From 302b241be2f9adab1a3a0b3340a38f5e6a6c294e Mon Sep 17 00:00:00 2001 From: Fghj240 <43589874+Fghj240@users.noreply.github.com> Date: Sat, 22 Nov 2025 08:29:02 -0800 Subject: [PATCH] NT Frontier lets you refund researched nodes (#94074) ## About The Pull Request If you research a node you can still buy it from NT Frontier, and when you do it refunds the research points you spent. It's like how experi-scanners work. Also cytology gives you an 80 point discount instead of a 120 point discount. This doesn't change anything because it only costs 80 points and NT Frontier boosts can't make costs go negative. ## Why It's Good For The Game Right now it's most efficient to delay research until ordnance gets finished and then grab all the free stuff, and any head of staff researching stuff for their own deparment or robo that wants to make cool mechs can fuck things up. That's not great, because it's unrealistic to expect everyone to be coordinated and delaying research never gets tried in practice. Also, doing ordnance after the round has been going on for a while is way less effective because all of the nodes you would've discounted were already researched. ## Changelog :cl: balance: NT Frontier can purchase and refund researched techweb nodes. /:cl: --------- Co-authored-by: Fghj240 --- code/__DEFINES/research.dm | 1 + .../file_system/programs/frontier.dm | 8 +++++--- code/modules/research/ordnance/_scipaper.dm | 12 +++++++++--- code/modules/research/ordnance/scipaper_partner.dm | 2 +- code/modules/research/techweb/_techweb_node.dm | 2 +- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/code/__DEFINES/research.dm b/code/__DEFINES/research.dm index c78b4938621..96a2c74ef8b 100644 --- a/code/__DEFINES/research.dm +++ b/code/__DEFINES/research.dm @@ -79,6 +79,7 @@ #define SCIENTIFIC_COOPERATION_PURCHASE_MULTIPLIER 0.01 /// How much money is one point of gain worth. #define SCIPAPER_GAIN_TO_MONEY 125 +#define SCIPAPER_ALREADY_BOUGHT 2 ///Connects the 'server_var' to a valid research server on your Z level. ///Used for machines in LateInitialize, to ensure that RND servers are loaded first. diff --git a/code/modules/modular_computers/file_system/programs/frontier.dm b/code/modules/modular_computers/file_system/programs/frontier.dm index 9df0e2d9160..34bcbca8027 100644 --- a/code/modules/modular_computers/file_system/programs/frontier.dm +++ b/code/modules/modular_computers/file_system/programs/frontier.dm @@ -155,7 +155,8 @@ else data["relations"][partner.type] = "Undefined" data["purchaseableBoosts"][partner.type] = list() - for(var/node_id in linked_techweb.get_available_nodes()) + var/displayable_nodes = linked_techweb.get_available_nodes() + linked_techweb.get_researched_nodes() + for(var/node_id in displayable_nodes) // Not from our partner if(!(node_id in partner.boostable_nodes)) continue @@ -218,8 +219,9 @@ var/datum/scientific_partner/partner = locate(text2path(params["boost_seller"])) in SSresearch.scientific_partners var/datum/techweb_node/node = SSresearch.techweb_node_by_id(params["purchased_boost"]) if(partner && node) - if(partner.purchase_boost(linked_techweb, node)) - computer.say("Purchase successful.") + var/possible_boost = partner.purchase_boost(linked_techweb, node) + if(possible_boost) + computer.say("Purchase successful[possible_boost == SCIPAPER_ALREADY_BOUGHT ? ", refunding [partner.boostable_nodes[params["purchased_boost"]]] points" : ""].") playsound(computer, 'sound/machines/ping.ogg', 25) return TRUE playsound(computer, 'sound/machines/terminal/terminal_error.ogg', 25) diff --git a/code/modules/research/ordnance/_scipaper.dm b/code/modules/research/ordnance/_scipaper.dm index 7d3ea79b332..0b5efc03e10 100644 --- a/code/modules/research/ordnance/_scipaper.dm +++ b/code/modules/research/ordnance/_scipaper.dm @@ -290,17 +290,23 @@ var/list/boostable_nodes = list() /datum/scientific_partner/proc/purchase_boost(datum/techweb/purchasing_techweb, datum/techweb_node/node) - if(!allowed_to_boost(purchasing_techweb, node.id)) + var/possible_boost = allowed_to_boost(purchasing_techweb, node.id) + if(!possible_boost) return FALSE purchasing_techweb.boost_techweb_node(node, list(TECHWEB_POINT_TYPE_GENERIC = boostable_nodes[node.id])) purchasing_techweb.scientific_cooperation[type] -= boostable_nodes[node.id] * SCIENTIFIC_COOPERATION_PURCHASE_MULTIPLIER + if(possible_boost == SCIPAPER_ALREADY_BOUGHT) /// Refund the original price + purchasing_techweb.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = boostable_nodes[node.id])) + return SCIPAPER_ALREADY_BOUGHT return TRUE /datum/scientific_partner/proc/allowed_to_boost(datum/techweb/purchasing_techweb, node_id) if(purchasing_techweb.scientific_cooperation[type] < (boostable_nodes[node_id] * SCIENTIFIC_COOPERATION_PURCHASE_MULTIPLIER)) // Too expensive return FALSE - if(!(node_id in purchasing_techweb.get_available_nodes())) // Not currently available - return FALSE if((TECHWEB_POINT_TYPE_GENERIC in purchasing_techweb.boosted_nodes[node_id]) && (purchasing_techweb.boosted_nodes[node_id][TECHWEB_POINT_TYPE_GENERIC] >= boostable_nodes[node_id])) // Already bought or we have a bigger discount return FALSE + if(node_id in purchasing_techweb.researched_nodes) + return SCIPAPER_ALREADY_BOUGHT + if(!(node_id in purchasing_techweb.get_available_nodes())) // Not currently available + return FALSE return TRUE diff --git a/code/modules/research/ordnance/scipaper_partner.dm b/code/modules/research/ordnance/scipaper_partner.dm index 5bbe3e7d627..39d1cc68ed4 100644 --- a/code/modules/research/ordnance/scipaper_partner.dm +++ b/code/modules/research/ordnance/scipaper_partner.dm @@ -54,7 +54,7 @@ TECHWEB_NODE_CYBER_ORGANS = TECHWEB_TIER_2_POINTS, TECHWEB_NODE_CYBER_ORGANS_UPGRADED = TECHWEB_TIER_3_POINTS, TECHWEB_NODE_MEDBAY_EQUIP_ADV = TECHWEB_TIER_3_POINTS, - TECHWEB_NODE_CYTOLOGY = TECHWEB_TIER_3_POINTS, + TECHWEB_NODE_CYTOLOGY = TECHWEB_TIER_2_POINTS, TECHWEB_NODE_BORG_MEDICAL = TECHWEB_TIER_3_POINTS, TECHWEB_NODE_COMBAT_IMPLANTS = TECHWEB_TIER_4_POINTS, ) diff --git a/code/modules/research/techweb/_techweb_node.dm b/code/modules/research/techweb/_techweb_node.dm index 2a6eb8b7b7d..104e475b7e5 100644 --- a/code/modules/research/techweb/_techweb_node.dm +++ b/code/modules/research/techweb/_techweb_node.dm @@ -92,7 +92,7 @@ if(host.completed_experiments[experiment_type]) //do we have this discount_experiment unlocked? actual_costs[cost_type] -= discount_experiments[experiment_type] - if(host.boosted_nodes[id]) // Boosts should be subservient to experiments. Discount from boosts are capped when costs fall below 250. + if(host.boosted_nodes[id]) // Boosts should be subservient to experiments. var/list/boostlist = host.boosted_nodes[id] for(var/booster in boostlist) if(actual_costs[booster])