Biohazard Alert changes (#29616)

* better biohazard alerts

* fixing some legacy stuff

* fix admin outbreaks

* fuck

* fuck

* new announcement
This commit is contained in:
DeityLink
2021-05-30 23:14:40 +02:00
committed by GitHub
parent afd51afe57
commit 409dce55b9
16 changed files with 139 additions and 120 deletions

View File

@@ -44,13 +44,14 @@
for(var/word in vox_sentence)
play_vox_sound(word,STATION_Z,null)
/datum/command_alert/biohazard_alert/minor
level_max = 4
level_min = 2
/datum/command_alert/biohazard_organ
name = "Organ Failures"
alert_title = "Risk of Spontaneous Organ Failure"
force_report = 1
/datum/command_alert/biohazard_alert/major
level_max = 7
level_min = 5
/datum/command_alert/biohazard_organ/announce()
message = "The microdosimetry meter onboard [station_name()] has been tripped by recent cosmic interference. Automated Bragg Curve calculations show a threat of ion implantation in crew members, which may lead to sickness or organ failure. Central Command advises regular health screening of staff displaying symptoms of malaise."
..()
///////HISS

View File

@@ -6,15 +6,15 @@ var/global/list/outbreak_level_words=list(
/* 5 */ 'sound/AI/five.ogg',
/* 6 */ 'sound/AI/six.ogg',
/* 7 */ 'sound/AI/seven.ogg',
)
/proc/biohazard_alert()
command_alert(/datum/command_alert/biohazard_alert)
/* 8 */ 'sound/AI/eight.ogg' /* outbreak of a disease of combined badness level of 15 or 16, yikes! */,
) /* 9 */ /*This one is reserved for Blob, we don't use it.*/
/proc/biohazard_alert_minor()
command_alert(/datum/command_alert/biohazard_alert/minor)
/proc/biohazard_alert_major()
command_alert(/datum/command_alert/biohazard_alert/major)
/proc/biohazard_alert(var/level)
var/datum/command_alert/biohazard_alert/CA = new /datum/command_alert/biohazard_alert
if (level)//The initial Blob announcement will have a random level between 4 and 7
CA.level_max = level
CA.level_min = level
return CA.announce()
/*
#warn TELL N3X15 TO COMMENT THIS SHIT OUT

View File

@@ -120,10 +120,7 @@
for (var/ID in blood_viruses)
var/datum/disease2/disease/D = blood_viruses[ID]
if (D.strength >= 80)
var/total_badness = 0
for(var/datum/disease2/effect/e in D.effects)
total_badness += text2num(e.badness)
if (total_badness >= 13)
if (D.get_total_badness() >= 13)
return 1
return 0
@@ -153,10 +150,7 @@
var/list/blood_viruses = blood.data["virus2"]
for (var/ID in blood_viruses)
var/datum/disease2/disease/D = blood_viruses[ID]
var/total_badness = 0
for(var/datum/disease2/effect/e in D.effects)
total_badness += text2num(e.badness)
if (total_badness <= 2)
if (D.get_total_badness() <= 2)
return 1
return 0

View File

@@ -101,7 +101,7 @@
spacevine_infestation()
if(15)
communications_blackout()
*/
/proc/appendicitis()
for(var/mob/living/carbon/human/H in living_mob_list)
@@ -180,41 +180,6 @@
spawn(rand(1500, 3000)) //Delayed announcements to keep the crew on their toes.
biohazard_alert()
/proc/alien_infestation(var/spawncount = 1) // -- TLE
//command_alert("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert")
// world << sound('sound/AI/aliens.ogg')
var/list/vents = list()
var/success = FALSE
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in atmos_machines)
if(temp_vent.loc.z == map.zMainStation && !temp_vent.welded && temp_vent.network && temp_vent.canSpawnMice)
if(temp_vent.network.normal_members.len > 50) // Stops Aliens getting stuck in small networks. See: Security, Virology
vents += temp_vent
var/list/mob/dead/observer/candidates = get_active_candidates(ROLE_ALIEN, buffer=ALIEN_SELECT_AFK_BUFFER, poll="HEY KID, YOU WANNA BE AN ALIEN LARVA?")
if(candidates.len)
shuffle(candidates)
if(prob(40))
spawncount++ //sometimes, have two larvae spawn instead of one
while((spawncount >= 1) && vents.len && candidates.len)
var/obj/vent = pick(vents)
var/mob/dead/observer/candidate = pick(candidates)
if(istype(candidate) && candidate.client && candidate.key)
var/mob/living/carbon/alien/larva/new_xeno = new(vent.loc)
new_xeno.transfer_personality(candidate.client)
success = TRUE
candidates -= candidate
vents -= vent
spawncount--
if(success)
spawn(rand(5000, 6000)) //Delayed announcements to keep the crew on their toes.
command_alert(/datum/command_alert/xenomorphs)
return success
/proc/high_radiation_event()
/* // Haha, this is way too laggy. I'll keep the prison break though.
@@ -331,3 +296,4 @@
apc.overload_lighting()
return
*/

