static int racial_cost;
-static bool racial_use_hp;
/*
* Note: return value indicates that we have succesfully used the power
s16b min_level = pd_ptr->level;
int use_stat = pd_ptr->stat;
int difficulty = pd_ptr->fail;
+ int use_hp = 0;
- racial_cost = pd_ptr->cost;
- racial_use_hp = FALSE;
+ racial_cost = pd_ptr->cost;
/* Not enough mana - use hp */
- if (p_ptr->csp < racial_cost) racial_use_hp = TRUE;
+ if (p_ptr->csp < racial_cost) use_hp = racial_cost - p_ptr->csp;
/* Power is not available yet */
if (p_ptr->lev < min_level)
}
/* Risk death? */
- else if (racial_use_hp && (p_ptr->chp < racial_cost))
+ else if (p_ptr->chp < use_hp)
{
#ifdef JP
if (!get_check("ËÜÅö¤Ëº£¤Î¿ê¼å¤·¤¿¾õÂ֤Ǥ³¤ÎǽÎϤò»È¤¤¤Þ¤¹¤«¡©"))
{
if (racial_cost)
{
- if (racial_use_hp)
+ int actual_racial_cost = racial_cost / 2 + randint1(racial_cost / 2);
+
+ /* If mana is not enough, player consumes hit point! */
+ if (p_ptr->csp < actual_racial_cost)
{
+ actual_racial_cost -= p_ptr->csp;
+ p_ptr->csp = 0;
#ifdef JP
- take_hit(DAMAGE_USELIFE, (racial_cost / 2) + randint1(racial_cost / 2),
- "²áÅ٤ν¸Ãæ", -1);
+ take_hit(DAMAGE_USELIFE, actual_racial_cost, "²áÅ٤ν¸Ãæ", -1);
#else
- take_hit(DAMAGE_USELIFE, (racial_cost / 2) + randint1(racial_cost / 2),
- "concentrating too hard", -1);
+ take_hit(DAMAGE_USELIFE, actual_racial_cost, "concentrating too hard", -1);
#endif
}
- else
- {
- p_ptr->csp -= (racial_cost / 2) + randint1(racial_cost / 2);
- }
+ else p_ptr->csp -= actual_racial_cost;
/* Redraw mana and hp */
p_ptr->redraw |= (PR_HP | PR_MANA);