diff --git a/modular_chomp/code/modules/event/bluespacelocker.dm b/modular_chomp/code/modules/event/bluespacelocker.dm new file mode 100644 index 0000000000..ecaf83f697 --- /dev/null +++ b/modular_chomp/code/modules/event/bluespacelocker.dm @@ -0,0 +1,57 @@ +/datum/event/bluespace_locker + var/obj/structure/closet/entry_point + var/obj/structure/closet/exit_point + var/list/area/excluded = list( + /area/shuttle, + /area/crew_quarters, + /area/construction, + /area/rnd/test_area, + /area/solar + ) + +/datum/event/bluespace_locker/setup() + var/list/area/pickable_areas = get_station_areas(excluded) + + for(var/i in 1 to 10) + var/area/picked_area = pick(pickable_areas) + var/list/obj/structure/closet/entry_points = list() + var/list/obj/structure/closet/exit_points = list() + + for(var/obj/structure/closet/closet in picked_area) + // Only the standing lockers + if(istype(closet, /obj/structure/closet/crate) || istype(closet, /obj/structure/closet/walllocker)) + continue + if(!closet.can_open()) // Skip locked/welded ones + continue + entry_points.Add(closet) + pickable_areas.Remove(picked_area) + + // After that, choose another area + picked_area = pick(pickable_areas) + + // And for the fun of it, pick any locker or crate. Locked or not. + for(var/obj/structure/closet/closet in picked_area) + exit_points.Add(closet) + + if(length(entry_points) && length(exit_points)) + entry_point = pick(entry_points) + exit_point = pick(exit_points) + announceWhen = rand(10 SECONDS, 2 MINUTES) + endWhen = announceWhen + 1 + return + + log_game("Bluespace Locker Event: Giving up after too many failures to pick valid candidates.") + kill() + return + +/datum/event/bluespace_locker/start() + if(!entry_point || !exit_point) + return + + entry_point.AddComponent(/datum/component/bluespace_connection, list(exit_point)) + exit_point.AddComponent(/datum/component/bluespace_connection, list(entry_point)) + + log_and_message_admins("Bluespace lockers linked. Entry: [get_area(exit_point)] Exit: [get_area(entry_point)]") + +/datum/event/bluespace_locker/announce() + command_announcement.Announce("Bluespace anomaly detected near [station_name()]. Monitor sensitive equipment for malfunctions.", "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 77ab9b3b61..2dcb73b07f 100644 --- a/modular_chomp/code/modules/event/event_container_ch.dm +++ b/modular_chomp/code/modules/event/event_container_ch.dm @@ -23,30 +23,30 @@ new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Nothing", /datum/event/nothing, 400), // Bluescreens APCs, but they still work new /datum/event_meta(EVENT_LEVEL_MUNDANE, "APC Damage", /datum/event/apc_damage, 20, list(DEPARTMENT_ENGINEERING = 20), min_jobs = list(DEPARTMENT_ENGINEERING = 1)), - new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Aurora Caelus", /datum/event/aurora_caelus, 2, list(), 1), - new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Brand Intelligence", /datum/event/brand_intelligence, 20, list(JOB_JANITOR = 25), 1, min_jobs = list(DEPARTMENT_ENGINEERING = 1)), + new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Aurora Caelus", /datum/event/aurora_caelus, 2, list(), TRUE), + new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Brand Intelligence", /datum/event/brand_intelligence, 20, list(JOB_JANITOR = 25), TRUE, min_jobs = list(DEPARTMENT_ENGINEERING = 1)), new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Canister Leak", /datum/event/canister_leak, 10, list(DEPARTMENT_ENGINEERING = 20)), new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Economic News", /datum/event/economic_event, 300), new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Electrified Door", /datum/event/electrified_door, -5, list(DEPARTMENT_MEDICAL = 5, DEPARTMENT_ENGINEERING = 20, JOB_AI = 10)), - new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Lone Spacefish", /datum/event/spacefish_migration, 0, list(DEPARTMENT_SECURITY = 15), 1, min_jobs = list(DEPARTMENT_SECURITY = 3)), - new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Money Hacker", /datum/event/money_hacker, 0, list(DEPARTMENT_ANY = 4), 1, 10, 25), - new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Money Lotto", /datum/event/money_lotto, 0, list(DEPARTMENT_ANY = 1), 1, 5, 15), + new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Lone Spacefish", /datum/event/spacefish_migration, 0, list(DEPARTMENT_SECURITY = 15), TRUE, min_jobs = list(DEPARTMENT_SECURITY = 3)), + new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Money Hacker", /datum/event/money_hacker, 0, list(DEPARTMENT_ANY = 4), TRUE, 10, 25), + new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Money Lotto", /datum/event/money_lotto, 0, list(DEPARTMENT_ANY = 1), TRUE, 5, 15), //new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Mundane News", /datum/event/mundane_news, 300), - new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Shipping Error", /datum/event/shipping_error , 30, list(DEPARTMENT_ANY = 2), 0), - new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Space Dust", /datum/event/dust, 0, list(DEPARTMENT_ENGINEERING = 20), 0, 0, 50), + new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Shipping Error", /datum/event/shipping_error , 30, list(DEPARTMENT_ANY = 2), FALSE), + new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Space Dust", /datum/event/dust, 0, list(DEPARTMENT_ENGINEERING = 20), FALSE, 0, 50), new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Trivial News", /datum/event/trivial_news, 400), new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Lore News", /datum/event/lore_news, 400), - new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Supply Demand", /datum/event/supply_demand, 0, list(DEPARTMENT_ANY = 5, DEPARTMENT_RESEARCH = 15, JOB_BOTANIST = 10, DEPARTMENT_ENGINEERING = 10, DEPARTMENT_MEDICAL = 15), 1, min_jobs = list(DEPARTMENT_CARGO = 1)), + new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Supply Demand", /datum/event/supply_demand, 0, list(DEPARTMENT_ANY = 5, DEPARTMENT_RESEARCH = 15, JOB_BOTANIST = 10, DEPARTMENT_ENGINEERING = 10, DEPARTMENT_MEDICAL = 15), TRUE, min_jobs = list(DEPARTMENT_CARGO = 1)), // Spawns mice, lizards, or dud spiderlings - new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Vermin Infestation", /datum/event/infestation, 100, list(DEPARTMENT_ANY = 5, JOB_JANITOR = 100), 1), + new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Vermin Infestation", /datum/event/infestation, 100, list(DEPARTMENT_ANY = 5, JOB_JANITOR = 100), TRUE), // Rot only weakens walls, not destroy them - new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Wallrot", /datum/event/wallrot, 0, list(DEPARTMENT_ENGINEERING = 30, JOB_BOTANIST = 50), 1), + new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Wallrot", /datum/event/wallrot, 0, list(DEPARTMENT_ENGINEERING = 30, JOB_BOTANIST = 50), TRUE), ) add_disabled_events(list( - new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Lost Carp", /datum/event/carp_migration, 0, list(DEPARTMENT_SECURITY = 40), 1, min_jobs = list(DEPARTMENT_SECURITY = 1)), - new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Ian Storm", /datum/event/ianstorm, 1, list(), 1), - new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Supply Demand", /datum/event/supply_demand, 0, list(DEPARTMENT_ANY = 5, DEPARTMENT_RESEARCH = 15, JOB_BOTANIST = 10, DEPARTMENT_ENGINEERING = 10, DEPARTMENT_MEDICAL = 15), 1, min_jobs = list(DEPARTMENT_CARGO = 1)), - new /datum/event_meta(EVENT_LEVEL_MUNDANE, "PDA Spam", /datum/event/pda_spam, 0, list(DEPARTMENT_ANY = 4), 1, 25, 50), + new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Lost Carp", /datum/event/carp_migration, 0, list(DEPARTMENT_SECURITY = 40), TRUE, min_jobs = list(DEPARTMENT_SECURITY = 1)), + new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Ian Storm", /datum/event/ianstorm, 1, list(), TRUE), + new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Supply Demand", /datum/event/supply_demand, 0, list(DEPARTMENT_ANY = 5, DEPARTMENT_RESEARCH = 15, JOB_BOTANIST = 10, DEPARTMENT_ENGINEERING = 10, DEPARTMENT_MEDICAL = 15), TRUE, min_jobs = list(DEPARTMENT_CARGO = 1)), + new /datum/event_meta(EVENT_LEVEL_MUNDANE, "PDA Spam", /datum/event/pda_spam, 0, list(DEPARTMENT_ANY = 4), TRUE, 25, 50), // new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Lost Spiders", /datum/event/spider_migration, 0, list(DEPARTMENT_SECURITY = 10), 1), //YW EDIT //CHOMPStation Edit: Moved to disabled and commented. This just spawns spiders on carp spawns. )) @@ -55,52 +55,54 @@ available_events = list( 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), 1, min_jobs = list(DEPARTMENT_MEDICAL = 2)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Atmos Leak", /datum/event/atmos_leak, 30, list(DEPARTMENT_ENGINEERING = 25), 1), - 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)), + 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 Lockers", /datum/event/bluespace_locker, 10, list(DEPARTMENT_RESEARCH = 25, DEPARTMENT_ANY = 2), TRUE), + 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), 1), + 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, "Drone Pod Drop", /datum/event/drone_pod_drop, 10, list(DEPARTMENT_RESEARCH = 40), 1), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Electrical Storm", /datum/event/electrical_storm, 250, list(DEPARTMENT_ENGINEERING = 20, JOB_JANITOR = 150), 1), + 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, "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)), // This one is just too fun. - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Gravity Failure", /datum/event/gravity, 75, list(DEPARTMENT_ENGINEERING = 60), 1), + 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), 1), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Grub Infestation", /datum/event/grub_infestation, -20, list(DEPARTMENT_SECURITY = 40, DEPARTMENT_ENGINEERING = 40), 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), 1, min_jobs = list(DEPARTMENT_MEDICAL = 2)), + 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, "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. new /datum/event_meta(EVENT_LEVEL_MODERATE, "Ion Storm", /datum/event/ionstorm, -125, list(JOB_AI = 80, JOB_CYBORG = 50, DEPARTMENT_ENGINEERING = 15, DEPARTMENT_RESEARCH = 5), min_jobs = list(JOB_CYBORG = 3)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Jellyfish School", /datum/event/jellyfish_migration, 5, list(DEPARTMENT_ANY = 1, DEPARTMENT_SECURITY = 5, DEPARTMENT_MEDICAL = 3), 1), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Maintenance Critter", /datum/event/maintenance_critter, 175, list(DEPARTMENT_ANY = 5), 0), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Meaty Ore Shower", /datum/event/meteor_wave/meatyores, -50, list(DEPARTMENT_ENGINEERING = 45), 1, min_jobs = list(DEPARTMENT_ENGINEERING = 2)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Meteor Shower", /datum/event/meteor_wave, -50, list(DEPARTMENT_ENGINEERING = 45), 1, min_jobs = list(DEPARTMENT_ENGINEERING = 2)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Jellyfish School", /datum/event/jellyfish_migration, 5, list(DEPARTMENT_ANY = 1, DEPARTMENT_SECURITY = 5, DEPARTMENT_MEDICAL = 3), TRUE), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Maintenance Critter", /datum/event/maintenance_critter, 175, list(DEPARTMENT_ANY = 5), FALSE), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Meaty Ore Shower", /datum/event/meteor_wave/meatyores, -50, list(DEPARTMENT_ENGINEERING = 45), TRUE, min_jobs = list(DEPARTMENT_ENGINEERING = 2)), + 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), 1), + 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, "Prison Break", /datum/event/prison_break, -10, list(DEPARTMENT_SECURITY = 30, DEPARTMENT_ENGINEERING = 20), 1, min_jobs = list(DEPARTMENT_SECURITY = 2)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Radiation Storm", /datum/event/radiation_storm, 50, list(DEPARTMENT_MEDICAL = 50), 1), //YW EDIT, Readded + 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. - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Solar Storm", /datum/event/solar_storm, 20, list(DEPARTMENT_ENGINEERING = 40, DEPARTMENT_SECURITY = 20), 1), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Space Dust", /datum/event/dust, 0, list(DEPARTMENT_ENGINEERING = 20), 1, 0, 50), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Spacefish Migration", /datum/event/spacefish_migration, 0, list(DEPARTMENT_SECURITY = 40, DEPARTMENT_MEDICAL = 5), 1, min_jobs = list(DEPARTMENT_SECURITY = 3)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Spider Infestation", /datum/event/spider_infestation, -20, list(DEPARTMENT_SECURITY = 30, JOB_HEAD_OF_SECURITY = 20, JOB_WARDEN = 20), 0, min_jobs = list(DEPARTMENT_SECURITY = 1)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Spontaneous Malignant Organ", /datum/event/spontaneous_malignant_organ, -30, list(DEPARTMENT_MEDICAL = 30), 1, min_jobs = list(DEPARTMENT_MEDICAL = 2)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Supply Demand", /datum/event/supply_demand, 0, list(DEPARTMENT_ANY = 5, DEPARTMENT_RESEARCH = 15, JOB_BOTANIST = 10, DEPARTMENT_ENGINEERING = 10, DEPARTMENT_MEDICAL = 15), 1), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Virology Breach", /datum/event/prison_break/virology, 0, list(DEPARTMENT_MEDICAL = 100), 1, min_jobs = list(DEPARTMENT_MEDICAL = 1)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Solar Storm", /datum/event/solar_storm, 20, list(DEPARTMENT_ENGINEERING = 40, DEPARTMENT_SECURITY = 20), TRUE), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Space Dust", /datum/event/dust, 0, list(DEPARTMENT_ENGINEERING = 20), TRUE, 0, 50), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Spacefish Migration", /datum/event/spacefish_migration, 0, list(DEPARTMENT_SECURITY = 40, DEPARTMENT_MEDICAL = 5), TRUE, min_jobs = list(DEPARTMENT_SECURITY = 3)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Spider Infestation", /datum/event/spider_infestation, -20, list(DEPARTMENT_SECURITY = 30, JOB_HEAD_OF_SECURITY = 20, JOB_WARDEN = 20), FALSE, min_jobs = list(DEPARTMENT_SECURITY = 1)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Spontaneous Malignant Organ", /datum/event/spontaneous_malignant_organ, -30, list(DEPARTMENT_MEDICAL = 30), TRUE, min_jobs = list(DEPARTMENT_MEDICAL = 2)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Supply Demand", /datum/event/supply_demand, 0, list(DEPARTMENT_ANY = 5, DEPARTMENT_RESEARCH = 15, JOB_BOTANIST = 10, DEPARTMENT_ENGINEERING = 10, DEPARTMENT_MEDICAL = 15), TRUE), new /datum/event_meta(EVENT_LEVEL_MODERATE, "Wormholes", /datum/event/wormholes, 20, list(DEPARTMENT_ANY = 5)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Xenobiology Breach", /datum/event/prison_break/xenobiology, 0, list(DEPARTMENT_RESEARCH = 100), 1, min_jobs = list(DEPARTMENT_RESEARCH = 1), min_jobs = list(DEPARTMENT_RESEARCH = 1, DEPARTMENT_SECURITY =1)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Xenobiology Breach", /datum/event/prison_break/xenobiology, 0, list(DEPARTMENT_RESEARCH = 100), TRUE, min_jobs = list(DEPARTMENT_RESEARCH = 1), min_jobs = list(DEPARTMENT_RESEARCH = 1, DEPARTMENT_SECURITY =1)), ) add_disabled_events(list( new /datum/event_meta(EVENT_LEVEL_MODERATE, "Meteor Shower", /datum/event/meteor_wave, 30, list(DEPARTMENT_ENGINEERING = 20), min_jobs = list(DEPARTMENT_ENGINEERING = 3)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Random Antagonist", /datum/event/random_antag, 2.5, list(DEPARTMENT_SECURITY = 1), 1, 0, 5), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Carp School", /datum/event/carp_migration, -20, list(DEPARTMENT_ENGINEERING = 10, DEPARTMENT_SECURITY = 30, JOB_HEAD_OF_SECURITY = 10, JOB_WARDEN = 5), 1, min_jobs = list(DEPARTMENT_SECURITY = 2)), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Supply Demand", /datum/event/supply_demand, 0, list(DEPARTMENT_ANY = 5, DEPARTMENT_RESEARCH = 15, JOB_BOTANIST = 10, DEPARTMENT_ENGINEERING = 10, DEPARTMENT_MEDICAL = 15), 1), - new /datum/event_meta(EVENT_LEVEL_MODERATE, "Disease Outbreak", /datum/event/disease_outbreak, -30, list(DEPARTMENT_MEDICAL = 30, DEPARTMENT_ANY = 1), 1, min_jobs = list(DEPARTMENT_MEDICAL = 2)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Prison Break", /datum/event/prison_break, -10, list(DEPARTMENT_SECURITY = 30, DEPARTMENT_ENGINEERING = 20), TRUE, min_jobs = list(DEPARTMENT_SECURITY = 2)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Random Antagonist", /datum/event/random_antag, 2.5, list(DEPARTMENT_SECURITY = 1), TRUE, 0, 5), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Carp School", /datum/event/carp_migration, -20, list(DEPARTMENT_ENGINEERING = 10, DEPARTMENT_SECURITY = 30, JOB_HEAD_OF_SECURITY = 10, JOB_WARDEN = 5), TRUE, min_jobs = list(DEPARTMENT_SECURITY = 2)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Supply Demand", /datum/event/supply_demand, 0, list(DEPARTMENT_ANY = 5, DEPARTMENT_RESEARCH = 15, JOB_BOTANIST = 10, DEPARTMENT_ENGINEERING = 10, DEPARTMENT_MEDICAL = 15), TRUE), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Disease Outbreak", /datum/event/disease_outbreak, -30, list(DEPARTMENT_MEDICAL = 30, DEPARTMENT_ANY = 1), TRUE, min_jobs = list(DEPARTMENT_MEDICAL = 2)), + new /datum/event_meta(EVENT_LEVEL_MODERATE, "Virology Breach", /datum/event/prison_break/virology, 0, list(DEPARTMENT_MEDICAL = 100), TRUE, min_jobs = list(DEPARTMENT_MEDICAL = 1)), // new /datum/event_meta(EVENT_LEVEL_MODERATE, "Lost Spiders", /datum/event/spider_migration, 0, list(DEPARTMENT_SECURITY = 30), 1), //YW EDIT //CHOMPStation Edit: Moved to disabled. This is a YW feature that spawns spiders on carp spawns. )) @@ -108,27 +110,29 @@ /datum/event_container/major/New() available_events = list( new /datum/event_meta(EVENT_LEVEL_MAJOR, "Nothing", /datum/event/nothing, 900), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Atmos Leak", /datum/event/atmos_leak, 5, list(DEPARTMENT_ENGINEERING = 35), 1), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Blob", /datum/event/blob, -100, list(DEPARTMENT_SECURITY = 40, JOB_HEAD_OF_SECURITY = 10, JOB_WARDEN = 10, DEPARTMENT_ENGINEERING = 5), 1, min_jobs = list(DEPARTMENT_SECURITY = 1)), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Carp Migration", /datum/event/carp_migration, -110, list(DEPARTMENT_SECURITY = 50, JOB_HEAD_OF_SECURITY = 10, JOB_WARDEN = 10), 1, min_jobs = list(DEPARTMENT_SECURITY = 3)), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Electrical Fire", /datum/event/electrical_fire, 5, list(DEPARTMENT_ENGINEERING = 5, JOB_CYBORG = 5), 0), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Exotic Horde Infestation", /datum/event/highdangerinfestation, -50, list(DEPARTMENT_ENGINEERING = 20, DEPARTMENT_RESEARCH = 5, DEPARTMENT_ANY = 2), 1), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Horde Infestation", /datum/event/horde_infestation, -60, list(DEPARTMENT_SECURITY = 20, JOB_HEAD_OF_SECURITY = 10, JOB_WARDEN = 10, DEPARTMENT_ANY = 3), 0), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Infected Room", /datum/event/disease_outbreak/floor, -50, list(DEPARTMENT_MEDICAL = 25, JOB_JANITOR = 10, DEPARTMENT_ANY = 1), 1, min_jobs = list(DEPARTMENT_MEDICAL = 2)), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Jellyfish Migration", /datum/event/jellyfish_migration, 5, list(DEPARTMENT_ANY = 1, DEPARTMENT_SECURITY = 5, DEPARTMENT_MEDICAL = 3), 1), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Meaty Ores Wave", /datum/event/meteor_wave/meatyores, -90, list(DEPARTMENT_ENGINEERING = 50, DEPARTMENT_MEDICAL = 10, DEPARTMENT_ANY = 1), 1, min_jobs = list(DEPARTMENT_ENGINEERING = 1)), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Meteor Wave", /datum/event/meteor_wave, -90, list(DEPARTMENT_ENGINEERING = 50, DEPARTMENT_MEDICAL = 10, DEPARTMENT_ANY = 1), 1, min_jobs = list(DEPARTMENT_ENGINEERING = 1)), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Spacefish Swarm", /datum/event/spacefish_migration, 10, list(DEPARTMENT_SECURITY = 5, DEPARTMENT_MEDICAL = 3), 1, min_jobs = list(DEPARTMENT_SECURITY = 1)), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Space Vines", /datum/event/spacevine, 20, list(DEPARTMENT_ENGINEERING = 15), 1), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Supply Demand", /datum/event/supply_demand, 0, list(DEPARTMENT_ANY = 5, DEPARTMENT_RESEARCH = 15, JOB_BOTANIST = 10, DEPARTMENT_ENGINEERING = 10, DEPARTMENT_MEDICAL = 15), 1, min_jobs = list(DEPARTMENT_CARGO = 1)), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Atmos Leak", /datum/event/atmos_leak, 5, list(DEPARTMENT_ENGINEERING = 35), TRUE), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Blob", /datum/event/blob, -100, list(DEPARTMENT_SECURITY = 40, JOB_HEAD_OF_SECURITY = 10, JOB_WARDEN = 10, DEPARTMENT_ENGINEERING = 5), TRUE, min_jobs = list(DEPARTMENT_SECURITY = 1)), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Carp Migration", /datum/event/carp_migration, -110, list(DEPARTMENT_SECURITY = 50, JOB_HEAD_OF_SECURITY = 10, JOB_WARDEN = 10), TRUE, min_jobs = list(DEPARTMENT_SECURITY = 3)), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Electrical Fire", /datum/event/electrical_fire, 5, list(DEPARTMENT_ENGINEERING = 5, JOB_CYBORG = 5), TRUE), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Electrical Storm", /datum/event/electrical_storm, 20, list(DEPARTMENT_ENGINEERING = 20, JOB_JANITOR = 150), TRUE), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Exotic Horde Infestation", /datum/event/highdangerinfestation, -50, list(DEPARTMENT_ENGINEERING = 20, DEPARTMENT_RESEARCH = 5, DEPARTMENT_ANY = 2), TRUE), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Horde Infestation", /datum/event/horde_infestation, -60, list(DEPARTMENT_SECURITY = 20, JOB_HEAD_OF_SECURITY = 10, JOB_WARDEN = 10, DEPARTMENT_ANY = 3), FALSE), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Hostile Runtime", /datum/event/hostile_runtime, -20, list(DEPARTMENT_ENGINEERING = 40), TRUE, min_jobs = list(DEPARTMENT_ENGINEERING = 1)), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "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)), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Jellyfish Migration", /datum/event/jellyfish_migration, 5, list(DEPARTMENT_ANY = 1, DEPARTMENT_SECURITY = 5, DEPARTMENT_MEDICAL = 3), TRUE), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Meaty Ores Wave", /datum/event/meteor_wave/meatyores, -90, list(DEPARTMENT_ENGINEERING = 50, DEPARTMENT_MEDICAL = 10, DEPARTMENT_ANY = 1), TRUE, min_jobs = list(DEPARTMENT_ENGINEERING = 1)), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Meteor Wave", /datum/event/meteor_wave, -90, list(DEPARTMENT_ENGINEERING = 50, DEPARTMENT_MEDICAL = 10, DEPARTMENT_ANY = 1), TRUE, min_jobs = list(DEPARTMENT_ENGINEERING = 1)), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Spacefish Swarm", /datum/event/spacefish_migration, 10, list(DEPARTMENT_SECURITY = 5, DEPARTMENT_MEDICAL = 3), TRUE, min_jobs = list(DEPARTMENT_SECURITY = 1)), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Space Vines", /datum/event/spacevine, 20, list(DEPARTMENT_ENGINEERING = 15), TRUE), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Supply Demand", /datum/event/supply_demand, 0, list(DEPARTMENT_ANY = 5, DEPARTMENT_RESEARCH = 15, JOB_BOTANIST = 10, DEPARTMENT_ENGINEERING = 10, DEPARTMENT_MEDICAL = 15), TRUE, min_jobs = list(DEPARTMENT_CARGO = 1)), ) add_disabled_events(list( new /datum/event_meta(EVENT_LEVEL_MAJOR, "Containment Breach", /datum/event/prison_break/station, 0, list(DEPARTMENT_ANY = 5),0), - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Disease Outbreak", /datum/event/disease_outbreak, -30, list(DEPARTMENT_MEDICAL = 30, DEPARTMENT_ANY = 1), 1, min_jobs = list(DEPARTMENT_MEDICAL = 2)), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Disease Outbreak", /datum/event/disease_outbreak, -30, list(DEPARTMENT_MEDICAL = 30, DEPARTMENT_ANY = 1), TRUE, min_jobs = list(DEPARTMENT_MEDICAL = 2)), //Spiders moved into horde infestation - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Spider Infestation", /datum/event/spider_infestation, -60, list(DEPARTMENT_SECURITY = 20, JOB_HEAD_OF_SECURITY = 10, JOB_WARDEN = 10, DEPARTMENT_ANY = 3), 0), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Spider Infestation", /datum/event/spider_infestation, -60, list(DEPARTMENT_SECURITY = 20, JOB_HEAD_OF_SECURITY = 10, JOB_WARDEN = 10, DEPARTMENT_ANY = 3), FALSE), //Metroids moved into horde infestation - new /datum/event_meta(EVENT_LEVEL_MAJOR, "Metroid Infestation", /datum/event/metroid_infestation, -100, list(DEPARTMENT_SECURITY = 30, DEPARTMENT_RESEARCH = 20, JOB_HEAD_OF_SECURITY = 15, JOB_WARDEN = 15, DEPARTMENT_ANY = 2), 1 , min_jobs = list(DEPARTMENT_SECURITY = 2, DEPARTMENT_RESEARCH = 1)), + new /datum/event_meta(EVENT_LEVEL_MAJOR, "Metroid Infestation", /datum/event/metroid_infestation, -100, list(DEPARTMENT_SECURITY = 30, DEPARTMENT_RESEARCH = 20, JOB_HEAD_OF_SECURITY = 15, JOB_WARDEN = 15, DEPARTMENT_ANY = 2), TRUE, min_jobs = list(DEPARTMENT_SECURITY = 2, DEPARTMENT_RESEARCH = 1)), // new /datum/event_meta(EVENT_LEVEL_MAJOR, "Viral Infection", /datum/event/viral_infection, -50, list(DEPARTMENT_MEDICAL = 25), 1, min_jobs = list(DEPARTMENT_MEDICAL = 2)), //Needs Xenobio containment breach fixed diff --git a/modular_chomp/code/modules/event/hostile_runtime.dm b/modular_chomp/code/modules/event/hostile_runtime.dm new file mode 100644 index 0000000000..0ff9a13de9 --- /dev/null +++ b/modular_chomp/code/modules/event/hostile_runtime.dm @@ -0,0 +1,67 @@ +/datum/event/hostile_runtime + var/area/picked_area + var/list/obj/machinery/door/airlock/target_airlocks = list() + var/obj/machinery/power/apc/apc + + var/list/excluded = list( + /area/shuttle, + /area/crew_quarters, + /area/holodeck, + /area/construction, + /area/engineering/engine_room, + /area/engineering/engine_monitoring, + /area/engineering/gravgen, + /area/maintenance, + /area/rnd/test_area, + /area/rnd/outpost, + /area/solar + ) + + var/electrify = FALSE + var/releaseWhen + +/datum/event/hostile_runtime/setup() + var/list/area/affected_areas = get_station_areas(excluded) + + picked_area = pick(affected_areas) + for(var/obj/machinery/door/airlock/airlock in picked_area) + if(airlock.isElectrified() && !airlock.arePowerSystemsOn()) + continue + target_airlocks.Add(airlock) + + if(!picked_area) + log_game("Hostile Runtime event: No areas was chosen!") + kill() + return + else + log_game("Hostile Runtime event: [picked_area] as chosen. Locking down.") + log_and_message_admins("Hostile Runtime event: [picked_area] was picked. Bolting airlocks.") + + announceWhen = rand(75, 105) SECONDS + releaseWhen = rand(60, 90) SECONDS + + endWhen = releaseWhen+2 + +/datum/event/hostile_runtime/announce() + GLOB.global_announcer.autosay("[pick("Gr3y.T1d3 virus","Malignant trojan")] detected in [picked_area]. [severity == EVENT_LEVEL_MODERATE ? "Damage partially mitigated." : ""]", "Firewall Subroutines", DEPARTMENT_ENGINEERING) + +/datum/event/hostile_runtime/start() + switch(severity) + if(EVENT_LEVEL_MODERATE) + for(var/obj/machinery/door/airlock/door in target_airlocks) + if(prob(50)) + door.lock() + door.aiControlDisabled = TRUE + if(prob(75)) + door.electrify(-1) + if(EVENT_LEVEL_MAJOR) + for(var/obj/machinery/door/airlock/door in target_airlocks) + door.lock() + door.aiControlDisabled = TRUE + door.electrify(-1) + +/datum/event/hostile_runtime/tick() + if(activeFor == releaseWhen) + if(apc && apc.operating) + for(var/obj/machinery/light/light in picked_area) + light.flicker(10) diff --git a/vorestation.dme b/vorestation.dme index e36aff5d83..a9acfac163 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -5172,11 +5172,13 @@ #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\bluespacelocker.dm" #include "modular_chomp\code\modules\event\dangerinfestation.dm" #include "modular_chomp\code\modules\event\electrical_fire.dm" #include "modular_chomp\code\modules\event\event_container_ch.dm" #include "modular_chomp\code\modules\event\heavydangerinfestation.dm" #include "modular_chomp\code\modules\event\horde_infestation.dm" +#include "modular_chomp\code\modules\event\hostile_runtime.dm" #include "modular_chomp\code\modules\event\infectedroom.dm" #include "modular_chomp\code\modules\event\landmarks.dm" #include "modular_chomp\code\modules\event\meatyores.dm"