mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Combat Overhaul Staging: Limb Specific Stamina and status effect clickdelay modifiers! (#36274)
This commit is contained in:
committed by
yogstation13-bot
parent
f943a8c465
commit
1646cc73ce
@@ -20,6 +20,14 @@
|
|||||||
/mob/proc/changeNext_move(num)
|
/mob/proc/changeNext_move(num)
|
||||||
next_move = world.time + ((num+next_move_adjust)*next_move_modifier)
|
next_move = world.time + ((num+next_move_adjust)*next_move_modifier)
|
||||||
|
|
||||||
|
/mob/living/changeNext_move(num)
|
||||||
|
var/mod = next_move_modifier
|
||||||
|
var/adj = next_move_adjust
|
||||||
|
for(var/i in status_effects)
|
||||||
|
var/datum/status_effect/S = i
|
||||||
|
mod *= S.nextmove_modifier()
|
||||||
|
adj += S.nextmove_adjust()
|
||||||
|
next_move = world.time + ((num + adj)*mod)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Before anything else, defer these calls to a per-mobtype handler. This allows us to
|
Before anything else, defer these calls to a per-mobtype handler. This allows us to
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
id = "knockdown"
|
id = "knockdown"
|
||||||
|
|
||||||
/datum/status_effect/incapacitating/knockdown/tick()
|
/datum/status_effect/incapacitating/knockdown/tick()
|
||||||
if(owner.staminaloss)
|
if(owner.getStaminaLoss())
|
||||||
owner.adjustStaminaLoss(-0.3) //reduce stamina loss by 0.3 per tick, 6 per 2 seconds
|
owner.adjustStaminaLoss(-0.3) //reduce stamina loss by 0.3 per tick, 6 per 2 seconds
|
||||||
|
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
needs_update_stat = TRUE
|
needs_update_stat = TRUE
|
||||||
|
|
||||||
/datum/status_effect/incapacitating/unconscious/tick()
|
/datum/status_effect/incapacitating/unconscious/tick()
|
||||||
if(owner.staminaloss)
|
if(owner.getStaminaLoss())
|
||||||
owner.adjustStaminaLoss(-0.3) //reduce stamina loss by 0.3 per tick, 6 per 2 seconds
|
owner.adjustStaminaLoss(-0.3) //reduce stamina loss by 0.3 per tick, 6 per 2 seconds
|
||||||
|
|
||||||
//SLEEPING
|
//SLEEPING
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
/datum/status_effect/incapacitating/sleeping/tick()
|
/datum/status_effect/incapacitating/sleeping/tick()
|
||||||
if(owner.staminaloss)
|
if(owner.getStaminaLoss())
|
||||||
owner.adjustStaminaLoss(-0.5) //reduce stamina loss by 0.5 per tick, 10 per 2 seconds
|
owner.adjustStaminaLoss(-0.5) //reduce stamina loss by 0.5 per tick, 10 per 2 seconds
|
||||||
if(human_owner && human_owner.drunkenness)
|
if(human_owner && human_owner.drunkenness)
|
||||||
human_owner.drunkenness *= 0.997 //reduce drunkenness by 0.3% per tick, 6% per 2 seconds
|
human_owner.drunkenness *= 0.997 //reduce drunkenness by 0.3% per tick, 6% per 2 seconds
|
||||||
|
|||||||
@@ -63,6 +63,13 @@
|
|||||||
owner = null
|
owner = null
|
||||||
qdel(src)
|
qdel(src)
|
||||||
|
|
||||||
|
//clickdelay/nextmove modifiers!
|
||||||
|
/datum/status_effect/proc/nextmove_modifier()
|
||||||
|
return 1
|
||||||
|
|
||||||
|
/datum/status_effect/proc/nextmove_adjust()
|
||||||
|
return 0
|
||||||
|
|
||||||
////////////////
|
////////////////
|
||||||
// ALERT HOOK //
|
// ALERT HOOK //
|
||||||
////////////////
|
////////////////
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
/obj/item/organ/heart/gland/heals/activate()
|
/obj/item/organ/heart/gland/heals/activate()
|
||||||
to_chat(owner, "<span class='notice'>You feel curiously revitalized.</span>")
|
to_chat(owner, "<span class='notice'>You feel curiously revitalized.</span>")
|
||||||
owner.adjustToxLoss(-20, FALSE, TRUE)
|
owner.adjustToxLoss(-20, FALSE, TRUE)
|
||||||
owner.heal_bodypart_damage(20, 20, TRUE)
|
owner.heal_bodypart_damage(20, 20, 0, TRUE)
|
||||||
owner.adjustOxyLoss(-20)
|
owner.adjustOxyLoss(-20)
|
||||||
|
|
||||||
/obj/item/organ/heart/gland/slime
|
/obj/item/organ/heart/gland/slime
|
||||||
|
|||||||
@@ -504,11 +504,14 @@
|
|||||||
return
|
return
|
||||||
var/total_burn = 0
|
var/total_burn = 0
|
||||||
var/total_brute = 0
|
var/total_brute = 0
|
||||||
|
var/total_stamina = 0
|
||||||
for(var/X in bodyparts) //hardcoded to streamline things a bit
|
for(var/X in bodyparts) //hardcoded to streamline things a bit
|
||||||
var/obj/item/bodypart/BP = X
|
var/obj/item/bodypart/BP = X
|
||||||
total_brute += BP.brute_dam
|
total_brute += BP.brute_dam
|
||||||
total_burn += BP.burn_dam
|
total_burn += BP.burn_dam
|
||||||
|
total_stamina += BP.stamina_dam
|
||||||
health = maxHealth - getOxyLoss() - getToxLoss() - getCloneLoss() - total_burn - total_brute
|
health = maxHealth - getOxyLoss() - getToxLoss() - getCloneLoss() - total_burn - total_brute
|
||||||
|
staminaloss = total_stamina
|
||||||
update_stat()
|
update_stat()
|
||||||
if(((maxHealth - total_burn) < HEALTH_THRESHOLD_DEAD) && stat == DEAD )
|
if(((maxHealth - total_burn) < HEALTH_THRESHOLD_DEAD) && stat == DEAD )
|
||||||
become_husk("burn")
|
become_husk("burn")
|
||||||
|
|||||||
@@ -35,10 +35,14 @@
|
|||||||
if(CLONE)
|
if(CLONE)
|
||||||
adjustCloneLoss(damage * hit_percent)
|
adjustCloneLoss(damage * hit_percent)
|
||||||
if(STAMINA)
|
if(STAMINA)
|
||||||
|
if(BP)
|
||||||
|
if(BP.receive_damage(0, 0, damage * hit_percent))
|
||||||
|
update_damage_overlays()
|
||||||
|
else
|
||||||
adjustStaminaLoss(damage * hit_percent)
|
adjustStaminaLoss(damage * hit_percent)
|
||||||
if(BRAIN)
|
if(BRAIN)
|
||||||
adjustBrainLoss(damage * hit_percent)
|
adjustBrainLoss(damage * hit_percent)
|
||||||
return 1
|
return TRUE
|
||||||
|
|
||||||
|
|
||||||
//These procs fetch a cumulative total damage from all bodyparts
|
//These procs fetch a cumulative total damage from all bodyparts
|
||||||
@@ -61,21 +65,20 @@
|
|||||||
if(!forced && (status_flags & GODMODE))
|
if(!forced && (status_flags & GODMODE))
|
||||||
return FALSE
|
return FALSE
|
||||||
if(amount > 0)
|
if(amount > 0)
|
||||||
take_overall_damage(amount, 0, updating_health)
|
take_overall_damage(amount, 0, 0, updating_health)
|
||||||
else
|
else
|
||||||
heal_overall_damage(-amount, 0, 0, 1, updating_health)
|
heal_overall_damage(abs(amount), 0, 0, FALSE, TRUE, updating_health)
|
||||||
return amount
|
return amount
|
||||||
|
|
||||||
/mob/living/carbon/adjustFireLoss(amount, updating_health = TRUE, forced = FALSE)
|
/mob/living/carbon/adjustFireLoss(amount, updating_health = TRUE, forced = FALSE)
|
||||||
if(!forced && (status_flags & GODMODE))
|
if(!forced && (status_flags & GODMODE))
|
||||||
return FALSE
|
return FALSE
|
||||||
if(amount > 0)
|
if(amount > 0)
|
||||||
take_overall_damage(0, amount, updating_health)
|
take_overall_damage(0, amount, 0, updating_health)
|
||||||
else
|
else
|
||||||
heal_overall_damage(0, -amount, 0, 1, updating_health)
|
heal_overall_damage(0, abs(amount), 0, FALSE, TRUE, updating_health)
|
||||||
return amount
|
return amount
|
||||||
|
|
||||||
|
|
||||||
/mob/living/carbon/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE)
|
/mob/living/carbon/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE)
|
||||||
if(!forced && has_trait(TRAIT_TOXINLOVER)) //damage becomes healing and healing becomes damage
|
if(!forced && has_trait(TRAIT_TOXINLOVER)) //damage becomes healing and healing becomes damage
|
||||||
amount = -amount
|
amount = -amount
|
||||||
@@ -85,14 +88,36 @@
|
|||||||
blood_volume -= amount
|
blood_volume -= amount
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
|
/mob/living/carbon/getStaminaLoss()
|
||||||
|
. = 0
|
||||||
|
for(var/X in bodyparts)
|
||||||
|
var/obj/item/bodypart/BP = X
|
||||||
|
. += BP.stamina_dam
|
||||||
|
|
||||||
|
/mob/living/carbon/adjustStaminaLoss(amount, updating_health = TRUE, forced = FALSE)
|
||||||
|
if(!forced && (status_flags & GODMODE))
|
||||||
|
return FALSE
|
||||||
|
if(amount > 0)
|
||||||
|
take_overall_damage(0, 0, amount, updating_health)
|
||||||
|
else
|
||||||
|
heal_overall_damage(0, 0, abs(amount), FALSE, FALSE, updating_health)
|
||||||
|
return amount
|
||||||
|
|
||||||
|
/mob/living/carbon/setStaminaLoss(amount, updating = TRUE, forced = FALSE)
|
||||||
|
var/current = getStaminaLoss()
|
||||||
|
var/diff = amount - current
|
||||||
|
if(!diff)
|
||||||
|
return
|
||||||
|
adjustStaminaLoss(diff, updating, forced)
|
||||||
|
|
||||||
////////////////////////////////////////////
|
////////////////////////////////////////////
|
||||||
|
|
||||||
//Returns a list of damaged bodyparts
|
//Returns a list of damaged bodyparts
|
||||||
/mob/living/carbon/proc/get_damaged_bodyparts(brute, burn)
|
/mob/living/carbon/proc/get_damaged_bodyparts(brute = FALSE, burn = FALSE, stamina = FALSE)
|
||||||
var/list/obj/item/bodypart/parts = list()
|
var/list/obj/item/bodypart/parts = list()
|
||||||
for(var/X in bodyparts)
|
for(var/X in bodyparts)
|
||||||
var/obj/item/bodypart/BP = X
|
var/obj/item/bodypart/BP = X
|
||||||
if((brute && BP.brute_dam) || (burn && BP.burn_dam))
|
if((brute && BP.brute_dam) || (burn && BP.burn_dam) || (stamina && BP.stamina_dam))
|
||||||
parts += BP
|
parts += BP
|
||||||
return parts
|
return parts
|
||||||
|
|
||||||
@@ -108,90 +133,79 @@
|
|||||||
//Heals ONE bodypart randomly selected from damaged ones.
|
//Heals ONE bodypart randomly selected from damaged ones.
|
||||||
//It automatically updates damage overlays if necessary
|
//It automatically updates damage overlays if necessary
|
||||||
//It automatically updates health status
|
//It automatically updates health status
|
||||||
/mob/living/carbon/heal_bodypart_damage(brute, burn, only_robotic = 0, only_organic = 1)
|
/mob/living/carbon/heal_bodypart_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE, only_robotic = FALSE, only_organic = TRUE)
|
||||||
var/list/obj/item/bodypart/parts = get_damaged_bodyparts(brute,burn)
|
var/list/obj/item/bodypart/parts = get_damaged_bodyparts(brute,burn)
|
||||||
if(!parts.len)
|
if(!parts.len)
|
||||||
return
|
return
|
||||||
var/obj/item/bodypart/picked = pick(parts)
|
var/obj/item/bodypart/picked = pick(parts)
|
||||||
if(picked.heal_damage(brute, burn, only_robotic, only_organic))
|
if(picked.heal_damage(brute, burn, stamina, only_robotic, only_organic))
|
||||||
update_damage_overlays()
|
update_damage_overlays()
|
||||||
|
|
||||||
//Damages ONE bodypart randomly selected from damagable ones.
|
//Damages ONE bodypart randomly selected from damagable ones.
|
||||||
//It automatically updates damage overlays if necessary
|
//It automatically updates damage overlays if necessary
|
||||||
//It automatically updates health status
|
//It automatically updates health status
|
||||||
/mob/living/carbon/take_bodypart_damage(brute, burn)
|
/mob/living/carbon/take_bodypart_damage(brute = 0, burn = 0, stamina = 0)
|
||||||
var/list/obj/item/bodypart/parts = get_damageable_bodyparts()
|
var/list/obj/item/bodypart/parts = get_damageable_bodyparts()
|
||||||
if(!parts.len)
|
if(!parts.len)
|
||||||
return
|
return
|
||||||
var/obj/item/bodypart/picked = pick(parts)
|
var/obj/item/bodypart/picked = pick(parts)
|
||||||
if(picked.receive_damage(brute,burn))
|
if(picked.receive_damage(brute, burn, stamina))
|
||||||
update_damage_overlays()
|
update_damage_overlays()
|
||||||
|
|
||||||
|
|
||||||
//Heal MANY bodyparts, in random order
|
//Heal MANY bodyparts, in random order
|
||||||
/mob/living/carbon/heal_overall_damage(brute, burn, only_robotic = 0, only_organic = 1, updating_health = 1)
|
/mob/living/carbon/heal_overall_damage(brute = 0, burn = 0, stamina = 0, only_robotic = FALSE, only_organic = TRUE, updating_health = TRUE)
|
||||||
var/list/obj/item/bodypart/parts = get_damaged_bodyparts(brute,burn)
|
var/list/obj/item/bodypart/parts = get_damaged_bodyparts(brute, burn, stamina)
|
||||||
|
|
||||||
var/update = 0
|
var/update = NONE
|
||||||
while(parts.len && (brute>0 || burn>0) )
|
while(parts.len && (brute > 0 || burn > 0 || stamina > 0))
|
||||||
var/obj/item/bodypart/picked = pick(parts)
|
var/obj/item/bodypart/picked = pick(parts)
|
||||||
|
|
||||||
var/brute_was = picked.brute_dam
|
var/brute_was = picked.brute_dam
|
||||||
var/burn_was = picked.burn_dam
|
var/burn_was = picked.burn_dam
|
||||||
|
var/stamina_was = picked.stamina_dam
|
||||||
|
|
||||||
update |= picked.heal_damage(brute,burn, only_robotic, only_organic, 0)
|
update |= picked.heal_damage(brute, burn, stamina, only_robotic, only_organic, FALSE)
|
||||||
|
|
||||||
brute -= (brute_was - picked.brute_dam)
|
brute -= (brute_was - picked.brute_dam)
|
||||||
burn -= (burn_was - picked.burn_dam)
|
burn -= (burn_was - picked.burn_dam)
|
||||||
|
stamina -= (stamina_was - picked.stamina_dam)
|
||||||
|
|
||||||
parts -= picked
|
parts -= picked
|
||||||
if(updating_health)
|
if(updating_health)
|
||||||
updatehealth()
|
updatehealth()
|
||||||
|
update_stamina()
|
||||||
if(update)
|
if(update)
|
||||||
update_damage_overlays()
|
update_damage_overlays()
|
||||||
|
|
||||||
// damage MANY bodyparts, in random order
|
// damage MANY bodyparts, in random order
|
||||||
/mob/living/carbon/take_overall_damage(brute, burn, updating_health = 1)
|
/mob/living/carbon/take_overall_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE)
|
||||||
if(status_flags & GODMODE)
|
if(status_flags & GODMODE)
|
||||||
return //godmode
|
return //godmode
|
||||||
|
|
||||||
var/list/obj/item/bodypart/parts = get_damageable_bodyparts()
|
var/list/obj/item/bodypart/parts = get_damageable_bodyparts()
|
||||||
var/update = 0
|
var/update = 0
|
||||||
while(parts.len && (brute>0 || burn>0) )
|
while(parts.len && (brute > 0 || burn > 0 || stamina > 0))
|
||||||
var/obj/item/bodypart/picked = pick(parts)
|
var/obj/item/bodypart/picked = pick(parts)
|
||||||
var/brute_per_part = round(brute/parts.len, 0.01)
|
var/brute_per_part = round(brute/parts.len, 0.01)
|
||||||
var/burn_per_part = round(burn/parts.len, 0.01)
|
var/burn_per_part = round(burn/parts.len, 0.01)
|
||||||
|
var/stamina_per_part = round(stamina/parts.len, 0.01)
|
||||||
|
|
||||||
var/brute_was = picked.brute_dam
|
var/brute_was = picked.brute_dam
|
||||||
var/burn_was = picked.burn_dam
|
var/burn_was = picked.burn_dam
|
||||||
|
var/stamina_was = picked.stamina_dam
|
||||||
|
|
||||||
|
|
||||||
update |= picked.receive_damage(brute_per_part,burn_per_part, 0)
|
update |= picked.receive_damage(brute_per_part, burn_per_part, stamina_per_part, FALSE)
|
||||||
|
|
||||||
brute -= (picked.brute_dam - brute_was)
|
brute -= (picked.brute_dam - brute_was)
|
||||||
burn -= (picked.burn_dam - burn_was)
|
burn -= (picked.burn_dam - burn_was)
|
||||||
|
stamina -= (picked.stamina_dam - stamina_was)
|
||||||
|
|
||||||
parts -= picked
|
parts -= picked
|
||||||
if(updating_health)
|
if(updating_health)
|
||||||
updatehealth()
|
updatehealth()
|
||||||
if(update)
|
if(update)
|
||||||
update_damage_overlays()
|
update_damage_overlays()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/mob/living/carbon/adjustStaminaLoss(amount, updating_stamina = 1)
|
|
||||||
if(status_flags & GODMODE)
|
|
||||||
return 0
|
|
||||||
staminaloss = CLAMP(staminaloss + amount, 0, maxHealth*2)
|
|
||||||
if(updating_stamina)
|
|
||||||
update_stamina()
|
|
||||||
|
|
||||||
|
|
||||||
/mob/living/carbon/setStaminaLoss(amount, updating_stamina = 1)
|
|
||||||
if(status_flags & GODMODE)
|
|
||||||
return 0
|
|
||||||
staminaloss = amount
|
|
||||||
if(updating_stamina)
|
|
||||||
update_stamina()
|
update_stamina()
|
||||||
|
|
||||||
/mob/living/carbon/getBrainLoss()
|
/mob/living/carbon/getBrainLoss()
|
||||||
|
|||||||
@@ -769,7 +769,7 @@
|
|||||||
return
|
return
|
||||||
else
|
else
|
||||||
if(hud_used.healths)
|
if(hud_used.healths)
|
||||||
var/health_amount = health - staminaloss
|
var/health_amount = health - getStaminaLoss()
|
||||||
if(..(health_amount)) //not dead
|
if(..(health_amount)) //not dead
|
||||||
switch(hal_screwyhud)
|
switch(hal_screwyhud)
|
||||||
if(SCREWYHUD_CRIT)
|
if(SCREWYHUD_CRIT)
|
||||||
|
|||||||
@@ -692,8 +692,8 @@
|
|||||||
|
|
||||||
if(bleed_rate)
|
if(bleed_rate)
|
||||||
to_chat(src, "<span class='danger'>You are bleeding!</span>")
|
to_chat(src, "<span class='danger'>You are bleeding!</span>")
|
||||||
if(staminaloss)
|
if(getStaminaLoss())
|
||||||
if(staminaloss > 30)
|
if(getStaminaLoss() > 30)
|
||||||
to_chat(src, "<span class='info'>You're completely exhausted.</span>")
|
to_chat(src, "<span class='info'>You're completely exhausted.</span>")
|
||||||
else
|
else
|
||||||
to_chat(src, "<span class='info'>You feel fatigued.</span>")
|
to_chat(src, "<span class='info'>You feel fatigued.</span>")
|
||||||
|
|||||||
@@ -1452,6 +1452,10 @@ GLOBAL_LIST_EMPTY(roundstart_races)
|
|||||||
if(CLONE)
|
if(CLONE)
|
||||||
H.adjustCloneLoss(damage * hit_percent * H.physiology.clone_mod)
|
H.adjustCloneLoss(damage * hit_percent * H.physiology.clone_mod)
|
||||||
if(STAMINA)
|
if(STAMINA)
|
||||||
|
if(BP)
|
||||||
|
if(BP.receive_damage(0, 0, damage * hit_percent * H.physiology.stamina_mod))
|
||||||
|
H.update_stamina()
|
||||||
|
else
|
||||||
H.adjustStaminaLoss(damage * hit_percent * H.physiology.stamina_mod)
|
H.adjustStaminaLoss(damage * hit_percent * H.physiology.stamina_mod)
|
||||||
if(BRAIN)
|
if(BRAIN)
|
||||||
H.adjustBrainLoss(damage * hit_percent * H.physiology.brain_mod)
|
H.adjustBrainLoss(damage * hit_percent * H.physiology.brain_mod)
|
||||||
|
|||||||
@@ -322,7 +322,7 @@
|
|||||||
//this updates all special effects: stun, sleeping, knockdown, druggy, stuttering, etc..
|
//this updates all special effects: stun, sleeping, knockdown, druggy, stuttering, etc..
|
||||||
/mob/living/carbon/handle_status_effects()
|
/mob/living/carbon/handle_status_effects()
|
||||||
..()
|
..()
|
||||||
if(staminaloss)
|
if(getStaminaLoss())
|
||||||
adjustStaminaLoss(-3)
|
adjustStaminaLoss(-3)
|
||||||
|
|
||||||
var/restingpwr = 1 + 4 * resting
|
var/restingpwr = 1 + 4 * resting
|
||||||
|
|||||||
@@ -236,34 +236,41 @@
|
|||||||
/mob/living/proc/setStaminaLoss(amount, updating_stamina = TRUE, forced = FALSE)
|
/mob/living/proc/setStaminaLoss(amount, updating_stamina = TRUE, forced = FALSE)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
// heal ONE external organ, organ gets randomly selected from damaged ones.
|
// heal ONE external organ, organ gets randomly selected from damaged ones.
|
||||||
/mob/living/proc/heal_bodypart_damage(brute, burn, updating_health = 1)
|
/mob/living/proc/heal_bodypart_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE)
|
||||||
adjustBruteLoss(-brute, 0) //zero as argument for no instant health update
|
adjustBruteLoss(-brute, FALSE) //zero as argument for no instant health update
|
||||||
adjustFireLoss(-burn, 0)
|
adjustFireLoss(-burn, FALSE)
|
||||||
|
adjustStaminaLoss(-stamina, FALSE)
|
||||||
if(updating_health)
|
if(updating_health)
|
||||||
updatehealth()
|
updatehealth()
|
||||||
|
update_stamina()
|
||||||
|
|
||||||
// damage ONE external organ, organ gets randomly selected from damaged ones.
|
// damage ONE external organ, organ gets randomly selected from damaged ones.
|
||||||
/mob/living/proc/take_bodypart_damage(brute, burn, updating_health = 1)
|
/mob/living/proc/take_bodypart_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE)
|
||||||
adjustBruteLoss(brute, 0) //zero as argument for no instant health update
|
adjustBruteLoss(brute, FALSE) //zero as argument for no instant health update
|
||||||
adjustFireLoss(burn, 0)
|
adjustFireLoss(burn, FALSE)
|
||||||
|
adjustStaminaLoss(stamina, FALSE)
|
||||||
if(updating_health)
|
if(updating_health)
|
||||||
updatehealth()
|
updatehealth()
|
||||||
|
update_stamina()
|
||||||
|
|
||||||
// heal MANY bodyparts, in random order
|
// heal MANY bodyparts, in random order
|
||||||
/mob/living/proc/heal_overall_damage(brute, burn, only_robotic = 0, only_organic = 1, updating_health = 1)
|
/mob/living/proc/heal_overall_damage(brute = 0, burn = 0, stamina = 0, only_robotic = FALSE, only_organic = TRUE, updating_health = TRUE)
|
||||||
adjustBruteLoss(-brute, 0) //zero as argument for no instant health update
|
adjustBruteLoss(-brute, FALSE) //zero as argument for no instant health update
|
||||||
adjustFireLoss(-burn, 0)
|
adjustFireLoss(-burn, FALSE)
|
||||||
|
adjustStaminaLoss(-stamina, FALSE)
|
||||||
if(updating_health)
|
if(updating_health)
|
||||||
updatehealth()
|
updatehealth()
|
||||||
|
update_stamina()
|
||||||
|
|
||||||
// damage MANY bodyparts, in random order
|
// damage MANY bodyparts, in random order
|
||||||
/mob/living/proc/take_overall_damage(brute, burn, updating_health = 1)
|
/mob/living/proc/take_overall_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE)
|
||||||
adjustBruteLoss(brute, 0) //zero as argument for no instant health update
|
adjustBruteLoss(brute, FALSE) //zero as argument for no instant health update
|
||||||
adjustFireLoss(burn, 0)
|
adjustFireLoss(burn, FALSE)
|
||||||
|
adjustStaminaLoss(stamina, FALSE)
|
||||||
if(updating_health)
|
if(updating_health)
|
||||||
updatehealth()
|
updatehealth()
|
||||||
|
update_stamina()
|
||||||
|
|
||||||
//heal up to amount damage, in a given order
|
//heal up to amount damage, in a given order
|
||||||
/mob/living/proc/heal_ordered_damage(amount, list/damage_types)
|
/mob/living/proc/heal_ordered_damage(amount, list/damage_types)
|
||||||
|
|||||||
@@ -433,6 +433,7 @@
|
|||||||
if(status_flags & GODMODE)
|
if(status_flags & GODMODE)
|
||||||
return
|
return
|
||||||
health = maxHealth - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
|
health = maxHealth - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
|
||||||
|
staminaloss = getStaminaLoss()
|
||||||
update_stat()
|
update_stat()
|
||||||
med_hud_set_health()
|
med_hud_set_health()
|
||||||
med_hud_set_status()
|
med_hud_set_status()
|
||||||
@@ -481,7 +482,7 @@
|
|||||||
cure_blind()
|
cure_blind()
|
||||||
cure_husk()
|
cure_husk()
|
||||||
hallucination = 0
|
hallucination = 0
|
||||||
heal_overall_damage(100000, 100000, 0, 0, 1) //heal brute and burn dmg on both organic and robotic limbs, and update health right away.
|
heal_overall_damage(INFINITY, INFINITY, INFINITY, FALSE, FALSE, TRUE) //heal brute and burn dmg on both organic and robotic limbs, and update health right away.
|
||||||
ExtinguishMob()
|
ExtinguishMob()
|
||||||
fire_stacks = 0
|
fire_stacks = 0
|
||||||
update_canmove()
|
update_canmove()
|
||||||
@@ -862,13 +863,17 @@
|
|||||||
return FALSE
|
return FALSE
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
/mob/living/carbon/proc/update_stamina()
|
/mob/living/proc/update_stamina()
|
||||||
if(staminaloss)
|
return
|
||||||
var/total_health = (health - staminaloss)
|
|
||||||
|
/mob/living/carbon/update_stamina()
|
||||||
|
var/stam = getStaminaLoss()
|
||||||
|
if(stam)
|
||||||
|
var/total_health = (health - stam)
|
||||||
if(total_health <= HEALTH_THRESHOLD_CRIT && !stat)
|
if(total_health <= HEALTH_THRESHOLD_CRIT && !stat)
|
||||||
to_chat(src, "<span class='notice'>You're too exhausted to keep going...</span>")
|
to_chat(src, "<span class='notice'>You're too exhausted to keep going...</span>")
|
||||||
Knockdown(100)
|
Knockdown(100)
|
||||||
setStaminaLoss(health - 2)
|
setStaminaLoss(health - 2, FALSE, FALSE)
|
||||||
update_health_hud()
|
update_health_hud()
|
||||||
|
|
||||||
/mob/living/carbon/alien/update_stamina()
|
/mob/living/carbon/alien/update_stamina()
|
||||||
|
|||||||
@@ -408,7 +408,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
|
|||||||
else
|
else
|
||||||
dam = 0
|
dam = 0
|
||||||
if((brute_heal > 0 && affecting.brute_dam > 0) || (burn_heal > 0 && affecting.burn_dam > 0))
|
if((brute_heal > 0 && affecting.brute_dam > 0) || (burn_heal > 0 && affecting.burn_dam > 0))
|
||||||
if(affecting.heal_damage(brute_heal, burn_heal, 1, 0))
|
if(affecting.heal_damage(brute_heal, burn_heal, 0, TRUE, FALSE))
|
||||||
H.update_damage_overlays()
|
H.update_damage_overlays()
|
||||||
user.visible_message("[user] has fixed some of the [dam ? "dents on" : "burnt wires in"] [H]'s [affecting.name].", \
|
user.visible_message("[user] has fixed some of the [dam ? "dents on" : "burnt wires in"] [H]'s [affecting.name].", \
|
||||||
"<span class='notice'>You fix some of the [dam ? "dents on" : "burnt wires in"] [H]'s [affecting.name].</span>")
|
"<span class='notice'>You fix some of the [dam ? "dents on" : "burnt wires in"] [H]'s [affecting.name].</span>")
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
|||||||
|
|
||||||
/datum/reagent/consumable/ethanol/bilk/on_mob_life(mob/living/M)
|
/datum/reagent/consumable/ethanol/bilk/on_mob_life(mob/living/M)
|
||||||
if(M.getBruteLoss() && prob(10))
|
if(M.getBruteLoss() && prob(10))
|
||||||
M.heal_bodypart_damage(1,0, 0)
|
M.heal_bodypart_damage(1)
|
||||||
. = 1
|
. = 1
|
||||||
return ..() || .
|
return ..() || .
|
||||||
|
|
||||||
@@ -1085,7 +1085,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
|||||||
|
|
||||||
/datum/reagent/consumable/ethanol/bananahonk/on_mob_life(mob/living/M)
|
/datum/reagent/consumable/ethanol/bananahonk/on_mob_life(mob/living/M)
|
||||||
if((ishuman(M) && M.job in list("Clown") ) || ismonkey(M))
|
if((ishuman(M) && M.job in list("Clown") ) || ismonkey(M))
|
||||||
M.heal_bodypart_damage(1,1, 0)
|
M.heal_bodypart_damage(1,1)
|
||||||
. = 1
|
. = 1
|
||||||
return ..() || .
|
return ..() || .
|
||||||
|
|
||||||
@@ -1403,7 +1403,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
|||||||
|
|
||||||
/datum/reagent/consumable/ethanol/quadruple_sec/on_mob_life(mob/living/M)
|
/datum/reagent/consumable/ethanol/quadruple_sec/on_mob_life(mob/living/M)
|
||||||
if(M.mind && M.mind.assigned_role in list("Security Officer", "Detective", "Head of Security", "Warden", "Lawyer")) //Securidrink in line with the screwderiver for engineers or nothing for mimes.
|
if(M.mind && M.mind.assigned_role in list("Security Officer", "Detective", "Head of Security", "Warden", "Lawyer")) //Securidrink in line with the screwderiver for engineers or nothing for mimes.
|
||||||
M.heal_bodypart_damage (1,1,1)
|
M.heal_bodypart_damage(1, 1)
|
||||||
M.adjustBruteLoss(-2,0)
|
M.adjustBruteLoss(-2,0)
|
||||||
. = 1
|
. = 1
|
||||||
return ..()
|
return ..()
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
M.setCloneLoss(0, 0)
|
M.setCloneLoss(0, 0)
|
||||||
M.setOxyLoss(0, 0)
|
M.setOxyLoss(0, 0)
|
||||||
M.radiation = 0
|
M.radiation = 0
|
||||||
M.heal_bodypart_damage(5,5, 0)
|
M.heal_bodypart_damage(5,5)
|
||||||
M.adjustToxLoss(-5, 0, TRUE)
|
M.adjustToxLoss(-5, 0, TRUE)
|
||||||
M.hallucination = 0
|
M.hallucination = 0
|
||||||
M.setBrainLoss(0)
|
M.setBrainLoss(0)
|
||||||
@@ -197,7 +197,7 @@
|
|||||||
|
|
||||||
/datum/reagent/medicine/rezadone/on_mob_life(mob/living/M)
|
/datum/reagent/medicine/rezadone/on_mob_life(mob/living/M)
|
||||||
M.setCloneLoss(0) //Rezadone is almost never used in favor of cryoxadone. Hopefully this will change that.
|
M.setCloneLoss(0) //Rezadone is almost never used in favor of cryoxadone. Hopefully this will change that.
|
||||||
M.heal_bodypart_damage(1,1, 0)
|
M.heal_bodypart_damage(1,1)
|
||||||
M.remove_trait(TRAIT_DISFIGURED, TRAIT_GENERIC)
|
M.remove_trait(TRAIT_DISFIGURED, TRAIT_GENERIC)
|
||||||
..()
|
..()
|
||||||
. = 1
|
. = 1
|
||||||
@@ -1129,7 +1129,7 @@
|
|||||||
can_synth = FALSE
|
can_synth = FALSE
|
||||||
|
|
||||||
/datum/reagent/medicine/miningnanites/on_mob_life(mob/living/M)
|
/datum/reagent/medicine/miningnanites/on_mob_life(mob/living/M)
|
||||||
M.heal_bodypart_damage(5,5, 0)
|
M.heal_bodypart_damage(5,5)
|
||||||
..()
|
..()
|
||||||
. = 1
|
. = 1
|
||||||
|
|
||||||
|
|||||||
@@ -784,7 +784,7 @@
|
|||||||
taste_description = "chlorine"
|
taste_description = "chlorine"
|
||||||
|
|
||||||
/datum/reagent/chlorine/on_mob_life(mob/living/M)
|
/datum/reagent/chlorine/on_mob_life(mob/living/M)
|
||||||
M.take_bodypart_damage(1*REM, 0, 0)
|
M.take_bodypart_damage(1*REM, 0, 0, 0)
|
||||||
. = 1
|
. = 1
|
||||||
..()
|
..()
|
||||||
|
|
||||||
|
|||||||
@@ -128,7 +128,7 @@
|
|||||||
M.adjustToxLoss(rand(20,60)*REM, 0)
|
M.adjustToxLoss(rand(20,60)*REM, 0)
|
||||||
. = 1
|
. = 1
|
||||||
else if(prob(40))
|
else if(prob(40))
|
||||||
M.heal_bodypart_damage(5*REM,0, 0)
|
M.heal_bodypart_damage(5*REM)
|
||||||
. = 1
|
. = 1
|
||||||
..()
|
..()
|
||||||
|
|
||||||
@@ -874,7 +874,7 @@
|
|||||||
|
|
||||||
/datum/reagent/toxin/peaceborg/tire/on_mob_life(mob/living/M)
|
/datum/reagent/toxin/peaceborg/tire/on_mob_life(mob/living/M)
|
||||||
var/healthcomp = (100 - M.health) //DOES NOT ACCOUNT FOR ADMINBUS THINGS THAT MAKE YOU HAVE MORE THAN 200/210 HEALTH, OR SOMETHING OTHER THAN A HUMAN PROCESSING THIS.
|
var/healthcomp = (100 - M.health) //DOES NOT ACCOUNT FOR ADMINBUS THINGS THAT MAKE YOU HAVE MORE THAN 200/210 HEALTH, OR SOMETHING OTHER THAN A HUMAN PROCESSING THIS.
|
||||||
if(M.staminaloss < (45 - healthcomp)) //At 50 health you would have 200 - 150 health meaning 50 compensation. 60 - 50 = 10, so would only do 10-19 stamina.)
|
if(M.getStaminaLoss() < (45 - healthcomp)) //At 50 health you would have 200 - 150 health meaning 50 compensation. 60 - 50 = 10, so would only do 10-19 stamina.)
|
||||||
M.adjustStaminaLoss(10)
|
M.adjustStaminaLoss(10)
|
||||||
if(prob(30))
|
if(prob(30))
|
||||||
to_chat(M, "You should sit down and take a rest...")
|
to_chat(M, "You should sit down and take a rest...")
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
var/burnstate = 0
|
var/burnstate = 0
|
||||||
var/brute_dam = 0
|
var/brute_dam = 0
|
||||||
var/burn_dam = 0
|
var/burn_dam = 0
|
||||||
|
var/stamina_dam = 0
|
||||||
var/max_damage = 0
|
var/max_damage = 0
|
||||||
var/list/embedded_objects = list()
|
var/list/embedded_objects = list()
|
||||||
var/held_index = 0 //are we a hand? if so, which one!
|
var/held_index = 0 //are we a hand? if so, which one!
|
||||||
@@ -107,52 +108,54 @@
|
|||||||
//Applies brute and burn damage to the organ. Returns 1 if the damage-icon states changed at all.
|
//Applies brute and burn damage to the organ. Returns 1 if the damage-icon states changed at all.
|
||||||
//Damage will not exceed max_damage using this proc
|
//Damage will not exceed max_damage using this proc
|
||||||
//Cannot apply negative damage
|
//Cannot apply negative damage
|
||||||
/obj/item/bodypart/proc/receive_damage(brute, burn, updating_health = 1)
|
/obj/item/bodypart/proc/receive_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE)
|
||||||
if(owner && (owner.status_flags & GODMODE))
|
if(owner && (owner.status_flags & GODMODE))
|
||||||
return 0 //godmode
|
return FALSE //godmode
|
||||||
var/dmg_mlt = CONFIG_GET(number/damage_multiplier)
|
var/dmg_mlt = CONFIG_GET(number/damage_multiplier)
|
||||||
brute = max(brute * dmg_mlt, 0)
|
brute = max(brute * dmg_mlt, 0)
|
||||||
burn = max(burn * dmg_mlt, 0)
|
burn = max(burn * dmg_mlt, 0)
|
||||||
|
stamina = max(stamina * dmg_mlt, 0)
|
||||||
|
|
||||||
if(status == BODYPART_ROBOTIC) //This makes robolimbs not damageable by chems and makes it stronger
|
if(status == BODYPART_ROBOTIC) //This makes robolimbs not damageable by chems and makes it stronger
|
||||||
brute = max(0, brute - 5)
|
brute = max(0, brute - 5)
|
||||||
burn = max(0, burn - 4)
|
burn = max(0, burn - 4)
|
||||||
|
//No stamina scaling.. for now..
|
||||||
|
|
||||||
|
if(!brute && !burn && !stamina)
|
||||||
|
return FALSE
|
||||||
|
|
||||||
switch(animal_origin)
|
switch(animal_origin)
|
||||||
if(ALIEN_BODYPART,LARVA_BODYPART) //aliens take double burn
|
if(ALIEN_BODYPART,LARVA_BODYPART) //aliens take double burn
|
||||||
burn *= 2
|
burn *= 2
|
||||||
|
|
||||||
var/can_inflict = max_damage - (brute_dam + burn_dam)
|
var/can_inflict = max_damage - (brute_dam + burn_dam)
|
||||||
if(!can_inflict)
|
if(can_inflict <= 0)
|
||||||
return 0
|
return FALSE
|
||||||
|
|
||||||
|
var/total_damage = brute + burn
|
||||||
|
|
||||||
|
if(total_damage > can_inflict)
|
||||||
|
var/excess = total_damage - can_inflict
|
||||||
|
brute = brute * (excess / total_damage)
|
||||||
|
burn = burn * (excess / total_damage)
|
||||||
|
|
||||||
if((brute + burn) < can_inflict)
|
|
||||||
brute_dam += brute
|
brute_dam += brute
|
||||||
burn_dam += burn
|
burn_dam += burn
|
||||||
else
|
|
||||||
if(brute > 0)
|
//We've dealt the physical damages, if there's room lets apply the stamina damage.
|
||||||
if(burn > 0)
|
var/current_damage = brute_dam + burn_dam + stamina_dam //This time around, count stamina loss too.
|
||||||
brute = round( (brute/(brute+burn)) * can_inflict, 1 )
|
var/available_damage = max_damage - current_damage
|
||||||
burn = can_inflict - brute //gets whatever damage is left over
|
stamina_dam += CLAMP(stamina, 0, available_damage)
|
||||||
brute_dam += brute
|
|
||||||
burn_dam += burn
|
|
||||||
else
|
|
||||||
brute_dam += can_inflict
|
|
||||||
else
|
|
||||||
if(burn > 0)
|
|
||||||
burn_dam += can_inflict
|
|
||||||
else
|
|
||||||
return 0
|
|
||||||
if(owner && updating_health)
|
if(owner && updating_health)
|
||||||
owner.updatehealth()
|
owner.updatehealth()
|
||||||
|
if(stamina)
|
||||||
|
owner.update_stamina()
|
||||||
return update_bodypart_damage_state()
|
return update_bodypart_damage_state()
|
||||||
|
|
||||||
|
|
||||||
//Heals brute and burn damage for the organ. Returns 1 if the damage-icon states changed at all.
|
//Heals brute and burn damage for the organ. Returns 1 if the damage-icon states changed at all.
|
||||||
//Damage cannot go below zero.
|
//Damage cannot go below zero.
|
||||||
//Cannot remove negative damage (i.e. apply damage)
|
//Cannot remove negative damage (i.e. apply damage)
|
||||||
/obj/item/bodypart/proc/heal_damage(brute, burn, only_robotic = 0, only_organic = 1, updating_health = 1)
|
/obj/item/bodypart/proc/heal_damage(brute, burn, stamina, only_robotic = FALSE, only_organic = TRUE, updating_health = TRUE)
|
||||||
|
|
||||||
if(only_robotic && status != BODYPART_ROBOTIC) //This makes organic limbs not heal when the proc is in Robotic mode.
|
if(only_robotic && status != BODYPART_ROBOTIC) //This makes organic limbs not heal when the proc is in Robotic mode.
|
||||||
return
|
return
|
||||||
@@ -162,6 +165,7 @@
|
|||||||
|
|
||||||
brute_dam = max(brute_dam - brute, 0)
|
brute_dam = max(brute_dam - brute, 0)
|
||||||
burn_dam = max(burn_dam - burn, 0)
|
burn_dam = max(burn_dam - burn, 0)
|
||||||
|
stamina_dam = max(stamina_dam - stamina, 0)
|
||||||
if(owner && updating_health)
|
if(owner && updating_health)
|
||||||
owner.updatehealth()
|
owner.updatehealth()
|
||||||
return update_bodypart_damage_state()
|
return update_bodypart_damage_state()
|
||||||
@@ -180,8 +184,8 @@
|
|||||||
if((tbrute != brutestate) || (tburn != burnstate))
|
if((tbrute != brutestate) || (tburn != burnstate))
|
||||||
brutestate = tbrute
|
brutestate = tbrute
|
||||||
burnstate = tburn
|
burnstate = tburn
|
||||||
return 1
|
return TRUE
|
||||||
return 0
|
return FALSE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -305,7 +305,7 @@
|
|||||||
cooldown = COOLDOWN_DAMAGE
|
cooldown = COOLDOWN_DAMAGE
|
||||||
for(var/V in listeners)
|
for(var/V in listeners)
|
||||||
var/mob/living/L = V
|
var/mob/living/L = V
|
||||||
L.heal_overall_damage(10 * power_multiplier, 10 * power_multiplier, 0, 0)
|
L.heal_overall_damage(10 * power_multiplier, 10 * power_multiplier, 0, FALSE, FALSE)
|
||||||
|
|
||||||
//BRUTE DAMAGE
|
//BRUTE DAMAGE
|
||||||
else if((findtext(message, hurt_words)))
|
else if((findtext(message, hurt_words)))
|
||||||
|
|||||||
Reference in New Issue
Block a user