diff --git a/code/datums/brain_damage/special.dm b/code/datums/brain_damage/special.dm index f49a6d0c0bc..486af4b2780 100644 --- a/code/datums/brain_damage/special.dm +++ b/code/datums/brain_damage/special.dm @@ -525,3 +525,179 @@ owner.ai_controller.set_ai_status(AI_STATUS_OFF) owner.remove_language(/datum/language/monkey, UNDERSTOOD_LANGUAGE, TRAUMA_TRAIT) to_chat(owner, span_green("The urge subsides.")) + +/datum/brain_trauma/special/axedoration + name = "Axe Delusions" + desc = "Patient feels an immense sense of duty towards protecting an axe and has hallucinations regarding it." + scan_desc = "object attachment" + gain_text = span_notice("You feel like protecting the fire axe is one of your greatest duties.") + lose_text = span_warning("You feel like you lost your sense of duty.") + resilience = TRAUMA_RESILIENCE_ABSOLUTE + random_gain = FALSE + var/static/list/talk_lines = list( + "I'm proud of you.", + "I believe in you!", + "Do I bother you?", + "Praise me!", + "Fires burn.", + "We made it!", + "Mother, my body disgusts me.", + "There's a gap where we meet, where I end and you begin.", + "Humble yourself.", + ) + var/static/list/hurt_lines = list( + "Ow!", + "Ouch!", + "Ack!", + "It burns!", + "Stop!", + "Arghh!", + "Please!", + "End it!", + "Cease!", + "Ah!", + ) + +/datum/brain_trauma/special/axedoration/on_life(seconds_per_tick, times_fired) + if(owner.stat != CONSCIOUS) + return + + if(!GLOB.bridge_axe) + if(SPT_PROB(0.5, seconds_per_tick)) + to_chat(owner, span_warning("I've failed my duty...")) + owner.set_jitter_if_lower(5 SECONDS) + owner.set_stutter_if_lower(5 SECONDS) + if(SPT_PROB(20, seconds_per_tick)) + owner.vomit(VOMIT_CATEGORY_DEFAULT) + return + + var/atom/axe_location = get_axe_location() + if(!SPT_PROB(1.5, seconds_per_tick)) + return + if(isliving(axe_location)) + var/mob/living/axe_holder = axe_location + if(axe_holder == owner) + talk_tuah(pick(talk_lines)) + return + var/datum/job/holder_job = axe_holder.mind?.assigned_role + if(holder_job && (/datum/job_department/command in holder_job.departments_list)) + to_chat(owner, span_notice("I hope the axe is in good hands...")) + owner.add_mood_event("fireaxe", /datum/mood_event/axe_neutral) + return + to_chat(owner, span_warning("You start having a bad feeling...")) + owner.add_mood_event("fireaxe", /datum/mood_event/axe_missing) + return + + if(!isarea(axe_location)) + owner.add_mood_event("fireaxe", /datum/mood_event/axe_gone) + return + + if(istype(axe_location, /area/station/command)) + to_chat(owner, span_notice("You feel a sense of relief...")) + if(istype(GLOB.bridge_axe.loc, /obj/structure/fireaxecabinet)) + return + owner.add_mood_event("fireaxe", /datum/mood_event/axe_neutral) + return + + to_chat(owner, span_warning("You start having a bad feeling...")) + owner.add_mood_event("fireaxe", /datum/mood_event/axe_missing) + +/datum/brain_trauma/special/axedoration/on_gain() + RegisterSignal(owner, COMSIG_MOB_EQUIPPED_ITEM, PROC_REF(on_equip)) + RegisterSignal(owner, COMSIG_MOB_UNEQUIPPED_ITEM, PROC_REF(on_unequip)) + RegisterSignal(owner, COMSIG_MOB_EXAMINING, PROC_REF(on_examine)) + if(!GLOB.bridge_axe) + axe_gone() + return ..() + RegisterSignal(GLOB.bridge_axe, COMSIG_QDELETING, PROC_REF(axe_gone)) + if(istype(get_axe_location(), /area/station/command) && istype(GLOB.bridge_axe.loc, /obj/structure/fireaxecabinet)) + owner.add_mood_event("fireaxe", /datum/mood_event/axe_cabinet) + else if(owner.is_holding(GLOB.bridge_axe)) + on_equip(owner, GLOB.bridge_axe) + else + owner.add_mood_event("fireaxe", /datum/mood_event/axe_neutral) + RegisterSignal(GLOB.bridge_axe, COMSIG_ITEM_AFTERATTACK, PROC_REF(on_axe_attack)) + return ..() + + +/datum/brain_trauma/special/axedoration/on_lose() + owner.clear_mood_event("fireaxe") + UnregisterSignal(owner, list(COMSIG_MOB_EQUIPPED_ITEM, COMSIG_MOB_UNEQUIPPED_ITEM, COMSIG_MOB_EXAMINING)) + if(GLOB.bridge_axe) + UnregisterSignal(GLOB.bridge_axe, COMSIG_ITEM_AFTERATTACK) + return ..() + +/datum/brain_trauma/special/axedoration/proc/axe_gone(source) + SIGNAL_HANDLER + to_chat(owner, span_danger("You feel a great disturbance in the force.")) + owner.add_mood_event("fireaxe", /datum/mood_event/axe_gone) + owner.set_jitter_if_lower(15 SECONDS) + owner.set_stutter_if_lower(15 SECONDS) + +/datum/brain_trauma/special/axedoration/proc/on_equip(source, obj/item/picked_up, slot) + SIGNAL_HANDLER + if(!istype(picked_up, /obj/item/fireaxe)) + return + owner.set_jitter_if_lower(3 SECONDS) + if(picked_up == GLOB.bridge_axe) + to_chat(owner, span_hypnophrase("I have it. It's time to put it back.")) + owner.add_mood_event("fireaxe", /datum/mood_event/axe_held) + return + ADD_TRAIT(picked_up, TRAIT_NODROP, type) + to_chat(owner, span_warning("...This is not the one I'm looking after.")) + owner.Immobilize(2 SECONDS) + addtimer(CALLBACK(src, PROC_REF(throw_faker), picked_up), 2 SECONDS) + +/datum/brain_trauma/special/axedoration/proc/throw_faker(obj/item/faker) + REMOVE_TRAIT(faker, TRAIT_NODROP, type) + var/held_index = owner.get_held_index_of_item(faker) + if(!held_index) + return + to_chat(owner, span_warning("Be gone with you.")) + owner.swap_hand(held_index, silent = TRUE) + var/turf/target_turf = get_ranged_target_turf(owner, owner.dir, faker.throw_range) + owner.throw_item(target_turf) + +/datum/brain_trauma/special/axedoration/proc/on_unequip(datum/source, obj/item/dropped_item, force, new_location) + SIGNAL_HANDLER + if(dropped_item != GLOB.bridge_axe) + return + if(get_axe_location() == owner) + return + if(istype(new_location, /obj/structure/fireaxecabinet)) + if(istype(get_area(new_location), /area/station/command)) + to_chat(owner, span_nicegreen("Ah! Back where it belongs!")) + owner.add_mood_event("fireaxe", /datum/mood_event/axe_cabinet) + INVOKE_ASYNC(owner, TYPE_PROC_REF(/mob, emote), "smile") + return + to_chat(owner, span_warning("Leaving it outside of command? Am I sure about that?")) + owner.add_mood_event("fireaxe", /datum/mood_event/axe_neutral) + return + to_chat(owner, span_warning("Should I really leave it here?")) + owner.add_mood_event("fireaxe", /datum/mood_event/axe_neutral) + +/datum/brain_trauma/special/axedoration/proc/on_examine(mob/source, atom/target, list/examine_strings) + SIGNAL_HANDLER + if(!istype(target, /obj/item/fireaxe)) + return + if(target == GLOB.bridge_axe) + examine_strings += span_notice("It's the axe I've sworn to protect.") + else + examine_strings += span_warning("It's a simulacra, a fake axe made to fool the masses.") + +/datum/brain_trauma/special/axedoration/proc/on_axe_attack(obj/item/axe, atom/target, mob/user, click_parameters) + SIGNAL_HANDLER + if(user != owner) + return + talk_tuah(pick(hurt_lines)) + +/datum/brain_trauma/special/axedoration/proc/talk_tuah(sent_message = "Hello World.") + owner.Hear(null, GLOB.bridge_axe, owner.get_selected_language(), sent_message) + +/datum/brain_trauma/special/axedoration/proc/get_axe_location() + if(!GLOB.bridge_axe) + return + var/atom/axe_loc = GLOB.bridge_axe.loc + while(!ismob(axe_loc) && !isarea(axe_loc) && !isnull(axe_loc)) + axe_loc = axe_loc.loc + return axe_loc diff --git a/code/datums/components/twohanded.dm b/code/datums/components/twohanded.dm index dcb8d63a3c4..e903d84fab0 100644 --- a/code/datums/components/twohanded.dm +++ b/code/datums/components/twohanded.dm @@ -195,10 +195,10 @@ var/atom/atom_parent = parent if(HAS_TRAIT(user, TRAIT_NO_TWOHANDING)) if(require_twohands) - atom_parent.balloon_alert(user, "too weak to wield!") + atom_parent.balloon_alert(user, "can't wield!") user.dropItemToGround(parent, force = TRUE) else - atom_parent.balloon_alert(user, "too weak to wield with both hands!") + atom_parent.balloon_alert(user, "can't wield with both hands!") return COMPONENT_EQUIPPED_FAILED if(user.get_inactive_held_item()) if(require_twohands) diff --git a/code/datums/mood_events/axe_events.dm b/code/datums/mood_events/axe_events.dm new file mode 100644 index 00000000000..1af7c116cef --- /dev/null +++ b/code/datums/mood_events/axe_events.dm @@ -0,0 +1,20 @@ + +/datum/mood_event/axe_gone + description = "What happened to the axe... Where is it? It can't be..." + mood_change = -15 + +/datum/mood_event/axe_neutral + description = "I'm sure the axe is okay." + mood_change = 1 + +/datum/mood_event/axe_cabinet + description = "The axe is where it belongs." + mood_change = 5 + +/datum/mood_event/axe_missing + description = "The axe, there's something wrong..." + mood_change = -5 + +/datum/mood_event/axe_held + description = "I'm not worthy of you, axe. I need to put you back." + mood_change = -10 diff --git a/code/game/objects/items/fireaxe.dm b/code/game/objects/items/fireaxe.dm index 265a05cfac7..162af703ad2 100644 --- a/code/game/objects/items/fireaxe.dm +++ b/code/game/objects/items/fireaxe.dm @@ -1,3 +1,5 @@ +GLOBAL_DATUM(bridge_axe, /obj/item/fireaxe) + /* * Fireaxe */ @@ -34,6 +36,9 @@ /obj/item/fireaxe/Initialize(mapload) . = ..() + if(!GLOB.bridge_axe && istype(get_area(src), /area/station/command)) + GLOB.bridge_axe = src + AddComponent(/datum/component/butchering, \ speed = 10 SECONDS, \ effectiveness = 80, \ @@ -43,6 +48,11 @@ //axes are not known for being precision butchering tools AddComponent(/datum/component/two_handed, force_unwielded=force_unwielded, force_wielded=force_wielded, icon_wielded="[base_icon_state]1") +/obj/item/fireaxe/Destroy() + if(GLOB.bridge_axe == src) + GLOB.bridge_axe = null + return ..() + /obj/item/fireaxe/update_icon_state() icon_state = "[base_icon_state]0" return ..() diff --git a/code/modules/jobs/job_types/station_trait/bridge_assistant.dm b/code/modules/jobs/job_types/station_trait/bridge_assistant.dm index d776ae6251f..562ec695d8a 100644 --- a/code/modules/jobs/job_types/station_trait/bridge_assistant.dm +++ b/code/modules/jobs/job_types/station_trait/bridge_assistant.dm @@ -37,7 +37,9 @@ /datum/job/bridge_assistant/after_spawn(mob/living/spawned, client/player_client) . = ..() - ADD_TRAIT(spawned, TRAIT_NO_TWOHANDING, JOB_TRAIT) + var/mob/living/carbon/bridgie = spawned + if(istype(bridgie)) + bridgie.gain_trauma(/datum/brain_trauma/special/axedoration) /datum/job/bridge_assistant/get_roundstart_spawn_point() var/list/chair_turfs = list() diff --git a/tgstation.dme b/tgstation.dme index f11340f1e5e..3191d598006 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1694,6 +1694,7 @@ #include "code\datums\mocking\client.dm" #include "code\datums\mood_events\_mood_event.dm" #include "code\datums\mood_events\area_events.dm" +#include "code\datums\mood_events\axe_events.dm" #include "code\datums\mood_events\beauty_events.dm" #include "code\datums\mood_events\dna_infuser_events.dm" #include "code\datums\mood_events\drink_events.dm"