Crossfire Server, Branches 1.12  R18729
monster.c File Reference
#include <global.h>
#include <random_map.h>
#include <rproto.h>
+ Include dependency graph for monster.c:

Go to the source code of this file.

Functions

void insert_multisquare_ob_in_map (object *new_obj, mapstruct *map)
 
void place_monsters (mapstruct *map, char *monsterstyle, int difficulty, RMParms *RP)
 

Detailed Description

Monster placement for random maps.

Definition in file monster.c.

Function Documentation

void insert_multisquare_ob_in_map ( object new_obj,
mapstruct map 
)

Inserts a monster in the map. Some monsters are multisquare, and these guys require special handling.

Parameters
new_objmonster to insert. Its x and y fields must be the desired location.
mapwhere to insert to.
Todo:
there probably is a function in the common library for that, so remove this one.

Definition at line 49 of file monster.c.

References obj::arch, arch_to_object(), archt::clone, obj::head, INS_NO_MERGE, INS_NO_WALK_ON, insert_ob_in_map(), obj::map, obj::more, archt::more, obj::x, and obj::y.

Referenced by include_map_in_map(), and place_monsters().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void place_monsters ( mapstruct map,
char *  monsterstyle,
int  difficulty,
RMParms RP 
)

Place some monsters into the map. Their experience is linked to difficulty to insert a suitable number of critters.

Parameters
mapwhere to put monsters on.
monsterstylestyle. Can be NULL, in which case a random one is used.
difficultyhow difficult the monsters should be, and how many there should be.
RPrandom map parameters.

Definition at line 89 of file monster.c.

References obj::arch, arch_to_object(), copy_object_with_inv(), liv::exp, find_first_free_spot(), find_style(), freearr_x, freearr_y, liv::hp, insert_multisquare_ob_in_map(), level_exp(), MAP_HEIGHT, MAP_WIDTH, archt::more, pick_random_object(), snprintf(), obj::stats, RMParms::total_map_hp, obj::x, RMParms::Xsize, obj::y, and RMParms::Ysize.

Referenced by generate_random_map().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: