Files
CHOMPStation2/code/game/objects/structures/lattice.dm
Neerti 00fa623c9d Merge branch 'dev' of https://github.com/Baystation12/Baystation12 into dev
Conflicts:
	.travis.yml
	code/controllers/configuration.dm
	code/game/gamemodes/changeling/modularchangling.dm
	code/game/jobs/job/medical.dm
	code/game/jobs/job/security.dm
	code/game/machinery/Sleeper.dm
	code/game/machinery/computer/communications.dm
	code/game/machinery/cryopod.dm
	code/game/objects/items/weapons/RCD.dm
	code/game/objects/items/weapons/storage/boxes.dm
	code/game/turfs/simulated/floor.dm
	code/game/turfs/simulated/floor_types.dm
	code/global.dm
	code/modules/materials/materials.dm
	code/modules/mob/living/silicon/ai/ai.dm
	code/modules/projectiles/guns/projectile/automatic.dm
	polaris.dme
2015-08-23 01:30:46 -04:00

86 lines
2.3 KiB
Plaintext

/obj/structure/lattice
name = "lattice"
desc = "A lightweight support lattice."
icon = 'icons/obj/structures.dmi'
icon_state = "latticefull"
density = 0
anchored = 1.0
layer = 2.3 //under pipes
// flags = CONDUCT
/obj/structure/lattice/New()
..()
///// Z-Level Stuff
if(!(istype(src.loc, /turf/space) || istype(src.loc, /turf/simulated/floor/open) || istype(src.loc, /turf/simulated/floor/plating/airless/asteroid) || istype(src.loc, /turf/simulated/floor/plating/asteroid)))
///// Z-Level Stuff
qdel(src)
for(var/obj/structure/lattice/LAT in src.loc)
if(LAT != src)
qdel(LAT)
icon = 'icons/obj/smoothlattice.dmi'
icon_state = "latticeblank"
updateOverlays()
for (var/dir in cardinal)
var/obj/structure/lattice/L
if(locate(/obj/structure/lattice, get_step(src, dir)))
L = locate(/obj/structure/lattice, get_step(src, dir))
L.updateOverlays()
/obj/structure/lattice/Destroy()
for (var/dir in cardinal)
var/obj/structure/lattice/L
if(locate(/obj/structure/lattice, get_step(src, dir)))
L = locate(/obj/structure/lattice, get_step(src, dir))
L.updateOverlays(src.loc)
..()
/obj/structure/lattice/blob_act()
qdel(src)
return
/obj/structure/lattice/ex_act(severity)
switch(severity)
if(1.0)
qdel(src)
return
if(2.0)
qdel(src)
return
if(3.0)
return
else
return
/obj/structure/lattice/attackby(obj/item/C as obj, mob/user as mob)
if (istype(C, /obj/item/stack/tile/floor))
var/turf/T = get_turf(src)
T.attackby(C, user) //BubbleWrap - hand this off to the underlying turf instead
return
if (istype(C, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = C
if(WT.remove_fuel(0, user))
user << "<span class='notice'>Slicing lattice joints ...</span>"
PoolOrNew(/obj/item/stack/rods, src.loc)
qdel(src)
return
/obj/structure/lattice/proc/updateOverlays()
//if(!(istype(src.loc, /turf/space)))
// qdel(src)
spawn(1)
overlays = list()
var/dir_sum = 0
for (var/direction in cardinal)
if(locate(/obj/structure/lattice, get_step(src, direction)))
dir_sum += direction
else
if(!(istype(get_step(src, direction), /turf/space)))
dir_sum += direction
icon_state = "lattice[dir_sum]"
return