summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-grow.h
blob: 0f60bff7223924f8ff8406d2a5ea441f230bb4b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 *  File:       mon-grow.cc
 *  Summary:    Monster level-up code.
 *  Written by: dshaligram on Fri Oct 26 08:33:37 2007 UTC
 */

#ifndef __MGROW_H__
#define __MGROW_H__

#include "fixedvector.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