diff --git a/code/modules/events/_event.dm b/code/modules/events/_event.dm index bfb6d62bf8f..767986c3e2c 100644 --- a/code/modules/events/_event.dm +++ b/code/modules/events/_event.dm @@ -122,9 +122,8 @@ Runs the event * * In the worst case scenario we can still recall a event which we cancelled by accident, which is much better then to have a unwanted event */ UnregisterSignal(SSdcs, COMSIG_GLOB_RANDOM_EVENT) - var/datum/round_event/E = new typepath() + var/datum/round_event/E = new typepath(TRUE, src) E.current_players = get_active_player_count(alive_check = 1, afk_check = 1, human_check = 1) - E.control = src occurrences++ SSevents.previously_run += src //SKYRAT EDIT ADDITION @@ -280,7 +279,8 @@ Runs the event //Sets up the event then adds the event to the the list of running events -/datum/round_event/New(my_processing = TRUE) +/datum/round_event/New(my_processing = TRUE, datum/round_event_control/event_controller) + control = event_controller setup() processing = my_processing SSevents.running += src diff --git a/code/modules/events/anomaly/_anomaly.dm b/code/modules/events/anomaly/_anomaly.dm index e17ecfb59e3..0e3cb80bcc9 100644 --- a/code/modules/events/anomaly/_anomaly.dm +++ b/code/modules/events/anomaly/_anomaly.dm @@ -7,6 +7,17 @@ weight = 15 category = EVENT_CATEGORY_ANOMALIES description = "This anomaly shocks and explodes. This is the base type." + ///The admin-chosen spawn location. + var/turf/spawn_location + +/datum/round_event_control/anomaly/admin_setup(mob/admin) + . = ..() + + if(!check_rights(R_FUN)) + return ADMIN_CANCEL_EVENT + + if(tgui_alert(usr, "Spawn anomaly at your current location?", "Anomaly Alert", list("Yes", "No")) == "Yes") + spawn_location = get_turf(usr) /datum/round_event/anomaly var/area/impact_area @@ -15,15 +26,33 @@ announce_when = 1 /datum/round_event/anomaly/setup() - impact_area = placer.findValidArea() + + end_when = start_when + 1 //Admin vars are cleared on end(), so we make sure the anomaly spawns before then. + + var/datum/round_event_control/anomaly/anomaly_event = control + if(anomaly_event.spawn_location) + impact_area = get_area(anomaly_event.spawn_location) + else + impact_area = placer.findValidArea() /datum/round_event/anomaly/announce(fake) priority_announce("Localized energetic flux wave detected on long range scanners. Expected location of impact: [impact_area.name].", "Anomaly Alert") /datum/round_event/anomaly/start() - var/turf/anomaly_turf = placer.findValidTurf(impact_area) + var/turf/anomaly_turf + + var/datum/round_event_control/anomaly/anomaly_event = control + if(anomaly_event.spawn_location) + anomaly_turf = anomaly_event.spawn_location + else + anomaly_turf = placer.findValidTurf(impact_area) + var/newAnomaly if(anomaly_turf) newAnomaly = new anomaly_path(anomaly_turf) if (newAnomaly) announce_to_ghosts(newAnomaly) + +/datum/round_event/anomaly/end() + var/datum/round_event_control/anomaly/anomaly_event = control + anomaly_event.spawn_location = null