• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionb7ef02bc34b39718dc0ec89133be1fd30674d9d1 (tree)
Time2019-06-22 12:23:18
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1328,7 +1328,7 @@ bool activate_artifact(object_type *o_ptr)
13281328 {
13291329 msg_format(_("%sから鋭い音が流れ出た...", "The %s lets out a shrill wail..."), name);
13301330 k = 3 * p_ptr->lev;
1331- (void)set_protevil(randint1(25) + k, FALSE);
1331+ (void)set_protevil(p_ptr, randint1(25) + k, FALSE);
13321332 break;
13331333 }
13341334
--- a/src/cmd-read.c
+++ b/src/cmd-read.c
@@ -370,7 +370,7 @@ void exe_read(INVENTORY_IDX item, bool known)
370370 case SV_SCROLL_PROTECTION_FROM_EVIL:
371371 {
372372 k = 3 * p_ptr->lev;
373- if (set_protevil(p_ptr->protevil + randint1(25) + k, FALSE)) ident = TRUE;
373+ if (set_protevil(p_ptr, p_ptr->protevil + randint1(25) + k, FALSE)) ident = TRUE;
374374 break;
375375 }
376376
--- a/src/core.c
+++ b/src/core.c
@@ -1983,7 +1983,7 @@ static void process_world_aux_timeout(void)
19831983 /* Protection from evil */
19841984 if (p_ptr->protevil)
19851985 {
1986- (void)set_protevil(p_ptr->protevil - 1, TRUE);
1986+ (void)set_protevil(p_ptr, p_ptr->protevil - 1, TRUE);
19871987 }
19881988
19891989 /* Invulnerability */
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -298,7 +298,7 @@ void dispel_player(void)
298298 (void)set_tsuyoshi(0, TRUE);
299299 (void)set_hero(p_ptr, 0, TRUE);
300300 (void)set_shero(p_ptr, 0, TRUE);
301- (void)set_protevil(0, TRUE);
301+ (void)set_protevil(p_ptr, 0, TRUE);
302302 (void)set_invuln(0, TRUE);
303303 (void)set_wraith_form(0, TRUE);
304304 (void)set_kabenuke(0, TRUE);
@@ -1245,21 +1245,21 @@ bool set_shero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
12451245 * @param do_dec 現在の継続時間より長い値のみ上書きする
12461246 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
12471247 */
1248-bool set_protevil(TIME_EFFECT v, bool do_dec)
1248+bool set_protevil(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
12491249 {
12501250 bool notice = FALSE;
12511251 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
12521252
1253- if (p_ptr->is_dead) return FALSE;
1253+ if (creature_ptr->is_dead) return FALSE;
12541254
12551255 /* Open */
12561256 if (v)
12571257 {
1258- if (p_ptr->protevil && !do_dec)
1258+ if (creature_ptr->protevil && !do_dec)
12591259 {
1260- if (p_ptr->protevil > v) return FALSE;
1260+ if (creature_ptr->protevil > v) return FALSE;
12611261 }
1262- else if (!p_ptr->protevil)
1262+ else if (!creature_ptr->protevil)
12631263 {
12641264 msg_print(_("邪悪なる存在から守られているような感じがする!", "You feel safe from evil!"));
12651265 notice = TRUE;
@@ -1269,7 +1269,7 @@ bool set_protevil(TIME_EFFECT v, bool do_dec)
12691269 /* Shut */
12701270 else
12711271 {
1272- if (p_ptr->protevil)
1272+ if (creature_ptr->protevil)
12731273 {
12741274 msg_print(_("邪悪なる存在から守られている感じがなくなった。", "You no longer feel safe from evil."));
12751275 notice = TRUE;
@@ -1277,8 +1277,8 @@ bool set_protevil(TIME_EFFECT v, bool do_dec)
12771277 }
12781278
12791279 /* Use the value */
1280- p_ptr->protevil = v;
1281- p_ptr->redraw |= (PR_STATUS);
1280+ creature_ptr->protevil = v;
1281+ creature_ptr->redraw |= (PR_STATUS);
12821282
12831283 /* Nothing to notice */
12841284 if (!notice) return (FALSE);
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -29,7 +29,7 @@ extern bool set_magicdef(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
2929 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);
32-extern bool set_protevil(TIME_EFFECT v, bool do_dec);
32+extern bool set_protevil(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3333 extern bool set_invuln(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);
--- a/src/realm-craft.c
+++ b/src/realm-craft.c
@@ -241,7 +241,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
241241
242242 if (cast)
243243 {
244- set_protevil(randint1(sides) + base, FALSE);
244+ set_protevil(p_ptr, randint1(sides) + base, FALSE);
245245 }
246246 }
247247 break;
--- a/src/realm-crusade.c
+++ b/src/realm-crusade.c
@@ -231,7 +231,7 @@ concptr do_crusade_spell(SPELL_IDX spell, BIT_FLAGS mode)
231231
232232 if (cast)
233233 {
234- set_protevil(randint1(sides) + base, FALSE);
234+ set_protevil(p_ptr, randint1(sides) + base, FALSE);
235235 }
236236 }
237237 break;
@@ -568,7 +568,7 @@ concptr do_crusade_spell(SPELL_IDX spell, BIT_FLAGS mode)
568568 set_hero(p_ptr, randint1(base) + base, FALSE);
569569 set_blessed(p_ptr, randint1(base) + base, FALSE);
570570 set_fast(p_ptr, randint1(sp_sides) + sp_base, FALSE);
571- set_protevil(randint1(base) + base, FALSE);
571+ set_protevil(p_ptr, randint1(base) + base, FALSE);
572572 set_afraid(p_ptr, 0);
573573 }
574574 }
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -914,7 +914,7 @@ bool cleansing_nova(player_type *creature_ptr, bool magic, bool powerful)
914914 bool ident = FALSE;
915915 if (dispel_evil(powerful ? 225 : 150)) ident = TRUE;
916916 int k = 3 * creature_ptr->lev;
917- if (set_protevil((magic ? 0 : creature_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
917+ if (set_protevil(p_ptr, (magic ? 0 : creature_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
918918 if (set_poisoned(p_ptr, 0)) ident = TRUE;
919919 if (set_afraid(p_ptr, 0)) ident = TRUE;
920920 if (hp_player(p_ptr, 50)) ident = TRUE;
Show on old repository browser