• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisiona0497d82a5caf4aa3625b52ea946937bff4bcb94 (tree)
Time2019-06-27 11:52:24
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1314,7 +1314,7 @@ bool activate_artifact(object_type *o_ptr)
13141314
13151315 case ACT_ESP:
13161316 {
1317- (void)set_tim_esp(randint1(30) + 25, FALSE);
1317+ (void)set_tim_esp(p_ptr, randint1(30) + 25, FALSE);
13181318 break;
13191319 }
13201320
--- a/src/core.c
+++ b/src/core.c
@@ -1839,7 +1839,7 @@ static void process_world_aux_timeout(void)
18391839 /* Timed esp */
18401840 if (p_ptr->tim_esp)
18411841 {
1842- (void)set_tim_esp(p_ptr->tim_esp - 1, TRUE);
1842+ (void)set_tim_esp(p_ptr, p_ptr->tim_esp - 1, TRUE);
18431843 }
18441844
18451845 /* Timed temporary elemental brands. -LM- */
@@ -2460,12 +2460,12 @@ static void process_world_aux_mutation(void)
24602460 if (p_ptr->tim_esp > 0)
24612461 {
24622462 msg_print(_("精神にもやがかかった!", "Your mind feels cloudy!"));
2463- set_tim_esp(0, TRUE);
2463+ set_tim_esp(p_ptr, 0, TRUE);
24642464 }
24652465 else
24662466 {
24672467 msg_print(_("精神が広がった!", "Your mind expands!"));
2468- set_tim_esp(p_ptr->lev, FALSE);
2468+ set_tim_esp(p_ptr, p_ptr->lev, FALSE);
24692469 }
24702470 }
24712471 if ((p_ptr->muta2 & MUT2_NAUSEA) && !p_ptr->slow_digest && one_in_(9000))
--- a/src/mind.c
+++ b/src/mind.c
@@ -1062,7 +1062,7 @@ static bool cast_mindcrafter_spell(int spell)
10621062 }
10631063
10641064 if ((plev > 24) && (plev < 40))
1065- set_tim_esp((TIME_EFFECT)plev, FALSE);
1065+ set_tim_esp(p_ptr, (TIME_EFFECT)plev, FALSE);
10661066
10671067 if (!b) msg_print(_("安全な気がする。", "You feel safe."));
10681068
@@ -1330,7 +1330,7 @@ static bool cast_mirror_spell(int spell)
13301330 tmp = is_mirror_grid(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x]) ? 4 : 0;
13311331 if (plev + tmp > 4)detect_monsters_normal(DETECT_RAD_DEFAULT);
13321332 if (plev + tmp > 18)detect_monsters_invis(DETECT_RAD_DEFAULT);
1333- if (plev + tmp > 28)set_tim_esp((TIME_EFFECT)plev, FALSE);
1333+ if (plev + tmp > 28)set_tim_esp(p_ptr, (TIME_EFFECT)plev, FALSE);
13341334 if (plev + tmp > 38)map_area(DETECT_RAD_MAP);
13351335 if (tmp == 0 && plev < 5) {
13361336 msg_print(_("鏡がなくて集中できなかった!", "You need a mirror to concentrate!"));
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -311,7 +311,7 @@ void dispel_player(void)
311311
312312 (void)set_tim_invis(p_ptr, 0, TRUE);
313313 (void)set_tim_infra(p_ptr, 0, TRUE);
314- (void)set_tim_esp(0, TRUE);
314+ (void)set_tim_esp(p_ptr, 0, TRUE);
315315 (void)set_tim_regen(p_ptr, 0, TRUE);
316316 (void)set_tim_stealth(p_ptr, 0, TRUE);
317317 (void)set_tim_levitation(p_ptr, 0, TRUE);
@@ -1426,19 +1426,19 @@ bool set_invuln(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
14261426 * @param do_dec 現在の継続時間より長い値のみ上書きする
14271427 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
14281428 */
1429-bool set_tim_esp(TIME_EFFECT v, bool do_dec)
1429+bool set_tim_esp(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
14301430 {
14311431 bool notice = FALSE;
14321432 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
14331433
1434- if (p_ptr->is_dead) return FALSE;
1434+ if (creature_ptr->is_dead) return FALSE;
14351435
14361436 /* Open */
14371437 if (v)
14381438 {
1439- if (p_ptr->tim_esp && !do_dec)
1439+ if (creature_ptr->tim_esp && !do_dec)
14401440 {
1441- if (p_ptr->tim_esp > v) return FALSE;
1441+ if (creature_ptr->tim_esp > v) return FALSE;
14421442 }
14431443 else if (!IS_TIM_ESP())
14441444 {
@@ -1450,7 +1450,7 @@ bool set_tim_esp(TIME_EFFECT v, bool do_dec)
14501450 /* Shut */
14511451 else
14521452 {
1453- if (p_ptr->tim_esp && !music_singing(MUSIC_MIND))
1453+ if (creature_ptr->tim_esp && !music_singing(MUSIC_MIND))
14541454 {
14551455 msg_print(_("意識は元に戻った。", "Your consciousness contracts again."));
14561456 notice = TRUE;
@@ -1458,15 +1458,15 @@ bool set_tim_esp(TIME_EFFECT v, bool do_dec)
14581458 }
14591459
14601460 /* Use the value */
1461- p_ptr->tim_esp = v;
1462- p_ptr->redraw |= (PR_STATUS);
1461+ creature_ptr->tim_esp = v;
1462+ creature_ptr->redraw |= (PR_STATUS);
14631463
14641464 /* Nothing to notice */
14651465 if (!notice) return (FALSE);
14661466
14671467 if (disturb_state) disturb(FALSE, FALSE);
1468- p_ptr->update |= (PU_BONUS);
1469- p_ptr->update |= (PU_MONSTERS);
1468+ creature_ptr->update |= (PU_BONUS);
1469+ creature_ptr->update |= (PU_MONSTERS);
14701470 handle_stuff();
14711471 return (TRUE);
14721472 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -78,7 +78,7 @@ extern bool set_tim_res_time(TIME_EFFECT v, bool do_dec);
7878 extern bool choose_ele_attack(void);
7979 extern bool choose_ele_immune(TIME_EFFECT turn);
8080 extern bool set_wraith_form(TIME_EFFECT v, bool do_dec);
81-extern bool set_tim_esp(TIME_EFFECT v, bool do_dec);
81+extern bool set_tim_esp(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
8282 extern bool set_superstealth(player_type *creature_ptr, bool set);
8383 extern void do_poly_wounds(player_type *creature_ptr);
8484 extern void change_race(player_type *creature_ptr, CHARACTER_IDX new_race, concptr effect_msg);
--- a/src/realm-arcane.c
+++ b/src/realm-arcane.c
@@ -553,7 +553,7 @@ concptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
553553
554554 if (!p_ptr->telepathy)
555555 {
556- set_tim_esp(randint1(sides) + base, FALSE);
556+ set_tim_esp(p_ptr, randint1(sides) + base, FALSE);
557557 }
558558 }
559559 }
--- a/src/realm-craft.c
+++ b/src/realm-craft.c
@@ -287,7 +287,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
287287
288288 if (cast)
289289 {
290- set_tim_esp(randint1(sides) + base, FALSE);
290+ set_tim_esp(p_ptr, randint1(sides) + base, FALSE);
291291 }
292292 }
293293 break;
--- a/src/realm-daemon.c
+++ b/src/realm-daemon.c
@@ -324,7 +324,7 @@ concptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
324324
325325 if (cast)
326326 {
327- set_tim_esp(randint1(sides) + base, FALSE);
327+ set_tim_esp(p_ptr, randint1(sides) + base, FALSE);
328328 }
329329 }
330330 break;
--- a/src/realm-sorcery.c
+++ b/src/realm-sorcery.c
@@ -339,7 +339,7 @@ concptr do_sorcery_spell(SPELL_IDX spell, BIT_FLAGS mode)
339339
340340 if (cast)
341341 {
342- set_tim_esp(randint1(sides) + base, FALSE);
342+ set_tim_esp(p_ptr, randint1(sides) + base, FALSE);
343343 }
344344 }
345345 break;
@@ -487,7 +487,7 @@ concptr do_sorcery_spell(SPELL_IDX spell, BIT_FLAGS mode)
487487
488488 if (!p_ptr->telepathy)
489489 {
490- set_tim_esp(randint1(sides) + base, FALSE);
490+ set_tim_esp(p_ptr, randint1(sides) + base, FALSE);
491491 }
492492 }
493493 }
--- a/src/realm-trump.c
+++ b/src/realm-trump.c
@@ -120,7 +120,7 @@ concptr do_trump_spell(SPELL_IDX spell, BIT_FLAGS mode)
120120
121121 if (cast)
122122 {
123- set_tim_esp(randint1(sides) + base, FALSE);
123+ set_tim_esp(p_ptr, randint1(sides) + base, FALSE);
124124 }
125125 }
126126 break;
--- a/src/spells-status.c
+++ b/src/spells-status.c
@@ -461,7 +461,7 @@ bool cosmic_cast_off(player_type *creature_ptr, object_type *o_ptr)
461461 t = 20 + randint1(20);
462462 (void)set_blind(p_ptr, creature_ptr->blind + t);
463463 (void)set_afraid(p_ptr, 0);
464- (void)set_tim_esp(creature_ptr->tim_esp + t, FALSE);
464+ (void)set_tim_esp(p_ptr, creature_ptr->tim_esp + t, FALSE);
465465 (void)set_tim_regen(p_ptr, creature_ptr->tim_regen + t, FALSE);
466466 (void)set_hero(p_ptr, creature_ptr->hero + t, FALSE);
467467 (void)set_blessed(p_ptr, creature_ptr->blessed + t, FALSE);
Show on old repository browser