From 755467ac20cad880ca3b8a5a1a8e08d0b1bb8316 Mon Sep 17 00:00:00 2001 From: Krausus Date: Sat, 30 May 2015 05:35:18 -0400 Subject: [PATCH] Fixes examining those with limb stumps/accessories Limb stumps would show as "He has a limb stump on his limb stump", and accessories would be lowercased and worded poorly. --- .../clothing/under/accessories/accessory.dm | 21 ++++++++++++++++++- .../mob/living/carbon/human/examine.dm | 4 ++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index 055e7e0dc65..e43b72a499c 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -325,4 +325,23 @@ /obj/item/clothing/accessory/petcollar/attack_self(mob/user as mob) tagname = copytext(sanitize(input(user, "Would you like to change the name on the tag?", "Name your new pet", "Spot") as null|text),1,MAX_NAME_LEN) - name = "[initial(name)] - [tagname]" \ No newline at end of file + name = "[initial(name)] - [tagname]" + +/proc/english_accessory_list(obj/item/clothing/under/U) + if(!istype(U) || !U.accessories.len) + return + var/list/A = U.accessories + var/total = A.len + if (total == 1) + return "\a [A[1]]" + else if (total == 2) + return "\a [A[1]] and \a [A[2]]" + else + var/output = "" + var/index = 1 + var/comma_text = ", " + while (index < total) + output += "\a [A[index]][comma_text]" + index++ + + return "[output]and \a [A[index]]" diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 06186ea604a..96d9f6ddc0e 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -68,7 +68,7 @@ if(istype(w_uniform,/obj/item/clothing/under)) var/obj/item/clothing/under/U = w_uniform if(U.accessories.len) - tie_msg += " with [lowertext(english_list(U.accessories))]" + tie_msg += " with [english_accessory_list(U)]" if(w_uniform.blood_DNA) msg += "[t_He] [t_is] wearing \icon[w_uniform] [w_uniform.gender==PLURAL?"some":"a"] blood-stained [w_uniform.name][tie_msg]!\n" @@ -280,7 +280,7 @@ continue for(var/obj/item/organ/external/temp in organs) - if(temp) + if(temp && !temp.is_stump()) if(temp.status & ORGAN_ROBOT) if(!(temp.brute_dam + temp.burn_dam)) if(!(species.flags & IS_SYNTHETIC))