From def79dbb0be7346cda9652b527a62646f417bb56 Mon Sep 17 00:00:00 2001 From: boodaliboo <40642354+boodaliboo@users.noreply.github.com> Date: Sat, 15 Aug 2020 06:30:34 -0700 Subject: [PATCH] ports researching boosting nanites (#9451) * Update utility.dm * Update nanite_designs.dm * Update all_nodes.dm * Update nanites.dm --- .../subsystem/processing/nanites.dm | 5 +- .../research/designs/nanite_designs.dm | 14 ++++++ .../nanites/nanite_programs/utility.dm | 47 +++++++++++++++++++ code/modules/research/techweb/all_nodes.dm | 4 +- 4 files changed, 66 insertions(+), 4 deletions(-) diff --git a/code/controllers/subsystem/processing/nanites.dm b/code/controllers/subsystem/processing/nanites.dm index 69bd5781debb..349b85cf5bfc 100644 --- a/code/controllers/subsystem/processing/nanites.dm +++ b/code/controllers/subsystem/processing/nanites.dm @@ -6,7 +6,8 @@ PROCESSING_SUBSYSTEM_DEF(nanites) var/list/datum/nanite_cloud_backup/cloud_backups = list() var/list/mob/living/nanite_monitored_mobs = list() var/list/datum/nanite_program/relay/nanite_relays = list() - + var/neural_network_count = 0 + /datum/controller/subsystem/processing/nanites/proc/check_hardware(datum/nanite_cloud_backup/backup) if(QDELETED(backup.storage) || (backup.storage.stat & (NOPOWER|BROKEN))) return FALSE @@ -18,4 +19,4 @@ PROCESSING_SUBSYSTEM_DEF(nanites) if(!force && !check_hardware(backup)) return if(backup.cloud_id == cloud_id) - return backup \ No newline at end of file + return backup diff --git a/code/modules/research/designs/nanite_designs.dm b/code/modules/research/designs/nanite_designs.dm index d17ec6a4cf2d..3532db39b3d9 100644 --- a/code/modules/research/designs/nanite_designs.dm +++ b/code/modules/research/designs/nanite_designs.dm @@ -25,6 +25,20 @@ program_type = /datum/nanite_program/viral category = list("Utility Nanites") +/datum/design/nanites/research + name = "Distributed Computing" + desc = "The nanites aid the research servers by performing a portion of its calculations, increasing research point generation." + id = "research_nanites" + program_type = /datum/nanite_program/research + category = list("Utility Nanites") + +/datum/design/nanites/researchplus + name = "Neural Network" + desc = "The nanites link the host's brains together forming a neural research network, that becomes more efficient with the amount of total hosts. Can be overloaded to increase research output." + id = "researchplus_nanites" + program_type = /datum/nanite_program/researchplus + category = list("Utility Nanites") + /datum/design/nanites/monitoring name = "Monitoring" desc = "The nanites monitor the host's vitals and location, sending them to the suit sensor network." diff --git a/code/modules/research/nanites/nanite_programs/utility.dm b/code/modules/research/nanites/nanite_programs/utility.dm index 3734f09091f6..c9a11fec6bfe 100644 --- a/code/modules/research/nanites/nanite_programs/utility.dm +++ b/code/modules/research/nanites/nanite_programs/utility.dm @@ -207,6 +207,53 @@ /datum/nanite_program/metabolic_synthesis/active_effect() host_mob.adjust_nutrition(-0.5) +/datum/nanite_program/research + name = "Distributed Computing" + desc = "The nanites aid the research servers by performing a portion of its calculations, increasing research point generation." + use_rate = 0.2 + rogue_types = list(/datum/nanite_program/toxic) + +/datum/nanite_program/research/active_effect() + if(!iscarbon(host_mob)) + return + var/points = 1 + if(!host_mob.client) //less brainpower + points *= 0.25 + SSresearch.science_tech.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = points)) + +/datum/nanite_program/researchplus + name = "Neural Network" + desc = "The nanites link the host's brains together forming a neural research network, that becomes more efficient with the amount of total hosts." + use_rate = 0.3 + rogue_types = list(/datum/nanite_program/brain_decay) + +/datum/nanite_program/researchplus/enable_passive_effect() + . = ..() + if(!iscarbon(host_mob)) + return + if(host_mob.client) + SSnanites.neural_network_count++ + else + SSnanites.neural_network_count += 0.25 + +/datum/nanite_program/researchplus/disable_passive_effect() + . = ..() + if(!iscarbon(host_mob)) + return + if(host_mob.client) + SSnanites.neural_network_count-- + else + SSnanites.neural_network_count -= 0.25 + +/datum/nanite_program/researchplus/active_effect() + if(!iscarbon(host_mob)) + return + var/mob/living/carbon/C = host_mob + var/points = round(SSnanites.neural_network_count / 12, 0.1) + if(!C.client) //less brainpower + points *= 0.25 + SSresearch.science_tech.add_point_list(list(TECHWEB_POINT_TYPE_GENERIC = points)) + /datum/nanite_program/triggered/access name = "Subdermal ID" desc = "The nanites store the host's ID access rights in a subdermal magnetic strip. Updates when triggered, copying the host's current access." diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index 3e68dd5470ba..81f9b01490c7 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -931,7 +931,7 @@ display_name = "Smart Nanite Programming" description = "Nanite programs that require nanites to perform complex actions, act independently, roam or seek targets." prereq_ids = list("nanite_base","adv_robotics") - design_ids = list("purging_nanites", "metabolic_nanites", "stealth_nanites", "memleak_nanites","sensor_voice_nanites", "voice_nanites") + design_ids = list("purging_nanites", "research_nanites", "metabolic_nanites", "stealth_nanites", "memleak_nanites","sensor_voice_nanites", "voice_nanites") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2000) export_price = 4000 @@ -977,7 +977,7 @@ display_name = "Harmonic Nanite Programming" description = "Nanite programs that require seamless integration between nanites and biology." prereq_ids = list("nanite_bio","nanite_smart","nanite_mesh") - design_ids = list("fakedeath_nanites","aggressive_nanites","defib_nanites","regenerative_plus_nanites","brainheal_plus_nanites","purging_plus_nanites","adrenaline_nanites") + design_ids = list("fakedeath_nanites","researchplus_nanites","aggressive_nanites","defib_nanites","regenerative_plus_nanites","brainheal_plus_nanites","purging_plus_nanites","adrenaline_nanites") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 4000) export_price = 8000