Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Synth Customisation Options #500

Merged
merged 25 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e981d0e
Adds a head option for synths. Adds an extra cover that goes on their…
Constellado Jun 10, 2024
5d4e7e8
Merge branch 'MrMelbert:master' into SynthHeads
Constellado Jun 10, 2024
2c3adc5
removing duplicate code. id rather this be in a eparate file but thin…
Constellado Jun 10, 2024
0ab22f1
fix the dme. bugs are weird.
Constellado Jun 10, 2024
67197ad
how did this happen, adding this back in
Constellado Jun 10, 2024
b176c94
aghhhh
Constellado Jun 10, 2024
94c7d9d
i try hard. i do. not worky still.
Constellado Jun 10, 2024
5ea3503
IT NOW WORKS. All it needs is sprites now. Also, why is it changing t…
Constellado Jun 11, 2024
e04782e
IT WORKS. SPRITES.
Constellado Jun 11, 2024
260e604
Synths now have genders, and eyes! Currently having issues with havin…
Constellado Jun 11, 2024
f5ae2ec
sprite improvements
Constellado Jun 11, 2024
22d6de5
all the sprite tweaks
Constellado Jun 11, 2024
6e98c96
removing a random 5??? dunno where that came from
Constellado Jun 11, 2024
9dbee38
more sprite tweaks. hat issue is still there though
Constellado Jun 11, 2024
cd94bb4
Merge branch 'MrMelbert:master' into SynthHeads
Constellado Jun 12, 2024
f554511
All fixed!! Currently whenever a head over is on, no matter what kind…
Constellado Jun 12, 2024
2587ff3
Merge branch 'master' into SynthHeads
Constellado Jun 12, 2024
789a46c
Updates the screenshot test for synths
Constellado Jun 12, 2024
4fec040
adds another head option
Constellado Jun 13, 2024
1043565
Merge branch 'SynthHeads' of https://github.com/Constellado/MapleStat…
Constellado Jun 13, 2024
73f6647
fix hats for new image
Constellado Jun 13, 2024
60578b3
ahhh sprite adjustments!
Constellado Jun 13, 2024
433e446
ok one final tweak to this one.
Constellado Jun 13, 2024
5cd7cee
Update maplestation_modules/code/modules/mob/living/carbon/human/spec…
Constellado Jun 25, 2024
21d5bb3
Fixes for code review. not doing add_blank = TRUE for now.
Constellado Jun 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion code/__DEFINES/DNA.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@
#define DNA_AVIAN_EARS_BLOCK 18 // NON-MODULE CHANGE
#define DNA_AVIAN_TAIL_BLOCK 19 // NON-MODULE CHANGE
#define DNA_FEATHER_COLOR_BLOCK 20 // NON-MODULE CHANGE
#define DNA_SYNTH_HEAD_COVER_BLOCK 21 // NON-MODULE CHANGE

#define DNA_FEATURE_BLOCKS 20 // NON-MODULE CHANGE
#define DNA_FEATURE_BLOCKS 21 // NON-MODULE CHANGE

#define DNA_SEQUENCE_LENGTH 4
#define DNA_MUTATION_BLOCKS 8
Expand Down Expand Up @@ -104,6 +105,7 @@
#define ORGAN_SLOT_EXTERNAL_BODYMARKINGS "bodymarkings"
#define ORGAN_SLOT_EXTERNAL_POD_HAIR "pod_hair"
#define ORGAN_SLOT_EXTERNAL_HEAD_TENTACLES "head_tentacles" // NON-MODULE CHANGE
#define ORGAN_SLOT_EXTERNAL_SYNTH_HEAD_COVER "synth_head_cover" //NON-MODULE CHANGE

/// Xenomorph organ slots
#define ORGAN_SLOT_XENO_ACIDGLAND "acid_gland"
Expand Down
1 change: 1 addition & 0 deletions code/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
init_sprite_accessory_subtypes(/datum/sprite_accessory/arm_wingsopen, GLOB.arm_wingsopen_list) //NON-MODULE CHANGE
init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/avian, GLOB.tails_list_avian) //NON-MODULE CHANGE
init_sprite_accessory_subtypes(/datum/sprite_accessory/plumage, GLOB.avian_ears_list) //NON-MODULE CHANGE
init_sprite_accessory_subtypes(/datum/sprite_accessory/synth_head_cover, GLOB.synth_head_cover_list) //NON-MODULE CHANGE

