OSDN Git Service

[Refactor] #37353 mutate_player() to status_shuffle() in spells-status.c.
authordeskull <deskull@users.sourceforge.jp>
Tue, 5 Mar 2019 05:14:21 +0000 (14:14 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 5 Mar 2019 05:14:21 +0000 (14:14 +0900)
src/effects.c
src/externs.h
src/spells-status.c
src/spells-status.h
src/spells1.c
src/spells3.c

index dd811c9..d16eb57 100644 (file)
@@ -3839,7 +3839,7 @@ void do_poly_self(void)
        /* Note: earlier deductions may have left power < 0 already. */
        while (power > 0)
        {
-               mutate_player();
+               status_shuffle();
                power--;
        }
 }
index 2bbb4f2..5d0f85f 100644 (file)
@@ -955,7 +955,6 @@ extern bool recall_player(player_type *creature_ptr, TIME_EFFECT turns);
 extern bool free_level_recall(player_type *creature_ptr);
 extern bool reset_recall(void);
 extern bool apply_disenchant(BIT_FLAGS mode);
-extern void mutate_player(void);
 extern void phlogiston(void);
 extern void brand_weapon(int brand_type);
 extern void call_the_(void);
index 6fb94f5..46dee72 100644 (file)
@@ -508,9 +508,40 @@ void apply_nexus(monster_type *m_ptr)
                }
 
                msg_print(_("体がねじれ始めた...", "Your body starts to scramble..."));
-               mutate_player();
+               status_shuffle();
                break;
        }
        }
 }
 
+/*!
+ * @brief プレイヤーのステータスシャッフル処理
+ * @return なし
+ */
+void status_shuffle(void)
+{
+       BASE_STATUS max1, cur1, max2, cur2;
+       int ii, jj, i;
+
+       /* Pick a pair of stats */
+       ii = randint0(A_MAX);
+       for (jj = ii; jj == ii; jj = randint0(A_MAX)) /* loop */;
+
+       max1 = p_ptr->stat_max[ii];
+       cur1 = p_ptr->stat_cur[ii];
+       max2 = p_ptr->stat_max[jj];
+       cur2 = p_ptr->stat_cur[jj];
+
+       p_ptr->stat_max[ii] = max2;
+       p_ptr->stat_cur[ii] = cur2;
+       p_ptr->stat_max[jj] = max1;
+       p_ptr->stat_cur[jj] = cur1;
+
+       for (i = 0; i < A_MAX; i++)
+       {
+               if (p_ptr->stat_max[i] > p_ptr->stat_max_max[i]) p_ptr->stat_max[i] = p_ptr->stat_max_max[i];
+               if (p_ptr->stat_cur[i] > p_ptr->stat_max_max[i]) p_ptr->stat_cur[i] = p_ptr->stat_max_max[i];
+       }
+
+       p_ptr->update |= (PU_BONUS);
+}
index 33b77fb..a3f7160 100644 (file)
@@ -26,3 +26,4 @@ extern bool restore_all_status(void);
 extern bool fishing(player_type *creature_ptr);
 extern bool cosmic_cast_off(player_type *creature_ptr, object_type *o_ptr);
 extern void apply_nexus(monster_type *m_ptr);
+extern void status_shuffle(void);
index c7e2759..42a3fb7 100644 (file)
@@ -4053,7 +4053,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
                                        if (one_in_(4)) /* 4 */
                                                do_poly_self();
                                        else
-                                               mutate_player();
+                                               status_shuffle();
                                }
 
                                if (one_in_(6))
index fd424d5..5ca0461 100644 (file)
@@ -1091,37 +1091,6 @@ bool apply_disenchant(BIT_FLAGS mode)
        return (TRUE);
 }
 
-/*!
- * @brief プレイヤーの突然変異処理
- * @return なし
- */
-void mutate_player(void)
-{
-       BASE_STATUS max1, cur1, max2, cur2;
-       int ii, jj, i;
-
-       /* Pick a pair of stats */
-       ii = randint0(A_MAX);
-       for (jj = ii; jj == ii; jj = randint0(A_MAX)) /* loop */;
-
-       max1 = p_ptr->stat_max[ii];
-       cur1 = p_ptr->stat_cur[ii];
-       max2 = p_ptr->stat_max[jj];
-       cur2 = p_ptr->stat_cur[jj];
-
-       p_ptr->stat_max[ii] = max2;
-       p_ptr->stat_cur[ii] = cur2;
-       p_ptr->stat_max[jj] = max1;
-       p_ptr->stat_cur[jj] = cur1;
-
-       for (i = 0; i < A_MAX; i++)
-       {
-               if(p_ptr->stat_max[i] > p_ptr->stat_max_max[i]) p_ptr->stat_max[i] = p_ptr->stat_max_max[i];
-               if(p_ptr->stat_cur[i] > p_ptr->stat_max_max[i]) p_ptr->stat_cur[i] = p_ptr->stat_max_max[i];
-       }
-
-       p_ptr->update |= (PU_BONUS);
-}
 
 /*!
  * @brief 寿命つき光源の燃素追加処理 /