--- deliantra/server/random_maps/monster.C 2006/08/13 17:16:03 1.1 +++ deliantra/server/random_maps/monster.C 2006/08/29 08:01:36 1.2 @@ -1,6 +1,6 @@ /* * static char *rcsid_monster_c = - * "$Id: monster.C,v 1.1 2006/08/13 17:16:03 elmex Exp $"; + * "$Id: monster.C,v 1.2 2006/08/29 08:01:36 root Exp $"; */ /* @@ -31,7 +31,7 @@ #include /* some monsters are multisquare, and these guys require special - handling. */ + handling. */ void insert_multisquare_ob_in_map(object *new_obj,mapstruct *map) { int x,y; @@ -60,7 +60,7 @@ } - + /* place some monsters into the map. */ void place_monsters(mapstruct *map, char *monsterstyle, int difficulty,RMParms *RP) { @@ -81,7 +81,7 @@ failed_placements = 0; exp_per_sq = 0; while(exp_per_sq <= level_exp(difficulty,1.0) && failed_placements < 100 - && number_monsters < (RP->Xsize * RP->Ysize)/8) { + && number_monsters < (RP->Xsize * RP->Ysize)/8) { object *this_monster=pick_random_object(style_map); int x,y,freeindex; if(this_monster == NULL) return; /* no monster?? */ @@ -89,20 +89,20 @@ y = RANDOM() % RP->Ysize; freeindex = find_first_free_spot(this_monster,map,x,y); if(freeindex!=-1) { - object *new_monster = arch_to_object(this_monster->arch); - x += freearr_x[freeindex]; - y += freearr_y[freeindex]; - copy_object_with_inv(this_monster,new_monster); - new_monster->x = x; - new_monster->y = y; - insert_multisquare_ob_in_map(new_monster,map); - total_experience+= this_monster->stats.exp; - for(at = new_monster->arch; at != NULL; at = at->more) - number_monsters++; - RP->total_map_hp+=new_monster->stats.hp; /* a global count */ + object *new_monster = arch_to_object(this_monster->arch); + x += freearr_x[freeindex]; + y += freearr_y[freeindex]; + copy_object_with_inv(this_monster,new_monster); + new_monster->x = x; + new_monster->y = y; + insert_multisquare_ob_in_map(new_monster,map); + total_experience+= this_monster->stats.exp; + for(at = new_monster->arch; at != NULL; at = at->more) + number_monsters++; + RP->total_map_hp+=new_monster->stats.hp; /* a global count */ } else { - failed_placements++; + failed_placements++; } exp_per_sq=(sint64)(((double)1000*total_experience)/(MAP_WIDTH(map)*MAP_HEIGHT(map)+1)); }