Files

36 lines
1.2 KiB
C#
Raw Permalink Normal View History

using Content.Server.Medical;
using Content.Shared.EntityEffects;
2022-05-23 19:03:27 -04:00
using JetBrains.Annotations;
using Robust.Shared.Prototypes;
2022-05-23 19:03:27 -04:00
namespace Content.Server.EntityEffects.Effects
2022-05-23 19:03:27 -04:00
{
/// <summary>
/// Forces you to vomit.
/// </summary>
[UsedImplicitly]
public sealed partial class ChemVomit : EntityEffect
2022-05-23 19:03:27 -04:00
{
/// How many units of thirst to add each time we vomit
[DataField]
public float ThirstAmount = -8f;
2022-05-23 19:03:27 -04:00
/// How many units of hunger to add each time we vomit
[DataField]
public float HungerAmount = -8f;
2022-05-23 19:03:27 -04:00
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("reagent-effect-guidebook-chem-vomit", ("chance", Probability));
public override void Effect(EntityEffectBaseArgs args)
2022-05-23 19:03:27 -04:00
{
if (args is EntityEffectReagentArgs reagentArgs)
if (reagentArgs.Scale != 1f)
return;
2022-05-23 19:03:27 -04:00
var vomitSys = args.EntityManager.EntitySysManager.GetEntitySystem<VomitSystem>();
vomitSys.Vomit(args.TargetEntity, ThirstAmount, HungerAmount);
2022-05-23 19:03:27 -04:00
}
}
}