From 9227481a8ad9da1ff109acc3f127b0211824daa2 Mon Sep 17 00:00:00 2001
From: Rob Nelson
Date: Tue, 18 Feb 2014 14:44:37 -0800
Subject: [PATCH] Standardize windows.
Conflicts:
code/WorkInProgress/buildmode.dm
code/game/machinery/doors/airlock.dm
code/game/objects/items/stacks/sheets/glass.dm
code/game/objects/items/weapons/twohanded.dm
code/game/objects/structures/window.dm
code/modules/mining/mine_items.dm
code/modules/mob/living/carbon/metroid/metroid.dm
code/modules/mob/living/simple_animal/constructs.dm
code/modules/mob/living/simple_animal/friendly/corgi.dm
---
baystation12.dme | 1 +
code/WorkInProgress/Cael_Aislinn/sculpture.dm | 4 +-
code/WorkInProgress/buildmode.dm | 34 +++---
code/__HELPERS/unsorted.dm | 2 +-
code/_onclick/adjacent.dm | 2 +-
code/game/gamemodes/vampire/vampire_powers.dm | 4 +-
code/game/machinery/bots/bots.dm | 2 +-
code/game/machinery/doors/airlock.dm | 12 +-
code/game/objects/items/blueprints.dm | 4 +-
.../game/objects/items/stacks/sheets/glass.dm | 88 +++-----------
code/game/objects/items/weapons/twohanded.dm | 18 +--
code/game/objects/structures/fullwindow.dm | 96 +++++++++++++++
code/game/objects/structures/window.dm | 112 +++++-------------
code/modules/admin/verbs/mapping.dm | 6 +-
code/modules/liquid/splash_simulation.dm | 4 +-
code/modules/mining/mine_items.dm | 15 ++-
.../living/carbon/alien/humanoid/humanoid.dm | 9 +-
code/modules/mob/living/carbon/human/human.dm | 9 +-
.../mob/living/carbon/metroid/metroid.dm | 13 +-
.../mob/living/carbon/monkey/monkey.dm | 9 +-
code/modules/mob/living/living.dm | 7 +-
.../modules/mob/living/silicon/robot/robot.dm | 9 +-
.../mob/living/simple_animal/constructs.dm | 10 +-
.../living/simple_animal/friendly/corgi.dm | 11 +-
.../living/simple_animal/friendly/slime.dm | 9 +-
25 files changed, 239 insertions(+), 251 deletions(-)
create mode 100644 code/game/objects/structures/fullwindow.dm
diff --git a/baystation12.dme b/baystation12.dme
index 9259969a507..8d371af126a 100644
--- a/baystation12.dme
+++ b/baystation12.dme
@@ -650,6 +650,7 @@
#include "code\game\objects\structures\extinguisher.dm"
#include "code\game\objects\structures\false_walls.dm"
#include "code\game\objects\structures\flora.dm"
+#include "code\game\objects\structures\fullwindow.dm"
#include "code\game\objects\structures\girders.dm"
#include "code\game\objects\structures\grille.dm"
#include "code\game\objects\structures\inflatable.dm"
diff --git a/code/WorkInProgress/Cael_Aislinn/sculpture.dm b/code/WorkInProgress/Cael_Aislinn/sculpture.dm
index 0a1b14d1ae0..4589583f96b 100644
--- a/code/WorkInProgress/Cael_Aislinn/sculpture.dm
+++ b/code/WorkInProgress/Cael_Aislinn/sculpture.dm
@@ -185,7 +185,7 @@
var/num_turfs = get_dist(src,target_mob)
while(get_turf(src) != target_turf && num_turfs > 0)
for(var/obj/structure/window/W in next_turf)
- W.ex_act(2)
+ W.destroy()
for(var/obj/structure/table/O in next_turf)
O.ex_act(1)
for(var/obj/structure/grille/G in next_turf)
@@ -225,7 +225,7 @@
var/num_turfs = get_dist(src,target_turf)
while(get_turf(src) != target_turf && num_turfs > 0)
for(var/obj/structure/window/W in next_turf)
- W.ex_act(2)
+ W.destroy()
for(var/obj/structure/table/O in next_turf)
O.ex_act(1)
for(var/obj/structure/grille/G in next_turf)
diff --git a/code/WorkInProgress/buildmode.dm b/code/WorkInProgress/buildmode.dm
index 6d3509db6e0..f5474e8a8b2 100644
--- a/code/WorkInProgress/buildmode.dm
+++ b/code/WorkInProgress/buildmode.dm
@@ -54,8 +54,8 @@
if(SOUTH)
dir = WEST
if(WEST)
- dir = NORTHWEST
- if(NORTHWEST)
+ dir = SOUTHWEST
+ if(SOUTHWEST)
dir = NORTH
return 1
@@ -120,7 +120,7 @@
screen_loc = "NORTH,WEST+2"
var/varholder = "name"
var/valueholder = "derp"
- var/objholder = "/obj/structure/closet"
+ var/objholder = /obj/structure/closet
Click(location, control, params)
var/list/pa = params2list(params)
@@ -145,13 +145,13 @@
if(1)
return 1
if(2)
- objholder = input(usr,"Enter typepath:" ,"Typepath","/obj/structure/closet")
- var/list/removed_paths = list("/obj/effect/bhole")
- if(objholder in removed_paths)
+ objholder = text2path(input(usr,"Enter typepath:" ,"Typepath","/obj/structure/closet"))
+ if(!ispath(objholder))
+ objholder = /obj/structure/closet
alert("That path is not allowed.")
- objholder = "/obj/structure/closet"
- else if (dd_hasprefix(objholder, "/mob") && !check_rights(R_DEBUG,0))
- objholder = "/obj/structure/closet"
+ else
+ if(ispath(objholder,/mob) && !check_rights(R_DEBUG,0))
+ objholder = /obj/structure/closet
if(3)
var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "viruses", "cuffed", "ka", "last_eaten", "urine")
@@ -171,7 +171,8 @@
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value") as obj in world
if("turf-reference")
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value") as turf in world
- return 1
+ return 1
+
/proc/build_click(var/mob/user, buildmode, params, var/obj/object)
var/obj/effect/bmode/buildholder/holder = null
@@ -229,13 +230,16 @@
if(WEST)
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
WIN.dir = WEST
- if(NORTHWEST)
- var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
- WIN.dir = NORTHWEST
+ if(SOUTHWEST)
+ new/obj/structure/window/full/reinforced(get_turf(object))
if(2)
if(pa.Find("left"))
- var/obj/A = new holder.buildmode.objholder (get_turf(object))
- A.dir = holder.builddir.dir
+ if(ispath(holder.buildmode.objholder,/turf))
+ var/turf/T = get_turf(object)
+ T.ChangeTurf(holder.buildmode.objholder)
+ else
+ var/obj/A = new holder.buildmode.objholder (get_turf(object))
+ A.dir = holder.builddir.dir
else if(pa.Find("right"))
if(isobj(object)) del(object)
diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm
index e1a70bb3a14..f94da8b6995 100644
--- a/code/__HELPERS/unsorted.dm
+++ b/code/__HELPERS/unsorted.dm
@@ -172,7 +172,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
/proc/DirBlocked(turf/loc,var/dir)
for(var/obj/structure/window/D in loc)
if(!D.density) continue
- if(D.dir == SOUTHWEST) return 1
+ if(D.is_fulltile()) return 1
if(D.dir == dir) return 1
for(var/obj/machinery/door/D in loc)
diff --git a/code/_onclick/adjacent.dm b/code/_onclick/adjacent.dm
index c02737400ba..b39df751896 100644
--- a/code/_onclick/adjacent.dm
+++ b/code/_onclick/adjacent.dm
@@ -46,7 +46,7 @@
continue // could not leave T0 in that direction
var/turf/T1 = get_step(T0,d)
- if(!T1 || T1.density || !T1.ClickCross(get_dir(T1,T0) & get_dir(T1,src), border_only = 0))
+ if(!T1 || T1.density || !T1.ClickCross(get_dir(T1,T0) | get_dir(T1,src), border_only = 0))
continue // couldn't enter or couldn't leave T1
if(!src.ClickCross(get_dir(src,T1), border_only = 1, target_atom = target))
diff --git a/code/game/gamemodes/vampire/vampire_powers.dm b/code/game/gamemodes/vampire/vampire_powers.dm
index fa7f7698a2c..7aa1d28f7ea 100644
--- a/code/game/gamemodes/vampire/vampire_powers.dm
+++ b/code/game/gamemodes/vampire/vampire_powers.dm
@@ -222,9 +222,7 @@
C.Stun(8)
C.Jitter(150)
for(var/obj/structure/window/W in oview(3))
- new W.shardtype(W.loc)
- if(W.reinf) new /obj/item/stack/rods(W.loc)
- del(W)
+ W.destroy()
playsound(M.current.loc, 'sound/effects/creepyshriek.ogg', 100, 1)
M.current.remove_vampire_blood(30)
M.current.verbs -= /client/vampire/proc/vampire_screech
diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm
index 38834b4ef6a..d281fb57308 100644
--- a/code/game/machinery/bots/bots.dm
+++ b/code/game/machinery/bots/bots.dm
@@ -210,7 +210,7 @@
/proc/DirBlockedWithAccess(turf/loc,var/dir,var/obj/item/weapon/card/id/ID)
for(var/obj/structure/window/D in loc)
if(!D.density) continue
- if(D.dir == SOUTHWEST) return 1
+ if(D.is_fulltile()) return 1
if(D.dir == dir) return 1
for(var/obj/machinery/door/D in loc)
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 27f5560fa03..6d53efc796d 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -1079,11 +1079,13 @@ About the new airlock wires panel:
if(istype(src, /obj/machinery/door/airlock/clown))
playsound(src.loc, 'sound/items/bikehorn.ogg', 30, 1)
else
- playsound(src.loc, 'sound/machines/airlock.ogg', 30, 1)
- for(var/turf/turf in locs)
- var/obj/structure/window/killthis = (locate(/obj/structure/window) in turf)
- if(killthis)
- killthis.ex_act(2)//Smashin windows
+ playsound(get_turf(src), 'sound/machines/airlock.ogg', 30, 1)
+
+ for(var/turf/T in loc)
+ var/obj/structure/window/W = locate(/obj/structure/window) in T
+ if (W)
+ W.destroy()
+
..()
return
diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm
index 29ddcc812b4..350ff66dac0 100644
--- a/code/game/objects/items/blueprints.dm
+++ b/code/game/objects/items/blueprints.dm
@@ -199,7 +199,7 @@ move an amendment to the drawing.
for (var/obj/structure/window/W in T2)
if(turn(dir,180) == W.dir)
return BORDER_BETWEEN
- if (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST))
+ if (W.is_fulltile())
return BORDER_2NDTILE
for(var/obj/machinery/door/window/D in T2)
if(turn(dir,180) == D.dir)
@@ -224,7 +224,7 @@ move an amendment to the drawing.
for (var/dir in cardinal)
var/skip = 0
for (var/obj/structure/window/W in T)
- if(dir == W.dir || (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST)))
+ if(dir == W.dir || (W.is_fulltile()))
skip = 1; break
if (skip) continue
for(var/obj/machinery/door/window/D in T)
diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm
index 6c8f6423fa9..77d9b2f85d0 100644
--- a/code/game/objects/items/stacks/sheets/glass.dm
+++ b/code/game/objects/items/stacks/sheets/glass.dm
@@ -18,6 +18,8 @@
icon_state = "sheet-glass"
g_amt = 3750
origin_tech = "materials=1"
+ var/created_window = /obj/structure/window/basic
+ var/full_window = /obj/structure/window/full/basic
/obj/item/stack/sheet/glass/attack_self(mob/user as mob)
@@ -70,7 +72,7 @@
user << "\red There are too many windows in this location."
return 1
directions-=win.dir
- if(!(win.ini_dir in cardinal))
+ if(win.is_fulltile())
user << "\red Can't let you do that."
return 1
@@ -97,13 +99,10 @@
if(src.amount < 2)
user << "\red You need more glass to do that."
return 1
- if(locate(/obj/structure/window) in user.loc)
- user << "\red There is a window in the way."
+ if(locate(/obj/structure/window/full) in user.loc)
+ user << "\red There is a full window in the way."
return 1
- var/obj/structure/window/W
- W = new /obj/structure/window/basic( user.loc, 0 )
- W.dir = SOUTHWEST
- W.ini_dir = SOUTHWEST
+ var/obj/structure/window/W = new full_window( user.loc, 0 )
W.anchored = 0
src.use(2)
return 0
@@ -152,7 +151,7 @@
user << "\red There are too many windows in this location."
return 1
directions-=win.dir
- if(!(win.ini_dir in cardinal))
+ if(win.is_fulltile())
user << "\red Can't let you do that."
return 1
@@ -181,7 +180,7 @@
if(src.amount < 2)
user << "\red You need more glass to do that."
return 1
- if(locate(/obj/structure/window) in user.loc)
+ if(locate(/obj/structure/window/full) in user.loc)
user << "\red There is a window in the way."
return 1
var/obj/structure/window/W
@@ -331,8 +330,11 @@
icon_state = "sheet-plasmaglass"
g_amt = 7500
origin_tech = "materials=3;plasma=2"
+ var/created_window = /obj/structure/window/plasmabasic
+ var/full_window = /obj/structure/window/full/plasmabasic
-/obj/item/stack/sheet/plasmaglass/attack_self(mob/user as mob)
+
+/obj/item/stack/sheet/glass/plasmaglass/attack_self(mob/user as mob)
construct_window(user)
/obj/item/stack/sheet/plasmaglass/attackby(obj/item/W, mob/user)
@@ -419,67 +421,9 @@
g_amt = 7500
m_amt = 1875
origin_tech = "materials=4;plasma=2"
+ var/created_window = /obj/structure/window/plasmareinforced
+ var/full_window = /obj/structure/window/full/plasmareinforced
-/obj/item/stack/sheet/plasmarglass/attack_self(mob/user as mob)
+
+/obj/item/stack/sheet/glass/plasmarglass/attack_self(mob/user as mob)
construct_window(user)
-
-/obj/item/stack/sheet/plasmarglass/proc/construct_window(mob/user as mob)
- if(!user || !src) return 0
- if(!istype(user.loc,/turf)) return 0
- if(!user.IsAdvancedToolUser())
- user << "\red You don't have the dexterity to do this!"
- return 0
- var/title = "Sheet Plasma Reinf. Glass"
- title += " ([src.amount] sheet\s left)"
- switch(input(title, "Would you like full tile glass or a one direction glass pane?") in list("One Direction", "Full Window", "Cancel"))
- if("One Direction")
- if(!src) return 1
- if(src.loc != user) return 1
- var/list/directions = new/list(cardinal)
- var/i = 0
- for (var/obj/structure/window/win in user.loc)
- i++
- if(i >= 4)
- user << "\red There are too many windows in this location."
- return 1
- directions-=win.dir
- if(!(win.ini_dir in cardinal))
- user << "\red Can't let you do that."
- return 1
-
- //Determine the direction. It will first check in the direction the person making the window is facing, if it finds an already made window it will try looking at the next cardinal direction, etc.
- var/dir_to_set = 2
- for(var/direction in list( user.dir, turn(user.dir,90), turn(user.dir,180), turn(user.dir,270) ))
- var/found = 0
- for(var/obj/structure/window/WT in user.loc)
- if(WT.dir == direction)
- found = 1
- if(!found)
- dir_to_set = direction
- break
- var/obj/structure/window/W
- W = new /obj/structure/window/plasmareinforced( user.loc, 1 )
- W.state = 0
- W.dir = dir_to_set
- W.ini_dir = W.dir
- W.anchored = 0
- src.use(1)
- if("Full Window")
- if(!src) return 1
- if(src.loc != user) return 1
- if(src.amount < 2)
- user << "\red You need more glass to do that."
- return 1
- if(locate(/obj/structure/window) in user.loc)
- user << "\red There is a window in the way."
- return 1
- var/obj/structure/window/W
- W = new /obj/structure/window/plasmareinforced( user.loc, 1 )
- W.state = 0
- W.dir = SOUTHWEST
- W.ini_dir = SOUTHWEST
- W.anchored = 0
- src.use(2)
- else
- return 1
- return 0
diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm
index 789acca1ea1..5c865e6c689 100644
--- a/code/game/objects/items/weapons/twohanded.dm
+++ b/code/game/objects/items/weapons/twohanded.dm
@@ -161,16 +161,16 @@ obj/item/weapon/twohanded/
if(!proximity) return
..()
if(A && wielded && (istype(A,/obj/structure/window) || istype(A,/obj/structure/grille))) //destroys windows and grilles in one hit
- if(istype(A,/obj/structure/window)) //should just make a window.Break() proc but couldn't bother with it
+
+ if(istype(A,/obj/structure/window))
+ var/pdiff=performWallPressureCheck(A.loc)
+ if(pdiff>0)
+ message_admins("[A] with pdiff [pdiff] fire-axed by [user.real_name] ([formatPlayerPanel(user,user.ckey)]) at [formatJumpTo(A.loc)]!")
+ log_admin("[A] with pdiff [pdiff] fire-axed by [user.real_name] ([user.ckey]) at [A.loc]!")
var/obj/structure/window/W = A
-
- new /obj/item/weapon/shard( W.loc )
- if(W.reinf) new /obj/item/stack/rods( W.loc)
-
- if (W.dir == SOUTHWEST)
- new /obj/item/weapon/shard( W.loc )
- if(W.reinf) new /obj/item/stack/rods( W.loc)
- del(A)
+ W.destroy()
+ else
+ del(A)
/*
diff --git a/code/game/objects/structures/fullwindow.dm b/code/game/objects/structures/fullwindow.dm
new file mode 100644
index 00000000000..ca5488945f2
--- /dev/null
+++ b/code/game/objects/structures/fullwindow.dm
@@ -0,0 +1,96 @@
+/obj/structure/window/full
+ sheets = 2
+ dir=SOUTHWEST
+
+/obj/structure/window/full/CheckExit(atom/movable/O as mob|obj, target as turf)
+ return 1
+
+/obj/structure/window/full/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
+ if(istype(mover) && mover.checkpass(PASSGLASS))
+ return 1
+ return 0
+
+/obj/structure/window/full/update_nearby_tiles(need_rebuild)
+ if(!air_master) return 0
+ if(!loc) return 0
+
+ var/turf/simulated/source = get_turf(src)
+ if(istype(source))
+ air_master.tiles_to_update |= source
+ for(var/dir in cardinal)
+ var/turf/simulated/target = get_step(source,dir)
+ if(istype(target)) air_master.tiles_to_update |= target
+ return 1
+
+/obj/structure/window/full/is_fulltile()
+ return 1
+
+//merges adjacent full-tile windows into one (blatant ripoff from game/smoothwall.dm)
+/obj/structure/window/full/update_icon()
+ //A little cludge here, since I don't know how it will work with slim windows. Most likely VERY wrong.
+ //this way it will only update full-tile ones
+ //This spawn is here so windows get properly updated when one gets deleted.
+ spawn(2)
+ if(!src) return
+ if(!is_fulltile())
+ return
+ var/junction = 0 //will be used to determine from which side the window is connected to other windows
+ if(anchored)
+ for(var/obj/structure/window/full/W in orange(src,1))
+ if(W.anchored && W.density) //Only counts anchored, not-destroyed full-tile windows.
+ if(abs(x-W.x)-abs(y-W.y) ) //doesn't count windows, placed diagonally to src
+ junction |= get_dir(src,W)
+ icon_state = "[basestate][junction]"
+ return
+
+/obj/structure/window/full/basic
+ desc = "It looks thin and flimsy. A few knocks with... anything, really should shatter it."
+ icon_state = "window"
+ basestate = "window"
+
+/obj/structure/window/full/plasmabasic
+ name = "plasma window"
+ desc = "A plasma-glass alloy window. It looks insanely tough to break. It appears it's also insanely tough to burn through."
+ basestate = "plasmawindow"
+ icon_state = "plasmawindow"
+ shardtype = /obj/item/weapon/shard/plasma
+ health = 120
+
+/obj/structure/window/full/plasmabasic/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
+ if(exposed_temperature > T0C + 32000)
+ hit(round(exposed_volume / 1000), 0)
+ ..()
+
+/obj/structure/window/full/plasmareinforced
+ name = "reinforced plasma window"
+ desc = "A plasma-glass alloy window, with rods supporting it. It looks hopelessly tough to break. It also looks completely fireproof, considering how basic plasma windows are insanely fireproof."
+ basestate = "plasmarwindow"
+ icon_state = "plasmarwindow"
+ shardtype = /obj/item/weapon/shard/plasma
+ reinf = 1
+ health = 160
+
+/obj/structure/window/full/plasmareinforced/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
+ return
+
+/obj/structure/window/full/reinforced
+ name = "reinforced window"
+ desc = "It looks rather strong. Might take a few good hits to shatter it."
+ icon_state = "rwindow"
+ basestate = "rwindow"
+ health = 40
+ reinf = 1
+
+/obj/structure/window/full/reinforced/tinted
+ name = "tinted window"
+ desc = "It looks rather strong and opaque. Might take a few good hits to shatter it."
+ icon_state = "twindow"
+ basestate = "twindow"
+ opacity = 1
+
+/obj/structure/window/full/reinforced/tinted/frosted
+ name = "frosted window"
+ desc = "It looks rather strong and frosted over. Looks like it might take a few less hits then a normal reinforced window."
+ icon_state = "fwindow"
+ basestate = "fwindow"
+ health = 30
\ No newline at end of file
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index 4bdd5ac3613..d45b07f2317 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -13,10 +13,10 @@
var/reinf = 0
var/basestate
var/shardtype = /obj/item/weapon/shard
+ var/sheets = 1 // Number of sheets needed to build this window (determines how much shit is spawned by destroy())
// var/silicate = 0 // number of units of silicate
// var/icon/silicateIcon = null // the silicated icon
-
/obj/structure/window/bullet_act(var/obj/item/projectile/Proj)
health -= Proj.damage
..()
@@ -25,62 +25,52 @@
if(pdiff>0)
message_admins("Window destroyed by [Proj.firer.real_name] ([formatPlayerPanel(Proj.firer,Proj.firer.ckey)]) via \an [Proj]! pdiff = [pdiff] at [formatJumpTo(loc)]!")
log_admin("Window destroyed by ([Proj.firer.ckey]) via \an [Proj]! pdiff = [pdiff] at [loc]!")
- new /obj/item/weapon/shard(loc)
- new /obj/item/stack/rods(loc)
- del(src)
+ destroy()
return
+// This should result in the same materials used to make the window.
+/obj/structure/window/proc/destroy()
+ for(var/i=0;i[src] was hit by [AM].")
@@ -108,9 +98,6 @@
message_admins("Window with pdiff [pdiff] at [formatJumpTo(loc)] deanchored by [AM]!")
log_admin("Window with pdiff [pdiff] at [loc] deanchored by [AM]!")
if(health <= 0)
- new /obj/item/weapon/shard(loc)
- if(reinf) new /obj/item/stack/rods(loc)
- del(src)
var/pdiff=performWallPressureCheck(src.loc)
if(pdiff>0)
if(M)
@@ -119,21 +106,20 @@
else
message_admins("Window with pdiff [pdiff] at [formatJumpTo(loc)] destroyed by [AM]!")
log_admin("Window with pdiff [pdiff] at [loc] destroyed by [AM]!")
+ destroy()
/obj/structure/window/attack_hand(mob/user as mob)
if(M_HULK in user.mutations)
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!"))
user.visible_message("[user] smashes through [src]!")
- new /obj/item/weapon/shard(loc)
- if(reinf) new /obj/item/stack/rods(loc)
- del(src)
var/pdiff=performWallPressureCheck(src.loc)
if(pdiff>0)
message_admins("Window destroyed by hulk [user.real_name] ([formatPlayerPanel(user,user.ckey)]) with pdiff [pdiff] at [formatJumpTo(loc)]!")
log_admin("Window destroyed by hulk [user.real_name] ([user.ckey]) with pdiff [pdiff] at [loc]!")
- else if (usr.a_intent == "harm")
- playsound(src.loc, 'sound/effects/glassknock.ogg', 80, 1)
+ destroy()
+ else if (usr.a_intent == "hurt")
+ playsound(get_turf(src), 'sound/effects/glassknock.ogg', 80, 1)
usr.visible_message("\red [usr.name] bangs against the [src.name]!", \
"\red You bang against the [src.name]!", \
"You hear a banging sound.")
@@ -148,17 +134,14 @@
/obj/structure/window/attack_paw(mob/user as mob)
return attack_hand(user)
-
/obj/structure/window/proc/attack_generic(mob/user as mob, damage = 0) //used by attack_alien, attack_animal, and attack_slime
health -= damage
if(health <= 0)
user.visible_message("[user] smashes through [src]!")
- new /obj/item/weapon/shard(loc)
- if(reinf) new /obj/item/stack/rods(loc)
- del(src)
var/pdiff=performWallPressureCheck(src.loc)
if(pdiff>0)
message_admins("Window destroyed by [user.real_name] ([formatPlayerPanel(user,user.ckey)]) with pdiff [pdiff] at [formatJumpTo(loc)]!")
+ destroy()
else //for nicer text~
user.visible_message("[user] smashes into [src]!")
playsound(loc, 'sound/effects/Glasshit.ogg', 100, 1)
@@ -257,20 +240,10 @@
if(sound_effect)
playsound(loc, 'sound/effects/Glasshit.ogg', 75, 1)
if(health <= 0)
- if(dir == SOUTHWEST)
- var/index = null
- index = 0
- while(index < 2)
- new shardtype(loc)
- if(reinf) new /obj/item/stack/rods(loc)
- index++
- else
- new shardtype(loc)
- if(reinf) new /obj/item/stack/rods(loc)
var/pdiff=performWallPressureCheck(src.loc)
if(pdiff>0)
message_admins("Window with pdiff [pdiff] broken at [formatJumpTo(loc)]!")
- del(src)
+ destroy()
return
@@ -351,7 +324,8 @@
/obj/structure/window/Destroy()
density = 0
update_nearby_tiles()
- playsound(src, "shatter", 70, 1)
+ if(loc)
+ playsound(get_turf(src), "shatter", 70, 1)
update_nearby_icons()
..()
@@ -372,50 +346,24 @@
//checks if this window is full-tile one
/obj/structure/window/proc/is_fulltile()
- if(dir in list(5,6,9,10))
- return 1
return 0
//This proc is used to update the icons of nearby windows. It should not be confused with update_nearby_tiles(), which is an atmos proc!
/obj/structure/window/proc/update_nearby_icons()
+ if(!loc) return 0
update_icon()
for(var/direction in cardinal)
for(var/obj/structure/window/W in get_step(src,direction) )
W.update_icon()
-//merges adjacent full-tile windows into one (blatant ripoff from game/smoothwall.dm)
/obj/structure/window/update_icon()
- //A little cludge here, since I don't know how it will work with slim windows. Most likely VERY wrong.
- //this way it will only update full-tile ones
- //This spawn is here so windows get properly updated when one gets deleted.
- spawn(2)
- if(!src) return
- if(!is_fulltile())
- icon_state = "[basestate]"
- return
- var/junction = 0 //will be used to determine from which side the window is connected to other windows
- if(anchored)
- for(var/obj/structure/window/W in orange(src,1))
- if(W.anchored && W.density && W.is_fulltile()) //Only counts anchored, not-destroyed fill-tile windows.
- if(abs(x-W.x)-abs(y-W.y) ) //doesn't count windows, placed diagonally to src
- junction |= get_dir(src,W)
- if(opacity)
- icon_state = "[basestate][junction]"
- else
- if(reinf)
- icon_state = "[basestate][junction]"
- else
- icon_state = "[basestate][junction]"
-
- return
+ return
/obj/structure/window/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > T0C + 800)
hit(round(exposed_volume / 100), 0)
..()
-
-
/obj/structure/window/basic
icon_state = "window"
desc = "It looks thin and flimsy. A few knocks with... anything, really should shatter it."
diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm
index 7b952382a5d..b1b5098be40 100644
--- a/code/modules/admin/verbs/mapping.dm
+++ b/code/modules/admin/verbs/mapping.dm
@@ -77,8 +77,8 @@ var/intercom_range_display_status = 0
for(var/obj/machinery/camera/C in cameranet.cameras)
CL += C
- var/output = {"CAMERA ANNOMALITIES REPORT
-The following annomalities have been detected. The ones in red need immediate attention: Some of those in black may be intentional.
"}
+ var/output = {"CAMERA ANOMALIES REPORT
+The following anomalies have been detected. The ones in red need immediate attention: Some of those in black may be intentional.
"}
for(var/obj/machinery/camera/C1 in CL)
for(var/obj/machinery/camera/C2 in CL)
@@ -94,7 +94,7 @@ var/intercom_range_display_status = 0
if(!(locate(/obj/structure/grille,T)))
var/window_check = 0
for(var/obj/structure/window/W in T)
- if (W.dir == turn(C1.dir,180) || W.dir in list(5,6,9,10) )
+ if (W.dir == turn(C1.dir,180) || W.is_fulltile() )
window_check = 1
break
if(!window_check)
diff --git a/code/modules/liquid/splash_simulation.dm b/code/modules/liquid/splash_simulation.dm
index 2bde78b19d9..d9147f60b18 100644
--- a/code/modules/liquid/splash_simulation.dm
+++ b/code/modules/liquid/splash_simulation.dm
@@ -168,7 +168,7 @@ turf/space/can_leave_liquid(from_direction)
turf/simulated/floor/can_accept_liquid(from_direction)
for(var/obj/structure/window/W in src)
- if(W.dir in list(5,6,9,10))
+ if(W.is_fulltile())
return 0
if(W.dir & from_direction)
return 0
@@ -179,7 +179,7 @@ turf/simulated/floor/can_accept_liquid(from_direction)
turf/simulated/floor/can_leave_liquid(to_direction)
for(var/obj/structure/window/W in src)
- if(W.dir in list(5,6,9,10))
+ if(W.is_fulltile())
return 0
if(W.dir & to_direction)
return 0
diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm
index 0883b1a2747..bcda9889f73 100644
--- a/code/modules/mining/mine_items.dm
+++ b/code/modules/mining/mine_items.dm
@@ -83,11 +83,16 @@ proc/move_mining_shuttle()
if(istype(T, /turf/simulated))
del(T)
- for(var/mob/living/carbon/bug in toArea) // If someone somehow is still in the shuttle's docking area...
- bug.gib()
-
- for(var/mob/living/simple_animal/pest in toArea) // And for the other kind of bug...
- pest.gib()
+ //Do I really need to explain this loop?
+ for(var/atom/A in toArea)
+ if(istype(A,/mob/living))
+ var/mob/living/unlucky_person = A
+ unlucky_person.gib()
+ // Weird things happen when this shit gets in the way.
+ if(istype(A,/obj/structure/lattice) \
+ || istype(A, /obj/structure/window) \
+ || istype(A, /obj/structure/grille))
+ qdel(A)
fromArea.move_contents_to(toArea)
if (mining_shuttle_location)
diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
index f53c6c1a05e..5a65382def6 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
@@ -38,11 +38,10 @@
now_pushing = 1
if (!AM.anchored)
var/t = get_dir(src, AM)
- if (istype(AM, /obj/structure/window))
- if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
- for(var/obj/structure/window/win in get_step(AM,t))
- now_pushing = 0
- return
+ if (istype(AM, /obj/structure/window/full))
+ for(var/obj/structure/window/win in get_step(AM,t))
+ now_pushing = 0
+ return
step(AM, t)
now_pushing = null
return
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index fd1661290b9..9da6564adaa 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -169,11 +169,10 @@
if (!AM.anchored)
var/t = get_dir(src, AM)
- if (istype(AM, /obj/structure/window))
- if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
- for(var/obj/structure/window/win in get_step(AM,t))
- now_pushing = 0
- return
+ if (istype(AM, /obj/structure/window/full))
+ for(var/obj/structure/window/win in get_step(AM,t))
+ now_pushing = 0
+ return
step(AM, t)
now_pushing = 0
return
diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm
index f9bce720cb3..97b863400ff 100644
--- a/code/modules/mob/living/carbon/metroid/metroid.dm
+++ b/code/modules/mob/living/carbon/metroid/metroid.dm
@@ -164,15 +164,14 @@
now_pushing = 1
if (!( AM.anchored ))
var/t = get_dir(src, AM)
- if (istype(AM, /obj/structure/window))
- if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
- for(var/obj/structure/window/win in get_step(AM,t))
- now_pushing = 0
- return
+ if (istype(AM, /obj/structure/window/full))
+ for(var/obj/structure/window/win in get_step(AM,t))
+ now_pushing = 0
+ return
step(AM, t)
now_pushing = null
return
- return
+
/mob/living/carbon/slime/Process_Spacemove()
return 2
@@ -1098,4 +1097,4 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
M.slime_color = pickedcolor
user << "You absorb the pigment and your color shifts!"
M.update_mutantrace()
- del(src) //Finally a tidy way to remove all the used cores lying about
\ No newline at end of file
+ del(src) //Finally a tidy way to remove all the used cores lying about
diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm
index 12aa97f50fb..ed193859ffa 100644
--- a/code/modules/mob/living/carbon/monkey/monkey.dm
+++ b/code/modules/mob/living/carbon/monkey/monkey.dm
@@ -147,11 +147,10 @@
now_pushing = 1
if (!( AM.anchored ))
var/t = get_dir(src, AM)
- if (istype(AM, /obj/structure/window))
- if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
- for(var/obj/structure/window/win in get_step(AM,t))
- now_pushing = 0
- return
+ if (istype(AM, /obj/structure/window/full))
+ for(var/obj/structure/window/win in get_step(AM,t))
+ now_pushing = 0
+ return
step(AM, t)
now_pushing = null
return
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index cadf9e44d9e..c61446d6f92 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -424,10 +424,9 @@
M.start_pulling(t)
else
if (pulling)
- if (istype(pulling, /obj/structure/window))
- if(pulling:ini_dir == NORTHWEST || pulling:ini_dir == NORTHEAST || pulling:ini_dir == SOUTHWEST || pulling:ini_dir == SOUTHEAST)
- for(var/obj/structure/window/win in get_step(pulling,get_dir(pulling.loc, T)))
- stop_pulling()
+ if (istype(pulling, /obj/structure/window/full))
+ for(var/obj/structure/window/win in get_step(pulling,get_dir(pulling.loc, T)))
+ stop_pulling()
if (pulling)
step(pulling, get_dir(pulling.loc, T))
else
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 98173429f06..adaa87363c5 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -540,11 +540,10 @@
now_pushing = 1
if (!AM.anchored)
var/t = get_dir(src, AM)
- if (istype(AM, /obj/structure/window))
- if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
- for(var/obj/structure/window/win in get_step(AM,t))
- now_pushing = 0
- return
+ if (istype(AM, /obj/structure/window/full))
+ for(var/obj/structure/window/win in get_step(AM,t))
+ now_pushing = 0
+ return
step(AM, t)
now_pushing = null
return
diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm
index 307b06dbdf8..13f320472ba 100644
--- a/code/modules/mob/living/simple_animal/constructs.dm
+++ b/code/modules/mob/living/simple_animal/constructs.dm
@@ -84,17 +84,15 @@
now_pushing = 1
if (!( AM.anchored ))
var/t = get_dir(src, AM)
- if (istype(AM, /obj/structure/window))
- if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
- for(var/obj/structure/window/win in get_step(AM,t))
- now_pushing = 0
- return
+ if (istype(AM, /obj/structure/window/full))
+ for(var/obj/structure/window/win in get_step(AM,t))
+ now_pushing = 0
+ return
step(AM, t)
now_pushing = null
return
return
-
/mob/living/simple_animal/construct/attack_animal(mob/living/simple_animal/M as mob)
if(istype(M, /mob/living/simple_animal/construct/builder))
health += 5
diff --git a/code/modules/mob/living/simple_animal/friendly/corgi.dm b/code/modules/mob/living/simple_animal/friendly/corgi.dm
index 1c98a330f77..80b2e224372 100644
--- a/code/modules/mob/living/simple_animal/friendly/corgi.dm
+++ b/code/modules/mob/living/simple_animal/friendly/corgi.dm
@@ -358,11 +358,10 @@
now_pushing = 1
if (!( AM.anchored ))
var/t = get_dir(src, AM)
- if (istype(AM, /obj/structure/window))
- if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
- for(var/obj/structure/window/win in get_step(AM,t))
- now_pushing = 0
- return
+ if (istype(AM, /obj/structure/window/full))
+ for(var/obj/structure/window/win in get_step(AM,t))
+ now_pushing = 0
+ return
step(AM, t)
now_pushing = null
return
@@ -489,4 +488,4 @@
s.start()
respawnable_list += src
del src
- return
+ return
diff --git a/code/modules/mob/living/simple_animal/friendly/slime.dm b/code/modules/mob/living/simple_animal/friendly/slime.dm
index aa498446be2..ddddc43132a 100644
--- a/code/modules/mob/living/simple_animal/friendly/slime.dm
+++ b/code/modules/mob/living/simple_animal/friendly/slime.dm
@@ -41,11 +41,10 @@
now_pushing = 1
if (!( AM.anchored ))
var/t = get_dir(src, AM)
- if (istype(AM, /obj/structure/window))
- if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
- for(var/obj/structure/window/win in get_step(AM,t))
- now_pushing = 0
- return
+ if (istype(AM, /obj/structure/window/full))
+ for(var/obj/structure/window/win in get_step(AM,t))
+ now_pushing = 0
+ return
step(AM, t)
now_pushing = null
return