From 63c498777f379ba7cc09af6573f4aaa3412e2fb5 Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Wed, 7 Feb 2018 00:53:47 -0500 Subject: [PATCH] VS: Make this define generic --- code/game/turfs/unsimulated/sky_vr.dm | 67 +++++++++++++++++++++++++ maps/tether/submaps/_tether_submaps.dm | 68 -------------------------- vorestation.dme | 1 + 3 files changed, 68 insertions(+), 68 deletions(-) create mode 100644 code/game/turfs/unsimulated/sky_vr.dm diff --git a/code/game/turfs/unsimulated/sky_vr.dm b/code/game/turfs/unsimulated/sky_vr.dm new file mode 100644 index 0000000000..1db001a187 --- /dev/null +++ b/code/game/turfs/unsimulated/sky_vr.dm @@ -0,0 +1,67 @@ +/////////////////// +// Generic skyfall turf +// Really only works well if the map doesn't have 'indoor' areas otherwise they can fall into one. +// TODO: Fix that. +/turf/unsimulated/floor/sky + name = "the sky" + desc = "It's the sky! Be careful!" + icon = 'icons/turf/floors.dmi' + icon_state = "sky_slow" + dir = SOUTH + initialized = FALSE + var/does_skyfall = TRUE + var/list/skyfall_levels + +/turf/unsimulated/floor/sky/initialize() + . = ..() + if(does_skyfall && !LAZYLEN(skyfall_levels)) + error("[x],[y],[z], [get_area(src)] doesn't have skyfall_levels defined! Can't skyfall!") + if(locate(/turf/simulated) in orange(src,1)) + set_light(2, 2, color) + +/turf/unsimulated/floor/sky/Entered(atom/movable/AM,atom/oldloc) + . = ..() + if(!does_skyfall) + return //We don't do that + if(isobserver(AM)) + return //Don't ghostport, very annoying + if(AM.throwing) + return //Being thrown over, not fallen yet + + var/mob/living/L + if(isliving(AM)) + L = AM + if(L.is_floating) + return //Flyers/nograv can ignore it + + do_fall(AM) + +/turf/unsimulated/floor/sky/hitby(var/atom/movable/AM, var/speed) + . = ..() + + if(!does_skyfall) + return //We don't do that + + do_fall(AM) + +/turf/unsimulated/floor/sky/proc/do_fall(atom/movable/AM) + //Bye + 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),pick(skyfall_levels)) + if(candidate.density) + attempts-- + continue + + T = candidate + break + + if(!T) + return + + AM.forceMove(T) + if(isliving(AM)) + var/mob/living/L = AM + message_admins("\The [AM] fell out of the sky.") + L.fall_impact(T, 42, 90, FALSE, TRUE) //You will not be defibbed from this. diff --git a/maps/tether/submaps/_tether_submaps.dm b/maps/tether/submaps/_tether_submaps.dm index 533340c5b9..8829a4664a 100644 --- a/maps/tether/submaps/_tether_submaps.dm +++ b/maps/tether/submaps/_tether_submaps.dm @@ -231,71 +231,3 @@ processing_objects -= src depleted = TRUE return - -/////////////////// -// Generic skyfall turf -// Really only works well if the map doesn't have 'indoor' areas otherwise they can fall into one. -// TODO: Fix that. -/turf/unsimulated/floor/sky - name = "the sky" - desc = "It's the sky! Be careful!" - icon = 'icons/turf/floors.dmi' - icon_state = "sky_slow" - dir = SOUTH - initialized = FALSE - var/does_skyfall = TRUE - var/list/skyfall_levels - -/turf/unsimulated/floor/sky/initialize() - . = ..() - if(does_skyfall && !LAZYLEN(skyfall_levels)) - error("[x],[y],[z], [get_area(src)] doesn't have skyfall_levels defined! Can't skyfall!") - if(locate(/turf/simulated) in orange(src,1)) - set_light(2, 2, color) - -/turf/unsimulated/floor/sky/Entered(atom/movable/AM,atom/oldloc) - . = ..() - if(!does_skyfall) - return //We don't do that - if(isobserver(AM)) - return //Don't ghostport, very annoying - if(AM.throwing) - return //Being thrown over, not fallen yet - - var/mob/living/L - if(isliving(AM)) - L = AM - if(L.is_floating) - return //Flyers/nograv can ignore it - - do_fall(AM) - -/turf/unsimulated/floor/sky/hitby(var/atom/movable/AM, var/speed) - . = ..() - - if(!does_skyfall) - return //We don't do that - - do_fall(AM) - -/turf/unsimulated/floor/sky/proc/do_fall(atom/movable/AM) - //Bye - 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),pick(skyfall_levels)) - if(candidate.density) - attempts-- - continue - - T = candidate - break - - if(!T) - return - - AM.forceMove(T) - if(isliving(AM)) - var/mob/living/L = AM - message_admins("\The [AM] fell out of the sky on Virgo2.") - L.fall_impact(T, 42, 90, FALSE, TRUE) //You will not be defibbed from this. diff --git a/vorestation.dme b/vorestation.dme index ce26d52cd9..2384e7fbc3 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -1232,6 +1232,7 @@ #include "code\game\turfs\unsimulated\floor.dm" #include "code\game\turfs\unsimulated\planetary.dm" #include "code\game\turfs\unsimulated\shuttle.dm" +#include "code\game\turfs\unsimulated\sky_vr.dm" #include "code\game\turfs\unsimulated\walls.dm" #include "code\game\verbs\advanced_who.dm" #include "code\game\verbs\ignore.dm"