[MIRROR] Staticpath [MDB ignore] (#12445)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2026-02-23 00:33:43 +01:00
committed by GitHub
co-authored by Kashargul
parent cc106f8032
commit ba5224fbcb
437 changed files with 5869 additions and 5220 deletions
+13 -13
View File
@@ -1,11 +1,11 @@
GLOBAL_DATUM_INIT(overmap_event_handler, /decl/overmap_event_handler, new)
GLOBAL_DATUM_INIT(overmap_event_handler, /datum/decl/overmap_event_handler, new)
/decl/overmap_event_handler
/datum/decl/overmap_event_handler
var/list/hazard_by_turf = list()
var/list/ship_events = list()
// Populates overmap with random events! Should be called once at startup at some point.
/decl/overmap_event_handler/proc/create_events(var/z_level, var/overmap_size, var/number_of_events)
/datum/decl/overmap_event_handler/proc/create_events(var/z_level, var/overmap_size, var/number_of_events)
// Acquire the list of not-yet utilized overmap turfs on this Z-level
var/list/overmap_turfs = block(locate(OVERMAP_EDGE, OVERMAP_EDGE, z_level), locate(overmap_size - OVERMAP_EDGE, overmap_size - OVERMAP_EDGE, z_level))
var/list/candidate_turfs = list()
@@ -29,7 +29,7 @@ GLOBAL_DATUM_INIT(overmap_event_handler, /decl/overmap_event_handler, new)
qdel(datum_spawn)//idk help how do I do this better?
/decl/overmap_event_handler/proc/acquire_event_turfs(var/number_of_turfs, var/distance_from_origin, var/list/candidate_turfs, var/continuous = TRUE)
/datum/decl/overmap_event_handler/proc/acquire_event_turfs(var/number_of_turfs, var/distance_from_origin, var/list/candidate_turfs, var/continuous = TRUE)
number_of_turfs = min(number_of_turfs, candidate_turfs.len)
candidate_turfs = candidate_turfs.Copy() // Not this proc's responsibility to adjust the given lists
@@ -52,7 +52,7 @@ GLOBAL_DATUM_INIT(overmap_event_handler, /decl/overmap_event_handler, new)
return selected_turfs
/decl/overmap_event_handler/proc/get_random_neighbour(var/turf/origin_turf, var/list/candidate_turfs, var/continuous = TRUE, var/range)
/datum/decl/overmap_event_handler/proc/get_random_neighbour(var/turf/origin_turf, var/list/candidate_turfs, var/continuous = TRUE, var/range)
var/fitting_turfs
if(continuous)
fitting_turfs = origin_turf.CardinalTurfs(FALSE)
@@ -63,7 +63,7 @@ GLOBAL_DATUM_INIT(overmap_event_handler, /decl/overmap_event_handler, new)
if(T in candidate_turfs)
return T
/decl/overmap_event_handler/proc/start_hazard(var/obj/effect/overmap/visitable/ship/ship, var/obj/effect/overmap/event/hazard)//make these accept both hazards or events
/datum/decl/overmap_event_handler/proc/start_hazard(var/obj/effect/overmap/visitable/ship/ship, var/obj/effect/overmap/event/hazard)//make these accept both hazards or events
if(!(ship in ship_events))
ship_events += ship
@@ -79,20 +79,20 @@ GLOBAL_DATUM_INIT(overmap_event_handler, /decl/overmap_event_handler, new)
E.victim = ship
LAZYADD(ship_events[ship], E)
/decl/overmap_event_handler/proc/stop_hazard(var/obj/effect/overmap/visitable/ship/ship, var/obj/effect/overmap/event/hazard)
/datum/decl/overmap_event_handler/proc/stop_hazard(var/obj/effect/overmap/visitable/ship/ship, var/obj/effect/overmap/event/hazard)
for(var/event_type in hazard.events)
var/datum/event/E = is_event_active(ship, event_type, hazard.difficulty)
if(E)
E.kill()
LAZYREMOVE(ship_events[ship], E)
/decl/overmap_event_handler/proc/is_event_active(var/ship, var/event_type, var/severity)
/datum/decl/overmap_event_handler/proc/is_event_active(var/ship, var/event_type, var/severity)
if(!ship_events[ship]) return
for(var/datum/event/E in ship_events[ship])
if(E.type == event_type && E.severity == severity)
return E
/decl/overmap_event_handler/proc/on_turf_entered(var/turf/new_loc, var/obj/effect/overmap/visitable/ship/ship, var/old_loc)
/datum/decl/overmap_event_handler/proc/on_turf_entered(var/turf/new_loc, var/obj/effect/overmap/visitable/ship/ship, var/old_loc)
if(!istype(ship))
return
if(new_loc == old_loc)
@@ -101,7 +101,7 @@ GLOBAL_DATUM_INIT(overmap_event_handler, /decl/overmap_event_handler, new)
for(var/obj/effect/overmap/event/E in hazard_by_turf[new_loc])
start_hazard(ship, E)
/decl/overmap_event_handler/proc/on_turf_exited(var/turf/old_loc, var/obj/effect/overmap/visitable/ship/ship, var/new_loc)
/datum/decl/overmap_event_handler/proc/on_turf_exited(var/turf/old_loc, var/obj/effect/overmap/visitable/ship/ship, var/new_loc)
if(!istype(ship))
return
if(new_loc == old_loc)
@@ -112,7 +112,7 @@ GLOBAL_DATUM_INIT(overmap_event_handler, /decl/overmap_event_handler, new)
continue // If new turf has the same event as well... keep it going!
stop_hazard(ship, E)
/decl/overmap_event_handler/proc/update_hazards(var/turf/T)//catch all updater
/datum/decl/overmap_event_handler/proc/update_hazards(var/turf/T)//catch all updater
if(!istype(T))
return
@@ -138,12 +138,12 @@ GLOBAL_DATUM_INIT(overmap_event_handler, /decl/overmap_event_handler, new)
for(var/obj/effect/overmap/event/E in active_hazards)
start_hazard(ship, E)
/decl/overmap_event_handler/proc/is_event_in_turf(var/datum/event/E, var/turf/T)
/datum/decl/overmap_event_handler/proc/is_event_in_turf(var/datum/event/E, var/turf/T)
for(var/obj/effect/overmap/event/hazard in hazard_by_turf[T])
if((E in hazard.events) && E.severity == hazard.difficulty)
return TRUE
/decl/overmap_event_handler/proc/is_event_included(var/list/hazards, var/obj/effect/overmap/event/E, var/equal_or_better)//this proc is only used so it can break out of 2 loops cleanly
/datum/decl/overmap_event_handler/proc/is_event_included(var/list/hazards, var/obj/effect/overmap/event/E, var/equal_or_better)//this proc is only used so it can break out of 2 loops cleanly
for(var/obj/effect/overmap/event/A in hazards)
if(istype(A, E.type) || istype(E, A.type))
if(same_entries(A.events, E.events))
@@ -62,7 +62,7 @@
can_atmos_pass = ATMOS_PASS_NO
connect_types = CONNECT_TYPE_REGULAR|CONNECT_TYPE_FUEL
// construct_state = /decl/machine_construction/default/panel_closed
// construct_state = /datum/decl/machine_construction/default/panel_closed
// maximum_component_parts = list(/obj/item/stock_parts = 6)//don't want too many, let upgraded component shine
// uncreated_component_parts = list(/obj/item/stock_parts/power/apc/buildable = 1)
@@ -214,5 +214,5 @@
// Not Implemented - Variant that pulls power from cables. Too complicated without bay's power components.
// /obj/machinery/atmospherics/unary/engine/terminal
// base_type = /obj/machinery/atmospherics/unary/engine
// stock_part_presets = list(/decl/stock_part_preset/terminal_setup)
// stock_part_presets = list(/datum/decl/stock_part_preset/terminal_setup)
// uncreated_component_parts = list(/obj/item/stock_parts/power/terminal/buildable = 1)
@@ -42,7 +42,7 @@
power_channel = ENVIRON
idle_power_usage = 100
anchored = TRUE
// construct_state = /decl/machine_construction/default/panel_closed
// construct_state = /datum/decl/machine_construction/default/panel_closed
var/datum/ship_engine/ion/controller
var/thrust_limit = 1
var/on = 1