From f882fc0762fa8d042e7022f3c579a2cf8e71a120 Mon Sep 17 00:00:00 2001
From: "Wowzewow (Wezzy)" <42310821+alsoandanswer@users.noreply.github.com>
Date: Wed, 10 Jun 2020 14:03:13 +0800
Subject: [PATCH] Fixes bodybag examine text (#9066)
It was incorrectly using closet examine code and it incorrectly kept displaying it as empty.
This should resolve that issue.
Also tides up code here and there and some cleanup.
PR'd again, in an attempt to stop travis cloning itself.
Also makes a proc out of the examine to make things cleaner I guess
---
code/game/objects/items/bodybag.dm | 46 ++++++++++++------
.../structures/crates_lockers/closets.dm | 23 +++++----
html/changelogs/wezzy_bodybag_fixes.yml | 41 ++++++++++++++++
icons/obj/bodybag.dmi | Bin 4007 -> 778 bytes
4 files changed, 84 insertions(+), 26 deletions(-)
create mode 100644 html/changelogs/wezzy_bodybag_fixes.yml
diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm
index e2fad0595e0..eb09ae79abf 100644
--- a/code/game/objects/items/bodybag.dm
+++ b/code/game/objects/items/bodybag.dm
@@ -6,12 +6,14 @@
icon = 'icons/obj/bodybag.dmi'
icon_state = "bodybag_folded"
w_class = 2.0
+ drop_sound = 'sound/items/drop/cloth.ogg'
+ pickup_sound = 'sound/items/pickup/cloth.ogg'
- attack_self(mob/user)
- var/obj/structure/closet/body_bag/R = new /obj/structure/closet/body_bag(user.loc)
- R.add_fingerprint(user)
- qdel(src)
-
+/obj/item/bodybag/attack_self(mob/user)
+ var/obj/structure/closet/body_bag/R = new /obj/structure/closet/body_bag(user.loc)
+ R.add_fingerprint(user)
+ playsound(src, 'sound/items/drop/cloth.ogg', 30)
+ qdel(src)
/obj/item/storage/box/bodybags
name = "body bags"
@@ -27,7 +29,6 @@
new /obj/item/bodybag(src)
new /obj/item/bodybag(src)
-
/obj/structure/closet/body_bag
name = "body bag"
desc = "A plastic bag designed for the storage and transportation of cadavers."
@@ -37,11 +38,24 @@
icon_opened = "bodybag_open"
open_sound = 'sound/items/zip.ogg'
close_sound = 'sound/items/zip.ogg'
- var/item_path = /obj/item/bodybag
density = 0
storage_capacity = 30
+ var/item_path = /obj/item/bodybag
var/contains_body = 0
+/obj/structure/closet/body_bag/content_info(mob/user, content_size)
+ if(!content_size && !contains_body)
+ to_chat(user, "\The [src] is empty.")
+ else if(storage_capacity > content_size*4)
+ to_chat(user, "\The [src] is barely filled.")
+ else if(storage_capacity > content_size*2)
+ to_chat(user, "\The [src] is less than half full.")
+ else if(storage_capacity > content_size)
+ to_chat(user, "\The [src] still has some free space.")
+ else
+ to_chat(user, "\The [src] is full.")
+ to_chat(user, "It [contains_body ? "contains" : "does not contain"] a body.")
+
/obj/structure/closet/body_bag/attackby(var/obj/item/W, mob/user as mob)
if (W.ispen())
var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text
@@ -53,13 +67,15 @@
if (t)
src.name = "body bag - "
src.name += t
+ playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20)
add_overlay("bodybag_label")
else
src.name = "body bag"
//..() //Doesn't need to run the parent. Since when can fucking bodybags be welded shut? -Agouri
return
else if(W.iswirecutter())
- to_chat(user, "You cut the tag off the bodybag")
+ to_chat(user, "You cut the tag off the bodybag.")
+ playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
src.name = "body bag"
cut_overlays()
return
@@ -80,7 +96,7 @@
if(!ishuman(usr)) return
if(opened) return 0
if(contents.len) return 0
- visible_message("[usr] folds up the [src.name]")
+ playsound(src, 'sound/items/pickup/cloth.ogg', 15)
new item_path(get_turf(src))
spawn(0)
qdel(src)
@@ -95,9 +111,8 @@
else
icon_state = icon_closed
-
/obj/item/bodybag/cryobag
- name = "stasis bag"
+ name = "cryogenic stasis bag"
desc = "A folded, non-reusable bag designed to prevent additional damage to an occupant at the cost of genetic damage."
icon = 'icons/obj/cryobag.dmi'
icon_state = "bodybag_folded"
@@ -105,12 +120,11 @@
/obj/item/bodybag/cryobag/attack_self(mob/user)
var/obj/structure/closet/body_bag/cryobag/R = new /obj/structure/closet/body_bag/cryobag(user.loc)
R.add_fingerprint(user)
+ playsound(src, 'sound/items/drop/cloth.ogg', 30)
qdel(src)
-
-
/obj/structure/closet/body_bag/cryobag
- name = "stasis bag"
+ name = "cryogenic stasis bag"
desc = "A non-reusable plastic bag designed to prevent additional damage to an occupant at the cost of genetic damage."
icon = 'icons/obj/cryobag.dmi'
item_path = /obj/item/bodybag/cryobag
@@ -125,11 +139,11 @@
O.name = "used stasis bag"
O.icon = src.icon
O.icon_state = "bodybag_used"
- O.desc = "Pretty useless now.."
+ O.desc = "Pretty useless now."
qdel(src)
/obj/structure/closet/body_bag/cryobag/MouseDrop(over_object, src_location, over_location)
if((over_object == usr && (in_range(src, usr) || usr.contents.Find(src))))
if(!ishuman(usr)) return
- to_chat(usr, "You can't fold that up anymore..")
+ to_chat(usr, SPAN_WARNING("You can't fold that up anymore."))
..()
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index da238d9e635..40448842192 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -51,22 +51,25 @@
// Fill lockers with this.
/obj/structure/closet/proc/fill()
+/obj/structure/closet/proc/content_info(mob/user, content_size)
+ if(!content_size)
+ to_chat(user, "\The [src] is empty.")
+ else if(storage_capacity > content_size*4)
+ to_chat(user, "\The [src] is barely filled.")
+ else if(storage_capacity > content_size*2)
+ to_chat(user, "\The [src] is less than half full.")
+ else if(storage_capacity > content_size)
+ to_chat(user, "\The [src] still has some free space.")
+ else
+ to_chat(user, "\The [src] is full.")
+
/obj/structure/closet/examine(mob/user)
if(..(user, 1) && !opened)
var/content_size = 0
for(var/obj/item/I in contents)
if(!I.anchored)
content_size += Ceiling(I.w_class/2)
- if(!content_size)
- to_chat(user, "It is empty.")
- else if(storage_capacity > content_size*4)
- to_chat(user, "It is barely filled.")
- else if(storage_capacity > content_size*2)
- to_chat(user, "It is less than half full.")
- else if(storage_capacity > content_size)
- to_chat(user, "There is still some free space.")
- else
- to_chat(user, "It is full.")
+ content_info(user, content_size)
/obj/structure/closet/proc/stored_weight()
var/content_size = 0
diff --git a/html/changelogs/wezzy_bodybag_fixes.yml b/html/changelogs/wezzy_bodybag_fixes.yml
new file mode 100644
index 00000000000..546f524e691
--- /dev/null
+++ b/html/changelogs/wezzy_bodybag_fixes.yml
@@ -0,0 +1,41 @@
+################################
+# Example Changelog File
+#
+# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
+#
+# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
+# When it is, any changes listed below will disappear.
+#
+# Valid Prefixes:
+# bugfix
+# wip (For works in progress)
+# tweak
+# soundadd
+# sounddel
+# rscadd (general adding of nice things)
+# rscdel (general deleting of nice things)
+# imageadd
+# imagedel
+# maptweak
+# spellcheck (typo fixes)
+# experiment
+# balance
+# admin
+# backend
+# security
+# refactor
+#################################
+
+# Your name.
+author: Wowzewow (Wezzy)
+
+# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
+delete-after: True
+
+# Any changes you've made. See valid prefix list above.
+# INDENT WITH TWO SPACES. NOT TABS. SPACES.
+# SCREW THIS UP AND IT WON'T WORK.
+# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
+# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
+changes:
+ - bugfix: "Fixed bodybag examine text."
diff --git a/icons/obj/bodybag.dmi b/icons/obj/bodybag.dmi
index a1f990312809ec446985c852e3ff8267b223bef2..f693b9ffb3d6f79840b7e193246bdc80e706fc35 100644
GIT binary patch
delta 767
zcmV0d!JMQvg8b*k%9#0FHW8Sad{XbAMxUX>fFDZ*Bkpc$`yK
zaB_9`^iy#0_2eo`Eh^5;&r`5fFwryM;w;ZhDainGjE%TBGg33tGfE(w;*!LYR3K9+
zDL`qSdG6=cJI}
zmYl?-)Er!@m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