diff --git a/code/game/dna/dna2_ch.dm b/code/game/dna/dna2_ch.dm new file mode 100644 index 0000000000..263a966582 --- /dev/null +++ b/code/game/dna/dna2_ch.dm @@ -0,0 +1,13 @@ +/datum/dna + var/digitigrade = 0 //0, Not FALSE, for future use as indicator for digitigrade types (0 = None, 1 = default, 2 = digitigrade birdfeet, ...ect) + +/datum/dna/Clone() + . = ..() + var/datum/dna/D = . + //Data for inclusion of digitigrade leg settings in DNA + D.digitigrade = src.digitigrade + +/datum/dna/ResetUIFrom(var/mob/living/carbon/human/character) + //inclusion of digitigrade + src.digitigrade = character.digitigrade + . = ..() \ No newline at end of file diff --git a/code/modules/client/preference_setup/general/03_body.dm b/code/modules/client/preference_setup/general/03_body.dm index a157879965..1cdbb79b27 100644 --- a/code/modules/client/preference_setup/general/03_body.dm +++ b/code/modules/client/preference_setup/general/03_body.dm @@ -579,7 +579,12 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O if(has_flag(mob_species, HAS_SKIN_COLOR)) . += "
Body Color
" . += "Change Color [color_square(pref.r_skin, pref.g_skin, pref.b_skin)]
" - + + //CHOMPEdit START + if(mob_species.digi_allowed) + . += "
Digitigrade?: [pref.digitigrade ? "Yes" : "No"]
" + //CHOMPEdit END + . += "

Genetics Settings

