mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-31 00:49:06 +01:00
Dionae can now use the check light level verb. Removes dead dionastats code. (#12524)
This commit is contained in:
@@ -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, "<span class='danger'>You feel a shifting sensation inside you as your nymphs move apart to make space, forming a new [O.name].</span>")
|
||||
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("<font size=3>You have mastered the [i] language!</font>"))
|
||||
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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user