Merge pull request #10569 from keronshb/RemoteMoodResearch

Ports the Nanite Remote, Nanite Mood Programs + Rebalance, and the Research Generating Nanites
This commit is contained in:
kevinz000
2020-01-17 14:24:13 -07:00
committed by GitHub
16 changed files with 949 additions and 603 deletions

View File

@@ -292,6 +292,7 @@
//Nanites //Nanites
#define COMSIG_HAS_NANITES "has_nanites" //() returns TRUE if nanites are found #define COMSIG_HAS_NANITES "has_nanites" //() returns TRUE if nanites are found
#define COMSIG_NANITE_IS_STEALTHY "nanite_is_stealthy" //() returns TRUE if nanites have stealth
#define COMSIG_NANITE_GET_PROGRAMS "nanite_get_programs" //(list/nanite_programs) - makes the input list a copy the nanites' program list #define COMSIG_NANITE_GET_PROGRAMS "nanite_get_programs" //(list/nanite_programs) - makes the input list a copy the nanites' program list
#define COMSIG_NANITE_SET_VOLUME "nanite_set_volume" //(amount) Sets current nanite volume to the given amount #define COMSIG_NANITE_SET_VOLUME "nanite_set_volume" //(amount) Sets current nanite volume to the given amount
#define COMSIG_NANITE_ADJUST_VOLUME "nanite_adjust" //(amount) Adjusts nanite volume by the given amount #define COMSIG_NANITE_ADJUST_VOLUME "nanite_adjust" //(amount) Adjusts nanite volume by the given amount
@@ -300,6 +301,7 @@
#define COMSIG_NANITE_SET_SAFETY "nanite_set_safety" //(amount) Sets safety threshold to the given amount #define COMSIG_NANITE_SET_SAFETY "nanite_set_safety" //(amount) Sets safety threshold to the given amount
#define COMSIG_NANITE_SET_REGEN "nanite_set_regen" //(amount) Sets regeneration rate to the given amount #define COMSIG_NANITE_SET_REGEN "nanite_set_regen" //(amount) Sets regeneration rate to the given amount
#define COMSIG_NANITE_SIGNAL "nanite_signal" //(code(1-9999)) Called when sending a nanite signal to a mob. #define COMSIG_NANITE_SIGNAL "nanite_signal" //(code(1-9999)) Called when sending a nanite signal to a mob.
#define COMSIG_NANITE_COMM_SIGNAL "nanite_comm_signal" //(comm_code(1-9999), comm_message) Called when sending a nanite comm signal to a mob.
#define COMSIG_NANITE_SCAN "nanite_scan" //(mob/user, full_scan) - sends to chat a scan of the nanites to the user, returns TRUE if nanites are detected #define COMSIG_NANITE_SCAN "nanite_scan" //(mob/user, full_scan) - sends to chat a scan of the nanites to the user, returns TRUE if nanites are detected
#define COMSIG_NANITE_UI_DATA "nanite_ui_data" //(list/data, scan_level) - adds nanite data to the given data list - made for ui_data procs #define COMSIG_NANITE_UI_DATA "nanite_ui_data" //(list/data, scan_level) - adds nanite data to the given data list - made for ui_data procs
#define COMSIG_NANITE_ADD_PROGRAM "nanite_add_program" //(datum/nanite_program/new_program, datum/nanite_program/source_program) Called when adding a program to a nanite component #define COMSIG_NANITE_ADD_PROGRAM "nanite_add_program" //(datum/nanite_program/new_program, datum/nanite_program/source_program) Called when adding a program to a nanite component

View File

