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-02 20:55:13 -07:00
committed by GitHub
parent 1a3a77d42c
commit 3e46e525da
8 changed files with 32 additions and 15 deletions
@@ -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 ..()