Diona Regen Fixes (#5260)

credit to lohikar for the code, and fowl for pointing it out in the first place

comes with energy/biomass balance value tweaks that elohi needs to look at tomorrow. if you're reading this, don't let them forget. put them at nymphpoint if you must.
This commit is contained in:
ParadoxSpace
2018-09-11 08:41:12 +03:00
committed by Erki
parent 0147c06bb4
commit b693d7b0a2
2 changed files with 68 additions and 39 deletions
+30 -39
View File
@@ -8,8 +8,8 @@
#define NYMPH_ABSORB_NUTRITION 650
#define NYMPH_ABSORB_DEAD_FACTOR 0.3
#define REGROW_FOOD_REQ 100
#define REGROW_ENERGY_REQ 40
#define REGROW_FOOD_REQ 150
#define REGROW_ENERGY_REQ 60
#define LANGUAGE_POINTS_TO_LEARN 3 //The number of samples of a language required to learn it
@@ -116,12 +116,9 @@ var/list/diona_banned_languages = list(
//Most medicines don't work on diona, but physical treatment for external wounds helps a little,
//and some alternative things that are toxic to other life, such as radium and mutagen, will benefit diona
/mob/living/carbon/proc/diona_handle_regeneration(var/datum/dionastats/DS)
if ((DS.stored_energy < 1 && !total_radiation)) //we need energy or radiation to heal
if ((DS.stored_energy < 1 && !total_radiation)) //we need energy or total_radiation to heal
return FALSE
var/radiation = max(total_radiation, 0)
var/value //A little variable we'll reuse to optimise
var/CL //Cached loss, to save on repeatedly recalculating it
var/HF = DS.healing_factor //I don't know if fetching a variable from an object repeatedly is slow, but this seems safe
@@ -132,10 +129,10 @@ var/list/diona_banned_languages = list(
if (getHalLoss() > 0)
CL = getHalLoss()
if (CL > 0)
if (radiation > 0)
value = min(CL, radiation, 2*HF)
if (total_radiation > 0)
value = min(CL, total_radiation, 2*HF)
adjustHalLoss(value*-3,1) //Halloss heals more quickly
radiation -= value
total_radiation -= value
CL = getHalLoss()
value = min(CL, DS.stored_energy, 1*HF)
@@ -149,10 +146,10 @@ var/list/diona_banned_languages = list(
CL = getBruteLoss()
if (CL > 0)
if (radiation > 0)
value = min(CL, radiation, 2*HF)
if (total_radiation > 0)
value = min(CL, total_radiation, 2*HF)
adjustBruteLoss(value*-1)
radiation -= value
total_radiation -= value
CL = getBruteLoss() //After adjusting it, recalculate for the lighthealing
value = min(CL, DS.stored_energy, 1*HF)
@@ -161,10 +158,10 @@ var/list/diona_banned_languages = list(
CL = getFireLoss()
if (CL > 0)
if (radiation > 0)
value = min(CL, radiation, 2*HF)
if (total_radiation > 0)
value = min(CL, total_radiation, 2*HF)
adjustFireLoss(value*-1)
radiation -= value
total_radiation -= value
CL = getFireLoss()
value = min(CL, DS.stored_energy, 1*HF)
@@ -173,10 +170,10 @@ var/list/diona_banned_languages = list(
CL = stunned
if (CL > 0)
if (radiation > 0)
value = min(CL, radiation, 2*HF)
if (total_radiation > 0)
value = min(CL, total_radiation, 2*HF)
stunned -= value
radiation -= value
total_radiation -= value
CL = stunned
value = min(CL, DS.stored_energy, 1*HF)
@@ -186,10 +183,10 @@ var/list/diona_banned_languages = list(
CL = weakened
if (CL > 0)
if (radiation > 0)
value = min(CL, radiation, 2*HF)
if (total_radiation > 0)
value = min(CL, total_radiation, 2*HF)
weakened -= value
radiation -= value
total_radiation -= value
CL = weakened
value = min(CL, DS.stored_energy, 1*HF)
@@ -200,10 +197,10 @@ var/list/diona_banned_languages = list(
if (life_tick % LIFETICK_INTERVAL_LESS == 0)
CL = getToxLoss()
if (CL > 0)
if (radiation > 0)
value = min(CL, radiation, 2*HF*LIFETICK_INTERVAL_LESS)
if (total_radiation > 0)
value = min(CL, total_radiation, 2*HF*LIFETICK_INTERVAL_LESS)
adjustToxLoss(value*-1)
radiation -= value
total_radiation -= value
CL = getToxLoss()
value = min(CL, DS.stored_energy, 1*HF*LIFETICK_INTERVAL_LESS)
@@ -213,10 +210,10 @@ var/list/diona_banned_languages = list(
CL = getCloneLoss()
if (CL > 0)
if (radiation > 0)
value = min(CL, radiation, 2*HF*LIFETICK_INTERVAL_LESS)
if (total_radiation > 0)
value = min(CL, total_radiation, 2*HF*LIFETICK_INTERVAL_LESS)
adjustCloneLoss(value/-2.5) //Genetic damage, should diona ever suffer it, heals much more slowly.
radiation -= value //Most likely the only time they'll cloneloss is escaping from being partially devoured
total_radiation -= value //Most likely the only time they'll cloneloss is escaping from being partially devoured
CL = getCloneLoss()
value = min(CL, DS.stored_energy, 1*HF*LIFETICK_INTERVAL_LESS)
@@ -227,21 +224,15 @@ var/list/diona_banned_languages = list(
updatehealth()
return FALSE
// A little inter-proc communication.
// We need the continued radiation count for the sake of actually working.
return max(radiation, 0)
// Continuation of the Diona regen proc, but for human specific actions.
/mob/living/carbon/human/diona_handle_regeneration(var/datum/dionastats/DS)
. = ..()
..()
// We cancel with regening organ, as it's meant to stop all other regenerative
// processes. Just pray to shit the timers don't implode.
if (!. || DS.regening_organ)
if ((!total_radiation && !DS.healing_factor && !DS.stored_energy) || DS.regening_organ)
return FALSE
var/radiation = .
//Next up, healing any damage to internal organs.
//Diona really only have one critical organ, the light receptor node in the head.
//If badly damaged, the light receptor reduces the effectiveness of incoming light
@@ -251,10 +242,10 @@ var/list/diona_banned_languages = list(
for (var/obj/item/organ/O in bad_internal_organs)
var/CL = O.damage
var/value
if (radiation > 0)
value = min(CL, radiation, 2 * DS.healing_factor * LIFETICK_INTERVAL_LESS)
if(total_radiation > 0)
value = min(CL, total_radiation, 2 * DS.healing_factor * LIFETICK_INTERVAL_LESS)
O.damage += value/-1.5
radiation -= value
total_radiation -= value
CL = getCloneLoss()
value = min(CL, DS.stored_energy, 1 * DS.healing_factor * LIFETICK_INTERVAL_LESS)
@@ -424,7 +415,7 @@ var/list/diona_banned_languages = list(
var/HP = 1 //HP = health-percentage
if (DS.LMS == 4)
if (HP < 0.6)
to_chat(src, "<span class='danger'>The darkness burns. Your nymphs decay and wilt You are in mortal danger!</span>")
to_chat(src, "<span class='danger'>The darkness burns. Your nymphs decay and wilt. You are in mortal danger!</span>")
DS.LMS = 5
else if (DS.LMS == 5)
@@ -0,0 +1,38 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
#################################
# Your name.
author: ParadoxSpace
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- bugfix: "After much internal debate among their nymphs, Diona gestalts have now decided it's probably a good idea to regenerate their limbs again."
- tweak: "Increases amount of energy and nutrition Diona need to do such. Eat up."