View File

@@ -849,7 +849,7 @@ var/global/floorIsLava = 0
<A href='?src=\ref[src];secretsfun=virus'>Trigger a Virus Outbreak</A><BR>
<A href='?src=\ref[src];secretsfun=mass_hallucination'>Cause the crew to hallucinate</A><BR>
<BR>
<A href='?src=\ref[src];secretsfun=lightsout'>Toggle a "lights out" event</A><BR>
<A href='?src=\ref[src];secretsfun=lightsout'>Trigger an Electrical Storm (breaks some lights)</A><BR>
<A href='?src=\ref[src];secretsfun=prison_break'>Trigger a Prison Break</A><BR>
<A href='?src=\ref[src];secretsfun=ionstorm'>Spawn an Ion Storm</A><BR>
<A href='?src=\ref[src];secretsfun=comms_blackout'>Trigger a communication blackout</A><BR>

View File

@@ -50,12 +50,8 @@
if (dish.contained_virus)
if (ID == "[dish.contained_virus.uniqueID]-[dish.contained_virus.subID]")
dishes++
var/nickname = ""
if (ID in virusDB)
var/datum/data/record/v = virusDB[ID]
nickname = v.fields["nickname"] ? " \"[v.fields["nickname"]]\"" : ""
dat += {"<tr>
<td><a href='?src=\ref[src];diseasepanel_examine=\ref[D]'>[D.form] #[add_zero("[D.uniqueID]", 4)]-[add_zero("[D.subID]", 4)][nickname]</a></td>
<td><a href='?src=\ref[src];diseasepanel_examine=\ref[D]'>[D.real_name()]</a></td>
<td>[D.origin]</td>
<td><a href='?src=\ref[src];diseasepanel_toggledb=\ref[D]'>[(ID in virusDB) ? "Yes" : "No"]</a></td>
<td><a href='?src=\ref[src];diseasepanel_infectedmobs=\ref[D]'>[infctd_mobs][infctd_mobs_dead ? " (including [infctd_mobs_dead] dead)" : "" ]</a></td>
@@ -70,3 +66,4 @@
"}
usr << browse(dat, "window=diseasespanel;size=705x450")

View File

@@ -3534,17 +3534,18 @@
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","PB")
message_admins("[key_name_admin(usr)] has allowed a prison break", 1)
prison_break()
new /datum/event/prison_break
if("lightsout")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","LO")
message_admins("[key_name_admin(usr)] has broke a lot of lights", 1)
lightsout(1,2)
message_admins("[key_name_admin(usr)] has triggered an electrical storm", 1)
new /datum/event/electrical_storm
if("blackout")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","BO")
message_admins("[key_name_admin(usr)] broke all lights", 1)
lightsout(0,0)
for(var/obj/machinery/power/apc/apc in power_machines)
apc.overload_lighting()
if("whiteout")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","WO")
@@ -3555,7 +3556,6 @@
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","RAD")
message_admins("[key_name_admin(usr)] has started a radiation event", 1)
//makeAliens()
new /datum/event/radiation_storm
if("floorlava")
if(floorIsLava)
@@ -3633,13 +3633,27 @@
if("virus")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","V")
var/answer = alert("Do you want this to be a greater disease or a lesser one?",,"Greater","Lesser")
if(answer=="Lesser")
//virus2_lesser_infection()
message_admins("[key_name_admin(usr)] has triggered a lesser virus outbreak.", 1)
else
//virus2_greater_infection()
message_admins("[key_name_admin(usr)] has triggered a greater virus outbreak.", 1)
var/answer = alert("Do you want this to be a greater disease or a lesser one?","Pathogen Outbreak","Greater","Lesser","Custom")
switch (answer)
if ("Lesser")
new /datum/event/viral_infection
message_admins("[key_name_admin(usr)] has triggered a lesser virus outbreak.", 1)
if ("Greater")
new /datum/event/viral_outbreak
message_admins("[key_name_admin(usr)] has triggered a greater virus outbreak.", 1)
if ("Custom")
var/list/existing_pathogen = list()
for (var/pathogen in disease2_list)
var/datum/disease2/disease/dis = disease2_list[pathogen]
existing_pathogen["[dis.real_name()]"] = pathogen
var/chosen_pathogen = input(usr, "Choose a pathogen", "Choose a pathogen") as null | anything in existing_pathogen
if (chosen_pathogen)
var/datum/disease2/disease/dis = disease2_list[existing_pathogen[chosen_pathogen]]
spread_disease_among_crew(dis,"Custom Outbreak")
message_admins("[key_name_admin(usr)] has triggered a custom virus outbreak.", 1)
var/dis_level = clamp(round((dis.get_total_badness()+1)/2),1,8)
spawn(rand(0,3000))
biohazard_alert(dis_level)
if("retardify")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","RET")

View File

@@ -0,0 +1,33 @@
/proc/alien_infestation(var/spawncount = 1)
var/list/vents = list()
var/success = FALSE
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in atmos_machines)
if(temp_vent.loc.z == map.zMainStation && !temp_vent.welded && temp_vent.network && temp_vent.canSpawnMice)
if(temp_vent.network.normal_members.len > 50) // Stops Aliens getting stuck in small networks. See: Security, Virology
vents += temp_vent
var/list/mob/dead/observer/candidates = get_active_candidates(ROLE_ALIEN, buffer=ALIEN_SELECT_AFK_BUFFER, poll="HEY KID, YOU WANNA BE AN ALIEN LARVA?")
if(candidates.len)
shuffle(candidates)
if(prob(40))
spawncount++ //sometimes, have two larvae spawn instead of one
while((spawncount >= 1) && vents.len && candidates.len)
var/obj/vent = pick(vents)
var/mob/dead/observer/candidate = pick(candidates)
if(istype(candidate) && candidate.client && candidate.key)
var/mob/living/carbon/alien/larva/new_xeno = new(vent.loc)
new_xeno.transfer_personality(candidate.client)
success = TRUE
candidates -= candidate
vents -= vent
spawncount--
if(success)
spawn(rand(5000, 6000)) //Delayed announcements to keep the crew on their toes.
command_alert(/datum/command_alert/xenomorphs)
return success

