From 73f65b3ce53e8839921d205c5f8c5f7890452234 Mon Sep 17 00:00:00 2001 From: deskull Date: Fri, 17 Jul 2020 00:59:05 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#40514=20=E5=91=AA=E3=81=84?= =?utf8?q?=E8=A3=85=E5=82=99=E3=81=AB=E3=82=88=E3=82=8B=E5=91=BD=E4=B8=AD?= =?utf8?q?=E4=BF=AE=E6=AD=A3=E8=A1=A8=E7=A4=BA=E3=82=92=E7=A7=BB=E5=8B=95?= =?utf8?q?=EF=BC=8E=20/=20Moved=20displaying=20hit=20power=20calculation?= =?utf8?q?=20processing=20by=20cursed=20weapon.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/object/object-kind.c | 13 ------------- src/player/player-status.c | 22 +++++++++++++++++++++- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/object/object-kind.c b/src/object/object-kind.c index 5f47cca15..c53e70fbb 100644 --- a/src/object/object-kind.c +++ b/src/object/object-kind.c @@ -246,19 +246,6 @@ void calc_equipment_status(player_type* creature_ptr) { if (o_ptr->tval == TV_CAPTURE) continue; - if (o_ptr->curse_flags & TRC_LOW_MELEE) { - int slot = i - INVEN_RARM; - if (slot >= 2) { - if (o_ptr->curse_flags & TRC_HEAVY_CURSE) { - if (object_is_fully_known(o_ptr)) - creature_ptr->dis_to_h_b -= 15; - } else { - if (object_is_fully_known(o_ptr)) - creature_ptr->dis_to_h_b -= 5; - } - } - } - if (i == INVEN_RARM && has_melee_weapon(creature_ptr, i)) continue; if (i == INVEN_LARM && has_melee_weapon(creature_ptr, i)) diff --git a/src/player/player-status.c b/src/player/player-status.c index 68c8a901f..b9eac7426 100644 --- a/src/player/player-status.c +++ b/src/player/player-status.c @@ -3752,6 +3752,25 @@ static void calc_to_hit_bow_display(player_type *creature_ptr) { creature_ptr->dis_to_h_b += ((int)(adj_dex_th[creature_ptr->stat_ind[A_DEX]]) - 128); creature_ptr->dis_to_h_b += ((int)(adj_str_th[creature_ptr->stat_ind[A_STR]]) - 128); + for (int i = INVEN_RARM; i < INVEN_TOTAL; i++) { + object_type *o_ptr; + BIT_FLAGS flgs[TR_FLAG_SIZE]; + o_ptr = &creature_ptr->inventory_list[i]; + if (!o_ptr->k_idx) + continue; + object_flags(o_ptr, flgs); + + if (object_is_fully_known(o_ptr)) { + if (o_ptr->curse_flags & TRC_LOW_MELEE) { + if (o_ptr->curse_flags & TRC_HEAVY_CURSE) { + creature_ptr->dis_to_h_b -= 15; + } else { + creature_ptr->dis_to_h_b -= 5; + } + } + } + } + if (creature_ptr->stun > 50) { creature_ptr->dis_to_h_b -= 20; } else if (creature_ptr->stun) { @@ -3769,7 +3788,8 @@ static void calc_to_hit_bow_display(player_type *creature_ptr) { if (creature_ptr->shero) { creature_ptr->dis_to_h_b -= 12; } - + + } static void calc_to_damage_misc(player_type *creature_ptr) -- 2.11.0