From 1805269393b5e2dd7298a3b5a472d8b7cebcdf12 Mon Sep 17 00:00:00 2001 From: Crazylemon Date: Thu, 17 Dec 2015 18:51:06 -0800 Subject: [PATCH 1/6] First pass of R&D consoles not losing special ID stuff when de/reconstructed The RD's ID, and anyone with equivalent access, can switch the access restrictions on an RD console's board in event of the boards getting destroyed --- .../game/machinery/computer/buildandrepair.dm | 55 ++++++++++++++++--- code/modules/research/rdconsole.dm | 3 + 2 files changed, 49 insertions(+), 9 deletions(-) diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index 09a0c72ed56..04de559235d 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -144,9 +144,29 @@ /obj/item/weapon/circuitboard/prisoner name = "Circuit board (Prisoner Management)" build_path = /obj/machinery/computer/prisoner + + +// RD console circuits, so that {de,re}constructing one of the special consoles doesn't ruin everything forever /obj/item/weapon/circuitboard/rdconsole name = "Circuit Board (RD Console)" build_path = /obj/machinery/computer/rdconsole/core + req_access = list(access_rd) // This is for adjusting the type of computer we're building - in case something messes up the pre-existing robotics or mechanics consoles + var/access_types = list("R&D Core", "Robotics", "E.X.P.E.R.I-MENTOR", "Mechanics") + id = 1 +/obj/item/weapon/circuitboard/rdconsole/robotics + name = "Circuit Board (RD Console - Robotics)" + build_path = /obj/machinery/computer/rdconsole/robotics + id = 2 +/obj/item/weapon/circuitboard/rdconsole/experiment + name = "Circuit Board (RD Console - E.X.P.E.R.I-MENTOR)" + build_path = /obj/machinery/computer/rdconsole/experiment + id = 3 +/obj/item/weapon/circuitboard/rdconsole/mechanics + name = "Circuit Board (RD Console - Mechanics)" + build_path = /obj/machinery/computer/rdconsole/mechanics + id = 4 + + /obj/item/weapon/circuitboard/mecha_control name = "Circuit Board (Exosuit Control Console)" build_path = /obj/machinery/computer/mecha @@ -285,16 +305,33 @@ return /obj/item/weapon/circuitboard/rdconsole/attackby(obj/item/I as obj, mob/user as mob, params) - if(istype(I,/obj/item/weapon/screwdriver)) - user.visible_message("\blue \the [user] adjusts the jumper on the [src]'s access protocol pins.", "\blue You adjust the jumper on the access protocol pins.") - if(src.build_path == "/obj/machinery/computer/rdconsole/core") - src.name = "Circuit Board (RD Console - Robotics)" - src.build_path = /obj/machinery/computer/rdconsole/robotics - user << "\blue Access protocols set to robotics." + if(istype(I,/obj/item/weapon/card/id)||istype(I, /obj/item/device/pda)) + if(allowed(user)) + user.visible_message("\the [user] waves their ID past the [src]'s access protocol scanner.", "You swipe your ID past the [src]'s access protocol scanner.") + var/console_choice = input(user, "What do you want to configure the access to?", "Configuration Modification", "R&D Core") as null|anything in access_types + if(console_choice == null) + return + switch(console_choice) + if("R&D Core") + name = "Circuit Board (RD Console)" + build_path = /obj/machinery/computer/rdconsole/core + id = 1 + if("Robotics") + name = "Circuit Board (RD Console - Robotics)" + build_path = /obj/machinery/computer/rdconsole/robotics + id = 2 + if("E.X.P.E.R.I-MENTOR") + name = "Circuit Board (RD Console - E.X.P.E.R.I-MENTOR)" + build_path = /obj/machinery/computer/rdconsole/experiment + id = 3 + if("Mechanics") + name = "Circuit Board (RD Console - Mechanics)" + build_path = /obj/machinery/computer/rdconsole/mechanics + id = 4 + + user << "Access protocols set to [console_choice]." else - src.name = "Circuit Board (RD Console)" - src.build_path = /obj/machinery/computer/rdconsole/core - user << "\blue Access protocols set to default." + user << "Access Denied" return /obj/structure/computerframe/attackby(obj/item/P as obj, mob/user as mob, params) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 0212dcf4834..e376b20808b 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -1164,14 +1164,17 @@ proc/CallMaterialName(ID) desc = "A console used to interface with R&D tools." id = 2 req_access = list(access_robotics) + circuit = /obj/item/weapon/circuitboard/rdconsole/robotics /obj/machinery/computer/rdconsole/experiment name = "\improper E.X.P.E.R.I-MENTOR R&D console" desc = "A console used to interface with R&D tools." id = 3 + circuit = /obj/item/weapon/circuitboard/rdconsole/experiment /obj/machinery/computer/rdconsole/mechanics name = "mechanics R&D console" desc = "A console used to interface with R&D tools." id = 4 req_access = list(access_mechanic) + circuit = /obj/item/weapon/circuitboard/rdconsole/mechanics From b1c745235603087568d4011cae9f29054926b133 Mon Sep 17 00:00:00 2001 From: Crazylemon Date: Mon, 21 Dec 2015 10:42:26 -0800 Subject: [PATCH 2/6] RD consoles no longer can be screwed apart when locked --- code/modules/research/rdconsole.dm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index e376b20808b..d6913970e93 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -169,6 +169,8 @@ proc/CallMaterialName(ID) return D.loc = src user << "You add the disk to the machine!" + if(istype(D, /obj/item/weapon/screwdriver) && islocked()) + user << "This console is locked; Unlock it first" else ..() src.updateUsrDialog() @@ -1154,6 +1156,11 @@ proc/CallMaterialName(ID) dat += "" return dat +// This check here is silly but the reason I made it a proc is so that if a better criterion is made +// you can just change it here and you'll be good to go +/obj/machinery/computer/rdconsole/proc/islocked() + return screen == 0.2 + /obj/machinery/computer/rdconsole/core name = "core R&D console" desc = "A console used to interface with R&D tools." From 6ff1b00bed8f0619c2a6c6a932ab7527225958ea Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Mon, 21 Dec 2015 12:20:54 -0800 Subject: [PATCH 3/6] Locking the RnD console prevents simple deconstruction --- code/modules/research/rdconsole.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index d6913970e93..b26b275a836 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -169,7 +169,7 @@ proc/CallMaterialName(ID) return D.loc = src user << "You add the disk to the machine!" - if(istype(D, /obj/item/weapon/screwdriver) && islocked()) + if(istype(D, /obj/item/weapon/screwdriver) && islocked() && !(stat & BROKEN)) user << "This console is locked; Unlock it first" else ..() From 909f262f63b518e778c12fe844762aac160479ab Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Mon, 21 Dec 2015 12:24:36 -0800 Subject: [PATCH 4/6] Added a description to the boards for those who don't read github --- code/game/machinery/computer/buildandrepair.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index 04de559235d..cb71483c1b9 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -149,6 +149,7 @@ // RD console circuits, so that {de,re}constructing one of the special consoles doesn't ruin everything forever /obj/item/weapon/circuitboard/rdconsole name = "Circuit Board (RD Console)" + desc = "Swipe a Research Director level ID or higher to reconfigure." build_path = /obj/machinery/computer/rdconsole/core req_access = list(access_rd) // This is for adjusting the type of computer we're building - in case something messes up the pre-existing robotics or mechanics consoles var/access_types = list("R&D Core", "Robotics", "E.X.P.E.R.I-MENTOR", "Mechanics") From aaf07170b6aaf63b527a9a321cff4d1569e03ed7 Mon Sep 17 00:00:00 2001 From: Crazylemon Date: Mon, 21 Dec 2015 19:59:39 -0800 Subject: [PATCH 5/6] RIP rd console locking, you were completely obsolete by rdconsole checks --- code/modules/research/rdconsole.dm | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index b26b275a836..4ce213730ab 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -169,8 +169,6 @@ proc/CallMaterialName(ID) return D.loc = src user << "You add the disk to the machine!" - if(istype(D, /obj/item/weapon/screwdriver) && islocked() && !(stat & BROKEN)) - user << "This console is locked; Unlock it first" else ..() src.updateUsrDialog() @@ -326,12 +324,6 @@ proc/CallMaterialName(ID) use_power(250) updateUsrDialog() - else if(href_list["lock"]) //Lock the console from use by anyone without 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) @@ -658,10 +650,6 @@ proc/CallMaterialName(ID) if(0.1) dat += "
Processing and Updating Database...
" - if(0.2) - dat += "
SYSTEM LOCKED
" - dat += "Unlock" - if(0.3) dat += "
Constructing Prototype. Please Wait...
" @@ -774,7 +762,6 @@ proc/CallMaterialName(ID) dat += "Connect to Research Network
" dat += "Disconnect from Research Network
" dat += "Device Linkage Menu
" - dat += "Lock Console
" if(check_rights(R_ADMIN,0)) dat += "\[ADMIN\] Maximize Research Levels
" dat += "Reset R&D Database" @@ -1156,11 +1143,6 @@ proc/CallMaterialName(ID) dat += "" return dat -// This check here is silly but the reason I made it a proc is so that if a better criterion is made -// you can just change it here and you'll be good to go -/obj/machinery/computer/rdconsole/proc/islocked() - return screen == 0.2 - /obj/machinery/computer/rdconsole/core name = "core R&D console" desc = "A console used to interface with R&D tools." From e5bc5faa207a5093254852c0260f11d5446cf508 Mon Sep 17 00:00:00 2001 From: Crazylemon Date: Mon, 21 Dec 2015 20:17:58 -0800 Subject: [PATCH 6/6] Adds in a "Public" console type for generous RD's --- code/game/machinery/computer/buildandrepair.dm | 12 ++++++++++-- code/modules/research/rdconsole.dm | 7 +++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index cb71483c1b9..6b297d2ef00 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -152,7 +152,7 @@ desc = "Swipe a Research Director level ID or higher to reconfigure." build_path = /obj/machinery/computer/rdconsole/core req_access = list(access_rd) // This is for adjusting the type of computer we're building - in case something messes up the pre-existing robotics or mechanics consoles - var/access_types = list("R&D Core", "Robotics", "E.X.P.E.R.I-MENTOR", "Mechanics") + var/access_types = list("R&D Core", "Robotics", "E.X.P.E.R.I-MENTOR", "Mechanics", "Public") id = 1 /obj/item/weapon/circuitboard/rdconsole/robotics name = "Circuit Board (RD Console - Robotics)" @@ -166,6 +166,10 @@ name = "Circuit Board (RD Console - Mechanics)" build_path = /obj/machinery/computer/rdconsole/mechanics id = 4 +/obj/item/weapon/circuitboard/rdconsole/public + name = "Circuit Board (RD Console - Public)" + build_path = /obj/machinery/computer/rdconsole/public + id = 5 /obj/item/weapon/circuitboard/mecha_control @@ -309,7 +313,7 @@ if(istype(I,/obj/item/weapon/card/id)||istype(I, /obj/item/device/pda)) if(allowed(user)) user.visible_message("\the [user] waves their ID past the [src]'s access protocol scanner.", "You swipe your ID past the [src]'s access protocol scanner.") - var/console_choice = input(user, "What do you want to configure the access to?", "Configuration Modification", "R&D Core") as null|anything in access_types + var/console_choice = input(user, "What do you want to configure the access to?", "Access Modification", "R&D Core") as null|anything in access_types if(console_choice == null) return switch(console_choice) @@ -329,6 +333,10 @@ name = "Circuit Board (RD Console - Mechanics)" build_path = /obj/machinery/computer/rdconsole/mechanics id = 4 + if("Public") + name = "Circuit Board (RD Console - Public)" + build_path = /obj/machinery/computer/rdconsole/public + id = 5 user << "Access protocols set to [console_choice]." else diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 4ce213730ab..b96f1a29b40 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -1167,3 +1167,10 @@ proc/CallMaterialName(ID) id = 4 req_access = list(access_mechanic) circuit = /obj/item/weapon/circuitboard/rdconsole/mechanics + +/obj/machinery/computer/rdconsole/public + name = "public R&D console" + desc = "A console used to interface with R&D tools." + id = 5 + req_access = list() + circuit = /obj/item/weapon/circuitboard/rdconsole/public