summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells2.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-07 23:37:49 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-07 23:37:49 +0000
commit6267771c634384c7c706b5e48f8bdb3dc873bdfe (patch)
treebc5051cecc2ed4232dd8e1272014994aca88403d /crawl-ref/source/spells2.cc
parent7988fe7d7d775fd45616f146b0b2d3ff5e3c8d6d (diff)
downloadcrawl-ref-6267771c634384c7c706b5e48f8bdb3dc873bdfe.tar.gz
crawl-ref-6267771c634384c7c706b5e48f8bdb3dc873bdfe.zip
Add const.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5561 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells2.cc')
-rw-r--r--crawl-ref/source/spells2.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index b92276cfd1..8259bca081 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -1532,20 +1532,20 @@ bool summon_elemental(int pow, int restricted_type,
// - Air elementals are harder because they're more dynamic/dangerous.
// - Earth elementals are more static and easy to tame (as before).
// - Fire elementals fall in between the two (10 is still fairly easy).
- bool friendly = ((mon != MONS_FIRE_ELEMENTAL
- || random2(10) < you.skills[SK_FIRE_MAGIC])
+ const bool friendly = ((mon != MONS_FIRE_ELEMENTAL
+ || random2(10) < you.skills[SK_FIRE_MAGIC])
- && (mon != MONS_WATER_ELEMENTAL
- || random2((you.species == SP_MERFOLK) ? 5 : 15)
- < you.skills[SK_ICE_MAGIC])
+ && (mon != MONS_WATER_ELEMENTAL
+ || random2((you.species == SP_MERFOLK) ? 5 : 15)
+ < you.skills[SK_ICE_MAGIC])
- && (mon != MONS_AIR_ELEMENTAL
- || random2(15) < you.skills[SK_AIR_MAGIC])
+ && (mon != MONS_AIR_ELEMENTAL
+ || random2(15) < you.skills[SK_AIR_MAGIC])
- && (mon != MONS_EARTH_ELEMENTAL
- || random2(5) < you.skills[SK_EARTH_MAGIC])
+ && (mon != MONS_EARTH_ELEMENTAL
+ || random2(5) < you.skills[SK_EARTH_MAGIC])
- && random2(100) >= unfriendly);
+ && random2(100) >= unfriendly);
if (create_monster(
mgen_data(mon,
@@ -1870,7 +1870,7 @@ bool cast_call_canine_familiar(int pow, bool god_gift)
const int dur = std::min(2 + (random2(pow) / 4), 6);
- bool friendly = (random2(pow) > 3);
+ const bool friendly = (random2(pow) > 3);
if (create_monster(
mgen_data(mon,
@@ -1982,7 +1982,7 @@ bool cast_summon_ugly_thing(int pow, bool god_gift)
const int dur = std::min(2 + (random2(pow) / 4), 6);
- bool friendly = (random2(pow) > 3);
+ const bool friendly = (random2(pow) > 3);
if (create_monster(
mgen_data(mon,
@@ -2035,7 +2035,7 @@ bool cast_summon_wraiths(int pow, bool god_gift)
(chance > 3) ? MONS_FREEZING_WRAITH // 20%
: MONS_SPECTRAL_WARRIOR); // 16%
- bool friendly = (random2(pow) > 5);
+ const bool friendly = (random2(pow) > 5);
if (create_monster(
mgen_data(mon,