Files
tbd-station-14/Content.Shared/EntityEffects/Effects/Drunk.cs
Princess Cheeseballs 6b73d320b9 [NEW STATUS SYSTEM] Drunkenness, Stuttering, Slurred Speech, and Bloodloss (#38678)
* The only commit that matters

* I had to stop playing with my cat to push this change

* Yaml removal

* Proper drunk status effect and remove shitcode

* Review changes

* whoops

* Whoops x2

* Update master fix merge conflicts

* Fix merge conflicts

* Dunk Component kill

* MORE RELAYS

* Holy fucking breaking changes

* Ough

* 46 file diff

* Fix bad commits

* Erm what the test fail?

* Fix those last two

* Merge conflicts

* Me when I fix the merge conflicts

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
2025-08-18 16:26:29 -04:00

28 lines
958 B
C#

using Content.Shared.Drunk;
using Robust.Shared.Prototypes;
namespace Content.Shared.EntityEffects.Effects;
public sealed partial class Drunk : EntityEffect
{
/// <summary>
/// BoozePower is how long each metabolism cycle will make the drunk effect last for.
/// </summary>
[DataField]
public TimeSpan BoozePower = TimeSpan.FromSeconds(3f);
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("reagent-effect-guidebook-drunk", ("chance", Probability));
public override void Effect(EntityEffectBaseArgs args)
{
var boozePower = BoozePower;
if (args is EntityEffectReagentArgs reagentArgs)
boozePower *= reagentArgs.Scale.Float();
var drunkSys = args.EntityManager.EntitySysManager.GetEntitySystem<SharedDrunkSystem>();
drunkSys.TryApplyDrunkenness(args.TargetEntity, boozePower);
}
}