summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells2.cc
diff options
context:
space:
mode:
authorevktalo <evktalo@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-09 20:16:56 +0000
committerevktalo <evktalo@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-09 20:16:56 +0000
commit873c564dcda878d3fed808a616ce55b19fba13bf (patch)
treef4035033d665f5b9940e014aa70dcc193247e996 /crawl-ref/source/spells2.cc
parent230557b3131962bd882b32309644a9fddfa6d5fc (diff)
downloadcrawl-ref-873c564dcda878d3fed808a616ce55b19fba13bf.tar.gz
crawl-ref-873c564dcda878d3fed808a616ce55b19fba13bf.zip
* 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
Diffstat (limited to 'crawl-ref/source/spells2.cc')
-rw-r--r--crawl-ref/source/spells2.cc17
1 files changed, 6 insertions, 11 deletions
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);
}