From 873c564dcda878d3fed808a616ce55b19fba13bf Mon Sep 17 00:00:00 2001 From: evktalo Date: Thu, 9 Jul 2009 20:16:56 +0000 Subject: * Summon Small Mammals gives maximum of 2 mammals per casting. The possibility of getting two begins at power 32, where it used to be guaranteed. At maximum power (80), you should be getting about 1.75 per casting. * Instead of rerolling, give good god worshipers a green rat when they'd otherwise get an orange rat. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10129 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spells2.cc | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'crawl-ref/source/spells2.cc') diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index 256d0d4af0..7c5eb2add9 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -929,7 +929,6 @@ bool cast_summon_butterflies(int pow, god_type god) return (success); } -//jmf: beefed up higher-level casting of this (formerly lame) spell bool cast_summon_small_mammals(int pow, god_type god) { bool success = false; @@ -937,15 +936,11 @@ bool cast_summon_small_mammals(int pow, god_type god) monster_type mon = MONS_PROGRAM_BUG; int count = 0; - const int count_max = std::max(1, std::min(5, pow / 16)); + const int count_max = 2; - int pow_left = pow + 1; - - while (pow_left > 0 && count < count_max) + do { - const int pow_spent = random2(pow_left) + 1; - - switch (pow_spent) + switch (random2(pow+1)) { case 75: case 74: case 38: mon = MONS_ORANGE_RAT; @@ -968,9 +963,8 @@ bool cast_summon_small_mammals(int pow, god_type god) // If you worship a good god, don't summon an evil small mammal // (in this case, the orange rat). if (player_will_anger_monster(mon)) - continue; + mon = MONS_GREEN_RAT; - pow_left -= pow_spent; count++; if (create_monster( @@ -981,7 +975,8 @@ bool cast_summon_small_mammals(int pow, god_type god) { success = true; } - } + + } while (random2(pow+1) > 32 && count < count_max); return (success); } -- cgit v1.2.3-54-g00ecf