summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/view.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-07 11:58:54 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-07 11:58:54 +0000
commit167ae03b160a0ccadd7934b2bfe557d491f1cb1f (patch)
treec1ee0ef626b416c5eee0f62082da72cb9f4137c3 /crawl-ref/source/view.cc
parent33dc7cedd5a65d3bd1ce8eff9006e4517a3390dd (diff)
downloadcrawl-ref-167ae03b160a0ccadd7934b2bfe557d491f1cb1f.tar.gz
crawl-ref-167ae03b160a0ccadd7934b2bfe557d491f1cb1f.zip
Another clean up, and add some new weapon speech.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6439 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/view.cc')
-rw-r--r--crawl-ref/source/view.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 89cc37c67c..c25c8d874f 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -804,7 +804,7 @@ static void _good_god_follower_attitude_change(monsters *monster)
{
monster->flags |= MF_ATT_CHANGE_ATTEMPT;
- if (you.piety > random2(MAX_PIETY) && !you.penance[you.religion])
+ if (x_chance_in_y(you.piety, MAX_PIETY) && !you.penance[you.religion])
{
int wpn = you.equip[EQ_WEAPON];
if (wpn != -1
@@ -887,8 +887,11 @@ static void _handle_seen_interrupt(monsters* monster)
void handle_monster_shouts(monsters* monster, bool force)
{
- if (!force && (!you.turn_is_over || random2(30) < you.skills[SK_STEALTH]))
+ if (!force && (!you.turn_is_over
+ || x_chance_in_y(you.skills[SK_STEALTH], 30)))
+ {
return;
+ }
// Friendly or neutral monsters don't shout.
if (!force && (mons_friendly(monster) || mons_neutral(monster)))
@@ -1274,7 +1277,7 @@ bool check_awaken(monsters* monster)
if (mons_perc < 0)
mons_perc = 0;
- if (random2(stealth) <= mons_perc)
+ if (x_chance_in_y(mons_perc + 1, stealth))
return (true); // Oops, the monster wakes up!
// You didn't wake the monster!