OSDN Git Service

[Refactor] #38997 reset_tim_flags() に player_type * 引数を追加.
authordeskull <deskull@users.sourceforge.jp>
Sat, 29 Jun 2019 09:40:03 +0000 (18:40 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 29 Jun 2019 09:40:03 +0000 (18:40 +0900)
src/bldg.c
src/core.c
src/player-effects.c
src/player-effects.h

index f60b4e7..498191b 100644 (file)
@@ -349,7 +349,7 @@ static void arena_comm(int cmd)
                                                msg_print(NULL);
                                        
                                                p_ptr->exit_bldg = FALSE;
-                                               reset_tim_flags();
+                                               reset_tim_flags(p_ptr);
 
                                                /* Save the surface floor as saved floor */
                                                prepare_change_floor_mode(CFM_SAVE_FLOORS);
@@ -379,7 +379,7 @@ static void arena_comm(int cmd)
                        else
                        {
                                p_ptr->exit_bldg = FALSE;
-                               reset_tim_flags();
+                               reset_tim_flags(p_ptr);
 
                                /* Save the surface floor as saved floor */
                                prepare_change_floor_mode(CFM_SAVE_FLOORS);
@@ -1657,7 +1657,7 @@ static bool kakutoujou(void)
                        battle_odds = MAX(wager+1, wager * battle_odds / 100);
                        kakekin = wager;
                        p_ptr->au -= wager;
-                       reset_tim_flags();
+                       reset_tim_flags(p_ptr);
 
                        /* Save the surface floor as saved floor */
                        prepare_change_floor_mode(CFM_SAVE_FLOORS);
index 230fb82..5927c8e 100644 (file)
@@ -5654,7 +5654,7 @@ void play_game(bool new_game)
                                p_ptr->chp = 0;
                                p_ptr->chp_frac = 0;
                                p_ptr->exit_bldg = TRUE;
-                               reset_tim_flags();
+                               reset_tim_flags(p_ptr);
 
                                /* Leave through the exit */
                                prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_RAND_CONNECT);
index 4b56239..62c871c 100644 (file)
@@ -203,84 +203,84 @@ void set_action(ACTION_IDX typ)
  * @brief プレイヤーの全ての時限効果をリセットする。 / reset timed flags
  * @return なし
  */
-void reset_tim_flags(void)
+void reset_tim_flags(player_type *creature_ptr)
 {
-       p_ptr->fast = 0;            /* Timed -- Fast */
-       p_ptr->lightspeed = 0;
-       p_ptr->slow = 0;            /* Timed -- Slow */
-       p_ptr->blind = 0;           /* Timed -- Blindness */
-       p_ptr->paralyzed = 0;       /* Timed -- Paralysis */
-       p_ptr->confused = 0;        /* Timed -- Confusion */
-       p_ptr->afraid = 0;          /* Timed -- Fear */
-       p_ptr->image = 0;           /* Timed -- Hallucination */
-       p_ptr->poisoned = 0;        /* Timed -- Poisoned */
-       p_ptr->cut = 0;             /* Timed -- Cut */
-       p_ptr->stun = 0;            /* Timed -- Stun */
-
-       p_ptr->protevil = 0;        /* Timed -- Protection */
-       p_ptr->invuln = 0;          /* Timed -- Invulnerable */
-       p_ptr->ult_res = 0;
-       p_ptr->hero = 0;            /* Timed -- Heroism */
-       p_ptr->shero = 0;           /* Timed -- Super Heroism */
-       p_ptr->shield = 0;          /* Timed -- Shield Spell */
-       p_ptr->blessed = 0;         /* Timed -- Blessed */
-       p_ptr->tim_invis = 0;       /* Timed -- Invisibility */
-       p_ptr->tim_infra = 0;       /* Timed -- Infra Vision */
-       p_ptr->tim_regen = 0;       /* Timed -- Regeneration */
-       p_ptr->tim_stealth = 0;     /* Timed -- Stealth */
-       p_ptr->tim_esp = 0;
-       p_ptr->wraith_form = 0;     /* Timed -- Wraith Form */
-       p_ptr->tim_levitation = 0;
-       p_ptr->tim_sh_touki = 0;
-       p_ptr->tim_sh_fire = 0;
-       p_ptr->tim_sh_holy = 0;
-       p_ptr->tim_eyeeye = 0;
-       p_ptr->magicdef = 0;
-       p_ptr->resist_magic = 0;
-       p_ptr->tsuyoshi = 0;
-       p_ptr->kabenuke = 0;
-       p_ptr->tim_res_nether = 0;
-       p_ptr->tim_res_time = 0;
-       p_ptr->tim_mimic = 0;
-       p_ptr->mimic_form = 0;
-       p_ptr->tim_reflect = 0;
-       p_ptr->multishadow = 0;
-       p_ptr->dustrobe = 0;
-       p_ptr->action = ACTION_NONE;
-
-       p_ptr->oppose_acid = 0;     /* Timed -- oppose acid */
-       p_ptr->oppose_elec = 0;     /* Timed -- oppose lightning */
-       p_ptr->oppose_fire = 0;     /* Timed -- oppose heat */
-       p_ptr->oppose_cold = 0;     /* Timed -- oppose cold */
-       p_ptr->oppose_pois = 0;     /* Timed -- oppose poison */
-
-       p_ptr->word_recall = 0;
-       p_ptr->alter_reality = 0;
-       p_ptr->sutemi = FALSE;
-       p_ptr->counter = FALSE;
-       p_ptr->ele_attack = 0;
-       p_ptr->ele_immune = 0;
-       p_ptr->special_attack = 0L;
-       p_ptr->special_defense = 0L;
-
-       while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
-       p_ptr->timewalk = FALSE;
-
-       if (PRACE_IS_(p_ptr, RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
-       if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1;
-       if (p_ptr->pclass == CLASS_BERSERKER) p_ptr->shero = 1;
-
-       if (p_ptr->riding)
-       {
-               (void)set_monster_fast(p_ptr->riding, 0);
-               (void)set_monster_slow(p_ptr->riding, 0);
-               (void)set_monster_invulner(p_ptr->riding, 0, FALSE);
-       }
-
-       if (p_ptr->pclass == CLASS_BARD)
-       {
-               SINGING_SONG_EFFECT(p_ptr) = 0;
-               SINGING_SONG_ID(p_ptr) = 0;
+       creature_ptr->fast = 0;            /* Timed -- Fast */
+       creature_ptr->lightspeed = 0;
+       creature_ptr->slow = 0;            /* Timed -- Slow */
+       creature_ptr->blind = 0;           /* Timed -- Blindness */
+       creature_ptr->paralyzed = 0;       /* Timed -- Paralysis */
+       creature_ptr->confused = 0;        /* Timed -- Confusion */
+       creature_ptr->afraid = 0;          /* Timed -- Fear */
+       creature_ptr->image = 0;           /* Timed -- Hallucination */
+       creature_ptr->poisoned = 0;        /* Timed -- Poisoned */
+       creature_ptr->cut = 0;             /* Timed -- Cut */
+       creature_ptr->stun = 0;            /* Timed -- Stun */
+
+       creature_ptr->protevil = 0;        /* Timed -- Protection */
+       creature_ptr->invuln = 0;          /* Timed -- Invulnerable */
+       creature_ptr->ult_res = 0;
+       creature_ptr->hero = 0;            /* Timed -- Heroism */
+       creature_ptr->shero = 0;           /* Timed -- Super Heroism */
+       creature_ptr->shield = 0;          /* Timed -- Shield Spell */
+       creature_ptr->blessed = 0;         /* Timed -- Blessed */
+       creature_ptr->tim_invis = 0;       /* Timed -- Invisibility */
+       creature_ptr->tim_infra = 0;       /* Timed -- Infra Vision */
+       creature_ptr->tim_regen = 0;       /* Timed -- Regeneration */
+       creature_ptr->tim_stealth = 0;     /* Timed -- Stealth */
+       creature_ptr->tim_esp = 0;
+       creature_ptr->wraith_form = 0;     /* Timed -- Wraith Form */
+       creature_ptr->tim_levitation = 0;
+       creature_ptr->tim_sh_touki = 0;
+       creature_ptr->tim_sh_fire = 0;
+       creature_ptr->tim_sh_holy = 0;
+       creature_ptr->tim_eyeeye = 0;
+       creature_ptr->magicdef = 0;
+       creature_ptr->resist_magic = 0;
+       creature_ptr->tsuyoshi = 0;
+       creature_ptr->kabenuke = 0;
+       creature_ptr->tim_res_nether = 0;
+       creature_ptr->tim_res_time = 0;
+       creature_ptr->tim_mimic = 0;
+       creature_ptr->mimic_form = 0;
+       creature_ptr->tim_reflect = 0;
+       creature_ptr->multishadow = 0;
+       creature_ptr->dustrobe = 0;
+       creature_ptr->action = ACTION_NONE;
+
+       creature_ptr->oppose_acid = 0;     /* Timed -- oppose acid */
+       creature_ptr->oppose_elec = 0;     /* Timed -- oppose lightning */
+       creature_ptr->oppose_fire = 0;     /* Timed -- oppose heat */
+       creature_ptr->oppose_cold = 0;     /* Timed -- oppose cold */
+       creature_ptr->oppose_pois = 0;     /* Timed -- oppose poison */
+
+       creature_ptr->word_recall = 0;
+       creature_ptr->alter_reality = 0;
+       creature_ptr->sutemi = FALSE;
+       creature_ptr->counter = FALSE;
+       creature_ptr->ele_attack = 0;
+       creature_ptr->ele_immune = 0;
+       creature_ptr->special_attack = 0L;
+       creature_ptr->special_defense = 0L;
+
+       while(creature_ptr->energy_need < 0) creature_ptr->energy_need += ENERGY_NEED();
+       creature_ptr->timewalk = FALSE;
+
+       if (PRACE_IS_(creature_ptr, RACE_DEMON) && (creature_ptr->lev > 44)) creature_ptr->oppose_fire = 1;
+       if ((creature_ptr->pclass == CLASS_NINJA) && (creature_ptr->lev > 44)) creature_ptr->oppose_pois = 1;
+       if (creature_ptr->pclass == CLASS_BERSERKER) creature_ptr->shero = 1;
+
+       if (creature_ptr->riding)
+       {
+               (void)set_monster_fast(creature_ptr->riding, 0);
+               (void)set_monster_slow(creature_ptr->riding, 0);
+               (void)set_monster_invulner(creature_ptr->riding, 0, FALSE);
+       }
+
+       if (creature_ptr->pclass == CLASS_BARD)
+       {
+               SINGING_SONG_EFFECT(creature_ptr) = 0;
+               SINGING_SONG_ID(creature_ptr) = 0;
        }
 }
 
index d4a3b95..e39c4bf 100644 (file)
@@ -12,7 +12,7 @@ struct kamae
 /* effects.c */
 
 extern void set_action(ACTION_IDX typ);
-extern void reset_tim_flags(void);
+extern void reset_tim_flags(player_type *creature_ptr);
 extern void dispel_player(void);
 extern bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, IDX p, bool do_dec);
 extern bool set_blind(player_type *creature_ptr, TIME_EFFECT v);