Skip to content

Commit

Permalink
[MIRROR] Fixing the timeline (Paradox clone fixes) (#2782)
Browse files Browse the repository at this point in the history
* Fixing the timeline (Paradox clone fixes)

* Modular updates

---------

Co-authored-by: Lufferly <[email protected]>
Co-authored-by: Mal <[email protected]>
  • Loading branch information
3 people authored and StealsThePRs committed Jun 20, 2024
1 parent b666dca commit 36c63e6
Show file tree
Hide file tree
Showing 14 changed files with 134 additions and 123 deletions.
6 changes: 5 additions & 1 deletion code/__DEFINES/DNA.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@
#define DNA_HAIR_COLOR_BLOCK 6
#define DNA_FACIAL_HAIRSTYLE_BLOCK 7
#define DNA_FACIAL_HAIR_COLOR_BLOCK 8
#define DNA_HAIRSTYLE_GRADIENT_BLOCK 9
#define DNA_HAIR_COLOR_GRADIENT_BLOCK 10
#define DNA_FACIAL_HAIRSTYLE_GRADIENT_BLOCK 11
#define DNA_FACIAL_HAIR_COLOR_GRADIENT_BLOCK 12

#define DNA_UNI_IDENTITY_BLOCKS 8
#define DNA_UNI_IDENTITY_BLOCKS 12

//NOVA EDIT REMOVAL BEGIN - CUSTOMIZATION (moved to modular_nova/modules/customization/_DEFINES/DNA.dm)
/*
Expand Down
2 changes: 0 additions & 2 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,6 @@
//defines for grad_color and grad_styles list access keys
#define GRADIENT_HAIR_KEY 1
#define GRADIENT_FACIAL_HAIR_KEY 2
//Keep up to date with the highest key value
#define GRADIENTS_LEN 2

// /datum/sprite_accessory/gradient defines
#define GRADIENT_APPLIES_TO_HAIR (1<<0)
Expand Down
32 changes: 32 additions & 0 deletions code/datums/dna.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ GLOBAL_LIST_INIT(identity_block_lengths, list(
"[DNA_FACIAL_HAIR_COLOR_BLOCK]" = DNA_BLOCK_SIZE_COLOR,
"[DNA_EYE_COLOR_LEFT_BLOCK]" = DNA_BLOCK_SIZE_COLOR,
"[DNA_EYE_COLOR_RIGHT_BLOCK]" = DNA_BLOCK_SIZE_COLOR,
"[DNA_HAIR_COLOR_GRADIENT_BLOCK]" = DNA_BLOCK_SIZE_COLOR,
"[DNA_FACIAL_HAIR_COLOR_GRADIENT_BLOCK]" = DNA_BLOCK_SIZE_COLOR,
))
/**
Expand Down Expand Up @@ -229,6 +231,10 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
L[DNA_SKIN_TONE_BLOCK] = construct_block(GLOB.skin_tones.Find(H.skin_tone), GLOB.skin_tones.len)
L[DNA_EYE_COLOR_LEFT_BLOCK] = sanitize_hexcolor(H.eye_color_left, include_crunch = FALSE)
L[DNA_EYE_COLOR_RIGHT_BLOCK] = sanitize_hexcolor(H.eye_color_right, include_crunch = FALSE)
L[DNA_HAIRSTYLE_GRADIENT_BLOCK] = construct_block(SSaccessories.hair_gradients_list.Find(H.grad_style[GRADIENT_HAIR_KEY]), length(SSaccessories.hair_gradients_list))
L[DNA_HAIR_COLOR_GRADIENT_BLOCK] = sanitize_hexcolor(H.grad_color[GRADIENT_HAIR_KEY], include_crunch = FALSE)
L[DNA_FACIAL_HAIRSTYLE_GRADIENT_BLOCK] = construct_block(SSaccessories.facial_hair_gradients_list.Find(H.grad_style[GRADIENT_FACIAL_HAIR_KEY]), length(SSaccessories.facial_hair_gradients_list))
L[DNA_FACIAL_HAIR_COLOR_GRADIENT_BLOCK] = sanitize_hexcolor(H.grad_color[GRADIENT_FACIAL_HAIR_KEY], include_crunch = FALSE)

for(var/blocknum in 1 to DNA_UNI_IDENTITY_BLOCKS)
. += L[blocknum] || random_string(GET_UI_BLOCK_LEN(blocknum), GLOB.hex_characters)
Expand Down Expand Up @@ -373,7 +379,19 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
if(DNA_FACIAL_HAIRSTYLE_BLOCK)
set_uni_identity_block(blocknumber, construct_block(GLOB.facial_hairstyles_list.Find(H.facial_hairstyle), GLOB.facial_hairstyles_list.len))
if(DNA_HAIRSTYLE_BLOCK)
<<<<<<< HEAD

Check failure on line 382 in code/datums/dna.dm

View workflow job for this annotation

GitHub Actions / Run Linters

got '<<', expected one of: newline, '/', identifier
set_uni_identity_block(blocknumber, construct_block(GLOB.hairstyles_list.Find(H.hairstyle), GLOB.hairstyles_list.len))
=======
set_uni_identity_block(blocknumber, construct_block(SSaccessories.hairstyles_list.Find(H.hairstyle), length(SSaccessories.hairstyles_list)))
if(DNA_HAIRSTYLE_GRADIENT_BLOCK)
set_uni_identity_block(blocknumber, construct_block(SSaccessories.hair_gradients_list.Find(H.grad_style[GRADIENT_HAIR_KEY]), length(SSaccessories.hair_gradients_list)))
if(DNA_FACIAL_HAIRSTYLE_GRADIENT_BLOCK)
set_uni_identity_block(blocknumber, construct_block(SSaccessories.facial_hair_gradients_list.Find(H.grad_style[GRADIENT_FACIAL_HAIR_KEY]), length(SSaccessories.facial_hair_gradients_list)))
if(DNA_HAIR_COLOR_GRADIENT_BLOCK)
set_uni_identity_block(blocknumber, sanitize_hexcolor(H.grad_color[GRADIENT_HAIR_KEY], include_crunch = FALSE))
if(DNA_FACIAL_HAIR_COLOR_GRADIENT_BLOCK)
set_uni_identity_block(blocknumber, sanitize_hexcolor(H.grad_color[GRADIENT_FACIAL_HAIR_KEY], include_crunch = FALSE))
>>>>>>> a761c4182e7 ([MIRROR] Fixing the timeline (Paradox clone fixes) (#2782))

//NOVA EDIT REMOVAL BEGIN - CUSTOMIZATION (moved to modular_nova/modules/customization/code/datums/dna.dm)
/*
Expand Down Expand Up @@ -700,16 +718,30 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
eye_color_right = sanitize_hexcolor(get_uni_identity_block(structure, DNA_EYE_COLOR_RIGHT_BLOCK))
set_haircolor(sanitize_hexcolor(get_uni_identity_block(structure, DNA_HAIR_COLOR_BLOCK)), update = FALSE)
set_facial_haircolor(sanitize_hexcolor(get_uni_identity_block(structure, DNA_FACIAL_HAIR_COLOR_BLOCK)), update = FALSE)
set_hair_gradient_color(sanitize_hexcolor(get_uni_identity_block(structure, DNA_HAIR_COLOR_GRADIENT_BLOCK)), update = FALSE)
set_facial_hair_gradient_color(sanitize_hexcolor(get_uni_identity_block(structure, DNA_FACIAL_HAIR_COLOR_GRADIENT_BLOCK)), update = FALSE)
if(HAS_TRAIT(src, TRAIT_SHAVED))
set_facial_hairstyle("Shaved", update = FALSE)
else
<<<<<<< HEAD
var/style = GLOB.facial_hairstyles_list[deconstruct_block(get_uni_identity_block(structure, DNA_FACIAL_HAIRSTYLE_BLOCK), GLOB.facial_hairstyles_list.len)]
=======
var/style = SSaccessories.facial_hairstyles_list[deconstruct_block(get_uni_identity_block(structure, DNA_FACIAL_HAIRSTYLE_BLOCK), length(SSaccessories.facial_hairstyles_list))]
var/gradient_style = SSaccessories.facial_hair_gradients_list[deconstruct_block(get_uni_identity_block(structure, DNA_FACIAL_HAIRSTYLE_GRADIENT_BLOCK), length(SSaccessories.facial_hair_gradients_list))]
>>>>>>> a761c4182e7 ([MIRROR] Fixing the timeline (Paradox clone fixes) (#2782))
set_facial_hairstyle(style, update = FALSE)
set_facial_hair_gradient_style(gradient_style, update = FALSE)
if(HAS_TRAIT(src, TRAIT_BALD))
set_hairstyle("Bald", update = FALSE)
else
<<<<<<< HEAD
var/style = GLOB.hairstyles_list[deconstruct_block(get_uni_identity_block(structure, DNA_HAIRSTYLE_BLOCK), GLOB.hairstyles_list.len)]
=======
var/style = SSaccessories.hairstyles_list[deconstruct_block(get_uni_identity_block(structure, DNA_HAIRSTYLE_BLOCK), length(SSaccessories.hairstyles_list))]
var/gradient_style = SSaccessories.hair_gradients_list[deconstruct_block(get_uni_identity_block(structure, DNA_HAIRSTYLE_GRADIENT_BLOCK), length(SSaccessories.hair_gradients_list))]
>>>>>>> a761c4182e7 ([MIRROR] Fixing the timeline (Paradox clone fixes) (#2782))
set_hairstyle(style, update = FALSE)
set_hair_gradient_style(gradient_style, update = FALSE)
var/features = dna.unique_features
if(dna.features["mcolor"])
dna.features["mcolor"] = sanitize_hexcolor(get_uni_feature_block(features, DNA_MUTANT_COLOR_BLOCK))
Expand Down
1 change: 1 addition & 0 deletions code/datums/quirks/neutral_quirks/heretochromatic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
var/was_not_hetero = !human_holder.eye_color_heterochromatic
human_holder.eye_color_heterochromatic = TRUE
human_holder.eye_color_right = color
human_holder.dna.update_ui_block(DNA_EYE_COLOR_RIGHT_BLOCK)

var/obj/item/organ/internal/eyes/eyes_of_the_holder = quirk_holder.get_organ_by_type(/obj/item/organ/internal/eyes)
if(!eyes_of_the_holder)
Expand Down
77 changes: 24 additions & 53 deletions code/modules/antagonists/changeling/changeling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/// The original profile of this changeling.
var/datum/changeling_profile/first_profile = null
/// How many DNA strands the changeling can store for transformation.
var/dna_max = 8 // NOVA EDIT - ORIGINAL: 6
var/dna_max = 6
/// The amount of DNA gained. Includes DNA sting.
var/absorbed_count = 0
/// The amount of DMA gained using absorb, not DNA sting. Start with one (your original DNA)
Expand All @@ -47,9 +47,9 @@
/// Changeling name, what other lings see over the hivemind when talking.
var/changelingID = "Changeling"
/// The number of genetics points (to buy powers) this ling currently has.
var/genetic_points = 15 // NOVA EDIT - ORIGINAL: 10
var/genetic_points = 10
/// The max number of genetics points (to buy powers) this ling can have..
var/total_genetic_points = 15 // NOVA EDIT - ORIGINAL: 10
var/total_genetic_points = 10
/// List of all powers we start with.
var/list/innate_powers = list()
/// Associated list of all powers we have evolved / bought from the emporium. [path] = [instance of path]
Expand Down Expand Up @@ -85,7 +85,7 @@
var/static/list/slot2type = list(
"head" = /obj/item/clothing/head/changeling,
"wear_mask" = /obj/item/clothing/mask/changeling,
"wear_neck" = /obj/item/changeling, // NOVA EDIT
"wear_neck" = /obj/item/changeling,
"back" = /obj/item/changeling,
"wear_suit" = /obj/item/clothing/suit/changeling,
"w_uniform" = /obj/item/clothing/under/changeling,
Expand All @@ -101,32 +101,8 @@
/// A list of all memories we've stolen through absorbs.
var/list/stolen_memories = list()

var/true_form_death //NOVA EDIT ADDITION: The time that the horror form died.

// NOVA EDIT START
var/datum/changeling_profile/current_profile = null
var/list/mimicable_quirks_list = list(
"Bad Touch",
"Sensitive Snout",
"Ash aspect (Emotes)",
"Canidae Traits",
"Excitable!",
"Feline Traits",
"Floral aspect (Emotes)",
"Heterochromatic",
"Hydra Heads",
"Oversized",
"Personal Space",
"Pseudobulbar Affect",
"Shifty Eyes",
"Smooth-Headed",
"Sparkle aspect (Emotes)",
"Water aspect (Emotes)",
"Webbing aspect (Emotes)",
"Friendly",
"Avian Traits",
)
// NOVA EDIT END
/// Keeps track of the currently selected profile.
var/datum/changeling_profile/current_profile

/datum/antagonist/changeling/New()
. = ..()
Expand All @@ -140,6 +116,7 @@
/datum/antagonist/changeling/Destroy()
QDEL_NULL(emporium_action)
QDEL_NULL(cellular_emporium)
current_profile = null
return ..()

/datum/antagonist/changeling/on_gain()
Expand Down Expand Up @@ -557,11 +534,11 @@

// Clothes, of course
new_profile.underwear = target.underwear
new_profile.underwear_color = target.underwear_color
new_profile.undershirt = target.undershirt
new_profile.socks = target.socks
// NOVA EDIT ADDITION START
new_profile.bra = target.bra
new_profile.underwear_color = target.underwear_color
new_profile.undershirt_color = target.undershirt_color
new_profile.socks_color = target.socks_color
new_profile.bra_color = target.bra_color
Expand All @@ -572,6 +549,7 @@
new_profile.laugh_type = target.selected_laugh?.type || /datum/laugh_type/none
//NOVA EDIT ADDITION END

<<<<<<< HEAD
//THE FLUFFY FRONTIER EDIT ADDITION BEGIN - Blooper
new_profile.blooper_id = target.blooper_id
new_profile.blooper_pitch = target.blooper_pitch
Expand All @@ -583,6 +561,8 @@
new_profile.grad_style = LAZYLISTDUPLICATE(target.grad_style)
new_profile.grad_color = LAZYLISTDUPLICATE(target.grad_color)

=======
>>>>>>> a761c4182e7 ([MIRROR] Fixing the timeline (Paradox clone fixes) (#2782))
// Grab skillchips they have
new_profile.skillchips = target.clone_skillchip_list(TRUE)

Expand All @@ -601,7 +581,7 @@
// Grab the target's sechut icon.
new_profile.id_icon = target.wear_id?.get_sechud_job_icon_state()

var/list/slots = list("head", "wear_mask", "wear_neck", "back", "wear_suit", "w_uniform", "shoes", "belt", "gloves", "glasses", "ears", "wear_id", "s_store") // NOVA EDIT
var/list/slots = list("head", "wear_mask", "wear_neck", "back", "wear_suit", "w_uniform", "shoes", "belt", "gloves", "glasses", "ears", "wear_id", "s_store")
for(var/slot in slots)
if(!(slot in target.vars))
continue
Expand Down Expand Up @@ -643,7 +623,7 @@

if(!first_profile)
first_profile = new_profile
current_profile = first_profile // NOVA EDIT
current_profile = first_profile

stored_profiles += new_profile
absorbed_count++
Expand Down Expand Up @@ -794,7 +774,7 @@
var/static/list/slot2slot = list(
"head" = ITEM_SLOT_HEAD,
"wear_mask" = ITEM_SLOT_MASK,
"wear_neck" = ITEM_SLOT_NECK, // NOVA EDIT
"wear_neck" = ITEM_SLOT_NECK,
"back" = ITEM_SLOT_BACK,
"wear_suit" = ITEM_SLOT_OCLOTHING,
"w_uniform" = ITEM_SLOT_ICLOTHING,
Expand All @@ -810,17 +790,16 @@
var/datum/dna/chosen_dna = chosen_profile.dna
user.real_name = chosen_profile.name
user.underwear = chosen_profile.underwear
user.underwear_color = chosen_profile.underwear_color
user.undershirt = chosen_profile.undershirt
user.socks = chosen_profile.socks
user.age = chosen_profile.age
user.physique = chosen_profile.physique
user.mind?.set_level(/datum/skill/athletics, chosen_profile.athletics_level, silent = TRUE)
user.grad_style = LAZYLISTDUPLICATE(chosen_profile.grad_style)
user.grad_color = LAZYLISTDUPLICATE(chosen_profile.grad_color)
user.voice = chosen_profile.voice
user.voice_filter = chosen_profile.voice_filter
// NOVA EDIT ADDITION START
user.bra = chosen_profile.bra

user.underwear_color = chosen_profile.underwear_color
user.undershirt_color = chosen_profile.undershirt_color
user.socks_color = chosen_profile.socks_color
user.bra_color = chosen_profile.bra_color
Expand All @@ -847,15 +826,13 @@
user.add_quirk(target_quirk.type)
break
// NOVA EDIT ADDITION END
user.voice = chosen_profile.voice
user.voice_filter = chosen_profile.voice_filter

chosen_dna.transfer_identity(user, TRUE)

for(var/obj/item/bodypart/limb as anything in user.bodyparts)
limb.update_limb(is_creating = TRUE)

user.updateappearance(mutcolor_update = TRUE, eyeorgancolor_update = TRUE) // NOVA EDIT
user.updateappearance(mutcolor_update = TRUE, eyeorgancolor_update = TRUE) // NOVA EDIT CHANGE - ORIGINAL: user.updateappearance(mutcolor_update = TRUE)
user.domutcheck()

// Get rid of any scars from previous Changeling-ing
Expand Down Expand Up @@ -927,14 +904,13 @@
new_flesh_item.inhand_icon_state = chosen_profile.inhand_icon_state_list[slot]
new_flesh_item.worn_icon = chosen_profile.worn_icon_list[slot]
new_flesh_item.worn_icon_state = chosen_profile.worn_icon_state_list[slot]

// NOVA EDIT START
// NOVA EDIT ADDITION START
new_flesh_item.worn_icon_digi = chosen_profile.worn_icon_digi_list[slot]
new_flesh_item.worn_icon_monkey = chosen_profile.worn_icon_monkey_list[slot]
new_flesh_item.worn_icon_teshari = chosen_profile.worn_icon_teshari_list[slot]
new_flesh_item.worn_icon_vox = chosen_profile.worn_icon_vox_list[slot]
new_flesh_item.supports_variations_flags = chosen_profile.supports_variations_flags_list[slot]
// NOVA EDIT END
// NOVA EDIT ADDITION END

if(istype(new_flesh_item, /obj/item/changeling/id) && chosen_profile.id_icon)
var/obj/item/changeling/id/flesh_id = new_flesh_item
Expand All @@ -958,7 +934,6 @@
user.updateappearance(mutcolor_update = TRUE, eyeorgancolor_update = TRUE)
user.regenerate_icons()
user.name = user.get_visible_name()
current_profile = chosen_profile
// NOVA EDIT END
//THE FLUFFY FRONTIER EDIT ADDITION BEGIN - Blooper
user.blooper = null
Expand Down Expand Up @@ -996,6 +971,8 @@
var/list/worn_icon_state_list = list()
/// The underwear worn by the profile source
var/underwear
/// The colour of the underwear worn by the profile source
var/underwear_color
/// The undershirt worn by the profile source
var/undershirt
/// The socks worn by the profile source
Expand All @@ -1016,19 +993,15 @@
var/athletics_level
/// The quirks of the profile source.
var/list/quirks = list()
/// The hair and facial hair gradient styles of the profile source.
var/list/grad_style = list("None", "None")
/// The hair and facial hair gradient colours of the profile source.
var/list/grad_color = list(null, null)
/// The TTS voice of the profile source
var/voice
/// The TTS filter of the profile filter
var/voice_filter = ""


/datum/changeling_profile/Destroy()
qdel(dna)
LAZYCLEARLIST(stored_scars)
QDEL_LAZYLIST(quirks)
return ..()

/*
Expand All @@ -1048,6 +1021,7 @@
new_profile.righthand_file_list = righthand_file_list.Copy()
new_profile.inhand_icon_state_list = inhand_icon_state_list.Copy()
new_profile.underwear = underwear
new_profile.underwear_color = underwear_color
new_profile.undershirt = undershirt
new_profile.socks = socks
new_profile.worn_icon_list = worn_icon_list.Copy()
Expand All @@ -1060,12 +1034,9 @@
new_profile.physique = physique
new_profile.athletics_level = athletics_level
new_profile.quirks = quirks.Copy()
new_profile.grad_style = LAZYLISTDUPLICATE(grad_style)
new_profile.grad_color = LAZYLISTDUPLICATE(grad_color)
new_profile.voice = voice
new_profile.voice_filter = voice_filter
// NOVA EDIT ADDITION START
new_profile.underwear_color = underwear_color
new_profile.undershirt_color = undershirt_color
new_profile.socks_color = socks_color
new_profile.bra = bra
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@
for(var/datum/quirk/target_quirk as anything in target.quirks)
LAZYADD(quirks, new target_quirk.type)

hair_gradient_style = LAZYLISTDUPLICATE(target.grad_style)
hair_gradient_colours = LAZYLISTDUPLICATE(target.grad_color)

voice = target.voice
voice_filter = target.voice_filter

Expand All @@ -120,8 +117,6 @@
target.real_name = name
target.age = age
target.physique = physique
target.grad_style = LAZYLISTDUPLICATE(hair_gradient_style)
target.grad_color = LAZYLISTDUPLICATE(hair_gradient_colours)
target.voice = voice
target.voice_filter = voice_filter

Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/_job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@
player_client.prefs.read_preference(/datum/preference/choiced/species),
)
dna.update_dna_identity()

updateappearance()

/mob/living/silicon/ai/apply_prefs_job(client/player_client, datum/job/job)
if(GLOB.current_anonymous_theme)
Expand Down
10 changes: 8 additions & 2 deletions code/modules/mob/living/carbon/human/human_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@
var/hairstyle = "Bald"

///Colours used for hair and facial hair gradients.
var/list/grad_color
var/list/grad_color = list(
COLOR_BLACK, //Hair Gradient Color
COLOR_BLACK, //Facial Hair Gradient Color
)
///Styles used for hair and facial hair gradients.
var/list/grad_style
var/list/grad_style = list(
"None", //Hair Gradient Style
"None", //Facial Hair Gradient Style
)

//Facial hair colour and style
var/facial_hair_color = COLOR_BLACK
Expand Down
Loading

0 comments on commit 36c63e6

Please sign in to comment.