@@ -37,6 +37,7 @@
/datum/component/nanites/RegisterWithParent() /datum/component/nanites/RegisterWithParent()
. = ..() . = ..()
RegisterSignal(parent, COMSIG_HAS_NANITES, .proc/confirm_nanites) RegisterSignal(parent, COMSIG_HAS_NANITES, .proc/confirm_nanites)
RegisterSignal(parent, COMSIG_NANITE_IS_STEALTHY, .proc/check_stealth)
RegisterSignal(parent, COMSIG_NANITE_UI_DATA, .proc/nanite_ui_data) RegisterSignal(parent, COMSIG_NANITE_UI_DATA, .proc/nanite_ui_data)
RegisterSignal(parent, COMSIG_NANITE_GET_PROGRAMS, .proc/get_programs) RegisterSignal(parent, COMSIG_NANITE_GET_PROGRAMS, .proc/get_programs)
RegisterSignal(parent, COMSIG_NANITE_SET_VOLUME, .proc/set_volume) RegisterSignal(parent, COMSIG_NANITE_SET_VOLUME, .proc/set_volume)
@@ -57,10 +58,12 @@
RegisterSignal(parent, COMSIG_LIVING_MINOR_SHOCK, .proc/on_minor_shock) RegisterSignal(parent, COMSIG_LIVING_MINOR_SHOCK, .proc/on_minor_shock)
RegisterSignal(parent, COMSIG_SPECIES_GAIN, .proc/check_viable_biotype) RegisterSignal(parent, COMSIG_SPECIES_GAIN, .proc/check_viable_biotype)
RegisterSignal(parent, COMSIG_NANITE_SIGNAL, .proc/receive_signal) RegisterSignal(parent, COMSIG_NANITE_SIGNAL, .proc/receive_signal)
RegisterSignal(parent, COMSIG_NANITE_COMM_SIGNAL, .proc/receive_comm_signal)
/datum/component/nanites/UnregisterFromParent() /datum/component/nanites/UnregisterFromParent()
. = ..() . = ..()
UnregisterSignal(parent, list(COMSIG_HAS_NANITES, UnregisterSignal(parent, list(COMSIG_HAS_NANITES,
COMSIG_NANITE_IS_STEALTHY,
COMSIG_NANITE_UI_DATA, COMSIG_NANITE_UI_DATA,
COMSIG_NANITE_GET_PROGRAMS, COMSIG_NANITE_GET_PROGRAMS,
COMSIG_NANITE_SET_VOLUME, COMSIG_NANITE_SET_VOLUME,
@@ -79,7 +82,8 @@
COMSIG_LIVING_MINOR_SHOCK, COMSIG_LIVING_MINOR_SHOCK,
COMSIG_MOVABLE_HEAR, COMSIG_MOVABLE_HEAR,
COMSIG_SPECIES_GAIN, COMSIG_SPECIES_GAIN,
COMSIG_NANITE_SIGNAL)) COMSIG_NANITE_SIGNAL,
COMSIG_NANITE_COMM_SIGNAL))
/datum/component/nanites/Destroy() /datum/component/nanites/Destroy()
STOP_PROCESSING(SSnanites, src) STOP_PROCESSING(SSnanites, src)
@@ -188,6 +192,9 @@
var/datum/nanite_program/NP = X var/datum/nanite_program/NP = X
NP.on_minor_shock() NP.on_minor_shock()
/datum/component/nanites/proc/check_stealth(datum/source)
return stealth
/datum/component/nanites/proc/on_death(datum/source, gibbed) /datum/component/nanites/proc/on_death(datum/source, gibbed)
for(var/X in programs) for(var/X in programs)
var/datum/nanite_program/NP = X var/datum/nanite_program/NP = X
@@ -198,6 +205,12 @@
var/datum/nanite_program/NP = X var/datum/nanite_program/NP = X
NP.receive_signal(code, source) NP.receive_signal(code, source)
/datum/component/nanites/proc/receive_comm_signal(datum/source, comm_code, comm_message, comm_source = "an unidentified source")
for(var/X in programs)
if(istype(X, /datum/nanite_program/triggered/comm))
var/datum/nanite_program/triggered/comm/NP = X
NP.receive_comm_signal(comm_code, comm_message, comm_source)
/datum/component/nanites/proc/check_viable_biotype() /datum/component/nanites/proc/check_viable_biotype()
if(!(MOB_ORGANIC in host_mob.mob_biotypes) && !(MOB_UNDEAD in host_mob.mob_biotypes)) if(!(MOB_ORGANIC in host_mob.mob_biotypes) && !(MOB_UNDEAD in host_mob.mob_biotypes))
qdel(src) //bodytype no longer sustains nanites qdel(src) //bodytype no longer sustains nanites

View File

@@ -239,7 +239,14 @@
mood_change = -3 mood_change = -3
timeout = 1000 timeout = 1000
/datum/mood_event/nanite_sadness
description = "<span class='warning robot'>+++++++HAPPINESS SUPPRESSION+++++++</span>\n"
mood_change = -7
/datum/mood_event/daylight_2 /datum/mood_event/daylight_2
description = "<span class='boldwarning'>I have been scorched by the unforgiving rays of the sun.</span>\n" description = "<span class='boldwarning'>I have been scorched by the unforgiving rays of the sun.</span>\n"
mood_change = -6 mood_change = -6
timeout = 1200 timeout = 1200
/datum/mood_event/nanite_sadness/add_effects(message)
description = "<span class='warning robot'>+++++++[message]+++++++</span>\n"

View File

@@ -142,6 +142,16 @@
mood_change = 2 mood_change = 2
timeout = 15 MINUTES timeout = 15 MINUTES
/datum/mood_event/nanite_happiness
description = "<span class='nicegreen robot'>+++++++HAPPINESS ENHANCEMENT+++++++</span>\n"
mood_change = 7
/datum/mood_event/nanite_happiness/add_effects(message)
description = "<span class='nicegreen robot'>+++++++[message]+++++++</span>\n"
/datum/mood_event/area
description = "" //Fill this out in the area
mood_change = 0
//Power gamer stuff below //Power gamer stuff below
/datum/mood_event/drankblood /datum/mood_event/drankblood
description = "<span class='nicegreen'>I have fed greedly from that which nourishes me.</span>\n" description = "<span class='nicegreen'>I have fed greedly from that which nourishes me.</span>\n"

View File

@@ -46,6 +46,16 @@
category = list("Electronics") category = list("Electronics")
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
/datum/design/nanite_comm_remote
name = "Nanite Communication Remote"
desc = "Allows for the construction of a nanite communication remote."
id = "nanite_comm_remote"
build_type = PROTOLATHE
materials = list(MAT_GLASS = 500, MAT_METAL = 500)
build_path = /obj/item/nanite_remote/comm
category = list("Electronics")
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
/datum/design/nanite_scanner /datum/design/nanite_scanner
name = "Nanite Scanner" name = "Nanite Scanner"
desc = "Allows for the construction of a nanite scanner." desc = "Allows for the construction of a nanite scanner."

View File

