Grate traps are used to make a wall appear behind the player when stepping on a grate. Each grate trap is associated with an unlocker button which is always located in a dead end. The generator starts by finding a random dead end.
The grateStarting from the dead end, the generator uses the root directions to go back a random number of cells between 8 and 15 times. While it's going back, it makes sure that each cell is free of puzzle blocking artifact because we don't want a puzzle to prevent us from reaching the unlocker.When the location is reached, the position is saved and the generator goes back 1 more cell to see if we can make a wall appear at this location. If the cell is not a standard floor (ie. random floor, open floor or dark area), the generator will cancel the saved position of the grate and try to move it 1 cell back until it has reached a good spot. If the cell is a puzzle artifact, the attempt is aborted. Once a valid spot is found for the unlocker, grate and appearing wall, the map is modified. A maximum of 16 traps can be created.
Here, the three grate traps and their related unlockers are highlighted in yellow so you can better see them (map is getting crowded, isn't it!) |