Files
CHOMPstation/maps/tether/submaps/_tether_submaps.dm
T
2018-02-01 21:09:06 -05:00

121 lines
3.4 KiB
Plaintext

// This causes tether submap maps to get 'checked' and compiled, when undergoing a unit test.
// This is so Travis can validate PoIs, and ensure future changes don't break PoIs, as PoIs are loaded at runtime and the compiler can't catch errors.
//Away missions defined here for testing
/datum/map_template/proc/on_map_loaded(z)
return
/datum/map_template/tether_lateload
allow_duplicates = FALSE
var/associated_map_datum
/datum/map_template/tether_lateload/on_map_loaded(z)
if(!associated_map_datum || !ispath(associated_map_datum))
log_game("Extra z-level [src] has no associated map datum")
return
new associated_map_datum(using_map, z)
/datum/map_z_level/tether_lateload
z = 0
flags = MAP_LEVEL_SEALED
/datum/map_z_level/tether_lateload/New(var/datum/map/map, mapZ)
if(mapZ)
z = mapZ
return ..(map)
/// Static - Always Loaded
/datum/map_template/tether_lateload/tether_ships
name = "Tether - Ships"
desc = "Ship transit map and whatnot."
mappath = 'tether_ships.dmm'
associated_map_datum = /datum/map_z_level/tether_lateload/ships
/datum/map_z_level/tether_lateload/ships
name = "Ships"
flags = MAP_LEVEL_ADMIN|MAP_LEVEL_SEALED
/turf/unsimulated/wall/seperator //to block vision between transit zones
name = ""
icon = 'icons/effects/effects.dmi'
icon_state = "1"
/obj/effect/step_trigger/zlevel_fall //Don't ever use this, only use subtypes.Define a new var/static/target_z on each
affect_ghosts = 1
/obj/effect/step_trigger/zlevel_fall/initialize()
. = ..()
if(istype(get_turf(src), /turf/simulated/floor))
src:target_z = z
qdel(src)
/obj/effect/step_trigger/zlevel_fall/Trigger(var/atom/movable/A) //mostly from /obj/effect/step_trigger/teleporter/planetary_fall, step_triggers.dm L160
if(!src:target_z)
return
var/attempts = 100
var/turf/simulated/T
while(attempts && !T)
var/turf/simulated/candidate = locate(rand(5,world.maxx-5),rand(5,world.maxy-5),src:target_z)
if(candidate.density)
attempts--
continue
T = candidate
break
if(!T)
return
if(isobserver(A))
A.forceMove(T) // Harmlessly move ghosts.
return
A.forceMove(T)
if(isliving(A)) // Someday, implement parachutes. For now, just turbomurder whoever falls.
message_admins("\The [A] fell out of the sky.")
var/mob/living/L = A
L.fall_impact(T, 42, 90, FALSE, TRUE) //You will not be defibbed from this.
/obj/effect/step_trigger/zlevel_fall/beach
var/static/target_z
/// Away Missions
#if AWAY_MISSION_TEST
#include "beach/beach.dmm"
#include "beach/cave.dmm"
#endif
#include "beach/beach.dm"
/datum/map_template/tether_lateload/away_beach
name = "Desert Planet - Z1 Beach"
desc = "The beach away mission."
mappath = 'beach/beach.dmm'
associated_map_datum = /datum/map_z_level/tether_lateload/away_beach
/datum/map_z_level/tether_lateload/away_beach
name = "Away Mission - Desert Beach"
/datum/map_template/tether_lateload/away_beach_cave
name = "Desert Planet - Z2 Cave"
desc = "The beach away mission's cave."
mappath = 'beach/cave.dmm'
associated_map_datum = /datum/map_z_level/tether_lateload/away_beach_cave
/datum/map_z_level/tether_lateload/away_beach_cave
name = "Away Mission - Desert Cave"
#include "alienship/alienship.dm"
/datum/map_template/tether_lateload/away_alienship
name = "Alien Ship - Z1 Ship"
desc = "The alien ship away mission."
mappath = 'alienship/alienship.dmm'
associated_map_datum = /datum/map_z_level/tether_lateload/away_alienship
/datum/map_z_level/tether_lateload/away_alienship
name = "Away Mission - Alien Ship"