Requested changes

This commit is contained in:
phil235
2016-11-03 19:03:04 +01:00
parent 7959535d05
commit b0b5a90bd7
7 changed files with 65 additions and 55 deletions
@@ -3,10 +3,6 @@
// Mappers: use "Generate Instances from Directions" for this
// one.
#define STATION_TUBE_OPEN 0
#define STATION_TUBE_OPENING 1
#define STATION_TUBE_CLOSED 2
#define STATION_TUBE_CLOSING 3
/obj/structure/transit_tube/station
name = "station tube station"
@@ -22,7 +22,7 @@
if(newdirection)
setDir(newdirection)
init_tube_dirs()
generate_decorative_tubes()
generate_tube_overlays()
/obj/structure/transit_tube/Destroy()
for(var/obj/structure/transit_tube_pod/P in loc)
@@ -115,11 +115,6 @@
return enter_delay
// Parse the icon_state into a list of directions.
// This means that mappers can use Dream Maker's built in
// "Generate Instances from Icon-states" option to get all
// variations. Additionally, as a separate proc, sub-types
// can handle it more intelligently.
/obj/structure/transit_tube/proc/init_tube_dirs()
switch(dir)
if(NORTH)
@@ -132,29 +127,22 @@
tube_dirs = list(EAST, WEST)
//phil235 must deconstruct on Move()
//phil235 remember to update the maps!
// Look for diagonal directions, generate the decorative corners in each.
/obj/structure/transit_tube/proc/generate_decorative_tubes()
/obj/structure/transit_tube/proc/generate_tube_overlays()
for(var/direction in tube_dirs)
if(direction in diagonals)
if(direction & NORTH)
create_decorative_tube(direction ^ 3, NORTH)
// else
// create_decorative_tube(direction ^ 3, SOUTH)
create_tube_overlay(direction ^ 3, NORTH)
if(direction & EAST)
create_decorative_tube(direction ^ 12, EAST)
create_tube_overlay(direction ^ 12, EAST)
else
create_decorative_tube(direction ^ 12, WEST)
create_tube_overlay(direction ^ 12, WEST)
else
create_decorative_tube(direction)
create_tube_overlay(direction)
// Generate a corner, if one doesn't exist for the direction on the turf.
/obj/structure/transit_tube/proc/create_decorative_tube(direction, shift_dir)
/obj/structure/transit_tube/proc/create_tube_overlay(direction, shift_dir)
var/image/I
if(shift_dir)
I = image(loc = src, icon_state = "decorative_diag", dir = direction)
@@ -176,7 +164,7 @@
//Some of these are mostly for mapping use
/obj/structure/transit_tube/horizontal
dir = 8
dir = WEST
/obj/structure/transit_tube/diagonal
@@ -194,9 +182,18 @@
if(WEST)
tube_dirs = list(NORTHWEST, SOUTHEAST)
//mostly for mapping use
/obj/structure/transit_tube/diagonal/topleft
dir = 8
dir = WEST
/obj/structure/transit_tube/diagonal/crossing
density = 0
icon_state = "diagonal_crossing"
tube_construction = /obj/structure/c_transit_tube/diagonal/crossing
//mostly for mapping use
/obj/structure/transit_tube/diagonal/crossing/topleft
dir = WEST
/obj/structure/transit_tube/curved
@@ -266,5 +263,6 @@
tube_construction = /obj/structure/c_transit_tube/crossing
density = 0
//mostly for mapping use
/obj/structure/transit_tube/crossing/horizontal
dir = 8
dir = WEST
@@ -4,7 +4,7 @@
/obj/structure/c_transit_tube
name = "unattached transit tube"
icon = 'icons/obj/atmospherics/pipes/transit_tube.dmi'
icon_state = "straight" //icon_state decides which tube will be built
icon_state = "straight"
density = 0
layer = LOW_ITEM_LAYER //same as the built tube
anchored = 0
@@ -23,9 +23,7 @@
/obj/structure/c_transit_tube/proc/tube_flip()
if(flipped_build_type)
flipped = !flipped
var/cur_flip = flipped
if(initial(flipped))
cur_flip = !cur_flip
var/cur_flip = initial(flipped) ? !flipped : flipped
if(cur_flip)
build_type = flipped_build_type
else
@@ -52,8 +50,7 @@
return
if(!in_range(src, user))
return
else
tube_rotate()
tube_rotate()
/obj/structure/c_transit_tube/verb/flip()
set name = "Flip"
@@ -119,6 +116,10 @@
icon_state = "diagonal"
build_type = /obj/structure/transit_tube/diagonal
/obj/structure/c_transit_tube/diagonal/crossing
icon_state = "diagonal_crossing"
build_type = /obj/structure/transit_tube/diagonal/crossing
/obj/structure/c_transit_tube/curved
icon_state = "curved0"
@@ -214,8 +214,3 @@
if(TT.has_exit(direction))
setDir(direction)
return
#undef STATION_TUBE_OPEN
#undef STATION_TUBE_OPENING
#undef STATION_TUBE_CLOSED
#undef STATION_TUBE_CLOSING