From 5cbd2deb516da97b236dc63e11c2248878659fec Mon Sep 17 00:00:00 2001 From: DragonTrance Date: Sun, 9 Jan 2022 16:48:47 -0700 Subject: [PATCH] Various suicide_act() things (#63808) --- .../signals/signals_mob/signals_mob_carbon.dm | 3 ++ code/datums/action.dm | 23 +++++++++++ code/game/objects/items/crayons.dm | 1 + code/game/objects/items/food/_food.dm | 1 - code/game/objects/items/food/burgers.dm | 6 +++ code/game/objects/items/food/misc.dm | 13 ++++++- .../objects/items/implants/implant_stealth.dm | 1 - code/game/objects/items/storage/boxes.dm | 8 ++++ code/game/objects/items/storage/briefcase.dm | 24 ++++++++++++ .../eldritch_cult/eldritch_magic.dm | 38 +++++++++++++++++-- code/modules/client/verbs/suicide.dm | 6 ++- code/modules/clothing/glasses/hud.dm | 14 +++++++ code/modules/clothing/head/tinfoilhat.dm | 25 ++++++++++++ code/modules/mob/living/living.dm | 4 ++ .../mob/living/simple_animal/hostile/bees.dm | 6 +++ 15 files changed, 164 insertions(+), 9 deletions(-) diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm index 83211757340..ea5faafe3e7 100644 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm +++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm @@ -85,3 +85,6 @@ #define COMSIG_HUMAN_MONKEYIZE "human_monkeyize" ///Called when a monkey turns into a human, from /mob/living/carbon/proc/finish_humanize(species) #define COMSIG_MONKEY_HUMANIZE "monkey_humanize" + +///From mob/living/carbon/human/suicide() +#define COMSIG_HUMAN_SUICIDE_ACT "human_suicide_act" diff --git a/code/datums/action.dm b/code/datums/action.dm index bf364530486..a00b97bbb59 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -580,6 +580,29 @@ owner.forceMove(box) owner.playsound_local(box, 'sound/misc/box_deploy.ogg', 50, TRUE) +/datum/action/item_action/agent_box/Grant(mob/M) + . = ..() + if(owner) + RegisterSignal(owner, COMSIG_HUMAN_SUICIDE_ACT, .proc/suicide_act) + +/datum/action/item_action/agent_box/Remove(mob/M) + if(owner) + UnregisterSignal(owner, COMSIG_HUMAN_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)) + return OXYLOSS + //Preset for spells /datum/action/spell_action check_flags = NONE diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 09793630d96..5fc5cd2d37f 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -75,6 +75,7 @@ /obj/item/toy/crayon/suicide_act(mob/user) user.visible_message(span_suicide("[user] is jamming [src] up [user.p_their()] nose and into [user.p_their()] brain. It looks like [user.p_theyre()] trying to commit suicide!")) + user.add_atom_colour(paint_color) return (BRUTELOSS|OXYLOSS) /obj/item/toy/crayon/Initialize(mapload) diff --git a/code/game/objects/items/food/_food.dm b/code/game/objects/items/food/_food.dm index f2991861cbb..520bcd6a687 100644 --- a/code/game/objects/items/food/_food.dm +++ b/code/game/objects/items/food/_food.dm @@ -107,4 +107,3 @@ /obj/item/food/proc/MakeDecompose(mapload) if(!preserved_food) AddComponent(/datum/component/decomposition, mapload, decomp_req_handle, decomp_flags = foodtypes, decomp_result = decomp_type, ant_attracting = ant_attracting) - diff --git a/code/game/objects/items/food/burgers.dm b/code/game/objects/items/food/burgers.dm index ed62988f871..d3153dd17c1 100644 --- a/code/game/objects/items/food/burgers.dm +++ b/code/game/objects/items/food/burgers.dm @@ -297,6 +297,12 @@ foodtypes = GRAIN | MEAT | DAIRY venue_value = FOOD_PRICE_EXOTIC +/obj/item/food/burger/superbite/suicide_act(mob/user) + user.visible_message(span_suicide("[user] starts to eat [src] in one bite, it looks like [user.p_theyre()] trying to commit suicide!")) + var/datum/component/edible/component = GetComponent(/datum/component/edible) + component?.TakeBite(user, user) + return OXYLOSS + /obj/item/food/burger/fivealarm name = "five alarm burger" desc = "HOT! HOT!" diff --git a/code/game/objects/items/food/misc.dm b/code/game/objects/items/food/misc.dm index cd0a3794f9e..679b19cf34b 100644 --- a/code/game/objects/items/food/misc.dm +++ b/code/game/objects/items/food/misc.dm @@ -445,6 +445,11 @@ /// The amount to metabolize per second var/metabolization_amount = REAGENTS_METABOLISM / 2 +/obj/item/food/bubblegum/suicide_act(mob/user) + user.visible_message(span_suicide("[user] swallows [src]! It looks like [user.p_theyre()] trying to commit suicide!")) + qdel(src) + return TOXLOSS + /obj/item/food/bubblegum/Initialize(mapload) . = ..() AddElement(/datum/element/chewable, metabolization_amount = metabolization_amount) @@ -469,6 +474,8 @@ food_reagents = list(/datum/reagent/blood = 15) tastes = list("hell" = 1) metabolization_amount = REAGENTS_METABOLISM + /// What the player hears from the bubblegum hallucination, and also says one of these when suiciding + var/static/list/hallucination_lines = list("I AM IMMORTAL.", "I SHALL TAKE YOUR WORLD.", "I SEE YOU.", "YOU CANNOT ESCAPE ME FOREVER.", "NOTHING CAN HOLD ME.") /obj/item/food/bubblegum/bubblegum/process() . = ..() @@ -499,10 +506,14 @@ return if(prob(15)) new /datum/hallucination/oh_yeah(victim) - to_chat(victim, span_colossus("[pick("I AM IMMORTAL.", "I SHALL TAKE YOUR WORLD.", "I SEE YOU.", "YOU CANNOT ESCAPE ME FOREVER.", "NOTHING CAN HOLD ME.")]")) + to_chat(victim, span_colossus("[pick(hallucination_lines)]")) else to_chat(victim, span_warning("[pick("You hear faint whispers.", "You smell ash.", "You feel hot.", "You hear a roar in the distance.")]")) +/obj/item/food/bubblegum/bubblegum/suicide_act(mob/user) + user.say(";[pick(hallucination_lines)]") + return ..() + /obj/item/food/gumball name = "gumball" desc = "A colorful, sugary gumball." diff --git a/code/game/objects/items/implants/implant_stealth.dm b/code/game/objects/items/implants/implant_stealth.dm index 66d3f2328df..7ef672e63c7 100644 --- a/code/game/objects/items/implants/implant_stealth.dm +++ b/code/game/objects/items/implants/implant_stealth.dm @@ -24,7 +24,6 @@ . = ..() go_invisible() - /obj/structure/closet/cardboard/agent/open(mob/living/user, force = FALSE) . = ..() qdel(src) diff --git a/code/game/objects/items/storage/boxes.dm b/code/game/objects/items/storage/boxes.dm index 733db662e7b..ceeab922b03 100644 --- a/code/game/objects/items/storage/boxes.dm +++ b/code/game/objects/items/storage/boxes.dm @@ -845,6 +845,14 @@ else return ..() +/obj/item/storage/box/clown/suicide_act(mob/user) + user.visible_message(span_suicide("[user] opens [src] and gets consumed by [p_them()]! It looks like [user.p_theyre()] trying to commit suicide!")) + playsound(user, 'sound/misc/scary_horn.ogg', 70, vary = TRUE) + var/obj/item/clothing/head/mob_holder/consumed = new(src, user) + user.forceMove(consumed) + consumed.desc = "It's [user.real_name]! It looks like [user.p_they()] committed suicide!" + return OXYLOSS + ////// /obj/item/storage/box/hug/medical/PopulateContents() new /obj/item/stack/medical/bruise_pack(src) diff --git a/code/game/objects/items/storage/briefcase.dm b/code/game/objects/items/storage/briefcase.dm index 582564b9a01..9ca87910be6 100644 --- a/code/game/objects/items/storage/briefcase.dm +++ b/code/game/objects/items/storage/briefcase.dm @@ -35,6 +35,30 @@ new /obj/item/stamp/law(src) ..() +/obj/item/storage/briefcase/suicide_act(mob/user) + var/list/papers_found = list() + var/turf/item_loc = get_turf(src) + + if(!item_loc) + return OXYLOSS + + for(var/obj/item/potentially_paper in contents) + if(istype(potentially_paper, /obj/item/paper) || istype(potentially_paper, /obj/item/paperplane)) + papers_found += potentially_paper + if(!papers_found.len || !item_loc) + user.visible_message(span_suicide("[user] bashes [user.p_them()]self in the head with [src]! It looks like [user.p_theyre()] trying to commit suicide!")) + return BRUTELOSS + + user.visible_message(span_suicide("[user] opens [src] and all of [user.p_their()] papers fly out!")) + for(var/obj/item/paper as anything in papers_found) //Throws the papers in a random direction + var/turf/turf_to_throw_at = prob(20) ? item_loc : get_ranged_target_turf(item_loc, pick(GLOB.alldirs)) + paper.throw_at(turf_to_throw_at, 2) + + stoplag(1 SECONDS) + user.say("ARGGHH, HOW WILL I GET THIS WORK DONE NOW?!!") + user.visible_message(span_suicide("[user] looks overwhelmed with paperwork! It looks like [user.p_theyre()] trying to commit suicide!")) + return OXYLOSS + /obj/item/storage/briefcase/sniperbundle desc = "Its label reads \"genuine hardened Captain leather\", but suspiciously has no other tags or branding. Smells like L'Air du Temps." force = 10 diff --git a/code/modules/antagonists/eldritch_cult/eldritch_magic.dm b/code/modules/antagonists/eldritch_cult/eldritch_magic.dm index 6895ec949ca..ec0d5d7252d 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_magic.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_magic.dm @@ -71,15 +71,45 @@ C.adjustBruteLoss(10) C.AdjustKnockdown(5 SECONDS) C.adjustStaminaLoss(80) - var/list/knowledge = cultie.get_all_knowledge() + var/list/researched_knowledge = cultie.get_all_knowledge() - for(var/X in knowledge) - var/datum/eldritch_knowledge/EK = knowledge[X] - if(EK.on_mansus_grasp(target, user, proximity_flag, click_parameters)) + for(var/knowledge in researched_knowledge) + var/datum/eldritch_knowledge/eldritch_knowledge = researched_knowledge[knowledge] + if(eldritch_knowledge.on_mansus_grasp(target, user, proximity_flag, click_parameters)) use_charge = TRUE if(use_charge) return ..() +/obj/item/melee/touch_attack/mansus_fist/suicide_act(mob/user) + user.visible_message(span_suicide("[user] covers [user.p_their()] face with [user.p_their()] sickly-looking hand! It looks like [user.p_theyre()] trying to commit suicide!")) + var/mob/living/carbon/carbon_user = user //iscarbon already used in spell's parent + var/datum/antagonist/heretic/cultie = carbon_user.mind.has_antag_datum(/datum/antagonist/heretic) + var/list/researched_knowledge = cultie.get_all_knowledge() + var/escape_our_torment = 0 + while(carbon_user.stat == CONSCIOUS) + if(QDELETED(src) || QDELETED(user)) + return SHAME + if(escape_our_torment > 20) //Stops us from infinitely stunning ourselves if we're just not taking the damage + return FIRELOSS + + if(prob(70)) + carbon_user.adjustFireLoss(20) + playsound(carbon_user, 'sound/effects/wounds/sizzle1.ogg', 70, vary = TRUE) + if(prob(50)) + carbon_user.emote("scream") + carbon_user.stuttering += 13 + + for(var/knowledge in researched_knowledge) + var/datum/eldritch_knowledge/eldritch_knowledge = researched_knowledge[knowledge] + eldritch_knowledge.on_mansus_grasp(carbon_user, carbon_user) + + carbon_user.adjustBruteLoss(10) + carbon_user.AdjustKnockdown(5 SECONDS) + carbon_user.adjustStaminaLoss(80) + escape_our_torment++ + stoplag(0.4 SECONDS) + return FIRELOSS + /obj/effect/proc_holder/spell/aoe_turf/rust_conversion name = "Aggressive Spread" desc = "Spreads rust onto nearby surfaces." diff --git a/code/modules/client/verbs/suicide.dm b/code/modules/client/verbs/suicide.dm index 7670e8a8185..089c1658b7d 100644 --- a/code/modules/client/verbs/suicide.dm +++ b/code/modules/client/verbs/suicide.dm @@ -35,8 +35,10 @@ return set_suicide(TRUE) //need to be called before calling suicide_act as fuck knows what suicide_act will do with your suicider var/obj/item/held_item = get_active_held_item() - if(held_item) - var/damagetype = held_item.suicide_act(src) + var/damagetype = SEND_SIGNAL(src, COMSIG_HUMAN_SUICIDE_ACT) + if(held_item || damagetype) + if(!damagetype && held_item) + damagetype = held_item.suicide_act(src) if(damagetype) if(damagetype & SHAME) adjustStaminaLoss(200) diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index 0dd472335f7..76b1a2a9ed9 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -41,6 +41,20 @@ to_chat(user, span_warning("PZZTTPFFFT")) desc = "[desc] The display is flickering slightly." +/obj/item/clothing/glasses/hud/suicide_act(mob/user) + if(user.is_blind() || !isliving(user)) + return ..() + var/mob/living/living_user = user + user.visible_message(span_suicide("[user] looks through [src] and looks overwhelmed with the information! It looks like [user.p_theyre()] trying to commit suicide!")) + if(living_user.getOrganLoss(ORGAN_SLOT_BRAIN) >= BRAIN_DAMAGE_SEVERE) + var/mob/thing = pick((/mob in view()) - user) + if(thing) + user.say("VALID MAN IS WANTER, ARREST HE!!") + user.pointed(thing) + else + user.say("WHY IS THERE A BAR ON MY HEAD?!!") + return OXYLOSS + /obj/item/clothing/glasses/hud/health name = "health scanner HUD" desc = "A heads-up display that scans the humanoids in view and provides accurate data about their health status." diff --git a/code/modules/clothing/head/tinfoilhat.dm b/code/modules/clothing/head/tinfoilhat.dm index a81f8b9eed3..a404a5a3401 100644 --- a/code/modules/clothing/head/tinfoilhat.dm +++ b/code/modules/clothing/head/tinfoilhat.dm @@ -24,6 +24,8 @@ QDEL_NULL(paranoia) paranoia = new() + RegisterSignal(user, COMSIG_HUMAN_SUICIDE_ACT, .proc/call_suicide) + user.gain_trauma(paranoia, TRAUMA_RESILIENCE_MAGIC) to_chat(user, span_warning("As you don the foiled hat, an entire world of conspiracy theories and seemingly insane ideas suddenly rush into your mind. What you once thought unbelievable suddenly seems.. undeniable. Everything is connected and nothing happens just by accident. You know too much and now they're out to get you. ")) @@ -40,6 +42,7 @@ . = ..() if(paranoia) QDEL_NULL(paranoia) + UnregisterSignal(user, COMSIG_HUMAN_SUICIDE_ACT) /obj/item/clothing/head/foilhat/proc/warp_up() name = "scorched tinfoil hat" @@ -49,6 +52,7 @@ if(!isliving(loc) || !paranoia) return var/mob/living/target = loc + UnregisterSignal(target, COMSIG_HUMAN_SUICIDE_ACT) if(target.get_item_by_slot(ITEM_SLOT_HEAD) != src) return QDEL_NULL(paranoia) @@ -67,3 +71,24 @@ . = ..() if(!warped) warp_up() + +/obj/item/clothing/head/foilhat/proc/call_suicide(datum/source) + SIGNAL_HANDLER + INVOKE_ASYNC(src, .proc/suicide_act, source) //SIGNAL_HANDLER doesn't like things waiting; INVOKE_ASYNC bypasses that + return OXYLOSS + +/obj/item/clothing/head/foilhat/suicide_act(mob/living/user) + user.visible_message(span_suicide("[user] gets a crazed look in [user.p_their()] eyes! [capitalize(user.p_they())] [user.p_have()] witnessed the truth, and try to commit suicide!")) + var/static/list/conspiracy_line = list( + ";THEY'RE HIDING CAMERAS IN THE CEILINGS! THEY WITNESS EVERYTHING WE DO!!", + ";HOW CAN I LIVE IN A WORLD WHERE MY FATE AND EXISTENCE IS DECIDED BY A GROUP OF INDIVIDUALS?!!", + ";THEY'RE TOYING WITH ALL OF YOUR MINDS AND TREATING YOU AS EXPERIMENTS!!", + ";THEY HIRE ASSISTANTS WITHOUT DOING BACKGROUND CHECKS!!", + ";WE LIVE IN A ZOO AND WE ARE THE ONES BEING OBSERVED!!", + ";WE REPEAT OUR LIVES DAILY WITHOUT FURTHER QUESTIONS!!" + ) + user.say(pick(conspiracy_line), forced=type) + var/obj/item/organ/brain/brain = user.getorganslot(ORGAN_SLOT_BRAIN) + if(brain) + brain.damage = BRAIN_DAMAGE_DEATH + return OXYLOSS diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 7d8e84915e0..1fcc077b757 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1986,6 +1986,10 @@ /mob/living/proc/will_escape_storage() return FALSE +//Used specifically for the clown box suicide act +/mob/living/carbon/human/will_escape_storage() + return TRUE + /// Sets the mob's hunger levels to a safe overall level. Useful for TRAIT_NOHUNGER species changes. /mob/living/proc/set_safe_hunger_level() // Nutrition reset and alert clearing. diff --git a/code/modules/mob/living/simple_animal/hostile/bees.dm b/code/modules/mob/living/simple_animal/hostile/bees.dm index b67d0c777b2..910cd39fbe8 100644 --- a/code/modules/mob/living/simple_animal/hostile/bees.dm +++ b/code/modules/mob/living/simple_animal/hostile/bees.dm @@ -324,6 +324,12 @@ to_chat(user, span_warning("You don't have enough units of that chemical to modify the bee's DNA!")) ..() +/obj/item/queen_bee/suicide_act(mob/user) + user.visible_message(span_suicide("[user] eats [src]! It looks like [user.p_theyre()] trying to commit suicide!")) + user.say("IT'S HIP TO EAT BEES!") + qdel(src) + return TOXLOSS + /obj/item/queen_bee/Initialize(mapload) . = ..() AddElement(/datum/element/swabable, CELL_LINE_TABLE_QUEEN_BEE, CELL_VIRUS_TABLE_GENERIC_MOB, 1, 5)