Files
Bubberstation/code/datums/brain_damage/brain_trauma.dm
SkyratBot 84d003b4ab [MIRROR] more span macro changes in brain traumas and disease files [MDB IGNORE] (#19226)
* more span macro changes in brain traumas and disease files (#73273)

## About The Pull Request

i was fucking around with brain traumas on a downstream and noticed they
had similar issues to quirks so i decided to continue work from #73116

![Code_Klx14O288V](https://user-images.githubusercontent.com/116288367/217046732-765ffe27-73c9-416a-833e-e0d9e2aa7a86.png)
(search in VSC for span class = 'notice')
its going to be a bit of a thing to get all of these but this is a
decent chunk i think

there was only one annoying/tough file.
imaginary_friend.dm had class = 'game say' and class = 'emote' both of
which after some testing did not seem like they did anything. ill try to
keep that in mind in other files if i continue to do this but i either
omitted them because they didnt have any formatting or, in the case of
emote, turned it into name, which i think is what you'd want those
messages to look like.

there were also a few small spelling errors that i fixed

## Why It's Good For The Game

more consistent and stops people from copying brain trauma formatting
wrong

## Changelog

they should all work the same

---------

Co-authored-by: san7890 <the@ san7890.com>

* more span macro changes in brain traumas and disease files

---------

Co-authored-by: Sol N <116288367+flowercuco@users.noreply.github.com>
Co-authored-by: san7890 <the@ san7890.com>
2023-02-08 02:16:41 +00:00

59 lines
2.1 KiB
Plaintext

//Brain Traumas are the new actual brain damage. Brain damage itself acts as a way to acquire traumas: every time brain damage is dealt, there's a chance of receiving a trauma.
//This chance gets higher the higher the mob's brainloss is. Removing traumas is a separate thing from removing brain damage: you can get restored to full brain operativity,
// but keep the quirks, until repaired by neurine, surgery, lobotomy or magic; depending on the resilience
// of the trauma.
/datum/brain_trauma
var/name = "Brain Trauma"
var/desc = "A trauma caused by brain damage, which causes issues to the patient."
var/scan_desc = "generic brain trauma" //description when detected by a health scanner
var/mob/living/carbon/owner //the poor bastard
var/obj/item/organ/internal/brain/brain //the poor bastard's brain
var/gain_text = span_notice("You feel traumatized.")
var/lose_text = span_notice("You no longer feel traumatized.")
var/can_gain = TRUE
var/random_gain = TRUE //can this be gained through random traumas?
var/resilience = TRAUMA_RESILIENCE_BASIC //how hard is this to cure?
/datum/brain_trauma/Destroy()
// Handles our references with our brain
brain?.remove_trauma_from_traumas(src)
if(owner)
on_lose()
owner = null
return ..()
//Called on life ticks
/datum/brain_trauma/proc/on_life(delta_time, times_fired)
return
//Called on death
/datum/brain_trauma/proc/on_death()
return
//Called when given to a mob
/datum/brain_trauma/proc/on_gain()
if(gain_text)
to_chat(owner, gain_text)
RegisterSignal(owner, COMSIG_MOB_SAY, PROC_REF(handle_speech))
RegisterSignal(owner, COMSIG_MOVABLE_HEAR, PROC_REF(handle_hearing))
//Called when removed from a mob
/datum/brain_trauma/proc/on_lose(silent)
if(!silent && lose_text)
to_chat(owner, lose_text)
UnregisterSignal(owner, COMSIG_MOB_SAY)
UnregisterSignal(owner, COMSIG_MOVABLE_HEAR)
//Called when hearing a spoken message
/datum/brain_trauma/proc/handle_hearing(datum/source, list/hearing_args)
SIGNAL_HANDLER
UnregisterSignal(owner, COMSIG_MOVABLE_HEAR)
//Called when speaking
/datum/brain_trauma/proc/handle_speech(datum/source, list/speech_args)
SIGNAL_HANDLER
UnregisterSignal(owner, COMSIG_MOB_SAY)