mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 20:43:10 +01:00
Door rigging tool (#18899)
Added a door rigging tool, it allows you to mine a door, so that when it opens, it explodes. Requires the door to be welded shut first. Added a box and antag uplink item for the above. --------- Signed-off-by: Fluffy <65877598+FluffyGhoster@users.noreply.github.com> Co-authored-by: Geeves <ggrobler447@gmail.com>
This commit is contained in:
@@ -196,6 +196,69 @@
|
||||
fragem(src,num_fragments,num_fragments,explosion_size,explosion_size+1,fragment_damage,damage_step,TRUE)
|
||||
qdel(src)
|
||||
|
||||
/**
|
||||
* # Door Rigging Landmine
|
||||
*
|
||||
* A landmine that will explode when the door it is attached to opens
|
||||
*/
|
||||
/obj/item/landmine/frag/door_rigging
|
||||
name = "door rigging landmine"
|
||||
fragment_damage = 20
|
||||
|
||||
///The airlock that we are observing for when it opens, to explode
|
||||
var/obj/machinery/door/airlock/door_rigged
|
||||
|
||||
//Prevent this mine to be used like a normal one
|
||||
/obj/item/landmine/frag/door_rigging/attack_self(mob/user)
|
||||
to_chat(user, SPAN_ALERT("This landmine is not usable in this way, you need to apply it to a door."))
|
||||
return
|
||||
|
||||
/obj/item/landmine/frag/door_rigging/resolve_attackby(atom/A, mob/user, click_parameters)
|
||||
. = ..()
|
||||
|
||||
if(istype(A, /obj/machinery/door/airlock))
|
||||
|
||||
door_rigged = A
|
||||
var/turf/turf_under_door = get_turf(door_rigged)
|
||||
|
||||
//Prevent people from exploding themselves by targeting a door that will open once clicked
|
||||
if(!door_rigged.welded || !door_rigged.density || !istype(turf_under_door) || locate(/obj/item/landmine) in turf_under_door)
|
||||
to_chat(user, SPAN_WARNING("The door is not welded, is open, is already rigged or does not have a turf below it."))
|
||||
door_rigged = null //Clean up the var
|
||||
return
|
||||
|
||||
//Take a little to do this
|
||||
if(!do_after(user, 10 SECONDS, door_rigged))
|
||||
door_rigged = null
|
||||
return
|
||||
|
||||
RegisterSignal(door_rigged, COMSIG_QDELETING, PROC_REF(handle_door_qdel))
|
||||
|
||||
deploy(user)
|
||||
src.forceMove(turf_under_door)
|
||||
|
||||
activate(user)
|
||||
|
||||
START_PROCESSING(SSfast_process, src)
|
||||
|
||||
/obj/item/landmine/frag/door_rigging/process(seconds_per_tick)
|
||||
if(QDELETED(door_rigged))
|
||||
STOP_PROCESSING(SSfast_process, src)
|
||||
qdel(src)
|
||||
|
||||
if(!door_rigged.density)
|
||||
STOP_PROCESSING(SSfast_process, src)
|
||||
trigger(null)
|
||||
|
||||
///Clear the reference and delete the mine if the door gets deleted
|
||||
/obj/item/landmine/frag/door_rigging/proc/handle_door_qdel()
|
||||
SIGNAL_HANDLER
|
||||
|
||||
door_rigged = null
|
||||
STOP_PROCESSING(SSfast_process, src)
|
||||
qdel(src)
|
||||
|
||||
|
||||
/**
|
||||
* # Radiation Landmine
|
||||
*
|
||||
|
||||
@@ -1276,6 +1276,11 @@
|
||||
desc = "A box containing 5 standstill landmines."
|
||||
starts_with = list(/obj/item/landmine/standstill = 5)
|
||||
|
||||
/obj/item/storage/box/landmines/door_rigging
|
||||
name = "box of door rigging landmines"
|
||||
desc = "A box containing 5 door rigging landmines."
|
||||
starts_with = list(/obj/item/landmine/frag/door_rigging = 5)
|
||||
|
||||
/obj/item/storage/box/landmines/claymore
|
||||
name = "box of claymore landmines"
|
||||
desc = "A box containing 5 claymore landmines, relative detonators, and a spare one to trigger them all."
|
||||
|
||||
Reference in New Issue
Block a user