mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 13:10:02 +01:00
Blast door refactor and fix (#58231)
* - refactored blast door code - moved shutters/bumpopen() to shutters.dm - fixed infinite deconstruct blast doors for free airlock electronics * keep recipe as ref * moved recipe variable to a local scope Co-authored-by: norill <4>
This commit is contained in:
@@ -38,7 +38,6 @@
|
||||
var/datum/effect_system/spark_spread/spark_system
|
||||
var/real_explosion_block //ignore this, just use explosion_block
|
||||
var/red_alert_access = FALSE //if TRUE, this door will always open on red alert
|
||||
var/poddoor = FALSE
|
||||
var/unres_sides = 0 //Unrestricted sides. A bitflag for which direction (if any) can open the door with no access
|
||||
var/safety_mode = FALSE ///Whether or not the airlock can be opened with bare hands while unpowered
|
||||
var/can_crush = TRUE /// Whether or not the door can crush mobs.
|
||||
@@ -51,8 +50,7 @@
|
||||
. += "<span class='notice'>Due to a security threat, its access requirements have been lifted!</span>"
|
||||
else
|
||||
. += "<span class='notice'>In the event of a red alert, its access requirements will automatically lift.</span>"
|
||||
if(!poddoor)
|
||||
. += "<span class='notice'>Its maintenance panel is <b>screwed</b> in place.</span>"
|
||||
. += "<span class='notice'>Its maintenance panel is <b>screwed</b> in place.</span>"
|
||||
if(safety_mode)
|
||||
. += "<span class='notice'>It has labels indicating that it has an emergency mechanism to open it with <b>just your hands</b> if there's no power.</span>"
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
|
||||
//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."
|
||||
@@ -14,15 +20,11 @@
|
||||
armor = list(MELEE = 50, BULLET = 100, LASER = 100, ENERGY = 100, BOMB = 50, BIO = 100, RAD = 100, FIRE = 100, ACID = 70)
|
||||
resistance_flags = FIRE_PROOF
|
||||
damage_deflection = 70
|
||||
poddoor = TRUE
|
||||
var/ertblast = FALSE //If this is true the blast door cannot be deconstructed
|
||||
var/deconstruction = INTACT //For the deconstruction steps
|
||||
var/datum/crafting_recipe/recipe_type = /datum/crafting_recipe/blast_doors
|
||||
var/deconstruction = BLASTDOOR_FINISHED // deconstruction step
|
||||
|
||||
/obj/machinery/door/poddoor/attackby(obj/item/W, mob/user, params)
|
||||
. = ..()
|
||||
if(ertblast && W.tool_behaviour == TOOL_SCREWDRIVER) // This makes it so ERT members cannot cheese by opening their blast doors.
|
||||
to_chat(user, "<span class='warning'>This shutter has a different kind of screw, you cannot unscrew the panel open.</span>")
|
||||
return
|
||||
|
||||
if(W.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
if(density)
|
||||
@@ -33,35 +35,48 @@
|
||||
return TRUE
|
||||
|
||||
if(panel_open)
|
||||
if(W.tool_behaviour == TOOL_MULTITOOL)
|
||||
if(W.tool_behaviour == TOOL_MULTITOOL && deconstruction == BLASTDOOR_FINISHED)
|
||||
var/change_id = input("Set the shutters/blast door/blast door controllers ID. It must be a number between 1 and 100.", "ID", id) as num|null
|
||||
if(change_id)
|
||||
id = clamp(round(change_id, 1), 1, 100)
|
||||
to_chat(user, "<span class='notice'>You change the ID to [id].</span>")
|
||||
|
||||
if(W.tool_behaviour == TOOL_CROWBAR && deconstruction == INTACT)
|
||||
else if(W.tool_behaviour == TOOL_CROWBAR && deconstruction == BLASTDOOR_FINISHED)
|
||||
to_chat(user, "<span class='notice'>You start to remove the airlock electronics.</span>")
|
||||
if(do_after(user, 10 SECONDS, target = src))
|
||||
new /obj/item/electronics/airlock(loc)
|
||||
id = null
|
||||
deconstruction = FALSE
|
||||
deconstruction = BLASTDOOR_NEEDS_ELECTRONICS
|
||||
|
||||
if(W.tool_behaviour == TOOL_WIRECUTTER && deconstruction == FALSE)
|
||||
else if(W.tool_behaviour == TOOL_WIRECUTTER && deconstruction == BLASTDOOR_NEEDS_ELECTRONICS)
|
||||
to_chat(user, "<span class='notice'>You start to remove the internal cables.</span>")
|
||||
if(do_after(user, 10 SECONDS, target = src))
|
||||
deconstruction = TRUE
|
||||
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
|
||||
|
||||
else if(W.tool_behaviour == TOOL_WELDER && deconstruction == BLASTDOOR_NEEDS_WIRES)
|
||||
if(!W.tool_start_check(user, amount=0))
|
||||
return
|
||||
|
||||
if(W.tool_behaviour == TOOL_WELDER && deconstruction == TRUE)
|
||||
to_chat(user, "<span class='notice'>You start tearing apart the [src].</span>")
|
||||
playsound(src.loc, 'sound/items/welder.ogg', 50, 1)
|
||||
if(do_after(user, 15 SECONDS, target = src))
|
||||
new /obj/item/stack/sheet/plasteel(loc, 5)
|
||||
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)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/door/poddoor/examine(mob/user)
|
||||
. = ..()
|
||||
if(panel_open)
|
||||
. += "<span class='<span class='notice'>The maintenance panel is [panel_open ? "opened" : "closed"].</span>"
|
||||
if(deconstruction == BLASTDOOR_FINISHED)
|
||||
. += "<span class='notice'>The maintenance panel is opened and the electronics could be <b>pried</b> out.</span>"
|
||||
else if(deconstruction == BLASTDOOR_NEEDS_ELECTRONICS)
|
||||
. += "<span class='notice'>The <i>electronics</i> are missing and there are some <b>wires</b> sticking out.</span>"
|
||||
else if(deconstruction == BLASTDOOR_NEEDS_WIRES)
|
||||
. += "<span class='notice'>The <i>wires</i> have been removed and it's ready to be <b>sliced apart</b>.</span>"
|
||||
|
||||
/obj/machinery/door/poddoor/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock)
|
||||
id = "[port.id]_[id]"
|
||||
@@ -74,12 +89,10 @@
|
||||
/obj/machinery/door/poddoor/ert
|
||||
name = "hardened blast door"
|
||||
desc = "A heavy duty blast door that only opens for dire emergencies."
|
||||
ertblast = TRUE
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
||||
|
||||
//special poddoors that open when emergency shuttle docks at centcom
|
||||
/obj/machinery/door/poddoor/shuttledock
|
||||
ertblast = TRUE
|
||||
var/checkdir = 4 //door won't open if turf in this dir is `turftype`
|
||||
var/turftype = /turf/open/space
|
||||
|
||||
@@ -136,9 +149,6 @@
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/door/poddoor/shutters/bumpopen()
|
||||
return
|
||||
|
||||
//"BLAST" doors are obviously stronger than regular doors when it comes to BLASTS.
|
||||
/obj/machinery/door/poddoor/ex_act(severity, target)
|
||||
if(severity == EXPLODE_LIGHT)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
damage_deflection = 20
|
||||
armor = list("melee" = 20, "bullet" = 20, "laser" = 20, "energy" = 75, "bomb" = 25, "bio" = 100, "rad" = 100, "fire" = 100, "acid" = 70)
|
||||
max_integrity = 100
|
||||
recipe_type = /datum/crafting_recipe/shutters
|
||||
|
||||
/obj/machinery/door/poddoor/shutters/preopen
|
||||
icon_state = "open"
|
||||
@@ -16,7 +17,6 @@
|
||||
|
||||
/obj/machinery/door/poddoor/shutters/indestructible
|
||||
name = "hardened shutters"
|
||||
ertblast = TRUE
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
||||
|
||||
/obj/machinery/door/poddoor/shutters/radiation
|
||||
@@ -51,3 +51,6 @@
|
||||
/obj/machinery/door/poddoor/shutters/window/preopen
|
||||
icon_state = "open"
|
||||
density = FALSE
|
||||
|
||||
/obj/machinery/door/poddoor/shutters/bumpopen()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user