Skip to content

Commit

Permalink
New Synth Customisation Options (#500)
Browse files Browse the repository at this point in the history
  • Loading branch information
Constellado authored Jul 8, 2024
1 parent 6c652fe commit 697ef4c
Show file tree
Hide file tree
Showing 10 changed files with 168 additions and 6 deletions.
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 @@ -107,6 +107,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 @@ -256,6 +256,7 @@
icon ='maplestation_modules/icons/mob/clothing/underwear.dmi'
gender = NEUTER

/// -- Frills --
/datum/sprite_accessory/frills/big
name = "Big"
icon_state = "big"
Expand All @@ -266,6 +267,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,86 @@
biological_state = BIO_ROBOTIC|BIO_BLOODED
change_exempt_flags = BP_BLOCK_CHANGE_SPECIES

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

// 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)

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)

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

//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

0 comments on commit 697ef4c

Please sign in to comment.