Changelings now update their flavor text upon transforming. Updates DNA to include flavor text. (#26094)

* Fixes https://github.com/ParadiseSS13/Paradise/issues/3352

* bleugh
This commit is contained in:
Spaghetti-bit
2024-07-03 03:55:13 +00:00
committed by GitHub
parent 1a3a77d42c
commit 3e46e525da
8 changed files with 32 additions and 15 deletions
+19 -8
View File
@@ -23,9 +23,12 @@ GLOBAL_LIST_EMPTY(bad_blocks)
/datum/dna
// READ-ONLY, GETS OVERWRITTEN
// DO NOT FUCK WITH THESE OR BYOND WILL EAT YOUR FACE
var/uni_identity = "" // Encoded UI
var/struc_enzymes = "" // Encoded SE
var/unique_enzymes = "" // MD5 of player name
/// Encoded UI
var/uni_identity = ""
/// Encoded SE
var/struc_enzymes = ""
/// MD5 of player name
var/unique_enzymes = ""
// Original Encoded SE, for use with Ryetalin
var/struc_enzymes_original = "" // Encoded SE
@@ -41,11 +44,16 @@ GLOBAL_LIST_EMPTY(bad_blocks)
var/list/UI[DNA_UI_LENGTH]
// From old dna.
var/blood_type = "A+" // Should probably change to an integer => string map but I'm lazy.
var/real_name // Stores the real name of the person who originally got this dna datum. Used primarily for changelings,
var/datum/species/species = new /datum/species/human //The type of mutant race the player is if applicable (i.e. potato-man)
var/list/default_blocks = list() //list of all blocks toggled at roundstart
/// The blood type of the mob.
var/blood_type = "A+"
/// Stores the real name of the person who originally got this dna datum. Used primarily for changelings,
var/real_name
/// The type of mutant race the player is if applicable (i.e. potato-man)
var/datum/species/species = new /datum/species/human
/// list of all blocks toggled at roundstart
var/list/default_blocks = list()
/// The flavor text of the person. We store this here for polymorph and changelings.
var/flavor_text
// Make a copy of this strand.
// USE THIS WHEN COPYING STUFF OR YOU'LL GET CORRUPTION!
@@ -57,6 +65,7 @@ GLOBAL_LIST_EMPTY(bad_blocks)
new_dna.blood_type = blood_type
new_dna.real_name = real_name
new_dna.species = new species.type
new_dna.flavor_text = flavor_text
for(var/b = 1; b <= DNA_SE_LENGTH; b++)
new_dna.SE[b]=SE[b]
@@ -439,6 +448,7 @@ GLOBAL_LIST_EMPTY(bad_blocks)
// Because old DNA coders were insane or something
data["blood_type"] = blood_type
data["real_name"] = real_name
data["flavor_text"] = flavor_text
return data
/datum/dna/deserialize(data)
@@ -452,6 +462,7 @@ GLOBAL_LIST_EMPTY(bad_blocks)
species = new S
blood_type = data["blood_type"]
real_name = data["real_name"]
flavor_text = data["flavor_text"]
/datum/dna/proc/transfer_identity(mob/living/carbon/human/destination)
if(!istype(destination))
@@ -123,6 +123,7 @@
H.real_name = team_name + " Agent"
H.cleanSE() //No fat/blind/colourblind/epileptic/whatever ayys.
H.overeatduration = 0
H.dna.flavor_text = null
H.flavor_text = null
H.equipOutfit(/datum/outfit/abductor/agent)
greet_agent(agent,team_number)
@@ -140,6 +141,7 @@
H.real_name = team_name + " Scientist"
H.cleanSE() //No fat/blind/colourblind/epileptic/whatever ayys.
H.overeatduration = 0
H.dna.flavor_text = null
H.flavor_text = null
H.equipOutfit(/datum/outfit/abductor/scientist)
greet_scientist(scientist,team_number)
+2 -1
View File
@@ -164,11 +164,12 @@
var/mob/living/carbon/human/M = synd_mind.current
M.set_species(/datum/species/human, TRUE)
M.dna.flavor_text = null
M.flavor_text = null
M.dna.ready_dna(M) // Quadriplegic Nuke Ops won't be participating in the paralympics
M.dna.species.create_organs(M)
M.cleanSE() //No fat/blind/colourblind/epileptic/whatever ops.
M.overeatduration = 0
M.flavor_text = null
var/obj/item/organ/external/head/head_organ = M.get_organ("head")
var/hair_c = pick("#8B4513","#000000","#FF4500","#FFD700") // Brown, black, red, blonde
+1 -1
View File
@@ -313,7 +313,7 @@
/obj/machinery/clonepod/proc/create_clone()
clone = new /mob/living/carbon/human(src, patient_data.genetic_info.species.type)
clone.change_dna(patient_data.genetic_info, FALSE, TRUE)
clone.change_dna(patient_data.genetic_info, FALSE)
for(var/obj/item/organ/external/limb in clone.bodyparts)
if(!(limb.limb_name in limbs_to_grow)) //if the limb was determined to be vital
@@ -1909,6 +1909,7 @@
character.change_eye_color(e_colour, skip_icons = TRUE)
character.original_eye_color = e_colour
character.dna.flavor_text = flavor_text
if(disabilities & DISABILITY_FLAG_FAT)
character.dna.SetSEState(GLOB.fatblock, TRUE, TRUE)
@@ -1004,16 +1004,16 @@
dna.real_name = name
return name
/mob/living/carbon/human/proc/change_dna(datum/dna/new_dna, include_species_change = FALSE, keep_flavor_text = FALSE)
/mob/living/carbon/human/proc/change_dna(datum/dna/new_dna, include_species_change = FALSE)
if(include_species_change)
set_species(new_dna.species.type, retain_damage = TRUE, transformation = TRUE, keep_missing_bodyparts = TRUE)
dna = new_dna.Clone()
if(include_species_change) //We have to call this after new_dna.Clone() so that species actions don't get overwritten
dna.species.on_species_gain(src)
real_name = new_dna.real_name
if(dna.flavor_text)
flavor_text = dna.flavor_text
domutcheck(src, MUTCHK_FORCED) //Ensures species that get powers by the species proc handle_dna keep them
if(!keep_flavor_text)
flavor_text = ""
dna.UpdateSE()
dna.UpdateUI()
sync_organ_dna(TRUE)
+3 -1
View File
@@ -767,11 +767,13 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
to_chat(usr, "<span class='notice'>You have to be conscious to change your flavor text</span>")
return
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
if(dna)
dna.flavor_text = msg // Only carbon mobs have DNA.
flavor_text = msg
/mob/proc/print_flavor_text(shrink = TRUE)
if(flavor_text && flavor_text != "")
var/msg = replacetext(flavor_text, "\n", " ")
var/msg = !dna.flavor_text ? replacetext(dna.flavor_text, "\n", " ") : replacetext(flavor_text, "\n", " ")
if(length(msg) <= 40 || !shrink)
return "<span class='notice'>[msg]</span>" // There is already encoded by tgui_input
else
@@ -227,7 +227,7 @@
var/mob/living/carbon/human/H = M
var/datum/dna/D = data["dna"]
if(!D.species.is_small)
H.change_dna(D, TRUE, TRUE)
H.change_dna(D, TRUE)
return ..()