mirror of
https://github.com/CHOMPstation/CHOMPstation.git
synced 2026-08-26 21:46:51 +01:00
Consolidated digital t-valves type paths.
- Because mirroring is now *much* easier to setup than digital remote control, we reverse the order of inheritance to de-duplicate all the radio code from digital t-valves!
- This requires changing the following type paths:
/obj/machinery/atmospherics/tvalve/mirrored/digital -> /obj/machinery/atmospherics/tvalve/digital/mirrored
/obj/machinery/atmospherics/tvalve/mirrored/digital/bypass -> /obj/machinery/atmospherics/tvalve/digital/mirrored/bypass
- Change made on all maps.
- We can eliminate any overriden methods at all on flipped trinary devices by making a `mirrored` and `tee` variable! This allows us to do things like flip them without delete/spawning.
- T-Valves are also basically trinary. Sadly they are not a subtype, so to share code with them I have to put it into an outside proc. But still worth it.
This commit is contained in:
@@ -359,73 +359,10 @@
|
||||
icon_state = "map_tvalvem1"
|
||||
state = 1
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital // can be controlled by AI
|
||||
name = "digital switching valve"
|
||||
desc = "A digitally controlled valve."
|
||||
icon = 'icons/atmos/digital_tvalve.dmi'
|
||||
/obj/machinery/atmospherics/tvalve/digital/mirrored
|
||||
icon_state = "map_tvalvem0"
|
||||
mirrored = TRUE
|
||||
|
||||
var/frequency = 0
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital/Destroy()
|
||||
unregister_radio(src, frequency)
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital/bypass
|
||||
/obj/machinery/atmospherics/tvalve/digital/mirrored/bypass
|
||||
icon_state = "map_tvalvem1"
|
||||
state = 1
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital/update_icon()
|
||||
..()
|
||||
if(!powered())
|
||||
icon_state = "tvalvemnopower"
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital/attack_hand(mob/user as mob)
|
||||
if(!powered())
|
||||
return
|
||||
if(!src.allowed(user))
|
||||
to_chat(user, "<span class='warning'>Access denied.</span>")
|
||||
return
|
||||
..()
|
||||
|
||||
//Radio remote control -eh?
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA)
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital/initialize()
|
||||
. = ..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id))
|
||||
return 0
|
||||
|
||||
switch(signal.data["command"])
|
||||
if("valve_open")
|
||||
if(!state)
|
||||
go_to_side()
|
||||
|
||||
if("valve_close")
|
||||
if(state)
|
||||
go_straight()
|
||||
|
||||
if("valve_toggle")
|
||||
if(state)
|
||||
go_straight()
|
||||
else
|
||||
go_to_side()
|
||||
|
||||
@@ -145,7 +145,7 @@ Buildable meters
|
||||
src.pipe_type = PIPE_PASSIVE_GATE
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/unary/heat_exchanger))
|
||||
src.pipe_type = PIPE_HEAT_EXCHANGE
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/tvalve/mirrored/digital))
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/tvalve/digital/mirrored))
|
||||
src.pipe_type = PIPE_DTVALVEM
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/tvalve/mirrored))
|
||||
src.pipe_type = PIPE_MTVALVEM
|
||||
@@ -1105,7 +1105,7 @@ Buildable meters
|
||||
V.node3.build_network()
|
||||
|
||||
if(PIPE_DTVALVEM) //mirrored digital t-valve
|
||||
var/obj/machinery/atmospherics/tvalve/mirrored/digital/V = new(src.loc)
|
||||
var/obj/machinery/atmospherics/tvalve/digital/mirrored/V = new(src.loc)
|
||||
if(src.req_access)
|
||||
V.req_access = src.req_access
|
||||
if(src.req_one_access)
|
||||
|
||||
@@ -2643,7 +2643,7 @@
|
||||
"aYQ" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 8},/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 1},/obj/machinery/door/firedoor/border_only,/obj/machinery/atmospherics/pipe/simple/hidden/red{tag = "icon-intact (EAST)"; icon_state = "intact"; dir = 4},/turf/simulated/floor/plating,/area/maintenance/engineering/pumpstation)
|
||||
"aYR" = (/obj/machinery/atmospherics/pipe/simple/visible/red{tag = "icon-intact (EAST)"; icon_state = "intact"; dir = 4},/turf/simulated/floor/tiled,/area/maintenance/engineering/pumpstation)
|
||||
"aYS" = (/obj/machinery/atmospherics/pipe/simple/hidden/supply,/obj/machinery/atmospherics/pipe/simple/visible/red{tag = "icon-intact (EAST)"; icon_state = "intact"; dir = 4},/turf/simulated/floor/tiled,/area/maintenance/engineering/pumpstation)
|
||||
"aYT" = (/obj/machinery/atmospherics/tvalve/mirrored/digital/bypass{dir = 4},/obj/machinery/camera/network/engineering{c_tag = "ENG - Pump Station"; dir = 1},/obj/structure/extinguisher_cabinet{pixel_x = 5; pixel_y = -32},/turf/simulated/floor/tiled,/area/maintenance/engineering/pumpstation)
|
||||
"aYT" = (/obj/machinery/atmospherics/tvalve/digital/mirrored/bypass{dir = 4},/obj/machinery/camera/network/engineering{c_tag = "ENG - Pump Station"; dir = 1},/obj/structure/extinguisher_cabinet{pixel_x = 5; pixel_y = -32},/turf/simulated/floor/tiled,/area/maintenance/engineering/pumpstation)
|
||||
"aYU" = (/obj/machinery/atmospherics/binary/pump{dir = 4},/turf/simulated/floor/tiled,/area/maintenance/engineering/pumpstation)
|
||||
"aYV" = (/obj/machinery/atmospherics/pipe/manifold/visible/red,/turf/simulated/floor/tiled,/area/maintenance/engineering/pumpstation)
|
||||
"aYW" = (/obj/random/maintenance/research,/obj/random/maintenance/research,/obj/random/junk,/turf/simulated/floor,/area/maintenance/research_shuttle)
|
||||
@@ -8600,7 +8600,7 @@
|
||||
"djt" = (/obj/machinery/atmospherics/pipe/manifold/visible/green{dir = 8},/turf/simulated/floor/tiled,/area/engineering/atmos)
|
||||
"dju" = (/obj/machinery/atmospherics/pipe/simple/visible/red,/obj/machinery/atmospherics/binary/pump{dir = 4; name = "N2 to Mixing"},/turf/simulated/floor/tiled,/area/engineering/atmos)
|
||||
"djv" = (/obj/machinery/atmospherics/pipe/manifold/visible/green{tag = "icon-map (EAST)"; icon_state = "map"; dir = 4},/turf/simulated/floor/tiled,/area/engineering/atmos)
|
||||
"djw" = (/obj/machinery/atmospherics/tvalve/mirrored/digital{name = "Waste to Space"},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"},/turf/simulated/floor/tiled,/area/engineering/atmos)
|
||||
"djw" = (/obj/machinery/atmospherics/tvalve/digital/mirrored{name = "Waste to Space"},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"},/turf/simulated/floor/tiled,/area/engineering/atmos)
|
||||
"djx" = (/obj/machinery/atmospherics/pipe/simple/visible/red{tag = "icon-intact (SOUTHWEST)"; icon_state = "intact"; dir = 10},/obj/machinery/meter,/turf/simulated/floor/tiled,/area/engineering/atmos)
|
||||
"djy" = (/obj/machinery/atmospherics/pipe/simple/visible/red,/turf/simulated/floor/tiled,/area/engineering/atmos)
|
||||
"djz" = (/obj/machinery/atmospherics/valve/digital,/turf/simulated/floor/tiled,/area/engineering/atmos)
|
||||
|
||||
Reference in New Issue
Block a user