diff --git a/_maps/map_files/tramstation/tramstation.dmm b/_maps/map_files/tramstation/tramstation.dmm index 9befe46a5bc..abe12325c19 100644 --- a/_maps/map_files/tramstation/tramstation.dmm +++ b/_maps/map_files/tramstation/tramstation.dmm @@ -793,7 +793,7 @@ dir = 1 }, /obj/structure/industrial_lift/tram, -/obj/structure/chair/sofa/bench/right{ +/obj/structure/chair/sofa/bench/tram/right{ dir = 8 }, /turf/open/openspace, @@ -8095,7 +8095,7 @@ dir = 1 }, /obj/effect/landmark/start/hangover, -/obj/structure/chair/sofa/bench/left{ +/obj/structure/chair/sofa/bench/tram/left{ dir = 4 }, /turf/open/openspace, @@ -13400,7 +13400,7 @@ "eOi" = ( /obj/structure/industrial_lift/tram, /obj/structure/window/reinforced/tram/left/directional/north, -/obj/structure/chair/sofa/bench/right{ +/obj/structure/chair/sofa/bench/tram/right{ dir = 8 }, /turf/open/openspace, @@ -13490,7 +13490,7 @@ /obj/machinery/destination_sign/north{ pixel_y = 10 }, -/obj/structure/chair/sofa/bench/left{ +/obj/structure/chair/sofa/bench/tram/left{ dir = 4 }, /turf/open/openspace, @@ -16828,7 +16828,7 @@ pixel_y = 10 }, /obj/structure/window/reinforced/tram/left/directional/north, -/obj/structure/chair/sofa/bench/right{ +/obj/structure/chair/sofa/bench/tram/right{ dir = 8 }, /turf/open/openspace, @@ -28761,7 +28761,7 @@ }, /obj/structure/window/reinforced/tram/left/directional/south, /obj/effect/landmark/start/hangover, -/obj/structure/chair/sofa/bench/left{ +/obj/structure/chair/sofa/bench/tram/left{ dir = 8 }, /turf/open/openspace, @@ -29057,7 +29057,7 @@ "kBX" = ( /obj/structure/industrial_lift/tram, /obj/structure/window/reinforced/tram/left/directional/south, -/obj/structure/chair/sofa/bench/right{ +/obj/structure/chair/sofa/bench/tram/right{ dir = 4 }, /turf/open/openspace, @@ -44212,7 +44212,7 @@ "pWK" = ( /obj/structure/industrial_lift/tram, /obj/structure/window/reinforced/tram/right/directional/north, -/obj/structure/chair/sofa/bench/right{ +/obj/structure/chair/sofa/bench/tram/right{ dir = 8 }, /turf/open/openspace, @@ -49044,7 +49044,7 @@ /obj/structure/fluff/tram_rail, /obj/structure/industrial_lift/tram, /obj/effect/landmark/start/hangover, -/obj/structure/chair/sofa/bench/left{ +/obj/structure/chair/sofa/bench/tram/left{ dir = 8 }, /turf/open/openspace, @@ -49850,7 +49850,7 @@ "rPU" = ( /obj/structure/industrial_lift/tram, /obj/structure/fluff/tram_rail, -/obj/structure/chair/sofa/bench/left{ +/obj/structure/chair/sofa/bench/tram/left{ dir = 8 }, /turf/open/openspace, @@ -51044,7 +51044,7 @@ pixel_y = -11 }, /obj/effect/landmark/start/hangover, -/obj/structure/chair/sofa/bench/right{ +/obj/structure/chair/sofa/bench/tram/right{ dir = 4 }, /turf/open/openspace, @@ -55109,7 +55109,7 @@ /obj/structure/fluff/tram_rail, /obj/effect/landmark/start/hangover, /obj/structure/industrial_lift/tram, -/obj/structure/chair/sofa/bench/right{ +/obj/structure/chair/sofa/bench/tram/right{ dir = 4 }, /turf/open/openspace, @@ -59304,7 +59304,7 @@ /obj/structure/fluff/tram_rail{ dir = 1 }, -/obj/structure/chair/sofa/bench/left{ +/obj/structure/chair/sofa/bench/tram/left{ dir = 4 }, /turf/open/openspace, @@ -61298,7 +61298,7 @@ /obj/structure/industrial_lift/tram, /obj/structure/fluff/tram_rail, /obj/effect/landmark/start/hangover, -/obj/structure/chair/sofa/bench/left{ +/obj/structure/chair/sofa/bench/tram/left{ dir = 8 }, /turf/open/openspace, @@ -62974,7 +62974,7 @@ "wHs" = ( /obj/structure/industrial_lift/tram, /obj/structure/window/reinforced/tram/right/directional/south, -/obj/structure/chair/sofa/bench/right{ +/obj/structure/chair/sofa/bench/tram/right{ dir = 4 }, /turf/open/openspace, diff --git a/code/game/objects/items/emags.dm b/code/game/objects/items/emags.dm index a3d0176ca68..84eb1d50139 100644 --- a/code/game/objects/items/emags.dm +++ b/code/game/objects/items/emags.dm @@ -60,7 +60,7 @@ /obj/item/card/emag/Initialize(mapload) . = ..() - type_blacklist = list(typesof(/obj/machinery/door/airlock), typesof(/obj/machinery/door/window/), typesof(/obj/machinery/door/firedoor)) //list of all typepaths that require a specialized emag to hack. + type_blacklist = list(typesof(/obj/machinery/door/airlock) + typesof(/obj/machinery/door/window/) + typesof(/obj/machinery/door/firedoor) - typesof(/obj/machinery/door/window/tram/)) //list of all typepaths that require a specialized emag to hack. /obj/item/card/emag/attack() return diff --git a/code/game/objects/structures/beds_chairs/sofa.dm b/code/game/objects/structures/beds_chairs/sofa.dm index 0c2e84b6d0d..0dc90f72acd 100644 --- a/code/game/objects/structures/beds_chairs/sofa.dm +++ b/code/game/objects/structures/beds_chairs/sofa.dm @@ -100,27 +100,23 @@ COLORED_SOFA(/obj/structure/chair/sofa, maroon, SOFA_MAROON) desc = "Perfectly designed to be comfortable to sit on, and hellish to sleep on." icon_state = "bench_middle" greyscale_config = /datum/greyscale_config/bench_middle - greyscale_colors = "#00CCFF" + greyscale_colors = "#2E668A" /obj/structure/chair/sofa/bench/left icon_state = "bench_left" greyscale_config = /datum/greyscale_config/bench_left - greyscale_colors = "#00CCFF" /obj/structure/chair/sofa/bench/right icon_state = "bench_right" greyscale_config = /datum/greyscale_config/bench_right - greyscale_colors = "#00CCFF" /obj/structure/chair/sofa/bench/corner icon_state = "bench_corner" greyscale_config = /datum/greyscale_config/bench_corner - greyscale_colors = "#00CCFF" /obj/structure/chair/sofa/bench/solo icon_state = "bench_solo" greyscale_config = /datum/greyscale_config/bench_solo - greyscale_colors = "#00CCFF" /obj/structure/chair/sofa/bench/post_buckle_mob(mob/living/Mob) if(src.dir == EAST || WEST) diff --git a/code/modules/events/tram_malfunction.dm b/code/modules/events/tram_malfunction.dm index b6bc575c360..afb2e62970e 100644 --- a/code/modules/events/tram_malfunction.dm +++ b/code/modules/events/tram_malfunction.dm @@ -37,19 +37,22 @@ /datum/round_event/tram_malfunction/start() for(var/obj/machinery/crossing_signal/signal as anything in GLOB.tram_signals) - if(signal.obj_flags & EMAGGED) - return - signal.start_malfunction() + for(var/obj/machinery/door/window/tram/door as anything in GLOB.tram_doors) + door.start_malfunction() + for(var/obj/structure/industrial_lift/tram as anything in GLOB.lifts) original_lethality = tram.collision_lethality tram.collision_lethality = 2 /datum/round_event/tram_malfunction/end() - for(var/obj/machinery/crossing_signal/signal in GLOB.tram_signals) + for(var/obj/machinery/crossing_signal/signal as anything in GLOB.tram_signals) signal.end_malfunction() + for(var/obj/machinery/door/window/tram/door as anything in GLOB.tram_doors) + door.end_malfunction() + for(var/obj/structure/industrial_lift/tram as anything in GLOB.lifts) tram.collision_lethality = original_lethality diff --git a/code/modules/industrial_lift/tram/tram_machinery.dm b/code/modules/industrial_lift/tram/tram_machinery.dm index 36bec4ef62d..9071aaf5e0d 100644 --- a/code/modules/industrial_lift/tram/tram_machinery.dm +++ b/code/modules/industrial_lift/tram/tram_machinery.dm @@ -1,5 +1,6 @@ GLOBAL_LIST_EMPTY(tram_signals) GLOBAL_LIST_EMPTY(tram_signs) +GLOBAL_LIST_EMPTY(tram_doors) /obj/machinery/computer/tram_controls name = "tram controls" @@ -13,7 +14,7 @@ GLOBAL_LIST_EMPTY(tram_signs) circuit = /obj/item/circuitboard/computer/tram_controls flags_1 = NODECONSTRUCT_1 | SUPERMATTER_IGNORES_1 resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF - + light_color = COLOR_BLUE_LIGHT light_range = 0 //we dont want to spam SSlighting with source updates every movement ///Weakref to the tram piece we control @@ -238,15 +239,14 @@ GLOBAL_LIST_EMPTY(tram_signs) plane = GAME_PLANE_UPPER max_integrity = 250 integrity_failure = 0.25 - idle_power_usage = BASE_MACHINE_IDLE_CONSUMPTION * 0.05 - active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 0.02 + idle_power_usage = BASE_MACHINE_IDLE_CONSUMPTION * 2.4 + active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 0.74 anchored = TRUE density = FALSE // pointless if it only takes 2 seconds to cross but updates every 2 seconds subsystem_type = /datum/controller/subsystem/processing/fastprocess - light_range = 1.5 - light_power = 1 + light_power = 3 light_color = COLOR_VIBRANT_LIME luminosity = 1 @@ -273,17 +273,17 @@ GLOBAL_LIST_EMPTY(tram_signs) name = "crossing signal" desc = "Indicates to pedestrians if it's safe to cross the tracks." icon = 'icons/obj/machines/crossing_signal.dmi' - icon_state = "static-base-left" - base_icon_state = "static-" + icon_state = "static-left-on" + base_icon_state = "static-left-" plane = GAME_PLANE_UPPER max_integrity = 250 integrity_failure = 0.25 - idle_power_usage = BASE_MACHINE_IDLE_CONSUMPTION * 0.05 - active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 0.02 + idle_power_usage = BASE_MACHINE_IDLE_CONSUMPTION * 2.4 + active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 0.74 anchored = TRUE density = FALSE light_range = 1.5 - light_power = 1 + light_power = 3 light_color = COLOR_VIBRANT_LIME luminosity = 1 @@ -359,6 +359,9 @@ GLOBAL_LIST_EMPTY(tram_signs) * Returns whether we are still processing. */ /obj/machinery/crossing_signal/proc/update_operating() + + use_power(idle_power_usage) + // Emagged crossing signals don't update if(obj_flags & EMAGGED) return @@ -481,6 +484,16 @@ GLOBAL_LIST_EMPTY(tram_signs) . += mutable_appearance(icon, lights_overlay) . += emissive_appearance(icon, "[lights_overlay]e", offset_spokesman = src, alpha = src.alpha) +/obj/machinery/static_signal/power_change() + ..() + if(!is_operational) + icon_state = "[base_icon_state]off" + set_light(l_on = FALSE) + return + + icon_state = "[base_icon_state]on" + set_light(l_on = TRUE) + /// Shifted to NE corner for east side of northern passage. /obj/machinery/crossing_signal/northeast icon_state = "crossing-base-left" @@ -512,25 +525,27 @@ GLOBAL_LIST_EMPTY(tram_signs) pixel_y = 20 /obj/machinery/static_signal/northeast - icon_state = "static-base-left" + icon_state = "static-left-on" pixel_x = -2 pixel_y = -1 /// Shifted to NW corner for west side of northern passage. /obj/machinery/static_signal/northwest - icon_state = "static-base-right" + icon_state = "static-right-on" + base_icon_state = "static-right-" pixel_x = -32 pixel_y = -1 /// Shifted to SE corner for east side of northern passage. /obj/machinery/static_signal/southeast - icon_state = "static-base-left" + icon_state = "static-left-on" pixel_x = -2 pixel_y = 20 /// Shifted to SW corner for west side of northern passage. /obj/machinery/static_signal/southwest - icon_state = "static-base-right" + icon_state = "static-right-on" + base_icon_state = "static-right-" pixel_x = -32 pixel_y = 20 @@ -540,8 +555,8 @@ GLOBAL_LIST_EMPTY(tram_signs) icon = 'icons/obj/machines/tram_sign.dmi' icon_state = "desto_off" base_icon_state = "desto_" - idle_power_usage = BASE_MACHINE_IDLE_CONSUMPTION * 0.05 - active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 0.02 + idle_power_usage = BASE_MACHINE_IDLE_CONSUMPTION * 1.2 + active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 0.47 anchored = TRUE density = FALSE subsystem_type = /datum/controller/subsystem/processing/fastprocess @@ -660,7 +675,7 @@ GLOBAL_LIST_EMPTY(tram_signs) var/datum/weakref/tram_ref /// Directions the tram door can be forced open in an emergency var/space_dir = null - safe = FALSE + var/malfunctioning = FALSE /obj/machinery/door/window/tram/left icon_state = "left" @@ -679,6 +694,26 @@ GLOBAL_LIST_EMPTY(tram_signs) icon_state = "windoor" base_state = "windoor" +/obj/machinery/door/window/tram/emag_act(mob/living/user) + if(obj_flags & EMAGGED) + return + balloon_alert(user, "disabled motion sensors") + obj_flags |= EMAGGED + +/obj/machinery/door/window/tram/proc/start_malfunction() + if(obj_flags & EMAGGED) + return + + malfunctioning = TRUE + process() + +/obj/machinery/door/window/tram/proc/end_malfunction() + if(obj_flags & EMAGGED) + return + + malfunctioning = FALSE + process() + /obj/machinery/door/window/tram/proc/cycle_doors(command, forced=FALSE) if(command == "open" && icon_state == "[base_state]open") if(!forced) @@ -687,13 +722,6 @@ GLOBAL_LIST_EMPTY(tram_signs) return 1 if(command == "close" && icon_state == base_state) return 1 - if(operating) //doors can still function when emag-disabled - return 0 - if(forced < 2) - if(obj_flags & EMAGGED) - return 0 - if(!operating) //in case of emag - operating = TRUE playsound(src, 'sound/machines/windowdoor.ogg', 100, TRUE) switch(command) if("open") @@ -702,22 +730,25 @@ GLOBAL_LIST_EMPTY(tram_signs) sleep(7 DECISECONDS) set_density(FALSE) air_update_turf(TRUE, FALSE) - if(operating == 1) //emag again - operating = FALSE if("close") + if(obj_flags & EMAGGED | malfunctioning) + flick("[base_state]spark", src) + playsound(src, SFX_SPARKS, 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) + sleep(6 DECISECONDS) do_animate("closing") icon_state = base_state sleep(19 DECISECONDS) - for(var/i=1 to 4) - for(var/mob/living/crushee in get_turf(src)) - if(crushee.dir == NORTH && dir == SOUTH) + if(obj_flags & EMAGGED | malfunctioning) + if(malfunctioning && prob(85)) + return + for(var/i=1 to 3) + for(var/mob/living/crushee in get_turf(src)) crush() - if(crushee.dir == SOUTH && dir == NORTH) - crush() - sleep(1 DECISECONDS) + sleep(2 DECISECONDS) air_update_turf(TRUE, TRUE) operating = FALSE set_density(TRUE) + update_freelook_sight() return 1 @@ -740,8 +771,13 @@ GLOBAL_LIST_EMPTY(tram_signs) . = ..() RemoveElement(/datum/element/atmos_sensitive, mapload) INVOKE_ASYNC(src, PROC_REF(open)) + GLOB.tram_doors += src find_tram() +/obj/machinery/door/window/tram/Destroy() + GLOB.tram_doors -= src + return ..() + /obj/machinery/door/window/tram/examine(mob/user) . = ..() . += span_notice("It has labels indicating that it has an emergency mechanism to open from the inside using just your hands in the event of an emergency.") diff --git a/code/modules/industrial_lift/tram/tram_structures.dm b/code/modules/industrial_lift/tram/tram_structures.dm new file mode 100644 index 00000000000..81c80e135ae --- /dev/null +++ b/code/modules/industrial_lift/tram/tram_structures.dm @@ -0,0 +1,22 @@ +/obj/structure/chair/sofa/bench/tram + name = "bench" + desc = "Perfectly designed to be comfortable to sit on, and hellish to sleep on." + icon_state = "bench_middle" + greyscale_config = /datum/greyscale_config/bench_middle + greyscale_colors = "#00CCFF" + +/obj/structure/chair/sofa/bench/tram/left + icon_state = "bench_left" + greyscale_config = /datum/greyscale_config/bench_left + +/obj/structure/chair/sofa/bench/tram/right + icon_state = "bench_right" + greyscale_config = /datum/greyscale_config/bench_right + +/obj/structure/chair/sofa/bench/tram/corner + icon_state = "bench_corner" + greyscale_config = /datum/greyscale_config/bench_corner + +/obj/structure/chair/sofa/bench/tram/solo + icon_state = "bench_solo" + greyscale_config = /datum/greyscale_config/bench_solo diff --git a/icons/obj/doors/tramdoor.dmi b/icons/obj/doors/tramdoor.dmi index d96b2e1fe30..8ca8c9aee49 100644 Binary files a/icons/obj/doors/tramdoor.dmi and b/icons/obj/doors/tramdoor.dmi differ diff --git a/icons/obj/machines/crossing_signal.dmi b/icons/obj/machines/crossing_signal.dmi index 172f202dd66..4e31966f7e4 100644 Binary files a/icons/obj/machines/crossing_signal.dmi and b/icons/obj/machines/crossing_signal.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 123e1a43827..925fcb53462 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3423,6 +3423,7 @@ #include "code\modules\industrial_lift\tram\tram_lift_master.dm" #include "code\modules\industrial_lift\tram\tram_machinery.dm" #include "code\modules\industrial_lift\tram\tram_override_objects.dm" +#include "code\modules\industrial_lift\tram\tram_structures.dm" #include "code\modules\industrial_lift\tram\tram_walls.dm" #include "code\modules\industrial_lift\tram\tram_windows.dm" #include "code\modules\instruments\items.dm"