diff options
author | Samuel Bronson <naesten@gmail.com> | 2011-12-02 18:26:24 -0500 |
---|---|---|
committer | Samuel Bronson <naesten@gmail.com> | 2011-12-02 18:26:24 -0500 |
commit | a1df1363570653bc89bc6d5362a414b734f89bea (patch) | |
tree | 3d2fdbd9d293b9eba9212703e5a52684d3653c5b /crawl-ref/source/mon-grow.cc | |
parent | 1727034c4f490bf4d3ac94a994339e129678153c (diff) | |
download | crawl-ref-a1df1363570653bc89bc6d5362a414b734f89bea.tar.gz crawl-ref-a1df1363570653bc89bc6d5362a414b734f89bea.zip |
Implement CMD_TARGET_WIZARD_GAIN_LEVEL.
This required adding a parameter to monster::gain_exp specifying the
maximum number of levels to be gained.
Diffstat (limited to 'crawl-ref/source/mon-grow.cc')
-rw-r--r-- | crawl-ref/source/mon-grow.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crawl-ref/source/mon-grow.cc b/crawl-ref/source/mon-grow.cc index 2a03e86237..4ed92722fe 100644 --- a/crawl-ref/source/mon-grow.cc +++ b/crawl-ref/source/mon-grow.cc @@ -199,7 +199,7 @@ void monster::init_experience() experience = mexplevs[std::min(hit_dice, MAX_MONS_HD)]; } -bool monster::gain_exp(int exp) +bool monster::gain_exp(int exp, int max_levels_to_gain) { if (!alive()) return (false); @@ -224,11 +224,11 @@ bool monster::gain_exp(int exp) const monster mcopy(*this); int levels_gained = 0; - // Monsters can gain a maximum of two levels from one kill. + // Monsters can normally gain a maximum of two levels from one kill. while (hit_dice < MAX_MONS_HD && experience >= mexplevs[hit_dice + 1] && level_up() - && ++levels_gained < 2); + && ++levels_gained < max_levels_to_gain); if (levels_gained) { |