Merge pull request #7772 from mwerezak/events

Moderate level event weightings and balance
This commit is contained in:
Chinsky
2015-01-14 18:56:06 +03:00
11 changed files with 143 additions and 73 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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)
else if(severity == EVENT_LEVEL_MODERATE)
spawn_fish(landmarks_list.len)
else if(severity == EVENT_LEVEL_MODERATE)
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)

View File

@@ -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

View File

@@ -45,6 +45,10 @@
log_debug("Event '[EM.name]' has completed at [worldtime2text()].")
/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)
var/html = GetInteractWindow()
@@ -92,7 +96,7 @@
html += "<td>[EM.max_weight]</td>"
html += "<td><A align='right' href='?src=\ref[src];toggle_oneshot=\ref[EM]'>[EM.one_shot]</A></td>"
html += "<td><A align='right' href='?src=\ref[src];toggle_enabled=\ref[EM]'>[EM.enabled]</A></td>"
html += "<td><span class='alert'>[EM.get_weight()]</span></td>"
html += "<td><span class='alert'>[EM.get_weight(number_active_with_role())]</span></td>"
html += "<td><A align='right' href='?src=\ref[src];remove=\ref[EM];EC=\ref[selected_event_container]'>Remove</A></td>"
html += "</tr>"
html += "</table>"

View File

@@ -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()

View File

@@ -1,11 +1,36 @@
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/strength = 1 //whether the disease is of the greater or lesser variety
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
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 +38,10 @@ 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])
var/datum/disease2/disease/D = pick(viruses)
infect_mob(candidates[1], D.getcopy())
candidates.Remove(candidates[1])
actual_severity--

View File

@@ -16,17 +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)
infectionchance = rand(60,90)
switch(severity)
if(1)
infectionchance = 1
if(2)
infectionchance = rand(10,20)
else
infectionchance = rand(60,90)
antigen |= text2num(pick(ANTIGENS))
antigen |= text2num(pick(ANTIGENS))
spreadtype = prob(70) ? "Airborne" : "Contact"
@@ -76,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

View File

@@ -33,14 +33,14 @@
multiplier = rand(1,effect.maxm)
/datum/disease2/effectholder/proc/majormutate()
getrandomeffect(2)
getrandomeffect(3)
////////////////////////////////////////////////////////////////
////////////////////////EFFECTS/////////////////////////////////
////////////////////////////////////////////////////////////////
/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
@@ -56,10 +56,16 @@
////////////////////////STAGE 4/////////////////////////////////
/datum/disease2/effect/nothing
name = "Nil Syndrome"
stage = 4
badness = 1
chance_maxm = 0
/datum/disease2/effect/gibbingtons
name = "Gibbingtons Syndrome"
stage = 4
badness = 2
badness = 3
activate(var/mob/living/carbon/mob,var/multiplier)
mob.gib()
@@ -67,19 +73,21 @@
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
/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
@@ -88,7 +96,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
@@ -101,12 +109,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 +125,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 +151,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 +169,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 +185,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,10 +252,10 @@
activate(var/mob/living/carbon/mob,var/multiplier)
mob.apply_damage(2, CLONE)
/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/////////////////////////////////
@@ -250,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")
@@ -262,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")
@@ -288,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")
@@ -333,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 << "<span class='warning'>Mucous runs down the back of your throat.</span>"
/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")
@@ -351,4 +369,4 @@
name = "Headache"
stage = 1
activate(var/mob/living/carbon/mob,var/multiplier)
mob << "<span class = 'notice'> Your head hurts a bit</span>"
mob << "<span class='warning'>Your head hurts a bit.</span>"

View File

@@ -72,16 +72,15 @@ proc/airborne_can_reach(turf/source, turf/target)
return
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(istype(M,/mob/living/carbon/human))
var/mob/living/carbon/human/chump = M
if (!(chump.species.name in disease.affected_species))
return
if(!disease.affected_species.len)
return
if (!(M.species.name in disease.affected_species))
if (forced)
disease.affected_species[1] = M.species.name
else
return //not compatible with this species
// log_debug("Infecting [M]")
@@ -96,20 +95,22 @@ 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
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)
infect_virus2(M,D,1)
M.hud_updateflag |= 1 << STATUS_HUD
D.makerandom(2)
infect_mob(M, D)
//Fancy prob() function.
/proc/dprob(var/p)