Files
tbd-station-14/Content.Server/Chemistry/ReagentEffects/CureZombieInfection.cs
Nemanja d55cd23b0a Zombie Mode 𝓡𝓮𝓭𝓾𝔁 (#18199)
* zombie mode redux

* the great zombie changes

* fix this

* 65 down to 50

* empty

* Changes to address stalling

* make zombie nukies no longer nukies

* actually work
2023-07-25 15:31:35 -06:00

39 lines
1.2 KiB
C#

using Content.Shared.Chemistry.Reagent;
using Robust.Shared.Prototypes;
using Robust.Shared.Configuration;
using Content.Server.Zombies;
namespace Content.Server.Chemistry.ReagentEffects;
public sealed class CureZombieInfection : ReagentEffect
{
[DataField("innoculate")]
public bool Innoculate;
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
{
if(Innoculate)
return Loc.GetString("reagent-effect-guidebook-innoculate-zombie-infection", ("chance", Probability));
return Loc.GetString("reagent-effect-guidebook-cure-zombie-infection", ("chance", Probability));
}
// Removes the Zombie Infection Components
public override void Effect(ReagentEffectArgs args)
{
var entityManager = args.EntityManager;
if (entityManager.HasComponent<IncurableZombieComponent>(args.SolutionEntity))
return;
entityManager.RemoveComponent<ZombifyOnDeathComponent>(args.SolutionEntity);
entityManager.RemoveComponent<PendingZombieComponent>(args.SolutionEntity);
if (Innoculate)
{
entityManager.EnsureComponent<ZombieImmuneComponent>(args.SolutionEntity);
}
}
}