View File

@@ -1,7 +1,9 @@
//Cannot actually trigger due to the absence a custom can_start() proc and isn't spawned anywhere else, and that's for the better seeing as those diseases are deprecated.
//I'll let someone else take the decision to remove this file altogether.
/datum/event/disease_outbreak
announceWhen = 90
/datum/event/disease_outbreak/announce()
biohazard_alert()

View File

@@ -27,4 +27,4 @@
for(var/obj/effect/landmark/epicentre in epicentreList)
for(var/obj/machinery/power/apc/apc in range(epicentre,lightsoutRange))
apc.overload_lighting()
apc.overload_lighting()

View File

@@ -12,7 +12,8 @@ datum/event/organ_failure/setup()
severity = rand(1, 4)
datum/event/organ_failure/announce()
biohazard_alert()
command_alert(/datum/command_alert/biohazard_organ)
datum/event/organ_failure/start()
var/list/candidates = list() //list of candidate keys
for(var/mob/living/carbon/human/G in player_list)

View File

@@ -1,4 +1,6 @@
/datum/event/viral_infection
var/level = 0
/datum/event/viral_infection/can_start(var/list/active_with_role)
if(active_with_role["Medical"] > 1)
@@ -10,7 +12,7 @@
endWhen = announceWhen + 1
/datum/event/viral_infection/announce()
biohazard_alert_minor()
biohazard_alert(level)
/datum/event/viral_infection/start()
var/datum/disease2/disease/D = get_random_weighted_disease(WINFECTION)
@@ -33,17 +35,6 @@
D.makerandom(list(50,90),list(50,90),anti,bad,src)
var/list/candidates = list()
for(var/mob/living/candidate in player_list)
if(candidate.z == STATION_Z && candidate.client && candidate.stat != DEAD && candidate.can_be_infected() && candidate.immune_system.CanInfect(D))
candidates += candidate
level = clamp(round((D.get_total_badness()+1)/2),1,8)
if(!candidates.len)
return
var/infected = 1 + round(candidates.len/10)
for (var/i = 1 to infected)
var/mob/living/candidate = pick(candidates)
candidates -= candidate
candidate.infect_disease2(D,1, "Minor Outbreak")
spread_disease_among_crew(D,"Minor Outbreak")

