mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-25 09:31:30 +00:00
Just some general cleanup
Moved the spacecraft folder into the unused section, moved syndiebeacon into machinery. Research moved into Modules. Virus2 moved into WIP - is anyone even working on this, it looks almost done? Computer2,optics,pda2,experimental moved unto unused. WIP Chemistry things moved into Chemical Module Cameras.dm moved into weapons GameKit.dm moved into unused BrokenInHands.dm moved into unused Removed Grillify.dm Moved all of the files listed as unused in the mining module to unused Removed several empty folders in modules Moved cloning.dm into machinery Moved NewBan.dm into admin Changed humanoid aliens new_life.dm into life.dm Moved beast mob into unused Moved hivebot into unused Moved carpedexplosion.dm into unused Moved ai_lockdown.dm verb into unused and removed it from the AIs verb list as it didn't actually do anything. Removed mastercontroler2.dm Moved savefile.dm from human to new_player Bugfix People spawning on the starting screen on rev/cult should be fixed. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1964 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
129
code/modules/research/circuitprinter.dm
Normal file
129
code/modules/research/circuitprinter.dm
Normal file
@@ -0,0 +1,129 @@
|
||||
/*///////////////Circuit Imprinter (By Darem)////////////////////////
|
||||
Used to print new circuit boards (for computers and similar systems) and AI modules. Each circuit board pattern are stored in
|
||||
a /datum/desgin on the linked R&D console. You can then print them out in a fasion similar to a regular lathe. However, instead of
|
||||
using metal and glass, it uses glass and reagents (usually sulfuric acis).
|
||||
|
||||
*/
|
||||
/obj/machinery/r_n_d/circuit_imprinter
|
||||
name = "Circuit Imprinter"
|
||||
icon_state = "circuit_imprinter"
|
||||
flags = OPENCONTAINER
|
||||
var
|
||||
g_amount = 0
|
||||
gold_amount = 0
|
||||
diamond_amount = 0
|
||||
max_material_amount = 75000.0
|
||||
|
||||
New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/circuit_imprinter(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/reagent_containers/glass/beaker(src)
|
||||
component_parts += new /obj/item/weapon/reagent_containers/glass/beaker(src)
|
||||
RefreshParts()
|
||||
|
||||
RefreshParts()
|
||||
var/T = 0
|
||||
for(var/obj/item/weapon/reagent_containers/glass/G in component_parts)
|
||||
T += G.reagents.maximum_volume
|
||||
var/datum/reagents/R = new/datum/reagents(T) //Holder for the reagents used as materials.
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
T = 0
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
T += M.rating
|
||||
max_material_amount = T * 75000.0
|
||||
|
||||
|
||||
blob_act()
|
||||
if (prob(50))
|
||||
del(src)
|
||||
|
||||
meteorhit()
|
||||
del(src)
|
||||
return
|
||||
|
||||
proc/TotalMaterials()
|
||||
return g_amount + gold_amount + diamond_amount
|
||||
|
||||
attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if (shocked)
|
||||
shock(user,50)
|
||||
if (istype(O, /obj/item/weapon/screwdriver))
|
||||
if (!opened)
|
||||
opened = 1
|
||||
if(linked_console)
|
||||
linked_console.linked_imprinter = null
|
||||
linked_console = null
|
||||
icon_state = "circuit_imprinter_t"
|
||||
user << "You open the maintenance hatch of [src]."
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "circuit_imprinter"
|
||||
user << "You close the maintenance hatch of [src]."
|
||||
return
|
||||
if (opened)
|
||||
if(istype(O, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'Crowbar.ogg', 50, 1)
|
||||
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
M.state = 2
|
||||
M.icon_state = "box_1"
|
||||
for(var/obj/I in component_parts)
|
||||
if(istype(I, /obj/item/weapon/reagent_containers/glass/beaker))
|
||||
reagents.trans_to(I, reagents.total_volume)
|
||||
if(I.reliability != 100 && crit_fail)
|
||||
I.crit_fail = 1
|
||||
I.loc = src.loc
|
||||
if(g_amount >= 3750)
|
||||
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc)
|
||||
G.amount = round(g_amount / 3750)
|
||||
del(src)
|
||||
return 1
|
||||
else
|
||||
user << "\red You can't load the [src.name] while it's opened."
|
||||
return 1
|
||||
if (disabled)
|
||||
return
|
||||
if (!linked_console)
|
||||
user << "\The [name] must be linked to an R&D console first!"
|
||||
return 1
|
||||
if (O.is_open_container())
|
||||
return 1
|
||||
if (!istype(O, /obj/item/stack/sheet/glass) && !istype(O, /obj/item/stack/sheet/gold) && !istype(O, /obj/item/stack/sheet/diamond))
|
||||
user << "\red You cannot insert this item into the [name]!"
|
||||
return 1
|
||||
if (stat)
|
||||
return 1
|
||||
if (busy)
|
||||
user << "\red The [name] is busy. Please wait for completion of previous operation."
|
||||
return 1
|
||||
if ((TotalMaterials() + 3750) > max_material_amount)
|
||||
user << "\red The [name] is full. Please remove glass from the protolathe in order to insert more."
|
||||
return 1
|
||||
|
||||
var/obj/item/stack/stack = O
|
||||
var/amount = 1
|
||||
var/title = "[stack.name]: [stack.amount] sheet\s left"
|
||||
switch(alert(title, "How many sheets do you want to load?", "one", "max", "cancel", null))
|
||||
if("one")
|
||||
amount = 1
|
||||
if("max")
|
||||
amount = min(stack.amount, round((max_material_amount-TotalMaterials())/3750))
|
||||
else
|
||||
return 1
|
||||
|
||||
busy = 1
|
||||
use_power(max(1000, (3750*amount/10)))
|
||||
spawn(16)
|
||||
user << "\blue You add [amount] sheets to the [src.name]."
|
||||
if(istype(stack, /obj/item/stack/sheet/glass))
|
||||
g_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/gold))
|
||||
gold_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/diamond))
|
||||
diamond_amount += amount * 3750
|
||||
stack.use(amount)
|
||||
busy = 0
|
||||
src.updateUsrDialog()
|
||||
1250
code/modules/research/designs.dm
Normal file
1250
code/modules/research/designs.dm
Normal file
File diff suppressed because it is too large
Load Diff
109
code/modules/research/destructive_analyzer.dm
Normal file
109
code/modules/research/destructive_analyzer.dm
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
Destructive Analyzer
|
||||
|
||||
It is used to destroy hand-held objects and advance technological research. Controls are in the linked R&D console.
|
||||
|
||||
Note: Must be placed within 3 tiles of the R&D Console
|
||||
*/
|
||||
/obj/machinery/r_n_d/destructive_analyzer
|
||||
name = "Destructive Analyzer"
|
||||
icon_state = "d_analyzer"
|
||||
var
|
||||
obj/item/weapon/loaded_item = null
|
||||
decon_mod = 1
|
||||
|
||||
New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/destructive_analyzer(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/scanning_module(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
|
||||
RefreshParts()
|
||||
|
||||
RefreshParts()
|
||||
var/T = 0
|
||||
for(var/obj/item/weapon/stock_parts/S in src)
|
||||
T += S.rating * 0.1
|
||||
T = between (0, T, 1)
|
||||
decon_mod = T
|
||||
|
||||
meteorhit()
|
||||
del(src)
|
||||
return
|
||||
|
||||
proc/ConvertReqString2List(var/list/source_list)
|
||||
var/list/temp_list = params2list(source_list)
|
||||
for(var/O in temp_list)
|
||||
temp_list[O] = text2num(temp_list[O])
|
||||
return temp_list
|
||||
|
||||
|
||||
attackby(var/obj/O as obj, var/mob/user as mob)
|
||||
if (shocked)
|
||||
shock(user,50)
|
||||
if (istype(O, /obj/item/weapon/screwdriver))
|
||||
if (!opened)
|
||||
opened = 1
|
||||
if(linked_console)
|
||||
linked_console.linked_destroy = null
|
||||
linked_console = null
|
||||
icon_state = "d_analyzer_t"
|
||||
user << "You open the maintenance hatch of [src]."
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "d_analyzer"
|
||||
user << "You close the maintenance hatch of [src]."
|
||||
return
|
||||
if (opened)
|
||||
if(istype(O, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'Crowbar.ogg', 50, 1)
|
||||
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
M.state = 2
|
||||
M.icon_state = "box_1"
|
||||
for(var/obj/I in component_parts)
|
||||
I.loc = src.loc
|
||||
del(src)
|
||||
return 1
|
||||
else
|
||||
user << "\red You can't load the [src.name] while it's opened."
|
||||
return 1
|
||||
if (disabled)
|
||||
return
|
||||
if (!linked_console)
|
||||
user << "\red The protolathe must be linked to an R&D console first!"
|
||||
return
|
||||
if (busy)
|
||||
user << "\red The protolathe is busy right now."
|
||||
return
|
||||
if (istype(O, /obj/item) && !loaded_item)
|
||||
if(!O.origin_tech)
|
||||
user << "\red This doesn't seem to have a tech origin!"
|
||||
return
|
||||
var/list/temp_tech = ConvertReqString2List(O.origin_tech)
|
||||
if (temp_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()
|
||||
O.loc = src
|
||||
user << "\blue You add the [O.name] to the machine!"
|
||||
flick("d_analyzer_la", src)
|
||||
spawn(10)
|
||||
icon_state = "d_analyzer_l"
|
||||
busy = 0
|
||||
return
|
||||
|
||||
//For testing purposes only.
|
||||
/*/obj/item/weapon/deconstruction_test
|
||||
name = "Test Item"
|
||||
desc = "WTF?"
|
||||
icon = 'weapons.dmi'
|
||||
icon_state = "d20"
|
||||
g_amt = 5000
|
||||
m_amt = 5000
|
||||
origin_tech = "materials=5;plasmatech=5;syndicate=5;programming=9"*/
|
||||
89
code/modules/research/message_server.dm
Normal file
89
code/modules/research/message_server.dm
Normal file
@@ -0,0 +1,89 @@
|
||||
/datum/data_pda_msg
|
||||
var/recipient = "Unspecified" //name of the person
|
||||
var/sender = "Unspecified" //name of the sender
|
||||
var/message = "Blank" //transferred message
|
||||
|
||||
/datum/data_pda_msg/New(var/param_rec = "",var/param_sender = "",var/param_message = "")
|
||||
if(param_rec)
|
||||
recipient = param_rec
|
||||
if(param_sender)
|
||||
sender = param_sender
|
||||
if(param_message)
|
||||
message = param_message
|
||||
|
||||
/datum/data_rc_msg
|
||||
var/rec_dpt = "Unspecified" //name of the person
|
||||
var/send_dpt = "Unspecified" //name of the sender
|
||||
var/message = "Blank" //transferred message
|
||||
var/stamp = "Unstamped"
|
||||
var/id_auth = "Unauthenticated"
|
||||
var/priority = "Normal"
|
||||
|
||||
/datum/data_rc_msg/New(var/param_rec = "",var/param_sender = "",var/param_message = "",var/param_stamp = "",var/param_id_auth = "",var/param_priority)
|
||||
if(param_rec)
|
||||
rec_dpt = param_rec
|
||||
if(param_sender)
|
||||
send_dpt = param_sender
|
||||
if(param_message)
|
||||
message = param_message
|
||||
if(param_stamp)
|
||||
stamp = param_stamp
|
||||
if(param_id_auth)
|
||||
id_auth = param_id_auth
|
||||
if(param_priority)
|
||||
switch(param_priority)
|
||||
if(1)
|
||||
priority = "Normal"
|
||||
if(2)
|
||||
priority = "High"
|
||||
if(3)
|
||||
priority = "Extreme"
|
||||
else
|
||||
priority = "Undetermined"
|
||||
|
||||
/obj/machinery/message_server
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "server"
|
||||
name = "Messaging Server"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 100
|
||||
|
||||
var/list/datum/data_pda_msg/pda_msgs = list()
|
||||
var/list/datum/data_rc_msg/rc_msgs = list()
|
||||
|
||||
/obj/machinery/message_server/proc/send_pda_message(var/recipient = "",var/sender = "",var/message = "")
|
||||
pda_msgs += new/datum/data_pda_msg(recipient,sender,message)
|
||||
|
||||
/obj/machinery/message_server/proc/send_rc_message(var/recipient = "",var/sender = "",var/message = "",var/stamp = "", var/id_auth = "", var/priority = 1)
|
||||
rc_msgs += new/datum/data_rc_msg(recipient,sender,message,stamp,id_auth)
|
||||
|
||||
/obj/machinery/message_server/attack_hand(user as mob)
|
||||
user << "\blue There seem to be some parts missing from this server. They should arrive on the station in a few days, give or take a few CentCom delays."
|
||||
|
||||
|
||||
|
||||
/obj/machinery/blackbox_recorder
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "blackbox"
|
||||
name = "Blackbox Recorder"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
use_power = 1
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 100
|
||||
var/messages = list()
|
||||
var/messages_admin = list()
|
||||
|
||||
var/msg_common = list()
|
||||
var/msg_science = list()
|
||||
var/msg_command = list()
|
||||
var/msg_medical = list()
|
||||
var/msg_engineering = list()
|
||||
var/msg_security = list()
|
||||
var/msg_deathsquad = list()
|
||||
var/msg_syndicate = list()
|
||||
var/msg_mining = list()
|
||||
var/msg_cargo = list()
|
||||
177
code/modules/research/protolathe.dm
Normal file
177
code/modules/research/protolathe.dm
Normal file
@@ -0,0 +1,177 @@
|
||||
/*
|
||||
Protolathe
|
||||
|
||||
Similar to an autolathe, you load glass and metal sheets (but not other objects) into it to be used as raw materials for the stuff
|
||||
it creates. All the menus and other manipulation commands are in the R&D console.
|
||||
|
||||
Note: Must be placed west/left of and R&D console to function.
|
||||
|
||||
*/
|
||||
/obj/machinery/r_n_d/protolathe
|
||||
name = "Protolathe"
|
||||
icon_state = "protolathe"
|
||||
flags = OPENCONTAINER
|
||||
var
|
||||
max_material_storage = 100000 //All this could probably be done better with a list but meh.
|
||||
m_amount = 0.0
|
||||
g_amount = 0.0
|
||||
gold_amount = 0.0
|
||||
silver_amount = 0.0
|
||||
plasma_amount = 0.0
|
||||
uranium_amount = 0.0
|
||||
diamond_amount = 0.0
|
||||
clown_amount = 0.0
|
||||
adamantine_amount = 0.0
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/protolathe(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
||||
component_parts += new /obj/item/weapon/reagent_containers/glass/beaker(src)
|
||||
component_parts += new /obj/item/weapon/reagent_containers/glass/beaker(src)
|
||||
RefreshParts()
|
||||
|
||||
proc/TotalMaterials() //returns the total of all the stored materials. Makes code neater.
|
||||
return m_amount + g_amount + gold_amount + silver_amount + plasma_amount + uranium_amount + diamond_amount + clown_amount
|
||||
|
||||
RefreshParts()
|
||||
var/T = 0
|
||||
for(var/obj/item/weapon/reagent_containers/glass/G in component_parts)
|
||||
T += G.reagents.maximum_volume
|
||||
var/datum/reagents/R = new/datum/reagents(T) //Holder for the reagents used as materials.
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
T = 0
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
T += M.rating
|
||||
max_material_storage = T * 75000
|
||||
|
||||
attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if (shocked)
|
||||
shock(user,50)
|
||||
if (O.is_open_container())
|
||||
return 1
|
||||
if (istype(O, /obj/item/weapon/screwdriver))
|
||||
if (!opened)
|
||||
opened = 1
|
||||
if(linked_console)
|
||||
linked_console.linked_lathe = null
|
||||
linked_console = null
|
||||
icon_state = "protolathe_t"
|
||||
user << "You open the maintenance hatch of [src]."
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "protolathe"
|
||||
user << "You close the maintenance hatch of [src]."
|
||||
return
|
||||
if (opened)
|
||||
if(istype(O, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'Crowbar.ogg', 50, 1)
|
||||
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
M.state = 2
|
||||
M.icon_state = "box_1"
|
||||
for(var/obj/I in component_parts)
|
||||
if(istype(I, /obj/item/weapon/reagent_containers/glass/beaker))
|
||||
reagents.trans_to(I, reagents.total_volume)
|
||||
if(I.reliability != 100 && crit_fail)
|
||||
I.crit_fail = 1
|
||||
I.loc = src.loc
|
||||
if(m_amount >= 3750)
|
||||
var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal(src.loc)
|
||||
G.amount = round(m_amount / 3750)
|
||||
if(g_amount >= 3750)
|
||||
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc)
|
||||
G.amount = round(g_amount / 3750)
|
||||
if(plasma_amount >= 3750)
|
||||
var/obj/item/stack/sheet/plasma/G = new /obj/item/stack/sheet/plasma(src.loc)
|
||||
G.amount = round(plasma_amount / 3750)
|
||||
if(silver_amount >= 3750)
|
||||
var/obj/item/stack/sheet/silver/G = new /obj/item/stack/sheet/silver(src.loc)
|
||||
G.amount = round(silver_amount / 3750)
|
||||
if(gold_amount >= 3750)
|
||||
var/obj/item/stack/sheet/gold/G = new /obj/item/stack/sheet/gold(src.loc)
|
||||
G.amount = round(gold_amount / 3750)
|
||||
if(uranium_amount >= 3750)
|
||||
var/obj/item/stack/sheet/uranium/G = new /obj/item/stack/sheet/uranium(src.loc)
|
||||
G.amount = round(uranium_amount / 3750)
|
||||
if(diamond_amount >= 3750)
|
||||
var/obj/item/stack/sheet/diamond/G = new /obj/item/stack/sheet/diamond(src.loc)
|
||||
G.amount = round(diamond_amount / 3750)
|
||||
if(clown_amount >= 3750)
|
||||
var/obj/item/stack/sheet/clown/G = new /obj/item/stack/sheet/clown(src.loc)
|
||||
G.amount = round(clown_amount / 3750)
|
||||
if(adamantine_amount >= 3750)
|
||||
var/obj/item/stack/sheet/adamantine/G = new /obj/item/stack/sheet/adamantine(src.loc)
|
||||
G.amount = round(adamantine_amount / 3750)
|
||||
del(src)
|
||||
return 1
|
||||
else
|
||||
user << "\red You can't load the [src.name] while it's opened."
|
||||
return 1
|
||||
if (disabled)
|
||||
return
|
||||
if (!linked_console)
|
||||
user << "\The protolathe must be linked to an R&D console first!"
|
||||
return 1
|
||||
if (busy)
|
||||
user << "\red The protolathe is busy. Please wait for completion of previous operation."
|
||||
return 1
|
||||
if (!istype(O, /obj/item/stack/sheet))
|
||||
user << "\red You cannot insert this item into the protolathe!"
|
||||
return 1
|
||||
if (stat)
|
||||
return 1
|
||||
if (TotalMaterials() + 3750 > max_material_storage)
|
||||
user << "\red The protolathe's material bin is full. Please remove material before adding more."
|
||||
return 1
|
||||
|
||||
var/obj/item/stack/stack = O
|
||||
var/amount = 1
|
||||
var/title = "[stack.name]: [stack.amount] sheet\s left"
|
||||
switch(alert(title, "How many sheets do you want to load?", "one", "max", "cancel", null))
|
||||
if("one")
|
||||
amount = 1
|
||||
if("max")
|
||||
amount = min(stack.amount, round((max_material_storage-TotalMaterials())/3750))
|
||||
else
|
||||
return 1
|
||||
|
||||
if(istype(O, /obj/item/stack/sheet/glass))
|
||||
flick("protolathe_r",src)//plays glass insertion animation
|
||||
else
|
||||
flick("protolathe_o",src)//plays metal insertion animation
|
||||
|
||||
icon_state = "protolathe"
|
||||
busy = 1
|
||||
use_power(max(1000, (3750*amount/10)))
|
||||
spawn(16)
|
||||
user << "\blue You add [amount] sheets to the [src.name]."
|
||||
icon_state = "protolathe"
|
||||
flick("protolathe_o",src)
|
||||
if(istype(stack, /obj/item/stack/sheet/metal))
|
||||
m_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/glass))
|
||||
g_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/gold))
|
||||
gold_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/silver))
|
||||
silver_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/plasma))
|
||||
plasma_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/uranium))
|
||||
uranium_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/diamond))
|
||||
diamond_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/clown))
|
||||
clown_amount += amount * 3750
|
||||
else if(istype(stack, /obj/item/stack/sheet/adamantine))
|
||||
adamantine_amount += amount * 3750
|
||||
stack.use(amount)
|
||||
busy = 0
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
239
code/modules/research/rd-readme.dm
Normal file
239
code/modules/research/rd-readme.dm
Normal file
@@ -0,0 +1,239 @@
|
||||
/*
|
||||
Research and Development System. (Designed specifically for the /tg/station 13 (Space Station 13) open source project)
|
||||
|
||||
///////////////Overview///////////////////
|
||||
This system is a "tech tree" research and development system designed for SS13. It allows a "researcher" job (this document assumes
|
||||
the "scientist" job is given this role) the tools necessiary to research new and better technologies. In general, the system works
|
||||
by breaking existing technology and using what you learn from to advance your knowledge of SCIENCE! As your knowledge progresses,
|
||||
you can build newer (and better?) devices (which you can also, eventually, deconstruct to advance your knowledge).
|
||||
|
||||
A brief overview is below. For more details, see the related files.
|
||||
|
||||
////////////Game Use/////////////
|
||||
The major research and development is performed using a combination of four machines:
|
||||
- R&D Console: A computer console that allows you to manipulate the other devices that are linked to it and view/manipulate the
|
||||
technologies you have researched so far.
|
||||
- Protolathe: Used to make new hand-held devices and parts for larger devices. All metals and reagents as raw materials.
|
||||
- Destructive Analyzer: You can put hand-held objects into it and it'll analyze them for technological advancements but it destroys
|
||||
them in the process. Destroyed items will send their raw materials to a linked Protolathe (if any)
|
||||
- Circuit Imprinter: Similar to the Protolathe, it allows for the construction of circuit boards. Uses glass and acid as the raw
|
||||
materials.
|
||||
|
||||
While researching you are dealing with two different types of information: Technology Paths and Device Designs. Technology Paths
|
||||
are the "Tech Trees" of the game. You start out with a number of them at the game start and they are improved by using the
|
||||
Destructive Analyzer. By themselves, they don't do a whole lot. However, they unlock Device Designs. This is the information used
|
||||
by the circuit imprinter and the protolathe to produce objects. It also tracks the current reliability of that particular design.
|
||||
|
||||
//EXISTING TECH
|
||||
Each tech path should have at LEAST one item at every level (levels 1 - 20). This is to allow for a more fluid progression of the
|
||||
researching. Existing tech (ie, anything you can find on the station or get from the quartermaster) shouldn't go higher then
|
||||
level 5 or 7. Everything past that should be stuff you research.
|
||||
|
||||
Below is a checklist to make sure every tree is filled. As new items get added to R&D, add them here if there is an empty slot.
|
||||
When thinking about new stuff, check here to see if there are any slots unfilled.
|
||||
|
||||
//MATERIALS
|
||||
1 | Metal
|
||||
2 | Solid Plasma
|
||||
3 | Silver
|
||||
4 | Gold, Super Capacitor
|
||||
5 | Uranium, Nuclear Gun, SUPERPACMAN
|
||||
6 | Diamond, MRSPACMAN
|
||||
7 |
|
||||
8 |
|
||||
9 |
|
||||
10 |
|
||||
11 |
|
||||
12 |
|
||||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
||||
17 |
|
||||
18 |
|
||||
19 |
|
||||
20 |
|
||||
|
||||
//PLASMA TECH
|
||||
1 |
|
||||
2 | Solid Plasma
|
||||
3 | Pacman Generator
|
||||
4 |
|
||||
5 |
|
||||
6 |
|
||||
7 |
|
||||
8 |
|
||||
9 |
|
||||
10 |
|
||||
11 |
|
||||
12 |
|
||||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
||||
17 |
|
||||
18 |
|
||||
19 |
|
||||
20 |
|
||||
|
||||
//POWER TECH
|
||||
1 | Basic Capacitor, Basic Cell
|
||||
2 | High-Capacity Cell (10,000)
|
||||
3 | Super-Capacity Cell (20,000), Powersink, PACMAN
|
||||
4 | SUPERPACMAN
|
||||
5 | MRSPACMAN, Super Capacitor
|
||||
6 | Hyper-Capacity Cell (30,000)
|
||||
7 |
|
||||
8 |
|
||||
9 |
|
||||
10 |
|
||||
11 |
|
||||
12 |
|
||||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
||||
17 |
|
||||
18 |
|
||||
19 |
|
||||
20 |
|
||||
|
||||
//BLUE SPACE
|
||||
1 |
|
||||
2 | Teleporter Console Board
|
||||
3 | Teleport Gun, Hand Tele
|
||||
4 | Teleportation Scroll
|
||||
5 |
|
||||
6 |
|
||||
7 |
|
||||
8 |
|
||||
9 |
|
||||
10 |
|
||||
11 |
|
||||
12 |
|
||||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
||||
17 |
|
||||
18 |
|
||||
19 |
|
||||
20 |
|
||||
|
||||
//BIOTECH
|
||||
1 | Bruise Pack, Scalple
|
||||
2 | PANDEMIC Board, Mass Spectrometer
|
||||
3 | AI Core, Brains (MMI)
|
||||
4 | MMI+Radio
|
||||
5 |
|
||||
6 |
|
||||
7 |
|
||||
8 |
|
||||
9 |
|
||||
10 |
|
||||
11 |
|
||||
12 |
|
||||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
||||
17 |
|
||||
18 |
|
||||
19 |
|
||||
20 |
|
||||
|
||||
//MAGNETS
|
||||
1 | Basic Sensor
|
||||
2 | Comm Console Board
|
||||
3 | Adv Sensor
|
||||
4 | Adv Mass Spectrometer, Chameleon Projector
|
||||
5 | Phasic Sensor
|
||||
6 |
|
||||
7 |
|
||||
8 |
|
||||
9 |
|
||||
10 |
|
||||
11 |
|
||||
12 |
|
||||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
||||
17 |
|
||||
18 |
|
||||
19 |
|
||||
20 |
|
||||
|
||||
//PROGRAMMING
|
||||
1 | Arcade Board
|
||||
2 | Sec Camera
|
||||
3 | Cloning Machine Console Board
|
||||
4 | AI Core, Intellicard
|
||||
5 | Pico-Manipulator, Ultra-Micro-Laser
|
||||
6 |
|
||||
7 |
|
||||
8 |
|
||||
9 |
|
||||
10 |
|
||||
11 |
|
||||
12 |
|
||||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
||||
17 |
|
||||
18 |
|
||||
19 |
|
||||
20 |
|
||||
|
||||
//SYNDICATE
|
||||
1 | Sleepypen
|
||||
2 | TYRANT Module, Emag
|
||||
3 | Cloaking Device, Power Sink
|
||||
4 |
|
||||
5 |
|
||||
6 |
|
||||
7 |
|
||||
8 |
|
||||
9 |
|
||||
10 |
|
||||
11 |
|
||||
12 |
|
||||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
||||
17 |
|
||||
18 |
|
||||
19 |
|
||||
20 |
|
||||
|
||||
//COMBAT
|
||||
1 | Flashbang, Mousetrap, Nettle
|
||||
2 | Stun Baton
|
||||
3 | Power Axe, Death Nettle, Nuclear Gun
|
||||
4 |
|
||||
5 |
|
||||
6 |
|
||||
7 |
|
||||
8 |
|
||||
9 |
|
||||
10 |
|
||||
11 |
|
||||
12 |
|
||||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
||||
17 |
|
||||
18 |
|
||||
19 |
|
||||
20 |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
867
code/modules/research/rdconsole.dm
Normal file
867
code/modules/research/rdconsole.dm
Normal file
@@ -0,0 +1,867 @@
|
||||
/*
|
||||
Research and Development (R&D) Console
|
||||
|
||||
This is the main work horse of the R&D system. It contains the menus/controls for the Destructive Analyzer, Protolathe, and Circuit
|
||||
imprinter. It also contains the /datum/research holder with all the known/possible technology paths and device designs.
|
||||
|
||||
Basic use: When it first is created, it will attempt to link up to related devices within 3 squares. It'll only link up if they
|
||||
aren't already linked to another console. Any consoles it cannot link up with (either because all of a certain type are already
|
||||
linked or there aren't any in range), you'll just not have access to that menu. In the settings menu, there are menu options that
|
||||
allow a player to attempt to re-sync with nearby consoles. You can also force it to disconnect from a specific console.
|
||||
|
||||
The imprinting and construction menus do NOT require toxins access to access but all the other menus do. However, if you leave it
|
||||
on a menu, nothing is to stop the person from using the options on that menu (although they won't be able to change to a different
|
||||
one). You can also lock the console on the settings menu if you're feeling paranoid and you don't want anyone messing with it who
|
||||
doesn't have toxins access.
|
||||
|
||||
When a R&D console is destroyed or even partially disassembled, you lose all research data on it. However, there are two ways around
|
||||
this dire fate:
|
||||
- The easiest way is to go to the settings menu and select "Sync Database with Network." That causes it to upload (but not download)
|
||||
it's data to every other device in the game. Each console has a "disconnect from network" option that'll will cause data base sync
|
||||
operations to skip that console. This is useful if you want to make a "public" R&D console or, for example, give the engineers
|
||||
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 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.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/obj/machinery/computer/rdconsole
|
||||
name = "R&D Console"
|
||||
icon_state = "rdcomp"
|
||||
var
|
||||
datum/research/files //Stores all the collected research data.
|
||||
obj/item/weapon/disk/tech_disk/t_disk = null //Stores the technology disk.
|
||||
obj/item/weapon/disk/design_disk/d_disk = null //Stores the design disk.
|
||||
|
||||
obj/machinery/r_n_d/destructive_analyzer/linked_destroy = null //Linked Destructive Analyzer
|
||||
obj/machinery/r_n_d/protolathe/linked_lathe = null //Linked Protolathe
|
||||
obj/machinery/r_n_d/circuit_imprinter/linked_imprinter = null //Linked Circuit Imprinter
|
||||
|
||||
screen = 1.0 //Which screen is currently showing.
|
||||
id = 0 //ID of the computer (for server restrictions).
|
||||
sync = 1 //If sync = 0, it doesn't show up on Server Control Console
|
||||
emagged = 0 //Turns off ID check
|
||||
|
||||
req_access = list(access_tox) //Data and setting manipulation requires scientist access.
|
||||
|
||||
proc
|
||||
CallTechName(var/ID) //A simple helper proc to find the name of a tech with a given ID.
|
||||
var/datum/tech/check_tech
|
||||
var/return_name = null
|
||||
for(var/T in typesof(/datum/tech) - /datum/tech)
|
||||
check_tech = null
|
||||
check_tech = new T()
|
||||
if(check_tech.id == ID)
|
||||
return_name = check_tech.name
|
||||
del(check_tech)
|
||||
check_tech = null
|
||||
break
|
||||
|
||||
return return_name
|
||||
|
||||
CallMaterialName(var/ID)
|
||||
var/datum/reagent/temp_reagent
|
||||
var/return_name = null
|
||||
if (copytext(ID, 1, 2) == "$")
|
||||
return_name = copytext(ID, 2)
|
||||
switch(return_name)
|
||||
if("metal")
|
||||
return_name = "Metal"
|
||||
if("glass")
|
||||
return_name = "Glass"
|
||||
if("gold")
|
||||
return_name = "Gold"
|
||||
if("silver")
|
||||
return_name = "Silver"
|
||||
if("plasma")
|
||||
return_name = "Solid Plasma"
|
||||
if("uranium")
|
||||
return_name = "Uranium"
|
||||
if("diamond")
|
||||
return_name = "Diamond"
|
||||
if("clown")
|
||||
return_name = "Bananium"
|
||||
else
|
||||
for(var/R in typesof(/datum/reagent) - /datum/reagent)
|
||||
temp_reagent = null
|
||||
temp_reagent = new R()
|
||||
if(temp_reagent.id == ID)
|
||||
return_name = temp_reagent.name
|
||||
del(temp_reagent)
|
||||
temp_reagent = null
|
||||
break
|
||||
return return_name
|
||||
|
||||
SyncRDevices() //Makes sure it is properly sync'ed up with the devices attached to it (if any).
|
||||
for(var/obj/machinery/r_n_d/D in oview(3,src))
|
||||
if(D.linked_console != null || D.disabled || D.opened)
|
||||
continue
|
||||
if(istype(D, /obj/machinery/r_n_d/destructive_analyzer))
|
||||
if(linked_destroy == null)
|
||||
linked_destroy = D
|
||||
D.linked_console = src
|
||||
else if(istype(D, /obj/machinery/r_n_d/protolathe))
|
||||
if(linked_lathe == null)
|
||||
linked_lathe = D
|
||||
D.linked_console = src
|
||||
else if(istype(D, /obj/machinery/r_n_d/circuit_imprinter))
|
||||
if(linked_imprinter == null)
|
||||
linked_imprinter = D
|
||||
D.linked_console = src
|
||||
return
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
files = new /datum/research(src) //Setup the research data holder.
|
||||
if(!id)
|
||||
for(var/obj/machinery/r_n_d/server/centcom/S in world)
|
||||
S.initialize()
|
||||
break
|
||||
|
||||
initialize()
|
||||
SyncRDevices()
|
||||
|
||||
process()
|
||||
for(var/obj/machinery/r_n_d/server/centcom/C in world) //have it automatically push research to the centcomm server so wild griffins can't fuck up R&D's work --NEO
|
||||
for(var/datum/tech/T in files.known_tech)
|
||||
C.files.AddTech2Known(T)
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
C.files.AddDesign2Known(D)
|
||||
C.files.RefreshResearch()
|
||||
|
||||
attackby(var/obj/item/weapon/D as obj, var/mob/user as mob)
|
||||
//The construction/deconstruction of the console code.
|
||||
if(istype(D, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/computerframe/A = new /obj/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/rdconsole/M = new /obj/item/weapon/circuitboard/rdconsole( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/computerframe/A = new /obj/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/rdconsole/M = new /obj/item/weapon/circuitboard/rdconsole( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
//Loading a disk into it.
|
||||
else if(istype(D, /obj/item/weapon/disk))
|
||||
if(t_disk || d_disk)
|
||||
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
|
||||
else
|
||||
user << "\red Machine cannot accept disks in that format."
|
||||
return
|
||||
user.drop_item()
|
||||
D.loc = src
|
||||
user << "\blue You add the disk to the machine!"
|
||||
else if(istype(D, /obj/item/weapon/card/emag) && !emagged)
|
||||
playsound(src.loc, 'sparks4.ogg', 75, 1)
|
||||
emagged = 1
|
||||
user << "\blue You you disable the security protocols"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
add_fingerprint(usr)
|
||||
|
||||
usr.machine = src
|
||||
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"])
|
||||
if(temp_screen <= 1.1 || (3 <= temp_screen && 4.9 >= temp_screen) || src.allowed(usr) || emagged) //Unless you are making something, you need access.
|
||||
screen = temp_screen
|
||||
else
|
||||
usr << "Unauthorized Access."
|
||||
|
||||
else if(href_list["updt_tech"]) //Update the research holder with information from the technology disk.
|
||||
screen = 0.0
|
||||
spawn(50)
|
||||
screen = 1.2
|
||||
files.AddTech2Known(t_disk.stored)
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["clear_tech"]) //Erase data on the technology disk.
|
||||
t_disk.stored = null
|
||||
|
||||
else if(href_list["eject_tech"]) //Eject the technology disk.
|
||||
t_disk:loc = src.loc
|
||||
t_disk = null
|
||||
screen = 1.0
|
||||
|
||||
else if(href_list["copy_tech"]) //Copys some technology data from the research holder to the disk.
|
||||
for(var/datum/tech/T in files.known_tech)
|
||||
if(href_list["copy_tech_ID"] == T.id)
|
||||
t_disk.stored = T
|
||||
break
|
||||
screen = 1.2
|
||||
|
||||
else if(href_list["updt_design"]) //Updates the research holder with design data from the design disk.
|
||||
screen = 0.0
|
||||
spawn(50)
|
||||
screen = 1.4
|
||||
files.AddDesign2Known(d_disk.blueprint)
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["clear_design"]) //Erases data on the design disk.
|
||||
d_disk.blueprint = null
|
||||
|
||||
else if(href_list["eject_design"]) //Eject the design disk.
|
||||
d_disk:loc = src.loc
|
||||
d_disk = null
|
||||
screen = 1.0
|
||||
|
||||
else if(href_list["copy_design"]) //Copy design data from the research holder to the design disk.
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
if(href_list["copy_design_ID"] == D.id)
|
||||
d_disk.blueprint = D
|
||||
break
|
||||
screen = 1.4
|
||||
|
||||
else if(href_list["eject_item"]) //Eject the item inside the destructive analyzer.
|
||||
if(linked_destroy)
|
||||
if(linked_destroy.busy)
|
||||
usr << "\red The destructive analyzer is busy at the moment."
|
||||
|
||||
else if(linked_destroy.loaded_item)
|
||||
linked_destroy.loaded_item.loc = linked_destroy.loc
|
||||
linked_destroy.loaded_item = null
|
||||
linked_destroy.icon_state = "d_analyzer"
|
||||
screen = 2.1
|
||||
|
||||
else if(href_list["deconstruct"]) //Deconstruct the item in the destructive analyzer and update the research holder.
|
||||
if(linked_destroy)
|
||||
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")
|
||||
if(choice == "Cancel") return
|
||||
linked_destroy.busy = 1
|
||||
screen = 0.1
|
||||
updateUsrDialog()
|
||||
flick("d_analyzer_process", linked_destroy)
|
||||
spawn(24)
|
||||
if(linked_destroy)
|
||||
linked_destroy.busy = 0
|
||||
if(!linked_destroy.hacked)
|
||||
if(!linked_destroy.loaded_item)
|
||||
usr <<"\red The destructive analyzer appears to be empty."
|
||||
return
|
||||
if(linked_destroy.loaded_item.reliability >= 90)
|
||||
var/list/temp_tech = linked_destroy.ConvertReqString2List(linked_destroy.loaded_item.origin_tech)
|
||||
for(var/T in temp_tech)
|
||||
files.UpdateTech(T, temp_tech[T])
|
||||
if(linked_destroy.loaded_item.reliability < 100 && linked_destroy.loaded_item.crit_fail)
|
||||
files.UpdateDesign(linked_destroy.loaded_item.type)
|
||||
if(linked_lathe) //Also sends salvaged materials to a linked protolathe, if any.
|
||||
linked_lathe.m_amount += min((linked_lathe.max_material_storage - linked_lathe.TotalMaterials()), (linked_destroy.loaded_item.m_amt*linked_destroy.decon_mod))
|
||||
linked_lathe.g_amount += min((linked_lathe.max_material_storage - linked_lathe.TotalMaterials()), (linked_destroy.loaded_item.g_amt*linked_destroy.decon_mod))
|
||||
linked_destroy.loaded_item = null
|
||||
for(var/obj/I in linked_destroy.contents)
|
||||
for(var/mob/M in I.contents)
|
||||
M.death()
|
||||
del(I)
|
||||
use_power(250)
|
||||
linked_destroy.icon_state = "d_analyzer"
|
||||
screen = 1.0
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["lock"]) //Lock the console from use by anyone without tox access.
|
||||
if(src.allowed(usr))
|
||||
screen = text2num(href_list["lock"])
|
||||
else
|
||||
usr << "Unauthorized Access."
|
||||
|
||||
else if(href_list["sync"]) //Sync the research holder with all the R&D consoles in the game that aren't sync protected.
|
||||
screen = 0.0
|
||||
if(!sync)
|
||||
usr << "\red You must connect to the network first!"
|
||||
else
|
||||
spawn(30)
|
||||
if(src)
|
||||
for(var/obj/machinery/r_n_d/server/S in world)
|
||||
var/server_processed = 0
|
||||
if(S.disabled)
|
||||
continue
|
||||
if((id in S.id_with_upload) || istype(S, /obj/machinery/r_n_d/server/centcom))
|
||||
for(var/datum/tech/T in files.known_tech)
|
||||
S.files.AddTech2Known(T)
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
S.files.AddDesign2Known(D)
|
||||
S.files.RefreshResearch()
|
||||
server_processed = 1
|
||||
if(((id in S.id_with_download) && !istype(S, /obj/machinery/r_n_d/server/centcom)) || S.hacked)
|
||||
for(var/datum/tech/T in S.files.known_tech)
|
||||
files.AddTech2Known(T)
|
||||
for(var/datum/design/D in S.files.known_designs)
|
||||
files.AddDesign2Known(D)
|
||||
files.RefreshResearch()
|
||||
server_processed = 1
|
||||
if(!istype(S, /obj/machinery/r_n_d/server/centcom) && server_processed)
|
||||
S.produce_heat(100)
|
||||
screen = 1.6
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["togglesync"]) //Prevents the console from being synced by other consoles. Can still send data.
|
||||
sync = !sync
|
||||
|
||||
else if(href_list["build"]) //Causes the Protolathe to build something.
|
||||
if(linked_lathe)
|
||||
var/datum/design/being_built = null
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
if(D.id == href_list["build"])
|
||||
being_built = D
|
||||
break
|
||||
var/power = 2000
|
||||
for(var/M in being_built.materials)
|
||||
power += round(being_built.materials[M] / 5)
|
||||
power = max(2000, power)
|
||||
screen = 0.3
|
||||
linked_lathe.busy = 1
|
||||
flick("protolathe_n",linked_lathe)
|
||||
spawn(16)
|
||||
use_power(power)
|
||||
spawn(16)
|
||||
for(var/M in being_built.materials)
|
||||
switch(M)
|
||||
if("$metal")
|
||||
linked_lathe.m_amount = max(0, (linked_lathe.m_amount-being_built.materials[M]))
|
||||
if("$glass")
|
||||
linked_lathe.g_amount = max(0, (linked_lathe.g_amount-being_built.materials[M]))
|
||||
if("$gold")
|
||||
linked_lathe.gold_amount = max(0, (linked_lathe.gold_amount-being_built.materials[M]))
|
||||
if("$silver")
|
||||
linked_lathe.silver_amount = max(0, (linked_lathe.silver_amount-being_built.materials[M]))
|
||||
if("$plasma")
|
||||
linked_lathe.plasma_amount = max(0, (linked_lathe.plasma_amount-being_built.materials[M]))
|
||||
if("$uranium")
|
||||
linked_lathe.uranium_amount = max(0, (linked_lathe.uranium_amount-being_built.materials[M]))
|
||||
if("$diamond")
|
||||
linked_lathe.diamond_amount = max(0, (linked_lathe.diamond_amount-being_built.materials[M]))
|
||||
if("$clown")
|
||||
linked_lathe.clown_amount = max(0, (linked_lathe.clown_amount-being_built.materials[M]))
|
||||
else
|
||||
linked_lathe.reagents.remove_reagent(M, being_built.materials[M])
|
||||
|
||||
if(being_built.build_path)
|
||||
var/obj/new_item = new being_built.build_path(src)
|
||||
new_item.reliability = being_built.reliability
|
||||
if(linked_lathe.hacked) being_built.reliability = max((reliability / 2), 0)
|
||||
new_item.loc = linked_lathe.loc
|
||||
linked_lathe.busy = 0
|
||||
screen = 3.1
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["imprint"]) //Causes the Circuit Imprinter to build something.
|
||||
if(linked_imprinter)
|
||||
var/datum/design/being_built = null
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
if(D.id == href_list["imprint"])
|
||||
being_built = D
|
||||
break
|
||||
var/power = 2000
|
||||
for(var/M in being_built.materials)
|
||||
power += round(being_built.materials[M] / 5)
|
||||
power = max(2000, power)
|
||||
screen = 0.4
|
||||
linked_imprinter.busy = 1
|
||||
flick("circuit_imprinter_ani",linked_imprinter)
|
||||
spawn(16)
|
||||
use_power(power)
|
||||
for(var/M in being_built.materials)
|
||||
switch(M)
|
||||
if("$glass")
|
||||
linked_imprinter.g_amount = max(0, (linked_imprinter.g_amount-being_built.materials[M]))
|
||||
if("$gold")
|
||||
linked_imprinter.gold_amount = max(0, (linked_imprinter.gold_amount-being_built.materials[M]))
|
||||
if("$diamond")
|
||||
linked_imprinter.diamond_amount = max(0, (linked_imprinter.diamond_amount-being_built.materials[M]))
|
||||
else
|
||||
linked_imprinter.reagents.remove_reagent(M, being_built.materials[M])
|
||||
var/obj/new_item = new being_built.build_path(src)
|
||||
new_item.reliability = being_built.reliability
|
||||
if(linked_imprinter.hacked) being_built.reliability = max((reliability / 2), 0)
|
||||
new_item.loc = linked_imprinter.loc
|
||||
linked_imprinter.busy = 0
|
||||
screen = 4.1
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["disposeI"] && linked_imprinter) //Causes the circuit imprinter to dispose of a single reagent (all of it)
|
||||
linked_imprinter.reagents.del_reagent(href_list["dispose"])
|
||||
|
||||
else if(href_list["disposeallI"] && linked_imprinter) //Causes the circuit imprinter to dispose of all it's reagents.
|
||||
linked_imprinter.reagents.clear_reagents()
|
||||
|
||||
else if(href_list["disposeP"] && linked_lathe) //Causes the protolathe to dispose of a single reagent (all of it)
|
||||
linked_lathe.reagents.del_reagent(href_list["dispose"])
|
||||
|
||||
else if(href_list["disposeallP"] && linked_lathe) //Causes the protolathe to dispose of all it's reagents.
|
||||
linked_lathe.reagents.clear_reagents()
|
||||
|
||||
else if(href_list["lathe_ejectsheet"] && linked_lathe) //Causes the protolathe to eject a sheet of material
|
||||
var/desired_num_sheets = text2num(href_list["lathe_ejectsheet_amt"])
|
||||
var/res_amount, type
|
||||
switch(href_list["lathe_ejectsheet"])
|
||||
if("metal")
|
||||
type = /obj/item/stack/sheet/metal
|
||||
res_amount = "m_amount"
|
||||
if("glass")
|
||||
type = /obj/item/stack/sheet/glass
|
||||
res_amount = "g_amount"
|
||||
if("gold")
|
||||
type = /obj/item/stack/sheet/gold
|
||||
res_amount = "gold_amount"
|
||||
if("silver")
|
||||
type = /obj/item/stack/sheet/silver
|
||||
res_amount = "silver_amount"
|
||||
if("plasma")
|
||||
type = /obj/item/stack/sheet/plasma
|
||||
res_amount = "plasma_amount"
|
||||
if("uranium")
|
||||
type = /obj/item/stack/sheet/uranium
|
||||
res_amount = "uranium_amount"
|
||||
if("diamond")
|
||||
type = /obj/item/stack/sheet/diamond
|
||||
res_amount = "diamond_amount"
|
||||
if("clown")
|
||||
type = /obj/item/stack/sheet/clown
|
||||
res_amount = "clown_amount"
|
||||
if(ispath(type) && hasvar(linked_lathe, res_amount))
|
||||
var/obj/item/stack/sheet/sheet = new type(linked_lathe.loc)
|
||||
var/available_num_sheets = round(linked_lathe.vars[res_amount]/sheet.perunit)
|
||||
if(available_num_sheets>0)
|
||||
sheet.amount = min(available_num_sheets, desired_num_sheets)
|
||||
linked_lathe.vars[res_amount] = max(0, (linked_lathe.vars[res_amount]-sheet.amount * sheet.perunit))
|
||||
else
|
||||
del sheet
|
||||
else if(href_list["imprinter_ejectsheet"] && linked_imprinter) //Causes the protolathe to eject a sheet of material
|
||||
var/desired_num_sheets = text2num(href_list["imprinter_ejectsheet_amt"])
|
||||
var/res_amount, type
|
||||
switch(href_list["imprinter_ejectsheet"])
|
||||
if("glass")
|
||||
type = /obj/item/stack/sheet/glass
|
||||
res_amount = "g_amount"
|
||||
if("gold")
|
||||
type = /obj/item/stack/sheet/gold
|
||||
res_amount = "gold_amount"
|
||||
if("diamond")
|
||||
type = /obj/item/stack/sheet/diamond
|
||||
res_amount = "diamond_amount"
|
||||
if(ispath(type) && hasvar(linked_imprinter, res_amount))
|
||||
var/obj/item/stack/sheet/sheet = new type(linked_imprinter.loc)
|
||||
var/available_num_sheets = round(linked_imprinter.vars[res_amount]/sheet.perunit)
|
||||
if(available_num_sheets>0)
|
||||
sheet.amount = min(available_num_sheets, desired_num_sheets)
|
||||
linked_imprinter.vars[res_amount] = max(0, (linked_imprinter.vars[res_amount]-sheet.amount * sheet.perunit))
|
||||
else
|
||||
del sheet
|
||||
|
||||
else if(href_list["find_device"]) //The R&D console looks for devices nearby to link up with.
|
||||
screen = 0.0
|
||||
spawn(20)
|
||||
SyncRDevices()
|
||||
screen = 1.7
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["disconnect"]) //The R&D console disconnects with a specific device.
|
||||
switch(href_list["disconnect"])
|
||||
if("destroy")
|
||||
linked_destroy.linked_console = null
|
||||
linked_destroy = null
|
||||
if("lathe")
|
||||
linked_lathe.linked_console = null
|
||||
linked_lathe = null
|
||||
if("imprinter")
|
||||
linked_imprinter.linked_console = null
|
||||
linked_imprinter = null
|
||||
|
||||
else if(href_list["reset"]) //Reset the R&D console's database.
|
||||
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")
|
||||
screen = 0.0
|
||||
del(files)
|
||||
files = new /datum/research(src)
|
||||
spawn(20)
|
||||
screen = 1.6
|
||||
updateUsrDialog()
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
if(ishuman(user))
|
||||
if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
|
||||
call(/obj/item/clothing/gloves/space_ninja/proc/drain)("RESEARCH",src,user:wear_suit)
|
||||
return
|
||||
|
||||
user.machine = src
|
||||
var/dat = ""
|
||||
files.RefreshResearch()
|
||||
switch(screen) //A quick check to make sure you get the right screen when a device is disconnected.
|
||||
if(2 to 2.9)
|
||||
if(linked_destroy == null)
|
||||
screen = 2.0
|
||||
else if(linked_destroy.loaded_item == null)
|
||||
screen = 2.1
|
||||
else
|
||||
screen = 2.2
|
||||
if(3 to 3.9)
|
||||
if(linked_lathe == null)
|
||||
screen = 3.0
|
||||
if(4 to 4.9)
|
||||
if(linked_imprinter == null)
|
||||
screen = 4.0
|
||||
|
||||
switch(screen)
|
||||
|
||||
//////////////////////R&D CONSOLE SCREENS//////////////////
|
||||
if(0.0) dat += "Updating Database...."
|
||||
|
||||
if(0.1) dat += "Processing and Updating Database..."
|
||||
|
||||
if(0.2)
|
||||
dat += "SYSTEM LOCKED<BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];lock=1.6'>Unlock</A>"
|
||||
|
||||
if(0.3)
|
||||
dat += "Constructing Prototype. Please Wait..."
|
||||
|
||||
if(0.4)
|
||||
dat += "Imprinting Circuit. Please Wait..."
|
||||
|
||||
if(1.0) //Main Menu
|
||||
dat += "Main Menu:<BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.1'>Current Research Levels</A><BR>"
|
||||
if(t_disk) dat += "<A href='?src=\ref[src];menu=1.2'>Disk Operations</A><BR>"
|
||||
else if(d_disk) dat += "<A href='?src=\ref[src];menu=1.4'>Disk Operations</A><BR>"
|
||||
else dat += "(Please Insert Disk)<BR>"
|
||||
if(linked_destroy != null) dat += "<A href='?src=\ref[src];menu=2.2'>Destructive Analyzer Menu</A><BR>"
|
||||
if(linked_lathe != null) dat += "<A href='?src=\ref[src];menu=3.1'>Protolathe Construction Menu</A><BR>"
|
||||
if(linked_imprinter != null) dat += "<A href='?src=\ref[src];menu=4.1'>Circuit Construction Menu</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.6'>Settings</A>"
|
||||
|
||||
if(1.1) //Research viewer
|
||||
dat += "Current Research Levels:<BR><BR>"
|
||||
for(var/datum/tech/T in files.known_tech)
|
||||
dat += "[T.name]<BR>"
|
||||
dat += "* Level: [T.level]<BR>"
|
||||
dat += "* Summary: [T.desc]<HR>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(1.2) //Technology Disk Menu
|
||||
dat += "Disk Contents: (Technology Data Disk)<BR><BR>"
|
||||
if(t_disk.stored == null)
|
||||
dat += "The disk has no data stored on it.<HR>"
|
||||
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]<HR>"
|
||||
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><HR>"
|
||||
dat += "<BR><A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(1.3) //Technology Disk submenu
|
||||
dat += "Load Technology to Disk:<BR><BR>"
|
||||
for(var/datum/tech/T in files.known_tech)
|
||||
dat += "[T.name] "
|
||||
dat += "<A href='?src=\ref[src];copy_tech=1;copy_tech_ID=[T.id]'>(Copy to Disk)</A><BR>"
|
||||
dat += "<HR><BR><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>"
|
||||
|
||||
if(1.4) //Design Disk menu.
|
||||
if(d_disk.blueprint == null)
|
||||
dat += "The disk has no data stored on it.<HR>"
|
||||
dat += "Operations: "
|
||||
dat += "<A href='?src=\ref[src];menu=1.5'>Load Design to Disk</A> || "
|
||||
else
|
||||
dat += "Name: [d_disk.blueprint.name]<BR>"
|
||||
dat += "Level: [between(0, (d_disk.blueprint.reliability + rand(-15,15)), 100)]<BR>"
|
||||
switch(d_disk.blueprint.build_type)
|
||||
if(IMPRINTER) dat += "Lathe Type: Circuit Imprinter<BR>"
|
||||
if(PROTOLATHE) dat += "Lathe Type: Proto-lathe<BR>"
|
||||
if(AUTOLATHE) dat += "Lathe Type: Auto-lathe<BR>"
|
||||
dat += "Required Materials:<BR>"
|
||||
for(var/M in d_disk.blueprint.materials)
|
||||
if(copytext(M, 1, 2) == "$") dat += "* [copytext(M, 2)] x [d_disk.blueprint.materials[M]]<BR>"
|
||||
else dat += "* [M] x [d_disk.blueprint.materials[M]]<BR>"
|
||||
dat += "<HR>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><HR>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(1.5) //Technology disk submenu
|
||||
dat += "Load Design to Disk:<BR><BR>"
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
dat += "[D.name] "
|
||||
dat += "<A href='?src=\ref[src];copy_design=1;copy_design_ID=[D.id]'>(Copy to Disk)</A><BR>"
|
||||
dat += "<HR><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>"
|
||||
|
||||
if(1.6) //R&D console settings
|
||||
dat += "R&D Console Setting:<BR><BR>"
|
||||
if(sync)
|
||||
dat += "<A href='?src=\ref[src];sync=1'>Sync Database with Network</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];togglesync=1'>Disconnect from Research Network</A><BR>"
|
||||
else
|
||||
dat += "<A href='?src=\ref[src];togglesync=1'>Connect to Research Network</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.7'>Device Linkage Menu</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];lock=0.2'>Lock Console</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];reset=1'>Reset R&D Database.</A><BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(1.7) //R&D device linkage
|
||||
dat += "R&D Console Device Linkage Menu:<BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];find_device=1'>Re-sync with Nearby Devices</A><BR>"
|
||||
dat += "Linked Devices:<BR>"
|
||||
if(linked_destroy)
|
||||
dat += "* Destructive Analyzer <A href='?src=\ref[src];disconnect=destroy'>(Disconnect)</A><BR>"
|
||||
else
|
||||
dat += "* (No Destructive Analyzer Linked)<BR>"
|
||||
if(linked_lathe)
|
||||
dat += "* Protolathe <A href='?src=\ref[src];disconnect=lathe'>(Disconnect)</A><BR>"
|
||||
else
|
||||
dat += "* (No Protolathe Linked)<BR>"
|
||||
if(linked_imprinter)
|
||||
dat += "* Circuit Imprinter <A href='?src=\ref[src];disconnect=imprinter'>(Disconnect)</A><BR>"
|
||||
else
|
||||
dat += "* (No Circuit Imprinter Linked)<BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];menu=1.6'>Settings Menu</A> || "
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
////////////////////DESTRUCTIVE ANALYZER SCREENS////////////////////////////
|
||||
if(2.0)
|
||||
dat += "NO DESTRUCTIVE ANALYZER LINKED TO CONSOLE<BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(2.1)
|
||||
dat += "No Item Loaded. Standing-by...<BR><HR>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(2.2)
|
||||
dat += "Deconstruction Menu<HR>"
|
||||
dat += "Name: [linked_destroy.loaded_item.name]<BR>"
|
||||
dat += "Origin Tech:<BR>"
|
||||
var/list/temp_tech = linked_destroy.ConvertReqString2List(linked_destroy.loaded_item.origin_tech)
|
||||
for(var/T in temp_tech)
|
||||
dat += "* [CallTechName(T)] [temp_tech[T]]<BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];deconstruct=1'>Deconstruct Item</A> || "
|
||||
dat += "<A href='?src=\ref[src];eject_item=1'>Eject Item</A> || "
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
/////////////////////PROTOLATHE SCREENS/////////////////////////
|
||||
if(3.0)
|
||||
dat += "NO PROTOLATHE LINKED TO CONSOLE<BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(3.1)
|
||||
dat += "Protolathe Menu:<BR><BR>"
|
||||
dat += "<B>Material Amount:</B> [linked_lathe.TotalMaterials()] cm<sup>3</sup> (MAX: [linked_lathe.max_material_storage])<BR>"
|
||||
dat += "<B>Chemical Volume:</B> [linked_lathe.reagents.total_volume] (MAX: [linked_lathe.reagents.maximum_volume])<HR>"
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
if(!(D.build_type & PROTOLATHE))
|
||||
continue
|
||||
var/temp_dat = "[D.name]"
|
||||
var/check_materials = 1
|
||||
for(var/M in D.materials)
|
||||
temp_dat += " [D.materials[M]] [CallMaterialName(M)]"
|
||||
if(copytext(M, 1, 2) == "$")
|
||||
switch(M)
|
||||
if("$glass")
|
||||
if(D.materials[M] > linked_lathe.g_amount) check_materials = 0
|
||||
if("$metal")
|
||||
if(D.materials[M] > linked_lathe.m_amount) check_materials = 0
|
||||
if("$gold")
|
||||
if(D.materials[M] > linked_lathe.gold_amount) check_materials = 0
|
||||
if("$silver")
|
||||
if(D.materials[M] > linked_lathe.silver_amount) check_materials = 0
|
||||
if("$plasma")
|
||||
if(D.materials[M] > linked_lathe.plasma_amount) check_materials = 0
|
||||
if("$uranium")
|
||||
if(D.materials[M] > linked_lathe.uranium_amount) check_materials = 0
|
||||
if("$diamond")
|
||||
if(D.materials[M] > linked_lathe.diamond_amount) check_materials = 0
|
||||
if("$clown")
|
||||
if(D.materials[M] > linked_lathe.clown_amount) check_materials = 0
|
||||
else if (!linked_lathe.reagents.has_reagent(M, D.materials[M]))
|
||||
check_materials = 0
|
||||
if (check_materials)
|
||||
dat += "* <A href='?src=\ref[src];build=[D.id]'>[temp_dat]</A><BR>"
|
||||
else
|
||||
dat += "* [temp_dat]<BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];menu=3.2'>Material Storage</A> || "
|
||||
dat += "<A href='?src=\ref[src];menu=3.3'>Chemical Storage</A> || "
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(3.2) //Protolathe Material Storage Sub-menu
|
||||
dat += "Material Storage<BR><HR>"
|
||||
//Metal
|
||||
dat += "* [linked_lathe.m_amount] cm<sup>3</sup> of Metal || "
|
||||
dat += "Eject: "
|
||||
if(linked_lathe.m_amount > 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=metal;lathe_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_lathe.m_amount > 18750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=metal;lathe_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_lathe.m_amount > 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=metal;lathe_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Glass
|
||||
dat += "* [linked_lathe.g_amount] cm<sup>3</sup> of Glass || "
|
||||
dat += "Eject: "
|
||||
if(linked_lathe.g_amount > 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=glass;lathe_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_lathe.g_amount > 18750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=glass;lathe_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_lathe.g_amount > 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=glass;lathe_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Gold
|
||||
dat += "* [linked_lathe.gold_amount] cm<sup>3</sup> of Gold || "
|
||||
dat += "Eject: "
|
||||
if(linked_lathe.gold_amount > 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=gold;lathe_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_lathe.gold_amount > 18750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=gold;lathe_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_lathe.gold_amount > 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=gold;lathe_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Silver
|
||||
dat += "* [linked_lathe.silver_amount] cm<sup>3</sup> of Silver || "
|
||||
dat += "Eject: "
|
||||
if(linked_lathe.silver_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=silver;lathe_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_lathe.silver_amount >= 18750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=silver;lathe_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_lathe.silver_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=silver;lathe_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Plasma
|
||||
dat += "* [linked_lathe.plasma_amount] cm<sup>3</sup> of Solid Plasma || "
|
||||
dat += "Eject: "
|
||||
if(linked_lathe.plasma_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=plasma;lathe_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_lathe.plasma_amount >= 18750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=plasma;lathe_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_lathe.plasma_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=plasmalathe_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Uranium
|
||||
dat += "* [linked_lathe.uranium_amount] cm<sup>3</sup> of Uranium || "
|
||||
dat += "Eject: "
|
||||
if(linked_lathe.uranium_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=uranium;lathe_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_lathe.uranium_amount >= 18750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=uranium;lathe_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_lathe.uranium_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=uranium;lathe_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Diamond
|
||||
dat += "* [linked_lathe.diamond_amount] cm<sup>3</sup> of Diamond || "
|
||||
dat += "Eject: "
|
||||
if(linked_lathe.diamond_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=diamond;lathe_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_lathe.diamond_amount >= 18750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=diamond;lathe_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_lathe.diamond_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=diamond;lathe_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Bananium
|
||||
dat += "* [linked_lathe.clown_amount] cm<sup>3</sup> of Bananium || "
|
||||
dat += "Eject: "
|
||||
if(linked_lathe.clown_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=clown;lathe_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_lathe.clown_amount >= 18750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=clown;lathe_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_lathe.clown_amount >= 3750) dat += "<A href='?src=\ref[src];lathe_ejectsheet=clown;lathe_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
|
||||
dat += "<HR><A href='?src=\ref[src];menu=3.1'>Protolathe Menu</A> | "
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(3.3) //Protolathe Chemical Storage Submenu
|
||||
dat += "Chemical Storage<BR><HR>"
|
||||
for(var/datum/reagent/R in linked_lathe.reagents.reagent_list)
|
||||
dat += "Name: [R.name] | Units: [R.volume] "
|
||||
dat += "<A href='?src=\ref[src];disposeP=[R.id]'>(Purge)</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];disposeallP=1'><U>Disposal All Chemicals in Storage</U></A><BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];menu=3.1'>Protolathe Menu</A> | "
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
///////////////////CIRCUIT IMPRINTER SCREENS////////////////////
|
||||
if(4.0)
|
||||
dat += "NO CIRCUIT IMPRINTER LINKED TO CONSOLE<BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(4.1)
|
||||
dat += "Circuit Imprinter Menu:<BR><BR>"
|
||||
dat += "Material Amount: [linked_imprinter.TotalMaterials()] cm<sup>3</sup><BR>"
|
||||
dat += "Chemical Volume: [linked_imprinter.reagents.total_volume]<HR>"
|
||||
|
||||
for(var/datum/design/D in files.known_designs)
|
||||
if(!(D.build_type & IMPRINTER))
|
||||
continue
|
||||
var/temp_dat = "[D.name]"
|
||||
var/check_materials = 1
|
||||
for(var/M in D.materials)
|
||||
temp_dat += " [D.materials[M]] [CallMaterialName(M)]"
|
||||
if(copytext(M, 1, 2) == "$")
|
||||
switch(M)
|
||||
if("$glass")
|
||||
if(D.materials[M] > linked_imprinter.g_amount) check_materials = 0
|
||||
if("$gold")
|
||||
if(D.materials[M] > linked_imprinter.gold_amount) check_materials = 0
|
||||
if("$diamond")
|
||||
if(D.materials[M] > linked_imprinter.diamond_amount) check_materials = 0
|
||||
else if (!linked_imprinter.reagents.has_reagent(M, D.materials[M]))
|
||||
check_materials = 0
|
||||
if (check_materials)
|
||||
dat += "* <A href='?src=\ref[src];imprint=[D.id]'>[temp_dat]</A><BR>"
|
||||
else
|
||||
dat += "* [temp_dat]<BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];menu=4.3'>Material Storage</A> || "
|
||||
dat += "<A href='?src=\ref[src];menu=4.2'>Chemical Storage</A> || "
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(4.2)
|
||||
dat += "Chemical Storage<BR><HR>"
|
||||
for(var/datum/reagent/R in linked_imprinter.reagents.reagent_list)
|
||||
dat += "Name: [R.name] | Units: [R.volume] "
|
||||
dat += "<A href='?src=\ref[src];disposeI=[R.id]'>(Purge)</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];disposeallI=1'><U>Disposal All Chemicals in Storage</U></A><BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];menu=4.1'>Imprinter Menu</A> | "
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
|
||||
if(4.3)
|
||||
dat += "Material Storage<BR><HR>"
|
||||
//Glass
|
||||
dat += "* [linked_imprinter.g_amount] cm<sup>3</sup> of Glass || "
|
||||
dat += "Eject: "
|
||||
if(linked_imprinter.g_amount > 3750) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=glass;imprinter_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_imprinter.g_amount > 18750) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=glass;imprinter_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_imprinter.g_amount > 3750) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=glass;imprinter_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Gold
|
||||
dat += "* [linked_imprinter.gold_amount] cm<sup>3</sup> of Gold || "
|
||||
dat += "Eject: "
|
||||
if(linked_imprinter.gold_amount > 3750) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=gold;imprinter_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_imprinter.gold_amount > 18750) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=gold;imprinter_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_imprinter.gold_amount > 3750) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=gold;imprinter_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
//Diamond
|
||||
dat += "* [linked_imprinter.diamond_amount] cm<sup>3</sup> of Diamond || "
|
||||
dat += "Eject: "
|
||||
if(linked_imprinter.diamond_amount > 3750) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=diamond;imprinter_ejectsheet_amt=1'>(1 Sheet)</A> "
|
||||
if(linked_imprinter.diamond_amount > 18750) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=diamond;imprinter_ejectsheet_amt=5'>(5 Sheets)</A> "
|
||||
if(linked_imprinter.diamond_amount > 3750) dat += "<A href='?src=\ref[src];imprinter_ejectsheet=diamond;imprinter_ejectsheet_amt=50'>(Max Sheets)</A>"
|
||||
dat += "<BR>"
|
||||
|
||||
dat += "<HR><A href='?src=\ref[src];menu=4.1'>Circuit Imprinter Menu</A> | "
|
||||
dat += "<A href='?src=\ref[src];menu=1.0'>Main Menu</A>"
|
||||
user << browse("<TITLE>Research and Development Console</TITLE><HR>[dat]", "window=rdconsole;size=575x400")
|
||||
onclose(user, "rdconsole")
|
||||
105
code/modules/research/rdmachines.dm
Normal file
105
code/modules/research/rdmachines.dm
Normal file
@@ -0,0 +1,105 @@
|
||||
//All devices that link into the R&D console fall into thise type for easy identification and some shared procs.
|
||||
|
||||
|
||||
/obj/machinery/r_n_d
|
||||
name = "R&D Device"
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
var
|
||||
busy = 0
|
||||
hacked = 0
|
||||
disabled = 0
|
||||
shocked = 0
|
||||
list/wires = list()
|
||||
hack_wire
|
||||
disable_wire
|
||||
shock_wire
|
||||
opened = 0
|
||||
obj/machinery/computer/rdconsole/linked_console
|
||||
|
||||
New()
|
||||
..()
|
||||
wires["Red"] = 0
|
||||
wires["Blue"] = 0
|
||||
wires["Green"] = 0
|
||||
wires["Yellow"] = 0
|
||||
wires["Black"] = 0
|
||||
wires["White"] = 0
|
||||
var/list/w = list("Red","Blue","Green","Yellow","Black","White")
|
||||
src.hack_wire = pick(w)
|
||||
w -= src.hack_wire
|
||||
src.shock_wire = pick(w)
|
||||
w -= src.shock_wire
|
||||
src.disable_wire = pick(w)
|
||||
w -= src.disable_wire
|
||||
|
||||
proc
|
||||
shock(mob/user, prb)
|
||||
if(stat & (BROKEN|NOPOWER)) // unpowered, no shock
|
||||
return 0
|
||||
if(!prob(prb))
|
||||
return 0
|
||||
var/datum/effects/system/spark_spread/s = new /datum/effects/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
if (electrocute_mob(user, get_area(src), src, 0.7))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if (shocked)
|
||||
shock(user,50)
|
||||
if(opened)
|
||||
var/dat as text
|
||||
dat += "[src.name] Wires:<BR>"
|
||||
for(var/wire in src.wires)
|
||||
dat += text("[wire] Wire: <A href='?src=\ref[src];wire=[wire];cut=1'>[src.wires[wire] ? "Mend" : "Cut"]</A> <A href='?src=\ref[src];wire=[wire];pulse=1'>Pulse</A><BR>")
|
||||
|
||||
dat += text("The red light is [src.disabled ? "off" : "on"].<BR>")
|
||||
dat += text("The green light is [src.shocked ? "off" : "on"].<BR>")
|
||||
dat += text("The blue light is [src.hacked ? "off" : "on"].<BR>")
|
||||
user << browse("<HTML><HEAD><TITLE>[src.name] Hacking</TITLE></HEAD><BODY>[dat]</BODY></HTML>","window=hack_win")
|
||||
return
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["pulse"])
|
||||
var/temp_wire = href_list["wire"]
|
||||
if (!istype(usr.equipped(), /obj/item/device/multitool))
|
||||
usr << "You need a multitool!"
|
||||
else
|
||||
if(src.wires[temp_wire])
|
||||
usr << "You can't pulse a cut wire."
|
||||
else
|
||||
if(src.hack_wire == href_list["wire"])
|
||||
src.hacked = !src.hacked
|
||||
spawn(100) src.hacked = !src.hacked
|
||||
if(src.disable_wire == href_list["wire"])
|
||||
src.disabled = !src.disabled
|
||||
src.shock(usr,50)
|
||||
spawn(100) src.disabled = !src.disabled
|
||||
if(src.shock_wire == href_list["wire"])
|
||||
src.shocked = !src.shocked
|
||||
src.shock(usr,50)
|
||||
spawn(100) src.shocked = !src.shocked
|
||||
if(href_list["cut"])
|
||||
if (!istype(usr.equipped(), /obj/item/weapon/wirecutters))
|
||||
usr << "You need wirecutters!"
|
||||
else
|
||||
var/temp_wire = href_list["wire"]
|
||||
wires[temp_wire] = !wires[temp_wire]
|
||||
if(src.hack_wire == temp_wire)
|
||||
src.hacked = !src.hacked
|
||||
if(src.disable_wire == temp_wire)
|
||||
src.disabled = !src.disabled
|
||||
src.shock(usr,50)
|
||||
if(src.shock_wire == temp_wire)
|
||||
src.shocked = !src.shocked
|
||||
src.shock(usr,50)
|
||||
src.updateUsrDialog()
|
||||
254
code/modules/research/research.dm
Normal file
254
code/modules/research/research.dm
Normal file
@@ -0,0 +1,254 @@
|
||||
/*
|
||||
General Explination:
|
||||
The research datum is the "folder" where all the research information is stored in a R&D console. It's also a holder for all the
|
||||
various procs used to manipulate it. It has four variables and seven procs:
|
||||
|
||||
Variables:
|
||||
- possible_tech is a list of all the /datum/tech that can potentially be researched by the player. The RefreshResearch() proc
|
||||
(explained later) only goes through those when refreshing what you know. Generally, possible_tech contains ALL of the existing tech
|
||||
but it is possible to add tech to the game that DON'T start in it (example: Xeno tech). Generally speaking, you don't want to mess
|
||||
with these since they should be the default version of the datums. They're actually stored in a list rather then using typesof to
|
||||
refer to them since it makes it a bit easier to search through them for specific information.
|
||||
- know_tech is the companion list to possible_tech. It's the tech you can actually research and improve. Until it's added to this
|
||||
list, it can't be improved. All the tech in this list are visible to the player.
|
||||
- possible_designs is functionally identical to possbile_tech except it's for /datum/design.
|
||||
- known_designs is functionally identical to known_tech except it's for /datum/design
|
||||
|
||||
Procs:
|
||||
- TechHasReqs: Used by other procs (specifically RefreshResearch) to see whether all of a tech's requirements are currently in
|
||||
known_tech and at a high enough level.
|
||||
- DesignHasReqs: Same as TechHasReqs but for /datum/design and known_design.
|
||||
- AddTech2Known: Adds a /datum/tech to known_tech. It checks to see whether it already has that tech (if so, it just replaces it). If
|
||||
it doesn't have it, it adds it. Note: It does NOT check possible_tech at all. So if you want to add something strange to it (like
|
||||
a player made tech?) you can.
|
||||
- AddDesign2Known: Same as AddTech2Known except for /datum/design and known_designs.
|
||||
- RefreshResearch: This is the workhorse of the R&D system. It updates the /datum/research holder and adds any unlocked tech paths
|
||||
and designs you have reached the requirements for. It only checks through possible_tech and possible_designs, however, so it won't
|
||||
accidentally add "secret" tech to it.
|
||||
- UpdateTech is used as part of the actual researching process. It takes an ID and finds techs with that same ID in known_tech. When
|
||||
it finds it, it checks to see whether it can improve it at all. If the known_tech's level is less then or equal to
|
||||
the inputted level, it increases the known tech's level to the inputted level -1 or know tech's level +1 (whichever is higher).
|
||||
|
||||
The tech datums are the actual "tech trees" that you improve through researching. Each one has five variables:
|
||||
- Name: Pretty obvious. This is often viewable to the players.
|
||||
- Desc: Pretty obvious. Also player viewable.
|
||||
- ID: This is the unique ID of the tech that is used by the various procs to find and/or maniuplate it.
|
||||
- Level: This is the current level of the tech. All techs start at 1 and have a max of 20. Devices and some techs require a certain
|
||||
level in specific techs before you can produce them.
|
||||
- Req_tech: This is a list of the techs required to unlock this tech path. If left blank, it'll automatically be loaded into the
|
||||
research holder datum.
|
||||
|
||||
*/
|
||||
/***************************************************************
|
||||
** Master Types **
|
||||
** Includes all the helper procs and basic tech processing. **
|
||||
***************************************************************/
|
||||
|
||||
/datum/research //Holder for all the existing, archived, and known tech. Individual to console.
|
||||
var
|
||||
list //Datum/tech go here.
|
||||
possible_tech = list() //List of all tech in the game that players have access to (barring special events).
|
||||
known_tech = list() //List of locally known tech.
|
||||
possible_designs = list() //List of all designs (at base reliability).
|
||||
known_designs = list() //List of available designs (at base reliability).
|
||||
|
||||
New() //Insert techs into possible_tech here. Known_tech automatically updated.
|
||||
for(var/T in typesof(/datum/tech) - /datum/tech)
|
||||
possible_tech += new T(src)
|
||||
for(var/D in typesof(/datum/design) - /datum/design)
|
||||
possible_designs += new D(src)
|
||||
RefreshResearch()
|
||||
|
||||
proc
|
||||
|
||||
//Checks to see if tech has all the required pre-reqs.
|
||||
//Input: datum/tech; Output: 0/1 (false/true)
|
||||
TechHasReqs(var/datum/tech/T)
|
||||
if(T.req_tech.len == 0)
|
||||
return 1
|
||||
var/matches = 0
|
||||
for(var/req in T.req_tech)
|
||||
for(var/datum/tech/known in known_tech)
|
||||
if((req == known.id) && (known.level >= T.req_tech[req]))
|
||||
matches++
|
||||
break
|
||||
if(matches == T.req_tech.len)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
//Checks to see if design has all the required pre-reqs.
|
||||
//Input: datum/design; Output: 0/1 (false/true)
|
||||
DesignHasReqs(var/datum/design/D)
|
||||
if(D.req_tech.len == 0)
|
||||
return 1
|
||||
var/matches = 0
|
||||
for(var/req in D.req_tech)
|
||||
for(var/datum/tech/known in known_tech)
|
||||
if((req == known.id) && (known.level >= D.req_tech[req]))
|
||||
matches++
|
||||
break
|
||||
if(matches == D.req_tech.len)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
//Adds a tech to known_tech list. Checks to make sure there aren't duplicates and updates existing tech's levels if needed.
|
||||
//Input: datum/tech; Output: Null
|
||||
AddTech2Known(var/datum/tech/T)
|
||||
for(var/datum/tech/known in known_tech)
|
||||
if(T.id == known.id)
|
||||
if(T.level > known.level)
|
||||
known.level = T.level
|
||||
return
|
||||
known_tech += T
|
||||
return
|
||||
|
||||
AddDesign2Known(var/datum/design/D)
|
||||
for(var/datum/design/known in known_designs)
|
||||
if(D.id == known.id)
|
||||
if(D.reliability_mod > known.reliability_mod)
|
||||
known.reliability_mod = D.reliability_mod
|
||||
return
|
||||
known_designs += D
|
||||
return
|
||||
|
||||
//Refreshes known_tech and known_designs list. Then updates the reliability vars of the designs in the known_designs list.
|
||||
//Input/Output: n/a
|
||||
RefreshResearch()
|
||||
for(var/datum/tech/PT in possible_tech)
|
||||
if(TechHasReqs(PT))
|
||||
AddTech2Known(PT)
|
||||
for(var/datum/design/PD in possible_designs)
|
||||
if(DesignHasReqs(PD))
|
||||
AddDesign2Known(PD)
|
||||
for(var/datum/tech/T in known_tech)
|
||||
T = between(1,T.level,20)
|
||||
for(var/datum/design/D in known_designs)
|
||||
D.CalcReliability(known_tech)
|
||||
return
|
||||
|
||||
//Refreshes the levels of a given tech.
|
||||
//Input: Tech's ID and Level; Output: null
|
||||
UpdateTech(var/ID, var/level)
|
||||
for(var/datum/tech/KT in known_tech)
|
||||
if(KT.id == ID)
|
||||
if(KT.level <= level) KT.level = max((KT.level + 1), (level - 1))
|
||||
return
|
||||
|
||||
UpdateDesign(var/path)
|
||||
for(var/datum/design/KD in known_designs)
|
||||
if(KD.build_path == path)
|
||||
KD.reliability_mod += rand(1,2)
|
||||
break
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
/***************************************************************
|
||||
** Technology Datums **
|
||||
** Includes all the various technoliges and what they make. **
|
||||
***************************************************************/
|
||||
|
||||
datum
|
||||
tech //Datum of individual technologies.
|
||||
var
|
||||
name = "name" //Name of the technology.
|
||||
desc = "description" //General description of what it does and what it makes.
|
||||
id = "id" //An easily referenced ID. Must be alphanumeric, lower-case, and no symbols.
|
||||
level = 1 //A simple number scale of the research level. Level 0 = Secret tech.
|
||||
list/req_tech = list() //List of ids associated values of techs required to research this tech. "id" = #
|
||||
|
||||
|
||||
//Trunk Technologies (don't require any other techs and you start knowning them).
|
||||
|
||||
materials
|
||||
name = "Materials Research"
|
||||
desc = "Development of new and improved materials."
|
||||
id = "materials"
|
||||
|
||||
engineering
|
||||
name = "Engineering Research"
|
||||
desc = "Development of new and improved engineering parts and."
|
||||
id = "engineering"
|
||||
|
||||
plasmatech
|
||||
name = "Plasma Research"
|
||||
desc = "Research into the mysterious substance colloqually known as 'plasma'."
|
||||
id = "plasmatech"
|
||||
|
||||
powerstorage
|
||||
name = "Power Manipulation Technology"
|
||||
desc = "The various technologies behind the storage and generation of electicity."
|
||||
id = "powerstorage"
|
||||
|
||||
bluespace
|
||||
name = "'Blue-space' Research"
|
||||
desc = "Research into the sub-reality known as 'blue-space'"
|
||||
id = "bluespace"
|
||||
|
||||
biotech
|
||||
name = "Biological Technology"
|
||||
desc = "Research into the deeper mysteries of life and organic substances."
|
||||
id = "biotech"
|
||||
|
||||
combat
|
||||
name = "Combat Systems Research"
|
||||
desc = "The development of offensive and defensive systems."
|
||||
id = "combat"
|
||||
|
||||
magnets
|
||||
name = "Electromagnetic Spectrum Research"
|
||||
desc = "Research into the electromagnetic spectrum. No clue how they actually work, though."
|
||||
id = "magnets"
|
||||
|
||||
programming
|
||||
name = "Data Theory Research"
|
||||
desc = "The development of new computer and artificial intelligence and data storage systems."
|
||||
id = "programming"
|
||||
|
||||
syndicate
|
||||
name = "Illegal Technologies Research"
|
||||
desc = "The study of technologies that violate Nanotrassen regulations."
|
||||
id = "syndicate"
|
||||
|
||||
/* arcane
|
||||
name = "Arcane Research"
|
||||
desc = "Research into the acult and arcane field for use in practical science"
|
||||
id = "arcane"
|
||||
level = 0 //It didn't become "secret" as advertised.
|
||||
|
||||
//Branch Techs
|
||||
explosives
|
||||
name = "Explosives Research"
|
||||
desc = "The creation and application of explosive materials."
|
||||
id = "explosives"
|
||||
req_tech = list("materials" = 3)
|
||||
|
||||
generators
|
||||
name = "Power Generation Technology"
|
||||
desc = "Research into more powerful and more reliable sources."
|
||||
id = "generators"
|
||||
req_tech = list("powerstorage" = 2)
|
||||
|
||||
robotics
|
||||
name = "Robotics Technology"
|
||||
desc = "The development of advanced automated, autonomous machines."
|
||||
id = "robotics"
|
||||
req_tech = list("materials" = 3, "programming" = 3)*/
|
||||
|
||||
|
||||
/obj/item/weapon/disk/tech_disk
|
||||
name = "Technology Disk"
|
||||
desc = "A disk for storing technology data for further research."
|
||||
icon = 'cloning.dmi'
|
||||
icon_state = "datadisk2"
|
||||
item_state = "card-id"
|
||||
w_class = 1.0
|
||||
m_amt = 30
|
||||
g_amt = 10
|
||||
var/datum/tech/stored
|
||||
New()
|
||||
src.pixel_x = rand(-5.0, 5)
|
||||
src.pixel_y = rand(-5.0, 5)
|
||||
334
code/modules/research/server.dm
Normal file
334
code/modules/research/server.dm
Normal file
@@ -0,0 +1,334 @@
|
||||
/obj/machinery/r_n_d/server
|
||||
name = "R&D Server"
|
||||
icon_state = "server"
|
||||
var
|
||||
datum/research/files
|
||||
health = 100
|
||||
list
|
||||
id_with_upload = list() //List of R&D consoles with upload to server access.
|
||||
id_with_download = list() //List of R&D consoles with download from server access.
|
||||
id_with_upload_string = "" //String versions for easy editing in map editor.
|
||||
id_with_download_string = ""
|
||||
server_id = 0
|
||||
heat_gen = 100
|
||||
heating_power = 40000
|
||||
delay = 10
|
||||
req_access = list(access_rd) //Only the R&D can change server settings.
|
||||
|
||||
New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/rdserver(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/scanning_module(src)
|
||||
component_parts += new /obj/item/weapon/cable_coil(src)
|
||||
component_parts += new /obj/item/weapon/cable_coil(src)
|
||||
RefreshParts()
|
||||
|
||||
RefreshParts()
|
||||
var/tot_rating = 0
|
||||
for(var/obj/item/weapon/stock_parts/SP in src)
|
||||
tot_rating += SP.rating
|
||||
heat_gen /= max(1, tot_rating)
|
||||
|
||||
initialize()
|
||||
if(!files) files = new /datum/research(src)
|
||||
var/list/temp_list
|
||||
if(!id_with_upload.len)
|
||||
temp_list = list()
|
||||
temp_list = dd_text2list(id_with_upload_string, ";")
|
||||
for(var/N in temp_list)
|
||||
id_with_upload += text2num(N)
|
||||
if(!id_with_download.len)
|
||||
temp_list = list()
|
||||
temp_list = dd_text2list(id_with_download_string, ";")
|
||||
for(var/N in temp_list)
|
||||
id_with_download += text2num(N)
|
||||
|
||||
process()
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
switch(environment.temperature)
|
||||
if(0 to T0C)
|
||||
health = min(100, health + 1)
|
||||
if(T0C to (T20C + 20))
|
||||
health = between(0, health, 100)
|
||||
if((T20C + 20) to (T0C + 70))
|
||||
health = max(0, health - 1)
|
||||
if(health <= 0)
|
||||
files.known_designs = list()
|
||||
for(var/datum/tech/T in files.known_tech)
|
||||
if(prob(1))
|
||||
T.level--
|
||||
files.RefreshResearch()
|
||||
if(delay)
|
||||
delay--
|
||||
else
|
||||
produce_heat(heat_gen)
|
||||
delay = initial(delay)
|
||||
|
||||
|
||||
proc
|
||||
produce_heat(heat_amt)
|
||||
if(!(stat & (NOPOWER|BROKEN))) //Blatently stolen from space heater.
|
||||
var/turf/simulated/L = loc
|
||||
if(istype(L))
|
||||
var/datum/gas_mixture/env = L.return_air()
|
||||
if(env.temperature < (heat_amt+T0C))
|
||||
|
||||
var/transfer_moles = 0.25 * env.total_moles()
|
||||
|
||||
var/datum/gas_mixture/removed = env.remove(transfer_moles)
|
||||
|
||||
if(removed)
|
||||
|
||||
var/heat_capacity = removed.heat_capacity()
|
||||
if(heat_capacity == 0 || heat_capacity == null)
|
||||
heat_capacity = 1
|
||||
removed.temperature = min((removed.temperature*heat_capacity + heating_power)/heat_capacity, 1000)
|
||||
|
||||
env.merge(removed)
|
||||
|
||||
attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if (disabled)
|
||||
return
|
||||
if (shocked)
|
||||
shock(user,50)
|
||||
if (istype(O, /obj/item/weapon/screwdriver))
|
||||
if (!opened)
|
||||
opened = 1
|
||||
icon_state = "server_o"
|
||||
user << "You open the maintenance hatch of [src]."
|
||||
else
|
||||
opened = 0
|
||||
icon_state = "server"
|
||||
user << "You close the maintenance hatch of [src]."
|
||||
return
|
||||
if (opened)
|
||||
if(istype(O, /obj/item/weapon/crowbar))
|
||||
playsound(src.loc, 'Crowbar.ogg', 50, 1)
|
||||
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
|
||||
M.state = 2
|
||||
M.icon_state = "box_1"
|
||||
for(var/obj/I in component_parts)
|
||||
if(I.reliability != 100 && crit_fail)
|
||||
I.crit_fail = 1
|
||||
I.loc = src.loc
|
||||
del(src)
|
||||
return 1
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if (disabled)
|
||||
return
|
||||
if (shocked)
|
||||
shock(user,50)
|
||||
if(ishuman(user))
|
||||
if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
|
||||
call(/obj/item/clothing/gloves/space_ninja/proc/drain)("RESEARCH",src,user:wear_suit)
|
||||
return
|
||||
|
||||
/obj/machinery/r_n_d/server/centcom
|
||||
name = "Centcom Central R&D Database"
|
||||
server_id = -1
|
||||
|
||||
initialize()
|
||||
..()
|
||||
var/list/no_id_servers = list()
|
||||
var/list/server_ids = list()
|
||||
for(var/obj/machinery/r_n_d/server/S in world)
|
||||
switch(S.server_id)
|
||||
if(-1)
|
||||
continue
|
||||
if(0)
|
||||
no_id_servers += S
|
||||
else
|
||||
server_ids += S.server_id
|
||||
|
||||
for(var/obj/machinery/r_n_d/server/S in no_id_servers)
|
||||
var/num = 1
|
||||
while(!S.server_id)
|
||||
if(num in server_ids)
|
||||
num++
|
||||
else
|
||||
S.server_id = num
|
||||
server_ids += num
|
||||
no_id_servers -= S
|
||||
|
||||
process()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/rdservercontrol
|
||||
name = "R&D Server Controller"
|
||||
icon_state = "rdcomp"
|
||||
var
|
||||
screen = 0
|
||||
obj/machinery/r_n_d/server/temp_server
|
||||
list
|
||||
servers = list()
|
||||
consoles = list()
|
||||
badmin = 0
|
||||
emagged = 0
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
add_fingerprint(usr)
|
||||
usr.machine = src
|
||||
if(!src.allowed(usr) && !emagged)
|
||||
usr << "\red You do not have the required access level"
|
||||
return
|
||||
|
||||
if(href_list["main"])
|
||||
screen = 0
|
||||
|
||||
else if(href_list["access"] || href_list["data"] || href_list["transfer"])
|
||||
temp_server = null
|
||||
consoles = list()
|
||||
servers = list()
|
||||
for(var/obj/machinery/r_n_d/server/S in world)
|
||||
if(S.server_id == text2num(href_list["access"]) || S.server_id == text2num(href_list["data"]) || S.server_id == text2num(href_list["transfer"]))
|
||||
temp_server = S
|
||||
break
|
||||
if(href_list["access"])
|
||||
screen = 1
|
||||
for(var/obj/machinery/computer/rdconsole/C in world)
|
||||
if(C.sync)
|
||||
consoles += C
|
||||
else if(href_list["data"])
|
||||
screen = 2
|
||||
else if(href_list["transfer"])
|
||||
screen = 3
|
||||
for(var/obj/machinery/r_n_d/server/S in world)
|
||||
if(S == src)
|
||||
continue
|
||||
servers += S
|
||||
|
||||
else if(href_list["upload_toggle"])
|
||||
var/num = text2num(href_list["upload_toggle"])
|
||||
if(num in temp_server.id_with_upload)
|
||||
temp_server.id_with_upload -= num
|
||||
else
|
||||
temp_server.id_with_upload += num
|
||||
|
||||
else if(href_list["download_toggle"])
|
||||
var/num = text2num(href_list["download_toggle"])
|
||||
if(num in temp_server.id_with_download)
|
||||
temp_server.id_with_download -= num
|
||||
else
|
||||
temp_server.id_with_download += num
|
||||
|
||||
else if(href_list["reset_tech"])
|
||||
var/choice = alert("Technology Data Rest", "Are you sure you want to reset this technology to it's default data? Data lost cannot be recovered.", "Continue", "Cancel")
|
||||
if(choice == "Continue")
|
||||
for(var/datum/tech/T in temp_server.files.known_tech)
|
||||
if(T.id == href_list["reset_tech"])
|
||||
T.level = 1
|
||||
break
|
||||
temp_server.files.RefreshResearch()
|
||||
|
||||
else if(href_list["reset_design"])
|
||||
var/choice = alert("Design Data Deletion", "Are you sure you want to delete this design? If you still have the prerequisites for the design, it'll reset to it's base reliability. Data lost cannot be recovered.", "Continue", "Cancel")
|
||||
if(choice == "Continue")
|
||||
for(var/datum/design/D in temp_server.files.known_designs)
|
||||
if(D.id == href_list["reset_design"])
|
||||
D.reliability_mod = 0
|
||||
temp_server.files.known_designs -= D
|
||||
break
|
||||
temp_server.files.RefreshResearch()
|
||||
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = ""
|
||||
|
||||
switch(screen)
|
||||
if(0) //Main Menu
|
||||
dat += "Connected Servers:<BR><BR>"
|
||||
|
||||
for(var/obj/machinery/r_n_d/server/S in world)
|
||||
if(istype(S, /obj/machinery/r_n_d/server/centcom) && !badmin)
|
||||
continue
|
||||
dat += "[S.name] || "
|
||||
dat += "<A href='?src=\ref[src];access=[S.server_id]'> Access Rights</A> | "
|
||||
dat += "<A href='?src=\ref[src];data=[S.server_id]'>Data Management</A>"
|
||||
if(badmin) dat += " | <A href='?src=\ref[src];transfer=[S.server_id]'>Server-to-Server Transfer</A>"
|
||||
dat += "<BR>"
|
||||
|
||||
if(1) //Access rights menu
|
||||
dat += "[temp_server.name] Access Rights<BR><BR>"
|
||||
dat += "Consoles with Upload Access<BR>"
|
||||
for(var/obj/machinery/computer/rdconsole/C in consoles)
|
||||
var/turf/console_turf = get_turf(C)
|
||||
dat += "* <A href='?src=\ref[src];upload_toggle=[C.id]'>[console_turf.loc]" //FYI, these are all numeric ids, eventually.
|
||||
if(C.id in temp_server.id_with_upload)
|
||||
dat += " (Remove)</A><BR>"
|
||||
else
|
||||
dat += " (Add)</A><BR>"
|
||||
dat += "Consoles with Download Access<BR>"
|
||||
for(var/obj/machinery/computer/rdconsole/C in consoles)
|
||||
var/turf/console_turf = get_turf(C)
|
||||
dat += "* <A href='?src=\ref[src];download_toggle=[C.id]'>[console_turf.loc]"
|
||||
if(C.id in temp_server.id_with_download)
|
||||
dat += " (Remove)</A><BR>"
|
||||
else
|
||||
dat += " (Add)</A><BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];main=1'>Main Menu</A>"
|
||||
|
||||
if(2) //Data Management menu
|
||||
dat += "[temp_server.name] Data ManagementP<BR><BR>"
|
||||
dat += "Known Technologies<BR>"
|
||||
for(var/datum/tech/T in temp_server.files.known_tech)
|
||||
dat += "* [T.name] "
|
||||
dat += "<A href='?src=\ref[src];reset_tech=[T.id]'>(Reset)</A><BR>" //FYI, these are all strings.
|
||||
dat += "Known Designs<BR>"
|
||||
for(var/datum/design/D in temp_server.files.known_designs)
|
||||
dat += "* [D.name] "
|
||||
dat += "<A href='?src=\ref[src];reset_design=[D.id]'>(Delete)</A><BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];main=1'>Main Menu</A>"
|
||||
|
||||
if(3) //Server Data Transfer
|
||||
dat += "[temp_server.name] Server to Server Transfer<BR><BR>"
|
||||
dat += "Send Data to what server?<BR>"
|
||||
for(var/obj/machinery/r_n_d/server/S in servers)
|
||||
dat += "[S.name] <A href='?src=\ref[src];send_to=[S.server_id]'> (Transfer)</A><BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];main=1'>Main Menu</A>"
|
||||
user << browse("<TITLE>R&D Server Control</TITLE><HR>[dat]", "window=server_control;size=575x400")
|
||||
onclose(user, "server_control")
|
||||
return
|
||||
|
||||
attackby(var/obj/item/weapon/D as obj, var/mob/user as mob)
|
||||
if(istype(D, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/computerframe/A = new /obj/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/rdservercontrol/M = new /obj/item/weapon/circuitboard/rdservercontrol( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/computerframe/A = new /obj/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/rdservercontrol/M = new /obj/item/weapon/circuitboard/rdservercontrol( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else if(istype(D, /obj/item/weapon/card/emag) && !emagged)
|
||||
playsound(src.loc, 'sparks4.ogg', 75, 1)
|
||||
emagged = 1
|
||||
user << "\blue You you disable the security protocols"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
Reference in New Issue
Block a user