diff --git a/code/modules/research/designs/nanite_designs.dm b/code/modules/research/designs/nanite_designs.dm index b157d0c349..133b43e6a9 100644 --- a/code/modules/research/designs/nanite_designs.dm +++ b/code/modules/research/designs/nanite_designs.dm @@ -113,7 +113,7 @@ /datum/design/nanites/spreading name = "Infective Exo-Locomotion" desc = "The nanites gain the ability to survive for brief periods outside of the human body, as well as the ability to start new colonies without an integration process; \ - resulting in an extremely infective strain of nanites." + resulting in an extremely infective strain of nanites. Bypasses antiviral defense" id = "spreading_nanites" program_type = /datum/nanite_program/spreading category = list("Utility Nanites") @@ -133,6 +133,21 @@ program_type = /datum/nanite_program/mitosis category = list("Utility Nanites") +/datum/design/nanites/antiviral + name = "Enhanced Error Correction" + desc = "The nanites self-propagate and replicate their program storage memory, preventing viral takeovers." + id = "antiviral_nanites" + program_type = /datum/nanite_program/antiviral + category = list("Utility Nanites") + +/datum/design/nanites/hostile_lockdown + name = "Hostile Lockdown" + desc = "The nanites constantly encrypt and scramble their own control sectors, preventing consoles from controlling them. Furthermore, \ + if the host happens to be a synthetic organism with innate control over nanite strains, this will prevent them from acting on the nanites as well." + id = "hostile_lockdown" + program_type = /datum/nanite_program/hostile_lockdown + category = list("Utility Nanites") + ////////////////////MEDICAL NANITES////////////////////////////////////// /datum/design/nanites/regenerative name = "Accelerated Regeneration" diff --git a/code/modules/research/nanites/nanite_programs/utility.dm b/code/modules/research/nanites/nanite_programs/utility.dm index f5372738db..eb76534f11 100644 --- a/code/modules/research/nanites/nanite_programs/utility.dm +++ b/code/modules/research/nanites/nanite_programs/utility.dm @@ -16,7 +16,7 @@ var/datum/nanite_extra_setting/program = extra_settings[NES_PROGRAM_OVERWRITE] var/datum/nanite_extra_setting/cloud = extra_settings[NES_CLOUD_OVERWRITE] for(var/mob/M in orange(host_mob, 5)) - if(SEND_SIGNAL(M, COMSIG_NANITE_IS_STEALTHY)) + if(SEND_SIGNAL(M, COMSIG_NANITE_CHECK_VIRAL_PROTECTION)) continue switch(program.get_value()) if("Overwrite") @@ -350,3 +350,66 @@ /datum/action/innate/nanite_button/Activate() program.press() + +/datum/nanite_program/lockout + unique = TRUE + var/emp_disable_time = 0 + var/shock_disbale_time = 0 + var/minor_shock_disable_time = 0 + var/disable_time = 0 + var/lock_console = FALSE + var/lock_virus = FALSE + var/lock_host = FALSE + +/datum/nanite_program/lockout/enable_passive_effect() + . = ..() + if(lock_console) + Registersignal(src, COMSIG_NANITE_INTERNAL_CONSOLE_LOCK_CHECK, .proc/check_antivirus) + if(lock_host) + Registersignal(src, COMSIG_NANITE_INTERNAL_HOST_LOCK_CHECK, .proc/check_antivirus) + if(lock_virus) + Registersignal(src, COMSIG_NANITE_INTERNAL_VIRUS_LOCK_CHECK, .proc/check_antivirus) + +/datum/nanite_program/lockout/disable_passive_effect() + . = ..() + UnregisterSignal(src, list( + COMSIG_NANITE_INTERNAL_HOST_LOCK_CHECK, + COMSIG_NANITE_INTERNAL_CONSOLE_LOCK_CHECK, + COMSIG_NANITE_INTERNAL_ANTI_VIRAL_CHECK + )) + +/datum/nanite_program/lockout/on_emp(severity) + // no parent call on purpose + disable_time = max(disable_time, world.time + emp_disable_time) + +/datum/nanite_program/lockout/on_shock(shock_damage) + // no parent call on purpose + disable_time = max(disable_time, world.time + shock_disable_time) + +/datum/nanite_program/lockout/on_minor_shock() + // no parent call on purpose + disable_time = max(disable_time, world.time + minor_shock_disable_time) + +/datum/nanite_program/lockout/proc/check_antivirus() + return (world.time <= disable_time)? NANITE_CHANGES_LOCKED : NONE + +/datum/nanite_program/lockout/antiviral + name = "Enhanced Error Correction" + desc = "Through expensive CRC checking and replication, prevents viral takeover of the nanite strain's control sectors. \ + Temporarily disabled by EMPs and shocks." + use_rate = 0.5 + emp_disable_time = 3 MINUTES + shock_disable_time = 45 SECONDS + minor_shock_disable_time = 10 SECONDS + lock_virus = TRUE + +/datum/nanite_program/lockout/hostile_lockdown + name = "Hostile Lockdown" + desc = "Constantly encrypts and scrambles the nanites' control memory, preventing consoles from modifying them and also locking out conscious host control of the nanite strain, if the host happens to be capable of that. \ + Temporarily disabled by EMPs and shocks." + use_rate = 0.5 + emp_disable_time = 3 MINUTES + shock_disable_time = 1 MINUTES + minor_shock_disable_time = 15 SECONDS + lock_host = TRUE + lock_console = TRUE diff --git a/code/modules/research/techweb/nodes/nanites_nodes.dm b/code/modules/research/techweb/nodes/nanites_nodes.dm index 0a860c8938..024a384ef1 100644 --- a/code/modules/research/techweb/nodes/nanites_nodes.dm +++ b/code/modules/research/techweb/nodes/nanites_nodes.dm @@ -23,7 +23,7 @@ display_name = "Mesh Nanite Programming" description = "Nanite programs that require static structures and membranes." prereq_ids = list("nanite_base","engineering") - design_ids = list("hardening_nanites", "dermal_button_nanites", "refractive_nanites", "cryo_nanites", "conductive_nanites", "shock_nanites", "emp_nanites", "temperature_nanites") + design_ids = list("hardening_nanites", "dermal_button_nanites", "refractive_nanites", "cryo_nanites", "conductive_nanites", "shock_nanites", "emp_nanites", "temperature_nanites", "antiviral_nanites", "hostile_lockdown") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) /datum/techweb_node/nanite_bio