Various suicide_act() things (#63808)

This commit is contained in:
DragonTrance
2022-01-09 15:48:47 -08:00
committed by GitHub
parent 6681c3b347
commit 5cbd2deb51
15 changed files with 164 additions and 9 deletions
@@ -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"
+23
View File
@@ -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
+1
View File
@@ -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)
-1
View File
@@ -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)
+6
View File
@@ -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!"
+12 -1
View File
@@ -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("<b>[pick("I AM IMMORTAL.", "I SHALL TAKE YOUR WORLD.", "I SEE YOU.", "YOU CANNOT ESCAPE ME FOREVER.", "NOTHING CAN HOLD ME.")]</b>"))
to_chat(victim, span_colossus("<b>[pick(hallucination_lines)]</b>"))
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."
@@ -24,7 +24,6 @@
. = ..()
go_invisible()
/obj/structure/closet/cardboard/agent/open(mob/living/user, force = FALSE)
. = ..()
qdel(src)
+8
View File
@@ -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)
@@ -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
@@ -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."
+4 -2
View File
@@ -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)
+14
View File
@@ -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."
+25
View File
@@ -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
+4
View File
@@ -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.
@@ -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)