From d473edf767361c19d6938c48ebd518f7d68824c1 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Sat, 22 Nov 2008 10:01:35 +0000 Subject: Fix bug 2325392: Ring of Flames interface problems. Whether stepping into a potentially damaging cloud prompts or not now takes into consideration temporary resistances and immunties, where before it only took into account permanent ones. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7535 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/cloud.cc | 5 ++++- crawl-ref/source/misc.cc | 2 +- crawl-ref/source/mutation.cc | 6 ++++++ crawl-ref/source/output.cc | 9 +++++++++ crawl-ref/source/player.cc | 8 +++++++- crawl-ref/source/spells1.cc | 7 +++++++ 6 files changed, 34 insertions(+), 3 deletions(-) diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc index 6229485d19..5c1f6a7512 100644 --- a/crawl-ref/source/cloud.cc +++ b/crawl-ref/source/cloud.cc @@ -614,8 +614,11 @@ bool is_damaging_cloud(cloud_type type, bool temp) { switch (type) { - // always harmful + // always harmful... case CLOUD_FIRE: + // ... unless a Ring of Flames is up and it's a fire cloud. + if (temp && you.duration[DUR_FIRE_SHIELD]) + return (false); case CLOUD_COLD: return (true); diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 2498be75ce..74e8d2e821 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -2454,7 +2454,7 @@ bool i_feel_safe(bool announce, bool want_move, bool just_monsters, int range) { const cloud_type type = env.cloud[env.cgrid(you.pos())].type; - if (is_damaging_cloud(type, false)) + if (is_damaging_cloud(type, want_move)) { if (announce) { diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index cb287cd63d..c90998b2d9 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -1260,6 +1260,12 @@ formatted_string describe_mutations() have_any = true; } + if (you.duration[DUR_FIRE_SHIELD]) + { + result += "You are immune to clouds of flame." EOL; + have_any = true; + } + textcolor(LIGHTGREY); // first add (non-removable) inborn abilities and demon powers diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index a35276a8a9..39b0fb8c9e 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -677,6 +677,12 @@ static void _get_status_lights(std::vector& out) out.push_back(status_light(color, "Sage")); } + if (you.duration[DUR_FIRE_SHIELD]) + { + int color = _dur_colour( BLUE, (you.duration[DUR_FIRE_SHIELD] <= 5) ); + out.push_back(status_light(color, "RoF")); + } + if (you.duration[DUR_SURE_BLADE]) { out.push_back(status_light(BLUE, "Blade")); @@ -2190,6 +2196,9 @@ std::string _status_mut_abilities() if (you.duration[DUR_MAGIC_SHIELD]) text += "shielded, "; + if (you.duration[DUR_FIRE_SHIELD]) + text += "immune to fire clouds, "; + if (you.duration[DUR_POISONING]) { text += (you.duration[DUR_POISONING] > 10) ? "extremely" : diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 9cd7f6bb30..7fcace5605 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -121,7 +121,7 @@ bool move_player_to_grid( const coord_def& p, bool stepped, bool allow_shift, { const cloud_type ctype = env.cloud[ cloud ].type; // Don't prompt if already in a cloud of the same type. - if (is_damaging_cloud(ctype, false) + if (is_damaging_cloud(ctype, true) && (env.cgrid(you.pos()) == EMPTY_CLOUD || ctype != env.cloud[ env.cgrid(you.pos()) ].type)) { @@ -3846,6 +3846,12 @@ void display_char_status() if (you.duration[DUR_LIQUID_FLAMES]) mpr("You are covered in liquid flames."); + if (you.duration[DUR_FIRE_SHIELD]) + { + mpr("You are surrounded by a ring of flames."); + mpr("You are immune to clouds of flame."); + } + if (you.duration[DUR_ICY_ARMOUR]) mpr("You are protected by an icy shield."); diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index 6675c9019d..7d850ba0b5 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -1513,10 +1513,17 @@ bool cast_sure_blade(int power) void manage_fire_shield() { + ASSERT(you.duration[DUR_FIRE_SHIELD]); you.duration[DUR_FIRE_SHIELD]--; if (!you.duration[DUR_FIRE_SHIELD]) + { + mpr("Your ring of flames gutters out.", MSGCH_DURATION); return; + } + + if (you.duration[DUR_FIRE_SHIELD] == 5) + mpr("Your ring of flames is guttering out.", MSGCH_WARN); // Place fire clouds all around you for ( adjacent_iterator ai; ai; ++ai ) -- cgit v1.2.3-54-g00ecf