1 /*
2  *  Globals.c
3  *  Brogue
4  *
5  *  Created by Brian Walker on 1/10/09.
6  *  Copyright 2012. All rights reserved.
7  *
8  *  This file is part of Brogue.
9  *
10  *  This program is free software: you can redistribute it and/or modify
11  *  it under the terms of the GNU Affero General Public License as
12  *  published by the Free Software Foundation, either version 3 of the
13  *  License, or (at your option) any later version.
14  *
15  *  This program is distributed in the hope that it will be useful,
16  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  *  GNU Affero General Public License for more details.
19  *
20  *  You should have received a copy of the GNU Affero General Public License
21  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #include "Rogue.h"
25 
26 tcell tmap[DCOLS][DROWS];                       // grids with info about the map
27 pcell pmap[DCOLS][DROWS];
28 short **scentMap;
29 cellDisplayBuffer displayBuffer[COLS][ROWS];    // used to optimize plotCharWithColor
30 short terrainRandomValues[DCOLS][DROWS][8];
31 short **safetyMap;                              // used to help monsters flee
32 short **allySafetyMap;                          // used to help allies flee
33 short **chokeMap;                               // used to assess the importance of the map's various chokepoints
34 const short nbDirs[8][2] = {{0,-1}, {0,1}, {-1,0}, {1,0}, {-1,-1}, {-1,1}, {1,-1}, {1,1}};
35 const short cDirs[8][2] = {{0, 1}, {1, 1}, {1, 0}, {1, -1}, {0, -1}, {-1, -1}, {-1, 0}, {-1, 1}};
36 short numberOfWaypoints;
37 levelData *levels;
38 creature player;
39 playerCharacter rogue;
40 creatureList *monsters;
41 creatureList *dormantMonsters;
42 creatureList graveyard;
43 creatureList purgatory;
44 item *floorItems;
45 item *packItems;
46 item *monsterItemsHopper;
47 
48 char displayedMessage[MESSAGE_LINES][COLS*2];
49 short messagesUnconfirmed;
50 char combatText[COLS * 2];
51 short messageArchivePosition;
52 archivedMessage messageArchive[MESSAGE_ARCHIVE_ENTRIES];
53 
54 char currentFilePath[BROGUE_FILENAME_MAX];
55 
56 char displayDetail[DCOLS][DROWS];       // used to make certain per-cell data accessible to external code (e.g. terminal adaptations)
57 
58 #ifdef AUDIT_RNG
59 FILE *RNGLogFile;
60 #endif
61 
62 unsigned char inputRecordBuffer[INPUT_RECORD_BUFFER + 100];
63 unsigned short locationInRecordingBuffer;
64 unsigned long randomNumbersGenerated;
65 unsigned long positionInPlaybackFile;
66 unsigned long lengthOfPlaybackFile;
67 unsigned long recordingLocation;
68 unsigned long maxLevelChanges;
69 char annotationPathname[BROGUE_FILENAME_MAX];   // pathname of annotation file
70 uint64_t previousGameSeed;
71 
72 //                                  Red     Green   Blue    RedRand GreenRand   BlueRand    Rand    Dances?
73 // basic colors
74 const color white =                 {100,   100,    100,    0,      0,          0,          0,      false};
75 const color gray =                  {50,    50,     50,     0,      0,          0,          0,      false};
76 const color darkGray =              {30,    30,     30,     0,      0,          0,          0,      false};
77 const color veryDarkGray =          {15,    15,     15,     0,      0,          0,          0,      false};
78 const color black =                 {0,     0,      0,      0,      0,          0,          0,      false};
79 const color yellow =                {100,   100,    0,      0,      0,          0,          0,      false};
80 const color darkYellow =            {50,    50,     0,      0,      0,          0,          0,      false};
81 const color teal =                  {30,    100,    100,    0,      0,          0,          0,      false};
82 const color purple =                {100,   0,      100,    0,      0,          0,          0,      false};
83 const color darkPurple =            {50,    0,      50,     0,      0,          0,          0,      false};
84 const color brown =                 {60,    40,     0,      0,      0,          0,          0,      false};
85 const color green =                 {0,     100,    0,      0,      0,          0,          0,      false};
86 const color darkGreen =             {0,     50,     0,      0,      0,          0,          0,      false};
87 const color orange =                {100,   50,     0,      0,      0,          0,          0,      false};
88 const color darkOrange =            {50,    25,     0,      0,      0,          0,          0,      false};
89 const color blue =                  {0,     0,      100,    0,      0,          0,          0,      false};
90 const color darkBlue =              {0,     0,      50,     0,      0,          0,          0,      false};
91 const color darkTurquoise =         {0,     40,     65,     0,      0,          0,          0,      false};
92 const color lightBlue =             {40,    40,     100,    0,      0,          0,          0,      false};
93 const color pink =                  {100,   60,     66,     0,      0,          0,          0,      false};
94 const color darkPink =              {50,    30,     33,     0,      0,          0,          0,      false};
95 const color red  =                  {100,   0,      0,      0,      0,          0,          0,      false};
96 const color darkRed =               {50,    0,      0,      0,      0,          0,          0,      false};
97 const color tanColor =              {80,    67,     15,     0,      0,          0,          0,      false};
98 
99 // bolt colors
100 const color rainbow =               {-70,   -70,    -70,    170,    170,        170,        0,      true};
101 const color descentBoltColor =      {-40,   -40,    -40,    0,      0,          80,         80,     true};
102 const color discordColor =          {25,    0,      25,     66,     0,          0,          0,      true};
103 const color poisonColor =           {0,     0,      0,      10,     50,         10,         0,      true};
104 const color beckonColor =           {10,    10,     10,     5,      5,          5,          50,     true};
105 const color invulnerabilityColor =  {25,    0,      25,     0,      0,          66,         0,      true};
106 const color dominationColor =       {0,     0,      100,    80,     25,         0,          0,      true};
107 const color empowermentColor =      {30,    100,    40,     25,     80,         25,         0,      true};
108 const color fireBoltColor =         {500,   150,    0,      45,     30,         0,          0,      true};
109 const color yendorLightColor =      {50,    -100,    30,     0,      0,          0,          0,      true};
110 const color dragonFireColor =       {500,   150,    0,      45,     30,         45,         0,      true};
111 const color flamedancerCoronaColor ={500,   150,    100,    45,     30,         0,          0,      true};
112 //const color shieldingColor =      {100,   50,     0,      0,      50,         100,        0,      true};
113 const color shieldingColor =        {150,   75,     0,      0,      50,         175,        0,      true};
114 
115 // tile colors
116 const color undiscoveredColor =     {0,     0,      0,      0,      0,          0,          0,      false};
117 
118 const color wallForeColor =         {7,     7,      7,      3,      3,          3,          0,      false};
119 
120 color wallBackColor;
121 const color wallBackColorStart =    {45,    40,     40,     15,     0,          5,          20,     false};
122 const color wallBackColorEnd =      {40,    30,     35,     0,      20,         30,         20,     false};
123 
124 const color mudWallForeColor =      {55,    45,     0,      5,      5,          5,          1,      false};
125 //const color mudWallForeColor =      {40,  34,     7,      0,      3,          0,          3,      false};
126 const color mudWallBackColor =      {20,    12,     3,      8,      4,          3,          0,      false};
127 
128 const color graniteBackColor =      {10,    10,     10,     0,      0,          0,          0,      false};
129 
130 const color floorForeColor =        {30,    30,     30,     0,      0,          0,          35,     false};
131 
132 color floorBackColor;
133 const color floorBackColorStart =   {2,     2,      10,     2,      2,          0,          0,      false};
134 const color floorBackColorEnd =     {5,     5,      5,      2,      2,          0,          0,      false};
135 
136 const color stairsBackColor =       {15,    15,     5,      0,      0,          0,          0,      false};
137 const color firstStairsBackColor =  {10,    10,     25,     0,      0,          0,          0,      false};
138 
139 const color refuseBackColor =       {6,     5,      3,      2,      2,          0,          0,      false};
140 const color rubbleBackColor =       {7,     7,      8,      2,      2,          1,          0,      false};
141 const color bloodflowerForeColor =  {30,    5,      40,     5,      1,          3,          0,      false};
142 const color bloodflowerPodForeColor = {50,  5,      25,     5,      1,          3,          0,      false};
143 const color bloodflowerBackColor =  {15,    3,      10,     3,      1,          3,          0,      false};
144 const color bedrollBackColor =      {10,    8,      5,      1,      1,          0,          0,      false};
145 
146 const color obsidianBackColor =     {6,     0,      8,      2,      0,          3,          0,      false};
147 const color carpetForeColor =       {23,    30,     38,     0,      0,          0,          0,      false};
148 const color carpetBackColor =       {15,    8,      5,      0,      0,          0,          0,      false};
149 const color marbleForeColor =       {30,    23,     38,     0,      0,          0,          0,      false};
150 const color marbleBackColor =       {6,     5,      13,     1,      0,          1,          0,      false};
151 const color doorForeColor =         {70,    35,     15,     0,      0,          0,          0,      false};
152 const color doorBackColor =         {30,    10,     5,      0,      0,          0,          0,      false};
153 //const color ironDoorForeColor =       {40,    40,     40,     0,      0,          0,          0,      false};
154 const color ironDoorForeColor =     {500,   500,    500,    0,      0,          0,          0,      false};
155 const color ironDoorBackColor =     {15,    15,     30,     0,      0,          0,          0,      false};
156 const color bridgeFrontColor =      {33,    12,     12,     12,     7,          2,          0,      false};
157 const color bridgeBackColor =       {12,    3,      2,      3,      2,          1,          0,      false};
158 const color statueBackColor =       {20,    20,     20,     0,      0,          0,          0,      false};
159 const color glyphColor =            {20,    5,      5,      50,     0,          0,          0,      true};
160 const color glyphLightColor =       {150,   0,      0,      150,    0,          0,          0,      true};
161 const color sacredGlyphColor =      {5,     20,     5,      0,      50,         0,          0,      true};
162 const color sacredGlyphLightColor = {45,    150,    60,     25,     80,         25,         0,      true};
163 
164 //const color deepWaterForeColor =  {5,     5,      40,     0,      0,          10,         10,     true};
165 //color deepWaterBackColor;
166 //const color deepWaterBackColorStart = {5, 5,      55,     5,      5,          10,         10,     true};
167 //const color deepWaterBackColorEnd =   {5,     5,      45,     2,      2,          5,          5,      true};
168 //const color shallowWaterForeColor =   {40,    40,     90,     0,      0,          10,         10,     true};
169 //color shallowWaterBackColor;
170 //const color shallowWaterBackColorStart ={30,30,       80,     0,      0,          10,         10,     true};
171 //const color shallowWaterBackColorEnd ={20,    20,     60,     0,      0,          5,          5,      true};
172 
173 const color deepWaterForeColor =    {5,     8,      20,     0,      4,          15,         10,     true};
174 color deepWaterBackColor;
175 const color deepWaterBackColorStart = {5,   10,     31,     5,      5,          5,          6,      true};
176 const color deepWaterBackColorEnd = {5,     8,      20,     2,      3,          5,          5,      true};
177 const color shallowWaterForeColor = {28,    28,     60,     0,      0,          10,         10,     true};
178 color shallowWaterBackColor;
179 const color shallowWaterBackColorStart ={20,20,     60,     0,      0,          10,         10,     true};
180 const color shallowWaterBackColorEnd ={12,  15,     40,     0,      0,          5,          5,      true};
181 
182 const color mudForeColor =          {18,    14,     5,      5,      5,          0,          0,      false};
183 const color mudBackColor =          {23,    17,     7,      5,      5,          0,          0,      false};
184 const color chasmForeColor =        {7,     7,      15,     4,      4,          8,          0,      false};
185 color chasmEdgeBackColor;
186 const color chasmEdgeBackColorStart ={5,    5,      25,     2,      2,          2,          0,      false};
187 const color chasmEdgeBackColorEnd = {8,     8,      20,     2,      2,          2,          0,      false};
188 const color fireForeColor =         {70,    20,     0,      15,     10,         0,          0,      true};
189 const color lavaForeColor =         {20,    20,     20,     100,    10,         0,          0,      true};
190 const color brimstoneForeColor =    {100,   50,     10,     0,      50,         40,         0,      true};
191 const color brimstoneBackColor =    {18,    12,     9,      0,      0,          5,          0,      false};
192 
193 const color lavaBackColor =         {70,    20,     0,      15,     10,         0,          0,      true};
194 const color acidBackColor =         {15,    80,     25,     5,      15,         10,         0,      true};
195 
196 const color lightningColor =        {100,   150,    500,    50,     50,         0,          50,     true};
197 const color fungusLightColor =      {2,     11,     11,     4,      3,          3,          0,      true};
198 const color lavaLightColor =        {47,    13,     0,      10,     7,          0,          0,      true};
199 const color deepWaterLightColor =   {10,    30,     100,    0,      30,         100,        0,      true};
200 
201 const color grassColor =            {15,    40,     15,     15,     50,         15,         10,     false};
202 const color deadGrassColor =        {20,    13,     0,      20,     10,         5,          10,     false};
203 const color fungusColor =           {15,    50,     50,     0,      25,         0,          30,     true};
204 const color grayFungusColor =       {30,    30,     30,     5,      5,          5,          10,     false};
205 const color foliageColor =          {25,    100,    25,     15,     0,          15,         0,      false};
206 const color deadFoliageColor =      {20,    13,     0,      30,     15,         0,          20,     false};
207 const color lichenColor =           {50,    5,      25,     10,     0,          5,          0,      true};
208 const color hayColor =              {70,    55,     5,      0,      20,         20,         0,      false};
209 const color ashForeColor =          {20,    20,     20,     0,      0,          0,          20,     false};
210 const color bonesForeColor =        {80,    80,     30,     5,      5,          35,         5,      false};
211 const color ectoplasmColor =        {45,    20,     55,     25,     0,          25,         5,      false};
212 const color forceFieldColor =       {0,     25,     25,     0,      25,         25,         0,      true};
213 const color wallCrystalColor =      {40,    40,     60,     20,     20,         40,         0,      true};
214 const color altarForeColor =        {5,     7,      9,      0,      0,          0,          0,      false};
215 const color altarBackColor =        {35,    18,     18,     0,      0,          0,          0,      false};
216 const color greenAltarBackColor =   {18,    25,     18,     0,      0,          0,          0,      false};
217 const color goldAltarBackColor =    {25,    24,     12,     0,      0,          0,          0,      false};
218 const color pedestalBackColor =     {10,    5,      20,     0,      0,          0,          0,      false};
219 
220 // monster colors
221 const color goblinColor =           {40,    30,     20,     0,      0,          0,          0,      false};
222 const color jackalColor =           {60,    42,     27,     0,      0,          0,          0,      false};
223 const color ogreColor =             {60,    25,     25,     0,      0,          0,          0,      false};
224 const color eelColor =              {30,    12,     12,     0,      0,          0,          0,      false};
225 const color goblinConjurerColor =   {67,    10,     100,    0,      0,          0,          0,      false};
226 const color spectralBladeColor =    {15,    15,     60,     0,      0,          70,         50,     true};
227 const color spectralImageColor =    {13,    0,      0,      25,     0,          0,          0,      true};
228 const color toadColor =             {40,    65,     30,     0,      0,          0,          0,      false};
229 const color trollColor =            {40,    60,     15,     0,      0,          0,          0,      false};
230 const color centipedeColor =        {75,    25,     85,     0,      0,          0,          0,      false};
231 const color dragonColor =           {20,    80,     15,     0,      0,          0,          0,      false};
232 const color krakenColor =           {100,   55,     55,     0,      0,          0,          0,      false};
233 const color salamanderColor =       {40,    10,     0,      8,      5,          0,          0,      true};
234 const color pixieColor =            {60,    60,     60,     40,     40,         40,         0,      true};
235 const color darPriestessColor =     {0,     50,     50,     0,      0,          0,          0,      false};
236 const color darMageColor =          {50,    50,     0,      0,      0,          0,          0,      false};
237 const color wraithColor =           {66,    66,     25,     0,      0,          0,          0,      false};
238 const color pinkJellyColor =        {100,   40,     40,     5,      5,          5,          20,     true};
239 const color wormColor =             {80,    60,     40,     0,      0,          0,          0,      false};
240 const color sentinelColor =         {3,     3,      30,     0,      0,          10,         0,      true};
241 const color goblinMysticColor =     {10,    67,     100,    0,      0,          0,          0,      false};
242 const color ifritColor =            {50,    10,     100,    75,     0,          20,         0,      true};
243 const color phoenixColor =          {100,   0,      0,      0,      100,        0,          0,      true};
244 
245 // light colors
246 color minersLightColor;
247 const color minersLightStartColor = {180,   180,    180,    0,      0,          0,          0,      false};
248 const color minersLightEndColor =   {90,    90,     120,    0,      0,          0,          0,      false};
249 const color torchColor =            {150,   75,     30,     0,      30,         20,         0,      true};
250 const color torchLightColor =       {75,    38,     15,     0,      15,         7,          0,      true};
251 //const color hauntedTorchColor =     {75,  30,     150,    30,     20,         0,          0,      true};
252 const color hauntedTorchColor =     {75,    20,     40,     30,     10,         0,          0,      true};
253 //const color hauntedTorchLightColor ={19,     7,       37,     8,      4,          0,          0,      true};
254 const color hauntedTorchLightColor ={67,    10,     10,     20,     4,          0,          0,      true};
255 const color ifritLightColor =       {0,     10,     150,    100,    0,          100,        0,      true};
256 //const color unicornLightColor =       {-50,   -50,    -50,    200,    200,        200,        0,      true};
257 const color unicornLightColor =     {-50,   -50,    -50,    250,    250,        250,        0,      true};
258 const color wispLightColor =        {75,    100,    250,    33,     10,         0,          0,      true};
259 const color summonedImageLightColor ={200,  0,      75,     0,      0,          0,          0,      true};
260 const color spectralBladeLightColor ={40,   0,      230,    0,      0,          0,          0,      true};
261 const color ectoplasmLightColor =   {23,    10,     28,     13,     0,          13,         3,      false};
262 const color explosionColor =        {10,    8,      2,      0,      2,          2,          0,      true};
263 const color explosiveAuraColor =    {2000,  0,      -1000,  200,    200,        0,          0,      true};
264 const color sacrificeTargetColor =  {100,   -100,   -300,   0,      100,        100,        0,      true};
265 const color dartFlashColor =        {500,   500,    500,    0,      2,          2,          0,      true};
266 const color lichLightColor =        {-50,   80,     30,     0,      0,          20,         0,      true};
267 const color forceFieldLightColor =  {10,    10,     10,     0,      50,         50,         0,      true};
268 const color crystalWallLightColor = {10,    10,     10,     0,      0,          50,         0,      true};
269 const color sunLightColor =         {100,   100,    75,     0,      0,          0,          0,      false};
270 const color fungusForestLightColor ={30,    40,     60,     0,      0,          0,          40,     true};
271 const color fungusTrampledLightColor ={10,  10,     10,     0,      50,         50,         0,      true};
272 const color redFlashColor =         {100,   10,     10,     0,      0,          0,          0,      false};
273 const color darknessPatchColor =    {-10,   -10,    -10,    0,      0,          0,          0,      false};
274 const color darknessCloudColor =    {-20,   -20,    -20,    0,      0,          0,          0,      false};
275 const color magicMapFlashColor =    {60,    20,     60,     0,      0,          0,          0,      false};
276 const color sentinelLightColor =    {20,    20,     120,    10,     10,         60,         0,      true};
277 const color telepathyColor =        {30,    30,     130,    0,      0,          0,          0,      false};
278 const color confusionLightColor =   {10,    10,     10,     10,     10,         10,         0,      true};
279 const color portalActivateLightColor ={300, 400,    500,    0,      0,          0,          0,      true};
280 const color descentLightColor =     {20,    20,     70,     0,      0,          0,          0,      false};
281 const color algaeBlueLightColor =   {20,    15,     50,     0,      0,          0,          0,      false};
282 const color algaeGreenLightColor =  {15,    50,     20,     0,      0,          0,          0,      false};
283 
284 // flare colors
285 const color scrollProtectionColor = {375,   750,    0,      0,      0,          0,          0,      true};
286 const color scrollEnchantmentColor ={250,   225,    300,    0,      0,          450,        0,      true};
287 const color potionStrengthColor =   {1000,  0,      400,    600,    0,          0,          0,      true};
288 const color empowermentFlashColor = {500,   1000,   600,    0,      500,        0,          0,      true};
289 const color genericFlashColor =     {800,   800,    800,    0,      0,          0,          0,      false};
290 const color summoningFlashColor =   {0,     0,      0,      600,    0,          1200,       0,      true};
291 const color fireFlashColor =        {750,   225,    0,      100,    50,         0,          0,      true};
292 const color explosionFlareColor =   {10000, 6000,   1000,   0,      0,          0,          0,      false};
293 const color quietusFlashColor =     {0,     -1000,  -200,   0,      0,          0,          0,      true};
294 const color slayingFlashColor =     {-1000, -200,   0,      0,      0,          0,          0,      true};
295 
296 // color multipliers
297 const color colorDim25 =            {25,    25,     25,     25,     25,         25,         25,     false};
298 const color colorMultiplier100 =    {100,   100,    100,    100,    100,        100,        100,    false};
299 const color memoryColor =           {25,    25,     50,     20,     20,         20,         0,      false};
300 const color memoryOverlay =         {25,    25,     50,     0,      0,          0,          0,      false};
301 const color magicMapColor =         {60,    20,     60,     60,     20,         60,         0,      false};
302 const color clairvoyanceColor =     {50,    90,     50,     50,     90,         50,         66,     false};
303 const color telepathyMultiplier =   {30,    30,     130,    30,     30,         130,        66,     false};
304 const color omniscienceColor =      {140,   100,    60,     140,    100,        60,         90,     false};
305 const color basicLightColor =       {180,   180,    180,    180,    180,        180,        180,    false};
306 
307 // blood colors
308 const color humanBloodColor =       {60,    20,     10,     15,     0,          0,          15,     false};
309 const color insectBloodColor =      {10,    60,     20,     0,      15,         0,          15,     false};
310 const color vomitColor =            {60,    50,     5,      0,      15,         15,         0,      false};
311 const color urineColor =            {70,    70,     40,     0,      0,          0,          10,     false};
312 const color methaneColor =          {45,    60,     15,     0,      0,          0,          0,      false};
313 
314 // gas colors
315 const color poisonGasColor =        {75,    25,     85,     0,      0,          0,          0,      false};
316 const color confusionGasColor =     {60,    60,     60,     40,     40,         40,         0,      true};
317 
318 // interface colors
319 const color itemColor =             {100,   95,     -30,    0,      0,          0,          0,      false};
320 const color blueBar =               {15,    10,     50,     0,      0,          0,          0,      false};
321 const color redBar =                {45,    10,     15,     0,      0,          0,          0,      false};
322 const color hiliteColor =           {100,   100,    0,      0,      0,          0,          0,      false};
323 const color interfaceBoxColor =     {7,     6,      15,     0,      0,          0,          0,      false};
324 const color interfaceButtonColor =  {18,    15,     38,     0,      0,          0,          0,      false};
325 const color buttonHoverColor =      {100,   70,     40,     0,      0,          0,          0,      false};
326 const color titleButtonColor =      {23,    15,     30,     0,      0,          0,          0,      false};
327 
328 const color playerInvisibleColor =  {20,    20,     30,     0,      0,          80,         0,      true};
329 const color playerInLightColor =    {100,   90,     30,     0,      0,          0,          0,      false};
330 const color playerInShadowColor =   {60,    60,     100,    0,      0,          0,          0,      false};
331 const color playerInDarknessColor = {30,    30,     65,     0,      0,          0,          0,      false};
332 
333 const color inLightMultiplierColor ={150,   150,    75,     150,    150,        75,         100,    true};
334 const color inDarknessMultiplierColor={66,  66,     120,    66,     66,         120,        66,     true};
335 
336 const color goodMessageColor =      {60,    50,     100,    0,      0,          0,          0,      false};
337 const color badMessageColor =       {100,   50,     60,     0,      0,          0,          0,      false};
338 const color advancementMessageColor ={50,   100,    60,     0,      0,          0,          0,      false};
339 const color itemMessageColor =      {100,   100,    50,     0,      0,          0,          0,      false};
340 const color flavorTextColor =       {50,    40,     90,     0,      0,          0,          0,      false};
341 const color backgroundMessageColor ={60,    20,     70,     0,      0,          0,          0,      false};
342 
343 const color superVictoryColor =     {150,   100,    300,    0,      0,          0,          0,      false};
344 
345 //const color flameSourceColor = {0, 0, 0, 65, 40, 100, 0, true}; // 1
346 //const color flameSourceColor = {0, 0, 0, 80, 50, 100, 0, true}; // 2
347 //const color flameSourceColor = {25, 13, 25, 50, 25, 50, 0, true}; // 3
348 //const color flameSourceColor = {20, 20, 20, 60, 20, 40, 0, true}; // 4
349 //const color flameSourceColor = {30, 18, 18, 70, 36, 36, 0, true}; // 7**
350 const color flameSourceColor = {20, 7, 7, 60, 40, 40, 0, true}; // 8
351 const color flameSourceColorSecondary = {7, 2, 0, 10, 0, 0, 0, true};
352 
353 //const color flameTitleColor = {0, 0, 0, 17, 10, 6, 0, true}; // pale orange
354 //const color flameTitleColor = {0, 0, 0, 7, 7, 10, 0, true}; // *pale blue*
355 const color flameTitleColor = {0, 0, 0, 9, 9, 15, 0, true}; // *pale blue**
356 //const color flameTitleColor = {0, 0, 0, 11, 11, 18, 0, true}; // *pale blue*
357 //const color flameTitleColor = {0, 0, 0, 15, 15, 9, 0, true}; // pale yellow
358 //const color flameTitleColor = {0, 0, 0, 15, 9, 15, 0, true}; // pale purple
359 
360 const color *dynamicColors[NUMBER_DYNAMIC_COLORS][3] = {
361     // used color           shallow color               deep color
362     {&minersLightColor,     &minersLightStartColor,     &minersLightEndColor},
363     {&wallBackColor,        &wallBackColorStart,        &wallBackColorEnd},
364     {&deepWaterBackColor,   &deepWaterBackColorStart,   &deepWaterBackColorEnd},
365     {&shallowWaterBackColor,&shallowWaterBackColorStart,&shallowWaterBackColorEnd},
366     {&floorBackColor,       &floorBackColorStart,       &floorBackColorEnd},
367     {&chasmEdgeBackColor,   &chasmEdgeBackColorStart,   &chasmEdgeBackColorEnd},
368 };
369 
370 const autoGenerator autoGeneratorCatalog[NUMBER_AUTOGENERATORS] = {
371 //   terrain                    layer   DF                          Machine                     reqDungeon  reqLiquid   >Depth  <Depth          freq    minIncp minSlope    maxNumber
372     // Ordinary features of the dungeon
373     {0,                         0,      DF_GRANITE_COLUMN,          0,                          FLOOR,      NOTHING,    1,      DEEPEST_LEVEL,  60,     100,    0,          4},
374     {0,                         0,      DF_CRYSTAL_WALL,            0,                          WALL,       NOTHING,    14,     DEEPEST_LEVEL,  15,     -325,   25,         5},
375     {0,                         0,      DF_LUMINESCENT_FUNGUS,      0,                          FLOOR,      NOTHING,    7,      DEEPEST_LEVEL,  15,     -300,   70,         14},
376     {0,                         0,      DF_GRASS,                   0,                          FLOOR,      NOTHING,    0,      10,             0,      1000,   -80,        10},
377     {0,                         0,      DF_DEAD_GRASS,              0,                          FLOOR,      NOTHING,    4,      9,              0,      -200,   80,         10},
378     {0,                         0,      DF_DEAD_GRASS,              0,                          FLOOR,      NOTHING,    9,      14,             0,      1200,   -80,        10},
379     {0,                         0,      DF_BONES,                   0,                          FLOOR,      NOTHING,    12,     DEEPEST_LEVEL-1,30,     0,      0,          4},
380     {0,                         0,      DF_RUBBLE,                  0,                          FLOOR,      NOTHING,    0,      DEEPEST_LEVEL-1,30,     0,      0,          4},
381     {0,                         0,      DF_FOLIAGE,                 0,                          FLOOR,      NOTHING,    0,      8,              15,     1000,   -333,       10},
382     {0,                         0,      DF_FUNGUS_FOREST,           0,                          FLOOR,      NOTHING,    13,     DEEPEST_LEVEL,  30,     -600,   50,         12},
383     {0,                         0,      DF_BUILD_ALGAE_WELL,        0,                          FLOOR,      DEEP_WATER, 10,     DEEPEST_LEVEL,  50,     0,      0,          2},
384     {STATUE_INERT,              DUNGEON,0,                          0,                          WALL,       NOTHING,    6,      DEEPEST_LEVEL-1,5,      -100,   35,         3},
385     {STATUE_INERT,              DUNGEON,0,                          0,                          FLOOR,      NOTHING,    10,     DEEPEST_LEVEL-1,50,     0,      0,          3},
386     {TORCH_WALL,                DUNGEON,0,                          0,                          WALL,       NOTHING,    6,      DEEPEST_LEVEL-1,5,      -200,   70,         12},
387 
388     // Pre-revealed traps
389     {GAS_TRAP_POISON,           DUNGEON,0,                          0,                          FLOOR,      NOTHING,    2,      4,              20,     0,      0,          1},
390     {NET_TRAP,                  DUNGEON,0,                          0,                          FLOOR,      NOTHING,    2,      5,              20,     0,      0,          1},
391     {0,                         0,      0,                          MT_PARALYSIS_TRAP_AREA,     FLOOR,      NOTHING,    2,      6,              20,     0,      0,          1},
392     {ALARM_TRAP,                DUNGEON,0,                          0,                          FLOOR,      NOTHING,    4,      7,              20,     0,      0,          1},
393     {GAS_TRAP_CONFUSION,        DUNGEON,0,                          0,                          FLOOR,      NOTHING,    2,      10,             20,     0,      0,          1},
394     {FLAMETHROWER,              DUNGEON,0,                          0,                          FLOOR,      NOTHING,    4,      12,             20,     0,      0,          1},
395     {FLOOD_TRAP,                DUNGEON,0,                          0,                          FLOOR,      NOTHING,    10,     14,             20,     0,      0,          1},
396 
397     // Hidden traps
398     {GAS_TRAP_POISON_HIDDEN,    DUNGEON,0,                          0,                          FLOOR,      NOTHING,    5,      DEEPEST_LEVEL-1,20,     100,    0,          3},
399     {NET_TRAP_HIDDEN,           DUNGEON,0,                          0,                          FLOOR,      NOTHING,    6,      DEEPEST_LEVEL-1,20,     100,    0,          3},
400     {0,                         0,      0,                          MT_PARALYSIS_TRAP_HIDDEN_AREA, FLOOR,   NOTHING,    7,      DEEPEST_LEVEL-1,20,     100,    0,          3},
401     {ALARM_TRAP_HIDDEN,         DUNGEON,0,                          0,                          FLOOR,      NOTHING,    8,      DEEPEST_LEVEL-1,20,     100,    0,          2},
402     {TRAP_DOOR_HIDDEN,          DUNGEON,0,                          0,                          FLOOR,      NOTHING,    9,      DEEPEST_LEVEL-1,20,     100,    0,          2},
403     {GAS_TRAP_CONFUSION_HIDDEN, DUNGEON,0,                          0,                          FLOOR,      NOTHING,    11,     DEEPEST_LEVEL-1,20,     100,    0,          3},
404     {FLAMETHROWER_HIDDEN,       DUNGEON,0,                          0,                          FLOOR,      NOTHING,    13,     DEEPEST_LEVEL-1,20,     100,    0,          3},
405     {FLOOD_TRAP_HIDDEN,         DUNGEON,0,                          0,                          FLOOR,      NOTHING,    15,     DEEPEST_LEVEL-1,20,     100,    0,          3},
406     {0,                         0,      0,                          MT_SWAMP_AREA,              FLOOR,      NOTHING,    1,      DEEPEST_LEVEL-1,30,     0,      0,          2},
407     {0,                         0,      DF_SUNLIGHT,                0,                          FLOOR,      NOTHING,    0,      5,              15,     500,    -150,       10},
408     {0,                         0,      DF_DARKNESS,                0,                          FLOOR,      NOTHING,    1,      15,             15,     500,    -50,        10},
409     {STEAM_VENT,                DUNGEON,0,                          0,                          FLOOR,      NOTHING,    16,     DEEPEST_LEVEL-1,30,     100,    0,          3},
410     {CRYSTAL_WALL,              DUNGEON,0,                          0,                          WALL,       NOTHING,    DEEPEST_LEVEL,DEEPEST_LEVEL,100,0,      0,          600},
411 
412     // Dewars
413     {DEWAR_CAUSTIC_GAS,         DUNGEON,DF_CARPET_AREA,             0,                          FLOOR,      NOTHING,    8,      DEEPEST_LEVEL-1,2,      0,      0,          2},
414     {DEWAR_CONFUSION_GAS,       DUNGEON,DF_CARPET_AREA,             0,                          FLOOR,      NOTHING,    8,      DEEPEST_LEVEL-1,2,      0,      0,          2},
415     {DEWAR_PARALYSIS_GAS,       DUNGEON,DF_CARPET_AREA,             0,                          FLOOR,      NOTHING,    8,      DEEPEST_LEVEL-1,2,      0,      0,          2},
416     {DEWAR_METHANE_GAS,         DUNGEON,DF_CARPET_AREA,             0,                          FLOOR,      NOTHING,    8,      DEEPEST_LEVEL-1,2,      0,      0,          2},
417 
418     // Flavor machines
419     {0,                         0,      DF_LUMINESCENT_FUNGUS,      0,                          FLOOR,      NOTHING,    DEEPEST_LEVEL,DEEPEST_LEVEL,100,0,      0,          200},
420     {0,                         0,      0,                          MT_BLOODFLOWER_AREA,        FLOOR,      NOTHING,    1,      30,             25,     140,    -10,        3},
421     {0,                         0,      0,                          MT_SHRINE_AREA,             FLOOR,      NOTHING,    5,      AMULET_LEVEL,   7,      0,      0,          1},
422     {0,                         0,      0,                          MT_IDYLL_AREA,              FLOOR,      NOTHING,    1,      5,              15,     0,      0,          1},
423     {0,                         0,      0,                          MT_REMNANT_AREA,            FLOOR,      NOTHING,    10,     DEEPEST_LEVEL,  15,     0,      0,          2},
424     {0,                         0,      0,                          MT_DISMAL_AREA,             FLOOR,      NOTHING,    7,      DEEPEST_LEVEL,  12,     0,      0,          5},
425     {0,                         0,      0,                          MT_BRIDGE_TURRET_AREA,      FLOOR,      NOTHING,    5,      DEEPEST_LEVEL-1,6,      0,      0,          2},
426     {0,                         0,      0,                          MT_LAKE_PATH_TURRET_AREA,   FLOOR,      NOTHING,    5,      DEEPEST_LEVEL-1,6,      0,      0,          2},
427     {0,                         0,      0,                          MT_TRICK_STATUE_AREA,       FLOOR,      NOTHING,    6,      DEEPEST_LEVEL-1,15,     0,      0,          3},
428     {0,                         0,      0,                          MT_SENTINEL_AREA,           FLOOR,      NOTHING,    12,     DEEPEST_LEVEL-1,10,     0,      0,          2},
429     {0,                         0,      0,                          MT_WORM_AREA,               FLOOR,      NOTHING,    12,     DEEPEST_LEVEL-1,12,     0,      0,          3},
430 };
431 
432 const floorTileType tileCatalog[NUMBER_TILETYPES] = {
433 
434     // promoteChance is in hundredths of a percent per turn
435 
436     //  char        fore color              back color      priority    ignit   fireType    discovType  promoteType     promoteChance   glowLight       flags                                                                                               description         flavorText
437 
438     // dungeon layer (this layer must have all of fore color, back color and char)
439     {   ' ',        &black,                 &black,                 100,0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       0, 0,                                                                                               "a chilly void",        ""},
440     {G_GRANITE,     &wallBackColor,         &graniteBackColor,      0,  0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE),                                                       "a rough granite wall", "The granite is split open with splinters of rock jutting out at odd angles."},
441     {G_FLOOR,       &floorForeColor,        &floorBackColor,        95, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       0, 0,                                                                                               "the ground",           ""},
442     {G_FLOOR,       &floorForeColor,        &floorBackColor,        95, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       0, 0,                                                                                               "the ground",           ""},
443     {G_CARPET,      &carpetForeColor,       &carpetBackColor,       85, 0,  DF_EMBERS,      0,          0,              0,              NO_LIGHT,       (T_IS_FLAMMABLE), (TM_VANISHES_UPON_PROMOTION),                                                     "the carpet",           "Ornate carpeting fills this room, a relic of ages past."},
444     {G_CARPET,      &marbleForeColor,       &marbleBackColor,       85, 0,  DF_EMBERS,      0,          0,              0,              NO_LIGHT,       0, 0,                                                                                               "the marble ground",    "Light from the nearby crystals catches the grain of the lavish marble floor."},
445     {G_WALL,        &wallForeColor,         &wallBackColor,         0,  0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE),                                                       "a stone wall",         "The rough stone wall is firm and unyielding."},
446     {G_CLOSED_DOOR, &doorForeColor,         &doorBackColor,         25, 50, DF_EMBERS,      0,          DF_OPEN_DOOR,   0,              NO_LIGHT,       (T_OBSTRUCTS_VISION | T_OBSTRUCTS_GAS | T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_PROMOTES_ON_STEP | TM_VISUALLY_DISTINCT), "a wooden door", "you pass through the doorway."},
447     {G_OPEN_DOOR,   &doorForeColor,         &doorBackColor,         25, 50, DF_EMBERS,      0,          DF_CLOSED_DOOR, 10000,          NO_LIGHT,       (T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_VISUALLY_DISTINCT),           "an open door",         "you pass through the doorway."},
448     {G_WALL,        &wallForeColor,         &wallBackColor,         0,  50, DF_EMBERS,      DF_SHOW_DOOR,0,             0,              NO_LIGHT,       (T_OBSTRUCTS_EVERYTHING | T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_IS_SECRET),  "a stone wall",     "The rough stone wall is firm and unyielding."},
449     {G_CLOSED_IRON_DOOR,&ironDoorForeColor, &ironDoorBackColor,     15, 50, DF_EMBERS,      0,          DF_OPEN_IRON_DOOR_INERT,0,      NO_LIGHT,       (T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_PROMOTES_WITH_KEY | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT | TM_BRIGHT_MEMORY | TM_INTERRUPT_EXPLORATION_WHEN_SEEN | TM_INVERT_WHEN_HIGHLIGHTED),  "a locked iron door",   "you search your pack but do not have a matching key."},
450     {G_OPEN_IRON_DOOR,&white,               &ironDoorBackColor,     90, 50, DF_EMBERS,      0,          0,              0,              NO_LIGHT,       (T_OBSTRUCTS_SURFACE_EFFECTS), (TM_STAND_IN_TILE | TM_VISUALLY_DISTINCT),                           "an open iron door",    "you pass through the doorway."},
451     {G_DOWN_STAIRS, &itemColor,             &stairsBackColor,       30, 0,  DF_PLAIN_FIRE,  0,          DF_REPEL_CREATURES, 0,          NO_LIGHT,       (T_OBSTRUCTS_ITEMS | T_OBSTRUCTS_SURFACE_EFFECTS), (TM_PROMOTES_ON_STEP | TM_STAND_IN_TILE | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT | TM_BRIGHT_MEMORY | TM_INTERRUPT_EXPLORATION_WHEN_SEEN | TM_INVERT_WHEN_HIGHLIGHTED), "a downward staircase",   "stairs spiral downward into the depths."},
452     {G_UP_STAIRS,   &itemColor,             &stairsBackColor,       30, 0,  DF_PLAIN_FIRE,  0,          DF_REPEL_CREATURES, 0,          NO_LIGHT,       (T_OBSTRUCTS_ITEMS | T_OBSTRUCTS_SURFACE_EFFECTS), (TM_PROMOTES_ON_STEP | TM_STAND_IN_TILE | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT | TM_BRIGHT_MEMORY | TM_INTERRUPT_EXPLORATION_WHEN_SEEN | TM_INVERT_WHEN_HIGHLIGHTED), "an upward staircase",    "stairs spiral upward."},
453     {G_DOORWAY,    &lightBlue,             &firstStairsBackColor,  30, 0,  DF_PLAIN_FIRE,  0,          DF_REPEL_CREATURES, 0,          NO_LIGHT,       (T_OBSTRUCTS_ITEMS | T_OBSTRUCTS_SURFACE_EFFECTS), (TM_PROMOTES_ON_STEP | TM_STAND_IN_TILE | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT | TM_BRIGHT_MEMORY | TM_INTERRUPT_EXPLORATION_WHEN_SEEN | TM_INVERT_WHEN_HIGHLIGHTED), "the dungeon exit",       "the gilded doors leading out of the dungeon are sealed by an invisible force."},
454     {G_DOORWAY,    &wallCrystalColor,      &firstStairsBackColor,  30, 0,  DF_PLAIN_FIRE,  0,          DF_REPEL_CREATURES, 0,          INCENDIARY_DART_LIGHT,      (T_OBSTRUCTS_ITEMS | T_OBSTRUCTS_SURFACE_EFFECTS), (TM_PROMOTES_ON_STEP | TM_STAND_IN_TILE | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT | TM_BRIGHT_MEMORY | TM_INTERRUPT_EXPLORATION_WHEN_SEEN | TM_INVERT_WHEN_HIGHLIGHTED), "a crystal portal",       "dancing lights play across the plane of this sparkling crystal portal."},
455     {G_TORCH,      &torchColor,            &wallBackColor,         0,  0,  DF_PLAIN_FIRE,  0,          0,              0,              TORCH_LIGHT,    (T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE),                                                       "a wall-mounted torch", "The torch is anchored firmly to the wall and sputters quietly in the gloom."},
456     {G_CRYSTAL,    &wallCrystalColor,      &wallCrystalColor,      0,  0,  DF_PLAIN_FIRE,  0,          0,              0,              CRYSTAL_WALL_LIGHT,(T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_ITEMS | T_OBSTRUCTS_GAS | T_OBSTRUCTS_SURFACE_EFFECTS | T_OBSTRUCTS_DIAGONAL_MOVEMENT), (TM_STAND_IN_TILE | TM_REFLECTS_BOLTS),"a crystal formation", "You feel the crystal's glossy surface and admire the dancing lights beneath."},
457     {G_PORTCULLIS, &gray,                  &floorBackColor,        10, 0,  DF_PLAIN_FIRE,  0,          DF_OPEN_PORTCULLIS, 0,          NO_LIGHT,       (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_ITEMS), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT | TM_CONNECTS_LEVEL), "a heavy portcullis", "The iron bars rattle but will not budge; they are firmly locked in place."},
458     {G_FLOOR,      &floorForeColor,        &floorBackColor,        95, 0,  DF_PLAIN_FIRE,  0,          DF_ACTIVATE_PORTCULLIS,0,       NO_LIGHT,       (0), (TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED),                                                    "the ground",           ""},
459     {G_BARRICADE,  &doorForeColor,         &floorBackColor,        10, 100,DF_WOODEN_BARRICADE_BURN,0, 0,              0,              NO_LIGHT,       (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_ITEMS | T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_VISUALLY_DISTINCT | TM_CONNECTS_LEVEL),"a dry wooden barricade","The wooden barricade is firmly set but has dried over the years. Might it burn?"},
460     {G_TORCH,     &torchLightColor,       &wallBackColor,         0,  0,  DF_PLAIN_FIRE,  0,          DF_PILOT_LIGHT, 0,              TORCH_LIGHT,    (T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED),            "a wall-mounted torch", "The torch is anchored firmly to the wall, and sputters quietly in the gloom."},
461     {G_FIRE,     &fireForeColor,         &wallBackColor,         0,  0,  DF_PLAIN_FIRE,  0,          0,              0,              TORCH_LIGHT,    (T_OBSTRUCTS_EVERYTHING | T_IS_FIRE), (TM_STAND_IN_TILE | TM_LIST_IN_SIDEBAR),                      "a fallen torch",       "The torch lies at the foot of the wall, spouting gouts of flame haphazardly."},
462     {G_TORCH,       &torchColor,            &wallBackColor,         0,  0,  DF_PLAIN_FIRE,  0,          DF_HAUNTED_TORCH_TRANSITION,0,  TORCH_LIGHT,    (T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED),            "a wall-mounted torch", "The torch is anchored firmly to the wall and sputters quietly in the gloom."},
463     {G_TORCH,       &torchColor,            &wallBackColor,         0,  0,  DF_PLAIN_FIRE,  0,          DF_HAUNTED_TORCH,2000,          TORCH_LIGHT,    (T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION),                          "a wall-mounted torch", "The torch is anchored firmly to the wall and sputters quietly in the gloom."},
464     {G_TORCH,       &hauntedTorchColor,     &wallBackColor,         0,  0,  DF_PLAIN_FIRE,  0,          0,              0,              HAUNTED_TORCH_LIGHT,(T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE),                                                   "a sputtering torch",   "A dim purple flame sputters and spits atop this wall-mounted torch."},
465     {G_WALL,        &wallForeColor,         &wallBackColor,         0,  0,  DF_PLAIN_FIRE,  DF_REVEAL_LEVER,0,          0,              NO_LIGHT,       (T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_IS_SECRET),           "a stone wall",         "The rough stone wall is firm and unyielding."},
466     {G_LEVER,       &wallForeColor,         &wallBackColor,         0,  0,  DF_PLAIN_FIRE,  0,          DF_PULL_LEVER,  0,              NO_LIGHT,       (T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_PROMOTES_ON_PLAYER_ENTRY | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT | TM_INVERT_WHEN_HIGHLIGHTED),"a lever", "The lever moves."},
467     {G_LEVER_PULLED,&wallForeColor,      &wallBackColor,         0,  0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE),                                                       "an inactive lever",    "The lever won't budge."},
468     {G_WALL,     &wallForeColor,         &wallBackColor,         0,  0,  DF_PLAIN_FIRE,  0,          DF_CREATE_LEVER,0,              NO_LIGHT,       (T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE | TM_IS_WIRED),                                         "a stone wall",         "The rough stone wall is firm and unyielding."},
469     {G_STATUE,   &wallBackColor,         &statueBackColor,       0,  0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_ITEMS | T_OBSTRUCTS_GAS | T_OBSTRUCTS_SURFACE_EFFECTS), (TM_STAND_IN_TILE),  "a marble statue",  "The cold marble statue has weathered the years with grace."},
470     {G_STATUE,   &wallBackColor,         &statueBackColor,       0,  0,  DF_PLAIN_FIRE,  0,          DF_CRACKING_STATUE,0,           NO_LIGHT,       (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_ITEMS | T_OBSTRUCTS_GAS | T_OBSTRUCTS_SURFACE_EFFECTS), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED),"a marble statue", "The cold marble statue has weathered the years with grace."},
471     {G_CRACKED_STATUE,   &wallBackColor,         &statueBackColor,       0,  0,  DF_PLAIN_FIRE,  0,          DF_STATUE_SHATTER,3500,         NO_LIGHT,       (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_ITEMS | T_OBSTRUCTS_GAS | T_OBSTRUCTS_SURFACE_EFFECTS), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_LIST_IN_SIDEBAR),"a cracking statue",    "Deep cracks ramble down the side of the statue even as you watch."},
472     {G_STATUE,   &wallBackColor,         &statueBackColor,       0,  0,  DF_PLAIN_FIRE,  0,          DF_STATUE_SHATTER,0,            NO_LIGHT,       (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_ITEMS | T_OBSTRUCTS_GAS | T_OBSTRUCTS_SURFACE_EFFECTS), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED),"a marble statue", "The cold marble statue has weathered the years with grace."},
473     {G_DOORWAY,    &wallBackColor,         &floorBackColor,        17, 0,  DF_PLAIN_FIRE,  0,          DF_PORTAL_ACTIVATE,0,           NO_LIGHT,       (T_OBSTRUCTS_ITEMS), (TM_STAND_IN_TILE | TM_IS_WIRED | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),  "a stone archway",      "This ancient moss-covered stone archway radiates a strange, alien energy."},
474     {G_WALL,     &wallForeColor,         &wallBackColor,         0,  0,  DF_PLAIN_FIRE,  0,          DF_TURRET_EMERGE,0,             NO_LIGHT,       (T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED),            "a stone wall",         "The rough stone wall is firm and unyielding."},
475     {G_WALL,     &wallForeColor,         &wallBackColor,         0,  0,  DF_PLAIN_FIRE,  0,          DF_WALL_SHATTER,0,              NO_LIGHT,       (T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED),            "a stone wall",         "The rough stone wall is firm and unyielding."},
476     {G_FLOOR,    &floorForeColor,        &floorBackColor,        95, 0,  DF_PLAIN_FIRE,  0,          DF_DARKENING_FLOOR, 0,          NO_LIGHT,       (0), (TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED),                                                    "the ground",           ""},
477     {G_FLOOR,    &floorForeColor,        &floorBackColor,        95, 0,  DF_PLAIN_FIRE,  0,          DF_DARK_FLOOR,  1500,           NO_LIGHT,       (0), (TM_VANISHES_UPON_PROMOTION),                                                                  "the ground",           ""},
478     {G_FLOOR,    &floorForeColor,        &floorBackColor,        95, 0,  DF_PLAIN_FIRE,  0,          0,              0,              DARKNESS_CLOUD_LIGHT, 0, 0,                                                                                         "the ground",           ""},
479     {G_FLOOR,    &floorForeColor,        &floorBackColor,        95, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (0), (TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_PROMOTES_ON_PLAYER_ENTRY),                      "the ground",           ""},
480     {G_ALTAR,    &altarForeColor,        &altarBackColor,        17, 0,  0,              0,          0,              0,              CANDLE_LIGHT,   (T_OBSTRUCTS_SURFACE_EFFECTS), (TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),                         "a candle-lit altar",   "a gilded altar is adorned with candles that flicker in the breeze."},
481     {G_ORB_ALTAR, &altarForeColor,        &altarBackColor,        17, 0,  0,              0,          0,              0,              CANDLE_LIGHT,   (T_OBSTRUCTS_SURFACE_EFFECTS), (TM_PROMOTES_WITH_KEY | TM_IS_WIRED | TM_LIST_IN_SIDEBAR),           "a candle-lit altar",   "ornate gilding spirals around a spherical depression in the top of the altar."},
482     {G_ALTAR,    &altarForeColor,        &altarBackColor,        17, 0,  0,              0,          DF_ITEM_CAGE_CLOSE, 0,          CANDLE_LIGHT,   (T_OBSTRUCTS_SURFACE_EFFECTS), (TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_PROMOTES_WITHOUT_KEY | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),"a candle-lit altar",   "a cage, open on the bottom, hangs over this altar on a retractable chain."},
483     {G_CLOSED_CAGE,     &altarBackColor,        &veryDarkGray,          17, 0,  0,              0,          DF_ITEM_CAGE_OPEN,  0,          CANDLE_LIGHT,   (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_SURFACE_EFFECTS), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_PROMOTES_WITH_KEY | TM_IS_WIRED | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),"an iron cage","the missing item must be replaced before you can access the remaining items."},
484     {G_SAC_ALTAR, &altarForeColor,        &altarBackColor,        17, 0,  0,              0,          DF_ALTAR_INERT, 0,              CANDLE_LIGHT,   (T_OBSTRUCTS_SURFACE_EFFECTS), (TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_PROMOTES_ON_ITEM_PICKUP | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT), "a candle-lit altar",   "a weathered stone altar is adorned with candles that flicker in the breeze."},
485     {G_SAC_ALTAR, &altarForeColor,        &altarBackColor,        17, 0,  0,              0,          DF_ALTAR_RETRACT,0,             CANDLE_LIGHT,   (T_OBSTRUCTS_SURFACE_EFFECTS), (TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_PROMOTES_ON_ITEM_PICKUP | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT), "a candle-lit altar",   "a weathered stone altar is adorned with candles that flicker in the breeze."},
486     {G_CLOSED_CAGE,     &altarBackColor,        &veryDarkGray,          17, 0,  0,              0,          DF_CAGE_DISAPPEARS, 0,          CANDLE_LIGHT,   (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_SURFACE_EFFECTS), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),"an iron cage","the cage won't budge. Perhaps there is a way to raise it nearby..."},
487     {G_PEDESTAL,    &altarForeColor,        &pedestalBackColor,     17, 0,  0,              0,          0,              0,              CANDLE_LIGHT,   (T_OBSTRUCTS_SURFACE_EFFECTS), 0,                                                                   "a stone pedestal",     "elaborate carvings wind around this ancient pedestal."},
488     {G_OPEN_CAGE,    &floorBackColor,        &veryDarkGray,          17, 0,  0,              0,          0,              0,              NO_LIGHT,       (0), (TM_STAND_IN_TILE),                                                                            "an open cage",         "the interior of the cage is filthy and reeks of decay."},
489     {G_CLOSED_CAGE,     &gray,                  &darkGray,              17, 0,  0,              0,          DF_MONSTER_CAGE_OPENS,  0,      NO_LIGHT,       (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_SURFACE_EFFECTS | T_OBSTRUCTS_GAS), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_PROMOTES_WITH_KEY | TM_LIST_IN_SIDEBAR | TM_INTERRUPT_EXPLORATION_WHEN_SEEN),"a locked iron cage","the bars of the cage are firmly set and will not budge."},
490     {G_CLOSED_COFFIN,    &bridgeFrontColor,      &bridgeBackColor,       17, 20, DF_COFFIN_BURNS,0,          DF_COFFIN_BURSTS,0,             NO_LIGHT,       (T_IS_FLAMMABLE), (TM_IS_WIRED | TM_VANISHES_UPON_PROMOTION | TM_LIST_IN_SIDEBAR),                  "a sealed coffin",      "a coffin made from thick wooden planks rests in a bed of moss."},
491     {G_OPEN_COFFIN,    &black,                 &bridgeBackColor,       17, 20, DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_LIST_IN_SIDEBAR),             "an empty coffin",      "an open wooden coffin rests in a bed of moss."},
492 
493     // traps (part of dungeon layer):
494     {G_FLOOR,    &floorForeColor,        &floorBackColor,        95, 0,  DF_POISON_GAS_CLOUD, DF_SHOW_POISON_GAS_TRAP, 0, 0,         NO_LIGHT,       (T_IS_DF_TRAP), (TM_IS_SECRET),                                                                     "the ground",           ""},
495     {G_TRAP,     &poisonGasColor,        0,                      30, 0,  DF_POISON_GAS_CLOUD, 0,     0,              0,              NO_LIGHT,       (T_IS_DF_TRAP), (TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),                                        "a caustic gas trap",   "there is a hidden pressure plate in the floor above a reserve of caustic gas."},
496     {G_FLOOR,    &floorForeColor,        &floorBackColor,        95, 0,  DF_POISON_GAS_CLOUD, DF_SHOW_TRAPDOOR,0,    0,              NO_LIGHT,       (T_AUTO_DESCENT), (TM_IS_SECRET),                                                                   "the ground",           "you plunge through a hidden trap door!"},
497     {G_CHASM,    &chasmForeColor,        &black,                 30, 0,  DF_POISON_GAS_CLOUD,0,      0,              0,              NO_LIGHT,       (T_AUTO_DESCENT), 0,                                                                                "a hole",               "you plunge through a hole in the ground!"},
498     {G_FLOOR,    &floorForeColor,        &floorBackColor,        95, 0,  0,              DF_SHOW_PARALYSIS_GAS_TRAP, 0, 0,           NO_LIGHT,       (T_IS_DF_TRAP), (TM_IS_SECRET | TM_IS_WIRED),                                                       "the ground",           ""},
499     {G_TRAP,     &pink,                  0,                      30, 0,  0,              0,          0,              0,              NO_LIGHT,       (T_IS_DF_TRAP), (TM_IS_WIRED | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),                          "a paralysis trigger",  "there is a hidden pressure plate in the floor."},
500     {G_FLOOR,    &floorForeColor,        &floorBackColor,        95, 0,  DF_PLAIN_FIRE,  DF_DISCOVER_PARALYSIS_VENT, DF_PARALYSIS_VENT_SPEW,0,NO_LIGHT,  (0), (TM_VANISHES_UPON_PROMOTION | TM_IS_SECRET | TM_IS_WIRED),                                 "the ground",           ""},
501     {G_VENT,     &pink,                  0,                      30, 0,  DF_PLAIN_FIRE,  0,          DF_PARALYSIS_VENT_SPEW,0,       NO_LIGHT,       (0), (TM_IS_WIRED | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),                                     "an inactive gas vent", "A dormant gas vent is connected to a reserve of paralytic gas."},
502     {G_FLOOR,    &floorForeColor,        &floorBackColor,        95, 0,  DF_CONFUSION_GAS_TRAP_CLOUD,DF_SHOW_CONFUSION_GAS_TRAP, 0,0,NO_LIGHT,       (T_IS_DF_TRAP), (TM_IS_SECRET),                                                                     "the ground",           ""},
503     {G_TRAP,     &confusionGasColor,     0,                      30, 0,  DF_CONFUSION_GAS_TRAP_CLOUD,0,  0,          0,              NO_LIGHT,       (T_IS_DF_TRAP), (TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),                                        "a confusion trap",     "A hidden pressure plate accompanies a reserve of psychotropic gas."},
504     {G_FLOOR,    &floorForeColor,        &floorBackColor,        95, 0,  DF_FLAMETHROWER,    DF_SHOW_FLAMETHROWER_TRAP, 0,   0,      NO_LIGHT,       (T_IS_DF_TRAP), (TM_IS_SECRET),                                                                     "the ground",           ""},
505     {G_TRAP,     &red,                   0,                      30, 0,  DF_FLAMETHROWER,    0,      0,              0,              NO_LIGHT,       (T_IS_DF_TRAP), (TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),                                        "a fire trap",          "A hidden pressure plate is connected to a crude flamethrower mechanism."},
506     {G_FLOOR,    &floorForeColor,        &floorBackColor,        95, 0,  DF_FLOOD,       DF_SHOW_FLOOD_TRAP, 0,      0,              NO_LIGHT,       (T_IS_DF_TRAP), (TM_IS_SECRET),                                                                     "the ground",           ""},
507     {G_TRAP,     &blue,                  0,                      58, 0,  DF_FLOOD,       0,          0,              0,              NO_LIGHT,       (T_IS_DF_TRAP), (TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),                                        "a flood trap",         "A hidden pressure plate is connected to floodgates in the walls and ceiling."},
508     {G_FLOOR,    &floorForeColor,        &floorBackColor,        95, 0,  DF_NET,         DF_SHOW_NET_TRAP, 0,        0,              NO_LIGHT,       (T_IS_DF_TRAP), (TM_IS_SECRET),                                                                     "the ground",           ""},
509     {G_TRAP,     &tanColor,              0,                      30, 0,  DF_NET,         0,          0,              0,              NO_LIGHT,       (T_IS_DF_TRAP), (TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),                                        "a net trap",           "you see netting subtly concealed in the ceiling over a hidden pressure plate."},
510     {G_FLOOR,    &floorForeColor,        &floorBackColor,        95, 0,  DF_AGGRAVATE_TRAP, DF_SHOW_ALARM_TRAP, 0,   0,              NO_LIGHT,       (T_IS_DF_TRAP), (TM_IS_SECRET),                                                                     "the ground",           ""},
511     {G_TRAP,     &gray,                  0,                      30, 0,  DF_AGGRAVATE_TRAP, 0,       0,              0,              NO_LIGHT,       (T_IS_DF_TRAP), (TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),                                        "an alarm trap",        "a hidden pressure plate is connected to a loud alarm mechanism."},
512     {G_FLOOR,    &floorForeColor,        &floorBackColor,        95, 0,  DF_PLAIN_FIRE,  DF_SHOW_POISON_GAS_VENT, DF_POISON_GAS_VENT_OPEN, 0, NO_LIGHT, (0), (TM_VANISHES_UPON_PROMOTION | TM_IS_SECRET | TM_IS_WIRED),                                  "the ground",           ""},
513     {G_VENT,     &floorForeColor,        0,                      30, 0,  DF_PLAIN_FIRE,  0,          DF_POISON_GAS_VENT_OPEN,0,      NO_LIGHT,       (0), (TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),        "an inactive gas vent", "An inactive gas vent is hidden in a crevice in the ground."},
514     {G_VENT,     &floorForeColor,        0,                      30, 0,  DF_PLAIN_FIRE,  0,          DF_VENT_SPEW_POISON_GAS,10000,  NO_LIGHT,       0, (TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),                                                     "a gas vent",           "Clouds of caustic gas are wafting out of a hidden vent in the floor."},
515     {G_FLOOR,    &floorForeColor,        &floorBackColor,        95, 0,  DF_PLAIN_FIRE,  DF_SHOW_METHANE_VENT, DF_METHANE_VENT_OPEN,0,NO_LIGHT,      (0), (TM_VANISHES_UPON_PROMOTION | TM_IS_SECRET | TM_IS_WIRED),                                     "the ground",           ""},
516     {G_VENT,     &floorForeColor,        0,                      30, 0,  DF_PLAIN_FIRE,  0,          DF_METHANE_VENT_OPEN,0,         NO_LIGHT,       (0), (TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),        "an inactive gas vent", "An inactive gas vent is hidden in a crevice in the ground."},
517     {G_VENT,     &floorForeColor,        0,                      30, 15, DF_EMBERS,      0,          DF_VENT_SPEW_METHANE,5000,      NO_LIGHT,       (T_IS_FLAMMABLE), (TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),                                      "a gas vent",           "Clouds of explosive gas are wafting out of a hidden vent in the floor."},
518     {G_VENT,     &gray,                  0,                      15, 15, DF_EMBERS,      0,          DF_STEAM_PUFF,  250,            NO_LIGHT,       T_OBSTRUCTS_ITEMS, (TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),                                     "a steam vent",         "A natural crevice in the floor periodically vents scalding gouts of steam."},
519     {G_TRAP,     &white,                 &chasmEdgeBackColor,    15, 0,  0,              0,          DF_MACHINE_PRESSURE_PLATE_USED,0,NO_LIGHT,      (T_IS_DF_TRAP), (TM_VANISHES_UPON_PROMOTION | TM_PROMOTES_ON_STEP | TM_IS_WIRED | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),"a pressure plate",        "There is an exposed pressure plate here. A thrown item might trigger it."},
520     {G_TRAP,     &darkGray,              &chasmEdgeBackColor,    15, 0,  0,              0,          0,              0,              NO_LIGHT,       0, (TM_LIST_IN_SIDEBAR),                                                                            "an inactive pressure plate", "This pressure plate has already been depressed."},
521     {G_MAGIC_GLYPH,    &glyphColor,            0,                      42, 0,  0,              0,          DF_INACTIVE_GLYPH,0,            GLYPH_LIGHT_DIM,(0), (TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_PROMOTES_ON_PLAYER_ENTRY | TM_VISUALLY_DISTINCT),"a magical glyph",      "A strange glyph, engraved into the floor, flickers with magical light."},
522     {G_MAGIC_GLYPH,    &glyphColor,            0,                      42, 0,  0,              0,          DF_ACTIVE_GLYPH,10000,          GLYPH_LIGHT_BRIGHT,(0), (TM_VANISHES_UPON_PROMOTION | TM_VISUALLY_DISTINCT),                                        "a glowing glyph",      "A strange glyph, engraved into the floor, radiates magical light."},
523     {G_DEWAR,    &poisonGasColor,        &darkGray,              10, 20, DF_DEWAR_CAUSTIC,0,         DF_DEWAR_CAUSTIC,0,             NO_LIGHT,       (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_SURFACE_EFFECTS | T_OBSTRUCTS_GAS | T_IS_FLAMMABLE), (TM_VANISHES_UPON_PROMOTION | TM_VISUALLY_DISTINCT | TM_LIST_IN_SIDEBAR | TM_PROMOTES_ON_PLAYER_ENTRY | TM_INVERT_WHEN_HIGHLIGHTED),"a glass dewar of caustic gas", ""},
524     {G_DEWAR,    &confusionGasColor,     &darkGray,              10, 20, DF_DEWAR_CONFUSION,0,       DF_DEWAR_CONFUSION,0,           NO_LIGHT,       (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_SURFACE_EFFECTS | T_OBSTRUCTS_GAS | T_IS_FLAMMABLE), (TM_VANISHES_UPON_PROMOTION | TM_VISUALLY_DISTINCT | TM_LIST_IN_SIDEBAR | TM_PROMOTES_ON_PLAYER_ENTRY | TM_INVERT_WHEN_HIGHLIGHTED),"a glass dewar of confusion gas", ""},
525     {G_DEWAR,    &pink,                  &darkGray,              10, 20, DF_DEWAR_PARALYSIS,0,       DF_DEWAR_PARALYSIS,0,           NO_LIGHT,       (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_SURFACE_EFFECTS | T_OBSTRUCTS_GAS | T_IS_FLAMMABLE), (TM_VANISHES_UPON_PROMOTION | TM_VISUALLY_DISTINCT | TM_LIST_IN_SIDEBAR | TM_PROMOTES_ON_PLAYER_ENTRY | TM_INVERT_WHEN_HIGHLIGHTED),"a glass dewar of paralytic gas", ""},
526     {G_DEWAR,    &methaneColor,          &darkGray,              10, 20, DF_DEWAR_METHANE,0,         DF_DEWAR_METHANE,0,             NO_LIGHT,       (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_SURFACE_EFFECTS | T_OBSTRUCTS_GAS | T_IS_FLAMMABLE), (TM_VANISHES_UPON_PROMOTION | TM_VISUALLY_DISTINCT | TM_LIST_IN_SIDEBAR | TM_PROMOTES_ON_PLAYER_ENTRY | TM_INVERT_WHEN_HIGHLIGHTED),"a glass dewar of methane gas", ""},
527 
528     // liquid layer
529     {G_LIQUID,   &deepWaterForeColor,    &deepWaterBackColor,    40, 100,DF_STEAM_ACCUMULATION,  0,  0,              0,              NO_LIGHT,       (T_IS_FLAMMABLE | T_IS_DEEP_WATER), (TM_ALLOWS_SUBMERGING | TM_STAND_IN_TILE | TM_EXTINGUISHES_FIRE),"the murky waters",    "the current tugs you in all directions."},
530     {0,             &shallowWaterForeColor, &shallowWaterBackColor, 55, 0,  DF_STEAM_ACCUMULATION,  0,  0,              0,              NO_LIGHT,       (0), (TM_STAND_IN_TILE | TM_EXTINGUISHES_FIRE | TM_ALLOWS_SUBMERGING),                              "shallow water",        "the water is cold and reaches your knees."},
531     {G_BOG,      &mudForeColor,          &mudBackColor,          55, 0,  DF_PLAIN_FIRE,  0,          DF_METHANE_GAS_PUFF, 100,       NO_LIGHT,       (0), (TM_STAND_IN_TILE | TM_ALLOWS_SUBMERGING),                                                     "a bog",                "you are knee-deep in thick, foul-smelling mud."},
532     {G_CHASM,    &chasmForeColor,        &black,                 40, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (T_AUTO_DESCENT), (TM_STAND_IN_TILE),                                                               "a chasm",              "you plunge downward into the chasm!"},
533     {G_FLOOR,    &white,                 &chasmEdgeBackColor,    80, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       0, 0,                                                                                               "the brink of a chasm", "chilly winds blow upward from the stygian depths."},
534     {G_FLOOR,    &floorForeColor,        &floorBackColor,        95, 0,  DF_PLAIN_FIRE,  0,          DF_SPREADABLE_COLLAPSE,0,       NO_LIGHT,       (0), (TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED),                                                    "the ground",           ""},
535     {G_FLOOR,    &white,                 &chasmEdgeBackColor,    45, 0,  DF_PLAIN_FIRE,  0,          DF_COLLAPSE_SPREADS,2500,       NO_LIGHT,       (0), (TM_VANISHES_UPON_PROMOTION),                                                                  "the crumbling ground", "cracks are appearing in the ground beneath your feet!"},
536     {G_LIQUID,   &fireForeColor,         &lavaBackColor,         40, 0,  DF_OBSIDIAN,    0,          0,              0,              LAVA_LIGHT,     (T_LAVA_INSTA_DEATH), (TM_STAND_IN_TILE | TM_ALLOWS_SUBMERGING),                                    "lava",                 "searing heat rises from the lava."},
537     {G_LIQUID,   &fireForeColor,         &lavaBackColor,         40, 0,  DF_OBSIDIAN,    0,          DF_RETRACTING_LAVA, 0,          LAVA_LIGHT,     (T_LAVA_INSTA_DEATH), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_ALLOWS_SUBMERGING),"lava","searing heat rises from the lava."},
538     {G_LIQUID,   &fireForeColor,         &lavaBackColor,         40, 0,  DF_OBSIDIAN,    0,          DF_OBSIDIAN_WITH_STEAM, -1500,  LAVA_LIGHT,     (T_LAVA_INSTA_DEATH), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_ALLOWS_SUBMERGING),       "cooling lava",         "searing heat rises from the lava."},
539     {G_FLOOR,    &floorForeColor,        &floorBackColor,        90, 0,  DF_PLAIN_FIRE,  0,          0,              0,              SUN_LIGHT,      (0), (TM_STAND_IN_TILE),                                                                            "a patch of sunlight",  "sunlight streams through cracks in the ceiling."},
540     {G_FLOOR,    &floorForeColor,        &floorBackColor,        90, 0,  DF_PLAIN_FIRE,  0,          0,              0,              DARKNESS_PATCH_LIGHT,   (0), 0,                                                                                     "a patch of shadows",   "this area happens to be cloaked in shadows -- perhaps a safe place to hide."},
541     {G_ASHES,      &brimstoneForeColor,    &brimstoneBackColor,    40, 100,DF_INERT_BRIMSTONE, 0,      DF_INERT_BRIMSTONE, 10,         NO_LIGHT,       (T_IS_FLAMMABLE | T_SPONTANEOUSLY_IGNITES), 0,                                                      "hissing brimstone",    "the jagged brimstone hisses and spits ominously as it crunches under your feet."},
542     {G_ASHES,      &brimstoneForeColor,    &brimstoneBackColor,    40, 0,  DF_INERT_BRIMSTONE, 0,      DF_ACTIVE_BRIMSTONE, 800,       NO_LIGHT,       (T_SPONTANEOUSLY_IGNITES), 0,                                                                       "hissing brimstone",    "the jagged brimstone hisses and spits ominously as it crunches under your feet."},
543     {G_FLOOR,    &darkGray,              &obsidianBackColor,     50, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       0, 0,                                                                                               "the obsidian ground",  "the ground has fused into obsidian."},
544     {G_BRIDGE,   &bridgeFrontColor,      &bridgeBackColor,       45, 50, DF_BRIDGE_FIRE, 0,          0,              0,              NO_LIGHT,       (T_IS_FLAMMABLE), (TM_VANISHES_UPON_PROMOTION),                                                     "a rickety rope bridge","the rickety rope bridge creaks underfoot."},
545     {G_BRIDGE,   &bridgeFrontColor,      &bridgeBackColor,       45, 50, DF_BRIDGE_FALL, 0,          DF_BRIDGE_FALL, 10000,          NO_LIGHT,       (T_IS_FLAMMABLE), (TM_VANISHES_UPON_PROMOTION),                                                     "a plummeting bridge",  "the bridge is plunging into the chasm before your eyes!"},
546     {G_BRIDGE,   &bridgeFrontColor,      &bridgeBackColor,       45, 50, DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (T_IS_FLAMMABLE), (TM_VANISHES_UPON_PROMOTION),                                                     "a rickety rope bridge","the rickety rope bridge is staked to the edge of the chasm."},
547     {G_FLOOR,    &white,                 &chasmEdgeBackColor,    20, 50, DF_BRIDGE_FIRE, 0,          0,              0,              NO_LIGHT,       0, 0,                                                                                               "a stone bridge",       "the narrow stone bridge winds precariously across the chasm."},
548     {0,             &shallowWaterForeColor, &shallowWaterBackColor, 60, 0,  DF_STEAM_ACCUMULATION,  0,  DF_SPREADABLE_WATER,0,          NO_LIGHT,       (0), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_EXTINGUISHES_FIRE | TM_ALLOWS_SUBMERGING),   "shallow water",    "the water is cold and reaches your knees."},
549     {0,             &shallowWaterForeColor, &shallowWaterBackColor, 60, 0,  DF_STEAM_ACCUMULATION,  0,  DF_WATER_SPREADS,2500,          NO_LIGHT,       (0), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_EXTINGUISHES_FIRE | TM_ALLOWS_SUBMERGING), "shallow water",        "the water is cold and reaches your knees."},
550     {G_FLOOR,      &mudForeColor,          &mudBackColor,          55, 0,  DF_PLAIN_FIRE,  0,          DF_MUD_ACTIVATE,0,              NO_LIGHT,       (0), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_ALLOWS_SUBMERGING),          "a bog",                "you are knee-deep in thick, foul-smelling mud."},
551     {G_FLOOR,    &white,                 &lightBlue,             35, 100,DF_DEEP_WATER_THAW, 0,      DF_DEEP_WATER_MELTING, -100,    NO_LIGHT,       (T_IS_FLAMMABLE), (TM_VANISHES_UPON_PROMOTION),                                                     "ice",                  "a sheet of ice extends into the water, ripples frozen into its glossy surface."},
552     {G_FLOOR,    &black,                 &lightBlue,             35, 100,DF_DEEP_WATER_THAW, 0,      DF_DEEP_WATER_THAW, 10000,      NO_LIGHT,       (T_IS_FLAMMABLE), (TM_VANISHES_UPON_PROMOTION),                                                     "melting ice",          "cracks extend across the surface of the ice as it melts before your eyes."},
553     {G_FLOOR,    &white,                 &lightBlue,             35, 100,DF_SHALLOW_WATER_THAW, 0,   DF_SHALLOW_WATER_MELTING, -100, NO_LIGHT,       (T_IS_FLAMMABLE), (TM_VANISHES_UPON_PROMOTION),                                                     "ice",                  "a sheet of ice extends into the water, ripples frozen into its glossy surface."},
554     {G_FLOOR,    &black,                 &lightBlue,             35, 100,DF_DEEP_WATER_THAW, 0,      DF_SHALLOW_WATER_THAW, 10000,   NO_LIGHT,       (T_IS_FLAMMABLE), (TM_VANISHES_UPON_PROMOTION),                                                     "melting ice",          "cracks extend across the surface of the ice as it melts before your eyes."},
555 
556     // surface layer
557     {G_CHASM,    &chasmForeColor,        &black,                 9,  0,  DF_PLAIN_FIRE,  0,          DF_HOLE_DRAIN,  -1000,          NO_LIGHT,       (T_AUTO_DESCENT), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION),                                  "a hole",               "you plunge downward into the hole!"},
558     {G_CHASM,    &chasmForeColor,        &black,                 9,  0,  DF_PLAIN_FIRE,  0,          DF_HOLE_DRAIN,  -1000,          DESCENT_LIGHT,  (T_AUTO_DESCENT), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION),                                  "a hole",               "you plunge downward into the hole!"},
559     {G_FLOOR,    &white,                 &chasmEdgeBackColor,    50, 0,  DF_PLAIN_FIRE,  0,          0,              -500,           NO_LIGHT,       (0), (TM_VANISHES_UPON_PROMOTION),                                                                  "translucent ground",   "chilly gusts of air blow upward through the translucent floor."},
560     {G_LIQUID,   &deepWaterForeColor,    &deepWaterBackColor,    41, 100,DF_STEAM_ACCUMULATION,  0,  DF_FLOOD_DRAIN, -200,           NO_LIGHT,       (T_IS_FLAMMABLE | T_IS_DEEP_WATER), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_EXTINGUISHES_FIRE | TM_ALLOWS_SUBMERGING), "sloshing water", "roiling water floods the room."},
561     {0,             &shallowWaterForeColor, &shallowWaterBackColor, 50, 0,  DF_STEAM_ACCUMULATION,  0,  DF_PUDDLE,      -100,           NO_LIGHT,       (0), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_EXTINGUISHES_FIRE | TM_ALLOWS_SUBMERGING), "shallow water",        "knee-deep water drains slowly into holes in the floor."},
562     {G_GRASS,    &grassColor,            0,                      60, 15, DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION),                                  "grass-like fungus",    "grass-like fungus crunches underfoot."},
563     {G_GRASS,    &deadGrassColor,        0,                      60, 40, DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION),                                  "withered fungus",      "dead fungus covers the ground."},
564     {G_GRASS,    &grayFungusColor,       0,                      51, 10, DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION),                                  "withered fungus",      "groping tendrils of pale fungus rise from the muck."},
565     {G_GRASS,    &fungusColor,           0,                      60, 10, DF_PLAIN_FIRE,  0,          0,              0,              FUNGUS_LIGHT,   (T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION),                                  "luminescent fungus",   "luminescent fungus casts a pale, eerie glow."},
566     {G_LICHEN,   &lichenColor,           0,                      60, 50, DF_PLAIN_FIRE,  0,          DF_LICHEN_GROW, 10000,          NO_LIGHT,       (T_CAUSES_POISON | T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION),                "deadly lichen",        "venomous barbs cover the quivering tendrils of this fast-growing lichen."},
567     {G_GRASS,    &hayColor,              &refuseBackColor,       57, 50, DF_STENCH_BURN, 0,          0,              0,              NO_LIGHT,       (T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION),                                  "filthy hay",           "a pile of hay, matted with filth, has been arranged here as a makeshift bed."},
568     {G_FLOOR_ALT,    &humanBloodColor,       0,                      80, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (0), (TM_STAND_IN_TILE),                                                                            "a pool of blood",      "the floor is splattered with blood."},
569     {G_FLOOR_ALT,    &insectBloodColor,      0,                      80, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (0), (TM_STAND_IN_TILE),                                                                            "a pool of green blood", "the floor is splattered with green blood."},
570     {G_FLOOR_ALT,    &poisonGasColor,        0,                      80, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (0), (TM_STAND_IN_TILE),                                                                            "a pool of purple blood", "the floor is splattered with purple blood."},
571     {G_FLOOR_ALT,    &acidBackColor,         0,                      80, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       0, 0,                                                                                               "a puddle of acid",     "the floor is splattered with acid."},
572     {G_FLOOR_ALT,    &vomitColor,            0,                      80, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (0), (TM_STAND_IN_TILE),                                                                            "a puddle of vomit",    "the floor is caked with vomit."},
573     {G_FLOOR_ALT,    &urineColor,            0,                      80, 0,  DF_PLAIN_FIRE,  0,          0,              100,            NO_LIGHT,       (0), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION),                                               "a puddle of urine",    "a puddle of urine covers the ground."},
574     {G_FLOOR_ALT,    &white,                 0,                      80, 0,  DF_PLAIN_FIRE,  0,          0,              0,              UNICORN_POOP_LIGHT,(0), (TM_STAND_IN_TILE),                                                                         "unicorn poop",         "a pile of lavender-scented unicorn poop sparkles with rainbow light."},
575     {G_FLOOR_ALT,    &wormColor,             0,                      80, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (0), (TM_STAND_IN_TILE),                                                                            "a pool of worm entrails", "worm viscera cover the ground."},
576     {G_ASHES,      &ashForeColor,          0,                      80, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (0), (TM_STAND_IN_TILE),                                                                            "a pile of ashes",      "charcoal and ash crunch underfoot."},
577     {G_ASHES,      &ashForeColor,          0,                      87, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (0), (TM_STAND_IN_TILE),                                                                            "burned carpet",        "the carpet has been scorched by an ancient fire."},
578     {G_FLOOR_ALT,    &shallowWaterBackColor, 0,                      80, 20, 0,              0,          0,              100,            NO_LIGHT,       (T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION),                                  "a puddle of water",    "a puddle of water covers the ground."},
579     {G_BONES,    &bonesForeColor,        0,                      70, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (0), (TM_STAND_IN_TILE),                                                                            "a pile of bones",      "unidentifiable bones, yellowed with age, litter the ground."},
580     {G_RUBBLE,    &gray,                  0,                      70, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (0), (TM_STAND_IN_TILE),                                                                            "a pile of rubble",     "rocky rubble covers the ground."},
581     {G_BONES,    &mudBackColor,          &refuseBackColor,       50, 20, DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (0), (TM_STAND_IN_TILE),                                                                            "a pile of filthy effects","primitive tools, carvings and trinkets are strewn about the area."},
582     {G_FLOOR_ALT,    &white,                 0,                      70, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (0), (TM_STAND_IN_TILE),                                                                            "shattered glass",      "jagged chunks of glass from the broken dewar litter the ground."},
583     {G_FLOOR_ALT,    &ectoplasmColor,        0,                      70, 0,  DF_PLAIN_FIRE,  0,          0,              0,              ECTOPLASM_LIGHT,(0), (TM_STAND_IN_TILE),                                                                            "ectoplasmic residue",  "a thick, glowing substance has congealed on the ground."},
584     {G_ASHES,      &fireForeColor,         0,                      70, 0,  DF_PLAIN_FIRE,  0,          DF_ASH,         300,            EMBER_LIGHT,    (0), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION),                                               "sputtering embers",    "sputtering embers cover the ground."},
585     {G_WEB,      &white,                 0,                      19, 100,DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (T_ENTANGLES | T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_VISUALLY_DISTINCT),"a spiderweb",       "thick, sticky spiderwebs fill the area."},
586     {G_NET,      &brown,                 0,                      19, 40, DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (T_ENTANGLES | T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_VISUALLY_DISTINCT),"a net",             "a dense tangle of netting fills the area."},
587     {G_FOLIAGE,  &foliageColor,          0,                      45, 15, DF_PLAIN_FIRE,  0,          DF_TRAMPLED_FOLIAGE, 0,         NO_LIGHT,       (T_OBSTRUCTS_VISION | T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_PROMOTES_ON_STEP), "dense foliage",   "dense foliage fills the area, thriving on what sunlight trickles in."},
588     {G_FOLIAGE,  &deadFoliageColor,      0,                      45, 80, DF_PLAIN_FIRE,  0,          DF_SMALL_DEAD_GRASS, 0,         NO_LIGHT,       (T_OBSTRUCTS_VISION | T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_PROMOTES_ON_STEP), "dead foliage",    "the decaying husk of a fungal growth fills the area."},
589     {G_GRASS,    &foliageColor,   0,                      60, 15, DF_PLAIN_FIRE,  0,          DF_FOLIAGE_REGROW, 100,         NO_LIGHT,       (T_IS_FLAMMABLE), (TM_VANISHES_UPON_PROMOTION),                                                     "trampled foliage",     "dense foliage fills the area, thriving on what sunlight trickles in."},
590     {G_FOLIAGE,  &fungusForestLightColor,0,                      45, 15, DF_PLAIN_FIRE,  0,          DF_TRAMPLED_FUNGUS_FOREST, 0,   FUNGUS_FOREST_LIGHT,(T_OBSTRUCTS_VISION | T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_PROMOTES_ON_STEP),"a luminescent fungal forest", "luminescent fungal growth fills the area, groping upward from the rich soil."},
591     {G_GRASS,    &fungusForestLightColor,0,               60, 15, DF_PLAIN_FIRE,  0,          DF_FUNGUS_FOREST_REGROW, 100,   FUNGUS_LIGHT,   (T_IS_FLAMMABLE), (TM_VANISHES_UPON_PROMOTION),                                                     "trampled fungal foliage", "luminescent fungal growth fills the area, groping upward from the rich soil."},
592     {G_CRYSTAL,  &forceFieldColor,       &forceFieldColor,       0,  0,  0,              0,          DF_FORCEFIELD_MELT, -200,       FORCEFIELD_LIGHT, (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_GAS | T_OBSTRUCTS_DIAGONAL_MOVEMENT), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_PROMOTES_ON_CREATURE),       "a green crystal",      "The translucent green crystal is melting away in front of your eyes."},
593     {G_CRYSTAL,  &black,                 &forceFieldColor,       0,  0,  0,              0,          0,              -10000,         FORCEFIELD_LIGHT, (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_GAS | T_OBSTRUCTS_DIAGONAL_MOVEMENT), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_PROMOTES_ON_CREATURE),     "a dissolving crystal",     "The translucent green crystal is melting away in front of your eyes."},
594     {G_MAGIC_GLYPH,    &sacredGlyphColor,      0,                      7, 0,  0,              0,          0,              0,              SACRED_GLYPH_LIGHT, (T_SACRED), 0,                                                                                  "a sacred glyph",       "a sacred glyph adorns the floor, glowing with a powerful warding enchantment."},
595     {G_CHAIN_TOP_LEFT,&gray,                  0,                      20, 0,  0,              0,          0,              0,              NO_LIGHT,       0, 0,                                                                                               "an iron manacle",      "a thick iron manacle is anchored to the ceiling."},
596     {G_CHAIN_BOTTOM_RIGHT, &gray,             0,                      20, 0,  0,              0,          0,              0,              NO_LIGHT,       0, 0,                                                                                               "an iron manacle",      "a thick iron manacle is anchored to the floor."},
597     {G_CHAIN_TOP_RIGHT, &gray,                0,                      20, 0,  0,              0,          0,              0,              NO_LIGHT,       0, 0,                                                                                               "an iron manacle",      "a thick iron manacle is anchored to the ceiling."},
598     {G_CHAIN_BOTTOM_LEFT, &gray,              0,                      20, 0,  0,              0,          0,              0,              NO_LIGHT,       0, 0,                                                                                               "an iron manacle",      "a thick iron manacle is anchored to the floor."},
599     {G_CHAIN_TOP,     &gray,                  0,                      20, 0,  0,              0,          0,              0,              NO_LIGHT,       0, 0,                                                                                               "an iron manacle",      "a thick iron manacle is anchored to the wall."},
600     {G_CHAIN_BOTTOM,  &gray,                  0,                      20, 0,  0,              0,          0,              0,              NO_LIGHT,       0, 0,                                                                                               "an iron manacle",      "a thick iron manacle is anchored to the wall."},
601     {G_CHAIN_LEFT,    &gray,                  0,                      20, 0,  0,              0,          0,              0,              NO_LIGHT,       0, 0,                                                                                               "an iron manacle",      "a thick iron manacle is anchored to the wall."},
602     {G_CHAIN_RIGHT,   &gray,                  0,                      20, 0,  0,              0,          0,              0,              NO_LIGHT,       0, 0,                                                                                               "an iron manacle",      "a thick iron manacle is anchored to the wall."},
603     {0,             0,                      0,                      1,  0,  0,              0,          0,              10000,          PORTAL_ACTIVATE_LIGHT,(0), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION),                                         "blinding light",       "blinding light streams out of the archway."},
604     {0,             0,                      0,                      100,0,  0,              0,          0,              10000,          GLYPH_LIGHT_BRIGHT,(0), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION),                                            "a red glow",           "a red glow fills the area."},
605 
606     // fire tiles
607     {G_FIRE,     &fireForeColor,         0,                      10, 0,  0,              0,          DF_EMBERS,      500,            FIRE_LIGHT,     (T_IS_FIRE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_VISUALLY_DISTINCT),                "billowing flames",     "flames billow upward."},
608     {G_FIRE,     &fireForeColor,         0,                      10, 0,  0,              0,          0,              2500,           BRIMSTONE_FIRE_LIGHT,(T_IS_FIRE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_VISUALLY_DISTINCT),           "sulfurous flames",     "sulfurous flames leap from the unstable bed of brimstone."},
609     {G_FIRE,     &fireForeColor,         0,                      10, 0,  0,              0,          DF_OBSIDIAN,    5000,           FIRE_LIGHT,     (T_IS_FIRE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_VISUALLY_DISTINCT),                "clouds of infernal flame", "billowing infernal flames eat at the floor."},
610     {G_FIRE,     &fireForeColor,         0,                      10, 0,  0,              0,          0,              8000,           FIRE_LIGHT,     (T_IS_FIRE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_VISUALLY_DISTINCT),                "a cloud of burning gas", "burning gas fills the air with flame."},
611     {G_FIRE,     &yellow,                0,                      10, 0,  0,              0,          0,              10000,          EXPLOSION_LIGHT,(T_IS_FIRE | T_CAUSES_EXPLOSIVE_DAMAGE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_VISUALLY_DISTINCT), "a violent explosion", "the force of the explosion slams into you."},
612     {G_FIRE,     &white,                 0,                      10, 0,  0,              0,          0,              10000,          INCENDIARY_DART_LIGHT ,(T_IS_FIRE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_VISUALLY_DISTINCT),         "a flash of fire",      "flames burst out of the incendiary dart."},
613     {G_FIRE,     &white,                 0,                      10, 0,  0,              0,          DF_EMBERS,      3000,           FIRE_LIGHT,     (T_IS_FIRE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_VISUALLY_DISTINCT),                "crackling flames",     "crackling flames rise from the blackened item."},
614     {G_FIRE,     &white,                 0,                      10, 0,  0,              0,          DF_EMBERS,      3000,           FIRE_LIGHT,     (T_IS_FIRE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_VISUALLY_DISTINCT),                "greasy flames",        "greasy flames rise from the corpse."},
615 
616     // gas layer
617     {   ' ',        0,                      &poisonGasColor,        35, 100,DF_GAS_FIRE,    0,          0,              0,              NO_LIGHT,       (T_IS_FLAMMABLE | T_CAUSES_DAMAGE), (TM_STAND_IN_TILE | TM_GAS_DISSIPATES),                         "a cloud of caustic gas", "you can feel the purple gas eating at your flesh."},
618     {   ' ',        0,                      &confusionGasColor,     35, 100,DF_GAS_FIRE,    0,          0,              0,              CONFUSION_GAS_LIGHT,(T_IS_FLAMMABLE | T_CAUSES_CONFUSION), (TM_STAND_IN_TILE | TM_GAS_DISSIPATES_QUICKLY),          "a cloud of confusion gas", "the rainbow-colored gas tickles your brain."},
619     {   ' ',        0,                      &vomitColor,            35, 100,DF_GAS_FIRE,    0,          0,              0,              NO_LIGHT,       (T_IS_FLAMMABLE | T_CAUSES_NAUSEA), (TM_STAND_IN_TILE | TM_GAS_DISSIPATES_QUICKLY),                 "a cloud of putrescence", "the stench of rotting flesh is overpowering."},
620     {   ' ',        0,                      &vomitColor,            35, 0,  DF_GAS_FIRE,    0,          0,              0,              NO_LIGHT,       (T_CAUSES_NAUSEA), (TM_STAND_IN_TILE | TM_GAS_DISSIPATES_QUICKLY),                                  "a cloud of putrid smoke", "you retch violently at the smell of the greasy smoke."},
621     {   ' ',        0,                      &pink,                  35, 100,DF_GAS_FIRE,    0,          0,              0,              NO_LIGHT,       (T_IS_FLAMMABLE | T_CAUSES_PARALYSIS), (TM_STAND_IN_TILE | TM_GAS_DISSIPATES_QUICKLY),              "a cloud of paralytic gas", "the pale gas causes your muscles to stiffen."},
622     {   ' ',        0,                      &methaneColor,          35, 100,DF_GAS_FIRE,    0,          DF_EXPLOSION_FIRE, 0,           NO_LIGHT,       (T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_EXPLOSIVE_PROMOTE),                                        "a cloud of explosive gas", "the smell of explosive swamp gas fills the air."},
623     {   ' ',        0,                      &white,                 35, 0,  DF_GAS_FIRE,    0,          0,              0,              NO_LIGHT,       (T_CAUSES_DAMAGE), (TM_STAND_IN_TILE | TM_GAS_DISSIPATES_QUICKLY),                                  "a cloud of scalding steam", "scalding steam fills the air!"},
624     {   ' ',        0,                      0,                      35, 0,  DF_GAS_FIRE,    0,          0,              0,              DARKNESS_CLOUD_LIGHT,   (0), (TM_STAND_IN_TILE),                                                                    "a cloud of supernatural darkness", "everything is obscured by an aura of supernatural darkness."},
625     {   ' ',        0,                      &darkRed,               35, 0,  DF_GAS_FIRE,    0,          0,              0,              NO_LIGHT,       (T_CAUSES_HEALING), (TM_STAND_IN_TILE | TM_GAS_DISSIPATES_QUICKLY),                                 "a cloud of healing spores", "bloodwort spores, renowned for their healing properties, fill the air."},
626 
627     // bloodwort pods
628     {G_BLOODWORT_STALK,  &bloodflowerForeColor,  &bloodflowerBackColor,  10, 20, DF_PLAIN_FIRE,  0,          DF_BLOODFLOWER_PODS_GROW, 100,  NO_LIGHT,       (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_ITEMS | T_IS_FLAMMABLE), (TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT), "a bloodwort stalk", "this spindly plant grows seed pods famous for their healing properties."},
629     {G_BLOODWORT_POD,     &bloodflowerPodForeColor, 0,                    11, 20, DF_BLOODFLOWER_POD_BURST,0, DF_BLOODFLOWER_POD_BURST, 0,    NO_LIGHT,       (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_ITEMS | T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_PROMOTES_ON_PLAYER_ENTRY | TM_VISUALLY_DISTINCT | TM_INVERT_WHEN_HIGHLIGHTED), "a bloodwort pod", "the bloodwort seed pod bursts, releasing a cloud of healing spores."},
630 
631     // shrine accoutrements
632     {G_BEDROLL,   &black,                 &bedrollBackColor,      57, 50, DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (T_IS_FLAMMABLE), (TM_VANISHES_UPON_PROMOTION),                                                     "an abandoned bedroll", "a bedroll lies in the corner, disintegrating with age."},
633 
634     // algae
635     {G_FLOOR,    &floorForeColor,        &floorBackColor,        95, 0,  DF_PLAIN_FIRE,  0,          DF_ALGAE_1,     100,            NO_LIGHT,       0, 0,                                                                                               "the ground",           ""},
636     {G_LIQUID,   &deepWaterForeColor,    &deepWaterBackColor,    40, 100,DF_STEAM_ACCUMULATION,  0,  DF_ALGAE_1,     500,            LUMINESCENT_ALGAE_BLUE_LIGHT,(T_IS_FLAMMABLE | T_IS_DEEP_WATER), (TM_STAND_IN_TILE | TM_EXTINGUISHES_FIRE | TM_ALLOWS_SUBMERGING),  "luminescent waters",   "blooming algae fills the waters with a swirling luminescence."},
637     {G_LIQUID,   &deepWaterForeColor,    &deepWaterBackColor,    39, 100,DF_STEAM_ACCUMULATION,  0,  DF_ALGAE_REVERT,300,            LUMINESCENT_ALGAE_GREEN_LIGHT,(T_IS_FLAMMABLE | T_IS_DEEP_WATER), (TM_STAND_IN_TILE | TM_EXTINGUISHES_FIRE | TM_ALLOWS_SUBMERGING), "luminescent waters",   "blooming algae fills the waters with a swirling luminescence."},
638 
639     // ancient spirit terrain
640     {G_VINE,     &lichenColor,           0,                      19, 100,DF_PLAIN_FIRE,  0,          DF_ANCIENT_SPIRIT_GRASS,1000,   NO_LIGHT,       (T_ENTANGLES | T_CAUSES_DAMAGE | T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_VISUALLY_DISTINCT | TM_PROMOTES_ON_PLAYER_ENTRY),"thorned vines",       "thorned vines make a rustling noise as they quiver restlessly."}, // +tile
641     {G_GRASS,    &grassColor,            0,                      60, 15, DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (T_IS_FLAMMABLE), (TM_STAND_IN_TILE),                                                               "a tuft of grass",      "tufts of lush grass have improbably pushed upward through the stone ground."},
642 
643     // Yendor amulet floor tile
644     {G_FLOOR,    &floorForeColor,        &floorBackColor,        95, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       0, (TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_PROMOTES_ON_ITEM_PICKUP),                         "the ground",           ""},
645 
646     // commutation device
647     {G_ORB_ALTAR, &altarForeColor,        &greenAltarBackColor,   17, 0,  0,              0,          DF_ALTAR_COMMUTE,0,             NO_LIGHT,       (T_OBSTRUCTS_SURFACE_EFFECTS), (TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_SWAP_ENCHANTS_ACTIVATION | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),    "a commutation altar",  "crude diagrams on this altar and its twin invite you to place items upon them."},
648     {G_ORB_ALTAR, &black,                 &greenAltarBackColor,   17, 0,  0,              0,          0,              0,              NO_LIGHT,       (T_OBSTRUCTS_SURFACE_EFFECTS), (TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),                         "a scorched altar",     "scorch marks cover the surface of the altar, but it is cold to the touch."},
649     {G_PIPES,    &veryDarkGray,          0,                      45, 0,  DF_PLAIN_FIRE,  0,          DF_INERT_PIPE,  0,              CONFUSION_GAS_LIGHT, (0), (TM_IS_WIRED | TM_VANISHES_UPON_PROMOTION),                                               "glowing glass pipes",  "glass pipes are set into the floor and emit a soft glow of shifting color."},
650     {G_PIPES,    &black,                 0,                      45, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (0), (0),                                                                                           "charred glass pipes",  "the inside of the glass pipes are charred."},
651 
652     // resurrection altar
653     {G_ALTAR,    &altarForeColor,        &goldAltarBackColor,    17, 0,  0,              0,          DF_ALTAR_RESURRECT,0,           CANDLE_LIGHT,   (T_OBSTRUCTS_SURFACE_EFFECTS), (TM_IS_WIRED | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),           "a resurrection altar", "the souls of the dead surround you. A deceased ally might be called back."},
654     {G_ALTAR,    &black,                 &goldAltarBackColor,    16, 0,  0,              0,          0,              0,              NO_LIGHT,       (T_OBSTRUCTS_SURFACE_EFFECTS), (TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),                         "a scorched altar",     "scorch marks cover the surface of the altar, but it is cold to the touch."},
655     {0,             0,                      0,                      95, 0,  0,              0,          0,              0,              NO_LIGHT,       (0), (TM_IS_WIRED | TM_PROMOTES_ON_PLAYER_ENTRY),                                                   "the ground",           ""},
656 
657     // sacrifice altar
658     {G_SAC_ALTAR, &altarForeColor,        &altarBackColor,        17, 0,  0,              0,          DF_SACRIFICE_ALTAR,0,           CANDLE_LIGHT,   (T_OBSTRUCTS_SURFACE_EFFECTS), (TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT), "a sacrificial altar", "demonological symbols decorate this altar."},
659     {G_SAC_ALTAR, &altarForeColor,        &altarBackColor,        17, 0,  0,              0,          DF_SACRIFICE_COMPLETE,0,        CANDLE_LIGHT,   (T_OBSTRUCTS_SURFACE_EFFECTS), (TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT | TM_PROMOTES_ON_SACRIFICE_ENTRY), "a sacrifice altar",    "demonological symbols decorate this altar."},
660     {G_LIQUID,   &fireForeColor,         &lavaBackColor,         40, 0,  DF_OBSIDIAN,    0,          0,              0,              LAVA_LIGHT,     (T_LAVA_INSTA_DEATH), (TM_ALLOWS_SUBMERGING | TM_LIST_IN_SIDEBAR),                                  "a sacrificial pit",      "the smell of burnt flesh lingers over this pit of lava."},
661     {G_WALL,     &altarBackColor,        &veryDarkGray,          17, 0,  0,              0,          DF_SACRIFICE_CAGE_ACTIVE,   0,  CANDLE_LIGHT,   (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_SURFACE_EFFECTS), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT),"an iron cage","the cage won't budge. Perhaps there is a way to raise it nearby..."},
662     {G_STATUE,   &wallBackColor,         &statueBackColor,       0,  0,  DF_PLAIN_FIRE,  0,          0,              0,              DEMONIC_STATUE_LIGHT,   (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_ITEMS | T_OBSTRUCTS_GAS | T_OBSTRUCTS_SURFACE_EFFECTS), (TM_STAND_IN_TILE),  "a demonic statue", "An obsidian statue of a leering demon looms over the room."},
663 
664     // doorway statues
665     {G_STATUE,   &wallBackColor,         &statueBackColor,       0,  0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_ITEMS | T_OBSTRUCTS_GAS | T_OBSTRUCTS_SURFACE_EFFECTS), (TM_STAND_IN_TILE | TM_CONNECTS_LEVEL),  "a marble statue",  "The cold marble statue has weathered the years with grace."},
666     {G_STATUE,   &wallBackColor,         &statueBackColor,       0,  0,  DF_PLAIN_FIRE,  0,          DF_CRACKING_STATUE,0,           NO_LIGHT,       (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_ITEMS | T_OBSTRUCTS_GAS | T_OBSTRUCTS_SURFACE_EFFECTS), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_CONNECTS_LEVEL),"a marble statue", "The cold marble statue has weathered the years with grace."},
667 
668     // extensible stone bridge
669     {G_CHASM,    &chasmForeColor,        &black,                 40, 0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (T_AUTO_DESCENT), (TM_STAND_IN_TILE),                                                               "a chasm",              "you plunge downward into the chasm!"},
670     {G_FLOOR,    &white,                 &chasmEdgeBackColor,    40, 0,  DF_PLAIN_FIRE,  0,          DF_BRIDGE_ACTIVATE,6000,        NO_LIGHT,       (0), (TM_VANISHES_UPON_PROMOTION),                                                                  "a stone bridge",       "the narrow stone bridge is extending across the chasm."},
671     {G_FLOOR,    &white,                 &chasmEdgeBackColor,    80, 0,  DF_PLAIN_FIRE,  0,          DF_BRIDGE_ACTIVATE_ANNOUNCE,0,  NO_LIGHT,       (0), (TM_IS_WIRED),                                                                                 "the brink of a chasm", "chilly winds blow upward from the stygian depths."},
672 
673     // rat trap
674     {G_WALL,     &wallForeColor,         &wallBackColor,         0,  0,  DF_PLAIN_FIRE,  0,          DF_WALL_CRACK,  0,              NO_LIGHT,       (T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED),            "a stone wall",         "The rough stone wall is firm and unyielding."},
675     {G_WALL,     &wallForeColor,         &wallBackColor,         0,  0,  DF_PLAIN_FIRE,  0,          DF_WALL_SHATTER,500,            NO_LIGHT,       (T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_LIST_IN_SIDEBAR),     "a cracking wall",      "Cracks are running ominously across the base of this rough stone wall."},
676 
677     // electric crystals
678     {G_ELECTRIC_CRYSTAL, &wallCrystalColor, &graniteBackColor,   0,  0,  DF_PLAIN_FIRE,  0,          DF_ELECTRIC_CRYSTAL_ON, 0,      NO_LIGHT,       (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_ITEMS | T_OBSTRUCTS_GAS | T_OBSTRUCTS_SURFACE_EFFECTS), (TM_STAND_IN_TILE | TM_PROMOTES_ON_ELECTRICITY | TM_IS_CIRCUIT_BREAKER | TM_IS_WIRED | TM_LIST_IN_SIDEBAR), "a darkened crystal globe", "A slight electric shock startles you when you touch the inert crystal globe."},
679     {G_ELECTRIC_CRYSTAL, &white,         &wallCrystalColor,      0,  0,  DF_PLAIN_FIRE,  0,          0,              0,              CRYSTAL_WALL_LIGHT,(T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_ITEMS | T_OBSTRUCTS_GAS | T_OBSTRUCTS_SURFACE_EFFECTS), (TM_STAND_IN_TILE | TM_LIST_IN_SIDEBAR), "a shining crystal globe", "Crackling light streams out of the crystal globe."},
680     {G_LEVER,    &wallForeColor,         &wallBackColor,         0,  0,  DF_PLAIN_FIRE,  0,          DF_TURRET_LEVER,0,              NO_LIGHT,       (T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_PROMOTES_ON_PLAYER_ENTRY | TM_LIST_IN_SIDEBAR | TM_VISUALLY_DISTINCT | TM_INVERT_WHEN_HIGHLIGHTED),"a lever", "The lever moves."},
681 
682     // worm tunnels
683     {0,             0,                      0,                      100,0,  0,              0,          DF_WORM_TUNNEL_MARKER_ACTIVE,0, NO_LIGHT,       (0), (TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED),                                                    "",                     ""},
684     {0,             0,                      0,                      100,0,  0,              0,          DF_GRANITE_CRUMBLES,-2000,      NO_LIGHT,       (0), (TM_VANISHES_UPON_PROMOTION),                                                                  "a rough granite wall", "The granite is split open with splinters of rock jutting out at odd angles."},
685     {G_WALL,     &wallForeColor,         &wallBackColor,         0,  0,  DF_PLAIN_FIRE,  0,          DF_WALL_SHATTER,0,              NO_LIGHT,       (T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE | TM_VANISHES_UPON_PROMOTION | TM_IS_WIRED | TM_CONNECTS_LEVEL),"a stone wall", "The rough stone wall is firm and unyielding."},
686 
687     // zombie crypt
688     {G_FIRE,     &fireForeColor,         &statueBackColor,       0,  0,  DF_PLAIN_FIRE,  0,          0,              0,              BURNING_CREATURE_LIGHT, (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_ITEMS | T_IS_FIRE), (TM_STAND_IN_TILE | TM_LIST_IN_SIDEBAR),"a ceremonial brazier",      "The ancient brazier smolders with a deep crimson flame."},
689 
690     // goblin warren
691     {G_FLOOR,    &mudBackColor,          &refuseBackColor,       85, 0,  DF_STENCH_SMOLDER,0,        0,              0,              NO_LIGHT,       (T_IS_FLAMMABLE), (TM_VANISHES_UPON_PROMOTION),                                                     "the mud floor",        "Rotting animal matter has been ground into the mud floor; the stench is awful."},
692     {G_WALL,     &mudWallForeColor,      &mudWallBackColor,      0,  0,  DF_PLAIN_FIRE,  0,          0,              0,              NO_LIGHT,       (T_OBSTRUCTS_EVERYTHING), (TM_STAND_IN_TILE),                                                       "a mud-covered wall",   "A malodorous layer of clay and fecal matter coats the wall."},
693     {G_DOORWAY,    &mudWallForeColor,      &refuseBackColor,       25, 50, DF_EMBERS,      0,          0,              0,              NO_LIGHT,       (T_OBSTRUCTS_VISION | T_OBSTRUCTS_GAS | T_IS_FLAMMABLE), (TM_STAND_IN_TILE | TM_VISUALLY_DISTINCT), "hanging animal skins", "you push through the animal skins that hang across the threshold."},
694 };
695 
696 // Features in the gas layer use the startprob as volume, ignore probdecr, and spawn in only a single point.
697 // Intercepts and slopes are in units of 0.01.
698 dungeonFeature dungeonFeatureCatalog[NUMBER_DUNGEON_FEATURES] = {
699     // tileType                 layer       start   decr    fl  txt  flare   fCol fRad  propTerrain subseqDF
700     {0}, // nothing
701     {GRANITE,                   DUNGEON,    80,     70,     DFF_CLEAR_OTHER_TERRAIN},
702     {CRYSTAL_WALL,              DUNGEON,    200,    50,     DFF_CLEAR_OTHER_TERRAIN},
703     {LUMINESCENT_FUNGUS,        SURFACE,    60,     8,      DFF_BLOCKED_BY_OTHER_LAYERS},
704     {GRASS,                     SURFACE,    75,     5,      DFF_BLOCKED_BY_OTHER_LAYERS},
705     {DEAD_GRASS,                SURFACE,    75,     5,      DFF_BLOCKED_BY_OTHER_LAYERS,    "", 0,  0,  0,      0,          DF_DEAD_FOLIAGE},
706     {BONES,                     SURFACE,    75,     23,     0},
707     {RUBBLE,                    SURFACE,    45,     23,     0},
708     {FOLIAGE,                   SURFACE,    100,    33,     (DFF_BLOCKED_BY_OTHER_LAYERS)},
709     {FUNGUS_FOREST,             SURFACE,    100,    45,     (DFF_BLOCKED_BY_OTHER_LAYERS)},
710     {DEAD_FOLIAGE,              SURFACE,    50,     30,     (DFF_BLOCKED_BY_OTHER_LAYERS)},
711 
712     // misc. liquids
713     {SUNLIGHT_POOL,             LIQUID,     65,     6,      0},
714     {DARKNESS_PATCH,            LIQUID,     65,     11,     0},
715 
716     // Dungeon features spawned during gameplay:
717 
718     // revealed secrets
719     {DOOR,                      DUNGEON,    0,      0,      0, "", GENERIC_FLASH_LIGHT},
720     {GAS_TRAP_POISON,           DUNGEON,    0,      0,      0, "", GENERIC_FLASH_LIGHT},
721     {GAS_TRAP_PARALYSIS,        DUNGEON,    0,      0,      0, "", GENERIC_FLASH_LIGHT},
722     {CHASM_EDGE,                LIQUID,     100,    100,    0, "", GENERIC_FLASH_LIGHT},
723     {TRAP_DOOR,                 LIQUID,     0,      0,      DFF_CLEAR_OTHER_TERRAIN, "", GENERIC_FLASH_LIGHT, 0, 0, 0, DF_SHOW_TRAPDOOR_HALO},
724     {GAS_TRAP_CONFUSION,        DUNGEON,    0,      0,      0, "", GENERIC_FLASH_LIGHT},
725     {FLAMETHROWER,              DUNGEON,    0,      0,      0, "", GENERIC_FLASH_LIGHT},
726     {FLOOD_TRAP,                DUNGEON,    0,      0,      0, "", GENERIC_FLASH_LIGHT},
727     {NET_TRAP,                  DUNGEON,    0,      0,      0, "", GENERIC_FLASH_LIGHT},
728     {ALARM_TRAP,                DUNGEON,    0,      0,      0, "", GENERIC_FLASH_LIGHT},
729 
730     // bloods
731     // Start probability is actually a percentage for bloods.
732     // Base probability is 15 + (damage * 2/3), and then take the given percentage of that.
733     // If it's a gas, we multiply the base by an additional 100.
734     // Thus to get a starting gas volume of a poison potion (1000), with a hit for 10 damage, use a starting probability of 48.
735     {RED_BLOOD,                 SURFACE,    100,    25,     0},
736     {GREEN_BLOOD,               SURFACE,    100,    25,     0},
737     {PURPLE_BLOOD,              SURFACE,    100,    25,     0},
738     {WORM_BLOOD,                SURFACE,    100,    25,     0},
739     {ACID_SPLATTER,             SURFACE,    200,    25,     0},
740     {ASH,                       SURFACE,    50,     25,     0},
741     {EMBERS,                    SURFACE,    125,    25,     0},
742     {ECTOPLASM,                 SURFACE,    110,    25,     0},
743     {RUBBLE,                    SURFACE,    33,     25,     0},
744     {ROT_GAS,                   GAS,        12,     0,      0},
745 
746     // monster effects
747     {VOMIT,                     SURFACE,    30,     10,     0},
748     {POISON_GAS,                GAS,        2000,   0,      0},
749     {GAS_EXPLOSION,             SURFACE,    350,    100,    0,  "", EXPLOSION_FLARE_LIGHT},
750     {RED_BLOOD,                 SURFACE,    150,    30,     0},
751     {FLAMEDANCER_FIRE,          SURFACE,    200,    75,     0},
752 
753     // mutation effects
754     {GAS_EXPLOSION,             SURFACE,    350,    100,    0,  "The corpse detonates with terrifying force!", EXPLOSION_FLARE_LIGHT},
755     {LICHEN,                    SURFACE,    70,     60,     0,  "Poisonous spores burst from the corpse!"},
756 
757     // misc
758     {NOTHING,                   GAS,        0,      0,      DFF_EVACUATE_CREATURES_FIRST},
759     {ROT_GAS,                   GAS,        15,     0,      0},
760     {STEAM,                     GAS,        325,    0,      0},
761     {STEAM,                     GAS,        15,     0,      0},
762     {METHANE_GAS,               GAS,        2,      0,      0},
763     {EMBERS,                    SURFACE,    0,      0,      0},
764     {URINE,                     SURFACE,    65,     25,     0},
765     {UNICORN_POOP,              SURFACE,    65,     40,     0},
766     {PUDDLE,                    SURFACE,    13,     25,     0},
767     {ASH,                       SURFACE,    0,      0,      0},
768     {ECTOPLASM,                 SURFACE,    0,      0,      0},
769     {FORCEFIELD,                SURFACE,    100,    50,     0},
770     {FORCEFIELD_MELT,           SURFACE,    0,      0,      0},
771     {SACRED_GLYPH,              SURFACE,    100,    100,    0,  "", EMPOWERMENT_LIGHT},
772     {LICHEN,                    SURFACE,    2,      100,    (DFF_BLOCKED_BY_OTHER_LAYERS)}, // Lichen won't spread through lava.
773     {RUBBLE,                    SURFACE,    45,     23,     (DFF_ACTIVATE_DORMANT_MONSTER)},
774     {RUBBLE,                    SURFACE,    0,      0,      (DFF_ACTIVATE_DORMANT_MONSTER)},
775 
776     {SPIDERWEB,                 SURFACE,    15,     12,     0},
777     {SPIDERWEB,                 SURFACE,    100,    39,     0},
778 
779     {ANCIENT_SPIRIT_VINES,      SURFACE,    75,     70,     0},
780     {ANCIENT_SPIRIT_GRASS,      SURFACE,    50,     47,     0},
781 
782     // foliage
783     {TRAMPLED_FOLIAGE,          SURFACE,    0,      0,      0},
784     {DEAD_GRASS,                SURFACE,    75,     75,     0},
785     {FOLIAGE,                   SURFACE,    0,      0,      (DFF_BLOCKED_BY_OTHER_LAYERS)},
786     {TRAMPLED_FUNGUS_FOREST,    SURFACE,    0,      0,      0},
787     {FUNGUS_FOREST,             SURFACE,    0,      0,      (DFF_BLOCKED_BY_OTHER_LAYERS)},
788 
789     // brimstone
790     {ACTIVE_BRIMSTONE,          LIQUID,     0,      0,      0},
791     {INERT_BRIMSTONE,           LIQUID,     0,      0,      0,  "", 0,  0,  0,      0,          DF_BRIMSTONE_FIRE},
792 
793     // bloodwort
794     {BLOODFLOWER_POD,           SURFACE,    60,     60,     DFF_EVACUATE_CREATURES_FIRST},
795     {BLOODFLOWER_POD,           SURFACE,    10,     10,     DFF_EVACUATE_CREATURES_FIRST},
796     {HEALING_CLOUD,             GAS,        350,    0,      0},
797 
798     // dewars
799     {POISON_GAS,                GAS,        20000,  0,      0, "the dewar shatters and pressurized caustic gas explodes outward!", 0, &poisonGasColor, 4, 0, DF_DEWAR_GLASS},
800     {CONFUSION_GAS,             GAS,        20000,  0,      0, "the dewar shatters and pressurized confusion gas explodes outward!", 0, &confusionGasColor, 4, 0, DF_DEWAR_GLASS},
801     {PARALYSIS_GAS,             GAS,        20000,  0,      0, "the dewar shatters and pressurized paralytic gas explodes outward!", 0, &pink, 4, 0, DF_DEWAR_GLASS},
802     {METHANE_GAS,               GAS,        20000,  0,      0, "the dewar shatters and pressurized methane gas explodes outward!", 0, &methaneColor, 4, 0, DF_DEWAR_GLASS},
803     {BROKEN_GLASS,              SURFACE,    100,    70,     0},
804     {CARPET,                    DUNGEON,    120,    20,     0},
805 
806     // algae
807     {DEEP_WATER_ALGAE_WELL,     DUNGEON,    0,      0,      DFF_SUPERPRIORITY},
808     {DEEP_WATER_ALGAE_1,        LIQUID,     50,     100,    0,  "", 0,  0,   0,     DEEP_WATER, DF_ALGAE_2},
809     {DEEP_WATER_ALGAE_2,        LIQUID,     0,      0,      0},
810     {DEEP_WATER,                LIQUID,     0,      0,      DFF_SUPERPRIORITY},
811 
812     // doors, item cages, altars, glyphs, guardians -- reusable machine components
813     {OPEN_DOOR,                 DUNGEON,    0,      0,      0},
814     {DOOR,                      DUNGEON,    0,      0,      0},
815     {OPEN_IRON_DOOR_INERT,      DUNGEON,    0,      0,      0,  "", GENERIC_FLASH_LIGHT},
816     {ALTAR_CAGE_OPEN,           DUNGEON,    0,      0,      0,  "the cages lift off of the altars as you approach.", GENERIC_FLASH_LIGHT},
817     {ALTAR_CAGE_CLOSED,         DUNGEON,    0,      0,      (DFF_EVACUATE_CREATURES_FIRST), "the cages lower to cover the altars.", GENERIC_FLASH_LIGHT},
818     {ALTAR_INERT,               DUNGEON,    0,      0,      0},
819     {FLOOR_FLOODABLE,           DUNGEON,    0,      0,      0,  "the altar retracts into the ground with a grinding sound.", GENERIC_FLASH_LIGHT},
820     {PORTAL_LIGHT,              SURFACE,    0,      0,      (DFF_EVACUATE_CREATURES_FIRST | DFF_ACTIVATE_DORMANT_MONSTER), "the archway flashes, and you catch a glimpse of another world!"},
821     {MACHINE_GLYPH_INACTIVE,    DUNGEON,    0,      0,      0},
822     {MACHINE_GLYPH,             DUNGEON,    0,      0,      0},
823     {GUARDIAN_GLOW,             SURFACE,    0,      0,      0,  ""},
824     {GUARDIAN_GLOW,             SURFACE,    0,      0,      0,  "the glyph beneath you glows, and the guardians take a step!"},
825     {GUARDIAN_GLOW,             SURFACE,    0,      0,      0,  "the mirrored totem flashes, reflecting the red glow of the glyph beneath you."},
826     {MACHINE_GLYPH,             DUNGEON,    200,    95,     DFF_BLOCKED_BY_OTHER_LAYERS},
827     {WALL_LEVER,                DUNGEON,    0,      0,      0,  "you notice a lever hidden behind a loose stone in the wall.", GENERIC_FLASH_LIGHT},
828     {WALL_LEVER_PULLED,         DUNGEON,    0,      0,      0},
829     {WALL_LEVER_HIDDEN,         DUNGEON,    0,      0,      0},
830 
831     {BRIDGE_FALLING,            LIQUID,     200,    100,    0, "", 0, 0, 0, BRIDGE},
832     {CHASM,                     LIQUID,     0,      0,      0, "", GENERIC_FLASH_LIGHT, 0, 0, 0, DF_BRIDGE_FALL_PREP},
833 
834     // fire
835     {PLAIN_FIRE,                SURFACE,    0,      0,      0},
836     {GAS_FIRE,                  SURFACE,    0,      0,      0},
837     {GAS_EXPLOSION,             SURFACE,    60,     17,     0},
838     {DART_EXPLOSION,            SURFACE,    0,      0,      0},
839     {BRIMSTONE_FIRE,            SURFACE,    0,      0,      0},
840     {0,                         0,          0,      0,      0,  "the rope bridge snaps from the heat and plunges into the chasm!", FALLEN_TORCH_FLASH_LIGHT,    0,  0,      0,      DF_BRIDGE_FALL},
841     {PLAIN_FIRE,                SURFACE,    100,    37,     0},
842     {EMBERS,                    SURFACE,    0,      0,      0},
843     {EMBERS,                    SURFACE,    100,    94,     0},
844     {OBSIDIAN,                  SURFACE,    0,      0,      0},
845     {ITEM_FIRE,                 SURFACE,    0,      0,      0,  "", FALLEN_TORCH_FLASH_LIGHT},
846     {CREATURE_FIRE,             SURFACE,    0,      0,      0,  "", FALLEN_TORCH_FLASH_LIGHT},
847 
848     {FLOOD_WATER_SHALLOW,       SURFACE,    225,    37,     0,  "", 0,  0,  0,      0,          DF_FLOOD_2},
849     {FLOOD_WATER_DEEP,          SURFACE,    175,    37,     0,  "the area is flooded as water rises through imperceptible holes in the ground."},
850     {FLOOD_WATER_SHALLOW,       SURFACE,    10,     25,     0},
851     {HOLE,                      SURFACE,    200,    100,    0},
852     {HOLE_EDGE,                 SURFACE,    0,      0,      0},
853 
854     // ice effects
855     {ICE_DEEP,                  LIQUID,     150,    50,     DFF_EVACUATE_CREATURES_FIRST,   "", 0,  0,  0,      DEEP_WATER,         DF_ALGAE_1_FREEZE},
856     {ICE_DEEP,                  LIQUID,     150,    50,     DFF_EVACUATE_CREATURES_FIRST,   "", 0,  0,  0,      DEEP_WATER_ALGAE_1, DF_ALGAE_2_FREEZE},
857     {ICE_DEEP,                  LIQUID,     150,    50,     DFF_EVACUATE_CREATURES_FIRST,   "", 0,  0,  0,      DEEP_WATER_ALGAE_2, DF_SHALLOW_WATER_FREEZE},
858     {ICE_DEEP_MELT,             LIQUID,     0,      0,      0},
859     {DEEP_WATER,                LIQUID,     0,      0,      0},
860     {ICE_SHALLOW,               LIQUID,     100,    50,     DFF_EVACUATE_CREATURES_FIRST,   "", 0,  0,  0,      SHALLOW_WATER},
861     {ICE_SHALLOW_MELT,          LIQUID,     0,      0,      0},
862     {SHALLOW_WATER,             LIQUID,     0,      0,      0},
863 
864     // gas trap effects
865     {POISON_GAS,                GAS,        1000,   0,      0,  "a cloud of caustic gas sprays upward from the floor!"},
866     {CONFUSION_GAS,             GAS,        300,    0,      0,  "a sparkling cloud of confusion gas sprays upward from the floor!"},
867     {NETTING,                   SURFACE,    300,    90,     0,  "a net falls from the ceiling!"},
868     {0,                         0,          0,      0,      DFF_AGGRAVATES_MONSTERS, "a piercing shriek echoes through the nearby rooms!", 0, 0, DCOLS/2},
869     {METHANE_GAS,               GAS,        10000,  0,      0}, // debugging toy
870 
871     // potions
872     {POISON_GAS,                GAS,        1000,   0,      0,  "", 0,  &poisonGasColor,4},
873     {PARALYSIS_GAS,             GAS,        1000,   0,      0,  "", 0,  &pink,4},
874     {CONFUSION_GAS,             GAS,        1000,   0,      0,  "", 0,  &confusionGasColor, 4},
875     {PLAIN_FIRE,                SURFACE,    100,    37,     0,  "", EXPLOSION_FLARE_LIGHT},
876     {DARKNESS_CLOUD,            GAS,        200,    0,      0},
877     {HOLE_EDGE,                 SURFACE,    300,    100,    0,  "", 0,  &darkBlue,3,0,          DF_HOLE_2},
878     {LICHEN,                    SURFACE,    70,     60,     0},
879 
880     // other items
881     {PLAIN_FIRE,                SURFACE,    100,    45,     0,  "", 0,  &yellow,3},
882     {HOLE_GLOW,                 SURFACE,    200,    100,    DFF_SUBSEQ_EVERYWHERE,  "", 0,  &darkBlue,3,0,          DF_STAFF_HOLE_EDGE},
883     {HOLE_EDGE,                 SURFACE,    100,    100,    0},
884 
885     // machine components
886 
887     // commutation altars
888     {COMMUTATION_ALTAR_INERT,   DUNGEON,    0,      0,      0,  "the items on the two altars flash with a brilliant light!", SCROLL_ENCHANTMENT_LIGHT},
889     {PIPE_GLOWING,              SURFACE,    90,     60,     0},
890     {PIPE_INERT,                SURFACE,    0,      0,      0,  "", SCROLL_ENCHANTMENT_LIGHT},
891 
892     // resurrection altars
893     {RESURRECTION_ALTAR_INERT,  DUNGEON,    0,      0,      DFF_RESURRECT_ALLY, "An old friend emerges from a bloom of sacred light!", EMPOWERMENT_LIGHT},
894     {MACHINE_TRIGGER_FLOOR_REPEATING, LIQUID, 300,  100,    DFF_SUPERPRIORITY, "", 0, 0, 0, CARPET},
895 
896     // sacrifice altars
897     {SACRIFICE_ALTAR,           DUNGEON,    0,      0,      0,  "a demonic presence whispers its demand: \"Bring to me the marked sacrifice!\""},
898     {SACRIFICE_LAVA,            DUNGEON,    0,      0,      0,  "demonic cackling echoes through the room as the altar plunges downward!"},
899     {ALTAR_CAGE_RETRACTABLE,    DUNGEON,    0,      0,      0},
900 
901     // coffin bursts open to reveal vampire:
902     {COFFIN_OPEN,               DUNGEON,    0,      0,      DFF_ACTIVATE_DORMANT_MONSTER,   "the coffin opens and a dark figure rises!", 0, &darkGray, 3},
903     {PLAIN_FIRE,                SURFACE,    0,      0,      DFF_ACTIVATE_DORMANT_MONSTER,   "as flames begin to lick the coffin, its tenant bursts forth!", 0, 0, 0, 0, DF_EMBERS_PATCH},
904     {MACHINE_TRIGGER_FLOOR,     DUNGEON,    200,    100,    0},
905 
906     // throwing tutorial:
907     {ALTAR_INERT,               DUNGEON,    0,      0,      0,  "the cage lifts off of the altar.", GENERIC_FLASH_LIGHT},
908     {TRAP_DOOR,                 LIQUID,     225,    100,    (DFF_CLEAR_OTHER_TERRAIN | DFF_SUBSEQ_EVERYWHERE), "", 0, 0, 0, 0, DF_SHOW_TRAPDOOR_HALO},
909     {LAVA,                      LIQUID,     225,    100,    (DFF_CLEAR_OTHER_TERRAIN)},
910     {MACHINE_PRESSURE_PLATE_USED,DUNGEON,   0,      0,      0},
911 
912     // rat trap:
913     {RAT_TRAP_WALL_CRACKING,    DUNGEON,    0,      0,      0,  "a scratching sound emanates from the nearby walls!", 0, 0, 0, 0, DF_RUBBLE},
914 
915     // wooden barricade at entrance:
916     {PLAIN_FIRE,                SURFACE,    0,      0,      0,  "flames quickly consume the wooden barricade."},
917 
918     // wooden barricade around altar:
919     {WOODEN_BARRICADE,          DUNGEON,    220,    100,    (DFF_TREAT_AS_BLOCKING | DFF_SUBSEQ_EVERYWHERE), "", 0, 0, 0, 0, DF_SMALL_DEAD_GRASS},
920 
921     // shallow water flood machine:
922     {MACHINE_FLOOD_WATER_SPREADING, LIQUID, 0,      0,      0,  "you hear a heavy click, and the nearby water begins flooding the area!"},
923     {SHALLOW_WATER,             LIQUID,     0,      0,      0},
924     {MACHINE_FLOOD_WATER_SPREADING,LIQUID,  100,    100,    0,  "", 0,  0,  0,      FLOOR_FLOODABLE,            DF_SHALLOW_WATER},
925     {MACHINE_FLOOD_WATER_DORMANT,LIQUID,    250,    100,    (DFF_TREAT_AS_BLOCKING), "", 0, 0, 0, 0,            DF_SPREADABLE_DEEP_WATER_POOL},
926     {DEEP_WATER,                LIQUID,     90,     100,    (DFF_CLEAR_OTHER_TERRAIN | DFF_PERMIT_BLOCKING)},
927 
928     // unstable floor machine:
929     {MACHINE_COLLAPSE_EDGE_SPREADING,LIQUID,0,      0,      0,  "you hear a deep rumbling noise as the floor begins to collapse!"},
930     {CHASM,                     LIQUID,     0,      0,      DFF_CLEAR_OTHER_TERRAIN, "", 0, 0, 0, 0, DF_SHOW_TRAPDOOR_HALO},
931     {MACHINE_COLLAPSE_EDGE_SPREADING,LIQUID,100,    100,    0,  "", 0,  0,  0,  FLOOR_FLOODABLE,    DF_COLLAPSE},
932     {MACHINE_COLLAPSE_EDGE_DORMANT,LIQUID,  0,      0,      0},
933 
934     // levitation bridge machine:
935     {CHASM_WITH_HIDDEN_BRIDGE_ACTIVE,LIQUID,100,    100,    0,  "", 0, 0,  0,  CHASM_WITH_HIDDEN_BRIDGE,  DF_BRIDGE_APPEARS},
936     {CHASM_WITH_HIDDEN_BRIDGE_ACTIVE,LIQUID,100,    100,    0,  "a stone bridge extends from the floor with a grinding sound.", 0, 0,  0,  CHASM_WITH_HIDDEN_BRIDGE,  DF_BRIDGE_APPEARS},
937     {STONE_BRIDGE,              LIQUID,     0,      0,      0},
938     {MACHINE_CHASM_EDGE,        LIQUID,     100,    100,    0},
939 
940     // retracting lava pool:
941     {LAVA_RETRACTABLE,          LIQUID,     100,    100,    0,  "", 0, 0,  0,  LAVA},
942     {LAVA_RETRACTING,           LIQUID,     0,      0,      0,  "hissing fills the air as the lava begins to cool."},
943     {OBSIDIAN,                  SURFACE,    0,      0,      0,  "", 0,  0,  0,      0,          DF_STEAM_ACCUMULATION},
944 
945     // hidden poison vent machine:
946     {MACHINE_POISON_GAS_VENT_DORMANT,DUNGEON,0,     0,      0,  "you notice an inactive gas vent hidden in a crevice of the floor.", GENERIC_FLASH_LIGHT},
947     {MACHINE_POISON_GAS_VENT,   DUNGEON,    0,      0,      0,  "deadly purple gas starts wafting out of hidden vents in the floor!"},
948     {PORTCULLIS_CLOSED,         DUNGEON,    0,      0,      DFF_EVACUATE_CREATURES_FIRST,   "with a heavy mechanical sound, an iron portcullis falls from the ceiling!", GENERIC_FLASH_LIGHT},
949     {PORTCULLIS_DORMANT,        DUNGEON,    0,      0,      0,  "the portcullis slowly rises from the ground into a slot in the ceiling.", GENERIC_FLASH_LIGHT},
950     {POISON_GAS,                GAS,        25,     0,      0},
951 
952     // hidden methane vent machine:
953     {MACHINE_METHANE_VENT_DORMANT,DUNGEON,0,        0,      0,  "you notice an inactive gas vent hidden in a crevice of the floor.", GENERIC_FLASH_LIGHT},
954     {MACHINE_METHANE_VENT,      DUNGEON,    0,      0,      0,  "explosive methane gas starts wafting out of hidden vents in the floor!", 0, 0, 0, 0, DF_VENT_SPEW_METHANE},
955     {METHANE_GAS,               GAS,        60,     0,      0},
956     {PILOT_LIGHT,               DUNGEON,    0,      0,      0,  "a torch falls from its mount and lies sputtering on the floor.", FALLEN_TORCH_FLASH_LIGHT},
957 
958     // paralysis trap:
959     {MACHINE_PARALYSIS_VENT,    DUNGEON,    0,      0,      0,  "you notice an inactive gas vent hidden in a crevice of the floor.", GENERIC_FLASH_LIGHT},
960     {PARALYSIS_GAS,             GAS,        350,    0,      0,  "paralytic gas sprays upward from hidden vents in the floor!", 0, 0, 0, 0, DF_REVEAL_PARALYSIS_VENT_SILENTLY},
961     {MACHINE_PARALYSIS_VENT,    DUNGEON,    0,      0,      0},
962 
963     // thematic dungeon:
964     {RED_BLOOD,                 SURFACE,    75,     25,     0},
965 
966     // statuary:
967     {STATUE_CRACKING,           DUNGEON,    0,      0,      0,  "cracks begin snaking across the marble surface of the statue!", 0, 0, 0, 0, DF_RUBBLE},
968     {RUBBLE,                    SURFACE,    120,    100,    DFF_ACTIVATE_DORMANT_MONSTER,   "the statue shatters!", 0, &darkGray, 3, 0, DF_RUBBLE},
969 
970     // hidden turrets:
971     {WALL,                      DUNGEON,    0,      0,      DFF_ACTIVATE_DORMANT_MONSTER,   "you hear a click, and the stones in the wall shift to reveal turrets!", 0, 0, 0, 0, DF_RUBBLE},
972 
973     // worm tunnels:
974     {WORM_TUNNEL_MARKER_DORMANT,LIQUID,     5,      5,      0,  "", 0,  0,  GRANITE},
975     {WORM_TUNNEL_MARKER_ACTIVE, LIQUID,     0,      0,      0},
976     {FLOOR,                     DUNGEON,    0,      0,      (DFF_SUPERPRIORITY | DFF_ACTIVATE_DORMANT_MONSTER),  "", 0, 0,  0,  0,  DF_TUNNELIZE},
977     {FLOOR,                     DUNGEON,    0,      0,      0,  "the nearby wall cracks and collapses in a cloud of dust!", 0, &darkGray,  5,  0,  DF_TUNNELIZE},
978 
979     // haunted room:
980     {DARK_FLOOR_DARKENING,      DUNGEON,    0,      0,      0,  "the light in the room flickers and you feel a chill in the air."},
981     {DARK_FLOOR,                DUNGEON,    0,      0,      DFF_ACTIVATE_DORMANT_MONSTER,   "", 0, 0, 0, 0, DF_ECTOPLASM_DROPLET},
982     {HAUNTED_TORCH_TRANSITIONING,DUNGEON,   0,      0,      0},
983     {HAUNTED_TORCH,             DUNGEON,    0,      0,      0},
984 
985     // mud pit:
986     {MACHINE_MUD_DORMANT,       LIQUID,     100,    100,    0},
987     {MUD,                       LIQUID,     0,      0,      DFF_ACTIVATE_DORMANT_MONSTER,   "across the bog, bubbles rise ominously from the mud."},
988 
989     // electric crystals:
990     {ELECTRIC_CRYSTAL_ON,       DUNGEON,    0,      0,      0, "the crystal absorbs the electricity and begins to glow.", CHARGE_FLASH_LIGHT},
991     {WALL,                      DUNGEON,    0,      0,      DFF_ACTIVATE_DORMANT_MONSTER,   "the wall above the lever shifts to reveal a spark turret!"},
992 
993     // idyll:
994     {SHALLOW_WATER,             LIQUID,     150,    100,    (DFF_PERMIT_BLOCKING)},
995     {DEEP_WATER,                LIQUID,     90,     100,    (DFF_TREAT_AS_BLOCKING | DFF_CLEAR_OTHER_TERRAIN | DFF_SUBSEQ_EVERYWHERE), "", 0, 0, 0, 0, DF_SHALLOW_WATER_POOL},
996 
997     // swamp:
998     {SHALLOW_WATER,             LIQUID,     30,     100,    0},
999     {GRAY_FUNGUS,               SURFACE,    80,     50,     0,  "", 0, 0, 0, 0, DF_SWAMP_MUD},
1000     {MUD,                       LIQUID,     75,     5,      0,  "", 0, 0, 0, 0, DF_SWAMP_WATER},
1001 
1002     // camp:
1003     {HAY,                       SURFACE,    90,     87,     0},
1004     {JUNK,                      SURFACE,    20,     20,     0},
1005 
1006     // remnants:
1007     {CARPET,                    DUNGEON,    110,    20,     DFF_SUBSEQ_EVERYWHERE,  "", 0, 0, 0, 0, DF_REMNANT_ASH},
1008     {BURNED_CARPET,             SURFACE,    120,    100,    0},
1009 
1010     // chasm catwalk:
1011     {CHASM,                     LIQUID,     0,      0,      DFF_CLEAR_OTHER_TERRAIN, "", 0, 0, 0, 0, DF_SHOW_TRAPDOOR_HALO},
1012     {STONE_BRIDGE,              LIQUID,     0,      0,      DFF_CLEAR_OTHER_TERRAIN},
1013 
1014     // lake catwalk:
1015     {DEEP_WATER,                LIQUID,     0,      0,      DFF_CLEAR_OTHER_TERRAIN, "", 0, 0, 0, 0, DF_LAKE_HALO},
1016     {SHALLOW_WATER,             LIQUID,     160,    100,    0},
1017 
1018     // worms pop out of walls:
1019     {RUBBLE,                    SURFACE,    120,    100,    DFF_ACTIVATE_DORMANT_MONSTER,   "the nearby wall explodes in a shower of stone fragments!", 0, &darkGray, 3, 0, DF_RUBBLE},
1020 
1021     // monster cages open:
1022     {MONSTER_CAGE_OPEN,         DUNGEON,    0,      0,      0},
1023 
1024     // goblin warren:
1025     {STENCH_SMOKE_GAS,          GAS,        50,     0,      0, "", 0, 0, 0, 0, DF_PLAIN_FIRE},
1026     {STENCH_SMOKE_GAS,          GAS,        50,     0,      0, "", 0, 0, 0, 0, DF_EMBERS},
1027 };
1028 
1029 dungeonProfile dungeonProfileCatalog[NUMBER_DUNGEON_PROFILES] = {
1030     // Room frequencies:
1031     //      0. Cross room
1032     //      1. Small symmetrical cross room
1033     //      2. Small room
1034     //      3. Circular room
1035     //      4. Chunky room
1036     //      5. Cave
1037     //      6. Cavern (the kind that fills a level)
1038     //      7. Entrance room (the big upside-down T room at the start of depth 1)
1039 
1040     // Room frequencies
1041     // 0    1   2   3   4   5   6   7   Corridor chance
1042     {{2,    1,  1,  1,  7,  1,  0,  0}, 10},    // Basic dungeon generation (further adjusted by depth)
1043     {{10,   0,  0,  3,  7,  10, 10, 0}, 0},     // First room for basic dungeon generation (further adjusted by depth)
1044 
1045     {{0,    0,  1,  0,  0,  0,  0,  0}, 0},     // Goblin warrens
1046     {{0,    5,  0,  1,  0,  0,  0,  0}, 0},     // Sentinel sanctuaries
1047 };
1048 
1049 // radius is in units of 0.01
1050 const lightSource lightCatalog[NUMBER_LIGHT_KINDS] = {
1051     //color                 radius range            fade%   passThroughCreatures
1052     {0},                                                                // NO_LIGHT
1053     {&minersLightColor,     {0, 0, 1},              35,     true},      // miners light
1054     {&fireBoltColor,        {300, 400, 1},          0,      false},     // burning creature light
1055     {&wispLightColor,       {400, 800, 1},          0,      false},     // will-o'-the-wisp light
1056     {&fireBoltColor,        {300, 400, 1},          0,      false},     // salamander glow
1057     {&pink,                 {600, 600, 1},          0,      true},      // imp light
1058     {&pixieColor,           {400, 600, 1},          50,     false},     // pixie light
1059     {&lichLightColor,       {1500, 1500, 1},        0,      false},     // lich light
1060     {&flamedancerCoronaColor,{1000, 2000, 1},       0,      false},     // flamedancer light
1061     {&sentinelLightColor,   {300, 500, 1},          0,      false},     // sentinel light
1062     {&unicornLightColor,    {300, 400, 1},          0,      false},     // unicorn light
1063     {&ifritLightColor,      {300, 600, 1},          0,      false},     // ifrit light
1064     {&fireBoltColor,        {400, 600, 1},          0,      false},     // phoenix light
1065     {&fireBoltColor,        {150, 300, 1},          0,      false},     // phoenix egg light
1066     {&yendorLightColor,     {1500, 1500, 1},        0,      false},     // Yendorian light
1067     {&spectralBladeLightColor,{350, 350, 1},        0,      false},     // spectral blades
1068     {&summonedImageLightColor,{350, 350, 1},        0,      false},     // weapon images
1069     {&lightningColor,       {250, 250, 1},          35,     false},     // lightning turret light
1070     {&explosiveAuraColor,   {150, 200, 1},          0,      true},      // explosive bloat light
1071     {&lightningColor,       {300, 300, 1},          0,      false},     // bolt glow
1072     {&telepathyColor,       {200, 200, 1},          0,      true},      // telepathy light
1073     {&sacrificeTargetColor, {250, 250, 1},          0,      true},      // sacrifice doom light
1074 
1075     // flares:
1076     {&scrollProtectionColor,{600, 600, 1},          0,      true},      // scroll of protection flare
1077     {&scrollEnchantmentColor,{600, 600, 1},         0,      true},      // scroll of enchantment flare
1078     {&potionStrengthColor,  {600, 600, 1},          0,      true},      // potion of strength flare
1079     {&empowermentFlashColor,{600, 600, 1},          0,      true},      // empowerment flare
1080     {&genericFlashColor,    {300, 300, 1},          0,      true},      // generic flash flare
1081     {&fireFlashColor,       {800, 800, 1},          0,      false},     // fallen torch flare
1082     {&summoningFlashColor,  {600, 600, 1},          0,      true},      // summoning flare
1083     {&explosionFlareColor,  {5000, 5000, 1},        0,      true},      // explosion (explosive bloat or incineration potion)
1084     {&quietusFlashColor,    {300, 300, 1},          0,      true},      // quietus activation flare
1085     {&slayingFlashColor,    {300, 300, 1},          0,      true},      // slaying activation flare
1086     {&lightningColor,       {800, 800, 1},          0,      false},     // electric crystal activates
1087 
1088     // glowing terrain:
1089     {&torchLightColor,      {1000, 1000, 1},        50,     false},     // torch
1090     {&lavaLightColor,       {300, 300, 1},          50,     false},     // lava
1091     {&sunLightColor,        {200, 200, 1},          25,     true},      // sunlight
1092     {&darknessPatchColor,   {400, 400, 1},          0,      true},      // darkness patch
1093     {&fungusLightColor,     {300, 300, 1},          50,     false},     // luminescent fungus
1094     {&fungusForestLightColor,{500, 500, 1},         0,      false},     // luminescent forest
1095     {&algaeBlueLightColor,  {300, 300, 1},          0,      false},     // luminescent algae blue
1096     {&algaeGreenLightColor, {300, 300, 1},          0,      false},     // luminescent algae green
1097     {&ectoplasmColor,       {200, 200, 1},          50,     false},     // ectoplasm
1098     {&unicornLightColor,    {200, 200, 1},          0,      false},     // unicorn poop light
1099     {&lavaLightColor,       {200, 200, 1},          50,     false},     // embers
1100     {&lavaLightColor,       {500, 1000, 1},         0,      false},     // fire
1101     {&lavaLightColor,       {200, 300, 1},          0,      false},     // brimstone fire
1102     {&explosionColor,       {DCOLS*100,DCOLS*100,1},100,    false},     // explosions
1103     {&dartFlashColor,       {15*100,15*100,1},      0,      false},     // incendiary darts
1104     {&portalActivateLightColor, {DCOLS*100,DCOLS*100,1},0,  false},     // portal activation
1105     {&confusionLightColor,  {300, 300, 1},          100,    false},     // confusion gas
1106     {&darknessCloudColor,   {500, 500, 1},          0,      true},      // darkness cloud
1107     {&forceFieldLightColor, {200, 200, 1},          50,     false},     // forcefield
1108     {&crystalWallLightColor,{300, 500, 1},          50,     false},     // crystal wall
1109     {&torchLightColor,      {200, 400, 1},          0,      false},     // candle light
1110     {&hauntedTorchColor,    {400, 600, 1},          0,      false},     // haunted torch
1111     {&glyphLightColor,      {100, 100, 1},          0,      false},     // glyph dim light
1112     {&glyphLightColor,      {300, 300, 1},          0,      false},     // glyph bright light
1113     {&sacredGlyphColor,     {300, 300, 1},          0,      false},     // sacred glyph light
1114     {&descentLightColor,    {600, 600, 1},          0,      false},     // magical pit light
1115     {&sacrificeTargetColor, {800, 1200, 1},          0,      true},      // demonic statue light
1116 };
1117 
1118 const blueprint blueprintCatalog[NUMBER_BLUEPRINTS] = {
1119     {{0}}, // nothing
1120     //BLUEPRINTS:
1121     //depths            roomSize    freq    featureCt   dungeonProfileType  flags   (features on subsequent lines)
1122 
1123         //FEATURES:
1124         //DF        terrain     layer       instanceCtRange minInsts    itemCat     itemKind    monsterKind     reqSpace        hordeFl     itemFlags   featureFlags
1125 
1126     // -- REWARD ROOMS --
1127 
1128     // Mixed item library -- can check one item out at a time
1129     {{1, 12},           {30, 50},   30,     6,          0,                  (BP_ROOM | BP_PURGE_INTERIOR | BP_SURROUND_WITH_WALLS | BP_OPEN_INTERIOR | BP_IMPREGNABLE | BP_REWARD), {
1130         {0,         CARPET,     DUNGEON,        {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)},
1131         {0,         0,          0,              {1,1},      1,          0,          0,          0,              2,              0,          0,          (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING | MF_BUILD_VESTIBULE)},
1132         {0,         ALTAR_CAGE_OPEN,DUNGEON,    {1,1},      1,          WAND,       -1,         0,              2,              0,          (ITEM_IS_KEY | ITEM_KIND_AUTO_ID | ITEM_PLAYER_AVOIDS), (MF_GENERATE_ITEM | MF_TREAT_AS_BLOCKING | MF_IMPREGNABLE)},
1133         {0,         ALTAR_CAGE_OPEN,DUNGEON,    {3,3},      3,          (WEAPON|ARMOR|WAND),-1, 0,              2,              0,          (ITEM_IS_KEY | ITEM_KIND_AUTO_ID | ITEM_PLAYER_AVOIDS), (MF_GENERATE_ITEM | MF_NO_THROWING_WEAPONS | MF_TREAT_AS_BLOCKING | MF_IMPREGNABLE)},
1134         {0,         ALTAR_CAGE_OPEN,DUNGEON,    {2,3},      2,          (STAFF|RING|CHARM),-1,  0,              2,              0,          (ITEM_IS_KEY | ITEM_KIND_AUTO_ID | ITEM_MAX_CHARGES_KNOWN | ITEM_PLAYER_AVOIDS),    (MF_GENERATE_ITEM | MF_NO_THROWING_WEAPONS | MF_TREAT_AS_BLOCKING | MF_IMPREGNABLE)},
1135         {0,         STATUE_INERT,DUNGEON,       {2,3},      0,          0,          -1,         0,              2,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_BUILD_IN_WALLS | MF_IMPREGNABLE)}}},
1136     // Single item category library -- can check one item out at a time
1137     {{1, 12},           {30, 50},   15,     5,          0,                  (BP_ROOM | BP_PURGE_INTERIOR | BP_SURROUND_WITH_WALLS | BP_OPEN_INTERIOR | BP_IMPREGNABLE | BP_REWARD), {
1138         {0,         CARPET,     DUNGEON,        {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)},
1139         {0,         0,          0,              {1,1},      1,          0,          0,          0,              2,              0,          0,          (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING | MF_BUILD_VESTIBULE)},
1140         {0,         ALTAR_CAGE_OPEN,DUNGEON,    {3,4},      3,          (RING),     -1,         0,              2,              0,          (ITEM_IS_KEY | ITEM_KIND_AUTO_ID | ITEM_MAX_CHARGES_KNOWN | ITEM_PLAYER_AVOIDS),    (MF_GENERATE_ITEM | MF_TREAT_AS_BLOCKING | MF_ALTERNATIVE | MF_IMPREGNABLE)},
1141         {0,         ALTAR_CAGE_OPEN,DUNGEON,    {4,5},      4,          (STAFF),    -1,         0,              2,              0,          (ITEM_IS_KEY | ITEM_KIND_AUTO_ID | ITEM_MAX_CHARGES_KNOWN | ITEM_PLAYER_AVOIDS),    (MF_GENERATE_ITEM | MF_TREAT_AS_BLOCKING | MF_ALTERNATIVE | MF_IMPREGNABLE)},
1142         {0,         STATUE_INERT,DUNGEON,       {2,3},      0,          0,          -1,         0,              2,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_BUILD_IN_WALLS | MF_IMPREGNABLE)}}},
1143     // Treasure room -- apothecary or archive (potions or scrolls)
1144     {{8, AMULET_LEVEL}, {20, 40},   20,     6,          0,                  (BP_ROOM | BP_PURGE_INTERIOR | BP_SURROUND_WITH_WALLS | BP_OPEN_INTERIOR | BP_IMPREGNABLE | BP_REWARD), {
1145         {0,         CARPET,     DUNGEON,        {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)},
1146         {0,         0,          0,              {5,7},      2,          (POTION),   -1,         0,              2,              0,          0,          (MF_GENERATE_ITEM | MF_ALTERNATIVE | MF_TREAT_AS_BLOCKING)},
1147         {0,         0,          0,              {4,6},      2,          (SCROLL),   -1,         0,              2,              0,          0,          (MF_GENERATE_ITEM | MF_ALTERNATIVE | MF_TREAT_AS_BLOCKING)},
1148         {0,         FUNGUS_FOREST,SURFACE,      {3,4},      0,          0,          -1,         0,              2,              0,          0,          0},
1149         {0,         0,          0,              {1,1},      1,          0,          0,          0,              2,              0,          0,          (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING | MF_BUILD_VESTIBULE)},
1150         {0,         STATUE_INERT,DUNGEON,       {2,3},      0,          0,          -1,         0,              2,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_BUILD_IN_WALLS | MF_IMPREGNABLE)}}},
1151     // Guaranteed good permanent item on a glowing pedestal (runic weapon/armor or 2 staffs)
1152     {{5, 16},           {10, 30},   30,     6,          0,                  (BP_ROOM | BP_PURGE_INTERIOR | BP_SURROUND_WITH_WALLS | BP_OPEN_INTERIOR | BP_IMPREGNABLE | BP_REWARD), {
1153         {0,         CARPET,     DUNGEON,        {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)},
1154         {0,         STATUE_INERT,DUNGEON,       {2,3},      0,          0,          -1,         0,              2,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_BUILD_IN_WALLS | MF_IMPREGNABLE)},
1155         {0,         PEDESTAL,   DUNGEON,        {1,1},      1,          (WEAPON),   -1,         0,              2,              0,          ITEM_IDENTIFIED,(MF_GENERATE_ITEM | MF_ALTERNATIVE | MF_REQUIRE_GOOD_RUNIC | MF_NO_THROWING_WEAPONS | MF_TREAT_AS_BLOCKING)},
1156         {0,         PEDESTAL,   DUNGEON,        {1,1},      1,          (ARMOR),    -1,         0,              2,              0,          ITEM_IDENTIFIED,(MF_GENERATE_ITEM | MF_ALTERNATIVE | MF_REQUIRE_GOOD_RUNIC | MF_TREAT_AS_BLOCKING)},
1157         {0,         PEDESTAL,   DUNGEON,        {2,2},      2,          (STAFF),    -1,         0,              2,              0,          (ITEM_KIND_AUTO_ID | ITEM_MAX_CHARGES_KNOWN),   (MF_GENERATE_ITEM | MF_ALTERNATIVE | MF_TREAT_AS_BLOCKING)},
1158         {0,         0,          0,              {1,1},      1,          0,          0,          0,              2,              0,          0,          (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING | MF_BUILD_VESTIBULE)}}},
1159     // Guaranteed good consumable item on glowing pedestals (scrolls of enchanting, potion of life)
1160     {{10, AMULET_LEVEL},{10, 30},   30,     5,          0,                  (BP_ROOM | BP_PURGE_INTERIOR | BP_SURROUND_WITH_WALLS | BP_OPEN_INTERIOR | BP_IMPREGNABLE | BP_REWARD), {
1161         {0,         CARPET,     DUNGEON,        {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)},
1162         {0,         STATUE_INERT,DUNGEON,       {1,3},      0,          0,          -1,         0,              2,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_BUILD_IN_WALLS | MF_IMPREGNABLE)},
1163         {0,         PEDESTAL,   DUNGEON,        {1,1},      1,          (SCROLL),   SCROLL_ENCHANTING, 0,       2,              0,          (ITEM_KIND_AUTO_ID),    (MF_GENERATE_ITEM | MF_ALTERNATIVE | MF_TREAT_AS_BLOCKING)},
1164         {0,         PEDESTAL,   DUNGEON,        {1,1},      1,          (POTION),   POTION_LIFE,0,              2,              0,          (ITEM_KIND_AUTO_ID),    (MF_GENERATE_ITEM | MF_ALTERNATIVE | MF_TREAT_AS_BLOCKING)},
1165         {0,         0,          0,              {1,1},      1,          0,          0,          0,              2,              0,          0,          (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING | MF_BUILD_VESTIBULE)}}},
1166     // Commutation altars
1167     {{13, AMULET_LEVEL},{10, 30},   50,     4,          0,                  (BP_ROOM | BP_PURGE_INTERIOR | BP_SURROUND_WITH_WALLS | BP_OPEN_INTERIOR | BP_IMPREGNABLE | BP_REWARD), {
1168         {0,         CARPET,     DUNGEON,        {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)},
1169         {0,         STATUE_INERT,DUNGEON,       {1,3},      0,          0,          -1,         0,              2,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_BUILD_IN_WALLS | MF_IMPREGNABLE)},
1170         {DF_MAGIC_PIPING,COMMUTATION_ALTAR,DUNGEON,{2,2},   2,          0,          -1,         0,              2,              0,          0,          (MF_TREAT_AS_BLOCKING)},
1171         {0,         0,          0,              {1,1},      1,          0,          0,          0,              2,              0,          0,          (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING | MF_BUILD_VESTIBULE)}}},
1172     // Resurrection altar
1173     {{13, AMULET_LEVEL},{10, 30},   30,     4,          0,                  (BP_ROOM | BP_PURGE_INTERIOR | BP_SURROUND_WITH_WALLS | BP_OPEN_INTERIOR | BP_IMPREGNABLE | BP_REWARD), {
1174         {0,         CARPET,     DUNGEON,        {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)},
1175         {0,         STATUE_INERT,DUNGEON,       {1,3},      0,          0,          -1,         0,              2,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_BUILD_IN_WALLS | MF_IMPREGNABLE)},
1176         {DF_MACHINE_FLOOR_TRIGGER_REPEATING, RESURRECTION_ALTAR,DUNGEON, {1,1}, 1, 0, -1,       0,              2,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_FAR_FROM_ORIGIN)},
1177         {0,         0,          0,              {1,1},      1,          0,          0,          0,              2,              0,          0,          (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING | MF_BUILD_VESTIBULE)}}},
1178     // Outsourced item -- same item possibilities as in the good permanent item reward room (plus charms), but directly adopted by 1-2 key machines.
1179     {{5, 17},           {0, 0},     20,     4,          0,                  (BP_REWARD | BP_NO_INTERIOR_FLAG),  {
1180         {0,         0,          0,              {1,1},      1,          (WEAPON),   -1,         0,              0,              0,          ITEM_IDENTIFIED,(MF_GENERATE_ITEM | MF_ALTERNATIVE | MF_REQUIRE_GOOD_RUNIC | MF_NO_THROWING_WEAPONS | MF_OUTSOURCE_ITEM_TO_MACHINE | MF_BUILD_ANYWHERE_ON_LEVEL)},
1181         {0,         0,          0,              {1,1},      1,          (ARMOR),    -1,         0,              0,              0,          ITEM_IDENTIFIED,(MF_GENERATE_ITEM | MF_ALTERNATIVE | MF_REQUIRE_GOOD_RUNIC | MF_OUTSOURCE_ITEM_TO_MACHINE | MF_BUILD_ANYWHERE_ON_LEVEL)},
1182         {0,         0,          0,              {2,2},      2,          (STAFF),    -1,         0,              0,              0,          ITEM_KIND_AUTO_ID, (MF_GENERATE_ITEM | MF_ALTERNATIVE | MF_OUTSOURCE_ITEM_TO_MACHINE | MF_BUILD_ANYWHERE_ON_LEVEL)},
1183         {0,         0,          0,              {1,2},      1,          (CHARM),    -1,         0,              0,              0,          ITEM_KIND_AUTO_ID, (MF_GENERATE_ITEM | MF_ALTERNATIVE | MF_OUTSOURCE_ITEM_TO_MACHINE | MF_BUILD_ANYWHERE_ON_LEVEL)}}},
1184     // Dungeon -- two allies chained up for the taking
1185     {{5, AMULET_LEVEL}, {30, 80},   12,     5,          0,                  (BP_ROOM | BP_REWARD),  {
1186         {0,         VOMIT,      SURFACE,        {2,2},      2,          0,          -1,         0,              2,              (HORDE_MACHINE_CAPTIVE | HORDE_LEADER_CAPTIVE), 0, (MF_GENERATE_HORDE | MF_TREAT_AS_BLOCKING)},
1187         {DF_AMBIENT_BLOOD,MANACLE_T,SURFACE,    {1,2},      1,          0,          -1,         0,              1,              0,          0,          0},
1188         {DF_AMBIENT_BLOOD,MANACLE_L,SURFACE,    {1,2},      1,          0,          -1,         0,              1,              0,          0,          0},
1189         {DF_BONES,  0,          0,              {2,3},      1,          0,          -1,         0,              1,              0,          0,          0},
1190         {DF_VOMIT,  0,          0,              {2,3},      1,          0,          -1,         0,              1,              0,          0,          0},
1191         {0,         0,          0,              {1,1},      1,          0,          0,          0,              2,              0,          0,          (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING | MF_BUILD_VESTIBULE)}}},
1192     // Kennel -- allies locked in cages in an open room; choose one or two to unlock and take with you.
1193     {{5, AMULET_LEVEL}, {30, 80},   12,     4,          0,                  (BP_ROOM | BP_REWARD),  {
1194         {0,         MONSTER_CAGE_CLOSED,DUNGEON,{3,5},      3,          0,          -1,         0,              2,              (HORDE_MACHINE_KENNEL | HORDE_LEADER_CAPTIVE), 0, (MF_GENERATE_HORDE | MF_TREAT_AS_BLOCKING | MF_IMPREGNABLE)},
1195         {0,         0,          0,              {1,2},      1,          KEY,        KEY_CAGE,   0,              1,              0,          (ITEM_IS_KEY | ITEM_PLAYER_AVOIDS),(MF_PERMIT_BLOCKING | MF_GENERATE_ITEM | MF_OUTSOURCE_ITEM_TO_MACHINE | MF_SKELETON_KEY | MF_KEY_DISPOSABLE)},
1196         {DF_AMBIENT_BLOOD, 0,   0,              {3,5},      3,          0,          -1,         0,              1,              0,          0,          0},
1197         {DF_BONES,  0,          0,              {3,5},      3,          0,          -1,         0,              1,              0,          0,          0},
1198         {0,         TORCH_WALL, DUNGEON,        {2,3},      2,          0,          0,          0,              1,              0,          0,          (MF_BUILD_IN_WALLS)}}},
1199     // Vampire lair -- allies locked in cages and chained in a hidden room with a vampire in a coffin; vampire has one cage key.
1200     {{10, AMULET_LEVEL},{50, 80},   5,      4,          0,                  (BP_ROOM | BP_REWARD | BP_SURROUND_WITH_WALLS | BP_PURGE_INTERIOR), {
1201         {DF_AMBIENT_BLOOD,0,    0,              {1,2},      1,          0,          -1,         0,              2,              (HORDE_MACHINE_CAPTIVE | HORDE_LEADER_CAPTIVE), 0, (MF_GENERATE_HORDE | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)},
1202         {DF_AMBIENT_BLOOD,MONSTER_CAGE_CLOSED,DUNGEON,{2,4},2,          0,          -1,         0,              2,              (HORDE_VAMPIRE_FODDER | HORDE_LEADER_CAPTIVE), 0, (MF_GENERATE_HORDE | MF_TREAT_AS_BLOCKING | MF_IMPREGNABLE | MF_NOT_IN_HALLWAY)},
1203         {DF_TRIGGER_AREA,COFFIN_CLOSED,0,       {1,1},      1,          KEY,        KEY_CAGE,   MK_VAMPIRE,     1,              0,          (ITEM_IS_KEY | ITEM_PLAYER_AVOIDS),(MF_GENERATE_ITEM | MF_SKELETON_KEY | MF_MONSTER_TAKE_ITEM | MF_MONSTERS_DORMANT | MF_FAR_FROM_ORIGIN | MF_KEY_DISPOSABLE)},
1204         {DF_AMBIENT_BLOOD,SECRET_DOOR,DUNGEON,  {1,1},      1,          0,          0,          0,              1,              0,          0,          (MF_PERMIT_BLOCKING | MF_BUILD_AT_ORIGIN)}}},
1205     // Legendary ally -- approach the altar with the crystal key to activate a portal and summon a legendary ally.
1206     {{8, AMULET_LEVEL}, {30, 50},   15,     2,          0,                  (BP_ROOM | BP_REWARD),  {
1207         {DF_LUMINESCENT_FUNGUS, ALTAR_KEYHOLE, DUNGEON, {1,1}, 1,       KEY,        KEY_PORTAL, 0,              2,              0,          (ITEM_IS_KEY | ITEM_PLAYER_AVOIDS),(MF_GENERATE_ITEM | MF_NOT_IN_HALLWAY | MF_NEAR_ORIGIN | MF_OUTSOURCE_ITEM_TO_MACHINE | MF_KEY_DISPOSABLE)},
1208         {DF_LUMINESCENT_FUNGUS, PORTAL, DUNGEON,{1,1},      1,          0,          -1,         0,              2,              HORDE_MACHINE_LEGENDARY_ALLY,0, (MF_GENERATE_HORDE | MF_MONSTERS_DORMANT | MF_FAR_FROM_ORIGIN)}}},
1209     // Goblin warren
1210     {{5, 15},           {100, 200}, 15,     9,          DP_GOBLIN_WARREN,   (BP_ROOM | BP_REWARD | BP_MAXIMIZE_INTERIOR | BP_REDESIGN_INTERIOR),    {
1211         {0,         MUD_FLOOR,  DUNGEON,        {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)},
1212         {0,         MUD_DOORWAY,DUNGEON,        {1,1},      1,          0,          -1,         0,              1,              0,          0,          (MF_BUILD_AT_ORIGIN)},
1213         {0,         MUD_WALL,   DUNGEON,        {1,1},      100,        0,          -1,         0,              1,              0,          0,          (MF_BUILD_IN_WALLS | MF_EVERYWHERE)},
1214         {0,         PEDESTAL,   DUNGEON,        {1,1},      1,          (SCROLL),   SCROLL_ENCHANTING, MK_GOBLIN_CHIEFTAN, 2,   0,          (ITEM_KIND_AUTO_ID),    (MF_GENERATE_ITEM | MF_MONSTER_SLEEPING | MF_ALTERNATIVE | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY | MF_FAR_FROM_ORIGIN)},
1215         {0,         PEDESTAL,   DUNGEON,        {1,1},      1,          (POTION),   POTION_LIFE, MK_GOBLIN_CHIEFTAN, 2,         0,          (ITEM_KIND_AUTO_ID),    (MF_GENERATE_ITEM | MF_MONSTER_SLEEPING | MF_ALTERNATIVE | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY | MF_FAR_FROM_ORIGIN)},
1216         {0,         0,          0,              {5, 8},     5,          0,          -1,         0,              2,              HORDE_MACHINE_GOBLIN_WARREN,    0,  (MF_GENERATE_HORDE | MF_NOT_IN_HALLWAY | MF_MONSTER_SLEEPING)},
1217         {0,         0,          0,              {2,3},      2,          (WEAPON|ARMOR), -1,     0,              1,              0,          0,          (MF_GENERATE_ITEM | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)},
1218         {DF_HAY,    0,          0,              {10, 15},   1,          0,          -1,         0,              1,              0,          0,          (MF_NOT_IN_HALLWAY)},
1219         {DF_JUNK,   0,          0,              {7, 12},    1,          0,          -1,         0,              1,              0,          0,          (MF_NOT_IN_HALLWAY)}}},
1220     // Sentinel sanctuary
1221     {{10, 23},           {100, 200}, 15,  10,           DP_SENTINEL_SANCTUARY, (BP_ROOM | BP_REWARD | BP_MAXIMIZE_INTERIOR | BP_REDESIGN_INTERIOR), {
1222         {0,         MARBLE_FLOOR,DUNGEON,       {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)},
1223         {0,         CRYSTAL_WALL,DUNGEON,       {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_BUILD_IN_WALLS | MF_EVERYWHERE)},
1224         {0,         PEDESTAL, DUNGEON, {1,1},   1,          (SCROLL),   SCROLL_ENCHANTING,0,    2,              0,              (ITEM_KIND_AUTO_ID),    (MF_GENERATE_ITEM | MF_ALTERNATIVE | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY | MF_FAR_FROM_ORIGIN)},
1225         {0,         PEDESTAL, DUNGEON, {1,1},   1,          (POTION),   POTION_LIFE,0,          2,              0,              (ITEM_KIND_AUTO_ID),    (MF_GENERATE_ITEM | MF_ALTERNATIVE | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY | MF_FAR_FROM_ORIGIN)},
1226         {0,         MACHINE_GLYPH,DUNGEON,      {30, 35},   20,         0,          -1,         0,              1,              0,          0,          (MF_PERMIT_BLOCKING)},
1227         {0,         STATUE_INERT,DUNGEON,       {3, 5},     3,          0,          -1,         MK_SENTINEL,    2,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)},
1228         {0,         STATUE_INERT,DUNGEON,       {10, 15},   8,          0,          -1,         MK_SENTINEL,    2,              0,          0,          MF_BUILD_IN_WALLS},
1229         {0,         0,          0,              {4, 6},     4,          0,          -1,         MK_GUARDIAN,    1,              0,          0,          MF_TREAT_AS_BLOCKING},
1230         {0,         0,          0,              {0, 2},     0,          0,          -1,         MK_WINGED_GUARDIAN, 1,          0,          0,          MF_TREAT_AS_BLOCKING},
1231         {0,         0,          0,              {2,3},      2,          (SCROLL | POTION), -1,  0,              1,              0,          0,          (MF_GENERATE_ITEM | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)}}},
1232 
1233     // -- AMULET HOLDER --
1234     // Statuary -- key on an altar, area full of statues; take key to cause statues to burst and reveal monsters
1235     {{10, AMULET_LEVEL},{35, 40},   0,      4,          0,                  (BP_PURGE_INTERIOR | BP_OPEN_INTERIOR), {
1236         {DF_LUMINESCENT_FUNGUS, AMULET_SWITCH, DUNGEON, {1,1}, 1,       AMULET,     -1,         0,              2,              0,          0,          (MF_GENERATE_ITEM | MF_NEAR_ORIGIN | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)},
1237         {0,         FUNGUS_FOREST,SURFACE,      {2,3},      0,          0,          -1,         0,              2,              0,          0,          MF_NOT_IN_HALLWAY},
1238         {0,         STATUE_INSTACRACK,DUNGEON,  {1,1},      1,          0,          -1,         MK_WARDEN_OF_YENDOR,1,          0,          0,          (MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY | MF_MONSTERS_DORMANT | MF_FAR_FROM_ORIGIN | MF_IN_PASSABLE_VIEW_OF_ORIGIN | MF_IMPREGNABLE)},
1239         {0,         TORCH_WALL, DUNGEON,        {3,4},      0,          0,          0,          0,              1,              0,          0,          (MF_BUILD_IN_WALLS)}}},
1240 
1241     // -- VESTIBULES --
1242 
1243     // Plain locked door, key guarded by an adoptive room
1244     {{1, AMULET_LEVEL}, {1, 1},     100,        1,      0,                  (BP_VESTIBULE), {
1245         {0,         LOCKED_DOOR, DUNGEON,       {1,1},      1,          KEY,        KEY_DOOR,   0,              1,              0,          (ITEM_IS_KEY | ITEM_PLAYER_AVOIDS), (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING | MF_GENERATE_ITEM | MF_OUTSOURCE_ITEM_TO_MACHINE | MF_KEY_DISPOSABLE | MF_IMPREGNABLE)}}},
1246     // Plain secret door
1247     {{2, AMULET_LEVEL}, {1, 1},     1,      1,          0,                  (BP_VESTIBULE), {
1248         {0,         SECRET_DOOR, DUNGEON,       {1,1},      1,          0,          0,          0,              1,              0,          0,          (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING)}}},
1249     // Lever and either an exploding wall or a portcullis
1250     {{4, AMULET_LEVEL}, {1, 1},     8,      3,          0,                  (BP_VESTIBULE), {
1251         {0,         WORM_TUNNEL_OUTER_WALL,DUNGEON,{1,1},   1,          0,          -1,         0,              1,              0,          0,          (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING | MF_IMPREGNABLE | MF_ALTERNATIVE)},
1252         {0,         PORTCULLIS_CLOSED,DUNGEON,  {1,1},      1,          0,          0,          0,              3,              0,          0,          (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING | MF_IMPREGNABLE | MF_ALTERNATIVE)},
1253         {0,         WALL_LEVER_HIDDEN,DUNGEON,  {1,1},      1,          0,          -1,         0,              1,              0,          0,          (MF_BUILD_IN_WALLS | MF_IN_PASSABLE_VIEW_OF_ORIGIN | MF_BUILD_ANYWHERE_ON_LEVEL)}}},
1254     // Flammable barricade in the doorway -- burn the wooden barricade to enter
1255     {{1, 6},            {1, 1},     10,     3,          0,                  (BP_VESTIBULE), {
1256         {0,         WOODEN_BARRICADE,DUNGEON,   {1,1},      1,          0,          0,          0,              1,              0,          0,          (MF_PERMIT_BLOCKING | MF_BUILD_AT_ORIGIN)},
1257         {0,         0,          0,              {1,1},      1,          WEAPON,     INCENDIARY_DART, 0,         1,              0,          0,          (MF_GENERATE_ITEM | MF_BUILD_ANYWHERE_ON_LEVEL | MF_NOT_IN_HALLWAY | MF_ALTERNATIVE)},
1258         {0,         0,          0,              {1,1},      1,          POTION,     POTION_INCINERATION, 0,     1,              0,          0,          (MF_GENERATE_ITEM | MF_BUILD_ANYWHERE_ON_LEVEL | MF_NOT_IN_HALLWAY | MF_ALTERNATIVE)}}},
1259     // Statue in the doorway -- use a scroll of shattering to enter
1260     {{1, AMULET_LEVEL}, {1, 1},     6,      2,          0,                  (BP_VESTIBULE), {
1261         {0,         STATUE_INERT_DOORWAY,DUNGEON,       {1,1},1,        0,          0,          0,              1,              0,          0,          (MF_PERMIT_BLOCKING | MF_BUILD_AT_ORIGIN)},
1262         {0,         0,          0,              {1,1},      1,          SCROLL,     SCROLL_SHATTERING, 0,       1,              0,          0,          (MF_GENERATE_ITEM | MF_BUILD_ANYWHERE_ON_LEVEL | MF_NOT_IN_HALLWAY)}}},
1263     // Statue in the doorway -- bursts to reveal monster
1264     {{5, AMULET_LEVEL}, {2, 2},     6,      2,          0,                  (BP_VESTIBULE), {
1265         {0,         STATUE_DORMANT_DOORWAY,DUNGEON,     {1, 1}, 1,      0,          -1,         0,              1,              HORDE_MACHINE_STATUE,0, (MF_PERMIT_BLOCKING | MF_GENERATE_HORDE | MF_MONSTERS_DORMANT | MF_BUILD_AT_ORIGIN | MF_ALTERNATIVE)},
1266         {0,         MACHINE_TRIGGER_FLOOR,DUNGEON,{0,0},    1,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)}}},
1267     // Throwing tutorial -- toss an item onto the pressure plate to retract the portcullis
1268     {{1, 4},            {70, 70},   8,      3,          0,                  (BP_VESTIBULE), {
1269         {DF_MEDIUM_HOLE, MACHINE_PRESSURE_PLATE, LIQUID, {1,1}, 1,      0,          0,          0,              1,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)},
1270         {0,         PORTCULLIS_CLOSED,DUNGEON,  {1,1},      1,          0,          0,          0,              3,              0,          0,          (MF_IMPREGNABLE | MF_PERMIT_BLOCKING | MF_BUILD_AT_ORIGIN | MF_ALTERNATIVE)},
1271         {0,         WORM_TUNNEL_OUTER_WALL,DUNGEON,{1,1},   1,          0,          -1,         0,              1,              0,          0,          (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING | MF_IMPREGNABLE | MF_ALTERNATIVE)}}},
1272     // Pit traps -- area outside entrance is full of pit traps
1273     {{1, AMULET_LEVEL}, {30, 60},   8,      3,          0,                  (BP_VESTIBULE | BP_OPEN_INTERIOR | BP_NO_INTERIOR_FLAG),    {
1274         {0,         DOOR,       DUNGEON,        {1,1},      1,          0,          0,          0,              1,              0,          0,          (MF_PERMIT_BLOCKING | MF_BUILD_AT_ORIGIN | MF_ALTERNATIVE)},
1275         {0,         SECRET_DOOR,DUNGEON,        {1,1},      1,          0,          0,          0,              1,              0,          0,          (MF_IMPREGNABLE | MF_PERMIT_BLOCKING | MF_BUILD_AT_ORIGIN | MF_ALTERNATIVE)},
1276         {0,         TRAP_DOOR_HIDDEN,DUNGEON,   {60, 60},   1,          0,          -1,         0,              1,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_REPEAT_UNTIL_NO_PROGRESS)}}},
1277     // Beckoning obstacle -- a mirrored totem guards the door, and glyph are around the doorway.
1278     {{5, AMULET_LEVEL}, {15, 30},   8,      3,          0,                  (BP_VESTIBULE | BP_PURGE_INTERIOR | BP_OPEN_INTERIOR), {
1279         {0,         DOOR,       DUNGEON,        {1,1},      1,          0,          -1,         0,              1,              0,          0,          (MF_PERMIT_BLOCKING | MF_BUILD_AT_ORIGIN)},
1280         {0,         MACHINE_GLYPH,DUNGEON,      {1,1},      0,          0,          -1,         0,              1,              0,          0,          (MF_NEAR_ORIGIN | MF_EVERYWHERE)},
1281         {0,         0,          0,              {1,1},      1,          0,          -1,         MK_MIRRORED_TOTEM,3,            0,          0,          (MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY | MF_IN_VIEW_OF_ORIGIN | MF_BUILD_ANYWHERE_ON_LEVEL)},
1282         {0,         MACHINE_GLYPH,DUNGEON,      {3,5},      2,          0,          -1,         0,              2,              0,          0,          (MF_TREAT_AS_BLOCKING)}}},
1283     // Guardian obstacle -- a guardian is in the door on a glyph, with other glyphs scattered around.
1284     {{6, AMULET_LEVEL}, {25, 25},   8,      4,          0,                  (BP_VESTIBULE | BP_OPEN_INTERIOR),  {
1285         {0,         DOOR,       DUNGEON,        {1,1},      1,          0,          0,          MK_GUARDIAN,    2,              0,          0,          (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING | MF_ALTERNATIVE)},
1286         {0,         DOOR,       DUNGEON,        {1,1},      1,          0,          0,          MK_WINGED_GUARDIAN,2,           0,          0,          (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING | MF_ALTERNATIVE)},
1287         {0,         MACHINE_GLYPH,DUNGEON,      {10,10},    3,          0,          -1,         0,              1,              0,          0,          (MF_PERMIT_BLOCKING| MF_NEAR_ORIGIN)},
1288         {0,         MACHINE_GLYPH,DUNGEON,      {1,1},      0,          0,          -1,         0,              2,              0,          0,          (MF_EVERYWHERE | MF_PERMIT_BLOCKING | MF_NOT_IN_HALLWAY)}}},
1289 
1290     // -- KEY HOLDERS --
1291 
1292     // Nested item library -- can check one item out at a time, and one is a disposable key to another reward room
1293     {{1, AMULET_LEVEL}, {30, 50},   35,     7,          0,                  (BP_ROOM | BP_PURGE_INTERIOR | BP_SURROUND_WITH_WALLS | BP_OPEN_INTERIOR | BP_ADOPT_ITEM | BP_IMPREGNABLE), {
1294         {0,         CARPET,     DUNGEON,        {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)},
1295         {0,         WALL,       DUNGEON,        {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_BUILD_IN_WALLS | MF_IMPREGNABLE | MF_EVERYWHERE)},
1296         {0,         0,          0,              {1,1},      1,          0,          0,          0,              2,              0,          0,          (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING | MF_BUILD_VESTIBULE)},
1297         {0,         ALTAR_CAGE_OPEN,DUNGEON,    {1,2},      1,          (WEAPON|ARMOR|WAND),-1, 0,              2,              0,          (ITEM_IS_KEY | ITEM_KIND_AUTO_ID | ITEM_PLAYER_AVOIDS), (MF_GENERATE_ITEM | MF_NO_THROWING_WEAPONS | MF_TREAT_AS_BLOCKING | MF_IMPREGNABLE)},
1298         {0,         ALTAR_CAGE_OPEN,DUNGEON,    {1,2},      1,          (STAFF|RING|CHARM),-1,  0,              2,              0,          (ITEM_IS_KEY | ITEM_KIND_AUTO_ID | ITEM_MAX_CHARGES_KNOWN | ITEM_PLAYER_AVOIDS),    (MF_GENERATE_ITEM | MF_NO_THROWING_WEAPONS | MF_TREAT_AS_BLOCKING | MF_IMPREGNABLE)},
1299         {0,         ALTAR_CAGE_OPEN,DUNGEON,    {1,1},      1,          0,          -1,         0,              2,              0,          (ITEM_IS_KEY | ITEM_PLAYER_AVOIDS | ITEM_MAX_CHARGES_KNOWN),    (MF_ADOPT_ITEM | MF_TREAT_AS_BLOCKING | MF_IMPREGNABLE)},
1300         {0,         STATUE_INERT,DUNGEON,       {1,3},      0,          0,          -1,         0,              2,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_BUILD_IN_WALLS | MF_IMPREGNABLE)}}},
1301     // Secret room -- key on an altar in a secret room
1302     {{1, AMULET_LEVEL}, {15, 100},  1,      2,          0,                  (BP_ROOM | BP_ADOPT_ITEM), {
1303         {0,         ALTAR_INERT,DUNGEON,        {1,1},      1,          0,          -1,         0,              1,              0,          ITEM_PLAYER_AVOIDS, (MF_ADOPT_ITEM | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)},
1304         {0,         SECRET_DOOR,DUNGEON,        {1,1},      1,          0,          0,          0,              1,              0,          0,          (MF_PERMIT_BLOCKING | MF_BUILD_AT_ORIGIN)}}},
1305     // Throwing tutorial -- toss an item onto the pressure plate to retract the cage and reveal the key
1306     {{1, 4},            {70, 80},   8,      2,          0,                  (BP_ADOPT_ITEM), {
1307         {0,         ALTAR_CAGE_RETRACTABLE,DUNGEON,{1,1},   1,          0,          -1,         0,              3,              0,          0,          (MF_ADOPT_ITEM | MF_IMPREGNABLE | MF_NOT_IN_HALLWAY)},
1308         {DF_MEDIUM_HOLE, MACHINE_PRESSURE_PLATE, LIQUID, {1,1}, 1,      0,          0,          0,              1,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)}}},
1309     // Rat trap -- getting the key triggers paralysis vents nearby and also causes rats to burst out of the walls
1310     {{1,8},             {30, 70},   7,      3,          0,                  (BP_ADOPT_ITEM | BP_ROOM),  {
1311         {0,         ALTAR_SWITCH,DUNGEON,       {1,1},      1,          0,          -1,         0,              1,              0,          0,          (MF_ADOPT_ITEM | MF_FAR_FROM_ORIGIN | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)},
1312         {0,         MACHINE_PARALYSIS_VENT_HIDDEN,DUNGEON,{1,1},1,      0,          -1,         0,              2,              0,          0,          (MF_FAR_FROM_ORIGIN | MF_NOT_IN_HALLWAY)},
1313         {0,         RAT_TRAP_WALL_DORMANT,DUNGEON,{10,20},  5,          0,          -1,         MK_RAT,         1,              0,          0,          (MF_MONSTERS_DORMANT | MF_BUILD_IN_WALLS | MF_NOT_ON_LEVEL_PERIMETER)}}},
1314     // Fun with fire -- trigger the fire trap and coax the fire over to the wooden barricade surrounding the altar and key
1315     {{3, 10},           {80, 100},  10,     6,          0,                  (BP_ROOM | BP_ADOPT_ITEM | BP_PURGE_INTERIOR | BP_SURROUND_WITH_WALLS | BP_OPEN_INTERIOR), {
1316         {DF_SURROUND_WOODEN_BARRICADE,ALTAR_INERT,DUNGEON,{1,1},1,      0,          -1,         0,              3,              0,          0,          (MF_ADOPT_ITEM | MF_FAR_FROM_ORIGIN | MF_TREAT_AS_BLOCKING)},
1317         {0,         GRASS,      SURFACE,        {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE | MF_ALTERNATIVE)},
1318         {DF_SWAMP,  0,          0,              {4,4},      2,          0,          -1,         0,              2,              0,          0,          (MF_ALTERNATIVE | MF_FAR_FROM_ORIGIN)},
1319         {0,         FLAMETHROWER_HIDDEN,DUNGEON,{1,1},      1,          0,          0,          0,              1,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_NEAR_ORIGIN)},
1320         {0,         GAS_TRAP_POISON_HIDDEN,DUNGEON,{3, 3},  1,          0,          -1,         0,              5,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_ALTERNATIVE)},
1321         {0,         0,          0,              {2,2},      1,          POTION,     POTION_LICHEN, 0,           3,              0,          0,          (MF_GENERATE_ITEM | MF_BUILD_ANYWHERE_ON_LEVEL | MF_NOT_IN_HALLWAY | MF_ALTERNATIVE)}}},
1322     // Flood room -- key on an altar in a room with pools of eel-infested waters; take key to flood room with shallow water
1323     {{3, AMULET_LEVEL}, {80, 180},  10,     4,          0,                  (BP_ROOM | BP_SURROUND_WITH_WALLS | BP_PURGE_LIQUIDS | BP_PURGE_PATHING_BLOCKERS | BP_ADOPT_ITEM),  {
1324         {0,         FLOOR_FLOODABLE,LIQUID,     {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)},
1325         {0,         ALTAR_SWITCH,DUNGEON,       {1,1},      1,          0,          -1,         0,              5,              0,          0,          (MF_ADOPT_ITEM | MF_FAR_FROM_ORIGIN | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)},
1326         {DF_SPREADABLE_WATER_POOL,0,0,          {2, 4},     1,          0,          -1,         0,              5,              HORDE_MACHINE_WATER_MONSTER,0,MF_GENERATE_HORDE},
1327         {DF_GRASS,  FOLIAGE,    SURFACE,        {3, 4},     3,          0,          -1,         0,              1,              0,          0,          0}}},
1328     // Fire trap room -- key on an altar, pools of water, fire traps all over the place.
1329     {{4, AMULET_LEVEL}, {80, 180},  6,      5,          0,                  (BP_ROOM | BP_SURROUND_WITH_WALLS | BP_PURGE_LIQUIDS | BP_PURGE_PATHING_BLOCKERS | BP_ADOPT_ITEM),  {
1330         {0,         ALTAR_INERT,DUNGEON,        {1,1},      1,          0,          -1,         0,              1,              0,          0,          (MF_ADOPT_ITEM | MF_FAR_FROM_ORIGIN | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)},
1331         {0,         0,          0,              {1, 1},     1,          0,          -1,         0,              4,              0,          0,          MF_BUILD_AT_ORIGIN},
1332         {0,         FLAMETHROWER_HIDDEN,DUNGEON,{40, 60},   20,         0,          -1,         0,              1,              0,          0,          (MF_TREAT_AS_BLOCKING)},
1333         {DF_DEEP_WATER_POOL,0,  0,              {4, 4},     1,          0,          -1,         0,              4,              HORDE_MACHINE_WATER_MONSTER,0,MF_GENERATE_HORDE},
1334         {DF_GRASS,  FOLIAGE,    SURFACE,        {3, 4},     3,          0,          -1,         0,              1,              0,          0,          0}}},
1335     // Thief area -- empty altar, monster with item, permanently fleeing.
1336     {{3, AMULET_LEVEL}, {15, 20},   10,     2,          0,                  (BP_ADOPT_ITEM),    {
1337         {DF_LUMINESCENT_FUNGUS, ALTAR_INERT,DUNGEON,{1,1},  1,          0,          -1,         0,              2,              HORDE_MACHINE_THIEF,0,          (MF_ADOPT_ITEM | MF_BUILD_AT_ORIGIN | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY | MF_GENERATE_HORDE | MF_MONSTER_TAKE_ITEM | MF_MONSTER_FLEEING)},
1338         {0,         STATUE_INERT,0,             {3, 5},     2,          0,          -1,         0,              2,              0,          0,          (MF_FAR_FROM_ORIGIN | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)}}},
1339     // Collapsing floor area -- key on an altar in an area; take key to cause the floor of the area to collapse
1340     {{1, AMULET_LEVEL}, {45, 65},   13,     3,          0,                  (BP_ADOPT_ITEM | BP_TREAT_AS_BLOCKING), {
1341         {0,         FLOOR_FLOODABLE,DUNGEON,    {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)},
1342         {0,         ALTAR_SWITCH_RETRACTING,DUNGEON,{1,1},  1,          0,          -1,         0,              3,              0,          0,          (MF_ADOPT_ITEM | MF_NEAR_ORIGIN | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)},
1343         {DF_ADD_MACHINE_COLLAPSE_EDGE_DORMANT,0,0,{3, 3},   2,          0,          -1,         0,              3,              0,          0,          (MF_FAR_FROM_ORIGIN | MF_NOT_IN_HALLWAY)}}},
1344     // Pit traps -- key on an altar, room full of pit traps
1345     {{1, AMULET_LEVEL}, {30, 100},  10,     3,          0,                  (BP_ROOM | BP_ADOPT_ITEM),  {
1346         {0,         ALTAR_INERT,DUNGEON,        {1,1},      1,          0,          -1,         0,              2,              0,          0,          (MF_ADOPT_ITEM | MF_FAR_FROM_ORIGIN | MF_TREAT_AS_BLOCKING)},
1347         {0,         TRAP_DOOR_HIDDEN,DUNGEON,   {30, 40},   1,          0,          -1,         0,              1,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_REPEAT_UNTIL_NO_PROGRESS)},
1348         {0,         SECRET_DOOR,DUNGEON,        {1,1},      1,          0,          0,          0,              1,              0,          0,          (MF_PERMIT_BLOCKING | MF_BUILD_AT_ORIGIN)}}},
1349     // Levitation challenge -- key on an altar, room filled with pit, levitation or lever elsewhere on level, bridge appears when you grab the key/lever.
1350     {{1, 13},           {75, 120},  10,     9,          0,                  (BP_ROOM | BP_ADOPT_ITEM | BP_PURGE_INTERIOR | BP_OPEN_INTERIOR | BP_SURROUND_WITH_WALLS),  {
1351         {0,         ALTAR_SWITCH,DUNGEON,       {1,1},      1,          0,          -1,         0,              3,              0,          0,          (MF_ADOPT_ITEM | MF_FAR_FROM_ORIGIN | MF_TREAT_AS_BLOCKING)},
1352         {0,         TORCH_WALL, DUNGEON,        {1,4},      0,          0,          0,          0,              1,              0,          0,          (MF_BUILD_IN_WALLS)},
1353         {0,         0,          0,              {1,1},      1,          0,          0,          0,              3,              0,          0,          MF_BUILD_AT_ORIGIN},
1354         {DF_ADD_DORMANT_CHASM_HALO, CHASM,LIQUID,{120, 120},1,          0,          -1,         0,              1,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_REPEAT_UNTIL_NO_PROGRESS)},
1355         {DF_ADD_DORMANT_CHASM_HALO, CHASM_WITH_HIDDEN_BRIDGE,LIQUID,{1,1},1,0,      0,          0,              1,              0,          0,          (MF_PERMIT_BLOCKING | MF_EVERYWHERE)},
1356         {0,         0,          0,              {1,1},      1,          POTION,     POTION_LEVITATION, 0,       1,              0,          0,          (MF_GENERATE_ITEM | MF_BUILD_ANYWHERE_ON_LEVEL | MF_NOT_IN_HALLWAY | MF_ALTERNATIVE)},
1357         {0,         WALL_LEVER_HIDDEN,DUNGEON,  {1,1},      1,          0,          -1,         0,              1,              0,          0,          (MF_BUILD_IN_WALLS | MF_IN_PASSABLE_VIEW_OF_ORIGIN | MF_BUILD_ANYWHERE_ON_LEVEL | MF_ALTERNATIVE)}}},
1358     // Web climbing -- key on an altar, room filled with pit, spider at altar to shoot webs, bridge appears when you grab the key
1359     {{7, AMULET_LEVEL}, {55, 90},   10,     7,          0,                  (BP_ROOM | BP_ADOPT_ITEM | BP_PURGE_INTERIOR | BP_OPEN_INTERIOR | BP_SURROUND_WITH_WALLS),  {
1360         {0,         ALTAR_SWITCH,DUNGEON,       {1,1},      1,          0,          -1,         MK_SPIDER,      3,              0,          0,          (MF_ADOPT_ITEM | MF_FAR_FROM_ORIGIN | MF_TREAT_AS_BLOCKING | MF_IN_VIEW_OF_ORIGIN)},
1361         {0,         TORCH_WALL, DUNGEON,        {1,4},      0,          0,          0,          0,              1,              0,          0,          (MF_BUILD_IN_WALLS)},
1362         {0,         0,          0,              {1,1},      1,          0,          0,          0,              3,              0,          0,          MF_BUILD_AT_ORIGIN},
1363         {DF_ADD_DORMANT_CHASM_HALO, CHASM,LIQUID,   {120, 120}, 1,      0,          -1,         0,              1,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_REPEAT_UNTIL_NO_PROGRESS)},
1364         {DF_ADD_DORMANT_CHASM_HALO, CHASM_WITH_HIDDEN_BRIDGE,LIQUID,{1,1},1,0,      0,          0,              1,              0,          0,          (MF_PERMIT_BLOCKING | MF_EVERYWHERE)}}},
1365     // Lava moat room -- key on an altar, room filled with lava, levitation/fire immunity/lever elsewhere on level, lava retracts when you grab the key/lever
1366     {{3, 13},           {75, 120},  7,      7,          0,                  (BP_ROOM | BP_ADOPT_ITEM | BP_PURGE_INTERIOR | BP_SURROUND_WITH_WALLS | BP_OPEN_INTERIOR),  {
1367         {0,         ALTAR_SWITCH,DUNGEON,       {1,1},      1,          0,          -1,         0,              2,              0,          0,          (MF_ADOPT_ITEM | MF_FAR_FROM_ORIGIN | MF_TREAT_AS_BLOCKING)},
1368         {0,         0,          0,              {1,1},      1,          0,          0,          0,              2,              0,          0,          (MF_BUILD_AT_ORIGIN)},
1369         {0,         LAVA,       LIQUID,         {60,60},    1,          0,          0,          0,              1,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_REPEAT_UNTIL_NO_PROGRESS)},
1370         {DF_LAVA_RETRACTABLE, LAVA_RETRACTABLE, LIQUID, {1,1}, 1,       0,          0,          0,              1,              0,          0,          (MF_PERMIT_BLOCKING | MF_EVERYWHERE)},
1371         {0,         0,          0,              {1,1},      1,          POTION,     POTION_LEVITATION, 0,       1,              0,          0,          (MF_GENERATE_ITEM | MF_BUILD_ANYWHERE_ON_LEVEL | MF_NOT_IN_HALLWAY | MF_ALTERNATIVE)},
1372         {0,         0,          0,              {1,1},      1,          POTION,     POTION_FIRE_IMMUNITY, 0,    1,              0,          0,          (MF_GENERATE_ITEM | MF_BUILD_ANYWHERE_ON_LEVEL | MF_NOT_IN_HALLWAY | MF_ALTERNATIVE)},
1373         {0,         WALL_LEVER_HIDDEN,DUNGEON,  {1,1},      1,          0,          -1,         0,              1,              0,          0,          (MF_BUILD_IN_WALLS | MF_IN_PASSABLE_VIEW_OF_ORIGIN | MF_BUILD_ANYWHERE_ON_LEVEL | MF_ALTERNATIVE)}}},
1374     // Lava moat area -- key on an altar, surrounded with lava, levitation/fire immunity elsewhere on level, lava retracts when you grab the key
1375     {{3, 13},           {40, 60},   3,      5,          0,                  (BP_ADOPT_ITEM | BP_PURGE_INTERIOR | BP_OPEN_INTERIOR | BP_TREAT_AS_BLOCKING),  {
1376         {0,         ALTAR_SWITCH,DUNGEON,       {1,1},      1,          0,          -1,         0,              2,              0,          0,          (MF_ADOPT_ITEM | MF_BUILD_AT_ORIGIN | MF_TREAT_AS_BLOCKING)},
1377         {0,         LAVA,       LIQUID,         {60,60},    1,          0,          0,          0,              1,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_REPEAT_UNTIL_NO_PROGRESS)},
1378         {DF_LAVA_RETRACTABLE, LAVA_RETRACTABLE, LIQUID, {1,1}, 1,       0,          0,          0,              1,              0,          0,          (MF_PERMIT_BLOCKING | MF_EVERYWHERE)},
1379         {0,         0,          0,              {1,1},      1,          POTION,     POTION_LEVITATION, 0,       1,              0,          0,          (MF_GENERATE_ITEM | MF_BUILD_ANYWHERE_ON_LEVEL | MF_NOT_IN_HALLWAY | MF_ALTERNATIVE)},
1380         {0,         0,          0,              {1,1},      1,          POTION,     POTION_FIRE_IMMUNITY, 0,    1,              0,          0,          (MF_GENERATE_ITEM | MF_BUILD_ANYWHERE_ON_LEVEL | MF_NOT_IN_HALLWAY | MF_ALTERNATIVE)}}},
1381     // Poison gas -- key on an altar; take key to cause a caustic gas vent to appear and the door to be blocked; there is a hidden trapdoor or an escape item somewhere inside
1382     {{4, AMULET_LEVEL}, {35, 60},   7,      7,          0,                  (BP_ROOM | BP_PURGE_INTERIOR | BP_SURROUND_WITH_WALLS | BP_ADOPT_ITEM), {
1383         {0,         ALTAR_SWITCH,DUNGEON,       {1,1},      1,          0,          -1,         0,              2,              0,          0,          (MF_ADOPT_ITEM | MF_TREAT_AS_BLOCKING)},
1384         {0,         MACHINE_POISON_GAS_VENT_HIDDEN,DUNGEON,{1,2}, 1,    0,          -1,         0,              2,              0,          0,          0},
1385         {0,         TRAP_DOOR_HIDDEN,DUNGEON,   {1,1},      1,          0,          -1,         0,              2,              0,          0,          MF_ALTERNATIVE},
1386         {0,         0,          0,              {1,1},      1,          SCROLL,     SCROLL_TELEPORT, 0,         2,              0,          0,          (MF_GENERATE_ITEM | MF_NOT_IN_HALLWAY | MF_ALTERNATIVE)},
1387         {0,         0,          0,              {1,1},      1,          POTION,     POTION_DESCENT, 0,          2,              0,          0,          (MF_GENERATE_ITEM | MF_NOT_IN_HALLWAY | MF_ALTERNATIVE)},
1388         {0,         WALL_LEVER_HIDDEN_DORMANT,DUNGEON,{1,1},1,          0,          -1,         0,              1,              0,          0,          (MF_BUILD_IN_WALLS)},
1389         {0,         PORTCULLIS_DORMANT,DUNGEON,{1,1},       1,          0,          0,          0,              1,              0,          0,          (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING)}}},
1390     // Explosive situation -- key on an altar; take key to cause a methane gas vent to appear and a pilot light to ignite
1391     {{7, AMULET_LEVEL}, {80, 90},   10,     5,          0,                  (BP_ROOM | BP_PURGE_LIQUIDS | BP_SURROUND_WITH_WALLS | BP_ADOPT_ITEM),  {
1392         {0,         DOOR,       DUNGEON,        {1,1},      1,          0,          0,          0,              1,              0,          0,          (MF_BUILD_AT_ORIGIN)},
1393         {0,         FLOOR,      DUNGEON,        {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)},
1394         {0,         ALTAR_SWITCH,DUNGEON,       {1,1},      1,          0,          -1,         0,              1,              0,          0,          (MF_ADOPT_ITEM | MF_TREAT_AS_BLOCKING | MF_FAR_FROM_ORIGIN)},
1395         {0,         MACHINE_METHANE_VENT_HIDDEN,DUNGEON,{1,1}, 1,       0,          -1,         0,              1,              0,          0,          MF_NEAR_ORIGIN},
1396         {0,         PILOT_LIGHT_DORMANT,DUNGEON,{1,1},      1,          0,          -1,         0,              1,              0,          0,          (MF_FAR_FROM_ORIGIN | MF_BUILD_IN_WALLS)}}},
1397     // Burning grass -- key on an altar; take key to cause pilot light to ignite grass in room
1398     {{1, 7},            {40, 110},  10,     6,          0,                  (BP_ROOM | BP_PURGE_INTERIOR | BP_SURROUND_WITH_WALLS | BP_ADOPT_ITEM | BP_OPEN_INTERIOR),  {
1399         {DF_SMALL_DEAD_GRASS,ALTAR_SWITCH_RETRACTING,DUNGEON,{1,1},1,   0,          -1,         0,              1,              0,          0,          (MF_ADOPT_ITEM | MF_TREAT_AS_BLOCKING | MF_FAR_FROM_ORIGIN)},
1400         {DF_DEAD_FOLIAGE,0,     SURFACE,        {2,3},      0,          0,          -1,         0,              1,              0,          0,          0},
1401         {0,         FOLIAGE,    SURFACE,        {1,4},      0,          0,          -1,         0,              1,              0,          0,          0},
1402         {0,         GRASS,      SURFACE,        {10,25},    0,          0,          -1,         0,              1,              0,          0,          0},
1403         {0,         DEAD_GRASS, SURFACE,        {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)},
1404         {0,         PILOT_LIGHT_DORMANT,DUNGEON,{1,1},      1,          0,          -1,         0,              1,              0,          0,          MF_NEAR_ORIGIN | MF_BUILD_IN_WALLS}}},
1405     // Statuary -- key on an altar, area full of statues; take key to cause statues to burst and reveal monsters
1406     {{10, AMULET_LEVEL},{35, 90},   10,     2,          0,                  (BP_ADOPT_ITEM | BP_NO_INTERIOR_FLAG),  {
1407         {0,         ALTAR_SWITCH,DUNGEON,       {1,1},      1,          0,          -1,         0,              2,              0,          0,          (MF_ADOPT_ITEM | MF_NEAR_ORIGIN | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)},
1408         {0,         STATUE_DORMANT,DUNGEON,     {3,5},      3,          0,          -1,         0,              2,              HORDE_MACHINE_STATUE,0, (MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY | MF_GENERATE_HORDE | MF_MONSTERS_DORMANT | MF_FAR_FROM_ORIGIN)}}},
1409     // Guardian water puzzle -- key held by a guardian, flood trap in the room, glyphs scattered. Lure the guardian into the water to have him drop the key.
1410     {{4, AMULET_LEVEL}, {35, 70},   8,      4,          0,                  (BP_ROOM | BP_PURGE_INTERIOR | BP_SURROUND_WITH_WALLS | BP_ADOPT_ITEM), {
1411         {0,         0,          0,              {1,1},      1,          0,          -1,         0,              2,              0,          0,          (MF_BUILD_AT_ORIGIN)},
1412         {0,         0,          0,              {1,1},      1,          0,          -1,         MK_GUARDIAN,    2,              0,          0,          (MF_ADOPT_ITEM | MF_FAR_FROM_ORIGIN | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY | MF_MONSTER_TAKE_ITEM)},
1413         {0,         FLOOD_TRAP,DUNGEON,         {1,1},      1,          0,          -1,         0,              2,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)},
1414         {0,         MACHINE_GLYPH,DUNGEON,      {1,1},      4,          0,          -1,         0,              2,              0,          0,          (MF_EVERYWHERE | MF_NOT_IN_HALLWAY)}}},
1415     // Guardian gauntlet -- key in a room full of guardians, glyphs scattered and unavoidable.
1416     {{6, AMULET_LEVEL}, {50, 95},   10,     6,          0,                  (BP_ROOM | BP_ADOPT_ITEM),  {
1417         {DF_GLYPH_CIRCLE,ALTAR_INERT,DUNGEON,   {1,1},      1,          0,          -1,         0,              1,              0,          0,          (MF_ADOPT_ITEM | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY | MF_FAR_FROM_ORIGIN)},
1418         {0,         DOOR,       DUNGEON,        {1,1},      1,          0,          0,          0,              3,              0,          0,          (MF_PERMIT_BLOCKING | MF_BUILD_AT_ORIGIN)},
1419         {0,         0,          0,              {3,6},      3,          0,          -1,         MK_GUARDIAN,    2,              0,          0,          (MF_NEAR_ORIGIN | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY | MF_ALTERNATIVE)},
1420         {0,         0,          0,              {1,2},      1,          0,          -1,         MK_WINGED_GUARDIAN,2,           0,          0,          (MF_NEAR_ORIGIN | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY | MF_ALTERNATIVE)},
1421         {0,         MACHINE_GLYPH,DUNGEON,      {10,15},   10,          0,          -1,         0,              1,              0,          0,          (MF_PERMIT_BLOCKING | MF_NOT_IN_HALLWAY)},
1422         {0,         MACHINE_GLYPH,DUNGEON,      {1,1},      0,          0,          -1,         0,              2,              0,          0,          (MF_EVERYWHERE | MF_PERMIT_BLOCKING | MF_NOT_IN_HALLWAY)}}},
1423     // Guardian corridor -- key in a small room, with a connecting corridor full of glyphs, one guardian blocking the corridor.
1424     {{4, AMULET_LEVEL}, {85, 100},   5,     7,          0,                  (BP_ROOM | BP_ADOPT_ITEM | BP_PURGE_INTERIOR | BP_OPEN_INTERIOR | BP_SURROUND_WITH_WALLS),        {
1425         {DF_GLYPH_CIRCLE,ALTAR_INERT,DUNGEON,   {1,1},      1,          0,          -1,         MK_GUARDIAN,    3,              0,          0,          (MF_ADOPT_ITEM | MF_FAR_FROM_ORIGIN  | MF_ALTERNATIVE)},
1426         {DF_GLYPH_CIRCLE,ALTAR_INERT,DUNGEON,   {1,1},      1,          0,          -1,         MK_WINGED_GUARDIAN,3,           0,          0,          (MF_ADOPT_ITEM | MF_FAR_FROM_ORIGIN  | MF_ALTERNATIVE)},
1427         {0,         MACHINE_GLYPH,DUNGEON,      {3,5},      2,          0,          0,          0,              2,              0,          0,          MF_NEAR_ORIGIN | MF_NOT_IN_HALLWAY},
1428         {0,         0,          0,              {1,1},      1,          0,          0,          0,              3,              0,          0,          MF_BUILD_AT_ORIGIN},
1429         {0,         WALL,DUNGEON,               {80,80},    1,          0,          -1,         0,              1,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_REPEAT_UNTIL_NO_PROGRESS)},
1430         {0,         MACHINE_GLYPH,DUNGEON,      {1,1},      1,          0,          0,          0,              1,              0,          0,          (MF_PERMIT_BLOCKING | MF_EVERYWHERE)},
1431         {0,         MACHINE_GLYPH,DUNGEON,      {1,1},      1,          0,          -1,         0,              1,              0,          0,          (MF_IN_PASSABLE_VIEW_OF_ORIGIN | MF_NOT_IN_HALLWAY | MF_BUILD_ANYWHERE_ON_LEVEL)}}},
1432     // Sacrifice altar -- lure the chosen monster from elsewhere on the level onto the altar to release the key.
1433     {{4, AMULET_LEVEL}, {20, 60},   12,     6,          0,                  (BP_ROOM | BP_ADOPT_ITEM | BP_PURGE_INTERIOR | BP_OPEN_INTERIOR | BP_SURROUND_WITH_WALLS),        {
1434         {DF_BONES,  0,          0,              {3,4},      2,          0,          -1,         0,              1,              0,          0,          0},
1435         {0,         0,          0,              {1,1},      0,          0,          -1,         0,              2,              0,          0,          (MF_BUILD_IN_WALLS | MF_EVERYWHERE)},
1436         {DF_TRIGGER_AREA,SACRIFICE_ALTAR_DORMANT,DUNGEON,{1,1},1,       0,          -1,         0,              2,              0,          0,          (MF_FAR_FROM_ORIGIN | MF_NOT_IN_HALLWAY)},
1437         {0,         SACRIFICE_CAGE_DORMANT,DUNGEON,{1,1},   1,          0,          -1,         0,              2,              0,          0,          (MF_ADOPT_ITEM | MF_NOT_IN_HALLWAY | MF_IMPREGNABLE)},
1438         {0,         DEMONIC_STATUE,DUNGEON,     {1,1},      1,          0,          -1,         0,              2,              0,          0,          (MF_FAR_FROM_ORIGIN | MF_NOT_IN_HALLWAY | MF_IMPREGNABLE)},
1439         {0,         STATUE_INSTACRACK,DUNGEON,  {1,1},      1,          0,          -1,         0,              2,              (HORDE_SACRIFICE_TARGET), 0, (MF_BUILD_ANYWHERE_ON_LEVEL | MF_GENERATE_HORDE | MF_MONSTERS_DORMANT | MF_TREAT_AS_BLOCKING | MF_IMPREGNABLE | MF_NOT_IN_HALLWAY)}}},
1440     // Summoning circle -- key in a room with an eldritch totem, glyphs unavoidable. // DISABLED. (Not fun enough.)
1441     {{12, AMULET_LEVEL}, {50, 100}, 0,      2,          0,                  (BP_ROOM | BP_OPEN_INTERIOR | BP_ADOPT_ITEM),   {
1442         {DF_GLYPH_CIRCLE,ALTAR_INERT,DUNGEON,   {1,1},      1,          0,          -1,         0,              3,              0,          0,          (MF_ADOPT_ITEM | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY | MF_FAR_FROM_ORIGIN)},
1443         {DF_GLYPH_CIRCLE,0,     0,              {1,1},      1,          0,          -1,         MK_ELDRITCH_TOTEM,3,            0,          0,          (MF_FAR_FROM_ORIGIN | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)}}},
1444     // Beckoning obstacle -- key surrounded by glyphs in a room with a mirrored totem.
1445     {{5, AMULET_LEVEL}, {60, 100},  10,     4,          0,                  (BP_ROOM | BP_PURGE_INTERIOR | BP_SURROUND_WITH_WALLS | BP_OPEN_INTERIOR | BP_ADOPT_ITEM), {
1446         {DF_GLYPH_CIRCLE,ALTAR_INERT,DUNGEON,   {1,1},      1,          0,          -1,         0,              3,              0,          0,          (MF_ADOPT_ITEM | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY | MF_FAR_FROM_ORIGIN | MF_IN_VIEW_OF_ORIGIN)},
1447         {0,         0,          0,              {1,1},      1,          0,          -1,         MK_MIRRORED_TOTEM,3,            0,          0,          (MF_NEAR_ORIGIN | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY | MF_IN_VIEW_OF_ORIGIN)},
1448         {0,         0,          0,              {1,1},      1,          0,          -1,         0,              2,              0,          0,          (MF_BUILD_AT_ORIGIN)},
1449         {0,         MACHINE_GLYPH,DUNGEON,      {3,5},      2,          0,          -1,         0,              2,              0,          0,          (MF_TREAT_AS_BLOCKING)}}},
1450     // Worms in the walls -- key on altar; take key to cause underworms to burst out of the walls
1451     {{12,AMULET_LEVEL}, {7, 7},     7,      2,          0,                  (BP_ADOPT_ITEM),    {
1452         {0,         ALTAR_SWITCH,DUNGEON,       {1,1},      1,          0,          -1,         0,              2,              0,          0,          (MF_ADOPT_ITEM | MF_NEAR_ORIGIN | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)},
1453         {0,         WALL_MONSTER_DORMANT,DUNGEON,{5,8},     5,          0,          -1,         MK_UNDERWORM,   1,              0,          0,          (MF_MONSTERS_DORMANT | MF_BUILD_IN_WALLS | MF_NOT_ON_LEVEL_PERIMETER)}}},
1454     // Mud pit -- key on an altar, room full of mud, take key to cause bog monsters to spawn in the mud
1455     {{12, AMULET_LEVEL},{40, 90},   10,     3,          0,                  (BP_ROOM | BP_ADOPT_ITEM | BP_SURROUND_WITH_WALLS | BP_PURGE_LIQUIDS),  {
1456         {DF_SWAMP,      0,      0,              {5,5},      0,          0,          -1,         0,              1,              0,          0,          0},
1457         {DF_SWAMP,  ALTAR_SWITCH,DUNGEON,       {1,1},      1,          0,          -1,         0,              2,              0,          0,          (MF_ADOPT_ITEM | MF_FAR_FROM_ORIGIN | MF_TREAT_AS_BLOCKING)},
1458         {DF_MUD_DORMANT,0,      0,              {3,4},      3,          0,          -1,         0,              1,              HORDE_MACHINE_MUD,0,    (MF_GENERATE_HORDE | MF_MONSTERS_DORMANT)}}},
1459     // Electric crystals -- key caged on an altar, darkened crystal globes around the room, lightning the globes to release the key.
1460     {{6, AMULET_LEVEL},{40, 60},    10,     5,          0,                  (BP_ROOM | BP_ADOPT_ITEM | BP_SURROUND_WITH_WALLS | BP_OPEN_INTERIOR | BP_PURGE_INTERIOR),  {
1461         {0,         CARPET,     DUNGEON,        {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)},
1462         {0,         ELECTRIC_CRYSTAL_OFF,DUNGEON,{3,4},     3,          0,          -1,         0,              3,              0,          0,          (MF_NOT_IN_HALLWAY | MF_IMPREGNABLE)},
1463         {0,         SACRED_GLYPH,  DUNGEON,     {1, 1},     1,          0,          -1,         0,              1,              0,          0,          (MF_BUILD_AT_ORIGIN)},
1464         {0,         ALTAR_CAGE_RETRACTABLE,DUNGEON,{1,1},   1,          0,          -1,         0,              3,              0,          0,          (MF_ADOPT_ITEM | MF_IMPREGNABLE | MF_NOT_IN_HALLWAY | MF_FAR_FROM_ORIGIN)},
1465         {0,         TURRET_LEVER, DUNGEON,      {7,9},      4,          0,          -1,         MK_SPARK_TURRET,3,              0,          0,          (MF_BUILD_IN_WALLS | MF_MONSTERS_DORMANT)}}},
1466     // Zombie crypt -- key on an altar; coffins scattered around; brazier in the room; take key to cause zombies to burst out of all of the coffins
1467     {{12, AMULET_LEVEL},{60, 90},   10,     8,          0,                  (BP_ROOM | BP_ADOPT_ITEM | BP_SURROUND_WITH_WALLS | BP_PURGE_INTERIOR), {
1468         {0,         DOOR,       DUNGEON,        {1,1},      1,          0,          -1,         0,              1,              0,          0,          (MF_BUILD_AT_ORIGIN)},
1469         {DF_BONES,  0,          0,              {3,4},      2,          0,          -1,         0,              1,              0,          0,          0},
1470         {DF_ASH,    0,          0,              {3,4},      2,          0,          -1,         0,              1,              0,          0,          0},
1471         {DF_AMBIENT_BLOOD,0,    0,              {1,2},      1,          0,          -1,         0,              1,              0,          0,          0},
1472         {DF_AMBIENT_BLOOD,0,    0,              {1,2},      1,          0,          -1,         0,              1,              0,          0,          0},
1473         {0,         ALTAR_SWITCH,DUNGEON,       {1,1},      1,          0,          -1,         0,              2,              0,          0,          (MF_ADOPT_ITEM | MF_FAR_FROM_ORIGIN | MF_TREAT_AS_BLOCKING)},
1474         {0,         BRAZIER,    DUNGEON,        {1,1},      1,          0,          -1,         0,              2,              0,          0,          (MF_NEAR_ORIGIN | MF_TREAT_AS_BLOCKING)},
1475         {0,         COFFIN_CLOSED, DUNGEON,     {6,8},      1,          0,          0,          MK_ZOMBIE,      2,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY | MF_MONSTERS_DORMANT)}}},
1476     // Haunted house -- key on an altar; take key to cause the room to darken, ectoplasm to cover everything and phantoms to appear
1477     {{16, AMULET_LEVEL},{45, 150},  10,     4,          0,                  (BP_ROOM | BP_ADOPT_ITEM | BP_PURGE_INTERIOR | BP_SURROUND_WITH_WALLS), {
1478         {0,         ALTAR_SWITCH,DUNGEON,       {1,1},      1,          0,          -1,         0,              2,              0,          0,          (MF_ADOPT_ITEM | MF_FAR_FROM_ORIGIN | MF_TREAT_AS_BLOCKING)},
1479         {0,         DARK_FLOOR_DORMANT,DUNGEON, {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)},
1480         {0,         DARK_FLOOR_DORMANT,DUNGEON, {4,5},      4,          0,          -1,         MK_PHANTOM,     1,              0,          0,          (MF_MONSTERS_DORMANT)},
1481         {0,         HAUNTED_TORCH_DORMANT,DUNGEON,{5,10},   3,          0,          -1,         0,              2,              0,          0,          (MF_BUILD_IN_WALLS)}}},
1482     // Worm tunnels -- hidden lever causes tunnels to open up revealing worm areas and a key
1483     {{8, AMULET_LEVEL},{80, 175},   10,     6,          0,                  (BP_ROOM | BP_ADOPT_ITEM | BP_PURGE_INTERIOR | BP_MAXIMIZE_INTERIOR | BP_SURROUND_WITH_WALLS),  {
1484         {0,         ALTAR_INERT,DUNGEON,        {1,1},      1,          0,          -1,         0,              2,              0,          0,          (MF_ADOPT_ITEM | MF_FAR_FROM_ORIGIN | MF_TREAT_AS_BLOCKING)},
1485         {0,         0,          0,              {3,6},      3,          0,          -1,         MK_UNDERWORM,   1,              0,          0,          0},
1486         {0,         GRANITE,    DUNGEON,        {150,150},  1,          0,          -1,         0,              1,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_REPEAT_UNTIL_NO_PROGRESS)},
1487         {DF_WORM_TUNNEL_MARKER_DORMANT,GRANITE,DUNGEON,{0,0},0,         0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE | MF_PERMIT_BLOCKING)},
1488         {DF_TUNNELIZE,WORM_TUNNEL_OUTER_WALL,DUNGEON,{1,1}, 1,          0,          -1,         0,              1,              0,          0,          (MF_BUILD_AT_ORIGIN | MF_PERMIT_BLOCKING)},
1489         {0,         WALL_LEVER_HIDDEN,DUNGEON,  {1,1},      1,          0,          -1,         0,              1,              0,          0,          (MF_BUILD_IN_WALLS | MF_IN_PASSABLE_VIEW_OF_ORIGIN | MF_BUILD_ANYWHERE_ON_LEVEL)}}},
1490     // Gauntlet -- key on an altar; take key to cause turrets to emerge
1491     {{5, 24},           {35, 90},   10,     2,          0,                  (BP_ADOPT_ITEM | BP_NO_INTERIOR_FLAG),  {
1492         {0,         ALTAR_SWITCH,DUNGEON,       {1,1},      1,          0,          -1,         0,              2,              0,          0,          (MF_ADOPT_ITEM | MF_NEAR_ORIGIN | MF_NOT_IN_HALLWAY | MF_TREAT_AS_BLOCKING)},
1493         {0,         TURRET_DORMANT,DUNGEON,     {4,6},      4,          0,          -1,         0,              2,              HORDE_MACHINE_TURRET,0, (MF_TREAT_AS_BLOCKING | MF_GENERATE_HORDE | MF_MONSTERS_DORMANT | MF_BUILD_IN_WALLS | MF_IN_VIEW_OF_ORIGIN)}}},
1494     // Boss -- key is held by a boss atop a pile of bones in a secret room. A few fungus patches light up the area.
1495     {{5, AMULET_LEVEL}, {40, 100},  18,     3,          0,                  (BP_ROOM | BP_ADOPT_ITEM | BP_SURROUND_WITH_WALLS | BP_PURGE_LIQUIDS), {
1496         {DF_BONES,  SECRET_DOOR,DUNGEON,        {1,1},      1,          0,          0,          0,              3,              0,          0,          (MF_PERMIT_BLOCKING | MF_BUILD_AT_ORIGIN)},
1497         {DF_LUMINESCENT_FUNGUS, STATUE_INERT,DUNGEON,{7,7}, 0,          0,          -1,         0,              2,              0,          0,          (MF_TREAT_AS_BLOCKING)},
1498         {DF_BONES,  0,          0,              {1,1},      1,          0,          -1,         0,              1,              HORDE_MACHINE_BOSS, 0,  (MF_ADOPT_ITEM | MF_FAR_FROM_ORIGIN | MF_MONSTER_TAKE_ITEM | MF_GENERATE_HORDE | MF_MONSTER_SLEEPING)}}},
1499 
1500     // -- FLAVOR MACHINES --
1501 
1502     // Bloodwort -- bloodwort stalk, some pods, and surrounding grass
1503     {{1,DEEPEST_LEVEL}, {5, 5},     0,          2,      0,                  (BP_TREAT_AS_BLOCKING), {
1504         {DF_GRASS,  BLOODFLOWER_STALK, SURFACE, {1, 1},     1,          0,          -1,         0,              0,              0,          0,          (MF_BUILD_AT_ORIGIN | MF_NOT_IN_HALLWAY)},
1505         {DF_BLOODFLOWER_PODS_GROW_INITIAL,0, 0, {1, 1},     1,          0,          -1,         0,              1,              0,          0,          (MF_BUILD_AT_ORIGIN | MF_TREAT_AS_BLOCKING)}}},
1506     // Shrine -- safe haven constructed and abandoned by a past adventurer
1507     {{1,DEEPEST_LEVEL}, {15, 25},   0,          3,      0,                  (BP_ROOM | BP_PURGE_INTERIOR | BP_SURROUND_WITH_WALLS | BP_OPEN_INTERIOR), {
1508         {0,         SACRED_GLYPH,  DUNGEON,     {1, 1},     1,          0,          -1,         0,              3,              0,          0,          (MF_BUILD_AT_ORIGIN)},
1509         {0,         HAVEN_BEDROLL, SURFACE,     {1, 1},     1,          0,          -1,         0,              2,              0,          0,          (MF_FAR_FROM_ORIGIN | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)},
1510         {0,         BONES,      SURFACE,        {1, 1},     1,          (POTION|SCROLL|WEAPON|ARMOR|RING),-1,0, 2,              0,          0,          (MF_GENERATE_ITEM | MF_TREAT_AS_BLOCKING | MF_NOT_IN_HALLWAY)}}},
1511     // Idyll -- ponds and some grass and forest
1512     {{1,DEEPEST_LEVEL}, {80, 120},  0,      2,          0,                  BP_NO_INTERIOR_FLAG, {
1513         {DF_GRASS,  FOLIAGE,    SURFACE,        {3, 4},     3,          0,          -1,         0,              1,              0,          0,          0},
1514         {DF_DEEP_WATER_POOL,0,  0,              {2, 3},     2,          0,          -1,         0,              5,              0,          0,          (MF_NOT_IN_HALLWAY)}}},
1515     // Swamp -- mud, grass and some shallow water
1516     {{1,DEEPEST_LEVEL}, {50, 65},   0,      2,          0,                  BP_NO_INTERIOR_FLAG, {
1517         {DF_SWAMP,  0,          0,              {6, 8},     3,          0,          -1,         0,              1,              0,          0,          0},
1518         {DF_DEEP_WATER_POOL,0,  0,              {0, 1},     0,          0,          -1,         0,              3,              0,          0,          (MF_NOT_IN_HALLWAY | MF_TREAT_AS_BLOCKING)}}},
1519     // Camp -- hay, junk, urine, vomit
1520     {{1,DEEPEST_LEVEL}, {40, 50},   0,      4,          0,                  BP_NO_INTERIOR_FLAG, {
1521         {DF_HAY,    0,          0,              {1, 3},     1,          0,          -1,         0,              1,              0,          0,          (MF_NOT_IN_HALLWAY | MF_IN_VIEW_OF_ORIGIN)},
1522         {DF_JUNK,   0,          0,              {1, 2},     1,          0,          -1,         0,              3,              0,          0,          (MF_NOT_IN_HALLWAY | MF_IN_VIEW_OF_ORIGIN)},
1523         {DF_URINE,  0,          0,              {3, 5},     1,          0,          -1,         0,              1,              0,          0,          MF_IN_VIEW_OF_ORIGIN},
1524         {DF_VOMIT,  0,          0,              {0, 2},     0,          0,          -1,         0,              1,              0,          0,          MF_IN_VIEW_OF_ORIGIN}}},
1525     // Remnant -- carpet surrounded by ash and with some statues
1526     {{1,DEEPEST_LEVEL}, {80, 120},  0,      2,          0,                  BP_NO_INTERIOR_FLAG, {
1527         {DF_REMNANT, 0,         0,              {6, 8},     3,          0,          -1,         0,              1,              0,          0,          0},
1528         {0,         STATUE_INERT,DUNGEON,       {3, 5},     2,          0,          -1,         0,              1,              0,          0,          (MF_NOT_IN_HALLWAY | MF_TREAT_AS_BLOCKING)}}},
1529     // Dismal -- blood, bones, charcoal, some rubble
1530     {{1,DEEPEST_LEVEL}, {60, 70},   0,      3,          0,                  BP_NO_INTERIOR_FLAG, {
1531         {DF_AMBIENT_BLOOD, 0,   0,              {5,10},     3,          0,          -1,         0,              1,              0,          0,          MF_NOT_IN_HALLWAY},
1532         {DF_ASH,    0,          0,              {4, 8},     2,          0,          -1,         0,              1,              0,          0,          MF_NOT_IN_HALLWAY},
1533         {DF_BONES,  0,          0,              {3, 5},     2,          0,          -1,         0,              1,              0,          0,          MF_NOT_IN_HALLWAY}}},
1534     // Chasm catwalk -- narrow bridge over a chasm, possibly under fire from a turret or two
1535     {{1,DEEPEST_LEVEL-1},{40, 80},  0,      4,          0,                  (BP_REQUIRE_BLOCKING | BP_OPEN_INTERIOR | BP_NO_INTERIOR_FLAG), {
1536         {DF_CHASM_HOLE, 0,      0,              {80, 80},   1,          0,          -1,         0,              1,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_REPEAT_UNTIL_NO_PROGRESS)},
1537         {DF_CATWALK_BRIDGE,0,   0,              {0,0},      0,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)},
1538         {0,         MACHINE_TRIGGER_FLOOR, DUNGEON, {0,1},  0,          0,          0,          0,              1,              0,          0,          (MF_NEAR_ORIGIN | MF_PERMIT_BLOCKING)},
1539         {0,         TURRET_DORMANT,DUNGEON,     {1, 2},     1,          0,          -1,         0,              2,              HORDE_MACHINE_TURRET,0, (MF_TREAT_AS_BLOCKING | MF_GENERATE_HORDE | MF_MONSTERS_DORMANT | MF_BUILD_IN_WALLS | MF_IN_VIEW_OF_ORIGIN)}}},
1540     // Lake walk -- narrow bridge of shallow water through a lake, possibly under fire from a turret or two
1541     {{1,DEEPEST_LEVEL}, {40, 80},   0,      3,          0,                  (BP_REQUIRE_BLOCKING | BP_OPEN_INTERIOR | BP_NO_INTERIOR_FLAG), {
1542         {DF_LAKE_CELL,  0,      0,              {80, 80},   1,          0,          -1,         0,              1,              0,          0,          (MF_TREAT_AS_BLOCKING | MF_REPEAT_UNTIL_NO_PROGRESS)},
1543         {0,         MACHINE_TRIGGER_FLOOR, DUNGEON, {0,1},  0,          0,          0,          0,              1,              0,          0,          (MF_NEAR_ORIGIN | MF_PERMIT_BLOCKING)},
1544         {0,         TURRET_DORMANT,DUNGEON,     {1, 2},     1,          0,          -1,         0,              2,              HORDE_MACHINE_TURRET,0, (MF_TREAT_AS_BLOCKING | MF_GENERATE_HORDE | MF_MONSTERS_DORMANT | MF_BUILD_IN_WALLS | MF_IN_VIEW_OF_ORIGIN)}}},
1545     // Paralysis trap -- already-revealed pressure plate with a few hidden vents nearby.
1546     {{1,DEEPEST_LEVEL}, {35, 40},   0,      2,          0,                  (BP_NO_INTERIOR_FLAG), {
1547         {0,         GAS_TRAP_PARALYSIS, DUNGEON, {1,2},     1,          0,          0,          0,              3,              0,          0,          (MF_NEAR_ORIGIN | MF_NOT_IN_HALLWAY)},
1548         {0,         MACHINE_PARALYSIS_VENT_HIDDEN,DUNGEON,{3, 4},2,     0,          0,          0,              3,              0,          0,          (MF_FAR_FROM_ORIGIN | MF_NOT_IN_HALLWAY)}}},
1549     // Paralysis trap -- hidden pressure plate with a few vents nearby.
1550     {{1,DEEPEST_LEVEL}, {35, 40},   0,      2,          0,                  (BP_NO_INTERIOR_FLAG), {
1551         {0,         GAS_TRAP_PARALYSIS_HIDDEN, DUNGEON, {1,2},1,        0,          0,          0,              3,              0,          0,          (MF_NEAR_ORIGIN | MF_NOT_IN_HALLWAY)},
1552         {0,         MACHINE_PARALYSIS_VENT_HIDDEN,DUNGEON,{3, 4},2,     0,          0,          0,              3,              0,          0,          (MF_FAR_FROM_ORIGIN | MF_NOT_IN_HALLWAY)}}},
1553     // Statue comes alive -- innocent-looking statue that bursts to reveal a monster when the player approaches
1554     {{1,DEEPEST_LEVEL}, {5, 5},     0,      3,          0,                  (BP_NO_INTERIOR_FLAG), {
1555         {0,         STATUE_DORMANT,DUNGEON,     {1, 1},     1,          0,          -1,         0,              1,              HORDE_MACHINE_STATUE,0, (MF_GENERATE_HORDE | MF_MONSTERS_DORMANT | MF_BUILD_AT_ORIGIN | MF_ALTERNATIVE)},
1556         {0,         STATUE_DORMANT,DUNGEON,     {1, 1},     1,          0,          -1,         0,              1,              HORDE_MACHINE_STATUE,0, (MF_GENERATE_HORDE | MF_MONSTERS_DORMANT | MF_BUILD_IN_WALLS | MF_ALTERNATIVE | MF_NOT_ON_LEVEL_PERIMETER)},
1557         {0,         MACHINE_TRIGGER_FLOOR,DUNGEON,{0,0},    2,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)}}},
1558     // Worms in the walls -- step on trigger region to cause underworms to burst out of the walls
1559     {{1,DEEPEST_LEVEL}, {7, 7},     0,      2,          0,                  (BP_NO_INTERIOR_FLAG), {
1560         {0,         WALL_MONSTER_DORMANT,DUNGEON,{1, 3},    1,          0,          -1,         MK_UNDERWORM,   1,              0,          0,          (MF_MONSTERS_DORMANT | MF_BUILD_IN_WALLS | MF_NOT_ON_LEVEL_PERIMETER)},
1561         {0,         MACHINE_TRIGGER_FLOOR,DUNGEON,{0,0},    2,          0,          -1,         0,              0,              0,          0,          (MF_EVERYWHERE)}}},
1562     // Sentinels
1563     {{1,DEEPEST_LEVEL}, {40, 40},   0,      2,          0,                  (BP_NO_INTERIOR_FLAG), {
1564         {0,         STATUE_INERT,DUNGEON,       {3, 3},     3,          0,          -1,         MK_SENTINEL,    2,              0,          0,          (MF_NOT_IN_HALLWAY | MF_TREAT_AS_BLOCKING | MF_IN_VIEW_OF_ORIGIN)},
1565         {DF_ASH,    0,          0,              {2, 3},     0,          0,          -1,         0,              0,              0,          0,          0}}},
1566 };
1567 
1568 
1569 // Defines all creatures, which include monsters and the player:
1570 creatureType monsterCatalog[NUMBER_MONSTER_KINDS] = {
1571     //  name            ch      color           HP      def     acc     damage          reg move    attack  blood           light isLarge     DFChance DFType         bolts       behaviorF, abilityF
1572     {0, "you",  G_PLAYER,       &playerInLightColor,30, 0,      100,    {1, 2, 1},      20, 100,    100,    DF_RED_BLOOD,   0,    false,      0,      0,              {0},
1573         (MONST_MALE | MONST_FEMALE)},
1574 
1575     {0, "rat",          G_RAT,    &gray,          6,      0,      80,     {1, 3, 1},      20, 100,    100,    DF_RED_BLOOD,   0,    false,      1,      DF_URINE,       {0}},
1576     {0, "kobold",       G_KOBOLD,    &goblinColor,   7,      0,      80,     {1, 4, 1},      20, 100,    100,    DF_RED_BLOOD,   0,    false,      0,      0,              {0}},
1577     {0, "jackal",       G_JACKAL,    &jackalColor,   8,      0,      70,     {2, 4, 1},      20, 50,     100,    DF_RED_BLOOD,   0,    false,      1,      DF_URINE,              {0}},
1578     {0, "eel",          G_EEL,    &eelColor,      18,     27,     100,    {3, 7, 2},      5,  50,     100,    0,              0,    false,      0,      0,              {0},
1579         (MONST_RESTRICTED_TO_LIQUID | MONST_IMMUNE_TO_WATER | MONST_SUBMERGES | MONST_FLITS | MONST_NEVER_SLEEPS)},
1580     {0, "monkey",       G_MONKEY,    &ogreColor,     12,     17,     100,    {1, 3, 1},      20, 100,    100,    DF_RED_BLOOD,   0,    false,      1,      DF_URINE,       {0},
1581         (0), (MA_HIT_STEAL_FLEE)},
1582     {0, "bloat",        G_BLOAT,    &poisonGasColor,4,      0,      100,    {0, 0, 0},      5,  100,    100,    DF_PURPLE_BLOOD,0,    false,      0,      DF_BLOAT_DEATH, {0},
1583         (MONST_FLIES | MONST_FLITS), (MA_KAMIKAZE | MA_DF_ON_DEATH)},
1584     {0, "pit bloat",    G_BLOAT,    &lightBlue,     4,      0,      100,    {0, 0, 0},      5,  100,    100,    DF_PURPLE_BLOOD,0,    false,      0,      DF_HOLE_POTION, {0},
1585         (MONST_FLIES | MONST_FLITS), (MA_KAMIKAZE | MA_DF_ON_DEATH)},
1586     {0, "goblin",       G_GOBLIN,    &goblinColor,   15,     10,     70,     {2, 5, 1},      20, 100,    100,    DF_RED_BLOOD,   0,    false,      0,      0,              {0},
1587         (0),  (MA_ATTACKS_PENETRATE | MA_AVOID_CORRIDORS)},
1588     {0, "goblin conjurer",G_GOBLIN_MAGIC,  &goblinConjurerColor, 10,10,    70,     {2, 4, 1},      20, 100,    100,    DF_RED_BLOOD,   0,    false,      0,      0,              {0},
1589         (MONST_MAINTAINS_DISTANCE | MONST_CAST_SPELLS_SLOWLY | MONST_CARRY_ITEM_25), (MA_CAST_SUMMON | MA_AVOID_CORRIDORS)},
1590     {0, "goblin mystic",G_GOBLIN_MAGIC,    &goblinMysticColor, 10, 10,     70,     {2, 4, 1},      20, 100,    100,    DF_RED_BLOOD,   0,    false,      0,      0,              {BOLT_SHIELDING},
1591         (MONST_MAINTAINS_DISTANCE | MONST_CARRY_ITEM_25), (MA_AVOID_CORRIDORS)},
1592     {0, "goblin totem", G_TOTEM, &orange,    30,     0,      0,      {0, 0, 0},      0,  100,    300,    DF_RUBBLE_BLOOD,IMP_LIGHT,    false,0,    0,              {BOLT_HASTE, BOLT_SPARK},
1593         (MONST_IMMUNE_TO_WEBS | MONST_NEVER_SLEEPS | MONST_IMMOBILE | MONST_INANIMATE | MONST_WILL_NOT_USE_STAIRS), (0)},
1594     {0, "pink jelly",   G_JELLY,    &pinkJellyColor,50,     0,      85,     {1, 3, 1},      0,  100,    100,    DF_PURPLE_BLOOD,0,    true,       0,      0,              {0},
1595         (MONST_NEVER_SLEEPS), (MA_CLONE_SELF_ON_DEFEND)},
1596     {0, "toad",         G_TOAD,    &toadColor,     18,     0,      90,     {1, 4, 1},      10, 100,    100,    DF_GREEN_BLOOD, 0,    false,      0,      0,              {0},
1597         (0), (MA_HIT_HALLUCINATE)},
1598     {0, "vampire bat",  G_BAT,    &gray,          18,     25,     100,    {2, 6, 1},      20, 50,     100,    DF_RED_BLOOD,   0,    false,      0,      0,              {0},
1599         (MONST_FLIES | MONST_FLITS), (MA_TRANSFERENCE)},
1600     {0, "arrow turret", G_TURRET,&black,     30,     0,      90,     {2, 6, 1},      0,  100,    250,    0,              0,    false,      0,      0,              {BOLT_DISTANCE_ATTACK},
1601         (MONST_TURRET), (0)},
1602     {0, "acid mound",   G_MOUND,    &acidBackColor, 15,     10,     70,     {1, 3, 1},      5,  100,    100,    DF_ACID_BLOOD,  0,    false,      0,      0,              {0},
1603         (MONST_DEFEND_DEGRADE_WEAPON), (MA_HIT_DEGRADE_ARMOR)},
1604     {0, "centipede",    G_CENTIPEDE,    &centipedeColor,20,     20,     80,     {4, 12, 1},     20, 100,    100,    DF_GREEN_BLOOD, 0,    false,      0,      0,              {0},
1605         (0), (MA_CAUSES_WEAKNESS)},
1606     {0, "ogre",         G_OGRE,    &ogreColor,     55,     60,     125,    {9, 13, 2},     20, 100,    200,    DF_RED_BLOOD,   0,    true,       0,      0,              {0},
1607         (MONST_MALE | MONST_FEMALE), (MA_AVOID_CORRIDORS | MA_ATTACKS_STAGGER)},
1608     {0, "bog monster",  G_BOG_MONSTER,    &krakenColor,   55,     60,     5000,   {3, 4, 1},      3,  200,    100,    0,              0,    true,       0,      0,              {0},
1609         (MONST_RESTRICTED_TO_LIQUID | MONST_SUBMERGES | MONST_FLITS | MONST_FLEES_NEAR_DEATH), (MA_SEIZES)},
1610     {0, "ogre totem",   G_TOTEM, &green,     70,     0,      0,      {0, 0, 0},      0,  100,    400,    DF_RUBBLE_BLOOD,LICH_LIGHT,    false,0,   0,              {BOLT_HEALING, BOLT_SLOW_2},
1611         (MONST_IMMUNE_TO_WEBS | MONST_NEVER_SLEEPS | MONST_IMMOBILE | MONST_INANIMATE | MONST_WILL_NOT_USE_STAIRS), (0)},
1612     {0, "spider",       G_SPIDER,    &white,         20,     70,     90,     {3, 4, 2},      20, 100,    200,    DF_GREEN_BLOOD, 0,    false,      0,      0,              {BOLT_SPIDERWEB},
1613         (MONST_IMMUNE_TO_WEBS | MONST_CAST_SPELLS_SLOWLY | MONST_ALWAYS_USE_ABILITY), (MA_POISONS)},
1614     {0, "spark turret", G_TURRET, &lightningColor,80,0,      100,    {0, 0, 0},      0,  100,    150,    0,              SPARK_TURRET_LIGHT,    false, 0,  0,      {BOLT_SPARK},
1615         (MONST_TURRET), (0)},
1616     {0, "wisp",         G_WISP,    &wispLightColor,10,     90,     100,    {0, 0, 0},      5,  100,    100,    DF_ASH_BLOOD,   WISP_LIGHT,    false, 0,  0,              {0},
1617         (MONST_IMMUNE_TO_FIRE | MONST_FLIES | MONST_FLITS | MONST_NEVER_SLEEPS | MONST_FIERY | MONST_DIES_IF_NEGATED), (MA_HIT_BURN)},
1618     {0, "wraith",       G_WRAITH,    &wraithColor,   50,     60,     120,    {6, 13, 2},     5,  50,     100,    DF_GREEN_BLOOD, 0,    true,       0,      0,              {0},
1619         (MONST_FLEES_NEAR_DEATH)},
1620     {0, "zombie",       G_ZOMBIE,    &vomitColor,    80,     0,      120,    {7, 12, 1},     0,  100,    100,    DF_ROT_GAS_BLOOD,0,    true,      100,    DF_ROT_GAS_PUFF, {0}},
1621     {0, "troll",        G_TROLL,    &trollColor,    65,     70,     125,    {10, 15, 3},    1,  100,    100,    DF_RED_BLOOD,   0,    true,       0,      0,              {0},
1622         (MONST_MALE | MONST_FEMALE)},
1623     {0, "ogre shaman",  G_OGRE_MAGIC,    &green,         45,     40,     100,    {5, 9, 1},      20, 100,    200,    DF_RED_BLOOD,   0,    true,       0,      0,              {BOLT_HASTE, BOLT_SPARK},
1624         (MONST_MAINTAINS_DISTANCE | MONST_CAST_SPELLS_SLOWLY | MONST_MALE | MONST_FEMALE), (MA_CAST_SUMMON | MA_AVOID_CORRIDORS)},
1625     {0, "naga",         G_NAGA,    &trollColor,    75,     70,     150,    {7, 11, 4},     10, 100,    100,    DF_GREEN_BLOOD, 0,    true,       100,    DF_PUDDLE,      {0},
1626         (MONST_IMMUNE_TO_WATER | MONST_SUBMERGES | MONST_NEVER_SLEEPS | MONST_FEMALE), (MA_ATTACKS_ALL_ADJACENT)},
1627     {0, "salamander",   G_SALAMANDER,    &salamanderColor,60,    70,     150,    {5, 11, 3},     10, 100,    100,    DF_ASH_BLOOD,   SALAMANDER_LIGHT,    true,  100, DF_SALAMANDER_FLAME, {0},
1628         (MONST_IMMUNE_TO_FIRE | MONST_SUBMERGES | MONST_NEVER_SLEEPS | MONST_FIERY | MONST_MALE), (MA_ATTACKS_EXTEND)},
1629     {0, "explosive bloat",G_BLOAT,  &orange,        10,     0,      100,    {0, 0, 0},      5,  100,    100,    DF_RED_BLOOD,   EXPLOSIVE_BLOAT_LIGHT,    false,0, DF_BLOAT_EXPLOSION, {0},
1630         (MONST_FLIES | MONST_FLITS), (MA_KAMIKAZE | MA_DF_ON_DEATH)},
1631     {0, "dar blademaster",G_DAR_BLADEMASTER,  &purple,        35,     70,     160,    {5, 9, 2},      20, 100,    100,    DF_RED_BLOOD,   0,    false,      0,      0,              {BOLT_BLINKING},
1632         (MONST_CARRY_ITEM_25 | MONST_MALE | MONST_FEMALE), (MA_AVOID_CORRIDORS)},
1633     {0, "dar priestess", G_DAR_PRIESTESS,   &darPriestessColor,20,  60,     100,    {2, 5, 1},      20, 100,    100,    DF_RED_BLOOD,   0,    false,      0,      0,              {BOLT_NEGATION, BOLT_HEALING, BOLT_HASTE, BOLT_SPARK},
1634         (MONST_MAINTAINS_DISTANCE | MONST_CARRY_ITEM_25 | MONST_FEMALE), (MA_AVOID_CORRIDORS)},
1635     {0, "dar battlemage",G_DAR_BATTLEMAGE,   &darMageColor,  20,     60,     100,    {1, 3, 1},      20, 100,    100,    DF_RED_BLOOD,   0,    false,      0,      0,              {BOLT_FIRE, BOLT_SLOW_2, BOLT_DISCORD},
1636         (MONST_MAINTAINS_DISTANCE | MONST_CARRY_ITEM_25 | MONST_MALE | MONST_FEMALE), (MA_AVOID_CORRIDORS)},
1637     {0, "acidic jelly", G_JELLY,    &acidBackColor, 60,     0,      115,    {2, 6, 1},      0,  100,    100,    DF_ACID_BLOOD,  0,    true,       0,      0,              {0},
1638         (MONST_DEFEND_DEGRADE_WEAPON), (MA_HIT_DEGRADE_ARMOR | MA_CLONE_SELF_ON_DEFEND)},
1639     {0, "centaur",      G_CENTAUR,    &tanColor,      35,     50,     175,    {4, 8, 2},      20, 50,     100,    DF_RED_BLOOD,   0,    true,       0,      0,              {BOLT_DISTANCE_ATTACK},
1640         (MONST_MAINTAINS_DISTANCE | MONST_MALE), (0)},
1641     {0, "underworm",    G_UNDERWORM,    &wormColor,     80,     40,     160,    {18, 22, 2},    3,  150,    200,    DF_WORM_BLOOD,  0,    true,       0,      0,              {0},
1642         (MONST_NEVER_SLEEPS)},
1643     {0, "sentinel",     G_GUARDIAN, &sentinelColor, 50,0,      0,      {0, 0, 0},      0,  100,    175,    DF_RUBBLE_BLOOD,SENTINEL_LIGHT,    false,0,0,             {BOLT_HEALING, BOLT_SPARK},
1644         (MONST_TURRET | MONST_CAST_SPELLS_SLOWLY | MONST_DIES_IF_NEGATED), (0)},
1645     {0, "dart turret", G_TURRET, &centipedeColor,20, 0,      140,    {1, 2, 1},      0,  100,    250,    0,              0,    false,      0,      0,              {BOLT_POISON_DART},
1646         (MONST_TURRET), (MA_CAUSES_WEAKNESS)},
1647     {0, "kraken",       G_KRAKEN,    &krakenColor,   120,    0,      150,    {15, 20, 3},    1,  50,     100,    0,              0,    true,       0,      0,              {0},
1648         (MONST_RESTRICTED_TO_LIQUID | MONST_IMMUNE_TO_WATER | MONST_SUBMERGES | MONST_FLITS | MONST_NEVER_SLEEPS | MONST_FLEES_NEAR_DEATH), (MA_SEIZES)},
1649     {0, "lich",         G_LICH,    &white,         35,     80,     175,    {2, 6, 1},      0,  100,    100,    DF_ASH_BLOOD,   LICH_LIGHT,    true,  0,  0,              {BOLT_FIRE},
1650         (MONST_MAINTAINS_DISTANCE | MONST_CARRY_ITEM_25 | MONST_NO_POLYMORPH), (MA_CAST_SUMMON)},
1651     {0, "phylactery",   G_EGG,&lichLightColor,30,    0,      0,      {0, 0, 0},      0,  100,    150,    DF_RUBBLE_BLOOD,LICH_LIGHT,    false, 0,  0,              {0},
1652         (MONST_IMMUNE_TO_WEBS | MONST_NEVER_SLEEPS | MONST_IMMOBILE | MONST_INANIMATE | MONST_ALWAYS_HUNTING | MONST_WILL_NOT_USE_STAIRS | MONST_DIES_IF_NEGATED), (MA_CAST_SUMMON | MA_ENTER_SUMMONS)},
1653     {0, "pixie",        G_PIXIE,    &pixieColor,    10,     90,     100,    {1, 3, 1},      20, 50,     100,    DF_GREEN_BLOOD, PIXIE_LIGHT,    false, 0, 0,              {BOLT_NEGATION, BOLT_SLOW_2, BOLT_DISCORD, BOLT_SPARK},
1654         (MONST_MAINTAINS_DISTANCE | MONST_FLIES | MONST_FLITS | MONST_MALE | MONST_FEMALE), (0)},
1655     {0, "phantom",      G_PHANTOM,    &ectoplasmColor,35,     70,     160,    {12, 18, 4},    0,  50,     200,    DF_ECTOPLASM_BLOOD, 0,    true,   2,      DF_ECTOPLASM_DROPLET, {0},
1656         (MONST_INVISIBLE | MONST_FLITS | MONST_FLIES | MONST_IMMUNE_TO_WEBS)},
1657     {0, "flame turret", G_TURRET, &lavaForeColor,40, 0,      150,    {1, 2, 1},      0,  100,    250,    0,              LAVA_LIGHT,    false, 0,  0,              {BOLT_FIRE},
1658         (MONST_TURRET), (0)},
1659     {0, "imp",          G_IMP,    &pink,          35,     90,     225,    {4, 9, 2},      10, 100,    100,    DF_GREEN_BLOOD, IMP_LIGHT,    false,  0,  0,              {BOLT_BLINKING},
1660         (0), (MA_HIT_STEAL_FLEE)},
1661     {0, "fury",         G_FURY,    &darkRed,       19,     90,     200,    {6, 11, 4},     20, 50,     100,    DF_RED_BLOOD,   0,    false,      0,      0,              {0},
1662         (MONST_NEVER_SLEEPS | MONST_FLIES)},
1663     {0, "revenant",     G_REVENANT,    &ectoplasmColor,30,     0,      200,    {15, 20, 5},    0,  100,    100,    DF_ECTOPLASM_BLOOD, 0,    true,   0,      0,              {0},
1664         (MONST_IMMUNE_TO_WEAPONS)},
1665     {0, "tentacle horror",G_TENTACLE_HORROR,  &centipedeColor,120,    95,     225,    {25, 35, 3},    1,  100,    100,    DF_PURPLE_BLOOD,0,    true,       0,      0,              {0}},
1666     {0, "golem",        G_GOLEM,    &gray,          400,    70,     225,    {4, 8, 1},      0,  100,    100,    DF_RUBBLE_BLOOD,0,    true,       0,      0,              {0},
1667         (MONST_REFLECT_4 | MONST_DIES_IF_NEGATED)},
1668     {0, "dragon",       G_DRAGON,    &dragonColor,   150,    90,     250,    {25, 50, 4},    20, 50,     200,    DF_GREEN_BLOOD, 0,    true,       0,      0,              {BOLT_DRAGONFIRE},
1669         (MONST_IMMUNE_TO_FIRE | MONST_CARRY_ITEM_100), (MA_ATTACKS_ALL_ADJACENT)},
1670 
1671     // bosses
1672     {0, "goblin warlord",G_GOBLIN_CHIEFTAN,   &blue,          30,     17,     100,    {3, 6, 1},      20, 100,    100,    DF_RED_BLOOD,   0,    false,      0,      0,              {0},
1673         (MONST_MAINTAINS_DISTANCE | MONST_CARRY_ITEM_25), (MA_CAST_SUMMON | MA_ATTACKS_PENETRATE | MA_AVOID_CORRIDORS)},
1674     {0, "black jelly",  G_JELLY,    &black,         120,    0,      130,    {3, 8, 1},      0,  100,    100,    DF_PURPLE_BLOOD,0,    true,       0,      0,              {0},
1675         (0), (MA_CLONE_SELF_ON_DEFEND)},
1676     {0, "vampire",      G_VAMPIRE,    &white,         75,     60,     120,    {4, 15, 2},     6,  50,     100,    DF_RED_BLOOD,   0,    true,       0,      DF_BLOOD_EXPLOSION, {BOLT_BLINKING, BOLT_DISCORD},
1677         (MONST_FLEES_NEAR_DEATH | MONST_MALE), (MA_TRANSFERENCE | MA_DF_ON_DEATH | MA_CAST_SUMMON | MA_ENTER_SUMMONS)},
1678     {0, "flamedancer",  G_FLAMEDANCER,    &white,         65,     80,     120,    {3, 8, 2},      0,  100,    100,    DF_EMBER_BLOOD, FLAMEDANCER_LIGHT,    true, 100,DF_FLAMEDANCER_CORONA, {BOLT_FIRE},
1679         (MONST_MAINTAINS_DISTANCE | MONST_IMMUNE_TO_FIRE | MONST_FIERY), (MA_HIT_BURN)},
1680 
1681     // special effect monsters
1682     {0, "spectral blade",G_WEAPON, &spectralBladeColor,1, 0, 150,    {1, 1, 1},      0,  50,     100,    0,              SPECTRAL_BLADE_LIGHT,    false,0,0,       {0},
1683         (MONST_INANIMATE | MONST_NEVER_SLEEPS | MONST_FLIES | MONST_WILL_NOT_USE_STAIRS | MONST_DIES_IF_NEGATED | MONST_IMMUNE_TO_WEBS | MONST_NOT_LISTED_IN_SIDEBAR)},
1684     {0, "spectral sword",G_WEAPON, &spectralImageColor, 1,0, 150,    {1, 1, 1},      0,  50,     100,    0,              SPECTRAL_IMAGE_LIGHT,    false,0,0,       {0},
1685         (MONST_INANIMATE | MONST_NEVER_SLEEPS | MONST_FLIES | MONST_WILL_NOT_USE_STAIRS | MONST_DIES_IF_NEGATED | MONST_IMMUNE_TO_WEBS)},
1686     {0, "stone guardian",G_GUARDIAN, &white,   1000,   0,      200,    {12, 17, 2},    0,  100,    100,    DF_RUBBLE,      0,    false,      100,      DF_GUARDIAN_STEP, {0},
1687         (MONST_INANIMATE | MONST_NEVER_SLEEPS | MONST_ALWAYS_HUNTING | MONST_IMMUNE_TO_FIRE | MONST_IMMUNE_TO_WEAPONS | MONST_WILL_NOT_USE_STAIRS | MONST_DIES_IF_NEGATED | MONST_REFLECT_4 | MONST_ALWAYS_USE_ABILITY | MONST_GETS_TURN_ON_ACTIVATION)},
1688     {0, "winged guardian",G_WINGED_GUARDIAN, &blue,   1000,   0,      200,    {12, 17, 2},    0,  100,    100,    DF_RUBBLE,      0,    false,      100,      DF_SILENT_GLYPH_GLOW, {BOLT_BLINKING},
1689         (MONST_INANIMATE | MONST_NEVER_SLEEPS | MONST_ALWAYS_HUNTING | MONST_IMMUNE_TO_FIRE | MONST_IMMUNE_TO_WEAPONS | MONST_WILL_NOT_USE_STAIRS | MONST_DIES_IF_NEGATED | MONST_REFLECT_4 | MONST_GETS_TURN_ON_ACTIVATION | MONST_ALWAYS_USE_ABILITY), (0)},
1690     {0, "guardian spirit",G_GUARDIAN, &spectralImageColor,1000,0,200,  {5, 12, 2},     0,  100,    100,    0,              SPECTRAL_IMAGE_LIGHT,    false,100,0,     {0},
1691         (MONST_INANIMATE | MONST_NEVER_SLEEPS | MONST_IMMUNE_TO_FIRE | MONST_IMMUNE_TO_WEAPONS | MONST_DIES_IF_NEGATED | MONST_REFLECT_4 | MONST_ALWAYS_USE_ABILITY)},
1692     {0, "Warden of Yendor",G_WARDEN, &yendorLightColor,1000,   0,    300,    {12, 17, 2},    0,  200,    200,    DF_RUBBLE,      YENDOR_LIGHT,    true,  100, 0,           {0},
1693         (MONST_NEVER_SLEEPS | MONST_ALWAYS_HUNTING | MONST_INVULNERABLE | MONST_NO_POLYMORPH)},
1694     {0, "eldritch totem",G_TOTEM, &glyphColor,80,    0,      0,      {0, 0, 0},      0,  100,    100,    DF_RUBBLE_BLOOD,0,    false,      0,      0,              {0},
1695         (MONST_IMMUNE_TO_WEBS | MONST_NEVER_SLEEPS | MONST_IMMOBILE | MONST_INANIMATE | MONST_ALWAYS_HUNTING | MONST_WILL_NOT_USE_STAIRS | MONST_GETS_TURN_ON_ACTIVATION | MONST_ALWAYS_USE_ABILITY), (MA_CAST_SUMMON)},
1696     {0, "mirrored totem",G_TOTEM, &beckonColor,80,   0,      0,      {0, 0, 0},      0,  100,    100,    DF_RUBBLE_BLOOD,0,    false,      100,    DF_MIRROR_TOTEM_STEP, {BOLT_BECKONING},
1697         (MONST_IMMUNE_TO_WEBS | MONST_NEVER_SLEEPS | MONST_IMMOBILE | MONST_INANIMATE | MONST_ALWAYS_HUNTING | MONST_WILL_NOT_USE_STAIRS | MONST_GETS_TURN_ON_ACTIVATION | MONST_ALWAYS_USE_ABILITY | MONST_REFLECT_4 | MONST_IMMUNE_TO_WEAPONS | MONST_IMMUNE_TO_FIRE), (0)},
1698 
1699     // legendary allies
1700     {0, "unicorn",      G_UNICORN, &white,   40,     60,     175,    {2, 10, 2},     20, 50,     100,    DF_RED_BLOOD,   UNICORN_LIGHT,    true, 1,DF_UNICORN_POOP, {BOLT_HEALING, BOLT_SHIELDING},
1701         (MONST_MAINTAINS_DISTANCE | MONST_MALE | MONST_FEMALE), (0)},
1702     {0, "ifrit",        G_IFRIT,    &ifritColor,    40,     75,     175,    {5, 13, 2},     1,  50,     100,    DF_ASH_BLOOD,   IFRIT_LIGHT,    true, 0,  0,              {BOLT_DISCORD},
1703         (MONST_IMMUNE_TO_FIRE | MONST_FLIES | MONST_MALE), (0)},
1704     {0, "phoenix",      G_PHOENIX,    &phoenixColor,  30,     70,     175,    {4, 10, 2},     0,  50,     100,    DF_ASH_BLOOD,   PHOENIX_LIGHT,    true, 0,0,              {0},
1705         (MONST_IMMUNE_TO_FIRE| MONST_FLIES | MONST_NO_POLYMORPH)},
1706     {0, "phoenix egg",  G_EGG,&phoenixColor, 50,     0,      0,      {0, 0, 0},      0,  100,    150,    DF_ASH_BLOOD,   PHOENIX_EGG_LIGHT,    false,  0,  0,      {0},
1707         (MONST_IMMUNE_TO_FIRE| MONST_IMMUNE_TO_WEBS | MONST_NEVER_SLEEPS | MONST_IMMOBILE | MONST_INANIMATE | MONST_WILL_NOT_USE_STAIRS | MONST_NO_POLYMORPH | MONST_ALWAYS_HUNTING | MONST_IMMUNE_TO_WEAPONS), (MA_CAST_SUMMON | MA_ENTER_SUMMONS)},
1708     {0, "mangrove dryad",G_ANCIENT_SPIRIT,   &tanColor,      70,     60,     175,    {2, 8, 2},      6,  100,    100,    DF_ASH_BLOOD,   0,    true,       0,      0,              {BOLT_ANCIENT_SPIRIT_VINES},
1709         (MONST_IMMUNE_TO_WEBS | MONST_ALWAYS_USE_ABILITY | MONST_MAINTAINS_DISTANCE | MONST_NO_POLYMORPH | MONST_MALE | MONST_FEMALE), (0)},
1710 };
1711 
1712 const monsterWords monsterText[NUMBER_MONSTER_KINDS] = {
1713     {"A naked adventurer in an unforgiving place, bereft of equipment and confused about the circumstances.",
1714         "studying", "Studying",
1715         {"hit", {0}}},
1716     {"The rat is a scavenger of the shallows, perpetually in search of decaying animal matter.",
1717         "gnawing at", "Eating",
1718         {"scratches", "bites", {0}}},
1719     {"The kobold is a lizardlike humanoid of the upper dungeon.",
1720         "poking at", "Examining",
1721         {"clubs", "bashes", {0}}},
1722     {"The jackal prowls the caverns for intruders to rend with $HISHER powerful jaws.",
1723         "tearing at", "Eating",
1724         {"claws", "bites", "mauls", {0}}},
1725     {"The eel slips silently through the subterranean lake, waiting for unsuspecting prey to set foot in $HISHER dark waters.",
1726         "eating", "Eating",
1727         {"shocks", "bites", {0}}},
1728     {"Mischievous trickster that $HESHE is, the monkey lives to steal shiny trinkets from passing adventurers.",
1729         "examining", "Examining",
1730         {"tweaks", "bites", "punches", {0}}},
1731     {"A bladder of deadly gas buoys the bloat through the air, $HISHER thin veinous membrane ready to rupture at the slightest stress.",
1732         "gazing at", "Gazing",
1733         {"bumps", {0}},
1734         "bursts, leaving behind an expanding cloud of caustic gas!"},
1735     {"This rare subspecies of bloat is filled with a peculiar vapor that, if released, will cause the floor to vanish out from underneath $HIMHER.",
1736         "gazing at", "Gazing",
1737         {"bumps", {0}},
1738         "bursts, causing the floor underneath $HIMHER to disappear!"},
1739     {"A filthy little primate, the tribalistic goblin often travels in packs and carries a makeshift stone spear.",
1740         "chanting over", "Chanting",
1741         {"cuts", "stabs", "skewers", {0}}},
1742     {"This goblin is covered with glowing sigils that pulse with power. $HESHE can call into existence phantom blades to attack $HISHER foes.",
1743         "performing a ritual on", "Performing ritual",
1744         {"thumps", "whacks", "wallops", {0}},
1745         {0},
1746         "gestures ominously!"},
1747     {"This goblin carries no weapon, and $HISHER eyes sparkle with golden light. $HESHE can invoke a powerful shielding magic to protect $HISHER escorts from harm.",
1748         "performing a ritual on", "Performing ritual",
1749         {"slaps", "punches", "kicks", {0}}},
1750     {"Goblins have created this makeshift totem and imbued $HIMHER with a shamanistic power.",
1751         "gazing at", "Gazing",
1752         {"hits", {0}}},
1753     {"This mass of caustic pink goo slips across the ground in search of a warm meal.",
1754         "absorbing", "Feeding",
1755         {"smears", "slimes", "drenches"}},
1756     {"The enormous, warty toad secretes a powerful hallucinogenic slime to befuddle the senses of any creatures that come in contact with $HIMHER.",
1757         "eating", "Eating",
1758         {"slimes", "slams", {0}}},
1759     {"Often hunting in packs, leathery wings and keen senses guide the vampire bat unerringly to $HISHER prey.",
1760         "draining", "Feeding",
1761         {"nips", "bites", {0}}},
1762     {"A mechanical contraption embedded in the wall, the spring-loaded arrow turret will fire volley after volley of arrows at intruders.",
1763         "gazing at", "Gazing",
1764         {"shoots", {0}}},
1765     {"The acid mound squelches softly across the ground, leaving a trail of hissing goo in $HISHER path.",
1766         "liquefying", "Feeding",
1767         {"slimes", "douses", "drenches", {0}}},
1768     {"This monstrous centipede's incisors are imbued with a horrible venom that will slowly kill $HISHER prey.",
1769         "eating", "Eating",
1770         {"pricks", "stings", {0}}},
1771     {"This lumbering creature carries an enormous club that $HESHE can swing with incredible force.",
1772         "examining", "Studying",
1773         {"cudgels", "clubs", "batters", {0}}},
1774     {"The horrifying bog monster dwells beneath the surface of mud-filled swamps. When $HISHER prey ventures into the mud, the bog monster will ensnare the unsuspecting victim in $HISHER pale tentacles and squeeze its life away.",
1775         "draining", "Feeding",
1776         {"squeezes", "strangles", "crushes", {0}}},
1777     {"Ancient ogres versed in the eldritch arts have assembled this totem and imbued $HIMHER with occult power.",
1778         "gazing at", "Gazing",
1779         {"hits", {0}}},
1780     {"The spider's red eyes pierce the darkness in search of enemies to ensnare with $HISHER projectile webs and dissolve with deadly poison.",
1781         "draining", "Feeding",
1782         {"bites", "stings", {0}}},
1783     {"This contraption hums with electrical charge that $HISHER embedded crystals and magical sigils can direct at intruders in deadly arcs.",
1784         "gazing at", "Gazing",
1785         {"shocks", {0}}},
1786     {"An ethereal blue flame dances through the air, flickering and pulsing in time to an otherworldly rhythm.",
1787         "consuming", "Feeding",
1788         {"scorches", "burns", {0}}},
1789     {"The wraith's hollow eye sockets stare hungrily at the world from $HISHER emaciated frame, and $HISHER long, bloodstained nails grope ceaselessly at the air for a fresh victim.",
1790         "devouring", "Feeding",
1791         {"clutches", "claws", "bites", {0}}},
1792     {"The zombie is the accursed product of a long-forgotten ritual. Perpetually decaying flesh hangs from $HISHER bones in shreds and releases a flammable stench that will induce violent nausea with one whiff.",
1793         "rending", "Eating",
1794         {"hits", "bites", {0}}},
1795     {"An enormous, disfigured creature covered in phlegm and warts, the troll regenerates very quickly and attacks with astonishing strength. Many adventures have ended at $HISHER misshapen hands.",
1796         "eating", "Eating",
1797         {"cudgels", "clubs", "bludgeons", "pummels", "batters"}},
1798     {"This ogre is bent with age, but what $HESHE has lost in physical strength, $HESHE has more than gained in occult power.",
1799         "performing a ritual on", "Performing ritual",
1800         {"cudgels", "clubs", {0}},
1801         {0},
1802         "chants in a harsh, guttural tongue!"},
1803     {"The serpentine naga live beneath the subterranean waters and emerge to attack unsuspecting adventurers.",
1804         "studying", "Studying",
1805         {"claws", "bites", "tail-whips", {0}}},
1806     {"A serpent wreathed in flames and carrying a burning lash, salamanders dwell in lakes of fire and emerge when they sense a nearby victim, leaving behind a trail of glowing embers.",
1807         "studying", "Studying",
1808         {"whips", "lashes", {0}}},
1809     {"This rare subspecies of bloat is little more than a thin membrane surrounding a bladder of highly explosive gases. The slightest stress will cause $HIMHER to rupture in spectacular and deadly fashion.",
1810         "gazing at", "Gazing",
1811         {"bumps", {0}},
1812         "detonates with terrifying force!"},
1813     {"An elf of the deep, the dar blademaster leaps toward $HISHER enemies with frightening speed to engage in deadly swordplay.",
1814         "studying", "Studying",
1815         {"grazes", "cuts", "slices", "slashes", "stabs"}},
1816     {"The dar priestess carries a host of religious relics that jangle as $HESHE walks.",
1817         "praying over", "Praying",
1818         {"cuts", "slices", {0}}},
1819     {"The dar battlemage's eyes glow like embers and $HISHER hands radiate an occult heat.",
1820         "transmuting", "Transmuting",
1821         {"cuts", {0}}},
1822     {"A jelly subsisting on a diet of acid mounds will eventually express the characteristics of $HISHER prey, corroding any unprotected weapons or armor that come in contact with $HIMHER.",
1823         "transmuting", "Transmuting",
1824         {"burns", {0}}},
1825     {"Half man and half horse, the centaur is an expert with the bow and arrow -- hunter and steed fused into a single creature.",
1826         "studying", "Studying",
1827         {"shoots", {0}}},
1828     {"A strange and horrifying creature of the earth's deepest places, larger than an ogre but capable of squeezing through tiny openings. When hungry, the underworm will burrow behind the walls of a cavern and lurk dormant and motionless -- often for months -- until $HESHE can feel the telltale vibrations of nearby prey.",
1829         "consuming", "Consuming",
1830         {"slams", "bites", "tail-whips", {0}}},
1831     {"An ancient statue of an unrecognizable humanoid figure, the sentinel holds aloft a crystal that gleams with ancient warding magic. Sentinels are always found in groups, and each will attempt to repair any damage done to the others.",
1832         "focusing on", "Focusing",
1833         {"hits", {0}}},
1834     {"This spring-loaded contraption fires darts that are imbued with a strength-sapping poison.",
1835         "gazing at", "Gazing",
1836         {"pricks", {0}}},
1837     {"This tentacled nightmare will emerge from the subterranean waters to ensnare and devour any creature foolish enough to set foot into $HISHER lake.",
1838         "devouring", "Feeding",
1839         {"slaps", "smites", "batters", {0}}},
1840     {"The desiccated form of an ancient sorcerer, animated by dark arts and lust for power, commands the obedience of the infernal planes. $HISHER essence is anchored to reality by a phylactery that is always in $HISHER possession, and the lich cannot die unless $HISHER phylactery is destroyed.",
1841         "enchanting", "Enchanting",
1842         {"touches", {0}},
1843         {0},
1844         "rasps a terrifying incantation!"},
1845     {"This gem was the fulcrum of a dark rite, performed centuries ago, that bound the soul of an ancient and terrible sorcerer. Hurry and destroy the gem, before the lich can gather its power and regenerate its corporeal form!",
1846         "enchanting", "Enchanting",
1847         {"touches", {0}},
1848         {0},
1849         "swirls with dark sorcery as the lich regenerates its form!"},
1850     {"A tiny humanoid sparkles in the gloom, the hum of $HISHER beating wings punctuated by intermittent peals of high-pitched laughter. What $HESHE lacks in physical endurance, $HESHE makes up for with $HISHER wealth of mischievous magical abilities.",
1851         "sprinkling dust on", "Dusting",
1852         {"pokes", {0}}},
1853     {"A silhouette of mournful rage against an empty backdrop, the phantom slips through the dungeon invisibly in clear air, leaving behind glowing droplets of ectoplasm and the cries of $HISHER unsuspecting victims.",
1854         "permeating", "Permeating",
1855         {"hits", {0}}},
1856     {"This infernal contraption spits blasts of flame at intruders.",
1857         "incinerating", "Incinerating",
1858         {"pricks", {0}}},
1859     {"This trickster demon moves with astonishing speed and delights in stealing from $HISHER enemies and blinking away.",
1860         "dissecting", "Dissecting",
1861         {"slices", "cuts", {0}}},
1862     {"A creature of inchoate rage made flesh, the fury's moist wings beat loudly in the darkness.",
1863         "flagellating", "Flagellating",
1864         {"drubs", "fustigates", "castigates", {0}}},
1865     {"This unholy specter stalks the deep places of the earth without fear, impervious to conventional attacks.",
1866         "desecrating", "Desecrating",
1867         {"hits", {0}}},
1868     {"This seething, towering nightmare of fleshy tentacles slinks through the bowels of the world. The tentacle horror's incredible strength and regeneration make $HIMHER one of the most fearsome creatures of the dungeon.",
1869         "sucking on", "Consuming",
1870         {"slaps", "batters", "crushes", {0}}},
1871     {"A statue animated by an ancient and tireless magic, the golem does not regenerate and attacks with only moderate strength, but $HISHER stone form can withstand incredible damage before collapsing into rubble.",
1872         "cradling", "Cradling",
1873         {"backhands", "punches", "kicks", {0}}},
1874     {"An ancient serpent of the world's deepest places, the dragon's immense form belies its lightning-quick speed and testifies to $HISHER breathtaking strength. An undying furnace of white-hot flames burns within $HISHER scaly hide, and few could withstand a single moment under $HISHER infernal lash.",
1875         "consuming", "Consuming",
1876         {"claws", "tail-whips", "bites", {0}}},
1877 
1878     {"Taller, stronger and smarter than other goblins, the warlord commands the loyalty of $HISHER kind and can summon them into battle.",
1879         "chanting over", "Chanting",
1880         {"slashes", "cuts", "stabs", "skewers", {0}},
1881         {0},
1882         "lets loose a deafening war cry!"},
1883     {"This blob of jet-black goo is as rare as $HESHE is deadly. Few creatures of the dungeon can withstand $HISHER caustic assault. Beware.",
1884         "absorbing", "Feeding",
1885         {"smears", "slimes", "drenches"}},
1886     {"This vampire lives a solitary life deep underground, consuming any warm-blooded creature unfortunate to venture near $HISHER lair.",
1887         "draining", "Drinking",
1888         {"grazes", "bites", "buries $HISHER fangs in", {0}},
1889         {0},
1890         "spreads his cloak and bursts into a cloud of bats!"},
1891     {"An elemental creature from another plane of existence, the infernal flamedancer burns with such intensity that $HESHE is painful to behold.",
1892         "immolating", "Consuming",
1893         {"singes", "burns", "immolates", {0}}},
1894 
1895     {"Eldritch forces have coalesced to form this flickering, ethereal weapon.",
1896         "gazing at", "Gazing",
1897         {"nicks",  {0}}},
1898     {"Eldritch energies bound up in your equipment have leapt forth to project this spectral image.",
1899         "gazing at", "Gazing",
1900         {"hits",  {0}}},
1901     {"Guarding the room is a weathered stone statue of a knight carrying a battleaxe, connected to the glowing glyphs on the floor by invisible strands of enchantment.",
1902         "gazing at", "Gazing",
1903         {"strikes",  {0}}},
1904     {"A statue of a sword-wielding angel surveys the room, connected to the glowing glyphs on the floor by invisible strands of enchantment.",
1905         "gazing at", "Gazing",
1906         {"strikes",  {0}}},
1907     {"A spectral outline of a knight carrying a battleaxe casts an ethereal light on $HISHER surroundings.",
1908         "gazing at", "Gazing",
1909         {"strikes",  {0}}},
1910     {"An immortal presence stalks through the dungeon, implacably hunting that which was taken... and the one who took it.",
1911         "gazing at", "Gazing",
1912         {"strikes",  {0}}},
1913     {"This totem sits at the center of a summoning circle that radiates a strange energy.",
1914         "gazing at", "Gazing",
1915         {"strikes",  {0}},
1916         {0},
1917         "crackles with energy as you touch the glyph!"},
1918     {"A prism of shoulder-high mirrored surfaces gleams in the darkness.",
1919         "gazing at", "Gazing",
1920         {"strikes",  {0}}},
1921 
1922     {"The unicorn's flowing mane and tail shine with rainbow light, $HISHER horn glows with healing and protective magic, and $HISHER eyes implore you to always chase your dreams. Unicorns are rumored to be attracted to virgins -- is there a hint of accusation in $HISHER gaze?",
1923         "consecrating", "Consecrating",
1924         {"pokes", "stabs", "gores", {0}}},
1925     {"A whirling desert storm given human shape, the ifrit's twin scimitars flicker in the darkness and $HISHER eyes burn with otherworldly zeal.",
1926         "absorbing", "Absorbing",
1927         {"cuts", "slashes", "lacerates", {0}}},
1928     {"This legendary bird shines with a brilliant light, and $HISHER wings crackle and pop like embers as they beat the air. When $HESHE dies, legend has it that an egg will form and a newborn phoenix will rise from its ashes.",
1929         "cremating", "Cremating",
1930         {"pecks", "scratches", "claws", {0}}},
1931     {"Cradled in a nest of cooling ashes, the translucent membrane of the phoenix egg reveals a yolk that glows brighter by the second.",
1932         "cremating", "Cremating",
1933         {"touches", {0}},
1934         {0},
1935         "bursts as a newborn phoenix rises from the ashes!"},
1936     {"This mangrove dryad is as old as the earth, and $HISHER gnarled figure houses an ancient power. When angered, $HESHE can call upon the forces of nature to bind $HISHER foes and tear them to shreds.",
1937         "absorbing", "Absorbing",
1938         {"whips", "lashes", "thrashes", "lacerates", {0}}},
1939 };
1940 
1941 const mutation mutationCatalog[NUMBER_MUTATORS] = {
1942     //Title         textColor       healthFactor    moveSpdMult attackSpdMult   defMult damMult DF% DFtype  light   monstFlags  abilityFlags    forbiddenFlags      forbiddenAbilities      canBeNegated
1943     {"explosive",   &orange,        50,             100,        100,            50,     100,    0,  DF_MUTATION_EXPLOSION, EXPLOSIVE_BLOAT_LIGHT, 0, MA_DF_ON_DEATH, MONST_SUBMERGES, 0,
1944         "A rare mutation will cause $HIMHER to explode violently when $HESHE dies.",    true},
1945     {"infested",    &lichenColor,   50,             100,        100,            50,     100,    0,  DF_MUTATION_LICHEN, 0, 0,   MA_DF_ON_DEATH, 0,               0,
1946         "$HESHE has been infested by deadly lichen spores; poisonous fungus will spread from $HISHER corpse when $HESHE dies.", true},
1947     {"agile",       &lightBlue,     100,            50,         100,            150,    100,    -1, 0,      0,      MONST_FLEES_NEAR_DEATH, 0, MONST_FLEES_NEAR_DEATH, 0,
1948         "A rare mutation greatly enhances $HISHER mobility.",   false},
1949     {"juggernaut",  &brown,         300,            200,        200,            75,     200,    -1, 0,      0,      0,          MA_ATTACKS_STAGGER, MONST_MAINTAINS_DISTANCE, 0,
1950         "A rare mutation has hardened $HISHER flesh, increasing $HISHER health and power but compromising $HISHER speed.",  false},
1951     {"grappling",   &tanColor,      150,            100,        100,            50,     100,    -1, 0,      0,      0,          MA_SEIZES,      MONST_MAINTAINS_DISTANCE, MA_SEIZES,
1952         "A rare mutation has caused suckered tentacles to sprout from $HISHER frame, increasing $HISHER health and allowing $HIMHER to grapple with $HISHER prey.", true},
1953     {"vampiric",    &red,           100,            100,        100,            100,    100,    -1, 0,      0,      0,          MA_TRANSFERENCE, MONST_MAINTAINS_DISTANCE, MA_TRANSFERENCE,
1954         "A rare mutation allows $HIMHER to heal $HIMSELFHERSELF with every attack.",    true},
1955     {"toxic",       &green,         100,            100,        200,            100,    20,     -1, 0,      0,      0,          (MA_CAUSES_WEAKNESS | MA_POISONS), MONST_MAINTAINS_DISTANCE, (MA_CAUSES_WEAKNESS | MA_POISONS),
1956         "A rare mutation causes $HIMHER to poison $HISHER victims and sap their strength with every attack.",   true},
1957     {"reflective",  &darkTurquoise, 100,            100,        100,            100,    100,    -1, 0,      0,      MONST_REFLECT_4, 0,         (MONST_REFLECT_4 | MONST_ALWAYS_USE_ABILITY), 0,
1958         "A rare mutation has coated $HISHER flesh with reflective scales.",     true},
1959 };
1960 
1961 const hordeType hordeCatalog[NUMBER_HORDES] = {
1962     // leader       #members    member list                             member numbers                  minL    maxL    freq    spawnsIn        machine         flags
1963     {MK_RAT,            0,      {0},                                    {{0}},                          1,      5,      150},
1964     {MK_KOBOLD,         0,      {0},                                    {{0}},                          1,      6,      150},
1965     {MK_JACKAL,         0,      {0},                                    {{0}},                          1,      3,      100},
1966     {MK_JACKAL,         1,      {MK_JACKAL},                            {{1, 3, 1}},                    3,      7,      50},
1967     {MK_EEL,            0,      {0},                                    {{0}},                          2,      17,     100,        DEEP_WATER},
1968     {MK_MONKEY,         0,      {0},                                    {{0}},                          2,      9,      50},
1969     {MK_BLOAT,          0,      {0},                                    {{0}},                          2,      13,     30},
1970     {MK_PIT_BLOAT,      0,      {0},                                    {{0}},                          2,      13,     10},
1971     {MK_BLOAT,          1,      {MK_BLOAT},                             {{0, 2, 1}},                    14,     26,     30},
1972     {MK_PIT_BLOAT,      1,      {MK_PIT_BLOAT},                         {{0, 2, 1}},                    14,     26,     10},
1973     {MK_EXPLOSIVE_BLOAT,0,      {0},                                    {{0}},                          10,     26,     10},
1974     {MK_GOBLIN,         0,      {0},                                    {{0}},                          3,      10,     100},
1975     {MK_GOBLIN_CONJURER,0,      {0},                                    {{0}},                          3,      10,     60},
1976     {MK_TOAD,           0,      {0},                                    {{0}},                          4,      11,     100},
1977     {MK_PINK_JELLY,     0,      {0},                                    {{0}},                          4,      13,     100},
1978     {MK_GOBLIN_TOTEM,   1,      {MK_GOBLIN},                            {{2,4,1}},                      5,      13,     100,        0,              MT_CAMP_AREA,   HORDE_NO_PERIODIC_SPAWN},
1979     {MK_ARROW_TURRET,   0,      {0},                                    {{0}},                          5,      13,     100,        WALL,   0,                      HORDE_NO_PERIODIC_SPAWN},
1980     {MK_MONKEY,         1,      {MK_MONKEY},                            {{2,4,1}},                      5,      13,     20},
1981     {MK_VAMPIRE_BAT,    0,      {0},                                    {{0}},                          6,      13,     30},
1982     {MK_VAMPIRE_BAT,    1,      {MK_VAMPIRE_BAT},                       {{1,2,1}},                      6,      13,     70,      0,              0,              HORDE_NEVER_OOD},
1983     {MK_ACID_MOUND,     0,      {0},                                    {{0}},                          6,      13,     100},
1984     {MK_GOBLIN,         3,      {MK_GOBLIN, MK_GOBLIN_MYSTIC, MK_JACKAL},{{2, 3, 1}, {1,2,1}, {1,2,1}}, 6,      12,     40},
1985     {MK_GOBLIN_CONJURER,2,      {MK_GOBLIN_CONJURER, MK_GOBLIN_MYSTIC}, {{0,1,1}, {1,1,1}},             7,      15,     40},
1986     {MK_CENTIPEDE,      0,      {0},                                    {{0}},                          7,      14,     100},
1987     {MK_BOG_MONSTER,    0,      {0},                                    {{0}},                          7,      14,     80,     MUD,            0,              HORDE_NEVER_OOD},
1988     {MK_OGRE,           0,      {0},                                    {{0}},                          7,      13,     100},
1989     {MK_EEL,            1,      {MK_EEL},                               {{2, 4, 1}},                    8,      22,     70,     DEEP_WATER},
1990     {MK_ACID_MOUND,     1,      {MK_ACID_MOUND},                        {{2, 4, 1}},                    9,      13,     30},
1991     {MK_SPIDER,         0,      {0},                                    {{0}},                          9,      16,     100},
1992     {MK_DAR_BLADEMASTER,1,      {MK_DAR_BLADEMASTER},                   {{0, 1, 1}},                    10,     14,     100},
1993     {MK_WILL_O_THE_WISP,0,      {0},                                    {{0}},                          10,     17,     100},
1994     {MK_WRAITH,         0,      {0},                                    {{0}},                          10,     17,     100},
1995     {MK_GOBLIN_TOTEM,   4,      {MK_GOBLIN_TOTEM, MK_GOBLIN_CONJURER, MK_GOBLIN_MYSTIC, MK_GOBLIN}, {{1,2,1},{1,2,1},{1,2,1},{3,5,1}},10,17,80,0,MT_CAMP_AREA,  HORDE_NO_PERIODIC_SPAWN},
1996     {MK_SPARK_TURRET,   0,      {0},                                    {{0}},                          11,     18,     100,        WALL,   0,                      HORDE_NO_PERIODIC_SPAWN},
1997     {MK_ZOMBIE,         0,      {0},                                    {{0}},                          11,     18,     100},
1998     {MK_TROLL,          0,      {0},                                    {{0}},                          12,     19,     100},
1999     {MK_OGRE_TOTEM,     1,      {MK_OGRE},                              {{2,4,1}},                      12,     19,     60,     0,          0,                  HORDE_NO_PERIODIC_SPAWN},
2000     {MK_BOG_MONSTER,    1,      {MK_BOG_MONSTER},                       {{2,4,1}},                      12,     26,     100,        MUD},
2001     {MK_NAGA,           0,      {0},                                    {{0}},                          13,     20,     100,        DEEP_WATER},
2002     {MK_SALAMANDER,     0,      {0},                                    {{0}},                          13,     20,     100,        LAVA},
2003     {MK_OGRE_SHAMAN,    1,      {MK_OGRE},                              {{1, 3, 1}},                    14,     20,     100},
2004     {MK_CENTAUR,        1,      {MK_CENTAUR},                           {{1, 1, 1}},                    14,     21,     100},
2005     {MK_ACID_JELLY,     0,      {0},                                    {{0}},                          14,     21,     100},
2006     {MK_DART_TURRET,    0,      {0},                                    {{0}},                          15,     22,     100,        WALL,   0,                      HORDE_NO_PERIODIC_SPAWN},
2007     {MK_PIXIE,          0,      {0},                                    {{0}},                          14,     21,     80},
2008     {MK_FLAME_TURRET,   0,      {0},                                    {{0}},                          14,     24,     100,        WALL,   0,                      HORDE_NO_PERIODIC_SPAWN},
2009     {MK_DAR_BLADEMASTER,2,      {MK_DAR_BLADEMASTER, MK_DAR_PRIESTESS}, {{0, 1, 1}, {0, 1, 1}},         15,     17,     100},
2010     {MK_PINK_JELLY,     2,      {MK_PINK_JELLY, MK_DAR_PRIESTESS},      {{0, 1, 1}, {1, 2, 1}},         17,     23,     70},
2011     {MK_KRAKEN,         0,      {0},                                    {{0}},                          15,     30,     100,        DEEP_WATER},
2012     {MK_PHANTOM,        0,      {0},                                    {{0}},                          16,     23,     100},
2013     {MK_WRAITH,         1,      {MK_WRAITH},                            {{1, 4, 1}},                    16,     23,     80},
2014     {MK_IMP,            0,      {0},                                    {{0}},                          17,     24,     100},
2015     {MK_DAR_BLADEMASTER,3,      {MK_DAR_BLADEMASTER, MK_DAR_PRIESTESS, MK_DAR_BATTLEMAGE},{{1,2,1},{1,1,1},{1,1,1}},18,25,100},
2016     {MK_FURY,           1,      {MK_FURY},                              {{2, 4, 1}},                    18,     26,     80},
2017     {MK_REVENANT,       0,      {0},                                    {{0}},                          19,     27,     100},
2018     {MK_GOLEM,          0,      {0},                                    {{0}},                          21,     30,     100},
2019     {MK_TENTACLE_HORROR,0,      {0},                                    {{0}},                          22,     DEEPEST_LEVEL-1,        100},
2020     {MK_PHYLACTERY,     0,      {0},                                    {{0}},                          22,     DEEPEST_LEVEL-1,        100},
2021     {MK_DRAGON,         0,      {0},                                    {{0}},                          24,     DEEPEST_LEVEL-1,        70},
2022     {MK_DRAGON,         1,      {MK_DRAGON},                            {{1,1,1}},                      27,     DEEPEST_LEVEL-1,        30},
2023     {MK_GOLEM,          3,      {MK_GOLEM, MK_DAR_PRIESTESS, MK_DAR_BATTLEMAGE}, {{1, 2, 1}, {0,1,1},{0,1,1}},27,DEEPEST_LEVEL-1,   80},
2024     {MK_GOLEM,          1,      {MK_GOLEM},                             {{5, 10, 2}},                   30,     DEEPEST_LEVEL-1,    20},
2025     {MK_KRAKEN,         1,      {MK_KRAKEN},                            {{5, 10, 2}},                   30,     DEEPEST_LEVEL-1,    100,        DEEP_WATER},
2026     {MK_TENTACLE_HORROR,2,      {MK_TENTACLE_HORROR, MK_REVENANT},      {{1, 3, 1}, {2, 4, 1}},         32,     DEEPEST_LEVEL-1,    20},
2027     {MK_DRAGON,         1,      {MK_DRAGON},                            {{3, 5, 1}},                    34,     DEEPEST_LEVEL-1,    20},
2028 
2029     // summons
2030     {MK_GOBLIN_CONJURER,1,      {MK_SPECTRAL_BLADE},                    {{3, 5, 1}},                    0,      0,      100,    0,          0,                  HORDE_IS_SUMMONED | HORDE_DIES_ON_LEADER_DEATH},
2031     {MK_OGRE_SHAMAN,    1,      {MK_OGRE},                              {{1, 1, 1}},                    0,      0,      100,    0,          0,                  HORDE_IS_SUMMONED},
2032     {MK_VAMPIRE,        1,      {MK_VAMPIRE_BAT},                       {{3, 3, 1}},                    0,      0,      100,    0,          0,                  HORDE_IS_SUMMONED},
2033     {MK_LICH,           1,      {MK_PHANTOM},                           {{2, 3, 1}},                    0,      0,      100,    0,          0,                  HORDE_IS_SUMMONED},
2034     {MK_LICH,           1,      {MK_FURY},                              {{2, 3, 1}},                    0,      0,      100,    0,          0,                  HORDE_IS_SUMMONED},
2035     {MK_PHYLACTERY,     1,      {MK_LICH},                              {{1,1,1}},                      0,      0,      100,    0,          0,                  HORDE_IS_SUMMONED},
2036     {MK_GOBLIN_CHIEFTAN,2,      {MK_GOBLIN_CONJURER, MK_GOBLIN},        {{1,1,1}, {3,4,1}},             0,      0,      100,    0,          0,                  HORDE_IS_SUMMONED | HORDE_SUMMONED_AT_DISTANCE},
2037     {MK_PHOENIX_EGG,    1,      {MK_PHOENIX},                           {{1,1,1}},                      0,      0,      100,    0,          0,                  HORDE_IS_SUMMONED},
2038     {MK_ELDRITCH_TOTEM, 1,      {MK_SPECTRAL_BLADE},                    {{4, 7, 1}},                    0,      0,      100,    0,          0,                  HORDE_IS_SUMMONED | HORDE_DIES_ON_LEADER_DEATH},
2039     {MK_ELDRITCH_TOTEM, 1,      {MK_FURY},                              {{2, 3, 1}},                    0,      0,      100,    0,          0,                  HORDE_IS_SUMMONED | HORDE_DIES_ON_LEADER_DEATH},
2040 
2041     // captives
2042     {MK_MONKEY,         1,      {MK_KOBOLD},                            {{1, 2, 1}},                    1,      5,      10,     0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2043     {MK_GOBLIN,         1,      {MK_GOBLIN},                            {{1, 2, 1}},                    3,      7,      10,     0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2044     {MK_OGRE,           1,      {MK_GOBLIN},                            {{3, 5, 1}},                    4,      10,     10,     0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2045     {MK_GOBLIN_MYSTIC,  1,      {MK_KOBOLD},                            {{3, 7, 1}},                    5,      11,     10,     0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2046     {MK_OGRE,           1,      {MK_OGRE},                              {{1, 2, 1}},                    8,      15,     20,     0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2047     {MK_TROLL,          1,      {MK_TROLL},                             {{1, 2, 1}},                    14,     19,     10,     0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2048     {MK_CENTAUR,        1,      {MK_TROLL},                             {{1, 2, 1}},                    12,     19,     10,     0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2049     {MK_TROLL,          2,      {MK_OGRE, MK_OGRE_SHAMAN},              {{2, 3, 1}, {0, 1, 1}},         17,     19,     10,     0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2050     {MK_DAR_BLADEMASTER,1,      {MK_TROLL},                             {{1, 2, 1}},                    12,     19,     10,     0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2051     {MK_NAGA,           1,      {MK_SALAMANDER},                        {{1, 2, 1}},                    14,     20,     10,     0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2052     {MK_SALAMANDER,     1,      {MK_NAGA},                              {{1, 2, 1}},                    13,     20,     10,     0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2053     {MK_TROLL,          1,      {MK_SALAMANDER},                        {{1, 2, 1}},                    13,     19,     10,     0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2054     {MK_IMP,            1,      {MK_FURY},                              {{2, 4, 1}},                    18,     26,     10,     0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2055     {MK_PIXIE,          1,      {MK_IMP, MK_PHANTOM},                   {{1, 2, 1}, {1, 2, 1}},         14,     21,     10,     0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2056     {MK_DAR_BLADEMASTER,1,      {MK_FURY},                              {{2, 4, 1}},                    18,     26,     10,     0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2057     {MK_DAR_BLADEMASTER,1,      {MK_IMP},                               {{2, 3, 1}},                    18,     26,     10,     0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2058     {MK_DAR_PRIESTESS,  1,      {MK_FURY},                              {{2, 4, 1}},                    18,     26,     10,     0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2059     {MK_DAR_BATTLEMAGE, 1,      {MK_IMP},                               {{2, 3, 1}},                    18,     26,     10,     0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2060     {MK_TENTACLE_HORROR,3,      {MK_DAR_BLADEMASTER, MK_DAR_PRIESTESS, MK_DAR_BATTLEMAGE},{{1,2,1},{1,1,1},{1,1,1}},20,26,10,   0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2061     {MK_GOLEM,          3,      {MK_DAR_BLADEMASTER, MK_DAR_PRIESTESS, MK_DAR_BATTLEMAGE},{{1,2,1},{1,1,1},{1,1,1}},18,25,10,   0,          0,                  HORDE_LEADER_CAPTIVE | HORDE_NEVER_OOD},
2062 
2063     // bosses
2064     {MK_GOBLIN_CHIEFTAN,2,      {MK_GOBLIN_MYSTIC, MK_GOBLIN, MK_GOBLIN_TOTEM}, {{1,1,1}, {2,3,1}, {2,2,1}},2,  10,     50,     0,          0,                  HORDE_MACHINE_BOSS},
2065     {MK_BLACK_JELLY,    0,      {0},                                    {{0}},                          5,      15,     50,     0,          0,                  HORDE_MACHINE_BOSS},
2066     {MK_VAMPIRE,        0,      {0},                                    {{0}},                          10,     DEEPEST_LEVEL,  50,  0,     0,                  HORDE_MACHINE_BOSS},
2067     {MK_FLAMEDANCER,    0,      {0},                                    {{0}},                          10,     DEEPEST_LEVEL,  50,  0,     0,                  HORDE_MACHINE_BOSS},
2068 
2069     // machine water monsters
2070     {MK_EEL,            0,      {0},                                    {{0}},                          2,      7,      100,        DEEP_WATER, 0,                  HORDE_MACHINE_WATER_MONSTER},
2071     {MK_EEL,            1,      {MK_EEL},                               {{2, 4, 1}},                    5,      15,     100,        DEEP_WATER, 0,                  HORDE_MACHINE_WATER_MONSTER},
2072     {MK_KRAKEN,         0,      {0},                                    {{0}},                          12,     DEEPEST_LEVEL,  100,    DEEP_WATER, 0,              HORDE_MACHINE_WATER_MONSTER},
2073     {MK_KRAKEN,         1,      {MK_EEL},                               {{1, 2, 1}},                    12,     DEEPEST_LEVEL,  80, DEEP_WATER, 0,              HORDE_MACHINE_WATER_MONSTER},
2074 
2075     // dungeon captives -- no captors
2076     {MK_OGRE,           0,      {0},                                    {{0}},                          4,      13,     100,        0,          0,                  HORDE_MACHINE_CAPTIVE | HORDE_LEADER_CAPTIVE},
2077     {MK_NAGA,           0,      {0},                                    {{0}},                          12,     20,     50,     0,          0,                  HORDE_MACHINE_CAPTIVE | HORDE_LEADER_CAPTIVE},
2078     {MK_GOBLIN_MYSTIC,  0,      {0},                                    {{0}},                          2,      8,      100,        0,          0,                  HORDE_MACHINE_CAPTIVE | HORDE_LEADER_CAPTIVE},
2079     {MK_TROLL,          0,      {0},                                    {{0}},                          10,     20,     50,     0,          0,                  HORDE_MACHINE_CAPTIVE | HORDE_LEADER_CAPTIVE},
2080     {MK_DAR_BLADEMASTER,0,      {0},                                    {{0}},                          8,      16,     100,        0,          0,                  HORDE_MACHINE_CAPTIVE | HORDE_LEADER_CAPTIVE},
2081     {MK_DAR_PRIESTESS,  0,      {0},                                    {{0}},                          8,      14,     100,        0,          0,                  HORDE_MACHINE_CAPTIVE | HORDE_LEADER_CAPTIVE},
2082     {MK_WRAITH,         0,      {0},                                    {{0}},                          11,     20,     100,        0,          0,                  HORDE_MACHINE_CAPTIVE | HORDE_LEADER_CAPTIVE},
2083     {MK_GOLEM,          0,      {0},                                    {{0}},                          17,     23,     100,        0,          0,                  HORDE_MACHINE_CAPTIVE | HORDE_LEADER_CAPTIVE},
2084     {MK_TENTACLE_HORROR,0,      {0},                                    {{0}},                          20,     AMULET_LEVEL,100,0,         0,                  HORDE_MACHINE_CAPTIVE | HORDE_LEADER_CAPTIVE},
2085     {MK_DRAGON,         0,      {0},                                    {{0}},                          23,     AMULET_LEVEL,100,0,         0,                  HORDE_MACHINE_CAPTIVE | HORDE_LEADER_CAPTIVE},
2086 
2087     // machine statue monsters
2088     {MK_GOBLIN,         0,      {0},                                    {{0}},                          1,      6,      100,        STATUE_DORMANT, 0,              HORDE_MACHINE_STATUE},
2089     {MK_OGRE,           0,      {0},                                    {{0}},                          6,      12,     100,        STATUE_DORMANT, 0,              HORDE_MACHINE_STATUE},
2090     {MK_WRAITH,         0,      {0},                                    {{0}},                          10,     17,     100,        STATUE_DORMANT, 0,              HORDE_MACHINE_STATUE},
2091     {MK_NAGA,           0,      {0},                                    {{0}},                          12,     19,     100,        STATUE_DORMANT, 0,              HORDE_MACHINE_STATUE},
2092     {MK_TROLL,          0,      {0},                                    {{0}},                          14,     21,     100,        STATUE_DORMANT, 0,              HORDE_MACHINE_STATUE},
2093     {MK_GOLEM,          0,      {0},                                    {{0}},                          21,     30,     100,        STATUE_DORMANT, 0,              HORDE_MACHINE_STATUE},
2094     {MK_DRAGON,         0,      {0},                                    {{0}},                          29,     DEEPEST_LEVEL,  100,    STATUE_DORMANT, 0,          HORDE_MACHINE_STATUE},
2095     {MK_TENTACLE_HORROR,0,      {0},                                    {{0}},                          29,     DEEPEST_LEVEL,  100,    STATUE_DORMANT, 0,          HORDE_MACHINE_STATUE},
2096 
2097     // machine turrets
2098     {MK_ARROW_TURRET,   0,      {0},                                    {{0}},                          5,      13,     100,        TURRET_DORMANT, 0,              HORDE_MACHINE_TURRET},
2099     {MK_SPARK_TURRET,   0,      {0},                                    {{0}},                          11,     18,     100,        TURRET_DORMANT, 0,              HORDE_MACHINE_TURRET},
2100     {MK_DART_TURRET,    0,      {0},                                    {{0}},                          15,     22,     100,        TURRET_DORMANT, 0,              HORDE_MACHINE_TURRET},
2101     {MK_FLAME_TURRET,   0,      {0},                                    {{0}},                          17,     24,     100,        TURRET_DORMANT, 0,              HORDE_MACHINE_TURRET},
2102 
2103     // machine mud monsters
2104     {MK_BOG_MONSTER,    0,      {0},                                    {{0}},                          12,     26,     100,        MACHINE_MUD_DORMANT, 0,         HORDE_MACHINE_MUD},
2105     {MK_KRAKEN,         0,      {0},                                    {{0}},                          17,     26,     30,     MACHINE_MUD_DORMANT, 0,         HORDE_MACHINE_MUD},
2106 
2107     // kennel monsters
2108     {MK_MONKEY,         0,      {0},                                    {{0}},                          1,      5,      100,        MONSTER_CAGE_CLOSED, 0,         HORDE_MACHINE_KENNEL | HORDE_LEADER_CAPTIVE},
2109     {MK_GOBLIN,         0,      {0},                                    {{0}},                          1,      8,      100,        MONSTER_CAGE_CLOSED, 0,         HORDE_MACHINE_KENNEL | HORDE_LEADER_CAPTIVE},
2110     {MK_GOBLIN_CONJURER,0,      {0},                                    {{0}},                          2,      9,      100,        MONSTER_CAGE_CLOSED, 0,         HORDE_MACHINE_KENNEL | HORDE_LEADER_CAPTIVE},
2111     {MK_GOBLIN_MYSTIC,  0,      {0},                                    {{0}},                          2,      9,      100,        MONSTER_CAGE_CLOSED, 0,         HORDE_MACHINE_KENNEL | HORDE_LEADER_CAPTIVE},
2112     {MK_OGRE,           0,      {0},                                    {{0}},                          7,      17,     100,        MONSTER_CAGE_CLOSED, 0,         HORDE_MACHINE_KENNEL | HORDE_LEADER_CAPTIVE},
2113     {MK_TROLL,          0,      {0},                                    {{0}},                          12,     21,     100,        MONSTER_CAGE_CLOSED, 0,         HORDE_MACHINE_KENNEL | HORDE_LEADER_CAPTIVE},
2114     {MK_NAGA,           0,      {0},                                    {{0}},                          13,     23,     100,        MONSTER_CAGE_CLOSED, 0,         HORDE_MACHINE_KENNEL | HORDE_LEADER_CAPTIVE},
2115     {MK_SALAMANDER,     0,      {0},                                    {{0}},                          9,      20,     100,        MONSTER_CAGE_CLOSED, 0,         HORDE_MACHINE_KENNEL | HORDE_LEADER_CAPTIVE},
2116     {MK_IMP,            0,      {0},                                    {{0}},                          15,     26,     100,        MONSTER_CAGE_CLOSED, 0,         HORDE_MACHINE_KENNEL | HORDE_LEADER_CAPTIVE},
2117     {MK_PIXIE,          0,      {0},                                    {{0}},                          11,     21,     100,        MONSTER_CAGE_CLOSED, 0,         HORDE_MACHINE_KENNEL | HORDE_LEADER_CAPTIVE},
2118     {MK_DAR_BLADEMASTER,0,      {0},                                    {{0}},                          9,      AMULET_LEVEL, 100, MONSTER_CAGE_CLOSED, 0,      HORDE_MACHINE_KENNEL | HORDE_LEADER_CAPTIVE},
2119     {MK_DAR_PRIESTESS,  0,      {0},                                    {{0}},                          12,     AMULET_LEVEL, 100, MONSTER_CAGE_CLOSED, 0,      HORDE_MACHINE_KENNEL | HORDE_LEADER_CAPTIVE},
2120     {MK_DAR_BATTLEMAGE, 0,      {0},                                    {{0}},                          13,     AMULET_LEVEL, 100, MONSTER_CAGE_CLOSED, 0,      HORDE_MACHINE_KENNEL | HORDE_LEADER_CAPTIVE},
2121 
2122     // vampire bloodbags
2123     {MK_MONKEY,         0,      {0},                                    {{0}},                          1,      5,      100,        MONSTER_CAGE_CLOSED, 0,         HORDE_VAMPIRE_FODDER | HORDE_LEADER_CAPTIVE},
2124     {MK_GOBLIN,         0,      {0},                                    {{0}},                          1,      8,      100,        MONSTER_CAGE_CLOSED, 0,         HORDE_VAMPIRE_FODDER | HORDE_LEADER_CAPTIVE},
2125     {MK_GOBLIN_CONJURER,0,      {0},                                    {{0}},                          2,      9,      100,        MONSTER_CAGE_CLOSED, 0,         HORDE_VAMPIRE_FODDER | HORDE_LEADER_CAPTIVE},
2126     {MK_GOBLIN_MYSTIC,  0,      {0},                                    {{0}},                          2,      9,      100,        MONSTER_CAGE_CLOSED, 0,         HORDE_VAMPIRE_FODDER | HORDE_LEADER_CAPTIVE},
2127     {MK_OGRE,           0,      {0},                                    {{0}},                          5,      15,     100,        MONSTER_CAGE_CLOSED, 0,         HORDE_VAMPIRE_FODDER | HORDE_LEADER_CAPTIVE},
2128     {MK_TROLL,          0,      {0},                                    {{0}},                          10,     19,     100,        MONSTER_CAGE_CLOSED, 0,         HORDE_VAMPIRE_FODDER | HORDE_LEADER_CAPTIVE},
2129     {MK_NAGA,           0,      {0},                                    {{0}},                          9,      20,     100,        MONSTER_CAGE_CLOSED, 0,         HORDE_VAMPIRE_FODDER | HORDE_LEADER_CAPTIVE},
2130     {MK_IMP,            0,      {0},                                    {{0}},                          15,     AMULET_LEVEL,100,MONSTER_CAGE_CLOSED, 0,            HORDE_VAMPIRE_FODDER | HORDE_LEADER_CAPTIVE},
2131     {MK_PIXIE,          0,      {0},                                    {{0}},                          11,     21,     100,        MONSTER_CAGE_CLOSED, 0,         HORDE_VAMPIRE_FODDER | HORDE_LEADER_CAPTIVE},
2132     {MK_DAR_BLADEMASTER,0,      {0},                                    {{0}},                          9,      AMULET_LEVEL,100,MONSTER_CAGE_CLOSED, 0,            HORDE_VAMPIRE_FODDER | HORDE_LEADER_CAPTIVE},
2133     {MK_DAR_PRIESTESS,  0,      {0},                                    {{0}},                          12,     AMULET_LEVEL,100,MONSTER_CAGE_CLOSED, 0,            HORDE_VAMPIRE_FODDER | HORDE_LEADER_CAPTIVE},
2134     {MK_DAR_BATTLEMAGE, 0,      {0},                                    {{0}},                          13,     AMULET_LEVEL,100,MONSTER_CAGE_CLOSED, 0,            HORDE_VAMPIRE_FODDER | HORDE_LEADER_CAPTIVE},
2135 
2136     // key thieves
2137     {MK_MONKEY,         0,      {0},                                    {{0}},                          1,      14,     100,     0,          0,                  HORDE_MACHINE_THIEF},
2138     {MK_IMP,            0,      {0},                                    {{0}},                          15,     DEEPEST_LEVEL,  100, 0,      0,                  HORDE_MACHINE_THIEF},
2139 
2140     // sacrifice victims
2141     {MK_MONKEY,         0,      {0},                                    {{0}},                          1,      5,      100,        STATUE_INSTACRACK, 0,           HORDE_SACRIFICE_TARGET},
2142     {MK_GOBLIN,         0,      {0},                                    {{0}},                          3,      10,     100,        STATUE_INSTACRACK, 0,           HORDE_SACRIFICE_TARGET},
2143     {MK_OGRE,           0,      {0},                                    {{0}},                          7,      13,     100,        STATUE_INSTACRACK, 0,           HORDE_SACRIFICE_TARGET},
2144     {MK_TROLL,          0,      {0},                                    {{0}},                          12,     19,     100,        STATUE_INSTACRACK, 0,           HORDE_SACRIFICE_TARGET},
2145     {MK_WRAITH,         0,      {0},                                    {{0}},                          10,     17,     100,        STATUE_INSTACRACK, 0,           HORDE_SACRIFICE_TARGET},
2146     {MK_NAGA,           0,      {0},                                    {{0}},                          13,     20,     100,        STATUE_INSTACRACK, 0,           HORDE_SACRIFICE_TARGET},
2147     {MK_DAR_BLADEMASTER,0,      {0},                                    {{0}},                          10,     20,     100,        STATUE_INSTACRACK, 0,           HORDE_SACRIFICE_TARGET},
2148     {MK_GOLEM,          0,      {0},                                    {{0}},                          22,     DEEPEST_LEVEL,100,  STATUE_INSTACRACK, 0,           HORDE_SACRIFICE_TARGET},
2149     {MK_REVENANT,       0,      {0},                                    {{0}},                          22,     DEEPEST_LEVEL,100,  STATUE_INSTACRACK, 0,           HORDE_SACRIFICE_TARGET},
2150     {MK_TENTACLE_HORROR,0,      {0},                                    {{0}},                          22,     DEEPEST_LEVEL,100,  STATUE_INSTACRACK, 0,           HORDE_SACRIFICE_TARGET},
2151 
2152     // legendary allies
2153     {MK_UNICORN,        0,      {0},                                    {{0}},                          1,      DEEPEST_LEVEL,  100, 0,     0,                  HORDE_MACHINE_LEGENDARY_ALLY | HORDE_ALLIED_WITH_PLAYER},
2154     {MK_IFRIT,          0,      {0},                                    {{0}},                          1,      DEEPEST_LEVEL,  100,    0,      0,                  HORDE_MACHINE_LEGENDARY_ALLY | HORDE_ALLIED_WITH_PLAYER},
2155     {MK_PHOENIX_EGG,    0,      {0},                                    {{0}},                          1,      DEEPEST_LEVEL,  100,    0,      0,                  HORDE_MACHINE_LEGENDARY_ALLY | HORDE_ALLIED_WITH_PLAYER},
2156     {MK_ANCIENT_SPIRIT, 0,      {0},                                    {{0}},                          1,      DEEPEST_LEVEL,  100,    0,      0,                  HORDE_MACHINE_LEGENDARY_ALLY | HORDE_ALLIED_WITH_PLAYER},
2157 
2158     // goblin warren
2159     {MK_GOBLIN,         0,      {0},                                    {{0}},                          1,      10,     100,     0,              0,              HORDE_MACHINE_GOBLIN_WARREN},
2160     {MK_GOBLIN_CONJURER,0,      {0},                                    {{0}},                          1,      10,     60,      0,              0,              HORDE_MACHINE_GOBLIN_WARREN},
2161     {MK_GOBLIN_TOTEM,   1,      {MK_GOBLIN},                            {{2,4,1}},                      5,      13,     100,        0,              MT_CAMP_AREA,   HORDE_MACHINE_GOBLIN_WARREN},
2162     {MK_GOBLIN,         3,      {MK_GOBLIN, MK_GOBLIN_MYSTIC, MK_JACKAL},{{2, 3, 1}, {1,2,1}, {1,2,1}}, 6,      12,     40,      0,              0,              HORDE_MACHINE_GOBLIN_WARREN},
2163     {MK_GOBLIN_CONJURER,2,      {MK_GOBLIN_CONJURER, MK_GOBLIN_MYSTIC}, {{0,1,1}, {1,1,1}},             7,      15,     40,      0,              0,              HORDE_MACHINE_GOBLIN_WARREN},
2164     {MK_GOBLIN_TOTEM,   4,      {MK_GOBLIN_TOTEM, MK_GOBLIN_CONJURER, MK_GOBLIN_MYSTIC, MK_GOBLIN}, {{1,2,1},{1,2,1},{1,2,1},{3,5,1}},10,17,80,0,MT_CAMP_AREA,  HORDE_MACHINE_GOBLIN_WARREN},
2165     {MK_GOBLIN,         1,      {MK_GOBLIN},                            {{1, 2, 1}},                    3,      7,      10,     0,              0,              HORDE_MACHINE_GOBLIN_WARREN | HORDE_LEADER_CAPTIVE},
2166 };
2167 
2168 const monsterClass monsterClassCatalog[MONSTER_CLASS_COUNT] = {
2169     // name             frequency   maxDepth    member list
2170     {"abomination",     10,         -1,         {MK_BOG_MONSTER, MK_UNDERWORM, MK_KRAKEN, MK_TENTACLE_HORROR}},
2171     {"dar",             10,         22,         {MK_DAR_BLADEMASTER, MK_DAR_PRIESTESS, MK_DAR_BATTLEMAGE}},
2172     {"animal",          10,         10,         {MK_RAT, MK_MONKEY, MK_JACKAL, MK_EEL, MK_TOAD, MK_VAMPIRE_BAT, MK_CENTIPEDE, MK_SPIDER}},
2173     {"goblin",          10,         10,         {MK_GOBLIN, MK_GOBLIN_CONJURER, MK_GOBLIN_MYSTIC, MK_GOBLIN_TOTEM, MK_GOBLIN_CHIEFTAN, MK_SPECTRAL_BLADE}},
2174     {"ogre",            10,         16,         {MK_OGRE, MK_OGRE_SHAMAN, MK_OGRE_TOTEM}},
2175     {"dragon",          10,         -1,         {MK_DRAGON}},
2176     {"undead",          10,         -1,         {MK_ZOMBIE, MK_WRAITH, MK_VAMPIRE, MK_PHANTOM, MK_LICH, MK_REVENANT}},
2177     {"jelly",           10,         15,         {MK_PINK_JELLY, MK_BLACK_JELLY, MK_ACID_JELLY}},
2178     {"turret",          5,          18,         {MK_ARROW_TURRET, MK_SPARK_TURRET, MK_DART_TURRET, MK_FLAME_TURRET}},
2179     {"infernal",        10,         -1,         {MK_FLAMEDANCER, MK_IMP, MK_REVENANT, MK_FURY, MK_PHANTOM, MK_IFRIT}},
2180     {"mage",            10,         -1,         {MK_GOBLIN_CONJURER, MK_GOBLIN_MYSTIC, MK_OGRE_SHAMAN, MK_DAR_PRIESTESS, MK_DAR_BATTLEMAGE, MK_PIXIE, MK_LICH}},
2181     {"waterborne",      10,         17,         {MK_EEL, MK_NAGA, MK_KRAKEN}},
2182     {"airborne",        10,         15,         {MK_VAMPIRE_BAT, MK_WILL_O_THE_WISP, MK_PIXIE, MK_PHANTOM, MK_FURY, MK_IFRIT, MK_PHOENIX}},
2183     {"fireborne",       10,         12,         {MK_WILL_O_THE_WISP, MK_SALAMANDER, MK_FLAMEDANCER, MK_PHOENIX}},
2184     {"troll",           10,         15,         {MK_TROLL}},
2185 };
2186 
2187 // ITEMS
2188 
2189 char itemTitles[NUMBER_SCROLL_KINDS][30];
2190 
2191 const char itemCategoryNames[NUMBER_ITEM_CATEGORIES][7] = {
2192         "food",
2193         "weapon",
2194         "armor",
2195         "potion",
2196         "scroll",
2197         "staff",
2198         "wand",
2199         "ring",
2200         "charm",
2201         "gold",
2202         "amulet",
2203         "gem",
2204         "key"
2205 };
2206 
2207 const char titlePhonemes[NUMBER_TITLE_PHONEMES][30] = {
2208     "glorp",
2209     "snarg",
2210     "gana",
2211     "flin",
2212     "herba",
2213     "pora",
2214     "nuglo",
2215     "greep",
2216     "nur",
2217     "lofa",
2218     "poder",
2219     "nidge",
2220     "pus",
2221     "wooz",
2222     "flem",
2223     "bloto",
2224     "porta",
2225     "ermah",
2226     "gerd",
2227     "nurt",
2228     "flurx",
2229 };
2230 
2231 char itemColors[NUMBER_ITEM_COLORS][30];
2232 
2233 const char itemColorsRef[NUMBER_ITEM_COLORS][30] = {
2234     "crimson",
2235     "scarlet",
2236     "orange",
2237     "yellow",
2238     "green",
2239     "blue",
2240     "indigo",
2241     "violet",
2242     "puce",
2243     "mauve",
2244     "burgundy",
2245     "turquoise",
2246     "aquamarine",
2247     "gray",
2248     "pink",
2249     "white",
2250     "lavender",
2251     "tan",
2252     "brown",
2253     "cyan",
2254     "black"
2255 };
2256 
2257 char itemWoods[NUMBER_ITEM_WOODS][30];
2258 
2259 const char itemWoodsRef[NUMBER_ITEM_WOODS][30] = {
2260     "teak",
2261     "oak",
2262     "redwood",
2263     "rowan",
2264     "willow",
2265     "mahogany",
2266     "pinewood",
2267     "maple",
2268     "bamboo",
2269     "ironwood",
2270     "pearwood",
2271     "birch",
2272     "cherry",
2273     "eucalyptus",
2274     "walnut",
2275     "cedar",
2276     "rosewood",
2277     "yew",
2278     "sandalwood",
2279     "hickory",
2280     "hemlock",
2281 };
2282 
2283 char itemMetals[NUMBER_ITEM_METALS][30];
2284 
2285 const char itemMetalsRef[NUMBER_ITEM_METALS][30] = {
2286     "bronze",
2287     "steel",
2288     "brass",
2289     "pewter",
2290     "nickel",
2291     "copper",
2292     "aluminum",
2293     "tungsten",
2294     "titanium",
2295     "cobalt",
2296     "chromium",
2297     "silver",
2298 };
2299 
2300 char itemGems[NUMBER_ITEM_GEMS][30];
2301 
2302 const char itemGemsRef[NUMBER_ITEM_GEMS][30] = {
2303     "diamond",
2304     "opal",
2305     "garnet",
2306     "ruby",
2307     "amethyst",
2308     "topaz",
2309     "onyx",
2310     "tourmaline",
2311     "sapphire",
2312     "obsidian",
2313     "malachite",
2314     "aquamarine",
2315     "emerald",
2316     "jade",
2317     "alexandrite",
2318     "agate",
2319     "bloodstone",
2320     "jasper"
2321 };
2322 
2323 //typedef struct itemTable {
2324 //  char *name;
2325 //  char *flavor;
2326 //  short frequency;
2327 //  short marketValue;
2328 //  short number;
2329 //  randomRange range;
2330 //} itemTable;
2331 
2332 const itemTable keyTable[NUMBER_KEY_TYPES] = {
2333     {"door key",            "", "", 1, 0,   0, {0,0,0}, true, false, "The notches on this ancient iron key are well worn; its leather lanyard is battered by age. What door might it open?"},
2334     {"cage key",            "", "", 1, 0,   0, {0,0,0}, true, false, "The rust accreted on this iron key has been stained with flecks of blood; it must have been used recently. What cage might it open?"},
2335     {"crystal orb",         "", "", 1, 0,   0, {0,0,0}, true, false, "A faceted orb, seemingly cut from a single crystal, sparkling and perpetually warm to the touch. What manner of device might such an object activate?"},
2336 };
2337 
2338 const itemTable foodTable[NUMBER_FOOD_KINDS] = {
2339     {"ration of food",      "", "", 3, 25,  1800, {0,0,0}, true, false, "A ration of food. Was it left by former adventurers? Is it a curious byproduct of the subterranean ecosystem?"},
2340     {"mango",               "", "", 1, 15,  1550, {0,0,0}, true, false, "An odd fruit to be found so deep beneath the surface of the earth, but only slightly less filling than a ration of food."}
2341 };
2342 
2343 const itemTable weaponTable[NUMBER_WEAPON_KINDS] = {
2344     {"dagger",              "", "", 10, 190,        12, {3, 4,  1},     true, false, "A simple iron dagger with a well-worn wooden handle. Daggers will deal quintuple damage upon a successful sneak attack instead of triple damage."},
2345     {"sword",               "", "", 10, 440,        14, {7, 9,  1},     true, false, "The razor-sharp length of steel blade shines reassuringly."},
2346     {"broadsword",          "", "", 10, 990,        19, {14, 22, 1},    true, false, "This towering blade inflicts heavy damage by investing its heft into every cut."},
2347 
2348     {"whip",                "", "", 10, 440,        14, {3, 5,  1},     true, false, "The lash from this coil of braided leather can tear bark from trees, and it will reach opponents up to five spaces away."},
2349     {"rapier",              "", "", 10, 440,        15, {3, 5,  1},     true, false, "This blade is thin and flexible, designed for deft and rapid maneuvers. It inflicts less damage than comparable weapons, but permits you to attack twice as quickly. If there is one space between you and an enemy and you step directly toward it, you will perform a devastating lunge attack, which deals treble damage and never misses."},
2350     {"flail",               "", "", 10, 440,        17, {9, 15, 1},     true, false, "This spiked iron ball can be whirled at the end of its chain in synchronicity with your movement, allowing you a free attack whenever moving between two spaces that are adjacent to an enemy."},
2351 
2352     {"mace",                "", "", 10, 660,        16, {16, 20, 1},    true, false, "The iron flanges at the head of this weapon inflict substantial damage with every weighty blow. Because of its heft, it takes an extra turn to recover when it hits, and will push your opponent backward if there is room."},
2353     {"war hammer",          "", "", 10, 1100,       20, {25, 35, 1},    true, false, "Few creatures can withstand the crushing blow of this towering mass of lead and steel, but only the strongest of adventurers can effectively wield it. Because of its heft, it takes an extra turn to recover when it hits, and will push your opponent backward if there is room."},
2354 
2355     {"spear",               "", "", 10, 330,        13, {4, 5, 1},      true, false, "A slender wooden rod tipped with sharpened iron. The reach of the spear permits you to simultaneously attack an adjacent enemy and the enemy directly behind it."},
2356     {"war pike",            "", "", 10, 880,        18, {11, 15, 1},    true, false, "A long steel pole ending in a razor-sharp point. The reach of the pike permits you to simultaneously attack an adjacent enemy and the enemy directly behind it."},
2357 
2358     {"axe",                 "", "", 10, 550,        15, {7, 9, 1},      true, false, "The blunt iron edge on this axe glints in the darkness. The arc of its swing permits you to attack all adjacent enemies simultaneously."},
2359     {"war axe",             "", "", 10, 990,        19, {12, 17, 1},    true, false, "The enormous steel head of this war axe puts considerable heft behind each stroke. The arc of its swing permits you to attack all adjacent enemies simultaneously."},
2360 
2361     {"dart",                "", "", 0,  15,         10, {2, 4,  1},     true, false, "These simple metal spikes are weighted to fly true and sting their prey with a flick of the wrist."},
2362     {"incendiary dart",     "", "", 10, 25,         12, {1, 2,  1},     true, false, "The barbed spike on each of these darts is designed to stick to its target while the compounds strapped to its length explode into flame."},
2363     {"javelin",             "", "", 10, 40,         15, {3, 11, 3},     true, false, "This length of metal is weighted to keep the spike at its tip foremost as it sails through the air."},
2364 };
2365 
2366 const itemTable armorTable[NUMBER_ARMOR_KINDS] = {
2367     {"leather armor",   "", "", 10, 250,        10, {30,30,0},      true, false, "This lightweight armor offers basic protection."},
2368     {"scale mail",      "", "", 10, 350,        12, {40,40,0},      true, false, "Bronze scales cover the surface of treated leather, offering greater protection than plain leather with minimal additional weight."},
2369     {"chain mail",      "", "", 10, 500,        13, {50,50,0},      true, false, "Interlocking metal links make for a tough but flexible suit of armor."},
2370     {"banded mail",     "", "", 10, 800,        15, {70,70,0},      true, false, "Overlapping strips of metal horizontally encircle a chain mail base, offering an additional layer of protection at the cost of greater weight."},
2371     {"splint mail",     "", "", 10, 1000,       17, {90,90,0},      true, false, "Thick plates of metal are embedded into a chain mail base, providing the wearer with substantial protection."},
2372     {"plate armor",     "", "", 10, 1300,       19, {110,110,0},    true, false, "Enormous plates of metal are joined together into a suit that provides unmatched protection to any adventurer strong enough to bear its staggering weight."}
2373 };
2374 
2375 const char weaponRunicNames[NUMBER_WEAPON_RUNIC_KINDS][30] = {
2376     "speed",
2377     "quietus",
2378     "paralysis",
2379     "multiplicity",
2380     "slowing",
2381     "confusion",
2382     "force",
2383     "slaying",
2384     "mercy",
2385     "plenty"
2386 };
2387 
2388 const char armorRunicNames[NUMBER_ARMOR_ENCHANT_KINDS][30] = {
2389     "multiplicity",
2390     "mutuality",
2391     "absorption",
2392     "reprisal",
2393     "immunity",
2394     "reflection",
2395     "respiration",
2396     "dampening",
2397     "burden",
2398     "vulnerability",
2399     "immolation",
2400 };
2401 
2402 itemTable scrollTable[NUMBER_SCROLL_KINDS] = {
2403     {"enchanting",          itemTitles[0], "",  0,  550,    0,{0,0,0}, false, false, "This ancient enchanting sorcery will imbue a single item with a powerful and permanent magical charge. A staff will increase in power and in number of charges; a weapon will inflict more damage and find its mark more easily; a suit of armor will deflect attacks more often; the magic of a ring will intensify; and a wand will gain expendable charges in the least amount that such a wand can be found with. Weapons and armor will also require less strength to use, and any curses on the item will be lifted."}, // frequency is dynamically adjusted
2404     {"identify",            itemTitles[1], "",  30, 300,    0,{0,0,0}, false, false, "This scrying magic will permanently reveal all of the secrets of a single item."},
2405     {"teleportation",       itemTitles[2], "",  10, 500,    0,{0,0,0}, false, false, "This escape spell will instantly relocate you to a random location on the dungeon level. It can be used to escape a dangerous situation with luck. The unlucky reader might find himself in an even more dangerous place."},
2406     {"remove curse",        itemTitles[3], "",  15, 150,    0,{0,0,0}, false, false, "This redemption spell will instantly strip from the reader's weapon, armor, rings and carried items any evil enchantments that might prevent the wearer from removing them."},
2407     {"recharging",          itemTitles[4], "",  12, 375,    0,{0,0,0}, false, false, "The power bound up in this parchment will instantly recharge all of your staffs and charms."},
2408     {"protect armor",       itemTitles[5], "",  10, 400,    0,{0,0,0}, false, false, "This ceremonial shielding magic will permanently proof your armor against degradation by acid."},
2409     {"protect weapon",      itemTitles[6], "",  10, 400,    0,{0,0,0}, false, false, "This ceremonial shielding magic will permanently proof your weapon against degradation by acid."},
2410     {"sanctuary",           itemTitles[7], "",  10, 500,    0,{0,0,0}, false, false, "This protection rite will imbue the area with powerful warding glyphs, when released over plain ground. Monsters will not willingly set foot on the affected area."},
2411     {"magic mapping",       itemTitles[8], "",  12, 500,    0,{0,0,0}, false, false, "This powerful scouting magic will etch a purple-hued image of crystal clarity into your memory, alerting you to the precise layout of the level and revealing all traps, secret doors and hidden levers."},
2412     {"negation",            itemTitles[9], "",  8,  400,    0,{0,0,0}, false, false, "When this powerful anti-magic is released, all creatures (including yourself) and all items lying on the ground within your field of view will be exposed to its blast and stripped of magic. Creatures animated purely by magic will die. Potions, scrolls, items being held by other creatures and items in your inventory will not be affected."},
2413     {"shattering",          itemTitles[10],"",  8,  500,    0,{0,0,0}, false, false, "This strange incantation will alter the physical structure of nearby stone, causing it to evaporate into the air over the ensuing minutes."},
2414     {"discord",             itemTitles[11], "", 8,  400,    0,{0,0,0}, false, false, "This scroll will unleash a powerful blast of mind magic. Any creatures within line of sight will turn against their companions and attack indiscriminately for 30 turns."},
2415     {"aggravate monsters",  itemTitles[12], "", 15, 50,     0,{0,0,0}, false, false, "This scroll will unleash a piercing shriek that will awaken all monsters and alert them to the reader's location."},
2416     {"summon monsters",     itemTitles[13], "", 10, 50,     0,{0,0,0}, false, false, "This summoning incantation will call out to creatures in other planes of existence, drawing them through the fabric of reality to confront the reader."},
2417 };
2418 
2419 itemTable potionTable[NUMBER_POTION_KINDS] = {
2420     {"life",                itemColors[1], "",  0,  500,    0,{0,0,0}, false, false, "A swirling elixir that will instantly heal you, cure you of ailments, and permanently increase your maximum health."}, // frequency is dynamically adjusted
2421     {"strength",            itemColors[2], "",  0,  400,    0,{0,0,0}, false, false, "This powerful medicine will course through your muscles, permanently increasing your strength by one point."}, // frequency is dynamically adjusted
2422     {"telepathy",           itemColors[3], "",  20, 350,    0,{0,0,0}, false, false, "This mysterious liquid will attune your mind to the psychic signature of distant creatures. Its effects will not reveal inanimate objects, such as totems, turrets and traps."},
2423     {"levitation",          itemColors[4], "",  15, 250,    0,{0,0,0}, false, false, "This curious liquid will cause you to hover in the air, able to drift effortlessly over lava, water, chasms and traps. Flames, gases and spiderwebs fill the air, and cannot be bypassed while airborne. Creatures that dwell in water or mud will be unable to attack you while you levitate."},
2424     {"detect magic",        itemColors[5], "",  20, 500,    0,{0,0,0}, false, false, "This mysterious brew will sensitize your mind to the radiance of magic. Items imbued with helpful enchantments will be marked with a full sigil; items corrupted by curses or designed to bring misfortune upon the bearer will be marked with a hollow sigil. The Amulet of Yendor will be revealed by its unique aura."},
2425     {"speed",               itemColors[6], "",  10, 500,    0,{0,0,0}, false, false, "Quaffing the contents of this flask will enable you to move at blinding speed for several minutes."},
2426     {"fire immunity",       itemColors[7], "",  15, 500,    0,{0,0,0}, false, false, "This potion will render you impervious to heat and permit you to wander through fire and lava and ignore otherwise deadly bolts of flame. It will not guard against the concussive impact of an explosion, however."},
2427     {"invisibility",        itemColors[8], "",  15, 400,    0,{0,0,0}, false, false, "Drinking this potion will render you temporarily invisible. Enemies more than two spaces away will be unable to track you."},
2428     {"caustic gas",         itemColors[9], "",  15, 200,    0,{0,0,0}, false, false, "Uncorking or shattering this pressurized glass will cause its contents to explode into a deadly cloud of caustic purple gas. You might choose to fling this potion at distant enemies instead of uncorking it by hand."},
2429     {"paralysis",           itemColors[10], "", 10, 250,    0,{0,0,0}, false, false, "Upon exposure to open air, the liquid in this flask will vaporize into a numbing pink haze. Anyone who inhales the cloud will be paralyzed instantly, unable to move for some time after the cloud dissipates. This item can be thrown at distant enemies to catch them within the effect of the gas."},
2430     {"hallucination",       itemColors[11], "", 10, 500,    0,{0,0,0}, false, false, "This flask contains a vicious and long-lasting hallucinogen. Under its dazzling effect, you will wander through a rainbow wonderland, unable to discern the form of any creatures or items you see."},
2431     {"confusion",           itemColors[12], "", 15, 450,    0,{0,0,0}, false, false, "This unstable chemical will quickly vaporize into a glittering cloud upon contact with open air, causing any creature that inhales it to lose control of the direction of its movements until the effect wears off (although its ability to aim projectile attacks will not be affected). Its vertiginous intoxication can cause creatures and adventurers to careen into one another or into chasms or lava pits, so extreme care should be taken when under its effect. Its contents can be weaponized by throwing the flask at distant enemies."},
2432     {"incineration",        itemColors[13], "", 15, 500,    0,{0,0,0}, false, false, "This flask contains an unstable compound which will burst violently into flame upon exposure to open air. You might throw the flask at distant enemies -- or into a deep lake, to cleanse the cavern with scalding steam."},
2433     {"darkness",            itemColors[14], "", 7,  150,    0,{0,0,0}, false, false, "Drinking this potion will plunge you into darkness. At first, you will be completely blind to anything not illuminated by an independent light source, but over time your vision will regain its former strength. Throwing the potion will create a cloud of supernatural darkness, and enemies will have difficulty seeing or following you if you take refuge under its cover."},
2434     {"descent",             itemColors[15], "", 15, 500,    0,{0,0,0}, false, false, "When this flask is uncorked by hand or shattered by being thrown, the fog that seeps out will temporarily cause the ground in the vicinity to vanish."},
2435     {"creeping death",      itemColors[16], "", 7,  450,    0,{0,0,0}, false, false, "When the cork is popped or the flask is thrown, tiny spores will spill across the ground and begin to grow a deadly lichen. Anything that touches the lichen will be poisoned by its clinging tendrils, and the lichen will slowly grow to fill the area. Fire will purge the infestation."},
2436 };
2437 
2438 itemTable wandTable[NUMBER_WAND_KINDS] = {
2439     {"teleportation",   itemMetals[0], "",  3,  800,    BOLT_TELEPORT,      {3,5,1}, false, false, "This wand will teleport a creature to a random place on the level. Aquatic or mud-bound creatures will be rendered helpless on dry land."},
2440     {"slowness",        itemMetals[1], "",  3,  800,    BOLT_SLOW,          {2,5,1}, false, false, "This wand will cause a creature to move at half its ordinary speed for 30 turns."},
2441     {"polymorphism",    itemMetals[2], "",  3,  700,    BOLT_POLYMORPH,     {3,5,1}, false, false, "This mischievous magic will transform a creature into another creature at random. Beware: the tamest of creatures might turn into the most fearsome. The horror of the transformation will turn an allied victim against you."},
2442     {"negation",        itemMetals[3], "",  3,  550,    BOLT_NEGATION,      {4,6,1}, false, false, "This powerful anti-magic will strip a creature of a host of magical traits, including flight, invisibility, acidic corrosiveness, telepathy, magical speed or slowness, hypnosis, magical fear, immunity to physical attack, fire resistance and the ability to blink. Spellcasters will lose their magical abilities and magical totems will be rendered inert. Creatures animated purely by magic will die."},
2443     {"domination",      itemMetals[4], "",  1,  1000,   BOLT_DOMINATION,    {1,2,1}, false, false, "This wand can forever bind an enemy to the caster's will, turning it into a steadfast ally. However, the magic only works effectively against enemies that are near death."},
2444     {"beckoning",       itemMetals[5], "",  3,  500,    BOLT_BECKONING,     {2,4,1}, false, false, "The force of this wand will draw the targeted creature into direct proximity."},
2445     {"plenty",          itemMetals[6], "",  2,  700,    BOLT_PLENTY,        {1,2,1}, false, false, "The creature at the other end of this wand, friend or foe, will be beside itself -- literally! This mischievous cloning magic splits the body and life essence of its target into two. Both the creature and its clone will be weaker than the original."},
2446     {"invisibility",    itemMetals[7], "",  3,  100,    BOLT_INVISIBILITY,  {3,5,1}, false, false, "This wand will render a creature temporarily invisible to the naked eye. Only with telepathy or in the silhouette of a thick gas will an observer discern the creature's hazy outline."},
2447     {"empowerment",     itemMetals[8], "",  2,  100,    BOLT_EMPOWERMENT,   {1,1,1}, false, false, "This sacred magic will permanently improve the mind and body of any monster it hits. A wise adventurer will use it on allies, making them stronger in combat and able to learn a new talent from a fallen foe. If the bolt is reflected back at you, it will have no effect."},
2448 };
2449 
2450 itemTable staffTable[NUMBER_STAFF_KINDS] = {
2451     {"lightning",       itemWoods[0], "",   15, 1300,   BOLT_LIGHTNING,     {2,4,1}, false, false, "This staff conjures forth deadly arcs of electricity to damage to any number of creatures in a straight line."},
2452     {"firebolt",        itemWoods[1], "",   15, 1300,   BOLT_FIRE,          {2,4,1}, false, false, "This staff unleashes bursts of magical fire. It will ignite flammable terrain and burn any creature that it hits. Creatures with an immunity to fire will be unaffected by the bolt."},
2453     {"poison",          itemWoods[3], "",   10, 1200,   BOLT_POISON,        {2,4,1}, false, false, "The vile blast of this twisted staff will imbue its target with a deadly venom. Each turn, a creature that is poisoned will suffer one point of damage per dose of poison it has received, and poisoned creatures will not regenerate lost health until the poison clears."},
2454     {"tunneling",       itemWoods[4], "",   10, 1000,   BOLT_TUNNELING,     {2,4,1}, false, false, "Bursts of magic from this staff will pass harmlessly through creatures but will reduce most obstructions to rubble."},
2455     {"blinking",        itemWoods[5], "",   11, 1200,   BOLT_BLINKING,      {2,4,1}, false, false, "This staff will allow you to teleport in the chosen direction. Creatures and inanimate obstructions will block the teleportation."},
2456     {"entrancement",    itemWoods[6], "",   6,  1000,   BOLT_ENTRANCEMENT,  {2,4,1}, false, false, "This staff will send creatures into a temporary trance, causing them to mindlessly mirror your movements. You can use the effect to cause one creature to attack another or to step into hazardous terrain, but the spell will be broken if you attack the creature under the effect."},
2457     {"obstruction",     itemWoods[7], "",   10, 1000,   BOLT_OBSTRUCTION,   {2,4,1}, false, false, "This staff will conjure a mass of impenetrable green crystal, preventing anything from moving through the affected area and temporarily entombing anything that is already there. The crystal will dissolve into the air as time passes. Higher level staffs will create larger obstructions."},
2458     {"discord",         itemWoods[8], "",   10, 1000,   BOLT_DISCORD,       {2,4,1}, false, false, "This staff will alter the perception of a creature and cause it to lash out indiscriminately. Strangers and allies alike will turn on the victim."},
2459     {"conjuration",     itemWoods[9], "",   8,  1000,   BOLT_CONJURATION,   {2,4,1}, false, false, "A flick of this staff will summon a number of phantom blades to fight on your behalf."},
2460     {"healing",         itemWoods[10], "",  5,  1100,   BOLT_HEALING,       {2,4,1}, false, false, "This staff will heal any creature, friend or foe. Unfortunately, you cannot use this or any staff on yourself except by reflecting the bolt."},
2461     {"haste",           itemWoods[11], "",  5,  900,    BOLT_HASTE,         {2,4,1}, false, false, "This staff will temporarily double the speed of any creature, friend or foe. Unfortunately, you cannot use this or any staff on yourself except by reflecting the bolt."},
2462     {"protection",      itemWoods[12], "",  5,  900,    BOLT_SHIELDING,     {2,4,1}, false, false, "This staff will bathe a creature in a protective light that will absorb all damage until it is depleted. Unfortunately, you cannot use this or any staff on yourself except by reflecting the bolt."},
2463 };
2464 
2465 itemTable ringTable[NUMBER_RING_KINDS] = {
2466     {"clairvoyance",    itemGems[0], "",    1,  900,    0,{1,3,1}, false, false, "This ring of eldritch scrying will permit you to see through nearby walls and doors, within a radius determined by the level of the ring. A cursed ring of clairvoyance will blind you to your immediate surroundings."},
2467     {"stealth",         itemGems[1], "",    1,  800,    0,{1,3,1}, false, false, "This ring of silent passage will reduce your stealth range, making enemies less likely to notice you and more likely to lose your trail. Staying motionless and lurking in the shadows will make you even harder to spot. Cursed rings of stealth will increase your stealth range, making you easier to spot and to track."},
2468     {"regeneration",    itemGems[2], "",    1,  750,    0,{1,3,1}, false, false, "This ring of sacred life will allow you to recover lost health at an accelerated rate. Cursed rings will decrease or even halt your natural regeneration."},
2469     {"transference",    itemGems[3], "",    1,  750,    0,{1,3,1}, false, false, "This ring of blood magic will heal you in proportion to the damage you inflict on others. Cursed rings will cause you to lose health when inflicting damage."},
2470     {"light",           itemGems[4], "",    1,  600,    0,{1,3,1}, false, false, "This ring of preternatural vision will allow you to see farther in the dimming light of the deeper dungeon levels. It will not make you more noticeable to enemies."},
2471     {"awareness",       itemGems[5], "",    1,  700,    0,{1,3,1}, false, false, "This ring of effortless vigilance will enable you to notice traps, secret doors and hidden levers more often and from a greater distance. Cursed rings of awareness will dull your senses, making it harder to notice secrets without actively searching for them."},
2472     {"wisdom",          itemGems[6], "",    1,  700,    0,{1,3,1}, false, false, "This ring of arcane power will cause your staffs to recharge at an accelerated rate. Cursed rings of wisdom will cause your staffs to recharge more slowly."},
2473     {"reaping",         itemGems[7], "",    1,  700,    0,{1,3,1}, false, false, "This ring of blood magic will recharge your staffs and charms every time you hit an enemy. Cursed rings of reaping will drain your staffs and charms with every hit."},
2474 };
2475 
2476 itemTable charmTable[NUMBER_CHARM_KINDS] = {
2477     {"health",          "", "", 5,  900,    0,{1,2,1}, true, false, "A handful of dried bloodwort and mandrake root has been bound together with leather cord and imbued with a powerful healing magic."},
2478     {"protection",      "", "", 5,  800,    0,{1,2,1}, true, false, "Four copper rings have been joined into a tetrahedron. The construct is oddly warm to the touch."},
2479     {"haste",           "", "", 5,  750,    0,{1,2,1}, true, false, "Various animals have been etched into the surface of this brass bangle. It emits a barely audible hum."},
2480     {"fire immunity",   "", "", 3,  750,    0,{1,2,1}, true, false, "Eldritch flames flicker within this polished crystal bauble."},
2481     {"invisibility",    "", "", 5,  700,    0,{1,2,1}, true, false, "A jade figurine depicts a strange humanoid creature. It has a face on both sides of its head, but all four eyes are closed."},
2482     {"telepathy",       "", "", 3,  700,    0,{1,2,1}, true, false, "Seven tiny glass eyes roll freely within this glass sphere. Somehow, they always come to rest facing outward."},
2483     {"levitation",      "", "", 1,  700,    0,{1,2,1}, true, false, "Sparkling dust and fragments of feather waft and swirl endlessly inside this small glass sphere."},
2484     {"shattering",      "", "", 1,  700,    0,{1,2,1}, true, false, "This turquoise crystal, fixed to a leather lanyard, hums with an arcane energy that sets your teeth on edge."},
2485     {"guardian",        "", "", 5,  700,    0,{1,2,1}, true, false, "When you touch this tiny granite statue, a rhythmic booming echoes in your mind."},
2486 //    {"fear",            "", "",   3,  700,    0,{1,2,1}, true, false, "When you gaze into the murky interior of this obsidian cube, you feel as though something predatory is watching you."},
2487     {"teleportation",   "", "", 4,  700,    0,{1,2,1}, true, false, "The surface of this nickel sphere has been etched with a perfect grid pattern. Somehow, the squares of the grid are all exactly the same size."},
2488     {"recharging",      "", "", 5,  700,    0,{1,2,1}, true, false, "A strip of bronze has been wound around a rough wooden sphere. Each time you touch it, you feel a tiny electric shock."},
2489     {"negation",        "", "", 5,  700,    0,{1,2,1}, true, false, "A featureless gray disc hangs from a lanyard. When you touch it, your hand and arm go numb."},
2490 };
2491 
2492 const bolt boltCatalog[NUMBER_BOLT_KINDS] = {
2493     {{0}},
2494     //name                      bolt description                ability description                         char    foreColor       backColor           boltEffect      magnitude       pathDF      targetDF    forbiddenMonsterFlags       flags
2495     {"teleportation spell",     "casts a teleport spell",       "can teleport other creatures",             0,      NULL,           &blue,              BE_TELEPORT,    10,             0,          0,          MONST_IMMOBILE,             (BF_TARGET_ENEMIES)},
2496     {"slowing spell",           "casts a slowing spell",        "can slow $HISHER enemies",                 0,      NULL,           &green,             BE_SLOW,        10,             0,          0,          MONST_INANIMATE,            (BF_TARGET_ENEMIES)},
2497     {"polymorph spell",         "casts a polymorphism spell",   "can polymorph other creatures",            0,      NULL,           &purple,            BE_POLYMORPH,   10,             0,          0,          MONST_INANIMATE,            (BF_TARGET_ENEMIES)},
2498     {"negation magic",          "casts a negation spell",       "can cast negation",                        0,      NULL,           &pink,              BE_NEGATION,    10,             0,          0,          0,                          (BF_TARGET_ENEMIES)},
2499     {"domination spell",        "casts a domination spell",     "can dominate other creatures",             0,      NULL,           &dominationColor,   BE_DOMINATION,  10,             0,          0,          MONST_INANIMATE,            (BF_TARGET_ENEMIES)},
2500     {"beckoning spell",         "casts a beckoning spell",      "can cast beckoning",                       0,      NULL,           &beckonColor,       BE_BECKONING,   10,             0,          0,          MONST_IMMOBILE,             (BF_TARGET_ENEMIES)},
2501     {"spell of plenty",         "casts a spell of plenty",      "can duplicate other creatures",            0,      NULL,           &rainbow,           BE_PLENTY,      10,             0,          0,          MONST_INANIMATE,            (BF_TARGET_ALLIES | BF_NOT_LEARNABLE)},
2502     {"invisibility magic",      "casts invisibility magic",     "can turn creatures invisible",             0,      NULL,           &darkBlue,          BE_INVISIBILITY, 10,            0,          0,          MONST_INANIMATE,            (BF_TARGET_ALLIES)},
2503     {"empowerment sorcery",     "casts empowerment",            "can cast empowerment",                     0,      NULL,           &empowermentColor,  BE_EMPOWERMENT, 10,             0,          0,          MONST_INANIMATE,            (BF_TARGET_ALLIES | BF_NOT_LEARNABLE)},
2504     {"lightning",               "casts lightning",              "can hurl lightning bolts",                 0,      NULL,           &lightningColor,    BE_DAMAGE,      10,             0,          0,          0,                          (BF_PASSES_THRU_CREATURES | BF_TARGET_ENEMIES | BF_ELECTRIC)},
2505     {"flame",                   "casts a gout of flame",        "can hurl gouts of flame",                  0,      NULL,           &fireBoltColor,     BE_DAMAGE,      4,              0,          0,          MONST_IMMUNE_TO_FIRE,       (BF_TARGET_ENEMIES | BF_FIERY)},
2506     {"poison ray",              "casts a poison ray",           "can cast poisonous bolts",                 0,      NULL,           &poisonColor,       BE_POISON,      10,             0,          0,          MONST_INANIMATE,            (BF_TARGET_ENEMIES)},
2507     {"tunneling magic",         "casts tunneling",              "can tunnel",                               0,      NULL,           &brown,             BE_TUNNELING,   10,             0,          0,          0,                          (BF_PASSES_THRU_CREATURES)},
2508     {"blink trajectory",        "blinks",                       "can blink",                                0,      NULL,           &white,             BE_BLINKING,    5,              0,          0,          0,                          (BF_HALTS_BEFORE_OBSTRUCTION)},
2509     {"entrancement ray",        "casts entrancement",           "can cast entrancement",                    0,      NULL,           &yellow,            BE_ENTRANCEMENT,10,             0,          0,          MONST_INANIMATE,            (BF_TARGET_ENEMIES)},
2510     {"obstruction magic",       "casts obstruction",            "can cast obstruction",                     0,      NULL,           &forceFieldColor,   BE_OBSTRUCTION, 10,             0,          0,          0,                          (BF_HALTS_BEFORE_OBSTRUCTION)},
2511     {"spell of discord",        "casts a spell of discord",     "can cast discord",                         0,      NULL,           &discordColor,      BE_DISCORD,     10,             0,          0,          MONST_INANIMATE,            (BF_TARGET_ENEMIES)},
2512     {"conjuration magic",       "casts a conjuration bolt",     "can cast conjuration",                     0,      NULL,           &spectralBladeColor, BE_CONJURATION,10,             0,          0,          MONST_IMMUNE_TO_WEAPONS,    (BF_HALTS_BEFORE_OBSTRUCTION | BF_TARGET_ENEMIES)},
2513     {"healing magic",           "casts healing",                "can heal $HISHER allies",                  0,      NULL,           &darkRed,           BE_HEALING,     5,              0,          0,          0,                          (BF_TARGET_ALLIES)},
2514     {"haste spell",             "casts a haste spell",          "can haste $HISHER allies",                 0,      NULL,           &orange,            BE_HASTE,       2,              0,          0,          MONST_INANIMATE,            (BF_TARGET_ALLIES)},
2515     {"slowing spell",           "casts a slowing spell",        "can slow $HISHER enemies",                 0,      NULL,           &green,             BE_SLOW,        2,              0,          0,          MONST_INANIMATE,            (BF_TARGET_ENEMIES)},
2516     {"protection magic",        "casts protection",             "can cast protection",                      0,      NULL,           &shieldingColor,    BE_SHIELDING,   5,              0,          0,          MONST_INANIMATE,            (BF_TARGET_ALLIES)},
2517     {"spiderweb",               "launches a sticky web",        "can launch sticky webs",                   '*',    &white,         NULL,               BE_NONE,        10,             DF_WEB_SMALL, DF_WEB_LARGE, (MONST_IMMOBILE | MONST_IMMUNE_TO_WEBS),   (BF_TARGET_ENEMIES | BF_NEVER_REFLECTS | BF_NOT_LEARNABLE)},
2518     {"spark",                   "shoots a spark",               "can throw sparks of lightning",            0,      NULL,           &lightningColor,    BE_DAMAGE,      1,              0,          0,          0,                          (BF_PASSES_THRU_CREATURES | BF_TARGET_ENEMIES | BF_ELECTRIC)},
2519     {"dragonfire",              "breathes a gout of white-hot flame", "can breathe gouts of white-hot flame", 0,    NULL,           &dragonFireColor,   BE_DAMAGE,      18,             DF_OBSIDIAN, 0,         MONST_IMMUNE_TO_FIRE,       (BF_TARGET_ENEMIES | BF_FIERY | BF_NOT_LEARNABLE)},
2520     {"arrow",                   "shoots an arrow",              "attacks from a distance",                  G_WEAPON,&gray,         NULL,               BE_ATTACK,      1,              0,          0,          MONST_IMMUNE_TO_WEAPONS,    (BF_TARGET_ENEMIES | BF_NEVER_REFLECTS | BF_NOT_LEARNABLE)},
2521     {"poisoned dart",           "fires a dart",                 "fires strength-sapping darts",             G_WEAPON,&centipedeColor,NULL,              BE_ATTACK,      1,              0,          0,          0,                          (BF_TARGET_ENEMIES | BF_NEVER_REFLECTS | BF_NOT_LEARNABLE)},
2522     {"growing vines",           "releases carnivorous vines into the ground", "conjures carnivorous vines", G_GRASS,&tanColor,      NULL,               BE_NONE,        5,              DF_ANCIENT_SPIRIT_GRASS, DF_ANCIENT_SPIRIT_VINES, (MONST_INANIMATE | MONST_IMMUNE_TO_WEBS),   (BF_TARGET_ENEMIES | BF_NEVER_REFLECTS)},
2523     {"whip",                    "whips",                        "wields a whip",                            '*',    &tanColor,      NULL,               BE_ATTACK,      1,              0,          0,          MONST_IMMUNE_TO_WEAPONS,    (BF_TARGET_ENEMIES | BF_NEVER_REFLECTS | BF_NOT_LEARNABLE | BF_DISPLAY_CHAR_ALONG_LENGTH)},
2524 };
2525 
2526 const feat featTable[FEAT_COUNT] = {
2527     {"Pure Mage",       "Ascend without using fists or a weapon.", true},
2528     {"Pure Warrior",    "Ascend without using a staff, wand or charm.", true},
2529     {"Pacifist",        "Ascend without attacking a creature.", true},
2530     {"Archivist",       "Ascend without drinking a potion or reading a scroll.", true},
2531     {"Companion",       "Journey with an ally through 20 depths.", false},
2532     {"Specialist",      "Enchant an item up to or above +16.", false},
2533     {"Jellymancer",     "Obtain at least 90 jelly allies simultaneously.", false},
2534     {"Indomitable",     "Ascend without taking damage.", true},
2535     {"Ascetic",         "Ascend without eating.", true},
2536     {"Dragonslayer",    "Kill a dragon with a melee attack.", false},
2537     {"Paladin",         "Ascend without attacking an unaware or fleeing creature.", true},
2538     {"Untempted",       "Ascend without picking up gold.", true},
2539 };
2540 
2541 const char monsterBehaviorFlagDescriptions[32][COLS] = {
2542     "is invisible",                             // MONST_INVISIBLE
2543     "is an inanimate object",                   // MONST_INANIMATE
2544     "cannot move",                              // MONST_IMMOBILE
2545     "",                                         // MONST_CARRY_ITEM_100
2546     "",                                         // MONST_CARRY_ITEM_25
2547     "",                                         // MONST_ALWAYS_HUNTING
2548     "flees at low health",                      // MONST_FLEES_NEAR_DEATH
2549     "",                                         // MONST_ATTACKABLE_THRU_WALLS
2550     "corrodes weapons when hit",                // MONST_DEFEND_DEGRADE_WEAPON
2551     "is immune to weapon damage",               // MONST_IMMUNE_TO_WEAPONS
2552     "flies",                                    // MONST_FLIES
2553     "moves erratically",                        // MONST_FLITS
2554     "is immune to fire",                        // MONST_IMMUNE_TO_FIRE
2555     "",                                         // MONST_CAST_SPELLS_SLOWLY
2556     "cannot be entangled",                      // MONST_IMMUNE_TO_WEBS
2557     "can reflect magic spells",                 // MONST_REFLECT_4
2558     "never sleeps",                             // MONST_NEVER_SLEEPS
2559     "burns unceasingly",                        // MONST_FIERY
2560     "is invulnerable",                          // MONST_INVULNERABLE
2561     "is at home in water",                      // MONST_IMMUNE_TO_WATER
2562     "cannot venture onto dry land",             // MONST_RESTRICTED_TO_LIQUID
2563     "submerges",                                // MONST_SUBMERGES
2564     "keeps $HISHER distance",                   // MONST_MAINTAINS_DISTANCE
2565     "",                                         // MONST_WILL_NOT_USE_STAIRS
2566     "is animated purely by magic",              // MONST_DIES_IF_NEGATED
2567     "",                                         // MONST_MALE
2568     "",                                         // MONST_FEMALE
2569     "",                                         // MONST_NOT_LISTED_IN_SIDEBAR
2570     "moves only when activated",                // MONST_GETS_TURN_ON_ACTIVATION
2571 };
2572 
2573 const char monsterAbilityFlagDescriptions[32][COLS] = {
2574     "can induce hallucinations",                // MA_HIT_HALLUCINATE
2575     "can steal items",                          // MA_HIT_STEAL_FLEE
2576     "lights enemies on fire when $HESHE hits",  // MA_HIT_BURN
2577     "can possess $HISHER summoned allies",      // MA_ENTER_SUMMONS
2578     "corrodes armor when $HESHE hits",          // MA_HIT_DEGRADE_ARMOR
2579     "can summon allies",                        // MA_CAST_SUMMON
2580     "immobilizes $HISHER prey",                 // MA_SEIZES
2581     "injects poison when $HESHE hits",          // MA_POISONS
2582     "",                                         // MA_DF_ON_DEATH
2583     "divides in two when struck",               // MA_CLONE_SELF_ON_DEFEND
2584     "dies when $HESHE attacks",                 // MA_KAMIKAZE
2585     "recovers health when $HESHE inflicts damage",// MA_TRANSFERENCE
2586     "saps strength when $HESHE inflicts damage",// MA_CAUSE_WEAKNESS
2587 
2588     "attacks up to two opponents in a line",    // MA_ATTACKS_PENETRATE
2589     "attacks all adjacent opponents at once",   // MA_ATTACKS_ALL_ADJACENT
2590     "attacks with a whip",                      // MA_ATTACKS_EXTEND
2591     "pushes opponents backward when $HESHE hits", // MA_ATTACKS_STAGGER
2592     "avoids attacking in corridors in a group", // MA_AVOID_CORRIDORS
2593 };
2594 
2595 const char monsterBookkeepingFlagDescriptions[32][COLS] = {
2596     "",                                         // MB_WAS_VISIBLE
2597     "is telepathically bonded with you",        // MB_TELEPATHICALLY_REVEALED
2598     "",                                         // MB_PREPLACED
2599     "",                                         // MB_APPROACHING_UPSTAIRS
2600     "",                                         // MB_APPROACHING_DOWNSTAIRS
2601     "",                                         // MB_APPROACHING_PIT
2602     "",                                         // MB_LEADER
2603     "",                                         // MB_FOLLOWER
2604     "",                                         // MB_CAPTIVE
2605     "has been immobilized",                     // MB_SEIZED
2606     "is currently holding $HISHER prey immobile",// MB_SEIZING
2607     "is submerged",                             // MB_SUBMERGED
2608     "",                                         // MB_JUST_SUMMONED
2609     "",                                         // MB_WILL_FLASH
2610     "is anchored to reality by $HISHER summoner",// MB_BOUND_TO_LEADER
2611     "is marked for demonic sacrifice",          // MB_MARKED_FOR_SACRIFICE
2612 };
2613