Explosion resistance is now predicted! (#30654)
* First commit * Added Network and access
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using Content.Shared.Explosion.Components;
|
||||
using Content.Shared.Armor;
|
||||
|
||||
namespace Content.Shared.Explosion.EntitySystems;
|
||||
|
||||
public abstract class SharedExplosionSystem : EntitySystem
|
||||
{
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<ExplosionResistanceComponent, ArmorExamineEvent>(OnArmorExamine);
|
||||
}
|
||||
|
||||
private void OnArmorExamine(EntityUid uid, ExplosionResistanceComponent component, ref ArmorExamineEvent args)
|
||||
{
|
||||
var value = MathF.Round((1f - component.DamageCoefficient) * 100, 1);
|
||||
|
||||
if (value == 0)
|
||||
return;
|
||||
|
||||
args.Msg.PushNewline();
|
||||
args.Msg.AddMarkupOrThrow(Loc.GetString(component.Examine, ("value", value)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user