Skip to content

Commit

Permalink
Merge branch 'stable' of https://github.com/wall-nerds/wallening into…
Browse files Browse the repository at this point in the history
… stable
  • Loading branch information
LemonInTheDark committed Aug 3, 2024
2 parents 693b3ad + 7fed911 commit 605a461
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
2 changes: 2 additions & 0 deletions code/game/objects/structures/plaques/static_plaques.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
icon_state = "commission_tram"
custom_materials = list(/datum/material/titanium = SHEET_MATERIAL_AMOUNT)
layer = SIGN_LAYER
pixel_y = -29
pixel_z = 29

/obj/structure/plaque/static_plaque/tram/Initialize(mapload)
. = ..()
Expand Down
2 changes: 2 additions & 0 deletions code/modules/transport/tram/tram_controls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@
dir = SOUTH
pixel_x = -8
pixel_y = 32
pixel_z = 0

/obj/machinery/computer/tram_controls/split/directional/south
dir = NORTH
pixel_x = 8
pixel_y = -32
pixel_z = 0

/obj/machinery/computer/tram_controls/split/directional/east
dir = WEST
Expand Down
44 changes: 31 additions & 13 deletions code/modules/transport/tram/tram_doors.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#define TRAM_DOOR_WARNING_TIME (0.9 SECONDS)
#define TRAM_DOOR_CYCLE_TIME (0.6 SECONDS)
#define TRAM_DOOR_CRUSH_TIME (0.7 SECONDS)
#define TRAM_DOOR_RECYCLE_TIME (2.7 SECONDS)

/obj/machinery/door/airlock/tram
Expand All @@ -17,6 +14,8 @@
doorOpen = 'sound/machines/tramopen.ogg'
doorClose = 'sound/machines/tramclose.ogg'
autoclose = FALSE
greyscale_config = null
greyscale_colors = null
/// Weakref to the tram we're attached
var/datum/weakref/transport_ref
var/retry_counter
Expand All @@ -28,6 +27,28 @@
if(!id_tag)
id_tag = assign_random_name()

/obj/machinery/door/airlock/tram/animation_length(animation)
switch(animation)
if(DOOR_OPENING_ANIMATION)
return 1.3 SECONDS
if(DOOR_CLOSING_ANIMATION)
return 2 SECONDS

/obj/machinery/door/airlock/tram/animation_segment_delay(animation)
switch(animation)
if(AIRLOCK_OPENING_TRANSPARENT)
return 0.6 SECONDS
if(AIRLOCK_OPENING_PASSABLE)
return 0.9 SECONDS
if(AIRLOCK_OPENING_FINISHED)
return 0.9 SECONDS
if(AIRLOCK_CLOSING_UNPASSABLE)
return 0.9 SECONDS
if(AIRLOCK_CLOSING_OPAQUE)
return 0.7 SECONDS
if(AIRLOCK_CLOSING_FINISHED)
return 0.9 SECONDS

/obj/machinery/door/airlock/tram/open(forced = DEFAULT_DOOR_CHECKS)
if(operating || welded || locked || seal)
return FALSE
Expand All @@ -38,24 +59,24 @@
if(forced == DEFAULT_DOOR_CHECKS && (!hasPower() || wires.is_cut(WIRE_OPEN)))
return FALSE

SEND_SIGNAL(src, COMSIG_AIRLOCK_OPEN, FALSE)
SEND_SIGNAL(src, COMSIG_AIRLOCK_OPEN, forced)
operating = TRUE
update_icon(ALL, AIRLOCK_OPENING)

if(forced >= BYPASS_DOOR_CHECKS)
playsound(src, 'sound/machines/airlockforced.ogg', vol = 40, vary = FALSE)
sleep(TRAM_DOOR_CYCLE_TIME)
sleep(animation_segment_delay(AIRLOCK_OPENING_TRANSPARENT))
else
playsound(src, doorOpen, vol = 40, vary = FALSE)
sleep(TRAM_DOOR_WARNING_TIME)
sleep(animation_segment_delay(AIRLOCK_OPENING_PASSABLE))

set_density(FALSE)
if(!isnull(filler))
filler.set_density(FALSE)
update_freelook_sight()
flags_1 &= ~PREVENT_CLICK_UNDER_1
air_update_turf(TRUE, FALSE)
sleep(TRAM_DOOR_WARNING_TIME)
sleep(animation_segment_delay(AIRLOCK_OPENING_FINISHED))
layer = OPEN_DOOR_LAYER
operating = FALSE
update_icon(ALL, AIRLOCK_OPEN)
Expand Down Expand Up @@ -95,7 +116,7 @@
operating = TRUE
layer = CLOSED_DOOR_LAYER
update_icon(ALL, AIRLOCK_CLOSING)
sleep(TRAM_DOOR_WARNING_TIME)
sleep(animation_segment_delay(AIRLOCK_CLOSING_UNPASSABLE))
if(!hungry_door)
for(var/turf/checked_turf in locs)
for(var/atom/movable/blocker in checked_turf)
Expand All @@ -107,7 +128,7 @@
update_icon(ALL, AIRLOCK_OPEN)
return FALSE
SEND_SIGNAL(src, COMSIG_AIRLOCK_CLOSE)
sleep(TRAM_DOOR_CRUSH_TIME)
sleep(animation_segment_delay(AIRLOCK_CLOSING_OPAQUE))
set_density(TRUE)
if(!isnull(filler))
filler.set_density(TRUE)
Expand All @@ -116,7 +137,7 @@
air_update_turf(TRUE, TRUE)
crush()
crushing_in_progress = FALSE
sleep(TRAM_DOOR_WARNING_TIME)
sleep(animation_segment_delay(AIRLOCK_CLOSING_FINISHED))
operating = FALSE
update_icon(ALL, AIRLOCK_CLOSED)
retry_counter = 0
Expand Down Expand Up @@ -237,7 +258,4 @@
open(forced = BYPASS_DOOR_CHECKS)
return

#undef TRAM_DOOR_WARNING_TIME
#undef TRAM_DOOR_CYCLE_TIME
#undef TRAM_DOOR_CRUSH_TIME
#undef TRAM_DOOR_RECYCLE_TIME
Binary file modified icons/obj/doors/airlocks/tram/tram.dmi
Binary file not shown.

0 comments on commit 605a461

Please sign in to comment.