mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-19 20:06:28 +01:00
Shuttle Landing Indicators (#16305)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
/obj/effect/shuttle_warning
|
||||
name = "shuttle warning effect"
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
icon_state = "shuttle_warning"
|
||||
anchored = TRUE
|
||||
simulated = FALSE
|
||||
mouse_opacity = 0
|
||||
layer = INGAME_HUD_EFFECT_LAYER
|
||||
@@ -117,6 +117,7 @@
|
||||
return FALSE
|
||||
|
||||
/obj/effect/shuttle_landmark/visiting_shuttle/shuttle_arrived(datum/shuttle/shuttle)
|
||||
..()
|
||||
LAZYSET(core_landmark.visitors, src, shuttle)
|
||||
shuttle_moved_event.register(shuttle, src, PROC_REF(shuttle_left))
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
var/shuttle_restricted
|
||||
var/landmark_flags = 0
|
||||
|
||||
/// Effects that show where the shuttle will land, to prevent unfair squishing
|
||||
var/list/landing_indicators
|
||||
|
||||
/obj/effect/shuttle_landmark/Initialize()
|
||||
. = ..()
|
||||
name = name + " ([x],[y])"
|
||||
@@ -72,11 +75,21 @@
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/effect/shuttle_landmark/proc/deploy_landing_indicators(var/datum/shuttle/shuttle)
|
||||
LAZYINITLIST(landing_indicators)
|
||||
for(var/area/A in shuttle.shuttle_area)
|
||||
var/list/translation = get_turf_translation(get_turf(shuttle.current_location), get_turf(src), A.contents)
|
||||
for(var/target_turf in list_values(translation))
|
||||
landing_indicators += new /obj/effect/shuttle_warning(target_turf)
|
||||
|
||||
/obj/effect/shuttle_landmark/proc/clear_landing_indicators()
|
||||
QDEL_NULL_LIST(landing_indicators) // lazyclear but we delete the effects as well
|
||||
|
||||
/obj/effect/shuttle_landmark/proc/cannot_depart(datum/shuttle/shuttle)
|
||||
return FALSE
|
||||
|
||||
/obj/effect/shuttle_landmark/proc/shuttle_arrived(datum/shuttle/shuttle)
|
||||
return
|
||||
clear_landing_indicators()
|
||||
|
||||
/proc/check_collision(area/target_area, list/target_turfs)
|
||||
for(var/target_turf in target_turfs)
|
||||
|
||||
@@ -130,12 +130,14 @@
|
||||
if(attempt_move(interim))
|
||||
on_move_interim()
|
||||
var/fwooshed = 0
|
||||
destination.deploy_landing_indicators(src)
|
||||
while (world.time < arrive_time)
|
||||
if(!fwooshed && (arrive_time - world.time) < 100)
|
||||
fwooshed = 1
|
||||
playsound(destination, sound_landing, 50, 20, is_global = TRUE)
|
||||
sleep(5)
|
||||
if(!attempt_move(destination))
|
||||
destination.clear_landing_indicators()
|
||||
attempt_move(start_location) //try to go back to where we started. If that fails, I guess we're stuck in the interim location
|
||||
|
||||
moving_status = SHUTTLE_IDLE
|
||||
|
||||
Reference in New Issue
Block a user