Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passive healing of damage into stamina #57

Merged
merged 2 commits into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions code/datums/components/tackle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
var/obj/item/bodypart/head/hed = user.get_bodypart(BODY_ZONE_HEAD)
if(hed)
hed.receive_damage(brute=20, updating_health=TRUE)
user.gain_trauma(/datum/brain_trauma/mild/concussion)
// user.gain_trauma(/datum/brain_trauma/mild/concussion)

if(-4 to -2) // glancing blow at best
user.visible_message(span_warning("[user] lands a weak [tackle_word] on [target], briefly knocking [target.p_them()] off-balance!"), span_userdanger("I land a weak [tackle_word] on [target], briefly knocking [target.p_them()] off-balance!"), target)
Expand Down Expand Up @@ -510,7 +510,7 @@
user.adjustStaminaLoss(30)
user.adjustBruteLoss(80)
user.Unconscious(100)
user.gain_trauma_type(BRAIN_TRAUMA_MILD)
// user.gain_trauma_type(BRAIN_TRAUMA_MILD)
playsound(user, 'sound/effects/blobattack.ogg', 60, TRUE)
playsound(user, 'sound/effects/splat.ogg', 70, TRUE)
user.playsound_local(get_turf(user), 'sound/weapons/flashbang.ogg', 100, TRUE, 8, 0.9)
Expand All @@ -524,7 +524,7 @@
user.adjustStaminaLoss(100)
user.adjustBruteLoss(30)
user.Unconscious(100)
user.gain_trauma_type(BRAIN_TRAUMA_MILD)
// user.gain_trauma_type(BRAIN_TRAUMA_MILD)
user.playsound_local(get_turf(user), 'sound/weapons/flashbang.ogg', 100, TRUE, 8, 0.9)
shake_camera(user, 6, 6)
user.overlay_fullscreen("flash", /atom/movable/screen/fullscreen/flash)
Expand All @@ -535,8 +535,8 @@
user.adjustStaminaLoss(30)
user.adjustBruteLoss(30)
user.confused += 15
if(prob(80))
user.gain_trauma(/datum/brain_trauma/mild/concussion)
// if(prob(80))
// user.gain_trauma(/datum/brain_trauma/mild/concussion)
user.playsound_local(get_turf(user), 'sound/weapons/flashbang.ogg', 100, TRUE, 8, 0.9)
user.DefaultCombatKnockdown(40)
shake_camera(user, 5, 5)
Expand Down
20 changes: 10 additions & 10 deletions code/datums/wounds/bones.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
Overwriting of base procs
*/
/datum/wound/blunt/wound_injury(datum/wound/old_wound = null)
if(limb.body_zone == BODY_ZONE_HEAD && brain_trauma_group)
processes = TRUE
active_trauma = victim.gain_trauma_type(brain_trauma_group, TRAUMA_RESILIENCE_WOUND)
next_trauma_cycle = world.time + (rand(100-WOUND_BONE_HEAD_TIME_VARIANCE, 100+WOUND_BONE_HEAD_TIME_VARIANCE) * 0.01 * trauma_cycle_cooldown)
// if(limb.body_zone == BODY_ZONE_HEAD && brain_trauma_group)
// processes = TRUE
// active_trauma = victim.gain_trauma_type(brain_trauma_group, TRAUMA_RESILIENCE_WOUND)
// next_trauma_cycle = world.time + (rand(100-WOUND_BONE_HEAD_TIME_VARIANCE, 100+WOUND_BONE_HEAD_TIME_VARIANCE) * 0.01 * trauma_cycle_cooldown)

RegisterSignal(victim, COMSIG_HUMAN_EARLY_UNARMED_ATTACK,PROC_REF(attack_with_hurt_hand))
if(limb.held_index && victim.get_item_for_held_index(limb.held_index) && (disabling || prob(30 * severity)))
Expand All @@ -59,12 +59,12 @@

