Revert "12/21 modernizations from TG live"
This commit is contained in:
@@ -22,8 +22,8 @@ operations to skip that console. This is useful if you want to make a "public" R
|
||||
a circuit imprinter with certain designs on it and don't want it accidentally updating. The downside of this method is that you have
|
||||
to have physical access to the other console to send data back. Note: An R&D console is on Centcom so if a random griffan happens to
|
||||
cause a ton of data to be lost, an admin can go send it back.
|
||||
- The second method is with Technology Disks and Design Disks. Each of these disks can hold technology or design datums in
|
||||
their entirety. You can then take the disk to any R&D console and upload it's data to it. This method is a lot more secure (since it
|
||||
- The second method is with Technology Disks and Design Disks. Each of these disks can hold a single technology or design datum in
|
||||
it's entirety. You can then take the disk to any R&D console and upload it's data to it. This method is a lot more secure (since it
|
||||
won't update every console in existence) but it's more of a hassle to do. Also, the disks can be stolen.
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
icon_screen = "rdcomp"
|
||||
icon_keyboard = "rd_key"
|
||||
circuit = /obj/item/weapon/circuitboard/computer/rdconsole
|
||||
light_color = LIGHT_COLOR_PINK
|
||||
var/datum/research/files //Stores all the collected research data.
|
||||
var/obj/item/weapon/disk/tech_disk/t_disk = null //Stores the technology disk.
|
||||
var/obj/item/weapon/disk/design_disk/d_disk = null //Stores the design disk.
|
||||
@@ -51,7 +52,6 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
|
||||
var/selected_category
|
||||
var/list/datum/design/matching_designs = list() //for the search function
|
||||
var/disk_slot_selected = 0
|
||||
|
||||
|
||||
/proc/CallTechName(ID) //A simple helper proc to find the name of a tech with a given ID.
|
||||
@@ -122,10 +122,8 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
user << "A disk is already loaded into the machine."
|
||||
return
|
||||
|
||||
if(istype(D, /obj/item/weapon/disk/tech_disk))
|
||||
t_disk = D
|
||||
else if (istype(D, /obj/item/weapon/disk/design_disk))
|
||||
d_disk = D
|
||||
if(istype(D, /obj/item/weapon/disk/tech_disk)) t_disk = D
|
||||
else if (istype(D, /obj/item/weapon/disk/design_disk)) d_disk = D
|
||||
else
|
||||
user << "<span class='danger'>Machine cannot accept disks in that format.</span>"
|
||||
return
|
||||
@@ -138,7 +136,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
updateUsrDialog()
|
||||
|
||||
|
||||
/obj/machinery/computer/rdconsole/on_deconstruction()
|
||||
/obj/machinery/computer/rdconsole/deconstruction()
|
||||
if(linked_destroy)
|
||||
linked_destroy.linked_console = null
|
||||
linked_destroy = null
|
||||
@@ -164,9 +162,6 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
add_fingerprint(usr)
|
||||
|
||||
usr.set_machine(src)
|
||||
if(href_list["disk_slot"])
|
||||
disk_slot_selected = text2num(href_list["disk_slot"])
|
||||
|
||||
if(href_list["menu"]) //Switches menu screens. Converts a sent text string into a number. Saves a LOT of code.
|
||||
var/temp_screen = text2num(href_list["menu"])
|
||||
screen = temp_screen
|
||||
@@ -175,34 +170,16 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
selected_category = href_list["category"]
|
||||
|
||||
else if(href_list["updt_tech"]) //Update the research holder with information from the technology disk.
|
||||
var/n = text2num(href_list["updt_tech"])
|
||||
screen = 0.0
|
||||
var/wait = 50
|
||||
if(!n)
|
||||
wait = 0
|
||||
for(var/D in t_disk.tech_stored)
|
||||
if(D)
|
||||
wait += 50
|
||||
spawn(wait)
|
||||
spawn(50)
|
||||
screen = 1.2
|
||||
if(t_disk)
|
||||
if(!n)
|
||||
for(var/tech in t_disk.tech_stored)
|
||||
if(tech)
|
||||
files.AddTech2Known(tech)
|
||||
else
|
||||
files.AddTech2Known(t_disk.tech_stored[n])
|
||||
updateUsrDialog()
|
||||
griefProtection() //Update centcom too
|
||||
files.AddTech2Known(t_disk.stored)
|
||||
updateUsrDialog()
|
||||
griefProtection() //Update centcom too
|
||||
|
||||
else if(href_list["clear_tech"]) //Erase data on the technology disk.
|
||||
if(t_disk)
|
||||
var/n = text2num(href_list["clear_tech"])
|
||||
if(!n)
|
||||
for(var/i in 1 to t_disk.max_tech_stored)
|
||||
t_disk.tech_stored[i] = null
|
||||
else
|
||||
t_disk.tech_stored[n] = null
|
||||
t_disk.stored = null
|
||||
|
||||
else if(href_list["eject_tech"]) //Eject the technology disk.
|
||||
if(t_disk)
|
||||
@@ -211,39 +188,20 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
screen = 1.0
|
||||
|
||||
else if(href_list["copy_tech"]) //Copy some technology data from the research holder to the disk.
|
||||
var/slot = text2num(href_list["copy_tech"])
|
||||
t_disk.tech_stored[slot] = files.known_tech[href_list["copy_tech_ID"]]
|
||||
t_disk.stored = files.known_tech[href_list["copy_tech_ID"]]
|
||||
screen = 1.2
|
||||
|
||||
else if(href_list["updt_design"]) //Updates the research holder with design data from the design disk.
|
||||
var/n = text2num(href_list["updt_design"])
|
||||
screen = 0.0
|
||||
var/wait = 50
|
||||
if(!n)
|
||||
wait = 0
|
||||
for(var/D in d_disk.blueprints)
|
||||
if(D)
|
||||
wait += 50
|
||||
spawn(wait)
|
||||
spawn(50)
|
||||
screen = 1.4
|
||||
if(d_disk)
|
||||
if(!n)
|
||||
for(var/D in d_disk.blueprints)
|
||||
if(D)
|
||||
files.AddDesign2Known(D)
|
||||
else
|
||||
files.AddDesign2Known(d_disk.blueprints[n])
|
||||
updateUsrDialog()
|
||||
griefProtection() //Update centcom too
|
||||
files.AddDesign2Known(d_disk.blueprint)
|
||||
updateUsrDialog()
|
||||
griefProtection() //Update centcom too
|
||||
|
||||
else if(href_list["clear_design"]) //Erases data on the design disk.
|
||||
if(d_disk)
|
||||
var/n = text2num(href_list["clear_design"])
|
||||
if(!n)
|
||||
for(var/i in 1 to d_disk.max_blueprints)
|
||||
d_disk.blueprints[i] = null
|
||||
else
|
||||
d_disk.blueprints[n] = null
|
||||
d_disk.blueprint = null
|
||||
|
||||
else if(href_list["eject_design"]) //Eject the design disk.
|
||||
if(d_disk)
|
||||
@@ -252,11 +210,10 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
screen = 1.0
|
||||
|
||||
else if(href_list["copy_design"]) //Copy design data from the research holder to the design disk.
|
||||
var/slot = text2num(href_list["copy_design"])
|
||||
var/datum/design/D = files.known_designs[href_list["copy_design_ID"]]
|
||||
if(D)
|
||||
var/autolathe_friendly = 1
|
||||
if(D.reagents_list.len)
|
||||
if(D.reagents.len)
|
||||
autolathe_friendly = 0
|
||||
D.category -= "Imported"
|
||||
else
|
||||
@@ -268,7 +225,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
if(D.build_type & (AUTOLATHE|PROTOLATHE|CRAFTLATHE)) // Specifically excludes circuit imprinter and mechfab
|
||||
D.build_type = autolathe_friendly ? (D.build_type | AUTOLATHE) : D.build_type
|
||||
D.category |= "Imported"
|
||||
d_disk.blueprints[slot] = D
|
||||
d_disk.blueprint = D
|
||||
screen = 1.4
|
||||
|
||||
else if(href_list["eject_item"]) //Eject the item inside the destructive analyzer.
|
||||
@@ -277,7 +234,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
usr << "<span class='danger'>The destructive analyzer is busy at the moment.</span>"
|
||||
|
||||
else if(linked_destroy.loaded_item)
|
||||
linked_destroy.loaded_item.forceMove(linked_destroy.loc)
|
||||
linked_destroy.loaded_item.loc = linked_destroy.loc
|
||||
linked_destroy.loaded_item = null
|
||||
linked_destroy.icon_state = "d_analyzer"
|
||||
screen = 1.0
|
||||
@@ -385,9 +342,6 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
var/datum/design/being_built = files.known_designs[href_list["build"]]
|
||||
var/amount = text2num(href_list["amount"])
|
||||
|
||||
if(being_built.make_reagents.len)
|
||||
return 0
|
||||
|
||||
if(!linked_lathe || !being_built || !amount)
|
||||
updateUsrDialog()
|
||||
return
|
||||
@@ -426,21 +380,18 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
enough_materials = 0
|
||||
g2g = 0
|
||||
else
|
||||
for(var/R in being_built.reagents_list)
|
||||
if(!linked_lathe.reagents.has_reagent(R, being_built.reagents_list[R]*coeff))
|
||||
for(var/R in being_built.reagents)
|
||||
if(!linked_lathe.reagents.has_reagent(R, being_built.reagents[R]*coeff))
|
||||
linked_lathe.say("Not enough reagents to complete prototype.")
|
||||
enough_materials = 0
|
||||
g2g = 0
|
||||
|
||||
if(enough_materials)
|
||||
linked_lathe.materials.use_amount(efficient_mats, amount)
|
||||
for(var/R in being_built.reagents_list)
|
||||
linked_lathe.reagents.remove_reagent(R, being_built.reagents_list[R]*coeff)
|
||||
for(var/R in being_built.reagents)
|
||||
linked_lathe.reagents.remove_reagent(R, being_built.reagents[R]*coeff)
|
||||
|
||||
var/P = being_built.build_path //lets save these values before the spawn() just in case. Nobody likes runtimes.
|
||||
|
||||
coeff *= being_built.lathe_time_factor
|
||||
|
||||
spawn(32*coeff*amount**0.8)
|
||||
if(linked_lathe)
|
||||
if(g2g) //And if we only fail the material requirements, we still spend time and power
|
||||
@@ -502,16 +453,16 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
enough_materials = 0
|
||||
g2g = 0
|
||||
else
|
||||
for(var/R in being_built.reagents_list)
|
||||
if(!linked_imprinter.reagents.has_reagent(R, being_built.reagents_list[R]/coeff))
|
||||
for(var/R in being_built.reagents)
|
||||
if(!linked_imprinter.reagents.has_reagent(R, being_built.reagents[R]/coeff))
|
||||
linked_imprinter.say("Not enough reagents to complete prototype.")
|
||||
enough_materials = 0
|
||||
g2g = 0
|
||||
|
||||
if(enough_materials)
|
||||
linked_imprinter.materials.use_amount(efficient_mats)
|
||||
for(var/R in being_built.reagents_list)
|
||||
linked_imprinter.reagents.remove_reagent(R, being_built.reagents_list[R]/coeff)
|
||||
for(var/R in being_built.reagents)
|
||||
linked_imprinter.reagents.remove_reagent(R, being_built.reagents[R]/coeff)
|
||||
|
||||
var/P = being_built.build_path //lets save these values before the spawn() just in case. Nobody likes runtimes.
|
||||
spawn(16)
|
||||
@@ -571,7 +522,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
else if(href_list["reset"]) //Reset the R&D console's database.
|
||||
griefProtection()
|
||||
var/choice = alert("R&D Console Database Reset", "Are you sure you want to reset the R&D console's database? Data lost cannot be recovered.", "Continue", "Cancel")
|
||||
if(choice == "Continue" && usr.canUseTopic(src))
|
||||
if(choice == "Continue")
|
||||
message_admins("[key_name_admin(usr)] reset \the [src.name]'s database")
|
||||
log_game("[key_name_admin(usr)] reset \the [src.name]'s database")
|
||||
screen = 0.0
|
||||
@@ -689,19 +640,22 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
dat += "</div>"
|
||||
|
||||
if(1.2) //Technology Disk Menu
|
||||
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A><HR>"
|
||||
dat += "Disk Operations: <A href='?src=\ref[src];clear_tech=0'>Clear Disk</A><A href='?src=\ref[src];updt_tech=0'>Upload All</A><A href='?src=\ref[src];eject_tech=1'>Eject Disk</A>"
|
||||
for(var/i in 1 to t_disk.max_tech_stored)
|
||||
dat += "<div class='statusDisplay'>"
|
||||
if(t_disk.tech_stored[i])
|
||||
var/datum/tech/tech = t_disk.tech_stored[i]
|
||||
dat += "Name: [tech.name]<BR>"
|
||||
dat += "Level: [tech.level]<BR>"
|
||||
dat += "Description: [tech.desc]<BR>"
|
||||
dat += "Operations: <A href='?src=\ref[src];updt_tech=[i]'>Upload to Database</A><A href='?src=\ref[src];clear_tech=[i]'>Clear Slot</A>"
|
||||
else
|
||||
dat += "Empty Slot<BR>Operations: <A href='?src=\ref[src];menu=1.3;disk_slot=[i]'>Load Tech to Slot</A>"
|
||||
dat += "</div>"
|
||||
dat += "<div class='statusDisplay'>Technology Data Disk Contents:<BR><BR>"
|
||||
if(t_disk.stored == null)
|
||||
dat += "The disk has no data stored on it.</div>"
|
||||
dat += "Operations: "
|
||||
dat += "<A href='?src=\ref[src];menu=1.3'>Load Tech to Disk</A>"
|
||||
else
|
||||
dat += "Name: [t_disk.stored.name]<BR>"
|
||||
dat += "Level: [t_disk.stored.level]<BR>"
|
||||
dat += "Description: [t_disk.stored.desc]</div>"
|
||||
dat += "Operations: "
|
||||
dat += "<A href='?src=\ref[src];updt_tech=1'>Upload to Database</A>"
|
||||
dat += "<A href='?src=\ref[src];clear_tech=1'>Clear Disk</A>"
|
||||
dat += "<A href='?src=\ref[src];eject_tech=1'>Eject Disk</A>"
|
||||
|
||||
if(1.3) //Technology Disk submenu
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.2'>Return to Disk Operations</A><div class='statusDisplay'>"
|
||||
@@ -710,41 +664,42 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
var/datum/tech/T = files.known_tech[v]
|
||||
if(T.level <= 0)
|
||||
continue
|
||||
dat += "[T.name]"
|
||||
dat += "<A href='?src=\ref[src];copy_tech=[disk_slot_selected];copy_tech_ID=[T.id]'>Copy to Disk</A><BR>"
|
||||
dat += "[T.name] "
|
||||
dat += "<A href='?src=\ref[src];copy_tech=1;copy_tech_ID=[T.id]'>Copy to Disk</A><BR>"
|
||||
dat += "</div>"
|
||||
|
||||
if(1.4) //Design Disk menu.
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A><HR>"
|
||||
dat += "Disk Operations: <A href='?src=\ref[src];clear_design=0'>Clear Disk</A><A href='?src=\ref[src];updt_design=0'>Upload All</A><A href='?src=\ref[src];eject_design=1'>Eject Disk</A>"
|
||||
for(var/i in 1 to d_disk.max_blueprints)
|
||||
dat += "<div class='statusDisplay'>"
|
||||
if(d_disk.blueprints[i])
|
||||
var/datum/design/D = d_disk.blueprints[i]
|
||||
dat += "Name: [D.name]<BR>"
|
||||
if(D.build_type)
|
||||
dat += "Lathe Types:<BR>"
|
||||
if(D.build_type & IMPRINTER) dat += "Circuit Imprinter<BR>"
|
||||
if(D.build_type & PROTOLATHE) dat += "Protolathe<BR>"
|
||||
if(D.build_type & AUTOLATHE) dat += "Autolathe<BR>"
|
||||
if(D.build_type & MECHFAB) dat += "Exosuit Fabricator<BR>"
|
||||
if(D.build_type & BIOGENERATOR) dat += "Biogenerator<BR>"
|
||||
dat += "Required Materials:<BR>"
|
||||
var/all_mats = D.materials + D.reagents_list
|
||||
for(var/M in all_mats)
|
||||
dat += "* [CallMaterialName(M)] x [all_mats[M]]<BR>"
|
||||
dat += "Operations: <A href='?src=\ref[src];updt_design=[i]'>Upload to Database</A> <A href='?src=\ref[src];clear_design=[i]'>Clear Slot</A>"
|
||||
else
|
||||
dat += "Empty Slot<BR>Operations: <A href='?src=\ref[src];menu=1.5;disk_slot=[i]'>Load Design to Slot</A>"
|
||||
dat += "</div>"
|
||||
if(1.5) //Design disk submenu
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A><div class='statusDisplay'>"
|
||||
if(d_disk.blueprint == null)
|
||||
dat += "The disk has no data stored on it.</div>"
|
||||
dat += "Operations: "
|
||||
dat += "<A href='?src=\ref[src];menu=1.5'>Load Design to Disk</A>"
|
||||
else
|
||||
dat += "Name: [d_disk.blueprint.name]<BR>"
|
||||
var/b_type = d_disk.blueprint.build_type
|
||||
if(b_type)
|
||||
dat += "Lathe Types:<BR>"
|
||||
if(b_type & IMPRINTER) dat += "Circuit Imprinter<BR>"
|
||||
if(b_type & PROTOLATHE) dat += "Protolathe<BR>"
|
||||
if(b_type & AUTOLATHE) dat += "Autolathe<BR>"
|
||||
if(b_type & MECHFAB) dat += "Exosuit Fabricator<BR>"
|
||||
dat += "Required Materials:<BR>"
|
||||
var/all_mats = d_disk.blueprint.materials + d_disk.blueprint.reagents
|
||||
for(var/M in all_mats)
|
||||
dat += "* [CallMaterialName(M)] x [all_mats[M]]<BR>"
|
||||
dat += "</div>Operations: "
|
||||
dat += "<A href='?src=\ref[src];updt_design=1'>Upload to Database</A>"
|
||||
dat += "<A href='?src=\ref[src];clear_design=1'>Clear Disk</A>"
|
||||
dat += "<A href='?src=\ref[src];eject_design=1'>Eject Disk</A>"
|
||||
|
||||
if(1.5) //Technology disk submenu
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.4'>Return to Disk Operations</A><div class='statusDisplay'>"
|
||||
dat += "<h3>Load Design to Disk:</h3><BR>"
|
||||
for(var/v in files.known_designs)
|
||||
var/datum/design/D = files.known_designs[v]
|
||||
dat += "[D.name] "
|
||||
dat += "<A href='?src=\ref[src];copy_design=[disk_slot_selected];copy_design_ID=[D.id]'>Copy to Disk</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];copy_design=1;copy_design_ID=[D.id]'>Copy to Disk</A><BR>"
|
||||
dat += "</div>"
|
||||
|
||||
if(1.6) //R&D console settings
|
||||
@@ -851,7 +806,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
var/c = 50
|
||||
var/t
|
||||
|
||||
var/all_materials = D.materials + D.reagents_list
|
||||
var/all_materials = D.materials + D.reagents
|
||||
for(var/M in all_materials)
|
||||
t = linked_lathe.check_mat(D, M)
|
||||
temp_material += " | "
|
||||
@@ -885,14 +840,13 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
var/temp_material
|
||||
var/c = 50
|
||||
var/t
|
||||
var/all_materials = D.materials + D.reagents_list
|
||||
for(var/M in all_materials)
|
||||
for(var/M in D.materials)
|
||||
t = linked_lathe.check_mat(D, M)
|
||||
temp_material += " | "
|
||||
if (t < 1)
|
||||
temp_material += "<span class='bad'>[all_materials[M]*coeff] [CallMaterialName(M)]</span>"
|
||||
temp_material += "<span class='bad'>[D.materials[M]*coeff] [CallMaterialName(M)]</span>"
|
||||
else
|
||||
temp_material += " [all_materials[M]*coeff] [CallMaterialName(M)]"
|
||||
temp_material += " [D.materials[M]*coeff] [CallMaterialName(M)]"
|
||||
c = min(c,t)
|
||||
|
||||
if (c >= 1)
|
||||
@@ -970,7 +924,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
var/temp_materials
|
||||
var/check_materials = 1
|
||||
|
||||
var/all_materials = D.materials + D.reagents_list
|
||||
var/all_materials = D.materials + D.reagents
|
||||
|
||||
for(var/M in all_materials)
|
||||
temp_materials += " | "
|
||||
@@ -996,14 +950,13 @@ won't update every console in existence) but it's more of a hassle to do. Also,
|
||||
for(var/datum/design/D in matching_designs)
|
||||
var/temp_materials
|
||||
var/check_materials = 1
|
||||
var/all_materials = D.materials + D.reagents_list
|
||||
for(var/M in all_materials)
|
||||
for(var/M in D.materials)
|
||||
temp_materials += " | "
|
||||
if (!linked_imprinter.check_mat(D, M))
|
||||
check_materials = 0
|
||||
temp_materials += " <span class='bad'>[all_materials[M]/coeff] [CallMaterialName(M)]</span>"
|
||||
temp_materials += " <span class='bad'>[D.materials[M]/coeff] [CallMaterialName(M)]</span>"
|
||||
else
|
||||
temp_materials += " [all_materials[M]/coeff] [CallMaterialName(M)]"
|
||||
temp_materials += " [D.materials[M]/coeff] [CallMaterialName(M)]"
|
||||
if (check_materials)
|
||||
dat += "<A href='?src=\ref[src];imprint=[D.id]'>[D.name]</A>[temp_materials]<BR>"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user