Fun with tiletypes. Expect explosions.

develop
Petr Mrázek 2011-04-28 23:00:52 +02:00
parent df946783c0
commit 456a979244
4 changed files with 53 additions and 51 deletions

@ -10,7 +10,7 @@ namespace DFHack
// 0 // 0
{"void",EMPTY, AIR, VAR_1}, {"void",EMPTY, AIR, VAR_1},
{"ramp top",RAMP_TOP, AIR, VAR_1}, {"ramp top",RAMP_TOP, AIR, VAR_1},
{"pool",FLOOR, SOIL, VAR_1, TILE_POOL}, {"pool",POOL, SOIL, VAR_1},
{0, EMPTY, AIR, VAR_1}, {0, EMPTY, AIR, VAR_1},
{0, EMPTY, AIR, VAR_1}, {0, EMPTY, AIR, VAR_1},
{0, EMPTY, AIR, VAR_1}, {0, EMPTY, AIR, VAR_1},
@ -49,7 +49,7 @@ namespace DFHack
{"empty space",EMPTY, AIR, VAR_1}, {"empty space",EMPTY, AIR, VAR_1},
{0 ,EMPTY, AIR, VAR_1}, {0 ,EMPTY, AIR, VAR_1},
{"shrub",SHRUB_OK, SOIL, VAR_1}, {"shrub",SHRUB_OK, SOIL, VAR_1},
{"chasm",FLOOR, AIR, VAR_1, TILE_ENDLESS }, {"chasm",ENDLESS_PIT, AIR, VAR_1},
{"obsidian stair up/down",STAIR_UPDOWN, OBSIDIAN, VAR_1}, {"obsidian stair up/down",STAIR_UPDOWN, OBSIDIAN, VAR_1},
{"obsidian stair down",STAIR_DOWN, OBSIDIAN, VAR_1}, {"obsidian stair down",STAIR_DOWN, OBSIDIAN, VAR_1},
{"obsidian stair up",STAIR_UP, OBSIDIAN, VAR_1}, {"obsidian stair up",STAIR_UP, OBSIDIAN, VAR_1},
@ -58,7 +58,7 @@ namespace DFHack
// 40 // 40
{"soil stair down",STAIR_DOWN, SOIL, VAR_1}, {"soil stair down",STAIR_DOWN, SOIL, VAR_1},
{"soil stair up",STAIR_UP, SOIL, VAR_1}, {"soil stair up",STAIR_UP, SOIL, VAR_1},
{"eerie pit",FLOOR, HFS, VAR_1, TILE_ENDLESS}, {"eerie pit",ENDLESS_PIT, HFS, VAR_1},
{"smooth stone floor",FLOOR, STONE, VAR_1 , TILE_SMOOTH }, {"smooth stone floor",FLOOR, STONE, VAR_1 , TILE_SMOOTH },
{"smooth obsidian floor",FLOOR, OBSIDIAN, VAR_1 , TILE_SMOOTH }, {"smooth obsidian floor",FLOOR, OBSIDIAN, VAR_1 , TILE_SMOOTH },
{"smooth featstone? floor",FLOOR, FEATSTONE, VAR_1 , TILE_SMOOTH }, {"smooth featstone? floor",FLOOR, FEATSTONE, VAR_1 , TILE_SMOOTH },
@ -406,10 +406,6 @@ namespace DFHack
// 330 // 330
{"worn obsidian wall",WALL,OBSIDIAN,VAR_1}, {"worn obsidian wall",WALL,OBSIDIAN,VAR_1},
{"obsidian wall",WALL,OBSIDIAN,VAR_1}, {"obsidian wall",WALL,OBSIDIAN,VAR_1},
/*MAPTILE_FEATSTONE_WALL_WORN1,
MAPTILE_FEATSTONE_WALL_WORN2,
MAPTILE_FEATSTONE_WALL_WORN3,
MAPTILE_FEATSTONE_WALL,*/
{"cracked featstone wall",WALL,FEATSTONE,VAR_1, TILE_CRACKED }, {"cracked featstone wall",WALL,FEATSTONE,VAR_1, TILE_CRACKED },
{"damaged featstone wall",WALL,FEATSTONE,VAR_1, TILE_DAMAGED }, {"damaged featstone wall",WALL,FEATSTONE,VAR_1, TILE_DAMAGED },
{"worn featstone wall",WALL,FEATSTONE,VAR_1, TILE_WORN }, {"worn featstone wall",WALL,FEATSTONE,VAR_1, TILE_WORN },
@ -449,27 +445,27 @@ namespace DFHack
{"damaged ice wall",WALL,ICE,VAR_1, TILE_DAMAGED}, {"damaged ice wall",WALL,ICE,VAR_1, TILE_DAMAGED},
{"worn ice wall",WALL,ICE,VAR_1, TILE_WORN }, {"worn ice wall",WALL,ICE,VAR_1, TILE_WORN },
{"ice wall",WALL,ICE,VAR_1}, {"ice wall",WALL,ICE,VAR_1},
{"river N",FLOOR,SOIL,VAR_1, TILE_RIVER , "N" }, {"river N",RIVER_BED,SOIL,VAR_1, TILE_NORMAL, "N" },
{"river S",FLOOR,SOIL,VAR_1, TILE_RIVER , "S" }, {"river S",RIVER_BED,SOIL,VAR_1, TILE_NORMAL, "S" },
{"river E",FLOOR,SOIL,VAR_1, TILE_RIVER , "E" }, {"river E",RIVER_BED,SOIL,VAR_1, TILE_NORMAL, "E" },
{"river W",FLOOR,SOIL,VAR_1, TILE_RIVER , "W" }, {"river W",RIVER_BED,SOIL,VAR_1, TILE_NORMAL, "W" },
{"river NW",FLOOR,SOIL,VAR_1, TILE_RIVER, "NW"}, {"river NW",RIVER_BED,SOIL,VAR_1,TILE_NORMAL, "NW"},
//370 //370
{"river NE",FLOOR,SOIL,VAR_1, TILE_RIVER , "NE" }, {"river NE",RIVER_BED,SOIL,VAR_1, TILE_NORMAL , "NE" },
{"river SW",FLOOR,SOIL,VAR_1, TILE_RIVER , "SW" }, {"river SW",RIVER_BED,SOIL,VAR_1, TILE_NORMAL , "SW" },
{"river SE",FLOOR,SOIL,VAR_1, TILE_RIVER , "SE" }, {"river SE",RIVER_BED,SOIL,VAR_1, TILE_NORMAL , "SE" },
{"stream bed N",FLOOR,SOIL,VAR_1, TILE_STREAM , "N" }, {"brook bed N",BROOK_BED,SOIL,VAR_1, TILE_NORMAL , "N" },
{"stream bed S",FLOOR,SOIL,VAR_1, TILE_STREAM , "S" }, {"brook bed S",BROOK_BED,SOIL,VAR_1, TILE_NORMAL , "S" },
{"stream bed E",FLOOR,SOIL,VAR_1, TILE_STREAM , "E" }, {"brook bed E",BROOK_BED,SOIL,VAR_1, TILE_NORMAL , "E" },
{"stream bed W",FLOOR,SOIL,VAR_1, TILE_STREAM , "W" }, {"brook bed W",BROOK_BED,SOIL,VAR_1, TILE_NORMAL , "W" },
{"stream bed NW",FLOOR,SOIL,VAR_1, TILE_STREAM, "NW" }, {"brook bed NW",BROOK_BED,SOIL,VAR_1, TILE_NORMAL, "NW" },
{"stream bed NE",FLOOR,SOIL,VAR_1, TILE_STREAM, "NE" }, {"brook bed NE",BROOK_BED,SOIL,VAR_1, TILE_NORMAL, "NE" },
{"stream bed SW",FLOOR,SOIL,VAR_1, TILE_STREAM, "SW" }, {"brook bed SW",BROOK_BED,SOIL,VAR_1, TILE_NORMAL, "SW" },
// 380 // 380
{"stream bed SE",FLOOR,SOIL,VAR_1, TILE_STREAM, "SE" }, {"brook bed SE",BROOK_BED,SOIL,VAR_1, TILE_NORMAL, "SE" },
{"stream top",FLOOR,SOIL,VAR_1, TILE_STREAM_TOP }, {"brook top",BROOK_TOP,SOIL,VAR_1 },
{0 ,EMPTY, AIR, VAR_1}, {0 ,EMPTY, AIR, VAR_1},
{0 ,EMPTY, AIR, VAR_1}, {0 ,EMPTY, AIR, VAR_1},
{0 ,EMPTY, AIR, VAR_1}, {0 ,EMPTY, AIR, VAR_1},

