From 7872eeafc1aeb9fb363b62536dac914fcb414427 Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Thu, 5 Jan 2012 21:50:20 -0700 Subject: [PATCH] Cloning now works right from any and all consoles. Make the mail management less buggy and more robust. --- code/game/machinery/cloning.dm | 20 ++-- code/modules/recycling/sortingmachinery.dm | 114 ++++++++++++++++----- 2 files changed, 99 insertions(+), 35 deletions(-) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 6572ca08817..426d77202b0 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -1,3 +1,4 @@ +/var/list/geneticsrecords = list() //Cloning revival method. //The pod handles the actual cloning while the computer manages the clone profiles @@ -34,6 +35,8 @@ var/obj/item/weapon/disk/data/diskette = null //Mostly so the geneticist can steal everything. var/wantsscan = 1 var/wantspod = 1 + var/poddir = 8 //Which dir relative to the computer it is in. + var/scandir = 8 //The return of data disks?? Just for transferring between genetics machine/cloning machine. //TO-DO: Make the genetics machine accept them. @@ -65,10 +68,8 @@ /obj/machinery/computer/cloning/New() ..() spawn(5) - src.scanner = locate(/obj/machinery/dna_scannernew, get_step(src, WEST)) -// src.scanner = locate(/obj/machinery/dna_scannernew, get_step(src, EAST)) -// src.pod1 = locate(/obj/machinery/clonepod, get_step(src, EAST)) - src.pod1 = locate(/obj/machinery/clonepod, get_step(src, WEST)) + src.scanner = locate(/obj/machinery/dna_scannernew, get_step(src, scandir)) + src.pod1 = locate(/obj/machinery/clonepod, get_step(src, poddir)) src.temp = "" if (isnull(src.scanner) && wantsscan) @@ -138,7 +139,7 @@ if(2) dat += "

Current records

" dat += "Back

