diff --git a/code/controllers/subsystem/research.dm b/code/controllers/subsystem/research.dm index 2f4efd1b5734..06c8e6305975 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.remove_stored_point_type(i, boost_amt) science_tech.add_point_list(bitcoins) last_income = world.time 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 diff --git a/code/modules/research/techweb/_techweb.dm b/code/modules/research/techweb/_techweb.dm index 0c1a0ce2515b..c4c7b8417602 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, 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, 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, stored_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)