diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-07 21:24:09 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-07 21:24:09 +0000 |
commit | 4a940cde598238124cbe701d44cba217db175c65 (patch) | |
tree | 7e2ef1536689b5b3ac657e1895342e8869a49d5f /crawl-ref | |
parent | 857a0760acce7f0e7bf9346aeb5a0a050602ecc9 (diff) | |
download | crawl-ref-4a940cde598238124cbe701d44cba217db175c65.tar.gz crawl-ref-4a940cde598238124cbe701d44cba217db175c65.zip |
Generalize summoning of holy beings, in case any more of them are added.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5556 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/monplace.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/monplace.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/xom.cc | 13 |
3 files changed, 14 insertions, 6 deletions
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc index f8043905af..28ec926f51 100644 --- a/crawl-ref/source/monplace.cc +++ b/crawl-ref/source/monplace.cc @@ -2191,6 +2191,11 @@ monster_type summon_any_demon(demon_class_type dct) return (mon); } +monster_type summon_any_holy_being() +{ + return (coinflip()) ? MONS_ANGEL : MONS_DAEVA; +} + monster_type summon_any_dragon(dragon_class_type dct) { monster_type mon = MONS_PROGRAM_BUG; diff --git a/crawl-ref/source/monplace.h b/crawl-ref/source/monplace.h index 53b840269c..7886c295f1 100644 --- a/crawl-ref/source/monplace.h +++ b/crawl-ref/source/monplace.h @@ -268,6 +268,8 @@ bool empty_surrounds( int emx, int emy, dungeon_feature_type spc_wanted, * *********************************************************************** */ monster_type summon_any_demon(demon_class_type dct); +monster_type summon_any_holy_being(); + monster_type summon_any_dragon(dragon_class_type dct); bool drac_colour_incompatible(int drac, int colour); diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index b8d2e2a699..33a611b822 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -431,15 +431,16 @@ static monster_type xom_random_demon(int sever, bool use_greater_demons = true) roll >= 340 ? DEMON_COMMON : DEMON_LESSER; - // Sometimes, send an angel or daeva instead. - if (dct == DEMON_GREATER && coinflip()) - return (coinflip() ? MONS_ANGEL : MONS_DAEVA); + monster_type demon = MONS_PROGRAM_BUG; - const monster_type demontype = - summon_any_demon( + // Sometimes, send a holy being instead. + if (dct == DEMON_GREATER && coinflip()) + demon = summon_any_holy_being(); + else + demon = summon_any_demon( use_greater_demons || dct != DEMON_GREATER ? dct : DEMON_COMMON); - return (demontype); + return (demon); } // Returns a demon suitable for use in Xom's punishments, filtering out |