VS: Make this define generic

This commit is contained in:
Arokha Sieyes
2018-02-07 00:53:47 -05:00
parent 50b77f51c9
commit 63c498777f
3 changed files with 68 additions and 68 deletions
+67
View File
@@ -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.
-68
View File
@@ -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.
+1
View File
@@ -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"