[MIRROR] People can be cloned from heads or brains (#919)
* People can be cloned from heads or brains * .rej fixes * Update cloning.dm
This commit is contained in:
committed by
Poojawa
parent
f957d20e09
commit
33941c29c8
@@ -1399,3 +1399,20 @@ GLOBAL_PROTECT(valid_HTTPSGet)
|
||||
|
||||
/proc/pass()
|
||||
return
|
||||
|
||||
/proc/get_mob_or_brainmob(occupant)
|
||||
var/mob/living/mob_occupant
|
||||
|
||||
if(isliving(occupant))
|
||||
mob_occupant = occupant
|
||||
|
||||
else if(isbodypart(occupant))
|
||||
var/obj/item/bodypart/head/head = occupant
|
||||
|
||||
mob_occupant = head.brainmob
|
||||
|
||||
else if(isorgan(occupant))
|
||||
var/obj/item/organ/brain/brain = occupant
|
||||
mob_occupant = brain.brainmob
|
||||
|
||||
return mob_occupant
|
||||
|
||||
+504
-499
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,3 @@
|
||||
|
||||
/obj/machinery/computer/cloning
|
||||
name = "cloning console"
|
||||
desc = "Used to clone people and manage DNA."
|
||||
@@ -61,7 +60,7 @@
|
||||
return
|
||||
|
||||
if(scanner.occupant && scanner.scan_level > 2)
|
||||
scan_mob(scanner.occupant)
|
||||
scan_occupant(scanner.occupant)
|
||||
|
||||
for(var/datum/data/record/R in records)
|
||||
var/obj/machinery/clonepod/pod = GetAvailableEfficientPod(R.fields["mind"])
|
||||
@@ -185,8 +184,7 @@
|
||||
|
||||
// Scanner
|
||||
if (!isnull(src.scanner))
|
||||
|
||||
var/mob/living/scanner_occupant = scanner.occupant
|
||||
var/mob/living/scanner_occupant = get_mob_or_brainmob(scanner.occupant)
|
||||
|
||||
dat += "<h3>Scanner Functions</h3>"
|
||||
|
||||
@@ -303,7 +301,7 @@
|
||||
say("Initiating scan...")
|
||||
|
||||
spawn(20)
|
||||
src.scan_mob(scanner.occupant)
|
||||
src.scan_occupant(scanner.occupant)
|
||||
|
||||
loading = 0
|
||||
src.updateUsrDialog()
|
||||
@@ -435,64 +433,70 @@
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/cloning/proc/scan_mob(mob/living/carbon/human/subject)
|
||||
if (!istype(subject))
|
||||
/obj/machinery/computer/cloning/proc/scan_occupant(occupant)
|
||||
var/mob/living/mob_occupant = get_mob_or_brainmob(occupant)
|
||||
var/datum/dna/dna
|
||||
if(iscarbon(mob_occupant))
|
||||
var/mob/living/carbon/C = mob_occupant
|
||||
dna = C.has_dna()
|
||||
if(istype(mob_occupant, /mob/living/brain))
|
||||
var/mob/living/brain/B = mob_occupant
|
||||
dna = B.stored_dna
|
||||
|
||||
if(!istype(dna))
|
||||
scantemp = "<font class='bad'>Unable to locate valid genetic data.</font>"
|
||||
playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
|
||||
return
|
||||
if (!subject.getorgan(/obj/item/organ/brain))
|
||||
scantemp = "<font class='bad'>No signs of intelligence detected.</font>"
|
||||
playsound(src, 'sound/machines/terminal_alert.ogg', 50, 0)
|
||||
return
|
||||
if (subject.suiciding == 1 || subject.hellbound)
|
||||
if(mob_occupant.suiciding || mob_occupant.hellbound)
|
||||
scantemp = "<font class='bad'>Subject's brain is not responding to scanning stimuli.</font>"
|
||||
playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
|
||||
return
|
||||
if ((subject.disabilities & NOCLONE) && (src.scanner.scan_level < 2))
|
||||
if((mob_occupant.disabilities & NOCLONE) && (src.scanner.scan_level < 2))
|
||||
scantemp = "<font class='bad'>Subject no longer contains the fundamental materials required to create a living clone.</font>"
|
||||
playsound(src, 'sound/machines/terminal_alert.ogg', 50, 0)
|
||||
return
|
||||
if ((!subject.ckey) || (!subject.client))
|
||||
if ((!mob_occupant.ckey) || (!mob_occupant.client))
|
||||
scantemp = "<font class='bad'>Mental interface failure.</font>"
|
||||
playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
|
||||
return
|
||||
if (find_record("ckey", subject.ckey, records))
|
||||
if (find_record("ckey", mob_occupant.ckey, records))
|
||||
scantemp = "<font class='average'>Subject already in database.</font>"
|
||||
playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
|
||||
return
|
||||
|
||||
var/datum/data/record/R = new()
|
||||
if(subject.dna.species)
|
||||
if(dna.species)
|
||||
// We store the instance rather than the path, because some
|
||||
// species (abductors, slimepeople) store state in their
|
||||
// species datums
|
||||
R.fields["mrace"] = subject.dna.species
|
||||
R.fields["mrace"] = dna.species
|
||||
else
|
||||
var/datum/species/rando_race = pick(config.roundstart_races)
|
||||
R.fields["mrace"] = rando_race.type
|
||||
R.fields["ckey"] = subject.ckey
|
||||
R.fields["name"] = subject.real_name
|
||||
R.fields["id"] = copytext(md5(subject.real_name), 2, 6)
|
||||
R.fields["UE"] = subject.dna.unique_enzymes
|
||||
R.fields["UI"] = subject.dna.uni_identity
|
||||
R.fields["SE"] = subject.dna.struc_enzymes
|
||||
R.fields["blood_type"] = subject.dna.blood_type
|
||||
R.fields["features"] = subject.dna.features
|
||||
R.fields["factions"] = subject.faction
|
||||
|
||||
//Add an implant if needed
|
||||
R.fields["ckey"] = mob_occupant.ckey
|
||||
R.fields["name"] = mob_occupant.real_name
|
||||
R.fields["id"] = copytext(md5(mob_occupant.real_name), 2, 6)
|
||||
R.fields["UE"] = dna.unique_enzymes
|
||||
R.fields["UI"] = dna.uni_identity
|
||||
R.fields["SE"] = dna.struc_enzymes
|
||||
R.fields["blood_type"] = dna.blood_type
|
||||
R.fields["features"] = dna.features
|
||||
R.fields["factions"] = mob_occupant.faction
|
||||
|
||||
if (!isnull(mob_occupant.mind)) //Save that mind so traitors can continue traitoring after cloning.
|
||||
R.fields["mind"] = "\ref[mob_occupant.mind]"
|
||||
|
||||
//Add an implant if needed
|
||||
var/obj/item/weapon/implant/health/imp
|
||||
for(var/obj/item/weapon/implant/health/HI in subject.implants)
|
||||
for(var/obj/item/weapon/implant/health/HI in mob_occupant.implants)
|
||||
imp = HI
|
||||
break
|
||||
if(!imp)
|
||||
imp = new /obj/item/weapon/implant/health(subject)
|
||||
imp.implant(subject)
|
||||
imp = new /obj/item/weapon/implant/health(mob_occupant)
|
||||
imp.implant(mob_occupant)
|
||||
R.fields["imp"] = "\ref[imp]"
|
||||
|
||||
if (!isnull(subject.mind)) //Save that mind so traitors can continue traitoring after cloning.
|
||||
R.fields["mind"] = "\ref[subject.mind]"
|
||||
|
||||
src.records += R
|
||||
scantemp = "Subject successfully scanned."
|
||||
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
use_power = 1
|
||||
idle_power_usage = 50
|
||||
active_power_usage = 300
|
||||
occupant_typecache = list(/mob/living, /obj/item/bodypart/head, /obj/item/organ/brain)
|
||||
var/damage_coeff
|
||||
var/scan_level
|
||||
var/precision_coeff
|
||||
@@ -98,6 +99,13 @@
|
||||
|
||||
open_machine()
|
||||
|
||||
/obj/machinery/dna_scannernew/proc/locate_computer(type_)
|
||||
for(dir in list(NORTH,EAST,SOUTH,WEST))
|
||||
var/C = locate(type_, get_step(src, dir))
|
||||
if(C)
|
||||
return C
|
||||
return null
|
||||
|
||||
/obj/machinery/dna_scannernew/close_machine()
|
||||
if(!state_open)
|
||||
return 0
|
||||
@@ -105,22 +113,19 @@
|
||||
..()
|
||||
|
||||
// search for ghosts, if the corpse is empty and the scanner is connected to a cloner
|
||||
var/mob/living/mob_occupant = occupant
|
||||
if(mob_occupant)
|
||||
if(locate(/obj/machinery/computer/cloning, get_step(src, NORTH)) \
|
||||
|| locate(/obj/machinery/computer/cloning, get_step(src, SOUTH)) \
|
||||
|| locate(/obj/machinery/computer/cloning, get_step(src, EAST)) \
|
||||
|| locate(/obj/machinery/computer/cloning, get_step(src, WEST)))
|
||||
var/mob/living/mob_occupant = get_mob_or_brainmob(occupant)
|
||||
if(istype(mob_occupant))
|
||||
if(locate_computer(/obj/machinery/computer/cloning))
|
||||
if(!mob_occupant.suiciding && !(mob_occupant.disabilities & NOCLONE) && !mob_occupant.hellbound)
|
||||
mob_occupant.notify_ghost_cloning("Your corpse has been placed into a cloning scanner. Re-enter your corpse if you want to be cloned!", source = src)
|
||||
|
||||
var/obj/machinery/computer/scan_consolenew/console
|
||||
for(dir in list(NORTH,EAST,SOUTH,WEST))
|
||||
console = locate(/obj/machinery/computer/scan_consolenew, get_step(src, dir))
|
||||
if(console)
|
||||
console.on_scanner_close()
|
||||
break
|
||||
return 1
|
||||
// DNA manipulators cannot operate on severed heads or brains
|
||||
if(isliving(occupant))
|
||||
var/obj/machinery/computer/scan_consolenew/console = locate_computer(/obj/machinery/computer/scan_consolenew)
|
||||
if(console)
|
||||
console.on_scanner_close()
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/dna_scannernew/open_machine()
|
||||
if(state_open)
|
||||
@@ -158,4 +163,4 @@
|
||||
if(..(user,1,0)) //don't set the machine, since there's no dialog
|
||||
return
|
||||
|
||||
toggle_open(user)
|
||||
toggle_open(user)
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
/mob/living/brain
|
||||
var/obj/item/device/mmi/container = null
|
||||
var/timeofhostdeath = 0
|
||||
|
||||
Reference in New Issue
Block a user