* #ACTION_NONE / #ACTION_SEARCH / #ACTION_REST / #ACTION_LEARN / #ACTION_FISH / #ACTION_KAMAE / #ACTION_KATA / #ACTION_SING / #ACTION_HAYAGAKE / #ACTION_SPELL から選択。
* @return なし
*/
-void set_action(ACTION_IDX typ)
+void set_action(player_type *creature_ptr, ACTION_IDX typ)
{
- int prev_typ = p_ptr->action;
+ int prev_typ = creature_ptr->action;
if (typ == prev_typ)
{
case ACTION_SEARCH:
{
msg_print(_("探索をやめた。", "You no longer walk carefully."));
- p_ptr->redraw |= (PR_SPEED);
+ creature_ptr->redraw |= (PR_SPEED);
break;
}
case ACTION_REST:
{
- p_ptr->resting = 0;
+ creature_ptr->resting = 0;
break;
}
case ACTION_LEARN:
{
msg_print(_("学習をやめた。", "You stop Learning"));
- p_ptr->new_mane = FALSE;
+ creature_ptr->new_mane = FALSE;
break;
}
case ACTION_KAMAE:
{
msg_print(_("構えをといた。", "You stop assuming the posture."));
- p_ptr->special_defense &= ~(KAMAE_MASK);
+ creature_ptr->special_defense &= ~(KAMAE_MASK);
break;
}
case ACTION_KATA:
{
msg_print(_("型を崩した。", "You stop assuming the posture."));
- p_ptr->special_defense &= ~(KATA_MASK);
- p_ptr->update |= (PU_MONSTERS);
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->special_defense &= ~(KATA_MASK);
+ creature_ptr->update |= (PU_MONSTERS);
+ creature_ptr->redraw |= (PR_STATUS);
break;
}
case ACTION_SING:
case ACTION_HAYAGAKE:
{
msg_print(_("足が重くなった。", "You are no longer walking extremely fast."));
- take_turn(p_ptr, 100);
+ take_turn(creature_ptr, 100);
break;
}
case ACTION_SPELL:
}
}
- p_ptr->action = typ;
+ creature_ptr->action = typ;
/* If we are requested other action, stop singing */
- if (prev_typ == ACTION_SING) stop_singing(p_ptr);
- if (prev_typ == ACTION_SPELL) stop_hex_spell();
+ if (prev_typ == ACTION_SING) stop_singing(creature_ptr);
+ if (prev_typ == ACTION_SPELL) stop_hex_spell(creature_ptr);
- switch (p_ptr->action)
+ switch (creature_ptr->action)
{
case ACTION_SEARCH:
{
msg_print(_("注意深く歩き始めた。", "You begin to walk carefully."));
- p_ptr->redraw |= (PR_SPEED);
+ creature_ptr->redraw |= (PR_SPEED);
break;
}
case ACTION_LEARN:
break;
}
}
- p_ptr->update |= (PU_BONUS);
- p_ptr->redraw |= (PR_STATE);
+ creature_ptr->update |= (PU_BONUS);
+ creature_ptr->redraw |= (PR_STATE);
}
/*!
* @brief プレイヤーの全ての時限効果をリセットする。 / reset timed flags
* @return なし
*/
-void reset_tim_flags(void)
+void reset_tim_flags(player_type *creature_ptr)
{
- p_ptr->fast = 0; /* Timed -- Fast */
- p_ptr->lightspeed = 0;
- p_ptr->slow = 0; /* Timed -- Slow */
- p_ptr->blind = 0; /* Timed -- Blindness */
- p_ptr->paralyzed = 0; /* Timed -- Paralysis */
- p_ptr->confused = 0; /* Timed -- Confusion */
- p_ptr->afraid = 0; /* Timed -- Fear */
- p_ptr->image = 0; /* Timed -- Hallucination */
- p_ptr->poisoned = 0; /* Timed -- Poisoned */
- p_ptr->cut = 0; /* Timed -- Cut */
- p_ptr->stun = 0; /* Timed -- Stun */
-
- p_ptr->protevil = 0; /* Timed -- Protection */
- p_ptr->invuln = 0; /* Timed -- Invulnerable */
- p_ptr->ult_res = 0;
- p_ptr->hero = 0; /* Timed -- Heroism */
- p_ptr->shero = 0; /* Timed -- Super Heroism */
- p_ptr->shield = 0; /* Timed -- Shield Spell */
- p_ptr->blessed = 0; /* Timed -- Blessed */
- p_ptr->tim_invis = 0; /* Timed -- Invisibility */
- p_ptr->tim_infra = 0; /* Timed -- Infra Vision */
- p_ptr->tim_regen = 0; /* Timed -- Regeneration */
- p_ptr->tim_stealth = 0; /* Timed -- Stealth */
- p_ptr->tim_esp = 0;
- p_ptr->wraith_form = 0; /* Timed -- Wraith Form */
- p_ptr->tim_levitation = 0;
- p_ptr->tim_sh_touki = 0;
- p_ptr->tim_sh_fire = 0;
- p_ptr->tim_sh_holy = 0;
- p_ptr->tim_eyeeye = 0;
- p_ptr->magicdef = 0;
- p_ptr->resist_magic = 0;
- p_ptr->tsuyoshi = 0;
- p_ptr->kabenuke = 0;
- p_ptr->tim_res_nether = 0;
- p_ptr->tim_res_time = 0;
- p_ptr->tim_mimic = 0;
- p_ptr->mimic_form = 0;
- p_ptr->tim_reflect = 0;
- p_ptr->multishadow = 0;
- p_ptr->dustrobe = 0;
- p_ptr->action = ACTION_NONE;
-
- p_ptr->oppose_acid = 0; /* Timed -- oppose acid */
- p_ptr->oppose_elec = 0; /* Timed -- oppose lightning */
- p_ptr->oppose_fire = 0; /* Timed -- oppose heat */
- p_ptr->oppose_cold = 0; /* Timed -- oppose cold */
- p_ptr->oppose_pois = 0; /* Timed -- oppose poison */
-
- p_ptr->word_recall = 0;
- p_ptr->alter_reality = 0;
- p_ptr->sutemi = FALSE;
- p_ptr->counter = FALSE;
- p_ptr->ele_attack = 0;
- p_ptr->ele_immune = 0;
- p_ptr->special_attack = 0L;
- p_ptr->special_defense = 0L;
-
- while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
- p_ptr->timewalk = FALSE;
-
- if (PRACE_IS_(p_ptr, RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
- if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1;
- if (p_ptr->pclass == CLASS_BERSERKER) p_ptr->shero = 1;
-
- if (p_ptr->riding)
- {
- (void)set_monster_fast(p_ptr->riding, 0);
- (void)set_monster_slow(p_ptr->riding, 0);
- (void)set_monster_invulner(p_ptr->riding, 0, FALSE);
- }
-
- if (p_ptr->pclass == CLASS_BARD)
- {
- SINGING_SONG_EFFECT(p_ptr) = 0;
- SINGING_SONG_ID(p_ptr) = 0;
+ creature_ptr->fast = 0; /* Timed -- Fast */
+ creature_ptr->lightspeed = 0;
+ creature_ptr->slow = 0; /* Timed -- Slow */
+ creature_ptr->blind = 0; /* Timed -- Blindness */
+ creature_ptr->paralyzed = 0; /* Timed -- Paralysis */
+ creature_ptr->confused = 0; /* Timed -- Confusion */
+ creature_ptr->afraid = 0; /* Timed -- Fear */
+ creature_ptr->image = 0; /* Timed -- Hallucination */
+ creature_ptr->poisoned = 0; /* Timed -- Poisoned */
+ creature_ptr->cut = 0; /* Timed -- Cut */
+ creature_ptr->stun = 0; /* Timed -- Stun */
+
+ creature_ptr->protevil = 0; /* Timed -- Protection */
+ creature_ptr->invuln = 0; /* Timed -- Invulnerable */
+ creature_ptr->ult_res = 0;
+ creature_ptr->hero = 0; /* Timed -- Heroism */
+ creature_ptr->shero = 0; /* Timed -- Super Heroism */
+ creature_ptr->shield = 0; /* Timed -- Shield Spell */
+ creature_ptr->blessed = 0; /* Timed -- Blessed */
+ creature_ptr->tim_invis = 0; /* Timed -- Invisibility */
+ creature_ptr->tim_infra = 0; /* Timed -- Infra Vision */
+ creature_ptr->tim_regen = 0; /* Timed -- Regeneration */
+ creature_ptr->tim_stealth = 0; /* Timed -- Stealth */
+ creature_ptr->tim_esp = 0;
+ creature_ptr->wraith_form = 0; /* Timed -- Wraith Form */
+ creature_ptr->tim_levitation = 0;
+ creature_ptr->tim_sh_touki = 0;
+ creature_ptr->tim_sh_fire = 0;
+ creature_ptr->tim_sh_holy = 0;
+ creature_ptr->tim_eyeeye = 0;
+ creature_ptr->magicdef = 0;
+ creature_ptr->resist_magic = 0;
+ creature_ptr->tsuyoshi = 0;
+ creature_ptr->kabenuke = 0;
+ creature_ptr->tim_res_nether = 0;
+ creature_ptr->tim_res_time = 0;
+ creature_ptr->tim_mimic = 0;
+ creature_ptr->mimic_form = 0;
+ creature_ptr->tim_reflect = 0;
+ creature_ptr->multishadow = 0;
+ creature_ptr->dustrobe = 0;
+ creature_ptr->action = ACTION_NONE;
+
+ creature_ptr->oppose_acid = 0; /* Timed -- oppose acid */
+ creature_ptr->oppose_elec = 0; /* Timed -- oppose lightning */
+ creature_ptr->oppose_fire = 0; /* Timed -- oppose heat */
+ creature_ptr->oppose_cold = 0; /* Timed -- oppose cold */
+ creature_ptr->oppose_pois = 0; /* Timed -- oppose poison */
+
+ creature_ptr->word_recall = 0;
+ creature_ptr->alter_reality = 0;
+ creature_ptr->sutemi = FALSE;
+ creature_ptr->counter = FALSE;
+ creature_ptr->ele_attack = 0;
+ creature_ptr->ele_immune = 0;
+ creature_ptr->special_attack = 0L;
+ creature_ptr->special_defense = 0L;
+
+ while(creature_ptr->energy_need < 0) creature_ptr->energy_need += ENERGY_NEED();
+ creature_ptr->timewalk = FALSE;
+
+ if (PRACE_IS_(creature_ptr, RACE_DEMON) && (creature_ptr->lev > 44)) creature_ptr->oppose_fire = 1;
+ if ((creature_ptr->pclass == CLASS_NINJA) && (creature_ptr->lev > 44)) creature_ptr->oppose_pois = 1;
+ if (creature_ptr->pclass == CLASS_BERSERKER) creature_ptr->shero = 1;
+
+ if (creature_ptr->riding)
+ {
+ (void)set_monster_fast(creature_ptr->riding, 0);
+ (void)set_monster_slow(creature_ptr->riding, 0);
+ (void)set_monster_invulner(creature_ptr->riding, 0, FALSE);
+ }
+
+ if (creature_ptr->pclass == CLASS_BARD)
+ {
+ SINGING_SONG_EFFECT(creature_ptr) = 0;
+ SINGING_SONG_ID(creature_ptr) = 0;
}
}
* @brief プレイヤーに魔力消去効果を与える。
* @return なし
*/
-void dispel_player(void)
+void dispel_player(player_type *creature_ptr)
{
- (void)set_fast(p_ptr, 0, TRUE);
- (void)set_lightspeed(0, TRUE);
- (void)set_slow(p_ptr, 0, TRUE);
- (void)set_shield(p_ptr, 0, TRUE);
- (void)set_blessed(p_ptr, 0, TRUE);
- (void)set_tsuyoshi(0, TRUE);
- (void)set_hero(0, TRUE);
- (void)set_shero(0, TRUE);
- (void)set_protevil(0, TRUE);
- (void)set_invuln(0, TRUE);
- (void)set_wraith_form(0, TRUE);
- (void)set_kabenuke(0, TRUE);
- (void)set_tim_res_nether(0, TRUE);
- (void)set_tim_res_time(0, TRUE);
+ (void)set_fast(creature_ptr, 0, TRUE);
+ (void)set_lightspeed(creature_ptr, 0, TRUE);
+ (void)set_slow(creature_ptr, 0, TRUE);
+ (void)set_shield(creature_ptr, 0, TRUE);
+ (void)set_blessed(creature_ptr, 0, TRUE);
+ (void)set_tsuyoshi(creature_ptr, 0, TRUE);
+ (void)set_hero(creature_ptr, 0, TRUE);
+ (void)set_shero(creature_ptr, 0, TRUE);
+ (void)set_protevil(creature_ptr, 0, TRUE);
+ (void)set_invuln(creature_ptr, 0, TRUE);
+ (void)set_wraith_form(creature_ptr, 0, TRUE);
+ (void)set_kabenuke(creature_ptr, 0, TRUE);
+ (void)set_tim_res_nether(creature_ptr, 0, TRUE);
+ (void)set_tim_res_time(creature_ptr, 0, TRUE);
/* by henkma */
- (void)set_tim_reflect(0,TRUE);
- (void)set_multishadow(0,TRUE);
- (void)set_dustrobe(0,TRUE);
-
- (void)set_tim_invis(0, TRUE);
- (void)set_tim_infra(0, TRUE);
- (void)set_tim_esp(0, TRUE);
- (void)set_tim_regen(0, TRUE);
- (void)set_tim_stealth(0, TRUE);
- (void)set_tim_levitation(0, TRUE);
- (void)set_tim_sh_touki(0, TRUE);
- (void)set_tim_sh_fire(0, TRUE);
- (void)set_tim_sh_holy(0, TRUE);
- (void)set_tim_eyeeye(0, TRUE);
- (void)set_magicdef(p_ptr, 0, TRUE);
- (void)set_resist_magic(0, TRUE);
- (void)set_oppose_acid(0, TRUE);
- (void)set_oppose_elec(0, TRUE);
- (void)set_oppose_fire(0, TRUE);
- (void)set_oppose_cold(0, TRUE);
- (void)set_oppose_pois(0, TRUE);
- (void)set_ultimate_res(0, TRUE);
- (void)set_mimic(p_ptr, 0, 0, TRUE);
- (void)set_ele_attack(0, 0);
- (void)set_ele_immune(0, 0);
+ (void)set_tim_reflect(creature_ptr, 0,TRUE);
+ (void)set_multishadow(creature_ptr, 0,TRUE);
+ (void)set_dustrobe(creature_ptr, 0,TRUE);
+
+ (void)set_tim_invis(creature_ptr, 0, TRUE);
+ (void)set_tim_infra(creature_ptr, 0, TRUE);
+ (void)set_tim_esp(creature_ptr, 0, TRUE);
+ (void)set_tim_regen(creature_ptr, 0, TRUE);
+ (void)set_tim_stealth(creature_ptr, 0, TRUE);
+ (void)set_tim_levitation(creature_ptr, 0, TRUE);
+ (void)set_tim_sh_touki(creature_ptr, 0, TRUE);
+ (void)set_tim_sh_fire(creature_ptr, 0, TRUE);
+ (void)set_tim_sh_holy(creature_ptr, 0, TRUE);
+ (void)set_tim_eyeeye(creature_ptr, 0, TRUE);
+ (void)set_magicdef(creature_ptr, 0, TRUE);
+ (void)set_resist_magic(creature_ptr, 0, TRUE);
+ (void)set_oppose_acid(creature_ptr, 0, TRUE);
+ (void)set_oppose_elec(creature_ptr, 0, TRUE);
+ (void)set_oppose_fire(creature_ptr, 0, TRUE);
+ (void)set_oppose_cold(creature_ptr, 0, TRUE);
+ (void)set_oppose_pois(creature_ptr, 0, TRUE);
+ (void)set_ultimate_res(creature_ptr, 0, TRUE);
+ (void)set_mimic(creature_ptr, 0, 0, TRUE);
+ (void)set_ele_attack(creature_ptr, 0, 0);
+ (void)set_ele_immune(creature_ptr, 0, 0);
/* Cancel glowing hands */
- if (p_ptr->special_attack & ATTACK_CONFUSE)
+ if (creature_ptr->special_attack & ATTACK_CONFUSE)
{
- p_ptr->special_attack &= ~(ATTACK_CONFUSE);
+ creature_ptr->special_attack &= ~(ATTACK_CONFUSE);
msg_print(_("手の輝きがなくなった。", "Your hands stop glowing."));
}
- if (music_singing_any() || hex_spelling_any())
+ if (music_singing_any(creature_ptr) || hex_spelling_any(creature_ptr))
{
- concptr str = (music_singing_any()) ? _("歌", "singing") : _("呪文", "spelling");
- INTERUPTING_SONG_EFFECT(p_ptr) = SINGING_SONG_EFFECT(p_ptr);
- SINGING_SONG_EFFECT(p_ptr) = MUSIC_NONE;
+ concptr str = (music_singing_any(creature_ptr)) ? _("歌", "singing") : _("呪文", "spelling");
+ INTERUPTING_SONG_EFFECT(creature_ptr) = SINGING_SONG_EFFECT(creature_ptr);
+ SINGING_SONG_EFFECT(creature_ptr) = MUSIC_NONE;
msg_format(_("%sが途切れた。", "Your %s is interrupted."), str);
- p_ptr->action = ACTION_NONE;
- p_ptr->update |= (PU_BONUS | PU_HP | PU_MONSTERS);
- p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
- p_ptr->energy_need += ENERGY_NEED();
+ creature_ptr->action = ACTION_NONE;
+ creature_ptr->update |= (PU_BONUS | PU_HP | PU_MONSTERS);
+ creature_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
+ creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+ creature_ptr->energy_need += ENERGY_NEED();
}
}
/*!
- * @brief 変身効果の継続時間と変身先をセットする / Set "p_ptr->tim_mimic", and "p_ptr->mimic_form", notice observable changes
+ * @brief 変身効果の継続時間と変身先をセットする / Set "tim_mimic", and "mimic_form", notice observable changes
* @param v 継続時間
* @param p 変身内容
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, IDX p, bool do_dec)
+bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, MIMIC_RACE_IDX p, bool do_dec)
{
bool notice = FALSE;
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
if (creature_ptr->is_dead) return FALSE;
- /* Open */
if (v)
{
if (creature_ptr->tim_mimic && (creature_ptr->mimic_form == p) && !do_dec)
}
}
- /* Shut */
else
{
if (creature_ptr->tim_mimic)
{
msg_print(_("変身が解けた。", "You are no longer transformed."));
- if (creature_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(0, TRUE);
+ if (creature_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(creature_ptr, 0, TRUE);
creature_ptr->mimic_form=0;
notice = TRUE;
p = 0;
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, TRUE);
+ if (disturb_state) disturb(creature_ptr, FALSE, TRUE);
creature_ptr->redraw |= (PR_BASIC | PR_STATUS);
creature_ptr->update |= (PU_BONUS | PU_HP);
}
/*!
- * @brief 盲目の継続時間をセットする / Set "p_ptr->blind", notice observable changes
+ * @brief 盲目の継続時間をセットする / Set "blind", notice observable changes
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
* @details
if (creature_ptr->is_dead) return FALSE;
- /* Open */
if (v)
{
if (!creature_ptr->blind)
}
notice = TRUE;
- chg_virtue(V_ENLIGHTEN, -1);
+ chg_virtue(creature_ptr, V_ENLIGHTEN, -1);
}
}
- /* Shut */
else
{
if (creature_ptr->blind)
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
/* Fully update the visuals */
creature_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
/*!
- * @brief 混乱の継続時間をセットする / Set "p_ptr->confused", notice observable changes
+ * @brief 混乱の継続時間をセットする / Set "confused", notice observable changes
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
if (creature_ptr->is_dead) return FALSE;
- /* Open */
if (v)
{
if (!creature_ptr->confused)
}
/* Sniper */
- if (creature_ptr->concent) reset_concentration(TRUE);
+ if (creature_ptr->concent) reset_concentration(creature_ptr, TRUE);
- /* Hex */
- if (hex_spelling_any()) stop_hex_spell_all();
+ if (hex_spelling_any(creature_ptr)) stop_hex_spell_all(creature_ptr);
notice = TRUE;
creature_ptr->counter = FALSE;
- chg_virtue(V_HARMONY, -1);
+ chg_virtue(creature_ptr, V_HARMONY, -1);
}
}
- /* Shut */
else
{
if (creature_ptr->confused)
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 毒の継続時間をセットする / Set "p_ptr->poisoned", notice observable changes
+ * @brief 毒の継続時間をセットする / Set "poisoned", notice observable changes
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
if (creature_ptr->is_dead) return FALSE;
- /* Open */
if (v)
{
if (!creature_ptr->poisoned)
}
}
- /* Shut */
else
{
if (creature_ptr->poisoned)
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 恐怖の継続時間をセットする / Set "p_ptr->afraid", notice observable changes
+ * @brief 恐怖の継続時間をセットする / Set "afraid", notice observable changes
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
if (creature_ptr->is_dead) return FALSE;
- /* Open */
if (v)
{
if (!creature_ptr->afraid)
notice = TRUE;
creature_ptr->counter = FALSE;
- chg_virtue(V_VALOUR, -1);
+ chg_virtue(creature_ptr, V_VALOUR, -1);
}
}
- /* Shut */
else
{
if (creature_ptr->afraid)
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
handle_stuff();
return (TRUE);
}
if (creature_ptr->is_dead) return FALSE;
- /* Open */
if (v)
{
if (!creature_ptr->paralyzed)
{
msg_print(_("体が麻痺してしまった!", "You are paralyzed!"));
- /* Sniper */
- if (creature_ptr->concent) reset_concentration(TRUE);
-
- /* Hex */
- if (hex_spelling_any()) stop_hex_spell_all();
+ if (creature_ptr->concent) reset_concentration(creature_ptr, TRUE);
+ if (hex_spelling_any(creature_ptr)) stop_hex_spell_all(creature_ptr);
creature_ptr->counter = FALSE;
notice = TRUE;
}
}
- /* Shut */
else
{
if (creature_ptr->paralyzed)
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
creature_ptr->redraw |= (PR_STATE);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 幻覚の継続時間をセットする / Set "p_ptr->image", notice observable changes
+ * @brief 幻覚の継続時間をセットする / Set "image", notice observable changes
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
* @details Note that we must redraw the map when hallucination changes.
if (creature_ptr->is_dead) return FALSE;
if (creature_ptr->pseikaku == SEIKAKU_CHARGEMAN) v = 0;
- /* Open */
if (v)
{
- set_tsuyoshi(0, TRUE);
+ set_tsuyoshi(creature_ptr, 0, TRUE);
if (!creature_ptr->image)
{
msg_print(_("ワーオ!何もかも虹色に見える!", "Oh, wow! Everything looks so cosmic now!"));
/* Sniper */
- if (creature_ptr->concent) reset_concentration(TRUE);
+ if (creature_ptr->concent) reset_concentration(creature_ptr, TRUE);
creature_ptr->counter = FALSE;
notice = TRUE;
}
}
- /* Shut */
else
{
if (creature_ptr->image)
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, TRUE);
+ if (disturb_state) disturb(creature_ptr, FALSE, TRUE);
creature_ptr->redraw |= (PR_MAP | PR_HEALTH | PR_UHEALTH);
creature_ptr->update |= (PU_MONSTERS);
}
/*!
- * @brief 加速の継続時間をセットする / Set "p_ptr->fast", notice observable changes
+ * @brief 加速の継続時間をセットする / Set "fast", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
if (creature_ptr->is_dead) return FALSE;
- /* Open */
if (v)
{
if (creature_ptr->fast && !do_dec)
{
if (creature_ptr->fast > v) return FALSE;
}
- else if (!IS_FAST() && !creature_ptr->lightspeed)
+ else if (!IS_FAST(creature_ptr) && !creature_ptr->lightspeed)
{
msg_print(_("素早く動けるようになった!", "You feel yourself moving much faster!"));
notice = TRUE;
- chg_virtue(V_PATIENCE, -1);
- chg_virtue(V_DILIGENCE, 1);
+ chg_virtue(creature_ptr, V_PATIENCE, -1);
+ chg_virtue(creature_ptr, V_DILIGENCE, 1);
}
}
- /* Shut */
else
{
- if (creature_ptr->fast && !creature_ptr->lightspeed && !music_singing(MUSIC_SPEED) && !music_singing(MUSIC_SHERO))
+ if (creature_ptr->fast && !creature_ptr->lightspeed && !music_singing(creature_ptr, MUSIC_SPEED) && !music_singing(creature_ptr, MUSIC_SHERO))
{
msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
notice = TRUE;
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 光速移動の継続時間をセットする / Set "p_ptr->lightspeed", notice observable changes
+ * @brief 光速移動の継続時間をセットする / Set "lightspeed", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_lightspeed(TIME_EFFECT v, bool do_dec)
+bool set_lightspeed(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;
- if (p_ptr->wild_mode) v = 0;
+ if (creature_ptr->wild_mode) v = 0;
- /* Open */
if (v)
{
- if (p_ptr->lightspeed && !do_dec)
+ if (creature_ptr->lightspeed && !do_dec)
{
- if (p_ptr->lightspeed > v) return FALSE;
+ if (creature_ptr->lightspeed > v) return FALSE;
}
- else if (!p_ptr->lightspeed)
+ else if (!creature_ptr->lightspeed)
{
msg_print(_("非常に素早く動けるようになった!", "You feel yourself moving extremely faster!"));
notice = TRUE;
- chg_virtue(V_PATIENCE, -1);
- chg_virtue(V_DILIGENCE, 1);
+ chg_virtue(creature_ptr, V_PATIENCE, -1);
+ chg_virtue(creature_ptr, V_DILIGENCE, 1);
}
}
- /* Shut */
else
{
- if (p_ptr->lightspeed)
+ if (creature_ptr->lightspeed)
{
msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
notice = TRUE;
}
/* Use the value */
- p_ptr->lightspeed = v;
+ creature_ptr->lightspeed = v;
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 減速の継続時間をセットする / Set "p_ptr->slow", notice observable changes
+ * @brief 減速の継続時間をセットする / Set "slow", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
if (creature_ptr->is_dead) return FALSE;
- /* Open */
if (v)
{
if (creature_ptr->slow && !do_dec)
}
}
- /* Shut */
else
{
if (creature_ptr->slow)
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
/*!
- * @brief 肌石化の継続時間をセットする / Set "p_ptr->shield", notice observable changes
+ * @brief 肌石化の継続時間をセットする / Set "shield", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
if (creature_ptr->is_dead) return FALSE;
- /* Open */
if (v)
{
if (creature_ptr->shield && !do_dec)
}
}
- /* Shut */
else
{
if (creature_ptr->shield)
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
/*!
- * @brief つぶれるの継続時間をセットする / Set "p_ptr->tsubureru", notice observable changes
+ * @brief つぶれるの継続時間をセットする / Set "tsubureru", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
if (creature_ptr->is_dead) return FALSE;
- /* Open */
if (v)
{
if (creature_ptr->tsubureru && !do_dec)
}
}
- /* Shut */
else
{
if (creature_ptr->tsubureru)
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
/*!
- * @brief 魔法の鎧の継続時間をセットする / Set "p_ptr->magicdef", notice observable changes
+ * @brief 魔法の鎧の継続時間をセットする / Set "magicdef", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
if (creature_ptr->is_dead) return FALSE;
- /* Open */
if (v)
{
if (creature_ptr->magicdef && !do_dec)
}
}
- /* Shut */
else
{
if (creature_ptr->magicdef)
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 祝福の継続時間をセットする / Set "p_ptr->blessed", notice observable changes
+ * @brief 祝福の継続時間をセットする / Set "blessed", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
if (creature_ptr->is_dead) return FALSE;
- /* Open */
if (v)
{
if (creature_ptr->blessed && !do_dec)
}
}
- /* Shut */
else
{
- if (creature_ptr->blessed && !music_singing(MUSIC_BLESS))
+ if (creature_ptr->blessed && !music_singing(creature_ptr, MUSIC_BLESS))
{
msg_print(_("高潔な気分が消え失せた。", "The prayer has expired."));
notice = TRUE;
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
/*!
- * @brief 士気高揚の継続時間をセットする / Set "p_ptr->hero", notice observable changes
+ * @brief 士気高揚の継続時間をセットする / Set "hero", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_hero(TIME_EFFECT v, bool do_dec)
+bool set_hero(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->hero && !do_dec)
+ if (creature_ptr->hero && !do_dec)
{
- if (p_ptr->hero > v) return FALSE;
+ if (creature_ptr->hero > v) return FALSE;
}
else if (!IS_HERO())
{
}
}
- /* Shut */
else
{
- if (p_ptr->hero && !music_singing(MUSIC_HERO) && !music_singing(MUSIC_SHERO))
+ if (creature_ptr->hero && !music_singing(creature_ptr, MUSIC_HERO) && !music_singing(creature_ptr, MUSIC_SHERO))
{
msg_print(_("ヒーローの気分が消え失せた。", "The heroism wears off."));
notice = TRUE;
}
/* Use the value */
- p_ptr->hero = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->hero = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
/* Recalculate hitpoints */
- p_ptr->update |= (PU_HP);
+ creature_ptr->update |= (PU_HP);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 狂戦士化の継続時間をセットする / Set "p_ptr->shero", notice observable changes
+ * @brief 狂戦士化の継続時間をセットする / Set "shero", notice observable changes
* @param v 継続時間/ 0ならば無条件にリセット
* @param do_dec FALSEの場合現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_shero(TIME_EFFECT v, bool do_dec)
+bool set_shero(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;
- if (p_ptr->pclass == CLASS_BERSERKER) v = 1;
- /* Open */
+ if (creature_ptr->pclass == CLASS_BERSERKER) v = 1;
if (v)
{
- if (p_ptr->shero && !do_dec)
+ if (creature_ptr->shero && !do_dec)
{
- if (p_ptr->shero > v) return FALSE;
+ if (creature_ptr->shero > v) return FALSE;
}
- else if (!p_ptr->shero)
+ else if (!creature_ptr->shero)
{
msg_print(_("殺戮マシーンになった気がする!", "You feel like a killing machine!"));
notice = TRUE;
}
}
- /* Shut */
else
{
- if (p_ptr->shero)
+ if (creature_ptr->shero)
{
msg_print(_("野蛮な気持ちが消え失せた。", "You feel less Berserk."));
notice = TRUE;
}
/* Use the value */
- p_ptr->shero = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->shero = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
/* Recalculate hitpoints */
- p_ptr->update |= (PU_HP);
+ creature_ptr->update |= (PU_HP);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 対邪悪結界の継続時間をセットする / Set "p_ptr->protevil", notice observable changes
+ * @brief 対邪悪結界の継続時間をセットする / Set "protevil", notice observable changes
* @param v 継続時間
* @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);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 幽体化の継続時間をセットする / Set "p_ptr->wraith_form", notice observable changes
+ * @brief 幽体化の継続時間をセットする / Set "wraith_form", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_wraith_form(TIME_EFFECT v, bool do_dec)
+bool set_wraith_form(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->wraith_form && !do_dec)
+ if (creature_ptr->wraith_form && !do_dec)
{
- if (p_ptr->wraith_form > v) return FALSE;
+ if (creature_ptr->wraith_form > v) return FALSE;
}
- else if (!p_ptr->wraith_form)
+ else if (!creature_ptr->wraith_form)
{
msg_print(_("物質界を離れて幽鬼のような存在になった!", "You leave the physical world and current_world_ptr->game_turn into a wraith-being!"));
notice = TRUE;
- chg_virtue(V_UNLIFE, 3);
- chg_virtue(V_HONOUR, -2);
- chg_virtue(V_SACRIFICE, -2);
- chg_virtue(V_VALOUR, -5);
+ chg_virtue(creature_ptr, V_UNLIFE, 3);
+ chg_virtue(creature_ptr, V_HONOUR, -2);
+ chg_virtue(creature_ptr, V_SACRIFICE, -2);
+ chg_virtue(creature_ptr, V_VALOUR, -5);
- p_ptr->redraw |= (PR_MAP);
- p_ptr->update |= (PU_MONSTERS);
+ creature_ptr->redraw |= (PR_MAP);
+ creature_ptr->update |= (PU_MONSTERS);
- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+ creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
}
}
- /* Shut */
else
{
- if (p_ptr->wraith_form)
+ if (creature_ptr->wraith_form)
{
msg_print(_("不透明になった感じがする。", "You feel opaque."));
notice = TRUE;
- p_ptr->redraw |= (PR_MAP);
- p_ptr->update |= (PU_MONSTERS);
+ creature_ptr->redraw |= (PR_MAP);
+ creature_ptr->update |= (PU_MONSTERS);
- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+ creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
}
}
/* Use the value */
- p_ptr->wraith_form = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->wraith_form = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 無傷球の継続時間をセットする / Set "p_ptr->invuln", notice observable changes
+ * @brief 無傷球の継続時間をセットする / Set "invuln", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_invuln(TIME_EFFECT v, bool do_dec)
+bool set_invuln(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->invuln && !do_dec)
+ if (creature_ptr->invuln && !do_dec)
{
- if (p_ptr->invuln > v) return FALSE;
+ if (creature_ptr->invuln > v) return FALSE;
}
else if (!IS_INVULN())
{
msg_print(_("無敵だ!", "Invulnerability!"));
notice = TRUE;
- chg_virtue(V_UNLIFE, -2);
- chg_virtue(V_HONOUR, -2);
- chg_virtue(V_SACRIFICE, -3);
- chg_virtue(V_VALOUR, -5);
+ chg_virtue(creature_ptr, V_UNLIFE, -2);
+ chg_virtue(creature_ptr, V_HONOUR, -2);
+ chg_virtue(creature_ptr, V_SACRIFICE, -3);
+ chg_virtue(creature_ptr, V_VALOUR, -5);
- p_ptr->redraw |= (PR_MAP);
- p_ptr->update |= (PU_MONSTERS);
+ creature_ptr->redraw |= (PR_MAP);
+ creature_ptr->update |= (PU_MONSTERS);
- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+ creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
}
}
- /* Shut */
else
{
- if (p_ptr->invuln && !music_singing(MUSIC_INVULN))
+ if (creature_ptr->invuln && !music_singing(creature_ptr, MUSIC_INVULN))
{
msg_print(_("無敵ではなくなった。", "The invulnerability wears off."));
notice = TRUE;
- p_ptr->redraw |= (PR_MAP);
- p_ptr->update |= (PU_MONSTERS);
+ creature_ptr->redraw |= (PR_MAP);
+ creature_ptr->update |= (PU_MONSTERS);
- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+ creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
- p_ptr->energy_need += ENERGY_NEED();
+ creature_ptr->energy_need += ENERGY_NEED();
}
}
/* Use the value */
- p_ptr->invuln = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->invuln = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 時限ESPの継続時間をセットする / Set "p_ptr->tim_esp", notice observable changes
+ * @brief 時限ESPの継続時間をセットする / Set "tim_esp", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_esp(TIME_EFFECT v, bool do_dec)
+bool set_tim_esp(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->tim_esp && !do_dec)
+ if (creature_ptr->tim_esp && !do_dec)
{
- if (p_ptr->tim_esp > v) return FALSE;
+ if (creature_ptr->tim_esp > v) return FALSE;
}
else if (!IS_TIM_ESP())
{
}
}
- /* Shut */
else
{
- if (p_ptr->tim_esp && !music_singing(MUSIC_MIND))
+ if (creature_ptr->tim_esp && !music_singing(creature_ptr, MUSIC_MIND))
{
msg_print(_("意識は元に戻った。", "Your consciousness contracts again."));
notice = TRUE;
}
/* Use the value */
- p_ptr->tim_esp = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->tim_esp = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
- p_ptr->update |= (PU_MONSTERS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
+ creature_ptr->update |= (PU_MONSTERS);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 時限透明視の継続時間をセットする / Set "p_ptr->tim_invis", notice observable changes
+ * @brief 時限透明視の継続時間をセットする / Set "tim_invis", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_invis(TIME_EFFECT v, bool do_dec)
+bool set_tim_invis(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->tim_invis && !do_dec)
+ if (creature_ptr->tim_invis && !do_dec)
{
- if (p_ptr->tim_invis > v) return FALSE;
+ if (creature_ptr->tim_invis > v) return FALSE;
}
- else if (!p_ptr->tim_invis)
+ else if (!creature_ptr->tim_invis)
{
msg_print(_("目が非常に敏感になった気がする!", "Your eyes feel very sensitive!"));
notice = TRUE;
}
}
- /* Shut */
else
{
- if (p_ptr->tim_invis)
+ if (creature_ptr->tim_invis)
{
msg_print(_("目の敏感さがなくなったようだ。", "Your eyes feel less sensitive."));
notice = TRUE;
}
/* Use the value */
- p_ptr->tim_invis = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->tim_invis = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
/* Update the monsters */
- p_ptr->update |= (PU_MONSTERS);
+ creature_ptr->update |= (PU_MONSTERS);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 時限赤外線視力の継続時間をセットする / Set "p_ptr->tim_infra", notice observable changes
+ * @brief 時限赤外線視力の継続時間をセットする / Set "tim_infra", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_infra(TIME_EFFECT v, bool do_dec)
+bool set_tim_infra(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->tim_infra && !do_dec)
+ if (creature_ptr->tim_infra && !do_dec)
{
- if (p_ptr->tim_infra > v) return FALSE;
+ if (creature_ptr->tim_infra > v) return FALSE;
}
- else if (!p_ptr->tim_infra)
+ else if (!creature_ptr->tim_infra)
{
msg_print(_("目がランランと輝き始めた!", "Your eyes begin to tingle!"));
notice = TRUE;
}
}
- /* Shut */
else
{
- if (p_ptr->tim_infra)
+ if (creature_ptr->tim_infra)
{
msg_print(_("目の輝きがなくなった。", "Your eyes stop tingling."));
notice = TRUE;
}
/* Use the value */
- p_ptr->tim_infra = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->tim_infra = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
/* Update the monsters */
- p_ptr->update |= (PU_MONSTERS);
+ creature_ptr->update |= (PU_MONSTERS);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 時限急回復の継続時間をセットする / Set "p_ptr->tim_regen", notice observable changes
+ * @brief 時限急回復の継続時間をセットする / Set "tim_regen", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_regen(TIME_EFFECT v, bool do_dec)
+bool set_tim_regen(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->tim_regen && !do_dec)
+ if (creature_ptr->tim_regen && !do_dec)
{
- if (p_ptr->tim_regen > v) return FALSE;
+ if (creature_ptr->tim_regen > v) return FALSE;
}
- else if (!p_ptr->tim_regen)
+ else if (!creature_ptr->tim_regen)
{
msg_print(_("回復力が上がった!", "You feel yourself regenerating quickly!"));
notice = TRUE;
}
}
- /* Shut */
else
{
- if (p_ptr->tim_regen)
+ if (creature_ptr->tim_regen)
{
msg_print(_("素早く回復する感じがなくなった。", "You feel yourself regenerating slowly."));
notice = TRUE;
}
/* Use the value */
- p_ptr->tim_regen = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->tim_regen = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 隠密の歌の継続時間をセットする / Set "p_ptr->tim_stealth", notice observable changes
+ * @brief 隠密の歌の継続時間をセットする / Set "tim_stealth", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_stealth(TIME_EFFECT v, bool do_dec)
+bool set_tim_stealth(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->tim_stealth && !do_dec)
+ if (creature_ptr->tim_stealth && !do_dec)
{
- if (p_ptr->tim_stealth > v) return FALSE;
+ if (creature_ptr->tim_stealth > v) return FALSE;
}
else if (!IS_TIM_STEALTH())
{
}
}
- /* Shut */
else
{
- if (p_ptr->tim_stealth && !music_singing(MUSIC_STEALTH))
+ if (creature_ptr->tim_stealth && !music_singing(creature_ptr, MUSIC_STEALTH))
{
msg_print(_("足音が大きくなった。", "You no longer walk silently."));
notice = TRUE;
}
/* Use the value */
- p_ptr->tim_stealth = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->tim_stealth = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @param set TRUEならば超隠密状態になる。
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_superstealth(bool set)
+bool set_superstealth(player_type *creature_ptr, bool set)
{
bool notice = FALSE;
- if (p_ptr->is_dead) return FALSE;
+ if (creature_ptr->is_dead) return FALSE;
- /* Open */
if (set)
{
- if (!(p_ptr->special_defense & NINJA_S_STEALTH))
+ if (!(creature_ptr->special_defense & NINJA_S_STEALTH))
{
- if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_MNLT)
+ if (p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & CAVE_MNLT)
{
msg_print(_("敵の目から薄い影の中に覆い隠された。", "You are mantled in weak shadow from ordinary eyes."));
- p_ptr->monlite = p_ptr->old_monlite = TRUE;
+ creature_ptr->monlite = creature_ptr->old_monlite = TRUE;
}
else
{
msg_print(_("敵の目から影の中に覆い隠された!", "You are mantled in shadow from ordinary eyes!"));
- p_ptr->monlite = p_ptr->old_monlite = FALSE;
+ creature_ptr->monlite = creature_ptr->old_monlite = FALSE;
}
notice = TRUE;
/* Use the value */
- p_ptr->special_defense |= NINJA_S_STEALTH;
+ creature_ptr->special_defense |= NINJA_S_STEALTH;
}
}
- /* Shut */
else
{
- if (p_ptr->special_defense & NINJA_S_STEALTH)
+ if (creature_ptr->special_defense & NINJA_S_STEALTH)
{
msg_print(_("再び敵の目にさらされるようになった。", "You are exposed to common sight once more."));
notice = TRUE;
/* Use the value */
- p_ptr->special_defense &= ~(NINJA_S_STEALTH);
+ creature_ptr->special_defense &= ~(NINJA_S_STEALTH);
}
}
/* Nothing to notice */
if (!notice) return (FALSE);
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->redraw |= (PR_STATUS);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
return (TRUE);
}
/*!
- * @brief 一時的浮遊の継続時間をセットする / Set "p_ptr->tim_levitation", notice observable changes
+ * @brief 一時的浮遊の継続時間をセットする / Set "tim_levitation", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
+bool set_tim_levitation(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->tim_levitation && !do_dec)
+ if (creature_ptr->tim_levitation && !do_dec)
{
- if (p_ptr->tim_levitation > v) return FALSE;
+ if (creature_ptr->tim_levitation > v) return FALSE;
}
- else if (!p_ptr->tim_levitation)
+ else if (!creature_ptr->tim_levitation)
{
msg_print(_("体が宙に浮き始めた。", "You begin to fly!"));
notice = TRUE;
}
}
- /* Shut */
else
{
- if (p_ptr->tim_levitation)
+ if (creature_ptr->tim_levitation)
{
msg_print(_("もう宙に浮かべなくなった。", "You stop flying."));
notice = TRUE;
}
/* Use the value */
- p_ptr->tim_levitation = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->tim_levitation = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 一時的闘気のオーラの継続時間をセットする / Set "p_ptr->tim_sh_touki", notice observable changes
+ * @brief 一時的闘気のオーラの継続時間をセットする / Set "tim_sh_touki", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec)
+bool set_tim_sh_touki(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->tim_sh_touki && !do_dec)
+ if (creature_ptr->tim_sh_touki && !do_dec)
{
- if (p_ptr->tim_sh_touki > v) return FALSE;
+ if (creature_ptr->tim_sh_touki > v) return FALSE;
}
- else if (!p_ptr->tim_sh_touki)
+ else if (!creature_ptr->tim_sh_touki)
{
msg_print(_("体が闘気のオーラで覆われた。", "You have enveloped by the aura of the Force!"));
notice = TRUE;
}
}
- /* Shut */
else
{
- if (p_ptr->tim_sh_touki)
+ if (creature_ptr->tim_sh_touki)
{
msg_print(_("闘気が消えた。", "Aura of the Force disappeared."));
notice = TRUE;
}
/* Use the value */
- p_ptr->tim_sh_touki = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->tim_sh_touki = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 一時的火炎のオーラの継続時間をセットする / Set "p_ptr->tim_sh_fire", notice observable changes
+ * @brief 一時的火炎のオーラの継続時間をセットする / Set "tim_sh_fire", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec)
+bool set_tim_sh_fire(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->tim_sh_fire && !do_dec)
+ if (creature_ptr->tim_sh_fire && !do_dec)
{
- if (p_ptr->tim_sh_fire > v) return FALSE;
+ if (creature_ptr->tim_sh_fire > v) return FALSE;
}
- else if (!p_ptr->tim_sh_fire)
+ else if (!creature_ptr->tim_sh_fire)
{
msg_print(_("体が炎のオーラで覆われた。", "You have enveloped by fiery aura!"));
notice = TRUE;
}
}
- /* Shut */
else
{
- if (p_ptr->tim_sh_fire)
+ if (creature_ptr->tim_sh_fire)
{
msg_print(_("炎のオーラが消えた。", "Fiery aura disappeared."));
notice = TRUE;
}
/* Use the value */
- p_ptr->tim_sh_fire = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->tim_sh_fire = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 一時的聖なるのオーラの継続時間をセットする / Set "p_ptr->tim_sh_holy", notice observable changes
+ * @brief 一時的聖なるのオーラの継続時間をセットする / Set "tim_sh_holy", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec)
+bool set_tim_sh_holy(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->tim_sh_holy && !do_dec)
+ if (creature_ptr->tim_sh_holy && !do_dec)
{
- if (p_ptr->tim_sh_holy > v) return FALSE;
+ if (creature_ptr->tim_sh_holy > v) return FALSE;
}
- else if (!p_ptr->tim_sh_holy)
+ else if (!creature_ptr->tim_sh_holy)
{
msg_print(_("体が聖なるオーラで覆われた。", "You have enveloped by holy aura!"));
notice = TRUE;
}
}
- /* Shut */
else
{
- if (p_ptr->tim_sh_holy)
+ if (creature_ptr->tim_sh_holy)
{
msg_print(_("聖なるオーラが消えた。", "Holy aura disappeared."));
notice = TRUE;
}
/* Use the value */
- p_ptr->tim_sh_holy = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->tim_sh_holy = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 目には目をの残り時間をセットする / Set "p_ptr->tim_eyeeye", notice observable changes
+ * @brief 目には目をの残り時間をセットする / Set "tim_eyeeye", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec)
+bool set_tim_eyeeye(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->tim_eyeeye && !do_dec)
+ if (creature_ptr->tim_eyeeye && !do_dec)
{
- if (p_ptr->tim_eyeeye > v) return FALSE;
+ if (creature_ptr->tim_eyeeye > v) return FALSE;
}
- else if (!p_ptr->tim_eyeeye)
+ else if (!creature_ptr->tim_eyeeye)
{
msg_print(_("法の守り手になった気がした!", "You feel like a keeper of commandments!"));
notice = TRUE;
}
}
- /* Shut */
else
{
- if (p_ptr->tim_eyeeye)
+ if (creature_ptr->tim_eyeeye)
{
msg_print(_("懲罰を執行することができなくなった。", "You no longer feel like a keeper."));
notice = TRUE;
}
/* Use the value */
- p_ptr->tim_eyeeye = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->tim_eyeeye = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 一時的魔法防御の継続時間をセットする / Set "p_ptr->resist_magic", notice observable changes
+ * @brief 一時的魔法防御の継続時間をセットする / Set "resist_magic", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_resist_magic(TIME_EFFECT v, bool do_dec)
+bool set_resist_magic(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->resist_magic && !do_dec)
+ if (creature_ptr->resist_magic && !do_dec)
{
- if (p_ptr->resist_magic > v) return FALSE;
+ if (creature_ptr->resist_magic > v) return FALSE;
}
- else if (!p_ptr->resist_magic)
+ else if (!creature_ptr->resist_magic)
{
msg_print(_("魔法への耐性がついた。", "You have been protected from magic!"));
notice = TRUE;
}
}
- /* Shut */
else
{
- if (p_ptr->resist_magic)
+ if (creature_ptr->resist_magic)
{
msg_print(_("魔法に弱くなった。", "You are no longer protected from magic."));
notice = TRUE;
}
/* Use the value */
- p_ptr->resist_magic = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->resist_magic = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 一時的反射の継続時間をセットする / Set "p_ptr->tim_reflect", notice observable changes
+ * @brief 一時的反射の継続時間をセットする / Set "tim_reflect", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_reflect(TIME_EFFECT v, bool do_dec)
+bool set_tim_reflect(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->tim_reflect && !do_dec)
+ if (creature_ptr->tim_reflect && !do_dec)
{
- if (p_ptr->tim_reflect > v) return FALSE;
+ if (creature_ptr->tim_reflect > v) return FALSE;
}
- else if (!p_ptr->tim_reflect)
+ else if (!creature_ptr->tim_reflect)
{
msg_print(_("体の表面が滑かになった気がする。", "Your body becames smooth."));
notice = TRUE;
}
}
- /* Shut */
else
{
- if (p_ptr->tim_reflect)
+ if (creature_ptr->tim_reflect)
{
msg_print(_("体の表面が滑かでなくなった。", "Your body is no longer smooth."));
notice = TRUE;
}
/* Use the value */
- p_ptr->tim_reflect = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->tim_reflect = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
/*
- * Set "p_ptr->multishadow", notice observable changes
+ * Set "multishadow", notice observable changes
*/
-bool set_multishadow(TIME_EFFECT v, bool do_dec)
+bool set_multishadow(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->multishadow && !do_dec)
+ if (creature_ptr->multishadow && !do_dec)
{
- if (p_ptr->multishadow > v) return FALSE;
+ if (creature_ptr->multishadow > v) return FALSE;
}
- else if (!p_ptr->multishadow)
+ else if (!creature_ptr->multishadow)
{
msg_print(_("あなたの周りに幻影が生まれた。", "Your Shadow enveloped you."));
notice = TRUE;
}
}
- /* Shut */
else
{
- if (p_ptr->multishadow)
+ if (creature_ptr->multishadow)
{
msg_print(_("幻影が消えた。", "Your Shadow disappears."));
notice = TRUE;
}
/* Use the value */
- p_ptr->multishadow = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->multishadow = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 一時的破片のオーラの継続時間をセットする / Set "p_ptr->dustrobe", notice observable changes
+ * @brief 一時的破片のオーラの継続時間をセットする / Set "dustrobe", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_dustrobe(TIME_EFFECT v, bool do_dec)
+bool set_dustrobe(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->dustrobe && !do_dec)
+ if (creature_ptr->dustrobe && !do_dec)
{
- if (p_ptr->dustrobe > v) return FALSE;
+ if (creature_ptr->dustrobe > v) return FALSE;
}
- else if (!p_ptr->dustrobe)
+ else if (!creature_ptr->dustrobe)
{
msg_print(_("体が鏡のオーラで覆われた。", "You were enveloped by mirror shards."));
notice = TRUE;
}
}
- /* Shut */
else
{
- if (p_ptr->dustrobe)
+ if (creature_ptr->dustrobe)
{
msg_print(_("鏡のオーラが消えた。", "The mirror shards disappear."));
notice = TRUE;
}
/* Use the value */
- p_ptr->dustrobe = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->dustrobe = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 一時的壁抜けの継続時間をセットする / Set "p_ptr->kabenuke", notice observable changes
+ * @brief 一時的壁抜けの継続時間をセットする / Set "kabenuke", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_kabenuke(TIME_EFFECT v, bool do_dec)
+bool set_kabenuke(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->kabenuke && !do_dec)
+ if (creature_ptr->kabenuke && !do_dec)
{
- if (p_ptr->kabenuke > v) return FALSE;
+ if (creature_ptr->kabenuke > v) return FALSE;
}
- else if (!p_ptr->kabenuke)
+ else if (!creature_ptr->kabenuke)
{
msg_print(_("体が半物質の状態になった。", "You became ethereal form."));
notice = TRUE;
}
}
- /* Shut */
else
{
- if (p_ptr->kabenuke)
+ if (creature_ptr->kabenuke)
{
msg_print(_("体が物質化した。", "You are no longer in an ethereal form."));
notice = TRUE;
}
/* Use the value */
- p_ptr->kabenuke = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->kabenuke = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
/*!
- * @brief オクレ兄さんの継続時間をセットする / Set "p_ptr->tsuyoshi", notice observable changes
+ * @brief オクレ兄さんの継続時間をセットする / Set "tsuyoshi", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tsuyoshi(TIME_EFFECT v, bool do_dec)
+bool set_tsuyoshi(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->tsuyoshi && !do_dec)
+ if (creature_ptr->tsuyoshi && !do_dec)
{
- if (p_ptr->tsuyoshi > v) return FALSE;
+ if (creature_ptr->tsuyoshi > v) return FALSE;
}
- else if (!p_ptr->tsuyoshi)
+ else if (!creature_ptr->tsuyoshi)
{
msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
notice = TRUE;
- chg_virtue(V_VITALITY, 2);
+ chg_virtue(creature_ptr, V_VITALITY, 2);
}
}
- /* Shut */
else
{
- if (p_ptr->tsuyoshi)
+ if (creature_ptr->tsuyoshi)
{
msg_print(_("肉体が急速にしぼんでいった。", "Your body had quickly shriveled."));
- (void)dec_stat(p_ptr, A_CON, 20, TRUE);
- (void)dec_stat(p_ptr, A_STR, 20, TRUE);
+ (void)dec_stat(creature_ptr, A_CON, 20, TRUE);
+ (void)dec_stat(creature_ptr, A_STR, 20, TRUE);
notice = TRUE;
- chg_virtue(V_VITALITY, -3);
+ chg_virtue(creature_ptr, V_VITALITY, -3);
}
}
/* Use the value */
- p_ptr->tsuyoshi = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->tsuyoshi = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
/* Recalculate hitpoints */
- p_ptr->update |= (PU_HP);
+ creature_ptr->update |= (PU_HP);
handle_stuff();
return (TRUE);
}
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_ele_attack(u32b attack_type, TIME_EFFECT v)
+bool set_ele_attack(player_type *creature_ptr, u32b attack_type, TIME_EFFECT v)
{
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
/* Clear all elemental attacks (only one is allowed at a time). */
- if ((p_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
+ if ((creature_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
{
- p_ptr->special_attack &= ~(ATTACK_ACID);
+ creature_ptr->special_attack &= ~(ATTACK_ACID);
msg_print(_("酸で攻撃できなくなった。", "Your temporary acidic brand fades away."));
}
- if ((p_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
+ if ((creature_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
{
- p_ptr->special_attack &= ~(ATTACK_ELEC);
+ creature_ptr->special_attack &= ~(ATTACK_ELEC);
msg_print(_("電撃で攻撃できなくなった。", "Your temporary electrical brand fades away."));
}
- if ((p_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
+ if ((creature_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
{
- p_ptr->special_attack &= ~(ATTACK_FIRE);
+ creature_ptr->special_attack &= ~(ATTACK_FIRE);
msg_print(_("火炎で攻撃できなくなった。", "Your temporary fiery brand fades away."));
}
- if ((p_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
+ if ((creature_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
{
- p_ptr->special_attack &= ~(ATTACK_COLD);
+ creature_ptr->special_attack &= ~(ATTACK_COLD);
msg_print(_("冷気で攻撃できなくなった。", "Your temporary frost brand fades away."));
}
- if ((p_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
+ if ((creature_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
{
- p_ptr->special_attack &= ~(ATTACK_POIS);
+ creature_ptr->special_attack &= ~(ATTACK_POIS);
msg_print(_("毒で攻撃できなくなった。", "Your temporary poison brand fades away."));
}
if ((v) && (attack_type))
{
/* Set attack type. */
- p_ptr->special_attack |= (attack_type);
+ creature_ptr->special_attack |= (attack_type);
/* Set duration. */
- p_ptr->ele_attack = v;
+ creature_ptr->ele_attack = v;
#ifdef JP
msg_format("%sで攻撃できるようになった!",
#endif
}
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->redraw |= (PR_STATUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->redraw |= (PR_STATUS);
- p_ptr->update |= (PU_BONUS);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_ele_immune(u32b immune_type, TIME_EFFECT v)
+bool set_ele_immune(player_type *creature_ptr, u32b immune_type, TIME_EFFECT v)
{
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
/* Clear all elemental attacks (only one is allowed at a time). */
- if ((p_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
+ if ((creature_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
{
- p_ptr->special_defense &= ~(DEFENSE_ACID);
+ creature_ptr->special_defense &= ~(DEFENSE_ACID);
msg_print(_("酸の攻撃で傷つけられるようになった。。", "You are no longer immune to acid."));
}
- if ((p_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
+ if ((creature_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
{
- p_ptr->special_defense &= ~(DEFENSE_ELEC);
+ creature_ptr->special_defense &= ~(DEFENSE_ELEC);
msg_print(_("電撃の攻撃で傷つけられるようになった。。", "You are no longer immune to electricity."));
}
- if ((p_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
+ if ((creature_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
{
- p_ptr->special_defense &= ~(DEFENSE_FIRE);
+ creature_ptr->special_defense &= ~(DEFENSE_FIRE);
msg_print(_("火炎の攻撃で傷つけられるようになった。。", "You are no longer immune to fire."));
}
- if ((p_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
+ if ((creature_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
{
- p_ptr->special_defense &= ~(DEFENSE_COLD);
+ creature_ptr->special_defense &= ~(DEFENSE_COLD);
msg_print(_("冷気の攻撃で傷つけられるようになった。。", "You are no longer immune to cold."));
}
- if ((p_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
+ if ((creature_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
{
- p_ptr->special_defense &= ~(DEFENSE_POIS);
+ creature_ptr->special_defense &= ~(DEFENSE_POIS);
msg_print(_("毒の攻撃で傷つけられるようになった。。", "You are no longer immune to poison."));
}
if ((v) && (immune_type))
{
/* Set attack type. */
- p_ptr->special_defense |= (immune_type);
+ creature_ptr->special_defense |= (immune_type);
/* Set duration. */
- p_ptr->ele_immune = v;
+ creature_ptr->ele_immune = v;
msg_format(_("%sの攻撃を受けつけなくなった!", "For a while, You are immune to %s"),
((immune_type == DEFENSE_ACID) ? _("酸", "acid!") :
_("(なし)", "do nothing special.")))))));
}
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->redraw |= (PR_STATUS);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->redraw |= (PR_STATUS);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 一時的酸耐性の継続時間をセットする / Set "p_ptr->oppose_acid", notice observable changes
+ * @brief 一時的酸耐性の継続時間をセットする / Set "oppose_acid", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_oppose_acid(TIME_EFFECT v, bool do_dec)
+bool set_oppose_acid(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->oppose_acid && !do_dec)
+ if (creature_ptr->oppose_acid && !do_dec)
{
- if (p_ptr->oppose_acid > v) return FALSE;
+ if (creature_ptr->oppose_acid > v) return FALSE;
}
else if (!IS_OPPOSE_ACID())
{
}
}
- /* Shut */
else
{
- if (p_ptr->oppose_acid && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
+ if (creature_ptr->oppose_acid && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
{
msg_print(_("酸への耐性が薄れた気がする。", "You feel less resistant to acid."));
notice = TRUE;
}
/* Use the value */
- p_ptr->oppose_acid = v;
+ creature_ptr->oppose_acid = v;
/* Nothing to notice */
if (!notice) return (FALSE);
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->redraw |= (PR_STATUS);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 一時的電撃耐性の継続時間をセットする / Set "p_ptr->oppose_elec", notice observable changes
+ * @brief 一時的電撃耐性の継続時間をセットする / Set "oppose_elec", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_oppose_elec(TIME_EFFECT v, bool do_dec)
+bool set_oppose_elec(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->oppose_elec && !do_dec)
+ if (creature_ptr->oppose_elec && !do_dec)
{
- if (p_ptr->oppose_elec > v) return FALSE;
+ if (creature_ptr->oppose_elec > v) return FALSE;
}
else if (!IS_OPPOSE_ELEC())
{
}
}
- /* Shut */
else
{
- if (p_ptr->oppose_elec && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
+ if (creature_ptr->oppose_elec && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
{
msg_print(_("電撃への耐性が薄れた気がする。", "You feel less resistant to electricity."));
notice = TRUE;
}
/* Use the value */
- p_ptr->oppose_elec = v;
+ creature_ptr->oppose_elec = v;
/* Nothing to notice */
if (!notice) return (FALSE);
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->redraw |= (PR_STATUS);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 一時的火炎耐性の継続時間をセットする / Set "p_ptr->oppose_fire", notice observable changes
+ * @brief 一時的火炎耐性の継続時間をセットする / Set "oppose_fire", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_oppose_fire(TIME_EFFECT v, bool do_dec)
+bool set_oppose_fire(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;
- if ((PRACE_IS_(p_ptr, RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
- /* Open */
+ if ((PRACE_IS_(creature_ptr, RACE_DEMON) && (creature_ptr->lev > 44)) || (creature_ptr->mimic_form == MIMIC_DEMON)) v = 1;
if (v)
{
- if (p_ptr->oppose_fire && !do_dec)
+ if (creature_ptr->oppose_fire && !do_dec)
{
- if (p_ptr->oppose_fire > v) return FALSE;
+ if (creature_ptr->oppose_fire > v) return FALSE;
}
else if (!IS_OPPOSE_FIRE())
{
}
}
- /* Shut */
else
{
- if (p_ptr->oppose_fire && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
+ if (creature_ptr->oppose_fire && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
{
msg_print(_("火への耐性が薄れた気がする。", "You feel less resistant to fire."));
notice = TRUE;
}
/* Use the value */
- p_ptr->oppose_fire = v;
+ creature_ptr->oppose_fire = v;
/* Nothing to notice */
if (!notice) return (FALSE);
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->redraw |= (PR_STATUS);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 一時的冷気耐性の継続時間をセットする / Set "p_ptr->oppose_cold", notice observable changes
+ * @brief 一時的冷気耐性の継続時間をセットする / Set "oppose_cold", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_oppose_cold(TIME_EFFECT v, bool do_dec)
+bool set_oppose_cold(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->oppose_cold && !do_dec)
+ if (creature_ptr->oppose_cold && !do_dec)
{
- if (p_ptr->oppose_cold > v) return FALSE;
+ if (creature_ptr->oppose_cold > v) return FALSE;
}
else if (!IS_OPPOSE_COLD())
{
}
}
- /* Shut */
else
{
- if (p_ptr->oppose_cold && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
+ if (creature_ptr->oppose_cold && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
{
msg_print(_("冷気への耐性が薄れた気がする。", "You feel less resistant to cold."));
notice = TRUE;
}
/* Use the value */
- p_ptr->oppose_cold = v;
+ creature_ptr->oppose_cold = v;
/* Nothing to notice */
if (!notice) return (FALSE);
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->redraw |= (PR_STATUS);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 一時的毒耐性の継続時間をセットする / Set "p_ptr->oppose_pois", notice observable changes
+ * @brief 一時的毒耐性の継続時間をセットする / Set "oppose_pois", notice observable changes
* @param v 継続時間
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_oppose_pois(TIME_EFFECT v, bool do_dec)
+bool set_oppose_pois(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
- if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) v = 1;
- if (p_ptr->is_dead) return FALSE;
+ if ((creature_ptr->pclass == CLASS_NINJA) && (creature_ptr->lev > 44)) v = 1;
+ if (creature_ptr->is_dead) return FALSE;
- /* Open */
if (v)
{
- if (p_ptr->oppose_pois && !do_dec)
+ if (creature_ptr->oppose_pois && !do_dec)
{
- if (p_ptr->oppose_pois > v) return FALSE;
+ if (creature_ptr->oppose_pois > v) return FALSE;
}
else if (!IS_OPPOSE_POIS())
{
}
}
- /* Shut */
else
{
- if (p_ptr->oppose_pois && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
+ if (creature_ptr->oppose_pois && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
{
msg_print(_("毒への耐性が薄れた気がする。", "You feel less resistant to poison."));
notice = TRUE;
}
/* Use the value */
- p_ptr->oppose_pois = v;
+ creature_ptr->oppose_pois = v;
/* Nothing to notice */
if (!notice) return (FALSE);
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->redraw |= (PR_STATUS);
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 朦朧の継続時間をセットする / Set "p_ptr->stun", notice observable changes
+ * @brief 朦朧の継続時間をセットする / Set "stun", notice observable changes
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
* @details
* Note the special code to only notice "range" changes.
*/
-bool set_stun(TIME_EFFECT v)
+bool set_stun(player_type *creature_ptr, TIME_EFFECT v)
{
int old_aux, new_aux;
bool notice = FALSE;
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
- if (p_ptr->is_dead) return FALSE;
- if (PRACE_IS_(p_ptr, RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
+ if (creature_ptr->is_dead) return FALSE;
+ if (PRACE_IS_(creature_ptr, RACE_GOLEM) || ((creature_ptr->pclass == CLASS_BERSERKER) && (creature_ptr->lev > 34))) v = 0;
/* Knocked out */
- if (p_ptr->stun > 100)
+ if (creature_ptr->stun > 100)
{
old_aux = 3;
}
/* Heavy stun */
- else if (p_ptr->stun > 50)
+ else if (creature_ptr->stun > 50)
{
old_aux = 2;
}
/* Stun */
- else if (p_ptr->stun > 0)
+ else if (creature_ptr->stun > 0)
{
old_aux = 1;
}
if (one_in_(3))
{
- if (!p_ptr->sustain_int) (void)do_dec_stat(p_ptr, A_INT);
- if (!p_ptr->sustain_wis) (void)do_dec_stat(p_ptr, A_WIS);
+ if (!creature_ptr->sustain_int) (void)do_dec_stat(creature_ptr, A_INT);
+ if (!creature_ptr->sustain_wis) (void)do_dec_stat(creature_ptr, A_WIS);
}
else if (one_in_(2))
{
- if (!p_ptr->sustain_int) (void)do_dec_stat(p_ptr, A_INT);
+ if (!creature_ptr->sustain_int) (void)do_dec_stat(creature_ptr, A_INT);
}
else
{
- if (!p_ptr->sustain_wis) (void)do_dec_stat(p_ptr, A_WIS);
+ if (!creature_ptr->sustain_wis) (void)do_dec_stat(creature_ptr, A_WIS);
}
}
- if (p_ptr->special_defense & KATA_MASK)
+ if (creature_ptr->special_defense & KATA_MASK)
{
msg_print(_("型が崩れた。", "Your posture gets loose."));
- p_ptr->special_defense &= ~(KATA_MASK);
- p_ptr->update |= (PU_BONUS);
- p_ptr->update |= (PU_MONSTERS);
- p_ptr->redraw |= (PR_STATE);
- p_ptr->redraw |= (PR_STATUS);
- p_ptr->action = ACTION_NONE;
+ creature_ptr->special_defense &= ~(KATA_MASK);
+ creature_ptr->update |= (PU_BONUS);
+ creature_ptr->update |= (PU_MONSTERS);
+ creature_ptr->redraw |= (PR_STATE);
+ creature_ptr->redraw |= (PR_STATUS);
+ creature_ptr->action = ACTION_NONE;
}
/* Sniper */
- if (p_ptr->concent) reset_concentration(TRUE);
-
- /* Hex */
- if (hex_spelling_any()) stop_hex_spell_all();
+ if (creature_ptr->concent) reset_concentration(creature_ptr, TRUE);
+ if (hex_spelling_any(creature_ptr)) stop_hex_spell_all(creature_ptr);
notice = TRUE;
}
case 0:
msg_print(_("やっと朦朧状態から回復した。", "You are no longer stunned."));
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
break;
}
}
/* Use the value */
- p_ptr->stun = v;
+ creature_ptr->stun = v;
/* No change */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
/* Redraw the "stun" */
- p_ptr->redraw |= (PR_STUN);
+ creature_ptr->redraw |= (PR_STUN);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 出血の継続時間をセットする / Set "p_ptr->cut", notice observable changes
+ * @brief 出血の継続時間をセットする / Set "cut", notice observable changes
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
* @details
* Note the special code to only notice "range" changes.
*/
-bool set_cut(TIME_EFFECT v)
+bool set_cut(player_type *creature_ptr, TIME_EFFECT v)
{
int old_aux, new_aux;
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;
- if ((p_ptr->prace == RACE_GOLEM ||
- p_ptr->prace == RACE_SKELETON ||
- p_ptr->prace == RACE_SPECTRE ||
- (p_ptr->prace == RACE_ZOMBIE && p_ptr->lev > 11)) &&
- !p_ptr->mimic_form)
+ if ((creature_ptr->prace == RACE_GOLEM ||
+ creature_ptr->prace == RACE_SKELETON ||
+ creature_ptr->prace == RACE_SPECTRE ||
+ (creature_ptr->prace == RACE_ZOMBIE && creature_ptr->lev > 11)) &&
+ !creature_ptr->mimic_form)
v = 0;
/* Mortal wound */
- if (p_ptr->cut > 1000)
+ if (creature_ptr->cut > 1000)
{
old_aux = 7;
}
/* Deep gash */
- else if (p_ptr->cut > 200)
+ else if (creature_ptr->cut > 200)
{
old_aux = 6;
}
/* Severe cut */
- else if (p_ptr->cut > 100)
+ else if (creature_ptr->cut > 100)
{
old_aux = 5;
}
/* Nasty cut */
- else if (p_ptr->cut > 50)
+ else if (creature_ptr->cut > 50)
{
old_aux = 4;
}
/* Bad cut */
- else if (p_ptr->cut > 25)
+ else if (creature_ptr->cut > 25)
{
old_aux = 3;
}
/* Light cut */
- else if (p_ptr->cut > 10)
+ else if (creature_ptr->cut > 10)
{
old_aux = 2;
}
/* Graze */
- else if (p_ptr->cut > 0)
+ else if (creature_ptr->cut > 0)
{
old_aux = 1;
}
if (randint1(1000) < v || one_in_(16))
{
- if (!p_ptr->sustain_chr)
+ if (!creature_ptr->sustain_chr)
{
msg_print(_("ひどい傷跡が残ってしまった。", "You have been horribly scarred."));
- do_dec_stat(p_ptr, A_CHR);
+ do_dec_stat(creature_ptr, A_CHR);
}
}
}
{
/* None */
case 0:
- msg_format(_("やっと%s。", "You are no longer bleeding."), p_ptr->prace == RACE_ANDROID ? "怪我が直った" : "出血が止まった");
+ msg_format(_("やっと%s。", "You are no longer bleeding."), creature_ptr->prace == RACE_ANDROID ? "怪我が直った" : "出血が止まった");
- if (disturb_state) disturb(FALSE, FALSE);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
break;
}
}
/* Use the value */
- p_ptr->cut = v;
+ creature_ptr->cut = v;
/* No change */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
/* Redraw the "cut" */
- p_ptr->redraw |= (PR_CUT);
+ creature_ptr->redraw |= (PR_CUT);
handle_stuff();
return (TRUE);
}
/*!
- * @brief 空腹状態をセットする / Set "p_ptr->food", notice observable changes
+ * @brief 空腹状態をセットする / Set "food", notice observable changes
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
* @details
* Set "", notice observable changes\n
*\n
- * The "p_ptr->food" variable can get as large as 20000, allowing the
+ * The "food" variable can get as large as 20000, allowing the
* addition of the most "filling" item, Elvish Waybread, which adds
* 7500 food units, without overflowing the 32767 maximum limit.\n
*\n
* game turns, or 500/(100/5) = 25 player turns (if nothing else is
* affecting the player speed).\n
*/
-bool set_food(TIME_EFFECT v)
+bool set_food(player_type *creature_ptr, TIME_EFFECT v)
{
int old_aux, new_aux;
v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
/* Fainting / Starving */
- if (p_ptr->food < PY_FOOD_FAINT)
+ if (creature_ptr->food < PY_FOOD_FAINT)
{
old_aux = 0;
}
/* Weak */
- else if (p_ptr->food < PY_FOOD_WEAK)
+ else if (creature_ptr->food < PY_FOOD_WEAK)
{
old_aux = 1;
}
/* Hungry */
- else if (p_ptr->food < PY_FOOD_ALERT)
+ else if (creature_ptr->food < PY_FOOD_ALERT)
{
old_aux = 2;
}
/* Normal */
- else if (p_ptr->food < PY_FOOD_FULL)
+ else if (creature_ptr->food < PY_FOOD_FULL)
{
old_aux = 3;
}
/* Full */
- else if (p_ptr->food < PY_FOOD_MAX)
+ else if (creature_ptr->food < PY_FOOD_MAX)
{
old_aux = 4;
}
}
if (old_aux < 1 && new_aux > 0)
- chg_virtue(V_PATIENCE, 2);
+ chg_virtue(creature_ptr, V_PATIENCE, 2);
else if (old_aux < 3 && (old_aux != new_aux))
- chg_virtue(V_PATIENCE, 1);
+ chg_virtue(creature_ptr, V_PATIENCE, 1);
if (old_aux == 2)
- chg_virtue(V_TEMPERANCE, 1);
+ chg_virtue(creature_ptr, V_TEMPERANCE, 1);
if (old_aux == 0)
- chg_virtue(V_TEMPERANCE, -1);
+ chg_virtue(creature_ptr, V_TEMPERANCE, -1);
/* Food increase */
if (new_aux > old_aux)
/* Bloated */
case 5:
msg_print(_("食べ過ぎだ!", "You have gorged yourself!"));
- chg_virtue(V_HARMONY, -1);
- chg_virtue(V_PATIENCE, -1);
- chg_virtue(V_TEMPERANCE, -2);
+ chg_virtue(creature_ptr, V_HARMONY, -1);
+ chg_virtue(creature_ptr, V_PATIENCE, -1);
+ chg_virtue(creature_ptr, V_TEMPERANCE, -2);
break;
}
case 4: msg_print(_("やっとお腹がきつくなくなった。", "You are no longer gorged.")); break;
}
- if (p_ptr->wild_mode && (new_aux < 2))
+ if (creature_ptr->wild_mode && (new_aux < 2))
{
- change_wild_mode(FALSE);
+ change_wild_mode(creature_ptr, FALSE);
}
/* Change */
}
/* Use the value */
- p_ptr->food = v;
+ creature_ptr->food = v;
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
/* Redraw hunger */
- p_ptr->redraw |= (PR_HUNGER);
+ creature_ptr->redraw |= (PR_HUNGER);
handle_stuff();
return (TRUE);
}
/* Damage "max" value */
if (permanent && (max > 3))
{
- chg_virtue(V_SACRIFICE, 1);
+ chg_virtue(creature_ptr, V_SACRIFICE, 1);
if (stat == A_WIS || stat == A_INT)
- chg_virtue(V_ENLIGHTEN, -2);
+ chg_virtue(creature_ptr, V_ENLIGHTEN, -2);
/* Handle "low" values */
if (max <= 18)
bool hp_player(player_type *creature_ptr, int num)
{
int vir;
- vir = virtue_number(V_VITALITY);
+ vir = virtue_number(creature_ptr, V_VITALITY);
if(num <= 0) return (FALSE);
if (creature_ptr->chp < creature_ptr->mhp)
{
if ((num > 0) && (creature_ptr->chp < (creature_ptr->mhp/3)))
- chg_virtue(V_TEMPERANCE, 1);
+ chg_virtue(creature_ptr, V_TEMPERANCE, 1);
/* Gain hitpoints */
creature_ptr->chp += num;
}
/* Attempt to reduce the stat */
- if (dec_stat(p_ptr, stat, 10, (ironman_nightmare && !randint0(13))))
+ if (dec_stat(creature_ptr, stat, 10, (ironman_nightmare && !randint0(13))))
{
msg_format(_("ひどく%sなった気がする。", "You feel very %s."), desc_stat_neg[stat]);
/* Attempt to increase */
if (res_stat(creature_ptr, stat))
{
- msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]);
+ msg_format(_("元通りに%sなった気がする。", "You feel more %s."), desc_stat_pos[stat]);
return (TRUE);
}
/*
* Gain a "point" in a stat
*/
-bool do_inc_stat(int stat)
+bool do_inc_stat(player_type *creature_ptr, int stat)
{
bool res;
/* Restore strength */
- res = res_stat(p_ptr, stat);
+ res = res_stat(creature_ptr, stat);
/* Attempt to increase */
- if (inc_stat(p_ptr, stat))
+ if (inc_stat(creature_ptr, stat))
{
if (stat == A_WIS)
{
- chg_virtue(V_ENLIGHTEN, 1);
- chg_virtue(V_FAITH, 1);
+ chg_virtue(creature_ptr, V_ENLIGHTEN, 1);
+ chg_virtue(creature_ptr, V_FAITH, 1);
}
else if (stat == A_INT)
{
- chg_virtue(V_KNOWLEDGE, 1);
- chg_virtue(V_ENLIGHTEN, 1);
+ chg_virtue(creature_ptr, V_KNOWLEDGE, 1);
+ chg_virtue(creature_ptr, V_ENLIGHTEN, 1);
}
else if (stat == A_CON)
- chg_virtue(V_VITALITY, 1);
+ chg_virtue(creature_ptr, V_VITALITY, 1);
msg_format(_("ワーオ!とても%sなった!", "Wow! You feel very %s!"), desc_stat_pos[stat]);
/* Restoration worked */
if (res)
{
- msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]);
+ msg_format(_("元通りに%sなった気がする。", "You feel more %s."), desc_stat_pos[stat]);
return (TRUE);
}
/*
* Restores any drained experience
*/
-bool restore_level(void)
+bool restore_level(player_type *creature_ptr)
{
/* Restore experience */
- if (p_ptr->exp < p_ptr->max_exp)
+ if (creature_ptr->exp < creature_ptr->max_exp)
{
msg_print(_("経験値が戻ってきた気がする。", "You feel your experience returning."));
/* Restore the experience */
- p_ptr->exp = p_ptr->max_exp;
+ creature_ptr->exp = creature_ptr->max_exp;
/* Check the experience */
- check_experience();
+ check_experience(creature_ptr);
/* Did something */
return (TRUE);
/*
* Forget everything
*/
-bool lose_all_info(void)
+bool lose_all_info(player_type *creature_ptr)
{
int i;
- chg_virtue(V_KNOWLEDGE, -5);
- chg_virtue(V_ENLIGHTEN, -5);
+ chg_virtue(creature_ptr, V_KNOWLEDGE, -5);
+ chg_virtue(creature_ptr, V_ENLIGHTEN, -5);
/* Forget info about objects */
for (i = 0; i < INVEN_TOTAL; i++)
{
- object_type *o_ptr = &p_ptr->inventory_list[i];
+ object_type *o_ptr = &creature_ptr->inventory_list[i];
if (!o_ptr->k_idx) continue;
/* Allow "protection" by the MENTAL flag */
/* Hack -- Clear the "felt" flag */
o_ptr->ident &= ~(IDENT_SENSE);
}
- p_ptr->update |= (PU_BONUS);
- p_ptr->update |= (PU_COMBINE | PU_REORDER);
+ creature_ptr->update |= (PU_BONUS);
+ creature_ptr->update |= (PU_COMBINE | PU_REORDER);
- p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
+ creature_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
/* Mega-Hack -- Forget the map */
- wiz_dark();
+ wiz_dark(creature_ptr);
/* It worked */
return (TRUE);
}
-void do_poly_wounds(void)
+void do_poly_wounds(player_type *creature_ptr)
{
/* Changed to always provide at least _some_ healing */
- s16b wounds = p_ptr->cut;
- s16b hit_p = (p_ptr->mhp - p_ptr->chp);
- s16b change = damroll(p_ptr->lev, 5);
+ s16b wounds = creature_ptr->cut;
+ s16b hit_p = (creature_ptr->mhp - creature_ptr->chp);
+ s16b change = damroll(creature_ptr->lev, 5);
bool Nasty_effect = one_in_(5);
if (!(wounds || hit_p || Nasty_effect)) return;
msg_print(_("傷がより軽いものに変化した。", "Your wounds are polymorphed into less serious ones."));
- hp_player(p_ptr, change);
+ hp_player(creature_ptr, change);
if (Nasty_effect)
{
msg_print(_("新たな傷ができた!", "A new wound was created!"));
- take_hit(DAMAGE_LOSELIFE, change / 2, _("変化した傷", "a polymorphed wound"), -1);
- set_cut(change);
+ take_hit(creature_ptr, DAMAGE_LOSELIFE, change / 2, _("変化した傷", "a polymorphed wound"), -1);
+ set_cut(creature_ptr,change);
}
else
{
- set_cut(p_ptr->cut - (change / 2));
+ set_cut(creature_ptr,creature_ptr->cut - (change / 2));
}
}
/*
* Change player race
*/
-void change_race(CHARACTER_IDX new_race, concptr effect_msg)
+void change_race(player_type *creature_ptr, CHARACTER_IDX new_race, concptr effect_msg)
{
concptr title = race_info[new_race].title;
- int old_race = p_ptr->prace;
+ int old_race = creature_ptr->prace;
#ifdef JP
msg_format("あなたは%s%sに変化した!", effect_msg, title);
msg_format("You current_world_ptr->game_turn into %s %s%s!", (!effect_msg[0] && is_a_vowel(title[0]) ? "an" : "a"), effect_msg, title);
#endif
- chg_virtue(V_CHANCE, 2);
+ chg_virtue(creature_ptr, V_CHANCE, 2);
- if (p_ptr->prace < 32)
+ if (creature_ptr->prace < 32)
{
- p_ptr->old_race1 |= 1L << p_ptr->prace;
+ creature_ptr->old_race1 |= 1L << creature_ptr->prace;
}
else
{
- p_ptr->old_race2 |= 1L << (p_ptr->prace - 32);
+ creature_ptr->old_race2 |= 1L << (creature_ptr->prace - 32);
}
- p_ptr->prace = new_race;
- rp_ptr = &race_info[p_ptr->prace];
+ creature_ptr->prace = new_race;
+ rp_ptr = &race_info[creature_ptr->prace];
/* Experience factor */
- p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
+ creature_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
/*
* The speed bonus of Klackons and Sprites are disabled
* and the experience penalty is decreased.
*/
- if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_NINJA)) && ((p_ptr->prace == RACE_KLACKON) || (p_ptr->prace == RACE_SPRITE)))
- p_ptr->expfact -= 15;
+ if (((creature_ptr->pclass == CLASS_MONK) || (creature_ptr->pclass == CLASS_FORCETRAINER) || (creature_ptr->pclass == CLASS_NINJA)) && ((creature_ptr->prace == RACE_KLACKON) || (creature_ptr->prace == RACE_SPRITE)))
+ creature_ptr->expfact -= 15;
/* Get character's height and weight */
- get_height_weight();
+ get_height_weight(creature_ptr);
/* Hitdice */
- if (p_ptr->pclass == CLASS_SORCERER)
- p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
+ if (creature_ptr->pclass == CLASS_SORCERER)
+ creature_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
else
- p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
+ creature_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
- roll_hitdice(p_ptr, 0L);
+ roll_hitdice(creature_ptr, 0L);
/* The experience level may be modified */
- check_experience();
+ check_experience(creature_ptr);
- p_ptr->redraw |= (PR_BASIC);
+ creature_ptr->redraw |= (PR_BASIC);
- p_ptr->update |= (PU_BONUS);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
/* Load an autopick preference file */
- if (old_race != p_ptr->prace) autopick_load_pref(FALSE);
+ if (old_race != creature_ptr->prace) autopick_load_pref(FALSE);
/* Player's graphic tile may change */
- lite_spot(p_ptr->y, p_ptr->x);
+ lite_spot(creature_ptr->y, creature_ptr->x);
}
-void do_poly_self(void)
+void do_poly_self(player_type *creature_ptr)
{
- int power = p_ptr->lev;
+ int power = creature_ptr->lev;
msg_print(_("あなたは変化の訪れを感じた...", "You feel a change coming over you..."));
- chg_virtue(V_CHANCE, 1);
+ chg_virtue(creature_ptr, V_CHANCE, 1);
- if ((power > randint0(20)) && one_in_(3) && (p_ptr->prace != RACE_ANDROID))
+ if ((power > randint0(20)) && one_in_(3) && (creature_ptr->prace != RACE_ANDROID))
{
char effect_msg[80] = "";
CHARACTER_IDX new_race;
/* sex change */
power -= 2;
- if (p_ptr->psex == SEX_MALE)
+ if (creature_ptr->psex == SEX_MALE)
{
- p_ptr->psex = SEX_FEMALE;
- sp_ptr = &sex_info[p_ptr->psex];
+ creature_ptr->psex = SEX_FEMALE;
+ sp_ptr = &sex_info[creature_ptr->psex];
sprintf(effect_msg, _("女性の", "female "));
}
else
{
- p_ptr->psex = SEX_MALE;
- sp_ptr = &sex_info[p_ptr->psex];
+ creature_ptr->psex = SEX_MALE;
+ sp_ptr = &sex_info[creature_ptr->psex];
sprintf(effect_msg, _("男性の", "male "));
}
}
{
if (one_in_(2))
{
- (void)dec_stat(p_ptr, tmp, randint1(6) + 6, one_in_(3));
+ (void)dec_stat(creature_ptr, tmp, randint1(6) + 6, one_in_(3));
power -= 1;
}
tmp++;
}
/* Deformities are discriminated against! */
- (void)dec_stat(p_ptr, A_CHR, randint1(6), TRUE);
+ (void)dec_stat(creature_ptr, A_CHR, randint1(6), TRUE);
if (effect_msg[0])
{
/* Polymorph into a less mutated form */
power -= 10;
- if (!lose_mutation(0))
+ if (!lose_mutation(creature_ptr, 0))
msg_print(_("奇妙なくらい普通になった気がする。", "You feel oddly normal."));
}
{
new_race = (CHARACTER_IDX)randint0(MAX_RACES);
}
- while ((new_race == p_ptr->prace) || (new_race == RACE_ANDROID));
+ while ((new_race == creature_ptr->prace) || (new_race == RACE_ANDROID));
- change_race(new_race, effect_msg);
+ change_race(creature_ptr, new_race, effect_msg);
}
if ((power > randint0(30)) && one_in_(6))
/* Abomination! */
power -= 20;
- msg_format(_("%sの構成が変化した!", "Your internal organs are rearranged!"), p_ptr->prace == RACE_ANDROID ? "機械" : "内臓");
+ msg_format(_("%sの構成が変化した!", "Your internal organs are rearranged!"), creature_ptr->prace == RACE_ANDROID ? "機械" : "内臓");
while (tmp < A_MAX)
{
- (void)dec_stat(p_ptr, tmp, randint1(6) + 6, one_in_(3));
+ (void)dec_stat(creature_ptr, tmp, randint1(6) + 6, one_in_(3));
tmp++;
}
if (one_in_(6))
{
msg_print(_("現在の姿で生きていくのは困難なようだ!", "You find living difficult in your present form!"));
- take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), _("致命的な突然変異", "a lethal mutation"), -1);
+ take_hit(creature_ptr, DAMAGE_LOSELIFE, damroll(randint1(10), creature_ptr->lev), _("致命的な突然変異", "a lethal mutation"), -1);
power -= 10;
}
{
power -= 10;
- get_max_stats();
- roll_hitdice(p_ptr, 0L);
+ get_max_stats(creature_ptr);
+ roll_hitdice(creature_ptr, 0L);
}
while ((power > randint0(15)) && one_in_(3))
{
power -= 7;
- (void)gain_mutation(p_ptr, 0);
+ (void)gain_mutation(creature_ptr, 0);
}
if (power > randint0(5))
{
power -= 5;
- do_poly_wounds();
+ do_poly_wounds(creature_ptr);
}
/* Note: earlier deductions may have left power < 0 already. */
while (power > 0)
{
- status_shuffle();
+ status_shuffle(creature_ptr);
power--;
}
}
/*
* Gain experience
*/
-void gain_exp_64(s32b amount, u32b amount_frac)
+void gain_exp_64(player_type *creature_ptr, s32b amount, u32b amount_frac)
{
- if (p_ptr->is_dead) return;
+ if (creature_ptr->is_dead) return;
- if (p_ptr->prace == RACE_ANDROID) return;
+ if (creature_ptr->prace == RACE_ANDROID) return;
/* Gain some experience */
- s64b_add(&(p_ptr->exp), &(p_ptr->exp_frac), amount, amount_frac);
+ s64b_add(&(creature_ptr->exp), &(creature_ptr->exp_frac), amount, amount_frac);
/* Slowly recover from experience drainage */
- if (p_ptr->exp < p_ptr->max_exp)
+ if (creature_ptr->exp < creature_ptr->max_exp)
{
/* Gain max experience (20%) (was 10%) */
- p_ptr->max_exp += amount / 5;
+ creature_ptr->max_exp += amount / 5;
}
- /* Check Experience */
- check_experience();
+ check_experience(creature_ptr);
}
/*
* Gain experience
*/
-void gain_exp(s32b amount)
+void gain_exp(player_type *creature_ptr, s32b amount)
{
- gain_exp_64(amount, 0L);
+ gain_exp_64(creature_ptr, amount, 0L);
}
-void calc_android_exp(void)
+void calc_android_exp(player_type *creature_ptr)
{
int i;
u32b total_exp = 0;
- if (p_ptr->is_dead) return;
+ if (creature_ptr->is_dead) return;
- if (p_ptr->prace != RACE_ANDROID) return;
+ if (creature_ptr->prace != RACE_ANDROID) return;
for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
{
- object_type *o_ptr = &p_ptr->inventory_list[i];
+ object_type *o_ptr = &creature_ptr->inventory_list[i];
object_type forge;
object_type *q_ptr = &forge;
u32b value, exp;
value = object_value_real(q_ptr);
if (value <= 0) continue;
- if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (p_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
+ if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (creature_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
if (value > 5000000L) value = 5000000L;
if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
if (value > 100000L)
exp += (value - 100000L) / 4 * level;
}
- if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
+ if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(creature_ptr, i))) || (i == INVEN_BOW)) total_exp += exp / 48;
else total_exp += exp / 16;
if (i == INVEN_BODY) total_exp += exp / 32;
}
- p_ptr->exp = p_ptr->max_exp = total_exp;
-
- /* Check Experience */
- check_experience();
+ creature_ptr->exp = creature_ptr->max_exp = total_exp;
+ check_experience(creature_ptr);
}
/*
* Lose experience
*/
-void lose_exp(s32b amount)
+void lose_exp(player_type *creature_ptr, s32b amount)
{
- if (p_ptr->prace == RACE_ANDROID) return;
-
- /* Never drop below zero experience */
- if (amount > p_ptr->exp) amount = p_ptr->exp;
+ if (creature_ptr->prace == RACE_ANDROID) return;
+ if (amount > creature_ptr->exp) amount = creature_ptr->exp;
- /* Lose some experience */
- p_ptr->exp -= amount;
+ creature_ptr->exp -= amount;
- /* Check Experience */
- check_experience();
+ check_experience(creature_ptr);
}
* Drain experience
* If resisted to draining, return FALSE
*/
-bool drain_exp(s32b drain, s32b slip, int hold_exp_prob)
+bool drain_exp(player_type *creature_ptr, s32b drain, s32b slip, int hold_exp_prob)
{
/* Androids and their mimics are never drained */
- if (p_ptr->prace == RACE_ANDROID) return FALSE;
+ if (creature_ptr->prace == RACE_ANDROID) return FALSE;
- if (p_ptr->hold_exp && (randint0(100) < hold_exp_prob))
+ if (creature_ptr->hold_exp && (randint0(100) < hold_exp_prob))
{
/* Hold experience */
msg_print(_("しかし自己の経験値を守りきった!", "You keep hold of your experience!"));
}
/* Hold experience failed */
- if (p_ptr->hold_exp)
+ if (creature_ptr->hold_exp)
{
msg_print(_("経験値を少し吸い取られた気がする!", "You feel your experience slipping away!"));
- lose_exp(slip);
+ lose_exp(creature_ptr, slip);
}
else
{
msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away!"));
- lose_exp(drain);
+ lose_exp(creature_ptr, drain);
}
return TRUE;
}
-bool set_ultimate_res(TIME_EFFECT v, bool do_dec)
+bool set_ultimate_res(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->ult_res && !do_dec)
+ if (creature_ptr->ult_res && !do_dec)
{
- if (p_ptr->ult_res > v) return FALSE;
+ if (creature_ptr->ult_res > v) return FALSE;
}
- else if (!p_ptr->ult_res)
+ else if (!creature_ptr->ult_res)
{
msg_print(_("あらゆることに対して耐性がついた気がする!", "You feel resistant!"));
notice = TRUE;
}
}
- /* Shut */
else
{
- if (p_ptr->ult_res)
+ if (creature_ptr->ult_res)
{
msg_print(_("あらゆることに対する耐性が薄れた気がする。", "You feel less resistant"));
notice = TRUE;
}
/* Use the value */
- p_ptr->ult_res = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->ult_res = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
-bool set_tim_res_nether(TIME_EFFECT v, bool do_dec)
+bool set_tim_res_nether(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->tim_res_nether && !do_dec)
+ if (creature_ptr->tim_res_nether && !do_dec)
{
- if (p_ptr->tim_res_nether > v) return FALSE;
+ if (creature_ptr->tim_res_nether > v) return FALSE;
}
- else if (!p_ptr->tim_res_nether)
+ else if (!creature_ptr->tim_res_nether)
{
msg_print(_("地獄の力に対して耐性がついた気がする!", "You feel nether resistant!"));
notice = TRUE;
}
}
- /* Shut */
else
{
- if (p_ptr->tim_res_nether)
+ if (creature_ptr->tim_res_nether)
{
msg_print(_("地獄の力に対する耐性が薄れた気がする。", "You feel less nether resistant"));
notice = TRUE;
}
/* Use the value */
- p_ptr->tim_res_nether = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->tim_res_nether = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
-bool set_tim_res_time(TIME_EFFECT v, bool do_dec)
+bool set_tim_res_time(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->tim_res_time && !do_dec)
+ if (creature_ptr->tim_res_time && !do_dec)
{
- if (p_ptr->tim_res_time > v) return FALSE;
+ if (creature_ptr->tim_res_time > v) return FALSE;
}
- else if (!p_ptr->tim_res_time)
+ else if (!creature_ptr->tim_res_time)
{
msg_print(_("時間逆転の力に対して耐性がついた気がする!", "You feel time resistant!"));
notice = TRUE;
}
}
- /* Shut */
else
{
- if (p_ptr->tim_res_time)
+ if (creature_ptr->tim_res_time)
{
msg_print(_("時間逆転の力に対する耐性が薄れた気がする。", "You feel less time resistant"));
notice = TRUE;
}
/* Use the value */
- p_ptr->tim_res_time = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->tim_res_time = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
- if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
/*
* Choose a warrior-mage elemental attack. -LM-
*/
-bool choose_ele_attack(void)
+bool choose_ele_attack(player_type *creature_ptr)
{
int num;
char choice;
- if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
+ if (!has_melee_weapon(creature_ptr, INVEN_RARM) && !has_melee_weapon(creature_ptr, INVEN_LARM))
{
msg_format(_("武器を持たないと魔法剣は使えない。", "You cannot use temporary branding with no weapon."));
return FALSE;
}
screen_save();
- num = (p_ptr->lev - 20) / 5;
+ num = (creature_ptr->lev - 20) / 5;
c_prt(TERM_RED, _(" a) 焼棄", " a) Fire Brand"), 2, 14);
if (num >= 2)
choice = inkey();
if ((choice == 'a') || (choice == 'A'))
- set_ele_attack(ATTACK_FIRE, p_ptr->lev/2 + randint1(p_ptr->lev/2));
+ set_ele_attack(creature_ptr, ATTACK_FIRE, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
- set_ele_attack(ATTACK_COLD, p_ptr->lev/2 + randint1(p_ptr->lev/2));
+ set_ele_attack(creature_ptr, ATTACK_COLD, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
- set_ele_attack(ATTACK_POIS, p_ptr->lev/2 + randint1(p_ptr->lev/2));
+ set_ele_attack(creature_ptr, ATTACK_POIS, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
- set_ele_attack(ATTACK_ACID, p_ptr->lev/2 + randint1(p_ptr->lev/2));
+ set_ele_attack(creature_ptr, ATTACK_ACID, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
- set_ele_attack(ATTACK_ELEC, p_ptr->lev/2 + randint1(p_ptr->lev/2));
+ set_ele_attack(creature_ptr, ATTACK_ELEC, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
else
{
msg_print(_("魔法剣を使うのをやめた。", "You cancel the temporary branding."));
/*
* Choose a elemental immune. -LM-
*/
-bool choose_ele_immune(TIME_EFFECT immune_turn)
+bool choose_ele_immune(player_type *creature_ptr, TIME_EFFECT immune_turn)
{
char choice;
screen_save();
choice = inkey();
if ((choice == 'a') || (choice == 'A'))
- set_ele_immune(DEFENSE_FIRE, immune_turn);
+ set_ele_immune(creature_ptr, DEFENSE_FIRE, immune_turn);
else if ((choice == 'b') || (choice == 'B'))
- set_ele_immune(DEFENSE_COLD, immune_turn);
+ set_ele_immune(creature_ptr, DEFENSE_COLD, immune_turn);
else if ((choice == 'c') || (choice == 'C'))
- set_ele_immune(DEFENSE_ACID, immune_turn);
+ set_ele_immune(creature_ptr, DEFENSE_ACID, immune_turn);
else if ((choice == 'd') || (choice == 'D'))
- set_ele_immune(DEFENSE_ELEC, immune_turn);
+ set_ele_immune(creature_ptr, DEFENSE_ELEC, immune_turn);
else
{
msg_print(_("免疫を付けるのをやめた。", "You cancel the temporary immune."));