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

hormones change your sex #1267

Merged
merged 1 commit into from
Jan 11, 2025
Merged
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
49 changes: 49 additions & 0 deletions Content.Server/_DV/Medical/HormoneSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

using Content.Shared.Humanoid;
using Content.Shared._DV.Medical;
using Content.Shared._DV.Traits;

namespace Content.Server._DV.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);
}
}
25 changes: 25 additions & 0 deletions Content.Shared/_DV/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._DV.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/_DV/Traits/HormoneSensitive.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Content.Shared._DV.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
@@ -0,0 +1,2 @@
reagent-effect-status-effect-Feminized = feminization
reagent-effect-status-effect-Masculinized = masculinization
1 change: 1 addition & 0 deletions Resources/Locale/en-US/_DV/reagents/meta/physical-desc.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reagent-physical-desc-hormonal = hormonal
5 changes: 5 additions & 0 deletions Resources/Locale/en-US/_DV/traits/traits.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
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.
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 @@ -138,6 +138,8 @@
- RadiationProtection
- Drowsiness
- Adrenaline
- Feminized # DeltaV - Hormone system
- Masculinized # DeltaV - Hormone system
- type: Body
prototype: Human
requiredLegs: 2
Expand Down
17 changes: 17 additions & 0 deletions Resources/Prototypes/_DV/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
5 changes: 5 additions & 0 deletions Resources/Prototypes/_DV/status_effects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- type: statusEffect
id: Feminized

- type: statusEffect
id: Masculinized
37 changes: 32 additions & 5 deletions Resources/Prototypes/_Impstation/Reagents/fun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
conditions:
- !type:ReagentThreshold
min: 50

- type: reagent
id: PropulsionGel
name: reagent-name-propulsion-gel
Expand All @@ -95,20 +95,47 @@
tileReactions:
- !type:SpillTileReaction

# These two dont actually do anything, theyre just here for rp
# Thui beego pu suggestion.
- type: reagent
id: Estradiol
name: reagent-name-estradiol
group: Medicine # DeltaV
desc: reagent-desc-estradiol
physicalDesc: reagent-physical-desc-clear
physicalDesc: reagent-physical-desc-hormonal # DeltaV
color: "pink"

boilingPoint: 1573.0 # DeltaV
meltingPoint: 446.5 # DeltaV
metabolisms: # DeltaV
Medicine:
metabolismRate: 0.02
effects:
- !type:GenericStatusEffect
key: Feminized
component: Feminized
type: Add
time: 2
refresh: false

- type: reagent
id: Testosterone
name: reagent-name-testosterone
group: Medicine # DeltaV
desc: reagent-desc-testosterone
physicalDesc: reagent-physical-desc-chalky
physicalDesc: reagent-physical-desc-hormonal # DeltaV
flavor: bitter # DeltaV
color: "#267ef0"
boilingPoint: 1321.0 # DeltaV
meltingPoint: 424.1 # DeltaV
metabolisms: # DeltaV
Medicine:
metabolismRate: 0.02
effects:
- !type:GenericStatusEffect
key: Masculinized
component: Masculinized
type: Add
time: 2
refresh: false

- type: reagent
id: Holium
Expand Down
Loading