OSDN Git Service

劣化攻撃でまれ(1/13)にpvalが下がるようにした。
authorhabu <habu@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 2 Mar 2002 05:09:05 +0000 (05:09 +0000)
committerhabu <habu@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 2 Mar 2002 05:09:05 +0000 (05:09 +0000)
src/spells3.c

index 3a6528b..6a2e0f6 100644 (file)
@@ -875,6 +875,7 @@ bool apply_disenchant(int mode)
        int             t = 0;
        object_type     *o_ptr;
        char            o_name[MAX_NLEN];
+       int to_h, to_d, to_a, pval;
 
 
        /* Unused */
@@ -902,7 +903,7 @@ bool apply_disenchant(int mode)
 
 
        /* Nothing to disenchant */
-       if ((o_ptr->to_h <= 0) && (o_ptr->to_d <= 0) && (o_ptr->to_a <= 0))
+       if ((o_ptr->to_h <= 0) && (o_ptr->to_d <= 0) && (o_ptr->to_a <= 0) && (o_ptr->pval <= 1))
        {
                /* Nothing to notice */
                return (FALSE);
@@ -931,6 +932,12 @@ msg_format("%s(%c)
        }
 
 
+       /* Memorize old value */
+       to_h = o_ptr->to_h;
+       to_d = o_ptr->to_d;
+       to_a = o_ptr->to_a;
+       pval = o_ptr->pval;
+
        /* Disenchant tohit */
        if (o_ptr->to_h > 0) o_ptr->to_h--;
        if ((o_ptr->to_h > 5) && (randint0(100) < 20)) o_ptr->to_h--;
@@ -943,26 +950,33 @@ msg_format("%s(%c)
        if (o_ptr->to_a > 0) o_ptr->to_a--;
        if ((o_ptr->to_a > 5) && (randint0(100) < 20)) o_ptr->to_a--;
 
-       /* Message */
+       /* Disenchant pval (occasionally) */
+       if ((o_ptr->pval > 1) && one_in_(13)) o_ptr->pval--;
+
+       if ((to_h != o_ptr->to_h) || (to_d != o_ptr->to_d) ||
+           (to_a != o_ptr->to_a) || (pval != o_ptr->pval))
+       {
+               /* Message */
 #ifdef JP
-msg_format("%s(%c)¤ÏÎô²½¤·¤Æ¤·¤Þ¤Ã¤¿¡ª",
-                   o_name, index_to_label(t) );
+               msg_format("%s(%c)¤ÏÎô²½¤·¤Æ¤·¤Þ¤Ã¤¿¡ª",
+                          o_name, index_to_label(t) );
 #else
-       msg_format("Your %s (%c) %s disenchanted!",
-                  o_name, index_to_label(t),
-                  ((o_ptr->number != 1) ? "were" : "was"));
+               msg_format("Your %s (%c) %s disenchanted!",
+                          o_name, index_to_label(t),
+                          ((o_ptr->number != 1) ? "were" : "was"));
 #endif
 
-       chg_virtue(V_HARMONY, 1);
-       chg_virtue(V_ENCHANT, -2);
+               chg_virtue(V_HARMONY, 1);
+               chg_virtue(V_ENCHANT, -2);
 
-       /* Recalculate bonuses */
-       p_ptr->update |= (PU_BONUS);
+               /* Recalculate bonuses */
+               p_ptr->update |= (PU_BONUS);
 
-       /* Window stuff */
-       p_ptr->window |= (PW_EQUIP | PW_PLAYER);
+               /* Window stuff */
+               p_ptr->window |= (PW_EQUIP | PW_PLAYER);
 
-       calc_android_exp();
+               calc_android_exp();
+       }
 
        /* Notice */
        return (TRUE);