View File

@@ -1,19 +1,20 @@
datum/event/viral_outbreak
/datum/event/viral_outbreak
var/level = 0
/datum/event/viral_outbreak/can_start(var/list/active_with_role)
if(active_with_role["Medical"] > 1)
return 25
return 0
datum/event/viral_outbreak/setup()
/datum/event/viral_outbreak/setup()
announceWhen = rand(0, 3000)
endWhen = announceWhen + 1
datum/event/viral_outbreak/announce()
biohazard_alert_major()
/datum/event/viral_outbreak/announce()
biohazard_alert(level)
datum/event/viral_outbreak/start()
/datum/event/viral_outbreak/start()
var/datum/disease2/disease/D = get_random_weighted_disease(WOUTBREAK)
var/list/anti = list(
@@ -34,17 +35,6 @@ datum/event/viral_outbreak/start()
D.makerandom(list(80,100),list(60,100),anti,bad,src)
var/list/candidates = list()
for(var/mob/living/candidate in player_list)
if(candidate.z == STATION_Z && candidate.client && candidate.stat != DEAD && candidate.can_be_infected() && candidate.immune_system.CanInfect(D))
candidates += candidate
level = clamp(round((D.get_total_badness()+1)/2),1,8)
if(!candidates.len)
return
var/infected = 1 + round(candidates.len/10)
for (var/i = 1 to infected)
var/mob/living/candidate = pick(candidates)
candidates -= candidate
candidate.infect_disease2(D,1, "Major Outbreak")
spread_disease_among_crew(D,"Major Outbreak")

View File

@@ -318,11 +318,15 @@ var/global/list/disease2_list = list()
return
if (chosen_form == "infect with an already existing pathogen")
var/chosen_pathogen = input(C, "Choose a pathogen", "Choose a pathogen") as null | anything in disease2_list
var/list/existing_pathogen = list()
for (var/pathogen in disease2_list)
var/datum/disease2/disease/dis = disease2_list[pathogen]
existing_pathogen["[dis.real_name()]"] = pathogen
var/chosen_pathogen = input(C, "Choose a pathogen", "Choose a pathogen") as null | anything in existing_pathogen
if (!chosen_pathogen)
qdel(D)
return
var/datum/disease2/disease/dis = disease2_list[chosen_pathogen]
var/datum/disease2/disease/dis = existing_pathogen[chosen_pathogen]
D = dis.getcopy()
D.origin = "[D.origin] (Badmin)"
else
@@ -359,11 +363,7 @@ var/global/list/disease2_list = list()
D.robustness = input(C, "What will be your pathogen's robustness? (1-100) Lower values mean that infected can carry the pathogen without getting affected by its symptoms.", "Pathogen Robustness", D.infectionchance) as num
D.robustness = clamp(D.strength,0,100)
var/new_id = copytext(sanitize(input(C, "You can pick a 4 number ID for your Pathogen. Otherwise a random ID will be generated.", "Pick a unique ID", rand(0,9999)) as null | num),1,4)
if (!new_id)
D.uniqueID = rand(0,9999)
else
D.uniqueID = new_id
D.uniqueID = clamp(input(C, "You can specify the 4 number ID for your Pathogen, or just use this randomly generated one.", "Pick a unique ID", rand(0,9999)) as num, 0, 9999)
D.subID = rand(0,9999)
D.childID = 0
@@ -833,6 +833,13 @@ var/global/list/virusDB = list()
var/datum/data/record/V = virusDB["[uniqueID]-[subID]"]
.= V.fields["name"]
/datum/disease2/disease/proc/real_name()
.= "[form] #[add_zero("[uniqueID]", 4)]-[add_zero("[subID]", 4)]"
if ("[uniqueID]-[subID]" in virusDB)
var/datum/data/record/v = virusDB["[uniqueID]-[subID]"]
var/nickname = v.fields["nickname"] ? " \"[v.fields["nickname"]]\"" : ""
. += nickname
/datum/disease2/disease/proc/get_subdivisions_string()
var/subdivision = (strength - ((robustness * strength) / 100)) / max_stage
var/dat = "("
@@ -864,6 +871,12 @@ var/global/list/virusDB = list()
r += "<BR><i>last analyzed at: [worldtime2text()]</i>"
return r
/datum/disease2/disease/proc/get_total_badness()
var/total_badness = 0
for(var/datum/disease2/effect/e in effects)
total_badness += text2num(e.badness)
return total_badness
/datum/disease2/disease/proc/addToDB()
if ("[uniqueID]-[subID]" in virusDB)
return 0

View File

@@ -356,3 +356,21 @@ var/list/infected_items = list()
if("eyes")
part = EYES
return part
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/proc/spread_disease_among_crew(var/datum/disease2/disease/D, var/reason = "4noraisin")
var/list/candidates = list()
for(var/mob/living/candidate in player_list)
if(candidate.z == STATION_Z && candidate.client && candidate.stat != DEAD && candidate.can_be_infected() && candidate.immune_system.CanInfect(D))
candidates += candidate
if(!candidates.len)
return
var/infected = 1 + round(candidates.len/10)
for (var/i = 1 to infected)
var/mob/living/candidate = pick(candidates)
candidates -= candidate
candidate.infect_disease2(D,1, reason)

View File

@@ -557,7 +557,6 @@
#include "code\game\dna\genes\speech.dm"
#include "code\game\dna\genes\vg_disabilities.dm"
#include "code\game\dna\genes\vg_powers.dm"
#include "code\game\gamemodes\events.dm"
#include "code\game\gamemodes\gameticker.dm"
#include "code\game\gamemodes\highscores.dm"
#include "code\game\gamemodes\intercept_report.dm"
@@ -1524,13 +1523,13 @@
#include "code\modules\Economy\Wages.dm"
#include "code\modules\error_handler\error_handler.dm"
#include "code\modules\error_handler\error_viewer.dm"
#include "code\modules\events\alien_infestation.dm"
#include "code\modules\events\ancientpod.dm"
#include "code\modules\events\blizzard.dm"
#include "code\modules\events\bluespaceanomaly.dm"
#include "code\modules\events\brand_intelligence.dm"
#include "code\modules\events\carp_migration.dm"
#include "code\modules\events\communications_blackout.dm"
#include "code\modules\events\disease_outbreak.dm"
#include "code\modules\events\electrical_storm.dm"
#include "code\modules\events\event.dm"
#include "code\modules\events\event_dynamic.dm"