Removed intact var in favour of is_plating() proc, fixed issues with invisible initialized pipes.

This commit is contained in:
Zuhayr
2015-08-16 17:51:19 -07:00
parent 23e9c7d4c9
commit 3b712adb5f
34 changed files with 111 additions and 132 deletions

View File

@@ -49,7 +49,7 @@ Pipelines + Other Objects -> Pipe network
/obj/machinery/atmospherics/proc/add_underlay(var/turf/T, var/obj/machinery/atmospherics/node, var/direction, var/icon_connect_type)
if(node)
if(T.intact && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
if(!T.is_plating() && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
//underlays += icon_manager.get_atmos_icon("underlay_down", direction, color_cache_name(node))
underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "down" + icon_connect_type)
else

View File

@@ -69,7 +69,7 @@
if(!istype(T))
return
if(T.intact && node1 && node2 && node1.level == 1 && node2.level == 1 && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe))
if(!T.is_plating() && node1 && node2 && node1.level == 1 && node2.level == 1 && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe))
vent_icon += "h"
if(!powered())
@@ -85,7 +85,7 @@
var/turf/T = get_turf(src)
if(!istype(T))
return
if(T.intact && node1 && node2 && node1.level == 1 && node2.level == 1 && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe))
if(!T.is_plating() && node1 && node2 && node1.level == 1 && node2.level == 1 && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe))
return
else
if (node1)

View File

@@ -189,7 +189,7 @@
var/turf/T = get_turf(src)
if(!istype(T))
return
if(T.intact && istype(P.node, /obj/machinery/atmospherics/pipe) && P.node.level == 1 )
if(!T.is_plating() && istype(P.node, /obj/machinery/atmospherics/pipe) && P.node.level == 1 )
//pipe_state = icon_manager.get_atmos_icon("underlay_down", P.dir, color_cache_name(P.node))
pipe_state = icon_manager.get_atmos_icon("underlay", P.dir, color_cache_name(P.node), "down")
else

View File

@@ -69,7 +69,7 @@
if (!istype(W, /obj/item/weapon/wrench))
return ..()
var/turf/T = src.loc
if (level==1 && isturf(T) && T.intact)
if (level==1 && isturf(T) && !T.is_plating())
user << "<span class='warning'>You must remove the plating first.</span>"
return 1
var/datum/gas_mixture/int_air = return_air()

View File

