 |
Crossfire Server, Trunk
1.75.0
|
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) {
#define INS_NO_WALK_ON
Don't call check_walk_on against the originator.
archetype * more
Next part of a linked object.
void place_monsters(mapstruct *map, char *monsterstyle, int difficulty, RMParms *RP)
Place some monsters into the map.
struct archetype * arch
Pointer to archetype.
int object_find_first_free_spot(const object *ob, mapstruct *m, int x, int y)
object_find_first_free_spot(archetype, mapstruct, x, y) works like object_find_free_spot(),...
mapstruct * find_style(const char *dirname, const char *stylename, int difficulty)
Loads and returns the map requested.
void object_copy_with_inv(const object *src_ob, object *dest_ob, bool update_speed)
Copy an object with an inventory, duplicate the inv too.
int rndm(int min, int max)
Returns a number between min and max.
short freearr_y[SIZEOFFREE]
Y offset when searching around a spot.
#define INS_NO_MERGE
Don't try to merge with other items.
object * object_create_arch(archetype *at)
Create a full object using the given archetype.
int64_t level_exp(int level, double expmul)
Returns how much experience is needed for a player to become the given level.
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
Same as object_insert_in_map() except it handle separate coordinates and do a clean job preparing mul...
#define MAP_WIDTH(m)
Map width.
long unsigned int total_map_hp
Total hit points of the monsters in the map, used for treasure generation.
object * pick_random_object(mapstruct *style)
Picks a random object from a style map.
#define MAP_HEIGHT(m)
Map height.
living stats
Str, Con, Dex, etc.
short freearr_x[SIZEOFFREE]
X offset when searching around a spot.
void generate_artifact(object *op, int difficulty)
Decides randomly which artifact the object should be turned into.