From eeb5fbababe665cfdb60156ff4c8c6ade374477c Mon Sep 17 00:00:00 2001 From: Habu Date: Fri, 5 Feb 2021 21:30:51 +0900 Subject: [PATCH] =?utf8?q?[fix]=20#41475=20=E9=98=B2=E5=85=B7=E3=81=AE?= =?utf8?q?=E5=91=BD=E4=B8=AD=E4=BF=AE=E6=AD=A3=E3=81=8C=E5=8F=8D=E6=98=A0?= =?utf8?q?=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 防具の命中修正を加算する部分で、「防具が鑑定されておらずかつ 本当の修正値を計算しない時はスキップする」という判定をする 条件式が誤っているため、加算するべき修正値が加算されていなかった。 ダメージ修正のほうは正しい条件式になっているので、 命中修正もそれに合わせる。 また、is_true_valueという変数名は「本当の修正値を計算する」という 意図であるが、真偽値の変数名としてTRUEがかぶっており 紛らわしいのでis_real_valueという名称に変更する。 --- src/player/player-status.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/player/player-status.c b/src/player/player-status.c index 599aa2d3a..3fccdd5f4 100644 --- a/src/player/player-status.c +++ b/src/player/player-status.c @@ -121,7 +121,7 @@ static s16b calc_constitution_addition(player_type *creature_ptr); static s16b calc_charisma_addition(player_type *creature_ptr); static s16b calc_to_magic_chance(player_type *creature_ptr); static ARMOUR_CLASS calc_base_ac(player_type *creature_ptr); -static ARMOUR_CLASS calc_to_ac(player_type *creature_ptr, bool is_true_value); +static ARMOUR_CLASS calc_to_ac(player_type *creature_ptr, bool is_real_value); static s16b calc_speed(player_type *creature_ptr); static s16b calc_double_weapon_penalty(player_type *creature_ptr, INVENTORY_IDX slot); static void calc_use_status(player_type *creature_ptr, int status); @@ -130,10 +130,10 @@ static void calc_ind_status(player_type *creature_ptr, int status); static s16b calc_riding_bow_penalty(player_type *creature_ptr); static void put_equipment_warning(player_type *creature_ptr); -static s16b calc_to_damage(player_type *creature_ptr, INVENTORY_IDX slot, bool is_true_value); -static s16b calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot, bool is_true_value); +static s16b calc_to_damage(player_type *creature_ptr, INVENTORY_IDX slot, bool is_real_value); +static s16b calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot, bool is_real_value); -static s16b calc_to_hit_bow(player_type *creature_ptr, bool is_true_value); +static s16b calc_to_hit_bow(player_type *creature_ptr, bool is_real_value); static s16b calc_to_damage_misc(player_type *creature_ptr); static s16b calc_to_hit_misc(player_type *creature_ptr); @@ -2314,7 +2314,7 @@ static ARMOUR_CLASS calc_base_ac(player_type *creature_ptr) return ac; } -static ARMOUR_CLASS calc_to_ac(player_type *creature_ptr, bool is_true_value) +static ARMOUR_CLASS calc_to_ac(player_type *creature_ptr, bool is_real_value) { ARMOUR_CLASS ac = 0; if (creature_ptr->yoiyami) @@ -2347,15 +2347,15 @@ static ARMOUR_CLASS calc_to_ac(player_type *creature_ptr, bool is_true_value) o_ptr = &creature_ptr->inventory_list[i]; if (!o_ptr->k_idx) continue; - if (is_true_value || object_is_known(o_ptr)) + if (is_real_value || object_is_known(o_ptr)) ac += o_ptr->to_a; if (o_ptr->curse_flags & TRC_LOW_AC) { if (o_ptr->curse_flags & TRC_HEAVY_CURSE) { - if (is_true_value || object_is_fully_known(o_ptr)) + if (is_real_value || object_is_fully_known(o_ptr)) ac -= 30; } else { - if (is_true_value || object_is_fully_known(o_ptr)) + if (is_real_value || object_is_fully_known(o_ptr)) ac -= 10; } } @@ -2903,7 +2903,7 @@ void put_equipment_warning(player_type *creature_ptr) } } -static s16b calc_to_damage(player_type *creature_ptr, INVENTORY_IDX slot, bool is_true_value) +static s16b calc_to_damage(player_type *creature_ptr, INVENTORY_IDX slot, bool is_real_value) { object_type *o_ptr = &creature_ptr->inventory_list[slot]; BIT_FLAGS flgs[TR_FLAG_SIZE]; @@ -2964,7 +2964,7 @@ static s16b calc_to_damage(player_type *creature_ptr, INVENTORY_IDX slot, bool i || (i == INVEN_SUB_HAND && has_melee_weapon(creature_ptr, i)) || i == INVEN_BOW) continue; - if (!object_is_known(o_ptr) && !is_true_value) + if (!object_is_known(o_ptr) && !is_real_value) continue; bonus_to_d = o_ptr->to_d; @@ -3038,7 +3038,7 @@ static s16b calc_to_damage(player_type *creature_ptr, INVENTORY_IDX slot, bool i * @details * 'slot' MUST be INVEN_MAIN_HAND or INVEM_SUB_HAND. */ -static s16b calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot, bool is_true_value) +static s16b calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot, bool is_real_value) { s16b hit = 0; @@ -3112,7 +3112,7 @@ static s16b calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot, bool is_t } /* Low melee penalty */ - if ((object_is_fully_known(o_ptr) || is_true_value) && o_ptr->curse_flags & TRC_LOW_MELEE) { + if ((object_is_fully_known(o_ptr) || is_real_value) && o_ptr->curse_flags & TRC_LOW_MELEE) { if (o_ptr->curse_flags & TRC_HEAVY_CURSE) { hit -= 15; } else { @@ -3188,7 +3188,7 @@ static s16b calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot, bool is_t continue; /* Fake value does not include unknown objects' value */ - if (is_true_value || !object_is_known(o_ptr)) + if (!object_is_known(o_ptr) && !is_real_value) continue; int bonus_to_h = o_ptr->to_h; @@ -3254,7 +3254,7 @@ static s16b calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot, bool is_t return hit; } -static s16b calc_to_hit_bow(player_type *creature_ptr, bool is_true_value) +static s16b calc_to_hit_bow(player_type *creature_ptr, bool is_real_value) { s16b pow = 0; @@ -3325,7 +3325,7 @@ static s16b calc_to_hit_bow(player_type *creature_ptr, bool is_true_value) bonus_to_h = (o_ptr->to_h + 1) / 2; } - if (is_true_value || object_is_known(o_ptr)) + if (is_real_value || object_is_known(o_ptr)) pow += (s16b)bonus_to_h; } -- 2.11.0