• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision85a7ef1d097c9742b3561b0397229a29d4edfd87 (tree)
Time2019-06-23 14:20:03
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1365,7 +1365,7 @@ bool activate_artifact(object_type *o_ptr)
13651365
13661366 case ACT_INVULN:
13671367 {
1368- (void)set_invuln(randint1(8) + 8, FALSE);
1368+ (void)set_invuln(p_ptr, randint1(8) + 8, FALSE);
13691369 break;
13701370 }
13711371
--- a/src/cmd-mane.c
+++ b/src/cmd-mane.c
@@ -663,7 +663,7 @@ static bool use_mane(int spell)
663663 break;
664664 case MS_INVULNER:
665665 msg_print(_("無傷の球の呪文を唱えた。", "You cast a Globe of Invulnerability."));
666- (void)set_invuln(randint1(7) + 7, FALSE);
666+ (void)set_invuln(p_ptr, randint1(7) + 7, FALSE);
667667 break;
668668 case MS_BLINK:
669669 teleport_player(10, 0L);
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -462,7 +462,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
462462 break;
463463
464464 case SV_POTION_INVULNERABILITY:
465- (void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
465+ (void)set_invuln(p_ptr, p_ptr->invuln + randint1(4) + 4, FALSE);
466466 ident = TRUE;
467467 break;
468468
--- a/src/core.c
+++ b/src/core.c
@@ -1989,7 +1989,7 @@ static void process_world_aux_timeout(void)
19891989 /* Invulnerability */
19901990 if (p_ptr->invuln)
19911991 {
1992- (void)set_invuln(p_ptr->invuln - 1, TRUE);
1992+ (void)set_invuln(p_ptr, p_ptr->invuln - 1, TRUE);
19931993 }
19941994
19951995 /* Wraith form */
@@ -2519,7 +2519,7 @@ static void process_world_aux_mutation(void)
25192519 disturb(FALSE, TRUE);
25202520 msg_print(_("無敵な気がする!", "You feel invincible!"));
25212521 msg_print(NULL);
2522- (void)set_invuln(randint1(8) + 8, FALSE);
2522+ (void)set_invuln(p_ptr, randint1(8) + 8, FALSE);
25232523 }
25242524
25252525 if ((p_ptr->muta2 & MUT2_SP_TO_HP) && one_in_(2000))
--- a/src/mind.c
+++ b/src/mind.c
@@ -1448,7 +1448,7 @@ static bool cast_mirror_spell(int spell)
14481448 break;
14491449 /* mirror of Ruffnor */
14501450 case 20:
1451- (void)set_invuln(randint1(4) + 4, FALSE);
1451+ (void)set_invuln(p_ptr, randint1(4) + 4, FALSE);
14521452 break;
14531453 default:
14541454 msg_print(_("なに?", "Zap?"));
--- a/src/mspells3.c
+++ b/src/mspells3.c
@@ -1286,7 +1286,7 @@ static bool cast_learned_spell(int spell, bool success)
12861286 break;
12871287 case MS_INVULNER:
12881288 msg_print(_("無傷の球の呪文を唱えた。", "You cast a Globe of Invulnerability."));
1289- (void)set_invuln(randint1(4) + 4, FALSE);
1289+ (void)set_invuln(p_ptr, randint1(4) + 4, FALSE);
12901290 break;
12911291 case MS_BLINK:
12921292 teleport_player(10, 0L);
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -299,7 +299,7 @@ void dispel_player(void)
299299 (void)set_hero(p_ptr, 0, TRUE);
300300 (void)set_shero(p_ptr, 0, TRUE);
301301 (void)set_protevil(p_ptr, 0, TRUE);
302- (void)set_invuln(0, TRUE);
302+ (void)set_invuln(p_ptr, 0, TRUE);
303303 (void)set_wraith_form(0, TRUE);
304304 (void)set_kabenuke(0, TRUE);
305305 (void)set_tim_res_nether(0, TRUE);
@@ -1359,19 +1359,19 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec)
13591359 * @param do_dec 現在の継続時間より長い値のみ上書きする
13601360 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
13611361 */
1362-bool set_invuln(TIME_EFFECT v, bool do_dec)
1362+bool set_invuln(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
13631363 {
13641364 bool notice = FALSE;
13651365 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
13661366
1367- if (p_ptr->is_dead) return FALSE;
1367+ if (creature_ptr->is_dead) return FALSE;
13681368
13691369 /* Open */
13701370 if (v)
13711371 {
1372- if (p_ptr->invuln && !do_dec)
1372+ if (creature_ptr->invuln && !do_dec)
13731373 {
1374- if (p_ptr->invuln > v) return FALSE;
1374+ if (creature_ptr->invuln > v) return FALSE;
13751375 }
13761376 else if (!IS_INVULN())
13771377 {
@@ -1383,39 +1383,39 @@ bool set_invuln(TIME_EFFECT v, bool do_dec)
13831383 chg_virtue(V_SACRIFICE, -3);
13841384 chg_virtue(V_VALOUR, -5);
13851385
1386- p_ptr->redraw |= (PR_MAP);
1387- p_ptr->update |= (PU_MONSTERS);
1386+ creature_ptr->redraw |= (PR_MAP);
1387+ creature_ptr->update |= (PU_MONSTERS);
13881388
1389- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1389+ creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
13901390 }
13911391 }
13921392
13931393 /* Shut */
13941394 else
13951395 {
1396- if (p_ptr->invuln && !music_singing(MUSIC_INVULN))
1396+ if (creature_ptr->invuln && !music_singing(MUSIC_INVULN))
13971397 {
13981398 msg_print(_("無敵ではなくなった。", "The invulnerability wears off."));
13991399 notice = TRUE;
14001400
1401- p_ptr->redraw |= (PR_MAP);
1402- p_ptr->update |= (PU_MONSTERS);
1401+ creature_ptr->redraw |= (PR_MAP);
1402+ creature_ptr->update |= (PU_MONSTERS);
14031403
1404- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1404+ creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
14051405
1406- p_ptr->energy_need += ENERGY_NEED();
1406+ creature_ptr->energy_need += ENERGY_NEED();
14071407 }
14081408 }
14091409
14101410 /* Use the value */
1411- p_ptr->invuln = v;
1412- p_ptr->redraw |= (PR_STATUS);
1411+ creature_ptr->invuln = v;
1412+ creature_ptr->redraw |= (PR_STATUS);
14131413
14141414 /* Nothing to notice */
14151415 if (!notice) return (FALSE);
14161416
14171417 if (disturb_state) disturb(FALSE, FALSE);
1418- p_ptr->update |= (PU_BONUS);
1418+ creature_ptr->update |= (PU_BONUS);
14191419 handle_stuff();
14201420 return (TRUE);
14211421 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -30,7 +30,7 @@ extern bool set_blessed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3030 extern bool set_hero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3131 extern bool set_shero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3232 extern bool set_protevil(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
33-extern bool set_invuln(TIME_EFFECT v, bool do_dec);
33+extern bool set_invuln(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3434 extern bool set_tim_invis(TIME_EFFECT v, bool do_dec);
3535 extern bool set_tim_infra(TIME_EFFECT v, bool do_dec);
3636 extern bool set_tim_regen(TIME_EFFECT v, bool do_dec);
--- a/src/realm-sorcery.c
+++ b/src/realm-sorcery.c
@@ -549,7 +549,7 @@ concptr do_sorcery_spell(SPELL_IDX spell, BIT_FLAGS mode)
549549
550550 if (cast)
551551 {
552- set_invuln(randint1(base) + base, FALSE);
552+ set_invuln(p_ptr, randint1(base) + base, FALSE);
553553 }
554554 }
555555 break;
Show on old repository browser