" - for(var/datum/data/record/R in src.records) + for(var/datum/data/record/R in geneticsrecords) dat += "[R.fields["id"]]-[R.fields["name"]]
" if(3) @@ -220,7 +221,7 @@ var/obj/item/weapon/card/id/C = usr.equipped() if (istype(C)||istype(C, /obj/item/device/pda)) if(src.check_access(C)) - src.records.Remove(src.active_record) + geneticsrecords.Remove(src.active_record) del(src.active_record) src.temp = "Record deleted." src.menu = 2 @@ -290,7 +291,7 @@ src.temp = "Unable to initiate cloning cycle." // most helpful error message in THE HISTORY OF THE WORLD else if (src.pod1.growclone(selected, C.fields["name"], C.fields["UI"], C.fields["SE"], C.fields["mind"], C.fields["mrace"], C.fields["interface"],C.fields["changeling"])) src.temp = "Cloning cycle activated." - src.records.Remove(C) + geneticsrecords.Remove(C) del(C) src.menu = 1 @@ -350,14 +351,13 @@ if (!isnull(subject.mind)) //Save that mind so traitors can continue traitoring after cloning. R.fields["mind"] = "\ref[subject.mind]" - for(var/obj/machinery/computer/cloning/F in world) - F.records += R + geneticsrecords += R //Save it to the global scan list. src.temp = "Subject successfully scanned." //Find a specific record by key. /obj/machinery/computer/cloning/proc/find_record(var/find_key) var/selected_record = null - for(var/datum/data/record/R in src.records) + for(var/datum/data/record/R in geneticsrecords) if (R.fields["ckey"] == find_key) selected_record = R break diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 543db2e97eb..2422e24c41c 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -8,6 +8,7 @@ var/sortTag = null flags = FPRINT mouse_drag_pointer = MOUSE_ACTIVE_POINTER + var/examtext = null attack_hand(mob/user as mob) @@ -25,17 +26,37 @@ user << "\blue *TAGGED*" src.sortTag = O.currTag else if(istype(W, /obj/item/weapon/pen)) - var/str = input(usr,"Label text?","Set label","") - if(!str || !length(str)) - usr << "\red Invalid text." - return - if(length(str) > 64) - usr << "\red Text too long." - return - var/label = str - for(var/mob/M in viewers()) - M << "\blue [user] labels [src] as [label]." - src.name = "[src.name] ([label])" + switch(alert("What would you like to alter?",,"Title","Description", "Cancel")) + if("Title") + var/str = input(usr,"Label text?","Set label","") + if(!str || !length(str)) + usr << "\red Invalid text." + return + if(length(str) > 64) + usr << "\red Text too long." + return + var/label = str + for(var/mob/M in viewers()) + M << "\blue [user] labels [src] as [label]." + src.name = "[src.name] ([label])" + if("Description") + var/str = input(usr,"Label text?","Set label","") + if(!str || !length(str)) + usr << "\red Invalid text." + return + if(length(str) > 64) + usr << "\red Text too long." + return + examtext = str + for(var/mob/M in viewers()) + M << "\blue [user] labels [src] with the note: [examtext]." + return + + examine() + set src in oview(4) + if(examtext) + usr << examtext + ..() return /obj/item/smallDelivery @@ -46,6 +67,7 @@ var/obj/item/wrapped = null var/sortTag = null flags = FPRINT + var/examtext = null attack_self(mob/user) @@ -61,17 +83,37 @@ user << "\blue *TAGGED*" src.sortTag = O.currTag else if(istype(W, /obj/item/weapon/pen)) - var/str = input(usr,"Label text?","Set label","") - if(!str || !length(str)) - usr << "\red Invalid text." - return - if(length(str) > 64) - usr << "\red Text too long." - return - var/label = str - for(var/mob/M in viewers()) - M << "\blue [user] labels [src] as [label]." - src.name = "[src.name] ([label])" + switch(alert("What would you like to alter?",,"Title","Description", "Cancel")) + if("Title") + var/str = input(usr,"Label text?","Set label","") + if(!str || !length(str)) + usr << "\red Invalid text." + return + if(length(str) > 64) + usr << "\red Text too long." + return + var/label = str + for(var/mob/M in viewers()) + M << "\blue [user] labels [src] as [label]." + src.name = "[src.name] ([label])" + if("Description") + var/str = input(usr,"Label text?","Set label","") + if(!str || !length(str)) + usr << "\red Invalid text." + return + if(length(str) > 64) + usr << "\red Text too long." + return + examtext = str + for(var/mob/M in viewers()) + M << "\blue [user] labels [src] with the note: [examtext]." + return + + examine() + set src in oview(4) + if(examtext) + usr << examtext + ..() return @@ -80,7 +122,7 @@ name = "package wrapper" icon = 'items.dmi' icon_state = "deliveryPaper" - w_class = 4.0 + w_class = 3.0 var/amount = 25.0 @@ -89,9 +131,19 @@ user.attack_log += text("\[[time_stamp()]\] Has used [src.name] on \ref[target]") if (istype(target, /obj/item)) + if(istype(target,/obj/item/weapon/storage) || istype(target,/obj/item/clothing/suit/storage/)) //Put it into the bag + return + var/obj/item/temptrgt = target + if(istype(temptrgt.loc,/obj/item/weapon/storage) || istype(temptrgt.loc,/obj/item/clothing/suit/storage/)) //Taking stuff out of storage duplicates it. + user << "\blue Do not do this, it is broken as all hell. Take it out of the container first." + return + for(var/obj/item/T in user) //Lets remove it from their inventory + if(T == src) + user.remove_from_mob(target) + break var/obj/item/O = target if (src.amount > 1) - var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(get_turf(O.loc)) + var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(get_turf(O.loc)) //Aaannd wrap it up! P.wrapped = O O.loc = P src.amount -= 1 @@ -110,9 +162,11 @@ var/obj/effect/bigDelivery/P = new /obj/effect/bigDelivery(get_turf(O.loc)) P.wrapped = O O.close() - O.welded = 1 +// O.welded = 1 //You should be able to burst out of the package, now. (maybe) O.loc = P src.amount -= 3 + else + user << "\blue You need more paper." else user << "\blue The object you are trying to wrap is unsuitable for the sorting machinery!" @@ -123,6 +177,12 @@ return return + examine() + set src in usr + usr << "\blue There are [amount] units of package wrap left!" + ..() + return + /obj/item/device/destTagger name = "destination tagger" desc = "Used to set the destination of properly wrapped packages." @@ -252,4 +312,8 @@ var/mob/living/M = A HasEntered(M) return 0 + if(istype(A, /obj)) // You Shall Not Pass! + var/obj/M = A + HasEntered(M) + return 1 return 1