mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
26 lines
979 B
C#
26 lines
979 B
C#
using Content.Shared.Flash.Components;
|
|
using Content.Shared.Damage.Systems;
|
|
|
|
namespace Content.Shared.Flash;
|
|
|
|
public sealed partial class DamagedByFlashingSystem : EntitySystem
|
|
{
|
|
[Dependency] private DamageableSystem _damageable = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<DamagedByFlashingComponent, FlashAttemptEvent>(OnFlashAttempt);
|
|
}
|
|
|
|
// TODO: Attempt events should not be doing state changes. But using AfterFlashedEvent does not work because this entity cannot get the status effect.
|
|
// Best wait for Ed's status effect system rewrite.
|
|
private void OnFlashAttempt(Entity<DamagedByFlashingComponent> ent, ref FlashAttemptEvent args)
|
|
{
|
|
_damageable.ChangeDamage(ent.Owner, ent.Comp.FlashDamage);
|
|
|
|
// TODO: It would be more logical if different flashes had different power,
|
|
// and the damage would be inflicted depending on the strength of the flash.
|
|
}
|
|
}
|