From 596ca8b6d4cc49cd69fc104b53b7f4973497a2e5 Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Thu, 29 Jun 2023 04:45:23 +0200 Subject: [PATCH] Fixes and includes `clothing_under_armor_subtype_check.dm` in the unit tests. (#76351) ## About The Pull Request See #76345 (which said: Unit test clothing_under_armor_subtype_check is unticked in _unit_test.dm and also would fail if it was ticked It's not included, it doesn't run Even if it would run, it's currently doing an istype when it should be doing an ispath, so it'd fail) ## Why It's Good For The Game This will fix #76345. ## Changelog N/A --- .../equipment/gear/abductor_clothing.dm | 6 ++--- .../awaymissions/mission_code/snowdin.dm | 5 ++-- code/modules/clothing/chameleon.dm | 5 ++-- code/modules/clothing/under/costume.dm | 6 ++--- .../under/jobs/Plasmaman/civilian_service.dm | 5 ++-- .../clothing/under/jobs/Plasmaman/command.dm | 19 +++++--------- code/modules/clothing/under/jobs/cargo.dm | 1 - code/modules/clothing/under/jobs/centcom.dm | 1 - .../clothing/under/jobs/civilian/civilian.dm | 10 +++---- code/modules/clothing/under/jobs/command.dm | 5 ++-- .../clothing/under/jobs/engineering.dm | 12 +++------ code/modules/clothing/under/jobs/medical.dm | 11 +++----- code/modules/clothing/under/jobs/security.dm | 14 +++++----- code/modules/clothing/under/miscellaneous.dm | 15 +++++------ code/modules/clothing/under/syndicate.dm | 26 ++----------------- code/modules/unit_tests/_unit_tests.dm | 1 + .../clothing_under_armor_subtype_check.dm | 3 ++- 17 files changed, 47 insertions(+), 98 deletions(-) diff --git a/code/modules/antagonists/abductor/equipment/gear/abductor_clothing.dm b/code/modules/antagonists/abductor/equipment/gear/abductor_clothing.dm index 5bd7c0a02c7..064b77cb518 100644 --- a/code/modules/antagonists/abductor/equipment/gear/abductor_clothing.dm +++ b/code/modules/antagonists/abductor/equipment/gear/abductor_clothing.dm @@ -5,13 +5,11 @@ icon_state = "abductor" inhand_icon_state = "bl_suit" worn_icon = 'icons/mob/clothing/under/syndicate.dmi' - armor_type = /datum/armor/under_abductor + armor_type = /datum/armor/clothing_under/abductor can_adjust = FALSE -/datum/armor/under_abductor +/datum/armor/clothing_under/abductor bomb = 10 - bio = 10 - wound = 5 //AGENT VEST /obj/item/clothing/suit/armor/abductor/vest diff --git a/code/modules/awaymissions/mission_code/snowdin.dm b/code/modules/awaymissions/mission_code/snowdin.dm index d160ea5dada..2b8d4e80663 100644 --- a/code/modules/awaymissions/mission_code/snowdin.dm +++ b/code/modules/awaymissions/mission_code/snowdin.dm @@ -375,17 +375,16 @@ /obj/item/clothing/under/syndicate/coldres name = "insulated tactical turtleneck" desc = "A nondescript and slightly suspicious-looking turtleneck with digital camouflage cargo pants. The interior has been padded with special insulation for both warmth and protection." - armor_type = /datum/armor/syndicate_coldres + armor_type = /datum/armor/clothing_under/syndicate/coldres cold_protection = CHEST|GROIN|ARMS|LEGS min_cold_protection_temperature = FIRE_SUIT_MIN_TEMP_PROTECT -/datum/armor/syndicate_coldres +/datum/armor/clothing_under/syndicate/coldres melee = 20 bullet = 10 energy = 5 fire = 25 acid = 25 - wound = 10 /obj/item/clothing/shoes/combat/coldres name = "insulated combat boots" diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm index b2a03c2f0fb..b11ed10d959 100644 --- a/code/modules/clothing/chameleon.dm +++ b/code/modules/clothing/chameleon.dm @@ -380,15 +380,14 @@ random_sensor = FALSE resistance_flags = NONE can_adjust = FALSE - armor_type = /datum/armor/under_chameleon + armor_type = /datum/armor/clothing_under/chameleon var/datum/action/item_action/chameleon/change/chameleon_action -/datum/armor/under_chameleon +/datum/armor/clothing_under/chameleon melee = 10 bullet = 10 laser = 10 - bio = 10 fire = 50 acid = 50 wound = 10 diff --git a/code/modules/clothing/under/costume.dm b/code/modules/clothing/under/costume.dm index dd2dcb07be9..e19757d8fca 100644 --- a/code/modules/clothing/under/costume.dm +++ b/code/modules/clothing/under/costume.dm @@ -247,18 +247,16 @@ inhand_icon_state = null worn_icon = 'icons/mob/clothing/under/security.dmi' alt_covers_chest = TRUE - armor_type = /datum/armor/costume_russian_officer + armor_type = /datum/armor/clothing_under/costume_russian_officer strip_delay = 50 sensor_mode = SENSOR_COORDS random_sensor = FALSE can_adjust = FALSE -/datum/armor/costume_russian_officer +/datum/armor/clothing_under/costume_russian_officer melee = 10 - bio = 10 fire = 30 acid = 30 - wound = 5 /obj/item/clothing/under/costume/buttondown gender = PLURAL diff --git a/code/modules/clothing/under/jobs/Plasmaman/civilian_service.dm b/code/modules/clothing/under/jobs/Plasmaman/civilian_service.dm index 75477e3dceb..45bff8fd2d0 100644 --- a/code/modules/clothing/under/jobs/Plasmaman/civilian_service.dm +++ b/code/modules/clothing/under/jobs/Plasmaman/civilian_service.dm @@ -7,7 +7,7 @@ icon = 'icons/obj/clothing/under/plasmaman.dmi' worn_icon = 'icons/mob/clothing/under/plasmaman.dmi' clothing_flags = PLASMAMAN_PREVENT_IGNITION - armor_type = /datum/armor/under_plasmaman + armor_type = /datum/armor/clothing_under/plasmaman body_parts_covered = CHEST|GROIN|LEGS|FEET|ARMS|HANDS can_adjust = FALSE strip_delay = 80 @@ -15,11 +15,10 @@ var/extinguish_cooldown = 100 var/extinguishes_left = 5 -/datum/armor/under_plasmaman +/datum/armor/clothing_under/plasmaman bio = 100 fire = 95 acid = 95 - wound = 5 /obj/item/clothing/under/plasmaman/examine(mob/user) . = ..() diff --git a/code/modules/clothing/under/jobs/Plasmaman/command.dm b/code/modules/clothing/under/jobs/Plasmaman/command.dm index 2e5697e07cb..8713edb5588 100644 --- a/code/modules/clothing/under/jobs/Plasmaman/command.dm +++ b/code/modules/clothing/under/jobs/Plasmaman/command.dm @@ -5,13 +5,12 @@ inhand_icon_state = null sensor_mode = SENSOR_COORDS random_sensor = FALSE - armor_type = /datum/armor/clothing_under/plasmaman_captain + armor_type = /datum/armor/clothing_under/rank_captain/plasmaman -/datum/armor/clothing_under/plasmaman_captain +/datum/armor/clothing_under/rank_captain/plasmaman bio = 100 fire = 95 acid = 95 - wound = 15 /obj/item/clothing/under/plasmaman/head_of_personnel name = "head of personnel's plasma envirosuit" @@ -38,9 +37,9 @@ desc = "An air-tight suit designed to be used by plasmamen insane enough to achieve the rank of \"Chief Engineer\"." icon_state = "ce_envirosuit" inhand_icon_state = null - armor_type = /datum/armor/clothing_under/plasmaman_chief_engineer + armor_type = /datum/armor/clothing_under/engineering_chief_engineer/plasmaman -/datum/armor/clothing_under/plasmaman_chief_engineer +/datum/armor/clothing_under/engineering_chief_engineer/plasmaman bio = 100 fire = 95 acid = 95 @@ -50,21 +49,15 @@ desc = "It's an envirosuit worn by those with the experience to be \"Chief Medical Officer\"." icon_state = "cmo_envirosuit" inhand_icon_state = null - armor_type = /datum/armor/clothing_under/plasmaman_chief_medical_officer - -/datum/armor/clothing_under/plasmaman_chief_medical_officer - bio = 100 - fire = 95 - acid = 95 /obj/item/clothing/under/plasmaman/research_director name = "research director's plasma envirosuit" desc = "It's an envirosuit worn by those with the know-how to achieve the position of \"Research Director\"." icon_state = "rd_envirosuit" inhand_icon_state = null - armor_type = /datum/armor/clothing_under/plasmaman_research_director + armor_type = /datum/armor/clothing_under/rnd_research_director/plasmaman -/datum/armor/clothing_under/plasmaman_research_director +/datum/armor/clothing_under/rnd_research_director/plasmaman bio = 100 fire = 95 acid = 95 diff --git a/code/modules/clothing/under/jobs/cargo.dm b/code/modules/clothing/under/jobs/cargo.dm index 1602f51f1bd..d1f1ab01d90 100644 --- a/code/modules/clothing/under/jobs/cargo.dm +++ b/code/modules/clothing/under/jobs/cargo.dm @@ -45,7 +45,6 @@ resistance_flags = NONE /datum/armor/clothing_under/cargo_miner - bio = 10 fire = 80 wound = 10 diff --git a/code/modules/clothing/under/jobs/centcom.dm b/code/modules/clothing/under/jobs/centcom.dm index a8d13747dad..da1fe5d7a1d 100644 --- a/code/modules/clothing/under/jobs/centcom.dm +++ b/code/modules/clothing/under/jobs/centcom.dm @@ -64,7 +64,6 @@ /datum/armor/clothing_under/centcom_military melee = 10 - bio = 10 fire = 50 acid = 40 wound = 10 diff --git a/code/modules/clothing/under/jobs/civilian/civilian.dm b/code/modules/clothing/under/jobs/civilian/civilian.dm index 9f24f590a5b..86860e796c2 100644 --- a/code/modules/clothing/under/jobs/civilian/civilian.dm +++ b/code/modules/clothing/under/jobs/civilian/civilian.dm @@ -98,11 +98,10 @@ name = "botanist's jumpsuit" icon_state = "hydroponics" inhand_icon_state = "g_suit" - armor_type = /datum/armor/civilian_hydroponics + armor_type = /datum/armor/clothing_under/civilian_hydroponics -/datum/armor/civilian_hydroponics +/datum/armor/clothing_under/civilian_hydroponics bio = 50 - wound = 5 /obj/item/clothing/under/rank/civilian/hydroponics/skirt name = "botanist's jumpskirt" @@ -119,11 +118,10 @@ name = "janitor's jumpsuit" icon_state = "janitor" inhand_icon_state = "janitor" - armor_type = /datum/armor/civilian_janitor + armor_type = /datum/armor/clothing_under/civilian_janitor -/datum/armor/civilian_janitor +/datum/armor/clothing_under/civilian_janitor bio = 10 - wound = 5 /obj/item/clothing/under/rank/civilian/janitor/skirt name = "janitor's jumpskirt" diff --git a/code/modules/clothing/under/jobs/command.dm b/code/modules/clothing/under/jobs/command.dm index dffb319185e..2969eabc63c 100644 --- a/code/modules/clothing/under/jobs/command.dm +++ b/code/modules/clothing/under/jobs/command.dm @@ -7,10 +7,9 @@ random_sensor = FALSE icon = 'icons/obj/clothing/under/captain.dmi' worn_icon = 'icons/mob/clothing/under/captain.dmi' - armor_type = /datum/armor/rank_captain + armor_type = /datum/armor/clothing_under/rank_captain -/datum/armor/rank_captain - bio = 10 +/datum/armor/clothing_under/rank_captain wound = 15 /obj/item/clothing/under/rank/captain/skirt diff --git a/code/modules/clothing/under/jobs/engineering.dm b/code/modules/clothing/under/jobs/engineering.dm index c6852d3b52a..b6bd430eee8 100644 --- a/code/modules/clothing/under/jobs/engineering.dm +++ b/code/modules/clothing/under/jobs/engineering.dm @@ -3,27 +3,23 @@ /obj/item/clothing/under/rank/engineering icon = 'icons/obj/clothing/under/engineering.dmi' worn_icon = 'icons/mob/clothing/under/engineering.dmi' - armor_type = /datum/armor/rank_engineering + armor_type = /datum/armor/clothing_under/rank_engineering resistance_flags = NONE -/datum/armor/rank_engineering - bio = 10 +/datum/armor/clothing_under/rank_engineering fire = 60 acid = 20 - wound = 5 /obj/item/clothing/under/rank/engineering/chief_engineer desc = "It's a high visibility jumpsuit given to those engineers insane enough to achieve the rank of \"Chief Engineer\". Made from fire resistant materials." name = "chief engineer's jumpsuit" icon_state = "chiefengineer" inhand_icon_state = "gy_suit" - armor_type = /datum/armor/engineering_chief_engineer + armor_type = /datum/armor/clothing_under/engineering_chief_engineer -/datum/armor/engineering_chief_engineer - bio = 10 +/datum/armor/clothing_under/engineering_chief_engineer fire = 80 acid = 40 - wound = 5 /obj/item/clothing/under/rank/engineering/chief_engineer/skirt name = "chief engineer's jumpskirt" diff --git a/code/modules/clothing/under/jobs/medical.dm b/code/modules/clothing/under/jobs/medical.dm index 560d90228da..1574b64bbf0 100644 --- a/code/modules/clothing/under/jobs/medical.dm +++ b/code/modules/clothing/under/jobs/medical.dm @@ -1,11 +1,10 @@ /obj/item/clothing/under/rank/medical icon = 'icons/obj/clothing/under/medical.dmi' worn_icon = 'icons/mob/clothing/under/medical.dmi' - armor_type = /datum/armor/rank_medical + armor_type = /datum/armor/clothing_under/rank_medical -/datum/armor/rank_medical +/datum/armor/clothing_under/rank_medical bio = 50 - wound = 5 /obj/item/clothing/under/rank/medical/doctor desc = "It's made of a special fiber that provides minor protection against biohazards. It has a cross on the chest denoting that the wearer is trained medical personnel." @@ -121,13 +120,11 @@ name = "chemist's jumpsuit" icon_state = "chemistry" inhand_icon_state = "w_suit" - armor_type = /datum/armor/medical_chemist + armor_type = /datum/armor/clothing_under/medical_chemist -/datum/armor/medical_chemist - bio = 10 +/datum/armor/clothing_under/medical_chemist fire = 50 acid = 65 - wound = 5 /obj/item/clothing/under/rank/medical/chemist/skirt name = "chemist's jumpskirt" diff --git a/code/modules/clothing/under/jobs/security.dm b/code/modules/clothing/under/jobs/security.dm index 8f76bd4587a..69c6658e377 100644 --- a/code/modules/clothing/under/jobs/security.dm +++ b/code/modules/clothing/under/jobs/security.dm @@ -12,14 +12,13 @@ /obj/item/clothing/under/rank/security icon = 'icons/obj/clothing/under/security.dmi' worn_icon = 'icons/mob/clothing/under/security.dmi' - armor_type = /datum/armor/rank_security + armor_type = /datum/armor/clothing_under/rank_security strip_delay = 50 sensor_mode = SENSOR_COORDS random_sensor = FALSE -/datum/armor/rank_security +/datum/armor/clothing_under/rank_security melee = 10 - bio = 10 fire = 30 acid = 30 wound = 10 @@ -145,12 +144,11 @@ desc = "A security jumpsuit decorated for those few with the dedication to achieve the position of Head of Security." icon_state = "rhos" inhand_icon_state = "r_suit" - armor_type = /datum/armor/security_head_of_security + armor_type = /datum/armor/clothing_under/security_head_of_security strip_delay = 60 -/datum/armor/security_head_of_security +/datum/armor/clothing_under/security_head_of_security melee = 10 - bio = 10 fire = 50 acid = 50 wound = 10 @@ -221,9 +219,9 @@ icon_state = "spacepol" inhand_icon_state = null can_adjust = FALSE - armor_type = /datum/armor/sec_uniform_spacepol + armor_type = /datum/armor/clothing_under/sec_uniform_spacepol -/datum/armor/sec_uniform_spacepol +/datum/armor/clothing_under/sec_uniform_spacepol fire = 10 acid = 10 melee = 10 diff --git a/code/modules/clothing/under/miscellaneous.dm b/code/modules/clothing/under/miscellaneous.dm index a8c81f7b25a..8f1263fa3e2 100644 --- a/code/modules/clothing/under/miscellaneous.dm +++ b/code/modules/clothing/under/miscellaneous.dm @@ -49,7 +49,7 @@ worn_icon = 'icons/mob/clothing/under/syndicate.dmi' desc = "A cybernetically enhanced jumpsuit used for administrative duties." body_parts_covered = CHEST|GROIN|LEGS|FEET|ARMS|HANDS - armor_type = /datum/armor/misc_adminsuit + armor_type = /datum/armor/clothing_under/adminsuit cold_protection = CHEST | GROIN | LEGS | FEET | ARMS | HANDS min_cold_protection_temperature = SPACE_SUIT_MIN_TEMP_PROTECT heat_protection = CHEST|GROIN|LEGS|FEET|ARMS|HANDS @@ -57,7 +57,7 @@ can_adjust = FALSE resistance_flags = FIRE_PROOF | ACID_PROOF -/datum/armor/misc_adminsuit +/datum/armor/clothing_under/adminsuit melee = 100 bullet = 100 laser = 100 @@ -97,15 +97,14 @@ icon_state = "durathread" inhand_icon_state = null can_adjust = FALSE - armor_type = /datum/armor/misc_durathread + armor_type = /datum/armor/clothing_under/durathread -/datum/armor/misc_durathread +/datum/armor/clothing_under/durathread melee = 10 laser = 10 fire = 40 acid = 10 bomb = 5 - bio = 10 wound = 10 /obj/item/clothing/under/misc/bouncer @@ -114,14 +113,12 @@ icon_state = "bouncer" inhand_icon_state = null can_adjust = FALSE - armor_type = /datum/armor/misc_bouncer + armor_type = /datum/armor/clothing_under/bouncer -/datum/armor/misc_bouncer +/datum/armor/clothing_under/bouncer melee = 5 - bio = 10 fire = 30 acid = 30 - wound = 5 /obj/item/clothing/under/misc/coordinator name = "coordinator jumpsuit" diff --git a/code/modules/clothing/under/syndicate.dm b/code/modules/clothing/under/syndicate.dm index 27abe790f92..0c2ed985ec1 100644 --- a/code/modules/clothing/under/syndicate.dm +++ b/code/modules/clothing/under/syndicate.dm @@ -4,14 +4,13 @@ icon_state = "syndicate" inhand_icon_state = "bl_suit" has_sensor = NO_SENSORS - armor_type = /datum/armor/clothing_under/under_syndicate + armor_type = /datum/armor/clothing_under/syndicate alt_covers_chest = TRUE icon = 'icons/obj/clothing/under/syndicate.dmi' worn_icon = 'icons/mob/clothing/under/syndicate.dmi' -/datum/armor/clothing_under/under_syndicate +/datum/armor/clothing_under/syndicate melee = 10 - bio = 10 fire = 50 acid = 40 wound = 10 @@ -21,20 +20,10 @@ desc = "A non-descript and slightly suspicious looking skirtleneck." icon_state = "syndicate_skirt" inhand_icon_state = "bl_suit" - has_sensor = NO_SENSORS - armor_type = /datum/armor/clothing_under/syndicate_skirt - alt_covers_chest = TRUE female_sprite_flags = FEMALE_UNIFORM_TOP_ONLY dying_key = DYE_REGISTRY_JUMPSKIRT supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON -/datum/armor/clothing_under/syndicate_skirt - melee = 10 - bio = 10 - fire = 50 - acid = 40 - wound = 10 - /obj/item/clothing/under/syndicate/bloodred name = "blood-red sneaksuit" desc = "It still counts as stealth if there are no witnesses." @@ -49,7 +38,6 @@ bullet = 10 laser = 10 energy = 10 - bio = 10 fire = 50 acid = 40 wound = 10 @@ -62,7 +50,6 @@ armor_type = /datum/armor/clothing_under/bloodred_sleepytime /datum/armor/clothing_under/bloodred_sleepytime - bio = 10 fire = 50 acid = 40 @@ -76,7 +63,6 @@ stubborn_stains = TRUE /datum/armor/clothing_under/syndicate_tacticool - bio = 10 fire = 50 acid = 40 @@ -103,16 +89,10 @@ desc = "Just looking at it makes you want to buy an SKS, go into the woods, and -operate-." icon_state = "tactifool_skirt" inhand_icon_state = "bl_suit" - armor_type = /datum/armor/clothing_under/tacticool_skirt female_sprite_flags = FEMALE_UNIFORM_TOP_ONLY dying_key = DYE_REGISTRY_JUMPSKIRT supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON -/datum/armor/clothing_under/tacticool_skirt - bio = 10 - fire = 50 - acid = 40 - /obj/item/clothing/under/syndicate/sniper name = "tactical turtleneck suit" desc = "A double seamed tactical turtleneck disguised as a civilian-grade silk suit. Intended for the most formal operator. The collar is really sharp." @@ -137,7 +117,6 @@ /datum/armor/clothing_under/syndicate_soviet melee = 10 - bio = 10 /obj/item/clothing/under/syndicate/combat name = "combat uniform" @@ -155,7 +134,6 @@ /datum/armor/clothing_under/syndicate_rus_army melee = 5 - bio = 10 /obj/item/clothing/under/syndicate/scrubs name = "tactical scrubs" diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm index 83f22d5593d..bd038f90de8 100644 --- a/code/modules/unit_tests/_unit_tests.dm +++ b/code/modules/unit_tests/_unit_tests.dm @@ -103,6 +103,7 @@ #include "chat_filter.dm" #include "circuit_component_category.dm" #include "closets.dm" +#include "clothing_under_armor_subtype_check.dm" #include "combat.dm" #include "component_tests.dm" #include "confusion.dm" diff --git a/code/modules/unit_tests/clothing_under_armor_subtype_check.dm b/code/modules/unit_tests/clothing_under_armor_subtype_check.dm index 158d0a3862d..9755004f71c 100644 --- a/code/modules/unit_tests/clothing_under_armor_subtype_check.dm +++ b/code/modules/unit_tests/clothing_under_armor_subtype_check.dm @@ -5,4 +5,5 @@ /datum/unit_test/clothing_under_armor_subtype_check/Run() for(var/obj/item/clothing/under/jumpsuit as anything in typesof(/obj/item/clothing/under)) - TEST_ASSERT(istype(initial(jumpsuit.armor_type), /datum/armor/clothing_under), "[initial(jumpsuit.type)] does not use clothing_under as its armor!") + if(!ispath(initial(UNLINT(jumpsuit.armor_type)), /datum/armor/clothing_under)) + TEST_FAIL("[jumpsuit] does not use clothing_under as its armor!")