From 1ff24812c178a2add6267f9977d427c14a023f17 Mon Sep 17 00:00:00 2001 From: HugoLuman Date: Mon, 16 May 2016 18:59:17 -0700 Subject: [PATCH 1/2] Refactors examine code to make disguising a humanoid's species possible with s string specified in clothing item definitions. Cardborg disguises now say their wearer is "a high-tech robot!" when they are examined. Also, makes ABSTRACT flagged gear invisible on examination. Signed-off-by: HugoLuman --- code/modules/clothing/clothing.dm | 1 + code/modules/clothing/head/misc_special.dm | 1 + code/modules/clothing/suits/miscellaneous.dm | 1 + .../mob/living/carbon/human/examine.dm | 31 +++++++++++-------- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 04f0f3ed42d..8d6595b73ff 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -25,6 +25,7 @@ var/active_sound = null var/toggle_cooldown = null var/cooldown = 0 + var/species_disguise = null //BS12: Species-restricted clothing check. /obj/item/clothing/mob_can_equip(M as mob, slot) diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 071c6032722..8bda5f4c30f 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -216,6 +216,7 @@ item_state = "cardborg_h" flags = HEADCOVERSEYES | HEADCOVERSMOUTH flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE + species_disguise = "High-tech robot" /obj/item/clothing/head/cardborg/equipped(mob/living/user, slot) ..() diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm index 5abc5e86cbf..7985eb06b57 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -206,6 +206,7 @@ item_state = "cardborg" body_parts_covered = UPPER_TORSO|LOWER_TORSO flags_inv = HIDEJUMPSUIT + species_disguise = "High-tech robot" /obj/item/clothing/suit/cardborg/equipped(mob/living/user, slot) ..() diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 714e9c45146..69eb172d4fe 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -56,17 +56,22 @@ var/list/nospecies = list("Abductor", "Shadowling", "Neara", "Monkey", "Stok", "Farwa", "Wolpin") //species that won't show their race no matter what - if (skipjumpsuit && skipface || (species.name in nospecies)) //either obscured or on the nospecies list - msg += "!\n" //omit the species when examining - else if (species.name == "Slime People") //snowflakey because Slime People are defined as a plural + var/displayed_species = get_species() + for(var/obj/item/clothing/C in src) + if(C.species_disguise) + displayed_species = C.species_disguise + else continue + if (skipjumpsuit && skipface || (displayed_species in nospecies)) //either obscured or on the nospecies list + msg += "!\n" //omit the species when examining + else if (displayed_species == "Slime People") //snowflakey because Slime People are defined as a plural msg += ", a slime person!\n" - else if (species.name == "Unathi") //DAMN YOU, VOWELS + else if (displayed_species == "Unathi") //DAMN YOU, VOWELS msg += ", a unathi!\n" else - msg += ", \a [lowertext(species.name)]!\n" + msg += ", \a [lowertext(displayed_species)]!\n" //uniform - if(w_uniform && !skipjumpsuit) + if(w_uniform && !skipjumpsuit && !(w_uniform.flags & ABSTRACT)) //Ties var/tie_msg if(istype(w_uniform,/obj/item/clothing/under)) @@ -80,14 +85,14 @@ msg += "[t_He] [t_is] wearing \icon[w_uniform] \a [w_uniform][tie_msg].\n" //head - if(head) + if(head && !(head.flags & ABSTRACT)) if(head.blood_DNA) msg += "[t_He] [t_is] wearing \icon[head] [head.gender==PLURAL?"some":"a"] [head.blood_color != "#030303" ? "blood-stained":"oil-stained"] [head.name] on [t_his] head!\n" else msg += "[t_He] [t_is] wearing \icon[head] \a [head] on [t_his] head.\n" //suit/armour - if(wear_suit) + if(wear_suit && !(wear_suit.flags & ABSTRACT)) if(wear_suit.blood_DNA) msg += "[t_He] [t_is] wearing \icon[wear_suit] [wear_suit.gender==PLURAL?"some":"a"] [wear_suit.blood_color != "#030303" ? "blood-stained":"oil-stained"] [wear_suit.name]!\n" else @@ -101,7 +106,7 @@ msg += "[t_He] [t_is] carrying \icon[s_store] \a [s_store] on [t_his] [wear_suit.name].\n" //back - if(back) + if(back && !(back.flags & ABSTRACT)) if(back.blood_DNA) msg += "[t_He] [t_has] \icon[back] [back.gender==PLURAL?"some":"a"] [back.blood_color != "#030303" ? "blood-stained":"oil-stained"] [back] on [t_his] back.\n" else @@ -122,7 +127,7 @@ msg += "[t_He] [t_is] holding \icon[r_hand] \a [r_hand] in [t_his] right hand.\n" //gloves - if(gloves && !skipgloves) + if(gloves && !skipgloves && !(gloves.flags & ABSTRACT)) if(gloves.blood_DNA) msg += "[t_He] [t_has] \icon[gloves] [gloves.gender==PLURAL?"some":"a"] [gloves.blood_color != "#030303" ? "blood-stained":"oil-stained"] [gloves.name] on [t_his] hands!\n" else @@ -147,7 +152,7 @@ msg += "[t_He] [t_has] \icon[belt] \a [belt] about [t_his] waist.\n" //shoes - if(shoes && !skipshoes) + if(shoes && !skipshoes && !(shoes.flags & ABSTRACT)) if(shoes.blood_DNA) msg += "[t_He] [t_is] wearing \icon[shoes] [shoes.gender==PLURAL?"some":"a"] [shoes.blood_color != "#030303" ? "blood-stained":"oil-stained"] [shoes.name] on [t_his] feet!\n" else @@ -157,14 +162,14 @@ //mask - if(wear_mask && !skipmask) + if(wear_mask && !skipmask && !(wear_mask.flags & ABSTRACT)) if(wear_mask.blood_DNA) msg += "[t_He] [t_has] \icon[wear_mask] [wear_mask.gender==PLURAL?"some":"a"] [wear_mask.blood_color != "#030303" ? "blood-stained":"oil-stained"] [wear_mask.name] on [t_his] face!\n" else msg += "[t_He] [t_has] \icon[wear_mask] \a [wear_mask] on [t_his] face.\n" //eyes - if(glasses && !skipeyes) + if(glasses && !skipeyes && !(glasses.flags & ABSTRACT)) if(glasses.blood_DNA) msg += "[t_He] [t_has] \icon[glasses] [glasses.gender==PLURAL?"some":"a"] [glasses.blood_color != "#030303" ? "blood-stained":"oil-stained"] [glasses] covering [t_his] eyes!\n" else From 057d2104e8fa350359433e0e9a66b74944cc7f51 Mon Sep 17 00:00:00 2001 From: HugoLuman Date: Wed, 18 May 2016 12:40:44 -0700 Subject: [PATCH 2/2] Adds checks for disguise being worn Now for the disguise string to appear, the item that gives it must be in a worn slot --- code/modules/mob/living/carbon/human/examine.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 69eb172d4fe..539d88f11cb 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -57,10 +57,10 @@ var/list/nospecies = list("Abductor", "Shadowling", "Neara", "Monkey", "Stok", "Farwa", "Wolpin") //species that won't show their race no matter what var/displayed_species = get_species() - for(var/obj/item/clothing/C in src) - if(C.species_disguise) - displayed_species = C.species_disguise - else continue + for(var/obj/item/clothing/C in src) //Disguise checks + if (C == src.head || C == src.wear_suit || C == src.wear_mask || C == src.w_uniform || C == src.belt || C == src.back) + if(C.species_disguise) + displayed_species = C.species_disguise if (skipjumpsuit && skipface || (displayed_species in nospecies)) //either obscured or on the nospecies list msg += "!\n" //omit the species when examining else if (displayed_species == "Slime People") //snowflakey because Slime People are defined as a plural