Crossfire Server, Trunk
|
#include "global.h"
#include "compat.h"
#include "string.h"
#include "malloc.h"
#include <string>
#include <map>
#include <vector>
#include "sproto.h"
#include "assets.h"
#include "AssetsManager.h"
#include "Archetypes.h"
Go to the source code of this file.
Functions | |
void | dump_races (void) |
void | finish_races () |
void | free_races (void) |
void | load_races (BufferReader *reader, const char *) |
object * | races_get_random_monster (const char *race, int level) |
Variables | |
std::map< std::string, std::vector< std::string > > | addToRace |
std::map< std::string, std::vector< object * > > | races |
void dump_races | ( | void | ) |
Dumps all race information to stderr.
Definition at line 83 of file races.cpp.
Referenced by init_beforeplay().
void finish_races | ( | ) |
Definition at line 100 of file races.cpp.
References addToRace, AssetsManager::archetypes(), AssetsCollection< T, Key >::find(), FLAG_MONSTER, getManager(), llevError, LOG(), mon, give::name, QUERY_FLAG, and races.
Referenced by init_beforeplay().
void free_races | ( | void | ) |
void load_races | ( | BufferReader * | reader, |
const char * | |||
) |
Reads the races file in the lib/ directory, then overwrites old 'race' entries. This routine allow us to quickly re-configure the 'alignment' of monsters, objects. Useful for putting together lists of creatures, etc that belong to gods.
Definition at line 49 of file races.cpp.
References addToRace, buf, bufferreader_next_line(), llevDebug, LOG(), and MAX_BUF.
Referenced by add_server_collect_hooks().
object* races_get_random_monster | ( | const char * | race, |
int | level | ||
) |
Get a random monster of specified race and level at most the specified one.
race | race, must not be NULL. If invalid, then logs as an error. |
level | maximum number, included. |
Definition at line 24 of file races.cpp.
References llevError, LOG(), ring_occidental_mages::r, races, and rndm().
Referenced by choose_cult_monster().
std::map<std::string, std::vector<std::string> > addToRace |
Definition at line 15 of file races.cpp.
Referenced by finish_races(), and load_races().
std::map<std::string, std::vector<object *> > races |
Definition at line 16 of file races.cpp.
Referenced by dump_races(), finish_races(), free_races(), and races_get_random_monster().