mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 15:17:01 +01:00
Merge pull request #19964 from KorPhaeron/config
Replace health config with damage multiplier config
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
if(health<= -maxHealth || !getorgan(/obj/item/organ/brain))
|
||||
death()
|
||||
return
|
||||
if(paralysis || sleeping || getOxyLoss() > 50 || (status_flags & FAKEDEATH) || health <= config.health_threshold_crit)
|
||||
if(paralysis || sleeping || getOxyLoss() > 50 || (status_flags & FAKEDEATH) || health <= HEALTH_THRESHOLD_CRIT)
|
||||
if(stat == CONSCIOUS)
|
||||
stat = UNCONSCIOUS
|
||||
blind_eyes(1)
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
/mob/living/carbon/brain/can_be_revived()
|
||||
. = 1
|
||||
if(!container || health <= config.health_threshold_dead)
|
||||
if(!container || health <= HEALTH_THRESHOLD_DEAD)
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/brain/update_sight()
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
if(brainmob)
|
||||
if(brainmob.client)
|
||||
if(brainmob.health <= config.health_threshold_dead)
|
||||
if(brainmob.health <= HEALTH_THRESHOLD_DEAD)
|
||||
user << "It's lifeless and severely damaged."
|
||||
else
|
||||
user << "You can feel the small spark of life still left in this one."
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
/mob/living/carbon/brain/update_stat()
|
||||
if(status_flags & GODMODE)
|
||||
return
|
||||
if(health <= config.health_threshold_dead)
|
||||
if(health <= HEALTH_THRESHOLD_DEAD)
|
||||
if(stat != DEAD)
|
||||
death()
|
||||
var/obj/item/organ/brain/BR
|
||||
|
||||
@@ -634,7 +634,7 @@
|
||||
if(!client)
|
||||
return
|
||||
|
||||
if(stat == UNCONSCIOUS && health <= config.health_threshold_crit)
|
||||
if(stat == UNCONSCIOUS && health <= HEALTH_THRESHOLD_CRIT)
|
||||
var/severity = 0
|
||||
switch(health)
|
||||
if(-20 to -10) severity = 1
|
||||
@@ -712,10 +712,10 @@
|
||||
if(status_flags & GODMODE)
|
||||
return
|
||||
if(stat != DEAD)
|
||||
if(health<= config.health_threshold_dead || !getorgan(/obj/item/organ/brain))
|
||||
if(health<= HEALTH_THRESHOLD_DEAD || !getorgan(/obj/item/organ/brain))
|
||||
death()
|
||||
return
|
||||
if(paralysis || sleeping || getOxyLoss() > 50 || (status_flags & FAKEDEATH) || health <= config.health_threshold_crit)
|
||||
if(paralysis || sleeping || getOxyLoss() > 50 || (status_flags & FAKEDEATH) || health <= HEALTH_THRESHOLD_CRIT)
|
||||
if(stat == CONSCIOUS)
|
||||
stat = UNCONSCIOUS
|
||||
blind_eyes(1)
|
||||
|
||||
@@ -837,7 +837,7 @@
|
||||
var/they_breathe = (!(NOBREATH in C.dna.species.specflags))
|
||||
var/they_lung = C.getorganslot("lungs")
|
||||
|
||||
if(C.health > config.health_threshold_crit)
|
||||
if(C.health > HEALTH_THRESHOLD_CRIT)
|
||||
return
|
||||
|
||||
src.visible_message("[src] performs CPR on [C.name]!", "<span class='notice'>You perform CPR on [C.name].</span>")
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
total_burn += BP.burn_dam
|
||||
health = maxHealth - getOxyLoss() - getToxLoss() - getCloneLoss() - total_burn - total_brute
|
||||
update_stat()
|
||||
if(((maxHealth - total_burn) < config.health_threshold_dead) && stat == DEAD )
|
||||
if(((maxHealth - total_burn) < HEALTH_THRESHOLD_DEAD) && stat == DEAD )
|
||||
ChangeToHusk()
|
||||
if(on_fire)
|
||||
shred_clothing()
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
return 1//Humans can use guns and such
|
||||
|
||||
/mob/living/carbon/human/InCritical()
|
||||
return (health <= config.health_threshold_crit && stat == UNCONSCIOUS)
|
||||
return (health <= HEALTH_THRESHOLD_CRIT && stat == UNCONSCIOUS)
|
||||
|
||||
/mob/living/carbon/human/reagent_check(datum/reagent/R)
|
||||
return dna.species.handle_chemicals(R,src)
|
||||
|
||||
@@ -479,7 +479,7 @@
|
||||
H.losebreath = 0
|
||||
|
||||
var/takes_crit_damage = (!(NOCRITDAMAGE in specflags))
|
||||
if((H.health < config.health_threshold_crit) && takes_crit_damage)
|
||||
if((H.health < HEALTH_THRESHOLD_CRIT) && takes_crit_damage)
|
||||
H.adjustBruteLoss(1)
|
||||
|
||||
/datum/species/proc/spec_death(gibbed, mob/living/carbon/human/H)
|
||||
@@ -1169,7 +1169,7 @@
|
||||
if(!breath || (breath.total_moles() == 0) || !lungs)
|
||||
if(H.reagents.has_reagent("epinephrine") && lungs)
|
||||
return
|
||||
if(H.health >= config.health_threshold_crit)
|
||||
if(H.health >= HEALTH_THRESHOLD_CRIT)
|
||||
H.adjustOxyLoss(HUMAN_MAX_OXYLOSS)
|
||||
if(!lungs)
|
||||
H.adjustOxyLoss(1)
|
||||
@@ -1329,7 +1329,7 @@
|
||||
if(!H || !safe_breath_min) //the other args are either: Ok being 0 or Specifically handled.
|
||||
return 0
|
||||
|
||||
if(!(NOBREATH in specflags) || (H.health <= config.health_threshold_crit))
|
||||
if(!(NOBREATH in specflags) || (H.health <= HEALTH_THRESHOLD_CRIT))
|
||||
if(prob(20))
|
||||
H.emote("gasp")
|
||||
if(breath_pp > 0)
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
// If whispering your last words, limit the whisper based on how close you are to death.
|
||||
if(critical)
|
||||
var/health_diff = round(-config.health_threshold_dead + health)
|
||||
var/health_diff = round(-HEALTH_THRESHOLD_DEAD + health)
|
||||
// If we cut our message short, abruptly end it with a-..
|
||||
var/message_len = length(message)
|
||||
message = copytext(message, 1, health_diff) + "[message_len > health_diff ? "-.." : "..."]"
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
var/datum/gas_mixture/breath
|
||||
|
||||
if(health <= config.health_threshold_crit || (pulledby && pulledby.grab_state >= GRAB_KILL && !getorganslot("breathing_tube")))
|
||||
if(health <= HEALTH_THRESHOLD_CRIT || (pulledby && pulledby.grab_state >= GRAB_KILL && !getorganslot("breathing_tube")))
|
||||
losebreath++
|
||||
|
||||
//Suffocate
|
||||
@@ -311,7 +311,7 @@
|
||||
if(sleeping)
|
||||
handle_dreams()
|
||||
AdjustSleeping(-1)
|
||||
if(prob(10) && health>config.health_threshold_crit)
|
||||
if(prob(10) && health>HEALTH_THRESHOLD_CRIT)
|
||||
emote("snore")
|
||||
|
||||
var/restingpwr = 1 + 4 * resting
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
/* I am informed this was added by Giacom to reduce mob-stacking in escape pods.
|
||||
It's sorta problematic atm due to the shuttle changes I am trying to do
|
||||
Sorry Giacom. Please don't be mad :(
|
||||
/mob/living/Life()
|
||||
..()
|
||||
var/area/A = get_area(loc)
|
||||
if(A && A.push_dir)
|
||||
push_mob_back(src, A.push_dir)
|
||||
*/
|
||||
|
||||
/mob/living/New()
|
||||
. = ..()
|
||||
generateStaticOverlay()
|
||||
@@ -216,7 +206,7 @@ Sorry Giacom. Please don't be mad :(
|
||||
set hidden = 1
|
||||
if (InCritical())
|
||||
src.attack_log += "[src] has [whispered ? "whispered his final words" : "succumbed to death"] with [round(health, 0.1)] points of health!"
|
||||
src.adjustOxyLoss(src.health - config.health_threshold_dead)
|
||||
src.adjustOxyLoss(src.health - HEALTH_THRESHOLD_DEAD)
|
||||
updatehealth()
|
||||
if(!whispered)
|
||||
src << "<span class='notice'>You have given up life and succumbed to death.</span>"
|
||||
@@ -272,7 +262,7 @@ Sorry Giacom. Please don't be mad :(
|
||||
/mob/living/proc/adjustBruteLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
bruteloss = Clamp(bruteloss + amount, 0, maxHealth*2)
|
||||
bruteloss = Clamp((bruteloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
@@ -282,7 +272,7 @@ Sorry Giacom. Please don't be mad :(
|
||||
/mob/living/proc/adjustOxyLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
oxyloss = Clamp(oxyloss + amount, 0, maxHealth*2)
|
||||
oxyloss = Clamp((oxyloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
@@ -299,7 +289,7 @@ Sorry Giacom. Please don't be mad :(
|
||||
/mob/living/proc/adjustToxLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
toxloss = Clamp(toxloss + amount, 0, maxHealth*2)
|
||||
toxloss = Clamp((toxloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
return amount
|
||||
@@ -317,7 +307,7 @@ Sorry Giacom. Please don't be mad :(
|
||||
/mob/living/proc/adjustFireLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
fireloss = Clamp(fireloss + amount, 0, maxHealth*2)
|
||||
fireloss = Clamp((fireloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
@@ -327,7 +317,7 @@ Sorry Giacom. Please don't be mad :(
|
||||
/mob/living/proc/adjustCloneLoss(amount, updating_health=1)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
cloneloss = Clamp(cloneloss + amount, 0, maxHealth*2)
|
||||
cloneloss = Clamp((cloneloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
@@ -344,7 +334,7 @@ Sorry Giacom. Please don't be mad :(
|
||||
/mob/living/proc/adjustBrainLoss(amount)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
brainloss = Clamp(brainloss + amount, 0, maxHealth*2)
|
||||
brainloss = Clamp((brainloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
|
||||
|
||||
/mob/living/proc/setBrainLoss(amount)
|
||||
if(status_flags & GODMODE)
|
||||
@@ -541,7 +531,7 @@ Sorry Giacom. Please don't be mad :(
|
||||
//proc called by revive(), to check if we can actually ressuscitate the mob (we don't want to revive him and have him instantly die again)
|
||||
/mob/living/proc/can_be_revived()
|
||||
. = 1
|
||||
if(health <= config.health_threshold_dead)
|
||||
if(health <= HEALTH_THRESHOLD_DEAD)
|
||||
return 0
|
||||
|
||||
/mob/living/proc/update_damage_overlays()
|
||||
@@ -1026,7 +1016,7 @@ Sorry Giacom. Please don't be mad :(
|
||||
/mob/living/carbon/human/update_stamina()
|
||||
if(staminaloss)
|
||||
var/total_health = (health - staminaloss)
|
||||
if(total_health <= config.health_threshold_crit && !stat)
|
||||
if(total_health <= HEALTH_THRESHOLD_CRIT && !stat)
|
||||
src << "<span class='notice'>You're too exhausted to keep going...</span>"
|
||||
Weaken(5)
|
||||
setStaminaLoss(health - 2)
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
if(status_flags & GODMODE)
|
||||
return
|
||||
if(stat != DEAD)
|
||||
if(health <= config.health_threshold_dead)
|
||||
if(health <= HEALTH_THRESHOLD_DEAD)
|
||||
death()
|
||||
return
|
||||
else if(stat == UNCONSCIOUS)
|
||||
|
||||
@@ -152,7 +152,7 @@ var/global/list/parasites = list() //all currently existing/living guardians
|
||||
if(summoner)
|
||||
var/resulthealth
|
||||
if(iscarbon(summoner))
|
||||
resulthealth = round((abs(config.health_threshold_dead - summoner.health) / abs(config.health_threshold_dead - summoner.maxHealth)) * 100)
|
||||
resulthealth = round((abs(HEALTH_THRESHOLD_DEAD - summoner.health) / abs(HEALTH_THRESHOLD_DEAD - summoner.maxHealth)) * 100)
|
||||
else
|
||||
resulthealth = round((summoner.health / summoner.maxHealth) * 100, 0.5)
|
||||
stat(null, "Summoner Health: [resulthealth]%")
|
||||
@@ -197,7 +197,7 @@ var/global/list/parasites = list() //all currently existing/living guardians
|
||||
if(summoner && hud_used && hud_used.healths)
|
||||
var/resulthealth
|
||||
if(iscarbon(summoner))
|
||||
resulthealth = round((abs(config.health_threshold_dead - summoner.health) / abs(config.health_threshold_dead - summoner.maxHealth)) * 100)
|
||||
resulthealth = round((abs(HEALTH_THRESHOLD_DEAD - summoner.health) / abs(HEALTH_THRESHOLD_DEAD - summoner.maxHealth)) * 100)
|
||||
else
|
||||
resulthealth = round((summoner.health / summoner.maxHealth) * 100, 0.5)
|
||||
hud_used.healths.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='#efeeef'>[resulthealth]%</font></div>"
|
||||
|
||||
@@ -290,23 +290,23 @@
|
||||
|
||||
/mob/living/simple_animal/adjustBruteLoss(amount)
|
||||
if(damage_coeff[BRUTE])
|
||||
. = adjustHealth(amount*damage_coeff[BRUTE])
|
||||
. = adjustHealth(amount * damage_coeff[BRUTE] * config.damage_multiplier)
|
||||
|
||||
/mob/living/simple_animal/adjustFireLoss(amount)
|
||||
if(damage_coeff[BURN])
|
||||
. = adjustHealth(amount*damage_coeff[BURN])
|
||||
. = adjustHealth(amount * damage_coeff[BURN] * config.damage_multiplier)
|
||||
|
||||
/mob/living/simple_animal/adjustOxyLoss(amount)
|
||||
if(damage_coeff[OXY])
|
||||
. = adjustHealth(amount*damage_coeff[OXY])
|
||||
. = adjustHealth(amount * damage_coeff[OXY] * config.damage_multiplier)
|
||||
|
||||
/mob/living/simple_animal/adjustToxLoss(amount)
|
||||
if(damage_coeff[TOX])
|
||||
. = adjustHealth(amount*damage_coeff[TOX])
|
||||
. = adjustHealth(amount * damage_coeff[TOX] * config.damage_multiplier)
|
||||
|
||||
/mob/living/simple_animal/adjustCloneLoss(amount)
|
||||
if(damage_coeff[CLONE])
|
||||
. = adjustHealth(amount*damage_coeff[CLONE])
|
||||
. = adjustHealth(amount * damage_coeff[CLONE] * config.damage_multiplier)
|
||||
|
||||
/mob/living/simple_animal/adjustStaminaLoss(amount)
|
||||
return
|
||||
|
||||
@@ -234,7 +234,7 @@
|
||||
Feedstop(0, 0)
|
||||
return
|
||||
|
||||
add_nutrition(rand(7,15))
|
||||
add_nutrition((rand(7,15) * config.damage_multiplier))
|
||||
|
||||
//Heal yourself.
|
||||
adjustBruteLoss(-3)
|
||||
|
||||
Reference in New Issue
Block a user