Zombies keep their anomalies on zombification (#33867)
* Zombies keep their anomalies on zombification * Refactor anombies to isolate anomalies and zombies InnerBodyAnomalies now send an event when the host dies. Zombies cancels this event if the host is turning into a zombie. * Anomazombies: deprecate CancellableEntityEventArgs CancellableEntityEventArgs is deprecated. Use structs with bool Cancelled instead.
This commit is contained in:
committed by
GitHub
parent
67e5cc2104
commit
8f2d16aabf
@@ -5,6 +5,7 @@ using Content.Server.Chat;
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Server.Emoting.Systems;
|
||||
using Content.Server.Speech.EntitySystems;
|
||||
using Content.Shared.Anomaly.Components;
|
||||
using Content.Shared.Bed.Sleep;
|
||||
using Content.Shared.Cloning;
|
||||
using Content.Shared.Damage;
|
||||
@@ -64,10 +65,19 @@ namespace Content.Server.Zombies
|
||||
SubscribeLocalEvent<ZombieComponent, GetCharactedDeadIcEvent>(OnGetCharacterDeadIC);
|
||||
|
||||
SubscribeLocalEvent<PendingZombieComponent, MapInitEvent>(OnPendingMapInit);
|
||||
SubscribeLocalEvent<PendingZombieComponent, BeforeRemoveAnomalyOnDeathEvent>(OnBeforeRemoveAnomalyOnDeath);
|
||||
|
||||
SubscribeLocalEvent<IncurableZombieComponent, MapInitEvent>(OnPendingMapInit);
|
||||
|
||||
SubscribeLocalEvent<ZombifyOnDeathComponent, MobStateChangedEvent>(OnDamageChanged);
|
||||
|
||||
}
|
||||
|
||||
private void OnBeforeRemoveAnomalyOnDeath(Entity<PendingZombieComponent> ent, ref BeforeRemoveAnomalyOnDeathEvent args)
|
||||
{
|
||||
// Pending zombies (e.g. infected non-zombies) do not remove their hosted anomaly on death.
|
||||
// Current zombies DO remove the anomaly on death.
|
||||
args.Cancelled = true;
|
||||
}
|
||||
|
||||
private void OnPendingMapInit(EntityUid uid, IncurableZombieComponent component, MapInitEvent args)
|
||||
|
||||
Reference in New Issue
Block a user