summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells2.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-08 16:31:54 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-08 16:31:54 +0000
commit8bc24807373e07c83b31c7152c5fef820e51c325 (patch)
treede4d968043a63ebf0538f222b97840718ad9f874 /crawl-ref/source/spells2.cc
parent9855f61a84eb903023abc21be286d74d8857b58d (diff)
downloadcrawl-ref-8bc24807373e07c83b31c7152c5fef820e51c325.tar.gz
crawl-ref-8bc24807373e07c83b31c7152c5fef820e51c325.zip
Add minor cosmetic fixes.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5595 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells2.cc')
-rw-r--r--crawl-ref/source/spells2.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index e50002258d..059b613961 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -1546,9 +1546,11 @@ bool cast_summon_small_mammals(int pow, bool god_gift)
bool cast_sticks_to_snakes(int pow, bool god_gift)
{
monster_type mon = MONS_PROGRAM_BUG;
- int count = 0;
- int max = 1 + random2(1 + you.skills[SK_TRANSMIGRATION]) / 4;
- int dur = std::min(3 + random2(pow) / 20, 5);
+
+ const int dur = std::min(3 + random2(pow) / 20, 5);
+
+ int how_many_max = 1 + random2(1 + you.skills[SK_TRANSMIGRATION]) / 4;
+
const int weapon = you.equip[EQ_WEAPON];
if (weapon == -1)
@@ -1572,13 +1574,15 @@ bool cast_sticks_to_snakes(int pow, bool god_gift)
const unsigned short hitting = (beha == BEH_HOSTILE) ? MHITYOU
: you.pet_target;
+ int count = 0;
+
if ((you.inv[weapon].base_type == OBJ_MISSILES
&& (you.inv[weapon].sub_type == MI_ARROW)))
{
- if (you.inv[weapon].quantity < max)
- max = you.inv[weapon].quantity;
+ if (you.inv[weapon].quantity < how_many_max)
+ how_many_max = you.inv[weapon].quantity;
- for (int i = 0; i <= max; i++)
+ for (int i = 0; i <= how_many_max; i++)
{
if (one_chance_in(5 - std::min(4, div_rand_round(pow * 2, 25)))
|| get_ammo_brand(you.inv[weapon]) == SPMSL_POISONED)