summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-12-13 10:02:21 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-12-13 10:02:21 +0000
commit52b146bac6c9f15d8b90331576738204651d6c8c (patch)
treefd443b2458c9309d39ff82847632ccd1eba0c996 /crawl-ref/source/player.cc
parentac1b7c7427e4786ff62d6be16277c2d7e2a5b0c8 (diff)
downloadcrawl-ref-52b146bac6c9f15d8b90331576738204651d6c8c.tar.gz
crawl-ref-52b146bac6c9f15d8b90331576738204651d6c8c.zip
Permanent levitation no longer confers permanent flight.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3053 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc27
1 files changed, 19 insertions, 8 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 2a9dd4cb78..b264ca8ab1 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -3247,14 +3247,7 @@ void level_change(bool skip_ability_increase)
MSGCH_INTRINSIC_GAIN);
}
else if (you.experience_level == 15)
- {
mpr("You can now fly continuously.", MSGCH_INTRINSIC_GAIN);
- if (you.duration[DUR_LEVITATION])
- {
- you.duration[DUR_LEVITATION] = 100;
- you.duration[DUR_CONTROLLED_FLIGHT] = 100;
- }
- }
break;
case SP_MERFOLK:
@@ -3669,7 +3662,7 @@ void display_char_status()
const bool swim = player_is_swimming();
const bool lev = player_is_airborne();
- const bool fly = (lev && you.duration[DUR_CONTROLLED_FLIGHT]);
+ const bool fly = (you.flight_mode() == FL_FLY);
const bool swift = (you.duration[DUR_SWIFTNESS] > 0);
mprf( "Your %s speed is %s%s%s.",
@@ -5988,6 +5981,24 @@ flight_type player::flight_mode() const
return (FL_NONE);
}
+bool player::permanent_levitation() const
+{
+ return airborne() &&
+ (permanent_flight() ||
+ // Boots of levitation keep you with DUR_LEVITATION >= 2 at
+ // all times. This is so that you can evoke stop-levitation
+ // in order to actually cancel levitation (by setting
+ // DUR_LEVITATION to 1.) Note that antimagic() won't do this.
+ (player_equip_ego_type( EQ_BOOTS, SPARM_LEVITATION ) &&
+ you.duration[DUR_LEVITATION] > 1));
+}
+
+bool player::permanent_flight() const
+{
+ return airborne() &&
+ (you.species == SP_KENKU && you.experience_level >= 15);
+}
+
bool player::light_flight() const
{
// Only Kenku get perks for flying light.