Brain Traumas
This commit is contained in:
@@ -112,7 +112,8 @@
|
||||
take_bodypart_damage(10)
|
||||
victim.Knockdown(20)
|
||||
Knockdown(20)
|
||||
visible_message("<span class='danger'>[src] crashes into [victim], knocking them both over!</span>", "<span class='userdanger'>You violently crash into [victim]!</span>")
|
||||
visible_message("<span class='danger'>[src] crashes into [victim], knocking them both over!</span>",\
|
||||
"<span class='userdanger'>You violently crash into [victim]!</span>")
|
||||
playsound(src,'sound/weapons/punch1.ogg',50,1)
|
||||
|
||||
|
||||
@@ -765,6 +766,7 @@
|
||||
update_handcuffed()
|
||||
if(reagents)
|
||||
reagents.addiction_list = list()
|
||||
cure_all_traumas(TRUE, TRUE)
|
||||
..()
|
||||
// heal ears after healing disabilities, since ears check DEAF disability
|
||||
// when healing.
|
||||
@@ -849,3 +851,5 @@
|
||||
.["Modify bodypart"] = "?_src_=vars;[HrefToken()];editbodypart=[REF(src)]"
|
||||
.["Modify organs"] = "?_src_=vars;[HrefToken()];editorgans=[REF(src)]"
|
||||
.["Hallucinate"] = "?_src_=vars;[HrefToken()];hallucinate=[REF(src)]"
|
||||
.["Give brain trauma"] = "?_src_=vars;[HrefToken()];givetrauma=[REF(src)]"
|
||||
.["Cure brain traumas"] = "?_src_=vars;[HrefToken()];curetraumas=[REF(src)]"
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
"<span class='danger'>[src] was shocked by \the [source]!</span>", \
|
||||
"<span class='userdanger'>You feel a powerful shock coursing through your body!</span>", \
|
||||
"<span class='italics'>You hear a heavy electrical crack.</span>" \
|
||||
)
|
||||
)
|
||||
jitteriness += 1000 //High numbers for violent convulsions
|
||||
do_jitter_animation(jitteriness)
|
||||
stuttering += 2
|
||||
|
||||
@@ -196,3 +196,37 @@
|
||||
staminaloss = amount
|
||||
if(updating_stamina)
|
||||
update_stamina()
|
||||
|
||||
/mob/living/carbon/getBrainLoss()
|
||||
. = BRAIN_DAMAGE_DEATH
|
||||
var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN)
|
||||
if(B)
|
||||
. = B.get_brain_damage()
|
||||
|
||||
//Some sources of brain damage shouldn't be deadly
|
||||
/mob/living/carbon/adjustBrainLoss(amount, maximum = BRAIN_DAMAGE_DEATH)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN)
|
||||
if(!B)
|
||||
return
|
||||
B.adjust_brain_damage(amount, maximum)
|
||||
if(amount <= 0) //cut this early
|
||||
return
|
||||
var/brainloss = getBrainLoss()
|
||||
if(brainloss > BRAIN_DAMAGE_MILD && !has_trauma_type(BRAIN_TRAUMA_MILD))
|
||||
if(prob((amount * 2) + ((brainloss - BRAIN_DAMAGE_MILD) / 5))) //1 damage|50 brain damage = 4% chance
|
||||
gain_trauma_type(BRAIN_TRAUMA_MILD)
|
||||
if(brainloss > BRAIN_DAMAGE_SEVERE && !has_trauma_type(BRAIN_TRAUMA_SEVERE) && !has_trauma_type(BRAIN_TRAUMA_SPECIAL))
|
||||
if(prob(amount + ((brainloss - BRAIN_DAMAGE_SEVERE) / 15))) //1 damage|150 brain damage = 3% chance
|
||||
if(prob(20))
|
||||
gain_trauma_type(BRAIN_TRAUMA_SPECIAL)
|
||||
else
|
||||
gain_trauma_type(BRAIN_TRAUMA_SEVERE)
|
||||
|
||||
/mob/living/carbon/setBrainLoss(amount)
|
||||
var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN)
|
||||
if(B)
|
||||
var/adjusted_amount = amount - B.get_brain_damage()
|
||||
B.adjust_brain_damage(adjusted_amount, null)
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
else
|
||||
msg += "<b>[t_He] [t_is] severely deformed!</b>\n"
|
||||
|
||||
if(getBrainLoss() > 60)
|
||||
if(disabilities & DUMB)
|
||||
msg += "[t_He] seem[p_s()] to be clumsy and unable to think.\n"
|
||||
|
||||
if(fire_stacks > 0)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
var/t_has = p_have()
|
||||
var/t_is = p_are()
|
||||
|
||||
var/msg = "<span class='info'>*---------*\nThis is <EM>[src.name]</EM>!\n"
|
||||
var/msg = "<span class='info'>*---------*\nThis is <EM>[name]</EM>!\n"
|
||||
|
||||
var/list/obscured = check_obscured_slots()
|
||||
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
|
||||
@@ -284,7 +284,7 @@
|
||||
if(stat == UNCONSCIOUS)
|
||||
msg += "[t_He] [t_is]n't responding to anything around [t_him] and seem[p_s()] to be asleep.\n"
|
||||
else
|
||||
if(getBrainLoss() >= 60)
|
||||
if(disabilities & DUMB)
|
||||
msg += "[t_He] [t_has] a stupid expression on [t_his] face.\n"
|
||||
if(InCritical())
|
||||
msg += "[t_He] [t_is] barely conscious.\n"
|
||||
|
||||
@@ -103,7 +103,9 @@
|
||||
|
||||
|
||||
/mob/living/carbon/human/IsAdvancedToolUser()
|
||||
return 1//Humans can use guns and such
|
||||
if(disabilities & MONKEYLIKE)
|
||||
return FALSE
|
||||
return TRUE//Humans can use guns and such
|
||||
|
||||
/mob/living/carbon/human/reagent_check(datum/reagent/R)
|
||||
return dna.species.handle_chemicals(R,src)
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
#define COLD_GAS_DAMAGE_LEVEL_2 1.5 //Amount of damage applied when the current breath's temperature passes the 200K point
|
||||
#define COLD_GAS_DAMAGE_LEVEL_3 3 //Amount of damage applied when the current breath's temperature passes the 120K point
|
||||
|
||||
#define BRAIN_DAMAGE_FILE "brain_damage_lines.json"
|
||||
|
||||
/mob/living/carbon/human/Life()
|
||||
set invisibility = 0
|
||||
set background = BACKGROUND_ENABLED
|
||||
@@ -74,14 +72,6 @@
|
||||
else if(eye_blurry) //blurry eyes heal slowly
|
||||
adjust_blurriness(-1)
|
||||
|
||||
if (getBrainLoss() >= 60 && stat == CONSCIOUS)
|
||||
if(prob(3))
|
||||
if(prob(25))
|
||||
emote("drool")
|
||||
else
|
||||
say(pick_list_replacements(BRAIN_DAMAGE_FILE, "brain_damage"))
|
||||
|
||||
|
||||
/mob/living/carbon/human/handle_mutations_and_radiation()
|
||||
if(!dna || !dna.species.handle_mutations_and_radiation(src))
|
||||
..()
|
||||
@@ -430,7 +420,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
to_chat(src, "<span class='warning'>Maybe you should lie down for a bit...</span>")
|
||||
|
||||
if(drunkenness >= 91)
|
||||
adjustBrainLoss(0.4)
|
||||
adjustBrainLoss(0.4, 60)
|
||||
if(prob(20) && !stat)
|
||||
if(SSshuttle.emergency.mode == SHUTTLE_DOCKED && (z in GLOB.station_z_levels)) //QoL mainly
|
||||
to_chat(src, "<span class='warning'>You're so tired... but you can't miss that shuttle...</span>")
|
||||
|
||||
@@ -1359,8 +1359,13 @@ GLOBAL_LIST_EMPTY(roundstart_races)
|
||||
target.apply_damage(damage, BRUTE, affecting, armor_block)
|
||||
add_logs(user, target, "punched")
|
||||
if((target.stat != DEAD) && damage >= user.dna.species.punchstunthreshold)
|
||||
<<<<<<< HEAD
|
||||
target.visible_message("<span class='danger'>[user] has weakened [target]!</span>", \
|
||||
"<span class='userdanger'>[user] has weakened [target]!</span>")
|
||||
=======
|
||||
target.visible_message("<span class='danger'>[user] has knocked [target] down!</span>", \
|
||||
"<span class='userdanger'>[user] has knocked [target] down!</span>", null, COMBAT_MESSAGE_RANGE)
|
||||
>>>>>>> 550d711... Brain Traumas (#31727)
|
||||
target.apply_effect(80, KNOCKDOWN, armor_block)
|
||||
target.forcesay(GLOB.hit_appends)
|
||||
else if(target.lying)
|
||||
@@ -1404,7 +1409,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
|
||||
if(randn <= 60)
|
||||
var/obj/item/I = null
|
||||
if(target.pulling)
|
||||
to_chat(target, "<span class='warning'>[user] has broken [target]'s grip on [target.pulling]!</span>")
|
||||
target.visible_message("<span class='warning'>[user] has broken [target]'s grip on [target.pulling]!</span>")
|
||||
target.stop_pulling()
|
||||
else
|
||||
I = target.get_active_held_item()
|
||||
@@ -1509,7 +1514,10 @@ GLOBAL_LIST_EMPTY(roundstart_races)
|
||||
H.visible_message("<span class='danger'>[H] has been knocked senseless!</span>", \
|
||||
"<span class='userdanger'>[H] has been knocked senseless!</span>")
|
||||
H.confused = max(H.confused, 20)
|
||||
H.adjustBrainLoss(20)
|
||||
H.adjust_blurriness(10)
|
||||
if(prob(20))
|
||||
H.gain_trauma(/datum/brain_trauma/mild/concussion)
|
||||
|
||||
if(prob(I.force + ((100 - H.health)/2)) && H != user)
|
||||
var/datum/antagonist/rev/rev = H.mind.has_antag_datum(/datum/antagonist/rev)
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
amount = dna.species.spec_stun(src,amount)
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/human/Knockdown(amount, updating = 1, ignore_canstun = 0)
|
||||
/mob/living/carbon/human/Knockdown(amount, updating = 1, ignore_canknockdown = 0)
|
||||
amount = dna.species.spec_stun(src,amount)
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/human/Unconscious(amount, updating = 1, ignore_canstun = 0)
|
||||
/mob/living/carbon/human/Unconscious(amount, updating = 1, ignore_canunconscious = 0)
|
||||
amount = dna.species.spec_stun(src,amount)
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -13,9 +13,17 @@
|
||||
handle_blood()
|
||||
|
||||
if(stat != DEAD)
|
||||
<<<<<<< HEAD
|
||||
for(var/V in internal_organs)
|
||||
var/obj/item/organ/O = V
|
||||
O.on_life()
|
||||
=======
|
||||
handle_brain_damage()
|
||||
|
||||
if(stat != DEAD)
|
||||
handle_liver()
|
||||
|
||||
>>>>>>> 550d711... Brain Traumas (#31727)
|
||||
if(stat == DEAD)
|
||||
stop_sound_channel(CHANNEL_HEARTBEAT)
|
||||
|
||||
@@ -437,3 +445,20 @@
|
||||
adjustToxLoss(8)
|
||||
if(prob(30))
|
||||
to_chat(src, "<span class='notice'>You feel confused and nauseous...</span>")//actual symptoms of liver failure
|
||||
|
||||
|
||||
////////////////
|
||||
//BRAIN DAMAGE//
|
||||
////////////////
|
||||
|
||||
/mob/living/carbon/proc/handle_brain_damage()
|
||||
for(var/T in get_traumas())
|
||||
var/datum/brain_trauma/BT = T
|
||||
BT.on_life()
|
||||
|
||||
if(getBrainLoss() >= BRAIN_DAMAGE_DEATH) //rip
|
||||
to_chat(src, "<span class='userdanger'>The last spark of life in your brain fizzles out...<span>")
|
||||
death()
|
||||
var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN)
|
||||
if(B)
|
||||
B.damaged_brain = TRUE
|
||||
@@ -1,4 +1,6 @@
|
||||
/mob/living/carbon/treat_message(message)
|
||||
for(var/datum/brain_trauma/trauma in get_traumas())
|
||||
message = trauma.on_say(message)
|
||||
message = ..(message)
|
||||
var/obj/item/organ/tongue/T = getorganslot(ORGAN_SLOT_TONGUE)
|
||||
if(!T) //hoooooouaah!
|
||||
@@ -34,4 +36,16 @@
|
||||
if(T)
|
||||
. = T.could_speak_in_language(dt)
|
||||
else
|
||||
<<<<<<< HEAD
|
||||
. = initial(dt.flags_1) & TONGUELESS_SPEECH
|
||||
=======
|
||||
. = initial(dt.flags) & TONGUELESS_SPEECH
|
||||
|
||||
/mob/living/carbon/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode)
|
||||
if(!client)
|
||||
return
|
||||
for(var/T in get_traumas())
|
||||
var/datum/brain_trauma/trauma = T
|
||||
message = trauma.on_hear(message, speaker, message_language, raw_message, radio_freq)
|
||||
return ..()
|
||||
>>>>>>> 550d711... Brain Traumas (#31727)
|
||||
|
||||
@@ -101,3 +101,35 @@
|
||||
status_flags |= DISFIGURED //makes them unknown
|
||||
update_body()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/proc/get_traumas()
|
||||
. = list()
|
||||
var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN)
|
||||
if(B)
|
||||
. = B.traumas
|
||||
|
||||
/mob/living/carbon/proc/has_trauma_type(brain_trauma_type, consider_permanent = FALSE)
|
||||
var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN)
|
||||
if(B)
|
||||
. = B.has_trauma_type(brain_trauma_type, consider_permanent)
|
||||
|
||||
/mob/living/carbon/proc/gain_trauma(datum/brain_trauma/trauma, permanent = FALSE, list/arguments)
|
||||
var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN)
|
||||
if(B)
|
||||
. = B.gain_trauma(trauma, permanent, arguments)
|
||||
|
||||
/mob/living/carbon/proc/gain_trauma_type(brain_trauma_type = /datum/brain_trauma, permanent = FALSE)
|
||||
var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN)
|
||||
if(B)
|
||||
. = B.gain_trauma_type(brain_trauma_type, permanent)
|
||||
|
||||
/mob/living/carbon/proc/cure_trauma_type(brain_trauma_type, cure_permanent = FALSE)
|
||||
var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN)
|
||||
if(B)
|
||||
. = B.cure_trauma_type(brain_trauma_type, cure_permanent)
|
||||
|
||||
/mob/living/carbon/proc/cure_all_traumas(cure_permanent = FALSE)
|
||||
var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN)
|
||||
if(B)
|
||||
. = B.cure_all_traumas(cure_permanent)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user