diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-26 08:33:37 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-26 08:33:37 +0000 |
commit | 66f022fd710eeb3d62cdd6094e80ca231d3a1263 (patch) | |
tree | 6a7e15131a30fd7a51d91c29a04aac611674eae7 /crawl-ref/source/mgrow.h | |
parent | 57f4a1b1382e1c4204cd0991eb3f574420184b83 (diff) | |
download | crawl-ref-66f022fd710eeb3d62cdd6094e80ca231d3a1263.tar.gz crawl-ref-66f022fd710eeb3d62cdd6094e80ca231d3a1263.zip |
Monsters can gain experience and level-up. Breaks saves.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2584 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mgrow.h')
-rw-r--r-- | crawl-ref/source/mgrow.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/crawl-ref/source/mgrow.h b/crawl-ref/source/mgrow.h new file mode 100644 index 0000000000..ff558265d1 --- /dev/null +++ b/crawl-ref/source/mgrow.h @@ -0,0 +1,37 @@ +#ifndef __MGROW_H__ +#define __MGROW_H__ + +#include "AppHdr.h" +#include "FixVec.h" + +// Monster level-up data. + +struct monster_level_up +{ + monster_type before, after; + int chance; // Chance in 1000 of the monster growing up, + // defaults to 1000. + + bool adjust_hp; // If hp post growing up is less than minimum, adjust it. + + monster_level_up(monster_type _before, monster_type _after, + int _chance = 1000, bool _adjust = true) + : before(_before), after(_after), chance(_chance), adjust_hp(_adjust) + { + } +}; + +const int MAX_MONS_HD = 27; +class mons_experience_levels +{ +public: + mons_experience_levels(); + unsigned operator [] (int xl) const + { + return mexp[xl]; + } +private: + FixedVector<unsigned, MAX_MONS_HD + 1> mexp; +}; + +#endif |