diff --git a/code/game/machinery/telecomms/machines/processor.dm b/code/game/machinery/telecomms/machines/processor.dm index c5a719c9198..52d8900a864 100644 --- a/code/game/machinery/telecomms/machines/processor.dm +++ b/code/game/machinery/telecomms/machines/processor.dm @@ -22,10 +22,17 @@ if(!is_freq_listening(signal)) return + // Processor set to COMPRESS if(!process_mode) - signal.data["compression"] = 100 // even more compressed signal + // Data scrambling increased from 35-65 to MAXIMUM GIBBERISH + signal.data["compression"] = 100 + // Processor set to UNCOMPRESS else if (signal.data["compression"]) - signal.data["compression"] = 0 // uncompress subspace signal + // Taken any damage? Start gently scrambling things. + if(integrity < 100) + signal.data["compression"] = rand(0, round((100-integrity))) + // Uncompress signal to complete clarity + else signal.data["compression"] = 0 if(istype(machine_from, /obj/machinery/telecomms/bus)) relay_direct_information(signal, machine_from) // send the signal back to the machine diff --git a/code/game/machinery/telecomms/telecommunications.dm b/code/game/machinery/telecomms/telecommunications.dm index 622ed5dcea8..e976ea2849c 100644 --- a/code/game/machinery/telecomms/telecommunications.dm +++ b/code/game/machinery/telecomms/telecommunications.dm @@ -147,6 +147,9 @@ stat |= EMPED addtimer(CALLBACK(src, PROC_REF(post_emp_act)), (300 SECONDS) / severity) +/obj/machinery/telecomms/proc/emp_damage() + integrity = between(0, integrity - (rand(5,30)), 100) + /obj/machinery/telecomms/proc/post_emp_act() stat &= ~EMPED toggle_power(POWER_USE_IDLE) diff --git a/code/modules/events/communications_blackout.dm b/code/modules/events/communications_blackout.dm index 84d2d90439c..9882da902d5 100644 --- a/code/modules/events/communications_blackout.dm +++ b/code/modules/events/communications_blackout.dm @@ -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() diff --git a/code/modules/events/electrical_storm.dm b/code/modules/events/electrical_storm.dm index e85e1d57edd..81a682663fa 100644 --- a/code/modules/events/electrical_storm.dm +++ b/code/modules/events/electrical_storm.dm @@ -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() . = ..() diff --git a/code/modules/events/event.dm b/code/modules/events/event.dm index 5cceb97d5d9..ae003fc7892 100644 --- a/code/modules/events/event.dm +++ b/code/modules/events/event.dm @@ -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)) diff --git a/code/modules/events/event_container.dm b/code/modules/events/event_container.dm index b53d447612e..09f81fd233a 100644 --- a/code/modules/events/event_container.dm +++ b/code/modules/events/event_container.dm @@ -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, diff --git a/code/modules/events/prison_break.dm b/code/modules/events/prison_break.dm index cb1884e2fe6..e83b964efd4 100644 --- a/code/modules/events/prison_break.dm +++ b/code/modules/events/prison_break.dm @@ -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() diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 6556bff8829..09e8c5c014d 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1322,12 +1322,20 @@ ABSTRACT_TYPE(/obj/machinery/power/apc) /obj/machinery/power/apc/proc/set_broken() // Aesthetically much better! visible_message(SPAN_NOTICE("[src]'s screen flickers with warnings briefly!")) + spark(src, 5, GLOB.alldirs) addtimer(CALLBACK(src, PROC_REF(break_timer)), rand(2, 5)) /obj/machinery/power/apc/proc/break_timer() - visible_message(SPAN_NOTICE("[src]'s screen suddenly explodes in rain of sparks and small debris!")) + visible_message(SPAN_DANGER("[src]'s screen suddenly explodes in rain of sparks and small debris!"), \ + SPAN_DANGER("You hear sizzling electronics.")) + var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread() + smoke.set_up(3, 0, loc) + smoke.attach(src) + smoke.start() + spark(src, 5, GLOB.alldirs) stat |= BROKEN operating = 0 + failure_timer = 0 queue_icon_update() update() @@ -1345,6 +1353,7 @@ ABSTRACT_TYPE(/obj/machinery/power/apc) if (prob(chance)) L.stat &= ~POWEROFF L.broken() + spark(L, 5, GLOB.alldirs) CHECK_TICK /obj/machinery/power/apc/proc/flicker_all() diff --git a/html/changelogs/Batrachophreno-EventUpdates.yml b/html/changelogs/Batrachophreno-EventUpdates.yml new file mode 100644 index 00000000000..f2f92caa121 --- /dev/null +++ b/html/changelogs/Batrachophreno-EventUpdates.yml @@ -0,0 +1,65 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: Batrachophreno + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Added variant of the Communications Blackout event which has the potential to damage telecomms machinery (weighted towards Engineering being on-manifest)." + - rscadd: "Telecomms Processors now factor damage into account when uncompressing messages (gibberish factor increases with damage)." + - balance: "Prison Break event adjusted to be in line with Containment events (now affects all of Security excepting certain highly secured areas)." + - balance: "Space Vines, Drone Revolution major events now require minimum population of 4." + - qol: "Majorly updated Event Probabilities sheet (updated multiple changed events, removed retired events, added missing new events, etc.)" + - bugfix: "Event selection now respects minimum pop requirement param." + - balance: "Refactored the Electrical Storm behavior to play more interestingly (less grinding busywork, more smoke and mirrors)." + - rscadd: "Added Mundane and Major variants of the Electrical Storm event." \ No newline at end of file diff --git a/tools/Event Probabilities/Event Probabilities.xlsx b/tools/Event Probabilities/Event Probabilities.xlsx index 6c4ae1274dd..1be10c2b1ce 100644 Binary files a/tools/Event Probabilities/Event Probabilities.xlsx and b/tools/Event Probabilities/Event Probabilities.xlsx differ