* 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>
28 lines
958 B
C#
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);
|
|
}
|
|
}
|