• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision1a0e2b9be456813f6a83ffe85f6ca4671daab38a (tree)
Time2019-06-29 18:40:03
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 reset_tim_flags() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/bldg.c
+++ b/src/bldg.c
@@ -349,7 +349,7 @@ static void arena_comm(int cmd)
349349 msg_print(NULL);
350350
351351 p_ptr->exit_bldg = FALSE;
352- reset_tim_flags();
352+ reset_tim_flags(p_ptr);
353353
354354 /* Save the surface floor as saved floor */
355355 prepare_change_floor_mode(CFM_SAVE_FLOORS);
@@ -379,7 +379,7 @@ static void arena_comm(int cmd)
379379 else
380380 {
381381 p_ptr->exit_bldg = FALSE;
382- reset_tim_flags();
382+ reset_tim_flags(p_ptr);
383383
384384 /* Save the surface floor as saved floor */
385385 prepare_change_floor_mode(CFM_SAVE_FLOORS);
@@ -1657,7 +1657,7 @@ static bool kakutoujou(void)
16571657 battle_odds = MAX(wager+1, wager * battle_odds / 100);
16581658 kakekin = wager;
16591659 p_ptr->au -= wager;
1660- reset_tim_flags();
1660+ reset_tim_flags(p_ptr);
16611661
16621662 /* Save the surface floor as saved floor */
16631663 prepare_change_floor_mode(CFM_SAVE_FLOORS);
--- a/src/core.c
+++ b/src/core.c
@@ -5654,7 +5654,7 @@ void play_game(bool new_game)
56545654 p_ptr->chp = 0;
56555655 p_ptr->chp_frac = 0;
56565656 p_ptr->exit_bldg = TRUE;
5657- reset_tim_flags();
5657+ reset_tim_flags(p_ptr);
56585658
56595659 /* Leave through the exit */
56605660 prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_RAND_CONNECT);
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -203,84 +203,84 @@ void set_action(ACTION_IDX typ)
203203 * @brief プレイヤーの全ての時限効果をリセットする。 / reset timed flags
204204 * @return なし
205205 */
206-void reset_tim_flags(void)
206+void reset_tim_flags(player_type *creature_ptr)
207207 {
208- p_ptr->fast = 0; /* Timed -- Fast */
209- p_ptr->lightspeed = 0;
210- p_ptr->slow = 0; /* Timed -- Slow */
211- p_ptr->blind = 0; /* Timed -- Blindness */
212- p_ptr->paralyzed = 0; /* Timed -- Paralysis */
213- p_ptr->confused = 0; /* Timed -- Confusion */
214- p_ptr->afraid = 0; /* Timed -- Fear */
215- p_ptr->image = 0; /* Timed -- Hallucination */
216- p_ptr->poisoned = 0; /* Timed -- Poisoned */
217- p_ptr->cut = 0; /* Timed -- Cut */
218- p_ptr->stun = 0; /* Timed -- Stun */
219-
220- p_ptr->protevil = 0; /* Timed -- Protection */
221- p_ptr->invuln = 0; /* Timed -- Invulnerable */
222- p_ptr->ult_res = 0;
223- p_ptr->hero = 0; /* Timed -- Heroism */
224- p_ptr->shero = 0; /* Timed -- Super Heroism */
225- p_ptr->shield = 0; /* Timed -- Shield Spell */
226- p_ptr->blessed = 0; /* Timed -- Blessed */
227- p_ptr->tim_invis = 0; /* Timed -- Invisibility */
228- p_ptr->tim_infra = 0; /* Timed -- Infra Vision */
229- p_ptr->tim_regen = 0; /* Timed -- Regeneration */
230- p_ptr->tim_stealth = 0; /* Timed -- Stealth */
231- p_ptr->tim_esp = 0;
232- p_ptr->wraith_form = 0; /* Timed -- Wraith Form */
233- p_ptr->tim_levitation = 0;
234- p_ptr->tim_sh_touki = 0;
235- p_ptr->tim_sh_fire = 0;
236- p_ptr->tim_sh_holy = 0;
237- p_ptr->tim_eyeeye = 0;
238- p_ptr->magicdef = 0;
239- p_ptr->resist_magic = 0;
240- p_ptr->tsuyoshi = 0;
241- p_ptr->kabenuke = 0;
242- p_ptr->tim_res_nether = 0;
243- p_ptr->tim_res_time = 0;
244- p_ptr->tim_mimic = 0;
245- p_ptr->mimic_form = 0;
246- p_ptr->tim_reflect = 0;
247- p_ptr->multishadow = 0;
248- p_ptr->dustrobe = 0;
249- p_ptr->action = ACTION_NONE;
250-
251- p_ptr->oppose_acid = 0; /* Timed -- oppose acid */
252- p_ptr->oppose_elec = 0; /* Timed -- oppose lightning */
253- p_ptr->oppose_fire = 0; /* Timed -- oppose heat */
254- p_ptr->oppose_cold = 0; /* Timed -- oppose cold */
255- p_ptr->oppose_pois = 0; /* Timed -- oppose poison */
256-
257- p_ptr->word_recall = 0;
258- p_ptr->alter_reality = 0;
259- p_ptr->sutemi = FALSE;
260- p_ptr->counter = FALSE;
261- p_ptr->ele_attack = 0;
262- p_ptr->ele_immune = 0;
263- p_ptr->special_attack = 0L;
264- p_ptr->special_defense = 0L;
265-
266- while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
267- p_ptr->timewalk = FALSE;
268-
269- if (PRACE_IS_(p_ptr, RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
270- if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1;
271- if (p_ptr->pclass == CLASS_BERSERKER) p_ptr->shero = 1;
272-
273- if (p_ptr->riding)
274- {
275- (void)set_monster_fast(p_ptr->riding, 0);
276- (void)set_monster_slow(p_ptr->riding, 0);
277- (void)set_monster_invulner(p_ptr->riding, 0, FALSE);
278- }
279-
280- if (p_ptr->pclass == CLASS_BARD)
281- {
282- SINGING_SONG_EFFECT(p_ptr) = 0;
283- SINGING_SONG_ID(p_ptr) = 0;
208+ creature_ptr->fast = 0; /* Timed -- Fast */
209+ creature_ptr->lightspeed = 0;
210+ creature_ptr->slow = 0; /* Timed -- Slow */
211+ creature_ptr->blind = 0; /* Timed -- Blindness */
212+ creature_ptr->paralyzed = 0; /* Timed -- Paralysis */
213+ creature_ptr->confused = 0; /* Timed -- Confusion */
214+ creature_ptr->afraid = 0; /* Timed -- Fear */
215+ creature_ptr->image = 0; /* Timed -- Hallucination */
216+ creature_ptr->poisoned = 0; /* Timed -- Poisoned */
217+ creature_ptr->cut = 0; /* Timed -- Cut */
218+ creature_ptr->stun = 0; /* Timed -- Stun */
219+
220+ creature_ptr->protevil = 0; /* Timed -- Protection */
221+ creature_ptr->invuln = 0; /* Timed -- Invulnerable */
222+ creature_ptr->ult_res = 0;
223+ creature_ptr->hero = 0; /* Timed -- Heroism */
224+ creature_ptr->shero = 0; /* Timed -- Super Heroism */
225+ creature_ptr->shield = 0; /* Timed -- Shield Spell */
226+ creature_ptr->blessed = 0; /* Timed -- Blessed */
227+ creature_ptr->tim_invis = 0; /* Timed -- Invisibility */
228+ creature_ptr->tim_infra = 0; /* Timed -- Infra Vision */
229+ creature_ptr->tim_regen = 0; /* Timed -- Regeneration */
230+ creature_ptr->tim_stealth = 0; /* Timed -- Stealth */
231+ creature_ptr->tim_esp = 0;
232+ creature_ptr->wraith_form = 0; /* Timed -- Wraith Form */
233+ creature_ptr->tim_levitation = 0;
234+ creature_ptr->tim_sh_touki = 0;
235+ creature_ptr->tim_sh_fire = 0;
236+ creature_ptr->tim_sh_holy = 0;
237+ creature_ptr->tim_eyeeye = 0;
238+ creature_ptr->magicdef = 0;
239+ creature_ptr->resist_magic = 0;
240+ creature_ptr->tsuyoshi = 0;
241+ creature_ptr->kabenuke = 0;
242+ creature_ptr->tim_res_nether = 0;
243+ creature_ptr->tim_res_time = 0;
244+ creature_ptr->tim_mimic = 0;
245+ creature_ptr->mimic_form = 0;
246+ creature_ptr->tim_reflect = 0;
247+ creature_ptr->multishadow = 0;
248+ creature_ptr->dustrobe = 0;
249+ creature_ptr->action = ACTION_NONE;
250+
251+ creature_ptr->oppose_acid = 0; /* Timed -- oppose acid */
252+ creature_ptr->oppose_elec = 0; /* Timed -- oppose lightning */
253+ creature_ptr->oppose_fire = 0; /* Timed -- oppose heat */
254+ creature_ptr->oppose_cold = 0; /* Timed -- oppose cold */
255+ creature_ptr->oppose_pois = 0; /* Timed -- oppose poison */
256+
257+ creature_ptr->word_recall = 0;
258+ creature_ptr->alter_reality = 0;
259+ creature_ptr->sutemi = FALSE;
260+ creature_ptr->counter = FALSE;
261+ creature_ptr->ele_attack = 0;
262+ creature_ptr->ele_immune = 0;
263+ creature_ptr->special_attack = 0L;
264+ creature_ptr->special_defense = 0L;
265+
266+ while(creature_ptr->energy_need < 0) creature_ptr->energy_need += ENERGY_NEED();
267+ creature_ptr->timewalk = FALSE;
268+
269+ if (PRACE_IS_(creature_ptr, RACE_DEMON) && (creature_ptr->lev > 44)) creature_ptr->oppose_fire = 1;
270+ if ((creature_ptr->pclass == CLASS_NINJA) && (creature_ptr->lev > 44)) creature_ptr->oppose_pois = 1;
271+ if (creature_ptr->pclass == CLASS_BERSERKER) creature_ptr->shero = 1;
272+
273+ if (creature_ptr->riding)
274+ {
275+ (void)set_monster_fast(creature_ptr->riding, 0);
276+ (void)set_monster_slow(creature_ptr->riding, 0);
277+ (void)set_monster_invulner(creature_ptr->riding, 0, FALSE);
278+ }
279+
280+ if (creature_ptr->pclass == CLASS_BARD)
281+ {
282+ SINGING_SONG_EFFECT(creature_ptr) = 0;
283+ SINGING_SONG_ID(creature_ptr) = 0;
284284 }
285285 }
286286
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -12,7 +12,7 @@ struct kamae
1212 /* effects.c */
1313
1414 extern void set_action(ACTION_IDX typ);
15-extern void reset_tim_flags(void);
15+extern void reset_tim_flags(player_type *creature_ptr);
1616 extern void dispel_player(void);
1717 extern bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, IDX p, bool do_dec);
1818 extern bool set_blind(player_type *creature_ptr, TIME_EFFECT v);
Show on old repository browser