Skip to content

Commit

Permalink
runtimes, emergency transit fix, gamma fix, shuttles direction fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BeebBeebBoob committed Oct 21, 2024
1 parent b25bd7c commit 33ec2bd
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 28 deletions.
17 changes: 12 additions & 5 deletions _maps/map_files/generic/CentComm.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -8651,7 +8651,8 @@
id = "admin";
name = "administration shuttle";
roundstart_move = "admin_away";
width = 18
width = 18;
port_direction = 4
},
/obj/machinery/door/airlock/external{
frequency = 1331;
Expand Down Expand Up @@ -13319,6 +13320,7 @@
id = "ruins_transport_shuttle";
name = "USSP Cargo Shuttle";
roundstart_move = "ussp_dock";
alone_shuttle = 1;
width = 8;
port_direction = 4
},
Expand Down Expand Up @@ -16518,7 +16520,8 @@
/obj/docking_port/mobile/emergency{
dwidth = 11;
height = 18;
width = 29
width = 29;
port_direction = 8
},
/obj/docking_port/stationary{
dir = 4;
Expand Down Expand Up @@ -19747,6 +19750,7 @@
name = "Regular Civilian Shuttle";
rebuildable = 1;
roundstart_move = "spacebar";
alone_shuttle = 1;
width = 6;
port_direction = 4
},
Expand Down Expand Up @@ -33210,7 +33214,8 @@
id = "ferry";
name = "ferry shuttle";
roundstart_move = "ferry_away";
width = 5
width = 5;
port_direction = 4
},
/obj/docking_port/stationary{
dir = 8;
Expand Down Expand Up @@ -37911,8 +37916,10 @@
id = "funeral";
name = "Funeral shuttle";
roundstart_move = "graveyard_dock";
alone_shuttle = 1;
width = 10;
port_direction = 4
port_direction = 4;
preferred_direction = 2
},
/turf/simulated/floor/shuttle/plating,
/area/shuttle/funeral)
Expand Down Expand Up @@ -78486,7 +78493,7 @@ aWY
giC
giC
gmU
giC
jvI
jvI
mVX
mVX
Expand Down
20 changes: 12 additions & 8 deletions code/controllers/subsystem/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ SUBSYSTEM_DEF(shuttle)
cargo_money_account = GLOB.department_accounts["Cargo"]

if(!emergency)
WARNING("No /obj/docking_port/mobile/emergency placed on the map!")
if(!backup_shuttle)
WARNING("No /obj/docking_port/mobile/emergency/backup placed on the map!")
log_runtime(EXCEPTION("No /obj/docking_port/mobile/emergency placed on the map!"))
if(!backup_shuttle)
message_admins("There's no emergency docking ports on the map! The game will be unresolvable. To resolve this problem load emergency shuttle template manually, and call register() on the mobile docking port.")
log_runtime(EXCEPTION("AND NO /obj/docking_port/mobile/emergency/backup placed on the map!"))
if(!supply)
WARNING("No /obj/docking_port/mobile/supply placed on the map!")
log_runtime(EXCEPTION("No /obj/docking_port/mobile/supply placed on the map!"))

initial_load()

Expand Down Expand Up @@ -124,13 +125,14 @@ SUBSYSTEM_DEF(shuttle)
for(var/obj/docking_port/mobile/M in mobile)
if(M.id == id)
return M
WARNING("couldn't find shuttle with id: [id]")
log_runtime(EXCEPTION("couldn't find shuttle with id: [id]"))

/datum/controller/subsystem/shuttle/proc/getDock(id)
for(var/obj/docking_port/stationary/S in stationary)
if(S.id == id)
return S
WARNING("couldn't find dock with id: [id]")
if(!alone_shuttle)

Check failure on line 134 in code/controllers/subsystem/shuttles.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "alone_shuttle"
log_runtime(EXCEPTION("couldn't find dock with id: [id]"))

/datum/controller/subsystem/shuttle/proc/secondsToRefuel()
var/elapsed = world.time - SSticker.round_start_time
Expand All @@ -139,9 +141,11 @@ SUBSYSTEM_DEF(shuttle)

