Skip to content

Commit 15b7777

Browse files
authored
removes most species restrictions from suits (#7146)
1 parent 08f1eb8 commit 15b7777

File tree

14 files changed

+36
-197
lines changed

14 files changed

+36
-197
lines changed

code/__DEFINES/inventory/bodytypes.dm

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,8 @@
6868
//! keep this number (count) up to date
6969
#define BODYTYPES_TOTAL 21
7070

71-
//? automatically typelist bodytypes if it's a list
72-
#define CONSTRUCT_BODYTYPES(LIST) LIST = fetch_bodytypes_struct(LIST)
73-
//? check bodytype lists matching
74-
#define COMPARE_BODYTYPES(L1, L2) L1.compare(L2)
75-
//? check bodytype list membership
76-
#define CHECK_BODYTYPE(L, BT) L.contains(BT)
71+
/// Constructs a bodytype struct from a variable.
72+
#define CONSTRUCT_BODYTYPES(BODYTYPES) BODYTYPES = fetch_bodytypes_struct(BODYTYPES)
7773

7874
// todo: what are we going to do with these?
7975
//? we should probably standardize bodytypes as entirely different sprites, and also

code/game/objects/items-inventory-old.dm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,14 @@
222222
/obj/item/proc/can_equip(mob/M, slot, mob/user, flags)
223223
if(!equip_check_beltlink(M, slot, user, flags))
224224
return FALSE
225+
if(ishuman(M) && !(flags & INV_OP_FORCE))
226+
// todo: put on the mob side maybe?
227+
var/mob/living/carbon/human/casted_bodytype_check = M
228+
var/their_bodytype = casted_bodytype_check.species.get_effective_bodytype(casted_bodytype_check, src, slot)
229+
if(!worn_bodytypes?.contains(their_bodytype) && !worn_bodytypes_fallback?.contains(their_bodytype))
230+
if(!(flags & INV_OP_SILENT))
231+
to_chat(user || M, SPAN_WARNING("[src] doesn't fit on you."))
232+
return FALSE
225233
return TRUE
226234

227235
/**

code/game/objects/items-inventory-rendering.dm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@
320320
var/list/additional = render_additional(M, icon_used, state_used, layer_used, dim_x, dim_y, align_y, bodytype, inhands, slot_meta)
321321
// todo: signal with (args, add)
322322
// todo: args' indices should be defines
323-
var/no_render = inhands? (worn_render_flags & WORN_RENDER_INHAND_NO_RENDER) : ((worn_render_flags & WORN_RENDER_SLOT_NO_RENDER) || CHECK_BODYTYPE(worn_bodytypes_invisible, bodytype))
323+
var/no_render = inhands? (worn_render_flags & WORN_RENDER_INHAND_NO_RENDER) : ((worn_render_flags & WORN_RENDER_SLOT_NO_RENDER) || worn_bodytypes_invisible?.contains(bodytype))
324324
var/mutable_appearance/MA
325325
// worn_state_guard makes us not render if we'd render the same as in-inventory icon.
326326
if(no_render) // don't bother
@@ -423,7 +423,7 @@
423423
//* inventory slot defaults
424424
else if(inhands? (worn_render_flags & WORN_RENDER_INHAND_ALLOW_DEFAULT) : (worn_render_flags & WORN_RENDER_SLOT_ALLOW_DEFAULT))
425425
var/list/resolved = slot_meta.resolve_default_assets(bodytype, data[WORN_DATA_STATE], M, src, inhand_default_type)
426-
if(!resolved && (bodytype != BODYTYPE_DEFAULT) && CHECK_BODYTYPE(worn_bodytypes_fallback, bodytype))
426+
if(!resolved && (bodytype != BODYTYPE_DEFAULT) && worn_bodytypes_fallback?.contains(bodytype))
427427
// attempt 2 - use fallback if available
428428
if(!(slot_meta.handle_worn_fallback(bodytype, data)))
429429
// attempt 3 - convert to default if specified to convert
@@ -436,7 +436,7 @@
436436
//* Now, the actual intended render system.
437437
if(!data[WORN_DATA_ICON])
438438
// grab icon based on priority
439-
if(!inhands && !CHECK_BODYTYPE(worn_bodytypes, bodytype) && CHECK_BODYTYPE(worn_bodytypes_fallback, bodytype) && slot_meta.handle_worn_fallback(bodytype, data))
439+
if(!inhands && !worn_bodytypes?.contains(bodytype) && worn_bodytypes_fallback?.contains(bodytype) && slot_meta.handle_worn_fallback(bodytype, data))
440440
// special: if bodytypes isn't in, and species has fallback
441441
// .. well don't do anything as handle_sprite_fallback will write to the data list.
442442
else if(inhands && inhand_icon)
@@ -494,7 +494,7 @@
494494
// PRIVATE_PROC(TRUE)
495495
if(inhands)
496496
return "[base_worn_state(inhands, slot_key, bodytype)][(worn_render_flags & WORN_RENDER_INHAND_ONE_FOR_ALL)? "_all" : "_[slot_key]"]"
497-
return "[base_worn_state(inhands, slot_key, bodytype)][(worn_render_flags & WORN_RENDER_SLOT_ONE_FOR_ALL)? "_all" : "_[slot_key]"][((bodytype != BODYTYPE_DEFAULT) && CHECK_BODYTYPE(worn_bodytypes, bodytype))? "_[bodytype_to_string(bodytype)]" : ""]"
497+
return "[base_worn_state(inhands, slot_key, bodytype)][(worn_render_flags & WORN_RENDER_SLOT_ONE_FOR_ALL)? "_all" : "_[slot_key]"][((bodytype != BODYTYPE_DEFAULT) && worn_bodytypes?.contains(bodytype))? "_[bodytype_to_string(bodytype)]" : ""]"
498498

499499
/obj/item/proc/base_worn_state(inhands, slot_key, bodytype)
500500
if(inhands)

code/modules/clothing/clothing.dm

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,26 @@
188188
if(!species_restricted)
189189
return //this item doesn't use the species_restricted system
190190

191-
//Set species_restricted list
192-
switch(target_species)
193-
if(SPECIES_HUMAN, SPECIES_SKRELL) //humanoid bodytypes
194-
species_restricted = list(SPECIES_HUMAN, SPECIES_SKRELL, SPECIES_PROMETHEAN, SPECIES_HUMAN_SPACER, SPECIES_HUMAN_GRAV, SPECIES_HUMAN_VATBORN) //skrell/humans can wear each other's suits
195-
if (SPECIES_UNATHI)
196-
//For the sake of gameplay, unathi is unathi
197-
species_restricted = list(SPECIES_UNATHI, SPECIES_UNATHI_DIGI)
198-
else
199-
species_restricted = list(target_species)
191+
// * temporary *//
192+
// this entire proc is pending decommissioning. the new worn_bodytypes system is the
193+
// successor, and contains proper non-strict restriction support via fallbacks system
194+
195+
// for now, we only bother mechnically restricting if it's a very different race; otherwise, we
196+
// swap icons if they exist, but do not actually restrict it, so you can actually have
197+
// humans wearing lizard suits in the interrim
198+
199+
// we should also investigate being able to intentionally mis-cycle a suit to something you're not
200+
// so you can disguise as a lizard by using a lizard suit as a human or something
201+
202+
var/static/list/actually_different_species = list(
203+
SPECIES_VOX,
204+
SPECIES_TESHARI,
205+
)
206+
207+
if(target_species in actually_different_species)
208+
species_restricted = list(target_species)
209+
else
210+
species_restricted = list("exclude") + actually_different_species
200211

201212
//Set icon
202213
LAZYINITLIST(sprite_sheets)

code/modules/clothing/spacesuits/alien.dm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
desc = "Smoothly contoured and polished to a shine. Still looks like a fishbowl."
55
armor_type = /datum/armor/skrell/space/light
66
max_heat_protection_temperature = SPACE_SUIT_MAX_HEAT_PROTECTION_TEMPERATURE
7-
species_restricted = list(SPECIES_SKRELL,SPECIES_HUMAN)
87

98
/obj/item/clothing/head/helmet/space/skrell/white
109
icon_state = "skrell_helmet_white"
@@ -19,7 +18,6 @@
1918
allowed = list(/obj/item/flashlight,/obj/item/tank,/obj/item/storage/bag/ore,/obj/item/t_scanner,/obj/item/pickaxe, /obj/item/rcd)
2019
heat_protection_cover = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS
2120
max_heat_protection_temperature = SPACE_SUIT_MAX_HEAT_PROTECTION_TEMPERATURE
22-
species_restricted = list(SPECIES_SKRELL,SPECIES_HUMAN)
2321

2422
/obj/item/clothing/suit/space/skrell/white
2523
icon_state = "skrell_suit_white"

code/modules/clothing/spacesuits/void/void.dm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
// inv_hide_flags = HIDEEARS|BLOCKHAIR
1717

1818
//Species-specific stuff.
19-
species_restricted = list(SPECIES_HUMAN, SPECIES_PROMETHEAN, SPECIES_ALRAUNE, SPECIES_PHORONOID)
2019
sprite_sheets_refit = list(
2120
SPECIES_UNATHI = 'icons/mob/clothing/species/unathi/helmet.dmi',
2221
SPECIES_UNATHI_DIGI = 'icons/mob/clothing/species/unathidigi/head.dmi',
@@ -49,7 +48,6 @@
4948
min_pressure_protection = 0 * ONE_ATMOSPHERE
5049
max_pressure_protection = 10 * ONE_ATMOSPHERE
5150

52-
species_restricted = list(SPECIES_HUMAN, SPECIES_SKRELL, SPECIES_PROMETHEAN, SPECIES_PHORONOID) //phoronoids are more humanoid than skrell!!
5351
sprite_sheets_refit = list(
5452
SPECIES_UNATHI = 'icons/mob/clothing/species/unathi/suits.dmi',
5553
SPECIES_UNATHI_DIGI = 'icons/mob/clothing/species/unathidigi/suits.dmi',

code/modules/clothing/spacesuits/void/void_vr.dm

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -49,29 +49,6 @@
4949
/obj/item/clothing/suit/space/void/explorer
5050
desc = "A classy red voidsuit for the needs of any semi-retro-futuristic spaceperson! This one is rather loose fitting."
5151
helmet_type = /obj/item/clothing/head/helmet/space/void/explorer
52-
species_restricted = list(
53-
SPECIES_AKULA,
54-
SPECIES_ALRAUNE,
55-
SPECIES_APIDAEN,
56-
SPECIES_AURIL,
57-
SPECIES_DREMACHIR,
58-
SPECIES_HUMAN,
59-
SPECIES_NEVREAN,
60-
SPECIES_RAPALA,
61-
SPECIES_SERGAL,
62-
SPECIES_SKRELL,
63-
SPECIES_TAJ,
64-
SPECIES_TESHARI,
65-
SPECIES_UNATHI,
66-
SPECIES_UNATHI_DIGI,
67-
SPECIES_VASILISSAN,
68-
SPECIES_VOX,
69-
SPECIES_VULPKANIN,
70-
SPECIES_XENOCHIMERA,
71-
SPECIES_XENOHYBRID,
72-
SPECIES_ZORREN_FLAT,
73-
SPECIES_ZORREN_HIGH,
74-
)
7552

7653
/obj/item/clothing/suit/space/void/explorer/Initialize(mapload)
7754
. = ..()
@@ -80,29 +57,6 @@
8057

8158
/obj/item/clothing/head/helmet/space/void/explorer
8259
desc = "A helmet that matches a red voidsuit! So classy."
83-
species_restricted = list(
84-
SPECIES_AKULA,
85-
SPECIES_ALRAUNE,
86-
SPECIES_APIDAEN,
87-
SPECIES_AURIL,
88-
SPECIES_DREMACHIR,
89-
SPECIES_HUMAN,
90-
SPECIES_NEVREAN,
91-
SPECIES_RAPALA,
92-
SPECIES_SERGAL,
93-
SPECIES_SKRELL,
94-
SPECIES_TAJ,
95-
SPECIES_TESHARI,
96-
SPECIES_UNATHI,
97-
SPECIES_UNATHI_DIGI,
98-
SPECIES_VASILISSAN,
99-
SPECIES_VOX,
100-
SPECIES_VULPKANIN,
101-
SPECIES_XENOCHIMERA,
102-
SPECIES_XENOHYBRID,
103-
SPECIES_ZORREN_FLAT,
104-
SPECIES_ZORREN_HIGH,
105-
)
10660

10761
/obj/item/clothing/head/helmet/space/void/explorer/Initialize(mapload)
10862
. = ..()

code/modules/clothing/spacesuits/void/xeno/plasman.dm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
|ACCESSORY_SLOT_ARMBAND\
2424
|ACCESSORY_SLOT_TIE\
2525
|ACCESSORY_SLOT_OVER) // snowflake decorating i guess
26-
species_restricted = list(SPECIES_HUMAN, SPECIES_PHORONOID) //if phoronoids can fit in human suits then...
2726
starts_with_helmet = TRUE
2827
helmet_type = /obj/item/clothing/head/helmet/space/void/plasman
2928

@@ -45,7 +44,6 @@
4544
light_overlay = "plasmaman_overlay"
4645
weight = ITEM_WEIGHT_PHORONOID_HELMET
4746
encumbrance = ITEM_ENCUMBRANCE_PHORONOID_HELMET
48-
species_restricted = list(SPECIES_HUMAN, SPECIES_PHORONOID)
4947
var/analyzing = FALSE
5048

5149
/obj/item/clothing/head/helmet/space/void/plasman/examine()

code/modules/clothing/spacesuits/void/zaddat.dm

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
armor_type = /datum/armor/zaddat
99
siemens_coefficient = 1
1010

11-
species_restricted = list(SPECIES_ZADDAT, SPECIES_PROMETHEAN) //on request from maintainer
12-
1311
/obj/item/clothing/suit/space/void/zaddat
1412
name = "\improper Hegemony Shroud"
1513
desc = "A Hegemony environment suit, still favored by the Spacer Zaddat because of its durability and ease of manufacture."
@@ -20,8 +18,6 @@
2018
helmet = new/obj/item/clothing/head/helmet/space/void/zaddat //shrouds come with helmets built-in
2119
var/has_been_customized = FALSE
2220

23-
species_restricted = list(SPECIES_ZADDAT, SPECIES_PROMETHEAN)
24-
2521
breach_threshold = 12
2622

2723
/obj/item/clothing/suit/space/void/zaddat/verb/custom_suit()

code/modules/clothing/suits/aliens/tajara.dm

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
body_cover_flags = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS
2929
allowed = list(/obj/item/gun,/obj/item/material/sword)
3030
inv_hide_flags = HIDEJUMPSUIT|HIDETAIL|HIDETIE|HIDEHOLSTER
31-
species_restricted = list(SPECIES_TAJ)
3231
armor_type = /datum/armor/general/medieval
3332
weight = ITEM_WEIGHT_TAJARAN_SWORDSMAN_ARMOR
3433
encumbrance = ITEM_ENCUMBRANCE_TAJARAN_SWORDSMAN_ARMOR
@@ -166,7 +165,6 @@
166165
icon_override = 'icons/mob/clothing/species/tajaran/coats.dmi'
167166
icon_state = "tajscrubs"
168167
hoodtype = /obj/item/clothing/head/hood/tajaran/surgery
169-
species_restricted = list(SPECIES_TAJ)
170168

171169
//Cloaks
172170
/obj/item/clothing/suit/storage/hooded/tajaran/cloak
@@ -244,7 +242,6 @@
244242
icon_state = "tajscrubs_hood"
245243
body_cover_flags = HEAD
246244
inv_hide_flags = HIDEEARS|BLOCKHAIR
247-
species_restricted = list(SPECIES_TAJ)
248245

249246
/obj/item/clothing/head/hood/tajaran/cloak/amohda
250247
name = "Amohdan cloak hood"

0 commit comments

Comments
 (0)