" var/list/ear_styles = pref.get_available_styles(global.ear_styles_list) diff --git a/code/modules/client/preference_setup/general/03_body_ch.dm b/code/modules/client/preference_setup/general/03_body_ch.dm new file mode 100644 index 0000000000..e92f75da29 --- /dev/null +++ b/code/modules/client/preference_setup/general/03_body_ch.dm @@ -0,0 +1,37 @@ +// Chomp additions to character load/save logic +// /datum/category_item/player_setup_item/general/body/content cannot be overridden here easily as the proc creates a list of html data +// perhaps one could get that list here, and sort through sections to rewrite it's content...? that seems inefficent having to loop through the list. + + +/datum/category_item/player_setup_item/general/body/copy_to_mob(var/mob/living/carbon/human/character) + . = ..() + if(character.species.digi_allowed) + character.digitigrade = pref.digitigrade + else + character.digitigrade = 0 + + //sanity check + if(character.digitigrade == null) + character.digitigrade = 0 + pref.digitigrade = 0 + +/datum/category_item/player_setup_item/general/body/OnTopic(var/href,var/list/href_list, var/mob/user) + if(href_list["digitigrade"]) + pref.digitigrade = !pref.digitigrade + + return TOPIC_REFRESH_UPDATE_PREVIEW + . = ..() + +// Savefile additions +// Be careful here +/datum/category_item/player_setup_item/general/body/load_character(var/savefile/S) + . = ..() + S["digitigrade"] >> pref.digitigrade //CHOMPEdit + +/datum/category_item/player_setup_item/general/body/save_character(var/savefile/S) + . = ..() + S["digitigrade"] << pref.digitigrade //CHOMPEdit + +/datum/category_item/player_setup_item/general/body/sanitize_character(var/savefile/S) + . = ..() + pref.digitigrade = sanitize_integer(pref.digitigrade, 0, 1, initial(pref.digitigrade)) \ No newline at end of file diff --git a/code/modules/client/preferences_ch.dm b/code/modules/client/preferences_ch.dm new file mode 100644 index 0000000000..ac31bd2daa --- /dev/null +++ b/code/modules/client/preferences_ch.dm @@ -0,0 +1,2 @@ +/datum/preferences + var/digitigrade = 0 // 0 = no digi, 1 = default, 2+ = digi styles... (Not used yet) \ No newline at end of file diff --git a/code/modules/clothing/clothing_ch.dm b/code/modules/clothing/clothing_ch.dm new file mode 100644 index 0000000000..ff5e820a26 --- /dev/null +++ b/code/modules/clothing/clothing_ch.dm @@ -0,0 +1,62 @@ +//CHOMP Overrides for if holder is digitigrade +/obj/item/clothing + var/update_icon_define_orig = null // temp storage for original update_icon_define (if it exists) + var/fit_for_digi = FALSE // flag for if clothing has already been reskinned to digitigrade + +/obj/item/clothing/proc/handle_digitigrade(var/mob/user) + if(ishuman(user)) + var/mob/living/carbon/human/H = user + + // if digitigrade-use flag is set + if(H.digitigrade) + + // figure out what slot we care about + var/update_icon_define_digi = null + + if(istype(src, /obj/item/clothing/shoes)) + update_icon_define_digi = "icons/inventory/feet/mob_digi_ch.dmi" + else if(istype(src, /obj/item/clothing/suit)) //suit + update_icon_define_digi = "icons/inventory/suit/mob_digi_ch.dmi" + else if(istype(src, /obj/item/clothing/under)) //uniform + update_icon_define_digi = "icons/inventory/uniform/mob_digi_ch.dmi" + else + return + + // Don't reset if already set + if(!fit_for_digi) + fit_for_digi = TRUE // set flag even if no icon_state exists, so we don't repeat checks + + //if update_icon_define is already set to something, place it in a var to hold it temporarily + if(update_icon_define) + update_icon_define_orig = update_icon_define + + // only override icon if a corresponding digitigrade replacement icon_state exists + // otherwise, keep the old non-digi icon_define (or nothing) + if(icon_state && icon_states(update_icon_define_digi).Find(icon_state)) + update_icon_define = update_icon_define_digi + + + // if not-digitigrade, only act if the clothing was previously fit for a digitigrade char + else + if(fit_for_digi) + fit_for_digi = FALSE + + //either reset update_icon_define to it's old value + // or reset update_icon_define to null + if(update_icon_define_orig) + update_icon_define = update_icon_define_orig + update_icon_define_orig = null + else + update_icon_define = null + +/obj/item/clothing/shoes/equipped(var/mob/user, var/slot) + . = ..() + handle_digitigrade(user) + +/obj/item/clothing/suit/equipped(var/mob/user, var/slot) + . = ..() + handle_digitigrade(user) + +/obj/item/clothing/under/equipped(var/mob/user, var/slot) + . = ..() + handle_digitigrade(user) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/human_defines_ch.dm b/code/modules/mob/living/carbon/human/human_defines_ch.dm index 10855c4bd7..538be62465 100644 --- a/code/modules/mob/living/carbon/human/human_defines_ch.dm +++ b/code/modules/mob/living/carbon/human/human_defines_ch.dm @@ -1,4 +1,5 @@ /mob/living/carbon/human var/gender_change_cooldown = 0 // A cooldown for gender and gender indentify changing procs to make it easy to avoid spam of gender change var/loneliness_stage = 0 - var/next_loneliness_time = 0 \ No newline at end of file + var/next_loneliness_time = 0 + var/digitigrade = 0 // 0 = no digi, 1 = default, 2+ = digi styles... (Not used yet) diff --git a/code/modules/mob/living/carbon/human/species/species_ch.dm b/code/modules/mob/living/carbon/human/species/species_ch.dm index 22c20b86c2..178bdb01a8 100644 --- a/code/modules/mob/living/carbon/human/species/species_ch.dm +++ b/code/modules/mob/living/carbon/human/species/species_ch.dm @@ -13,7 +13,9 @@ var/grab_power_self = 0 var/waking_speed = 1 var/mudking = FALSE - + var/icodigi = 'icons/mob/human_races/r_digi_ch.dmi' + var/digi_allowed = FALSE + /datum/species/handle_environment_special(var/mob/living/carbon/human/H) for(var/datum/trait/env_trait in env_traits) env_trait.handle_environment_special(H) diff --git a/code/modules/mob/living/carbon/human/species/station/station_ch.dm b/code/modules/mob/living/carbon/human/species/station/station_ch.dm index 77e80b2be9..ae48a445b2 100644 --- a/code/modules/mob/living/carbon/human/species/station/station_ch.dm +++ b/code/modules/mob/living/carbon/human/species/station/station_ch.dm @@ -38,4 +38,35 @@ /datum/species/vox spawn_flags = SPECIES_CAN_JOIN | SPECIES_IS_WHITELISTED | SPECIES_WHITELIST_SELECTABLE -*/ \ No newline at end of file +*/ + +//Can use digitigrade flags +/datum/species/custom + digi_allowed = TRUE + +/datum/species/unathi + digi_allowed = TRUE + +/datum/species/tajaran + digi_allowed = TRUE + +/datum/species/hi_zoxxen + digi_allowed = TRUE + +/datum/species/sergal + digi_allowed = TRUE + +/datum/species/akula + digi_allowed = TRUE + +/datum/species/nevrean + digi_allowed = TRUE + +/datum/species/vulpkanin + digi_allowed = TRUE + +/datum/species/xenohybrid + digi_allowed = TRUE + +/datum/species/xenochimera + digi_allowed = TRUE diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 4134a4c139..dd7d27bdd8 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -293,6 +293,12 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() if(tail_style.clip_mask) //VOREStation Edit. icon_key += tail_style.clip_mask_state + //ChompEDIT START + //icon_key addition for digitigrade switch + if(digitigrade && (part.organ_tag == BP_R_LEG || part.organ_tag == BP_L_LEG || part.organ_tag == BP_R_FOOT || part.organ_tag == BP_L_FOOT)) + icon_key += "_digi" + //ChompEDIT END + icon_key = "[icon_key][husk ? 1 : 0][fat ? 1 : 0][hulk ? 1 : 0][skeleton ? 1 : 0]" var/icon/base_icon if(human_icon_cache[icon_key]) diff --git a/code/modules/mob/living/carbon/human/update_icons_ch.dm b/code/modules/mob/living/carbon/human/update_icons_ch.dm new file mode 100644 index 0000000000..67f2f80d45 --- /dev/null +++ b/code/modules/mob/living/carbon/human/update_icons_ch.dm @@ -0,0 +1,39 @@ +// Expand shoe layer to allow changing the icon for digi legs +// For some reason, suit and uniform already has this funcitonality, but shoes do not. + +#define SHOES_LAYER_ALT 7 //Shoe-slot item (when set to be under uniform via verb) +#define SHOES_LAYER 10 //Shoe-slot item + +/mob/living/carbon/human/update_inv_shoes() + //. = ..() + remove_layer(SHOES_LAYER) + remove_layer(SHOES_LAYER_ALT) //Dumb alternate layer for shoes being under the uniform. + + if(!shoes || (wear_suit && wear_suit.flags_inv & HIDESHOES) || (w_uniform && w_uniform.flags_inv & HIDESHOES)) + return //Either nothing to draw, or it'd be hidden. + + for(var/f in list(BP_L_FOOT, BP_R_FOOT)) + var/obj/item/organ/external/foot/foot = get_organ(f) + if(istype(foot) && foot.is_hidden_by_tail()) //If either foot is hidden by the tail, don't render footwear. + return + + var/obj/item/clothing/shoes/shoe = shoes + var/shoe_sprite + + if(istype(shoe) && !isnull(shoe.update_icon_define)) + shoe_sprite = shoe.update_icon_define + else + shoe_sprite = INV_FEET_DEF_ICON + + //Allow for shoe layer toggle nonsense + var/shoe_layer = SHOES_LAYER + if(istype(shoes, /obj/item/clothing/shoes)) + var/obj/item/clothing/shoes/ushoes = shoes + if(ushoes.shoes_under_pants == 1) + shoe_layer = SHOES_LAYER_ALT + + //NB: the use of a var for the layer on this one + overlays_standing[shoe_layer] = shoes.make_worn_icon(body_type = species.get_bodytype(src), slot_name = slot_shoes_str, default_icon = shoe_sprite, default_layer = shoe_layer) + + apply_layer(SHOES_LAYER) + apply_layer(SHOES_LAYER_ALT) \ No newline at end of file diff --git a/code/modules/organs/organ_icon_ch.dm b/code/modules/organs/organ_icon_ch.dm new file mode 100644 index 0000000000..aa1ad01ad7 --- /dev/null +++ b/code/modules/organs/organ_icon_ch.dm @@ -0,0 +1,65 @@ +// override the organ icon getting proc if digitigrade and not a synth + +/obj/item/organ/external/get_icon(var/skeletal) + var/digitigrade = 0 + + // preferentially take digitigrade value from owner if available, THEN DNA. + // this allows limbs to be set properly when being printed in the bioprinter without an owner + // this also allows the preview mannequin to update properly because customisation topic calls don't call a DNA check + if(owner) + digitigrade = owner.digitigrade + else + digitigrade = dna.digitigrade + + if( !model && digitigrade && ( istype(src,/obj/item/organ/external/leg) || istype(src,/obj/item/organ/external/foot) ) ) + + var/gender = "m" + if(owner && owner.gender == FEMALE) + gender = "f" + + if(!force_icon_key) + icon_cache_key = "[icon_name]_[species ? species.get_bodytype() : SPECIES_HUMAN]" //VOREStation Edit + else + icon_cache_key = "[icon_name]_[force_icon_key]" + + if(force_icon) + mob_icon = new /icon(force_icon, "[icon_name][gendered_icon ? "_[gender]" : ""]") + else + if(!dna) + mob_icon = new /icon('icons/mob/human_races/r_human.dmi', "[icon_name][gendered_icon ? "_[gender]" : ""]") + else + + if(!gendered_icon) + gender = null + else + if(dna.GetUIState(DNA_UI_GENDER)) + gender = "f" + else + gender = "m" + + if(skeletal) + mob_icon = new /icon('icons/mob/human_races/r_skeleton.dmi', "[icon_name][gender ? "_[gender]" : ""]") + else if (robotic >= ORGAN_ROBOT) + mob_icon = new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]") + apply_colouration(mob_icon) + else + mob_icon = new /icon(species.icodigi, "[icon_name][gender ? "_[gender]" : ""]") + apply_colouration(mob_icon) + + /* + //Body markings, actually does not include head this time. Done separately above. + if(!istype(src,/obj/item/organ/external/head)) + for(var/M in markings) + var/datum/sprite_accessory/marking/mark_style = markings[M]["datum"] + var/icon/mark_s = new/icon("icon" = mark_style.icon, "icon_state" = "[mark_style.icon_state]-[organ_tag]") + mark_s.Blend(markings[M]["color"], mark_style.color_blend_mode) // VOREStation edit + add_overlay(mark_s) //So when it's not on your body, it has icons + mob_icon.Blend(mark_s, ICON_OVERLAY) //So when it's on your body, it has icons + icon_cache_key += "[M][markings[M]["color"]]" + */ + dir = EAST + icon = mob_icon + return mob_icon + + else + . = ..() \ No newline at end of file diff --git a/code/modules/resleeving/machines_ch.dm b/code/modules/resleeving/machines_ch.dm new file mode 100644 index 0000000000..647fe803d6 --- /dev/null +++ b/code/modules/resleeving/machines_ch.dm @@ -0,0 +1,11 @@ +/obj/machinery/clonepod/transhuman/growclone(var/datum/transhuman/body_record/current_project) + . = ..() + //Extra clonepod behavior + var/mob/living/carbon/human/H = occupant + var/datum/dna2/record/R = current_project.mydna + + H.digitigrade = R.dna.digitigrade // ensure clone mob has digitigrade var set appropriately + if(H.dna.digitigrade <> R.dna.digitigrade) + H.dna.digitigrade = R.dna.digitigrade // ensure cloned DNA is set appropriately from record??? for some reason it doesn't get set right despite the override to datum/dna/Clone() + + H.update_icons_body() \ No newline at end of file diff --git a/icons/inventory/feet/mob_digi_ch.dmi b/icons/inventory/feet/mob_digi_ch.dmi new file mode 100644 index 0000000000..5556c45b16 Binary files /dev/null and b/icons/inventory/feet/mob_digi_ch.dmi differ diff --git a/icons/inventory/suit/mob_digi_ch.dmi b/icons/inventory/suit/mob_digi_ch.dmi new file mode 100644 index 0000000000..5afc971d9f Binary files /dev/null and b/icons/inventory/suit/mob_digi_ch.dmi differ diff --git a/icons/inventory/uniform/mob_digi_ch.dmi b/icons/inventory/uniform/mob_digi_ch.dmi new file mode 100644 index 0000000000..3f802b2390 Binary files /dev/null and b/icons/inventory/uniform/mob_digi_ch.dmi differ diff --git a/icons/mob/human_races/r_digi_ch.dmi b/icons/mob/human_races/r_digi_ch.dmi new file mode 100644 index 0000000000..4d89b85a0e Binary files /dev/null and b/icons/mob/human_races/r_digi_ch.dmi differ diff --git a/vorestation.dme b/vorestation.dme index dc5dfa2078..72e021f68a 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -607,6 +607,7 @@ #include "code\game\area\Space Station 13 areas_vr.dm" #include "code\game\area\ss13_deprecated_areas.dm" #include "code\game\dna\dna2.dm" +#include "code\game\dna\dna2_ch.dm" #include "code\game\dna\dna2_domutcheck.dm" #include "code\game\dna\dna2_helpers.dm" #include "code\game\dna\dna_modifier.dm" @@ -1945,6 +1946,7 @@ #include "code\modules\client\client procs_vr.dm" #include "code\modules\client\movement.dm" #include "code\modules\client\preferences.dm" +#include "code\modules\client\preferences_ch.dm" #include "code\modules\client\preferences_factions.dm" #include "code\modules\client\preferences_savefile.dm" #include "code\modules\client\preferences_spawnpoints.dm" @@ -1962,6 +1964,7 @@ #include "code\modules\client\preference_setup\general\01_basic.dm" #include "code\modules\client\preference_setup\general\02_language.dm" #include "code\modules\client\preference_setup\general\03_body.dm" +#include "code\modules\client\preference_setup\general\03_body_ch.dm" #include "code\modules\client\preference_setup\general\04_equipment.dm" #include "code\modules\client\preference_setup\general\05_background.dm" #include "code\modules\client\preference_setup\general\06_flavor.dm" @@ -2034,6 +2037,7 @@ #include "code\modules\clothing\chameleon.dm" #include "code\modules\clothing\clothing.dm" #include "code\modules\clothing\clothing_accessories.dm" +#include "code\modules\clothing\clothing_ch.dm" #include "code\modules\clothing\clothing_icons.dm" #include "code\modules\clothing\clothing_vr.dm" #include "code\modules\clothing\ears\earrings.dm" @@ -2947,6 +2951,7 @@ #include "code\modules\mob\living\carbon\human\stripping.dm" #include "code\modules\mob\living\carbon\human\unarmed_attack.dm" #include "code\modules\mob\living\carbon\human\update_icons.dm" +#include "code\modules\mob\living\carbon\human\update_icons_ch.dm" #include "code\modules\mob\living\carbon\human\ai_controlled\ai_controlled.dm" #include "code\modules\mob\living\carbon\human\descriptors\_descriptors.dm" #include "code\modules\mob\living\carbon\human\descriptors\descriptors_generic.dm" @@ -3492,6 +3497,7 @@ #include "code\modules\organs\organ_external.dm" #include "code\modules\organs\organ_external_vr.dm" #include "code\modules\organs\organ_icon.dm" +#include "code\modules\organs\organ_icon_ch.dm" #include "code\modules\organs\organ_stump.dm" #include "code\modules\organs\pain.dm" #include "code\modules\organs\robolimbs.dm" @@ -3982,6 +3988,7 @@ #include "code\modules\resleeving\infomorph.dm" #include "code\modules\resleeving\infomorph_software.dm" #include "code\modules\resleeving\machines.dm" +#include "code\modules\resleeving\machines_ch.dm" #include "code\modules\resleeving\machines_vr.dm" #include "code\modules\resleeving\sleevecard.dm" #include "code\modules\rogueminer_vr\asteroid.dm"