mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
## About The Pull Request This PR moves most of the code for using an item to commit suicide from `human` to `living`, so that anything with hands can use what it is holding to commit suicide. This was surprisingly painless, as most `suicide_act` procs were already written without the assumption that the person killing themselves was a human even though they couldn't be anything else. This might occasionally mean that in some cases (like drones) it may reference anatomy that they don't have (like necks) but I think that's not a big deal and don't worry about it. ## Why It's Good For The Game It's funny. ## Changelog 🆑 balance: Anything with hands can now use the things it is holding to commit suicide /🆑
60 lines
2.1 KiB
Plaintext
60 lines
2.1 KiB
Plaintext
///MGS BOX!
|
|
/datum/action/item_action/agent_box
|
|
name = "Deploy Box"
|
|
desc = "Find inner peace, here, in the box."
|
|
check_flags = AB_CHECK_INCAPACITATED|AB_CHECK_HANDS_BLOCKED|AB_CHECK_IMMOBILE|AB_CHECK_CONSCIOUS
|
|
background_icon_state = "bg_agent"
|
|
overlay_icon_state = "bg_agent_border"
|
|
button_icon = 'icons/mob/actions/actions_items.dmi'
|
|
button_icon_state = "deploy_box"
|
|
///The type of closet this action spawns.
|
|
var/boxtype = /obj/structure/closet/cardboard/agent
|
|
COOLDOWN_DECLARE(box_cooldown)
|
|
|
|
///Handles opening and closing the box.
|
|
/datum/action/item_action/agent_box/do_effect(trigger_flags)
|
|
. = ..()
|
|
if(!.)
|
|
return FALSE
|
|
if(istype(owner.loc, /obj/structure/closet/cardboard/agent))
|
|
var/obj/structure/closet/cardboard/agent/box = owner.loc
|
|
if(box.open())
|
|
owner.playsound_local(box, 'sound/misc/box_deploy.ogg', 50, TRUE)
|
|
return FALSE
|
|
//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_warning("You need more space to activate this implant!"))
|
|
return FALSE
|
|
if(!COOLDOWN_FINISHED(src, box_cooldown))
|
|
return FALSE
|
|
COOLDOWN_START(src, box_cooldown, 10 SECONDS)
|
|
var/box = new boxtype(owner.drop_location())
|
|
owner.forceMove(box)
|
|
owner.playsound_local(box, 'sound/misc/box_deploy.ogg', 50, TRUE)
|
|
|
|
/datum/action/item_action/agent_box/Grant(mob/grant_to)
|
|
. = ..()
|
|
if(owner)
|
|
RegisterSignal(owner, COMSIG_LIVING_SUICIDE_ACT, PROC_REF(suicide_act))
|
|
|
|
/datum/action/item_action/agent_box/Remove(mob/M)
|
|
if(owner)
|
|
UnregisterSignal(owner, COMSIG_LIVING_SUICIDE_ACT)
|
|
return ..()
|
|
|
|
/datum/action/item_action/agent_box/proc/suicide_act(datum/source)
|
|
SIGNAL_HANDLER
|
|
|
|
if(!istype(owner.loc, /obj/structure/closet/cardboard/agent))
|
|
return
|
|
|
|
var/obj/structure/closet/cardboard/agent/box = owner.loc
|
|
owner.playsound_local(box, 'sound/misc/box_deploy.ogg', 50, TRUE)
|
|
box.open()
|
|
owner.visible_message(span_suicide("[owner] falls out of [box]! It looks like [owner.p_they()] committed suicide!"))
|
|
owner.throw_at(get_turf(owner))
|
|
if(isliving(owner))
|
|
var/mob/living/suicider = owner
|
|
suicider.suicide_log()
|
|
return OXYLOSS
|