/datum/wound/blunt/handle_process()
. = ..()
if(limb.body_zone == BODY_ZONE_HEAD && brain_trauma_group && world.time > next_trauma_cycle)
if(active_trauma)
QDEL_NULL(active_trauma)
else
active_trauma = victim.gain_trauma_type(brain_trauma_group, TRAUMA_RESILIENCE_WOUND)
next_trauma_cycle = world.time + (rand(100-WOUND_BONE_HEAD_TIME_VARIANCE, 100+WOUND_BONE_HEAD_TIME_VARIANCE) * 0.01 * trauma_cycle_cooldown)
// if(limb.body_zone == BODY_ZONE_HEAD && brain_trauma_group && world.time > next_trauma_cycle)
// if(active_trauma)
// QDEL_NULL(active_trauma)
// else
// active_trauma = victim.gain_trauma_type(brain_trauma_group, TRAUMA_RESILIENCE_WOUND)
// next_trauma_cycle = world.time + (rand(100-WOUND_BONE_HEAD_TIME_VARIANCE, 100+WOUND_BONE_HEAD_TIME_VARIANCE) * 0.01 * trauma_cycle_cooldown)

if(!regen_points_needed)
return
Expand Down
14 changes: 7 additions & 7 deletions code/modules/mob/living/brain/brain_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,13 @@
. = ..()
if(!. || !owner)
return
if(damage >= BRAIN_DAMAGE_DEATH) //rip
if(owner.stat != DEAD)
to_chat(owner, span_userdanger("The last spark of life in your brain fizzles out..."))
owner.death()
brain_death = TRUE
else
brain_death = FALSE
// if(damage >= BRAIN_DAMAGE_DEATH) //rip
// if(owner.stat != DEAD)
// to_chat(owner, span_userdanger("The last spark of life in your brain fizzles out..."))
// owner.death()
// brain_death = TRUE
// else
// brain_death = FALSE

/obj/item/organ/brain/check_damage_thresholds(mob/M)
. = ..()
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2076,8 +2076,8 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
span_userdanger("I have been knocked senseless!"))
H.confused = max(H.confused, 20)
H.adjust_blurriness(10)
if(prob(10))
H.gain_trauma(/datum/brain_trauma/mild/concussion)
// if(prob(10))
// H.gain_trauma(/datum/brain_trauma/mild/concussion)
else
H.adjustOrganLoss(ORGAN_SLOT_BRAIN, totitemdamage * 0.2)

Expand Down
18 changes: 18 additions & 0 deletions code/modules/mob/living/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
if(stat == DEAD)
return FALSE

handle_passive_heal() //Passive healing, if applicable

//Tongue wetness code or something
handle_healreservoir()

Expand Down Expand Up @@ -116,6 +118,22 @@
machine.check_eye(src)
return TRUE

/mob/living/proc/handle_passive_heal()
var/brut = getBruteLoss()
var/fire = getFireLoss()
var/oxy = getOxyLoss()
var/tox = getToxLoss()


if(brut > 0 || fire > 0 || oxy > 0 || tox > 0)
var/adjustby = brut + fire + oxy + tox
var/actuallyadjustby = clamp((adjustby/10) + 5, 0, adjustby)
adjustBruteLoss(-actuallyadjustby)
adjustFireLoss(-actuallyadjustby)
adjustOxyLoss(-actuallyadjustby)
adjustToxLoss(-actuallyadjustby, force_be_heal = TRUE)
adjustStaminaLoss(actuallyadjustby)

/mob/living/proc/handle_breathing(times_fired)
return

Expand Down
13 changes: 7 additions & 6 deletions code/modules/reagents/chemistry/reagents/toxin_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1149,12 +1149,13 @@
value = REAGENT_VALUE_EXCEPTIONAL

/datum/reagent/toxin/brainhurtingjuice/on_mob_life(mob/living/carbon/M)
if(prob(50))
M.gain_trauma_type(BRAIN_TRAUMA_MILD)
else if(prob(50))
M.gain_trauma_type(BRAIN_TRAUMA_SEVERE)
else
M.gain_trauma_type(BRAIN_TRAUMA_SPECIAL)
to_chat(M, span_warning("My brain hurts! Oof ouch."))
// if(prob(50))
// M.gain_trauma_type(BRAIN_TRAUMA_MILD)
// else if(prob(50))
// M.gain_trauma_type(BRAIN_TRAUMA_SEVERE)
// else
// M.gain_trauma_type(BRAIN_TRAUMA_SPECIAL)
..()

/datum/reagent/toxin/bungotoxin
Expand Down
Loading