Refactors the examine proc to return a list of strings (#12280)

This commit is contained in:
farie82
2019-09-26 07:05:01 +02:00
committed by variableundefined
parent 40a4cd1b75
commit 0e8ddb2afe
210 changed files with 808 additions and 830 deletions
+6 -7
View File
@@ -244,14 +244,13 @@ LINEN BINS
/obj/structure/bedsheetbin/examine(mob/user)
..(user)
. = ..()
if(amount < 1)
to_chat(user, "There are no bed sheets in the bin.")
return
if(amount == 1)
to_chat(user, "There is one bed sheet in the bin.")
return
to_chat(user, "There are [amount] bed sheets in the bin.")
. += "There are no bed sheets in the bin."
else if(amount == 1)
. += "There is one bed sheet in the bin."
else
. += "There are [amount] bed sheets in the bin."
/obj/structure/bedsheetbin/update_icon()
@@ -17,7 +17,7 @@
/obj/structure/closet/fireaxecabinet/examine(mob/user)
. = ..()
to_chat(user, "<span class='notice'>Use a multitool to lock/unlock it.</span>")
. += "<span class='notice'>Use a multitool to lock/unlock it.</span>"
/obj/structure/closet/fireaxecabinet/attackby(var/obj/item/O as obj, var/mob/living/user as mob) //Marker -Agouri
if(isrobot(user) || locked)
+4 -4
View File
@@ -148,12 +148,12 @@ GLOBAL_LIST_INIT(captain_display_cases, list())
start_showpiece_type = /obj/item/gun/projectile/automatic/pistol
/obj/structure/displaycase/examine(mob/user)
..(user)
to_chat(user, "<span class='notice'>Peering through the glass, you see that it contains:</span>")
. = ..()
. += "<span class='notice'>Peering through the glass, you see that it contains:</span>"
if(occupant)
to_chat(user, "[bicon(occupant)] <span class='notice'>\A [occupant].</span>")
. += "[bicon(occupant)] <span class='notice'>\A [occupant].</span>"
else
to_chat(user, "Nothing.")
. += "Nothing."
/obj/structure/displaycase/proc/dump()
if(occupant)
@@ -30,28 +30,28 @@
return ..()
/obj/structure/door_assembly/examine(mob/user)
..()
. = ..()
var/doorname = ""
if(created_name)
doorname = ", written on it is '[created_name]'"
switch(state)
if(AIRLOCK_ASSEMBLY_NEEDS_WIRES)
if(anchored)
to_chat(user, "<span class='notice'>The anchoring bolts are <b>wrenched</b> in place, but the maintenance panel lacks <i>wiring</i>.</span>")
. += "<span class='notice'>The anchoring bolts are <b>wrenched</b> in place, but the maintenance panel lacks <i>wiring</i>.</span>"
else
to_chat(user, "<span class='notice'>The assembly is <b>welded together</b>, but the anchoring bolts are <i>unwrenched</i>.</span>")
. += "<span class='notice'>The assembly is <b>welded together</b>, but the anchoring bolts are <i>unwrenched</i>.</span>"
if(AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS)
to_chat(user, "<span class='notice'>The maintenance panel is <b>wired</b>, but the circuit slot is <i>empty</i>.</span>")
. += "<span class='notice'>The maintenance panel is <b>wired</b>, but the circuit slot is <i>empty</i>.</span>"
if(AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER)
to_chat(user, "<span class='notice'>The circuit is <b>connected loosely</b> to its slot, but the maintenance panel is <i>unscrewed and open</i>.</span>")
. += "<span class='notice'>The circuit is <b>connected loosely</b> to its slot, but the maintenance panel is <i>unscrewed and open</i>.</span>"
if(!mineral && !glass && !noglass)
to_chat(user, "<span class='notice'>There is a small <i>paper</i> placard on the assembly[doorname]. There are <i>empty</i> slots for glass windows and mineral covers.</span>")
. += "<span class='notice'>There is a small <i>paper</i> placard on the assembly[doorname]. There are <i>empty</i> slots for glass windows and mineral covers.</span>"
else if(!mineral && glass && !noglass)
to_chat(user, "<span class='notice'>There is a small <i>paper</i> placard on the assembly[doorname]. There are <i>empty</i> slots for mineral covers.</span>")
. += "<span class='notice'>There is a small <i>paper</i> placard on the assembly[doorname]. There are <i>empty</i> slots for mineral covers.</span>"
else if(mineral && !glass && !noglass)
to_chat(user, "<span class='notice'>There is a small <i>paper</i> placard on the assembly[doorname]. There are <i>empty</i> slots for glass windows.</span>")
. += "<span class='notice'>There is a small <i>paper</i> placard on the assembly[doorname]. There are <i>empty</i> slots for glass windows.</span>"
else
to_chat(user, "<span class='notice'>There is a small <i>paper</i> placard on the assembly[doorname].</span>")
. += "<span class='notice'>There is a small <i>paper</i> placard on the assembly[doorname].</span>"
/obj/structure/door_assembly/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pen))
+2 -2
View File
@@ -29,8 +29,8 @@
has_extinguisher = new/obj/item/extinguisher
/obj/structure/extinguisher_cabinet/examine(mob/user)
..()
to_chat(user, "<span class='notice'>Alt-click to [opened ? "close":"open"] it.</span>")
. = ..()
. += "<span class='notice'>Alt-click to [opened ? "close":"open"] it.</span>"
/obj/structure/extinguisher_cabinet/AltClick(mob/living/user)
if(!istype(user) || user.incapacitated())
+5 -5
View File
@@ -14,16 +14,16 @@
. = ..()
switch(state)
if(GIRDER_REINF)
to_chat(user, "<span class='notice'>The support struts are <b>screwed</b> in place.</span>")
. += "<span class='notice'>The support struts are <b>screwed</b> in place.</span>"
if(GIRDER_REINF_STRUTS)
to_chat(user, "<span class='notice'>The support struts are <i>unscrewed</i> and the inner <b>grille</b> is intact.</span>")
. += "<span class='notice'>The support struts are <i>unscrewed</i> and the inner <b>grille</b> is intact.</span>"
if(GIRDER_NORMAL)
if(can_displace)
to_chat(user, "<span class='notice'>The bolts are <b>lodged</b> in place.</span>")
. += "<span class='notice'>The bolts are <b>lodged</b> in place.</span>"
if(GIRDER_DISPLACED)
to_chat(user, "<span class='notice'>The bolts are <i>loosened</i>, but the <b>screws</b> are holding [src] together.</span>")
. += "<span class='notice'>The bolts are <i>loosened</i>, but the <b>screws</b> are holding [src] together.</span>"
if(GIRDER_DISASSEMBLED)
to_chat(user, "<span class='notice'>[src] is disassembled! You probably shouldn't be able to see this examine message.</span>")
. += "<span class='notice'>[src] is disassembled! You probably shouldn't be able to see this examine message.</span>"
/obj/structure/girder/proc/refundMetal(metalAmount) //refunds metal used in construction when deconstructed
for(var/i=0;i < metalAmount;i++)
+3 -3
View File
@@ -54,11 +54,11 @@
obj_break()
/obj/structure/grille/examine(mob/user)
..()
. = ..()
if(anchored)
to_chat(user, "<span class='notice'>It's secured in place with <b>screws</b>. The rods look like they could be <b>cut</b> through.</span>")
. += "<span class='notice'>It's secured in place with <b>screws</b>. The rods look like they could be <b>cut</b> through.</span>"
if(!anchored)
to_chat(user, "<span class='notice'>The anchoring screws are <i>unscrewed</i>. The rods look like they could be <b>cut</b> through.</span>")
. += "<span class='notice'>The anchoring screws are <i>unscrewed</i>. The rods look like they could be <b>cut</b> through.</span>"
/obj/structure/grille/ratvar_act()
if(broken)
+2 -4
View File
@@ -33,7 +33,7 @@
return ..()
/obj/structure/guillotine/examine(mob/user)
..()
. = ..()
var/msg = ""
@@ -53,9 +53,7 @@
msg += "<br/>"
msg += "Someone appears to be strapped in. You can help them out, or you can harm them by activating the guillotine."
to_chat(user, msg)
return msg
. += msg
/obj/structure/guillotine/attack_hand(mob/user)
add_fingerprint(user)
+3 -3
View File
@@ -22,11 +22,11 @@
QDEL_IN(LAT, 0)
/obj/structure/lattice/examine(mob/user)
..()
deconstruction_hints(user)
. = ..()
. += deconstruction_hints(user)
/obj/structure/lattice/proc/deconstruction_hints(mob/user)
to_chat(user, "<span class='notice'>The rods look like they could be <b>cut</b>. There's space for more <i>rods</i> or a <i>tile</i>.</span>")
return "<span class='notice'>The rods look like they could be <b>cut</b>. There's space for more <i>rods</i> or a <i>tile</i>.</span>"
/obj/structure/lattice/attackby(obj/item/C, mob/user, params)
if(resistance_flags & INDESTRUCTIBLE)
+3 -2
View File
@@ -21,8 +21,9 @@
return ..()
/obj/structure/mopbucket/examine(mob/user)
if(..(user, 1))
to_chat(usr, "[bicon(src)] [src] contains [reagents.total_volume] units of water left!")
. = ..()
if(in_range(user, src))
. += "[bicon(src)] [src] contains [reagents.total_volume] units of water left!"
/obj/structure/mopbucket/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/mop))
+2 -2
View File
@@ -13,9 +13,9 @@
. = ..()
switch(state)
if(PLASTIC_FLAPS_NORMAL)
to_chat(user, "<span class='notice'>[src] are <b>screwed</b> to the floor.</span>")
. += "<span class='notice'>[src] are <b>screwed</b> to the floor.</span>"
if(PLASTIC_FLAPS_DETACHED)
to_chat(user, "<span class='notice'>[src] are no longer <i>screwed</i> to the floor, and the flaps can be <b>sliced</b> apart.</span>")
. += "<span class='notice'>[src] are no longer <i>screwed</i> to the floor, and the flaps can be <b>sliced</b> apart.</span>"
/obj/structure/plasticflaps/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
+2 -2
View File
@@ -79,9 +79,9 @@ GLOBAL_LIST_EMPTY(safes)
/obj/structure/safe/examine(mob/user)
. = ..()
to_chat(user, "This model appears to have [number_of_tumblers] tumblers.")
. += "This model appears to have [number_of_tumblers] tumblers."
if(open)
to_chat(user, "The inside of the the door has numbers written on it: <b>[get_combination()]</b>")
. += "The inside of the the door has numbers written on it: <b>[get_combination()]</b>"
/obj/structure/safe/blob_act()
return
+2 -2
View File
@@ -11,8 +11,8 @@
var/lastuser = null
/obj/structure/spirit_board/examine(mob/user)
..(user)
to_chat(user, "[initial(desc)] The planchette is sitting at \"[planchette]\".")
. = ..()
. += "[initial(desc)] The planchette is sitting at \"[planchette]\"."
/obj/structure/spirit_board/attack_hand(mob/user as mob)
if(..())
+5 -5
View File
@@ -41,11 +41,11 @@
update_icon()
/obj/structure/table/examine(mob/user)
..()
deconstruction_hints(user)
. = ..()
. += deconstruction_hints(user)
/obj/structure/table/proc/deconstruction_hints(mob/user)
to_chat(user, "<span class='notice'>The top is <b>screwed</b> on, but the main <b>bolts</b> are also visible.</span>")
return "<span class='notice'>The top is <b>screwed</b> on, but the main <b>bolts</b> are also visible.</span>"
/obj/structure/table/update_icon()
if(smooth && !flipped)
@@ -648,8 +648,8 @@
max_integrity = 20
/obj/structure/rack/examine(mob/user)
..()
to_chat(user, "<span class='notice'>It's held together by a couple of <b>bolts</b>.</span>")
. = ..()
. += "<span class='notice'>It's held together by a couple of <b>bolts</b>.</span>"
/obj/structure/rack/CanPass(atom/movable/mover, turf/target, height=0)
if(height==0)
@@ -28,8 +28,8 @@
var/state = "01" //How far the door assembly has progressed
/obj/structure/windoor_assembly/examine(mob/user)
..()
to_chat(user, "<span class='notice'>Alt-click to rotate it clockwise.</span>")
. = ..()
. += "<span class='notice'>Alt-click to rotate it clockwise.</span>"
obj/structure/windoor_assembly/New(loc, set_dir)
..()
+8 -8
View File
@@ -49,23 +49,23 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
var/hitsound = 'sound/effects/Glasshit.ogg'
/obj/structure/window/examine(mob/user)
..()
. = ..()
if(reinf)
if(anchored && state == WINDOW_SCREWED_TO_FRAME)
to_chat(user, "<span class='notice'>The window is <b>screwed</b> to the frame.</span>")
. += "<span class='notice'>The window is <b>screwed</b> to the frame.</span>"
else if(anchored && state == WINDOW_IN_FRAME)
to_chat(user, "<span class='notice'>The window is <i>unscrewed</i> but <b>pried</b> into the frame.</span>")
. += "<span class='notice'>The window is <i>unscrewed</i> but <b>pried</b> into the frame.</span>"
else if(anchored && state == WINDOW_OUT_OF_FRAME)
to_chat(user, "<span class='notice'>The window is out of the frame, but could be <i>pried</i> in. It is <b>screwed</b> to the floor.</span>")
. += "<span class='notice'>The window is out of the frame, but could be <i>pried</i> in. It is <b>screwed</b> to the floor.</span>"
else if(!anchored)
to_chat(user, "<span class='notice'>The window is <i>unscrewed</i> from the floor, and could be deconstructed by <b>wrenching</b>.</span>")
. += "<span class='notice'>The window is <i>unscrewed</i> from the floor, and could be deconstructed by <b>wrenching</b>.</span>"
else
if(anchored)
to_chat(user, "<span class='notice'>The window is <b>screwed</b> to the floor.</span>")
. += "<span class='notice'>The window is <b>screwed</b> to the floor.</span>"
else
to_chat(user, "<span class='notice'>The window is <i>unscrewed</i> from the floor, and could be deconstructed by <b>wrenching</b>.</span>")
. += "<span class='notice'>The window is <i>unscrewed</i> from the floor, and could be deconstructed by <b>wrenching</b>.</span>"
if(!anchored && !fulltile)
to_chat(user, "<span class='notice'>Alt-click to rotate it.</span>")
. += "<span class='notice'>Alt-click to rotate it.</span>"
/obj/structure/window/New(Loc, direct)
..()