Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions code/controllers/subsystem/research.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions code/game/machinery/doppler_array.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand All @@ -136,4 +136,4 @@ GLOBAL_LIST_EMPTY(doppler_arrays)

/obj/machinery/doppler_array/research/science/Initialize()
. = ..()
linked_techweb = SSresearch.science_tech
linked_techweb = SSresearch.science_tech
21 changes: 21 additions & 0 deletions code/modules/research/techweb/_techweb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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)

Expand Down