Merge pull request #6582 from Aurorablade/Ripple

Don't Stand Under Shuttles
This commit is contained in:
Fox McCloud
2017-05-01 19:47:50 -04:00
committed by GitHub
6 changed files with 83 additions and 1 deletions
+11
View File
@@ -203,6 +203,17 @@
return
var/time_left = timeLeft(1)
// The emergency shuttle doesn't work like others so this
// ripple check is slightly different
if(!ripples.len && (time_left <= SHUTTLE_RIPPLE_TIME) && ((mode == SHUTTLE_CALL) || (mode == SHUTTLE_ESCAPE)))
var/destination
if(mode == SHUTTLE_CALL)
destination = shuttle_master.getDock("emergency_home")
else if(mode == SHUTTLE_ESCAPE)
destination = shuttle_master.getDock("emergency_away")
create_ripples(destination)
switch(mode)
if(SHUTTLE_RECALL)
if(time_left <= 0)
+19
View File
@@ -0,0 +1,19 @@
/obj/effect/overlay/temp/ripple
name = "hyperspace ripple"
desc = "Something is coming through hyperspace, you can see the \
visual disturbances. It's probably best not to be on top of these \
when whatever is tunneling comes through."
icon = 'icons/turf/floors/ripple.dmi'
icon_state = "ripple"
anchored = TRUE
density = FALSE
smooth = SMOOTH_TRUE
layer = RIPPLE_LAYER
alpha = 0
duration = 3 * SHUTTLE_RIPPLE_TIME
mouse_opacity = 1
/obj/effect/overlay/temp/ripple/New()
. = ..()
smooth_icon(src)
animate(src, alpha=255, time=SHUTTLE_RIPPLE_TIME)
+49
View File
@@ -22,6 +22,8 @@
// All shuttle templates are timid
var/timid = FALSE
var/list/ripples = list()
//these objects are indestructable
/obj/docking_port/Destroy(force)
if(force)
@@ -378,10 +380,44 @@
qdel(src, force=TRUE)
/obj/docking_port/mobile/proc/create_ripples(obj/docking_port/stationary/S1)
var/list/turfs = ripple_area(S1)
for(var/i in turfs)
ripples += new /obj/effect/overlay/temp/ripple(i)
/obj/docking_port/mobile/proc/remove_ripples()
if(ripples.len)
for(var/i in ripples)
qdel(i)
ripples.Cut()
/obj/docking_port/mobile/proc/ripple_area(obj/docking_port/stationary/S1)
var/list/L0 = return_ordered_turfs(x, y, z, dir, areaInstance)
var/list/L1 = return_ordered_turfs(S1.x, S1.y, S1.z, S1.dir)
var/list/ripple_turfs = list()
for(var/i in 1 to L0.len)
var/turf/T0 = L0[i]
if(!T0)
continue
var/turf/T1 = L1[i]
if(!T1)
continue
if(T0.type != T0.baseturf)
ripple_turfs += T1
return ripple_turfs
//this is the main proc. It instantly moves our mobile port to stationary port S1
//it handles all the generic behaviour, such as sanity checks, closing doors on the shuttle, stunning mobs, etc
/obj/docking_port/mobile/proc/dock(obj/docking_port/stationary/S1, force=FALSE)
// Crashing this ship with NO SURVIVORS
if(S1.get_docked() == src)
remove_ripples()
return
if(!force)
if(!check_dock(S1))
return -1
@@ -389,6 +425,7 @@
if(canMove())
return -1
// //rotate transit docking ports, so we don't need zillions of variants
// if(istype(S1, /obj/docking_port/stationary/transit))
// S1.dir = turn(NORTH, -travelDir)
@@ -423,6 +460,9 @@
for(var/turf/T0 in L0)
A0.contents += T0
// Removes ripples
remove_ripples()
//move or squish anything in the way ship at destination
roadkill(L0, L1, S1.dir)
@@ -564,7 +604,10 @@
//used by shuttle subsystem to check timers
/obj/docking_port/mobile/proc/check()
check_effects()
var/timeLeft = timeLeft(1)
if(timeLeft <= 0)
switch(mode)
if(SHUTTLE_CALL)
@@ -579,6 +622,12 @@
timer = 0
destination = null
/obj/docking_port/mobile/proc/check_effects()
if(!ripples.len)
if((mode == SHUTTLE_CALL) || (mode == SHUTTLE_RECALL))
var/tl = timeLeft(1)
if(tl <= SHUTTLE_RIPPLE_TIME)
create_ripples(destination)
/obj/docking_port/mobile/proc/setTimer(wait)
if(timer <= 0)