mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Adds reversed trinaries and digital tvalve.
This commit is contained in:
@@ -5,6 +5,8 @@ obj/machinery/atmospherics/trinary/filter
|
||||
|
||||
name = "Gas filter"
|
||||
|
||||
mirror = /obj/machinery/atmospherics/trinary/filter/mirrored
|
||||
|
||||
var/on = 0
|
||||
var/temp = null // -- TLE
|
||||
|
||||
@@ -235,3 +237,25 @@ obj/machinery/atmospherics/trinary/filter/Topic(href, href_list) // -- TLE
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/trinary/filter/mirrored
|
||||
icon_state = "intactm_off"
|
||||
|
||||
/obj/machinery/atmospherics/trinary/filter/mirrored/initialize()
|
||||
if(node1 && node2 && node3) return
|
||||
|
||||
node1 = findConnecting(dir)
|
||||
node2 = findConnecting(turn(dir, -90))
|
||||
node3 = findConnecting(turn(dir, -180))
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/trinary/filter/mirrored/update_icon()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "intactm_off"
|
||||
else if(node2 && node3 && node1)
|
||||
icon_state = "intactm_[on?("on"):("off")]"
|
||||
else
|
||||
icon_state = "intactm_off"
|
||||
on = 0
|
||||
|
||||
return
|
||||
@@ -5,6 +5,8 @@ obj/machinery/atmospherics/trinary/mixer
|
||||
|
||||
name = "Gas mixer"
|
||||
|
||||
mirror = /obj/machinery/atmospherics/trinary/mixer/mirrored
|
||||
|
||||
var/on = 0
|
||||
|
||||
var/target_pressure = ONE_ATMOSPHERE
|
||||
@@ -160,3 +162,26 @@ obj/machinery/atmospherics/trinary/mixer
|
||||
src.update_icon()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/trinary/mixer/mirrored
|
||||
icon_state = "intactm_off"
|
||||
|
||||
/obj/machinery/atmospherics/trinary/mixer/mirrored/update_icon()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "intactm_off"
|
||||
else if(node2 && node3 && node1)
|
||||
icon_state = "intactm_[on?("on"):("off")]"
|
||||
else
|
||||
icon_state = "intactm_off"
|
||||
on = 0
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/trinary/mixer/mirrored/initialize()
|
||||
if(node1 && node2 && node3) return
|
||||
|
||||
node1 = findConnecting(dir)
|
||||
node2 = findConnecting(turn(dir, -90))
|
||||
node3 = findConnecting(turn(dir, -180))
|
||||
|
||||
update_icon()
|
||||
|
||||
@@ -35,6 +35,11 @@ obj/machinery/atmospherics/trinary
|
||||
air3.volume = 200
|
||||
|
||||
buildFrom(var/mob/usr,var/obj/item/pipe/pipe)
|
||||
if(!(pipe.dir in list(NORTH, SOUTH, EAST, WEST)) && src.mirror) //because the dir isn't in the right set, we want to make the mirror kind
|
||||
var/obj/machinery/atmospherics/trinary/mirrored_pipe = new mirror(src.loc)
|
||||
pipe.dir = turn(pipe.dir, -45)
|
||||
qdel(src)
|
||||
return mirrored_pipe.buildFrom(usr, pipe)
|
||||
dir = pipe.dir
|
||||
initialize_directions = pipe.get_pipe_dir()
|
||||
if (pipe.pipename)
|
||||
|
||||
@@ -8,6 +8,8 @@ obj/machinery/atmospherics/tvalve
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH|WEST
|
||||
|
||||
mirror = /obj/machinery/atmospherics/tvalve/mirrored
|
||||
|
||||
state = 0 // 0 = go straight, 1 = go to side
|
||||
|
||||
// like a trinary component, node1 is input, node2 is side output, node3 is straight output
|
||||
@@ -30,6 +32,11 @@ obj/machinery/atmospherics/tvalve
|
||||
..()
|
||||
|
||||
buildFrom(var/mob/usr,var/obj/item/pipe/pipe)
|
||||
if(!(pipe.dir in list(NORTH, SOUTH, EAST, WEST)) && src.mirror)
|
||||
var/obj/machinery/atmospherics/tvalve/mirrored_pipe = new mirror(src.loc)
|
||||
pipe.dir = turn(pipe.dir, -45)
|
||||
qdel(src)
|
||||
return mirrored_pipe.buildFrom(usr, pipe)
|
||||
dir = pipe.dir
|
||||
initialize_directions = pipe.get_pipe_dir()
|
||||
if (pipe.pipename)
|
||||
@@ -272,6 +279,8 @@ obj/machinery/atmospherics/tvalve
|
||||
desc = "A digitally controlled valve."
|
||||
icon = 'icons/obj/atmospherics/digital_valve.dmi'
|
||||
|
||||
mirror = /obj/machinery/atmospherics/tvalve/mirrored/digital
|
||||
|
||||
attack_ai(mob/user as mob)
|
||||
src.add_hiddenprint(user)
|
||||
return src.attack_hand(user)
|
||||
@@ -322,9 +331,6 @@ obj/machinery/atmospherics/tvalve
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (istype(src, /obj/machinery/atmospherics/tvalve/digital))
|
||||
user << "\red You cannot unwrench this [src], it's too complicated."
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
|
||||
Reference in New Issue
Block a user