From 1ba39fee84f7a134031dd1d9bc2e68c74c6d5896 Mon Sep 17 00:00:00 2001 From: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Date: Tue, 29 Nov 2022 07:51:01 +1000 Subject: [PATCH] Merge pull request #14056 from Seris02/prometheanchanges promethean fixes and QoLs --- code/__defines/mobs_vr.dm | 6 ++++++ .../client/preference_setup/vore/07_traits.dm | 12 +++++++++--- .../carbon/human/species/species_shapeshift.dm | 10 ++++++---- .../human/species/species_shapeshift_vr.dm | 17 ++++++++++++++++- .../living/carbon/human/species/species_vr.dm | 12 ++++++++---- .../carbon/human/species/station/alraune.dm | 2 +- .../carbon/human/species/station/blank_vr.dm | 2 +- .../human/species/station/station_special_vr.dm | 2 +- .../mob/living/carbon/human/update_icons.dm | 6 ++++++ 9 files changed, 54 insertions(+), 15 deletions(-) diff --git a/code/__defines/mobs_vr.dm b/code/__defines/mobs_vr.dm index 51c65f532b..253cde36e9 100644 --- a/code/__defines/mobs_vr.dm +++ b/code/__defines/mobs_vr.dm @@ -43,3 +43,9 @@ //custom species base sprites #define SPECIES_FENNEC "Fennec" #define SPECIES_XENOHYBRID "Xenohybrid" + +//for custom bodytypes + +#define SELECTS_BODYTYPE_FALSE 0 +#define SELECTS_BODYTYPE_CUSTOM 1 +#define SELECTS_BODYTYPE_SHAPESHIFTER 2 diff --git a/code/modules/client/preference_setup/vore/07_traits.dm b/code/modules/client/preference_setup/vore/07_traits.dm index ddd0ff612c..99a4020f4c 100644 --- a/code/modules/client/preference_setup/vore/07_traits.dm +++ b/code/modules/client/preference_setup/vore/07_traits.dm @@ -241,9 +241,15 @@ return TOPIC_REFRESH else if(href_list["custom_base"]) - var/list/choices = GLOB.custom_species_bases - if(pref.species != SPECIES_CUSTOM) - choices = (choices | pref.species) + var/list/choices + var/datum/species/spec = GLOB.all_species[pref.species] + if (spec.selects_bodytype == SELECTS_BODYTYPE_SHAPESHIFTER && istype(spec, /datum/species/shapeshifter)) + var/datum/species/shapeshifter/spec_shifter = spec + choices = spec_shifter.valid_transform_species + else + choices = GLOB.custom_species_bases + if(pref.species != SPECIES_CUSTOM) + choices = (choices | pref.species) var/text_choice = tgui_input_list(usr, "Pick an icon set for your species:","Icon Base", choices) if(text_choice in choices) pref.custom_base = text_choice diff --git a/code/modules/mob/living/carbon/human/species/species_shapeshift.dm b/code/modules/mob/living/carbon/human/species/species_shapeshift.dm index ac4929b13e..59d64d2019 100644 --- a/code/modules/mob/living/carbon/human/species/species_shapeshift.dm +++ b/code/modules/mob/living/carbon/human/species/species_shapeshift.dm @@ -13,7 +13,7 @@ var/list/wrapped_species_by_ref = list() var/list/valid_transform_species = list() var/monochromatic - var/default_form = SPECIES_HUMAN + //var/default_form = SPECIES_HUMAN //VOREStation edit /datum/species/shapeshifter/get_valid_shapeshifter_forms(var/mob/living/carbon/human/H) return valid_transform_species @@ -63,7 +63,7 @@ var/list/wrapped_species_by_ref = list() /datum/species/shapeshifter/handle_post_spawn(var/mob/living/carbon/human/H) ..() - wrapped_species_by_ref["\ref[H]"] = default_form + wrapped_species_by_ref["\ref[H]"] = base_species //VOREStation edit if(monochromatic) H.r_hair = H.r_skin H.g_hair = H.g_skin @@ -159,6 +159,7 @@ var/list/wrapped_species_by_ref = list() return shapeshifter_change_shape(new_species) +/* VOREStation edit - moved to species_shapeshift_vr.dm /mob/living/carbon/human/proc/shapeshifter_change_shape(var/new_species = null) if(!new_species) return @@ -166,6 +167,7 @@ var/list/wrapped_species_by_ref = list() wrapped_species_by_ref["\ref[src]"] = new_species visible_message("\The [src] shifts and contorts, taking the form of \a [new_species]!") regenerate_icons() +*/ /mob/living/carbon/human/proc/shapeshifter_select_colour() @@ -318,11 +320,11 @@ var/list/wrapped_species_by_ref = list() var/new_eyes = input(usr, "Pick a new color for your eyes.","Eye Color", current_color) as null|color if(!new_eyes) return - + shapeshifter_set_eye_color(new_eyes) /mob/living/carbon/human/proc/shapeshifter_set_eye_color(var/new_eyes) - + var/list/new_color_rgb_list = hex2rgb(new_eyes) // First, update mob vars. r_eyes = new_color_rgb_list[1] diff --git a/code/modules/mob/living/carbon/human/species/species_shapeshift_vr.dm b/code/modules/mob/living/carbon/human/species/species_shapeshift_vr.dm index 40fad362d8..c8e67a39cd 100644 --- a/code/modules/mob/living/carbon/human/species/species_shapeshift_vr.dm +++ b/code/modules/mob/living/carbon/human/species/species_shapeshift_vr.dm @@ -1,3 +1,7 @@ +/datum/species/shapeshifter + base_species = SPECIES_HUMAN + selects_bodytype = SELECTS_BODYTYPE_SHAPESHIFTER + /mob/living/carbon/human/proc/shapeshifter_select_ears() set name = "Select Ears" set category = "Abilities" @@ -175,4 +179,15 @@ L.transparent = !L.transparent visible_message("\The [src]'s internal composition seems to change.") update_icons_body() - update_hair() \ No newline at end of file + update_hair() + +/mob/living/carbon/human/proc/shapeshifter_change_shape(var/new_species = null, var/visible = TRUE) //not sure if this needs to be moved to a separate file but + if(!new_species) + return + + dna.base_species = new_species + species.base_species = new_species + wrapped_species_by_ref["\ref[src]"] = new_species + if (visible) + visible_message("\The [src] shifts and contorts, taking the form of \a [new_species]!") + regenerate_icons() diff --git a/code/modules/mob/living/carbon/human/species/species_vr.dm b/code/modules/mob/living/carbon/human/species/species_vr.dm index 145e296281..e7f0e4c608 100644 --- a/code/modules/mob/living/carbon/human/species/species_vr.dm +++ b/code/modules/mob/living/carbon/human/species/species_vr.dm @@ -15,7 +15,7 @@ var/trashcan = FALSE //It's always sunny in the wrestling ring. var/eat_minerals = FALSE //HEAVY METAL DIET var/base_species = null // Unused outside of a few species - var/selects_bodytype = FALSE // Allows the species to choose from body types like custom species can, affecting suit fitting and etcetera as you would expect. + var/selects_bodytype = SELECTS_BODYTYPE_FALSE // Allows the species to choose from body types like custom species can, affecting suit fitting and etcetera as you would expect. var/bloodsucker = FALSE // Allows safely getting nutrition from blood. @@ -61,10 +61,14 @@ ASSERT(istype(H)) var/datum/species/new_copy = new src.type() new_copy.race_key = race_key + new_copy.base_species = custom_base + if (custom_base) + if(selects_bodytype == SELECTS_BODYTYPE_CUSTOM) //If race selects a bodytype, retrieve the custom_base species and copy needed variables. + var/datum/species/S = GLOB.all_species[custom_base] + S.copy_variables(new_copy, copy_vars) - if(selects_bodytype && custom_base) //If race selects a bodytype, retrieve the custom_base species and copy needed variables. - var/datum/species/S = GLOB.all_species[custom_base] - S.copy_variables(new_copy, copy_vars) + if(selects_bodytype == SELECTS_BODYTYPE_SHAPESHIFTER) + H.shapeshifter_change_shape(custom_base, FALSE) for(var/organ in has_limbs) //Copy important organ data generated by species. var/list/organ_data = has_limbs[organ] diff --git a/code/modules/mob/living/carbon/human/species/station/alraune.dm b/code/modules/mob/living/carbon/human/species/station/alraune.dm index a4d8ed645c..828958ccfc 100644 --- a/code/modules/mob/living/carbon/human/species/station/alraune.dm +++ b/code/modules/mob/living/carbon/human/species/station/alraune.dm @@ -14,7 +14,7 @@ max_age = 250 health_hud_intensity = 1.5 base_species = SPECIES_ALRAUNE - selects_bodytype = TRUE + selects_bodytype = SELECTS_BODYTYPE_CUSTOM //VOREStation edit male_scream_sound = null //CHOMPedit female_scream_sound = null //CHOMPedit diff --git a/code/modules/mob/living/carbon/human/species/station/blank_vr.dm b/code/modules/mob/living/carbon/human/species/station/blank_vr.dm index 0b6a891890..9c28f57c59 100644 --- a/code/modules/mob/living/carbon/human/species/station/blank_vr.dm +++ b/code/modules/mob/living/carbon/human/species/station/blank_vr.dm @@ -6,7 +6,7 @@ /datum/species/custom name = SPECIES_CUSTOM name_plural = "Custom" - selects_bodytype = TRUE + selects_bodytype = SELECTS_BODYTYPE_CUSTOM base_species = SPECIES_HUMAN unarmed_types = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/punch, /datum/unarmed_attack/bite) diff --git a/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm b/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm index 19575b357b..b4afbaeeb2 100644 --- a/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm +++ b/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm @@ -15,7 +15,7 @@ brute_mod = 0.8 //About as tanky to brute as a Unathi. They'll probably snap and go feral when hurt though. burn_mod = 1.15 //As vulnerable to burn as a Tajara. base_species = "Xenochimera" - selects_bodytype = TRUE + selects_bodytype = SELECTS_BODYTYPE_CUSTOM num_alternate_languages = 3 secondary_langs = list("Sol Common") diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 5f63f1d757..0a04f6500e 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -266,6 +266,12 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() var/obj/item/organ/external/head/head = organs_by_name[BP_HEAD] if(head) if(!istype(head, /obj/item/organ/external/stump)) + if (species.selects_bodytype != SELECTS_BODYTYPE_FALSE && dna.base_species) + var/headtype = GLOB.all_species[dna.base_species]?.has_limbs[BP_HEAD] + var/obj/item/organ/external/head/headtypepath = headtype["path"] + if (headtypepath) + head.eye_icon = initial(headtypepath.eye_icon) + head.eye_icon_location = initial(headtypepath.eye_icon_location) icon_key += "[head.eye_icon]" for(var/organ_tag in species.has_limbs) var/obj/item/organ/external/part = organs_by_name[organ_tag]