@@ -380,7 +380,7 @@
name = "Mind Control" name = "Mind Control"
desc = "The nanites imprint an absolute directive onto the host's brain while they're active." desc = "The nanites imprint an absolute directive onto the host's brain while they're active."
id = "mindcontrol_nanites" id = "mindcontrol_nanites"
program_type = /datum/nanite_program/mind_control program_type = /datum/nanite_program/triggered/comm/mind_control
category = list("Weaponized Nanites") category = list("Weaponized Nanites")
////////////////////SUPPRESSION NANITES////////////////////////////////////// ////////////////////SUPPRESSION NANITES//////////////////////////////////////
@@ -445,21 +445,35 @@
name = "Skull Echo" name = "Skull Echo"
desc = "The nanites echo a synthesized message inside the host's skull." desc = "The nanites echo a synthesized message inside the host's skull."
id = "voice_nanites" id = "voice_nanites"
program_type = /datum/nanite_program/triggered/voice program_type = /datum/nanite_program/triggered/comm/voice
category = list("Suppression Nanites") category = list("Suppression Nanites")
/datum/design/nanites/speech /datum/design/nanites/speech
name = "Forced Speech" name = "Forced Speech"
desc = "The nanites force the host to say a pre-programmed sentence when triggered." desc = "The nanites force the host to say a pre-programmed sentence when triggered."
id = "speech_nanites" id = "speech_nanites"
program_type = /datum/nanite_program/triggered/speech program_type = /datum/nanite_program/triggered/comm/speech
category = list("Suppression Nanites") category = list("Suppression Nanites")
/datum/design/nanites/hallucination /datum/design/nanites/hallucination
name = "Hallucination" name = "Hallucination"
desc = "The nanites make the host see and hear things that aren't real." desc = "The nanites make the host see and hear things that aren't real."
id = "hallucination_nanites" id = "hallucination_nanites"
program_type = /datum/nanite_program/triggered/hallucination program_type = /datum/nanite_program/triggered/comm/hallucination
category = list("Suppression Nanites")
/datum/design/nanites/good_mood
name = "Happiness Enhancer"
desc = "The nanites synthesize serotonin inside the host's brain, creating an artificial sense of happiness."
id = "good_mood_nanites"
program_type = /datum/nanite_program/good_mood
category = list("Suppression Nanites")
/datum/design/nanites/bad_mood
name = "Happiness Suppressor"
desc = "The nanites suppress the production of serotonin inside the host's brain, creating an artificial state of depression."
id = "bad_mood_nanites"
program_type = /datum/nanite_program/bad_mood
category = list("Suppression Nanites") category = list("Suppression Nanites")
////////////////////SENSOR NANITES////////////////////////////////////// ////////////////////SENSOR NANITES//////////////////////////////////////

View File

@@ -3,7 +3,7 @@
/datum/nanite_program/regenerative /datum/nanite_program/regenerative
name = "Accelerated Regeneration" name = "Accelerated Regeneration"
desc = "The nanites boost the host's natural regeneration, increasing their healing speed. Does not consume nanites if the host is unharmed." desc = "The nanites boost the host's natural regeneration, increasing their healing speed. Does not consume nanites if the host is unharmed."
use_rate = 2.5 use_rate = 0.5
rogue_types = list(/datum/nanite_program/necrotic) rogue_types = list(/datum/nanite_program/necrotic)
/datum/nanite_program/regenerative/check_conditions() /datum/nanite_program/regenerative/check_conditions()
@@ -23,11 +23,11 @@
if(!parts.len) if(!parts.len)
return return
for(var/obj/item/bodypart/L in parts) for(var/obj/item/bodypart/L in parts)
if(L.heal_damage(1/parts.len, 1/parts.len)) if(L.heal_damage(0.5/parts.len, 0.5/parts.len, null, BODYPART_ORGANIC))
host_mob.update_damage_overlays() host_mob.update_damage_overlays()
else else
host_mob.adjustBruteLoss(-1, TRUE) host_mob.adjustBruteLoss(-0.5, TRUE)
host_mob.adjustFireLoss(-1, TRUE) host_mob.adjustFireLoss(-0.5, TRUE)
/datum/nanite_program/temperature /datum/nanite_program/temperature
name = "Temperature Adjustment" name = "Temperature Adjustment"
@@ -112,7 +112,7 @@
/datum/nanite_program/repairing /datum/nanite_program/repairing
name = "Mechanical Repair" name = "Mechanical Repair"
desc = "The nanites fix damage in the host's mechanical limbs." desc = "The nanites fix damage in the host's mechanical limbs."
use_rate = 0.5 //much more efficient than organic healing use_rate = 0.5
rogue_types = list(/datum/nanite_program/necrotic) rogue_types = list(/datum/nanite_program/necrotic)
/datum/nanite_program/repairing/check_conditions() /datum/nanite_program/repairing/check_conditions()
@@ -137,13 +137,13 @@
return return
var/update = FALSE var/update = FALSE
for(var/obj/item/bodypart/L in parts) for(var/obj/item/bodypart/L in parts)
if(L.heal_damage(1/parts.len, 1/parts.len, only_robotic = TRUE, only_organic = FALSE)) if(L.heal_damage(1.5/parts.len, 1.5/parts.len, null, BODYPART_ROBOTIC)) //much faster than organic healing
update = TRUE update = TRUE
if(update) if(update)
host_mob.update_damage_overlays() host_mob.update_damage_overlays()
else else
host_mob.adjustBruteLoss(-1, TRUE) host_mob.adjustBruteLoss(-1.5, TRUE)
host_mob.adjustFireLoss(-1, TRUE) host_mob.adjustFireLoss(-1.5, TRUE)
/datum/nanite_program/purging_advanced /datum/nanite_program/purging_advanced
name = "Selective Blood Purification" name = "Selective Blood Purification"

View File

