mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 15:47:15 +01:00
Extinguisher cabinet resprite (#85961)
## About The Pull Request Extinguisher cabinets are now Extinguisher racks, which serve the same function but are much, much easier to see.   ## Why It's Good For The Game Visual clarity is nice, a featureless grey box, is not. ## Changelog 🆑 sprite: Extinguisher cabinets are now extinguisher racks, which are much easier to see. /🆑 --------- Co-authored-by: ZephyrTFA <matthew@tfaluc.com>
This commit is contained in:
@@ -1,22 +1,19 @@
|
||||
/obj/structure/extinguisher_cabinet
|
||||
name = "extinguisher cabinet"
|
||||
desc = "A small wall mounted cabinet designed to hold a fire extinguisher."
|
||||
name = "extinguisher rack"
|
||||
desc = "A small wall mounted rack designed to hold a fire extinguisher."
|
||||
icon = 'icons/obj/structures/cabinet.dmi'
|
||||
icon_state = "cabinet"
|
||||
icon_state = "rack"
|
||||
anchored = TRUE
|
||||
density = FALSE
|
||||
max_integrity = 200
|
||||
integrity_failure = 0.25
|
||||
var/obj/item/extinguisher/stored_extinguisher
|
||||
var/opened = FALSE
|
||||
|
||||
WALL_MOUNT_DIRECTIONAL_HELPERS(/obj/structure/extinguisher_cabinet)
|
||||
|
||||
/obj/structure/extinguisher_cabinet/Initialize(mapload, ndir, building)
|
||||
. = ..()
|
||||
if(building)
|
||||
opened = TRUE
|
||||
else
|
||||
if(!building)
|
||||
stored_extinguisher = new /obj/item/extinguisher(src)
|
||||
update_appearance(UPDATE_ICON)
|
||||
register_context()
|
||||
@@ -27,9 +24,8 @@ WALL_MOUNT_DIRECTIONAL_HELPERS(/obj/structure/extinguisher_cabinet)
|
||||
. = ..()
|
||||
|
||||
if(isnull(held_item))
|
||||
context[SCREENTIP_CONTEXT_RMB] = opened ? "Close" : "Open"
|
||||
if(stored_extinguisher)
|
||||
context[SCREENTIP_CONTEXT_LMB] = "Take extinguisher" //Yes, this shows whether or not it's open! Extinguishers are taken immediately on LMB click when closed
|
||||
context[SCREENTIP_CONTEXT_LMB] = "Take extinguisher"
|
||||
return CONTEXTUAL_SCREENTIP_SET
|
||||
|
||||
if(stored_extinguisher)
|
||||
@@ -38,10 +34,9 @@ WALL_MOUNT_DIRECTIONAL_HELPERS(/obj/structure/extinguisher_cabinet)
|
||||
if(held_item.tool_behaviour == TOOL_WRENCH)
|
||||
context[SCREENTIP_CONTEXT_LMB] = "Disassemble cabinet"
|
||||
return CONTEXTUAL_SCREENTIP_SET
|
||||
if(istype(held_item, /obj/item/extinguisher) && opened)
|
||||
if(istype(held_item, /obj/item/extinguisher))
|
||||
context[SCREENTIP_CONTEXT_LMB] = "Insert extinguisher"
|
||||
return CONTEXTUAL_SCREENTIP_SET
|
||||
|
||||
return .
|
||||
|
||||
/obj/structure/extinguisher_cabinet/Destroy()
|
||||
@@ -68,18 +63,18 @@ WALL_MOUNT_DIRECTIONAL_HELPERS(/obj/structure/extinguisher_cabinet)
|
||||
|
||||
/obj/structure/extinguisher_cabinet/attackby(obj/item/used_item, mob/living/user, params)
|
||||
if(used_item.tool_behaviour == TOOL_WRENCH && !stored_extinguisher)
|
||||
user.balloon_alert(user, "deconstructing cabinet...")
|
||||
user.balloon_alert(user, "deconstructing rack...")
|
||||
used_item.play_tool_sound(src)
|
||||
if(used_item.use_tool(src, user, 60))
|
||||
playsound(loc, 'sound/items/deconstruct.ogg', 50, TRUE)
|
||||
user.balloon_alert(user, "cabinet deconstructed")
|
||||
user.balloon_alert(user, "rack deconstructed")
|
||||
deconstruct(TRUE)
|
||||
return
|
||||
|
||||
if(iscyborg(user) || isalien(user))
|
||||
return
|
||||
if(istype(used_item, /obj/item/extinguisher))
|
||||
if(!stored_extinguisher && opened)
|
||||
if(!stored_extinguisher)
|
||||
if(!user.transferItemToLoc(used_item, src))
|
||||
return
|
||||
stored_extinguisher = used_item
|
||||
@@ -87,9 +82,7 @@ WALL_MOUNT_DIRECTIONAL_HELPERS(/obj/structure/extinguisher_cabinet)
|
||||
update_appearance(UPDATE_ICON)
|
||||
return TRUE
|
||||
else
|
||||
toggle_cabinet(user)
|
||||
else if(!user.combat_mode)
|
||||
toggle_cabinet(user)
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -103,18 +96,6 @@ WALL_MOUNT_DIRECTIONAL_HELPERS(/obj/structure/extinguisher_cabinet)
|
||||
if(stored_extinguisher)
|
||||
user.put_in_hands(stored_extinguisher)
|
||||
user.balloon_alert(user, "extinguisher removed")
|
||||
if(!opened)
|
||||
opened = 1
|
||||
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
|
||||
update_appearance(UPDATE_ICON)
|
||||
else
|
||||
toggle_cabinet(user)
|
||||
|
||||
/obj/structure/extinguisher_cabinet/attack_hand_secondary(mob/living/user)
|
||||
if(!user.can_perform_action(src, NEED_DEXTERITY|NEED_HANDS|ALLOW_RESTING))
|
||||
return ..()
|
||||
toggle_cabinet(user)
|
||||
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
|
||||
|
||||
/obj/structure/extinguisher_cabinet/attack_tk(mob/user)
|
||||
. = COMPONENT_CANCEL_ATTACK_CHAIN
|
||||
@@ -122,29 +103,16 @@ WALL_MOUNT_DIRECTIONAL_HELPERS(/obj/structure/extinguisher_cabinet)
|
||||
stored_extinguisher.forceMove(loc)
|
||||
to_chat(user, span_notice("You telekinetically remove [stored_extinguisher] from [src]."))
|
||||
stored_extinguisher = null
|
||||
opened = TRUE
|
||||
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
|
||||
update_appearance(UPDATE_ICON)
|
||||
return
|
||||
toggle_cabinet(user)
|
||||
|
||||
|
||||
/obj/structure/extinguisher_cabinet/attack_paw(mob/user, list/modifiers)
|
||||
return attack_hand(user, modifiers)
|
||||
|
||||
/obj/structure/extinguisher_cabinet/proc/toggle_cabinet(mob/user)
|
||||
if(opened && broken)
|
||||
user.balloon_alert(user, "it's broken!")
|
||||
else
|
||||
playsound(loc, 'sound/machines/click.ogg', 15, TRUE, -3)
|
||||
opened = !opened
|
||||
update_appearance(UPDATE_ICON)
|
||||
|
||||
/obj/structure/extinguisher_cabinet/atom_break(damage_flag)
|
||||
. = ..()
|
||||
if(!broken)
|
||||
broken = 1
|
||||
opened = 1
|
||||
if(stored_extinguisher)
|
||||
stored_extinguisher.forceMove(loc)
|
||||
stored_extinguisher = null
|
||||
@@ -163,14 +131,10 @@ WALL_MOUNT_DIRECTIONAL_HELPERS(/obj/structure/extinguisher_cabinet)
|
||||
. = ..()
|
||||
if(stored_extinguisher)
|
||||
. += stored_extinguisher.cabinet_icon_state
|
||||
if(opened)
|
||||
. += "cabinet_door_open"
|
||||
else
|
||||
. += "cabinet_door_closed"
|
||||
|
||||
/obj/item/wallframe/extinguisher_cabinet
|
||||
name = "extinguisher cabinet frame"
|
||||
name = "extinguisher rack frame"
|
||||
desc = "Used for building wall-mounted extinguisher cabinets."
|
||||
icon = 'icons/obj/structures/cabinet.dmi'
|
||||
icon_state = "cabinet"
|
||||
icon_state = "rack"
|
||||
result_path = /obj/structure/extinguisher_cabinet
|
||||
|
||||
Reference in New Issue
Block a user