From 6091eda0db6f7097cdb91f2ea4299ec25a4417b7 Mon Sep 17 00:00:00 2001 From: deskull Date: Sun, 5 Jul 2020 22:59:09 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#40514=20=E8=A3=85=E5=82=99?= =?utf8?q?=E5=91=AA=E3=81=84=E3=81=AB=E3=82=88=E3=82=8BAC=E8=A8=88?= =?utf8?q?=E7=AE=97=E5=87=A6=E7=90=86=E3=82=92=E7=A7=BB=E5=8B=95=EF=BC=8E?= =?utf8?q?=20/=20Moved=20AC=20calculation=20by=20curse=20of=20equipment=20?= =?utf8?q?processing.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/object/object-kind.c | 12 ------------ src/player/player-status.c | 23 +++++++++++++++++++++-- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/object/object-kind.c b/src/object/object-kind.c index 340d91d69..88ff87e7c 100644 --- a/src/object/object-kind.c +++ b/src/object/object-kind.c @@ -272,18 +272,6 @@ void calc_equipment_status(player_type* creature_ptr) { } } - if (o_ptr->curse_flags & TRC_LOW_AC) { - if (o_ptr->curse_flags & TRC_HEAVY_CURSE) { - creature_ptr->to_a -= 30; - if (object_is_fully_known(o_ptr)) - creature_ptr->dis_to_a -= 30; - } else { - creature_ptr->to_a -= 10; - if (object_is_fully_known(o_ptr)) - creature_ptr->dis_to_a -= 10; - } - } - 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 b63524397..806e529c1 100644 --- a/src/player/player-status.c +++ b/src/player/player-status.c @@ -3038,7 +3038,16 @@ static void calc_to_ac(player_type *creature_ptr) if (!o_ptr->k_idx) continue; creature_ptr->to_a += o_ptr->to_a; - } + + if (o_ptr->curse_flags & TRC_LOW_AC) { + if (o_ptr->curse_flags & TRC_HEAVY_CURSE) { + creature_ptr->to_a -= 30; + } else { + creature_ptr->to_a -= 10; + } + } + + } if (is_specific_player_race(creature_ptr, RACE_GOLEM) || is_specific_player_race(creature_ptr, RACE_ANDROID)) { creature_ptr->to_a += 10 + (creature_ptr->lev * 2 / 5); @@ -3146,7 +3155,17 @@ static void calc_to_ac_display(player_type *creature_ptr) continue; if (object_is_known(o_ptr)) creature_ptr->dis_to_a += o_ptr->to_a; - } + + if (o_ptr->curse_flags & TRC_LOW_AC) { + if (o_ptr->curse_flags & TRC_HEAVY_CURSE) { + if (object_is_fully_known(o_ptr)) + creature_ptr->dis_to_a -= 30; + } else { + if (object_is_fully_known(o_ptr)) + creature_ptr->dis_to_a -= 10; + } + } + } if (is_specific_player_race(creature_ptr, RACE_GOLEM) || is_specific_player_race(creature_ptr, RACE_ANDROID)) { creature_ptr->dis_to_a += 10 + (creature_ptr->lev * 2 / 5); -- 2.11.0