mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
Don'tStandUnderShuttles
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/obj/effect/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/effects/effects.dmi'
|
||||
icon_state = "bluespacify"
|
||||
anchored = TRUE
|
||||
density = FALSE
|
||||
layer = RIPPLE_LAYER
|
||||
alpha = 0
|
||||
|
||||
/obj/effect/ripple/New()
|
||||
. = ..()
|
||||
animate(src, alpha=255, time=SHUTTLE_RIPPLE_TIME)
|
||||
// In case something goes wrong, delete us in a bit
|
||||
addtimer(src, "delself", 3 * SHUTTLE_RIPPLE_TIME, FALSE)
|
||||
|
||||
/obj/effect/ripple/proc/delself()
|
||||
qdel(src)
|
||||
@@ -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)
|
||||
@@ -329,6 +331,11 @@
|
||||
if(mode != SHUTTLE_CALL)
|
||||
return
|
||||
|
||||
if(ripples.len)
|
||||
for(var/i in ripples)
|
||||
qdel(i)
|
||||
ripples.Cut()
|
||||
|
||||
timer = world.time - timeLeft(1)
|
||||
mode = SHUTTLE_RECALL
|
||||
|
||||
@@ -378,6 +385,29 @@
|
||||
|
||||
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/ripple(i)
|
||||
|
||||
/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)
|
||||
@@ -426,6 +456,11 @@
|
||||
//move or squish anything in the way ship at destination
|
||||
roadkill(L0, L1, S1.dir)
|
||||
|
||||
// Removes ripples
|
||||
for(var/i in ripples)
|
||||
qdel(i)
|
||||
ripples.Cut()
|
||||
|
||||
for(var/i in 1 to L0.len)
|
||||
var/turf/T0 = L0[i]
|
||||
if(!T0)
|
||||
@@ -565,6 +600,9 @@
|
||||
//used by shuttle subsystem to check timers
|
||||
/obj/docking_port/mobile/proc/check()
|
||||
var/timeLeft = timeLeft(1)
|
||||
if(!ripples.len && (timeLeft <= SHUTTLE_RIPPLE_TIME) && ((mode == SHUTTLE_CALL) || (mode == SHUTTLE_RECALL)))
|
||||
create_ripples(destination)
|
||||
|
||||
if(timeLeft <= 0)
|
||||
switch(mode)
|
||||
if(SHUTTLE_CALL)
|
||||
|
||||
Reference in New Issue
Block a user