realistic transit turfs - transit turfs will now physically throw you out of the transit area instead of simply teleporting you

This commit is contained in:
deathride58
2019-02-21 01:38:18 -05:00
parent 74c87b3d56
commit 5d9e3e0092
4 changed files with 41 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
+26 -1
View File
@@ -26,12 +26,37 @@
/turf/open/space/transit/east
dir = EAST
/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/Entered(atom/movable/AM, atom/OldLoc)
..()
if(!locate(/obj/structure/lattice) in src)
if(!locate(/obj/structure/lattice) in src && !SSshuttle.is_in_shuttle_bounds(src))
throw_atom(AM)
/turf/open/space/transit/proc/throw_atom(atom/movable/AM)
if(!AM || istype(AM, /obj/docking_port))
return
if(AM.loc != src)
return
if(AM.throwing)
return
var/turf/T = get_ranged_target_turf(src, turn(dir, 180), 10)
AM.safe_throw_at(T, 10, 1, null, FALSE)
/turf/open/space/transit/border/throw_atom(atom/movable/AM)
set waitfor = FALSE
if(!AM || istype(AM, /obj/docking_port))
return
@@ -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()
@@ -60,7 +62,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