mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-07-20 20:54:35 +01:00
[MIRROR] Gives internal organs passive regeneration (#11653)
Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
50d299f7fb
commit
1cb88c75bc
@@ -5,12 +5,26 @@
|
||||
var/dead_icon // Icon to use when the organ has died.
|
||||
|
||||
var/supply_conversion_value = 0
|
||||
var/healing_factor = 0.005 // How much this organ will heal passively
|
||||
|
||||
/obj/item/organ/internal/Initialize(mapload, internal)
|
||||
. = ..()
|
||||
if(supply_conversion_value)
|
||||
AddElement(/datum/element/sellable/organ)
|
||||
|
||||
/obj/item/organ/internal/process()
|
||||
..()
|
||||
passive_heal()
|
||||
|
||||
// Heals the internal organ passively as long as it's under the bruised threshold
|
||||
// Not a lot of MATH just yet, but nutrition or other factors could be taken into account
|
||||
/obj/item/organ/internal/proc/passive_heal()
|
||||
if(!is_bruised() && !is_broken())
|
||||
return
|
||||
|
||||
var/heal_amt = healing_factor * CONFIG_GET(number/organ_regeneration_multiplier)
|
||||
damage = max(damage - heal_amt, 0)
|
||||
|
||||
/obj/item/organ/internal/die()
|
||||
..()
|
||||
if((status & ORGAN_DEAD) && dead_icon)
|
||||
|
||||
Reference in New Issue
Block a user