From: Verm <32827189+Vermidia@users.noreply.github.com>
Date: Sat, 1 Jun 2024 04:51:07 +0000 (-0500)
Subject: Randomizes more humanoid appearances (#27997)
X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=a9a65b7e0d21b246498c32fd822ca36517e06355;p=space-station-14.git
Randomizes more humanoid appearances (#27997)
---
diff --git a/Content.Server/Humanoid/Components/RandomHumanoidAppearanceComponent.cs b/Content.Server/Humanoid/Components/RandomHumanoidAppearanceComponent.cs
index 5a0f6fcef1..5efea024f4 100644
--- a/Content.Server/Humanoid/Components/RandomHumanoidAppearanceComponent.cs
+++ b/Content.Server/Humanoid/Components/RandomHumanoidAppearanceComponent.cs
@@ -1,4 +1,4 @@
-using Content.Shared.Humanoid.Prototypes;
+using Content.Shared.Humanoid.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
namespace Content.Server.CharacterAppearance.Components;
@@ -7,4 +7,8 @@ namespace Content.Server.CharacterAppearance.Components;
public sealed partial class RandomHumanoidAppearanceComponent : Component
{
[DataField("randomizeName")] public bool RandomizeName = true;
+ ///
+ /// After randomizing, sets the hair style to this, if possible
+ ///
+ [DataField] public string? Hair = null;
}
diff --git a/Content.Server/Humanoid/Systems/RandomHumanoidAppearanceSystem.cs b/Content.Server/Humanoid/Systems/RandomHumanoidAppearanceSystem.cs
index 9185fedc38..2822fb69e1 100644
--- a/Content.Server/Humanoid/Systems/RandomHumanoidAppearanceSystem.cs
+++ b/Content.Server/Humanoid/Systems/RandomHumanoidAppearanceSystem.cs
@@ -25,6 +25,9 @@ public sealed class RandomHumanoidAppearanceSystem : EntitySystem
}
var profile = HumanoidCharacterProfile.RandomWithSpecies(humanoid.Species);
+ //If we have a specified hair style, change it to this
+ if(component.Hair != null)
+ profile = profile.WithCharacterAppearance(profile.Appearance.WithHairStyleName(component.Hair));
_humanoid.LoadProfile(uid, profile, humanoid);
diff --git a/Content.Shared/Humanoid/Prototypes/RandomHumanoidSettingsPrototype.cs b/Content.Shared/Humanoid/Prototypes/RandomHumanoidSettingsPrototype.cs
index ec6818221a..a97c3134be 100644
--- a/Content.Shared/Humanoid/Prototypes/RandomHumanoidSettingsPrototype.cs
+++ b/Content.Shared/Humanoid/Prototypes/RandomHumanoidSettingsPrototype.cs
@@ -15,6 +15,7 @@ public sealed partial class RandomHumanoidSettingsPrototype : IPrototype, IInher
public string[]? Parents { get; }
[AbstractDataField]
+ [NeverPushInheritance]
public bool Abstract { get; }
///
@@ -32,6 +33,7 @@ public sealed partial class RandomHumanoidSettingsPrototype : IPrototype, IInher
///
/// Extra components to add to this entity.
///
- [DataField("components")]
+ [DataField]
+ [AlwaysPushInheritance]
public ComponentRegistry? Components { get; private set; }
}
diff --git a/Resources/Prototypes/Entities/Mobs/Player/human.yml b/Resources/Prototypes/Entities/Mobs/Player/human.yml
index 2c7ad4972c..629ba91518 100644
--- a/Resources/Prototypes/Entities/Mobs/Player/human.yml
+++ b/Resources/Prototypes/Entities/Mobs/Player/human.yml
@@ -11,6 +11,9 @@
name: syndicate agent
suffix: Human, Base
components:
+ - type: RandomHumanoidAppearance
+ randomizeName: false
+ hair: HairBald
- type: Loadout
prototypes: [SyndicateOperativeGearExtremelyBasic]
- type: RandomMetadata
diff --git a/Resources/Prototypes/Entities/Mobs/Player/humanoid.yml b/Resources/Prototypes/Entities/Mobs/Player/humanoid.yml
index c5805f0ed9..e365ee3a1c 100644
--- a/Resources/Prototypes/Entities/Mobs/Player/humanoid.yml
+++ b/Resources/Prototypes/Entities/Mobs/Player/humanoid.yml
@@ -1,4 +1,18 @@
-# Random humanoids
+## Random humanoids
+
+- type: randomHumanoidSettings
+ id: EventHumanoid
+ components:
+ - type: RandomHumanoidAppearance
+ randomizeName: false
+ - type: GhostTakeoverAvailable
+
+- type: randomHumanoidSettings
+ id: EventHumanoidMindShielded
+ parent: EventHumanoid
+ components:
+ - type: MindShield
+ - type: InitialInfectedExempt
## Death Squad
@@ -20,22 +34,20 @@
- type: randomHumanoidSettings
id: DeathSquad
+ parent: EventHumanoidMindShielded
randomizeName: false
- components:
- - type: MindShield
+ components:
- type: GhostRole
name: ghost-role-information-Death-Squad-name
description: ghost-role-information-Death-Squad-description
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ DeathSquadGear ]
- type: RandomMetadata
nameSegments:
- NamesFirstMilitaryLeader
- NamesLastMilitary
- - type: InitialInfectedExempt
## ERT Leader
@@ -58,22 +70,20 @@
- type: randomHumanoidSettings
id: ERTLeader
+ parent: EventHumanoidMindShielded
randomizeName: false
components:
- - type: MindShield
- type: GhostRole
name: ghost-role-information-ert-leader-name
description: ghost-role-information-ert-leader-description
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ ERTLeaderGear ]
- type: RandomMetadata
nameSegments:
- NamesFirstMilitaryLeader
- NamesLastMilitary
- - type: InitialInfectedExempt
- type: entity
id: RandomHumanoidSpawnerERTLeaderEVA
@@ -92,16 +102,13 @@
id: ERTLeaderEVA
parent: ERTLeader
components:
- - type: MindShield
- type: GhostRole
name: ghost-role-information-ert-leader-name
description: ghost-role-information-ert-leader-description
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ ERTLeaderGearEVA ]
- - type: InitialInfectedExempt
- type: entity
id: RandomHumanoidSpawnerERTLeaderEVALecter
@@ -116,16 +123,13 @@
id: ERTLeaderEVALecter
parent: ERTLeaderEVA
components:
- - type: MindShield
- type: GhostRole
name: ghost-role-information-ert-leader-name
description: ghost-role-information-ert-leader-description
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ ERTLeaderGearEVALecter ]
- - type: InitialInfectedExempt
## ERT Chaplain
@@ -149,20 +153,17 @@
id: ERTChaplain
parent: ERTLeader
components:
- - type: MindShield
- type: GhostRole
name: ghost-role-information-ert-chaplain-name
description: ghost-role-information-ert-chaplain-description
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: RandomMetadata
nameSegments:
- NamesFirstMilitary
- NamesLastMilitary
- type: Loadout
prototypes: [ ERTChaplainGear ]
- - type: InitialInfectedExempt
- type: entity
id: RandomHumanoidSpawnerERTChaplainEVA
@@ -180,16 +181,13 @@
id: ERTChaplainEVA
parent: ERTChaplain
components:
- - type: MindShield
- type: GhostRole
name: ghost-role-information-ert-chaplain-name
description: ghost-role-information-ert-chaplain-description
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ ERTChaplainGearEVA ]
- - type: InitialInfectedExempt
## ERT Janitor
@@ -213,20 +211,17 @@
id: ERTJanitor
parent: ERTLeader
components:
- - type: MindShield
- type: GhostRole
name: ghost-role-information-ert-janitor-name
description: ghost-role-information-ert-janitor-description
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: RandomMetadata
nameSegments:
- NamesFirstMilitary
- NamesLastMilitary
- type: Loadout
prototypes: [ ERTJanitorGear ]
- - type: InitialInfectedExempt
- type: entity
id: RandomHumanoidSpawnerERTJanitorEVA
@@ -244,16 +239,13 @@
id: ERTJanitorEVA
parent: ERTJanitor
components:
- - type: MindShield
- type: GhostRole
name: ghost-role-information-ert-janitor-name
description: ghost-role-information-ert-janitor-description
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ ERTJanitorGearEVA ]
- - type: InitialInfectedExempt
## ERT Engineer
@@ -277,20 +269,17 @@
id: ERTEngineer
parent: ERTLeader
components:
- - type: MindShield
- type: GhostRole
name: ghost-role-information-ert-engineer-name
description: ghost-role-information-ert-engineer-description
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: RandomMetadata
nameSegments:
- NamesFirstMilitary
- NamesLastMilitary
- type: Loadout
prototypes: [ ERTEngineerGear ]
- - type: InitialInfectedExempt
- type: entity
id: RandomHumanoidSpawnerERTEngineerEVA
@@ -308,16 +297,13 @@
id: ERTEngineerEVA
parent: ERTEngineer
components:
- - type: MindShield
- type: GhostRole
name: ghost-role-information-ert-engineer-name
description: ghost-role-information-ert-engineer-description
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ ERTEngineerGearEVA ]
- - type: InitialInfectedExempt
## ERT Security
@@ -341,20 +327,17 @@
id: ERTSecurity
parent: ERTLeader
components:
- - type: MindShield
- type: GhostRole
name: ghost-role-information-ert-security-name
description: ghost-role-information-ert-security-description
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: RandomMetadata
nameSegments:
- NamesFirstMilitary
- NamesLastMilitary
- type: Loadout
prototypes: [ ERTSecurityGear ]
- - type: InitialInfectedExempt
- type: entity
id: RandomHumanoidSpawnerERTSecurityEVA
@@ -372,16 +355,13 @@
id: ERTSecurityEVA
parent: ERTSecurity
components:
- - type: MindShield
- type: GhostRole
name: ghost-role-information-ert-security-name
description: ghost-role-information-ert-security-description
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ ERTSecurityGearEVA ]
- - type: InitialInfectedExempt
- type: entity
id: RandomHumanoidSpawnerERTSecurityEVALecter
@@ -395,16 +375,13 @@
id: ERTSecurityEVALecter
parent: ERTSecurityEVA
components:
- - type: MindShield
- type: GhostRole
name: ghost-role-information-ert-security-name
description: ghost-role-information-ert-security-description
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ ERTSecurityGearEVALecter ]
- - type: InitialInfectedExempt
## ERT Medic
@@ -428,20 +405,17 @@
id: ERTMedical
parent: ERTLeader
components:
- - type: MindShield
- type: GhostRole
name: ghost-role-information-ert-medical-name
description: ghost-role-information-ert-medical-description
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: RandomMetadata
nameSegments:
- NamesFirstMilitary
- NamesLastMilitary
- type: Loadout
prototypes: [ ERTMedicalGear ]
- - type: InitialInfectedExempt
- type: entity
id: RandomHumanoidSpawnerERTMedicalEVA
@@ -459,16 +433,13 @@
id: ERTMedicalEVA
parent: ERTMedical
components:
- - type: MindShield
- type: GhostRole
name: ghost-role-information-ert-medical-name
description: ghost-role-information-ert-medical-description
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ ERTMedicalGearEVA ]
- - type: InitialInfectedExempt
## CBURN
@@ -486,8 +457,8 @@
- type: randomHumanoidSettings
id: CBURNAgent
+ parent: EventHumanoidMindShielded
components:
- - type: MindShield
- type: Loadout
prototypes: [CBURNGear]
- type: GhostRole
@@ -495,12 +466,10 @@
description: ghost-role-information-cburn-agent-description
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: RandomMetadata
nameSegments:
- NamesFirstMilitary
- NamesLastMilitary
- - type: InitialInfectedExempt
## Central Command
- type: entity
@@ -516,17 +485,15 @@
- type: randomHumanoidSettings
id: CentcomOfficial
+ parent: EventHumanoidMindShielded
components:
- - type: MindShield
- type: GhostRole
name: ghost-role-information-centcom-official-name
description: ghost-role-information-centcom-official-description
raffle:
settings: default
- - type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ CentcomGear ]
- - type: InitialInfectedExempt
## Syndicate
@@ -545,6 +512,8 @@
- type: randomHumanoidSettings
id: SyndicateAgent
components:
+ - type: RandomHumanoidAppearance
+ randomizeName: false
- type: Loadout
prototypes: [SyndicateOperativeGearExtremelyBasic]
@@ -561,6 +530,8 @@
- type: randomHumanoidSettings
id: NukeOp
components:
+ - type: RandomHumanoidAppearance
+ randomizeName: false
- type: NukeOperative
- type: entity
@@ -580,6 +551,7 @@
- type: randomHumanoidSettings
id: Cluwne
+ parent: EventHumanoid
randomizeName: false
components:
- type: GhostRole
@@ -587,9 +559,11 @@
description: ghost-role-information-cluwne-description
raffle:
settings: default
- - type: GhostTakeoverAvailable
- type: Cluwne
+
+## Shuttle roles
+
## Lost Cargo technician
- type: entity
@@ -619,7 +593,7 @@
- type: randomHumanoidSettings
id: LostCargoTechnician
- randomizeName: false
+ parent: EventHumanoid
components:
- type: GhostRole
name: ghost-role-information-lost-cargo-technical-name
@@ -627,13 +601,8 @@
rules: ghost-role-information-lost-cargo-technical-rules
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ LostCargoTechGearSuit, LostCargoTechGearCoat ]
- - type: RandomMetadata
- nameSegments:
- - names_first
- - names_last
# Clown troupe
@@ -674,6 +643,7 @@
- type: randomHumanoidSettings
id: ClownTroupe
+ parent: EventHumanoid
randomizeName: false
components:
- type: GhostRole
@@ -682,7 +652,6 @@
rules: ghost-role-information-clown-troupe-rules
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ ClownTroupe ]
- type: RandomMetadata
@@ -691,18 +660,11 @@
- type: randomHumanoidSettings
id: ClownTroupeBanana
+ parent: ClownTroupe
randomizeName: false
components:
- - type: GhostRole
- name: ghost-role-information-clown-troupe-name
- description: ghost-role-information-clown-troupe-description
- rules: ghost-role-information-clown-troupe-rules
- - type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ BananaClown ]
- - type: RandomMetadata
- nameSegments:
- - names_clown
# Traveling exotic chef
@@ -732,7 +694,7 @@
- type: randomHumanoidSettings
id: TravelingChef
- randomizeName: false
+ parent: EventHumanoid
components:
- type: GhostRole
name: ghost-role-information-traveling-chef-name
@@ -740,13 +702,8 @@
rules: ghost-role-information-traveling-chef-rules
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ TravelingChef ]
- - type: RandomMetadata
- nameSegments:
- - names_first
- - names_last
# Disaster victim
@@ -793,9 +750,11 @@
- type: RandomHumanoidSpawner
settings: DisasterVictimCaptain
+## Following use EventHumanoidMindShielded since they are heads and probably should have mindshields
+
- type: randomHumanoidSettings
- id: DisasterVictimResearchDirector
- randomizeName: false
+ id: DisasterVictimHead
+ parent: EventHumanoidMindShielded
components:
- type: GhostRole
name: ghost-role-information-disaster-victim-name
@@ -803,49 +762,27 @@
rules: ghost-role-information-disaster-victim-rules
raffle:
settings: default
- - type: GhostTakeoverAvailable
+
+- type: randomHumanoidSettings
+ id: DisasterVictimResearchDirector
+ parent: DisasterVictimHead
+ components:
- type: Loadout
prototypes: [ DisasterVictimRD, DisasterVictimRDAlt ]
- - type: RandomMetadata
- nameSegments:
- - names_first
- - names_last
- type: randomHumanoidSettings
id: DisasterVictimCMO
- randomizeName: false
+ parent: DisasterVictimHead
components:
- - type: GhostRole
- name: ghost-role-information-disaster-victim-name
- description: ghost-role-information-disaster-victim-description
- rules: ghost-role-information-disaster-victim-rules
- raffle:
- settings: default
- - type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ DisasterVictimCMO, DisasterVictimCMOAlt ]
- - type: RandomMetadata
- nameSegments:
- - names_first
- - names_last
- type: randomHumanoidSettings
id: DisasterVictimCaptain
- randomizeName: false
+ parent: DisasterVictimHead
components:
- - type: GhostRole
- name: ghost-role-information-disaster-victim-name
- description: ghost-role-information-disaster-victim-description
- rules: ghost-role-information-disaster-victim-rules
- raffle:
- settings: default
- - type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ DisasterVictimCaptain, DisasterVictimCaptainAlt ]
- - type: RandomMetadata
- nameSegments:
- - names_first
- - names_last
# Syndie Disaster Victim
@@ -875,7 +812,7 @@
- type: randomHumanoidSettings
id: SyndieDisasterVictim
- randomizeName: false
+ parent: EventHumanoid
components:
- type: NpcFactionMember
factions:
@@ -886,10 +823,5 @@
rules: ghost-role-information-syndie-disaster-victim-rules
raffle:
settings: short
- - type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ SyndicateOperativeGearCivilian ]
- - type: RandomMetadata
- nameSegments:
- - names_first
- - names_last