From d48dad04af1fe27b63a97ec6dab70dc33038bfd4 Mon Sep 17 00:00:00 2001 From: Sealed101 <75863639+Sealed101@users.noreply.github.com> Date: Sun, 5 Sep 2021 18:41:20 +0300 Subject: [PATCH] Blast doors & shutters fixes & cleanup: toolspeed, sounds, player feedback (#61204) Blast doors & shutters were using do_after for their deconstruction steps without taking toolspeed into the account. This PR replaces this by use_tool, so better tools actually do the steps faster. It also brings back the sounds for each step. Screwdrivering the panel open/closed no longer produces two messages. Moved two defines to their rightful place. Each step now also provides feedback to the player upon completion. It used to just give you the You start ... but no You finish ... Wack. --- code/__DEFINES/construction.dm | 5 +++++ code/game/machinery/doors/poddoor.dm | 29 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/code/__DEFINES/construction.dm b/code/__DEFINES/construction.dm index bf9dba1f7d2..ccc5955520a 100644 --- a/code/__DEFINES/construction.dm +++ b/code/__DEFINES/construction.dm @@ -36,6 +36,11 @@ #define AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS 1 #define AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER 2 +//blast door (de)construction states +#define BLASTDOOR_NEEDS_WIRES 0 +#define BLASTDOOR_NEEDS_ELECTRONICS 1 +#define BLASTDOOR_FINISHED 2 + //default_unfasten_wrench() return defines #define CANT_UNFASTEN 0 #define FAILED_UNFASTEN 1 diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm index 61eb6fd6e8c..bc4d1102fc1 100644 --- a/code/game/machinery/doors/poddoor.dm +++ b/code/game/machinery/doors/poddoor.dm @@ -1,9 +1,3 @@ - -//blast door (de)construction states -#define BLASTDOOR_NEEDS_WIRES 0 -#define BLASTDOOR_NEEDS_ELECTRONICS 1 -#define BLASTDOOR_FINISHED 2 - /obj/machinery/door/poddoor name = "blast door" desc = "A heavy duty blast door that opens mechanically." @@ -28,10 +22,9 @@ if(W.tool_behaviour == TOOL_SCREWDRIVER) if(density) - to_chat(user, span_warning("You need to open [src] before opening its maintenance panel.")) + balloon_alert(user, "open the door first!") return else if(default_deconstruction_screwdriver(user, icon_state, icon_state, W)) - to_chat(user, span_notice("You [panel_open ? "open" : "close"] the maintenance hatch of [src].")) return TRUE if(panel_open) @@ -40,33 +33,39 @@ if(change_id) id = clamp(round(change_id, 1), 1, 100) to_chat(user, span_notice("You change the ID to [id].")) + balloon_alert(user, "ID changed") else if(W.tool_behaviour == TOOL_CROWBAR && deconstruction == BLASTDOOR_FINISHED) - to_chat(user, span_notice("You start to remove the airlock electronics.")) - if(do_after(user, 10 SECONDS, target = src)) + balloon_alert(user, "removing airlock electronics...") + if(W.use_tool(src, user, 100, volume=50)) new /obj/item/electronics/airlock(loc) id = null deconstruction = BLASTDOOR_NEEDS_ELECTRONICS + balloon_alert(user, "removed airlock electronics") + return TRUE else if(W.tool_behaviour == TOOL_WIRECUTTER && deconstruction == BLASTDOOR_NEEDS_ELECTRONICS) - to_chat(user, span_notice("You start to remove the internal cables.")) - if(do_after(user, 10 SECONDS, target = src)) + balloon_alert(user, "removing internal cables...") + if(W.use_tool(src, user, 100, volume=50)) var/datum/crafting_recipe/recipe = locate(recipe_type) in GLOB.crafting_recipes var/amount = recipe.reqs[/obj/item/stack/cable_coil] new /obj/item/stack/cable_coil(loc, amount) deconstruction = BLASTDOOR_NEEDS_WIRES + balloon_alert(user, "removed internal cables") + return TRUE else if(W.tool_behaviour == TOOL_WELDER && deconstruction == BLASTDOOR_NEEDS_WIRES) if(!W.tool_start_check(user, amount=0)) return - to_chat(user, span_notice("You start tearing apart the [src].")) - playsound(src.loc, 'sound/items/welder.ogg', 50, 1) - if(do_after(user, 15 SECONDS, target = src)) + balloon_alert(user, "tearing apart...") //You're tearing me apart, Lisa! + if(W.use_tool(src, user, 150, volume=50)) var/datum/crafting_recipe/recipe = locate(recipe_type) in GLOB.crafting_recipes var/amount = recipe.reqs[/obj/item/stack/sheet/plasteel] new /obj/item/stack/sheet/plasteel(loc, amount) + user.balloon_alert(user, "torn apart") qdel(src) + return TRUE /obj/machinery/door/poddoor/examine(mob/user) . = ..()