Another set of brainmed adjustment & miscellaneous things. (#11354)

This commit is contained in:
Matt Atlas
2021-03-05 23:35:58 +01:00
committed by GitHub
parent 607fe6680f
commit 80be3d88e1
10 changed files with 87 additions and 26 deletions
+1 -4
View File
@@ -156,20 +156,17 @@
if(prob(damprob))
take_internal_damage(1)
if(prob(damprob))
take_internal_damage(2)
take_internal_damage(1)
..()
/obj/item/organ/internal/brain/take_internal_damage(var/damage, var/silent)
set waitfor = 0
if(damage >= (max_damage / 4))
damage *= 2
..()
if(damage >= (max_damage / 5)) //This probably won't be triggered by oxyloss or mercury. Probably.
var/damage_secondary = damage * 0.20
owner.eye_blurry += damage_secondary
owner.confused += damage_secondary * 2
owner.Weaken(round(damage_secondary * 3, 1))
owner.adjustOxyLoss(damage)
if(prob(30))
addtimer(CALLBACK(src, .proc/brain_damage_callback, damage), rand(6, 20) SECONDS, TIMER_UNIQUE)
+1 -3
View File
@@ -1,5 +1,4 @@
#define HUMAN_MAX_OXYLOSS 1 //Defines how much oxyloss humans can get per tick. A tile with no air at all (such as space) applies this value, otherwise it's a percentage of it.
#define HUMAN_CRIT_MAX_OXYLOSS ( 2.0 / 6) //The amount of damage you'll get when in critical condition. We want this to be a 5 minute deal = 300s. There are 50HP to get through, so (1/6)*last_tick_duration per second. Breaths however only happen every 4 ticks. last_tick_duration = ~2.0 on average
/obj/item/organ/internal/lungs
name = "lungs"
@@ -67,7 +66,7 @@
"<span class='danger'>You can't breathe!</span>",
"You hear someone gasp for air!",
)
owner.losebreath += round(damage/2)
owner.losebreath = max(round(damage / 2), owner.losebreath)
if(rescued)
if(is_bruised())
@@ -377,4 +376,3 @@
rescued = FALSE
#undef HUMAN_MAX_OXYLOSS
#undef HUMAN_CRIT_MAX_OXYLOSS
+4 -1
View File
@@ -13,6 +13,7 @@
var/vital //Lose a vital limb, die immediately.
var/rejecting // Is this organ already being rejected?
var/is_augment = FALSE
var/death_time
//Organ damage stats.
var/damage = 0 // amount of damage to the organ
@@ -128,6 +129,7 @@
return
damage = max_damage
status |= ORGAN_DEAD
death_time = world.time
STOP_PROCESSING(SSprocessing, src)
if(owner && vital)
owner.death()
@@ -141,8 +143,9 @@
/obj/item/organ/proc/can_feel_pain()
return (!BP_IS_ROBOTIC(src) && (!species || !(species.flags & NO_PAIN)))
#define ORGAN_RECOVERY_THRESHOLD (5 MINUTES)
/obj/item/organ/proc/can_recover()
return max_damage > 0
return (max_damage > 0) && !(status & ORGAN_DEAD) || death_time >= world.time - ORGAN_RECOVERY_THRESHOLD
/obj/item/organ/process()
if(loc != owner)