From 7da71d18a7403dcd95b2e57370dc26bf1274f436 Mon Sep 17 00:00:00 2001 From: dolorous Date: Thu, 25 Sep 2008 16:32:21 +0000 Subject: Add miscellaneous minor cleanups to prepare for the introduction of Yred's injury mirroring: move the routine to make a visible monster flash a particular color into its own function, add an integer-based square root function based on Newton's method to stuff.cc, and adjust prayer lengths for Zin (1 turn), Yred (20 turns), Ely (same as Yred), and all gods who ignore prayers (same as Zin). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6982 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/view.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'crawl-ref/source/view.cc') 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) -- cgit v1.2.3-54-g00ecf