summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/godwrath.cc
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-08 17:15:06 -0600
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-08 17:18:07 -0600
commit247a84445df5577ff75367c7b2764c9322125e2c (patch)
treebb9d190cb80bc8253e33e42e32100efcadf0bcb9 /crawl-ref/source/godwrath.cc
parenta4be9baa7af0116b50c038d8efa00f216b1b41f9 (diff)
downloadcrawl-ref-247a84445df5577ff75367c7b2764c9322125e2c.tar.gz
crawl-ref-247a84445df5577ff75367c7b2764c9322125e2c.zip
Use fewer local variables when creating groups of hostile monsters.
Diffstat (limited to 'crawl-ref/source/godwrath.cc')
-rw-r--r--crawl-ref/source/godwrath.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/crawl-ref/source/godwrath.cc b/crawl-ref/source/godwrath.cc
index 60657bd513..d19c6b7158 100644
--- a/crawl-ref/source/godwrath.cc
+++ b/crawl-ref/source/godwrath.cc
@@ -98,7 +98,7 @@ static bool _tso_retribution()
bool success = false;
int how_many = 1 + random2(you.experience_level / 5) + random2(3);
- for (int i = 0; i < how_many; ++i)
+ for (; how_many > 0; --how_many)
{
if (summon_holy_warrior(100, god, 0, true, true, true))
success = true;
@@ -185,10 +185,10 @@ static bool _zin_retribution()
MONS_EYE_OF_DEVASTATION, MONS_GREAT_ORB_OF_EYES
};
- const int how_many = 1 + (you.experience_level / 10) + random2(3);
+ int how_many = 1 + (you.experience_level / 10) + random2(3);
bool success = false;
- for (int i = 0; i < how_many; ++i)
+ for (; how_many > 0; --how_many)
{
const monster_type mon = RANDOM_ELEMENT(eyes);
@@ -406,7 +406,7 @@ static bool _makhleb_retribution()
int how_many = 1 + (you.experience_level / 7);
int count = 0;
- for (int i = 0; i < how_many; ++i)
+ for (; how_many > 0; --how_many)
{
if (create_monster(
mgen_data::hostile_at(
@@ -436,7 +436,7 @@ static bool _kikubaaqudgha_retribution()
bool success = false;
int how_many = 1 + (you.experience_level / 5) + random2(3);
- for (int i = 0; i < how_many; ++i)
+ for (; how_many > 0; --how_many)
{
if (create_monster(
mgen_data::hostile_at(MONS_REAPER,
@@ -854,7 +854,7 @@ static bool _lugonu_retribution()
bool success = false;
int how_many = 1 + (you.experience_level / 7);
- for (int loopy = 0; loopy < how_many; ++loopy)
+ for (; how_many > 0; --how_many)
{
if (create_monster(
mgen_data::hostile_at(
@@ -977,10 +977,10 @@ static bool _jiyva_retribution()
MONS_DEATH_OOZE, MONS_SLIME_CREATURE
};
- const int how_many = 1 + (you.experience_level / 10) + random2(3);
-
+ int how_many = 1 + (you.experience_level / 10) + random2(3);
bool success = false;
- for (int i = 0; i < how_many; ++i)
+
+ for (; how_many > 0; --how_many)
{
const monster_type slime = RANDOM_ELEMENT(slimes);