diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 0446d99c20d..322f611710e 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -59,27 +59,39 @@ proc/random_name(gender, speciesName = "Human") -proc/random_skin_tone() - switch(pick(60;"caucasian", 15;"afroamerican", 10;"african", 10;"latino", 5;"albino")) - if("caucasian") . = -10 - if("afroamerican") . = -115 - if("african") . = -165 - if("latino") . = -55 - if("albino") . = 34 - else . = rand(-185,34) - return min(max( .+rand(-25, 25), -185),34) +proc/random_skin_tone(species = "Human") + if(species == "Human") + switch(pick(60;"caucasian", 15;"afroamerican", 10;"african", 10;"latino", 5;"albino")) + if("caucasian") . = -10 + if("afroamerican") . = -115 + if("african") . = -165 + if("latino") . = -55 + if("albino") . = 34 + else . = rand(-185,34) + return min(max( .+rand(-25, 25), -185),34) + else if(species == "Vox") + . = rand(1,3) + return . + else return 0 -proc/skintone2racedescription(tone) - switch (tone) - if(30 to INFINITY) return "albino" - if(20 to 30) return "pale" - if(5 to 15) return "light skinned" - if(-10 to 5) return "white" - if(-25 to -10) return "tan" - if(-45 to -25) return "darker skinned" - if(-65 to -45) return "brown" - if(-INFINITY to -65) return "black" - else return "unknown" +proc/skintone2racedescription(tone, species = "Human") + if(species == "Human") + switch (tone) + if(30 to INFINITY) return "albino" + if(20 to 30) return "pale" + if(5 to 15) return "light skinned" + if(-10 to 5) return "white" + if(-25 to -10) return "tan" + if(-45 to -25) return "darker skinned" + if(-65 to -45) return "brown" + if(-INFINITY to -65) return "black" + else return "unknown" + else if(species == "Vox") + switch(tone) + if(2) return "brown" + if(3) return "gray" + else return "green" + else return "unknown" proc/age2agedescription(age) switch(age) diff --git a/code/game/gamemodes/heist/heist.dm b/code/game/gamemodes/heist/heist.dm index 02170c987cd..42d8af23718 100644 --- a/code/game/gamemodes/heist/heist.dm +++ b/code/game/gamemodes/heist/heist.dm @@ -83,6 +83,7 @@ var/mob/living/carbon/human/vox = raider.current raider.name = vox.name vox.age = rand(12,20) + vox.s_tone = random_skin_tone("Vox") vox.dna.mutantrace = "vox" vox.set_species("Vox") vox.generate_name() diff --git a/code/game/turfs/simulated.dm b/code/game/turfs/simulated.dm index fa03c12546c..42ed3f456e3 100644 --- a/code/game/turfs/simulated.dm +++ b/code/game/turfs/simulated.dm @@ -53,13 +53,13 @@ H.track_blood = max(round(H.track_blood - 1, 1),0) if (bloodDNA) - if(istype(M,/mob/living/carbon/human/vox)) + if(H.species && istype(H.species,/datum/species/vox)) src.AddTracks(/obj/effect/decal/cleanable/blood/tracks/footprints/vox,bloodDNA,H.dir,0,bloodcolor) // Coming else src.AddTracks(/obj/effect/decal/cleanable/blood/tracks/footprints,bloodDNA,H.dir,0,bloodcolor) // Coming var/turf/simulated/from = get_step(H,reverse_direction(H.dir)) if(istype(from) && from) - if(istype(M,/mob/living/carbon/human/vox)) + if(H.species && istype(H.species,/datum/species/vox)) from.AddTracks(/obj/effect/decal/cleanable/blood/tracks/footprints/vox,bloodDNA,0,H.dir,bloodcolor) // Going else from.AddTracks(/obj/effect/decal/cleanable/blood/tracks/footprints,bloodDNA,0,H.dir,bloodcolor) // Going diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 1396fb6eb18..52e1368d4ab 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -212,7 +212,7 @@ var/const/MAX_SAVE_SLOTS = 8
Species: [species]
Secondary Language: [language]
- Skin Tone: [-s_tone + 35]/220