@@ -114,7 +114,19 @@
. = ..() . = ..()
host_mob.cure_fakedeath("nanites") host_mob.cure_fakedeath("nanites")
/datum/nanite_program/triggered/speech //Can receive transmissions from a nanite communication remote for customized messages
/datum/nanite_program/triggered/comm
var/comm_code = 0
var/comm_message = ""
/datum/nanite_program/triggered/comm/proc/receive_comm_signal(signal_comm_code, comm_message, comm_source)
if(!activated || !comm_code)
return
if(signal_comm_code == comm_code)
host_mob.investigate_log("'s [name] nanite program was messaged by [comm_source] with comm code [signal_comm_code] and message '[comm_message]'.", INVESTIGATE_NANITES)
trigger(comm_message)
/datum/nanite_program/triggered/comm/speech
name = "Forced Speech" name = "Forced Speech"
desc = "The nanites force the host to say a pre-programmed sentence when triggered." desc = "The nanites force the host to say a pre-programmed sentence when triggered."
unique = FALSE unique = FALSE
@@ -122,10 +134,10 @@
trigger_cooldown = 20 trigger_cooldown = 20
rogue_types = list(/datum/nanite_program/brain_misfire, /datum/nanite_program/brain_decay) rogue_types = list(/datum/nanite_program/brain_misfire, /datum/nanite_program/brain_decay)
extra_settings = list("Sentence") extra_settings = list("Sentence","Comm Code")
var/sentence = "" var/sentence = ""
/datum/nanite_program/triggered/speech/set_extra_setting(user, setting) /datum/nanite_program/triggered/comm/speech/set_extra_setting(user, setting)
if(setting == "Sentence") if(setting == "Sentence")
var/new_sentence = stripped_input(user, "Choose the sentence that the host will be forced to say.", "Sentence", sentence, MAX_MESSAGE_LEN) var/new_sentence = stripped_input(user, "Choose the sentence that the host will be forced to say.", "Sentence", sentence, MAX_MESSAGE_LEN)
if(!new_sentence) if(!new_sentence)
@@ -133,23 +145,34 @@
if(copytext(new_sentence, 1, 2) == "*") //emotes are abusable, like surrender if(copytext(new_sentence, 1, 2) == "*") //emotes are abusable, like surrender
return return
sentence = new_sentence sentence = new_sentence
if(setting == "Comm Code")
var/new_code = input(user, "Set the communication code (1-9999) or set to 0 to disable external signals.", name, null) as null|num
if(isnull(new_code))
return
comm_code = CLAMP(round(new_code, 1), 0, 9999)
/datum/nanite_program/triggered/speech/get_extra_setting(setting) /datum/nanite_program/triggered/comm/speech/get_extra_setting(setting)
if(setting == "Sentence") if(setting == "Sentence")
return sentence return sentence
if(setting == "Comm Code")
return comm_code
/datum/nanite_program/triggered/speech/copy_extra_settings_to(datum/nanite_program/triggered/speech/target) /datum/nanite_program/triggered/comm/speech/copy_extra_settings_to(datum/nanite_program/triggered/comm/speech/target)
target.sentence = sentence target.sentence = sentence
target.comm_code = comm_code
/datum/nanite_program/triggered/speech/trigger() /datum/nanite_program/triggered/comm/speech/trigger(comm_message)
if(!..()) if(!..())
return return
var/sent_message = comm_message
if(!comm_message)
sent_message = sentence
if(host_mob.stat == DEAD) if(host_mob.stat == DEAD)
return return
to_chat(host_mob, "<span class='warning'>You feel compelled to speak...</span>") to_chat(host_mob, "<span class='warning'>You feel compelled to speak...</span>")
host_mob.say(sentence, forced = "nanite speech") host_mob.say(sent_message, forced = "nanite speech")
/datum/nanite_program/triggered/voice /datum/nanite_program/triggered/comm/voice
name = "Skull Echo" name = "Skull Echo"
desc = "The nanites echo a synthesized message inside the host's skull." desc = "The nanites echo a synthesized message inside the host's skull."
unique = FALSE unique = FALSE
@@ -157,44 +180,62 @@
trigger_cooldown = 20 trigger_cooldown = 20
rogue_types = list(/datum/nanite_program/brain_misfire, /datum/nanite_program/brain_decay) rogue_types = list(/datum/nanite_program/brain_misfire, /datum/nanite_program/brain_decay)
extra_settings = list("Message") extra_settings = list("Message","Comm Code")
var/message = "" var/message = ""
/datum/nanite_program/triggered/voice/set_extra_setting(user, setting) /datum/nanite_program/triggered/comm/voice/set_extra_setting(user, setting)
if(setting == "Message") if(setting == "Message")
var/new_message = stripped_input(user, "Choose the message sent to the host.", "Message", message, MAX_MESSAGE_LEN) var/new_message = stripped_input(user, "Choose the message sent to the host.", "Message", message, MAX_MESSAGE_LEN)
if(!new_message) if(!new_message)
return return
message = new_message message = new_message
if(setting == "Comm Code")
var/new_code = input(user, "Set the communication code (1-9999) or set to 0 to disable external signals.", name, null) as null|num
if(isnull(new_code))
return
comm_code = CLAMP(round(new_code, 1), 0, 9999)
/datum/nanite_program/triggered/voice/get_extra_setting(setting) /datum/nanite_program/triggered/comm/voice/get_extra_setting(setting)
if(setting == "Message") if(setting == "Message")
return message return message
if(setting == "Comm Code")
return comm_code
/datum/nanite_program/triggered/voice/copy_extra_settings_to(datum/nanite_program/triggered/voice/target) /datum/nanite_program/triggered/comm/voice/copy_extra_settings_to(datum/nanite_program/triggered/comm/voice/target)
target.message = message target.message = message
target.comm_code = comm_code
/datum/nanite_program/triggered/voice/trigger() /datum/nanite_program/triggered/comm/voice/trigger(comm_message)
if(!..()) if(!..())
return return
var/sent_message = comm_message
if(!comm_message)
sent_message = message
if(host_mob.stat == DEAD) if(host_mob.stat == DEAD)
return return
to_chat(host_mob, "<i>You hear a strange, robotic voice in your head...</i> \"<span class='robot'>[message]</span>\"") to_chat(host_mob, "<i>You hear a strange, robotic voice in your head...</i> \"<span class='robot'>[sent_message]</span>\"")
/datum/nanite_program/triggered/hallucination /datum/nanite_program/triggered/comm/hallucination
name = "Hallucination" name = "Hallucination"
desc = "The nanites make the host hallucinate something when triggered." desc = "The nanites make the host hallucinate something when triggered."
trigger_cost = 4 trigger_cost = 4
trigger_cooldown = 80 trigger_cooldown = 80
unique = FALSE unique = FALSE
rogue_types = list(/datum/nanite_program/brain_misfire) rogue_types = list(/datum/nanite_program/brain_misfire)
extra_settings = list("Hallucination Type") extra_settings = list("Hallucination Type", "Comm Code")
var/hal_type var/hal_type
var/hal_details var/hal_details
/datum/nanite_program/triggered/hallucination/trigger() /datum/nanite_program/triggered/comm/hallucination/trigger(comm_message)
if(!..()) if(!..())
return return
if(comm_message && (hal_type != "Message")) //Triggered via comm remote, but not set to a message hallucination
return
var/sent_message = comm_message //Comm remotes can send custom hallucination messages for the chat hallucination
if(!sent_message)
sent_message = hal_details
if(!iscarbon(host_mob)) if(!iscarbon(host_mob))
return return
var/mob/living/carbon/C = host_mob var/mob/living/carbon/C = host_mob
@@ -203,7 +244,7 @@
else else
switch(hal_type) switch(hal_type)
if("Message") if("Message")
new /datum/hallucination/chat(C, TRUE, null, hal_details) new /datum/hallucination/chat(C, TRUE, null, sent_message)
if("Battle") if("Battle")
new /datum/hallucination/battle(C, TRUE, hal_details) new /datum/hallucination/battle(C, TRUE, hal_details)
if("Sound") if("Sound")
@@ -223,7 +264,13 @@
if("Plasma Flood") if("Plasma Flood")
new /datum/hallucination/fake_flood(C, TRUE) new /datum/hallucination/fake_flood(C, TRUE)
/datum/nanite_program/triggered/hallucination/set_extra_setting(user, setting) /datum/nanite_program/triggered/comm/hallucination/set_extra_setting(user, setting)
if(setting == "Comm Code")
var/new_code = input(user, "(Only for Message) Set the communication code (1-9999) or set to 0 to disable external signals.", name, null) as null|num
if(isnull(new_code))
return
comm_code = CLAMP(round(new_code, 1), 0, 9999)
if(setting == "Hallucination Type") if(setting == "Hallucination Type")
var/list/possible_hallucinations = list("Random","Message","Battle","Sound","Weird Sound","Station Message","Health","Alert","Fire","Shock","Plasma Flood") var/list/possible_hallucinations = list("Random","Message","Battle","Sound","Weird Sound","Station Message","Health","Alert","Fire","Shock","Plasma Flood")
var/hal_type_choice = input("Choose the hallucination type", name) as null|anything in possible_hallucinations var/hal_type_choice = input("Choose the hallucination type", name) as null|anything in possible_hallucinations
@@ -299,13 +346,76 @@
if("Plasma Flood") if("Plasma Flood")
hal_type = "Plasma Flood" hal_type = "Plasma Flood"
/datum/nanite_program/triggered/hallucination/get_extra_setting(setting) /datum/nanite_program/triggered/comm/hallucination/get_extra_setting(setting)
if(setting == "Hallucination Type") if(setting == "Hallucination Type")
if(!hal_type) if(!hal_type)
return "Random" return "Random"
else else
return hal_type return hal_type
if(setting == "Comm Code")
return comm_code
/datum/nanite_program/triggered/hallucination/copy_extra_settings_to(datum/nanite_program/triggered/hallucination/target) /datum/nanite_program/triggered/comm/hallucination/copy_extra_settings_to(datum/nanite_program/triggered/comm/hallucination/target)
target.hal_type = hal_type target.hal_type = hal_type
target.hal_details = hal_details target.hal_details = hal_details
target.comm_code = comm_code
/datum/nanite_program/good_mood
name = "Happiness Enhancer"
desc = "The nanites synthesize serotonin inside the host's brain, creating an artificial sense of happiness."
use_rate = 0.1
rogue_types = list(/datum/nanite_program/brain_decay)
extra_settings = list("Mood Message")
var/message = "HAPPINESS ENHANCEMENT"
/datum/nanite_program/good_mood/set_extra_setting(user, setting)
if(setting == "Mood Message")
var/new_message = stripped_input(user, "Choose the message visible on the mood effect.", "Message", message, MAX_NAME_LEN)
if(!new_message)
return
message = new_message
/datum/nanite_program/good_mood/get_extra_setting(setting)
if(setting == "Mood Message")
return message
/datum/nanite_program/good_mood/copy_extra_settings_to(datum/nanite_program/good_mood/target)
target.message = message
/datum/nanite_program/good_mood/enable_passive_effect()
. = ..()
SEND_SIGNAL(host_mob, COMSIG_ADD_MOOD_EVENT, "nanite_happy", /datum/mood_event/nanite_happiness, message)
/datum/nanite_program/good_mood/disable_passive_effect()
. = ..()
SEND_SIGNAL(host_mob, COMSIG_CLEAR_MOOD_EVENT, "nanite_happy")
/datum/nanite_program/bad_mood
name = "Happiness Suppressor"
desc = "The nanites suppress the production of serotonin inside the host's brain, creating an artificial state of depression."
use_rate = 0.1
rogue_types = list(/datum/nanite_program/brain_decay)
extra_settings = list("Mood Message")
var/message = "HAPPINESS SUPPRESSION"
/datum/nanite_program/bad_mood/set_extra_setting(user, setting)
if(setting == "Mood Message")
var/new_message = stripped_input(user, "Choose the message visible on the mood effect.", "Message", message, MAX_NAME_LEN)
if(!new_message)
return
message = new_message
/datum/nanite_program/bad_mood/get_extra_setting(setting)
if(setting == "Mood Message")
return message
/datum/nanite_program/bad_mood/copy_extra_settings_to(datum/nanite_program/bad_mood/target)
target.message = message
/datum/nanite_program/bad_mood/enable_passive_effect()
. = ..()
SEND_SIGNAL(host_mob, COMSIG_ADD_MOOD_EVENT, "nanite_sadness", /datum/mood_event/nanite_sadness, message)
/datum/nanite_program/bad_mood/disable_passive_effect()
. = ..()
SEND_SIGNAL(host_mob, COMSIG_CLEAR_MOOD_EVENT, "nanite_sadness")

