mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Adds barricading of airlocks and doors (#17848)
* I like wood 😩 * Makes them faster to remove * 😩 * I hate molti Co-authored-by: Molti <108117184+Moltijoe@users.noreply.github.com> --------- Co-authored-by: Molti <108117184+Moltijoe@users.noreply.github.com>
This commit is contained in:
@@ -100,7 +100,7 @@
|
||||
if(I.tool_behaviour == TOOL_CROWBAR && user.a_intent != INTENT_HARM)
|
||||
user.visible_message("[user.name] starts prying [src.name] apart.", \
|
||||
span_notice("You start prying the barricade apart"))
|
||||
if(I.use_tool(src, user, 190, volume=50))
|
||||
if(I.use_tool(src, user, 10 SECONDS, volume=50))
|
||||
to_chat(user, span_notice("You disassemble the barricade."))
|
||||
new /obj/item/stack/sheet/mineral/wood(user.loc, 5)
|
||||
qdel(src)
|
||||
|
||||
@@ -238,6 +238,8 @@
|
||||
return max_moles - min_moles > 20
|
||||
|
||||
/obj/machinery/door/attackby(obj/item/I, mob/user, params)
|
||||
add_fingerprint(user)
|
||||
|
||||
if(user.a_intent != INTENT_HARM && (I.tool_behaviour == TOOL_CROWBAR || istype(I, /obj/item/twohanded/fireaxe)))
|
||||
try_to_crowbar(I, user)
|
||||
return 1
|
||||
|
||||
@@ -258,6 +258,23 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \
|
||||
recipes = GLOB.wood_recipes
|
||||
return ..()
|
||||
|
||||
/obj/item/stack/sheet/mineral/wood/attack_obj(obj/O, mob/living/user)
|
||||
if(istype(O, /obj/structure/window) || istype(O, /obj/machinery/door/airlock) || istype(O,/obj/machinery/door)) //I hate this but reportedly there is no other way :skull:
|
||||
for(var/obj/structure/barricade/wooden/crude/crude in get_turf(O))
|
||||
to_chat(user, span_warning("There is already a barricade there!"))
|
||||
return
|
||||
var/obj/item/stack/sheet/mineral/wood/W = src
|
||||
if(W.amount < 5)
|
||||
to_chat(user, span_warning("You need at least five wooden planks to barricade the [O]!"))
|
||||
return
|
||||
else
|
||||
to_chat(user, span_notice("You start adding [src] to [O]..."))
|
||||
if(do_after(user, 5 SECONDS, src))
|
||||
W.use(5)
|
||||
new /obj/structure/barricade/wooden/crude(get_turf(O))
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/stack/sheet/mineral/wood/attackby(obj/item/item, mob/user, params)
|
||||
if(item.get_sharpness())
|
||||
user.visible_message(
|
||||
|
||||
@@ -176,18 +176,6 @@
|
||||
|
||||
add_fingerprint(user)
|
||||
|
||||
if(istype(I,/obj/item/stack/sheet/mineral/wood))
|
||||
var/obj/item/stack/sheet/mineral/wood/W = I
|
||||
if(W.amount < 5)
|
||||
to_chat(user, span_warning("You need at least five wooden planks to barricade the window!"))
|
||||
return
|
||||
else
|
||||
to_chat(user, span_notice("You start adding [I] to [src]..."))
|
||||
if(do_after(user, 5 SECONDS, src))
|
||||
W.use(5)
|
||||
new /obj/structure/barricade/wooden/crude(get_turf(src))
|
||||
return
|
||||
|
||||
if(I.tool_behaviour == TOOL_WELDER && user.a_intent == INTENT_HELP)
|
||||
if(obj_integrity < max_integrity)
|
||||
if(!I.tool_start_check(user, amount=0))
|
||||
|
||||
Reference in New Issue
Block a user