Skip to content

Commit

Permalink
New Trait: Liquor Lifeline 🍺🩹 (DeltaV-Station#706)
Browse files Browse the repository at this point in the history
# Description

**Liquor Lifeline** 🍺 is a new trait (-3 points) that makes you slowly
heal Brute and Burn (except Caustic) damage when drunk, healing more the
drunker you are. Inspired by the SS13 /tg/station quirk called Drunken
Resilience.

Strength of Liquor Lifeline healing in terms of its Brute damage healed
per tick compared to Bicaridine:
- 0.1u to 0.5u Ethanol - 10% Bicaridine
- 0.5u to 7u Ethanol - 20% Bicaridine
- 7u to 11u Ethanol - 40% Bicaridine
- 11u to 15u Ethanol - 80% Bicaridine
- 15u+ Ethanol **(drunk poisoning starts)** - 120% Bicaridine

## Media

**Trait entry**


![image](https://github.com/user-attachments/assets/31e8cb3a-c5d5-4596-8934-4ad1256b4981)

# Changelog

:cl: Skubman
- add: Add Liquor Lifeline (-3 points), a new positive trait that makes
you slowly heal Brute and Burn damage when drunk, healing more the
drunker you are. The trait also gives you the benefits of Alcohol
Tolerance.
- tweak: The cost of the Alcohol Tolerance trait has been reduced from
-2 points to -1 point.
- add: Dwarves receive the Liquor Lifeline trait for free.

---------

Signed-off-by: Angelo Fallaria <[email protected]>
  • Loading branch information
angelofallars authored Aug 10, 2024
1 parent 07c8eba commit 6a12eab
Show file tree
Hide file tree
Showing 10 changed files with 175 additions and 23 deletions.
3 changes: 2 additions & 1 deletion Content.Server/Body/Components/MetabolizerComponent.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -44,7 +45,7 @@ public sealed partial class MetabolizerComponent : Component
/// List of metabolizer types that this organ is. ex. Human, Slime, Felinid, w/e.
/// </summary>
[DataField]
[Access(typeof(MetabolizerSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends
[Access(typeof(MetabolizerSystem), typeof(LiquorLifelineSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends
public HashSet<ProtoId<MetabolizerTypePrototype>>? MetabolizerTypes = null;

/// <summary>
Expand Down
11 changes: 11 additions & 0 deletions Content.Server/Traits/Assorted/LiquorLifelineComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Content.Shared.Damage;

namespace Content.Server.Traits.Assorted;

/// <summary>
/// This is used for the Liquor Lifeline trait.
/// </summary>
[RegisterComponent]
public sealed partial class LiquorLifelineComponent : Component
{
}
39 changes: 39 additions & 0 deletions Content.Server/Traits/Assorted/LiquorLifelineSystem.cs
Original file line number Diff line number Diff line change
@@ -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<LiquorLifelineComponent, ComponentInit>(OnSpawn);
}

private void OnSpawn(Entity<LiquorLifelineComponent> entity, ref ComponentInit args)
{
if (!TryComp<BodyComponent>(entity, out var body))
return;

if (!_bodySystem.TryGetBodyOrganComponents<MetabolizerComponent>(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");
}
}
}
}
9 changes: 8 additions & 1 deletion Resources/Locale/en-US/traits/traits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Body/Organs/dwarf.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- type: entity
- type: entity
id: OrganDwarfHeart
parent: OrganHumanHeart
name: dwarf heart
Expand All @@ -12,7 +12,7 @@
name: dwarf liver
components:
- type: Metabolizer
metabolizerTypes: [Dwarf]
metabolizerTypes: [Dwarf, LiquorLifeline]

- type: entity
id: OrganDwarfStomach
Expand Down
4 changes: 4 additions & 0 deletions Resources/Prototypes/Chemistry/metabolizer_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@
- type: metabolizerType
id: Vampiric
name: vampiric

- type: metabolizerType
id: LiquorLifeline
name: liquorlifeline
2 changes: 2 additions & 0 deletions Resources/Prototypes/Entities/Mobs/Species/dwarf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
understands:
- GalacticCommon
- SolCommon
- type: LightweightDrunk
boozeStrengthMultiplier: 0.5

- type: entity
parent: BaseSpeciesDummy
Expand Down
88 changes: 71 additions & 17 deletions Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 6 additions & 1 deletion Resources/Prototypes/Traits/inconveniences.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- type: trait
- type: trait
id: LightweightDrunk
category: Physical
requirements:
Expand All @@ -11,6 +11,11 @@
inverted: true
traits:
- HeavyweightDrunk
- LiquorLifeline
- !type:CharacterSpeciesRequirement
inverted: true
species:
- Dwarf
components:
- type: LightweightDrunk
boozeStrengthMultiplier: 2
Expand Down
31 changes: 30 additions & 1 deletion Resources/Prototypes/Traits/skills.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
- type: trait
id: HeavyweightDrunk
category: Physical
points: -2
points: -1
requirements:
- !type:CharacterJobRequirement
inverted: true
Expand All @@ -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

Expand Down

0 comments on commit 6a12eab

Please sign in to comment.