diff --git a/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs b/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs index f22c208408..97e5fd3fc4 100644 --- a/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/ZombieRuleSystem.cs @@ -35,7 +35,7 @@ public sealed class ZombieRuleSystem : GameRuleSystem { base.Initialize(); - SubscribeLocalEvent(OnZombifySelf); + SubscribeLocalEvent(OnZombifySelf); } protected override void AppendRoundEndText(EntityUid uid, ZombieRuleComponent component, GameRuleComponent gameRule, @@ -128,7 +128,7 @@ public sealed class ZombieRuleSystem : GameRuleSystem component.NextRoundEndCheck = _timing.CurTime + component.EndCheckDelay; } - private void OnZombifySelf(EntityUid uid, PendingZombieComponent component, ZombifySelfActionEvent args) + private void OnZombifySelf(EntityUid uid, IncurableZombieComponent component, ZombifySelfActionEvent args) { _zombie.ZombifyEntity(uid); if (component.Action != null) diff --git a/Content.Server/Zombies/IncurableZombieComponent.cs b/Content.Server/Zombies/IncurableZombieComponent.cs index 2695865690..375b814b51 100644 --- a/Content.Server/Zombies/IncurableZombieComponent.cs +++ b/Content.Server/Zombies/IncurableZombieComponent.cs @@ -1,10 +1,16 @@ -namespace Content.Server.Zombies; +using Robust.Shared.Prototypes; + +namespace Content.Server.Zombies; /// -/// This is used for a zombie that cannot be cured by any methods. +/// This is used for a zombie that cannot be cured by any methods. Gives a succumb to zombie infection action. /// [RegisterComponent] public sealed partial class IncurableZombieComponent : Component { + [DataField] + public EntProtoId ZombifySelfActionPrototype = "ActionTurnUndead"; + [DataField] + public EntityUid? Action; } diff --git a/Content.Server/Zombies/PendingZombieComponent.cs b/Content.Server/Zombies/PendingZombieComponent.cs index 98eae74f06..811d3f9644 100644 --- a/Content.Server/Zombies/PendingZombieComponent.cs +++ b/Content.Server/Zombies/PendingZombieComponent.cs @@ -1,5 +1,4 @@ using Content.Shared.Damage; -using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Server.Zombies; @@ -48,9 +47,6 @@ public sealed partial class PendingZombieComponent : Component [DataField] public TimeSpan MaxInitialInfectedGrace = TimeSpan.FromMinutes(15f); - [DataField] - public EntProtoId ZombifySelfActionPrototype = "ActionTurnUndead"; - /// /// The chance each second that a warning will be shown. /// @@ -66,6 +62,4 @@ public sealed partial class PendingZombieComponent : Component "zombie-infection-warning", "zombie-infection-underway" }; - - [DataField] public EntityUid? Action; } diff --git a/Content.Server/Zombies/ZombieSystem.cs b/Content.Server/Zombies/ZombieSystem.cs index 09c8fa26db..552fd2781c 100644 --- a/Content.Server/Zombies/ZombieSystem.cs +++ b/Content.Server/Zombies/ZombieSystem.cs @@ -64,9 +64,16 @@ namespace Content.Server.Zombies SubscribeLocalEvent(OnPendingMapInit); + SubscribeLocalEvent(OnPendingMapInit); + SubscribeLocalEvent(OnDamageChanged); } + private void OnPendingMapInit(EntityUid uid, IncurableZombieComponent component, MapInitEvent args) + { + _actions.AddAction(uid, ref component.Action, component.ZombifySelfActionPrototype); + } + private void OnPendingMapInit(EntityUid uid, PendingZombieComponent component, MapInitEvent args) { if (_mobState.IsDead(uid)) @@ -77,7 +84,6 @@ namespace Content.Server.Zombies component.NextTick = _timing.CurTime + TimeSpan.FromSeconds(1f); component.GracePeriod = _random.Next(component.MinInitialInfectedGrace, component.MaxInitialInfectedGrace); - _actions.AddAction(uid, ref component.Action, component.ZombifySelfActionPrototype); } public override void Update(float frameTime)