/// Inits GLOB.species_list. Not using GLOBAL_LIST_INIT b/c it depends on GLOB.string_lists
/proc/init_species_list()
Expand Down
8 changes: 8 additions & 0 deletions code/datums/dna.dm
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
L[DNA_AVIAN_EARS_BLOCK] = construct_block(GLOB.avian_ears_list.Find(features["ears_avian"]), GLOB.avian_ears_list.len)
if(features["feathers"]) // NON-MODULE CHANGE
L[DNA_FEATHER_COLOR_BLOCK] = sanitize_hexcolor(features["feathers"], include_crunch = FALSE)
if(features["synth_head_cover"]) // NON-MODULE CHANGE
L[DNA_SYNTH_HEAD_COVER_BLOCK] = construct_block(GLOB.synth_head_cover_list.Find(features["synth_head_cover"]), GLOB.synth_head_cover_list.len)


for(var/blocknum in 1 to DNA_FEATURE_BLOCKS)
. += L[blocknum] || random_string(GET_UI_BLOCK_LEN(blocknum), GLOB.hex_characters)
Expand Down Expand Up @@ -388,6 +391,9 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
set_uni_feature_block(blocknumber, construct_block(GLOB.avian_ears_list.Find(features["ears_avian"]), GLOB.avian_ears_list.len))
if(DNA_FEATHER_COLOR_BLOCK) // NON-MODULE CHANGE
set_uni_feature_block(blocknumber, sanitize_hexcolor(features["feathers"], include_crunch = FALSE))
if(DNA_SYNTH_HEAD_COVER_BLOCK) // NON-MODULE CHANGE
set_uni_feature_block(blocknumber, construct_block(GLOB.synth_head_cover_list.Find(features["head_tentacles"]), GLOB.synth_head_cover_list.len))


//Please use add_mutation or activate_mutation instead
/datum/dna/proc/force_give(datum/mutation/human/human_mutation)
Expand Down Expand Up @@ -696,6 +702,8 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
dna.features["ears_avian"] = GLOB.avian_ears_list[deconstruct_block(get_uni_feature_block(features, DNA_AVIAN_EARS_BLOCK), GLOB.avian_ears_list.len)]
if(dna.features["feathers"]) // NON-MODULE CHANGE
dna.features["feathers"] = sanitize_hexcolor(get_uni_feature_block(features, DNA_FEATHER_COLOR_BLOCK))
if(dna.features["synth_head_cover"]) // NON-MODULE CHANGE
dna.features["synth_head_cover"] = GLOB.synth_head_cover_list[deconstruct_block(get_uni_feature_block(features, DNA_SYNTH_HEAD_COVER_BLOCK), GLOB.synth_head_cover_list.len)]

for(var/obj/item/organ/external/external_organ in organs)
external_organ.mutate_feature(features, src)
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/human/dummy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy)
target.dna.features["arm_wings"] = get_consistent_feature_entry(GLOB.arm_wings_list) // NON-MODULE CHANGE
target.dna.features["tail_avian"] = get_consistent_feature_entry(GLOB.tails_list_avian) // NON-MODULE CHANGE
target.dna.features["ears_avian"] = get_consistent_feature_entry(GLOB.avian_ears_list) // NON-MODULE CHANGE
target.dna.features["synth_head_cover"] = get_consistent_feature_entry(GLOB.synth_head_cover_list) // NON-MODULE CHANGE
target.dna.features["feathers"] = "#FF3B76" //NON-MODULE CHANGE
target.dna.initialize_dna(/datum/blood_type/crew/human/o_plus, create_mutation_blocks = FALSE, randomize_features = FALSE) //NON-MODULE CHANGE
// UF and UI are nondeterministic, even though the features are the same some blocks will randomize slightly
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,46 @@

/datum/preference/choiced/synth_blood/is_accessible(datum/preferences/preferences)
return ..() && ispath(preferences.read_preference(/datum/preference/choiced/species), /datum/species/synth)



//synth head covers (aka head design options)
/datum/preference/choiced/synth_head_cover
main_feature_name = "Head Cover"
savefile_key = "feature_synth_head_cover"

savefile_identifier = PREFERENCE_CHARACTER
category = PREFERENCE_CATEGORY_FEATURES
can_randomize = TRUE
relevant_external_organ = /obj/item/organ/external/synth_head_cover
should_generate_icons = TRUE

/datum/preference/choiced/synth_head_cover/init_possible_values()
return assoc_to_keys(GLOB.synth_head_cover_list)