View File

@@ -6,6 +6,7 @@
rogue_types = list(/datum/nanite_program/toxic) rogue_types = list(/datum/nanite_program/toxic)
extra_settings = list("Program Overwrite","Cloud Overwrite") extra_settings = list("Program Overwrite","Cloud Overwrite")
var/pulse_cooldown = 0
var/sync_programs = TRUE var/sync_programs = TRUE
var/sync_overwrite = FALSE var/sync_overwrite = FALSE
var/overwrite_cloud = FALSE var/overwrite_cloud = FALSE
@@ -67,12 +68,16 @@
target.sync_overwrite = sync_overwrite target.sync_overwrite = sync_overwrite
/datum/nanite_program/viral/active_effect() /datum/nanite_program/viral/active_effect()
if(world.time < pulse_cooldown)
return
for(var/mob/M in orange(host_mob, 5)) for(var/mob/M in orange(host_mob, 5))
if(prob(5)) if(SEND_SIGNAL(M, COMSIG_NANITE_IS_STEALTHY))
if(sync_programs) continue
SEND_SIGNAL(M, COMSIG_NANITE_SYNC, nanites, sync_overwrite) if(sync_programs)
if(overwrite_cloud) SEND_SIGNAL(M, COMSIG_NANITE_SYNC, nanites, sync_overwrite)
SEND_SIGNAL(M, COMSIG_NANITE_SET_CLOUD, set_cloud) if(overwrite_cloud)
SEND_SIGNAL(M, COMSIG_NANITE_SET_CLOUD, set_cloud)
pulse_cooldown = world.time + 75
/datum/nanite_program/monitoring /datum/nanite_program/monitoring
name = "Monitoring" name = "Monitoring"
@@ -197,6 +202,15 @@
return return
SEND_SIGNAL(host_mob, COMSIG_NANITE_SIGNAL, code, source) SEND_SIGNAL(host_mob, COMSIG_NANITE_SIGNAL, code, source)
/datum/nanite_program/relay/proc/relay_comm_signal(comm_code, relay_code, comm_message)
if(!activated)
return
if(!host_mob)
return
if(relay_code != relay_channel)
return
SEND_SIGNAL(host_mob, COMSIG_NANITE_COMM_SIGNAL, comm_code, comm_message)
/datum/nanite_program/metabolic_synthesis /datum/nanite_program/metabolic_synthesis
name = "Metabolic Synthesis" name = "Metabolic Synthesis"
desc = "The nanites use the metabolic cycle of the host to speed up their replication rate, using their extra nutrition as fuel." desc = "The nanites use the metabolic cycle of the host to speed up their replication rate, using their extra nutrition as fuel."
@@ -248,26 +262,27 @@
resulting in an extremely infective strain of nanites." resulting in an extremely infective strain of nanites."
use_rate = 1.50 use_rate = 1.50
rogue_types = list(/datum/nanite_program/aggressive_replication, /datum/nanite_program/necrotic) rogue_types = list(/datum/nanite_program/aggressive_replication, /datum/nanite_program/necrotic)
var/spread_cooldown = 0
/datum/nanite_program/spreading/active_effect() /datum/nanite_program/spreading/active_effect()
if(prob(10)) if(spread_cooldown < world.time)
var/list/mob/living/target_hosts = list() return
var/turf/T = get_turf(host_mob) spread_cooldown = world.time + 50
for(var/mob/living/L in range(5, host_mob)) var/list/mob/living/target_hosts = list()
if(!(MOB_ORGANIC in L.mob_biotypes) && !(MOB_UNDEAD in L.mob_biotypes)) for(var/mob/living/L in oview(5, host_mob))
continue if(!prob(25))
if(!disease_air_spread_walk(T, get_turf(L))) continue
continue if(!(L.mob_biotypes & (MOB_ORGANIC|MOB_UNDEAD)))
target_hosts += L continue
target_hosts -= host_mob target_hosts += L
if(!target_hosts.len) if(!target_hosts.len)
return return
var/mob/living/infectee = pick(target_hosts) var/mob/living/infectee = pick(target_hosts)
if(prob(100 - (infectee.get_permeability_protection() * 100))) if(prob(100 - (infectee.get_permeability_protection() * 100)))
//this will potentially take over existing nanites! //this will potentially take over existing nanites!
infectee.AddComponent(/datum/component/nanites, 10) infectee.AddComponent(/datum/component/nanites, 10)
SEND_SIGNAL(infectee, COMSIG_NANITE_SYNC, nanites) SEND_SIGNAL(infectee, COMSIG_NANITE_SYNC, nanites)
infectee.investigate_log("[key_name(infectee)] was infected by spreading nanites by [key_name(host_mob)]", INVESTIGATE_NANITES) infectee.investigate_log("was infected by spreading nanites by [key_name(host_mob)] at [AREACOORD(infectee)].", INVESTIGATE_NANITES)
/datum/nanite_program/mitosis /datum/nanite_program/mitosis
name = "Mitosis" name = "Mitosis"

