Adds Door/Window Barricading Mechanics (#31417)

* redoes entire pr to prevent linters and stuff

* teehee silly me i forgot to fix this

* some small fixes

* hp changes

* code formatting stuff

Co-authored-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>
Signed-off-by: SPACEGEESE <136994596+spacegeese@users.noreply.github.com>

* formatting

Co-authored-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>
Signed-off-by: SPACEGEESE <136994596+spacegeese@users.noreply.github.com>

* removes var that doesn't need to exist

* review+linters

* more linters

* OOPS

Co-authored-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>
Signed-off-by: SPACEGEESE <136994596+spacegeese@users.noreply.github.com>

* removes an src.

Signed-off-by: SPACEGEESE <136994596+spacegeese@users.noreply.github.com>

* Revert "removes an src."

This reverts commit 1716bf7e60.

* review+consistency

* review, some fixes, and consistency

* Apply suggestions from code review

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: SPACEGEESE <136994596+spacegeese@users.noreply.github.com>

* review

* Apply suggestions from code review

Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
Signed-off-by: SPACEGEESE <136994596+spacegeese@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
Signed-off-by: SPACEGEESE <136994596+spacegeese@users.noreply.github.com>

* call me jesus because i just converted someone into a NONE

* Apply suggestions from code review

Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
Signed-off-by: SPACEGEESE <136994596+spacegeese@users.noreply.github.com>

* formatting stuff

Co-authored-by: kyunkyunkyun <120701975+kyunkyunkyun@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: SPACEGEESE <136994596+spacegeese@users.noreply.github.com>

* success

* e

* Update door.dm

* Update code/game/machinery/deployable.dm

Co-authored-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>

* Update deployable.dm

* Update code/game/machinery/deployable.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>

---------

Signed-off-by: SPACEGEESE <136994596+spacegeese@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
Co-authored-by: spacegeese <136994596+spacegeese@users.noreply.github.com>
Co-authored-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: kyunkyunkyun <120701975+kyunkyunkyun@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
CRUNCH
2026-01-27 01:38:47 +00:00
committed by GitHub
parent 369804d665
commit 6c294803a2
4 changed files with 256 additions and 35 deletions
+56 -8
View File
@@ -25,6 +25,8 @@
var/damageSound = null
/// How much foam is on the door. Max 5 levels.
var/foam_level = 0
/// Is this door barricaded?
var/barricaded = FALSE
/obj/structure/mineral_door/examine(mob/user)
. = ..()
@@ -78,6 +80,8 @@
return
if(foam_level)
return
if(barricaded)
return
if(isliving(user))
var/mob/living/M = user
if(M.client)
@@ -124,7 +128,11 @@
/obj/structure/mineral_door/screwdriver_act(mob/living/user, obj/item/I)
if(flags & NODECONSTRUCT)
to_chat(user, SPAN_WARNING("You can't figure out how to deconstruct [src]!"))
return TRUE
return COMPONENT_CANCEL_ATTACK_CHAIN
if(barricaded)
to_chat(user, SPAN_WARNING("There's boards stopping you from levering [src]!"))
return COMPONENT_CANCEL_ATTACK_CHAIN
if(!I.use_tool(src, user, 4 SECONDS * I.toolspeed * hardness, volume = I.tool_volume))
return TRUE
@@ -132,22 +140,28 @@
deconstruct(TRUE)
return TRUE
/obj/structure/mineral_door/item_interaction(mob/living/user, obj/item/W, list/modifiers)
if(istype(W, /obj/item/pickaxe))
/obj/structure/mineral_door/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(istype(used, /obj/item/stack/sheet/wood))
build_barricade(user, used)
if(istype(used, /obj/item/pickaxe))
if(flags & NODECONSTRUCT)
to_chat(user, SPAN_WARNING("You can't figure out how to deconstruct [src]!"))
return
var/obj/item/pickaxe/digTool = W
return ITEM_INTERACT_COMPLETE
var/obj/item/pickaxe/digTool = used
to_chat(user, SPAN_NOTICE("You start digging \the [src]."))
if(do_after(user, 4 SECONDS * digTool.toolspeed * hardness, target = src) && src)
to_chat(user, SPAN_NOTICE("You finished digging."))
deconstruct(TRUE)
return ITEM_INTERACT_COMPLETE
else if(user.a_intent != INTENT_HARM)
if(user.a_intent != INTENT_HARM)
attack_hand(user)
return ITEM_INTERACT_COMPLETE
else
return ..()
return ..()
/obj/structure/mineral_door/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
@@ -159,6 +173,40 @@
new sheetType(T, max(sheetAmount - 2, 1))
qdel(src)
/obj/structure/mineral_door/proc/build_barricade(mob/living/user, obj/item/stack/sheet/wood/used)
if(barricaded)
to_chat(user, SPAN_WARNING("[src] is already barricaded!"))
return
if(used.get_amount() < 2)
to_chat(user, SPAN_WARNING("You need at least two planks of wood to barricade [src]!"))
return
if(!density)
to_chat(user, SPAN_WARNING("[src] needs to be closed before it can be barricaded!"))
return
to_chat(user, SPAN_NOTICE("You begin boarding up [src]..."))
if(!do_after_once(user, 4 SECONDS, target = src))
return
/// Quick checks to make sure nothing has changed during the timer.
if(!density || barricaded)
return
if(!used.use(2))
to_chat(user, SPAN_WARNING("You've run out of planks!"))
return
user.visible_message(
SPAN_WARNING("[user] boards up [src]!"),
SPAN_NOTICE("You board up [src]."),
SPAN_WARNING("You hear planks being nailed into something!")
)
var/obj/structure/barricade/wooden/crude/boards = new(loc)
boards.add_fingerprint(user)
barricaded = TRUE
/obj/structure/mineral_door/silver
name = "silver door"
desc = "An old-fashioned door built from two slabs of silver. Somehow completely airtight, and doesn't require any electricity to work."
+57 -2
View File
@@ -41,7 +41,8 @@
var/superconductivity = WINDOW_HEAT_TRANSFER_COEFFICIENT
/// How much we get activated by gamma radiation
var/rad_conversion_amount = 0
/// Are we boarded up?
var/barricaded = FALSE
/obj/structure/window/rad_act(atom/source, amount, emission_type)
if(emission_type == GAMMA_RAD && amount * rad_conversion_amount > RAD_BACKGROUND_RADIATION)
@@ -219,6 +220,10 @@
return
add_fingerprint(user)
if(istype(I, /obj/item/stack/sheet/wood))
build_barricade(user, I)
return
if(istype(I, /obj/item/stack/rods) && user.a_intent == INTENT_HELP)
for(var/obj/structure/grille/G in get_turf(src))
if(!G.broken)
@@ -257,7 +262,6 @@
else
return ..()
/obj/structure/window/crowbar_act(mob/user, obj/item/I)
if(!reinf)
return
@@ -523,6 +527,43 @@
/obj/structure/window/GetExplosionBlock()
return reinf && fulltile ? real_explosion_block : 0
/obj/structure/window/proc/build_barricade(mob/living/user, obj/item/stack/sheet/wood/used)
if(!fulltile)
return
if(barricaded)
to_chat(user, SPAN_WARNING("[src] is already barricaded!"))
return
if(used.get_amount() < 2)
to_chat(user, SPAN_WARNING("You need at least two planks of wood to barricade [src]!"))
return
if(!density)
to_chat(user, SPAN_WARNING("[src] needs to be secured before it can be barricaded!"))
return
to_chat(user, SPAN_NOTICE("You begin boarding up [src]..."))
if(!do_after_once(user, 4 SECONDS, target = src))
return
/// Quick checks to make sure nothing has changed during the timer.
if(!density || barricaded)
return
if(!used.use(2))
to_chat(user, SPAN_WARNING("You've run out of planks!"))
return
user.visible_message(
SPAN_WARNING("[user] boards up [src]!"),
SPAN_NOTICE("You board up [src]."),
SPAN_WARNING("You hear planks being nailed into something!")
)
var/obj/structure/barricade/wooden/crude/boards = new(loc)
boards.add_fingerprint(user)
barricaded = TRUE
/obj/structure/window/basic
desc = "It looks thin and flimsy. A few knocks with... anything, really should shatter it. Lacks protection from radiation."
@@ -709,6 +750,20 @@
smoothing_groups = list(SMOOTH_GROUP_WINDOW_FULLTILE, SMOOTH_GROUP_REGULAR_WALLS, SMOOTH_GROUP_REINFORCED_WALLS) //they are not walls but this lets walls smooth with them
canSmoothWith = list(SMOOTH_GROUP_WINDOW_FULLTILE, SMOOTH_GROUP_WALLS)
/obj/structure/window/full/screwdriver_act(mob/user, obj/item/I)
if(barricaded)
to_chat(user, SPAN_WARNING("There's boards in the way of [src]'s screws!"))
return COMPONENT_CANCEL_ATTACK_CHAIN
return ..()
/obj/structure/window/full/crowbar_act(mob/user, obj/item/I)
if(barricaded)
to_chat(user, SPAN_WARNING("There's boards stopping you from levering [src]!"))
return COMPONENT_CANCEL_ATTACK_CHAIN
return ..()
/obj/structure/window/full/basic
desc = "It looks thin and flimsy. A few knocks with... anything, really should shatter it. Has very light protection from radiation"
icon = 'icons/obj/smooth_structures/windows/window.dmi'