diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-31 23:44:21 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-31 23:44:21 +0000 |
commit | 891156c65624a607f4f5c7d352668b690e1860db (patch) | |
tree | 7b6f1ce79d99444c5f5e417a8087679539be6fb7 /crawl-ref/source/religion.cc | |
parent | 6ce835d28c2081d13222a9faedc350ece4abb11b (diff) | |
download | crawl-ref-891156c65624a607f4f5c7d352668b690e1860db.tar.gz crawl-ref-891156c65624a607f4f5c7d352668b690e1860db.zip |
Fix blessings' follower descriptions, and make the blessed follower
flash the god's associated color when blessed (only in console mode,
though).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3996 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r-- | crawl-ref/source/religion.cc | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index eeed2c156e..f0e36a58d0 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -997,13 +997,16 @@ bool bless_follower(monsters* follower, god_type god, bool (*suitable)(const monsters* mon)) { - monsters *mon; + monsters *mon = NULL; + std::string pronoun; std::string blessed; std::string result; int chance = random2(20); + bool is_near = false; + // If a follower was specified, and it's suitable, pick it. if (follower && suitable(follower)) mon = follower; @@ -1032,6 +1035,7 @@ bool bless_follower(monsters* follower, if (reinforced) { + pronoun = ""; blessed = "you"; result = "reinforcement"; goto blessing_done; @@ -1050,8 +1054,10 @@ bool bless_follower(monsters* follower, mon = &menv[monster]; } - blessed = (follower && !mons_near(follower)) ? "your follower" - : mon->name(DESC_PLAIN).c_str(); + is_near = mons_near(mon); + + pronoun = "your"; + blessed = (is_near) ? mon->name(DESC_PLAIN).c_str() : "follower"; if (chance == 0) { @@ -1185,11 +1191,27 @@ bool bless_follower(monsters* follower, } blessing_done: - snprintf(info, INFO_SIZE, " blesses %s%s with %s.", - mons_is_unique(mon->type) ? "" : "your ", - blessed.c_str(), result.c_str()); + snprintf(info, INFO_SIZE, " blesses %s %s with %s.", + pronoun.c_str(), blessed.c_str(), result.c_str()); simple_god_message(info); +#ifndef USE_TILE + if (mon && is_near) + { + int old_flash_colour = you.flash_colour; + coord_def c(mon->x, mon->y); + + you.flash_colour = god_colour(god); + view_update_at(c); + + update_screen(); + delay(100); + + you.flash_colour = old_flash_colour; + view_update_at(c); + } +#endif + return true; } |