From 855731b217e813a3a85ef01114dfeebc139928a2 Mon Sep 17 00:00:00 2001 From: Geeves Date: Fri, 27 Dec 2019 15:30:01 +0200 Subject: [PATCH] Examine Overhaul (#7737) --- code/game/atoms.dm | 13 +++++ code/modules/heavy_vehicle/mecha.dm | 19 ++++++- .../mob/living/carbon/human/examine.dm | 54 ++++++++++--------- code/modules/mob/living/carbon/human/human.dm | 6 +++ html/changelogs/geeves - examinestuff.yml | 8 +++ 5 files changed, 73 insertions(+), 27 deletions(-) create mode 100644 html/changelogs/geeves - examinestuff.yml diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 6c237bed360..ef8602422cd 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -146,9 +146,22 @@ to_chat(user, "\icon[src] That's [f_name] [suffix]") to_chat(user, desc) + if(description_fluff) + to_chat(user, span("notice", "This item has additional examine info. \[View\]")) + if(description_antag && player_is_antag(user.mind)) + to_chat(user, span("notice", "This item has additional antag info. \[View\]")) return distance == -1 || (get_dist(src, user) <= distance) +/atom/Topic(href,href_list[]) + . = ..() + if (.) + return + + switch(href_list["examine"]) + if("fluff") + usr.client.statpanel = "Examine" + // called by mobs when e.g. having the atom as their machine, pulledby, loc (AKA mob being inside the atom) or buckled var set. // see code/modules/mob/mob_movement.dm for more. /atom/proc/relaymove() diff --git a/code/modules/heavy_vehicle/mecha.dm b/code/modules/heavy_vehicle/mecha.dm index 923a7a186e2..7698a282643 100644 --- a/code/modules/heavy_vehicle/mecha.dm +++ b/code/modules/heavy_vehicle/mecha.dm @@ -93,9 +93,17 @@ if(!user || !user.client) return to_chat(user, "That's \a [src].") - user << desc + to_chat(user, desc) if(LAZYLEN(pilots) && (!hatch_closed || body.pilot_coverage < 100 || body.transparent_cabin)) - to_chat(user, "It is being piloted by [english_list(pilots, nothing_text = "nobody")].") + if(length(pilots) == 0) + to_chat(user, "It has no pilot.") + else + for(var/pilot in pilots) + if(istype(pilot, /mob)) + var/mob/M = pilot + to_chat(user, "It is being piloted by [M.name].") + else + to_chat(user, "It is being piloted by [pilot].") if(hardpoints.len) to_chat(user, "It has the following hardpoints:") for(var/hardpoint in hardpoints) @@ -119,6 +127,13 @@ damage_string = "almost destroyed" to_chat(user, "Its [thing.name] [thing.gender == PLURAL ? "are" : "is"] [damage_string].") +/mob/living/heavy_vehicle/Topic(href,href_list[]) + if (href_list["examine"]) + var/mob/M = locate(href_list["examine"]) + if(!M) + return + usr.examinate(M, 1) + /mob/living/heavy_vehicle/Initialize(mapload, var/obj/structure/heavy_vehicle_frame/source_frame) . = ..() diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 8abfda8d164..043f5a310ba 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -66,35 +66,39 @@ if(w_uniform && !skipjumpsuit) //Ties var/tie_msg + var/tie_msg_warn if(istype(w_uniform,/obj/item/clothing/under)) var/obj/item/clothing/under/U = w_uniform if(LAZYLEN(U.accessories)) tie_msg += ". Attached to it is [lowertext(english_list(U.accessories))]" + tie_msg_warn += "! Attached to it is [lowertext(english_list(U.accessories))]" if(w_uniform.blood_DNA) - msg += "[T.He] [T.is] wearing \icon[w_uniform] [w_uniform.gender==PLURAL?"some":"a"] [(w_uniform.blood_color != "#030303") ? "blood" : "oil"]-stained [w_uniform.name][tie_msg]!\n" + msg += "[T.He] [T.is] wearing \icon[w_uniform] [w_uniform.gender==PLURAL?"some":"a"] [(w_uniform.blood_color != "#030303") ? "blood" : "oil"]-stained [w_uniform.name][tie_msg_warn].\n" else - msg += "[T.He] [T.is] wearing \icon[w_uniform] \a [w_uniform][tie_msg].\n" + msg += "[T.He] [T.is] wearing \icon[w_uniform] \a [w_uniform][tie_msg].\n" //head if(head) if(head.blood_DNA) - msg += "[T.He] [T.is] wearing \icon[head] [head.gender==PLURAL?"some":"a"] [(head.blood_color != "#030303") ? "blood" : "oil"]-stained [head.name] on [T.his] head!\n" + msg += "[T.He] [T.is] wearing \icon[head] [head.gender==PLURAL?"some":"a"] [(head.blood_color != "#030303") ? "blood" : "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" + msg += "[T.He] [T.is] wearing \icon[head] \a [head] on [T.his] head.\n" //suit/armour if(wear_suit) var/tie_msg + var/tie_msg_warn if(istype(wear_suit,/obj/item/clothing/suit)) var/obj/item/clothing/suit/U = wear_suit if(LAZYLEN(U.accessories)) tie_msg += ". Attached to it is [lowertext(english_list(U.accessories))]" + tie_msg_warn += "! Attached to it is [lowertext(english_list(U.accessories))]" 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" : "oil"]-stained [wear_suit.name]!\n" + msg += "[T.He] [T.is] wearing \icon[wear_suit] [wear_suit.gender==PLURAL?"some":"a"] [(wear_suit.blood_color != "#030303") ? "blood" : "oil"]-stained [wear_suit.name][tie_msg_warn].\n" else - msg += "[T.He] [T.is] wearing \icon[wear_suit] \a [wear_suit][tie_msg].\n" + msg += "[T.He] [T.is] carrying \icon[s_store] \a [s_store] on [T.his] [wear_suit.name].\n" //suit/armour storage if(s_store && !skipsuitstorage) @@ -106,30 +110,30 @@ //back if(back) if(back.blood_DNA) - msg += "[T.He] [T.has] \icon[back] [back.gender==PLURAL?"some":"a"] [(back.blood_color != "#030303") ? "blood" : "oil"]-stained [back] on [T.his] back.\n" + msg += "[T.He] [T.has] \icon[back] [back.gender==PLURAL?"some":"a"] [(back.blood_color != "#030303") ? "blood" : "oil"]-stained [back] on [T.his] back.\n" else - msg += "[T.He] [T.has] \icon[back] \a [back] on [T.his] back.\n" + msg += "[T.He] [T.has] \icon[back] \a [back] on [T.his] back.\n" //left hand if(l_hand) if(l_hand.blood_DNA) - msg += "[T.He] [T.is] holding \icon[l_hand] [l_hand.gender==PLURAL?"some":"a"] [(l_hand.blood_color != "#030303") ? "blood" : "oil"]-stained [l_hand.name] in [T.his] left hand!\n" + msg += "[T.He] [T.is] holding \icon[l_hand] [l_hand.gender==PLURAL?"some":"a"] [(l_hand.blood_color != "#030303") ? "blood" : "oil"]-stained [l_hand.name] in [T.his] left hand!\n" else - msg += "[T.He] [T.is] holding \icon[l_hand] \a [l_hand] in [T.his] left hand.\n" + msg += "[T.He] [T.is] holding \icon[l_hand] \a [l_hand] in [T.his] left hand.\n" //right hand if(r_hand) if(r_hand.blood_DNA) - msg += "[T.He] [T.is] holding \icon[r_hand] [r_hand.gender==PLURAL?"some":"a"] [(r_hand.blood_color != "#030303") ? "blood" : "oil"]-stained [r_hand.name] in [T.his] right hand!\n" + msg += "[T.He] [T.is] holding \icon[r_hand] [r_hand.gender==PLURAL?"some":"a"] [(r_hand.blood_color != "#030303") ? "blood" : "oil"]-stained [r_hand.name] in [T.his] right hand!\n" else - msg += "[T.He] [T.is] holding \icon[r_hand] \a [r_hand] in [T.his] right hand.\n" + msg += "[T.He] [T.is] holding \icon[r_hand] \a [r_hand] in [T.his] right hand.\n" //gloves if(gloves && !skipgloves) if(gloves.blood_DNA) - msg += "[T.He] [T.has] \icon[gloves] [gloves.gender==PLURAL?"some":"a"] [(gloves.blood_color != "#030303") ? "blood" : "oil"]-stained [gloves.name] on [T.his] hands!\n" + msg += "[T.He] [T.has] \icon[gloves] [gloves.gender==PLURAL?"some":"a"] [(gloves.blood_color != "#030303") ? "blood" : "oil"]-stained [gloves.name] on [T.his] hands!\n" else - msg += "[T.He] [T.has] \icon[gloves] \a [gloves] on [T.his] hands.\n" + msg += "[T.He] [T.has] \icon[gloves] \a [gloves] on [T.his] hands.\n" else if(blood_DNA) msg += "[T.He] [T.has] [(hand_blood_color != "#030303") ? "blood" : "oil"]-stained hands!\n" @@ -147,40 +151,40 @@ //belt if(belt) if(belt.blood_DNA) - msg += "[T.He] [T.has] \icon[belt] [belt.gender==PLURAL?"some":"a"] [(belt.blood_color != "#030303") ? "blood" : "oil"]-stained [belt.name] about [T.his] waist!\n" + msg += "[T.He] [T.has] \icon[belt] [belt.gender==PLURAL?"some":"a"] [(belt.blood_color != "#030303") ? "blood" : "oil"]-stained [belt.name] about [T.his] waist!\n" else - msg += "[T.He] [T.has] \icon[belt] \a [belt] about [T.his] waist.\n" + msg += "[T.He] [T.has] \icon[belt] \a [belt] about [T.his] waist.\n" //shoes if(shoes && !skipshoes) if(shoes.blood_DNA) - msg += "[T.He] [T.is] wearing \icon[shoes] [shoes.gender==PLURAL?"some":"a"] [(shoes.blood_color != "#030303") ? "blood" : "oil"]-stained [shoes.name] on [T.his] feet!\n" + msg += "[T.He] [T.is] wearing \icon[shoes] [shoes.gender==PLURAL?"some":"a"] [(shoes.blood_color != "#030303") ? "blood" : "oil"]-stained [shoes.name] on [T.his] feet!\n" else - msg += "[T.He] [T.is] wearing \icon[shoes] \a [shoes] on [T.his] feet.\n" + msg += "[T.He] [T.is] wearing \icon[shoes] \a [shoes] on [T.his] feet.\n" else if(feet_blood_DNA) msg += "[T.He] [T.has] [(feet_blood_color != "#030303") ? "blood" : "oil"]-stained feet!\n" //mask if(wear_mask && !skipmask) 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" : "oil"]-stained [wear_mask.name] on [T.his] face!\n" + msg += "[T.He] [T.has] \icon[wear_mask] [wear_mask.gender==PLURAL?"some":"a"] [(wear_mask.blood_color != "#030303") ? "blood" : "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" + msg += "[T.He] [T.has] \icon[wear_mask] \a [wear_mask] on [T.his] face.\n" //eyes if(glasses && !skipeyes) if(glasses.blood_DNA) - msg += "[T.He] [T.has] \icon[glasses] [glasses.gender==PLURAL?"some":"a"] [(glasses.blood_color != "#030303") ? "blood" : "oil"]-stained [glasses] covering [T.his] eyes!\n" + msg += "[T.He] [T.has] \icon[glasses] [glasses.gender==PLURAL?"some":"a"] [(glasses.blood_color != "#030303") ? "blood" : "oil"]-stained [glasses] covering [T.his] eyes!\n" else - msg += "[T.He] [T.has] \icon[glasses] \a [glasses] covering [T.his] eyes.\n" + msg += "[T.He] [T.has] \icon[glasses] \a [glasses] covering [T.his] eyes.\n" //left ear if(l_ear && !skipears) - msg += "[T.He] [T.has] \icon[l_ear] \a [l_ear] on [T.his] left ear.\n" + msg += "[T.He] [T.has] \icon[l_ear] \a [l_ear] on [T.his] left ear.\n" //right ear if(r_ear && !skipears) - msg += "[T.He] [T.has] \icon[r_ear] \a [r_ear] on [T.his] right ear.\n" + msg += "[T.He] [T.has] \icon[r_ear] \a [r_ear] on [T.his] right ear.\n" //ID if(wear_id) @@ -194,7 +198,7 @@ if(id && (id != real_name) && (get_dist(src, usr) <= 1) && prob(10)) msg += "[T.He] [T.is] wearing \icon[wear_id] \a [wear_id] yet something doesn't seem right...\n" else*/ - msg += "[T.He] [T.is] wearing \icon[wear_id] \a [wear_id].\n" + msg += "[T.He] [T.is] wearing \icon[wear_id] \a [wear_id].\n" //Jitters if(is_jittery) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index e679597f970..8161c6188f1 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -784,6 +784,12 @@ return src.examinate(I) + if (href_list["lookitem_desc_only"]) + var/obj/item/I = locate(href_list["lookitem_desc_only"]) + if(!I) + return + usr.examinate(I, 1) + if (href_list["lookmob"]) var/mob/M = locate(href_list["lookmob"]) if(!M) diff --git a/html/changelogs/geeves - examinestuff.yml b/html/changelogs/geeves - examinestuff.yml new file mode 100644 index 00000000000..709deeb3e89 --- /dev/null +++ b/html/changelogs/geeves - examinestuff.yml @@ -0,0 +1,8 @@ +author: Geeves and Mwahahahaha + +delete-after: True + +changes: + - rscadd: "Items will now say whether they have extra examine info, and allow you to view them." + - rscadd: "You can now examine people that are in exosuits." + - rscadd: "You can now examine the stuff people are wearing and wielding by left clicking on the hyperlink on their examine."