From 7f64d9ce1340e7a3c02b8c3b9bff01ef78d4dd69 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Fri, 9 Jan 2015 22:42:52 -0500 Subject: [PATCH 01/12] Adjusts the amount of carp spawned for moderate level carp --- code/modules/events/carp_migration.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/events/carp_migration.dm b/code/modules/events/carp_migration.dm index e7c9f5a4021..19e16251261 100644 --- a/code/modules/events/carp_migration.dm +++ b/code/modules/events/carp_migration.dm @@ -21,7 +21,7 @@ for(var/i = 1 to rand(3,5)) spawn_fish(landmarks_list.len) else if(severity == EVENT_LEVEL_MODERATE) - spawn_fish(landmarks_list.len) + spawn_fish(rand(10,30)) else spawn_fish(rand(1, 5)) From 9b5eded546d6c274540a78424356115c4b44c7cb Mon Sep 17 00:00:00 2001 From: mwerezak Date: Fri, 9 Jan 2015 23:30:32 -0500 Subject: [PATCH 02/12] Fixes major virus event generating lesser viruses, makes lesser viruses actually less severe Makes more of a distinction between lesser and greater viruses by restricting lesser viruses to only have the "Nil" syndrome for stage 4. --- code/modules/events/viral_infection.dm | 20 ++++++++++++++++++-- code/modules/virus2/disease2.dm | 5 ++++- code/modules/virus2/effect.dm | 19 ++++++++++++++++--- code/modules/virus2/helpers.dm | 11 +++++++---- 4 files changed, 45 insertions(+), 10 deletions(-) diff --git a/code/modules/events/viral_infection.dm b/code/modules/events/viral_infection.dm index 6e40d38d333..87c55460ce1 100644 --- a/code/modules/events/viral_infection.dm +++ b/code/modules/events/viral_infection.dm @@ -1,11 +1,27 @@ +datum/event/viral_infection + var/list/viruses = list() + datum/event/viral_infection/setup() announceWhen = rand(0, 3000) endWhen = announceWhen + 1 + + //generate 1-3 viruses. This way there's an upper limit on how many individual diseases need to be cured if many people are initially infected + var/num_diseases = rand(1,3) + for (var/i=0, i < num_diseases, i++) + var/datum/disease2/disease/D = new /datum/disease2/disease + + var/greater = 0 //whether the disease is of the greater or lesser variety + if (severity >= EVENT_LEVEL_MAJOR && prob(50)) + greater = 1 + D.makerandom(greater) + viruses += D datum/event/viral_infection/announce() command_announcement.Announce("Confirmed outbreak of level five biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", new_sound = 'sound/AI/outbreak5.ogg') datum/event/viral_infection/start() + if(!viruses.len) return + var/list/candidates = list() //list of candidate keys for(var/mob/living/carbon/human/G in player_list) if(G.client && G.stat != DEAD) @@ -13,9 +29,9 @@ datum/event/viral_infection/start() if(!candidates.len) return candidates = shuffle(candidates)//Incorporating Donkie's list shuffle - severity = severity == 1 ? 1 : severity - 1 + severity = max(EVENT_LEVEL_MUNDANE, severity - 1) var/actual_severity = severity * rand(1, 3) while(actual_severity > 0 && candidates.len) - infect_mob_random_lesser(candidates[1]) + infect_mob(candidates[1], pick(viruses)) candidates.Remove(candidates[1]) actual_severity-- diff --git a/code/modules/virus2/disease2.dm b/code/modules/virus2/disease2.dm index 977c9ab9cab..09b6c80ee61 100644 --- a/code/modules/virus2/disease2.dm +++ b/code/modules/virus2/disease2.dm @@ -26,7 +26,10 @@ holder.getrandomeffect() effects += holder uniqueID = rand(0,10000) - infectionchance = rand(60,90) + if (greater) + infectionchance = rand(60,90) + else + infectionchance = 1 antigen |= text2num(pick(ANTIGENS)) antigen |= text2num(pick(ANTIGENS)) spreadtype = prob(70) ? "Airborne" : "Contact" diff --git a/code/modules/virus2/effect.dm b/code/modules/virus2/effect.dm index 3ebeefeba8e..82edfb80493 100644 --- a/code/modules/virus2/effect.dm +++ b/code/modules/virus2/effect.dm @@ -56,6 +56,13 @@ ////////////////////////STAGE 4///////////////////////////////// +/datum/disease2/effect/nothing + name = "Nil Syndrome" + stage = 4 + badness = 1 + activate() + return + /datum/disease2/effect/gibbingtons name = "Gibbingtons Syndrome" stage = 4 @@ -67,12 +74,14 @@ name = "Radian's Syndrome" stage = 4 maxm = 3 + badness = 2 activate(var/mob/living/carbon/mob,var/multiplier) mob.radiation += (2*multiplier) /datum/disease2/effect/deaf name = "Dead Ear Syndrome" stage = 4 + badness = 2 activate(var/mob/living/carbon/mob,var/multiplier) mob.ear_deaf += 20 @@ -101,12 +110,14 @@ /datum/disease2/effect/killertoxins name = "Toxification Syndrome" stage = 4 + badness = 2 activate(var/mob/living/carbon/mob,var/multiplier) mob.adjustToxLoss(15*multiplier) /datum/disease2/effect/dna name = "Reverse Pattern Syndrome" stage = 4 + badness = 2 activate(var/mob/living/carbon/mob,var/multiplier) mob.bodytemperature = max(mob.bodytemperature, 350) scramble(0,mob,10) @@ -115,6 +126,7 @@ /datum/disease2/effect/organs name = "Shutdown Syndrome" stage = 4 + badness = 2 activate(var/mob/living/carbon/mob,var/multiplier) if(istype(mob, /mob/living/carbon/human)) var/mob/living/carbon/human/H = mob @@ -140,6 +152,7 @@ /datum/disease2/effect/immortal name = "Longevity Syndrome" stage = 4 + badness = 2 activate(var/mob/living/carbon/mob,var/multiplier) if(istype(mob, /mob/living/carbon/human)) var/mob/living/carbon/human/H = mob @@ -157,11 +170,10 @@ var/backlash_amt = 5*multiplier mob.apply_damages(backlash_amt,backlash_amt,backlash_amt,backlash_amt) -////////////////////////STAGE 3///////////////////////////////// - /datum/disease2/effect/bones name = "Fragile Bones Syndrome" stage = 4 + badness = 2 activate(var/mob/living/carbon/mob,var/multiplier) if(istype(mob, /mob/living/carbon/human)) var/mob/living/carbon/human/H = mob @@ -174,6 +186,8 @@ for (var/datum/organ/external/E in H.organs) E.min_broken_damage = initial(E.min_broken_damage) +////////////////////////STAGE 3///////////////////////////////// + /datum/disease2/effect/toxins name = "Hyperacidity" stage = 3 @@ -239,7 +253,6 @@ activate(var/mob/living/carbon/mob,var/multiplier) mob.apply_damage(2, CLONE) - /datum/disease2/effect/groan name = "Groaning Syndrome" stage = 3 diff --git a/code/modules/virus2/helpers.dm b/code/modules/virus2/helpers.dm index 6118dade42e..e3da0e5614a 100644 --- a/code/modules/virus2/helpers.dm +++ b/code/modules/virus2/helpers.dm @@ -96,20 +96,23 @@ proc/airborne_can_reach(turf/source, turf/target) M.virus2["[D.uniqueID]"] = D M.hud_updateflag |= 1 << STATUS_HUD +//Infects mob M with disease D +/proc/infect_mob(var/mob/living/carbon/M, var/datum/disease2/disease/D) + infect_virus2(M,D,1) + M.hud_updateflag |= 1 << STATUS_HUD + //Infects mob M with random lesser disease, if he doesn't have one /proc/infect_mob_random_lesser(var/mob/living/carbon/M) var/datum/disease2/disease/D = new /datum/disease2/disease D.makerandom() D.infectionchance = 1 - infect_virus2(M,D,1) - M.hud_updateflag |= 1 << STATUS_HUD + infect_mob(M, D) //Infects mob M with random greated disease, if he doesn't have one /proc/infect_mob_random_greater(var/mob/living/carbon/M) var/datum/disease2/disease/D = new /datum/disease2/disease D.makerandom(1) - infect_virus2(M,D,1) - M.hud_updateflag |= 1 << STATUS_HUD + infect_mob(M, D) //Fancy prob() function. /proc/dprob(var/p) From 3a4fca8ed3eaa7d96db5d14458f2d09444ca4a5f Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 10 Jan 2015 01:26:49 -0500 Subject: [PATCH 03/12] Gridcheck event now only announces sometimes Requested by Ravensdale --- code/modules/events/grid_check.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/events/grid_check.dm b/code/modules/events/grid_check.dm index c485827efbc..40a38e23838 100644 --- a/code/modules/events/grid_check.dm +++ b/code/modules/events/grid_check.dm @@ -8,7 +8,8 @@ power_failure(0) /datum/event/grid_check/announce() - command_announcement.Announce("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", "Automated Grid Check", new_sound = 'sound/AI/poweroff.ogg') + if (prob(30)) + command_announcement.Announce("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", "Automated Grid Check", new_sound = 'sound/AI/poweroff.ogg') /datum/event/grid_check/end() power_restore() From b0440b9c28d7af2067742da6df6e2d9d53706927 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 10 Jan 2015 01:27:18 -0500 Subject: [PATCH 04/12] Adjusts moderate level event weightings --- code/modules/events/event_container.dm | 32 +++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/code/modules/events/event_container.dm b/code/modules/events/event_container.dm index 4f2675a5127..5ac880185f0 100644 --- a/code/modules/events/event_container.dm +++ b/code/modules/events/event_container.dm @@ -139,22 +139,22 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT /datum/event_container/moderate severity = EVENT_LEVEL_MODERATE available_events = list( - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Nothing", /datum/event/nothing, 10), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Carp School", /datum/event/carp_migration, 20, list(ASSIGNMENT_SECURITY = 10), 1), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Rogue Drones", /datum/event/rogue_drone, 5, list(ASSIGNMENT_ENGINEER = 25, ASSIGNMENT_SECURITY = 25)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Space vines", /datum/event/spacevine, 10, list(ASSIGNMENT_ENGINEER = 5)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Meteor Shower", /datum/event/meteor_shower, 0, list(ASSIGNMENT_ENGINEER = 10)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Communication Blackout", /datum/event/communications_blackout, 50, list(ASSIGNMENT_AI = 25, ASSIGNMENT_SECURITY = 25)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Prison Break", /datum/event/prison_break, 0, list(ASSIGNMENT_SECURITY = 50)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Grid Check", /datum/event/grid_check, 25, list(ASSIGNMENT_ENGINEER = 10)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Electrical Storm", /datum/event/electrical_storm, 15, list(ASSIGNMENT_ENGINEER = 5, ASSIGNMENT_JANITOR = 15)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Radiation Storm", /datum/event/radiation_storm, 0, list(ASSIGNMENT_MEDICAL = 10), 1), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Appendicitis", /datum/event/spontaneous_appendicitis, 0, list(ASSIGNMENT_MEDICAL = 10), 1), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Viral Infection", /datum/event/viral_infection, 0, list(ASSIGNMENT_MEDICAL = 10)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Spider Infestation", /datum/event/spider_infestation, 5, list(ASSIGNMENT_SECURITY = 5), 1), - new /datum/event_meta/alien(EVENT_LEVEL_MODERATE, "Alien Infestation", /datum/event/alien_infestation, 2.5,list(ASSIGNMENT_SECURITY = 1), 1, 0, 5), - new /datum/event_meta/ninja(EVENT_LEVEL_MODERATE, "Space Ninja", /datum/event/space_ninja, 0, list(ASSIGNMENT_SECURITY = 1), 1, 0, 5), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Ion Storm", /datum/event/ionstorm, 0, list(ASSIGNMENT_AI = 25, ASSIGNMENT_CYBORG = 25, ASSIGNMENT_ENGINEER = 10, ASSIGNMENT_SCIENTIST = 5)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Nothing", /datum/event/nothing, 1230), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Carp School", /datum/event/carp_migration, 100, list(ASSIGNMENT_ENGINEER = 10, ASSIGNMENT_SECURITY = 20), 1), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Rogue Drones", /datum/event/rogue_drone, 20, list(ASSIGNMENT_SECURITY = 20)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Space vines", /datum/event/spacevine, 200, list(ASSIGNMENT_ENGINEER = 10)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Meteor Shower", /datum/event/meteor_shower, 0, list(ASSIGNMENT_ENGINEER = 20)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Communication Blackout", /datum/event/communications_blackout, 500, list(ASSIGNMENT_AI = 150, ASSIGNMENT_SECURITY = 120)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Prison Break", /datum/event/prison_break, 0, list(ASSIGNMENT_SECURITY = 100)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Grid Check", /datum/event/grid_check, 200, list(ASSIGNMENT_ENGINEER = 60)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Electrical Storm", /datum/event/electrical_storm, 250, list(ASSIGNMENT_ENGINEER = 20, ASSIGNMENT_JANITOR = 150)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Radiation Storm", /datum/event/radiation_storm, 0, list(ASSIGNMENT_MEDICAL = 50), 1), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Appendicitis", /datum/event/spontaneous_appendicitis, 0, list(ASSIGNMENT_MEDICAL = 10), 1), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Viral Infection", /datum/event/viral_infection, 0, list(ASSIGNMENT_MEDICAL = 150)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Spider Infestation", /datum/event/spider_infestation, 100, list(ASSIGNMENT_SECURITY = 30), 1), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Ion Storm", /datum/event/ionstorm, 0, list(ASSIGNMENT_AI = 50, ASSIGNMENT_CYBORG = 50, ASSIGNMENT_ENGINEER = 15, ASSIGNMENT_SCIENTIST = 5)), + new /datum/event_meta/alien(EVENT_LEVEL_MODERATE, "Alien Infestation", /datum/event/alien_infestation, 2.5, list(ASSIGNMENT_SECURITY = 1), 1, 0, 5), + new /datum/event_meta/ninja(EVENT_LEVEL_MODERATE, "Space Ninja", /datum/event/space_ninja, 0, list(ASSIGNMENT_SECURITY = 1), 1, 0, 5), ) /datum/event_container/major From 1c5ca01daeeb7f5f7ce8b1bdcdefb69e2940ecb9 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 10 Jan 2015 02:30:27 -0500 Subject: [PATCH 05/12] Restricts Gibbingtons, Suicide, and Monkism syndromes Restricts Gibbingtons, Suicide, and Monkism syndromes from even greater diseases. Admins can still generate diseases with these syndromes through secrets. Fixes virus events potentially having people share the same virus datum. --- code/game/gamemodes/epidemic/epidemic.dm | 2 +- code/modules/admin/admin_verbs.dm | 16 +++++++++------- code/modules/events/viral_infection.dm | 9 +++++---- code/modules/virus2/disease2.dm | 19 ++++++++++--------- code/modules/virus2/effect.dm | 8 ++++---- code/modules/virus2/helpers.dm | 5 ++--- 6 files changed, 31 insertions(+), 28 deletions(-) diff --git a/code/game/gamemodes/epidemic/epidemic.dm b/code/game/gamemodes/epidemic/epidemic.dm index 4a0712c7128..9964a378130 100644 --- a/code/game/gamemodes/epidemic/epidemic.dm +++ b/code/game/gamemodes/epidemic/epidemic.dm @@ -113,7 +113,7 @@ world.Reboot() var/datum/disease2/disease/lethal = new - lethal.makerandom(1) + lethal.makerandom(3) lethal.infectionchance = 5 // the more doctors, the more will be infected diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 8d9e62cdcf8..65484547898 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -608,12 +608,14 @@ var/list/admin_verbs_mentor = list( var/datum/disease2/disease/D = new /datum/disease2/disease() - var/greater = ((input("Is this a lesser or greater disease?", "Give Disease") in list("Lesser", "Greater")) == "Greater") - - D.makerandom(greater) - if (!greater) - D.infectionchance = 1 + var/severity = 1 + var/greater = input("Is this a lesser, greater, or badmin disease?", "Give Disease") in list("Lesser", "Greater", "Badmin") + switch(greater) + if ("Lesser") severity = 1 + if ("Greater") severity = 2 + if ("Badmin") severity = 99 + D.makerandom(severity) D.infectionchance = input("How virulent is this disease? (1-100)", "Give Disease", D.infectionchance) as num if(istype(T,/mob/living/carbon/human)) @@ -626,8 +628,8 @@ var/list/admin_verbs_mentor = list( infect_virus2(T,D,1) feedback_add_details("admin_verb","GD2") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - log_admin("[key_name(usr)] gave [key_name(T)] a [(greater)? "greater":"lesser"] disease2 with infection chance [D.infectionchance].") - message_admins("\blue [key_name_admin(usr)] gave [key_name(T)] a [(greater)? "greater":"lesser"] disease2 with infection chance [D.infectionchance].", 1) + log_admin("[key_name(usr)] gave [key_name(T)] a [greater] disease2 with infection chance [D.infectionchance].") + message_admins("\blue [key_name_admin(usr)] gave [key_name(T)] a [greater] disease2 with infection chance [D.infectionchance].", 1) /client/proc/make_sound(var/obj/O in world) // -- TLE set category = "Special Verbs" diff --git a/code/modules/events/viral_infection.dm b/code/modules/events/viral_infection.dm index 87c55460ce1..29daed2773f 100644 --- a/code/modules/events/viral_infection.dm +++ b/code/modules/events/viral_infection.dm @@ -10,10 +10,10 @@ datum/event/viral_infection/setup() for (var/i=0, i < num_diseases, i++) var/datum/disease2/disease/D = new /datum/disease2/disease - var/greater = 0 //whether the disease is of the greater or lesser variety + var/strength = 1 //whether the disease is of the greater or lesser variety if (severity >= EVENT_LEVEL_MAJOR && prob(50)) - greater = 1 - D.makerandom(greater) + strength = 2 + D.makerandom(strength) viruses += D datum/event/viral_infection/announce() @@ -32,6 +32,7 @@ datum/event/viral_infection/start() severity = max(EVENT_LEVEL_MUNDANE, severity - 1) var/actual_severity = severity * rand(1, 3) while(actual_severity > 0 && candidates.len) - infect_mob(candidates[1], pick(viruses)) + var/datum/disease2/disease/D = pick(viruses) + infect_mob(candidates[1], D.getcopy()) candidates.Remove(candidates[1]) actual_severity-- diff --git a/code/modules/virus2/disease2.dm b/code/modules/virus2/disease2.dm index 09b6c80ee61..c7a9b8e3752 100644 --- a/code/modules/virus2/disease2.dm +++ b/code/modules/virus2/disease2.dm @@ -16,20 +16,21 @@ uniqueID = rand(0,10000) ..() -/datum/disease2/disease/proc/makerandom(var/greater=0) +/datum/disease2/disease/proc/makerandom(var/severity=1) for(var/i=1 ; i <= max_stage ; i++ ) var/datum/disease2/effectholder/holder = new /datum/disease2/effectholder holder.stage = i - if(greater) - holder.getrandomeffect(2) - else - holder.getrandomeffect() + holder.getrandomeffect(severity) effects += holder uniqueID = rand(0,10000) - if (greater) - infectionchance = rand(60,90) - else - infectionchance = 1 + switch(severity) + if(1) + infectionchance = 1 + if(2) + infectionchance = rand(10,50) + else + infectionchance = rand(60,90) + antigen |= text2num(pick(ANTIGENS)) antigen |= text2num(pick(ANTIGENS)) spreadtype = prob(70) ? "Airborne" : "Contact" diff --git a/code/modules/virus2/effect.dm b/code/modules/virus2/effect.dm index 82edfb80493..22d0a49e0a3 100644 --- a/code/modules/virus2/effect.dm +++ b/code/modules/virus2/effect.dm @@ -33,7 +33,7 @@ multiplier = rand(1,effect.maxm) /datum/disease2/effectholder/proc/majormutate() - getrandomeffect(2) + getrandomeffect(3) //////////////////////////////////////////////////////////////// ////////////////////////EFFECTS///////////////////////////////// @@ -66,7 +66,7 @@ /datum/disease2/effect/gibbingtons name = "Gibbingtons Syndrome" stage = 4 - badness = 2 + badness = 3 activate(var/mob/living/carbon/mob,var/multiplier) mob.gib() @@ -88,7 +88,7 @@ /datum/disease2/effect/monkey name = "Monkism Syndrome" stage = 4 - badness = 2 + badness = 3 activate(var/mob/living/carbon/mob,var/multiplier) if(istype(mob,/mob/living/carbon/human)) var/mob/living/carbon/human/h = mob @@ -97,7 +97,7 @@ /datum/disease2/effect/suicide name = "Suicidal Syndrome" stage = 4 - badness = 2 + badness = 3 activate(var/mob/living/carbon/mob,var/multiplier) mob.suiciding = 1 //instead of killing them instantly, just put them at -175 health and let 'em gasp for a while diff --git a/code/modules/virus2/helpers.dm b/code/modules/virus2/helpers.dm index e3da0e5614a..4ef8e3bbf4c 100644 --- a/code/modules/virus2/helpers.dm +++ b/code/modules/virus2/helpers.dm @@ -104,14 +104,13 @@ proc/airborne_can_reach(turf/source, turf/target) //Infects mob M with random lesser disease, if he doesn't have one /proc/infect_mob_random_lesser(var/mob/living/carbon/M) var/datum/disease2/disease/D = new /datum/disease2/disease - D.makerandom() - D.infectionchance = 1 + D.makerandom(1) infect_mob(M, D) //Infects mob M with random greated disease, if he doesn't have one /proc/infect_mob_random_greater(var/mob/living/carbon/M) var/datum/disease2/disease/D = new /datum/disease2/disease - D.makerandom(1) + D.makerandom(2) infect_mob(M, D) //Fancy prob() function. From 654769016e35fb94e3d866e93d5e1953fdc7c434 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 10 Jan 2015 03:18:52 -0500 Subject: [PATCH 06/12] Fixes virus events failing because of lack of compatible species --- code/modules/virus2/helpers.dm | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/code/modules/virus2/helpers.dm b/code/modules/virus2/helpers.dm index 4ef8e3bbf4c..8a744be85f0 100644 --- a/code/modules/virus2/helpers.dm +++ b/code/modules/virus2/helpers.dm @@ -73,15 +73,18 @@ proc/airborne_can_reach(turf/source, turf/target) if(M.reagents.has_reagent("spaceacillin")) return - if(istype(M,/mob/living/carbon/monkey)) - var/mob/living/carbon/monkey/chimp = M - if (!(chimp.greaterform in disease.affected_species)) - return + if(!disease.affected_species.len) + return - if(istype(M,/mob/living/carbon/human)) - var/mob/living/carbon/human/chump = M - if (!(chump.species.name in disease.affected_species)) - return + if(!istype(M,/mob/living/carbon)) + return + + var/mob/living/carbon/C = M + if (!(C.species.name in disease.affected_species)) + if (forced) + disease.affected_species[1] = C.species.name + else + return //not compatible with this species // log_debug("Infecting [M]") From cf0c0c29bbb2bd912d4418aea0977462dceca999 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 10 Jan 2015 11:42:52 -0500 Subject: [PATCH 07/12] Randomizes carp spawning locations --- code/modules/events/carp_migration.dm | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/code/modules/events/carp_migration.dm b/code/modules/events/carp_migration.dm index 19e16251261..16d623d3dae 100644 --- a/code/modules/events/carp_migration.dm +++ b/code/modules/events/carp_migration.dm @@ -18,19 +18,27 @@ /datum/event/carp_migration/start() if(severity == EVENT_LEVEL_MAJOR) - for(var/i = 1 to rand(3,5)) - spawn_fish(landmarks_list.len) + spawn_fish(landmarks_list.len) else if(severity == EVENT_LEVEL_MODERATE) - spawn_fish(rand(10,30)) + spawn_fish(rand(4, 6)) //12 to 30 carp, in small groups else - spawn_fish(rand(1, 5)) + spawn_fish(rand(1, 3), 1, 2) //1 to 6 carp, alone or in pairs + +/datum/event/carp_migration/proc/spawn_fish(var/num_groups, var/group_size_min=3, var/group_size_max=5) + var/list/spawn_locations = list() -/datum/event/carp_migration/proc/spawn_fish(var/limit) for(var/obj/effect/landmark/C in landmarks_list) if(C.name == "carpspawn") - spawned_carp.Add(new /mob/living/simple_animal/hostile/carp(C.loc)) - if(spawned_carp.len >= limit) - return + spawn_locations.Add(C.loc) + spawn_locations = shuffle(spawn_locations) + num_groups = min(num_groups, spawn_locations.len) + + var/i = 1 + while (i <= num_groups) + var/group_size = rand(group_size_min, group_size_max) + for (var/j = 1, j <= group_size, j++) + spawned_carp.Add(new /mob/living/simple_animal/hostile/carp(spawn_locations[i])) + i++ /datum/event/carp_migration/end() for(var/mob/living/simple_animal/hostile/carp/C in spawned_carp) From 8ac0450c0162b9fbaeb2f8d02d2d402f1365d38d Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 10 Jan 2015 12:26:12 -0500 Subject: [PATCH 08/12] Sets chance_maxm for several disease effects Also lengthens the time to get from stage 1 to stage 2 --- code/modules/events/viral_infection.dm | 13 +++++++++++-- code/modules/virus2/disease2.dm | 2 +- code/modules/virus2/effect.dm | 15 ++++++++++----- code/modules/virus2/helpers.dm | 6 +++--- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/code/modules/events/viral_infection.dm b/code/modules/events/viral_infection.dm index 29daed2773f..55dbe2b8239 100644 --- a/code/modules/events/viral_infection.dm +++ b/code/modules/events/viral_infection.dm @@ -11,13 +11,22 @@ datum/event/viral_infection/setup() var/datum/disease2/disease/D = new /datum/disease2/disease var/strength = 1 //whether the disease is of the greater or lesser variety - if (severity >= EVENT_LEVEL_MAJOR && prob(50)) + if (severity >= EVENT_LEVEL_MAJOR && prob(75)) strength = 2 D.makerandom(strength) viruses += D datum/event/viral_infection/announce() - command_announcement.Announce("Confirmed outbreak of level five biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", new_sound = 'sound/AI/outbreak5.ogg') + var/level + if (severity == EVENT_LEVEL_MUNDANE) + return + else if (severity == EVENT_LEVEL_MODERATE) + level = pick("one", "two", "three", "four") + else + level = "five" + + if (severity == EVENT_LEVEL_MAJOR || prob(60)) + command_announcement.Announce("Confirmed outbreak of level [level] biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", new_sound = 'sound/AI/outbreak5.ogg') datum/event/viral_infection/start() if(!viruses.len) return diff --git a/code/modules/virus2/disease2.dm b/code/modules/virus2/disease2.dm index c7a9b8e3752..a68bafed7c4 100644 --- a/code/modules/virus2/disease2.dm +++ b/code/modules/virus2/disease2.dm @@ -80,7 +80,7 @@ clicks += 10 //Moving to the next stage - if(clicks > stage*100 && prob(10)) + if(clicks > max(stage*100, 200) && prob(10)) if(stage == max_stage) src.cure(mob) mob.antibodies |= src.antigen diff --git a/code/modules/virus2/effect.dm b/code/modules/virus2/effect.dm index 22d0a49e0a3..c79db488a8d 100644 --- a/code/modules/virus2/effect.dm +++ b/code/modules/virus2/effect.dm @@ -40,7 +40,7 @@ //////////////////////////////////////////////////////////////// /datum/disease2/effect - var/chance_maxm = 50 + var/chance_maxm = 50 //note that disease effects only proc once every 3 ticks for humans var/name = "Blanking effect" var/stage = 4 var/maxm = 1 @@ -60,8 +60,7 @@ name = "Nil Syndrome" stage = 4 badness = 1 - activate() - return + chance_maxm = 0 /datum/disease2/effect/gibbingtons name = "Gibbingtons Syndrome" @@ -256,6 +255,7 @@ /datum/disease2/effect/groan name = "Groaning Syndrome" stage = 3 + chance_maxm = 25 activate(var/mob/living/carbon/mob,var/multiplier) mob.say("*groan") ////////////////////////STAGE 2///////////////////////////////// @@ -263,6 +263,7 @@ /datum/disease2/effect/scream name = "Loudness Syndrome" stage = 2 + chance_maxm = 25 activate(var/mob/living/carbon/mob,var/multiplier) mob.say("*scream") @@ -275,6 +276,7 @@ /datum/disease2/effect/sleepy name = "Resting Syndrome" stage = 2 + chance_maxm = 15 activate(var/mob/living/carbon/mob,var/multiplier) mob.say("*collapse") @@ -301,6 +303,7 @@ /datum/disease2/effect/fridge name = "Refridgerator Syndrome" stage = 2 + chance_maxm = 25 activate(var/mob/living/carbon/mob,var/multiplier) mob.say("*shiver") @@ -346,17 +349,19 @@ name = "Flemmingtons" stage = 1 activate(var/mob/living/carbon/mob,var/multiplier) - mob << "\red Mucous runs down the back of your throat." + mob << "Mucous runs down the back of your throat." /datum/disease2/effect/drool name = "Saliva Effect" stage = 1 + chance_maxm = 25 activate(var/mob/living/carbon/mob,var/multiplier) mob.say("*drool") /datum/disease2/effect/twitch name = "Twitcher" stage = 1 + chance_maxm = 25 activate(var/mob/living/carbon/mob,var/multiplier) mob.say("*twitch") @@ -364,4 +369,4 @@ name = "Headache" stage = 1 activate(var/mob/living/carbon/mob,var/multiplier) - mob << " Your head hurts a bit" + mob << "Your head hurts a bit." diff --git a/code/modules/virus2/helpers.dm b/code/modules/virus2/helpers.dm index 8a744be85f0..2c4e1e823c8 100644 --- a/code/modules/virus2/helpers.dm +++ b/code/modules/virus2/helpers.dm @@ -73,12 +73,12 @@ proc/airborne_can_reach(turf/source, turf/target) if(M.reagents.has_reagent("spaceacillin")) return - if(!disease.affected_species.len) - return - if(!istype(M,/mob/living/carbon)) return + if(!disease.affected_species.len) + return + var/mob/living/carbon/C = M if (!(C.species.name in disease.affected_species)) if (forced) From d61c808fef5f1254ee5ed6afb3f6bf3f07efb4b9 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 10 Jan 2015 12:29:35 -0500 Subject: [PATCH 09/12] Cleans up infect_virus2() typecheck --- code/modules/virus2/helpers.dm | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/code/modules/virus2/helpers.dm b/code/modules/virus2/helpers.dm index 2c4e1e823c8..927078b062a 100644 --- a/code/modules/virus2/helpers.dm +++ b/code/modules/virus2/helpers.dm @@ -72,17 +72,13 @@ proc/airborne_can_reach(turf/source, turf/target) return if(M.reagents.has_reagent("spaceacillin")) return - - if(!istype(M,/mob/living/carbon)) - return - + if(!disease.affected_species.len) return - - var/mob/living/carbon/C = M - if (!(C.species.name in disease.affected_species)) + + if (!(M.species.name in disease.affected_species)) if (forced) - disease.affected_species[1] = C.species.name + disease.affected_species[1] = M.species.name else return //not compatible with this species From e49a3a86aed66023c5afd9e85e4f427ec5ebef04 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 10 Jan 2015 12:43:19 -0500 Subject: [PATCH 10/12] Delays events by 15 minutes on crew autotransfer --- code/game/machinery/computer/communications.dm | 10 ++++++++-- code/modules/events/event_manager.dm | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index f187957f5b6..5285235fbfb 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -496,8 +496,14 @@ return emergency_shuttle.call_transfer() - log_game("[key_name(user)] has called the shuttle.") - message_admins("[key_name_admin(user)] has called the shuttle.", 1) + + //delay events in case of an autotransfer + if (isnull(user)) + event_manager.delay_events(EVENT_LEVEL_MODERATE, 9000) //15 minutes + event_manager.delay_events(EVENT_LEVEL_MAJOR, 9000) + + log_game("[user? key_name(user) : "Autotransfer"] has called the shuttle.") + message_admins("[user? key_name_admin(user) : "Autotransfer"] has called the shuttle.", 1) return diff --git a/code/modules/events/event_manager.dm b/code/modules/events/event_manager.dm index 1ef4d22e911..d6d571e9f09 100644 --- a/code/modules/events/event_manager.dm +++ b/code/modules/events/event_manager.dm @@ -45,6 +45,10 @@ log_debug("Event '[EM.name]' has completed at [worldtime2text()].") +/datum/event_manager/proc/delay_events(var/container, var/delay) + var/list/datum/event_container/EC = event_containers[container] + EC.next_event_time += delay + /datum/event_manager/proc/Interact(var/mob/living/user) var/html = GetInteractWindow() From 03e95ecbcf4f766efbeb546a62b56494298d0c9a Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 10 Jan 2015 13:29:19 -0500 Subject: [PATCH 11/12] Fixes UI event weighting display --- code/modules/events/event_manager.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/events/event_manager.dm b/code/modules/events/event_manager.dm index d6d571e9f09..4be0e83e979 100644 --- a/code/modules/events/event_manager.dm +++ b/code/modules/events/event_manager.dm @@ -45,8 +45,8 @@ log_debug("Event '[EM.name]' has completed at [worldtime2text()].") -/datum/event_manager/proc/delay_events(var/container, var/delay) - var/list/datum/event_container/EC = event_containers[container] +/datum/event_manager/proc/delay_events(var/severity, var/delay) + var/list/datum/event_container/EC = event_containers[severity] EC.next_event_time += delay /datum/event_manager/proc/Interact(var/mob/living/user) @@ -96,7 +96,7 @@ html += "[EM.max_weight]" html += "[EM.one_shot]" html += "[EM.enabled]" - html += "[EM.get_weight()]" + html += "[EM.get_weight(number_active_with_role())]" html += "Remove" html += "" html += "" From b069bfb6582686c0ab78a826d96e9331ff693929 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Mon, 12 Jan 2015 00:05:47 -0500 Subject: [PATCH 12/12] Adjusts infection chances After some discussion on IRC this seems like a better starting value. --- code/modules/virus2/disease2.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/virus2/disease2.dm b/code/modules/virus2/disease2.dm index a68bafed7c4..4323ce65455 100644 --- a/code/modules/virus2/disease2.dm +++ b/code/modules/virus2/disease2.dm @@ -27,7 +27,7 @@ if(1) infectionchance = 1 if(2) - infectionchance = rand(10,50) + infectionchance = rand(10,20) else infectionchance = rand(60,90)