Randomizes more humanoid appearances (#27997)

This commit is contained in:
Verm 2024-05-31 23:51:07 -05:00 committed by null
parent bacd52c991
commit fe3892977d
No known key found for this signature in database
GPG Key ID: 212F05528FD678BE
5 changed files with 58 additions and 114 deletions

View File

@ -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;
/// <summary>
/// After randomizing, sets the hair style to this, if possible
/// </summary>
[DataField] public string? Hair = null;
}

View File

@ -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);

View File

@ -15,6 +15,7 @@ public sealed partial class RandomHumanoidSettingsPrototype : IPrototype, IInher
public string[]? Parents { get; }
[AbstractDataField]
[NeverPushInheritance]
public bool Abstract { get; }
/// <summary>
@ -32,6 +33,7 @@ public sealed partial class RandomHumanoidSettingsPrototype : IPrototype, IInher
/// <summary>
/// Extra components to add to this entity.
/// </summary>
[DataField("components")]
[DataField]
[AlwaysPushInheritance]
public ComponentRegistry? Components { get; private set; }
}

View File

@ -13,6 +13,9 @@
name: syndicate agent
suffix: Human, Base
components:
- type: RandomHumanoidAppearance
randomizeName: false
hair: HairBald
- type: Loadout
prototypes: [SyndicateOperativeGearExtremelyBasic]
- type: RandomMetadata

View File

@ -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: PsionicBonusChance #Nyano - Summary: makes more likely to be psionic.
multiplier: 7
@ -583,6 +554,7 @@
- type: randomHumanoidSettings
id: Cluwne
parent: EventHumanoid
randomizeName: false
components:
- type: GhostRole
@ -590,9 +562,11 @@
description: ghost-role-information-cluwne-description
raffle:
settings: default
- type: GhostTakeoverAvailable
- type: Cluwne
## Shuttle roles
## Lost Cargo technician
- type: entity
@ -622,7 +596,7 @@
- type: randomHumanoidSettings
id: LostCargoTechnician
randomizeName: false
parent: EventHumanoid
components:
- type: GhostRole
name: ghost-role-information-lost-cargo-technical-name
@ -630,13 +604,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
@ -677,6 +646,7 @@
- type: randomHumanoidSettings
id: ClownTroupe
parent: EventHumanoid
randomizeName: false
components:
- type: GhostRole
@ -685,7 +655,6 @@
rules: ghost-role-information-clown-troupe-rules
raffle:
settings: short
- type: GhostTakeoverAvailable
- type: Loadout
prototypes: [ ClownTroupe ]
- type: RandomMetadata
@ -694,18 +663,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
@ -735,7 +697,7 @@
- type: randomHumanoidSettings
id: TravelingChef
randomizeName: false
parent: EventHumanoid
components:
- type: GhostRole
name: ghost-role-information-traveling-chef-name
@ -743,13 +705,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
@ -796,9 +753,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
@ -806,49 +765,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
@ -878,7 +815,7 @@
- type: randomHumanoidSettings
id: SyndieDisasterVictim
randomizeName: false
parent: EventHumanoid
components:
- type: NpcFactionMember
factions:
@ -889,10 +826,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