From d22ebac678fa1c1d0a60048a72ba445e3ed190d1 Mon Sep 17 00:00:00 2001 From: Nicholas Feinberg Date: Sun, 13 Jul 2014 15:38:23 -0700 Subject: Separate 'permanent' and 'temporary' monster hit dice As part of a wider scheme to make draining temporary. --- crawl-ref/source/mon-cast.cc | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'crawl-ref/source/mon-cast.cc') diff --git a/crawl-ref/source/mon-cast.cc b/crawl-ref/source/mon-cast.cc index f2e8b3fa4f..2471cd3117 100644 --- a/crawl-ref/source/mon-cast.cc +++ b/crawl-ref/source/mon-cast.cc @@ -744,7 +744,7 @@ bolt mons_spell_beam(monster* mons, spell_type spell_cast, int power, beam.damage = dice_def(3, 2 + (power / 30)); // Natural ability, so don't use spell_hd here - beam.hit = 20 + (3 * mons->hit_dice); + beam.hit = 20 + (3 * mons->get_hit_dice()); beam.flavour = BEAM_ACID; break; @@ -825,7 +825,7 @@ bolt mons_spell_beam(monster* mons, spell_type spell_cast, int power, beam.name = "blast of flame"; beam.aux_source = "blast of fiery breath"; beam.short_name = "flames"; - beam.damage = dice_def(3, (mons->hit_dice * 2)); + beam.damage = dice_def(3, (mons->get_hit_dice() * 2)); beam.colour = RED; beam.hit = 30; beam.flavour = BEAM_FIRE; @@ -835,7 +835,7 @@ bolt mons_spell_beam(monster* mons, spell_type spell_cast, int power, case SPELL_CHAOS_BREATH: beam.name = "blast of chaos"; beam.aux_source = "blast of chaotic breath"; - beam.damage = dice_def(3, (mons->hit_dice * 2)); + beam.damage = dice_def(3, (mons->get_hit_dice() * 2)); beam.colour = ETC_RANDOM; beam.hit = 30; beam.flavour = BEAM_CHAOS; @@ -846,7 +846,7 @@ bolt mons_spell_beam(monster* mons, spell_type spell_cast, int power, beam.name = "blast of cold"; beam.aux_source = "blast of icy breath"; beam.short_name = "frost"; - beam.damage = dice_def(3, (mons->hit_dice * 2)); + beam.damage = dice_def(3, (mons->get_hit_dice() * 2)); beam.colour = WHITE; beam.hit = 30; beam.flavour = BEAM_COLD; @@ -855,7 +855,7 @@ bolt mons_spell_beam(monster* mons, spell_type spell_cast, int power, case SPELL_HOLY_BREATH: beam.name = "blast of cleansing flame"; - beam.damage = dice_def(3, (mons->hit_dice * 2)); + beam.damage = dice_def(3, (mons->get_hit_dice() * 2)); beam.colour = ETC_HOLY; beam.flavour = BEAM_HOLY; beam.hit = 18 + power / 25; @@ -864,7 +864,7 @@ bolt mons_spell_beam(monster* mons, spell_type spell_cast, int power, break; case SPELL_DRACONIAN_BREATH: - beam.damage = dice_def(3, (mons->hit_dice * 2)); + beam.damage = dice_def(3, (mons->get_hit_dice() * 2)); beam.hit = 30; beam.is_beam = true; break; @@ -1475,7 +1475,7 @@ static bool _valid_blink_away_ally(const monster* caster, const monster* target, static bool _valid_druids_call_target(const monster* caller, const monster* callee) { return mons_aligned(caller, callee) && mons_is_beast(callee->type) - && callee->hit_dice <= 20 + && callee->get_experience_level() <= 20 && !callee->is_shapeshifter() && !caller->see_cell(callee->pos()) && mons_habitat(callee) != HT_WATER @@ -2214,7 +2214,7 @@ static bool _should_recall(monster* caller) if (*mi != caller && caller->can_see(*mi) && mons_aligned(caller, *mi) && !mons_is_firewood(*mi)) { - ally_hd += mi->hit_dice; + ally_hd += mi->get_experience_level(); } } return 25 + roll_dice(2, 22) > ally_hd; @@ -2438,8 +2438,9 @@ static void _cast_druids_call(const monster* mon) shuffle_array(mon_list); const actor* target = mon->get_foe(); - const int num = min((int)mon_list.size(), mon->hit_dice > 10 ? random_range(2, 3) - : random_range(1, 2)); + const int num = min((int)mon_list.size(), + mon->get_experience_level() > 10 ? random_range(2, 3) + : random_range(1, 2)); for (int i = 0; i < num; ++i) _place_druids_call_beast(mon, mon_list[i], target); @@ -2633,14 +2634,14 @@ static bool _trace_los(monster* agent, bool (*vulnerable)(actor*)) tracer.friend_info.count++; tracer.friend_info.power += ai->is_player() ? you.experience_level - : ai->as_monster()->hit_dice; + : ai->as_monster()->get_experience_level(); } else { tracer.foe_info.count++; tracer.foe_info.power += ai->is_player() ? you.experience_level - : ai->as_monster()->hit_dice; + : ai->as_monster()->get_experience_level(); } } return mons_should_fire(tracer); @@ -2890,7 +2891,7 @@ bool handle_mon_spell(monster* mons, bolt &beem) } // Servitors never fail to (try) to cast a spell else if (mons->type != MONS_SPELLFORGED_SERVITOR - && random2(200) > mons->hit_dice + 50) + && random2(200) > mons->get_hit_dice() + 50) { return false; } @@ -3513,7 +3514,7 @@ static int _monster_abjure_target(monster* target, int pow, bool actual) bool shielded = false; if (you_worship(GOD_SHINING_ONE)) { - pow = pow * (30 - target->hit_dice) / 30; + pow = pow * (30 - target->get_hit_dice()) / 30; if (pow < duration) { simple_god_message(" protects your fellow warrior from evil " @@ -4753,7 +4754,7 @@ void mons_cast(monster* mons, bolt &pbolt, spell_type spell_cast, MSGCH_MONSTER_SPELL); // Not spell_hd(spell_cast); this is an invocation const int dur = BASELINE_DELAY - * min(5 + roll_dice(2, (mons->hit_dice * 10) / 3 + 1), 100); + * min(5 + roll_dice(2, (mons->get_hit_dice() * 10) / 3 + 1), 100); mons->add_ench(mon_enchant(ENCH_RAISED_MR, 0, mons, dur)); mons->add_ench(mon_enchant(ENCH_REGENERATION, 0, mons, dur)); dprf("Trog's Hand cast (dur: %d aut)", dur); @@ -5117,12 +5118,15 @@ void mons_cast(monster* mons, bolt &pbolt, spell_type spell_cast, case SPELL_BROTHERS_IN_ARMS: { // Invocation; don't use spell_hd - const int power = (mons->hit_dice * 20)+ random2(mons->hit_dice * 5) - random2(mons->hit_dice * 5); + const int power = (mons->get_hit_dice() * 20) + + random2(mons->get_hit_dice() * 5) + - random2(mons->get_hit_dice() * 5); monster_type to_summon; if (mons->type == MONS_SPRIGGAN_BERSERKER) { - monster_type berserkers[] = { MONS_POLAR_BEAR, MONS_ELEPHANT, MONS_DEATH_YAK }; + monster_type berserkers[] = { MONS_POLAR_BEAR, MONS_ELEPHANT, + MONS_DEATH_YAK }; to_summon = RANDOM_ELEMENT(berserkers); } else -- cgit v1.2.3-54-g00ecf