summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player-act.cc
diff options
context:
space:
mode:
authorpubby <pubby8@gmail.com>2013-08-31 16:40:44 -0500
committerpubby <pubby8@gmail.com>2013-08-31 16:49:50 -0500
commit65c58ed6ccd53a9a080255ee37e131123ac65e96 (patch)
treed4a3d59267fa5c14ae7573b91f7dac9b66955159 /crawl-ref/source/player-act.cc
parentc4b51221cd6f40f90127768df0e2e1ad7ed7310e (diff)
parent70ca29ee15926336c0ab2369cb25743a9e510e08 (diff)
downloadcrawl-ref-65c58ed6ccd53a9a080255ee37e131123ac65e96.tar.gz
crawl-ref-65c58ed6ccd53a9a080255ee37e131123ac65e96.zip
Merge branch 'master' into dwants
Conflicts: crawl-ref/docs/crawl_manual.reST crawl-ref/source/abl-show.cc crawl-ref/source/dat/descript/ability.txt crawl-ref/source/delay.cc crawl-ref/source/enum.h crawl-ref/source/main.cc crawl-ref/source/mon-cast.cc crawl-ref/source/mon-gear.cc crawl-ref/source/mon-spll.h crawl-ref/source/mutation-data.h crawl-ref/source/mutation.cc crawl-ref/source/ng-restr.cc crawl-ref/source/ng-setup.cc crawl-ref/source/output.cc crawl-ref/source/player-act.cc crawl-ref/source/player.cc crawl-ref/source/species.cc crawl-ref/source/spl-data.h crawl-ref/source/wiz-you.cc
Diffstat (limited to 'crawl-ref/source/player-act.cc')
-rw-r--r--crawl-ref/source/player-act.cc49
1 files changed, 22 insertions, 27 deletions
diff --git a/crawl-ref/source/player-act.cc b/crawl-ref/source/player-act.cc
index 39067f0e6e..a93ffe0c29 100644
--- a/crawl-ref/source/player-act.cc
+++ b/crawl-ref/source/player-act.cc
@@ -24,6 +24,7 @@
#include "libutil.h"
#include "misc.h"
#include "monster.h"
+#include "spl-damage.h"
#include "state.h"
#include "terrain.h"
#include "transform.h"
@@ -71,6 +72,7 @@ void player::moveto(const coord_def &c, bool clear_net)
set_position(c);
clear_far_constrictions();
+ end_searing_ray();
}
bool player::move_to_pos(const coord_def &c, bool clear_net)
@@ -102,7 +104,7 @@ void player::set_position(const coord_def &c)
{
reset_prev_move();
- if (you.duration[DUR_QUAD_DAMAGE])
+ if (duration[DUR_QUAD_DAMAGE])
invalidate_agrid(true);
if (player_has_orb())
@@ -226,9 +228,9 @@ brand_type player::damage_brand(int)
brand_type ret = SPWPN_NORMAL;
const int wpn = equip[EQ_WEAPON];
- if (wpn != -1 && !you.melded[EQ_WEAPON])
+ if (wpn != -1 && !melded[EQ_WEAPON])
{
- if (!is_range_weapon(inv[wpn]) && !you.suppressed())
+ if (!is_range_weapon(inv[wpn]) && !suppressed())
ret = get_weapon_brand(inv[wpn]);
}
else if (duration[DUR_CONFUSING_TOUCH])
@@ -281,7 +283,7 @@ item_def *player::slot_item(equipment_type eq, bool include_melded) const
// Returns the item in the player's weapon slot.
item_def *player::weapon(int /* which_attack */) const
{
- if (you.melded[EQ_WEAPON])
+ if (melded[EQ_WEAPON])
return NULL;
return slot_item(EQ_WEAPON, false);
@@ -361,7 +363,7 @@ bool player::could_wield(const item_def &item, bool ignore_brand,
}
// Returns the shield the player is wearing, or NULL if none.
-item_def *player::shield()
+item_def *player::shield() const
{
return slot_item(EQ_SHIELD, false);
}
@@ -434,9 +436,9 @@ string player::hand_name(bool plural, bool *can_plural) const
{
if (species == SP_FELID)
str = "paw";
- else if (you.has_usable_claws())
+ else if (has_usable_claws())
str = "claw";
- else if (you.has_usable_tentacles())
+ else if (has_usable_tentacles())
str = "tentacle";
}
@@ -471,9 +473,9 @@ string player::foot_name(bool plural, bool *can_plural) const
{
if (player_mutation_level(MUT_HOOVES) >= 3)
str = "hoof";
- else if (you.has_usable_talons())
+ else if (has_usable_talons())
str = "talon";
- else if (you.has_usable_tentacles())
+ else if (has_usable_tentacles())
{
str = "tentacles";
*can_plural = false;
@@ -483,6 +485,8 @@ string player::foot_name(bool plural, bool *can_plural) const
str = "underbelly";
*can_plural = false;
}
+ else if (species == SP_FELID)
+ str = "paw";
else if (fishtail)
{
str = "tail";
@@ -682,20 +686,11 @@ bool player::can_go_berserk(bool intentional, bool potion, bool quiet) const
return false;
}
- if (!you.can_bleed(false))
+ if (is_lifeless_undead())
{
- // XXX: This message assumes that you're undead.
if (verbose)
mpr("You cannot raise a blood rage in your lifeless body.");
- // or else you won't notice -- no message here
- return false;
- }
-
- if (you.species == SP_GARGOYLE && you.petrifying())
- {
- if (verbose)
- mpr("You cannot rage while you turn to stone.");
return false;
}
@@ -703,7 +698,7 @@ bool player::can_go_berserk(bool intentional, bool potion, bool quiet) const
// trigger when the player attempts to activate berserk,
// auto-iding at that point, but also killing the berserk and
// wasting a turn.
- if (you.stasis(false))
+ if (stasis(false))
{
if (verbose)
{
@@ -712,12 +707,12 @@ bool player::can_go_berserk(bool intentional, bool potion, bool quiet) const
return false;
}
- if (!intentional && !potion && you.clarity())
+ if (!intentional && !potion && clarity())
{
if (verbose)
{
mpr("You're too calm and focused to rage.");
- if (!you.clarity(false))
+ if (!clarity(false))
maybe_id_clarity();
}
@@ -725,7 +720,7 @@ bool player::can_go_berserk(bool intentional, bool potion, bool quiet) const
}
ASSERT(HUNGER_STARVING - 100 + BERSERK_NUTRITION < 2066);
- if (you.hunger <= 2066)
+ if (hunger <= 2066)
{
if (verbose)
mpr("You're too hungry to go berserk.");
@@ -742,20 +737,20 @@ bool player::berserk() const
bool player::can_cling_to_walls() const
{
- return you.form == TRAN_SPIDER;
+ return form == TRAN_SPIDER;
}
bool player::is_web_immune() const
{
// Spider form
- return can_cling_to_walls();
+ return form == TRAN_SPIDER;
}
bool player::shove(const char* feat_name)
{
for (distance_iterator di(pos()); di; ++di)
if (in_bounds(*di) && !actor_at(*di) && !is_feat_dangerous(grd(*di))
- && you.can_pass_through_feat(grd(*di)))
+ && can_pass_through_feat(grd(*di)))
{
moveto(*di);
if (*feat_name)
@@ -768,5 +763,5 @@ bool player::shove(const char* feat_name)
int player::constriction_damage() const
{
- return roll_dice(2, div_rand_round(you.strength(), 5));
+ return roll_dice(2, div_rand_round(strength(), 5));
}