summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ghost.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-07 11:58:54 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-07 11:58:54 +0000
commit167ae03b160a0ccadd7934b2bfe557d491f1cb1f (patch)
treec1ee0ef626b416c5eee0f62082da72cb9f4137c3 /crawl-ref/source/ghost.cc
parent33dc7cedd5a65d3bd1ce8eff9006e4517a3390dd (diff)
downloadcrawl-ref-167ae03b160a0ccadd7934b2bfe557d491f1cb1f.tar.gz
crawl-ref-167ae03b160a0ccadd7934b2bfe557d491f1cb1f.zip
Another clean up, and add some new weapon speech.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6439 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/ghost.cc')
-rw-r--r--crawl-ref/source/ghost.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/crawl-ref/source/ghost.cc b/crawl-ref/source/ghost.cc
index b4f2788ab7..728489b8f2 100644
--- a/crawl-ref/source/ghost.cc
+++ b/crawl-ref/source/ghost.cc
@@ -533,6 +533,7 @@ void ghost_demon::find_extra_ghosts( std::vector<ghost_demon> &gs, int n )
find_transiting_ghosts(gs, n);
}
+// Returns the number of extra ghosts allowed on the level.
int ghost_demon::n_extra_ghosts()
{
const int lev = you.your_level + 1;
@@ -554,15 +555,19 @@ int ghost_demon::n_extra_ghosts()
return (0);
// No multiple ghosts until level 9 of the main dungeon.
- if ((lev < 9 && you.where_are_you == BRANCH_MAIN_DUNGEON)
- || (subdepth < 2 && you.where_are_you == BRANCH_LAIR)
- || (subdepth < 2 && you.where_are_you == BRANCH_ORCISH_MINES))
+ if (lev < 9 && you.where_are_you == BRANCH_MAIN_DUNGEON
+ || subdepth < 2 && you.where_are_you == BRANCH_LAIR
+ || subdepth < 2 && you.where_are_you == BRANCH_ORCISH_MINES)
+ {
return (0);
+ }
if (you.where_are_you == BRANCH_LAIR
|| you.where_are_you == BRANCH_ORCISH_MINES
- || (you.where_are_you == BRANCH_MAIN_DUNGEON && lev < 15))
+ || you.where_are_you == BRANCH_MAIN_DUNGEON && lev < 15)
+ {
return (1);
+ }
- return 1 + (random2(20) < lev) + (random2(40) < lev);
+ return (1 + x_chance_in_y(lev, 20) + x_chance_in_y(lev, 40));
}