added defines for window construction states and full window diagonal dir

added a proc to check for valid window location, added var/fulltile to windows instead of using a proc
added clockwork windoors and windows to brass recipes
added titanium glass and plastitanium glass, made glass types use recipes like other stacks, you can smelt the new glasses in the ORM
removed force from RCD and added NOBLUDGEON flag, fixing a bug where you couldn't deconstruct airlocks with an RCD
slight nerf to wielded fireaxe, does high damage to windows and grilles instead of insta-deleting them
deleted fullwindow.dm and moved windows to window.dm
added some feedback to placing glass on grilles
examining windoor assembly shows you can rotate it, examining windows show deconstruction hints and rotation
added cracks to windows, you can repair windows using a welding tool on help intent, slight buff to window health
added var/cancolor to windows and blacklists some windows from being auto-colored, window shards also get colored on narsie_act()
full windows now use icon smoothing system, windows now use the obj_integrity damage system
added is_glass_sheet() helper
This commit is contained in:
uraniummeltdown
2018-04-10 23:16:23 +05:00
parent 49e49591a1
commit 75bded82cf
40 changed files with 812 additions and 844 deletions
-116
View File
@@ -1,116 +0,0 @@
/obj/structure/window/full
sheets = 2
dir=SOUTHWEST
level = 3
/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)
if(istype(mover) && mover.checkpass(PASSGLASS))
return 1
return 0
/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/shard/plasma
glasstype = /obj/item/stack/sheet/plasmaglass
health = 240
/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/shard/plasma
glasstype = /obj/item/stack/sheet/plasmaglass
reinf = 1
health = 320
/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 = 80
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 = 60
/obj/structure/window/full/shuttle
name = "shuttle window"
desc = "It looks rather strong. Might take a few good hits to shatter it."
icon = 'icons/obj/podwindows.dmi'
icon_state = "window"
basestate = "window"
health = 160
reinf = 1
explosion_block = 3
armor = list("melee" = 50, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 50, "bio" = 100, "rad" = 100)
/obj/structure/window/full/shuttle/New()
..()
color = null
/obj/structure/window/full/shuttle/update_icon() //icon_state has to be set manually
return
/obj/structure/window/full/shuttle/shuttleRotate(rotation)
..()
var/matrix/M = transform
M.Turn(rotation)
transform = M
/obj/structure/window/full/shuttle/dark
icon = 'icons/turf/shuttle.dmi'
icon_state = "window5"
basestate = "window5"
+4 -4
View File
@@ -137,7 +137,7 @@
return
//window placing begin
else if(istype(W,/obj/item/stack/sheet/rglass) || istype(W,/obj/item/stack/sheet/glass) || istype(W,/obj/item/stack/sheet/plasmaglass) || istype(W,/obj/item/stack/sheet/plasmarglass))
else if(is_glass_sheet(W))
build_window(W, user)
return
//window placing end
@@ -190,10 +190,10 @@
S.use(1)
W.setDir(dir_to_set)
W.ini_dir = dir_to_set
W.anchored = 0
W.state = 0
W.anchored = FALSE
W.state = WINDOW_OUT_OF_FRAME
to_chat(user, "<span class='notice'>You place the [W] on [src].</span>")
W.update_icon()
W.update_nearby_icons()
return
/obj/structure/grille/attacked_by(obj/item/I, mob/living/user)
@@ -27,6 +27,10 @@
var/secure = FALSE //Whether or not this creates a secure windoor
var/state = "01" //How far the door assembly has progressed
/obj/structure/windoor_assembly/examine(mob/user)
..()
to_chat(user, "<span class='notice'>Alt-click to rotate it clockwise.</span>")
obj/structure/windoor_assembly/New(loc, set_dir)
..()
if(set_dir)
@@ -42,7 +46,7 @@ obj/structure/windoor_assembly/Destroy()
/obj/structure/windoor_assembly/Move()
var/turf/T = loc
. = ..()
..()
setDir(ini_dir)
move_update_air(T)
@@ -54,8 +58,17 @@ obj/structure/windoor_assembly/Destroy()
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)
@@ -317,9 +330,16 @@ obj/structure/windoor_assembly/Destroy()
if(usr.stat || !usr.canmove || usr.restrained())
return
if(anchored)
to_chat(usr, "It is fastened to the floor; therefore, you can't rotate it!")
return 0
setDir(turn(dir, 270))
to_chat(usr, "<span class='warning'>[src] cannot be rotated while it is fastened to the floor!</span>")
return FALSE
var/target_dir = turn(dir, 270)
if(!valid_window_location(loc, target_dir))
to_chat(usr, "<span class='warning'>[src] cannot be rotated in that direction!</span>")
return FALSE
setDir(target_dir)
ini_dir = dir
update_icon()
return TRUE
File diff suppressed because it is too large Load Diff