• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision559a3837cb0a09bbe4ec16862f0a1a157a75dd72 (tree)
Time2019-06-22 11:46:59
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1037,7 +1037,7 @@ bool activate_artifact(object_type *o_ptr)
10371037 (void)set_afraid(p_ptr, 0);
10381038 (void)set_hero(randint1(50) + 50, FALSE);
10391039 (void)hp_player(p_ptr, 10);
1040- (void)set_blessed(randint1(50) + 50, FALSE);
1040+ (void)set_blessed(p_ptr, randint1(50) + 50, FALSE);
10411041 (void)set_oppose_acid(randint1(50) + 50, FALSE);
10421042 (void)set_oppose_elec(randint1(50) + 50, FALSE);
10431043 (void)set_oppose_fire(randint1(50) + 50, FALSE);
@@ -1687,7 +1687,7 @@ bool activate_artifact(object_type *o_ptr)
16871687 (void)set_afraid(p_ptr, 0);
16881688 (void)set_hero(v, FALSE);
16891689 (void)hp_player(p_ptr, 10);
1690- (void)set_blessed(v, FALSE);
1690+ (void)set_blessed(p_ptr, v, FALSE);
16911691 (void)set_oppose_acid(v, FALSE);
16921692 (void)set_oppose_elec(v, FALSE);
16931693 (void)set_oppose_fire(v, FALSE);
--- a/src/cmd-read.c
+++ b/src/cmd-read.c
@@ -339,19 +339,19 @@ void exe_read(INVENTORY_IDX item, bool known)
339339
340340 case SV_SCROLL_BLESSING:
341341 {
342- if (set_blessed(p_ptr->blessed + randint1(12) + 6, FALSE)) ident = TRUE;
342+ if (set_blessed(p_ptr, p_ptr->blessed + randint1(12) + 6, FALSE)) ident = TRUE;
343343 break;
344344 }
345345
346346 case SV_SCROLL_HOLY_CHANT:
347347 {
348- if (set_blessed(p_ptr->blessed + randint1(24) + 12, FALSE)) ident = TRUE;
348+ if (set_blessed(p_ptr, p_ptr->blessed + randint1(24) + 12, FALSE)) ident = TRUE;
349349 break;
350350 }
351351
352352 case SV_SCROLL_HOLY_PRAYER:
353353 {
354- if (set_blessed(p_ptr->blessed + randint1(48) + 24, FALSE)) ident = TRUE;
354+ if (set_blessed(p_ptr, p_ptr->blessed + randint1(48) + 24, FALSE)) ident = TRUE;
355355 break;
356356 }
357357
--- a/src/core.c
+++ b/src/core.c
@@ -2013,7 +2013,7 @@ static void process_world_aux_timeout(void)
20132013 /* Blessed */
20142014 if (p_ptr->blessed)
20152015 {
2016- (void)set_blessed(p_ptr->blessed - 1, TRUE);
2016+ (void)set_blessed(p_ptr, p_ptr->blessed - 1, TRUE);
20172017 }
20182018
20192019 /* Shield */
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -294,7 +294,7 @@ void dispel_player(void)
294294 (void)set_lightspeed(0, TRUE);
295295 (void)set_slow(p_ptr, 0, TRUE);
296296 (void)set_shield(p_ptr, 0, TRUE);
297- (void)set_blessed(0, TRUE);
297+ (void)set_blessed(p_ptr, 0, TRUE);
298298 (void)set_tsuyoshi(0, TRUE);
299299 (void)set_hero(0, TRUE);
300300 (void)set_shero(0, TRUE);
@@ -1087,19 +1087,19 @@ bool set_magicdef(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
10871087 * @param do_dec 現在の継続時間より長い値のみ上書きする
10881088 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
10891089 */
1090-bool set_blessed(TIME_EFFECT v, bool do_dec)
1090+bool set_blessed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
10911091 {
10921092 bool notice = FALSE;
10931093 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
10941094
1095- if (p_ptr->is_dead) return FALSE;
1095+ if (creature_ptr->is_dead) return FALSE;
10961096
10971097 /* Open */
10981098 if (v)
10991099 {
1100- if (p_ptr->blessed && !do_dec)
1100+ if (creature_ptr->blessed && !do_dec)
11011101 {
1102- if (p_ptr->blessed > v) return FALSE;
1102+ if (creature_ptr->blessed > v) return FALSE;
11031103 }
11041104 else if (!IS_BLESSED())
11051105 {
@@ -1111,7 +1111,7 @@ bool set_blessed(TIME_EFFECT v, bool do_dec)
11111111 /* Shut */
11121112 else
11131113 {
1114- if (p_ptr->blessed && !music_singing(MUSIC_BLESS))
1114+ if (creature_ptr->blessed && !music_singing(MUSIC_BLESS))
11151115 {
11161116 msg_print(_("高潔な気分が消え失せた。", "The prayer has expired."));
11171117 notice = TRUE;
@@ -1119,14 +1119,14 @@ bool set_blessed(TIME_EFFECT v, bool do_dec)
11191119 }
11201120
11211121 /* Use the value */
1122- p_ptr->blessed = v;
1123- p_ptr->redraw |= (PR_STATUS);
1122+ creature_ptr->blessed = v;
1123+ creature_ptr->redraw |= (PR_STATUS);
11241124
11251125 /* Nothing to notice */
11261126 if (!notice) return (FALSE);
11271127
11281128 if (disturb_state) disturb(FALSE, FALSE);
1129- p_ptr->update |= (PU_BONUS);
1129+ creature_ptr->update |= (PU_BONUS);
11301130 handle_stuff();
11311131 return (TRUE);
11321132 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -26,7 +26,7 @@ extern bool set_slow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
2626 extern bool set_shield(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
2727 extern bool set_tsubureru(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
2828 extern bool set_magicdef(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
29-extern bool set_blessed(TIME_EFFECT v, bool do_dec);
29+extern bool set_blessed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3030 extern bool set_hero(TIME_EFFECT v, bool do_dec);
3131 extern bool set_shero(TIME_EFFECT v, bool do_dec);
3232 extern bool set_protevil(TIME_EFFECT v, bool do_dec);
--- a/src/realm-crusade.c
+++ b/src/realm-crusade.c
@@ -566,7 +566,7 @@ concptr do_crusade_spell(SPELL_IDX spell, BIT_FLAGS mode)
566566 summon_specific(-1, my, mx, plev, SUMMON_KNIGHTS, (PM_ALLOW_GROUP | PM_FORCE_PET | PM_HASTE));
567567 }
568568 set_hero(randint1(base) + base, FALSE);
569- set_blessed(randint1(base) + base, FALSE);
569+ set_blessed(p_ptr, randint1(base) + base, FALSE);
570570 set_fast(p_ptr, randint1(sp_sides) + sp_base, FALSE);
571571 set_protevil(randint1(base) + base, FALSE);
572572 set_afraid(p_ptr, 0);
--- a/src/realm-daemon.c
+++ b/src/realm-daemon.c
@@ -78,7 +78,7 @@ concptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
7878
7979 if (cast)
8080 {
81- set_blessed(randint1(base) + base, FALSE);
81+ set_blessed(p_ptr, randint1(base) + base, FALSE);
8282 }
8383 }
8484 break;
--- a/src/realm-life.c
+++ b/src/realm-life.c
@@ -47,7 +47,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
4747
4848 if (cast)
4949 {
50- set_blessed(randint1(base) + base, FALSE);
50+ set_blessed(p_ptr, randint1(base) + base, FALSE);
5151 }
5252 }
5353 break;
--- a/src/spells-status.c
+++ b/src/spells-status.c
@@ -464,7 +464,7 @@ bool cosmic_cast_off(player_type *creature_ptr, object_type *o_ptr)
464464 (void)set_tim_esp(creature_ptr->tim_esp + t, FALSE);
465465 (void)set_tim_regen(creature_ptr->tim_regen + t, FALSE);
466466 (void)set_hero(creature_ptr->hero + t, FALSE);
467- (void)set_blessed(creature_ptr->blessed + t, FALSE);
467+ (void)set_blessed(p_ptr, creature_ptr->blessed + t, FALSE);
468468 (void)set_fast(p_ptr, creature_ptr->fast + t, FALSE);
469469 (void)set_shero(creature_ptr->shero + t, FALSE);
470470 if (creature_ptr->pclass == CLASS_FORCETRAINER)
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -3751,7 +3751,7 @@ void cast_shuffle(void)
37513751 else if (die < 42)
37523752 {
37533753 msg_print(_("《正義》だ。", "It's Justice."));
3754- set_blessed(p_ptr->lev, FALSE);
3754+ set_blessed(p_ptr, p_ptr->lev, FALSE);
37553755 }
37563756 else if (die < 47)
37573757 {
Show on old repository browser