From 8e90ecbbd3bb2f4e39c5094a23a02d66a25159ff Mon Sep 17 00:00:00 2001 From: Theos Date: Tue, 14 Jun 2022 19:22:25 -0400 Subject: [PATCH 1/5] h boy this is going to b efun --- code/game/machinery/doppler_array.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/machinery/doppler_array.dm b/code/game/machinery/doppler_array.dm index 86d8e41a9d61..b6d11deeb55e 100644 --- a/code/game/machinery/doppler_array.dm +++ b/code/game/machinery/doppler_array.dm @@ -126,8 +126,8 @@ GLOBAL_LIST_EMPTY(doppler_arrays) var/datum/bank_account/D = SSeconomy.get_dep_account(ACCOUNT_CAR) if(D) D.adjust_money(point_gain) - linked_techweb.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, point_gain) - say("Explosion details and mixture analyzed and sold to the highest bidder for $[point_gain], with a reward of [point_gain] points.") + linked_techweb.add_stored_point_type(TECHWEB_POINT_TYPE_DEFAULT, point_gain) + say("Explosion details and mixture analyzed and sold to the highest bidder for $[point_gain], with a reward of [point_gain] points to be processed by research servers.") else //you've made smaller bombs say("Data already captured. Aborting.") @@ -136,4 +136,4 @@ GLOBAL_LIST_EMPTY(doppler_arrays) /obj/machinery/doppler_array/research/science/Initialize() . = ..() - linked_techweb = SSresearch.science_tech \ No newline at end of file + linked_techweb = SSresearch.science_tech From 12a34cd1a34430bacf940e1961d9b21c30cfbd3e Mon Sep 17 00:00:00 2001 From: Theos Date: Tue, 14 Jun 2022 19:47:03 -0400 Subject: [PATCH 2/5] Update research.dm --- code/controllers/subsystem/research.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/controllers/subsystem/research.dm b/code/controllers/subsystem/research.dm index 2f4efd1b5734..a5f5d8f54ebd 100644 --- a/code/controllers/subsystem/research.dm +++ b/code/controllers/subsystem/research.dm @@ -73,6 +73,10 @@ SUBSYSTEM_DEF(research) science_tech.last_bitcoins = bitcoins // Doesn't take tick drift into account for(var/i in bitcoins) bitcoins[i] *= income_time_difference / 10 + if(science_tech.stored_research_points[i]) + var/boost_amt = clamp(0, bitcoins[i], science_tech.stored_research_points[i]) //up to 2x research speed when burning stored research + bitcoins[i] += boost_amt + science_tech.stored_research_points.remove_stored_point_type(i, boost_amt) science_tech.add_point_list(bitcoins) last_income = world.time From e09e01debd0efc2b97b008353bfadb675a8f8bbb Mon Sep 17 00:00:00 2001 From: Theos Date: Tue, 14 Jun 2022 19:47:05 -0400 Subject: [PATCH 3/5] Update _techweb.dm --- code/modules/research/techweb/_techweb.dm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/code/modules/research/techweb/_techweb.dm b/code/modules/research/techweb/_techweb.dm index 0c1a0ce2515b..bfe4612b6d4c 100644 --- a/code/modules/research/techweb/_techweb.dm +++ b/code/modules/research/techweb/_techweb.dm @@ -14,6 +14,7 @@ var/list/hidden_nodes = list() //Hidden nodes. id = TRUE. Used for unhiding nodes when requirements are met by removing the entry of the node. var/list/deconstructed_items = list() //items already deconstructed for a generic point boost. path = list(point_type = points) var/list/research_points = list() //Available research points. type = number + var/list/stored_research_points = list() //Stored research, up to doubles server mining when present. type = number var/list/obj/machinery/computer/rdconsole/consoles_accessing = list() var/id = "generic" var/list/research_logs = list() //IC logs. @@ -142,6 +143,7 @@ /datum/techweb/proc/get_researched_nodes() return researched_nodes - hidden_nodes +/// procs for modifying a specific point type amount /datum/techweb/proc/add_point_type(type, amount) if(!SSresearch.point_types[type] || (amount <= 0)) return FALSE @@ -160,6 +162,25 @@ research_points[type] = max(0, research_points[type] - amount) return TRUE +/// procs for modifying a specific point type's stored research amount +/datum/techweb/proc/add_stored_point_type(type, amount) + if(!SSresearch.point_types[type] || (amount <= 0)) + return FALSE + stored_research_points[type] = max(0, research_points[type] + amount) + return TRUE + +/datum/techweb/proc/modify_stored_point_type(type, amount) + if(!SSresearch.point_types[type]) + return FALSE + stored_research_points[type] = max(0, research_points[type] + amount) + return TRUE + +/datum/techweb/proc/remove_stored_point_type(type, amount) + if(!SSresearch.point_types[type] || (amount <= 0)) + return FALSE + stored_research_points[type] = max(0, research_points[type] - amount) + return TRUE + /datum/techweb/proc/add_design_by_id(id, custom = FALSE) return add_design(SSresearch.techweb_design_by_id(id), custom) From e3826e5fd8f56ff2bfdcd560984d21260641ae6d Mon Sep 17 00:00:00 2001 From: Theos Date: Tue, 14 Jun 2022 19:53:26 -0400 Subject: [PATCH 4/5] Update research.dm --- code/controllers/subsystem/research.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/controllers/subsystem/research.dm b/code/controllers/subsystem/research.dm index a5f5d8f54ebd..06c8e6305975 100644 --- a/code/controllers/subsystem/research.dm +++ b/code/controllers/subsystem/research.dm @@ -76,7 +76,7 @@ SUBSYSTEM_DEF(research) if(science_tech.stored_research_points[i]) var/boost_amt = clamp(0, bitcoins[i], science_tech.stored_research_points[i]) //up to 2x research speed when burning stored research bitcoins[i] += boost_amt - science_tech.stored_research_points.remove_stored_point_type(i, boost_amt) + science_tech.remove_stored_point_type(i, boost_amt) science_tech.add_point_list(bitcoins) last_income = world.time From 0542a3e0b4b5df52a6773e2e1c289659ec73e291 Mon Sep 17 00:00:00 2001 From: Theos Date: Sat, 18 Jun 2022 08:24:30 -0400 Subject: [PATCH 5/5] nearly caused an incident --- code/modules/research/techweb/_techweb.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/research/techweb/_techweb.dm b/code/modules/research/techweb/_techweb.dm index bfe4612b6d4c..c4c7b8417602 100644 --- a/code/modules/research/techweb/_techweb.dm +++ b/code/modules/research/techweb/_techweb.dm @@ -166,19 +166,19 @@ /datum/techweb/proc/add_stored_point_type(type, amount) if(!SSresearch.point_types[type] || (amount <= 0)) return FALSE - stored_research_points[type] = max(0, research_points[type] + amount) + stored_research_points[type] = max(0, stored_research_points[type] + amount) return TRUE /datum/techweb/proc/modify_stored_point_type(type, amount) if(!SSresearch.point_types[type]) return FALSE - stored_research_points[type] = max(0, research_points[type] + amount) + stored_research_points[type] = max(0, stored_research_points[type] + amount) return TRUE /datum/techweb/proc/remove_stored_point_type(type, amount) if(!SSresearch.point_types[type] || (amount <= 0)) return FALSE - stored_research_points[type] = max(0, research_points[type] - amount) + stored_research_points[type] = max(0, stored_research_points[type] - amount) return TRUE /datum/techweb/proc/add_design_by_id(id, custom = FALSE)