Cupboard traps are used to make a wall disappear near the player to reveal an encounter. The encounter is always located in a dead end, so the generator starts by randomly finding a dead end.
The wallStarting from the dead end, the generator uses the root directions to go back 1 cell. If that cell is free and between two walls, the generator saves the position and goes to the next step. If not, it looks for another random dead end.The cupboardFrom the position of the wall, the generator goes back 1 more cell to place the cupboard trap. If that cell is next to at least 1 wall that can be modified, the generator is satisfied and applies the changes to the map.The rewardThe cupboard has a Zlot inside. The type of Zlot is randomly selected from a number between 1 and the current map number, up to 23. The health of the Zlot is also randomly selected between 0 and 63, and same goes for the quality between "Basic" and "Super".
Move the mouse pointer over the image to view the map before the change. It might be worth mentioning that encounters created for cupboard traps are slightly stronger than regular encounters. |