@ -36,24 +36,29 @@ namespace DFHack
// tile class -- determines the general shape of the tile // tile class -- determines the general shape of the tile
// enum and lookup table for string names created using X macros // enum and lookup table for string names created using X macros
#define TILESHAPE_MACRO \ #define TILESHAPE_MACRO \
X(EMPTY, "") \ X(EMPTY, "") \
X(WALL, "") \ X(WALL, "") \
X(PILLAR, "") \ X(PILLAR, "") \
X(FORTIFICATION, "") \ X(BROOK_BED, "mineable, water-passable rock on the bottom of brook") \
X(STAIR_UP, "") \ X(FORTIFICATION, "") \
X(STAIR_DOWN, "") \ X(STAIR_UP, "") \
X(STAIR_UPDOWN, "") \ X(STAIR_DOWN, "") \
X(RAMP, "ramps have no direction" ) \ X(STAIR_UPDOWN, "") \
X(RAMP_TOP, "used for pathing?" ) \ X(RAMP, "ramps have no direction" ) \
X(FLOOR, "") \ X(RAMP_TOP, "used for pathing?" ) \
X(TREE_DEAD, "") \ X(FLOOR, "") \
X(TREE_OK, "") \ X(BROOK_TOP, "water-passable floor on top of BROOK_BED tiles") \
X(SAPLING_DEAD, "") \ X(RIVER_BED, "It's a riverbed. Basically a floor.'") \
X(SAPLING_OK, "") \ X(POOL, "A pool. Gathers water while it's raining.'") \
X(SHRUB_DEAD, "") \ X(TREE_DEAD, "") \
X(SHRUB_OK, "") \ X(TREE_OK, "") \
X(BOULDER, "") \ X(SAPLING_DEAD, "") \
X(PEBBLES, "") X(SAPLING_OK, "") \
X(SHRUB_DEAD, "") \
X(SHRUB_OK, "") \
X(BOULDER, "") \
X(PEBBLES, "") \
X(ENDLESS_PIT, "a fake endless pit")
//end TILESHAPE_MACRO //end TILESHAPE_MACRO
//define tile class enum //define tile class enum
@ -106,14 +111,8 @@ namespace DFHack
// When the TileType class gets created, everything should be re-thought. // When the TileType class gets created, everything should be re-thought.
#define TILESPECIAL_MACRO \ #define TILESPECIAL_MACRO \
X(NORMAL, "Default for all type, nothing present" ) \ X(NORMAL, "Default for all type, nothing present" ) \
X(SPECIAL, "General purpose, for any unique tile which can not otherwise be differenciated" ) \
X(POOL, "Murky Pool, will gather water from rain" ) \
X(STREAM, "Streams (and brooks too? maybe?)" ) \
X(STREAM_TOP, "The walkable surface of a stream/brook" ) \
X(RIVER_SOURCE, "Rivers Source, when it exists on a map" ) \ X(RIVER_SOURCE, "Rivers Source, when it exists on a map" ) \
X(RIVER, "Rivers, and their entering and exiting tiles" ) \
X(WATERFALL, "Special case for Waterfall Landing. How's this used?" ) \ X(WATERFALL, "Special case for Waterfall Landing. How's this used?" ) \
X(ENDLESS, "Eerie Pit and Old Chasm/Endless Pit" ) \
X(CRACKED, "Walls being dug" ) \ X(CRACKED, "Walls being dug" ) \
X(DAMAGED, "Walls being dug" ) \ X(DAMAGED, "Walls being dug" ) \
X(WORN, "Walls being dug ??" ) \ X(WORN, "Walls being dug ??" ) \
@ -289,6 +288,10 @@ namespace DFHack
case DFHack::SHRUB_OK: case DFHack::SHRUB_OK:
case DFHack::BOULDER: case DFHack::BOULDER:
case DFHack::PEBBLES: case DFHack::PEBBLES:
case DFHack::RIVER_BED:
case DFHack::POOL:
case DFHack::ENDLESS_PIT:
case DFHack::BROOK_TOP:
return true; return true;
default: default:
return false; return false;

