Changeset 566
- Timestamp:
- 09/17/07 07:47:35 (1 year ago)
- Files:
-
- trunk/src/generate.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/generate.c
r557 r566 25 25 26 26 27 28 /*29 * Level generation is not an important bottleneck, though it can be30 * annoyingly slow on older machines... Thus we emphasize simplicity31 * and correctness over speed. See individual functions for notes.32 *33 * This entire file is only needed for generating levels.34 * This may allow smart compilers to only load it when needed.35 *36 * The "vault.txt" file is used to store vault generation info.37 */38 39 40 27 /* 41 28 * Dungeon generation values 42 29 */ 43 #define DUN_ROOMS 30 /* Number of rooms to attempt */ 30 #define DUN_ROOMS_MIN 10 31 #define DUN_ROOMS_MAX 30 32 33 34 44 35 #define DEST_LEVEL_CHANCE 30 /* 1/chance of being a destroyed level */ 45 36 … … 101 92 * These bounds are checked, though usually this is a formality. 102 93 */ 103 #define CENT_MAX DUN_ROOMS 94 #define CENT_MAX DUN_ROOMS_MAX 104 95 #define DOOR_MAX 100 105 96 #define WALL_MAX 40 … … 3225 3216 3226 3217 /* No special limit on ordinary rooms. */ 3227 if (room_type == 1) return (DUN_ROOMS );3218 if (room_type == 1) return (DUN_ROOMS_MAX); 3228 3219 3229 3220 … … 3253 3244 num_tries = 3 * base_num / 100; 3254 3245 if (num_tries < 2) num_tries = (base_num < 12 ? 1 : 2); 3255 if (num_tries > DUN_ROOMS / 2) num_tries = DUN_ROOMS/ 2;3246 if (num_tries > DUN_ROOMS_MAX / 2) num_tries = DUN_ROOMS_MAX / 2; 3256 3247 3257 3248 … … 4511 4502 int rooms_built = 0; 4512 4503 4504 int max_rooms = rand_range(DUN_ROOMS_MIN, DUN_ROOMS_MAX); 4505 4513 4506 /* Build rooms in descending order of difficulty. */ 4514 4507 byte room_build_order[ROOM_MAX] = {7, 6, 5, 4, 3, 2, 1, 0}; … … 4593 4586 { 4594 4587 /* Stop building rooms when we hit the maximum. */ 4595 if (rooms_built >= DUN_ROOMS) break;4588 if (rooms_built >= max_rooms) break; 4596 4589 4597 4590 /* Build the room. */
