diff --git a/Content.Server/Body/Components/MetabolizerComponent.cs b/Content.Server/Body/Components/MetabolizerComponent.cs index 90c99df7db2..7fe7d23cf34 100644 --- a/Content.Server/Body/Components/MetabolizerComponent.cs +++ b/Content.Server/Body/Components/MetabolizerComponent.cs @@ -1,4 +1,5 @@ using Content.Server.Body.Systems; +using Content.Server.Traits.Assorted; using Content.Shared.Body.Prototypes; using Content.Shared.FixedPoint; using Robust.Shared.Prototypes; @@ -44,7 +45,7 @@ public sealed partial class MetabolizerComponent : Component /// List of metabolizer types that this organ is. ex. Human, Slime, Felinid, w/e. /// [DataField] - [Access(typeof(MetabolizerSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends + [Access(typeof(MetabolizerSystem), typeof(LiquorLifelineSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends public HashSet>? MetabolizerTypes = null; /// diff --git a/Content.Server/Traits/Assorted/LiquorLifelineComponent.cs b/Content.Server/Traits/Assorted/LiquorLifelineComponent.cs new file mode 100644 index 00000000000..124d0fa3d72 --- /dev/null +++ b/Content.Server/Traits/Assorted/LiquorLifelineComponent.cs @@ -0,0 +1,11 @@ +using Content.Shared.Damage; + +namespace Content.Server.Traits.Assorted; + +/// +/// This is used for the Liquor Lifeline trait. +/// +[RegisterComponent] +public sealed partial class LiquorLifelineComponent : Component +{ +} diff --git a/Content.Server/Traits/Assorted/LiquorLifelineSystem.cs b/Content.Server/Traits/Assorted/LiquorLifelineSystem.cs new file mode 100644 index 00000000000..49618548d3f --- /dev/null +++ b/Content.Server/Traits/Assorted/LiquorLifelineSystem.cs @@ -0,0 +1,39 @@ +using Content.Server.Body.Components; +using Content.Server.Body.Systems; +using Content.Shared.Body.Components; + +namespace Content.Server.Traits.Assorted; + +public sealed class LiquorLifelineSystem : EntitySystem +{ + [Dependency] private readonly BodySystem _bodySystem = default!; + + public override void Initialize() + { + base.Initialize(); + SubscribeLocalEvent(OnSpawn); + } + + private void OnSpawn(Entity entity, ref ComponentInit args) + { + if (!TryComp(entity, out var body)) + return; + + if (!_bodySystem.TryGetBodyOrganComponents(entity, out var metabolizers, body)) + return; + + foreach (var (metabolizer, _) in metabolizers) + { + if (metabolizer.MetabolizerTypes is null + || metabolizer.MetabolismGroups is null) + continue; + + foreach (var metabolismGroup in metabolizer.MetabolismGroups) + { + // Add the LiquorLifeline metabolizer type to the liver and equivalent organs. + if (metabolismGroup.Id == "Alcohol") + metabolizer.MetabolizerTypes.Add("LiquorLifeline"); + } + } + } +} diff --git a/Resources/Locale/en-US/traits/traits.ftl b/Resources/Locale/en-US/traits/traits.ftl index 16cae663009..ac4eb206c6e 100644 --- a/Resources/Locale/en-US/traits/traits.ftl +++ b/Resources/Locale/en-US/traits/traits.ftl @@ -18,7 +18,14 @@ trait-name-LightweightDrunk = Lightweight Drunk trait-description-LightweightDrunk = Alcohol has a stronger effect on you trait-name-HeavyweightDrunk = Alcohol Tolerance -trait-description-HeavyweightDrunk = Alcohol is afraid of you. +trait-description-HeavyweightDrunk = + Alcohol is afraid of you. + +trait-name-LiquorLifeline = Liquor Lifeline +trait-description-LiquorLifeline = + Forget the doctor — just hit the bar for your "ethanol prescription"! + While drunk, you slowly heal [color=red]Brute[/color], [color=orange]Heat[/color], [color=orange]Shock[/color], and [color=orange]Cold[/color] damage, scaling with how drunk you are. + You also gain the benefits of [color=lightblue]Alcohol Tolerance[/color]. trait-name-Muted = Muted trait-description-Muted = You can't speak diff --git a/Resources/Prototypes/Body/Organs/dwarf.yml b/Resources/Prototypes/Body/Organs/dwarf.yml index 8da0cb1666f..497bc190cd1 100644 --- a/Resources/Prototypes/Body/Organs/dwarf.yml +++ b/Resources/Prototypes/Body/Organs/dwarf.yml @@ -1,4 +1,4 @@ -- type: entity +- type: entity id: OrganDwarfHeart parent: OrganHumanHeart name: dwarf heart @@ -12,7 +12,7 @@ name: dwarf liver components: - type: Metabolizer - metabolizerTypes: [Dwarf] + metabolizerTypes: [Dwarf, LiquorLifeline] - type: entity id: OrganDwarfStomach diff --git a/Resources/Prototypes/Chemistry/metabolizer_types.yml b/Resources/Prototypes/Chemistry/metabolizer_types.yml index 4d48dab9925..316b8f02b53 100644 --- a/Resources/Prototypes/Chemistry/metabolizer_types.yml +++ b/Resources/Prototypes/Chemistry/metabolizer_types.yml @@ -48,3 +48,7 @@ - type: metabolizerType id: Vampiric name: vampiric + +- type: metabolizerType + id: LiquorLifeline + name: liquorlifeline diff --git a/Resources/Prototypes/Entities/Mobs/Species/dwarf.yml b/Resources/Prototypes/Entities/Mobs/Species/dwarf.yml index b38ea2634fd..055c6522ddc 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/dwarf.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/dwarf.yml @@ -58,6 +58,8 @@ understands: - GalacticCommon - SolCommon + - type: LightweightDrunk + boozeStrengthMultiplier: 0.5 - type: entity parent: BaseSpeciesDummy diff --git a/Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml b/Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml index 12f5a80185a..e31087c309e 100644 --- a/Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml +++ b/Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml @@ -164,41 +164,95 @@ conditions: - !type:ReagentThreshold min: 15 - - !type:OrganType - type: Dwarf - shouldHave: false damage: types: Poison: 1 - # dwarves take less toxin damage and heal a marginal amount of brute - - !type:HealthChange + - !type:ChemVomit + probability: 0.04 conditions: - !type:ReagentThreshold - min: 15 + reagent: Ethanol + min: 12 + # dwarves immune to vomiting from alcohol - !type:OrganType type: Dwarf - damage: + shouldHave: false + # Drunken Resilience + - !type:HealthChange + conditions: + - !type:OrganType + type: LiquorLifeline + - !type:ReagentThreshold + reagent: Ethanol + min: 0.10 + max: 0.49 + damage: # NOTE: all damage sets for LiquorLifeline are halved due to + groups: # LightweightDrunkComponent making ethanol half as potent + Brute: -0.4 types: - Poison: 0.2 + Heat: -0.13 + Shock: -0.13 + Cold: -0.13 - !type:HealthChange conditions: + - !type:OrganType + type: LiquorLifeline - !type:ReagentThreshold - min: 15 + reagent: Ethanol + min: 0.50 + max: 6.99 + damage: + groups: + Brute: -0.8 + types: + Heat: -0.26 + Shock: -0.26 + Cold: -0.26 + - !type:HealthChange + conditions: - !type:OrganType - type: Dwarf + type: LiquorLifeline + - !type:ReagentThreshold + reagent: Ethanol + min: 7.00 + max: 10.99 damage: groups: - Brute: -1 - - !type:ChemVomit - probability: 0.04 + Brute: -1.6 + types: + Heat: -0.53 + Shock: -0.53 + Cold: -0.53 + - !type:HealthChange conditions: + - !type:OrganType + type: LiquorLifeline - !type:ReagentThreshold reagent: Ethanol - min: 12 - # dwarves immune to vomiting from alcohol + min: 11 + max: 14.99 + damage: + groups: + Brute: -3.2 + types: + Heat: -1.06 + Shock: -1.06 + Cold: -1.06 + - !type:HealthChange + conditions: - !type:OrganType - type: Dwarf - shouldHave: false + type: LiquorLifeline + - !type:ReagentThreshold + reagent: Ethanol + min: 15 # Overdose threshold + damage: + groups: + Brute: -4.8 + Burn: -4.8 + types: + Heat: -1.60 + Shock: -1.60 + Cold: -1.60 - !type:Drunk boozePower: 2 diff --git a/Resources/Prototypes/Traits/inconveniences.yml b/Resources/Prototypes/Traits/inconveniences.yml index 2dcc30cd97c..5e1e4e4b3f8 100644 --- a/Resources/Prototypes/Traits/inconveniences.yml +++ b/Resources/Prototypes/Traits/inconveniences.yml @@ -1,4 +1,4 @@ -- type: trait +- type: trait id: LightweightDrunk category: Physical requirements: @@ -11,6 +11,11 @@ inverted: true traits: - HeavyweightDrunk + - LiquorLifeline + - !type:CharacterSpeciesRequirement + inverted: true + species: + - Dwarf components: - type: LightweightDrunk boozeStrengthMultiplier: 2 diff --git a/Resources/Prototypes/Traits/skills.yml b/Resources/Prototypes/Traits/skills.yml index 56a8549c933..40198b724ed 100644 --- a/Resources/Prototypes/Traits/skills.yml +++ b/Resources/Prototypes/Traits/skills.yml @@ -36,7 +36,7 @@ - type: trait id: HeavyweightDrunk category: Physical - points: -2 + points: -1 requirements: - !type:CharacterJobRequirement inverted: true @@ -47,7 +47,36 @@ inverted: true traits: - LightweightDrunk + - LiquorLifeline + - !type:CharacterSpeciesRequirement + inverted: true + species: + - Dwarf + components: + - type: LightweightDrunk + boozeStrengthMultiplier: 0.5 + +- type: trait + id: LiquorLifeline + category: Physical + points: -3 + requirements: + - !type:CharacterJobRequirement + inverted: true + jobs: + - Borg + - MedicalBorg + - !type:CharacterTraitRequirement + inverted: true + traits: + - LightweightDrunk + - HeavyweightDrunk + - !type:CharacterSpeciesRequirement + inverted: true + species: + - Dwarf components: + - type: LiquorLifeline - type: LightweightDrunk boozeStrengthMultiplier: 0.5