{
msg_format(_("%sから鋭い音が流れ出た...", "The %s lets out a shrill wail..."), name);
k = 3 * p_ptr->lev;
- (void)set_protevil(randint1(25) + k, FALSE);
+ (void)set_protevil(p_ptr, randint1(25) + k, FALSE);
break;
}
case SV_SCROLL_PROTECTION_FROM_EVIL:
{
k = 3 * p_ptr->lev;
- if (set_protevil(p_ptr->protevil + randint1(25) + k, FALSE)) ident = TRUE;
+ if (set_protevil(p_ptr, p_ptr->protevil + randint1(25) + k, FALSE)) ident = TRUE;
break;
}
/* Protection from evil */
if (p_ptr->protevil)
{
- (void)set_protevil(p_ptr->protevil - 1, TRUE);
+ (void)set_protevil(p_ptr, p_ptr->protevil - 1, TRUE);
}
/* Invulnerability */
(void)set_tsuyoshi(0, TRUE);
(void)set_hero(p_ptr, 0, TRUE);
(void)set_shero(p_ptr, 0, TRUE);
- (void)set_protevil(0, TRUE);
+ (void)set_protevil(p_ptr, 0, TRUE);
(void)set_invuln(0, TRUE);
(void)set_wraith_form(0, TRUE);
(void)set_kabenuke(0, TRUE);
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_protevil(TIME_EFFECT v, bool do_dec)
+bool set_protevil(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
- if (p_ptr->is_dead) return FALSE;
+ if (creature_ptr->is_dead) return FALSE;
/* Open */
if (v)
{
- if (p_ptr->protevil && !do_dec)
+ if (creature_ptr->protevil && !do_dec)
{
- if (p_ptr->protevil > v) return FALSE;
+ if (creature_ptr->protevil > v) return FALSE;
}
- else if (!p_ptr->protevil)
+ else if (!creature_ptr->protevil)
{
msg_print(_("邪悪なる存在から守られているような感じがする!", "You feel safe from evil!"));
notice = TRUE;
/* Shut */
else
{
- if (p_ptr->protevil)
+ if (creature_ptr->protevil)
{
msg_print(_("邪悪なる存在から守られている感じがなくなった。", "You no longer feel safe from evil."));
notice = TRUE;
}
/* Use the value */
- p_ptr->protevil = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->protevil = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
extern bool set_blessed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
extern bool set_hero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
extern bool set_shero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
-extern bool set_protevil(TIME_EFFECT v, bool do_dec);
+extern bool set_protevil(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
extern bool set_invuln(TIME_EFFECT v, bool do_dec);
extern bool set_tim_invis(TIME_EFFECT v, bool do_dec);
extern bool set_tim_infra(TIME_EFFECT v, bool do_dec);
if (cast)
{
- set_protevil(randint1(sides) + base, FALSE);
+ set_protevil(p_ptr, randint1(sides) + base, FALSE);
}
}
break;
if (cast)
{
- set_protevil(randint1(sides) + base, FALSE);
+ set_protevil(p_ptr, randint1(sides) + base, FALSE);
}
}
break;
set_hero(p_ptr, randint1(base) + base, FALSE);
set_blessed(p_ptr, randint1(base) + base, FALSE);
set_fast(p_ptr, randint1(sp_sides) + sp_base, FALSE);
- set_protevil(randint1(base) + base, FALSE);
+ set_protevil(p_ptr, randint1(base) + base, FALSE);
set_afraid(p_ptr, 0);
}
}
bool ident = FALSE;
if (dispel_evil(powerful ? 225 : 150)) ident = TRUE;
int k = 3 * creature_ptr->lev;
- if (set_protevil((magic ? 0 : creature_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
+ if (set_protevil(p_ptr, (magic ? 0 : creature_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
if (set_poisoned(p_ptr, 0)) ident = TRUE;
if (set_afraid(p_ptr, 0)) ident = TRUE;
if (hp_player(p_ptr, 50)) ident = TRUE;