Rewrite examine() to pass a list around (#7038)

This commit is contained in:
Aronai Sieyes
2020-04-29 16:42:16 -04:00
committed by GitHub
parent fee5f1771d
commit 6c6644f86c
214 changed files with 1062 additions and 1151 deletions

View File

@@ -22,14 +22,14 @@
setLabel(R.name)
/obj/item/weapon/reagent_containers/chem_disp_cartridge/examine(mob/user)
..()
to_chat(user, "It has a capacity of [volume] units.")
. = ..()
. += "It has a capacity of [volume] units."
if(reagents.total_volume <= 0)
to_chat(user, "It is empty.")
. += "It is empty."
else
to_chat(user, "It contains [reagents.total_volume] units of liquid.")
. += "It contains [reagents.total_volume] units of liquid."
if(!is_open_container())
to_chat(user, "The cap is sealed.")
. += "The cap is sealed."
/obj/item/weapon/reagent_containers/chem_disp_cartridge/verb/verb_set_label(L as text)
set name = "Set Cartridge Label"

View File

@@ -26,8 +26,8 @@
add_cartridge(new type(src))
/obj/machinery/chemical_dispenser/examine(mob/user)
..()
to_chat(user, "It has [cartridges.len] cartridges installed, and has space for [DISPENSER_MAX_CARTRIDGES - cartridges.len] more.")
. = ..()
. += "It has [cartridges.len] cartridges installed, and has space for [DISPENSER_MAX_CARTRIDGES - cartridges.len] more."
/obj/machinery/chemical_dispenser/proc/add_cartridge(obj/item/weapon/reagent_containers/chem_disp_cartridge/C, mob/user)
if(!istype(C))

View File

@@ -109,31 +109,31 @@
..()
/obj/machinery/portable_atmospherics/powered/reagent_distillery/examine(mob/user)
..()
if(get_dist(user, src) < 3)
to_chat(user, "<span class='notice'>\The [src] is powered [on ? "on" : "off"].</span>")
. = ..()
if(get_dist(user, src) <= 2)
. += "<span class='notice'>\The [src] is powered [on ? "on" : "off"].</span>"
to_chat(user, "<span class='notice'>\The [src]'s gauges read:</span>")
. += "<span class='notice'>\The [src]'s gauges read:</span>"
if(!use_atmos)
to_chat(user, "<span class='notice'>- Target Temperature:</span> <span class='warning'>[target_temp]</span>")
to_chat(user, "<span class='notice'>- Temperature:</span> <span class='warning'>[current_temp]</span>")
. += "<span class='notice'>- Target Temperature:</span> <span class='warning'>[target_temp]</span>"
. += "<span class='notice'>- Temperature:</span> <span class='warning'>[current_temp]</span>"
if(InputBeaker)
if(InputBeaker.reagents.reagent_list.len)
to_chat(user, "<span class='notice'>\The [src]'s input beaker holds [InputBeaker.reagents.total_volume] units of liquid.</span>")
. += "<span class='notice'>\The [src]'s input beaker holds [InputBeaker.reagents.total_volume] units of liquid.</span>"
else
to_chat(user, "<span class='notice'>\The [src]'s input beaker is empty!</span>")
. += "<span class='notice'>\The [src]'s input beaker is empty!</span>"
if(Reservoir.reagents.reagent_list.len)
to_chat(user, "<span class='notice'>\The [src]'s internal buffer holds [Reservoir.reagents.total_volume] units of liquid.</span>")
. += "<span class='notice'>\The [src]'s internal buffer holds [Reservoir.reagents.total_volume] units of liquid.</span>"
else
to_chat(user, "<span class='notice'>\The [src]'s internal buffer is empty!</span>")
. += "<span class='notice'>\The [src]'s internal buffer is empty!</span>"
if(OutputBeaker)
if(OutputBeaker.reagents.reagent_list.len)
to_chat(user, "<span class='notice'>\The [src]'s output beaker holds [OutputBeaker.reagents.total_volume] units of liquid.</span>")
. += "<span class='notice'>\The [src]'s output beaker holds [OutputBeaker.reagents.total_volume] units of liquid.</span>"
else
to_chat(user, "<span class='notice'>\The [src]'s output beaker is empty!</span>")
. += "<span class='notice'>\The [src]'s output beaker is empty!</span>"
/obj/machinery/portable_atmospherics/powered/reagent_distillery/verb/toggle_power(mob/user = usr)
set name = "Toggle Distillery Heating"
@@ -186,7 +186,7 @@
switch(choice)
if("examine")
examine(user)
user.examinate(src)
if("use")
toggle_power(user)

View File

@@ -116,12 +116,10 @@
to_chat(usr, "<span class='notice'>Synthesizer is now producing '[R.name]'.</span>")
/obj/item/weapon/reagent_containers/borghypo/examine(mob/user)
if(!..(user, 2))
return
var/datum/reagent/R = SSchemistry.chemical_reagents[reagent_ids[mode]]
to_chat(user, "<span class='notice'>It is currently producing [R.name] and has [reagent_volumes[reagent_ids[mode]]] out of [volume] units left.</span>")
. = ..()
if(get_dist(user, src) <= 2)
var/datum/reagent/R = SSchemistry.chemical_reagents[reagent_ids[mode]]
. += "<span class='notice'>It is currently producing [R.name] and has [reagent_volumes[reagent_ids[mode]]] out of [volume] units left.</span>"
/obj/item/weapon/reagent_containers/borghypo/service
name = "cyborg drink synthesizer"

View File

@@ -14,12 +14,12 @@
drop_sound = 'sound/items/drop/glass.ogg'
/obj/item/weapon/reagent_containers/dropper/examine(var/mob/user)
if(!..(user, 2))
return
if(reagents && reagents.reagent_list.len)
to_chat(user, "<span class='notice'>It contains [reagents.total_volume] units of liquid.</span>")
else
to_chat(user, "<span class='notice'>It is empty.</span>")
. = ..()
if(get_dist(user, src) <= 2)
if(reagents && reagents.reagent_list.len)
. += "<span class='notice'>It contains [reagents.total_volume] units of liquid.</span>"
else
. += "<span class='notice'>It is empty.</span>"
/obj/item/weapon/reagent_containers/dropper/afterattack(var/obj/target, var/mob/user, var/proximity)
if(!target.reagents || !proximity) return

View File

@@ -59,14 +59,14 @@
base_desc = desc
/obj/item/weapon/reagent_containers/glass/examine(var/mob/user)
if(!..(user, 2))
return
if(reagents && reagents.reagent_list.len)
to_chat(user, "<span class='notice'>It contains [reagents.total_volume] units of liquid.</span>")
else
to_chat(user, "<span class='notice'>It is empty.</span>")
if(!is_open_container())
to_chat(user, "<span class='notice'>Airtight lid seals it completely.</span>")
. = ..()
if(get_dist(user, src) <= 2)
if(reagents && reagents.reagent_list.len)
. += "<span class='notice'>It contains [reagents.total_volume] units of liquid.</span>"
else
. += "<span class='notice'>It is empty.</span>"
if(!is_open_container())
. += "<span class='notice'>Airtight lid seals it completely.</span>"
/obj/item/weapon/reagent_containers/glass/attack_self()
..()

View File

@@ -164,11 +164,11 @@
icon_state = "[initial(icon_state)]0"
/obj/item/weapon/reagent_containers/hypospray/autoinjector/examine(mob/user)
. = ..(user)
. = ..()
if(reagents && reagents.reagent_list.len)
to_chat(user, "<span class='notice'>It is currently loaded.</span>")
. += "<span class='notice'>It is currently loaded.</span>"
else
to_chat(user, "<span class='notice'>It is spent.</span>")
. += "<span class='notice'>It is spent.</span>"
/obj/item/weapon/reagent_containers/hypospray/autoinjector/detox
name = "autoinjector (antitox)"

View File

@@ -79,9 +79,9 @@
to_chat(user, "<span class='notice'>You adjusted the pressure nozzle. You'll now use [amount_per_transfer_from_this] units per spray.</span>")
/obj/item/weapon/reagent_containers/spray/examine(mob/user)
if(..(user, 0) && loc == user)
to_chat(user, "[round(reagents.total_volume)] units left.")
return
. = ..()
if(loc == user)
. += "[round(reagents.total_volume)] units left."
/obj/item/weapon/reagent_containers/spray/verb/empty()
@@ -133,8 +133,9 @@
reagents.add_reagent("condensedcapsaicin", 40)
/obj/item/weapon/reagent_containers/spray/pepper/examine(mob/user)
if(..(user, 1))
to_chat(user, "The safety is [safety ? "on" : "off"].")
. = ..()
if(Adjacent(user))
. += "The safety is [safety ? "on" : "off"]."
/obj/item/weapon/reagent_containers/spray/pepper/attack_self(var/mob/user)
safety = !safety

View File

@@ -25,14 +25,14 @@
. = ..()
/obj/structure/reagent_dispensers/examine(mob/user)
if(!..(user, 2))
return
to_chat(user, "<span class='notice'>It contains:</span>")
if(reagents && reagents.reagent_list.len)
for(var/datum/reagent/R in reagents.reagent_list)
to_chat(user, "<span class='notice'>[R.volume] units of [R.name]</span>")
else
to_chat(user, "<span class='notice'>Nothing.</span>")
. = ..()
if(get_dist(user, src) <= 2)
. += "<span class='notice'>It contains:</span>"
if(reagents && reagents.reagent_list.len)
for(var/datum/reagent/R in reagents.reagent_list)
. += "<span class='notice'>[R.volume] units of [R.name]</span>"
else
. += "<span class='notice'>Nothing.</span>"
/obj/structure/reagent_dispensers/verb/set_APTFT() //set amount_per_transfer_from_this
set name = "Set transfer amount"
@@ -100,12 +100,12 @@
reagents.add_reagent("fuel",1000)
/obj/structure/reagent_dispensers/fueltank/examine(mob/user)
if(!..(user, 2))
return
if (modded)
to_chat(user, "<span class='warning'>Fuel faucet is wrenched open, leaking the fuel!</span>")
if(rig)
to_chat(user, "<span class='notice'>There is some kind of device rigged to the tank.</span>")
. = ..()
if(get_dist(user, src) <= 2)
if(modded)
. += "<span class='warning'>Fuel faucet is wrenched open, leaking the fuel!</span>"
if(rig)
. += "<span class='notice'>There is some kind of device rigged to the tank.</span>"
/obj/structure/reagent_dispensers/fueltank/attack_hand()
if (rig)
@@ -234,9 +234,9 @@
update_icon()
/obj/structure/reagent_dispensers/water_cooler/examine(mob/user)
..()
. = ..()
if(cupholder)
to_chat(user, "<span class='notice'>There are [cups] cups in the cup dispenser.</span>")
. += "<span class='notice'>There are [cups] cups in the cup dispenser.</span>"
/obj/structure/reagent_dispensers/water_cooler/attackby(obj/item/I as obj, mob/user as mob)
if(I.is_wrench())