OSDN Git Service

[Refactor] #40514 一部計算処理を calc_to_ac(), calc_to_ac_display() へ移動. / Moved some calcul...
authordeskull <deskull@users.sourceforge.jp>
Sat, 4 Jul 2020 06:17:03 +0000 (15:17 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 4 Jul 2020 06:17:03 +0000 (15:17 +0900)
src/mutation/mutation.c
src/player/player-effects.c
src/player/player-status.c

index c2f62d1..d16a2ac 100644 (file)
@@ -1891,7 +1891,6 @@ void set_mutation_flags(player_type *creature_ptr)
 {
     if (creature_ptr->muta3) {
 
-
         if (creature_ptr->muta3 & MUT3_FLESH_ROT) {
             creature_ptr->regenerate = FALSE;
         }
@@ -1905,18 +1904,6 @@ void set_mutation_flags(player_type *creature_ptr)
             creature_ptr->lite = TRUE;
         }
 
-        if (creature_ptr->muta3 & MUT3_WART_SKIN) {
-            creature_ptr->dis_to_a += 5;
-        }
-
-        if (creature_ptr->muta3 & MUT3_SCALES) {
-            creature_ptr->dis_to_a += 10;
-        }
-
-        if (creature_ptr->muta3 & MUT3_IRON_SKIN) {
-            creature_ptr->dis_to_a += 25;
-        }
-
         if (creature_ptr->muta3 & MUT3_WINGS) {
             creature_ptr->levitation = TRUE;
         }
index 0754d53..3582126 100644 (file)
@@ -3896,12 +3896,7 @@ void calc_timelimit_status(player_type *creature_ptr)
         creature_ptr->sh_fire = TRUE;
         creature_ptr->sh_elec = TRUE;
         creature_ptr->sh_cold = TRUE;
-        creature_ptr->to_a += 100;
-        creature_ptr->dis_to_a += 100;
-    } else if (creature_ptr->tsubureru || creature_ptr->shield || creature_ptr->magicdef) {
-        creature_ptr->to_a += 50;
-        creature_ptr->dis_to_a += 50;
-    }
+    } 
 
     if (creature_ptr->tim_res_nether) {
         creature_ptr->resist_neth = TRUE;
index fa12b1c..b538353 100644 (file)
@@ -1922,16 +1922,8 @@ void calc_bonuses(player_type *creature_ptr)
                        creature_ptr->dis_to_d[0] += (creature_ptr->lev / 6);
                }
 
-               if (creature_ptr->special_defense & KAMAE_BYAKKO)
+               if (creature_ptr->special_defense & KAMAE_SEIRYU)
                {
-                       creature_ptr->to_a -= 40;
-                       creature_ptr->dis_to_a -= 40;
-
-               }
-               else if (creature_ptr->special_defense & KAMAE_SEIRYU)
-               {
-                       creature_ptr->to_a -= 50;
-                       creature_ptr->dis_to_a -= 50;
                        creature_ptr->resist_acid = TRUE;
                        creature_ptr->resist_fire = TRUE;
                        creature_ptr->resist_elec = TRUE;
@@ -3968,9 +3960,19 @@ static void calc_to_ac(player_type *creature_ptr)
         }
     }
 
-    if (creature_ptr->special_defense & KATA_KOUKIJIN) {
+       if (creature_ptr->special_defense & KAMAE_BYAKKO) {
+        creature_ptr->to_a -= 40;
+    } else if (creature_ptr->special_defense & KAMAE_SEIRYU) {
+        creature_ptr->to_a -= 50;
+    } else if (creature_ptr->special_defense & KATA_KOUKIJIN) {
         creature_ptr->to_a -= 50;
     }
+
+    if (creature_ptr->ult_res || (creature_ptr->special_defense & KATA_MUSOU)) {
+        creature_ptr->to_a += 100;
+    } else if (creature_ptr->tsubureru || creature_ptr->shield || creature_ptr->magicdef) {
+        creature_ptr->to_a += 50;
+    }
 }
 
 static void calc_base_ac_display(player_type *creature_ptr)
@@ -4018,9 +4020,33 @@ static void calc_to_ac_display(player_type *creature_ptr)
         creature_ptr->dis_to_a += 10 + (creature_ptr->lev * 2 / 5);
     }
 
-       if (creature_ptr->special_defense & KATA_KOUKIJIN) {
+    if (creature_ptr->muta3) {
+        if (creature_ptr->muta3 & MUT3_WART_SKIN) {
+            creature_ptr->dis_to_a += 5;
+        }
+
+        if (creature_ptr->muta3 & MUT3_SCALES) {
+            creature_ptr->dis_to_a += 10;
+        }
+
+        if (creature_ptr->muta3 & MUT3_IRON_SKIN) {
+            creature_ptr->dis_to_a += 25;
+        }
+    }
+
+       if (creature_ptr->special_defense & KAMAE_BYAKKO) {
+        creature_ptr->dis_to_a -= 40;
+    } else if (creature_ptr->special_defense & KAMAE_SEIRYU) {
+        creature_ptr->dis_to_a -= 50;
+    } else if (creature_ptr->special_defense & KATA_KOUKIJIN) {
         creature_ptr->dis_to_a -= 50;
     }
+
+    if (creature_ptr->ult_res || (creature_ptr->special_defense & KATA_MUSOU)) {
+        creature_ptr->dis_to_a += 100;
+    } else if (creature_ptr->tsubureru || creature_ptr->shield || creature_ptr->magicdef) {
+        creature_ptr->dis_to_a += 50;
+    }
 }
 
 static void calc_speed(player_type *creature_ptr)