Skip to content

Commit

Permalink
Fixes being able to clone brains with short telomeres (#22283)
Browse files Browse the repository at this point in the history
  • Loading branch information
Moltijoe committed Jul 5, 2024
1 parent c60d538 commit 6225db7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
23 changes: 22 additions & 1 deletion code/datums/traits/negative.dm
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,6 @@
desc = "Due to hundreds of cloning cycles, your DNA's telomeres are dangerously shortened. Your DNA can't support cloning without expensive DNA restructuring, and what's worse- you work for Nanotrasen."
icon = "magnifying-glass-minus"
value = -2
mob_trait = TRAIT_SHORT_TELOMERES
medical_record_text = "DNA analysis indicates that the patient's DNA telomeres are artificially shortened from previous cloner usage."

/datum/quirk/telomeres_short/check_quirk(datum/preferences/prefs)
Expand All @@ -836,6 +835,28 @@
return "Your species cannot be cloned!"
return FALSE

//we apply it directly to the dna so it carries over to the brain mob if someone tries to clone the brain
/datum/quirk/telomeres_short/New(mob/living/quirk_mob, spawn_effects, no_init)
. = ..()
var/datum/dna/holder = quirk_holder?.has_dna()
if(holder)
holder.features |= TRAIT_SHORT_TELOMERES

/datum/quirk/telomeres_short/Destroy()
. = ..()
var/datum/dna/holder = quirk_holder?.has_dna()
if(holder)
holder.features -= TRAIT_SHORT_TELOMERES

/datum/quirk/telomeres_short/transfer_mob(mob/living/to_mob)
. = ..()
var/datum/dna/holder = quirk_holder?.has_dna()
if(holder)
holder.features -= TRAIT_SHORT_TELOMERES
holder = to_mob?.has_dna()
if(holder)
holder.features |= TRAIT_SHORT_TELOMERES

/datum/quirk/body_purist
name = "Body Purist"
desc = "You believe your body is a temple and its natural form is an embodiment of perfection. Accordingly, you despise the idea of ever augmenting it with unnatural parts, cybernetic, prosthetic, or anything like it."
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/cloning.dm
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@
playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
return

if(HAS_TRAIT(mob_occupant,TRAIT_SHORT_TELOMERES))
if(TRAIT_SHORT_TELOMERES in dna.features)
say("Error: Scan indicates occupant's DNA telomeres are too short to properly scan. Aborting.")
return

Expand Down

0 comments on commit 6225db7

Please sign in to comment.