2023-12-28 20:45:42 -07:00
|
|
|
using Content.Server.Medical;
|
2024-06-30 05:43:43 +02:00
|
|
|
using Content.Shared.EntityEffects;
|
2022-05-23 19:03:27 -04:00
|
|
|
using JetBrains.Annotations;
|
2023-06-04 16:45:02 -04:00
|
|
|
using Robust.Shared.Prototypes;
|
2022-05-23 19:03:27 -04:00
|
|
|
|
2024-06-30 05:43:43 +02:00
|
|
|
namespace Content.Server.EntityEffects.Effects
|
2022-05-23 19:03:27 -04:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Forces you to vomit.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[UsedImplicitly]
|
2024-06-30 05:43:43 +02:00
|
|
|
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
|
2023-12-29 04:47:43 -08:00
|
|
|
[DataField]
|
2023-11-05 21:16:56 -05:00
|
|
|
public float ThirstAmount = -8f;
|
2022-05-23 19:03:27 -04:00
|
|
|
/// How many units of hunger to add each time we vomit
|
2023-12-29 04:47:43 -08:00
|
|
|
[DataField]
|
2023-11-05 21:16:56 -05:00
|
|
|
public float HungerAmount = -8f;
|
2022-05-23 19:03:27 -04:00
|
|
|
|
2023-06-04 16:45:02 -04:00
|
|
|
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
|
|
|
|
=> Loc.GetString("reagent-effect-guidebook-chem-vomit", ("chance", Probability));
|
|
|
|
|
|
2024-06-30 05:43:43 +02:00
|
|
|
public override void Effect(EntityEffectBaseArgs args)
|
2022-05-23 19:03:27 -04:00
|
|
|
{
|
2024-06-30 05:43:43 +02:00
|
|
|
if (args is EntityEffectReagentArgs reagentArgs)
|
|
|
|
|
if (reagentArgs.Scale != 1f)
|
|
|
|
|
return;
|
2022-12-21 09:51:49 -05:00
|
|
|
|
2022-05-23 19:03:27 -04:00
|
|
|
var vomitSys = args.EntityManager.EntitySysManager.GetEntitySystem<VomitSystem>();
|
|
|
|
|
|
2024-06-30 05:43:43 +02:00
|
|
|
vomitSys.Vomit(args.TargetEntity, ThirstAmount, HungerAmount);
|
2022-05-23 19:03:27 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|