/datum/preference/choiced/synth_head_cover/icon_for(value)
var/datum/sprite_accessory/sprite_accessory = GLOB.synth_head_cover_list[value]
var/icon/head = icon('maplestation_modules/icons/mob/synth_heads.dmi', "synth_head", SOUTH)

var/icon/final_icon = icon(head)

if (!isnull(sprite_accessory))
for(var/side in list("ADJ", "FRONT"))
var/icon/accessory_icon = icon(
icon = 'maplestation_modules/icons/mob/synth_heads.dmi',
icon_state = "m_synth_head_cover_[sprite_accessory.icon_state]_ADJ",
dir = SOUTH,
)
final_icon.Blend(accessory_icon, ICON_OVERLAY)

final_icon.Crop(11, 20, 23, 32)
final_icon.Scale(32, 32)
final_icon.Blend(COLOR_GRAY, ICON_MULTIPLY)

return final_icon

/datum/preference/choiced/synth_head_cover/apply_to_human(mob/living/carbon/human/target, value)
target.dna.features["synth_head_cover"] = value

/datum/preference/choiced/synth_head_cover/create_default_value()
return /datum/sprite_accessory/synth_head_cover::name
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
icon ='maplestation_modules/icons/mob/clothing/underwear.dmi'
gender = NEUTER

/// -- Frills --
/datum/sprite_accessory/frills/big
name = "Big"
icon_state = "big"
Expand All @@ -119,6 +120,19 @@
icon_state = "divinity"
icon = 'maplestation_modules/icons/mob/frills.dmi'

// -- Synth head coverings --
/datum/sprite_accessory/synth_head_cover
icon = 'maplestation_modules/icons/mob/synth_heads.dmi'

/datum/sprite_accessory/synth_head_cover/helm
name = "Helm"
icon_state = "helm"

/datum/sprite_accessory/synth_head_cover/tv_blank
name = "Tv_blank"
icon_state = "tv_blank"


/// --- Socks ---

/datum/sprite_accessory/socks/pokersocks
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// -- Synth additions (though barely functional) --

/// GLOB list of head options
GLOBAL_LIST_EMPTY(synth_head_cover_list)

#define BODYPART_ID_SYNTH "synth"

/mob/living/carbon/human/species/synth
Expand All @@ -15,7 +18,7 @@
/datum/species/synth
name = "Synth"
id = SPECIES_SYNTH
sexes = FALSE
sexes = TRUE
inherent_traits = list(
TRAIT_AGEUSIA,
TRAIT_NOBREATH,
Expand All @@ -38,14 +41,17 @@
BODY_ZONE_R_LEG = /obj/item/bodypart/leg/right/synth,
BODY_ZONE_L_LEG = /obj/item/bodypart/leg/left/synth,
)

external_organs = list(/obj/item/organ/external/synth_head_cover = "Helm")

mutantbrain = /obj/item/organ/internal/brain/cybernetic
mutanttongue = /obj/item/organ/internal/tongue/robot
mutantstomach = /obj/item/organ/internal/stomach/cybernetic/tier2
mutantappendix = null
mutantheart = /obj/item/organ/internal/heart/cybernetic/tier2
mutantliver = /obj/item/organ/internal/liver/cybernetic/tier2
mutantlungs = null
mutanteyes = /obj/item/organ/internal/eyes/robotic
mutanteyes = /obj/item/organ/internal/eyes/robotic/synth
mutantears = /obj/item/organ/internal/ears/cybernetic
species_pain_mod = 0.2
exotic_bloodtype = /datum/blood_type/oil
Expand Down Expand Up @@ -363,8 +369,8 @@

/obj/item/bodypart/head/synth
limb_id = BODYPART_ID_SYNTH
icon_static = 'icons/mob/human/bodyparts.dmi'
icon = 'icons/mob/human/bodyparts.dmi'
icon_static = 'maplestation_modules/icons/mob/synth_heads.dmi'
icon = 'maplestation_modules/icons/mob/synth_heads.dmi'
icon_state = "synth_head"
should_draw_greyscale = FALSE
obj_flags = CONDUCTS_ELECTRICITY
Expand All @@ -373,7 +379,7 @@
brute_modifier = 0.8
burn_modifier = 0.8
biological_state = BIO_ROBOTIC|BIO_BLOODED
head_flags = NONE
head_flags = HEAD_EYESPRITES | HEAD_EYECOLOR
change_exempt_flags = BP_BLOCK_CHANGE_SPECIES

