From b693d7b0a27a2275da5cdfb988e876db2c489c8c Mon Sep 17 00:00:00 2001 From: ParadoxSpace Date: Mon, 10 Sep 2018 23:41:12 -0600 Subject: [PATCH] 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. --- code/modules/mob/living/carbon/diona_base.dm | 69 ++++++++----------- html/changelogs/paradoxspace-savethetrees.yml | 38 ++++++++++ 2 files changed, 68 insertions(+), 39 deletions(-) create mode 100644 html/changelogs/paradoxspace-savethetrees.yml diff --git a/code/modules/mob/living/carbon/diona_base.dm b/code/modules/mob/living/carbon/diona_base.dm index de18452940c..f4dec34580d 100644 --- a/code/modules/mob/living/carbon/diona_base.dm +++ b/code/modules/mob/living/carbon/diona_base.dm @@ -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, "The darkness burns. Your nymphs decay and wilt You are in mortal danger!") + to_chat(src, "The darkness burns. Your nymphs decay and wilt. You are in mortal danger!") DS.LMS = 5 else if (DS.LMS == 5) diff --git a/html/changelogs/paradoxspace-savethetrees.yml b/html/changelogs/paradoxspace-savethetrees.yml new file mode 100644 index 00000000000..1974338f058 --- /dev/null +++ b/html/changelogs/paradoxspace-savethetrees.yml @@ -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."