Promethean Regeneration now causes scaled Pain.

This commit is contained in:
Mechoid
2018-10-30 00:48:23 -07:00
parent 769f6df143
commit d24268b13c
2 changed files with 33 additions and 13 deletions

View File

@@ -307,7 +307,7 @@
organ_data["descriptor"] = O.name
to_chat(src, "<span class='notice'>You feel a slithering sensation as your [O.name] reform.</span>")
var/agony_to_apply = round(0.66 * O.max_damage) // 60% of the limb's health is converted into pain
var/agony_to_apply = round(0.66 * O.max_damage) // 60% of the limb's health is converted into pain.
src.apply_damage(agony_to_apply, HALLOSS)
update_icons_body()

View File

@@ -149,6 +149,10 @@ var/datum/species/shapeshifter/promethean/prometheans
H.gib()
/datum/species/shapeshifter/promethean/handle_environment_special(var/mob/living/carbon/human/H)
var/regen_brute = 1
var/regen_burn = 1
var/regen_tox = 1
var/regen_oxy = 1
var/turf/T = H.loc
if(istype(T))
@@ -160,28 +164,44 @@ var/datum/species/shapeshifter/promethean/prometheans
S.dirt = 0
H.nutrition = min(500, max(0, H.nutrition + rand(15, 30)))
T = get_turf(H) // Swap over to an actual turf, because we need to get the pressure.
if(istype(T)) // Make sure it exists, and is a turf again.
var/datum/gas_mixture/environment = T.return_air()
var/pressure = environment.return_pressure()
var/affecting_pressure = H.calculate_affecting_pressure(pressure)
if(affecting_pressure <= hazard_low_pressure) // Dangerous low pressure stops the regeneration of physical wounds. Body is focusing on keeping them intact rather than sealing.
regen_brute = 0
regen_burn = 0
// Heal remaining damage.
if(H.fire_stacks >= 0)
if(H.getBruteLoss() || H.getFireLoss() || H.getOxyLoss() || H.getToxLoss())
var/nutrition_cost = 0
var/nutrition_debt = H.getBruteLoss()
var/nutrition_debt = 0
var/starve_mod = 1
if(H.nutrition <= 25)
starve_mod = 0.75
H.adjustBruteLoss(-heal_rate * starve_mod)
nutrition_cost += nutrition_debt - H.getBruteLoss()
nutrition_debt = H.getFireLoss()
H.adjustFireLoss(-heal_rate * starve_mod)
nutrition_cost += nutrition_debt - H.getFireLoss()
if(regen_brute)
nutrition_debt = H.getBruteLoss()
H.adjustBruteLoss(-heal_rate * starve_mod)
nutrition_cost += nutrition_debt - H.getBruteLoss()
nutrition_debt = H.getOxyLoss()
H.adjustOxyLoss(-heal_rate * starve_mod)
nutrition_cost += nutrition_debt - H.getOxyLoss()
if(regen_burn)
nutrition_debt = H.getFireLoss()
H.adjustFireLoss(-heal_rate * starve_mod)
nutrition_cost += nutrition_debt - H.getFireLoss()
if(regen_oxy)
nutrition_debt = H.getOxyLoss()
H.adjustOxyLoss(-heal_rate * starve_mod)
nutrition_cost += nutrition_debt - H.getOxyLoss()
if(regen_tox)
nutrition_debt = H.getToxLoss()
H.adjustToxLoss(-heal_rate * starve_mod)
nutrition_cost += nutrition_debt - H.getToxLoss()
nutrition_debt = H.getToxLoss()
H.adjustToxLoss(-heal_rate * starve_mod)
nutrition_cost += nutrition_debt - H.getToxLoss()
H.nutrition -= (3 * nutrition_cost) //Costs Nutrition when damage is being repaired, corresponding to the amount of damage being repaired.
H.nutrition = max(0, H.nutrition) //Ensure it's not below 0.