OSDN Git Service

[Fix] #41264 WIP,calc_to_damage()再整理中.
[hengband/hengband.git] / src / player / player-status.c
index 7425ceb..9da4d6b 100644 (file)
@@ -1260,7 +1260,7 @@ static ACTION_SKILL_POWER calc_stealth(player_type *creature_ptr)
         if (hex_spelling_any(creature_ptr))
             pow -= (1 + casting_hex_num(creature_ptr));
     }
-    if (has_aggravate(creature_ptr) == AGGRAVATE_S_FAIRY) {
+    if (player_aggravate_state(creature_ptr) == AGGRAVATE_S_FAIRY) {
         pow = MIN(pow - 3, (pow + 2) / 2);
     }
 
@@ -1268,11 +1268,13 @@ static ACTION_SKILL_POWER calc_stealth(player_type *creature_ptr)
         pow -= 7;
     }
 
-    if (creature_ptr->pclass == CLASS_NINJA && heavy_armor(creature_ptr)) {
-        pow -= (creature_ptr->lev) / 10;
-    } else if ((!creature_ptr->inventory_list[INVEN_RARM].k_idx || has_right_hand_weapon(creature_ptr))
-        && (!creature_ptr->inventory_list[INVEN_LARM].k_idx || has_left_hand_weapon(creature_ptr))) {
-        pow += (creature_ptr->lev) / 10;
+    if (creature_ptr->pclass == CLASS_NINJA) {
+        if (heavy_armor(creature_ptr)) {
+            pow -= (creature_ptr->lev) / 10;
+        } else if ((!creature_ptr->inventory_list[INVEN_RARM].k_idx || has_right_hand_weapon(creature_ptr))
+            && (!creature_ptr->inventory_list[INVEN_LARM].k_idx || has_left_hand_weapon(creature_ptr))) {
+            pow += (creature_ptr->lev) / 10;
+        }
     }
 
     if (is_time_limit_stealth(creature_ptr))
@@ -2967,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;
         }
     }