Fixes mulligan not randomizing ethereal color, removes default_color for every race except ethereals (#66229)

Judging from code this is a fix, although I initially thought it would be a feature. It tried to update color but there was nothing in ethereal code to make that do anything. Now it does.

Moth wings also do not update. I tried to figure it out but species code makes me want to hit my head against a wall so I gave up on that.

default_color wasn't used anywhere except for ethereals, so I made it a var unique to ethereals.
This commit is contained in:
wesoda25
2022-05-09 18:38:27 -07:00
committed by GitHub
parent d944f69a9f
commit 6f58040394
12 changed files with 40 additions and 45 deletions
@@ -20,8 +20,6 @@ GLOBAL_LIST_EMPTY(features_by_species)
/// The formatting of the name of the species in plural context. Defaults to "[name]\s" if unset.
/// Ex "[Plasmamen] are weak", "[Mothmen] are strong", "[Lizardpeople] don't like", "[Golems] hate"
var/plural_form
// Default color. If mutant colors are disabled, this is the color that will be used by that race.
var/default_color = "#FFFFFF"
///Whether or not the race has sexual characteristics (biological genders). At the moment this is only FALSE for skeletons and shadows
var/sexes = TRUE
@@ -1,7 +1,6 @@
/datum/species/dullahan
name = "Dullahan"
id = SPECIES_DULLAHAN
default_color = "FFFFFF"
species_traits = list(EYECOLOR, HAIR, FACEHAIR, LIPS, HAS_FLESH, HAS_BONE)
inherent_traits = list(
TRAIT_ADVANCEDTOOLUSER,
@@ -48,6 +48,7 @@
var/static/g2 = 164
var/static/b2 = 149
var/obj/effect/dummy/lighting_obj/ethereal_light
var/default_color
@@ -99,13 +100,17 @@
return randname
/datum/species/ethereal/spec_updatehealth(mob/living/carbon/human/H)
/datum/species/ethereal/spec_updatehealth(mob/living/carbon/human/ethereal)
. = ..()
if(!ethereal_light)
return
if(H.stat != DEAD && !EMPeffect)
var/healthpercent = max(H.health, 0) / 100
if(default_color != ethereal.dna.features["ethcolor"])
var/new_color = ethereal.dna.features["ethcolor"]
r1 = GETREDPART(new_color)
g1 = GETGREENPART(new_color)
b1 = GETBLUEPART(new_color)
if(ethereal.stat != DEAD && !EMPeffect)
var/healthpercent = max(ethereal.health, 0) / 100
if(!emageffect)
current_color = rgb(r2 + ((r1-r2)*healthpercent), g2 + ((g1-g2)*healthpercent), b2 + ((b1-b2)*healthpercent))
ethereal_light.set_light_range_power_color(1 + (2 * healthpercent), 1 + (1 * healthpercent), current_color)
@@ -114,7 +119,7 @@
else
ethereal_light.set_light_on(FALSE)
fixed_mut_color = rgb(128,128,128)
H.update_body(is_creating = TRUE)
ethereal.update_body(is_creating = TRUE)
/datum/species/ethereal/proc/on_emp_act(mob/living/carbon/human/H, severity)
SIGNAL_HANDLER
@@ -1,7 +1,6 @@
/datum/species/human
name = "\improper Human"
id = SPECIES_HUMAN
default_color = "FFFFFF"
species_traits = list(EYECOLOR,HAIR,FACEHAIR,LIPS,HAS_FLESH,HAS_BONE)
inherent_traits = list(
TRAIT_ADVANCEDTOOLUSER,
@@ -3,7 +3,6 @@
name = "\improper Jellyperson"
plural_form = "Jellypeople"
id = SPECIES_JELLYPERSON
default_color = "00FF90"
say_mod = "chirps"
species_traits = list(MUTCOLORS,EYECOLOR,NOBLOOD)
inherent_traits = list(
@@ -150,7 +149,6 @@
name = "\improper Slimeperson"
plural_form = "Slimepeople"
id = SPECIES_SLIMEPERSON
default_color = "00FFFF"
species_traits = list(MUTCOLORS,EYECOLOR,HAIR,FACEHAIR,NOBLOOD)
hair_color = "mutcolor"
hair_alpha = 150
@@ -4,7 +4,6 @@
plural_form = "Lizardfolk"
id = SPECIES_LIZARD
say_mod = "hisses"
default_color = COLOR_VIBRANT_LIME
species_traits = list(MUTCOLORS, EYECOLOR, LIPS, HAS_FLESH, HAS_BONE)
inherent_traits = list(
TRAIT_ADVANCEDTOOLUSER,
@@ -3,7 +3,6 @@
plural_form = "Mothmen"
id = SPECIES_MOTH
say_mod = "flutters"
default_color = "00FF00"
species_traits = list(LIPS, HAS_FLESH, HAS_BONE, HAS_MARKINGS, TRAIT_ANTENNAE)
inherent_traits = list(
TRAIT_ADVANCEDTOOLUSER,
@@ -3,7 +3,6 @@
name = "\improper Podperson"
plural_form = "Podpeople"
id = SPECIES_PODPERSON
default_color = "59CE00"
species_traits = list(MUTCOLORS, EYECOLOR, HAS_FLESH, HAS_BONE)
inherent_traits = list(
TRAIT_ADVANCEDTOOLUSER,
@@ -1,7 +1,6 @@
/datum/species/snail
name = "Snailperson"
id = SPECIES_SNAIL
default_color = "336600" //vomit green
species_traits = list(MUTCOLORS, NO_UNDERWEAR, HAS_FLESH, HAS_BONE)
inherent_traits = list(
TRAIT_ADVANCEDTOOLUSER,
@@ -7,7 +7,6 @@
/datum/species/vampire
name = "Vampire"
id = SPECIES_VAMPIRE
default_color = "FFFFFF"
species_traits = list(
EYECOLOR,
HAIR,