Custom skin tone preferences.

This commit is contained in:
Ghommie
2020-04-14 19:10:28 +02:00
parent 8f71aafde5
commit 571584901c
30 changed files with 210 additions and 185 deletions
@@ -507,93 +507,83 @@
/datum/reagent/spraytan/reaction_mob(mob/living/M, method=TOUCH, reac_volume, show_message = 1)
if(ishuman(M))
if(method == PATCH || method == VAPOR)
var/mob/living/carbon/human/N = M
if(N.dna.species.id == "human")
switch(N.skin_tone)
if("african1")
N.skin_tone = "african2"
if("indian")
N.skin_tone = "african1"
if("arab")
N.skin_tone = "indian"
if("asian2")
N.skin_tone = "arab"
if("asian1")
N.skin_tone = "asian2"
if("mediterranean")
N.skin_tone = "african1"
if("latino")
N.skin_tone = "mediterranean"
if("caucasian3")
N.skin_tone = "mediterranean"
if("caucasian2")
N.skin_tone = pick("caucasian3", "latino")
if("caucasian1")
N.skin_tone = "caucasian2"
if ("albino")
N.skin_tone = "caucasian1"
var/mob/living/carbon/human/H = M
if(H.dna.species.use_skintones)
if(!H.dna.skin_tone_override)
var/diff_len = length(GLOB.skin_tones - GLOB.nonstandard_skin_tones)
H.skin_tone = GLOB.skin_tones[min(diff_len, GLOB.skin_tones.Find(H.skin_tone) + 1)]
else
H.skin_tone = H.dna.skin_tone_override = tan_mutant_color(H.dna.skin_tone_override, "#202020")
if(MUTCOLORS in H.dna.species.species_traits) //take current alien color and darken it slightly
H.dna.features["mcolor"] = tan_mutant_color(H.dna.features["mcolor"])
H.update_body()
if(MUTCOLORS in N.dna.species.species_traits) //take current alien color and darken it slightly
var/newcolor = ""
var/string = N.dna.features["mcolor"]
var/len = length(string)
var/char = ""
var/ascii = 0
for(var/i=1, i<=len, i += length(char))
char = string[i]
ascii = text2ascii(char)
switch(ascii)
if(48)
newcolor += "0"
if(49 to 57)
newcolor += ascii2text(ascii-1) //numbers 1 to 9
if(97)
newcolor += "9"
if(98 to 102)
newcolor += ascii2text(ascii-1) //letters b to f lowercase
if(65)
newcolor += "9"
if(66 to 70)
newcolor += ascii2text(ascii+31) //letters B to F - translates to lowercase
else
break
if(ReadHSV(newcolor)[3] >= ReadHSV("#7F7F7F")[3])
N.dna.features["mcolor"] = newcolor
N.regenerate_icons()
if(method == INGEST)
if(show_message)
to_chat(M, "<span class='notice'>That tasted horrible.</span>")
return ..()
/datum/reagent/spraytan/proc/tan_mutant_color(color, limit = "#7F7F7F")
var/newcolor = ""
var/len = length(color)
var/char = ""
var/ascii = 0
for(var/i=1, i<=len, i += length(char))
char = color[i]
ascii = text2ascii(char)
switch(ascii)
if(35)
newcolor += "#"
if(48)
newcolor += "0"
if(49 to 57)
newcolor += ascii2text(ascii-1) //numbers 1 to 9
if(97)
newcolor += "9"
if(98 to 102)
newcolor += ascii2text(ascii-1) //letters b to f lowercase
if(65)
newcolor += "9"
if(66 to 70)
newcolor += ascii2text(ascii+31) //letters B to F - translates to lowercase
else
break
if(ReadHSV(newcolor)[3] >= ReadHSV(limit)[3])
return newcolor
return color
if(method == INGEST)
if(show_message)
to_chat(M, "<span class='notice'>That tasted horrible.</span>")
..()
/datum/reagent/spraytan/overdose_start(mob/living/M)
. = ..()
if(ishuman(M))
var/mob/living/carbon/human/H = M
H.hair_style = "Spiky"
H.facial_hair_style = "Shaved"
H.facial_hair_color = "000"
H.hair_color = "000"
if(!(HAIR in H.dna.species.species_traits)) //No hair? No problem!
H.dna.species.species_traits += HAIR
if(H.dna.species.use_skintones)
if(H.dna.skin_tone_override)
H.skin_tone = H.dna.skin_tone_override = "#FF8800"
else
H.skin_tone = "orange"
else if(MUTCOLORS in H.dna.species.species_traits) //Aliens with custom colors simply get turned orange
H.dna.features["mcolor"] = "f80"
H.update_body()
/datum/reagent/spraytan/overdose_process(mob/living/M)
metabolization_rate = 1 * REAGENTS_METABOLISM
if(ishuman(M))
var/mob/living/carbon/human/N = M
N.hair_style = "Spiky"
N.facial_hair_style = "Shaved"
N.facial_hair_color = "000"
N.hair_color = "000"
if(!(HAIR in N.dna.species.species_traits)) //No hair? No problem!
N.dna.species.species_traits += HAIR
if(N.dna.species.use_skintones)
N.skin_tone = "orange"
else if(MUTCOLORS in N.dna.species.species_traits) //Aliens with custom colors simply get turned orange
N.dna.features["mcolor"] = "f80"
N.regenerate_icons()
var/mob/living/carbon/human/H = M
if(prob(7))
if(N.w_uniform)
M.visible_message(pick("<b>[M]</b>'s collar pops up without warning.</span>", "<b>[M]</b> flexes [M.p_their()] arms."))
if(H.w_uniform)
H.visible_message(pick("<b>[H]</b>'s collar pops up without warning.</span>", "<b>[H]</b> flexes [H.p_their()] arms."))
else
M.visible_message("<b>[M]</b> flexes [M.p_their()] arms.")
H.visible_message("<b>[H]</b> flexes [H.p_their()] arms.")
if(prob(10))
M.say(pick("Shit was SO cash.", "You are everything bad in the world.", "What sports do you play, other than 'jack off to naked drawn Japanese people?'", "Dont be a stranger. Just hit me with your best shot.", "My name is John and I hate every single one of you."), forced = "spraytan")
..()
return
return ..()
/datum/reagent/mutationtoxin
name = "Stable Mutation Toxin"