* Oh the possibilities * Merge fixes * Forgot to remote LavaSystem oops * Changed EntityEffectArgs to EntityEffectBaseArgs and EntityEffectReagentArgs * Throw exception for unimplemented effectargs * Remove Json and overrideable datafields * Fix test issues * Actually fix the compiling issue * Fix comments and remove EntityEffectArgs (no longer used, replaced with EntityEffectBaseArgs)
38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using Content.Server.Zombies;
|
|
using Content.Shared.EntityEffects;
|
|
using Robust.Shared.Prototypes;
|
|
using Content.Shared.Zombies;
|
|
|
|
namespace Content.Server.EntityEffects.Effects;
|
|
|
|
public sealed partial class CureZombieInfection : EntityEffect
|
|
{
|
|
[DataField]
|
|
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(EntityEffectBaseArgs args)
|
|
{
|
|
var entityManager = args.EntityManager;
|
|
if (entityManager.HasComponent<IncurableZombieComponent>(args.TargetEntity))
|
|
return;
|
|
|
|
entityManager.RemoveComponent<ZombifyOnDeathComponent>(args.TargetEntity);
|
|
entityManager.RemoveComponent<PendingZombieComponent>(args.TargetEntity);
|
|
|
|
if (Innoculate)
|
|
{
|
|
entityManager.EnsureComponent<ZombieImmuneComponent>(args.TargetEntity);
|
|
}
|
|
}
|
|
}
|
|
|