Skip to content

Commit

Permalink
Replacing all map instances of unsim floors with precompiled types.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Nov 12, 2024
1 parent f5acc8c commit d2f7b8e
Show file tree
Hide file tree
Showing 12 changed files with 932 additions and 2,862 deletions.
9 changes: 9 additions & 0 deletions code/game/turfs/flooring/flooring_wood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
force_material = /decl/material/solid/organic/wood
constructed = TRUE
gender = NEUTER
broken_states = list(
"broken0",
"broken1",
"broken2",
"broken3",
"broken4",
"broken5",
"broken6"
)

/decl/flooring/wood/mahogany
color = /decl/material/solid/organic/wood/mahogany::color
Expand Down
79 changes: 79 additions & 0 deletions code/game/turfs/unsimulated/floor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,82 @@
name = "snowy plating"
icon = 'icons/turf/flooring/snow_plating.dmi'
icon_state = "snowplating"

/turf/unsimulated/floor/wood
name = "wooden floor"
icon = 'icons/turf/flooring/wood.dmi'
icon_state = "wood0"

/turf/unsimulated/floor/wood/broken1
icon_state = "wood_broken1"

/turf/unsimulated/floor/wood/broken2
icon_state = "wood_broken2"

/turf/unsimulated/floor/wood/broken6
icon_state = "wood_broken6"

/turf/unsimulated/floor/vault
icon_state = "vault"

/turf/unsimulated/floor/dark
icon_state = "dark"

/turf/unsimulated/floor/freezer
icon_state = "freezerfloor"

/turf/unsimulated/floor/plating
name = "plating"
icon_state = "plating"

/turf/unsimulated/floor/asteroid
icon_state = "asteroid"

/turf/unsimulated/floor/asteroidplating
icon_state = "asteroidplating"

/turf/unsimulated/floor/asteroidfloor
icon_state = "asteroidfloor"

/turf/unsimulated/floor/cult
name = "plating"
icon_state = "cult"

/turf/unsimulated/floor/water
name = "water"
icon = 'icons/misc/beach.dmi'
icon_state = "seashallow"

/turf/unsimulated/floor/lava
icon_state = "lava"
name = "lava"

/turf/unsimulated/floor/grass
name = "grass"
icon_state = "grass0"

/turf/unsimulated/floor/steel
icon_state = "steel"

/turf/unsimulated/floor/dark
icon_state = "dark"

/turf/unsimulated/floor/bcircuit
icon_state = "bcircuit"

/turf/unsimulated/floor/hydro
icon_state = "hydrofloor"

/turf/unsimulated/floor/white
icon_state = "white"

/turf/unsimulated/floor/carpet
name = "carpet"
icon_state = "carpet"

/turf/unsimulated/floor/snow
name = "snow"
icon_state = "snow"

/turf/unsimulated/floor/bcarpet
icon_state = "bcarpet"
11 changes: 8 additions & 3 deletions code/unit_tests/turf_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
fail("Unable to locate an appropriate turf at [world.maxx],[world.maxy],1.")
return 1

var/validate_types = typesof(/turf/floor) | typesof(/turf/unsimulated/floor)
var/list/failures = list()
for(var/floor_type in typesof(/turf/floor))
for(var/floor_type in validate_types)
var/turf/floor/check_floor = floor_type
if(TYPE_IS_ABSTRACT(check_floor))
continue
Expand Down Expand Up @@ -72,15 +73,19 @@
SSoverlays.wake()
SSmaterials.wake()

// Procs used for validation below.
/turf/floor/proc/validate_turf()
/turf/proc/validate_turf()
SHOULD_CALL_PARENT(TRUE)
. = list()
if(isnull(icon))
. += "null icon"
if(!istext(icon_state))
. += "null or invalid icon_state '[icon_state]'"
if(icon && icon_state && !check_state_in_icon(icon_state, icon))
. += "missing initial icon_state '[icon_state]' from '[icon]'"

// Procs used for validation below.
/turf/floor/validate_turf()
. = ..()
if(!istype(_base_flooring))
. += "null or invalid _base_flooring ([_base_flooring || "NULL"])"
if(_flooring && !istype(_flooring))
Expand Down
Binary file modified icons/turf/flooring/wood.dmi
Binary file not shown.
Loading

0 comments on commit d2f7b8e

Please sign in to comment.