/datum/controller/subsystem/shuttle/proc/requestEvac(mob/user, call_reason)
if(!emergency)
WARNING("requestEvac(): There is no emergency shuttle, but the shuttle was called. Using the backup shuttle instead.")
log_runtime(EXCEPTION("requestEvac(): There is no emergency shuttle, but the shuttle was called. Using the backup shuttle instead."))
message_admins("requestEvac(): There is no emergency shuttle, but the shuttle was called. Using the backup shuttle instead.")
if(!backup_shuttle)
WARNING("requestEvac(): There is no emergency shuttle, or backup shuttle!\
message_admins("requestEvac(): There is no emergency shuttle, or backup shuttle! The game will be unresolvable. This is possibly a mapping error. To resolve this problem load emergency shuttle template manually, and call register() on the mobile docking port.")
WARNING("requestEvac(): There is no emergency shuttle, or backup shuttle! \
The game will be unresolvable.This is possibly a mapping error, \
more likely a bug with the shuttle \
manipulation system, or badminry. It is possible to manually \
Expand Down
5 changes: 2 additions & 3 deletions code/modules/paperwork/photography/camera_image_capturing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@
for(var/turf/T in turfs)
atoms += T
for(var/atom/movable/A in T)
if(istype(A, /atom/movable/lighting_object))
if(flashing_lights)
continue //Do not apply lighting, making whole image full bright.
if(flashing_lights && istype(A, /atom/movable/lighting_object))
continue //Do not apply lighting, making whole image full bright.
if(A.invisibility)
if(!(see_ghosts && isobserver(A)))
continue
Expand Down
7 changes: 6 additions & 1 deletion code/modules/shuttle/emergency.dm
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@
sound_played = 0
mode = SHUTTLE_STRANDED

if(time_left <= 100) // 9 seconds left - start requesting transit zones for emergency and pods
for(var/obj/docking_port/mobile/pod/M in SSshuttle.mobile)
M.check_transit_zone() // yeah, we even check for pods that aren't at station. just for safety
check_transit_zone()

if(time_left <= 50 && !sound_played) //4 seconds left - should sync up with the launch
sound_played = 1
for(var/area/shuttle/escape/E in GLOB.areas)
Expand Down Expand Up @@ -281,7 +286,7 @@
/obj/docking_port/mobile/pod/New()
..()
if(id == "pod")
WARNING("[type] id has not been changed from the default. Use the id convention \"pod1\" \"pod2\" etc.")
log_runtime(EXCEPTION("[type] id has not been changed from the default. Use the id convention \"pod1\" \"pod2\" etc."))

/obj/docking_port/mobile/pod/cancel()
return
Expand Down
5 changes: 2 additions & 3 deletions code/modules/shuttle/gamma.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
width = 7
dir = 4
fly_sound = 'sound/effects/hyperspace_end.ogg'
callTime = 10 SECONDS
ignitionTime = 0
roundstart_move = "gamma_away"
rechargeTime = 0
callTime = 8 SECONDS

/obj/docking_port/mobile/gamma/request(obj/docking_port/stationary/S)
. = ..()
Expand Down
25 changes: 17 additions & 8 deletions code/modules/shuttle/shuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,21 @@

var/timer //used as a timer (if you want time left to complete move, use timeLeft proc)
var/last_timer_length
var/mode = SHUTTLE_IDLE //current shuttle mode
var/rechargeTime = 5 SECONDS // time recharging before ready to launch again
var/callTime = 5 SECONDS //time spent in transit (deciseconds)
var/ignitionTime = 2 SECONDS // time spent "starting the engines". Also rate limits how often we try to reserve transit space if its ever full of transiting shuttles.
var/roundstart_move //id of port to send shuttle to at roundstart
var/rebuildable = 0 //can build new shuttle consoles for this one
/// current shuttle state
var/mode = SHUTTLE_IDLE
/// time recharging before ready to launch again
var/rechargeTime = 5 SECONDS
/// time spent in transit (deciseconds)
var/callTime = 5 SECONDS
/// time spent "starting the engines". Also rate limits how often we try to reserve transit space if its ever full of transiting shuttles.
/// DO NOT set under 3 seconds. We need to reserve space before we can launch the shuttle. Also it'll break launch sound(not by not playing. it'll be unsynced)
var/ignitionTime = 3 SECONDS
/// id of port to send shuttle to at roundstart
var/roundstart_move
/// can build new shuttle consoles for this one
var/rebuildable = 0
/// Doesn't throw runtimes if can't find the dock. Used by away shuttles(example ussp shuttle) which cannot get docks loaded in map.
var/alone_shuttle = FALSE

/// The direction the shuttle prefers to travel in, ie what direction the animation will cause it to appear to be traveling in
var/preferred_direction = NORTH
Expand Down Expand Up @@ -386,12 +395,12 @@
var/obj/docking_port/stationary/S1 = assigned_transit
if(S1)
if(dock(S1, transit = TRUE))
WARNING("shuttle \"[id]\" could not enter transit space. Docked at [S0 ? S0.id : "null"]. Transit dock [S1 ? S1.id : "null"].")
log_runtime(EXCEPTION("shuttle \"[id]\" could not enter transit space. Docked at [S0 ? S0.id : "null"]. Transit dock [S1 ? S1.id : "null"]."))
else
previous = S0
return TRUE
else
WARNING("shuttle \"[id]\" could not enter transit space. S0=[S0 ? S0.id : "null"] S1=[S1 ? S1.id : "null"]")
log_runtime(EXCEPTION("shuttle \"[id]\" could not enter transit space. S0=[S0 ? S0.id : "null"] S1=[S1 ? S1.id : "null"]"))



Expand Down

0 comments on commit 33ec2bd

Please sign in to comment.