Skip to content

Commit 90c9b4d

Browse files
Let borgs spawn with hats (ProjectOmu#1042)
* Let the borgs spawn with hats * Added hooks for borg species override * Comparing a string... * C# style null check comparison * Forgot an Omu comment * Added more borg hats to loadout * Made logic based on borg job for clarity * Fixed possible null dereference * Apply suggestions from code review Co-authored-by: NotActuallyMarty <27968892+NotActuallyMarty@users.noreply.github.com> --------- Co-authored-by: NotActuallyMarty <27968892+NotActuallyMarty@users.noreply.github.com>
1 parent 3862f07 commit 90c9b4d

7 files changed

Lines changed: 101 additions & 3 deletions

File tree

Content.Client/Lobby/LobbyUIController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,8 @@ public EntityUid LoadProfileEntity(HumanoidCharacterProfile? humanoid, JobProtot
600600
{
601601
// Special type like borg or AI, do not spawn a human just spawn the entity.
602602
dummyEnt = EntityManager.SpawnEntity(previewEntity, MapCoordinates.Nullspace);
603-
return dummyEnt;
603+
if (job?.Name != "job-name-borg") // Omu, don't return if borg
604+
return dummyEnt;
604605
}
605606
else if (humanoid is not null)
606607
{

Content.Server/Station/Systems/StationSpawningSystem.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ public EntityUid SpawnPlayerMob(
205205
}
206206

207207
// If we're not spawning a humanoid, we're gonna exit early without doing all the humanoid stuff.
208-
if (prototype?.JobEntity != null)
208+
if (prototype?.JobEntity != null
209+
&& prototype.Name != "job-name-borg") // Omu, only skip if AI so borgs can have a loadout
209210
{
210211
DebugTools.Assert(entity is null);
211212
var jobEntity = Spawn(prototype.JobEntity, coordinates);
@@ -224,6 +225,10 @@ public EntityUid SpawnPlayerMob(
224225

225226
string speciesId = profile != null ? profile.Species : SharedHumanoidAppearanceSystem.DefaultSpecies;
226227

228+
// Omu, overwrite species to Cyborg if playing JobBorg
229+
if (prototype?.Name == "job-name-borg")
230+
speciesId = "Cyborg";
231+
227232
if (!_prototypeManager.TryIndex<SpeciesPrototype>(speciesId, out var species))
228233
throw new ArgumentException($"Invalid species prototype was used: {speciesId}");
229234

Resources/Locale/en-US/_Omu/preferences/loadout-groups.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ loadout-group-courier-id = Courier ID
2828
loadout-group-courier-envirohelm = Courier envirohelm
2929
loadout-group-courier-envirosuit = Courier envirosuit
3030
loadout-group-courier-envirogloves = Courier envirogloves
31+
32+
# Cyborg
33+
loadout-group-cyborg-head = Cyborg head

Resources/Prototypes/Loadouts/role_loadouts.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@
161161
id: JobBorg
162162
nameDataset: NamesBorg
163163
canCustomizeName: true
164+
groups: # Omu
165+
- CyborgHead
164166

165167
- type: roleLoadout
166168
id: JobStationAi
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Head
2+
- type: loadout
3+
id: PropellerHead
4+
equipment:
5+
head: ClothingHeadHatPropeller
6+
7+
- type: loadout
8+
id: PartyHatRedHead
9+
equipment:
10+
head: ClothingHeadHatPartyRed
11+
12+
- type: loadout
13+
id: BeanieHead
14+
equipment:
15+
head: ClothingHeadHatCanadaBeanie
16+
17+
- type: loadout
18+
id: ChefHatHead
19+
equipment:
20+
head: ClothingHeadHatChef
21+
22+
- type: loadout
23+
id: FezHatHead
24+
equipment:
25+
head: ClothingHeadHatFez
26+
27+
- type: loadout
28+
id: FedoraHatHead
29+
equipment:
30+
head: ClothingHeadHatFedoraBrown
31+
32+
- type: loadout
33+
id: WhiteCowboyHead
34+
equipment:
35+
head: ClothingHeadHatCowboyWhite
36+
37+
- type: loadout
38+
id: TophatHead
39+
equipment:
40+
head: ClothingHeadHatTophat
41+
42+
- type: loadout
43+
id: SafariHead
44+
equipment:
45+
head: ClothingHeadSafari
46+
47+
- type: loadout
48+
id: JesterHead
49+
equipment:
50+
head: ClothingHeadHatJester
51+
52+
- type: loadout
53+
id: HeadSlimeHead
54+
equipment:
55+
head: ClothingHeadHatAnimalHeadslime
56+
57+
- type: loadout
58+
id: HeadFlowerHead
59+
equipment:
60+
head: ClothingHeadHatHairflower
61+
62+
- type: loadout
63+
id: HeadbandSkull
64+
equipment:
65+
head: ClothingHeadBandSkull
66+

Resources/Prototypes/_Omu/Loadouts/loadout_groups.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,3 +399,24 @@
399399
name: loadout-group-clown-belt
400400
loadouts:
401401
- ClownFoamSabre # Omu - Add foam sabre to the clown's loadout.
402+
403+
# Cyborg
404+
- type: loadoutGroup
405+
id: CyborgHead
406+
name: loadout-group-cyborg-head
407+
minLimit: 0
408+
loadouts:
409+
- PropellerHead
410+
- PartyHatRedHead
411+
- BeanieHead
412+
- ChefHead
413+
- FezHatHead
414+
- FedoraHatHead
415+
- WhiteCowboyHead
416+
- TophatHead
417+
- SafariHead
418+
- JesterHead
419+
- HeadSlimeHead
420+
- HeadFlowerHead
421+
- HeadbandSkull
422+

Resources/Prototypes/_Shitmed/Species/cyborg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
id: Cyborg
1010
name: species-name-human
1111
roundStart: false
12-
prototype: BorgChassisSelectable
12+
prototype: PlayerBorgBattery # Omu, borgs need batteries
1313
sprites: CyborgSprites
1414
defaultSkinTone: "#fff9e2"
1515
markingLimits: MobHumanMarkingLimits

0 commit comments

Comments
 (0)