Files

35 lines
1.1 KiB
C#
Raw Permalink Normal View History

using Content.Server.Medical;
using Content.Shared.Chemistry.Reagent;
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.Chemistry.ReagentEffects
{
/// <summary>
/// Forces you to vomit.
/// </summary>
[UsedImplicitly]
public sealed partial class ChemVomit : ReagentEffect
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));
2022-05-23 19:03:27 -04:00
public override void Effect(ReagentEffectArgs args)
{
if (args.Scale != 1f)
return;
2022-05-23 19:03:27 -04:00
var vomitSys = args.EntityManager.EntitySysManager.GetEntitySystem<VomitSystem>();
vomitSys.Vomit(args.SolutionEntity, ThirstAmount, HungerAmount);
}
}
}