Skip to content

Commit

Permalink
For the record, fuck floor code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Intigracy committed Sep 21, 2015
1 parent 440c2e1 commit 386a280
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 67 deletions.
17 changes: 13 additions & 4 deletions code/game/turfs/simulated/floor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","
"asteroid0","asteroid1","asteroid2","asteroid3","asteroid4",
"asteroid5","asteroid6","asteroid7","asteroid8","asteroid9","asteroid10","asteroid11","asteroid12",
"oldburning","light-on-r","light-on-y","light-on-g","light-on-b", "wood", "wood-broken", "wood-broken2", "wood-broken3", "wood-broken4", "wood-broken5", "wood-broken6", "wood-broken7", "carpet",
"carpetcorner", "carpetside", "carpet", "ironsand1", "ironsand2", "ironsand3", "ironsand4", "ironsand5",
"carpetcorner", "carpetside", "carpet", "arcade", "ironsand1", "ironsand2", "ironsand3", "ironsand4", "ironsand5",
"ironsand6", "ironsand7", "ironsand8", "ironsand9", "ironsand10", "ironsand11",
"ironsand12", "ironsand13", "ironsand14", "ironsand15","arcadecarpet")
"ironsand12", "ironsand13", "ironsand14", "ironsand15")

var/list/plating_icons = list("plating","platingdmg1","platingdmg2","platingdmg3","asteroid","asteroid_dug",
"ironsand1", "ironsand2", "ironsand3", "ironsand4", "ironsand5", "ironsand6", "ironsand7",
Expand Down Expand Up @@ -161,6 +161,10 @@ turf/simulated/floor/proc/update_icon()

icon_state = "carpet[connectdir]-[diagonalconnect]"

else if(is_arcade_floor())
if(!broken && !burnt)
icon_state = "arcade"

else if(is_wood_floor())
if(!broken && !burnt)
if( !(icon_state in wood_icons) )
Expand Down Expand Up @@ -246,6 +250,11 @@ turf/simulated/floor/proc/update_icon()
else
return 0

/turf/simulated/floor/is_arcade_floor()
if(istype(floor_tile,/obj/item/stack/tile/arcade))
return 1
return 0

/turf/simulated/floor/is_plating()
if(!floor_tile)
return 1
Expand All @@ -272,7 +281,7 @@ turf/simulated/floor/proc/update_icon()
else if(is_wood_floor())
src.icon_state = "wood-broken"
broken = 1
else if(is_carpet_floor())
else if((is_carpet_floor()) || (is_arcade_floor()))
src.icon_state = "carpet-broken"
broken = 1
else if(is_grass_floor())
Expand Down Expand Up @@ -304,7 +313,7 @@ turf/simulated/floor/proc/update_icon()
else if(is_wood_floor())
src.icon_state = "wood-broken"
burnt = 1
else if(is_carpet_floor())
else if((is_carpet_floor()) || (is_arcade_floor()))
src.icon_state = "carpet-broken"
burnt = 1
else if(is_grass_floor())
Expand Down
134 changes: 71 additions & 63 deletions code/game/turfs/simulated/floor_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
nitrogen = 0.01
temperature = TCMB

New()
..()
name = "floor"
/turf/simulated/floor/airless/New()
..()
name = "floor"



Expand All @@ -18,9 +18,9 @@
oxygen=0 // BIRDS HATE OXYGEN FOR SOME REASON
nitrogen = MOLES_O2STANDARD+MOLES_N2STANDARD // So it totals to the same pressure

New()
..()
name = "plating"
/turf/simulated/floor/plating/vox/New()
..()
name = "plating"

/turf/simulated/floor/vox
icon_state = "floor"
Expand All @@ -29,9 +29,9 @@
oxygen=0 // BIRDS HATE OXYGEN FOR SOME REASON
nitrogen = MOLES_O2STANDARD+MOLES_N2STANDARD // So it totals to the same pressure

New()
..()
name = "floor"
/turf/simulated/floor/vox/New()
..()
name = "floor"

/turf/simulated/floor/vox/wood
name = "floor"
Expand All @@ -43,31 +43,31 @@
soot_type = null
melt_temperature = 0 // Doesn't melt.

New()
if(floor_tile)
returnToPool(floor_tile)
floor_tile = null
floor_tile = getFromPool(/obj/item/stack/tile/wood, null)
..()
/turf/simulated/floor/vox/wood/New()
if(floor_tile)
returnToPool(floor_tile)
floor_tile = null
floor_tile = getFromPool(/obj/item/stack/tile/wood, null)
..()

/turf/simulated/floor/light
name = "Light floor"
luminosity = 5
icon_state = "light_on"
floor_tile

New()
if(floor_tile)
returnToPool(floor_tile)
floor_tile = null
floor_tile = getFromPool(/obj/item/stack/tile/light, null)
floor_tile.New() //I guess New() isn't run on objects spawned without the definition of a turf to house them, ah well.
var/n = name //just in case commands rename it in the ..() call
..()
spawn(4)
if(src)
update_icon()
name = n
/turf/simulated/floor/light/New()
if(floor_tile)
returnToPool(floor_tile)
floor_tile = null
floor_tile = getFromPool(/obj/item/stack/tile/light, null)
floor_tile.New() //I guess New() isn't run on objects spawned without the definition of a turf to house them, ah well.
var/n = name //just in case commands rename it in the ..() call
..()
spawn(4)
if(src)
update_icon()
name = n

/turf/simulated/floor/wood
name = "floor"
Expand All @@ -79,23 +79,23 @@
soot_type = null
melt_temperature = 0 // Doesn't melt.

New()
floor_tile = getFromPool(/obj/item/stack/tile/wood,null)
..()
/turf/simulated/floor/wood/New()
floor_tile = getFromPool(/obj/item/stack/tile/wood,null)
..()

/turf/simulated/floor/vault
icon_state = "rockvault"

New(location,type)
..()
icon_state = "[type]vault"
/turf/simulated/floor/vault/New(location,type)
..()
icon_state = "[type]vault"

/turf/simulated/wall/vault
icon_state = "rockvault"

New(location,type)
..()
icon_state = "[type]vault"
/turf/simulated/wall/vault/New(location,type)
..()
icon_state = "[type]vault"

/turf/simulated/floor/engine
name = "reinforced floor"
Expand Down Expand Up @@ -156,14 +156,15 @@
nitrogen = 0.01

/turf/simulated/floor/engine/n20
New()
..()
if(src.air)
// EXACTLY the same code as fucking roomfillers. If this doesn't work, something's fucked.
var/datum/gas/sleeping_agent/trace_gas = new
air.trace_gases += trace_gas
trace_gas.moles = 9*4000
air.update_values()

/turf/simulated/floor/engine/n20/New()
..()
if(src.air)
// EXACTLY the same code as fucking roomfillers. If this doesn't work, something's fucked.
var/datum/gas/sleeping_agent/trace_gas = new
air.trace_gases += trace_gas
trace_gas.moles = 9*4000
air.update_values()

/turf/simulated/floor/engine/nitrogen
name = "nitrogen floor"
Expand Down Expand Up @@ -198,9 +199,9 @@
nitrogen = 0.01
temperature = TCMB

New()
..()
name = "plating"
/turf/simulated/floor/plating/airless/New()
..()
name = "plating"

/turf/simulated/floor/bluegrid
icon = 'icons/turf/floors.dmi'
Expand Down Expand Up @@ -334,21 +335,21 @@
icon_state = "grass1"
floor_tile

New()
if(floor_tile)
returnToPool(floor_tile)
floor_tile = null
floor_tile = getFromPool(/obj/item/stack/tile/grass, null)
floor_tile.New() //I guess New() isn't ran on objects spawned without the definition of a turf to house them, ah well.
icon_state = "grass[pick("1","2","3","4")]"
..()
spawn(4)
if(src)
update_icon()
for(var/direction in cardinal)
if(istype(get_step(src,direction),/turf/simulated/floor))
var/turf/simulated/floor/FF = get_step(src,direction)
FF.update_icon() //so siding get updated properly
/turf/simulated/floor/grass/New()
if(floor_tile)
returnToPool(floor_tile)
floor_tile = null
floor_tile = getFromPool(/obj/item/stack/tile/grass, null)
floor_tile.New() //I guess New() isn't ran on objects spawned without the definition of a turf to house them, ah well.
icon_state = "grass[pick("1","2","3","4")]"
..()
spawn(4)
if(src)
update_icon()
for(var/direction in cardinal)
if(istype(get_step(src,direction),/turf/simulated/floor))
var/turf/simulated/floor/FF = get_step(src,direction)
FF.update_icon() //so siding get updated properly

/turf/simulated/floor/carpet
name = "Carpet"
Expand Down Expand Up @@ -379,9 +380,16 @@

/turf/simulated/floor/arcade
name = "Arcade Carpet"
icon_state = "arcadecarpet"
icon_state = "arcade"
floor_tile

/turf/simulated/floor/arcade/New()
if(floor_tile)
returnToPool(floor_tile)
floor_tile = null
floor_tile = getFromPool(/obj/item/stack/tile/arcade, null)
..()

/turf/simulated/floor/plating/ironsand/New()
..()
name = "Iron Sand"
Expand Down
3 changes: 3 additions & 0 deletions code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@
/turf/proc/is_carpet_floor()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/turf/proc/is_carpet_floor() called tick#: [world.time]")
return 0
/turf/proc/is_arcade_floor()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/turf/proc/is_arcade_floor() called tick#: [world.time]")
return 0
/turf/proc/is_mineral_floor()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/turf/proc/is_mineral_floor() called tick#: [world.time]")
return 0
Expand Down
Binary file modified icons/turf/floors.dmi
Binary file not shown.

0 comments on commit 386a280

Please sign in to comment.