diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-17 02:48:29 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-17 02:48:29 +0000 |
commit | 280b7607085b8cdb91a124e3a3915b53fea7e23e (patch) | |
tree | ac8b9c7fb2c3a53589cce367ec7b9e80f5bf735e /crawl-ref/source/mstuff2.cc | |
parent | b89faa7c00564daf2fb2d2e3595e34b5ec331f5d (diff) | |
download | crawl-ref-280b7607085b8cdb91a124e3a3915b53fea7e23e.tar.gz crawl-ref-280b7607085b8cdb91a124e3a3915b53fea7e23e.zip |
Add more miscellaneous minor cleanups.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5906 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mstuff2.cc')
-rw-r--r-- | crawl-ref/source/mstuff2.cc | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc index ee5d1cd4ad..9f2fcf3026 100644 --- a/crawl-ref/source/mstuff2.cc +++ b/crawl-ref/source/mstuff2.cc @@ -458,7 +458,7 @@ static monster_type _pick_random_wraith() static monster_type _pick_horrible_thing() { return (one_chance_in(4) ? MONS_TENTACLED_MONSTROSITY - : MONS_ABOMINATION_LARGE); + : MONS_ABOMINATION_LARGE); } static monster_type _pick_undead_summon() @@ -467,9 +467,7 @@ static monster_type _pick_undead_summon() // FIXME: This is ridiculous. do - { - summonik = random2(241); // hmmmm ... {dlb} - } + summonik = random2(MONS_PROGRAM_BUG); // hmmmm ... {dlb} while (mons_class_holiness(summonik) != MH_UNDEAD); return static_cast<monster_type>(summonik); @@ -559,30 +557,18 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast) if (!one_chance_in(3)) { - switch (random2(4)) - { - case 0: - mon = MONS_ORANGE_RAT; - break; + int temp_rand = random2(4); - case 1: - mon = MONS_GREEN_RAT; - break; + mon = (temp_rand == 0) ? MONS_ORANGE_RAT : + (temp_rand == 1) ? MONS_GREEN_RAT : + (temp_rand == 2) ? MONS_GREY_RAT + : MONS_RAT; - case 2: - mon = MONS_GREY_RAT; - break; - - case 3: - default: - mon = MONS_RAT; - break; - } } create_monster( - mgen_data(mon, SAME_ATTITUDE(monster), 5, - monster->pos(), monster->foe)); + mgen_data(mon, SAME_ATTITUDE(monster), + 5, monster->pos(), monster->foe)); } return; @@ -863,7 +849,7 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast) } // Set up bolt structure for monster spell casting. -void setup_mons_cast(const monsters *monster, struct bolt &pbolt, int spell_cast) +void setup_mons_cast(const monsters *monster, bolt &pbolt, int spell_cast) { // always set these -- used by things other than fire_beam() @@ -976,7 +962,7 @@ void setup_mons_cast(const monsters *monster, struct bolt &pbolt, int spell_cast pbolt.target_x = monster->target_x; pbolt.target_y = monster->target_y; } -} // end setup_mons_cast() +} void monster_teleport(struct monsters *monster, bool instan, bool silent) { |