View File

@@ -160,40 +160,55 @@
/datum/nanite_program/cryo/active_effect() /datum/nanite_program/cryo/active_effect()
host_mob.adjust_bodytemperature(-rand(15,25), 50) host_mob.adjust_bodytemperature(-rand(15,25), 50)
/datum/nanite_program/mind_control /datum/nanite_program/triggered/comm/mind_control
name = "Mind Control" name = "Mind Control"
desc = "The nanites imprint an absolute directive onto the host's brain while they're active." desc = "The nanites imprint an absolute directive onto the host's brain for one minute when triggered."
use_rate = 3 trigger_cost = 30
trigger_cooldown = 1800
rogue_types = list(/datum/nanite_program/brain_decay, /datum/nanite_program/brain_misfire) rogue_types = list(/datum/nanite_program/brain_decay, /datum/nanite_program/brain_misfire)
extra_settings = list("Directive") extra_settings = list("Directive","Comm Code")
var/cooldown = 0 //avoids spam when nanites are running low
var/directive = "..." var/directive = "..."
/datum/nanite_program/mind_control/set_extra_setting(user, setting) /datum/nanite_program/triggered/comm/mind_control/set_extra_setting(user, setting)
if(setting == "Directive") if(setting == "Directive")
var/new_directive = stripped_input(user, "Choose the directive to imprint with mind control.", "Directive", directive, MAX_MESSAGE_LEN) var/new_directive = stripped_input(user, "Choose the directive to imprint with mind control.", "Directive", directive, MAX_MESSAGE_LEN)
if(!new_directive) if(!new_directive)
return return
directive = new_directive directive = new_directive
if(setting == "Comm Code")
var/new_code = input(user, "Set the communication code (1-9999) or set to 0 to disable external signals.", name, null) as null|num
if(isnull(new_code))
return
comm_code = CLAMP(round(new_code, 1), 0, 9999)
/datum/nanite_program/mind_control/get_extra_setting(setting) /datum/nanite_program/triggered/comm/mind_control/get_extra_setting(setting)
if(setting == "Directive") if(setting == "Directive")
return directive return directive
if(setting == "Comm Code")
return comm_code
/datum/nanite_program/mind_control/copy_extra_settings_to(datum/nanite_program/mind_control/target) /datum/nanite_program/triggered/comm/mind_control/copy_extra_settings_to(datum/nanite_program/triggered/comm/mind_control/target)
target.directive = directive target.directive = directive
target.comm_code = comm_code
/datum/nanite_program/mind_control/enable_passive_effect() /datum/nanite_program/triggered/comm/mind_control/trigger(comm_message)
if(world.time < cooldown) if(!..())
return return
. = ..() if(host_mob.stat == DEAD)
brainwash(host_mob, directive) return
var/sent_directive = comm_message
if(!comm_message)
sent_directive = directive
brainwash(host_mob, sent_directive)
log_game("A mind control nanite program brainwashed [key_name(host_mob)] with the objective '[directive]'.") log_game("A mind control nanite program brainwashed [key_name(host_mob)] with the objective '[directive]'.")
addtimer(CALLBACK(src, .proc/end_brainwashing), 600)
/datum/nanite_program/mind_control/disable_passive_effect() /datum/nanite_program/triggered/comm/mind_control/proc/end_brainwashing()
. = ..()
if(host_mob.mind && host_mob.mind.has_antag_datum(/datum/antagonist/brainwashed)) if(host_mob.mind && host_mob.mind.has_antag_datum(/datum/antagonist/brainwashed))
host_mob.mind.remove_antag_datum(/datum/antagonist/brainwashed) host_mob.mind.remove_antag_datum(/datum/antagonist/brainwashed)
log_game("[key_name(host_mob)] is no longer brainwashed by nanites.") log_game("[key_name(host_mob)] is no longer brainwashed by nanites.")
cooldown = world.time + 450
/datum/nanite_program/triggered/comm/mind_control/disable_passive_effect()
. = ..()
end_brainwashing()

