From 972e16e81a33aa240ad4667c62c96e5461cbe7bd Mon Sep 17 00:00:00 2001 From: Matt Atlas Date: Tue, 21 Sep 2021 20:46:24 +0200 Subject: [PATCH] Dionae can now use the check light level verb. Removes dead dionastats code. (#12524) --- code/modules/mob/living/carbon/diona_base.dm | 26 +----------- .../mob/living/carbon/human/diona_gestalt.dm | 22 ---------- html/changelogs/mattatlas-dionafix.yml | 41 +++++++++++++++++++ 3 files changed, 42 insertions(+), 47 deletions(-) create mode 100644 html/changelogs/mattatlas-dionafix.yml diff --git a/code/modules/mob/living/carbon/diona_base.dm b/code/modules/mob/living/carbon/diona_base.dm index 137e7f34f7e..0f6f3e7bd41 100644 --- a/code/modules/mob/living/carbon/diona_base.dm +++ b/code/modules/mob/living/carbon/diona_base.dm @@ -26,8 +26,6 @@ var/list/diona_banned_languages = list( #define DIONA_LIGHT_COEFICIENT 0.25 /mob/living/carbon/proc/diona_handle_light(var/datum/dionastats/DS) //Carbon is the highest common denominator between gestalts and nymphs. They will share light code - //if light_organ is non null, then we're working with a gestalt. otherwise nymph - var/light_amount = DS.last_lightlevel //If we're not re-fetching the light level then we'll use a recent cached version if (life_tick % 2 == 0) //Only fetch the lightlevel every other proc to save performance @@ -82,19 +80,12 @@ var/list/diona_banned_languages = list( if (!pressure) return 0 - if (DS.nutrient_organ) - if (DS.nutrient_organ.is_broken()) - return 0 - if (consume_nutrition_from_air && (nutrition / max_nutrition > 0.25)) to_chat(src, SPAN_NOTICE("You feel like you have replanished enough of nutrition to stay alive. Consuming more makes you feel gross.")) consume_nutrition_from_air = !consume_nutrition_from_air return var/plus= (min(pressure,diona_max_pressure) / diona_max_pressure)* diona_nutrition_factor - if (DS.nutrient_organ) - if(DS.nutrient_organ.is_bruised()) - plus *= 0.5 plus = min(plus, max_nutrition - nutrition) adjustNutritionLoss(-plus) @@ -356,7 +347,6 @@ var/list/diona_banned_languages = list( to_chat(src, "You feel a shifting sensation inside you as your nymphs move apart to make space, forming a new [O.name].") regenerate_icons() DS.LMS = max(2, DS.LMS) //Prevents a message about darkness in light areas - update_dionastats() //Re-find the organs in case they were lost or regained updatehealth() return @@ -417,7 +407,6 @@ var/list/diona_banned_languages = list( DS.LMS = min(2, DS.LMS) //Prevents a message about darkness in light areas DS.regening_organ = FALSE - update_dionastats() //Re-find the organs in case they were lost or regained updatehealth() DS.regen_limb_progress = 0 playsound(src, 'sound/species/diona/gestalt_grow.ogg', 30, 1) @@ -481,13 +470,7 @@ var/list/diona_banned_languages = list( if (is_ventcrawling) return -1.5 //no light inside pipes - - if (DS.light_organ) - if (DS.light_organ.is_broken()) - light_factor *= 0.55 - else if (DS.light_organ.is_bruised()) - light_factor *= 0.8 - else if (DS.dionatype == 2) + if (DS.dionatype == 2) light_factor = 1 if (T) @@ -615,8 +598,6 @@ var/list/diona_banned_languages = list( var/list/sampled_DNA = list() var/list/language_progress = list() - var/obj/item/organ/internal/diona/node/light_organ = null //The organ this gestalt uses to receive light. This is left null for nymphs - var/obj/item/organ/internal/diona/nutrients/nutrient_organ = null //Organ var/LMS = 1 //Lightmessage state. Switching between states gives the user a message var/dionatype //1 = nymph, 2 = worker gestalt var/datum/weakref/nym @@ -692,11 +673,6 @@ var/list/diona_banned_languages = list( to_chat(user, SPAN_NOTICE("You have mastered the [i] language!")) language_progress.Remove(i) -/datum/dionastats/Destroy() - light_organ = null //Nulling out these references to prevent GC errors - nutrient_organ = null - return ..() - #undef TEMP_REGEN_STOP #undef TEMP_REGEN_NORMAL #undef TEMP_INCREASE_REGEN_DOUBLE diff --git a/code/modules/mob/living/carbon/human/diona_gestalt.dm b/code/modules/mob/living/carbon/human/diona_gestalt.dm index 72c5181ddf5..01bd7da8a7f 100644 --- a/code/modules/mob/living/carbon/human/diona_gestalt.dm +++ b/code/modules/mob/living/carbon/human/diona_gestalt.dm @@ -115,9 +115,6 @@ set category = "Abilities" set name = "Check light level" - if (!DS.light_organ || DS.light_organ.is_broken() || DS.light_organ.is_bruised()) - to_chat(usr, SPAN_DANGER("Our response node is damaged or missing, without it we can't tell light from darkness. We can only hope this area is bright enough to let us regenerate it!")) - return var/light = get_lightlevel_diona(DS) if (light <= -0.75) to_chat(usr, SPAN_DANGER("It is pitch black here! This is extremely dangerous, we must find light, or death will soon follow!")) @@ -151,24 +148,6 @@ DS.trauma_factor = (DS.max_health / dark_survival) / MLS DS.dionatype = 2//Gestalt - for (var/organ in internal_organs) - if (istype(organ, /obj/item/organ/internal/diona/node)) - DS.light_organ = organ - if (istype(organ, /obj/item/organ/internal/diona/nutrients)) - DS.nutrient_organ = organ - -//This proc can be called if some dionastats information needs to be refreshed or re-found -//Currently only used for refreshing organs -/mob/living/carbon/human/proc/update_dionastats() - DS.light_organ = null - DS.nutrient_organ = null - - for (var/organ in internal_organs) - if (istype(organ, /obj/item/organ/internal/diona/node)) - DS.light_organ = organ - if (istype(organ, /obj/item/organ/internal/diona/nutrients)) - DS.nutrient_organ = organ - //Splitting functions //==================== @@ -280,7 +259,6 @@ M.languages = languages.Copy() M.accent = accent - update_dionastats() //Re-find the organs in case they were lost or regained nutrition -= REGROW_FOOD_REQ DS.stored_energy -= REGROW_ENERGY_REQ diona_handle_regeneration(DS) diff --git a/html/changelogs/mattatlas-dionafix.yml b/html/changelogs/mattatlas-dionafix.yml new file mode 100644 index 00000000000..cebc19a2edc --- /dev/null +++ b/html/changelogs/mattatlas-dionafix.yml @@ -0,0 +1,41 @@ +################################ +# 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 +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: MattAtlas + +# 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: "Dionae can now use the check light level verb."