diff --git a/Content.Server/Body/Systems/MetabolizerSystem.cs b/Content.Server/Body/Systems/MetabolizerSystem.cs index 45cba5a195f..066bf0a1c5b 100644 --- a/Content.Server/Body/Systems/MetabolizerSystem.cs +++ b/Content.Server/Body/Systems/MetabolizerSystem.cs @@ -190,8 +190,11 @@ private void TryMetabolize(Entity= Min && quant <= Max; } diff --git a/Content.Server/Chemistry/ReagentEffects/Drunk.cs b/Content.Server/Chemistry/ReagentEffects/Drunk.cs index dbce995ca2e..6088db5787c 100644 --- a/Content.Server/Chemistry/ReagentEffects/Drunk.cs +++ b/Content.Server/Chemistry/ReagentEffects/Drunk.cs @@ -25,7 +25,7 @@ public override void Effect(ReagentEffectArgs args) { var boozePower = BoozePower; - boozePower *= args.Scale; + boozePower *= Math.Max(args.Scale, 1); var drunkSys = args.EntityManager.EntitySysManager.GetEntitySystem(); drunkSys.TryApplyDrunkenness(args.SolutionEntity, boozePower, SlurSpeech); diff --git a/Content.Shared/Traits/Assorted/Components/LightweightDrunkComponent.cs b/Content.Server/Traits/Assorted/LightweightDrunkComponent.cs similarity index 50% rename from Content.Shared/Traits/Assorted/Components/LightweightDrunkComponent.cs rename to Content.Server/Traits/Assorted/LightweightDrunkComponent.cs index 62d2f5899a4..4daff2e1338 100644 --- a/Content.Shared/Traits/Assorted/Components/LightweightDrunkComponent.cs +++ b/Content.Server/Traits/Assorted/LightweightDrunkComponent.cs @@ -1,13 +1,9 @@ -using Content.Shared.Drunk; -using Robust.Shared.GameStates; - namespace Content.Shared.Traits.Assorted.Components; /// -/// Used for the lightweight trait. DrunkSystem will check for this component and modify the boozePower accordingly if it finds it. +/// Used for the lightweight trait. LightweightDrunkSystem will multiply the effects of ethanol being metabolized /// -[RegisterComponent, NetworkedComponent] -[Access(typeof(SharedDrunkSystem))] +[RegisterComponent] public sealed partial class LightweightDrunkComponent : Component { [DataField("boozeStrengthMultiplier"), ViewVariables(VVAccess.ReadWrite)] diff --git a/Content.Server/Traits/Assorted/LightweightDrunkSystem.cs b/Content.Server/Traits/Assorted/LightweightDrunkSystem.cs new file mode 100644 index 00000000000..b5e9b877764 --- /dev/null +++ b/Content.Server/Traits/Assorted/LightweightDrunkSystem.cs @@ -0,0 +1,23 @@ +using Content.Server.Body.Components; +using Content.Server.Body.Systems; +using Content.Shared.Chemistry.Reagent; +using Content.Shared.Traits.Assorted.Components; + +namespace Content.Shared.Traits.Assorted.Systems; +public sealed class LightweightDrunkSystem : EntitySystem +{ + public override void Initialize() + { + SubscribeLocalEvent(OnTryMetabolizeReagent); + } + + private void OnTryMetabolizeReagent(EntityUid uid, LightweightDrunkComponent comp, ref TryMetabolizeReagent args) + { + Log.Debug(args.Prototype.ID); + if (args.Prototype.ID != "Ethanol") + return; + + args.Scale *= comp.BoozeStrengthMultiplier; + args.QuantityMultiplier *= comp.BoozeStrengthMultiplier; + } +} \ No newline at end of file diff --git a/Content.Shared/Chemistry/Reagent/ReagentEffect.cs b/Content.Shared/Chemistry/Reagent/ReagentEffect.cs index 5bcb21fedb3..41eea55cca4 100644 --- a/Content.Shared/Chemistry/Reagent/ReagentEffect.cs +++ b/Content.Shared/Chemistry/Reagent/ReagentEffect.cs @@ -107,6 +107,7 @@ public readonly record struct ReagentEffectArgs( FixedPoint2 Quantity, IEntityManager EntityManager, ReactionMethod? Method, - float Scale + float Scale = 1f, + float QuantityMultiplier = 1f ); } diff --git a/Content.Shared/Drunk/DrunkSystem.cs b/Content.Shared/Drunk/DrunkSystem.cs index 161d4729ede..ed022cae31b 100644 --- a/Content.Shared/Drunk/DrunkSystem.cs +++ b/Content.Shared/Drunk/DrunkSystem.cs @@ -18,9 +18,6 @@ public void TryApplyDrunkenness(EntityUid uid, float boozePower, bool applySlur if (!Resolve(uid, ref status, false)) return; - if (TryComp(uid, out var trait)) - boozePower *= trait.BoozeStrengthMultiplier; - if (applySlur) { _slurredSystem.DoSlur(uid, TimeSpan.FromSeconds(boozePower), status); diff --git a/Resources/Locale/en-US/traits/traits.ftl b/Resources/Locale/en-US/traits/traits.ftl index f6e3e0b1fc1..f8cef13ecd3 100644 --- a/Resources/Locale/en-US/traits/traits.ftl +++ b/Resources/Locale/en-US/traits/traits.ftl @@ -11,6 +11,9 @@ trait-description-Pacifist = You cannot attack or hurt any living beings. trait-name-LightweightDrunk = Lightweight Drunk trait-description-LightweightDrunk = Alcohol has a stronger effect on you +trait-name-HeavyweightDrunk = Heavyweight Drunk +trait-description-HeavyweightDrunk = Alcohols are afraid of you + trait-name-Muted = Muted trait-description-Muted = You can't speak diff --git a/Resources/Prototypes/Traits/inconveniences.yml b/Resources/Prototypes/Traits/inconveniences.yml index 8dc0264ffea..fee312593da 100644 --- a/Resources/Prototypes/Traits/inconveniences.yml +++ b/Resources/Prototypes/Traits/inconveniences.yml @@ -7,6 +7,10 @@ jobs: - Borg - MedicalBorg + - !type:CharacterTraitRequirement + inverted: true + traits: + - HeavyweightDrunk components: - type: LightweightDrunk boozeStrengthMultiplier: 2 diff --git a/Resources/Prototypes/Traits/skills.yml b/Resources/Prototypes/Traits/skills.yml index 6175834c1fc..988307f58e4 100644 --- a/Resources/Prototypes/Traits/skills.yml +++ b/Resources/Prototypes/Traits/skills.yml @@ -1,3 +1,21 @@ +- type: trait + id: HeavyweightDrunk + category: Physical + points: -2 + requirements: + - !type:CharacterJobRequirement + inverted: true + jobs: + - Borg + - MedicalBorg + - !type:CharacterTraitRequirement + inverted: true + traits: + - LightweightDrunk + components: + - type: LightweightDrunk + boozeStrengthMultiplier: 0.5 + - type: trait id: Thieving category: Physical