mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-07-19 12:13:38 +01:00
[MIRROR] Turfsuff (#10366)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
5b76a749ac
commit
87be9dc7e8
@@ -201,53 +201,20 @@ GLOBAL_LIST_EMPTY(tele_landmarks)
|
||||
/obj/effect/step_trigger/teleporter/planetary_fall
|
||||
var/datum/planet/planet = null
|
||||
|
||||
|
||||
/obj/effect/step_trigger/teleporter/planetary_fall/Destroy()
|
||||
. = ..()
|
||||
planet = null
|
||||
|
||||
// First time setup, which planet are we aiming for?
|
||||
/obj/effect/step_trigger/teleporter/planetary_fall/proc/find_planet()
|
||||
return
|
||||
|
||||
/obj/effect/step_trigger/teleporter/planetary_fall/Trigger(var/atom/movable/A)
|
||||
if(!planet)
|
||||
find_planet()
|
||||
|
||||
if(planet)
|
||||
if(!planet.planet_floors.len)
|
||||
message_admins("ERROR: planetary_fall step trigger's list of outdoor floors was empty.")
|
||||
return
|
||||
var/turf/simulated/T = null
|
||||
var/safety = 100 // Infinite loop protection.
|
||||
while(!T && safety)
|
||||
var/turf/simulated/candidate = pick(planet.planet_floors)
|
||||
if(!istype(candidate) || istype(candidate, /turf/simulated/sky))
|
||||
safety--
|
||||
continue
|
||||
else if(candidate && !candidate.is_outdoors())
|
||||
safety--
|
||||
continue
|
||||
else
|
||||
T = candidate
|
||||
break
|
||||
|
||||
if(!T)
|
||||
message_admins("ERROR: planetary_fall step trigger could not find a suitable landing turf.")
|
||||
return
|
||||
|
||||
if(isobserver(A))
|
||||
A.forceMove(T) // Harmlessly move ghosts.
|
||||
return
|
||||
//VOREStation Edit Start
|
||||
if(!(A.can_fall()))
|
||||
return // Phased shifted kin should not fall
|
||||
//VOREStation Edit End
|
||||
|
||||
A.forceMove(T)
|
||||
// Living things should probably be logged when they fall...
|
||||
if(isliving(A))
|
||||
message_admins("\The [A] fell out of the sky.")
|
||||
// ... because they're probably going to die from it.
|
||||
A.fall_impact(T, 42, 90, FALSE, TRUE) //You will not be defibbed from this.
|
||||
else
|
||||
message_admins("ERROR: planetary_fall step trigger lacks a planet to fall onto.")
|
||||
var/turf/T = get_turf(A)
|
||||
if(!T)
|
||||
return
|
||||
T.trigger_fall(A, planet)
|
||||
|
||||
//Death
|
||||
|
||||
|
||||
Reference in New Issue
Block a user