Go to the documentation of this file.
41 int failed_placements;
42 int64_t exp_per_sq, total_experience;
43 int number_monsters = 0;
46 const char *styledirname =
"/styles/monsterstyles";
47 style_map =
find_style(styledirname, monsterstyle, difficulty);
48 if (style_map == NULL) {
55 failed_placements = 0;
57 while (exp_per_sq <=
level_exp(difficulty, 1.0)
58 && failed_placements < 100
59 && number_monsters < (RP->
Xsize*RP->
Ysize)/8) {
63 if (this_monster == NULL) {
69 if (freeindex != -1) {
79 total_experience += this_monster->
stats.
exp;
80 for (at = new_monster->
arch; at != NULL; at = at->
more) {
void place_monsters(mapstruct *map, char *monsterstyle, int difficulty, RMParms *RP)
int object_find_first_free_spot(const object *ob, mapstruct *m, int x, int y)
mapstruct * find_style(const char *dirname, const char *stylename, int difficulty)
void object_copy_with_inv(const object *src_ob, object *dest_ob, bool update_speed)
int rndm(int min, int max)
short freearr_y[SIZEOFFREE]
object * object_create_arch(archetype *at)
int64_t level_exp(int level, double expmul)
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
long unsigned int total_map_hp
object * pick_random_object(mapstruct *style)
short freearr_x[SIZEOFFREE]
void generate_artifact(object *op, int difficulty)