Rewrite examine() to pass a list around

This commit is contained in:
Aronai Sieyes
2020-04-29 16:42:50 -04:00
committed by VirgoBot
parent 8c5c0a7cfb
commit 6ebd249748
214 changed files with 2021 additions and 1120 deletions
@@ -363,13 +363,12 @@
max_storage_space = ITEMSIZE_COST_NORMAL * 5
/obj/item/weapon/storage/backpack/parachute/examine(mob/user)
var/msg = desc
if(get_dist(src, user) <= 1)
. = ..()
if(Adjacent(user))
if(parachute)
msg += " It seems to be packed."
. += "It seems to be packed."
else
msg += " It seems to be unpacked."
to_chat(user, msg)
. += "It seems to be unpacked."
/obj/item/weapon/storage/backpack/parachute/handleParachute()
parachute = FALSE //If you parachute in, the parachute has probably been used.
@@ -144,32 +144,30 @@
/obj/item/weapon/storage/bag/ore/examine(mob/user)
..()
. = ..()
if(!Adjacent(user)) //Can only check the contents of ore bags if you can physically reach them.
return
return .
if(istype(user, /mob/living))
add_fingerprint(user)
if(!contents.len)
to_chat(user, "It is empty.")
return
. += "It is empty."
if(world.time > last_update + 10)
else if(world.time > last_update + 10)
update_ore_count()
last_update = world.time
to_chat(user, "<span class='notice'>It holds:</span>")
for(var/ore in stored_ore)
to_chat(user, "<span class='notice'>- [stored_ore[ore]] [ore]</span>")
return
. += "<span class='notice'>It holds:</span>"
for(var/ore in stored_ore)
. += "<span class='notice'>- [stored_ore[ore]] [ore]</span>"
/obj/item/weapon/storage/bag/ore/open(mob/user as mob) //No opening it for the weird UI of having shit-tons of ore inside it.
if(world.time > last_update + 10)
update_ore_count()
last_update = world.time
examine(user)
user.examinate(src)
/obj/item/weapon/storage/bag/ore/proc/update_ore_count() //Stolen from ore boxes.
@@ -26,17 +26,15 @@
return
/obj/item/weapon/storage/fancy/examine(mob/user)
if(!..(user, 1))
return
. = ..()
if(contents.len <= 0)
to_chat(user, "There are no [icon_type]s left in the box.")
else if(contents.len == 1)
to_chat(user, "There is one [icon_type] left in the box.")
else
to_chat(user, "There are [contents.len] [icon_type]s in the box.")
return
if(Adjacent(user))
if(!contents.len)
. += "There are no [icon_type]s left in the box."
else if(contents.len == 1)
. += "There is one [icon_type] left in the box."
else
. += "There are [contents.len] [icon_type]s in the box."
/*
* Egg Box
@@ -24,7 +24,7 @@ MRE Stuff
/obj/item/weapon/storage/mre/examine(mob/user)
. = ..()
to_chat(user, meal_desc)
. += meal_desc
/obj/item/weapon/storage/mre/update_icon()
if(opened)
@@ -29,8 +29,9 @@
use_sound = 'sound/items/storage/briefcase.ogg'
examine(mob/user)
if(..(user, 1))
to_chat(user, "The service panel is [src.open ? "open" : "closed"].")
. = ..()
if(Adjacent(user))
. += "The service panel is [src.open ? "open" : "closed"]."
attackby(obj/item/weapon/W as obj, mob/user as mob)
if(locked)
@@ -722,10 +722,10 @@
..()
/obj/item/weapon/storage/trinketbox/examine(mob/user)
..()
. = ..()
if(open && contents.len)
var/display_item = contents[1]
to_chat(user, "<span class='notice'>\The [src] contains \the [display_item]!</span>")
. += "<span class='notice'>\The [src] contains \the [display_item]!</span>"
/obj/item/weapon/storage/AllowDrop()
return TRUE