RnD Tech Processors (#12136)

This commit is contained in:
Geeves
2021-07-06 22:30:41 -03:00
committed by GitHub
parent f5dc81d247
commit ce19ab1681
15 changed files with 217 additions and 42 deletions
+1
View File
@@ -2723,6 +2723,7 @@
#include "code\modules\research\research.dm"
#include "code\modules\research\server.dm"
#include "code\modules\research\stockparts.dm"
#include "code\modules\research\tech_processor.dm"
#include "code\modules\research\weaponsanalyzer.dm"
#include "code\modules\research\designs\designs.dm"
#include "code\modules\research\designs\circuit\AI_law_boards.dm"
+8
View File
@@ -125,6 +125,14 @@
if(specialfunctions & SAFE)
D.set_safeties(1)
/obj/machinery/button/remote/airlock/screamer
var/message = "REPLACE THIS!"
var/channel = "Common"
/obj/machinery/button/remote/airlock/screamer/trigger()
. = ..()
global_announcer.autosay(message, capitalize_first_letters(name), channel)
#undef OPEN
#undef IDSCAN
#undef BOLTS
@@ -66,6 +66,7 @@
buffer_object = buffer
if(buffer_object)
destroyed_event.register(buffer_object, src, /obj/item/device/multitool/proc/unregister_buffer)
update_icon()
/obj/item/device/multitool/proc/unregister_buffer(var/atom/buffer_to_unregister)
// Only remove the buffered object, don't reset the name
@@ -73,6 +74,7 @@
if(buffer_to_unregister == buffer_object && buffer_object)
destroyed_event.unregister(buffer_object, src)
buffer_object = null
update_icon()
/obj/item/device/multitool/resolve_attackby(atom/A, mob/user, var/click_parameters)
if(!isobj(A))
@@ -16,4 +16,24 @@
#define CHANNEL_MERCENARY "Mercenary"
#define CHANNEL_NINJA "Ninja"
#define CHANNEL_BLUESPACE "Bluespace"
#define CHANNEL_BURGLAR "Burglar"
#define CHANNEL_BURGLAR "Burglar"
var/global/list/ALL_RADIO_CHANNELS = list(
CHANNEL_COMMON = TRUE,
CHANNEL_ENTERTAINMENT = TRUE,
CHANNEL_COMMAND = TRUE,
CHANNEL_SCIENCE = TRUE,
CHANNEL_MEDICAL = TRUE,
CHANNEL_ENGINEERING = TRUE,
CHANNEL_SECURITY = TRUE,
CHANNEL_SUPPLY = TRUE,
CHANNEL_SERVICE = TRUE,
CHANNEL_AI_PRIVATE = TRUE,
CHANNEL_PENAL = TRUE,
CHANNEL_RESPONSE_TEAM = TRUE,
CHANNEL_RAIDER = TRUE,
CHANNEL_MERCENARY = TRUE,
CHANNEL_NINJA = TRUE,
CHANNEL_BLUESPACE = TRUE,
CHANNEL_BURGLAR = TRUE
)
@@ -808,3 +808,7 @@ var/global/list/default_medbay_channels = list(
/obj/item/device/radio/phone/medbay/Initialize()
. = ..()
internal_channels = default_medbay_channels.Copy()
/obj/item/device/radio/all_channels/Initialize()
channels = ALL_RADIO_CHANNELS.Copy()
. = ..()
@@ -11,6 +11,16 @@ obj/item/circuitboard/rdserver
"/obj/item/stack/cable_coil" = 2,
"/obj/item/stock_parts/scanning_module" = 1)
obj/item/circuitboard/rdtechprocessor
name = T_BOARD("R&D tech processor")
build_path = /obj/machinery/r_n_d/tech_processor
board_type = "machine"
origin_tech = list(TECH_DATA = 3)
req_components = list(
"/obj/item/stack/cable_coil" = 2,
"/obj/item/stock_parts/scanning_module" = 2
)
/obj/item/circuitboard/destructive_analyzer
name = T_BOARD("destructive analyzer")
build_path = /obj/machinery/r_n_d/destructive_analyzer
+1 -1
View File
@@ -141,7 +141,7 @@ var/static/list/scarySounds = list(
var/max_explosion_range = 14
// Announcer intercom, because too much stuff creates an intercom for one message then hard del()s it.
var/global/obj/item/device/radio/intercom/global_announcer = new(null)
var/global/obj/item/device/radio/all_channels/global_announcer = new(null)
// the number next to it denotes how much money the department receives when its account is generated
var/list/department_funds = list(
@@ -46,6 +46,11 @@
req_tech = list(TECH_DATA = 3)
build_path = /obj/item/circuitboard/rdserver
/datum/design/circuit/machine/rdtechprocessor
name = "R&D Tech Processor"
req_tech = list(TECH_DATA = 3)
build_path = /obj/item/circuitboard/rdtechprocessor
/datum/design/circuit/machine/mechfab
name = "Exosuit Fabricator"
req_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 3)
+14 -15
View File
@@ -96,20 +96,19 @@ won't update every console in existence) but it's more of a hassle to do. Also,
return
/obj/machinery/computer/rdconsole/proc/SyncTechs()
if(src)
for(var/obj/machinery/r_n_d/server/S in SSmachinery.all_machines)
var/server_processed = 0
if((id in S.id_with_upload) || istype(S, /obj/machinery/r_n_d/server/centcom))
for(var/tech_id in files.known_tech)
var/datum/tech/T = files.known_tech[tech_id]
S.files.AddTech2Known(T)
S.files.RefreshResearch()
server_processed = 1
files.known_tech = S.files.known_tech.Copy()
if(!istype(S, /obj/machinery/r_n_d/server/centcom) && server_processed)
S.produce_heat()
screen = 1.6
updateUsrDialog()
for(var/obj/machinery/r_n_d/server/S in SSmachinery.all_machines)
var/server_processed = 0
if((id in S.id_with_upload) || istype(S, /obj/machinery/r_n_d/server/centcom))
for(var/tech_id in files.known_tech)
var/datum/tech/T = files.known_tech[tech_id]
S.files.AddTech2Known(T)
S.files.RefreshResearch()
server_processed = 1
files.known_tech = S.files.known_tech.Copy()
if(!istype(S, /obj/machinery/r_n_d/server/centcom) && server_processed)
S.produce_heat()
screen = 1.6
updateUsrDialog()
/obj/machinery/computer/rdconsole/proc/griefProtection() //Have it automatically push research to the centcomm server so wild griffins can't fuck up R&D's work
for(var/obj/machinery/r_n_d/server/centcom/C in SSmachinery.all_machines)
@@ -861,7 +860,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
/obj/machinery/computer/rdconsole/robotics
name = "robotics R&D console"
id = 2
id = 1
req_access = list(access_robotics)
allow_analyzer = FALSE
allow_lathe = FALSE
+3 -1
View File
@@ -150,10 +150,12 @@ var/global/list/designs_imprinter_categories = list()
if(KT.level >= MAX_TECH_LEVEL)
break
if(KT.next_level_progress + progress >= KT.next_level_threshold)
progress -= KT.next_level_threshold - KT.next_level_progress
var/progress_left = KT.next_level_threshold - KT.next_level_progress
KT.next_level_progress += progress_left
KT.level++
KT.level = clamp(KT.level, 0, MAX_TECH_LEVEL)
KT.next_level_threshold = get_level_value(KT.level)
progress -= progress_left
continue
KT.next_level_progress += progress
break
+31 -3
View File
@@ -1,5 +1,5 @@
/obj/machinery/r_n_d/server
name = "R&D server"
name = "\improper R&D server"
desc = "A server which houses a back-up of all station research. It can be used to restore lost data, or to act as another point of retrieval."
icon = 'icons/obj/machines/research.dmi'
icon_state = "server"
@@ -10,11 +10,13 @@
var/id_with_upload_string = "" //String versions for easy editing in map editor.
var/id_with_download_string = ""
var/server_id = 0
var/produces_heat = 1
var/produces_heat = TRUE
idle_power_usage = 800
var/delay = 10
req_access = list(access_rd) //Only the R&D can change server settings.
var/list/linked_processors
component_types = list(
/obj/item/circuitboard/rdserver,
/obj/item/stock_parts/scanning_module,
@@ -22,6 +24,8 @@
)
/obj/machinery/r_n_d/server/Destroy()
for(var/obj/machinery/r_n_d/tech_processor/TP as anything in linked_processors)
TP.set_server(null)
griefProtection()
return ..()
@@ -52,6 +56,9 @@
id_with_download += text2num(N)
/obj/machinery/r_n_d/server/machinery_process()
if(stat & (NOPOWER|BROKEN))
return
var/datum/gas_mixture/environment = loc.return_air()
switch(environment.temperature)
if(0 to T0C)
@@ -73,6 +80,19 @@
else
produce_heat()
delay = initial(delay)
upgrade_techs()
/obj/machinery/r_n_d/server/proc/upgrade_techs()
for(var/obj/machinery/r_n_d/tech_processor/TP as anything in linked_processors)
if(TP.stat & (NOPOWER|BROKEN))
continue
TP.processing_stage++
if(TP.processing_stage == 5)
for(var/tech_id in files.known_tech)
var/datum/tech/T = files.known_tech[tech_id]
if(T.level)
files.UpdateTech(T.id, round(TP.tech_rate))
TP.processing_stage = 0
/obj/machinery/r_n_d/server/emp_act(severity)
griefProtection()
@@ -113,7 +133,15 @@
env.merge(removed)
/obj/machinery/r_n_d/server/attackby(var/obj/item/O as obj, var/mob/user as mob)
/obj/machinery/r_n_d/server/attackby(obj/item/O, mob/user)
if(O.ismultitool())
var/obj/item/device/multitool/MT = O
var/obj/machinery/r_n_d/tech_processor/TP = MT.get_buffer(/obj/machinery/r_n_d/tech_processor)
if(TP)
TP.set_server(src)
MT.unregister_buffer(TP)
to_chat(user, SPAN_NOTICE("You link \the [TP] to \the [src]."))
return
if(default_deconstruction_screwdriver(user, O))
return
if(default_deconstruction_crowbar(user, O))
+85
View File
@@ -0,0 +1,85 @@
/obj/machinery/r_n_d/tech_processor
name = "\improper R&D tech processor"
desc = "A highly advanced analytical computation engine, when connected to an R&D server with a multitool, it will start processing known technology and add research points to it."
icon_state = "tech_processor"
component_types = list(
/obj/item/circuitboard/rdtechprocessor,
/obj/item/stock_parts/scanning_module = 2,
/obj/item/stack/cable_coil = 2
)
idle_power_usage = 800
var/tech_rate = 0
var/obj/machinery/r_n_d/server/linked_server
var/processing_stage = 0
var/heat_delay = 10
/obj/machinery/r_n_d/tech_processor/Destroy()
set_server(null)
return ..()
/obj/machinery/r_n_d/tech_processor/RefreshParts()
tech_rate = 0
for(var/obj/item/stock_parts/scanning_module/SM in component_parts)
tech_rate += SM.rating / 2
idle_power_usage = initial(idle_power_usage) * tech_rate // lots of power
update_icon()
/obj/machinery/r_n_d/tech_processor/machinery_process()
heat_delay--
if(!heat_delay)
produce_heat()
heat_delay = initial(heat_delay)
/obj/machinery/r_n_d/tech_processor/attackby(obj/item/W, mob/user)
if(W.ismultitool())
var/obj/item/device/multitool/MT = W
MT.set_buffer(src)
to_chat(user, SPAN_NOTICE("You attach \the [src]'s linking node to \the [MT]'s machinery buffer."))
return
if(default_deconstruction_screwdriver(user, W))
return
if(default_deconstruction_crowbar(user, W))
return
if(default_part_replacement(user, W))
return
return ..()
/obj/machinery/r_n_d/tech_processor/proc/set_server(var/obj/machinery/r_n_d/server/S)
if(linked_server)
LAZYREMOVE(linked_server.linked_processors, src)
linked_server = S
if(linked_server)
LAZYADD(linked_server.linked_processors, src)
update_icon()
/obj/machinery/r_n_d/tech_processor/proc/produce_heat()
if(!(stat & (NOPOWER|BROKEN)))
var/turf/simulated/L = loc
if(istype(L))
var/datum/gas_mixture/env = L.return_air()
var/transfer_moles = 0.25 * env.total_moles
var/datum/gas_mixture/removed = env.remove(transfer_moles)
if(removed)
var/heat_produced = idle_power_usage //obviously can't produce more heat than the machine draws from it's power source
removed.add_thermal_energy(heat_produced)
env.merge(removed)
/obj/machinery/r_n_d/tech_processor/power_change()
. = ..()
update_icon()
/obj/machinery/r_n_d/tech_processor/update_icon()
cut_overlays()
if(stat & (NOPOWER|BROKEN))
icon_state = "[initial(icon_state)]_off"
else if(!linked_server)
icon_state = "[initial(icon_state)]_unlinked"
else
icon_state = initial(icon_state)
if(panel_open)
add_overlay("[initial(icon_state)]_open")
+10
View File
@@ -0,0 +1,10 @@
author: Geeves
delete-after: True
changes:
- rscadd: "Added Tech Processors, circuits available in the Machinery section of the circuit imprinter. When linked to an RnD server with a multitool, it will passively increase any techs above level zero."
- rscadd: "A single tech processor circuitboard and two basic scanning modules have been added to Tech Storage."
- rscadd: "The entrance to the server room now has a button next to it that'll toggle ID Scan, it will also state that it has been used on the science radio channel."
- rscdel: "Removed the robotics server from the server room, the core server will now serve and be served by both consoles."
- bugfix: "Tech now properly adds the progress to the total progress when you increase a tech level."
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 20 KiB

+22 -21
View File
@@ -1515,15 +1515,6 @@
},
/turf/simulated/floor/plating,
/area/maintenance/substation/security)
"adf" = (
/obj/machinery/r_n_d/server/advanced/robotics,
/turf/simulated/floor/bluegrid{
name = "Server Base";
nitrogen = 500;
oxygen = 0;
temperature = 80
},
/area/server)
"adg" = (
/obj/machinery/atmospherics/unary/vent_pump{
dir = 4;
@@ -2183,6 +2174,7 @@
/obj/machinery/light/small{
dir = 8
},
/obj/machinery/r_n_d/server/advanced/core,
/turf/simulated/floor/bluegrid{
name = "Server Base";
nitrogen = 500;
@@ -2638,6 +2630,15 @@
/obj/effect/floor_decal/corner_wide/paleblue{
dir = 9
},
/obj/machinery/button/remote/airlock/screamer{
channel = "Science";
id = "server_door_lock";
message = "The Server Room Airlock's ID lock toggle has been used.";
name = "Server Room Control";
pixel_x = -24;
pixel_y = -24;
specialfunctions = 2
},
/turf/simulated/floor/tiled/white,
/area/rnd/research)
"afi" = (
@@ -2894,15 +2895,6 @@
temperature = 278
},
/area/security/investigations_storage)
"afF" = (
/obj/machinery/r_n_d/server/advanced/core,
/turf/simulated/floor/bluegrid{
name = "Server Base";
nitrogen = 500;
oxygen = 0;
temperature = 80
},
/area/server)
"afG" = (
/obj/machinery/atmospherics/unary/vent_pump{
dir = 4;
@@ -21686,6 +21678,8 @@
dir = 8
},
/obj/machinery/firealarm/south,
/obj/structure/table/steel,
/obj/item/device/multitool,
/turf/simulated/floor/carpet/rubber,
/area/server)
"aLL" = (
@@ -22977,7 +22971,7 @@
/obj/machinery/door/firedoor,
/obj/machinery/door/window/westleft{
name = "Server Room";
req_access = list(30)
req_access = null
},
/obj/machinery/door/window/eastleft{
name = "Server Room"
@@ -23864,6 +23858,7 @@
icon_state = "4-8"
},
/obj/machinery/door/airlock/glass_command{
id_tag = "server_door_lock";
name = "Server Room";
req_access = list(30)
},
@@ -34174,6 +34169,10 @@
dir = 8;
layer = 2.9
},
/obj/item/circuitboard/rdtechprocessor{
pixel_x = -2;
pixel_y = 2
},
/obj/item/circuitboard/unary_atmos/heater,
/obj/item/circuitboard/unary_atmos/cooler{
pixel_x = 3;
@@ -34859,6 +34858,8 @@
/obj/item/stock_parts/matter_bin,
/obj/item/stock_parts/capacitor,
/obj/item/stock_parts/capacitor,
/obj/item/stock_parts/scanning_module,
/obj/item/stock_parts/scanning_module,
/turf/simulated/floor/plating,
/area/storage/tech)
"biw" = (
@@ -90686,9 +90687,9 @@ bnx
boX
bqk
brr
adf
aes
aer
afF
aes
bvS
bwP
byt