mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-03 13:32:17 +00:00
* Fixes a few hard deletes and runtimes I either caused, or ran into when trying to fix hard deletes (#61953) Please don't try and send chat messages if you have nothing to say Fixes a spurious runtime. Fixes a runtime caused by my lack of understanding of huds. remove_hud_from is intended for hud watchers, remove_from_hud is intended for hud items. Doesn't really make sense most of the time, and just runtimes out the ass Fixes a runtime in shapeshifting, restore should not run if the object is not restoring, or if it's deleting. it should run if it's not restoring, and it's not deleted. 4head Fun fact, if there's two turret control boards they'll override each other. Use weakrefs. Oh also removes a var called cp, nothing good will come of that Today in: Good lord the stacking machine is an afront to god, we discover that the labor claims console was attempting to act as a console, which of course fails when it comes time to clear it's improperly named var. Disgusting Attempts to fix potential wound ref hangs in surgeries? maybe? Fixes a runtime in luminescent stuff I created in my big harddel crusade. owner is a mob, not a species Fixes a runtime related to headspikes deleting themselves twice. Pain Fixes hard deletes sourced from the prophet trauma. Good fucking lord this is awful Offhand item is somehow hard deleting. I have no idea how. Here's hoping signals fixes it, because if it doesn't I'm stumped. It's not a common scenario, but it does happen in spurts that suggest repeated usage * Fixes a few hard deletes and runtimes I either caused, or ran into when trying to fix hard deletes * Update turret_id_system.dm * Update turret_id_system.dm Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Co-authored-by: Gandalf <jzo123@hotmail.com>
60 lines
2.1 KiB
Plaintext
60 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/brain/brain //the poor bastard's brain
|
|
var/gain_text = "<span class='notice'>You feel traumatized.</span>"
|
|
var/lose_text = "<span class='notice'>You no longer feel traumatized.</span>"
|
|
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()
|
|
if(brain?.traumas)
|
|
brain.traumas -= src
|
|
if(owner)
|
|
on_lose()
|
|
brain = null
|
|
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/handle_speech)
|
|
RegisterSignal(owner, COMSIG_MOVABLE_HEAR, .proc/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)
|