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
co-authored by CRUNCH DGamerL kyunkyunkyun Luc PollardTheDragon Burzah spacegeese
parent 369804d665
commit 6c294803a2
4 changed files with 256 additions and 35 deletions
+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'