summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/abl-show.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/abl-show.cc')
-rw-r--r--crawl-ref/source/abl-show.cc22
1 files changed, 9 insertions, 13 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index bb69c1b8d8..a16fdf3ca6 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -702,6 +702,8 @@ static talent _get_talent(ability_type ability, bool check_confused)
case ABIL_TROG_BERSERK: // piety >= 30
invoc = true;
failure = 30 - you.piety; // starts at 0%
+ if (player_mental_clarity(true))
+ failure += 80;
break;
case ABIL_TROG_REGEN_MR: // piety >= 50
@@ -975,11 +977,8 @@ static bool _check_ability_possible(const ability_def& abil,
if (hungerCheck && you.species != SP_VAMPIRE)
{
const int expected_hunger = you.hunger - abil.food_cost * 2;
-#ifdef DEBUG_DIAGNOSTICS
- mprf(MSGCH_DIAGNOSTICS,
- "hunger: %d, max. food_cost: %d, expected hunger: %d",
+ dprf("hunger: %d, max. food_cost: %d, expected hunger: %d",
you.hunger, abil.food_cost * 2, expected_hunger);
-#endif
// Safety margin for natural hunger, mutations etc.
if (expected_hunger <= 150)
{
@@ -1102,7 +1101,8 @@ static bool _check_ability_possible(const ability_def& abil,
mpr("You're too hungry to berserk.");
return (false);
}
- return (you.can_go_berserk(true) && berserk_check_wielded_weapon());
+ return (you.can_go_berserk(true, abil.ability == ABIL_TROG_BERSERK)
+ && berserk_check_wielded_weapon());
case ABIL_FLY_II:
if (you.duration[DUR_EXHAUSTED])
@@ -1161,7 +1161,7 @@ static bool _activate_talent(const talent& tal)
}
if ((tal.which == ABIL_EVOKE_BERSERK || tal.which == ABIL_TROG_BERSERK)
- && !you.can_go_berserk(true))
+ && !you.can_go_berserk(true, tal.which == ABIL_TROG_BERSERK))
{
crawl_state.zero_turns_taken();
return (false);
@@ -1745,7 +1745,7 @@ static bool _do_ability(const ability_def& abil)
case ABIL_TROG_BERSERK:
// Trog abilities don't use or train invocations.
- go_berserk(true);
+ go_berserk(true, true);
break;
case ABIL_TROG_REGEN_MR:
@@ -2080,9 +2080,7 @@ static bool _do_ability(const ability_def& abil)
case ABIL_CHEIBRIADOS_SLOUCH:
mpr("You can feel time thicken.");
-#ifdef DEBUG_DIAGNOSTICS
- mprf(MSGCH_DIAGNOSTICS, "your speed is %d", player_movement_speed());
-#endif
+ dprf("your speed is %d", player_movement_speed());
exercise(SK_INVOCATIONS, 4 + random2(4));
cheibriados_slouch(0);
break;
@@ -2118,10 +2116,8 @@ static void _pay_ability_costs(const ability_def& abil)
const int piety_cost = abil.piety_cost.cost();
const int hp_cost = abil.hp_cost.cost(you.hp_max);
-#if DEBUG_DIAGNOSTICS
- mprf(MSGCH_DIAGNOSTICS, "Cost: mp=%d; hp=%d; food=%d; piety=%d",
+ dprf("Cost: mp=%d; hp=%d; food=%d; piety=%d",
abil.mp_cost, hp_cost, food_cost, piety_cost );
-#endif
if (abil.mp_cost)
{