From 4b0791f82b934b352c5bbe8952c018f2102e59be Mon Sep 17 00:00:00 2001 From: deskull Date: Wed, 19 Aug 2020 03:04:27 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#40514=20player=5Ftype=20=E3=81=AE?= =?utf8?q?=20heavy=5Fshoot=20=E3=82=92=E5=BB=83=E6=AD=A2=E3=81=97=E3=81=A6?= =?utf8?q?=20is=5Fheavy=5Fshoot()=20=E3=82=92=E7=9B=B4=E6=8E=A5=E5=8F=82?= =?utf8?q?=E7=85=A7=EF=BC=8E=20/=20Delete=20heavy=5Fshoot=20of=20player=5F?= =?utf8?q?type=20and=20refer=20directly=20to=20is=5Fheavy=5Fshoot().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/player/player-status.c | 18 ++++++++---------- src/player/player-status.h | 1 - 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/player/player-status.c b/src/player/player-status.c index 980e2712c..333eb22fc 100644 --- a/src/player/player-status.c +++ b/src/player/player-status.c @@ -451,19 +451,17 @@ void calc_bonuses(player_type *creature_ptr) creature_ptr->to_a = calc_to_ac(creature_ptr, TRUE); creature_ptr->dis_ac = calc_base_ac(creature_ptr); creature_ptr->dis_to_a = calc_to_ac(creature_ptr, FALSE); - + for (int i = 0; i < A_MAX; i++) { calc_top_status(creature_ptr, i); calc_use_status(creature_ptr, i); calc_ind_status(creature_ptr, i); } - o_ptr = &creature_ptr->inventory_list[INVEN_BOW]; - creature_ptr->heavy_shoot = is_heavy_shoot(creature_ptr, o_ptr); - + o_ptr = &creature_ptr->inventory_list[INVEN_BOW]; if (o_ptr->k_idx) { creature_ptr->tval_ammo = (byte)bow_tval_ammo(o_ptr); - if (o_ptr->k_idx && !creature_ptr->heavy_shoot) { + if (o_ptr->k_idx && !is_heavy_shoot(creature_ptr, &creature_ptr->inventory_list[INVEN_BOW])) { creature_ptr->num_fire = calc_num_fire(creature_ptr, o_ptr); } } @@ -2870,16 +2868,16 @@ static s16b calc_riding_bow_penalty(player_type *creature_ptr) void put_equipment_warning(player_type *creature_ptr) { - if (creature_ptr->old_heavy_shoot != creature_ptr->heavy_shoot) { - if (creature_ptr->heavy_shoot) { + bool heavy_shoot = is_heavy_shoot(creature_ptr, &creature_ptr->inventory_list[INVEN_BOW]); + if (creature_ptr->old_heavy_shoot != heavy_shoot) { + if (heavy_shoot) { msg_print(_("こんな重い弓を装備しているのは大変だ。", "You have trouble wielding such a heavy bow.")); } else if (creature_ptr->inventory_list[INVEN_BOW].k_idx) { msg_print(_("この弓なら装備していても辛くない。", "You have no trouble wielding your bow.")); } else { msg_print(_("重い弓を装備からはずして体が楽になった。", "You feel relieved to put down your heavy bow.")); } - - creature_ptr->old_heavy_shoot = creature_ptr->heavy_shoot; + creature_ptr->old_heavy_shoot = heavy_shoot; } for (int i = 0; i < 2; i++) { @@ -3505,7 +3503,7 @@ static s16b calc_to_hit_bow(player_type *creature_ptr, bool is_true_value) } if (o_ptr->k_idx) { - if (o_ptr->k_idx && !creature_ptr->heavy_shoot) { + if (o_ptr->k_idx && !is_heavy_shoot(creature_ptr, &creature_ptr->inventory_list[INVEN_BOW])) { if ((creature_ptr->pclass == CLASS_SNIPER) && (creature_ptr->tval_ammo == TV_BOLT)) { pow += (10 + (creature_ptr->lev / 5)); } diff --git a/src/player/player-status.h b/src/player/player-status.h index 6f1ae1945..838db575a 100644 --- a/src/player/player-status.h +++ b/src/player/player-status.h @@ -353,7 +353,6 @@ typedef struct player_type { bool cumber_armor; /* Mana draining armor */ bool cumber_glove; /* Mana draining gloves */ bool heavy_wield[2]; /* Heavy weapon */ - bool heavy_shoot; /* Heavy shooter */ bool icky_wield[2]; /* Icky weapon */ bool riding_wield[2]; /* Riding weapon */ bool riding_ryoute; /* Riding weapon */ -- 2.11.0