00001 /* 00002 * File: mon-grow.cc 00003 * Summary: Monster level-up code. 00004 * Written by: dshaligram on Fri Oct 26 08:33:37 2007 UTC 00005 */ 00006 00007 #ifndef __MGROW_H__ 00008 #define __MGROW_H__ 00009 00010 #include "fixedvector.h" 00011 00012 // Monster level-up data. 00013 00014 struct monster_level_up 00015 { 00016 monster_type before, after; 00017 int chance; // Chance in 1000 of the monster growing up, 00018 // defaults to 1000. 00019 00020 bool adjust_hp; // If hp post growing up is less than minimum, adjust it. 00021 00022 monster_level_up(monster_type _before, monster_type _after, 00023 int _chance = 1000, bool _adjust = true) 00024 : before(_before), after(_after), chance(_chance), adjust_hp(_adjust) 00025 { 00026 } 00027 }; 00028 00029 const int MAX_MONS_HD = 27; 00030 class mons_experience_levels 00031 { 00032 public: 00033 mons_experience_levels(); 00034 unsigned operator [] (int xl) const 00035 { 00036 return mexp[xl]; 00037 } 00038 private: 00039 FixedVector<unsigned, MAX_MONS_HD + 1> mexp; 00040 }; 00041 00042 #endif