From d9562253b2630ddaec017ec71c8d89ec27faccd9 Mon Sep 17 00:00:00 2001 From: iks Date: Thu, 12 Nov 2020 03:55:59 +0900 Subject: [PATCH] =?utf8?q?[Fix]=20=E6=AD=A6=E5=99=A8=E3=82=92=E4=B8=A1?= =?utf8?q?=E6=89=8B=E6=8C=81=E3=81=A1=E3=81=97=E3=81=A6=E3=81=84=E3=82=8B?= =?utf8?q?=E6=99=82=E3=81=AE=E4=BF=AE=E6=AD=A3=E3=81=8C=E3=82=82=E3=82=89?= =?utf8?q?=E3=81=88=E3=81=AA=E3=81=84=E3=81=93=E3=81=A8=E3=82=92=E5=88=A4?= =?utf8?q?=E5=AE=9A=E3=81=99=E3=82=8B=E9=96=A2=E6=95=B0=E3=81=AA=E3=81=AE?= =?utf8?q?=E3=81=AB=E3=80=81=E6=88=BB=E3=82=8A=E5=80=A4=E3=81=8C=E3=81=BB?= =?utf8?q?=E3=81=BC=E9=80=86=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=84?= =?utf8?q?=E3=81=9F=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3(=E6=AD=A6=E5=99=A8?= =?utf8?q?=E3=81=AE=E9=87=8D=E3=81=95=E3=83=9A=E3=83=8A=E3=83=AB=E3=83=86?= =?utf8?q?=E3=82=A3=E3=81=AFcalc=5Fto=5Fhit()=E3=81=AB=E7=B9=94=E3=82=8A?= =?utf8?q?=E8=BE=BC=E3=81=BF=E6=B8=88)=20/=20Fix=20that=20'Has=20disable?= =?utf8?q?=20bonus'=20returns=20nearly=20'Has=20enable=20bonus'.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/player/player-status-flags.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/player/player-status-flags.c b/src/player/player-status-flags.c index 86aa47a49..00e9bb956 100644 --- a/src/player/player-status-flags.c +++ b/src/player/player-status-flags.c @@ -1594,16 +1594,25 @@ BIT_FLAGS has_lite(player_type *creature_ptr) return result; } +/* + * @brief 両手持ちボーナスがもらえないかどうかを判定する。 / Does *not * get two hand wielding bonus. + * @detail + * Only can get hit bonuses when wieids an enough light weapon which is lighter than 5 times of weight limit. + * If its weight is 10 times heavier or more than weight limit, gets hit penalty in calc_to_hit(). + */ bool has_disable_two_handed_bonus(player_type *creature_ptr, int i) { - object_type *o_ptr; - o_ptr = &creature_ptr->inventory_list[INVEN_RARM + i]; - if (has_melee_weapon(creature_ptr, INVEN_RARM + i)) { - if (calc_weapon_weight_limit(creature_ptr) * 2 >= o_ptr->weight / 10 && has_two_handed_weapons(creature_ptr) - && (calc_weapon_weight_limit(creature_ptr) * 2 < o_ptr->weight / 5)) - return TRUE; + if (has_melee_weapon(creature_ptr, INVEN_RARM + i) && has_two_handed_weapons(creature_ptr)) { + object_type *o_ptr = &creature_ptr->inventory_list[INVEN_RARM + i]; + int limit = calc_weapon_weight_limit(creature_ptr) * 2; + + /* Enable when two hand wields an enough light weapon */ + if (limit >= o_ptr->weight / 5) + return FALSE; } - return FALSE; + + /* Disable when empty hands, one hand wieldings and heavy weapons */ + return TRUE; } bool has_icky_wield_weapon(player_type *creature_ptr, int i) -- 2.11.0