Merge pull request #8032 from deathride58/immersivetransitturfs

Makes transit areas physically throw you out of the transit area instead of simply teleporting you
This commit is contained in:
kevinz000
2019-02-27 16:02:58 -08:00
committed by GitHub
4 changed files with 39 additions and 4 deletions
+3 -1
View File
@@ -435,11 +435,13 @@ GLOBAL_LIST_EMPTY(the_station_areas)
GLOB.the_gateway.awaygate = new_gate
GLOB.the_gateway.wait = world.time
/datum/controller/subsystem/mapping/proc/RequestBlockReservation(width, height, z, type = /datum/turf_reservation, turf_type_override)
/datum/controller/subsystem/mapping/proc/RequestBlockReservation(width, height, z, type = /datum/turf_reservation, turf_type_override, border_type_override)
UNTIL(initialized && !clearing_reserved_turfs)
var/datum/turf_reservation/reserve = new type
if(turf_type_override)
reserve.turf_type = turf_type_override
if(border_type_override)
reserve.borderturf = border_type_override
if(!z)
for(var/i in levels_by_trait(ZTRAIT_RESERVED))
if(reserve.Reserve(width, height, i))
+6 -1
View File
@@ -443,17 +443,22 @@ SUBSYSTEM_DEF(shuttle)
*/
var/transit_path = /turf/open/space/transit
var/border_path = /turf/open/space/transit/border
switch(travel_dir)
if(NORTH)
transit_path = /turf/open/space/transit/north
border_path = /turf/open/space/transit/border/north
if(SOUTH)
transit_path = /turf/open/space/transit/south
border_path = /turf/open/space/transit/border/south
if(EAST)
transit_path = /turf/open/space/transit/east
border_path = /turf/open/space/transit/border/east
if(WEST)
transit_path = /turf/open/space/transit/west
border_path = /turf/open/space/transit/border/west
var/datum/turf_reservation/proposal = SSmapping.RequestBlockReservation(transit_width, transit_height, null, /datum/turf_reservation/transit, transit_path)
var/datum/turf_reservation/proposal = SSmapping.RequestBlockReservation(transit_width, transit_height, null, /datum/turf_reservation/transit, transit_path, border_path)
if(!istype(proposal))
return FALSE
+18 -1
View File
@@ -26,7 +26,22 @@
/turf/open/space/transit/east
dir = EAST
/turf/open/space/transit/Entered(atom/movable/AM, atom/OldLoc)
/turf/open/space/transit/border
opacity = TRUE
/turf/open/space/transit/border/south
dir = SOUTH
/turf/open/space/transit/border/north
dir = NORTH
/turf/open/space/transit/border/west
dir = WEST
/turf/open/space/transit/border/east
dir = EAST
/turf/open/space/transit/border/Entered(atom/movable/AM, atom/OldLoc)
..()
if(!locate(/obj/structure/lattice) in src)
throw_atom(AM)
@@ -66,6 +81,8 @@
var/turf/T = locate(_x, _y, _z)
AM.forceMove(T)
var/turf/throwturf = get_ranged_target_turf(T, dir, 1)
AM.safe_throw_at(throwturf, 1, 4, null, FALSE)
/turf/open/space/transit/CanBuildHere()
@@ -9,9 +9,11 @@
var/top_right_coords[3]
var/wipe_reservation_on_release = TRUE
var/turf_type = /turf/open/space
var/borderturf
/datum/turf_reservation/transit
turf_type = /turf/open/space/transit
borderturf = /turf/open/space/transit/border
/datum/turf_reservation/proc/Release()
var/v = reserved_turfs.Copy()
@@ -20,6 +22,12 @@
SSmapping.used_turfs -= i
SSmapping.reserve_turfs(v)
/datum/turf_reservation/transit/Release()
for(var/turf/open/space/transit/T in reserved_turfs)
for(var/atom/movable/AM in T)
T.throw_atom(AM)
. = ..()
/datum/turf_reservation/proc/Reserve(width, height, zlevel)
if(width > world.maxx || height > world.maxy || width < 1 || height < 1)
return FALSE
@@ -60,7 +68,10 @@
T.flags_1 &= ~UNUSED_RESERVATION_TURF_1
SSmapping.unused_turfs["[T.z]"] -= T
SSmapping.used_turfs[T] = src
T.ChangeTurf(turf_type, turf_type)
if(borderturf && (T.x == BL.x || T.x == TR.x || T.y == BL.y || T.y == TR.y))
T.ChangeTurf(borderturf, borderturf)
else
T.ChangeTurf(turf_type, turf_type)
src.width = width
src.height = height
return TRUE