diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-03 20:00:42 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-03 20:00:42 +0000 |
commit | c07f2c46323c57f9d5699293e3e4458d5bbacde5 (patch) | |
tree | 4afb8218230bd780be1d925a84f4abe8542aef32 /crawl-ref/source/it_use3.cc | |
parent | 774610f0402dc15c10a1a39105e2427484364006 (diff) | |
download | crawl-ref-c07f2c46323c57f9d5699293e3e4458d5bbacde5.tar.gz crawl-ref-c07f2c46323c57f9d5699293e3e4458d5bbacde5.zip |
Some cleanup (replacing you.duration[DUR_CONF] with you.confused())
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7108 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/it_use3.cc')
-rw-r--r-- | crawl-ref/source/it_use3.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/crawl-ref/source/it_use3.cc b/crawl-ref/source/it_use3.cc index e3ffee2d08..c38df3aa6f 100644 --- a/crawl-ref/source/it_use3.cc +++ b/crawl-ref/source/it_use3.cc @@ -729,13 +729,12 @@ static bool efreet_flask(void) static bool ball_of_seeing(void) { - int use = 0; bool ret = false; mpr("You gaze into the crystal ball."); - use = (!you.duration[DUR_CONF] ? random2(you.skills[SK_EVOCATIONS] * 6) - : random2(5)); + int use = (!you.confused() ? random2(you.skills[SK_EVOCATIONS] * 6) + : random2(5)); if (use < 2) { @@ -1016,14 +1015,12 @@ static bool box_of_beasts() static bool ball_of_energy(void) { - int use = 0; - int proportional = 0; - bool ret = false; mpr("You gaze into the crystal ball."); - use = ((!you.duration[DUR_CONF]) ? random2(you.skills[SK_EVOCATIONS] * 6) : random2(6)); + int use = ((!you.confused()) ? random2(you.skills[SK_EVOCATIONS] * 6) + : random2(6)); if (use < 2 || you.max_magic_points == 0) { @@ -1041,8 +1038,7 @@ static bool ball_of_energy(void) } else { - proportional = you.magic_points * 100; - proportional /= you.max_magic_points; + int proportional = (you.magic_points * 100) / you.max_magic_points; if (random2avg(77 - you.skills[SK_EVOCATIONS] * 2, 4) > proportional || one_chance_in(25)) |