View File

@@ -168,6 +168,109 @@
. = TRUE . = TRUE
/obj/item/nanite_remote/comm
name = "nanite communication remote"
desc = "A device that can send text messages to specific programs."
icon_state = "nanite_comm_remote"
var/comm_code = 0
var/comm_message = ""
/obj/item/nanite_remote/comm/afterattack(atom/target, mob/user, etc)
switch(mode)
if(REMOTE_MODE_OFF)
return
if(REMOTE_MODE_SELF)
to_chat(user, "<span class='notice'>You activate [src], signaling the nanites in your bloodstream.<span>")
signal_mob(user, comm_code, comm_message)
if(REMOTE_MODE_TARGET)
if(isliving(target) && (get_dist(target, get_turf(src)) <= 7))
to_chat(user, "<span class='notice'>You activate [src], signaling the nanites inside [target].<span>")
signal_mob(target, code, comm_message, key_name(user))
if(REMOTE_MODE_AOE)
to_chat(user, "<span class='notice'>You activate [src], signaling the nanites inside every host around you.<span>")
for(var/mob/living/L in view(user, 7))
signal_mob(L, code, comm_message, key_name(user))
if(REMOTE_MODE_RELAY)
to_chat(user, "<span class='notice'>You activate [src], signaling all connected relay nanites.<span>")
signal_relay(code, relay_code, comm_message, key_name(user))
/obj/item/nanite_remote/comm/signal_mob(mob/living/M, code, source)
SEND_SIGNAL(M, COMSIG_NANITE_COMM_SIGNAL, comm_code, comm_message)
/obj/item/nanite_remote/comm/signal_relay(code, relay_code, source)
for(var/X in SSnanites.nanite_relays)
var/datum/nanite_program/relay/N = X
N.relay_comm_signal(comm_code, relay_code, comm_message)
/obj/item/nanite_remote/comm/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state)
SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "nanite_comm_remote", name, 420, 800, master_ui, state)
ui.open()
/obj/item/nanite_remote/comm/ui_data()
var/list/data = list()
data["comm_code"] = comm_code
data["relay_code"] = relay_code
data["comm_message"] = comm_message
data["mode"] = mode
data["locked"] = locked
data["saved_settings"] = saved_settings
return data
/obj/item/nanite_remote/comm/ui_act(action, params)
if(..())
return
switch(action)
if("set_comm_code")
if(locked)
return
var/new_code = input("Set comm code (0000-9999):", name, code) as null|num
if(!isnull(new_code))
new_code = CLAMP(round(new_code, 1),0,9999)
comm_code = new_code
. = TRUE
if("set_message")
if(locked)
return
var/new_message = stripped_input(usr, "Set the message (Max 300 characters):", "Set Message", null , 300)
if(!new_message)
return
comm_message = new_message
. = TRUE
if("comm_save")
if(locked)
return
var/code_name = stripped_input(usr, "Set the setting name", "Set Name", null , 15)
if(!code_name)
return
var/new_save = list()
new_save["id"] = last_id + 1
last_id++
new_save["name"] = code_name
new_save["code"] = comm_code
new_save["mode"] = mode
new_save["relay_code"] = relay_code
new_save["message"] = comm_message
saved_settings += list(new_save)
. = TRUE
if("comm_load")
var/code_id = params["save_id"]
var/list/setting
for(var/list/X in saved_settings)
if(X["id"] == text2num(code_id))
setting = X
break
if(setting)
comm_code = setting["code"]
mode = setting["mode"]
relay_code = setting["relay_code"]
comm_message = setting["message"]
. = TRUE
#undef REMOTE_MODE_OFF #undef REMOTE_MODE_OFF
#undef REMOTE_MODE_SELF #undef REMOTE_MODE_SELF
#undef REMOTE_MODE_TARGET #undef REMOTE_MODE_TARGET

