summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/religion.cc23
-rw-r--r--crawl-ref/source/stuff.cc21
-rw-r--r--crawl-ref/source/stuff.h2
-rw-r--r--crawl-ref/source/view.cc22
-rw-r--r--crawl-ref/source/view.h4
5 files changed, 56 insertions, 16 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 11592f7a95..1db10e13e9 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -1652,21 +1652,7 @@ blessing_done:
god);
#ifndef USE_TILE
- if (see_follower)
- {
- unsigned char old_flash_colour = you.flash_colour;
- coord_def c(follower->pos());
-
- you.flash_colour = god_colour(god);
- view_update_at(c);
-
- update_screen();
- delay(200);
-
- you.flash_colour = old_flash_colour;
- view_update_at(c);
- update_screen();
- }
+ flash_monster_colour(follower, god_colour(god), 200);
#endif
return (true);
@@ -2036,8 +2022,13 @@ void pray()
you.duration[DUR_PRAYER] *= 2;
}
- if (you.religion == GOD_NEMELEX_XOBEH)
+ if (!_god_accepts_prayer(you.religion) || you.religion == GOD_ZIN
+ || you.religion == GOD_NEMELEX_XOBEH)
+ {
you.duration[DUR_PRAYER] = 1;
+ }
+ else if (you.religion == GOD_YREDELEMNUL || you.religion == GOD_ELYVILON)
+ you.duration[DUR_PRAYER] = 20;
if (!was_praying)
_do_god_gift(true);
diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc
index b580dc1584..03b5ae9a54 100644
--- a/crawl-ref/source/stuff.cc
+++ b/crawl-ref/source/stuff.cc
@@ -1648,6 +1648,27 @@ int coord_def::distance_from(const coord_def &other) const
return (grid_distance(x, y, other.x, other.y));
}
+int integer_sqrt(int value)
+{
+ if (value <= 0)
+ return (value);
+
+ int very_old_retval = -1;
+ int old_retval = 0;
+ int retval = 1;
+
+ while (very_old_retval != old_retval
+ && very_old_retval != retval
+ && retval != old_retval)
+ {
+ very_old_retval = old_retval;
+ old_retval = retval;
+ retval = (value / old_retval + old_retval) / 2;
+ }
+
+ return (retval);
+}
+
int random_rod_subtype()
{
return STAFF_SMITING + random2(NUM_STAVES - STAFF_SMITING);
diff --git a/crawl-ref/source/stuff.h b/crawl-ref/source/stuff.h
index 918665aaab..93c655383c 100644
--- a/crawl-ref/source/stuff.h
+++ b/crawl-ref/source/stuff.h
@@ -227,6 +227,8 @@ int choose_random_weighted(Iterator beg, const Iterator end)
return result;
}
+int integer_sqrt(int value);
+
int random_rod_subtype();
#endif
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 67a1b11393..ba78faa667 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -4736,6 +4736,28 @@ void view_update_at(const coord_def &pos)
#endif
}
+#ifndef USE_TILE
+void flash_monster_colour(const monsters *mon, unsigned char fmc_colour,
+ int fmc_delay)
+{
+ if (mons_near(mon) && player_monster_visible(mon))
+ {
+ unsigned char old_flash_colour = you.flash_colour;
+ coord_def c(mon->pos());
+
+ you.flash_colour = fmc_colour;
+ view_update_at(c);
+
+ update_screen();
+ delay(fmc_delay);
+
+ you.flash_colour = old_flash_colour;
+ view_update_at(c);
+ update_screen();
+ }
+}
+#endif
+
bool view_update()
{
if (you.num_turns > you.last_view_update)
diff --git a/crawl-ref/source/view.h b/crawl-ref/source/view.h
index e83f999927..f0f21cf266 100644
--- a/crawl-ref/source/view.h
+++ b/crawl-ref/source/view.h
@@ -244,6 +244,10 @@ unsigned get_magicmap_char(int feature);
bool view_update();
void view_update_at(const coord_def &pos);
+#ifndef USE_TILE
+void flash_monster_colour(const monsters *mon, unsigned char fmc_colour,
+ int fmc_delay);
+#endif
void viewwindow(bool draw_it, bool do_updates);
void fire_monster_alerts();