mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-20 06:32:56 +00:00
* Breaks up the three quirk code files into individual quirks * Removals + skyrat edits * Delete positive_quirks.dm * Update tgstation.dme --------- Co-authored-by: Thunder12345 <Thunder12345@users.noreply.github.com> Co-authored-by: Pinta <68373373+softcerv@users.noreply.github.com> Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
51 lines
2.2 KiB
Plaintext
51 lines
2.2 KiB
Plaintext
/datum/quirk/badback
|
|
name = "Bad Back"
|
|
desc = "Thanks to your poor posture, backpacks and other bags never sit right on your back. More evenly weighted objects are fine, though."
|
|
icon = FA_ICON_HIKING
|
|
value = -8
|
|
quirk_flags = QUIRK_HUMAN_ONLY|QUIRK_MOODLET_BASED
|
|
gain_text = span_danger("Your back REALLY hurts!")
|
|
lose_text = span_notice("Your back feels better.")
|
|
medical_record_text = "Patient scans indicate severe and chronic back pain."
|
|
hardcore_value = 4
|
|
mail_goodies = list(/obj/item/cane)
|
|
var/datum/weakref/backpack
|
|
|
|
/datum/quirk/badback/add(client/client_source)
|
|
var/mob/living/carbon/human/human_holder = quirk_holder
|
|
var/obj/item/storage/backpack/equipped_backpack = human_holder.back
|
|
if(istype(equipped_backpack))
|
|
quirk_holder.add_mood_event("back_pain", /datum/mood_event/back_pain)
|
|
RegisterSignal(human_holder.back, COMSIG_ITEM_POST_UNEQUIP, PROC_REF(on_unequipped_backpack))
|
|
else
|
|
RegisterSignal(quirk_holder, COMSIG_MOB_EQUIPPED_ITEM, PROC_REF(on_equipped_item))
|
|
|
|
/datum/quirk/badback/remove()
|
|
UnregisterSignal(quirk_holder, COMSIG_MOB_EQUIPPED_ITEM)
|
|
|
|
var/obj/item/storage/equipped_backpack = backpack?.resolve()
|
|
if(equipped_backpack)
|
|
UnregisterSignal(equipped_backpack, COMSIG_ITEM_POST_UNEQUIP)
|
|
quirk_holder.clear_mood_event("back_pain")
|
|
|
|
/// Signal handler for when the quirk_holder equips an item. If it's a backpack, adds the back_pain mood event.
|
|
/datum/quirk/badback/proc/on_equipped_item(mob/living/source, obj/item/equipped_item, slot)
|
|
SIGNAL_HANDLER
|
|
|
|
if(!(slot & ITEM_SLOT_BACK) || !istype(equipped_item, /obj/item/storage/backpack))
|
|
return
|
|
|
|
quirk_holder.add_mood_event("back_pain", /datum/mood_event/back_pain)
|
|
RegisterSignal(equipped_item, COMSIG_ITEM_POST_UNEQUIP, PROC_REF(on_unequipped_backpack))
|
|
UnregisterSignal(quirk_holder, COMSIG_MOB_EQUIPPED_ITEM)
|
|
backpack = WEAKREF(equipped_item)
|
|
|
|
/// Signal handler for when the quirk_holder unequips an equipped backpack. Removes the back_pain mood event.
|
|
/datum/quirk/badback/proc/on_unequipped_backpack(obj/item/source, force, atom/newloc, no_move, invdrop, silent)
|
|
SIGNAL_HANDLER
|
|
|
|
UnregisterSignal(source, COMSIG_ITEM_POST_UNEQUIP)
|
|
quirk_holder.clear_mood_event("back_pain")
|
|
backpack = null
|
|
RegisterSignal(quirk_holder, COMSIG_MOB_EQUIPPED_ITEM, PROC_REF(on_equipped_item))
|