From 669dbdd457fcdf3f745e38d5a7833565a126516a Mon Sep 17 00:00:00 2001 From: Guti <32563288+TheCaramelion@users.noreply.github.com> Date: Mon, 15 Dec 2025 17:22:30 +0100 Subject: [PATCH] Anomalies random event (#12111) --- modular_chomp/code/modules/event/anomalies.dm | 112 ++++++++++++++++++ .../code/modules/event/event_container_ch.dm | 10 +- vorestation.dme | 1 + 3 files changed, 121 insertions(+), 2 deletions(-) create mode 100644 modular_chomp/code/modules/event/anomalies.dm diff --git a/modular_chomp/code/modules/event/anomalies.dm b/modular_chomp/code/modules/event/anomalies.dm new file mode 100644 index 0000000000..288b08dc94 --- /dev/null +++ b/modular_chomp/code/modules/event/anomalies.dm @@ -0,0 +1,112 @@ +/datum/event/anomaly + startWhen = 15 + announceWhen = 1 + var/area/impact_area + var/datum/anomaly_placer/placer = new() + var/obj/effect/anomaly/anomaly_path = /obj/effect/anomaly/flux + +/datum/event/anomaly/setup() + impact_area = placer.find_valid_area() + +/datum/event/anomaly/announce() + if(isnull(impact_area)) + impact_area = placer.find_valid_area() + command_announcement.Announce("Energetic flux wave detected on [ANOMALY_ANNOUNCE_DANGEROUS_TEXT] [impact_area.name].", "Anomaly Alert") + +/datum/event/anomaly/start() + var/turf/anomaly_turf + anomaly_turf = placer.find_valid_turf(impact_area) + + var/newAnomaly + if(anomaly_turf) + newAnomaly = new anomaly_path(anomaly_turf) + if(newAnomaly) + apply_anomaly_properties(newAnomaly) + +/datum/event/anomaly/proc/apply_anomaly_properties(obj/effect/anomaly/new_anomaly) + return + +// Bioscrambler +/datum/event/anomaly/bioscrambler + startWhen = 3 + announceWhen = 1 + anomaly_path = /obj/effect/anomaly/bioscrambler + +/datum/event/anomaly/bioscrambler/announce() + if(isnull(impact_area)) + impact_area = placer.find_valid_area() + command_announcement.Announce("Biologic trait swapping agent detected on [ANOMALY_ANNOUNCE_MEDIUM_TEXT] [impact_area.name].", "Anomaly Alert") + +// Bluespace +/datum/event/anomaly/bluespace + startWhen = 3 + announceWhen = 1 + anomaly_path = /obj/effect/anomaly/bluespace + +/datum/event/anomaly/bluespace/announce() + if(isnull(impact_area)) + impact_area = placer.find_valid_area() + command_announcement.Announce("Bluespace instability detected on [ANOMALY_ANNOUNCE_MEDIUM_TEXT] [impact_area.name].", "Anomaly Alert") + +// Dimensional +/datum/event/anomaly/dimensional + startWhen = 3 + announceWhen = 1 + anomaly_path = /obj/effect/anomaly/dimensional + var/anomaly_theme + +/datum/event/anomaly/dimensional/apply_anomaly_properties(obj/effect/anomaly/new_anomaly) + if(!anomaly_theme) + return + var/obj/effect/anomaly/dimensional/anomaly = new_anomaly + anomaly.prepare_area(new_theme_path = anomaly_theme) + +/datum/event/anomaly/dimensional/announce() + if(isnull(impact_area)) + impact_area = placer.find_valid_area() + command_announcement.Announce("Dimensional instability detected on [ANOMALY_ANNOUNCE_MEDIUM_TEXT] [impact_area.name].", "Anomaly Alert") + +// Flux + +/datum/event/anomaly/flux + startWhen = 15 + announceWhen = 1 + anomaly_path = /obj/effect/anomaly/flux + +/datum/event/anomaly/flux/announce() + if(isnull(impact_area)) + impact_area = placer.find_valid_area() + command_announcement.Announce("Hyper-energetic flux wave detected on [ANOMALY_ANNOUNCE_DANGEROUS_TEXT] [impact_area.name].", "Anomaly Alert") + +// Gravitational +/datum/event/anomaly/grav + startWhen = 3 + announceWhen = 1 + anomaly_path = /obj/effect/anomaly/grav + +/datum/event/anomaly/grav/announce() + if(isnull(impact_area)) + impact_area = placer.find_valid_area() + command_announcement.Announce("Gravitational anomaly detected on [ANOMALY_ANNOUNCE_HARMFUL_TEXT] [impact_area.name].", "Anomaly Alert") + +// Hallucination +/datum/event/anomaly/hallucination + startWhen = 3 + announceWhen = 1 + anomaly_path = /obj/effect/anomaly/hallucination + +/datum/event/anomaly/hallucination/announce() + if(isnull(impact_area)) + impact_area = placer.find_valid_area() + command_announcement.Announce("Hallucinatory event detected on [ANOMALY_ANNOUNCE_MEDIUM_TEXT] [impact_area.name].", "Anomaly Alert") + +// Pyroclastic +/datum/event/anomaly/pyro + startWhen = 15 + announceWhen = 1 + anomaly_path = /obj/effect/anomaly/pyro + +/datum/event/anomaly/pyro/announce() + if(isnull(impact_area)) + impact_area = placer.find_valid_area() + command_announcement.Announce("Pyroclastic anomaly detected on [ANOMALY_ANNOUNCE_HARMFUL_TEXT] [impact_area.name].", "Anomaly Alert") diff --git a/modular_chomp/code/modules/event/event_container_ch.dm b/modular_chomp/code/modules/event/event_container_ch.dm index 2dcb73b07f..c760ca787c 100644 --- a/modular_chomp/code/modules/event/event_container_ch.dm +++ b/modular_chomp/code/modules/event/event_container_ch.dm @@ -56,22 +56,28 @@ new /datum/event_meta(EVENT_LEVEL_MODERATE, "Nothing", /datum/event/nothing, 1600), // Leaks gas into an unoccupied room. new /datum/event_meta(EVENT_LEVEL_MODERATE, "Appendicitis", /datum/event/spontaneous_appendicitis, -30, list(DEPARTMENT_MEDICAL = 30), TRUE, min_jobs = list(DEPARTMENT_MEDICAL = 2)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Bluespace Anomaly", /datum/event/anomaly/bluespace, -20, list(DEPARTMENT_RESEARCH = 30, DEPARTMENT_ANY = 2), TRUE), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Bluespace Lockers", /datum/event/bluespace_locker, 10, list(DEPARTMENT_RESEARCH = 25, DEPARTMENT_ANY = 2), TRUE), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Bioscrambler Anomaly", /datum/event/anomaly/bioscrambler, -20, list(DEPARTMENT_MEDICAL = 30, DEPARTMENT_RESEARCH = 10), TRUE, min_jobs = list(DEPARTMENT_MEDICAL = 1)), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Atmos Leak", /datum/event/atmos_leak, 30, list(DEPARTMENT_ENGINEERING = 25), TRUE), new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Camera Damage", /datum/event/camera_damage, 20, list(DEPARTMENT_SECURITY = 5, DEPARTMENT_ENGINEERING = 20), min_jobs = list(DEPARTMENT_ENGINEERING = 1)), // Just disables comms for a short while. new /datum/event_meta(EVENT_LEVEL_MODERATE, "Communication Blackout", /datum/event/communications_blackout, 500, list(JOB_AI = 100, DEPARTMENT_SECURITY = 50), TRUE), - // Just blows out a few lights + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Dimensional Anomaly", /datum/event/anomaly/dimensional, -20, list(DEPARTMENT_RESEARCH = 30, DEPARTMENT_ANY = 2), TRUE), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Drone Pod Drop", /datum/event/drone_pod_drop, 10, list(DEPARTMENT_RESEARCH = 40), TRUE), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Flux Anomaly", /datum/event/anomaly/flux, -30, list(DEPARTMENT_ENGINEERING = 30, DEPARTMENT_RESEARCH = 20), TRUE), + // Just blows out a few lights new /datum/event_meta(EVENT_LEVEL_MODERATE, "Electrical Storm", /datum/event/electrical_storm, 250, list(DEPARTMENT_ENGINEERING = 20, JOB_JANITOR = 150), TRUE), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Exotic Infestation", /datum/event/dangerinfestation, -30, list(DEPARTMENT_ENGINEERING = 20, DEPARTMENT_RESEARCH = 5, DEPARTMENT_ANY = 2)), //Escaped slime event itself needs to be rejiggered because of the mob refactor. //new /datum/event_meta(EVENT_LEVEL_MODERATE, "Escaped Slimes", /datum/event/escaped_slimes, -40, list(DEPARTMENT_RESEARCH = 30, DEPARTMENT_SECURITY = 20)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Gravity Anomaly", /datum/event/anomaly/grav, -20, list(DEPARTMENT_ENGINEERING = 30, DEPARTMENT_RESEARCH = 20, DEPARTMENT_ANY = 2), TRUE), // This one is just too fun. new /datum/event_meta(EVENT_LEVEL_MODERATE, "Gravity Failure", /datum/event/gravity, 75, list(DEPARTMENT_ENGINEERING = 60), TRUE), // Temporary power failure, but mitigatead by subgrids new /datum/event_meta(EVENT_LEVEL_MODERATE, "Grid Check", /datum/event/grid_check, 0, list(DEPARTMENT_RESEARCH = 10, DEPARTMENT_ENGINEERING = 25), TRUE), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Grub Infestation", /datum/event/grub_infestation, -20, list(DEPARTMENT_SECURITY = 40, DEPARTMENT_ENGINEERING = 40), TRUE), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Hallucination Anomaly", /datum/event/anomaly/hallucination, -20, list(DEPARTMENT_MEDICAL = 10, DEPARTMENT_RESEARCH = 10), TRUE), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Hostile Runtime", /datum/event/hostile_runtime, -20, list(DEPARTMENT_ENGINEERING = 40), min_jobs = list(DEPARTMENT_ENGINEERING = 1)), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Infected Room", /datum/event/disease_outbreak/floor, -50, list(DEPARTMENT_MEDICAL = 25, JOB_JANITOR = 10, DEPARTMENT_ANY = 1), TRUE, min_jobs = list(DEPARTMENT_MEDICAL = 2)), // Pure RP fun, no mechanical effects. @@ -82,7 +88,7 @@ new /datum/event_meta(EVENT_LEVEL_MODERATE, "Meteor Shower", /datum/event/meteor_wave, -50, list(DEPARTMENT_ENGINEERING = 45), TRUE, min_jobs = list(DEPARTMENT_ENGINEERING = 2)), //New CHOMPStation event. Mice and lizards grow into rats and lizardmen respectively. new /datum/event_meta(EVENT_LEVEL_MODERATE, "Mutants", /datum/event/mutants, 20, list(DEPARTMENT_ANY = 15, DEPARTMENT_SECURITY = 25), TRUE), - // Opens doors in brig. So just RP fun + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Pyroclastic Anomaly", /datum/event/anomaly/pyro, -30, list(DEPARTMENT_ENGINEERING = 30, DEPARTMENT_RESEARCH = 20), TRUE, min_jobs = list(DEPARTMENT_ENGINEERING = 2)), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Radiation Storm", /datum/event/radiation_storm, 50, list(DEPARTMENT_MEDICAL = 50), TRUE), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Rogue Drones", /datum/event/rogue_drone, -30, list(DEPARTMENT_SECURITY = 25, JOB_HEAD_OF_SECURITY = 35, JOB_WARDEN = 35), min_jobs = list(DEPARTMENT_SECURITY = 2)), // Radiation, but only in space. diff --git a/vorestation.dme b/vorestation.dme index be8b496470..b8c6a3d9d5 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -5345,6 +5345,7 @@ #include "modular_chomp\code\modules\economy\vending_machines_vr.dm" #include "modular_chomp\code\modules\emotes\definitions\audiable.dm" #include "modular_chomp\code\modules\emotes\definitions\audible_pain.dm" +#include "modular_chomp\code\modules\event\anomalies.dm" #include "modular_chomp\code\modules\event\bluespacelocker.dm" #include "modular_chomp\code\modules\event\dangerinfestation.dm" #include "modular_chomp\code\modules\event\electrical_fire.dm"