You can no longer stack multiple windows of the same dir on a tile

This commit is contained in:
Joan Lung
2017-01-22 13:43:39 -05:00
parent 4b4ea3711a
commit 0633e79042
7 changed files with 145 additions and 215 deletions
@@ -16,7 +16,7 @@
icon_state = "l_windoor_assembly01"
anchored = 0
density = 0
setDir(NORTH)
dir = NORTH
var/ini_dir
var/obj/item/weapon/electronics/airlock/electronics = null
@@ -32,8 +32,10 @@
..()
user << "<span class='notice'>Alt-click to rotate it clockwise.</span>"
/obj/structure/windoor_assembly/New(dir=NORTH)
/obj/structure/windoor_assembly/New(loc, set_dir)
..()
if(set_dir)
dir = set_dir
ini_dir = dir
air_update_turf(1)
@@ -45,6 +47,7 @@
/obj/structure/windoor_assembly/Move()
var/turf/T = loc
..()
setDir(ini_dir)
move_update_air(T)
/obj/structure/windoor_assembly/update_icon()
@@ -55,8 +58,17 @@
return 1
if(get_dir(loc, target) == dir) //Make sure looking at appropriate border
return !density
else
return 1
if(istype(mover, /obj/structure/window))
var/obj/structure/window/W = mover
if(!valid_window_location(loc, W.ini_dir))
return FALSE
else if(istype(mover, /obj/structure/windoor_assembly))
var/obj/structure/windoor_assembly/W = mover
if(!valid_window_location(loc, W.ini_dir))
return FALSE
else if(istype(mover, /obj/machinery/door/window) && !valid_window_location(loc, mover.dir))
return FALSE
return 1
/obj/structure/windoor_assembly/CanAtmosPass(turf/T)
if(get_dir(loc, T) == dir)
@@ -313,20 +325,21 @@
set src in oview(1)
if(usr.stat || !usr.canmove || usr.restrained())
return
if (anchored)
if(anchored)
usr << "<span class='warning'>[src] cannot be rotated while it is fastened to the floor!</span>"
return 0
//if(state != "01")
//update_nearby_tiles(need_rebuild=1) //Compel updates before
return FALSE
setDir(turn(dir, 270))
var/target_dir = turn(dir, 270)
//if(state != "01")
//update_nearby_tiles(need_rebuild=1)
if(!valid_window_location(loc, target_dir))
usr << "<span class='warning'>[src] cannot be rotated in that direction!</span>"
return FALSE
setDir(target_dir)
ini_dir = dir
update_icon()
return
return TRUE
/obj/structure/windoor_assembly/AltClick(mob/user)
..()
+48 -10
View File
@@ -55,7 +55,6 @@
if(rods)
debris += new /obj/item/stack/rods(src, rods)
/obj/structure/window/narsie_act()
add_atom_colour(NARSIE_WINDOW_COLOUR, FIXED_COLOUR_PRIORITY)
for(var/obj/item/weapon/shard/shard in debris)
@@ -85,9 +84,17 @@
return 0 //full tile window, you can't move into it!
if(get_dir(loc, target) == dir)
return !density
else
return 1
if(istype(mover, /obj/structure/window))
var/obj/structure/window/W = mover
if(!valid_window_location(loc, W.ini_dir))
return FALSE
else if(istype(mover, /obj/structure/windoor_assembly))
var/obj/structure/windoor_assembly/W = mover
if(!valid_window_location(loc, W.ini_dir))
return FALSE
else if(istype(mover, /obj/machinery/door/window) && !valid_window_location(loc, mover.dir))
return FALSE
return 1
/obj/structure/window/CheckExit(atom/movable/O as mob|obj, target)
if(istype(O) && O.checkpass(PASSGLASS))
@@ -251,13 +258,19 @@
if(anchored)
usr << "<span class='warning'>[src] cannot be rotated while it is fastened to the floor!</span>"
return 0
return FALSE
setDir(turn(dir, 90))
var/target_dir = turn(dir, 90)
if(!valid_window_location(loc, target_dir))
usr << "<span class='warning'>[src] cannot be rotated in that direction!</span>"
return FALSE
setDir(target_dir)
air_update_turf(1)
ini_dir = dir
add_fingerprint(usr)
return
return TRUE
/obj/structure/window/verb/revrotate()
@@ -270,13 +283,19 @@
if(anchored)
usr << "<span class='warning'>[src] cannot be rotated while it is fastened to the floor!</span>"
return 0
return FALSE
setDir(turn(dir, 270))
var/target_dir = turn(dir, 270)
if(!valid_window_location(loc, target_dir))
usr << "<span class='warning'>[src] cannot be rotated in that direction!</span>"
return FALSE
setDir(target_dir)
air_update_turf(1)
ini_dir = dir
add_fingerprint(usr)
return
return TRUE
/obj/structure/window/AltClick(mob/user)
..()
@@ -348,6 +367,9 @@
return 1
/obj/structure/window/unanchored
anchored = FALSE
/obj/structure/window/reinforced
name = "reinforced window"
icon_state = "rwindow"
@@ -357,6 +379,9 @@
explosion_block = 1
glass_type = /obj/item/stack/sheet/rglass
/obj/structure/window/reinforced/unanchored
anchored = FALSE
/obj/structure/window/reinforced/tinted
name = "tinted window"
icon_state = "twindow"
@@ -379,6 +404,9 @@
canSmoothWith = list(/obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile, /obj/structure/window/reinforced/tinted/fulltile)
glass_amount = 2
/obj/structure/window/fulltile/unanchored
anchored = FALSE
/obj/structure/window/reinforced/fulltile
icon = 'icons/obj/smooth_structures/reinforced_window.dmi'
icon_state = "r_window"
@@ -390,6 +418,9 @@
level = 3
glass_amount = 2
/obj/structure/window/reinforced/fulltile/unanchored
anchored = FALSE
/obj/structure/window/reinforced/tinted/fulltile
icon = 'icons/obj/smooth_structures/tinted_window.dmi'
icon_state = "tinted_window"
@@ -455,6 +486,7 @@
if(direct)
var/obj/effect/E = PoolOrNew(/obj/effect/overlay/temp/ratvar/window/single, get_turf(src))
setDir(direct)
ini_dir = direct
E.setDir(direct)
made_glow = TRUE
else
@@ -488,6 +520,9 @@
animate(src, color = previouscolor, time = 8)
addtimer(CALLBACK(src, /atom/proc/update_atom_colour), 8)
/obj/structure/window/reinforced/clockwork/unanchored
anchored = FALSE
/obj/structure/window/reinforced/clockwork/fulltile
icon_state = "clockwork_window"
smooth = SMOOTH_TRUE
@@ -498,3 +533,6 @@
level = 3
glass_amount = 2
made_glow = TRUE
/obj/structure/window/reinforced/clockwork/fulltile/unanchored
anchored = FALSE