/obj/item/bodypart/chest/synth
Expand Down Expand Up @@ -447,4 +453,91 @@
biological_state = BIO_ROBOTIC|BIO_BLOODED
change_exempt_flags = BP_BLOCK_CHANGE_SPECIES

/obj/item/organ/internal/eyes/robotic/synth
name = "synth eyes"

/obj/item/organ/internal/eyes/robotic/synth/generate_body_overlay(mob/living/carbon/human/parent)
return ..()
Constellado marked this conversation as resolved.
Show resolved Hide resolved



// Organ for synth head covers.

/obj/item/organ/external/synth_head_cover
name = "Head Cover"
desc = "It is a cover that goes on a synth head."

zone = BODY_ZONE_HEAD
slot = ORGAN_SLOT_EXTERNAL_SYNTH_HEAD_COVER

preference = "feature_synth_head_cover"

dna_block = DNA_SYNTH_HEAD_COVER_BLOCK
organ_flags = ORGAN_ROBOTIC

bodypart_overlay = /datum/bodypart_overlay/mutant/synth_head_cover


/obj/item/organ/external/synth_head_cover/on_mob_insert(mob/living/carbon/organ_owner, special, movement_flags)
. = ..()
var/mob/living/carbon/human/robot_target = organ_owner
var/obj/item/bodypart/head/noggin = robot_target.get_bodypart(BODY_ZONE_HEAD)
Constellado marked this conversation as resolved.
Show resolved Hide resolved

noggin.head_flags &= ~HEAD_EYESPRITES


/obj/item/organ/external/synth_head_cover/on_mob_remove(mob/living/carbon/organ_owner, special, movement_flags)
. = ..()
var/mob/living/carbon/human/robot_target = organ_owner
var/obj/item/bodypart/head/noggin = robot_target.get_bodypart(BODY_ZONE_HEAD)
Constellado marked this conversation as resolved.
Show resolved Hide resolved

noggin.head_flags &= HEAD_EYESPRITES


//-- overlay --
/datum/bodypart_overlay/mutant/synth_head_cover/get_global_feature_list()
return GLOB.synth_head_cover_list

/datum/bodypart_overlay/mutant/synth_head_cover/can_draw_on_bodypart(mob/living/carbon/human/human)
if((human.head?.flags_inv & HIDEHAIR) || (human.wear_mask?.flags_inv & HIDEHAIR))
return FALSE
return TRUE

/datum/bodypart_overlay/mutant/synth_head_cover
feature_key = "synth_head_cover"
layers = ALL_EXTERNAL_OVERLAYS

//-- accessories --
//the path to the icon for the head covers
/datum/sprite_accessory/synth_head_cover
icon = 'maplestation_modules/icons/mob/synth_heads.dmi'

//head covers
/datum/sprite_accessory/synth_head_cover/none // for those that don't want a cover.
name = "None"
icon_state = null
Comment on lines +511 to +513
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need an bespoke type for this, I think instead all you need to do is when you make the global list
(init_sprite_accessory_subtypes), you add add_blank = TRUE to the call, and that adds an empty sprite accessory for you

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doing that seems to introduce a bug where the preferences menu shows a head cover applied to the option that is supposed to be blank.
Not sure what that is about so I will hold back on this for now.


//A kind of helmet looking thing with a big black screen/face cover thing. I dunno what else to call this.
/datum/sprite_accessory/synth_head_cover/helm
name = "Helm"
icon_state = "helm"

//helm with white plastic on the sides.
/datum/sprite_accessory/synth_head_cover/helm_white
name = "White Helm"
icon_state = "helm_white"

//just the IPC TV that is already in the code base
/datum/sprite_accessory/synth_head_cover/tv_blank
name = "Tv_blank"
icon_state = "tv_blank"

//a cool design inspired from cloak pilots in titanfall 2, *sorta*.
/datum/sprite_accessory/synth_head_cover/cloakp
name = "Cloakp"
icon_state = "cloakp"

// add more here!!


#undef BODYPART_ID_SYNTH
Binary file added maplestation_modules/icons/mob/synth_heads.dmi
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ export const feature_head_tentacles: FeatureChoiced = {
component: FeatureDropdownInput,
};

export const feature_synth_head_cover: FeatureChoiced = {
name: 'Head Cover',
component: FeatureDropdownInput,
};

export const hair_lizard: FeatureToggle = {
name: 'Hair Lizard',
description: 'Check to spawn as a Lizard with hair.',
Expand Down
Loading