Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hormone replacement therapy #2275

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ public ChemMasterWindow()
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);

// Pill type selection buttons, in total there are 20 pills.
// Pill type selection buttons, in total there are 23 pills.
// Pill rsi file should have states named as pill1, pill2, and so on.
var resourcePath = new ResPath(PillsRsiPath);
var pillTypeGroup = new ButtonGroup();
PillTypeButtons = new Button[20];
PillTypeButtons = new Button[23];
for (uint i = 0; i < PillTypeButtons.Length; i++)
{
// For every button decide which stylebase to have
Expand Down
48 changes: 48 additions & 0 deletions Content.Server/DeltaV/Medical/HormoneSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using Content.Shared.Humanoid;
using Content.Shared.DeltaV.Medical;
using Content.Shared.DeltaV.Traits;

namespace Content.Server.DeltaV.Medical;

/// <summary>
/// System to handle hormonal effects
/// </summary>
public sealed class HormoneSystem : EntitySystem
{
[Dependency] private readonly SharedHumanoidAppearanceSystem _humanoidSystem = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<FeminizedComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<FeminizedComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<MasculinizedComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<MasculinizedComponent, ComponentShutdown>(OnShutdown);
}

private void OnInit(EntityUid uid, IHormoneComponent component, ComponentInit args)
{
HumanoidAppearanceComponent? humanoid = null;

if (!Resolve(uid, ref humanoid) || humanoid == null || humanoid.Sex == component.Target) {
return;
}

if (TryComp<HormoneSensitiveComponent>(uid, out var trait) && trait.Target == component.Target) {
component.Original = humanoid.Sex;
_humanoidSystem.SetSex(uid, component.Target);
}
}

private void OnShutdown(EntityUid uid, IHormoneComponent component, ComponentShutdown args)
{
HumanoidAppearanceComponent? humanoid = null;

if (!Resolve(uid, ref humanoid) || humanoid == null || component.Original == null) {
return;
}

_humanoidSystem.SetSex(uid, component.Original.Value);
}
}
2 changes: 1 addition & 1 deletion Content.Shared/Chemistry/SharedChemMaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Content.Shared.Chemistry
/// </summary>
public sealed class SharedChemMaster
{
public const uint PillTypes = 20;
public const uint PillTypes = 23;
public const string BufferSolutionName = "buffer";
public const string InputSlotName = "beakerSlot";
public const string OutputSlotName = "outputSlot";
Expand Down
25 changes: 25 additions & 0 deletions Content.Shared/DeltaV/Medical/HormoneComponents.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Robust.Shared.GameStates;
using Content.Shared.Humanoid;

namespace Content.Shared.DeltaV.Medical;

public interface IHormoneComponent {
Sex Target { get; }
Sex? Original { get; set; }
}

[RegisterComponent, NetworkedComponent]
public sealed partial class MasculinizedComponent : Component, IHormoneComponent {
public Sex Target => Sex.Male;

[DataField("original")]
public Sex? Original { get; set; } = null;
}

[RegisterComponent, NetworkedComponent]
public sealed partial class FeminizedComponent : Component, IHormoneComponent {
public Sex Target => Sex.Female;

[DataField("original")]
public Sex? Original { get; set; } = null;
}
12 changes: 12 additions & 0 deletions Content.Shared/DeltaV/Traits/HormoneSensitive.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Content.Shared.DeltaV.Traits;
using Content.Shared.Humanoid;

/// <summary>
/// This is used for the hormone sensitivty traits.
/// </summary>
[RegisterComponent]
public sealed partial class HormoneSensitiveComponent : Component
{
[DataField(required: true)]
public Sex Target;
}
2 changes: 1 addition & 1 deletion Resources/Locale/en-US/_CD/reagents/meta/medicine.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ reagent-name-soretizone = Soretizone
reagent-desc-soretizone = A fairly effective painkiller developed to treat chronic pain. It works for cases that Stubantazine won't solve. Overdoses will knock you right out. High doses may cause addiction. Does not conflict with reasonable amounts of alcohol.

reagent-name-agonolexyne = Agonolexyne
reagent-desc-agonolexyne = An incredibly potent and fast acting opioid invented to speed up the application of painkillers during surgery. Stops you from feeling pain (or really anything at all). Interacts poorly with alcohol. Known to be very addictive. Overdose may relax the lungs to the point of non-function.
reagent-desc-agonolexyne = An incredibly potent and fast acting opioid invented to speed up the application of painkillers during surgery. Stops you from feeling pain (or really anything at all). Interacts poorly with alcohol. Known to be very addictive. Overdose may relax the lungs to the point of non-function.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
reagent-physical-desc-bending = light bending
reagent-physical-desc-bending = light bending
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
reagent-effect-status-effect-PsionicallyInsulated = psionic insulation
reagent-effect-status-effect-PsionicsDisabled = inability to use psionic powers
reagent-effect-status-effect-Feminized = feminization
reagent-effect-status-effect-Masculinized = masculinization
8 changes: 8 additions & 0 deletions Resources/Locale/en-US/deltav/reagents/medicine.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
reagent-name-hormonium = hormonium
reagent-desc-hormonium = An efficient precursor to hormonal medicines developed by Nanotrasen. Taken alone, it results in hallucinations.

reagent-name-testosterone = testosterone
reagent-desc-testosterone = A hormonal medicine that results in masculinization. This formulation was developed by Nanotrasen to be easy to produce, but the results are temporary.

reagent-name-estradiol = estradiol
reagent-desc-estradiol = A hormonal medicine that results in feminization. This formulation was developed by Nanotrasen to be easy to produce, but the results are temporary.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reagent-physical-desc-hormonal = hormonal
6 changes: 6 additions & 0 deletions Resources/Locale/en-US/deltav/traits/traits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ trait-inpain-desc = You’re constantly in discomfort. You need painkillers to f

trait-addicted-name = Addicted
trait-addicted-desc = You crave the substance, and your thoughts keep drifting back to it. Without it, you feel incomplete, anxious, and on edge.

trait-estradiol-sensitive-name = Estradiol sensitive
trait-estradiol-sensitive-desc = Your body is capable of taking on Nanotrasen's special feminization medicines.

trait-testosterone-sensitive-name = Testosterone sensitive
trait-testosterone-sensitive-desc = Your body is capable of taking on Nanotrasen's special masculinization medicines.
63 changes: 63 additions & 0 deletions Resources/Prototypes/DeltaV/Reagents/medicine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
- type: reagent
id: Testosterone
name: reagent-name-testosterone
group: Medicine
desc: reagent-desc-testosterone
physicalDesc: reagent-physical-desc-hormonal
flavor: bitter
color: "#eb692d"
boilingPoint: 1321.0
meltingPoint: 424.1
metabolisms:
Medicine:
metabolismRate: 0.02
effects:
- !type:GenericStatusEffect
key: Masculinized
component: Masculinized
type: Add
time: 2
refresh: false
Comment on lines +15 to +20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make an effect to add HormoneComponent with a target sex
then just

- !type:HormoneEffect
  target: Male

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you wanting me to implement the temporary status effect logic myself for these components? AFAICT the GenericStatusEffect component only takes a single key and not a full component description

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes reimplement it

ideally generic status effect would use a ComponentRegistry but oh well


- type: reagent
id: Estradiol
name: reagent-name-estradiol
group: Medicine
desc: reagent-desc-estradiol
physicalDesc: reagent-physical-desc-hormonal
flavor: bitter
color: "#65b4b1"
boilingPoint: 1573.0
meltingPoint: 446.5
metabolisms:
Medicine:
metabolismRate: 0.02
effects:
- !type:GenericStatusEffect
key: Feminized
component: Feminized
type: Add
time: 2
refresh: false
Comment on lines +36 to +41
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

above but Female


- type: reagent
id: Hormonium
name: reagent-name-hormonium
group: Medicine
desc: reagent-desc-hormonium
physicalDesc: reagent-physical-desc-hormonal
flavor: bitter
color: "#f9c3f9"
boilingPoint: 937.0
meltingPoint: 420.0
metabolisms:
Medicine:
metabolismRate: 1
effects:
- !type:GenericStatusEffect
conditions:
key: SeeingRainbows
component: SeeingRainbows
type: Add
time: 1.1
refresh: false
34 changes: 34 additions & 0 deletions Resources/Prototypes/DeltaV/Recipes/Reactions/medicine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
- type: reaction
id: Testosterone
reactants:
Oil:
amount: 1
Hormonium:
amount: 1
Mercury:
amount: 1
products:
Testosterone: 3

- type: reaction
id: Estradiol
reactants:
Oil:
amount: 1
Hormonium:
amount: 1
Radium:
amount: 1
products:
Estradiol: 3

- type: reaction
id: TestosteroneEstradiol
impact: Medium
reactants:
Testosterone:
amount: 1
Estradiol:
amount: 1
products:
Hormonium: 1
17 changes: 17 additions & 0 deletions Resources/Prototypes/DeltaV/Traits/hormone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- type: trait
id: EstradiolSensitive
name: trait-estradiol-sensitive-name
description: trait-estradiol-sensitive-desc
category: Quirks
components:
- type: HormoneSensitive
target: Female

- type: trait
id: TestosteroneSensitive
name: trait-testosterone-sensitive-name
description: trait-testosterone-sensitive-desc
category: Quirks
components:
- type: HormoneSensitive
target: Male
6 changes: 6 additions & 0 deletions Resources/Prototypes/DeltaV/status_effects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@

- type: statusEffect
id: SuppressPain

- type: statusEffect
id: Feminized

- type: statusEffect
id: Masculinized
10 changes: 10 additions & 0 deletions Resources/Prototypes/Entities/Clothing/Neck/cloaks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,16 @@
components:
- type: Sprite
sprite: Clothing/Neck/Cloaks/trans.rsi
# Begin DeltaV Additions - trans cloaks can be ground into hormonium
- type: SolutionContainerManager
solutions:
hormone:
reagents:
- ReagentId: Hormonium
Quantity: 25
- type: Extractable
grindableSolutionName: hormone
# End DeltaV Additions

- type: entity
parent: ClothingNeckBase
Expand Down
10 changes: 10 additions & 0 deletions Resources/Prototypes/Entities/Clothing/Neck/pins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@
state: trans
- type: Clothing
equippedPrefix: trans
# Begin DeltaV Additions - trans pins can be ground into hormonium
- type: SolutionContainerManager
solutions:
hormone:
reagents:
- ReagentId: Hormonium
Quantity: 15
- type: Extractable
grindableSolutionName: hormone
# End DeltaV Additions

- type: entity
parent: ClothingNeckPinBase
Expand Down
2 changes: 2 additions & 0 deletions Resources/Prototypes/Entities/Mobs/Species/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@
- SuppressAddiction # DeltaV - Psych med addictions system
- InPain # DeltaV - Pain system
- SuppressPain # DeltaV - Pain system
- Feminized # DeltaV - Hormone system
- Masculinized # DeltaV - Hormone system
- type: Body
prototype: Human
requiredLegs: 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from cev-eris at https://github.com/discordia-space/CEV-Eris/blob/2b969adc2dfd3e9621bf3597c5cbffeb3ac8c9f0/icons/obj/chemical.dmi",
"copyright": "Pills φ through 21 are taken from cev-eris at https://github.com/discordia-space/CEV-Eris/blob/2b969adc2dfd3e9621bf3597c5cbffeb3ac8c9f0/icons/obj/chemical.dmi; pills 22 and 23 are copyright 2024 Janet Blackquill <[email protected]>",
"size": {
"x": 32,
"y": 32
Expand Down Expand Up @@ -73,6 +73,12 @@
{
"name": "pill17"
},
{
"name": "pill22"
},
{
"name": "pill23"
},
Comment on lines +76 to +81
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these sprites just look like horizontally scaled round sprites

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea i get that for the sprite 23 because it doesn't have a real world analogue, but sprite 22 will read as an estradiol pill to most people that know what they look like

i could probably drop the 23rd sprite?

{
"name": "inhand-left",
"directions": 4
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading