This commit is contained in:
Jabak
2024-07-31 20:36:59 +03:00
parent ddb49508ea
commit 25ee6d15ce
7 changed files with 94 additions and 0 deletions

View File

@@ -19,9 +19,13 @@ using Robust.Shared.Physics.Components;
using Robust.Shared.Random;
using System.Numerics;
using Content.Server.IdentityManagement;
using Content.Shared._Amour.GrammarSystem;
using Content.Shared.IdentityManagement.Components;
using Content.Shared.Movement.Pulling.Components;
using Content.Shared.Movement.Pulling.Systems;
using Robust.Shared.Collections;
using Robust.Shared.Enums;
using Robust.Shared.GameObjects.Components.Localization;
using Robust.Shared.Map.Components;
namespace Content.Server.Implants;
@@ -41,6 +45,7 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem
[Dependency] private readonly EntityLookupSystem _lookupSystem = default!;
[Dependency] private readonly SharedMapSystem _mapSystem = default!;
[Dependency] private readonly IdentitySystem _identity = default!; // WD
[Dependency] private readonly GrammarSystem _grammar = default!; //Amour
private EntityQuery<PhysicsComponent> _physicsQuery;
private HashSet<Entity<MapGridComponent>> _targetGrids = [];
@@ -56,6 +61,7 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem
SubscribeLocalEvent<SubdermalImplantComponent, ActivateImplantEvent>(OnActivateImplantEvent);
SubscribeLocalEvent<SubdermalImplantComponent, UseScramImplantEvent>(OnScramImplant);
SubscribeLocalEvent<SubdermalImplantComponent, UseDnaScramblerImplantEvent>(OnDnaScramblerImplant);
SubscribeLocalEvent<SubdermalImplantComponent, UseGenderSwapImplantEvent>(OnGenderSwapImplant); //Amour
}
@@ -225,4 +231,42 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem
args.Handled = true;
QueueDel(uid);
}
//Amour Start
private void OnGenderSwapImplant(EntityUid uid, SubdermalImplantComponent component, UseGenderSwapImplantEvent args)
{
if (component.ImplantedEntity is not { } ent)
return;
if (TryComp<HumanoidAppearanceComponent>(ent, out var humanoid) && humanoid.Sex != Sex.Unsexed)
{
var newSex = humanoid.Sex;
if (humanoid.Sex == Sex.Male)
newSex = Sex.Female;
else
newSex = Sex.Male;
_humanoidAppearance.SetSex(ent, newSex);
}
if (TryComp<GrammarComponent>(ent, out var grammar) &&
(grammar.Gender != Gender.Neuter || grammar.Gender != Gender.Epicene))
{
var newGender = grammar.Gender;
if (grammar.Gender == Gender.Male)
newGender = Gender.Female;
else
newGender = Gender.Male;
_grammar.SetGender((ent, grammar), newGender);
if (HasComp<IdentityComponent>(ent))
_identity.QueueIdentityUpdate(ent);
}
args.Handled = true;
QueueDel(uid);
}
//Amour End
}

View File

@@ -89,3 +89,10 @@ public sealed partial class UseDnaScramblerImplantEvent : InstantActionEvent
{
}
//Amour
public sealed partial class UseGenderSwapImplantEvent : InstantActionEvent
{
}
//Amour

View File

@@ -358,3 +358,18 @@
itemIconStyle: NoItem
useDelay: 1 # emote spam
event: !type:ToggleActionEvent
#Amour
- type: entity
id: ActionActivateGenderSwapImplant
name: Swap Gender
description: Swaps your gender between male/female.
components:
- type: InstantAction
charges: 1
itemIconStyle: BigAction
priority: -20
icon:
sprite: Clothing/OuterClothing/Hardsuits/lingspacesuit.rsi
state: icon
event: !type:UseGenderSwapImplantEvent

View File

@@ -918,6 +918,7 @@
- Saw
- Hemostat
- ClothingEyesGlassesChemical
- GenderSwapImplanter #Amour
dynamicRecipes:
- HandheldCrewMonitor
- ChemicalPayload

View File

@@ -254,3 +254,11 @@
Steel: 600
Plastic: 300
#Amour
- type: latheRecipe
id: GenderSwapImplanter
result: GenderSwapImplanter
completetime: 1
materials:
Glass: 600
Steel: 600

View File

@@ -42,3 +42,12 @@
components:
- type: Implanter
implant: NeuroStabilizationImplant
#Amour
- type: entity
id: GenderSwapImplanter
name: gender swap implanter
parent: BaseImplantOnlyImplanter
components:
- type: Implanter
implant: GenderSwapImplant

View File

@@ -49,3 +49,13 @@
tags:
- NeuroStabilization
#Amour
- type: entity
parent: BaseSubdermalImplant
id: GenderSwapImplant
name: Gender Swap Implant
description: This swaps the users gender on activation.
noSpawn: true
components:
- type: SubdermalImplant
implantAction: ActionActivateGenderSwapImplant