OSDN Git Service

レイシャルパワーに関する変更.
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 6 Jun 2003 20:51:43 +0000 (20:51 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 6 Jun 2003 20:51:43 +0000 (20:51 +0000)
* MPがコストに満たない場合はいきなりHPを消費するのではなく, MPを0にし
  てから差分のダメージを受けるように変更.
* レイシャルパワー使用時の低HP警告の仕様を変更し, (コスト - MP) がHP
  を上回る場合に警告を出すようにした.

src/racial.c

index b455ca5..b19dfa1 100644 (file)
@@ -728,7 +728,6 @@ static int racial_chance(power_desc_type *pd_ptr)
 
 
 static int  racial_cost;
-static bool racial_use_hp;
 
 /*
  * Note: return value indicates that we have succesfully used the power
@@ -739,12 +738,12 @@ static int racial_aux(power_desc_type *pd_ptr)
        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)
@@ -773,7 +772,7 @@ static int racial_aux(power_desc_type *pd_ptr)
        }
 
        /* Risk death? */
-       else if (racial_use_hp && (p_ptr->chp < racial_cost))
+       else if (p_ptr->chp < use_hp)
        {
 #ifdef JP
                if (!get_check("ËÜÅö¤Ëº£¤Î¿ê¼å¤·¤¿¾õÂ֤Ǥ³¤ÎǽÎϤò»È¤¤¤Þ¤¹¤«¡©"))
@@ -3777,20 +3776,20 @@ prt("                            Lv   MP 
        {
                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);