/* * CrossFire, A Multiplayer game for X-windows * * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team * Copyright (C) 2001 Mark Wedel & Crossfire Development Team * Copyright (C) 1992 Frank Tore Johansen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * The authors can be reached via e-mail at crossfire@schmorp.de */ #ifndef RANDOM_MAP_H #define RANDOM_MAP_H struct random_map_params { char wallstyle[512]; char wall_name[512]; char floorstyle[512]; char monsterstyle[512]; char treasurestyle[512]; char layoutstyle[512]; char doorstyle[512]; char decorstyle[512]; shstr origin_map; shstr final_map; char exitstyle[512]; shstr this_map; char exit_on_final_map[512]; char *custom; int xsize, ysize; int expand2x; int layoutoptions1; int layoutoptions2; int layoutoptions3; int symmetry; int difficulty; int difficulty_given; float difficulty_increase; int dungeon_level; int dungeon_depth; int decoroptions; int orientation; int origin_y; int origin_x; int random_seed; uint64_t total_map_hp; int map_layout_style; int treasureoptions; int symmetry_used; struct region *region; // "private", adjusted sizes int Xsize; int Ysize; }; enum { LAYOUT_NONE, LAYOUT_ONION, LAYOUT_MAZE, LAYOUT_SPIRAL, LAYOUT_ROGUELIKE, LAYOUT_SNAKE, LAYOUT_SQUARE_SPIRAL, NROFLAYOUTS, }; /* * Move these defines out of room_gen_onion.c to here, as * other files (like square_spiral) also uses them. options: 0 Pick random options below 1 "centered" 2 linear doors (default is nonlinear) 4 bottom "centered" 8 bottom-right centered 16 irregularly/randomly spaced layers (default: regular) 32 outer wall off: i.e., no outer wall. */ enum { RMOPT_RANDOM = 0, RMOPT_CENTERED = 1, RMOPT_LINEAR = 2, RMOPT_BOTTOM_C = 4, RMOPT_BOTTOM_R = 8, RMOPT_IRR_SPACE = 16, RMOPT_WALL_OFF = 32, RMOPT_WALLS_ONLY = 64, RMOPT_NO_DOORS = 256, /* Place walls insead of doors. Produces broken map. */ }; /* symmetry definitions--used in this file AND in treasure.c: the numerical values matter so don't change them. */ enum { SYMMETRY_RANDOM, SYMMETRY_NONE, SYMMETRY_X, SYMMETRY_Y, SYMMETRY_XY, }; #define MIN_RANDOM_MAP_SIZE 10 /* a macro to get a strongly centered random distribution, from 0 to x, centered at x/2 */ #define BC_RANDOM(x) ((int) ((RANDOM() % (x)+RANDOM()%(x)+RANDOM()%(x))/3.)) #endif