Z Level Conscientious Dark Lords of Destruction (#2595)

The great dark lords, Nar'Sie and Singuloth, now respect multi-z. Nar'Sie will move up/down to match it's target Z. Singularity will move up/down whenever it fails to move laterally, or to chase it's singularity beacon.

Singularity will also consume everything above and below it.

As a bonus, supermatter cascades will also spread vertically.
This commit is contained in:
LordFowl
2017-06-04 20:00:48 +03:00
committed by skull132
parent 869c824fe0
commit ed5c571e19
6 changed files with 81 additions and 14 deletions
+16 -2
View File
@@ -100,14 +100,25 @@
explosion(src.loc,(dist),(dist*2),(dist*4))
return 1000
/turf/singularity_act(S, current_size)
/turf/singularity_act(S, current_size, var/go_down = 1, var/go_up = 1)
if(!is_plating())
for(var/obj/O in contents)
if(O.level != 1)
continue
if(O.invisibility == 101)
O.singularity_act(src, current_size)
ChangeTurf(get_base_turf_by_area(src))
if(go_up && current_size >= STAGE_FIVE)
if(HasAbove(src.z))
var/turf/A = GetAbove(src)
A.singularity_act(S, current_size, 0, 1)
if(go_down && current_size >= STAGE_FIVE)
if(HasBelow(src.z))
var/turf/B = GetBelow(src)
B.singularity_act(S, current_size, 1, 0)
if(istype(src,/turf/simulated/mineral))
var/turf/simulated/mineral/M = src
M.GetDrilled()
ChangeTurf(/turf/space)
return 2
/turf/simulated/wall/singularity_pull(S, current_size)
@@ -128,6 +139,9 @@
/turf/space/singularity_act()
return
/turf/simulated/open/singularity_act()
return
/*******************
* Nar-Sie Act/Pull *
*******************/
+27 -3
View File
@@ -8,7 +8,7 @@
anchored = 1
density = 1
layer = 6
light_range = 6
light_power = -100 //eats all light
unacidable = 1 //Don't comment this out.
var/current_size = 1
@@ -23,7 +23,7 @@
var/grav_pull = 4 //How many tiles out do we pull?
var/consume_range = 0 //How many tiles out do we eat.
var/event_chance = 15 //Prob for event each tick.
var/target = null //Its target. Moves towards the target if it has one.
var/atom/target = null //Its target. Moves towards the target if it has one.
var/last_failed_movement = 0 //Will not move in the same dir if it couldnt before, will help with the getting stuck on fields thing.
var/last_warning
@@ -80,6 +80,9 @@
eat()
dissipate()
check_energy()
light_range = current_size-2
if(light_range < 0)
light_range = 0
if (current_size >= STAGE_THREE)
move()
@@ -299,6 +302,14 @@
if(target && prob(60))
movement_dir = get_dir(src,target) //moves to a singulo beacon, if there is one
if(target.z < z)
visible_message("<span class='danger'>\The [src] gravitates downwards.</span>")
zMove(DOWN)
visible_message("<span class='danger'>\The [src] appears from above.</span>")
else if(target.z > z)
visible_message("<span class='danger'>\The [src] gravitates upwards.</span>")
zMove(UP)
visible_message("<span class='danger'>\The [src] appears from below.</span>")
if(current_size >= 9)//The superlarge one does not care about things in its way
spawn(0)
@@ -312,7 +323,12 @@
step(src, movement_dir)
return 1
else
last_failed_movement = movement_dir
if(current_size >= STAGE_FIVE)
var/z_dir = pick(UP,DOWN)
if(!zMove(z_dir))
last_failed_movement = movement_dir
else
last_failed_movement = movement_dir
return 0
/obj/singularity/proc/check_turfs_in(var/direction = 0, var/step = 0)
@@ -493,3 +509,11 @@
spawn(0)
qdel(src)
return gain
/obj/singularity/can_fall()
return FALSE
/obj/singularity/proc/zMove(direction)
var/turf/destination = (direction == UP) ? GetAbove(src) : GetBelow(src)
if(destination)
forceMove(destination)