diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 343c8ab2db1..b79934974c8 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -33,7 +33,6 @@ icon = 'icons/obj/cloning.dmi' icon_state = "pod_0" req_access = list(access_genetics) //For premature unlocking. - var/mob/living/occupant var/heal_level = 20 //The clone is released once its health reaches this level. var/heal_rate = 1 @@ -57,8 +56,10 @@ component_parts += new /obj/item/stack/cable_coil(src, 2) RefreshParts() + update_icon() /obj/machinery/clonepod/attack_ai(mob/user as mob) + add_hiddenprint(user) return attack_hand(user) @@ -77,6 +78,7 @@ if(mess || attempting) return 0 var/datum/mind/clonemind = locate(R.mind) + if(!istype(clonemind, /datum/mind)) //not a mind return 0 if(clonemind.current && clonemind.current.stat != DEAD) //mind is associated with a non-dead body @@ -106,7 +108,6 @@ R.dna.real_name = "clone ([rand(0,999)])" H.real_name = R.dna.real_name - icon_state = "pod_1" //Get the clone body ready H.adjustCloneLoss(150) // New damage var so you can't eject a clone early then stab them to abuse the current damage system --NeoFite H.adjustBrainLoss(80) // Even if healed to full health, it will have some brain damage @@ -148,6 +149,7 @@ H.dna.UpdateUI() H.set_cloned_appearance() + update_icon() for(var/datum/language/L in R.languages) H.add_language(L.name) @@ -209,9 +211,6 @@ occupant = null if(locked) locked = 0 - if(!mess) - icon_state = "pod_0" - //use_power(200) return return @@ -256,7 +255,7 @@ else if(anchored) anchored = 0 - connected.pod1 = null + connected.pods -= src connected = null else anchored = 1 @@ -265,6 +264,11 @@ user.visible_message("[user] secures [src] to the floor.", "You secure [src] to the floor.") else user.visible_message("[user] unsecures [src] from the floor.", "You unsecure [src] from the floor.") + else if(istype(W, /obj/item/device/multitool)) + var/obj/item/device/multitool/M = W + M.connecting = src + user << "You load connection data from [src] to [M]." + return else ..() @@ -275,7 +279,7 @@ if(!message) return 0 - connected.temp = message + connected.temp = "[name] : [message]" connected.updateUsrDialog() return 1 @@ -311,41 +315,29 @@ if(mess) //Clean that mess and dump those gibs! mess = 0 gibs(loc) - icon_state = "pod_0" - - /* - for(var/obj/O in src) - O.loc = loc - */ + update_icon() return if(!(occupant)) return - /* - for(var/obj/O in src) - O.loc = loc - */ - if(occupant.client) occupant.client.eye = occupant.client.mob occupant.client.perspective = MOB_PERSPECTIVE occupant.loc = loc - icon_state = "pod_0" eject_wait = 0 //If it's still set somehow. domutcheck(occupant) //Waiting until they're out before possible monkeyizing. -// occupant.add_side_effect("Bad Stomach") // Give them an extra side-effect for free. occupant = null biomass -= CLONE_BIOMASS - + update_icon() return /obj/machinery/clonepod/proc/malfunction() if(occupant) connected_message("Critical Error!") mess = 1 - icon_state = "pod_g" + update_icon() occupant.ghostize() spawn(5) del(occupant) @@ -387,6 +379,14 @@ else return +/obj/machinery/clonepod/update_icon() + ..() + icon_state = "pod_0" + if (occupant && !(stat & NOPOWER)) + icon_state = "pod_1" + else if (mess) + icon_state = "pod_g" + //Health Tracker Implant /obj/item/weapon/implant/health diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 484f39df250..b0317ed855d 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -5,7 +5,7 @@ circuit = "/obj/item/weapon/circuitboard/cloning" req_access = list(access_heads) //Only used for record deletion right now. var/obj/machinery/dna_scannernew/scanner = null //Linked scanner. For scanning. - var/obj/machinery/clonepod/pod1 = null //Linked cloning pod. + var/list/pods = list() //Linked cloning pods. var/temp = "" var/scantemp = "Scanner unoccupied" var/menu = 1 //Which menu screen to display @@ -23,38 +23,35 @@ /obj/machinery/computer/cloning/proc/updatemodules() src.scanner = findscanner() - src.pod1 = findcloner() - - if (!isnull(src.pod1)) - src.pod1.connected = src // Some variable the pod needs + findcloner() + var/num = 1 + for (var/obj/machinery/clonepod/pod in pods) + pod.connected = src + pod.name = "[initial(pod.name)] #[num++]" /obj/machinery/computer/cloning/proc/findscanner() var/obj/machinery/dna_scannernew/scannerf = null - // Loop through every direction + //Try to find scanner on adjacent tiles first for(dir in list(NORTH,EAST,SOUTH,WEST)) - - // Try to find a scanner in that direction scannerf = locate(/obj/machinery/dna_scannernew, get_step(src, dir)) + if (scannerf) + return scannerf - // If found, then we break, and return the scanner - if (!isnull(scannerf)) - break + //Then look for a free one in the area + if(!scannerf) + for(var/obj/machinery/dna_scannernew/S in get_area(src)) + return S - // If no scanner was found, it will return null - return scannerf + return /obj/machinery/computer/cloning/proc/findcloner() - var/obj/machinery/clonepod/podf = null + pods.Cut() + for(var/obj/machinery/clonepod/P in get_area(src)) + if(!P.connected) + pods += P - for(dir in list(NORTH,EAST,SOUTH,WEST)) - - podf = locate(/obj/machinery/clonepod, get_step(src, dir)) - - if (!isnull(podf)) - break - - return podf + return /obj/machinery/computer/cloning/attackby(obj/item/W as obj, mob/user as mob) if (istype(W, /obj/item/weapon/disk/data)) //INSERT SOME DISKETTES @@ -65,6 +62,14 @@ user << "You insert [W]." src.updateUsrDialog() return + else if(istype(W, /obj/item/device/multitool)) + var/obj/item/device/multitool/M = W + var/obj/machinery/clonepod/P = M.connecting + if(P && !(P in pods)) + pods += P + P.connected = src + P.name = "[initial(P.name)] #[pods.len]" + user << "You connect [P] to [src]." else ..() return @@ -92,13 +97,13 @@ dat += "