diff --git a/code/defines/obj.dm b/code/defines/obj.dm
index 6644448ca42..cd3c76eb8fd 100644
--- a/code/defines/obj.dm
+++ b/code/defines/obj.dm
@@ -5,6 +5,7 @@
var/w_amt = 0 // waster amounts
var/list/origin_tech = null //Used by R&D to determine what research bonuses it grants.
var/reliability = 100 //Used by SOME devices to determine how reliable they are.
+ var/crit_fail = 0
var/unacidable = 0 //universal "unacidabliness" var, here so you can use it in any obj.
animate_movement = 2
var/throwforce = 0
diff --git a/code/defines/obj/supplypacks.dm b/code/defines/obj/supplypacks.dm
index 375d9ba4706..597facb4b2b 100644
--- a/code/defines/obj/supplypacks.dm
+++ b/code/defines/obj/supplypacks.dm
@@ -306,8 +306,8 @@
"/obj/item/device/flash",
"/obj/item/device/flash",
"/obj/item/device/flash",
- "/obj/item/weapon/cell/robotcrate",
- "/obj/item/weapon/cell/robotcrate")
+ "/obj/item/weapon/cell/high",
+ "/obj/item/weapon/cell/high")
cost = 10
containertype = /obj/crate/secure/gear
containername = "Robotics Assembly"
diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm
index dae7b32c577..20236fe1fc4 100644
--- a/code/defines/obj/weapon.dm
+++ b/code/defines/obj/weapon.dm
@@ -1179,6 +1179,7 @@ Total SMES charging rate should not exceed total power generation rate, or an ov
icon = 'power.dmi'
icon_state = "cell"
item_state = "cell"
+ origin_tech = list("powerstorage" = 1)
flags = FPRINT|TABLEPASS
force = 5.0
throwforce = 5.0
@@ -1191,9 +1192,19 @@ Total SMES charging rate should not exceed total power generation rate, or an ov
m_amt = 700
g_amt = 50
var/rigged = 0 // true if rigged to explode
+ var/minor_fault = 0 //If not 100% reliable, it will build up faults.
-/obj/item/weapon/cell/robotcrate
+/obj/item/weapon/cell/high
+ name = "high-capacity power cell"
+ origin_tech = list("powerstorage" = 3)
maxcharge = 10000
+ g_amt = 60
+
+/obj/item/weapon/cell/super
+ name = "super-capcity power cell"
+ origin_tech = list("powerstorage" = 5)
+ maxcharge = 20000
+ g_amt = 70
/*/obj/item/weapon/cell/potato
name = "Potato Battery"
diff --git a/code/game/research/designs.dm b/code/game/research/designs.dm
index e66b6065bd6..849e5af5e8b 100644
--- a/code/game/research/designs.dm
+++ b/code/game/research/designs.dm
@@ -26,7 +26,7 @@ datum
desc = "Desc" //Description of the created object.
id = "id" //ID of the created object for easy refernece. Alphanumeric, lower-case, no symbols
list/req_tech = list() //IDs of that techs the object originated from and the minimum level requirements.
- reliability_mod = 100 //Reliability modifier of the device at it's starting point.
+ reliability_mod = 0 //Reliability modifier of the device at it's starting point.
reliability_base = 100 //Base reliability of a device before modifiers.
reliability = 100 //Reliability of the device.
build_type = null //Flag as to what kind machine the design is built in. See defines.
@@ -335,7 +335,7 @@ datum
ripley_main
name = "Circuit Design (APLU \"Ripley\" Central Control module)"
- desc = "Allows for the construction of a Safeguard AI Module."
+ desc = "Allows for the construction of a \"Ripley\" Central Control module."
id = "ripley_main"
req_tech = list("programming" = 3, "robotics" = 5)
build_type = IMPRINTER
@@ -344,7 +344,7 @@ datum
ripley_peri
name = "Circuit Design (APLU \"Ripley\" Peripherals Control module)"
- desc = "Allows for the construction of a Safeguard AI Module."
+ desc = "Allows for the construction of a \"Ripley\" Peripheral Control module."
id = "ripley_peri"
req_tech = list("programming" = 3, "robotics" = 5)
build_type = IMPRINTER
@@ -353,7 +353,7 @@ datum
gygax_main
name = "Circuit Design (\"Gygax\" Central Control module)"
- desc = "Allows for the construction of a Safeguard AI Module."
+ desc = "Allows for the construction of a \"Gygax\" Central Control module."
id = "gygax_main"
req_tech = list("programming" = 4, "robotics" = 5)
build_type = IMPRINTER
@@ -362,7 +362,7 @@ datum
gygax_peri
name = "Circuit Design (\"Gygax\" Peripherals Control module)"
- desc = "Allows for the construction of a Safeguard AI Module."
+ desc = "Allows for the construction of a \"Gygax\" Peripheral Control module."
id = "gygax_peri"
req_tech = list("programming" = 4, "robotics" = 5)
build_type = IMPRINTER
@@ -371,7 +371,7 @@ datum
gygax_targ
name = "Circuit Design (\"Gygax\" Weapons & Targeting Control module)"
- desc = "Allows for the construction of a Safeguard AI Module."
+ desc = "Allows for the construction of a \"Gygax\" Weapons & Targeting Control module."
id = "gygax_targ"
req_tech = list("programming" = 4, "robotics" = 5)
build_type = IMPRINTER
@@ -493,6 +493,38 @@ datum
materials = list("$metal" = 80)
build_path = "/obj/item/weapon/stock_parts/adv_matter_bin"
+////////////////////////////////////////
+//////////////////Power/////////////////
+////////////////////////////////////////
+
+ basic_cell
+ name = "Basic Power Cell"
+ desc = "A basic power cell that holds 1000 units of energy"
+ id = "basic_cell"
+ req_tech = list("powerstorage" = 1)
+ build_type = PROTOLATHE | AUTOLATHE
+ materials = list("$metal" = 700, "$glass" = 50)
+ build_path = "/obj/item/weapon/cell"
+
+ high_cell
+ name = "High-Capacity Power Cell"
+ desc = "A power cell that holds 10000 units of energy"
+ id = "high_cell"
+ req_tech = list("powerstorage" = 3)
+ build_type = PROTOLATHE | AUTOLATHE
+ materials = list("$metal" = 700, "$glass" = 60)
+ build_path = "/obj/item/weapon/cell/high"
+
+ super_cell
+ name = "Super-Capacity Power Cell"
+ desc = "A power cell that holds 20000 units of energy"
+ id = "super_cell"
+ req_tech = list("powerstorage" = 5, "materials" = 2)
+ reliability_base = 75
+ build_type = PROTOLATHE
+ materials = list("$metal" = 700, "$glass" = 70)
+ build_path = "/obj/item/weapon/cell/super"
+
////////////////////////////////////////
//Disks for transporting design datums//
////////////////////////////////////////
diff --git a/code/game/research/destructive_analyzer.dm b/code/game/research/destructive_analyzer.dm
index b83f5ac9546..441f24020e9 100644
--- a/code/game/research/destructive_analyzer.dm
+++ b/code/game/research/destructive_analyzer.dm
@@ -30,6 +30,9 @@ Note: Must be placed east/right of an R&D console to function.
if (O.origin_tech.len == 0)
user << "\red You cannot deconstruct this item!"
return
+ if(O.reliability < 90 && O.crit_fail == 0)
+ usr << "\red Item is neither reliable enough or broken enough to learn from."
+ return
busy = 1
loaded_item = O
user.drop_item()
diff --git a/code/game/research/rdconsole.dm b/code/game/research/rdconsole.dm
index 5c5d7f53fec..0596bba3b91 100644
--- a/code/game/research/rdconsole.dm
+++ b/code/game/research/rdconsole.dm
@@ -228,7 +228,6 @@ won't update every console in existence) but it's more of a hassle to do. Also,
else if(href_list["deconstruct"]) //Deconstruct the item in the destructive analyzer and update the research holder.
if(linked_destroy.busy)
usr << "\red The destructive analyzer is busy at the moment."
-
else
var/choice = input("Proceeding will destroy loaded item.") in list("Proceed", "Cancel")
linked_destroy.busy = 1
@@ -238,6 +237,8 @@ won't update every console in existence) but it's more of a hassle to do. Also,
flick("d_analyzer_process", linked_destroy)
spawn(24)
linked_destroy.busy = 0
+ if(linked_destroy.reliability < 90)
+ files.UpdateDesign(linked_destroy.loaded_item.type)
for(var/T in linked_destroy.loaded_item.origin_tech)
files.UpdateTech(T, linked_destroy.loaded_item.origin_tech[T])
if(linked_lathe) //Also sends salvaged materials to a linked autolateh, if any.
@@ -293,7 +294,8 @@ won't update every console in existence) but it's more of a hassle to do. Also,
if(linked_lathe.g_amount < 0)
linked_lathe.g_amount = 0
var/obj/new_item = new being_built.build_path(src)
- new_item.loc = linked_destroy.loc
+ new_item.reliability = being_built.reliability
+ new_item.loc = linked_lathe.loc
linked_lathe.busy = 0
screen = 3.1
updateUsrDialog()
@@ -323,8 +325,9 @@ won't update every console in existence) but it's more of a hassle to do. Also,
linked_imprinter.reagents.remove_reagent(I, being_built.materials[I])
power += being_built.materials[I]
var/obj/new_item = new being_built.build_path(src)
+ new_item.reliability = being_built.reliability
use_power(power)
- new_item.loc = linked_destroy.loc
+ new_item.loc = linked_imprinter.loc
linked_imprinter.busy = 0
screen = 4.1
updateUsrDialog()
@@ -400,11 +403,8 @@ won't update every console in existence) but it's more of a hassle to do. Also,
else if(d_disk) dat += "Disk Operations
"
else dat += "(Please Insert Disk)
"
if(linked_destroy != null) dat += "Destructive Analyzer Menu
"
- else dat += "(NO DESTRUCTIVE ANALYZER CONNECTED TO CONSOLE)
"
if(linked_lathe != null) dat += "Protolathe Construction Menu
"
- else dat += "(NO PROTOLATHE CONNECTED TO CONSOLE)
"
if(linked_imprinter != null) dat += "Circuit Construction Menu
"
- else dat += "(NO IMPRINTER CONNECTED TO CONSOLE)
"
dat += "Settings"
if(1.1) //Research viewer
@@ -482,15 +482,18 @@ won't update every console in existence) but it's more of a hassle to do. Also,
dat += "R&D Console Device Linkage Menu:
"
dat += "Re-sync with Nearby Devices
"
dat += "Linked Devices:
"
- if(!linked_destroy && !linked_lathe && !linked_imprinter)
- dat += "No devices connected
"
+ if(linked_destroy)
+ dat += "* Destructive Analyzer (Disconnect)
"
else
- if(linked_destroy)
- dat += "* Destructive Analyzer (Disconnect)
"
- if(linked_lathe)
- dat += "* Protolathe (Disconnect)
"
- if(linked_imprinter)
- dat += "* Circuit Imprinter (Disconnect)
"
+ dat += "* (No Destructive Analyzer Linked)
"
+ if(linked_lathe)
+ dat += "* Protolathe (Disconnect)
"
+ else
+ dat += "* (No Protolathe Linked)
"
+ if(linked_imprinter)
+ dat += "* Circuit Imprinter (Disconnect)
"
+ else
+ dat += "* (No Circuit Imprinter Linked)
"
dat += "