Go to the documentation of this file.
38 fprintf(stderr,
"Reading parameters from stdin...\n");
41 memset(&rp, 0,
sizeof(
RMParms));
64 for (j = 0; j < height; ++j) {
65 for (i = 0; i < width; ++i) {
67 display_char =
layout[i][j];
69 switch (display_char) {
78 putchar(display_char);
114 static void test_layout(
int width,
int height,
char **(*layout_func)(
int,
int,
int,
int)) {
119 if (layout_func == NULL)
122 layout = layout_func(width, height, 0, 0);
130 fprintf(stderr,
"Type 'random_map -h' for usage instructions.\n");
136 "Usage: random_map [options]\n"
139 " -h display this help message\n"
140 " -g <file> randomly generate the specified map file\n"
141 " -l <layout> layout to use. See Layouts for valid layouts.\n"
142 " (overridden by -g)\n"
143 " -t test map layout (overriden by -g)\n"
144 " -x <width> specify map width\n"
145 " -y <height> specify map height\n"
148 " rogue -- roguelike map generator\n"
149 " snake -- snake map generator\n"
150 " sspiral -- square spiral map generator\n"
151 " spiral -- spiral map generator\n"
152 " maze -- maze map generator\n"
153 " onion -- onion map generator\n"
157 int main(
int argc,
char *argv[]) {
158 int flag, mode = 0, width = 80, height = 23;
159 char *filename_out=NULL;
165 while ((flag = getopt(argc, argv,
"g:hl:tx:y:")) != -1) {
169 filename_out = optarg;
186 width = atoi(optarg);
189 height = atoi(optarg);
201 }
else if (mode == 2) {
243 while ((
op->stats.hp--) > 0) {
270 while ((
tmp->stats.hp--) > 0) {
277 &&
tmp->randomitems) {
280 while ((
tmp->stats.hp--) > 0) {
310 uint8_t subtype,
const char *
message) {
320 uint8_t subtype,
const char *format, ...) {
329 va_start(ap, format);
341 fprintf(
logfile,
"ext_info_map: %s\n", str1);
char ** map_gen_onion(int xsize, int ysize, int option, int layers)
void move_firewall(object *ob)
#define HAS_RANDOM_ITEMS(op)
#define SAVE_MODE_INPLACE
char **(* func)(int, int, int, int)
void dragon_ability_gain(object *ob, int x, int y)
void emergency_save(int x)
static void print_map(char **layout, int width, int height)
void object_remove(object *op)
char ** roguelike_layout_gen(int xsize, int ysize, int options, int _unused_layers)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)
static void generate_map(char *OutFileName)
#define QUERY_FLAG(xyz, p)
static void test_layout(int width, int height, char **(*layout_func)(int, int, int, int))
void esrv_send_item(object *ob, object *obx)
static void print_usage(void)
char ** make_square_spiral_layout(int xsize, int ysize, int _unused_options, int _unused_layers)
void set_map_timeout(mapstruct *oldmap)
static layout layout_list[NROFLAYOUTS]
char ** maze_gen(int xsize, int ysize, int option, int _unused_layers)
mapstruct * generate_random_map(const char *OutFileName, RMParms *RP, char **use_layout, sstring reset_group)
static const flag_definition flags[]
static void print_quickhelp(void)
void create_treasure(treasurelist *t, object *op, int flag, int difficulty, int tries)
char ** map_gen_spiral(int xsize, int ysize, int option, int _unused_layers)
void apply_auto_fix(mapstruct *m)
void set_darkness_map(mapstruct *m)
void rod_adjust(object *rod)
object * identify(object *op)
static event_registration m
int load_parameters(FILE *fp, int bufstate, RMParms *RP)
void esrv_update_item(int flags, object *pl, object *op)
void ext_info_map(int color, const mapstruct *map, uint8_t type, uint8_t subtype, const char *str1)
int save_map(mapstruct *m, int flag)
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
void esrv_del_item(player *pl, object *ob)
int apply_auto(object *op)
void esrv_update_spells(player *pl)
#define CLEAR_FLAG(xyz, p)
char ** make_snake_layout(int xsize, int ysize, int _unused_options, int _unused_layers)
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
void object_free_drop_inventory(object *ob)
void clean_tmp_files(void)
object * generate_treasure(treasurelist *t, int difficulty)
object * find_skill_by_number(object *who, int skillno)
int main(int argc, char *argv[])