Files
wwdpublic/Content.Server/Body/Components/MetabolizerComponent.cs
Angelo Fallaria 6a12eabbaa New Trait: Liquor Lifeline 🍺🩹 (#706)
# 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

🆑 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 <ba.fallaria@gmail.com>
2024-08-10 16:59:22 -04:00

87 lines
3.2 KiB
C#

using Content.Server.Body.Systems;
using Content.Server.Traits.Assorted;
using Content.Shared.Body.Prototypes;
using Content.Shared.FixedPoint;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.Body.Components
{
/// <summary>
/// Handles metabolizing various reagents with given effects.
/// </summary>
[RegisterComponent, Access(typeof(MetabolizerSystem))]
public sealed partial class MetabolizerComponent : Component
{
/// <summary>
/// The next time that reagents will be metabolized.
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
public TimeSpan NextUpdate;
/// <summary>
/// How often to metabolize reagents.
/// </summary>
/// <returns></returns>
[DataField]
public TimeSpan UpdateInterval = TimeSpan.FromSeconds(1);
/// <summary>
/// From which solution will this metabolizer attempt to metabolize chemicals
/// </summary>
[DataField("solution")]
public string SolutionName = BloodstreamComponent.DefaultChemicalsSolutionName;
/// <summary>
/// Does this component use a solution on it's parent entity (the body) or itself
/// </summary>
/// <remarks>
/// Most things will use the parent entity (bloodstream).
/// </remarks>
[DataField]
public bool SolutionOnBody = true;
/// <summary>
/// List of metabolizer types that this organ is. ex. Human, Slime, Felinid, w/e.
/// </summary>
[DataField]
[Access(typeof(MetabolizerSystem), typeof(LiquorLifelineSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends
public HashSet<ProtoId<MetabolizerTypePrototype>>? MetabolizerTypes = null;
/// <summary>
/// Should this metabolizer remove chemicals that have no metabolisms defined?
/// As a stop-gap, basically.
/// </summary>
[DataField]
public bool RemoveEmpty = false;
/// <summary>
/// How many reagents can this metabolizer process at once?
/// Used to nerf 'stacked poisons' where having 5+ different poisons in a syringe, even at low
/// quantity, would be muuuuch better than just one poison acting.
/// </summary>
[DataField("maxReagents")]
public int MaxReagentsProcessable = 3;
/// <summary>
/// A list of metabolism groups that this metabolizer will act on, in order of precedence.
/// </summary>
[DataField("groups")]
public List<MetabolismGroupEntry>? MetabolismGroups = default!;
}
/// <summary>
/// Contains data about how a metabolizer will metabolize a single group.
/// This allows metabolizers to remove certain groups much faster, or not at all.
/// </summary>
[DataDefinition]
public sealed partial class MetabolismGroupEntry
{
[DataField(required: true)]
public ProtoId<MetabolismGroupPrototype> Id = default!;
[DataField("rateModifier")]
public FixedPoint2 MetabolismRateModifier = 1.0;
}
}