More Event Variations, Event Balance (#20813)

Some functional updates to events:
**Comms Blackouts:** Now has a variant (min. 6 pop,
engineering-weighted) which gives each machine a 10% chance to take a
little integrity damage. Additionally, Telecomms Processors now factor
their integrity damage into their ability to decompress messages, so
this alternative comms blackout might cause radio transmissions (either
global or for a given department) to start getting a little garbled- not
enough to genuinely impede comms, but enough to justify Engi to fix them
up.

**Prison Break:** Given how rarely we actually have people sitting
around in the prison waiting for breakouts over the course of a given
round, this event has been changed to be more akin to the existing
Containment events- the entire department (minus armory, nuke storage,
checkpoints, etc.) are at risk of lights blown, access issues, etc. Just
a little more variety added to the mix.

**Space Vines:** Minimum 4 pop to fire. Shouldn't matter much in the
grand scheme of things, just reduces annoyance factor for extremely
low-pop if they roll some vines that fuck them up. Will look into
refactoring that event so that the danger factor of the vines increases
with population, and remove the min pop requirement again.

**Drone Revolution:** Minimum 4 pop to fire. Again, shouldn't matter
much in the grand scheme of things but this highest tier event will
seriously fuck up anyone who latejoins and uses the maints to, say, help
set the ship up during low pop! No I'm not salty!

**Electrical Storm:** Refactored this and restored the Mundane and Major
variants. While we want this event to keep Engineers on their toes and
provide openings for people to break regs if they so wished, most of the
event is theater (lots of flickering lights now!) While the Mundane and
Moderate variants are mostly flavorful and will just give Engineers a
few excuses to visit different departments and RP with people, Major
events will be your 'all hands on deck' affairs (as Major events are
ought) and in very rare circumstances could even cascade into more
serious issues. Did a ton of unit testing on this and feel very good
about how each variant actually looks, will make any additional tweaks
if needed once we see how it plays with an actual population!

The Event Probabilities sheet was also very out of date, missing Comet
Expulsion, had the old Viral Outbreak, lots of old values, etc. Updated
all the events, and also updated the % formulas to factor in minimum
population- changing the 'Assumed Personnel' values at the top to a
level below the minimum population for a given event will now correctly
set its probability to 0%, making it clearer what actual odds are given
different pop levels.

I also don't think pop_needed was working correctly: various changes in
there to get it behaving.

Obv this PR grew in scope from outset and touches a small handful of
different things, so lmk anything to mix and match and change and drop.
!review
This commit is contained in:
Batrachophreno
2025-06-22 18:09:11 +00:00
committed by GitHub
parent 3e8e76b464
commit 4a63be9448
10 changed files with 181 additions and 44 deletions
@@ -1,5 +1,9 @@
/datum/event/communications_blackout
no_fake = 1
var/damage_machinery = 0
/datum/event/communications_blackout/damage_machinery
damage_machinery = 1
/datum/event/communications_blackout/announce()
var/alert = pick( "Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you*%fj00)`5vc-BZZT", \
@@ -27,3 +31,6 @@
for(var/obj/machinery/telecomms/T in SSmachinery.all_telecomms)
if(T.z in affecting_z)
T.emp_act(EMP_HEAVY)
// 10% chance for a given machine to take damage: slight delays in transmission time or slight message garbling until repaired.
if(damage_machinery && prob(10))
T.emp_damage()
+50 -17
View File
@@ -6,6 +6,7 @@
has_skybox_image = TRUE
var/list/valid_apcs
var/global/lightning_color
var/storm_damage
/datum/event/electrical_storm/Destroy(force)
valid_apcs = null
@@ -25,9 +26,10 @@
if(EVENT_LEVEL_MODERATE)
command_announcement.Announce("The [location_name()] is about to pass through an electrical storm. Please secure sensitive electrical equipment until the storm passes.", "[location_name()] Sensor Array", new_sound = 'sound/AI/electrical_storm.ogg', zlevels = affecting_z)
if(EVENT_LEVEL_MAJOR)
command_announcement.Announce("Alert. A strong electrical storm has been detected in proximity of the [location_name()]. It is recommended to immediately secure sensitive electrical equipment until the storm passes.", "[location_name()] Sensor Array", new_sound = 'sound/AI/electrical_storm.ogg', zlevels = affecting_z)
command_announcement.Announce("Alert. A catastrophic electrical storm has been detected in proximity of the [location_name()]. It is recommended to immediately secure sensitive electrical equipment until the storm passes.", "[location_name()] Sensor Array", new_sound = 'sound/AI/electrical_storm.ogg', zlevels = affecting_z)
/datum/event/electrical_storm/setup()
/datum/event/electrical_storm/start()
..()
valid_apcs = list()
for(var/obj/machinery/power/apc/valid_apc in SSmachinery.apc_units)
if((valid_apc.z in affecting_z) && !valid_apc.is_critical)
@@ -42,32 +44,63 @@
/datum/event/electrical_storm/tick()
..()
/*
While we want this event to keep Engineers on their toes and provide openings for people to break regs if they so wished,
most of this should be theater: the biggest show should be lights flickering all over the place and a few APCs temporarily
disabled (and able to be immediately re-enabled by anyone) rather than creating excessive work for Engineering/Janitors.
The damage and effect will add up very quickly when multiple APCs are targeted though. While Mundane and Moderate events are mostly
flavorful and will just give Engineers a few excuses to visit different departments and RP with people. Major events will be your
'all hands on deck' affairs (as Major events are ought) and in very rare circumstances could even cascade into more serious issues
(battery detonates somewhere that pokes a hole in the hull and enough rooms are depowered once to start venting a portion of the ship.)
*/
if(!length(valid_apcs))
return
var/list/picked_apcs = list()
for(var/i=0, i< severity*2, i++) // up to 2/4/6 APCs per tick depending on severity
// Up to 2/4/6 APCs per tick depending on severity
for(var/i = 0, i < (severity * 2), i++)
picked_apcs |= pick(valid_apcs)
for(var/obj/machinery/power/apc/T in picked_apcs)
// Main breaker is turned off. Consider this APC protected.
if(!T.operating)
for(var/obj/machinery/power/apc/victim_apc in picked_apcs)
// Determine what each APC does. Depending on how bad they roll, might be nothing or might blow out the entire thing.
// Mundane storm: 0-55 nothing, 56+ lights flicker, 86+ damage (2 APC at a time)
// Moderate storm: 0-30 nothing, 31+ lights flicker, 81+ damage (4 APCs at a time)
// Severe storm: 0-5 nothing, 6+ lights flicker, 76+ damage (6 APCs at a time)
// Once storm damage exceeds a threshold, there is a random chance of certain secondary effects.
storm_damage = rand(0,100)
// Main breaker is turned off, or we rolled lucky. Consider this APC protected.
if(!victim_apc.operating || storm_damage <= (80 - (severity * 25)))
continue
// Decent chance to overload lighting circuit.
if(prob(3 * severity))
T.overload_lighting()
// If the APC wasn't protected or we didn't roll lucky, flicker the lights for dramatic effect.
victim_apc.flicker_all()
// Relatively small chance to emag the apc as apc_damage event does.
if(prob(0.2 * severity))
T.emagged = 1
T.update_icon()
// Now all the things that can happen if we roll high on damage.
if(storm_damage > (90 - (severity * 5)))
// Very tiny chance to completely break the APC. Has a check to ensure we don't break critical APCs such as the Engine room, or AI core. Does not occur on Mundane severity.
if(prob((1 * severity) - 1))
LOG_DEBUG("[victim_apc.name]: storm destroyed")
victim_apc.set_broken()
continue
T.energy_fail(10 * severity * rand(severity * 2, severity * 4))
// Very high chance to shutdown the APC for a short time; this can be reversed immediately by interacting with it.
if(prob(80 + (severity * 5)))
victim_apc.energy_fail(4 * severity * rand(severity * 2, severity * 4))
// Very tiny chance to completely break the APC. Has a check to ensure we don't break critical APCs such as the Engine room, or AI core. Does not occur on Mundane severity.
if(prob((0.2 * severity) - 0.2))
T.set_broken()
// Medium chance to overload lighting circuit.
if(prob(15 * severity))
victim_apc.overload_lighting((range(15 * severity, 100)))
// Tiny chance to corrupt the cell (could potentially cause minor explosions!)
if(!QDELETED(victim_apc.cell) && prob(8 * severity))
victim_apc.cell.corrupt()
// Small chance to emag the apc as apc_damage event does.
if(prob(8 * severity))
victim_apc.emagged = 1
victim_apc.update_icon()
/datum/event/electrical_storm/announce_end()
. = ..()
+5 -2
View File
@@ -28,7 +28,7 @@
var/list/minimum_job_requirement = list()
///Minimum amount of player_list mobs for this to fire
var/pop_requirement = 0
var/pop_requirement = 1
/// A lazylist of gamemodes during which this event won't fire
var/list/excluded_gamemodes
@@ -59,7 +59,10 @@
if(!enabled)
return 0
if(length(GLOB.player_list) <= pop_requirement)
var/n = 0
for (var/mob/living in GLOB.player_list)
n++
if(n <= pop_requirement)
return 0
if(LAZYISIN(excluded_gamemodes, SSticker.mode.name))
+21 -10
View File
@@ -128,6 +128,7 @@ GLOBAL_LIST_INIT(severity_to_string, list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
//WHAT THE FUCK IS THIS, WHY
/// Returns how many characters are currently active (not logged out, not AFK for more than 10 minutes) with a specific role.
/// Note that this isn't sorted by department, because e.g. having a roboticist shouldn't make meteors spawn.
/// The higher this value is, the greater likelihood that the event will occur with each active dept member.
/proc/number_active_with_role()
var/list/active_with_role = list()
active_with_role[ASSIGNMENT_ANY] = 0
@@ -223,6 +224,9 @@ GLOBAL_LIST_INIT(severity_to_string, list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Economic News", /datum/event/economic_event,
300),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Electrical Storm", /datum/event/electrical_storm,
50, list(ASSIGNMENT_ENGINEER = 20, ASSIGNMENT_JANITOR = 25)),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Cozmozoan Migration", /datum/event/carp_migration/cozmo,
60),
@@ -282,11 +286,15 @@ GLOBAL_LIST_INIT(severity_to_string, list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Appendicitis", /datum/event/spontaneous_appendicitis,
0, list(ASSIGNMENT_SURGEON = 25)),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Communication Blackout", /datum/event/communications_blackout,
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Comms Blackout", /datum/event/communications_blackout,
100),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Comms Blackout - Damage", /datum/event/communications_blackout/damage_machinery,
100, list(ASSIGNMENT_ENGINEER = 25),
pop_needed = 6),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Electrical Storm", /datum/event/electrical_storm,
50, list(ASSIGNMENT_ENGINEER = 15, ASSIGNMENT_JANITOR = 20)),
40, list(ASSIGNMENT_AI = 10, ASSIGNMENT_ENGINEER = 15, ASSIGNMENT_JANITOR = 20)),
// see comment at code/modules/events/gravity.dm
// tl;dr gravity is handled globally, meaning if the horizon loses gravity, everyone does
@@ -296,11 +304,11 @@ GLOBAL_LIST_INIT(severity_to_string, list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Ion Storm", /datum/event/ionstorm,
0, list(ASSIGNMENT_AI = 45, ASSIGNMENT_CYBORG = 25, ASSIGNMENT_ENGINEER = 6, ASSIGNMENT_SCIENTIST = 6)),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Prison Break", /datum/event/prison_break,
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Containment Error - Security", /datum/event/prison_break,
0, list(ASSIGNMENT_SECURITY = 15, ASSIGNMENT_CYBORG = 20), TRUE),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Containment Error - Xenobiology", /datum/event/prison_break/xenobiology,
0, list(ASSIGNMENT_SCIENTIST = 15, ASSIGNMENT_CYBORG = 20), TRUE),
0, list(ASSIGNMENT_SCIENTIST = 25, ASSIGNMENT_CYBORG = 20), TRUE),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Containment Error - Bridge", /datum/event/prison_break/bridge,
0, list(ASSIGNMENT_ENGINEER = 15, ASSIGNMENT_CYBORG = 20), TRUE),
@@ -316,8 +324,7 @@ GLOBAL_LIST_INIT(severity_to_string, list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
15, list(ASSIGNMENT_SECURITY = 15)),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Moderate Spider Infestation", /datum/event/spider_infestation/moderate,
50, list(ASSIGNMENT_SECURITY = 10),
pop_needed = 8),
50, list(ASSIGNMENT_SECURITY = 10)),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Moderate Vermin Infestation", /datum/event/infestation/moderate,
30, list(ASSIGNMENT_JANITOR = 15, ASSIGNMENT_SECURITY = 15, ASSIGNMENT_MEDICAL = 10)),
@@ -353,18 +360,22 @@ GLOBAL_LIST_INIT(severity_to_string, list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT
0, list(ASSIGNMENT_ENGINEER = 10), TRUE, minimum_job_requirement_list = list(ASSIGNMENT_ENGINEER = 2),
pop_needed = 10),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Electrical Storm", /datum/event/electrical_storm,
30, list(ASSIGNMENT_AI = 20, ASSIGNMENT_ENGINEER = 15, ASSIGNMENT_JANITOR = 20)),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Space Vines", /datum/event/spacevine,
0, list(ASSIGNMENT_ANY = 1, ASSIGNMENT_ENGINEER = 10, ASSIGNMENT_GARDENER = 20), TRUE),
0, list(ASSIGNMENT_ANY = 1, ASSIGNMENT_ENGINEER = 10, ASSIGNMENT_GARDENER = 20), TRUE,
pop_needed = 4),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Spider Infestation", /datum/event/spider_infestation,
25, list(ASSIGNMENT_SECURITY = 10, ASSIGNMENT_MEDICAL = 5), TRUE,
pop_needed = 8),
25, list(ASSIGNMENT_SECURITY = 10, ASSIGNMENT_MEDICAL = 5), TRUE),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Major Vermin Infestation", /datum/event/infestation/major,
15, list(ASSIGNMENT_SECURITY = 15, ASSIGNMENT_MEDICAL = 5)),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Drone Revolution", /datum/event/rogue_maint_drones,
0, list(ASSIGNMENT_ENGINEER = 10, ASSIGNMENT_MEDICAL = 5, ASSIGNMENT_SECURITY = 5)),
0, list(ASSIGNMENT_ENGINEER = 10, ASSIGNMENT_MEDICAL = 5, ASSIGNMENT_SECURITY = 5),
pop_needed = 4),
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Comet Expulsion", /datum/event/comet_expulsion,
1, list(ASSIGNMENT_BRIDGE_CREW = 5, ASSIGNMENT_ENGINEER = 2), is_one_shot = TRUE,
+11 -12
View File
@@ -3,14 +3,19 @@
announceWhen = 75
var/releaseWhen = 60
var/list/area/areas = list() //List of areas to affect. Filled by start()
//List of areas to affect. Filled by start()
var/list/area/areas = list()
ic_name = "an imprisonment system virus"
no_fake = 1
var/eventDept = "Security" //Department name in announcement
var/list/areaName = list("Brig") //Names of areas mentioned in AI and Engineering announcements
var/list/areaType = list(/area/security/prison, /area/security/brig) //Area types to include.
var/list/areaNotType = list() //Area types to specifically exclude.
//Department name in announcement
var/eventDept = "Security"
//Names of areas mentioned in AI and Engineering announcements
var/list/areaName = list("Security")
//Area types to include.
var/list/areaType = list(/area/security)
//Area types to specifically exclude.
var/list/areaNotType = list(/area/security/armory, /area/security/nuke_storage, /area/security/checkpoint, /area/security/checkpoint2, /area/security/bridge_surface_checkpoint, /area/security/penal_colony)
/datum/event/prison_break/xenobiology
eventDept = "Science"
@@ -18,12 +23,6 @@
areaType = list(/area/rnd/xenobiology)
areaNotType = list(/area/rnd/xenobiology/xenoflora, /area/rnd/xenobiology/xenoflora_storage)
/datum/event/prison_break/station
eventDept = "Station"
areaName = list("Brig","Xenobiology")
areaType = list(/area/security/prison, /area/security/brig, /area/rnd/xenobiology)
areaNotType = list(/area/rnd/xenobiology/xenoflora, /area/rnd/xenobiology/xenoflora_storage)
/datum/event/prison_break/bridge
eventDept = "Bridge"
areaName = list("Bridge")
@@ -39,7 +38,7 @@
/datum/event/prison_break/announce()
if(areas && areas.len > 0)
command_announcement.Announce("[pick("Gr3y.T1d3 virus","Malignant trojan")] detected in [station_name()] [(eventDept == "Security")? "imprisonment":"containment"] subroutines. Secure any compromised areas immediately. AI involvement is recommended.", "[eventDept] Alert", zlevels = affecting_z)
command_announcement.Announce("[pick("Gr3y.T1d3 virus","Malignant trojan")] detected in [station_name()] containment subroutines. Secure any compromised areas immediately. AI involvement is recommended.", "[eventDept] Alert", zlevels = affecting_z)
/datum/event/prison_break/start()