using Content.Shared.Mobs.Components;
using Content.Shared.Zombies;
using Robust.Shared.Prototypes;
namespace Content.Shared.EntityEffects.Effects;
///
/// Causes the zombie infection on this entity.
///
///
public sealed partial class CauseZombieInfectionEntityEffectsSystem : EntityEffectSystem
{
// MobState because you have to die to become a zombie...
protected override void Effect(Entity entity, ref EntityEffectEvent args)
{
if (HasComp(entity) || HasComp(entity))
return;
EnsureComp(entity);
EnsureComp(entity);
}
}
///
/// Cures the Zombie infection on this entity and optionally inoculates them against future infection.
///
///
public sealed partial class CureZombieInfectionEntityEffectsSystem : EntityEffectSystem
{
// MobState because you have to die to become a zombie...
protected override void Effect(Entity entity, ref EntityEffectEvent args)
{
if (HasComp(entity))
return;
RemComp(entity);
RemComp(entity);
if (args.Effect.Innoculate)
EnsureComp(entity);
}
}
///
public sealed partial class CauseZombieInfection : EntityEffectBase
{
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("entity-effect-guidebook-cause-zombie-infection", ("chance", Probability));
}
///
public sealed partial class CureZombieInfection : EntityEffectBase
{
///
/// Do we also protect against future infections?
///
[DataField]
public bool Innoculate;
public override string EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
{
if (Innoculate)
return Loc.GetString("entity-effect-guidebook-innoculate-zombie-infection", ("chance", Probability));
return Loc.GetString("entity-effect-guidebook-cure-zombie-infection", ("chance", Probability));
}
}