From 3b8a8176757736a186c4f458d9f50db95f992be6 Mon Sep 17 00:00:00 2001 From: habu Date: Sat, 2 Mar 2002 05:09:05 +0000 Subject: [PATCH] =?utf8?q?=E5=8A=A3=E5=8C=96=E6=94=BB=E6=92=83=E3=81=A7?= =?utf8?q?=E3=81=BE=E3=82=8C(1/13)=E3=81=ABpval=E3=81=8C=E4=B8=8B=E3=81=8C?= =?utf8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/spells3.c | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/src/spells3.c b/src/spells3.c index 3a6528b13..6a2e0f666 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -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); -- 2.11.0