mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-20 19:44:46 +01:00
Gives internal organs passive regeneration (#18470)
* Organ heal * Changes * Use the config
This commit is contained in:
@@ -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