From: iks Date: Sat, 9 Feb 2013 10:44:50 +0000 (+0000) Subject: Improve broken weapon repairing service. Broken sword become TV_SWORD in 4/5. If... X-Git-Tag: v2.1.2~99 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;ds=sidebyside;h=4332e4539f567f34a1f5ce3938264917b1776989;p=hengband%2Fhengband.git Improve broken weapon repairing service. Broken sword become TV_SWORD in 4/5. If repaired to a base item which has some abilities, copy them to repaired item. --- diff --git a/src/bldg.c b/src/bldg.c index 0952fa5d6..0d76b7e91 100644 --- a/src/bldg.c +++ b/src/bldg.c @@ -4321,7 +4321,7 @@ static int repair_broken_weapon_aux(int bcost) else /* TV_BROKEN_SWORD */ { /* Repair to a sword or sometimes material's type weapon */ - int tval = (one_in_(5) ? TV_SWORD : mo_ptr->tval); + int tval = (one_in_(5) ? mo_ptr->tval : TV_SWORD); while(1) { @@ -4368,6 +4368,11 @@ static int repair_broken_weapon_aux(int bcost) o_ptr->dd = k_ptr->dd; o_ptr->ds = k_ptr->ds; + /* Copy base object's ability */ + for (i = 0; i < TR_FLAG_SIZE; i++) o_ptr->art_flags[i] |= k_ptr->flags[i]; + if (k_ptr->pval) o_ptr->pval = MAX(o_ptr->pval, randint1(k_ptr->pval)); + if (have_flag(k_ptr->flags, TR_ACTIVATE)) o_ptr->xtra2 = k_ptr->act_idx; + /* Dice up */ if (dd_bonus) {