From 8bc24807373e07c83b31c7152c5fef820e51c325 Mon Sep 17 00:00:00 2001 From: dolorous Date: Sun, 8 Jun 2008 16:31:54 +0000 Subject: Add minor cosmetic fixes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5595 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spells2.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source/spells2.cc') 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) -- cgit v1.2.3-54-g00ecf