From e65e50e8d9f5805621fe4d111f0faee6c8558659 Mon Sep 17 00:00:00 2001 From: coiax Date: Wed, 30 Jan 2019 16:36:20 +0000 Subject: [PATCH] Traumas are copied when a person is cloned (#41852) * Traumas are copied when a person is cloned :cl: coiax add: When a person is cloned, any mental traumas are cloned as well. /:cl: If the cloner is going to recreate your delicate personality, it's going to have to recreate anything wrong with your brain as well. After all, where does one greytider's legitimate fear of security end, and another one's irrational fear begin? Essentially, traumas could be easily gotten rid of by cloning, or death would rob a person of a rare positive trauma. Now you're stuck with them until you get rid of them. * Suggested changes --- code/datums/brain_damage/brain_trauma.dm | 5 +++++ code/datums/brain_damage/phobia.dm | 5 +++++ code/game/machinery/cloning.dm | 9 +++++++-- code/game/machinery/computer/cloning.dm | 18 ++++++++++-------- code/modules/clothing/head/misc_special.dm | 1 + 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/code/datums/brain_damage/brain_trauma.dm b/code/datums/brain_damage/brain_trauma.dm index 083c5735bfb..0fc12d8c7df 100644 --- a/code/datums/brain_damage/brain_trauma.dm +++ b/code/datums/brain_damage/brain_trauma.dm @@ -14,6 +14,7 @@ var/can_gain = TRUE var/random_gain = TRUE //can this be gained through random traumas? var/resilience = TRAUMA_RESILIENCE_BASIC //how hard is this to cure? + var/clonable = TRUE // will this transfer if the brain is cloned? /datum/brain_trauma/Destroy() if(brain && brain.traumas) @@ -24,6 +25,10 @@ owner = null return ..() +/datum/brain_trauma/proc/on_clone() + if(clonable) + return new type + //Called on life ticks /datum/brain_trauma/proc/on_life() return diff --git a/code/datums/brain_damage/phobia.dm b/code/datums/brain_damage/phobia.dm index 3979a0a5a2e..4c9bfbe4620 100644 --- a/code/datums/brain_damage/phobia.dm +++ b/code/datums/brain_damage/phobia.dm @@ -31,6 +31,11 @@ trigger_species = SStraumas.phobia_species[phobia_type] ..() + +/datum/brain_trauma/mild/phobia/on_clone() + if(clonable) + return new type(phobia_type) + /datum/brain_trauma/mild/phobia/on_life() ..() if(owner.has_trait(TRAIT_FEARLESS)) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 06d813c02ed..1c6b8e41be3 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -137,7 +137,7 @@ return examine(user) //Start growing a human clone in the pod! -/obj/machinery/clonepod/proc/growclone(clonename, ui, mutation_index, mindref, last_death, datum/species/mrace, list/features, factions, list/quirks, datum/bank_account/insurance) +/obj/machinery/clonepod/proc/growclone(clonename, ui, mutation_index, mindref, last_death, datum/species/mrace, list/features, factions, list/quirks, datum/bank_account/insurance, list/traumas) if(panel_open) return NONE if(mess || attempting) @@ -218,6 +218,12 @@ var/datum/quirk/Q = new V(H) Q.on_clone(quirks[V]) + for(var/t in traumas) + var/datum/brain_trauma/BT = t + var/datum/brain_trauma/cloned_trauma = BT.on_clone() + if(cloned_trauma) + H.gain_trauma(cloned_trauma, BT.resilience) + H.set_cloned_appearance() H.set_suicide(FALSE) @@ -388,7 +394,6 @@ mob_occupant.remove_trait(TRAIT_NOCRITDAMAGE, CLONING_POD_TRAIT) mob_occupant.remove_trait(TRAIT_NOBREATH, CLONING_POD_TRAIT) - if(grab_ghost_when == CLONER_MATURE_CLONE) mob_occupant.grab_ghost() to_chat(occupant, "There is a bright flash!
You feel like a new being.
") diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 5997787e0d3..2fe01b45906 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -63,7 +63,7 @@ . = pod /proc/grow_clone_from_record(obj/machinery/clonepod/pod, datum/data/record/R) - return pod.growclone(R.fields["name"], R.fields["UI"], R.fields["SE"], R.fields["mind"], R.fields["last_death"], R.fields["mrace"], R.fields["features"], R.fields["factions"], R.fields["quirks"], R.fields["bank_account"]) + return pod.growclone(R.fields["name"], R.fields["UI"], R.fields["SE"], R.fields["mind"], R.fields["last_death"], R.fields["mrace"], R.fields["features"], R.fields["factions"], R.fields["quirks"], R.fields["bank_account"], R.fields["traumas"]) /obj/machinery/computer/cloning/process() if(!(scanner && LAZYLEN(pods) && autoprocess)) @@ -474,7 +474,7 @@ else if(pod.occupant) temp = "Cloning cycle already in progress." playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) - else + else var/result = grow_clone_from_record(pod, C) if(result & CLONING_SUCCESS) temp = "[C.fields["name"]] => Cloning cycle in progress..." @@ -488,7 +488,7 @@ active_record = null menu = 1 records -= C - + if(!success) temp = "[C.fields["name"]] => Initialisation failure." playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) @@ -567,11 +567,17 @@ R.fields["features"] = dna.features R.fields["factions"] = mob_occupant.faction R.fields["quirks"] = list() - R.fields["bank_account"] = has_bank_account for(var/V in mob_occupant.roundstart_quirks) var/datum/quirk/T = V R.fields["quirks"][T.type] = T.clone_data() + R.fields["traumas"] = list() + if(ishuman(mob_occupant)) + R.fields["traumas"] = C.get_traumas() + if(isbrain(mob_occupant)) + R.fields["traumas"] = B.get_traumas() + + R.fields["bank_account"] = has_bank_account R.fields["mind"] = "[REF(mob_occupant.mind)]" R.fields["last_death"] = mob_occupant.stat == DEAD ? mob_occupant.mind.last_death : -1 @@ -588,7 +594,3 @@ if(old_record) records -= old_record scantemp = "Record updated." - else - scantemp = "Subject successfully scanned." - records += R - playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 9ef883be4cc..763e707b79d 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -244,6 +244,7 @@ if(paranoia) QDEL_NULL(paranoia) paranoia = new() + paranoia.clonable = FALSE user.gain_trauma(paranoia, TRAUMA_RESILIENCE_MAGIC) to_chat(user, "As you don the foiled hat, an entire world of conspiracy theories and seemingly insane ideas suddenly rush into your mind. What you once thought unbelievable suddenly seems.. undeniable. Everything is connected and nothing happens just by accident. You know too much and now they're out to get you. ")