Update action.dm
This commit is contained in:
+18
-11
@@ -494,6 +494,7 @@
|
||||
else
|
||||
to_chat(owner, "<span class='cultitalic'>Your hands are full!</span>")
|
||||
|
||||
//MGS Box
|
||||
/datum/action/item_action/agent_box
|
||||
name = "Deploy Box"
|
||||
desc = "Find inner peace, here, in the box."
|
||||
@@ -502,21 +503,27 @@
|
||||
icon_icon = 'icons/mob/actions/actions_items.dmi'
|
||||
button_icon_state = "deploy_box"
|
||||
var/cooldown = 0
|
||||
var/obj/structure/closet/cardboard/agent/box
|
||||
var/boxtype = /obj/structure/closet/cardboard/agent
|
||||
|
||||
//Handles open and closing the box
|
||||
/datum/action/item_action/agent_box/Trigger()
|
||||
if(!..())
|
||||
. = ..()
|
||||
if(!.)
|
||||
return FALSE
|
||||
if(QDELETED(box))
|
||||
if(cooldown < world.time - 100)
|
||||
box = new(owner.drop_location())
|
||||
owner.forceMove(box)
|
||||
cooldown = world.time
|
||||
owner.playsound_local(box, 'sound/misc/box_deploy.ogg', 50, TRUE)
|
||||
else
|
||||
owner.forceMove(box.drop_location())
|
||||
if(istype(owner.loc, /obj/structure/closet/cardboard/agent))
|
||||
var/obj/structure/closet/cardboard/agent/box = owner.loc
|
||||
owner.playsound_local(box, 'sound/misc/box_deploy.ogg', 50, TRUE)
|
||||
box.open()
|
||||
return
|
||||
//Box closing from here on out.
|
||||
if(!isturf(owner.loc)) //Don't let the player use this to escape mechs/welded closets.
|
||||
to_chat(owner, "<span class = 'notice'>You need more space to activate this implant.</span>")
|
||||
return
|
||||
if(cooldown < world.time - 100)
|
||||
var/box = new boxtype(owner.drop_location())
|
||||
owner.forceMove(box)
|
||||
cooldown = world.time
|
||||
owner.playsound_local(box, 'sound/misc/box_deploy.ogg', 50, TRUE)
|
||||
QDEL_NULL(box)
|
||||
|
||||
//Preset for spells
|
||||
/datum/action/spell_action
|
||||
|
||||
Reference in New Issue
Block a user