diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-23 01:32:57 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-23 01:32:57 +0000 |
commit | 70b49eb0667159b6a079e8decd5dc37ddfcef60f (patch) | |
tree | 1d7803404eebb41c7dd5d0abee6a2e071c5b782c /crawl-ref/source/mgrow.cc | |
parent | 6da9dc107ac5c8eac196c44d61105d1e412c9761 (diff) | |
download | crawl-ref-70b49eb0667159b6a079e8decd5dc37ddfcef60f.tar.gz crawl-ref-70b49eb0667159b6a079e8decd5dc37ddfcef60f.zip |
Expand bless_follower() to allow explicitly picking the follower as well
as picking one randomly, fix a potential problem with the display of the
blessing message, and add a piety-dependent chance that followers will
be specifically blessed when gaining levels.
Hook the last of these up to Beogh for now (since the random chance on
piety gain occurs less and less often as piety goes up). TSO should
also get this eventually.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3821 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mgrow.cc')
-rw-r--r-- | crawl-ref/source/mgrow.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/crawl-ref/source/mgrow.cc b/crawl-ref/source/mgrow.cc index 57b3edc0cf..aacacfe3d1 100644 --- a/crawl-ref/source/mgrow.cc +++ b/crawl-ref/source/mgrow.cc @@ -181,22 +181,22 @@ void monsters::init_experience() experience = mexplevs[std::min(hit_dice, MAX_MONS_HD)]; } -void monsters::gain_exp(int exp) +bool monsters::gain_exp(int exp) { if (!alive()) - return; + return false; init_experience(); if (hit_dice >= MAX_MONS_HD) - return; + return false; // Only natural monsters can level-up. if (holiness() != MH_NATURAL) - return; - + return false; + // Avoid wrap-around. if (experience + exp < experience) - return; + return false; experience += exp; @@ -218,4 +218,6 @@ void monsters::gain_exp(int exp) if (hit_dice < MAX_MONS_HD && experience >= mexplevs[hit_dice + 1]) experience = (mexplevs[hit_dice] + mexplevs[hit_dice + 1]) / 2; + + return (levels_gained > 0); } |