diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index a8f7ee216f5..234ef722205 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -168,7 +168,7 @@ if (istype(loc, /turf/space)) return -1 // It's hard to be slowed down in space by... anything - var/health_deficiency = (100 - health) + var/health_deficiency = traumatic_shock if(health_deficiency >= 40) tally += (health_deficiency / 25) var/hungry = (500 - nutrition)/5 // So overeat would be 100 and default level would be 80 diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 8ecb1cb853a..74f4d9fe0bb 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -8,6 +8,8 @@ temperature_alert = 0 + // used to do some stuff only on every X life tick + life_tick = 0 /mob/living/carbon/human/Life() set invisibility = 0 @@ -19,6 +21,8 @@ if(!loc) // Fixing a null error that occurs when the mob isn't found in the world -- TLE return + life_tick++ + var/datum/gas_mixture/environment = loc.return_air() // clean all symptoms, they must be set again in this cycle @@ -75,6 +79,9 @@ handle_pain() + // Some mobs heal slowly, others die slowly + handle_health_updates() + // Update clothing update_clothing() @@ -103,6 +110,23 @@ /mob/living/carbon/human proc + handle_health_updates() + // if the mob has enough health, she should slowly heal + if(health >= 0) + var/pr = 5 + if(stat == 1) // sleeping means faster healing + pr += 3 + if(prob(pr)) + heal_organ_damage(1,1) + adjustToxLoss(-1) + else if(health < 0) + var/pr = 8 + // sleeping means slower damage + if(stat == 1) + pr = 3 + if(prob(pr)) + adjustToxLoss(1) + clamp_values() SetStunned(min(stunned, 20)) diff --git a/code/modules/mob/organ/pain.dm b/code/modules/mob/organ/pain.dm index 5fcefd73c67..fb0715138c3 100644 --- a/code/modules/mob/organ/pain.dm +++ b/code/modules/mob/organ/pain.dm @@ -34,6 +34,10 @@ mob/proc/pain(var/partname, var/amount, var/force) mob/living/carbon/human/proc/handle_pain() // not when sleeping if(stat >= 2) return + if(reagents.has_reagent("tramadol")) + return + if(reagents.has_reagent("oxycodone")) + return var/maxdam = 0 var/datum/organ/external/damaged_organ = null for(var/name in organs)