@ -719,7 +719,7 @@ int main (void)
tp = getTileRow(block.tiletypes[x][y]); tp = getTileRow(block.tiletypes[x][y]);
d = &block.designation[x][y]; d = &block.designation[x][y];
//Only modify this level if it's 'empty' //Only modify this level if it's 'empty'
if ( EMPTY != tp->shape && RAMP_TOP != tp->shape && STAIR_DOWN != tp->shape && DFHack::TILE_STREAM_TOP != tp->special) if ( EMPTY != tp->shape && RAMP_TOP != tp->shape && STAIR_DOWN != tp->shape && DFHack::BROOK_TOP != tp->shape)
{ {
continue; continue;
} }

@ -141,8 +141,7 @@ int main (int argc, char* argv[])
case RAMP_TOP: case RAMP_TOP:
case STAIR_UPDOWN: case STAIR_UPDOWN:
case STAIR_DOWN: case STAIR_DOWN:
case STREAM: case BROOK_TOP:
case STREAM_TOP:
above = below = sides = true; above = below = sides = true;
break; break;
// has floor // has floor
@ -158,6 +157,10 @@ int main (int argc, char* argv[])
case SHRUB_OK: case SHRUB_OK:
case BOULDER: case BOULDER:
case PEBBLES: case PEBBLES:
case BROOK_BED:
case RIVER_BED:
case ENDLESS_PIT:
case POOL:
if(from_below) if(from_below)
unhide = 0; unhide = 0;
above = sides = true; above = sides = true;