Ports overmap events from Baystation12

- Move overmap defines to _defines folder.  Rename old file to turfs.dm since that is what it contains.
- Definition of overmap event objects and the overmap event handler.
- Upgrades to SSevents and SSskybox to tie in the overmap events.
- Enhancement to /datum/event itself to support affecting_z and victim ship.
- Upgrade to the five event types used on the overmap to support new vars.
- Upgrade to dust and meteor spawning code to support targeting z-levels.
This commit is contained in:
Leshana
2020-03-18 13:28:37 -04:00
committed by Aronai Sieyes
parent 15273a356c
commit f2a582569b
22 changed files with 795 additions and 347 deletions

View File

@@ -26,6 +26,15 @@
max_z = max(z, max_z)
return max_z
/proc/living_observers_present(var/list/zlevels)
if(LAZYLEN(zlevels))
for(var/mob/M in player_list) //if a tree ticks on the empty zlevel does it really tick
if(M.stat != DEAD) //(no it doesn't)
var/turf/T = get_turf(M)
if(T && (T.z in zlevels))
return TRUE
return FALSE
/proc/get_area(atom/A)
if(isarea(A))
return A

View File

@@ -33,6 +33,20 @@
available_turfs = start_turfs
return pick(available_turfs)
// Picks a turf that is clearance tiles away from the map edge given by dir, on z-level Z
/proc/pick_random_edge_turf(var/dir, var/Z, var/clearance = TRANSITIONEDGE + 1)
if(!dir)
return
switch(dir)
if(NORTH)
return locate(rand(clearance, world.maxx - clearance), world.maxy - clearance, Z)
if(SOUTH)
return locate(rand(clearance, world.maxx - clearance), clearance, Z)
if(EAST)
return locate(world.maxx - clearance, rand(clearance, world.maxy - clearance), Z)
if(WEST)
return locate(clearance, rand(clearance, world.maxy - clearance), Z)
/proc/is_below_sound_pressure(var/turf/T)
var/datum/gas_mixture/environment = T ? T.return_air() : null
var/pressure = environment ? environment.return_pressure() : 0