diff options
author | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-09-28 09:27:02 -0500 |
---|---|---|
committer | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-09-28 09:27:02 -0500 |
commit | 74e2f3fdac21f60de2ae454d0c3f7034599b3a14 (patch) | |
tree | dfd3a2a8d1a533ce8144abb1788ac36609460b89 /crawl-ref/source | |
parent | f0d371b01c7bb2385faf63d97dddd5f39eb1190b (diff) | |
download | crawl-ref-74e2f3fdac21f60de2ae454d0c3f7034599b3a14.tar.gz crawl-ref-74e2f3fdac21f60de2ae454d0c3f7034599b3a14.zip |
Add yet more minor cosmetic fixes.
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/externs.h | 6 | ||||
-rw-r--r-- | crawl-ref/source/mon-util.cc | 24 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 35 | ||||
-rw-r--r-- | crawl-ref/source/player.h | 2 |
5 files changed, 34 insertions, 35 deletions
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index 95428d89c0..3c8a6700d3 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -269,8 +269,8 @@ public: virtual int body_weight() const = 0; virtual int total_weight() const = 0; - virtual int damage_type(int which_attack = -1) = 0; virtual int damage_brand(int which_attack = -1) = 0; + virtual int damage_type(int which_attack = -1) = 0; virtual item_def *weapon(int which_attack = -1) = 0; virtual item_def *shield() = 0; virtual item_def *slot_item(equipment_type eq) = 0; @@ -1044,8 +1044,8 @@ public: size_type body_size(int psize = PSIZE_TORSO, bool base = false) const; int body_weight() const; int total_weight() const; - int damage_type(int attk = -1); int damage_brand(int attk = -1); + int damage_type(int attk = -1); int has_claws(bool allow_tran = true) const; bool has_usable_claws(bool allow_tran = true) const; item_def *weapon(int which_attack = -1); @@ -1390,8 +1390,8 @@ public: size_type body_size(int psize = PSIZE_TORSO, bool base = false) const; int body_weight() const; int total_weight() const; - int damage_type(int attk = -1); int damage_brand(int attk = -1); + int damage_type(int attk = -1); item_def *slot_item(equipment_type eq); item_def *mslot_item(mon_inv_type sl) const; diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index ac913ded54..e6c1ac97d6 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -3933,34 +3933,34 @@ int monsters::total_weight() const return (body_weight() + burden); } -int monsters::damage_type(int which_attack) +int monsters::damage_brand(int which_attack) { const item_def *mweap = weapon(which_attack); if (!mweap) { - const mon_attack_def atk = mons_attack_spec(this, which_attack); - return ((atk.type == AT_CLAW) ? DVORP_CLAWING : - (atk.type == AT_TENTACLE_SLAP) ? DVORP_TENTACLE - : DVORP_CRUSHING); + if (mons_is_ghost_demon(type)) + return (ghost->brand); + + return (SPWPN_NORMAL); } - return (get_vorpal_type(*mweap)); + return (!is_range_weapon(*mweap) ? get_weapon_brand(*mweap) : SPWPN_NORMAL); } -int monsters::damage_brand(int which_attack) +int monsters::damage_type(int which_attack) { const item_def *mweap = weapon(which_attack); if (!mweap) { - if (mons_is_ghost_demon(type)) - return (ghost->brand); - - return (SPWPN_NORMAL); + const mon_attack_def atk = mons_attack_spec(this, which_attack); + return ((atk.type == AT_CLAW) ? DVORP_CLAWING : + (atk.type == AT_TENTACLE_SLAP) ? DVORP_TENTACLE + : DVORP_CRUSHING); } - return (!is_range_weapon(*mweap) ? get_weapon_brand(*mweap) : SPWPN_NORMAL); + return (get_vorpal_type(*mweap)); } item_def *monsters::missiles() diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index f22a6d7d7f..9a2e180e1c 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -7709,7 +7709,7 @@ static void _handle_monster_move(monsters *monster) } } } - _handle_nearby_ability( monster ); + _handle_nearby_ability(monster); if (!mons_is_sleeping(monster) && !mons_is_wandering(monster) // Berserking monsters are limited to running up and diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 6461ec836c..b44093e7a4 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -378,24 +378,9 @@ bool move_player_to_grid( const coord_def& p, bool stepped, bool allow_shift, return (true); } -// Given an adjacent monster, returns true if the player can hit it (the -// monster should either not be submerged or submerged in shallow water, -// if the player has a polearm). -bool player_can_hit_monster(const monsters *mon) -{ - if (!mons_is_submerged(mon)) - return (true); - - if (grd(mon->pos()) != DNGN_SHALLOW_WATER) - return (false); - - const item_def *weapon = you.weapon(); - return (weapon && weapon_skill(*weapon) == SK_POLEARMS); -} - bool player_can_swim() { - return you.can_swim(); + return (you.can_swim()); } bool is_grid_dangerous(int grid) @@ -1090,15 +1075,29 @@ bool player_equip_unrand(int unrand_index) return (false); } +int player_damage_brand(void) +{ + return (you.damage_brand()); +} int player_damage_type(void) { return (you.damage_type()); } -int player_damage_brand(void) +// Given an adjacent monster, returns true if the player can hit it (the +// monster should not be submerged, or be submerged in shallow water if +// the player has a polearm). +bool player_can_hit_monster(const monsters *mon) { - return (you.damage_brand()); + if (!mons_is_submerged(mon)) + return (true); + + if (grd(mon->pos()) != DNGN_SHALLOW_WATER) + return (false); + + const item_def *weapon = you.weapon(); + return (weapon && weapon_skill(*weapon) == SK_POLEARMS); } int player_teleport(bool calc_unid) diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index c7a1597f3a..58bda4f796 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -70,8 +70,8 @@ bool berserk_check_wielded_weapon(void); int player_equip( equipment_type slot, int sub_type, bool calc_unid = true ); int player_equip_ego_type( int slot, int sub_type ); bool player_equip_unrand( int unrand_index ); -int player_damage_type(void); int player_damage_brand(void); +int player_damage_type(void); bool player_can_hit_monster(const monsters *mon); bool player_is_shapechanged(void); |