diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-07 23:35:16 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-07 23:35:16 +0000 |
commit | 7988fe7d7d775fd45616f146b0b2d3ff5e3c8d6d (patch) | |
tree | ad7d1b28f4925a35bb42636cf346a6f972964d00 /crawl-ref/source/monplace.cc | |
parent | 733294517b6c98b2ce17f3191140390a41e384e7 (diff) | |
download | crawl-ref-7988fe7d7d775fd45616f146b0b2d3ff5e3c8d6d.tar.gz crawl-ref-7988fe7d7d775fd45616f146b0b2d3ff5e3c8d6d.zip |
Clean up summoning of random demons and random holy beings again.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5560 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monplace.cc')
-rw-r--r-- | crawl-ref/source/monplace.cc | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc index 28ec926f51..badbb816a1 100644 --- a/crawl-ref/source/monplace.cc +++ b/crawl-ref/source/monplace.cc @@ -2133,6 +2133,9 @@ monster_type summon_any_demon(demon_class_type dct) { monster_type mon = MONS_PROGRAM_BUG; + if (dct == DEMON_RANDOM) + dct = static_cast<demon_class_type>(random2(DEMON_RANDOM)); + int temp_rand; // probability determination {dlb} switch (dct) @@ -2184,16 +2187,34 @@ monster_type summon_any_demon(demon_class_type dct) break; default: - mon = MONS_GIANT_ANT; // this was the original behaviour {dlb} break; } return (mon); } -monster_type summon_any_holy_being() +monster_type summon_any_holy_being(holy_being_class_type hbct) { - return (coinflip()) ? MONS_ANGEL : MONS_DAEVA; + monster_type mon = MONS_PROGRAM_BUG; + + if (hbct == HOLY_BEING_RANDOM) + hbct = static_cast<holy_being_class_type>(random2(HOLY_BEING_RANDOM)); + + switch (hbct) + { + case HOLY_BEING_ANGEL: + mon = MONS_ANGEL; + break; + + case HOLY_BEING_DAEVA: + mon = MONS_DAEVA; + break; + + default: + break; + } + + return (mon); } monster_type summon_any_dragon(dragon_class_type dct) |