OSDN Git Service

[Fix] 素手ボーナスが二重に適用されている
authordis- <dis.rogue@gmail.com>
Sat, 30 Jan 2021 04:55:44 +0000 (13:55 +0900)
committerdis- <dis.rogue@gmail.com>
Sat, 30 Jan 2021 04:55:44 +0000 (13:55 +0900)
重複分の削除と該当箇所の条件を整理。

src/player/player-status.c

index 1c75bff..88d1071 100644 (file)
@@ -3070,9 +3070,16 @@ static s16b calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot, bool is_t
 
     /* Default hand bonuses */
     if (get_default_hand(creature_ptr) == calc_hand) {
-        /* Add trained bonus of empty hands' combat when having no weapon and riding */
-        if ((!has_right_hand_weapon(creature_ptr) && (empty_hands(creature_ptr, TRUE) & EMPTY_HAND_LARM))
-            || (!has_left_hand_weapon(creature_ptr) && (empty_hands(creature_ptr, TRUE) & EMPTY_HAND_RARM))) {
+        switch (player_melee_type(creature_ptr)) {
+        case MELEE_TYPE_BAREHAND_RIGHT:
+            if (creature_ptr->riding)
+                break;
+            /* fall through */
+        case MELEE_TYPE_BAREHAND_LEFT:
+            if (creature_ptr->riding)
+                break;
+            /* fall through */
+        case MELEE_TYPE_BAREHAND_TWO:
             hit += (creature_ptr->skill_exp[GINOU_SUDE] - WEAPON_EXP_BEGINNER) / 200;
         }
 
@@ -3238,14 +3245,6 @@ static s16b calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot, bool is_t
         hit += (creature_ptr->lev / 3);
     }
 
-    if ((empty_hands(creature_ptr, FALSE) & EMPTY_HAND_RARM) && calc_hand == PLAYER_HAND_RIGHT) {
-        hit += (p_ptr->skill_exp[GINOU_SUDE] - WEAPON_EXP_BEGINNER) / 200;
-    }
-
-    if ((empty_hands(creature_ptr, FALSE) & EMPTY_HAND_LARM) && calc_hand == PLAYER_HAND_LEFT) {
-        hit += (p_ptr->skill_exp[GINOU_SUDE] - WEAPON_EXP_BEGINNER) / 200;
-    }
-
     /* Two handed combat penalty */
     hit -= calc_double_weapon_penalty(creature_ptr, slot);