View File

@@ -143,3 +143,9 @@
/obj/item/disk/nanite_program/reduced_diagnostics /obj/item/disk/nanite_program/reduced_diagnostics
program_type = /datum/nanite_program/reduced_diagnostics program_type = /datum/nanite_program/reduced_diagnostics
/obj/item/disk/nanite_program/good_mood
program_type = /datum/nanite_program/good_mood
/obj/item/disk/nanite_program/bad_mood
program_type = /datum/nanite_program/bad_mood

View File

@@ -976,7 +976,7 @@
display_name = "Basic Nanite Programming" display_name = "Basic Nanite Programming"
description = "The basics of nanite construction and programming." description = "The basics of nanite construction and programming."
prereq_ids = list("datatheory","robotics") prereq_ids = list("datatheory","robotics")
design_ids = list("nanite_disk","nanite_remote","nanite_scanner",\ design_ids = list("nanite_disk","nanite_remote","nanite_comm_remote","nanite_scanner",\
"nanite_chamber","public_nanite_chamber","nanite_chamber_control","nanite_programmer","nanite_program_hub","nanite_cloud_control",\ "nanite_chamber","public_nanite_chamber","nanite_chamber_control","nanite_programmer","nanite_program_hub","nanite_cloud_control",\
"relay_nanites", "monitoring_nanites", "access_nanites", "repairing_nanites","sensor_nanite_volume", "repeater_nanites", "relay_repeater_nanites","red_diag_nanites") "relay_nanites", "monitoring_nanites", "access_nanites", "repairing_nanites","sensor_nanite_volume", "repeater_nanites", "relay_repeater_nanites","red_diag_nanites")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
@@ -1015,7 +1015,7 @@
display_name = "Neural Nanite Programming" display_name = "Neural Nanite Programming"
description = "Nanite programs affecting nerves and brain matter." description = "Nanite programs affecting nerves and brain matter."
prereq_ids = list("nanite_bio") prereq_ids = list("nanite_bio")
design_ids = list("nervous_nanites", "brainheal_nanites", "paralyzing_nanites", "stun_nanites", "selfscan_nanites") design_ids = list("nervous_nanites", "brainheal_nanites", "paralyzing_nanites", "stun_nanites", "selfscan_nanites","good_mood_nanites","bad_mood_nanites")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
export_price = 5000 export_price = 5000

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 50 KiB

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,41 @@
<ui-display title='Nanite Control'>
{{#if data.locked}}
<ui-notice>The interface is locked.</ui-notice>
{{else}}
<ui-button icon='lock' action='lock'>Lock Interface</ui-button>
<ui-button icon='save' action='comm_save'>Save Current Setting</ui-button>
<ui-section label='Comm Code'>
<span>{{data.comm_code}}</span>
<ui-button icon='pencil' action='set_comm_code'>Set</ui-button>
</ui-section>
<ui-section label='Message'>
{{data.comm_message}}
<br>
<ui-button icon='pencil' action='set_message'>Set</ui-button>
</ui-section>
{{#if data.mode == "Relay"}}
<ui-section label='Relay Code'>
<span>{{data.relay_code}}</span>
<ui-button icon='pencil' action='set_relay_code'>Set</ui-button>
</ui-section>
{{/if}}
<ui-section label='Signal Mode'>
<span>{{data.mode}}</span>
<br>
<ui-button action='select_mode' params='{"mode": "Off"}'>Off</ui-button>
<ui-button action='select_mode' params='{"mode": "Local"}'>Local</ui-button>
<ui-button action='select_mode' params='{"mode": "Targeted"}'>Targeted</ui-button>
<ui-button action='select_mode' params='{"mode": "Area"}'>Area</ui-button>
<ui-button action='select_mode' params='{"mode": "Relay"}'>Relay</ui-button>
</ui-section>
{{/if}}
</ui-display>
<ui-display title='Saved Settings'>
{{#each data.saved_settings}}
<ui-button icon='load' action='comm_load' params='{"save_id": "{{id}}"}'>{{name}}</ui-button>
{{#if !data.locked}}
<ui-button icon='remove' action='remove_save' params='{"save_id": "{{id}}"}'>Remove</ui-button>
{{/if}}
<br>
{{/each}}
</ui-display>