+ Skin Tone: [species == "Human" ? "[-s_tone + 35]/220" : "[s_tone]"]

Handicaps: Set
Limbs: Set
Organs: Set
@@ -928,7 +928,7 @@ NOTE: The change will take effect AFTER any current recruiting periods."} g_eyes = rand(0,255) b_eyes = rand(0,255) if("s_tone") - s_tone = random_skin_tone() + s_tone = random_skin_tone(species) if("bag") backbag = rand(1,4) /*if("skin_style") @@ -1079,11 +1079,12 @@ NOTE: The change will take effect AFTER any current recruiting periods."} h_style = new_h_style if("facial") - var/new_facial = input(user, "Choose your character's facial-hair colour:", "Character Preference") as color|null - if(new_facial) - r_facial = hex2num(copytext(new_facial, 2, 4)) - g_facial = hex2num(copytext(new_facial, 4, 6)) - b_facial = hex2num(copytext(new_facial, 6, 8)) + if(species == "Human" || species == "Unathi") + var/new_facial = input(user, "Choose your character's facial-hair colour:", "Character Preference") as color|null + if(new_facial) + r_facial = hex2num(copytext(new_facial, 2, 4)) + g_facial = hex2num(copytext(new_facial, 4, 6)) + b_facial = hex2num(copytext(new_facial, 6, 8)) if("f_style") var/list/valid_facialhairstyles = list() @@ -1122,11 +1123,24 @@ NOTE: The change will take effect AFTER any current recruiting periods."} b_eyes = hex2num(copytext(new_eyes, 6, 8)) if("s_tone") - if(species != "Human") + if(species == "Human") + var/new_s_tone = input(user, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Character Preference") as num|null + if(new_s_tone) + s_tone = 35 - max(min(round(new_s_tone),220),1) + else if(species == "Vox")//Can't reference species flags here, sorry. + var/skin_c = input(user, "Choose your Vox's skin color:\n(1 = Green, 2 = Brown, 3 = Gray)", "Character Preference") as num|null + if(skin_c) + s_tone = max(min(round(skin_c),3),1) + switch(s_tone) + if(3) + to_chat(src,"Your vox will now be gray.") + if(2) + to_chat(src,"Your vox will now be brown.") + else + to_chat(src,"Your vox will now be green.") + else + to_chat(src,"Your species doesn't have different skin tones. Yet?") return - var/new_s_tone = input(user, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Character Preference") as num|null - if(new_s_tone) - s_tone = 35 - max(min( round(new_s_tone), 220),1) if("ooccolor") var/new_ooccolor = input(user, "Choose your OOC colour:", "Game Preference") as color|null diff --git a/code/modules/events/heist.dm b/code/modules/events/heist.dm index 3c19e99e207..75348bca56f 100644 --- a/code/modules/events/heist.dm +++ b/code/modules/events/heist.dm @@ -82,6 +82,7 @@ var/global/list/datum/mind/raiders = list() //Antags. var/mob/living/carbon/human/vox = raider.current vox.age = rand(12,20) + vox.s_tone = random_skin_tone("Vox") vox.dna.mutantrace = "vox" vox.set_species("Vox") vox.generate_name() diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index a09e28c775e..72d9b9f5b6a 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -41,9 +41,11 @@ for(var/obj/Overlays/O in obj_overlays) returnToPool(O) - + obj_overlays = null + species = null + ..() /mob/living/carbon/human/death(gibbed) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index ef88c36279a..d843934bbea 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -77,9 +77,14 @@ /mob/living/carbon/human/New(var/new_loc, var/new_species_name = null, var/delay_ready_dna=0) if(!hair_styles_list.len) buildHairLists() if(!all_species.len) buildSpeciesLists() + + if(new_species_name) + s_tone = random_skin_tone(new_species_name) + if(!src.species) if(new_species_name) src.set_species(new_species_name) else src.set_species() + default_language = get_default_language() create_reagents(1000) @@ -1395,6 +1400,7 @@ var/datum/species/S = all_species[new_species_name] src.species = new S.type + src.species.myhuman = src if(species.language) add_language(species.language) @@ -1414,8 +1420,8 @@ src.do_deferred_species_setup = 1 spawn() src.dna.species = new_species_name + src.species.handle_post_spawn(src) src.update_icons() - src.species.handle_post_spawn(src) return 1 /mob/living/carbon/human/proc/bloody_doodle() diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index ac1092b94c5..38488ad6d40 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -413,6 +413,8 @@ var/global/list/damage_icon_parts = list() race_icon = 'icons/mob/human_races/r_skeleton.dmi' else //Icon data is kept in species datums within the mob. + if(species && istype(species, /datum/species)) + species.updatespeciescolor(src) race_icon = species.icobase deform_icon = species.deform overlays -= obj_overlays[MUTANTRACE_LAYER] diff --git a/code/modules/mob/living/carbon/species.dm b/code/modules/mob/living/carbon/species.dm index 811f2a11ce4..e642b79ec1e 100644 --- a/code/modules/mob/living/carbon/species.dm +++ b/code/modules/mob/living/carbon/species.dm @@ -45,6 +45,7 @@ var/global/list/whitelisted_species = list("Human") var/punch_throw_range = 0 var/punch_throw_speed = 1 var/mutantrace // Safeguard due to old code. + var/myhuman // mob reference var/breath_type = "oxygen" // Non-oxygen gas breathed, if any. var/survival_gear = /obj/item/weapon/storage/box/survival // For spawnin'. @@ -133,6 +134,11 @@ var/global/list/whitelisted_species = list("Human") default_blocks = globalspeciesholder.default_blocks.Copy() default_mutations = globalspeciesholder.default_mutations.Copy() +/datum/species/Destroy() + if(myhuman) + myhuman = null + ..() + /datum/species/proc/handle_speech(var/datum/speech/speech, mob/living/carbon/human/H) if(H.dna) if(length(speech.message) >= 2) @@ -199,6 +205,9 @@ var/global/list/whitelisted_species = list("Human") /datum/species/proc/handle_post_spawn(var/mob/living/carbon/human/H) //Handles anything not already covered by basic species assignment. return +/datum/species/proc/updatespeciescolor(var/mob/living/carbon/human/H) //Handles changing icobase for species that have multiple skin colors. + return + // Sent from /datum/lung_gas/metabolizable. /datum/species/proc/receiveGas(var/gas_id, var/ratio, var/moles, var/mob/living/carbon/human/H) //testing("receiveGas: [gas_id] ? [breath_type] - ratio=[ratio], moles=[moles]") @@ -465,8 +474,8 @@ var/global/list/whitelisted_species = list("Human") /datum/species/vox name = "Vox" - icobase = 'icons/mob/human_races/r_vox.dmi' - deform = 'icons/mob/human_races/r_def_vox.dmi' + icobase = 'icons/mob/human_races/vox/r_vox.dmi' + deform = 'icons/mob/human_races/vox/r_def_vox.dmi' language = "Vox-pidgin" survival_gear = /obj/item/weapon/storage/box/survival/vox @@ -610,6 +619,23 @@ var/global/list/whitelisted_species = list("Human") newname += pick(vox_name_syllables) return capitalize(newname) +/datum/species/vox/handle_post_spawn(var/mob/living/carbon/human/H) + if(myhuman != H) return + updatespeciescolor(H) + H.update_icon() + +/datum/species/vox/updatespeciescolor(var/mob/living/carbon/human/H) + switch(H.s_tone) + if(3) + icobase = 'icons/mob/human_races/vox/r_voxgry.dmi' + deform = 'icons/mob/human_races/vox/r_def_voxgry.dmi' + if(2) + icobase = 'icons/mob/human_races/vox/r_voxbrn.dmi' + deform = 'icons/mob/human_races/vox/r_def_voxbrn.dmi' + else + icobase = 'icons/mob/human_races/vox/r_vox.dmi' + deform = 'icons/mob/human_races/vox/r_def_vox.dmi' + /datum/species/diona name = "Diona" icobase = 'icons/mob/human_races/r_plant.dmi' diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm index 5be5931ef71..94ff529d2b9 100644 --- a/code/modules/mob/new_player/preferences_setup.dm +++ b/code/modules/mob/new_player/preferences_setup.dm @@ -6,7 +6,7 @@ datum/preferences gender = MALE else gender = FEMALE - s_tone = random_skin_tone() + s_tone = random_skin_tone(species) h_style = random_hair_style(gender, species) f_style = random_facial_hair_style(gender, species) randomize_hair_color("hair") @@ -149,8 +149,18 @@ datum/preferences var/icon/icobase var/datum/species/current_species = all_species[species] + //icon based species color if(current_species) - icobase = current_species.icobase + if(current_species.name == "Vox") + switch(s_tone) + if(3) + icobase = 'icons/mob/human_races/vox/r_voxgry.dmi' + if(2) + icobase = 'icons/mob/human_races/vox/r_voxbrn.dmi' + else + icobase = 'icons/mob/human_races/vox/r_vox.dmi' + else + icobase = current_species.icobase else icobase = 'icons/mob/human_races/r_human.dmi' diff --git a/html/changelogs/Intipox.yml b/html/changelogs/Intipox.yml new file mode 100644 index 00000000000..440ef5e3de2 --- /dev/null +++ b/html/changelogs/Intipox.yml @@ -0,0 +1,5 @@ +author: Intigracy +delete-after: True +changes: +- imageadd: "Vox are now able to choose from 3 colors of skin (the current green has been darkened, a reddish-brown, and gray) in their preferences. Gray is the obvious best choice." +- tweak: "Vox raiders and adminspawned vox now get a random skin color. Admins are able to varedit vox skin colors by changing s_tone and regenerating icons." \ No newline at end of file diff --git a/icons/mob/human_races/r_def_vox.dmi b/icons/mob/human_races/r_def_vox.dmi deleted file mode 100644 index 2024f52583b..00000000000 Binary files a/icons/mob/human_races/r_def_vox.dmi and /dev/null differ diff --git a/icons/mob/human_races/r_vox.dmi b/icons/mob/human_races/r_vox.dmi deleted file mode 100644 index 28b083fd51e..00000000000 Binary files a/icons/mob/human_races/r_vox.dmi and /dev/null differ diff --git a/icons/mob/human_races/vox/r_def_vox.dmi b/icons/mob/human_races/vox/r_def_vox.dmi new file mode 100644 index 00000000000..2692ed5eb0e Binary files /dev/null and b/icons/mob/human_races/vox/r_def_vox.dmi differ diff --git a/icons/mob/human_races/vox/r_def_voxbrn.dmi b/icons/mob/human_races/vox/r_def_voxbrn.dmi new file mode 100644 index 00000000000..54bc29d92e7 Binary files /dev/null and b/icons/mob/human_races/vox/r_def_voxbrn.dmi differ diff --git a/icons/mob/human_races/vox/r_def_voxgry.dmi b/icons/mob/human_races/vox/r_def_voxgry.dmi new file mode 100644 index 00000000000..f9918a7bc50 Binary files /dev/null and b/icons/mob/human_races/vox/r_def_voxgry.dmi differ diff --git a/icons/mob/human_races/vox/r_vox.dmi b/icons/mob/human_races/vox/r_vox.dmi new file mode 100644 index 00000000000..2e2427d7ebb Binary files /dev/null and b/icons/mob/human_races/vox/r_vox.dmi differ diff --git a/icons/mob/human_races/vox/r_voxbrn.dmi b/icons/mob/human_races/vox/r_voxbrn.dmi new file mode 100644 index 00000000000..01fe8a73614 Binary files /dev/null and b/icons/mob/human_races/vox/r_voxbrn.dmi differ diff --git a/icons/mob/human_races/vox/r_voxgry.dmi b/icons/mob/human_races/vox/r_voxgry.dmi new file mode 100644 index 00000000000..80c36e75a12 Binary files /dev/null and b/icons/mob/human_races/vox/r_voxgry.dmi differ