Remove Kitsune actions when they become Zombies (#5376)

* Remove Kitsune actions when they become Zombies

* Use EntityZombifiedEvent instead

* Yeah just use the Kitsune component
This commit is contained in:
BarryNorfolk 2026-05-03 15:20:06 +02:00 committed by GitHub
parent a56c4643ac
commit 6b2c306c18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 0 deletions

View File

@ -4,6 +4,7 @@ using Content.Shared.Charges.Systems;
using Content.Shared.Hands.Components;
using Content.Shared.Humanoid;
using Content.Shared.Popups;
using Content.Shared.Zombies;
namespace Content.Shared._DV.Abilities.Kitsune;
@ -23,6 +24,8 @@ public abstract class SharedKitsuneSystem : EntitySystem
SubscribeLocalEvent<FoxfireComponent, ComponentShutdown>(OnFoxfireShutdown);
SubscribeLocalEvent<KitsuneComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<KitsuneComponent, AppearanceLoadedEvent>(OnProfileLoadFinished);
SubscribeLocalEvent<KitsuneComponent, EntityZombifiedEvent>(OnKitsuneZombified);
}
private void OnProfileLoadFinished(Entity<KitsuneComponent> ent, ref AppearanceLoadedEvent args)
@ -58,6 +61,17 @@ public abstract class SharedKitsuneSystem : EntitySystem
ent.Comp.FoxfireAction = _actions.AddAction(ent, ent.Comp.FoxfireActionId);
}
/// <summary>
/// Handles when a Kitsune becomes a zombie, removing their abilities.
/// </summary>
/// <param name="kitsune">The Kitsune zombie that has just spawned.</param>
/// <param name="args">Args for the event.</param>
private void OnKitsuneZombified(Entity<KitsuneComponent> kitsune, ref EntityZombifiedEvent args)
{
_actions.RemoveAction(kitsune.Comp.KitsuneActionEntity);
_actions.RemoveAction(kitsune.Comp.FoxfireAction);
}
private void OnCreateFoxfire(Entity<KitsuneComponent> ent, ref CreateFoxfireActionEvent args)
{
// Kitsune fox can make fox fires from their mouth otherwise they need hands.