mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Rewrite of machine code
- The most common attackbys now use a common proc and a flag system - The following flags now exist : EMAGGABLE, SCREWTOGGLE, CROWDESTROY, WRENCHMOVE, FIXED2WORK - Machines have had flags appropriately added with inherited procs to replace copied code
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
|
||||
density = 1
|
||||
|
||||
machine_flags = WRENCHMOVE | FIXED2WORK
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/New()
|
||||
..()
|
||||
desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]."
|
||||
@@ -70,38 +72,32 @@
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
anchored = !anchored
|
||||
user << "\blue You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor."
|
||||
|
||||
if(anchored)
|
||||
if(dir & (NORTH|SOUTH))
|
||||
initialize_directions = NORTH|SOUTH
|
||||
else if(dir & (EAST|WEST))
|
||||
initialize_directions = EAST|WEST
|
||||
|
||||
initialize()
|
||||
build_network()
|
||||
if (node1)
|
||||
node1.initialize()
|
||||
node1.build_network()
|
||||
if (node2)
|
||||
node2.initialize()
|
||||
node2.build_network()
|
||||
else
|
||||
if(node1)
|
||||
node1.disconnect(src)
|
||||
del(network1)
|
||||
if(node2)
|
||||
node2.disconnect(src)
|
||||
del(network2)
|
||||
|
||||
node1 = null
|
||||
node2 = null
|
||||
/obj/machinery/atmospherics/binary/circulator/wrenchAnchor(mob/user)
|
||||
..()
|
||||
if(anchored)
|
||||
if(dir & (NORTH|SOUTH))
|
||||
initialize_directions = NORTH|SOUTH
|
||||
else if(dir & (EAST|WEST))
|
||||
initialize_directions = EAST|WEST
|
||||
|
||||
initialize()
|
||||
build_network()
|
||||
if (node1)
|
||||
node1.initialize()
|
||||
node1.build_network()
|
||||
if (node2)
|
||||
node2.initialize()
|
||||
node2.build_network()
|
||||
else
|
||||
..()
|
||||
if(node1)
|
||||
node1.disconnect(src)
|
||||
del(network1)
|
||||
if(node2)
|
||||
node2.disconnect(src)
|
||||
del(network2)
|
||||
|
||||
node1 = null
|
||||
node2 = null
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/verb/rotate_clockwise()
|
||||
set category = "Object"
|
||||
|
||||
Reference in New Issue
Block a user