Merge remote-tracking branch 'citadel/master' into mobility_flags

This commit is contained in:
kevinz000
2020-02-21 13:35:26 -07:00
180 changed files with 4392 additions and 2132 deletions
@@ -1,15 +1,14 @@
//Programs that are generally useful for population control and non-harmful suppression.
/datum/nanite_program/triggered/sleepy
/datum/nanite_program/sleepy
name = "Sleep Induction"
desc = "The nanites cause rapid narcolepsy when triggered."
can_trigger = TRUE
trigger_cost = 15
trigger_cooldown = 1200
rogue_types = list(/datum/nanite_program/brain_misfire, /datum/nanite_program/brain_decay)
/datum/nanite_program/triggered/sleepy/trigger()
if(!..())
return
/datum/nanite_program/sleepy/on_trigger(comm_message)
to_chat(host_mob, "<span class='warning'>You start to feel very sleepy...</span>")
host_mob.drowsyness += 20
addtimer(CALLBACK(host_mob, /mob/living.proc/Sleeping, 200), rand(60,200))
@@ -31,31 +30,31 @@
. = ..()
to_chat(host_mob, "<span class='notice'>Your muscles relax, and you can move again.</span>")
/datum/nanite_program/triggered/shocking
/datum/nanite_program/shocking
name = "Electric Shock"
desc = "The nanites shock the host when triggered. Destroys a large amount of nanites!"
can_trigger = TRUE
trigger_cost = 10
trigger_cooldown = 300
program_flags = NANITE_SHOCK_IMMUNE
rogue_types = list(/datum/nanite_program/toxic)
/datum/nanite_program/triggered/shocking/trigger()
if(!..())
return
/datum/nanite_program/shocking/on_trigger(comm_message)
host_mob.electrocute_act(rand(5,10), "shock nanites", TRUE, TRUE)
/datum/nanite_program/triggered/stun
/datum/nanite_program/stun
name = "Neural Shock"
desc = "The nanites pulse the host's nerves when triggered, inapacitating them for a short period."
can_trigger = TRUE
trigger_cost = 4
trigger_cooldown = 300
rogue_types = list(/datum/nanite_program/triggered/shocking, /datum/nanite_program/nerve_decay)
rogue_types = list(/datum/nanite_program/shocking, /datum/nanite_program/nerve_decay)
/datum/nanite_program/triggered/stun/trigger()
if(!..())
return
playsound(host_mob, "sparks", 75, 1, -1)
host_mob.DefaultCombatKnockdown(80)
playsound(host_mob, "sparks", 75, TRUE, -1)
/datum/nanite_program/pacifying
name = "Pacification"
@@ -115,64 +114,50 @@
host_mob.cure_fakedeath("nanites")
//Can receive transmissions from a nanite communication remote for customized messages
/datum/nanite_program/triggered/comm
/datum/nanite_program/comm
can_trigger = TRUE
var/comm_code = 0
var/comm_message = ""
/datum/nanite_program/triggered/comm/proc/receive_comm_signal(signal_comm_code, comm_message, comm_source)
/datum/nanite_program/comm/register_extra_settings()
extra_settings[NES_COMM_CODE] = new /datum/nanite_extra_setting/number(0, 0, 9999)
/datum/nanite_program/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
/datum/nanite_program/comm/speech
name = "Forced Speech"
desc = "The nanites force the host to say a pre-programmed sentence when triggered."
unique = FALSE
trigger_cost = 3
trigger_cooldown = 20
rogue_types = list(/datum/nanite_program/brain_misfire, /datum/nanite_program/brain_decay)
var/static/list/blacklist = list(
"*surrender",
"*collapse"
)
extra_settings = list("Sentence","Comm Code")
var/sentence = ""
/datum/nanite_program/comm/speech/register_extra_settings()
. = ..()
extra_settings[NES_SENTENCE] = new /datum/nanite_extra_setting/text("")
/datum/nanite_program/triggered/comm/speech/set_extra_setting(user, setting)
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)
if(!new_sentence)
return
if(new_sentence[1] == "*") //emotes are abusable, like surrender
return
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/comm/speech/get_extra_setting(setting)
if(setting == "Sentence")
return sentence
if(setting == "Comm Code")
return comm_code
/datum/nanite_program/triggered/comm/speech/copy_extra_settings_to(datum/nanite_program/triggered/comm/speech/target)
target.sentence = sentence
target.comm_code = comm_code
/datum/nanite_program/triggered/comm/speech/trigger(comm_message)
if(!..())
return
/datum/nanite_program/comm/speech/on_trigger(comm_message)
var/sent_message = comm_message
if(!comm_message)
sent_message = sentence
var/datum/nanite_extra_setting/sentence = extra_settings[NES_SENTENCE]
sent_message = sentence.get_value()
if(sent_message in blacklist)
return
if(host_mob.stat == DEAD)
return
to_chat(host_mob, "<span class='warning'>You feel compelled to speak...</span>")
host_mob.say(sent_message, forced = "nanite speech")
/datum/nanite_program/triggered/comm/voice
/datum/nanite_program/comm/voice
name = "Skull Echo"
desc = "The nanites echo a synthesized message inside the host's skull."
unique = FALSE
@@ -180,56 +165,50 @@
trigger_cooldown = 20
rogue_types = list(/datum/nanite_program/brain_misfire, /datum/nanite_program/brain_decay)
extra_settings = list("Message","Comm Code")
var/message = ""
/datum/nanite_program/comm/voice/register_extra_settings()
. = ..()
extra_settings[NES_MESSAGE] = new /datum/nanite_extra_setting/text("")
/datum/nanite_program/triggered/comm/voice/set_extra_setting(user, setting)
if(setting == "Message")
var/new_message = stripped_input(user, "Choose the message sent to the host.", "Message", message, MAX_MESSAGE_LEN)
if(!new_message)
return
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/comm/voice/get_extra_setting(setting)
if(setting == "Message")
return message
if(setting == "Comm Code")
return comm_code
/datum/nanite_program/triggered/comm/voice/copy_extra_settings_to(datum/nanite_program/triggered/comm/voice/target)
target.message = message
target.comm_code = comm_code
/datum/nanite_program/triggered/comm/voice/trigger(comm_message)
if(!..())
return
/datum/nanite_program/comm/voice/on_trigger(comm_message)
var/sent_message = comm_message
if(!comm_message)
sent_message = message
var/datum/nanite_extra_setting/message_setting = extra_settings[NES_MESSAGE]
sent_message = message_setting.get_value()
if(host_mob.stat == DEAD)
return
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/comm/hallucination
/datum/nanite_program/comm/hallucination
name = "Hallucination"
desc = "The nanites make the host hallucinate something when triggered."
trigger_cost = 4
trigger_cooldown = 80
unique = FALSE
rogue_types = list(/datum/nanite_program/brain_misfire)
extra_settings = list("Hallucination Type", "Comm Code")
var/hal_type
var/hal_details
/datum/nanite_program/triggered/comm/hallucination/trigger(comm_message)
if(!..())
return
/datum/nanite_program/comm/hallucination/register_extra_settings()
. = ..()
var/list/options = list(
"Message",
"Battle",
"Sound",
"Weird Sound",
"Station Message",
"Health",
"Alert",
"Fire",
"Shock",
"Plasma Flood",
"Random"
)
extra_settings[NES_HALLUCINATION_TYPE] = new /datum/nanite_extra_setting/type("Message", options)
extra_settings[NES_HALLUCINATION_DETAIL] = new /datum/nanite_extra_setting/text("")
/datum/nanite_program/comm/hallucination/on_trigger(comm_message)
var/datum/nanite_extra_setting/hal_setting = extra_settings[NES_HALLUCINATION_TYPE]
var/hal_type = hal_setting.get_value()
var/datum/nanite_extra_setting/hal_detail_setting = extra_settings[NES_HALLUCINATION_DETAIL]
var/hal_details = hal_detail_setting.get_value()
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
@@ -239,7 +218,9 @@
if(!iscarbon(host_mob))
return
var/mob/living/carbon/C = host_mob
if(!hal_type)
if(hal_details == "random")
hal_details = null
if(hal_type == "Random")
C.hallucination += 15
else
switch(hal_type)
@@ -254,6 +235,13 @@
if("Station Message")
new /datum/hallucination/stationmessage(C, TRUE, hal_details)
if("Health")
switch(hal_details)
if("critical")
hal_details = SCREWYHUD_CRIT
if("dead")
hal_details = SCREWYHUD_DEAD
if("healthy")
hal_details = SCREWYHUD_HEALTHY
new /datum/hallucination/hudscrew(C, TRUE, hal_details)
if("Alert")
new /datum/hallucination/fake_alert(C, TRUE, hal_details)
@@ -264,127 +252,40 @@
if("Plasma Flood")
new /datum/hallucination/fake_flood(C, TRUE)
/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")
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
if(!hal_type_choice)
return
switch(hal_type_choice)
if("Random")
hal_type = null
hal_details = null
/datum/nanite_program/comm/hallucination/set_extra_setting(setting, value)
. = ..()
if(setting == NES_HALLUCINATION_TYPE)
switch(value)
if("Message")
hal_type = "Message"
var/hal_chat = stripped_input(user, "Choose the message the host will hear, or leave empty for random messages.", "Message", hal_details, MAX_MESSAGE_LEN)
if(hal_chat)
hal_details = hal_chat
extra_settings[NES_HALLUCINATION_DETAIL] = new /datum/nanite_extra_setting/text("")
if("Battle")
hal_type = "Battle"
var/sound_list = list("random","laser","disabler","esword","gun","stunprod","harmbaton","bomb")
var/hal_choice = input("Choose the hallucination battle type", name) as null|anything in sound_list
if(!hal_choice || hal_choice == "random")
hal_details = null
else
hal_details = hal_choice
extra_settings[NES_HALLUCINATION_DETAIL] = new /datum/nanite_extra_setting/type("random", list("random","laser","disabler","esword","gun","stunprod","harmbaton","bomb"))
if("Sound")
hal_type = "Sound"
var/sound_list = list("random","airlock","airlock pry","console","explosion","far explosion","mech","glass","alarm","beepsky","mech","wall decon","door hack")
var/hal_choice = input("Choose the hallucination sound", name) as null|anything in sound_list
if(!hal_choice || hal_choice == "random")
hal_details = null
else
hal_details = hal_choice
extra_settings[NES_HALLUCINATION_DETAIL] = new /datum/nanite_extra_setting/type("random", list("random","airlock","airlock pry","console","explosion","far explosion","mech","glass","alarm","beepsky","mech","wall decon","door hack"))
if("Weird Sound")
hal_type = "Weird Sound"
var/sound_list = list("random","phone","hallelujah","highlander","laughter","hyperspace","game over","creepy","tesla")
var/hal_choice = input("Choose the hallucination sound", name) as null|anything in sound_list
if(!hal_choice || hal_choice == "random")
hal_details = null
else
hal_details = hal_choice
extra_settings[NES_HALLUCINATION_DETAIL] = new /datum/nanite_extra_setting/type("random", list("random","phone","hallelujah","highlander","laughter","hyperspace","game over","creepy","tesla"))
if("Station Message")
hal_type = "Station Message"
var/msg_list = list("random","ratvar","shuttle dock","blob alert","malf ai","meteors","supermatter")
var/hal_choice = input("Choose the hallucination station message", name) as null|anything in msg_list
if(!hal_choice || hal_choice == "random")
hal_details = null
else
hal_details = hal_choice
extra_settings[NES_HALLUCINATION_DETAIL] = new /datum/nanite_extra_setting/type("random", list("random","ratvar","shuttle dock","blob alert","malf ai","meteors","supermatter"))
if("Health")
hal_type = "Health"
var/health_list = list("random","critical","dead","healthy")
var/hal_choice = input("Choose the health status", name) as null|anything in health_list
if(!hal_choice || hal_choice == "random")
hal_details = null
else
switch(hal_choice)
if("critical")
hal_details = SCREWYHUD_CRIT
if("dead")
hal_details = SCREWYHUD_DEAD
if("healthy")
hal_details = SCREWYHUD_HEALTHY
extra_settings[NES_HALLUCINATION_DETAIL] = new /datum/nanite_extra_setting/type("random", list("random","critical","dead","healthy"))
if("Alert")
hal_type = "Alert"
var/alert_list = list("random","not_enough_oxy","not_enough_tox","not_enough_co2","too_much_oxy","too_much_co2","too_much_tox","newlaw","nutrition","charge","gravity","fire","locked","hacked","temphot","tempcold","pressure")
var/hal_choice = input("Choose the alert", name) as null|anything in alert_list
if(!hal_choice || hal_choice == "random")
hal_details = null
else
hal_details = hal_choice
if("Fire")
hal_type = "Fire"
if("Shock")
hal_type = "Shock"
if("Plasma Flood")
hal_type = "Plasma Flood"
/datum/nanite_program/triggered/comm/hallucination/get_extra_setting(setting)
if(setting == "Hallucination Type")
if(!hal_type)
return "Random"
else
return hal_type
if(setting == "Comm Code")
return comm_code
/datum/nanite_program/triggered/comm/hallucination/copy_extra_settings_to(datum/nanite_program/triggered/comm/hallucination/target)
target.hal_type = hal_type
target.hal_details = hal_details
target.comm_code = comm_code
extra_settings[NES_HALLUCINATION_DETAIL] = new /datum/nanite_extra_setting/type("random", list("random","not_enough_oxy","not_enough_tox","not_enough_co2","too_much_oxy","too_much_co2","too_much_tox","newlaw","nutrition","charge","gravity","fire","locked","hacked","temphot","tempcold","pressure"))
else
extra_settings.Remove(NES_HALLUCINATION_DETAIL)
/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/register_extra_settings()
. = ..()
extra_settings[NES_MOOD_MESSAGE] = new /datum/nanite_extra_setting/text("HAPPINESS ENHANCEMENT")
/datum/nanite_program/good_mood/enable_passive_effect()
. = ..()
SEND_SIGNAL(host_mob, COMSIG_ADD_MOOD_EVENT, "nanite_happy", /datum/mood_event/nanite_happiness, message)
SEND_SIGNAL(host_mob, COMSIG_ADD_MOOD_EVENT, "nanite_happy", /datum/mood_event/nanite_happiness, get_extra_setting_value(NES_MOOD_MESSAGE))
/datum/nanite_program/good_mood/disable_passive_effect()
. = ..()
@@ -395,26 +296,14 @@
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/register_extra_settings()
. = ..()
extra_settings[NES_MOOD_MESSAGE] = new /datum/nanite_extra_setting/text("HAPPINESS SUPPRESSION")
/datum/nanite_program/bad_mood/enable_passive_effect()
. = ..()
SEND_SIGNAL(host_mob, COMSIG_ADD_MOOD_EVENT, "nanite_sadness", /datum/mood_event/nanite_sadness, message)
SEND_SIGNAL(host_mob, COMSIG_ADD_MOOD_EVENT, "nanite_sadness", /datum/mood_event/nanite_sadness, get_extra_setting_value(NES_MOOD_MESSAGE))
/datum/nanite_program/bad_mood/disable_passive_effect()
. = ..()