-
Notifications
You must be signed in to change notification settings - Fork 347
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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); | ||
} | ||
} |
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; | ||
} |
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; | ||
} |
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 |
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 |
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 | ||
|
||
- 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
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 |
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,9 @@ | |
|
||
- type: statusEffect | ||
id: SuppressPain | ||
|
||
- type: statusEffect | ||
id: Feminized | ||
|
||
- type: statusEffect | ||
id: Masculinized |
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 | ||
|
@@ -73,6 +73,12 @@ | |
{ | ||
"name": "pill17" | ||
}, | ||
{ | ||
"name": "pill22" | ||
}, | ||
{ | ||
"name": "pill23" | ||
}, | ||
Comment on lines
+76
to
+81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these sprites just look like horizontally scaled round sprites There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 descriptionThere was a problem hiding this comment.
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