OSDN Git Service

#37353 SINGING_SONG_IDとINTERUPTING_SONG_IDを定義。 / Define SINGING_SONG_ID and INTERUPTI...
[hengband/hengband.git] / src / effects.c
index 34a174f..7bcdd23 100644 (file)
@@ -21,7 +21,7 @@
  * #ACTION_NONE / #ACTION_SEARCH / #ACTION_REST / #ACTION_LEARN / #ACTION_FISH / #ACTION_KAMAE / #ACTION_KATA / #ACTION_SING / #ACTION_HAYAGAKE / #ACTION_SPELL から選択。
  * @return なし
  */
-void set_action(int typ)
+void set_action(ACTION_IDX typ)
 {
        int prev_typ = p_ptr->action;
 
@@ -268,8 +268,8 @@ void dispel_player(void)
        if (music_singing_any() || hex_spelling_any())
        {
                cptr str = (music_singing_any()) ? _("歌", "singing") : _("呪文", "spelling");
-               p_ptr->magic_num1[1] = p_ptr->magic_num1[0];
-               p_ptr->magic_num1[0] = 0;
+               INTERUPTING_SONG_ID(p_ptr) = SINGING_SONG_ID(p_ptr);
+               SINGING_SONG_ID(p_ptr) = MUSIC_NONE;
                msg_format(_("%sが途切れた。", "Your %s is interrupted."), str);
                p_ptr->action = ACTION_NONE;
 
@@ -297,7 +297,7 @@ void dispel_player(void)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_mimic(TIME_EFFECT v, int p, bool do_dec)
+bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -316,7 +316,7 @@ bool set_mimic(TIME_EFFECT v, int p, bool do_dec)
                else if ((!p_ptr->tim_mimic) || (p_ptr->mimic_form != p))
                {
                        msg_print(_("自分の体が変わってゆくのを感じた。", "You feel that your body changes."));
-                       p_ptr->mimic_form=p;
+                       p_ptr->mimic_form = p;
                        notice = TRUE;
                }
        }
@@ -3728,7 +3728,9 @@ bool inc_stat(int stat)
  */
 bool dec_stat(int stat, int amount, int permanent)
 {
-       int cur, max, loss, same, res = FALSE;
+       BASE_STATUS cur, max;
+       int loss, same;
+       bool res = FALSE;
 
 
        /* Acquire current value */
@@ -4188,7 +4190,7 @@ void do_poly_wounds(void)
 /*
  * Change player race
  */
-void change_race(int new_race, cptr effect_msg)
+void change_race(CHARACTER_IDX new_race, cptr effect_msg)
 {
        cptr title = race_info[new_race].title;
        int  old_race = p_ptr->prace;
@@ -4260,7 +4262,7 @@ void do_poly_self(void)
        if ((power > randint0(20)) && one_in_(3) && (p_ptr->prace != RACE_ANDROID))
        {
                char effect_msg[80] = "";
-               int new_race;
+               CHARACTER_IDX new_race;
 
                /* Some form of racial polymorph... */
                power -= 10;
@@ -4327,7 +4329,7 @@ void do_poly_self(void)
 
                do
                {
-                       new_race = randint0(MAX_RACES);
+                       new_race = (CHARACTER_IDX)randint0(MAX_RACES);
                }
                while ((new_race == p_ptr->prace) || (new_race == RACE_ANDROID));