OSDN Git Service

[Refactor] #40514 忍者の職業適性によるAC計算整理. / Clear AC calculation by Ninja's specification.
authordeskull <deskull@users.sourceforge.jp>
Thu, 13 Aug 2020 05:37:46 +0000 (14:37 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Thu, 13 Aug 2020 05:37:46 +0000 (14:37 +0900)
src/player/player-class.c
src/player/player-status.c

index a155ac2..a50e660 100644 (file)
@@ -1207,17 +1207,10 @@ void calc_class_status(player_type *creature_ptr)
         creature_ptr->redraw |= PR_STATUS;
         break;
     case CLASS_NINJA:
-        if ((!creature_ptr->inventory_list[INVEN_RARM].k_idx || creature_ptr->right_hand_weapon)
-            && (!creature_ptr->inventory_list[INVEN_LARM].k_idx || creature_ptr->left_hand_weapon)) {
-            creature_ptr->to_a += creature_ptr->lev / 2 + 5;
-            creature_ptr->dis_to_a += creature_ptr->lev / 2 + 5;
-        }
-
         if (creature_ptr->lev > 44) {
             creature_ptr->oppose_pois = 1;
             creature_ptr->redraw |= PR_STATUS;
         }
-
         break;
     }
 }
index 8210196..6bde133 100644 (file)
@@ -2524,6 +2524,13 @@ static void calc_to_ac(player_type *creature_ptr)
     if (creature_ptr->shero) {
         creature_ptr->to_a -= 10;
     }
+
+       if (creature_ptr->pclass == CLASS_NINJA) {
+        if ((!creature_ptr->inventory_list[INVEN_RARM].k_idx || creature_ptr->right_hand_weapon)
+            && (!creature_ptr->inventory_list[INVEN_LARM].k_idx || creature_ptr->left_hand_weapon)) {
+            creature_ptr->to_a += creature_ptr->lev / 2 + 5;
+        }
+    }
 }
 
 static void calc_base_ac_display(player_type *creature_ptr)
@@ -2683,6 +2690,13 @@ static void calc_to_ac_display(player_type *creature_ptr)
     if (creature_ptr->shero) {
         creature_ptr->dis_to_a -= 10;
     }
+
+       if (creature_ptr->pclass == CLASS_NINJA) {
+        if ((!creature_ptr->inventory_list[INVEN_RARM].k_idx || creature_ptr->right_hand_weapon)
+            && (!creature_ptr->inventory_list[INVEN_LARM].k_idx || creature_ptr->left_hand_weapon)) {
+            creature_ptr->dis_to_a += creature_ptr->lev / 2 + 5;
+        }
+    }
 }
 
 static void calc_speed(player_type *creature_ptr)
@@ -4364,7 +4378,6 @@ bool is_echizen(player_type *creature_ptr)
 void calc_equipment_status(player_type *creature_ptr)
 {
     object_type *o_ptr;
-    BIT_FLAGS flgs[TR_FLAG_SIZE];
     int default_hand = get_default_hand(creature_ptr);
 
     for (int i = INVEN_RARM; i < INVEN_TOTAL; i++) {