… | |
… | |
68 | write_map_parameters_to_string (buf, RP); |
68 | write_map_parameters_to_string (buf, RP); |
69 | |
69 | |
70 | if (RP->difficulty == 0) |
70 | if (RP->difficulty == 0) |
71 | { |
71 | { |
72 | RP->difficulty = RP->dungeon_level; /* use this instead of a map difficulty */ |
72 | RP->difficulty = RP->dungeon_level; /* use this instead of a map difficulty */ |
|
|
73 | |
73 | if (RP->difficulty_increase > 0.001) |
74 | if (RP->difficulty_increase > 0.001) |
74 | { |
|
|
75 | RP->difficulty = (int) ((float) RP->dungeon_level * RP->difficulty_increase); |
75 | RP->difficulty = (int) ((float) RP->dungeon_level * RP->difficulty_increase); |
|
|
76 | |
76 | if (RP->difficulty < 1) |
77 | if (RP->difficulty < 1) |
77 | RP->difficulty = 1; |
78 | RP->difficulty = 1; |
78 | } |
|
|
79 | } |
79 | } |
80 | else |
80 | else |
81 | RP->difficulty_given = 1; |
81 | RP->difficulty_given = 1; |
82 | |
82 | |
83 | if (RP->Xsize < MIN_RANDOM_MAP_SIZE) |
83 | if (RP->Xsize < MIN_RANDOM_MAP_SIZE) |
84 | RP->Xsize = MIN_RANDOM_MAP_SIZE + RANDOM () % 25 + 5; |
84 | RP->Xsize = MIN_RANDOM_MAP_SIZE + RANDOM () % 25 + 5; |
|
|
85 | |
85 | if (RP->Ysize < MIN_RANDOM_MAP_SIZE) |
86 | if (RP->Ysize < MIN_RANDOM_MAP_SIZE) |
86 | RP->Ysize = MIN_RANDOM_MAP_SIZE + RANDOM () % 25 + 5; |
87 | RP->Ysize = MIN_RANDOM_MAP_SIZE + RANDOM () % 25 + 5; |
87 | |
88 | |
88 | if (RP->expand2x > 0) |
89 | if (RP->expand2x > 0) |
89 | { |
90 | { |
… | |
… | |
161 | |
162 | |
162 | theMap->msg = strdup_local (buf); |
163 | theMap->msg = strdup_local (buf); |
163 | |
164 | |
164 | return theMap; |
165 | return theMap; |
165 | } |
166 | } |
166 | |
|
|
167 | |
167 | |
168 | /* function selects the layout function and gives it whatever |
168 | /* function selects the layout function and gives it whatever |
169 | arguments it needs. */ |
169 | arguments it needs. */ |
170 | char ** |
170 | char ** |
171 | layoutgen (RMParms * RP) |
171 | layoutgen (RMParms * RP) |
… | |
… | |
990 | void |
990 | void |
991 | copy_object_with_inv (object *src_ob, object *dest_ob) |
991 | copy_object_with_inv (object *src_ob, object *dest_ob) |
992 | { |
992 | { |
993 | object *walk, *tmp; |
993 | object *walk, *tmp; |
994 | |
994 | |
995 | copy_object (src_ob, dest_ob); |
995 | src_ob->copy_to (dest_ob); |
996 | |
996 | |
997 | for (walk = src_ob->inv; walk != NULL; walk = walk->below) |
997 | for (walk = src_ob->inv; walk != NULL; walk = walk->below) |
998 | { |
998 | { |
999 | tmp = get_object (); |
999 | tmp = object::create (); |
1000 | copy_object (walk, tmp); |
1000 | walk->copy_to (tmp); |
1001 | insert_ob_in_ob (tmp, dest_ob); |
1001 | insert_ob_in_ob (tmp, dest_ob); |
1002 | } |
1002 | } |
1003 | } |
1003 | } |