Go to the documentation of this file.
37 fprintf(stderr,
"Reading parameters from stdin...\n");
40 memset(&rp, 0,
sizeof(
RMParms));
63 for (j = 0; j < height; ++j) {
64 for (i = 0; i < width; ++i) {
66 display_char =
layout[i][j];
68 switch (display_char) {
77 putchar(display_char);
113 static void test_layout(
int width,
int height,
char **(*layout_func)(
int,
int,
int,
int)) {
118 if (layout_func == NULL)
121 layout = layout_func(width, height, 0, 0);
129 fprintf(stderr,
"Type 'random_map -h' for usage instructions.\n");
135 "Usage: random_map [options]\n"
138 " -h display this help message\n"
139 " -g <file> randomly generate the specified map file\n"
140 " -l <layout> layout to use. See Layouts for valid layouts.\n"
141 " (overridden by -g)\n"
142 " -t test map layout (overriden by -g)\n"
143 " -x <width> specify map width\n"
144 " -y <height> specify map height\n"
147 " rogue -- roguelike map generator\n"
148 " snake -- snake map generator\n"
149 " sspiral -- square spiral map generator\n"
150 " spiral -- spiral map generator\n"
151 " maze -- maze map generator\n"
152 " onion -- onion map generator\n"
156 int main(
int argc,
char *argv[]) {
157 int flag, mode = 0, width = 80, height = 23;
158 char *filename_out=NULL;
164 while ((flag = getopt(argc, argv,
"g:hl:tx:y:")) != -1) {
168 filename_out = optarg;
185 width = atoi(optarg);
188 height = atoi(optarg);
200 }
else if (mode == 2) {
242 while ((
op->stats.hp--) > 0) {
269 while ((
tmp->stats.hp--) > 0) {
276 &&
tmp->randomitems) {
279 while ((
tmp->stats.hp--) > 0) {
309 uint8_t subtype,
const char *
message) {
319 uint8_t subtype,
const char *format, ...) {
328 va_start(ap, format);
340 fprintf(
logfile,
"ext_info_map: %s\n", str1);
char ** map_gen_onion(int xsize, int ysize, int option, int layers)
#define HAS_RANDOM_ITEMS(op)
#define SAVE_MODE_INPLACE
char **(* func)(int, int, int, int)
int apply_auto(object *op)
char ** roguelike_layout_gen(int xsize, int ysize, int options, int _unused_layers)
#define QUERY_FLAG(xyz, p)
static void print_usage(void)
char ** make_square_spiral_layout(int xsize, int ysize, int _unused_options, int _unused_layers)
char ** maze_gen(int xsize, int ysize, int option, int _unused_layers)
static const flag_definition flags[]
mapstruct * generate_random_map(const char *OutFileName, RMParms *RP, char **use_layout, sstring reset_group)
static void test_layout(int width, int height, char **(*layout_func)(int, int, int, int))
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 esrv_update_spells(player *pl)
void set_map_timeout(mapstruct *oldmap)
void set_darkness_map(mapstruct *m)
void esrv_del_item(player *pl, object *ob)
static event_registration m
void object_free_drop_inventory(object *ob)
int load_parameters(FILE *fp, int bufstate, RMParms *RP)
void ext_info_map(int color, const mapstruct *map, uint8_t type, uint8_t subtype, const char *str1)
static layout layout_list[NROFLAYOUTS]
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)
void rod_adjust(object *rod)
void move_firewall(object *ob)
void apply_auto_fix(mapstruct *m)
void emergency_save(int x)
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
void esrv_update_item(int flags, object *pl, object *op)
void esrv_send_item(object *ob, object *obx)
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
void dragon_ability_gain(object *ob, int x, int y)
static void print_map(char **layout, int width, int height)
object * find_skill_by_number(object *who, int skillno)
int main(int argc, char *argv[])
#define CLEAR_FLAG(xyz, p)
char ** make_snake_layout(int xsize, int ysize, int _unused_options, int _unused_layers)
void object_remove(object *op)
void clean_tmp_files(void)
object * generate_treasure(treasurelist *t, int difficulty)
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
int save_map(mapstruct *m, int flag)
static void generate_map(char *OutFileName)
static void print_quickhelp(void)
object * identify(object *op)