From 6df90c09e3585a1d8dec7c73a69e391922e5b1f8 Mon Sep 17 00:00:00 2001 From: Mechoid Date: Wed, 24 Jan 2018 16:19:32 -0800 Subject: [PATCH] Allows Prometheans to be cloned from their Core. (#4602) * Allows Prometheans to be cloned from their Core. * Swap brain cloning dependency from the cloner to the brain itself. * Fffffff Changelog. And to_chat. --- code/game/dna/dna_modifier.dm | 33 ++++++++++++++++--- code/game/machinery/cloning.dm | 7 ++-- code/game/machinery/computer/cloning.dm | 14 +++++--- code/modules/mob/_modifiers/cloning.dm | 22 +++++++++++-- .../living/carbon/human/species/species.dm | 1 + .../human/species/station/prometheans.dm | 2 ++ code/modules/organs/internal/brain.dm | 5 +++ html/changelogs/Mechoid-PrometheanCloning.yml | 11 +++++++ 8 files changed, 82 insertions(+), 13 deletions(-) create mode 100644 html/changelogs/Mechoid-PrometheanCloning.yml diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index 0dc9b72be7..dfb9d37147 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -126,7 +126,7 @@ /obj/machinery/dna_scannernew/attackby(var/obj/item/weapon/item as obj, var/mob/user as mob) if(istype(item, /obj/item/weapon/reagent_containers/glass)) if(beaker) - user << "A beaker is already loaded into the machine." + to_chat(user, "A beaker is already loaded into the machine.") return beaker = item @@ -134,16 +134,32 @@ item.loc = src user.visible_message("\The [user] adds \a [item] to \the [src]!", "You add \a [item] to \the [src]!") return + + else if(istype(item, /obj/item/organ/internal/brain)) + if (src.occupant) + to_chat(user, "The scanner is already occupied!") + return + var/obj/item/organ/internal/brain/brain = item + if(brain.clone_source) + user.drop_item() + brain.loc = src + put_in(brain.brainmob) + src.add_fingerprint(user) + user.visible_message("\The [user] adds \a [item] to \the [src]!", "You add \a [item] to \the [src]!") + return + else + to_chat(user,"\The [brain] is not acceptable for genetic sampling!") + else if (!istype(item, /obj/item/weapon/grab)) return var/obj/item/weapon/grab/G = item if (!ismob(G.affecting)) return if (src.occupant) - user << "The scanner is already occupied!" + to_chat(user, "The scanner is already occupied!") return if (G.affecting.abiotic()) - user << "The subject cannot have abiotic items on." + to_chat(user, "The subject cannot have abiotic items on.") return put_in(G.affecting) src.add_fingerprint(user) @@ -167,7 +183,7 @@ if(!M.client && M.mind) for(var/mob/observer/dead/ghost in player_list) if(ghost.mind == M.mind) - ghost << "Your corpse has been placed into a cloning scanner. Return to your body if you want to be resurrected/cloned! (Verbs -> Ghost -> Re-enter corpse)" + to_chat(ghost, "Your corpse has been placed into a cloning scanner. Return to your body if you want to be resurrected/cloned! (Verbs -> Ghost -> Re-enter corpse)") break return @@ -177,7 +193,14 @@ if (src.occupant.client) src.occupant.client.eye = src.occupant.client.mob src.occupant.client.perspective = MOB_PERSPECTIVE - src.occupant.loc = src.loc + if(istype(occupant,/mob/living/carbon/brain)) + for(var/obj/O in src) + if(istype(O,/obj/item/organ/internal/brain)) + O.loc = get_turf(src) + src.occupant.loc = O + break + else + src.occupant.loc = src.loc src.occupant = null src.icon_state = "scanner_0" return diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 9bed646bc5..4e1d015033 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -153,7 +153,7 @@ modifier_lower_bound = round(modifier_lower_bound * clone_sickness_length, 1) modifier_upper_bound = round(modifier_upper_bound * clone_sickness_length, 1) - H.add_modifier(/datum/modifier/cloning_sickness, rand(modifier_lower_bound, modifier_upper_bound)) + H.add_modifier(H.species.cloning_modifier, rand(modifier_lower_bound, modifier_upper_bound)) // Modifier that doesn't do anything. H.add_modifier(/datum/modifier/cloned) @@ -342,7 +342,10 @@ occupant.client.perspective = MOB_PERSPECTIVE occupant.loc = src.loc eject_wait = 0 //If it's still set somehow. - domutcheck(occupant) //Waiting until they're out before possible transforming. + if(ishuman(occupant)) //Need to be safe. + var/mob/living/carbon/human/patient = occupant + if(!(patient.species.flags & NO_SCAN)) //If, for some reason, someone makes a genetically-unalterable clone, let's not make them permanently disabled. + domutcheck(occupant) //Waiting until they're out before possible transforming. occupant = null biomass -= CLONE_BIOMASS diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 0bd354b541..1e08ea6df2 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -289,10 +289,13 @@ add_fingerprint(usr) /obj/machinery/computer/cloning/proc/scan_mob(mob/living/carbon/human/subject as mob) - if ((isnull(subject)) || (!(ishuman(subject))) || (!subject.dna)) + var/brain_skip = 0 + if (istype(subject, /mob/living/carbon/brain)) //Brain scans. + brain_skip = 1 + if ((isnull(subject)) || (!(ishuman(subject)) && !brain_skip) || (!subject.dna)) scantemp = "Error: Unable to locate valid genetic data." return - if (!subject.has_brain()) + if (!subject.has_brain() && !brain_skip) if(istype(subject, /mob/living/carbon/human)) var/mob/living/carbon/human/H = subject if(H.should_have_organ("brain")) @@ -313,7 +316,7 @@ if (NOCLONE in subject.mutations) scantemp = "Error: Mental interface failure." return - if (subject.species && subject.species.flags & NO_SCAN) + if (subject.species && subject.species.flags & NO_SCAN && !brain_skip) scantemp = "Error: Mental interface failure." return for(var/modifier_type in subject.modifiers) //Can't be cloned, even if they had a previous scan @@ -333,7 +336,10 @@ R.name = R.dna.real_name R.types = DNA2_BUF_UI|DNA2_BUF_UE|DNA2_BUF_SE R.languages = subject.languages - R.flavor = subject.flavor_texts.Copy() + if(!brain_skip) //Brains don't have flavor text. + R.flavor = subject.flavor_texts.Copy() + else + R.flavor = list() for(var/datum/modifier/mod in subject.modifiers) if(mod.flags & MODIFIER_GENETIC) R.genetic_modifiers.Add(mod.type) diff --git a/code/modules/mob/_modifiers/cloning.dm b/code/modules/mob/_modifiers/cloning.dm index 661f957475..a5e8e5e2ba 100644 --- a/code/modules/mob/_modifiers/cloning.dm +++ b/code/modules/mob/_modifiers/cloning.dm @@ -39,7 +39,25 @@ // Prevents borging (specifically the MMI part), actual effect is on the MMI. /datum/modifier/no_borg - name = "Cyboernetic Incompatability" + name = "Cybernetic Incompatability" desc = "For whatever reason, your brain is incompatable with direct cybernetic interfaces, such as the MMI." - flags = MODIFIER_GENETIC \ No newline at end of file + flags = MODIFIER_GENETIC + +////////////////////////////////////// +//Species-Specific Cloning Modifiers// +///////////////////////////////////// + +/datum/modifier/cloning_sickness/promethean + name = "reformation sickness" + desc = "Your core feels damaged, as you were reformed with the improper machinery." + + on_created_text = "Your core aches." + on_expired_text = "You feel your core's strength returning to normal." + + incoming_damage_percent = 1 //Level the incoming damage from the parent modifier. They already take 200% burn. + incoming_brute_damage_percent = 1.5 //150% incoming brute damage. Decreases the effectiveness of their 0.75 modifier. + incoming_hal_damage_percent = 1.25 //125% incoming halloss. + + outgoing_melee_damage_percent = 0.5 //50% less outgoing melee damage. + attack_speed_percent = 1.2 //20% slower attack speed. diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 4174613765..f442897783 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -91,6 +91,7 @@ var/death_sound var/death_message = "seizes up and falls limp, their eyes dead and lifeless..." var/knockout_message = "has been knocked unconscious!" + var/cloning_modifier = /datum/modifier/cloning_sickness // Environment tolerance/life processes vars. var/reagent_tag //Used for metabolizing reagents. diff --git a/code/modules/mob/living/carbon/human/species/station/prometheans.dm b/code/modules/mob/living/carbon/human/species/station/prometheans.dm index 5201047761..3704b2f912 100644 --- a/code/modules/mob/living/carbon/human/species/station/prometheans.dm +++ b/code/modules/mob/living/carbon/human/species/station/prometheans.dm @@ -44,6 +44,8 @@ var/datum/species/shapeshifter/promethean/prometheans burn_mod = 2 oxy_mod = 0 + cloning_modifier = /datum/modifier/cloning_sickness/promethean + cold_level_1 = 280 //Default 260 - Lower is better cold_level_2 = 220 //Default 200 cold_level_3 = 130 //Default 120 diff --git a/code/modules/organs/internal/brain.dm b/code/modules/organs/internal/brain.dm index 7dd2bd948e..2019ca9c4a 100644 --- a/code/modules/organs/internal/brain.dm +++ b/code/modules/organs/internal/brain.dm @@ -13,6 +13,7 @@ throw_range = 5 origin_tech = list(TECH_BIO = 3) attack_verb = list("attacked", "slapped", "whacked") + var/clone_source = FALSE var/mob/living/carbon/brain/brainmob = null /obj/item/organ/internal/brain/robotize() @@ -133,6 +134,10 @@ icon = 'icons/mob/slimes.dmi' icon_state = "green slime extract" parent_organ = BP_TORSO + clone_source = TRUE + +/obj/item/orgam/internal/brain/slime/is_open_container() + return 1 /obj/item/organ/internal/brain/golem name = "chem" diff --git a/html/changelogs/Mechoid-PrometheanCloning.yml b/html/changelogs/Mechoid-PrometheanCloning.yml new file mode 100644 index 0000000000..cbc5887a64 --- /dev/null +++ b/html/changelogs/Mechoid-PrometheanCloning.yml @@ -0,0 +1,11 @@ + +author: Mechoid + +delete-after: True + +changes: + - rscadd: "Brains can be set to be a source of genetic information." + - rscadd: "Promethean cores can be inserted into a cloning scanner to be cloned. This gives them a worse modifier upon completion." + - rscadd: "Promethean cores can now have chemicals added or removed from them. Base for future slime cloner." + - rscadd: "Species-based cloning sicknesses possible." + - spellcheck: "Cyboernetic - > Cybernetic"