From 536cad41f666433204c1072afe2c3aa5c93c4d64 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Mon, 9 Jul 2007 11:32:32 +0000 Subject: Give merfolk in water and flying kenku evasion bonuses. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1812 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/misc.cc | 1 + crawl-ref/source/player.cc | 32 +++++++++++++++++++++++++++++++- crawl-ref/source/spells1.cc | 3 --- 3 files changed, 32 insertions(+), 4 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 988b322a17..2756efc18f 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -539,6 +539,7 @@ void merfolk_start_swimming(void) } remove_equipment(removed); + you.redraw_evasion = true; } void up_stairs(void) diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index a407bb2f0a..2e678eea91 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -267,6 +267,11 @@ bool move_player_to_grid( int x, int y, bool stepped, bool allow_shift, } } } + else if (!grid_is_water(new_grid) && grid_is_water(old_grid) + && you.species == SP_MERFOLK) + { + you.redraw_evasion = true; + } } // move the player to location @@ -1891,6 +1896,30 @@ int player_evasion() break; } + switch (you.species) + { + case SP_MERFOLK: + // Merfolk get an evasion bonus in water. + if (you.swimming()) + { + const int ev_bonus = std::min(9, std::max(2, ev / 4)); + ev += ev_bonus; + } + break; + + case SP_KENKU: + // Flying kenku get an evasion bonus. + if (you.levitates() == 1) + { + const int ev_bonus = std::min(9, std::max(1, ev / 5)); + ev += ev_bonus; + } + break; + + default: + break; + } + return (ev); } @@ -2149,6 +2178,7 @@ int burden_change(void) you.burden_state = BS_UNENCUMBERED; set_redraw_status( REDRAW_BURDEN ); + you.redraw_evasion = true; // changed the burdened levels to match the change to max_carried if (you.burden < carrying_capacity(BS_UNENCUMBERED)) @@ -5083,7 +5113,7 @@ int player::res_negative_energy() const int player::levitates() const { - if ( !player_is_levitating() ) + if ( !is_levitating() ) return 0; else return (you.duration[DUR_CONTROLLED_FLIGHT] ? 1 : 2); diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index 8989a0b238..f9d0a86d3b 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -981,9 +981,6 @@ void cast_fly(int power) else you.duration[DUR_CONTROLLED_FLIGHT] += dur_change; - // duration[DUR_CONTROLLED_FLIGHT] makes the game think player - // wears an amulet of controlled flight - burden_change(); } -- cgit v1.2.3-54-g00ecf