![]() |
Crossfire Server, Trunk
1.75.0
|
Go to the source code of this file.
Functions | |
void | dump_experience (void) |
Dump the experience table, then calls exit() - useful in terms of debugging to make sure the format of the exp_table is correct. More... | |
void | free_experience (void) |
Frees experience-related memory. More... | |
int | has_ability (const object *ob) |
Checks whether object has innate abilities (spell/spellbook in inventory). More... | |
void | init_experience (void) |
This loads the experience table from the exp_table file. More... | |
int64_t | new_exp (const object *ob) |
Alternative way to calculate experience based on the ability of a monster. More... | |
Variables | |
static const float | exp_att_mult [NROFATTACKS] |
static const float | exp_prot_mult [NROFATTACKS] |
int64_t * | levels |
Number of levels for which we have experience. More... | |
Experience management. reading data from files and such.
Definition in file exp.cpp.
void dump_experience | ( | void | ) |
void free_experience | ( | void | ) |
Frees experience-related memory.
Definition at line 263 of file exp.cpp.
References FREE_AND_CLEAR, and levels.
Referenced by free_globals().
int has_ability | ( | const object * | ob | ) |
Checks whether object has innate abilities (spell/spellbook in inventory).
Definition at line 153 of file exp.cpp.
References object_find_by_type(), SPELL, and SPELLBOOK.
Referenced by new_exp().
void init_experience | ( | void | ) |
This loads the experience table from the exp_table file.
This tends to exit on any errors, since it populates the table as it goes along, so if there are errors, the table is likely in an inconsistent state.
Definition at line 167 of file exp.cpp.
References buf, Settings::confdir, fatal(), FMT64, levels, llevDebug, llevError, LOG(), MAX_BUF, Settings::max_level, SEE_LAST_ERROR, and settings.
Referenced by init_library().
int64_t new_exp | ( | const object * | ob | ) |
Alternative way to calculate experience based on the ability of a monster.
It's far from perfect, and doesn't consider everything which can be considered, thus it's only used in debugging. this is only used with one of the dumpflags, and not anyplace in the code.
ob | object for which to return experience |
Definition at line 100 of file exp.cpp.
References living::ac, object::attacktype, living::Con, living::dam, exp_att_mult, exp_prot_mult, FABS, FALSE, FLAG_CAST_SPELL, FLAG_HITBACK, FLAG_NO_MAGIC, FLAG_REFL_MISSILE, FLAG_REFL_SPELL, FLAG_SEE_INVISIBLE, FLAG_SPLITTING, FLAG_STAND_STILL, FLAG_USE_BOW, FLAG_USE_RANGE, FLAG_USE_SCROLL, has_ability(), MAX, living::maxhp, living::maxsp, MIN, NROFATTACKS, QUERY_FLAG, object::resist, object::speed, object::stats, and living::wc.
Referenced by print_monsters().
|
static |
|
static |
int64_t* levels |
Number of levels for which we have experience.
Definition at line 26 of file exp.cpp.
Referenced by dump_experience(), free_experience(), init_experience(), perceive_self(), and send_exp_table().