From 7897fd1b7936b3ac11c60ea03e3e529c09034f12 Mon Sep 17 00:00:00 2001 From: meemofcourse <75212565+meemofcourse@users.noreply.github.com> Date: Sat, 13 Jan 2024 18:55:53 -0300 Subject: [PATCH] sechuds work with chameleons + gives them overlays this is definitely good code --- code/game/objects/items/cards_ids.dm | 2 ++ code/modules/clothing/chameleon.dm | 32 +++++++++++++++++++++------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index c15834565e4d..ad440817942b 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -521,6 +521,8 @@ update_label() else if (popup_input == "Forge/Reset" && forged) registered_name = initial(registered_name) assignment = initial(assignment) + faction_icon = initial(faction_icon) + job_icon = initial(job_icon) log_game("[key_name(user)] has reset \the [initial(name)] named \"[src]\" to default.") update_label() forged = FALSE diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm index e16fde8d54f0..7e89bca23b48 100644 --- a/code/modules/clothing/chameleon.dm +++ b/code/modules/clothing/chameleon.dm @@ -100,9 +100,9 @@ var/outfit_type = outfit_options[selected] if(!outfit_type) return FALSE - var/datum/outfit/job/O = new outfit_type() - var/list/outfit_types = O.get_chameleon_disguise_info() - var/datum/job/job_datum = GLOB.type_occupations[O.jobtype] + var/datum/outfit/job/outfit = new outfit_type() + var/list/outfit_types = outfit.get_chameleon_disguise_info() + var/datum/job/job_datum = GLOB.type_occupations[outfit.jobtype] for(var/V in user.chameleon_item_actions) var/datum/action/item_action/chameleon/change/A = V @@ -119,22 +119,38 @@ break //hardsuit helmets/suit hoods - if(O.toggle_helmet && (ispath(O.suit, /obj/item/clothing/suit/space/hardsuit) || ispath(O.suit, /obj/item/clothing/suit/hooded)) && ishuman(user)) + if(outfit.toggle_helmet && (ispath(outfit.suit, /obj/item/clothing/suit/space/hardsuit) || ispath(outfit.suit, /obj/item/clothing/suit/hooded)) && ishuman(user)) var/mob/living/carbon/human/H = user //make sure they are actually wearing the suit, not just holding it, and that they have a chameleon hat if(istype(H.wear_suit, /obj/item/clothing/suit/chameleon) && istype(H.head, /obj/item/clothing/head/chameleon)) var/helmet_type - if(ispath(O.suit, /obj/item/clothing/suit/space/hardsuit)) - var/obj/item/clothing/suit/space/hardsuit/hardsuit = O.suit + if(ispath(outfit.suit, /obj/item/clothing/suit/space/hardsuit)) + var/obj/item/clothing/suit/space/hardsuit/hardsuit = outfit.suit helmet_type = initial(hardsuit.helmettype) else - var/obj/item/clothing/suit/hooded/hooded = O.suit + var/obj/item/clothing/suit/hooded/hooded = outfit.suit helmet_type = initial(hooded.hoodtype) if(helmet_type) var/obj/item/clothing/head/chameleon/hat = H.head hat.chameleon_action.update_look(user, helmet_type) - qdel(O) + + // ID card sechud + if(outfit.job_icon) + if(!ishuman(user)) + return + var/mob/living/carbon/human/H = user + var/obj/item/card/id/card = H.wear_id + var/datum/job/J = GLOB.type_occupations[outfit.jobtype] // i really hope your outfit/job has a jobtype + if(!card) + return + card.job_icon = outfit.job_icon + card.faction_icon = outfit.faction_icon + card.assignment = J.name + H.sec_hud_set_ID() + card.update_label() + + qdel(outfit) return TRUE