From c445c5a6f661d292563c4e7a45e712c4550499ad Mon Sep 17 00:00:00 2001 From: dolorous Date: Fri, 18 Apr 2008 21:33:44 +0000 Subject: Improve halo-related output. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4345 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/direct.cc | 4 ++++ crawl-ref/source/externs.h | 9 ++++++--- crawl-ref/source/mon-util.cc | 9 +++++++-- crawl-ref/source/output.cc | 16 ++++++++++------ crawl-ref/source/player.cc | 12 ++++++++++-- crawl-ref/source/religion.cc | 6 +++--- 6 files changed, 40 insertions(+), 16 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc index c822c03304..fb3b24718d 100644 --- a/crawl-ref/source/direct.cc +++ b/crawl-ref/source/direct.cc @@ -2107,6 +2107,10 @@ static void describe_monster(const monsters *mon) mprf(MSGCH_EXAMINE, "%s is indifferent to you.", mon->pronoun(PRONOUN_CAP).c_str()); + if (mon->haloed()) + mprf(MSGCH_EXAMINE, "%s is illuminated by a halo.", + mon->pronoun(PRONOUN_CAP).c_str()); + std::string desc = ""; std::string last_desc = ""; std::string tmp = ""; diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index 9399eb7034..2b296482e2 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -200,7 +200,8 @@ public: virtual bool confused() const = 0; virtual bool caught() const = 0; virtual bool asleep() const { return (false); } - virtual bool backlit(bool check_halo = true) const = 0; + virtual bool backlit(bool check_haloed = true) const = 0; + virtual bool haloed() const = 0; virtual void god_conduct(conduct_type thing_done, int level) { } @@ -882,7 +883,8 @@ public: bool paralysed() const; bool confused() const; bool caught() const; - bool backlit(bool check_halo = true) const; + bool backlit(bool check_haloed = true) const; + bool haloed() const; bool asleep() const; void put_to_sleep(int power = 0); @@ -1184,7 +1186,8 @@ public: bool confused() const; bool caught() const; bool asleep() const; - bool backlit(bool check_halo = true) const; + bool backlit(bool check_haloed = true) const; + bool haloed() const; int holy_aura() const; diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 04266ee9d0..5ff798e908 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -3706,10 +3706,15 @@ bool monsters::asleep() const return (mons_is_sleeping(this)); } -bool monsters::backlit(bool check_halo) const +bool monsters::backlit(bool check_haloed) const { return (has_ench(ENCH_BACKLIGHT) - || ((check_halo) ? inside_halo(x, y) : false)); + || ((check_haloed) ? haloed() : false)); +} + +bool monsters::haloed() const +{ + return (inside_halo(x, y)); } bool monsters::caught() const diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index c9b98acc04..94a331dfcf 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -737,13 +737,17 @@ static void _get_status_lights(std::vector& out) out.push_back(status_light(RED, "Held")); } - // Don't display "Glow" for a visible player inside a halo. - if (you.backlit(you.duration[DUR_INVIS])) + if (you.backlit()) { - int color = you.magic_contamination > 5 - ? _bad_ench_colour( you.magic_contamination, 15, 25 ) - : LIGHTBLUE; - out.push_back(status_light(color, "Glow")); + if (!you.backlit(false) && you.haloed()) + out.push_back(status_light(LIGHTBLUE, "Halo")); + else + { + int color = you.magic_contamination > 5 + ? _bad_ench_colour( you.magic_contamination, 15, 25 ) + : LIGHTBLUE; + out.push_back(status_light(color, "Glow")); + } } if (you.duration[DUR_SWIFTNESS]) diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 5ada2330b3..66a7fab67f 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -3659,6 +3659,9 @@ void display_char_status() else mpr( "You are alive." ); + if (you.haloed()) + mpr( "You are illuminated by a halo." ); + if (you.species == SP_VAMPIRE) { std::string msg = "At your current hunger state you "; @@ -6425,10 +6428,15 @@ bool player::can_see(const actor *target) const return (mons_near(mon) && target->visible_to(this)); } -bool player::backlit(bool check_halo) const +bool player::backlit(bool check_haloed) const { return (magic_contamination >= 5 || duration[DUR_BACKLIGHT] - || ((check_halo) ? halo_radius() : false)); + || ((check_haloed) ? haloed() : false)); +} + +bool player::haloed() const +{ + return (halo_radius()); } void player::mutate() diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index e447437618..6b803b434c 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -480,7 +480,7 @@ static void _inc_penance(god_type god, int val) // nor does TSO's halo or divine shield else if (god == GOD_SHINING_ONE) { - if (halo_radius()) + if (you.haloed()) mpr("Your divine halo fades away."); if (you.duration[DUR_DIVINE_SHIELD]) @@ -3901,7 +3901,7 @@ void excommunication(god_type new_god) const god_type old_god = you.religion; ASSERT(old_god != new_god); - const bool old_halo = halo_radius(); + const bool was_haloed = you.haloed(); god_acting gdact(old_god, true); @@ -4000,7 +4000,7 @@ void excommunication(god_type new_god) break; case GOD_SHINING_ONE: - if (old_halo) + if (was_haloed) mpr("Your divine halo fades away."); if (you.duration[DUR_DIVINE_SHIELD]) -- cgit v1.2.3-54-g00ecf