OSDN Git Service

[Fix] #41264 WIP,calc_to_damage()再整理中.
authordeskull <deskull@users.sourceforge.jp>
Wed, 27 Jan 2021 22:16:32 +0000 (07:16 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 27 Jan 2021 22:16:32 +0000 (07:16 +0900)
src/player/player-status-flags.c
src/player/player-status.c

index d92510f..4b123c0 100644 (file)
@@ -1594,6 +1594,9 @@ bool has_right_hand_weapon(player_type *creature_ptr)
  */
 bool has_left_hand_weapon(player_type *creature_ptr) { return has_melee_weapon(creature_ptr, INVEN_LARM); }
 
+/*
+ * @brief 両手持ち状態かどうかを判定する
+ */
 bool has_two_handed_weapons(player_type *creature_ptr)
 {
     if (can_two_hands_wielding(creature_ptr)) {
index 3c60b5e..9da4d6b 100644 (file)
@@ -2969,14 +2969,9 @@ static s16b calc_to_damage(player_type *creature_ptr, INVENTORY_IDX slot, bool i
                 bonus_to_d = (o_ptr->to_d + 1) / 2;
         }
 
-        if ((i == INVEN_LEFT || i == INVEN_RIGHT) && !has_two_handed_weapons(creature_ptr)) {
+        if ((i == INVEN_LEFT || i == INVEN_RIGHT) && has_two_handed_weapons(creature_ptr)) {
             damage += (s16b)bonus_to_d;
-        } else if (has_right_hand_weapon(creature_ptr) && has_left_hand_weapon(creature_ptr)) {
-            if (id == 0)
-                damage += (bonus_to_d > 0) ? (bonus_to_d + 1) / 2 : bonus_to_d;
-            if (id == 1)
-                damage += (bonus_to_d > 0) ? bonus_to_d / 2 : bonus_to_d;
-        } else if (id == get_default_hand(creature_ptr)) {
+        } else if ((has_right_hand_weapon(creature_ptr) && id == 0 && i == INVEN_RIGHT)) {// || (has_left_hand_weapon(creature_ptr) && id == 1 && i == INVEN_LEFT)) {
             damage += (s16b)bonus_to_d;
         }
     }