if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
- (void)drain_exp(d, d / 10, 95);
+ (void)drain_exp(p_ptr, d, d / 10, 95);
break;
}
if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
- (void)drain_exp(d, d / 10, 90);
+ (void)drain_exp(p_ptr, d, d / 10, 90);
break;
}
if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
- (void)drain_exp(d, d / 10, 75);
+ (void)drain_exp(p_ptr, d, d / 10, 75);
break;
}
if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
- (void)drain_exp(d, d / 10, 50);
+ (void)drain_exp(p_ptr, d, d / 10, 50);
break;
}
if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
- resist_drain = !drain_exp(d, d / 10, 50);
+ resist_drain = !drain_exp(p_ptr, d, d / 10, 50);
/* Heal the attacker? */
if (p_ptr->mimic_form)
* Drain experience
* If resisted to draining, return FALSE
*/
-bool drain_exp(s32b drain, s32b slip, int hold_exp_prob)
+bool drain_exp(player_type *creature_ptr, s32b drain, s32b slip, int hold_exp_prob)
{
/* Androids and their mimics are never drained */
- if (p_ptr->prace == RACE_ANDROID) return FALSE;
+ if (creature_ptr->prace == RACE_ANDROID) return FALSE;
- if (p_ptr->hold_exp && (randint0(100) < hold_exp_prob))
+ if (creature_ptr->hold_exp && (randint0(100) < hold_exp_prob))
{
/* Hold experience */
msg_print(_("しかし自己の経験値を守りきった!", "You keep hold of your experience!"));
}
/* Hold experience failed */
- if (p_ptr->hold_exp)
+ if (creature_ptr->hold_exp)
{
msg_print(_("経験値を少し吸い取られた気がする!", "You feel your experience slipping away!"));
lose_exp(slip);
extern void gain_exp(s32b amount);
extern void calc_android_exp(player_type *creature_ptr);
extern void lose_exp(s32b amount);
-extern bool drain_exp(s32b drain, s32b slip, int hold_exp_prob);
+extern bool drain_exp(player_type *creature_ptr, s32b drain, s32b slip, int hold_exp_prob);
extern void do_poly_self(player_type *creature_ptr);
extern bool set_ultimate_res(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
extern bool set_tim_res_nether(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
dam *= 6; dam /= (randint1(4) + 7);
}
}
- else if (!CHECK_MULTISHADOW()) drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
+ else if (!CHECK_MULTISHADOW()) drain_exp(p_ptr, 200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
if (PRACE_IS_(p_ptr, RACE_SPECTRE) && !CHECK_MULTISHADOW())
{
}
if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
{
- drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
+ drain_exp(p_ptr, 5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
}
if (!p_ptr->resist_chaos || one_in_(9))