Roguelike
 All Classes Namespaces Functions Variables Typedefs Friends Pages
Functions
corruptible_pblind_db Namespace Reference

Functions

void corrupt_corners (vector< IntPoint > corners, db::dungeon_meta &dm)
 
void corrupt_walls (db::dungeon_meta &dm)
 
void build_dungeon (int width, int height, int target, ChunkLayer &cl)
 
void corrupt_corners (vector< IntPoint > corners)
 
void corrupt_walls ()
 

Detailed Description

CORRUPTIBLE PROCEDURALLY-BLIND DUNGEON GENERATION

This variant on a procedurally-blind dungeon has a more decayed look. Its walls are often caved in. This is achieved by passing over the created dungeon with an algorithm that modifies cells according to their surroundings and random chance.

Function Documentation

void corruptible_pblind_db::build_dungeon ( int  width,
int  height,
int  target,
ChunkLayer cl 
)

The primary entry point for dungeon building. Overrides the parent class's method of the same room, and adds a call to corrupt_walls().

Parameters
target- The target number of rooms to build.
cl- The ChunkLayer to work on
See also
corrupt_walls()
void corruptible_pblind_db::corrupt_corners ( vector< IntPoint corners)

Performs the following transformation to all given room corners, where percentages represent the chance that a certain transformation will occur. This function is called by corrupt_walls().

* O = empty
* X = wall
* . = room interior
* ? = anything
*
*   O O O   15%  O O O
*   O X X  --->  O O X
*   O X .        O X X
*     |
*     |     15%  O O O
*     \------->  O O X
*                O X .
* 
Parameters
corners- A vector of IntPoints representing room corners.
See also
corrupt_walls
void corruptible_pblind_db::corrupt_walls ( )

After a dungeon is built, will "corrupt" the dungeon walls according to the following rules:

* O = empty
* X = wall
* . = room interior
* ? = anything
*
*   O O O   15%  O O O
*   O X X  --->  O O X
*   O X .        O X X
*     |
*     |     15%  O O O
*     \------->  O O X
*                O X .
*
*   O O O   5%   O O O
*   X X X  --->  X O X
*   ? . ?        X X X
*     |
*     |     5%
*     |------->  O O O
*     |          X O X
*     |          . X .
*     |
*     |     5%
*     |------->  O O O
*     |          X O X
*     |          . X X
*     |
*     |     5%
*     \------->  O O O
*                X O X
*                X X .
*