@@ -118,7 +118,7 @@
if(!istype(T))
return
if(T.intact && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
if(!T.is_plating() && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
vent_icon += "h"
if(welded)
@@ -136,7 +136,7 @@
var/turf/T = get_turf(src)
if(!istype(T))
return
if(T.intact && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
if(!T.is_plating() && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
return
else
if(node)
@@ -399,7 +399,7 @@
user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>"
return 1
var/turf/T = src.loc
if (node && node.level==1 && isturf(T) && T.intact)
if (node && node.level==1 && isturf(T) && !T.is_plating())
user << "<span class='warning'>You must remove the plating first.</span>"
return 1
var/datum/gas_mixture/int_air = return_air()

View File

@@ -72,7 +72,7 @@
var/turf/T = get_turf(src)
if(!istype(T))
return
if(T.intact && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
if(!T.is_plating() && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
return
else
if(node)
@@ -261,7 +261,7 @@
user << "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>"
return 1
var/turf/T = src.loc
if (node && node.level==1 && isturf(T) && T.intact)
if (node && node.level==1 && isturf(T) && !T.is_plating())
user << "<span class='warning'>You must remove the plating first.</span>"
return 1
var/datum/gas_mixture/int_air = return_air()

View File

@@ -181,7 +181,7 @@ obj/machinery/atmospherics/mains_pipe/simple
..() // initialize internal pipes
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
hidden
@@ -243,7 +243,7 @@ obj/machinery/atmospherics/mains_pipe/manifold
..() // initialize internal pipes
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
update_icon()
@@ -293,7 +293,7 @@ obj/machinery/atmospherics/mains_pipe/manifold4w
..() // initialize internal pipes
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
update_icon()
@@ -354,7 +354,7 @@ obj/machinery/atmospherics/mains_pipe/split
N1.merge(N2)
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
update_icon()
@@ -475,7 +475,7 @@ obj/machinery/atmospherics/mains_pipe/split3
N1.merge(N2)
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
update_icon()
@@ -525,7 +525,7 @@ obj/machinery/atmospherics/mains_pipe/cap
..()
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
hidden

View File

@@ -19,10 +19,9 @@
return -1
/obj/machinery/atmospherics/pipe/New()
..()
//so pipes under walls are hidden
if(hides_under_flooring() && (istype(get_turf(src), /turf/simulated/wall) || istype(get_turf(src), /turf/simulated/shuttle/wall) || istype(get_turf(src), /turf/unsimulated/wall)))
if(istype(get_turf(src), /turf/simulated/wall) || istype(get_turf(src), /turf/simulated/shuttle/wall) || istype(get_turf(src), /turf/unsimulated/wall))
level = 1
..()
/obj/machinery/atmospherics/pipe/hides_under_flooring()
return level != 2
@@ -83,7 +82,7 @@
if (!istype(W, /obj/item/weapon/wrench))
return ..()
var/turf/T = src.loc
if (level==1 && isturf(T) && T.intact)
if (level==1 && isturf(T) && !T.is_plating())
user << "<span class='warning'>You must remove the plating first.</span>"
return 1
var/datum/gas_mixture/int_air = return_air()
@@ -299,9 +298,8 @@
qdel(src)
return
var/turf/T = get_turf(src)
if(istype(T))
hide(T.intact)
var/turf/T = loc
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
/obj/machinery/atmospherics/pipe/simple/disconnect(obj/machinery/atmospherics/reference)
@@ -584,8 +582,7 @@
return
var/turf/T = get_turf(src)
if(istype(T))
hide(T.intact)
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
/obj/machinery/atmospherics/pipe/manifold/visible
@@ -843,8 +840,7 @@
return
var/turf/T = get_turf(src)
if(istype(T))
hide(T.intact)
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
/obj/machinery/atmospherics/pipe/manifold4w/visible
@@ -999,7 +995,7 @@
break
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
if(level == 1 && !T.is_plating()) hide(1)
update_icon()
/obj/machinery/atmospherics/pipe/cap/visible
@@ -1388,7 +1384,7 @@
/obj/machinery/atmospherics/proc/add_underlay_adapter(var/turf/T, var/obj/machinery/atmospherics/node, var/direction, var/icon_connect_type) //modified from add_underlay, does not make exposed underlays
if(node)
if(T.intact && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
if(!T.is_plating() && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "down" + icon_connect_type)
else
underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "intact" + icon_connect_type)

View File

@@ -149,7 +149,7 @@ obj/machinery/atmospherics/pipe/zpipe/up/initialize()
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
hide(!T.is_plating())
///////////////////////
// and the down pipe //
@@ -190,7 +190,7 @@ obj/machinery/atmospherics/pipe/zpipe/down/initialize()
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
hide(!T.is_plating())
///////////////////////
// supply/scrubbers //

View File

@@ -1,6 +1,5 @@
/turf/simulated/floor/open
name = "open space"
intact = 0
density = 0
icon_state = "black"
pathweight = 100000 //Seriously, don't try and path over this one numbnuts

View File

@@ -18,7 +18,7 @@
Beacon.invisibility = INVISIBILITY_MAXIMUM
Beacon.loc = T
hide(T.intact)
hide(!T.is_plating())
Destroy()
if(Beacon)

View File

@@ -86,7 +86,7 @@
var/turf/simulated/floor/T = new_turf
if(!T.is_plating())
T.make_plating(!(T.broken || T.burnt))
return !new_turf.intact
return new_turf.is_plating()
/obj/machinery/cablelayer/proc/layCable(var/turf/new_turf,var/M_Dir)
if(!on)

View File

@@ -81,7 +81,7 @@
var/turf/simulated/floor/T = new_turf
if(!T.is_plating())
T.make_plating(!(T.broken || T.burnt))
return !new_turf.intact
return new_turf.is_plating()
/obj/machinery/floorlayer/proc/TakeNewStack()
for(var/obj/item/stack/tile/tile in contents)

View File

@@ -32,7 +32,7 @@
New()
..()
var/turf/T = loc
hide(T.intact)
hide(!T.is_plating())
center = T
spawn(10) // must wait for map loading to finish

View File

@@ -29,7 +29,7 @@ var/global/list/navbeacons // no I don't like putting this in, but it will do
set_codes()
var/turf/T = loc
hide(T.intact)
hide(!T.is_plating())
// add beacon to MULE bot beacon list
if(freq == 1400)
@@ -111,7 +111,7 @@ var/global/list/navbeacons // no I don't like putting this in, but it will do
attackby(var/obj/item/I, var/mob/user)
var/turf/T = loc
if(T.intact)
if(!T.is_plating())
return // prevent intraction when T-scanner revealed
if(istype(I, /obj/item/weapon/screwdriver))
@@ -145,7 +145,7 @@ var/global/list/navbeacons // no I don't like putting this in, but it will do
interact(var/mob/user, var/ai = 0)
var/turf/T = loc
if(T.intact)
if(!T.is_plating())
return // prevent intraction when T-scanner revealed
if(!open && !ai) // can't alter controls if not open, unless you're an AI

View File

@@ -461,7 +461,7 @@ Buildable meters
P.set_dir(src.dir)
P.initialize_directions = pipe_dir
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
if (deleted(P))
usr << pipefailtext
@@ -480,7 +480,7 @@ Buildable meters
P.set_dir(src.dir)
P.initialize_directions = pipe_dir
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
if (deleted(P))
usr << pipefailtext
@@ -499,7 +499,7 @@ Buildable meters
P.set_dir(src.dir)
P.initialize_directions = pipe_dir
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
if (deleted(P))
usr << pipefailtext
@@ -518,7 +518,7 @@ Buildable meters
P.set_dir(src.dir)
P.initialize_directions = pipe_dir
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
if (deleted(P))
usr << pipefailtext
@@ -536,8 +536,6 @@ Buildable meters
P.set_dir(src.dir)
P.initialize_directions = pipe_dir //this var it's used to know if the pipe is bent or not
P.initialize_directions_he = pipe_dir
//var/turf/T = P.loc
//P.level = T.intact ? 2 : 1
P.initialize()
if (deleted(P))
usr << pipefailtext
@@ -557,7 +555,7 @@ Buildable meters
if (pipename)
C.name = pipename
var/turf/T = C.loc
C.level = T.intact ? 2 : 1
C.level = !T.is_plating() ? 2 : 1
C.initialize()
C.build_network()
if (C.node)
@@ -572,7 +570,7 @@ Buildable meters
M.initialize_directions = pipe_dir
//M.New()
var/turf/T = M.loc
M.level = T.intact ? 2 : 1
M.level = !T.is_plating() ? 2 : 1
M.initialize()
if (deleted(M))
usr << pipefailtext
@@ -595,7 +593,7 @@ Buildable meters
M.initialize_directions = pipe_dir
//M.New()
var/turf/T = M.loc
M.level = T.intact ? 2 : 1
M.level = !T.is_plating() ? 2 : 1
M.initialize()
if (!M)
usr << "There's nothing to connect this manifold to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
@@ -618,7 +616,7 @@ Buildable meters
M.initialize_directions = pipe_dir
//M.New()
var/turf/T = M.loc
M.level = T.intact ? 2 : 1
M.level = !T.is_plating() ? 2 : 1
M.initialize()
if (!M)
usr << "There's nothing to connect this manifold to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
@@ -641,7 +639,7 @@ Buildable meters
M.initialize_directions = pipe_dir
//M.New()
var/turf/T = M.loc
M.level = T.intact ? 2 : 1
M.level = !T.is_plating() ? 2 : 1
M.initialize()
if (deleted(M))
usr << pipefailtext
@@ -668,7 +666,7 @@ Buildable meters
M.connect_types = src.connect_types
//M.New()
var/turf/T = M.loc
M.level = T.intact ? 2 : 1
M.level = !T.is_plating() ? 2 : 1
M.initialize()
if (!M)
usr << "There's nothing to connect this manifold to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
@@ -695,7 +693,7 @@ Buildable meters
M.connect_types = src.connect_types
//M.New()
var/turf/T = M.loc
M.level = T.intact ? 2 : 1
M.level = !T.is_plating() ? 2 : 1
M.initialize()
if (!M)
usr << "There's nothing to connect this manifold to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
@@ -719,8 +717,6 @@ Buildable meters
P.set_dir(src.dir)
P.initialize_directions = src.get_pdir()
P.initialize_directions_he = src.get_hdir()
//var/turf/T = P.loc
//P.level = T.intact ? 2 : 1
P.initialize()
if (deleted(P))
usr << pipefailtext //"There's nothing to connect this pipe to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
@@ -740,7 +736,7 @@ Buildable meters
if (pipename)
V.name = pipename
var/turf/T = V.loc
V.level = T.intact ? 2 : 1
V.level = !T.is_plating() ? 2 : 1
V.initialize()
V.build_network()
if (V.node)
@@ -755,7 +751,7 @@ Buildable meters
if (pipename)
V.name = pipename
var/turf/T = V.loc
V.level = T.intact ? 2 : 1
V.level = !T.is_plating() ? 2 : 1
V.initialize()
V.build_network()
if (V.node1)
@@ -774,7 +770,7 @@ Buildable meters
if (pipename)
P.name = pipename
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
P.build_network()
if (P.node1)
@@ -791,7 +787,7 @@ Buildable meters
if (pipename)
P.name = pipename
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
P.build_network()
if (P.node1)
@@ -811,7 +807,7 @@ Buildable meters
if (pipename)
P.name = pipename
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
P.build_network()
if (P.node1)
@@ -831,7 +827,7 @@ Buildable meters
if (pipename)
P.name = pipename
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
P.build_network()
if (P.node1)
@@ -851,7 +847,7 @@ Buildable meters
if (pipename)
P.name = pipename
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
P.build_network()
if (P.node1)
@@ -871,7 +867,7 @@ Buildable meters
if (pipename)
P.name = pipename
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
P.build_network()
if (P.node1)
@@ -891,7 +887,7 @@ Buildable meters
if (pipename)
S.name = pipename
var/turf/T = S.loc
S.level = T.intact ? 2 : 1
S.level = !T.is_plating() ? 2 : 1
S.initialize()
S.build_network()
if (S.node)
@@ -903,7 +899,7 @@ Buildable meters
P.set_dir(src.dir)
P.initialize_directions = pipe_dir
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
if (deleted(P))
usr << pipefailtext
@@ -923,7 +919,7 @@ Buildable meters
if (pipename)
V.name = pipename
var/turf/T = V.loc
V.level = T.intact ? 2 : 1
V.level = !T.is_plating() ? 2 : 1
V.initialize()
V.build_network()
if (V.node1)
@@ -943,7 +939,7 @@ Buildable meters
if (pipename)
V.name = pipename
var/turf/T = V.loc
V.level = T.intact ? 2 : 1
V.level = !T.is_plating() ? 2 : 1
V.initialize()
V.build_network()
if (V.node1)
@@ -993,7 +989,7 @@ Buildable meters
if (pipename)
P.name = pipename
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
P.build_network()
if (P.node1)
@@ -1010,7 +1006,7 @@ Buildable meters
if (pipename)
P.name = pipename
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
P.build_network()
if (P.node1)
@@ -1027,7 +1023,7 @@ Buildable meters
if (pipename)
C.name = pipename
var/turf/T = C.loc
C.level = T.intact ? 2 : 1
C.level = !T.is_plating() ? 2 : 1
C.initialize()
C.build_network()
if (C.node)
@@ -1041,7 +1037,7 @@ Buildable meters
if (pipename)
P.name = pipename
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
P.build_network()
if (P.node1)
@@ -1057,7 +1053,7 @@ Buildable meters
if (pipename)
P.name = pipename
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
P.build_network()
if (P.node1)
@@ -1073,7 +1069,7 @@ Buildable meters
if (pipename)
P.name = pipename
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
P.build_network()
if (P.node1)
@@ -1089,7 +1085,7 @@ Buildable meters
if (pipename)
P.name = pipename
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
P.build_network()
if (P.node1)
@@ -1105,7 +1101,7 @@ Buildable meters
if (pipename)
P.name = pipename
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
P.build_network()
if (P.node1)
@@ -1121,7 +1117,7 @@ Buildable meters
if (pipename)
P.name = pipename
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
P.build_network()
if (P.node1)
@@ -1134,13 +1130,13 @@ Buildable meters
if(PIPE_OMNI_MIXER)
var/obj/machinery/atmospherics/omni/mixer/P = new(loc)
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
P.build_network()
if(PIPE_OMNI_FILTER)
var/obj/machinery/atmospherics/omni/filter/P = new(loc)
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
P.level = !T.is_plating() ? 2 : 1
P.initialize()
P.build_network()

View File

@@ -111,7 +111,7 @@
var/turf/simulated/floor/T = new_turf
if(!T.is_plating())
T.make_plating(!(T.broken || T.burnt))
return !new_turf.intact
return new_turf.is_plating()
/obj/machinery/pipelayer/proc/layPipe(var/turf/w_turf,var/M_Dir,var/old_dir)
if(!on || !(M_Dir in list(1, 2, 4, 8)) || M_Dir==old_dir)

View File

@@ -334,7 +334,7 @@
var/turf/simulated/floor/T = new_turf
if(!T.is_plating())
T.make_plating(!(T.broken || T.burnt))
return !new_turf.intact
return new_turf.is_plating()
proc/layCable(var/turf/new_turf)
if(equip_ready || !istype(new_turf) || !dismantleFloor(new_turf))

View File

@@ -21,11 +21,6 @@
return
var/obj/machinery/atmospherics/pipe/P = A
var/turf/T = P.loc
if (P.level < 2 && T.level==1 && isturf(T) && T.intact)
user << "<span class='warning'>You must remove the plating first.</span>"
return
P.change_color(pipe_colors[mode])
/obj/item/device/pipe_painter/attack_self(mob/user as mob)

View File

@@ -34,7 +34,7 @@
if(istype(I, /obj/item/weapon/screwdriver))
if(mode == 0)
var/turf/T = loc
if(isturf(T) && !T.intact)
if(isturf(T) && !!T.is_plating())
attached = locate() in T
if(!attached)
user << "No exposed cable here to attach to."

View File

@@ -105,7 +105,7 @@
if(!center) return
for(var/turf/T in range(scan_range, center))
if(!T.intact)
if(!!T.is_plating())
continue
for(var/obj/O in T.contents)

View File

@@ -175,12 +175,12 @@ obj/structure/safe/ex_act(severity)
level = 1 //underfloor
layer = 2.5
/obj/structure/safe/floor/initialize()
..()
var/turf/T = loc
hide(T.intact)
if(istype(T) && !T.is_plating())
hide(1)
update_icon()
/obj/structure/safe/floor/hide(var/intact)
invisibility = intact ? 101 : 0

View File

@@ -40,11 +40,9 @@
/turf/simulated/floor/proc/set_flooring(var/decl/flooring/newflooring)
make_plating(defer_icon_update = 1)
flooring = newflooring
intact = 1
update_icon(1)
levelupdate()
//This proc will set floor_type to null and the update_icon() proc will then change the icon_state of the turf
//This proc auto corrects the grass tiles' siding.
/turf/simulated/floor/proc/make_plating(var/place_product, var/defer_icon_update)
@@ -63,10 +61,8 @@
if(flooring.build_type && place_product)
new flooring.build_type(src)
flooring = null
intact = 0
set_light(0)
intact = 0
broken = null
burnt = null
flooring_override = null

View File

@@ -1,7 +1,6 @@
/turf
icon = 'icons/turf/floors.dmi'
level = 1
var/intact
var/holy = 0
// Initial air contents (in moles)
@@ -44,6 +43,9 @@
/turf/proc/is_space()
return 0
/turf/proc/is_intact()
return 0
/turf/attack_hand(mob/user)
if(!(user.canmove) || user.restrained() || !(user.pulling))
return 0
@@ -160,7 +162,7 @@ var/const/enterloopsanity = 100
/turf/proc/levelupdate()
for(var/obj/O in src)
O.hide(O.hides_under_flooring() && src.intact)
O.hide(O.hides_under_flooring() && !is_plating())
/turf/proc/AdjacentTurfs()
var/L[] = new()

View File

@@ -1,5 +1,4 @@
/turf/unsimulated
intact = 1
name = "command"
oxygen = MOLES_O2STANDARD
nitrogen = MOLES_N2STANDARD

View File

@@ -505,7 +505,8 @@
else
user << "<span class='warning'>Access denied.</span>"
else if (istype(W, /obj/item/stack/cable_coil) && !terminal && opened && has_electronics!=2)
if (src.loc:intact)
var/turf/T = loc
if(istype(T) && !T.is_plating())
user << "<span class='warning'>You must remove the floor plating in front of the APC first.</span>"
return
var/obj/item/stack/cable_coil/C = W
@@ -517,7 +518,6 @@
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 20))
if (C.amount >= 10 && !terminal && opened && has_electronics != 2)
var/turf/T = get_turf(src)
var/obj/structure/cable/N = T.get_cable_node()
if (prob(50) && electrocute_mob(usr, N, N))
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
@@ -532,7 +532,8 @@
make_terminal()
terminal.connect_to_network()
else if (istype(W, /obj/item/weapon/wirecutters) && terminal && opened && has_electronics!=2)
if (src.loc:intact)
var/turf/T = loc
if(istype(T) && !T.is_plating())
user << "<span class='warning'>You must remove the floor plating in front of the APC first.</span>"
return
user.visible_message("<span class='warning'>[user.name] dismantles the power terminal from [src].</span>", \

View File

@@ -70,7 +70,6 @@ By design, d1 is the smallest direction and d2 is the highest
/obj/structure/cable/New()
..()
// ensure d1 & d2 reflect the icon_state for entering and exiting cable
var/dash = findtext(icon_state, "-")
@@ -80,7 +79,7 @@ By design, d1 is the smallest direction and d2 is the highest
d2 = text2num( copytext( icon_state, dash+1 ) )
var/turf/T = src.loc // hide if turf is not intact
if(level==1) hide(T.intact)
if(level==1) hide(!T.is_plating())
cable_list += src //add it to the global cable list
@@ -123,7 +122,7 @@ By design, d1 is the smallest direction and d2 is the highest
/obj/structure/cable/attackby(obj/item/W, mob/user)
var/turf/T = src.loc
if(T.intact)
if(!T.is_plating())
return
if(istype(W, /obj/item/weapon/wirecutters))
@@ -655,7 +654,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
user << "You can't lay cable at a place that far away."
return
if(F.intact) // Ff floor is intact, complain
if(!F.is_plating()) // Ff floor is intact, complain
user << "You can't lay cable there unless the floor tiles are removed."
return
@@ -750,7 +749,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
var/turf/T = C.loc
if(!isturf(T) || T.intact) // sanity checks, also stop use interacting with T-scanner revealed cable
if(!isturf(T) || !T.is_plating()) // sanity checks, also stop use interacting with T-scanner revealed cable
return
if(get_dist(C, user) > 1) // make sure it's close enough
@@ -766,7 +765,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
// one end of the clicked cable is pointing towards us
if(C.d1 == dirn || C.d2 == dirn)
if(U.intact) // can't place a cable if the floor is complete
if(!U.is_plating()) // can't place a cable if the floor is complete
user << "You can't lay cable there unless the floor tiles are removed."
return
else

View File

@@ -12,7 +12,7 @@
/obj/structure/cable/heavyduty/attackby(obj/item/W, mob/user)
var/turf/T = src.loc
if(T.intact)
if(!T.is_plating())
return
if(istype(W, /obj/item/weapon/wirecutters))

View File

@@ -126,7 +126,7 @@
var/turf/T = user.loc
if(T.intact || !istype(T, /turf/simulated/floor))
if(!T.is_plating() || !istype(T, /turf/simulated/floor))
return
if(get_dist(src, user) > 1)

View File

@@ -101,7 +101,7 @@
return 1000
/turf/singularity_act(S, current_size)
if(intact)
if(!is_plating())
for(var/obj/O in contents)
if(O.level != 1)
continue

View File

@@ -204,7 +204,7 @@
user << "<span class='warning'>You can't build a terminal on space.</span>"
return 1
else if (istype(tempLoc))
if(tempLoc.intact)
if(!tempLoc.is_plating())
user << "<span class='warning'>You must remove the floor plating first.</span>"
return 1
user << "<span class='notice'>You start adding cable to the [src].</span>"
@@ -272,7 +272,7 @@
building_terminal = 1
var/turf/tempTDir = terminal.loc
if (istype(tempTDir))
if(tempTDir.intact)
if(!tempTDir.is_plating())
user << "<span class='warning'>You must remove the floor plating first.</span>"
else
user << "<span class='notice'>You begin to cut the cables...</span>"

View File

@@ -17,7 +17,7 @@
/obj/machinery/power/terminal/New()
..()
var/turf/T = src.loc
if(level==1) hide(T.intact)
if(level==1) hide(!T.is_plating())
return
/obj/machinery/power/terminal/Destroy()

View File

@@ -219,7 +219,7 @@
ispipe = 1
var/turf/T = src.loc
if(T.intact)
if(!T.is_plating())
user << "You can only attach the [nicetype] if the floor plating is removed."
return

View File

@@ -713,7 +713,7 @@
// update the icon_state to reflect hidden status
proc/update()
var/turf/T = src.loc
hide(T.intact && !istype(T,/turf/space)) // space never hides pipes
hide(!T.is_plating() && !istype(T,/turf/space)) // space never hides pipes
// hide called by levelupdate if turf intact status changes
// change visibility status and force update of icon
@@ -746,14 +746,10 @@
H.active = 0
H.loc = src
return
if(T.intact && istype(T,/turf/simulated/floor)) //intact floor, pop the tile
if(!T.is_plating() && istype(T,/turf/simulated/floor)) //intact floor, pop the tile
var/turf/simulated/floor/F = T
//F.health = 100
F.burnt = 1
F.intact = 0
F.levelupdate()
F.break_tile()
new /obj/item/stack/tile(H) // add to holder so it will be thrown with other stuff
F.icon_state = "Floor[F.burnt ? "1" : ""]"
if(direction) // direction is specified
if(istype(T, /turf/space)) // if ended in space, then range is unlimited
@@ -856,7 +852,7 @@
attackby(var/obj/item/I, var/mob/user)
var/turf/T = src.loc
if(T.intact)
if(!T.is_plating())
return // prevent interaction with T-scanner revealed pipes
src.add_fingerprint(user)
if(istype(I, /obj/item/weapon/weldingtool))
@@ -1339,7 +1335,7 @@
return
var/turf/T = src.loc
if(T.intact)
if(!T.is_plating())
return // prevent interaction with T-scanner revealed pipes
src.add_fingerprint(user)
if(istype(I, /obj/item/weapon/weldingtool))