summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ranged_attack.cc
diff options
context:
space:
mode:
authorNicholas Feinberg <pleasingfung@gmail.com>2014-07-13 15:38:23 -0700
committerNicholas Feinberg <pleasingfung@gmail.com>2014-07-13 17:19:02 -0700
commitd22ebac678fa1c1d0a60048a72ba445e3ed190d1 (patch)
treea63ccd59b4bb01408be9fc5843c20f2f878e2cd2 /crawl-ref/source/ranged_attack.cc
parent5562ea36cc1ba917da155a9dd93e6bf71d022771 (diff)
downloadcrawl-ref-d22ebac678fa1c1d0a60048a72ba445e3ed190d1.tar.gz
crawl-ref-d22ebac678fa1c1d0a60048a72ba445e3ed190d1.zip
Separate 'permanent' and 'temporary' monster hit dice
As part of a wider scheme to make draining temporary.
Diffstat (limited to 'crawl-ref/source/ranged_attack.cc')
-rw-r--r--crawl-ref/source/ranged_attack.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/crawl-ref/source/ranged_attack.cc b/crawl-ref/source/ranged_attack.cc
index 7c7ef2c9cd..376921ddae 100644
--- a/crawl-ref/source/ranged_attack.cc
+++ b/crawl-ref/source/ranged_attack.cc
@@ -70,7 +70,7 @@ int ranged_attack::calc_to_hit(bool random)
orig_to_hit +=
(attacker->is_player())
? maybe_random2(you.attribute[ATTR_PORTAL_PROJECTILE] / 4, random)
- : 3 * attacker->as_monster()->hit_dice;
+ : 3 * attacker->as_monster()->get_hit_dice();
}
int hit = orig_to_hit;
@@ -374,7 +374,7 @@ int ranged_attack::calc_mon_to_hit_base()
{
ASSERT(attacker->is_monster());
const int hd_mult = attacker->as_monster()->is_archer() ? 15 : 9;
- return 18 + attacker->get_experience_level() * hd_mult / 6;
+ return 18 + attacker->get_hit_dice() * hd_mult / 6;
}
int ranged_attack::apply_damage_modifiers(int damage, int damage_max,
@@ -383,7 +383,7 @@ int ranged_attack::apply_damage_modifiers(int damage, int damage_max,
ASSERT(attacker->is_monster());
if (attacker->as_monster()->is_archer())
{
- const int bonus = attacker->get_experience_level() * 4 / 3;
+ const int bonus = attacker->get_hit_dice() * 4 / 3;
damage += random2avg(bonus, 2);
}
half_ac = false;
@@ -565,8 +565,8 @@ bool ranged_attack::blowgun_check(special_missile_type type)
if (attacker->is_monster())
{
- int chance = 85 - ((defender->get_experience_level()
- - attacker->get_experience_level()) * 5 / 2);
+ int chance = 85 - ((defender->get_hit_dice()
+ - attacker->get_hit_dice()) * 5 / 2);
chance += enchantment * 4;
chance = min(95, chance);
@@ -582,15 +582,15 @@ bool ranged_attack::blowgun_check(special_missile_type type)
// You have a really minor chance of hitting with no skills or good
// enchants.
- if (defender->get_experience_level() < 15 && random2(100) <= 2)
+ if (defender->get_hit_dice() < 15 && random2(100) <= 2)
return true;
const int resist_roll = 2 + random2(4 + skill + enchantment);
dprf("Brand rolled %d against defender HD: %d.",
- resist_roll, defender->get_experience_level());
+ resist_roll, defender->get_hit_dice());
- if (resist_roll < defender->get_experience_level())
+ if (resist_roll < defender->get_hit_dice())
{
if (needs_message)
{
@@ -615,7 +615,7 @@ int ranged_attack::blowgun_duration_roll(special_missile_type type)
return 2;
const int base_power = (attacker->is_monster())
- ? attacker->get_experience_level()
+ ? attacker->get_hit_dice()
: attacker->skill_rdiv(SK_THROWING);
const int plus = using_weapon() ? weapon->plus : 0;