mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-02 21:43:22 +00:00
Automatic healing and other medical stuff
- A mob with health > 0 will now slowly heal, around 1 damage per minute, unless it's cloneloss. This can be accelerated by sleeping. - A mob with health < 0 will now slowly be damaged, also around 1 damage per minute. This can be decellerated by sleeping. - Movement is no longer slowed by damage(unless it's a broken/missing bone), but only by trauma. This means that painkillers will help with movement speed. - Painkillers now remove the red flashes and pain messages.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user