everything but mob stuff

This commit is contained in:
Poojawa
2018-04-23 01:06:17 -05:00
parent cc6b320f83
commit 5518efebea
111 changed files with 978 additions and 3448 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
height = 7
/obj/docking_port/mobile/assault_pod/request()
if(z == initial(src.z)) //No launching pods that have already launched
if(!(z in SSmapping.levels_by_trait(ZTRAIT_STATION))) //No launching pods that have already launched
return ..()
+5 -23
View File
@@ -14,25 +14,11 @@
var/obj/docking_port/stationary/old_dock = get_docked()
// The turf that gets placed under where the shuttle moved from
var/underlying_turf_type = SHUTTLE_DEFAULT_TURF_TYPE
// The baseturf that the gets assigned to the turf_type above
var/underlying_baseturf_type = SHUTTLE_DEFAULT_BASETURF_TYPE
// The area that gets placed under where the shuttle moved from
var/underlying_area_type = SHUTTLE_DEFAULT_UNDERLYING_AREA
// The baseturf cache is a typecache of what counts as a baseturf to be left behind
var/list/baseturf_cache
if(old_dock) //Dock overwrites
underlying_turf_type = old_dock.turf_type
underlying_baseturf_type = old_dock.baseturf_type
underlying_area_type = old_dock.area_type
baseturf_cache = old_dock.baseturf_cache
else
baseturf_cache = typecacheof(underlying_baseturf_type)
/**************************************************************************************************************
Both lists are associative with a turf:bitflag structure. (new_turfs bitflag space unused currently)
@@ -70,7 +56,7 @@
remove_ripples()
. = preflight_check(old_turfs, new_turfs, areas_to_move, rotation, underlying_turf_type, baseturf_cache)
. = preflight_check(old_turfs, new_turfs, areas_to_move, rotation)
if(.)
return
@@ -97,7 +83,7 @@
CHECK_TICK
cleanup_runway(new_dock, old_turfs, new_turfs, areas_to_move, moved_atoms, rotation, movement_direction, underlying_old_area, underlying_turf_type, underlying_baseturf_type)
cleanup_runway(new_dock, old_turfs, new_turfs, areas_to_move, moved_atoms, rotation, movement_direction, underlying_old_area)
CHECK_TICK
@@ -118,8 +104,6 @@
list/new_turfs,
list/areas_to_move,
rotation,
underlying_turf_type,
baseturf_cache,
)
for(var/i in 1 to old_turfs.len)
@@ -142,8 +126,8 @@
continue
move_mode = moving_atom.beforeShuttleMove(newT, rotation, move_mode, src) //atoms
move_mode = oldT.fromShuttleMove(newT, underlying_turf_type, baseturf_cache, move_mode) //turfs
move_mode = newT.toShuttleMove(oldT, move_mode , src) //turfs
move_mode = oldT.fromShuttleMove(newT, move_mode) //turfs
move_mode = newT.toShuttleMove(oldT, move_mode, src) //turfs
if(move_mode & MOVE_AREA)
areas_to_move[old_area] = TRUE
@@ -188,8 +172,6 @@
rotation,
movement_direction,
area/underlying_old_area,
underlying_turf_type,
underlying_baseturf_type,
)
underlying_old_area.afterShuttleMove()
@@ -210,7 +192,7 @@
continue
var/turf/oldT = old_turfs[i]
var/turf/newT = new_turfs[i]
newT.afterShuttleMove(oldT, underlying_turf_type, underlying_baseturf_type, rotation) //turfs
newT.afterShuttleMove(oldT, rotation) //turfs
for(var/i in 1 to moved_atoms.len)
CHECK_TICK
+1 -1
View File
@@ -561,7 +561,7 @@
SSshuttle.emergency = current_emergency
SSshuttle.backup_shuttle = src
#undef TIMELEFT
#undef TIME_LEFT
#undef ENGINES_START_TIME
#undef ENGINES_STARTED
#undef IS_DOCKED
+1 -2
View File
@@ -271,8 +271,7 @@
// The shuttle template we loaded isn't "timid" which means
// it's already registered with the shuttles subsystem.
// This is a bad thing.
var/m = "Template [S] is non-timid! Unloading."
WARNING(m)
stack_trace("Template [S] is non-timid! Unloading.")
M.jumpToNullSpace()
return
else
+12 -11
View File
@@ -6,15 +6,9 @@ All ShuttleMove procs go here
// Called on every turf in the shuttle region, returns a bitflag for allowed movements of that turf
// returns the new move_mode (based on the old)
/turf/proc/fromShuttleMove(turf/newT, turf_type, list/baseturf_cache, move_mode)
if(!(move_mode & MOVE_AREA))
/turf/proc/fromShuttleMove(turf/newT, move_mode)
if(!(move_mode & MOVE_AREA) || !isshuttleturf(src))
return move_mode
if(istype(src, turf_type))
if(length(baseturfs))
if(baseturf_cache[baseturfs[1]])
return move_mode
else if(baseturf_cache[baseturfs])
return move_mode
return move_mode | MOVE_TURF | MOVE_CONTENTS
@@ -54,7 +48,12 @@ All ShuttleMove procs go here
if(newT == src) // In case of in place shuttle rotation shenanigans.
return
//Destination turf changes
newT.CopyOnTop(src, 1, 0) // We only want a surface copy
//Baseturfs is definitely a list or this proc wouldnt be called
var/shuttle_boundary = baseturfs.Find(/turf/baseturf_skipover/shuttle)
if(!shuttle_boundary)
CRASH("A turf queued to move via shuttle somehow had no skipover in baseturfs. [src]([type]):[loc]")
var/depth = baseturfs.len - shuttle_boundary + 1
newT.CopyOnTop(src, 1, depth)
//Air stuff
newT.blocks_air = TRUE
newT.air_update_turf(TRUE)
@@ -67,10 +66,12 @@ All ShuttleMove procs go here
return TRUE
// Called on the new turf after everything has been moved
/turf/proc/afterShuttleMove(turf/oldT, turf_type, baseturf_type, rotation)
/turf/proc/afterShuttleMove(turf/oldT, rotation)
//Dealing with the turf we left behind
oldT.TransferComponents(src)
oldT.ChangeTurf(turf_type, baseturf_type, CHANGETURF_IGNORE_AIR) // TODO: make this oldT.ScrapeAway() which requires templating all shuttles
var/shuttle_boundary = baseturfs.Find(/turf/baseturf_skipover/shuttle)
if(shuttle_boundary)
oldT.ScrapeAway(baseturfs.len - shuttle_boundary + 1)
if(rotation)
shuttleRotate(rotation) //see shuttle_rotate.dm
+15 -27
View File
@@ -7,7 +7,6 @@
/obj/docking_port
invisibility = INVISIBILITY_ABSTRACT
icon = 'icons/obj/device.dmi'
//icon = 'icons/dirsquare.dmi'
icon_state = "pinonfar"
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
@@ -22,8 +21,6 @@
var/dheight = 0 //position relative to covered area, parallel to dir
var/area_type
var/turf_type
var/baseturf_type
var/hidden = FALSE //are we invisible to shuttle navigation computers?
//these objects are indestructible
@@ -146,25 +143,17 @@
var/y0 = bounds[2]
var/x1 = bounds[3]
var/y1 = bounds[4]
if(x0 <= x1 && !ISINRANGE(T.x, x0, x1))
if(!ISINRANGE(T.x, min(x0, x1), max(x0, x1)))
return FALSE
else if(!ISINRANGE(T.x, x1, x0))
return FALSE
if(y0 <= y1 && !ISINRANGE(T.y, y0, y1))
return FALSE
else if(!ISINRANGE(T.y, y1, y0))
if(!ISINRANGE(T.y, min(y0, y1), max(y0, y1)))
return FALSE
return TRUE
/obj/docking_port/stationary
name = "dock"
turf_type = SHUTTLE_DEFAULT_TURF_TYPE
baseturf_type = SHUTTLE_DEFAULT_BASETURF_TYPE
area_type = SHUTTLE_DEFAULT_UNDERLYING_AREA
var/list/baseturf_cache
var/last_dock_time
var/datum/map_template/shuttle/roundstart_template
@@ -177,7 +166,6 @@
id = "[SSshuttle.stationary.len]"
if(name == "dock")
name = "dock[SSshuttle.stationary.len]"
baseturf_cache = typecacheof(baseturf_type)
if(mapload)
for(var/turf/T in return_turfs())
@@ -214,7 +202,6 @@
/obj/docking_port/stationary/transit
name = "In Transit"
turf_type = /turf/open/space/transit
var/list/turf/assigned_turfs = list()
var/area/shuttle/transit/assigned_area
var/obj/docking_port/mobile/owner
@@ -226,8 +213,9 @@
/obj/docking_port/stationary/transit/proc/dezone()
for(var/i in 1 to assigned_turfs.len)
var/turf/T = assigned_turfs[i]
if(T.type == turf_type)
T.ChangeTurf(SHUTTLE_DEFAULT_TURF_TYPE, SHUTTLE_DEFAULT_BASETURF_TYPE)
if(istype(T, /turf/open/space/transit))
T.ChangeTurf(/turf/open/space)
T.assemble_baseturfs(initial(T.baseturfs))
T.flags_1 |= UNUSED_TRANSIT_TURF_1
/obj/docking_port/stationary/transit/Destroy(force=FALSE)
@@ -437,18 +425,11 @@
// Not in a fancy way, it just ceases.
var/obj/docking_port/stationary/current_dock = get_docked()
var/turf_type = SHUTTLE_DEFAULT_TURF_TYPE
var/baseturf_type = SHUTTLE_DEFAULT_BASETURF_TYPE
var/underlying_area_type = SHUTTLE_DEFAULT_UNDERLYING_AREA
// If the shuttle is docked to a stationary port, restore its normal
// "empty" area and turf
if(current_dock)
if(current_dock.turf_type)
turf_type = current_dock.turf_type
if(current_dock.baseturf_type)
baseturf_type = current_dock.baseturf_type
if(current_dock.area_type)
underlying_area_type = current_dock.area_type
if(current_dock && current_dock.area_type)
underlying_area_type = current_dock.area_type
var/list/old_turfs = return_ordered_turfs(x, y, z, dir)
var/area/underlying_area = locate(underlying_area_type) in GLOB.sortedAreas
@@ -462,7 +443,14 @@
var/area/old_area = oldT.loc
underlying_area.contents += oldT
oldT.change_area(old_area, underlying_area)
oldT.empty(turf_type, baseturf_type)
oldT.empty(null)
// Here we locate the bottomost shuttle boundary and remove all turfs above it
var/list/baseturf_cache = oldT.baseturfs
for(var/k in 1 to length(baseturf_cache))
if(ispath(baseturf_cache[k], /turf/baseturf_skipover/shuttle))
oldT.ScrapeAway(baseturf_cache.len - k + 1)
break
qdel(src, force=TRUE)