*/
#include "angband.h"
+#include "term.h"
+#include "core.h"
#include "util.h"
+#include "creature.h"
+
#include "artifact.h"
+#include "cmd-dump.h"
#include "floor.h"
#include "bldg.h"
#include "birth.h"
#include "mutation.h"
#include "quest.h"
#include "avatar.h"
-#include "player-status.h"
#include "spells-status.h"
+#include "realm-song.h"
#include "realm-hex.h"
+#include "object-ego.h"
#include "object-hook.h"
#include "wild.h"
#include "spells-floor.h"
+#include "player-status.h"
+#include "player-class.h"
#include "player-move.h"
#include "player-effects.h"
+#include "player-race.h"
+#include "player-class.h"
+#include "player-personality.h"
+#include "player-sex.h"
+#include "player-damage.h"
#include "monster-status.h"
#include "snipe.h"
#include "files.h"
-#include "player-effects.h"
#include "monster-spell.h"
#include "world.h"
+#include "objectkind.h"
+#include "autopick.h"
+#include "save.h"
+#include "report.h"
+
+#include "view-mainwindow.h"
+
+ /*!
+ * @brief 修行僧の構え能力テーブル
+ */
+const kamae kamae_shurui[MAX_KAMAE] =
+{
+#ifdef JP
+ {"玄武", 25, ""},
+ {"白虎", 30, ""},
+ {"青竜", 35, ""},
+ {"朱雀", 40, ""},
+#else
+ {"Genbu", 25, "(Black Tortoise) "},
+ {"Byakko", 30, "(White Tiger) "},
+ {"Seiryuu", 35, "(Blue Dragon) "},
+ {"Suzaku", 40, "(Red Phoenix) "},
+#endif
+};
+
+/*!
+ * @brief 剣術家の構え能力テーブル
+ */
+const kamae kata_shurui[MAX_KATA] =
+{
+#ifdef JP
+ {"居合", 25, ""},
+ {"風塵", 30, ""},
+ {"降鬼", 35, ""},
+ {"無想", 40, ""},
+#else
+ {"Iai", 25, ""},
+ {"Huujin", 30, ""},
+ {"Kouki", 35, ""},
+ {"Musou", 40, ""},
+#endif
+};
+
/*!
* @brief プレイヤーの継続行動を設定する。
case ACTION_LEARN:
{
msg_print(_("学習をやめた。", "You stop Learning"));
- new_mane = FALSE;
+ p_ptr->new_mane = FALSE;
break;
}
case ACTION_KAMAE:
while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
p_ptr->timewalk = FALSE;
- if (prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
+ 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;
*/
void dispel_player(void)
{
- (void)set_fast(0, TRUE);
- (void)set_lightspeed(0, TRUE);
- (void)set_slow(0, TRUE);
- (void)set_shield(0, TRUE);
- (void)set_blessed(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_fast(p_ptr, 0, TRUE);
+ (void)set_lightspeed(p_ptr, 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(p_ptr, 0, TRUE);
+ (void)set_hero(p_ptr, 0, TRUE);
+ (void)set_shero(p_ptr, 0, TRUE);
+ (void)set_protevil(p_ptr, 0, TRUE);
+ (void)set_invuln(p_ptr, 0, TRUE);
(void)set_wraith_form(0, TRUE);
- (void)set_kabenuke(0, TRUE);
+ (void)set_kabenuke(p_ptr, 0, TRUE);
(void)set_tim_res_nether(0, TRUE);
(void)set_tim_res_time(0, TRUE);
/* by henkma */
- (void)set_tim_reflect(0,TRUE);
- (void)set_multishadow(0,TRUE);
- (void)set_dustrobe(0,TRUE);
+ (void)set_tim_reflect(p_ptr, 0,TRUE);
+ (void)set_multishadow(p_ptr, 0,TRUE);
+ (void)set_dustrobe(p_ptr, 0,TRUE);
- (void)set_tim_invis(0, TRUE);
- (void)set_tim_infra(0, TRUE);
+ (void)set_tim_invis(p_ptr, 0, TRUE);
+ (void)set_tim_infra(p_ptr, 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(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_tim_regen(p_ptr, 0, TRUE);
+ (void)set_tim_stealth(p_ptr, 0, TRUE);
+ (void)set_tim_levitation(p_ptr, 0, TRUE);
+ (void)set_tim_sh_touki(p_ptr, 0, TRUE);
+ (void)set_tim_sh_fire(p_ptr, 0, TRUE);
+ (void)set_tim_sh_holy(p_ptr, 0, TRUE);
+ (void)set_tim_eyeeye(p_ptr, 0, TRUE);
+ (void)set_magicdef(p_ptr, 0, TRUE);
+ (void)set_resist_magic(p_ptr, 0, TRUE);
+ (void)set_oppose_acid(p_ptr, 0, TRUE);
+ (void)set_oppose_elec(p_ptr, 0, TRUE);
+ (void)set_oppose_fire(p_ptr, 0, TRUE);
+ (void)set_oppose_cold(p_ptr, 0, TRUE);
+ (void)set_oppose_pois(p_ptr, 0, TRUE);
(void)set_ultimate_res(0, TRUE);
- (void)set_mimic(0, 0, TRUE);
- (void)set_ele_attack(0, 0);
- (void)set_ele_immune(0, 0);
+ (void)set_mimic(p_ptr, 0, 0, TRUE);
+ (void)set_ele_attack(p_ptr, 0, 0);
+ (void)set_ele_immune(p_ptr, 0, 0);
/* Cancel glowing hands */
if (p_ptr->special_attack & ATTACK_CONFUSE)
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec)
+bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, IDX p, 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_mimic && (p_ptr->mimic_form == p) && !do_dec)
+ if (creature_ptr->tim_mimic && (creature_ptr->mimic_form == p) && !do_dec)
{
- if (p_ptr->tim_mimic > v) return FALSE;
+ if (creature_ptr->tim_mimic > v) return FALSE;
}
- else if ((!p_ptr->tim_mimic) || (p_ptr->mimic_form != p))
+ else if ((!creature_ptr->tim_mimic) || (creature_ptr->mimic_form != p))
{
msg_print(_("自分の体が変わってゆくのを感じた。", "You feel that your body changes."));
- p_ptr->mimic_form = p;
+ creature_ptr->mimic_form = p;
notice = TRUE;
}
}
/* Shut */
else
{
- if (p_ptr->tim_mimic)
+ if (creature_ptr->tim_mimic)
{
msg_print(_("変身が解けた。", "You are no longer transformed."));
- if (p_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(0, TRUE);
- p_ptr->mimic_form=0;
+ if (creature_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(p_ptr, 0, TRUE);
+ creature_ptr->mimic_form=0;
notice = TRUE;
p = 0;
}
}
/* Use the value */
- p_ptr->tim_mimic = v;
+ creature_ptr->tim_mimic = v;
/* Nothing to notice */
if (!notice) return (FALSE);
if (disturb_state) disturb(FALSE, TRUE);
- p_ptr->redraw |= (PR_BASIC | PR_STATUS);
- p_ptr->update |= (PU_BONUS | PU_HP);
+ creature_ptr->redraw |= (PR_BASIC | PR_STATUS);
+ creature_ptr->update |= (PU_BONUS | PU_HP);
handle_stuff();
return (TRUE);
* Note that blindness is currently the only thing which can affect\n
* "player_can_see_bold()".\n
*/
-bool set_blind(TIME_EFFECT v)
+bool set_blind(player_type *creature_ptr, TIME_EFFECT v)
{
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->blind)
+ if (!creature_ptr->blind)
{
- if (p_ptr->prace == RACE_ANDROID)
+ if (creature_ptr->prace == RACE_ANDROID)
{
msg_print(_("センサーをやられた!", "You are blind!"));
}
/* Shut */
else
{
- if (p_ptr->blind)
+ if (creature_ptr->blind)
{
- if (p_ptr->prace == RACE_ANDROID)
+ if (creature_ptr->prace == RACE_ANDROID)
{
msg_print(_("センサーが復旧した。", "You can see again."));
}
}
/* Use the value */
- p_ptr->blind = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->blind = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
if (disturb_state) disturb(FALSE, FALSE);
/* Fully update the visuals */
- p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
- p_ptr->redraw |= (PR_MAP);
- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+ creature_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
+ creature_ptr->redraw |= (PR_MAP);
+ creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
handle_stuff();
return (TRUE);
}
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_confused(TIME_EFFECT v)
+bool set_confused(player_type *creature_ptr, TIME_EFFECT v)
{
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->confused)
+ if (!creature_ptr->confused)
{
msg_print(_("あなたは混乱した!", "You are confused!"));
- if (p_ptr->action == ACTION_LEARN)
+ if (creature_ptr->action == ACTION_LEARN)
{
msg_print(_("学習が続けられない!", "You cannot continue Learning!"));
- new_mane = FALSE;
+ creature_ptr->new_mane = FALSE;
- p_ptr->redraw |= (PR_STATE);
- p_ptr->action = ACTION_NONE;
+ creature_ptr->redraw |= (PR_STATE);
+ creature_ptr->action = ACTION_NONE;
}
- if (p_ptr->action == ACTION_KAMAE)
+ if (creature_ptr->action == ACTION_KAMAE)
{
msg_print(_("構えがとけた。", "Your posture gets loose."));
- p_ptr->special_defense &= ~(KAMAE_MASK);
- p_ptr->update |= (PU_BONUS);
- p_ptr->redraw |= (PR_STATE);
- p_ptr->action = ACTION_NONE;
+ creature_ptr->special_defense &= ~(KAMAE_MASK);
+ creature_ptr->update |= (PU_BONUS);
+ creature_ptr->redraw |= (PR_STATE);
+ creature_ptr->action = ACTION_NONE;
}
- else if (p_ptr->action == ACTION_KATA)
+ else if (creature_ptr->action == ACTION_KATA)
{
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);
+ if (creature_ptr->concent) reset_concentration(TRUE);
/* Hex */
if (hex_spelling_any()) stop_hex_spell_all();
notice = TRUE;
- p_ptr->counter = FALSE;
+ creature_ptr->counter = FALSE;
chg_virtue(V_HARMONY, -1);
}
}
/* Shut */
else
{
- if (p_ptr->confused)
+ if (creature_ptr->confused)
{
msg_print(_("やっと混乱がおさまった。", "You feel less confused now."));
- p_ptr->special_attack &= ~(ATTACK_SUIKEN);
+ creature_ptr->special_attack &= ~(ATTACK_SUIKEN);
notice = TRUE;
}
}
/* Use the value */
- p_ptr->confused = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->confused = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_poisoned(TIME_EFFECT v)
+bool set_poisoned(player_type *creature_ptr, TIME_EFFECT v)
{
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->poisoned)
+ if (!creature_ptr->poisoned)
{
msg_print(_("毒に侵されてしまった!", "You are poisoned!"));
notice = TRUE;
/* Shut */
else
{
- if (p_ptr->poisoned)
+ if (creature_ptr->poisoned)
{
msg_print(_("やっと毒の痛みがなくなった。", "You are no longer poisoned."));
notice = TRUE;
}
/* Use the value */
- p_ptr->poisoned = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->poisoned = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_afraid(TIME_EFFECT v)
+bool set_afraid(player_type *creature_ptr, TIME_EFFECT v)
{
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->afraid)
+ if (!creature_ptr->afraid)
{
msg_print(_("何もかも恐くなってきた!", "You are terrified!"));
- 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;
}
notice = TRUE;
- p_ptr->counter = FALSE;
+ creature_ptr->counter = FALSE;
chg_virtue(V_VALOUR, -1);
}
}
/* Shut */
else
{
- if (p_ptr->afraid)
+ if (creature_ptr->afraid)
{
msg_print(_("やっと恐怖を振り払った。", "You feel bolder now."));
notice = TRUE;
}
/* Use the value */
- p_ptr->afraid = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->afraid = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
}
/*!
- * @brief 麻痺の継続時間をセットする / Set "p_ptr->paralyzed", notice observable changes
+ * @brief 麻痺の継続時間をセットする / Set "paralyzed", notice observable changes
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_paralyzed(TIME_EFFECT v)
+bool set_paralyzed(player_type *creature_ptr, TIME_EFFECT v)
{
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->paralyzed)
+ if (!creature_ptr->paralyzed)
{
msg_print(_("体が麻痺してしまった!", "You are paralyzed!"));
/* Sniper */
- if (p_ptr->concent) reset_concentration(TRUE);
+ if (creature_ptr->concent) reset_concentration(TRUE);
/* Hex */
if (hex_spelling_any()) stop_hex_spell_all();
- p_ptr->counter = FALSE;
+ creature_ptr->counter = FALSE;
notice = TRUE;
}
}
/* Shut */
else
{
- if (p_ptr->paralyzed)
+ if (creature_ptr->paralyzed)
{
msg_print(_("やっと動けるようになった。", "You can move again."));
notice = TRUE;
}
/* Use the value */
- p_ptr->paralyzed = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->paralyzed = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->redraw |= (PR_STATE);
+ creature_ptr->redraw |= (PR_STATE);
handle_stuff();
return (TRUE);
}
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
* @details Note that we must redraw the map when hallucination changes.
*/
-bool set_image(TIME_EFFECT v)
+bool set_image(player_type *creature_ptr, TIME_EFFECT v)
{
bool notice = FALSE;
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
- if (p_ptr->is_dead) return FALSE;
- if (p_ptr->pseikaku == SEIKAKU_CHARGEMAN) v = 0;
-
+ if (creature_ptr->is_dead) return FALSE;
+ if (creature_ptr->pseikaku == SEIKAKU_CHARGEMAN) v = 0;
/* Open */
if (v)
{
- set_tsuyoshi(0, TRUE);
- if (!p_ptr->image)
+ set_tsuyoshi(p_ptr, 0, TRUE);
+ if (!creature_ptr->image)
{
msg_print(_("ワーオ!何もかも虹色に見える!", "Oh, wow! Everything looks so cosmic now!"));
/* Sniper */
- if (p_ptr->concent) reset_concentration(TRUE);
+ if (creature_ptr->concent) reset_concentration(TRUE);
- p_ptr->counter = FALSE;
+ creature_ptr->counter = FALSE;
notice = TRUE;
}
}
/* Shut */
else
{
- if (p_ptr->image)
+ if (creature_ptr->image)
{
msg_print(_("やっとはっきりと物が見えるようになった。", "You can see clearly again."));
notice = TRUE;
}
/* Use the value */
- p_ptr->image = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->image = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
if (disturb_state) disturb(FALSE, TRUE);
- p_ptr->redraw |= (PR_MAP | PR_HEALTH | PR_UHEALTH);
- p_ptr->update |= (PU_MONSTERS);
- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+ creature_ptr->redraw |= (PR_MAP | PR_HEALTH | PR_UHEALTH);
+ creature_ptr->update |= (PU_MONSTERS);
+ creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
handle_stuff();
return (TRUE);
}
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_fast(TIME_EFFECT v, bool do_dec)
+bool set_fast(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->fast && !do_dec)
+ if (creature_ptr->fast && !do_dec)
{
- if (p_ptr->fast > v) return FALSE;
+ if (creature_ptr->fast > v) return FALSE;
}
- else if (!IS_FAST() && !p_ptr->lightspeed)
+ else if (!IS_FAST() && !creature_ptr->lightspeed)
{
msg_print(_("素早く動けるようになった!", "You feel yourself moving much faster!"));
notice = TRUE;
/* Shut */
else
{
- if (p_ptr->fast && !p_ptr->lightspeed && !music_singing(MUSIC_SPEED) && !music_singing(MUSIC_SHERO))
+ if (creature_ptr->fast && !creature_ptr->lightspeed && !music_singing(MUSIC_SPEED) && !music_singing(MUSIC_SHERO))
{
msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
notice = TRUE;
}
/* Use the value */
- p_ptr->fast = v;
+ creature_ptr->fast = v;
/* Nothing to notice */
if (!notice) return (FALSE);
if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @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;
/* 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);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_slow(TIME_EFFECT v, bool do_dec)
+bool set_slow(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->slow && !do_dec)
+ if (creature_ptr->slow && !do_dec)
{
- if (p_ptr->slow > v) return FALSE;
+ if (creature_ptr->slow > v) return FALSE;
}
- else if (!p_ptr->slow)
+ else if (!creature_ptr->slow)
{
msg_print(_("体の動きが遅くなってしまった!", "You feel yourself moving slower!"));
notice = TRUE;
/* Shut */
else
{
- if (p_ptr->slow)
+ if (creature_ptr->slow)
{
msg_print(_("動きの遅さがなくなったようだ。", "You feel yourself speed up."));
notice = TRUE;
}
/* Use the value */
- p_ptr->slow = v;
+ creature_ptr->slow = v;
/* Nothing to notice */
if (!notice) return (FALSE);
if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_shield(TIME_EFFECT v, bool do_dec)
+bool set_shield(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->shield && !do_dec)
+ if (creature_ptr->shield && !do_dec)
{
- if (p_ptr->shield > v) return FALSE;
+ if (creature_ptr->shield > v) return FALSE;
}
- else if (!p_ptr->shield)
+ else if (!creature_ptr->shield)
{
msg_print(_("肌が石になった。", "Your skin turns to stone."));
notice = TRUE;
/* Shut */
else
{
- if (p_ptr->shield)
+ if (creature_ptr->shield)
{
msg_print(_("肌が元に戻った。", "Your skin returns to normal."));
notice = TRUE;
}
/* Use the value */
- p_ptr->shield = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->shield = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tsubureru(TIME_EFFECT v, bool do_dec)
+bool set_tsubureru(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->tsubureru && !do_dec)
+ if (creature_ptr->tsubureru && !do_dec)
{
- if (p_ptr->tsubureru > v) return FALSE;
+ if (creature_ptr->tsubureru > v) return FALSE;
}
- else if (!p_ptr->tsubureru)
+ else if (!creature_ptr->tsubureru)
{
msg_print(_("横に伸びた。", "Your body expands horizontally."));
notice = TRUE;
/* Shut */
else
{
- if (p_ptr->tsubureru)
+ if (creature_ptr->tsubureru)
{
msg_print(_("もう横に伸びていない。", "Your body returns to normal."));
notice = TRUE;
}
/* Use the value */
- p_ptr->tsubureru = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->tsubureru = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_magicdef(TIME_EFFECT v, bool do_dec)
+bool set_magicdef(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->magicdef && !do_dec)
+ if (creature_ptr->magicdef && !do_dec)
{
- if (p_ptr->magicdef > v) return FALSE;
+ if (creature_ptr->magicdef > v) return FALSE;
}
- else if (!p_ptr->magicdef)
+ else if (!creature_ptr->magicdef)
{
msg_print(_("魔法の防御力が増したような気がする。", "You feel more resistant to magic."));
notice = TRUE;
/* Shut */
else
{
- if (p_ptr->magicdef)
+ if (creature_ptr->magicdef)
{
msg_print(_("魔法の防御力が元に戻った。", "You feel less resistant to magic."));
notice = TRUE;
}
/* Use the value */
- p_ptr->magicdef = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->magicdef = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_blessed(TIME_EFFECT v, bool do_dec)
+bool set_blessed(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->blessed && !do_dec)
+ if (creature_ptr->blessed && !do_dec)
{
- if (p_ptr->blessed > v) return FALSE;
+ if (creature_ptr->blessed > v) return FALSE;
}
else if (!IS_BLESSED())
{
/* Shut */
else
{
- if (p_ptr->blessed && !music_singing(MUSIC_BLESS))
+ if (creature_ptr->blessed && !music_singing(MUSIC_BLESS))
{
msg_print(_("高潔な気分が消え失せた。", "The prayer has expired."));
notice = TRUE;
}
/* Use the value */
- p_ptr->blessed = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->blessed = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->update |= (PU_BONUS);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @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(MUSIC_HERO) && !music_singing(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);
+ creature_ptr->update |= (PU_BONUS);
/* Recalculate hitpoints */
- p_ptr->update |= (PU_HP);
+ creature_ptr->update |= (PU_HP);
handle_stuff();
return (TRUE);
}
* @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;
+ if (creature_ptr->pclass == CLASS_BERSERKER) v = 1;
/* Open */
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);
+ creature_ptr->update |= (PU_BONUS);
/* Recalculate hitpoints */
- p_ptr->update |= (PU_HP);
+ creature_ptr->update |= (PU_HP);
handle_stuff();
return (TRUE);
}
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_protevil(TIME_EFFECT v, bool do_dec)
+bool set_protevil(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
- if (p_ptr->is_dead) return FALSE;
+ if (creature_ptr->is_dead) return FALSE;
/* Open */
if (v)
{
- if (p_ptr->protevil && !do_dec)
+ if (creature_ptr->protevil && !do_dec)
{
- if (p_ptr->protevil > v) return FALSE;
+ if (creature_ptr->protevil > v) return FALSE;
}
- else if (!p_ptr->protevil)
+ else if (!creature_ptr->protevil)
{
msg_print(_("邪悪なる存在から守られているような感じがする!", "You feel safe from evil!"));
notice = TRUE;
/* Shut */
else
{
- if (p_ptr->protevil)
+ if (creature_ptr->protevil)
{
msg_print(_("邪悪なる存在から守られている感じがなくなった。", "You no longer feel safe from evil."));
notice = TRUE;
}
/* Use the value */
- p_ptr->protevil = v;
- p_ptr->redraw |= (PR_STATUS);
+ creature_ptr->protevil = v;
+ creature_ptr->redraw |= (PR_STATUS);
/* Nothing to notice */
if (!notice) return (FALSE);
* @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())
{
chg_virtue(V_SACRIFICE, -3);
chg_virtue(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(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);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @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);
+ creature_ptr->update |= (PU_BONUS);
/* Update the monsters */
- p_ptr->update |= (PU_MONSTERS);
+ creature_ptr->update |= (PU_MONSTERS);
handle_stuff();
return (TRUE);
}
* @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);
+ creature_ptr->update |= (PU_BONUS);
/* Update the monsters */
- p_ptr->update |= (PU_MONSTERS);
+ creature_ptr->update |= (PU_MONSTERS);
handle_stuff();
return (TRUE);
}
* @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);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @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(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);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @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);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @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);
* @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);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @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);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @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);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @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);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @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);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
/*
* Set "p_ptr->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);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @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);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @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);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
}
* @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;
/* Shut */
else
{
- if (p_ptr->tsuyoshi)
+ if (creature_ptr->tsuyoshi)
{
msg_print(_("肉体が急速にしぼんでいった。", "Your body had quickly shriveled."));
- (void)dec_stat(A_CON, 20, TRUE);
- (void)dec_stat(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);
}
/* 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);
+ 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で攻撃できるようになった!",
}
if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->redraw |= (PR_STATUS);
+ 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!") :
}
if (disturb_state) disturb(FALSE, FALSE);
- p_ptr->redraw |= (PR_STATUS);
- p_ptr->update |= (PU_BONUS);
+ creature_ptr->redraw |= (PR_STATUS);
+ creature_ptr->update |= (PU_BONUS);
handle_stuff();
return (TRUE);
* @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(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);
handle_stuff();
* @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(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);
handle_stuff();
* @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_(RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
+ if ((PRACE_IS_(creature_ptr, RACE_DEMON) && (creature_ptr->lev > 44)) || (creature_ptr->mimic_form == MIMIC_DEMON)) v = 1;
/* Open */
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(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);
handle_stuff();
* @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(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);
handle_stuff();
* @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(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);
handle_stuff();
* @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_(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(A_INT);
- if (!p_ptr->sustain_wis) (void)do_dec_stat(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(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(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);
+ if (creature_ptr->concent) reset_concentration(TRUE);
/* Hex */
if (hex_spelling_any()) stop_hex_spell_all();
}
/* 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);
+ creature_ptr->update |= (PU_BONUS);
/* Redraw the "stun" */
- p_ptr->redraw |= (PR_STUN);
+ creature_ptr->redraw |= (PR_STUN);
handle_stuff();
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(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);
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);
+ creature_ptr->update |= (PU_BONUS);
/* Redraw the "cut" */
- p_ptr->redraw |= (PR_CUT);
+ creature_ptr->redraw |= (PR_CUT);
handle_stuff();
return (TRUE);
}
* 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;
}
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();
+ change_wild_mode(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);
+ creature_ptr->update |= (PU_BONUS);
/* Redraw hunger */
- p_ptr->redraw |= (PR_HUNGER);
+ creature_ptr->redraw |= (PR_HUNGER);
handle_stuff();
return (TRUE);
}
* Note that this function (used by stat potions) now restores\n
* the stat BEFORE increasing it.\n
*/
-bool inc_stat(int stat)
+bool inc_stat(player_type *creature_ptr, int stat)
{
BASE_STATUS value, gain;
/* Then augment the current/max stat */
- value = p_ptr->stat_cur[stat];
+ value = creature_ptr->stat_cur[stat];
/* Cannot go above 18/100 */
- if (value < p_ptr->stat_max_max[stat])
+ if (value < creature_ptr->stat_max_max[stat])
{
/* Gain one (sometimes two) points */
if (value < 18)
}
/* Gain 1/6 to 1/3 of distance to 18/100 */
- else if (value < (p_ptr->stat_max_max[stat]-2))
+ else if (value < (creature_ptr->stat_max_max[stat]-2))
{
/* Approximate gain value */
- gain = (((p_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
+ gain = (((creature_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
if (gain < 1) gain = 1;
/* Apply the bonus */
value += randint1(gain) + gain / 2;
/* Maximal value */
- if (value > (p_ptr->stat_max_max[stat]-1)) value = p_ptr->stat_max_max[stat]-1;
+ if (value > (creature_ptr->stat_max_max[stat]-1)) value = creature_ptr->stat_max_max[stat]-1;
}
/* Gain one point at a time */
}
/* Save the new value */
- p_ptr->stat_cur[stat] = value;
+ creature_ptr->stat_cur[stat] = value;
/* Bring up the maximum too */
- if (value > p_ptr->stat_max[stat])
+ if (value > creature_ptr->stat_max[stat])
{
- p_ptr->stat_max[stat] = value;
+ creature_ptr->stat_max[stat] = value;
}
- p_ptr->update |= (PU_BONUS);
+ creature_ptr->update |= (PU_BONUS);
/* Success */
return (TRUE);
* if your stat is already drained, the "max" value will not drop all\n
* the way down to the "cur" value.\n
*/
-bool dec_stat(int stat, int amount, int permanent)
+bool dec_stat(player_type *creature_ptr, int stat, int amount, int permanent)
{
BASE_STATUS cur, max;
int loss, same;
bool res = FALSE;
-
/* Acquire current value */
- cur = p_ptr->stat_cur[stat];
- max = p_ptr->stat_max[stat];
+ cur = creature_ptr->stat_cur[stat];
+ max = creature_ptr->stat_max[stat];
/* Note when the values are identical */
same = (cur == max);
if (cur < 3) cur = 3;
/* Something happened */
- if (cur != p_ptr->stat_cur[stat]) res = TRUE;
+ if (cur != creature_ptr->stat_cur[stat]) res = TRUE;
}
/* Damage "max" value */
if (same || (max < cur)) max = cur;
/* Something happened */
- if (max != p_ptr->stat_max[stat]) res = TRUE;
+ if (max != creature_ptr->stat_max[stat]) res = TRUE;
}
if (res)
{
/* Actually set the stat to its new value. */
- p_ptr->stat_cur[stat] = cur;
- p_ptr->stat_max[stat] = max;
+ creature_ptr->stat_cur[stat] = cur;
+ creature_ptr->stat_max[stat] = max;
- p_ptr->redraw |= (PR_STATS);
- p_ptr->update |= (PU_BONUS);
+ creature_ptr->redraw |= (PR_STATS);
+ creature_ptr->update |= (PU_BONUS);
}
return (res);
* @param stat 回復ステータスID
* @return 実際に回復した場合TRUEを返す。
*/
-bool res_stat(int stat)
+bool res_stat(player_type *creature_ptr, int stat)
{
/* Restore if needed */
- if (p_ptr->stat_cur[stat] != p_ptr->stat_max[stat])
+ if (creature_ptr->stat_cur[stat] != creature_ptr->stat_max[stat])
{
- p_ptr->stat_cur[stat] = p_ptr->stat_max[stat];
- p_ptr->update |= (PU_BONUS);
- p_ptr->redraw |= (PR_STATS);
+ creature_ptr->stat_cur[stat] = creature_ptr->stat_max[stat];
+ creature_ptr->update |= (PU_BONUS);
+ creature_ptr->redraw |= (PR_STATS);
/* Success */
return (TRUE);
/*
* Increase players hit points, notice effects
*/
-bool hp_player(int num)
+bool hp_player(player_type *creature_ptr, int num)
{
int vir;
vir = virtue_number(V_VITALITY);
if(vir)
{
- num = num * (p_ptr->virtues[vir - 1] + 1250) / 1250;
+ num = num * (creature_ptr->virtues[vir - 1] + 1250) / 1250;
}
/* Healing needed */
- if (p_ptr->chp < p_ptr->mhp)
+ if (creature_ptr->chp < creature_ptr->mhp)
{
- if ((num > 0) && (p_ptr->chp < (p_ptr->mhp/3)))
+ if ((num > 0) && (creature_ptr->chp < (creature_ptr->mhp/3)))
chg_virtue(V_TEMPERANCE, 1);
/* Gain hitpoints */
- p_ptr->chp += num;
+ creature_ptr->chp += num;
/* Enforce maximum */
- if (p_ptr->chp >= p_ptr->mhp)
+ if (creature_ptr->chp >= creature_ptr->mhp)
{
- p_ptr->chp = p_ptr->mhp;
- p_ptr->chp_frac = 0;
+ creature_ptr->chp = creature_ptr->mhp;
+ creature_ptr->chp_frac = 0;
}
- p_ptr->redraw |= (PR_HP);
+ creature_ptr->redraw |= (PR_HP);
- p_ptr->window |= (PW_PLAYER);
+ creature_ptr->window |= (PW_PLAYER);
/* Heal 0-4 */
if (num < 5)
/*
* Lose a "point"
*/
-bool do_dec_stat(int stat)
+bool do_dec_stat(player_type *creature_ptr, int stat)
{
bool sust = FALSE;
/* Access the "sustain" */
switch (stat)
{
- case A_STR: if (p_ptr->sustain_str) sust = TRUE; break;
- case A_INT: if (p_ptr->sustain_int) sust = TRUE; break;
- case A_WIS: if (p_ptr->sustain_wis) sust = TRUE; break;
- case A_DEX: if (p_ptr->sustain_dex) sust = TRUE; break;
- case A_CON: if (p_ptr->sustain_con) sust = TRUE; break;
- case A_CHR: if (p_ptr->sustain_chr) sust = TRUE; break;
+ case A_STR: if (creature_ptr->sustain_str) sust = TRUE; break;
+ case A_INT: if (creature_ptr->sustain_int) sust = TRUE; break;
+ case A_WIS: if (creature_ptr->sustain_wis) sust = TRUE; break;
+ case A_DEX: if (creature_ptr->sustain_dex) sust = TRUE; break;
+ case A_CON: if (creature_ptr->sustain_con) sust = TRUE; break;
+ case A_CHR: if (creature_ptr->sustain_chr) sust = TRUE; break;
}
/* Sustain */
}
/* Attempt to reduce the stat */
- if (dec_stat(stat, 10, (ironman_nightmare && !randint0(13))))
+ if (dec_stat(p_ptr, stat, 10, (ironman_nightmare && !randint0(13))))
{
msg_format(_("ひどく%sなった気がする。", "You feel very %s."), desc_stat_neg[stat]);
/*
* Restore lost "points" in a stat
*/
-bool do_res_stat(int stat)
+bool do_res_stat(player_type *creature_ptr, int stat)
{
/* Attempt to increase */
- if (res_stat(stat))
+ if (res_stat(creature_ptr, stat))
{
msg_format(_("元通りに%sなった気がする。", "You feel less %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(stat);
+ res = res_stat(creature_ptr, stat);
/* Attempt to increase */
- if (inc_stat(stat))
+ if (inc_stat(creature_ptr, stat))
{
if (stat == A_WIS)
{
/*
* 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();
/*
* Forget everything
*/
-bool lose_all_info(void)
+bool lose_all_info(player_type *creature_ptr)
{
int i;
/* 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();
if (!(wounds || hit_p || Nasty_effect)) return;
msg_print(_("傷がより軽いものに変化した。", "Your wounds are polymorphed into less serious ones."));
- hp_player(change);
+ hp_player(p_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);
+ set_cut(p_ptr,change);
}
else
{
- set_cut(p_ptr->cut - (change / 2));
+ set_cut(p_ptr,p_ptr->cut - (change / 2));
}
}
{
if (one_in_(2))
{
- (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
+ (void)dec_stat(p_ptr, tmp, randint1(6) + 6, one_in_(3));
power -= 1;
}
tmp++;
}
/* Deformities are discriminated against! */
- (void)dec_stat(A_CHR, randint1(6), TRUE);
+ (void)dec_stat(p_ptr, A_CHR, randint1(6), TRUE);
if (effect_msg[0])
{
while (tmp < A_MAX)
{
- (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
+ (void)dec_stat(p_ptr, tmp, randint1(6) + 6, one_in_(3));
tmp++;
}
if (one_in_(6))
}
}
-
-/*
- * Decreases players hit points and sets death flag if necessary
- *
- * Invulnerability needs to be changed into a "shield"
- *
- * Hack -- this function allows the user to save (or quit)
- * the game when he dies, since the "You die." message is shown before
- * setting the player to "dead".
- */
-
-int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
-{
- int old_chp = p_ptr->chp;
-
- char death_message[1024];
- char tmp[1024];
-
- int warning = (p_ptr->mhp * hitpoint_warn / 10);
- if (p_ptr->is_dead) return 0;
-
- if (p_ptr->sutemi) damage *= 2;
- if (p_ptr->special_defense & KATA_IAI) damage += (damage + 4) / 5;
-
- if (easy_band) damage = (damage+1)/2;
-
- if (damage_type != DAMAGE_USELIFE)
- {
- disturb(TRUE, TRUE);
- if (auto_more)
- {
- p_ptr->now_damaged = TRUE;
- }
- }
-
- if (monspell >= 0) learn_spell(monspell);
-
- /* Mega-Hack -- Apply "invulnerability" */
- if ((damage_type != DAMAGE_USELIFE) && (damage_type != DAMAGE_LOSELIFE))
- {
- if (IS_INVULN() && (damage < 9000))
- {
- if (damage_type == DAMAGE_FORCE)
- {
- msg_print(_("バリアが切り裂かれた!", "The attack cuts your shield of invulnerability open!"));
- }
- else if (one_in_(PENETRATE_INVULNERABILITY))
- {
- msg_print(_("無敵のバリアを破って攻撃された!", "The attack penetrates your shield of invulnerability!"));
- }
- else
- {
- return 0;
- }
- }
-
- if (CHECK_MULTISHADOW())
- {
- if (damage_type == DAMAGE_FORCE)
- {
- msg_print(_("幻影もろとも体が切り裂かれた!", "The attack hits Shadow together with you!"));
- }
- else if (damage_type == DAMAGE_ATTACK)
- {
- msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, you are unharmed!"));
- return 0;
- }
- }
-
- if (p_ptr->wraith_form)
- {
- if (damage_type == DAMAGE_FORCE)
- {
- msg_print(_("半物質の体が切り裂かれた!", "The attack cuts through your ethereal body!"));
- }
- else
- {
- damage /= 2;
- if ((damage == 0) && one_in_(2)) damage = 1;
- }
- }
-
- if (p_ptr->special_defense & KATA_MUSOU)
- {
- damage /= 2;
- if ((damage == 0) && one_in_(2)) damage = 1;
- }
- } /* not if LOSELIFE USELIFE */
-
- /* Hurt the player */
- p_ptr->chp -= damage;
- if(damage_type == DAMAGE_GENO && p_ptr->chp < 0)
- {
- damage += p_ptr->chp;
- p_ptr->chp = 0;
- }
-
- /* Display the hitpoints */
- p_ptr->redraw |= (PR_HP);
-
- p_ptr->window |= (PW_PLAYER);
-
- if (damage_type != DAMAGE_GENO && p_ptr->chp == 0)
- {
- chg_virtue(V_SACRIFICE, 1);
- chg_virtue(V_CHANCE, 2);
- }
-
- /* Dead player */
- if (p_ptr->chp < 0)
- {
- bool android = (p_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
-
-#ifdef JP /* 死んだ時に強制終了して死を回避できなくしてみた by Habu */
- if (!cheat_save)
- if(!save_player()) msg_print("セーブ失敗!");
-#endif
-
- sound(SOUND_DEATH);
-
- chg_virtue(V_SACRIFICE, 10);
-
- handle_stuff();
- p_ptr->leaving = TRUE;
-
- /* Note death */
- p_ptr->is_dead = TRUE;
-
- if (p_ptr->inside_arena)
- {
- concptr m_name = r_name+r_info[arena_info[p_ptr->arena_number].r_idx].name;
- msg_format(_("あなたは%sの前に敗れ去った。", "You are beaten by %s."), m_name);
- msg_print(NULL);
- if (record_arena) do_cmd_write_nikki(NIKKI_ARENA, -1 - p_ptr->arena_number, m_name);
- }
- else
- {
- QUEST_IDX q_idx = quest_number(current_floor_ptr->dun_level);
- bool seppuku = streq(hit_from, "Seppuku");
- bool winning_seppuku = p_ptr->total_winner && seppuku;
-
- play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_GAMEOVER);
-
-#ifdef WORLD_SCORE
- /* Make screen dump */
- screen_dump = make_screen_dump();
-#endif
-
- /* Note cause of death */
- if (seppuku)
- {
- strcpy(p_ptr->died_from, hit_from);
-#ifdef JP
- if (!winning_seppuku) strcpy(p_ptr->died_from, "切腹");
-#endif
- }
- else
- {
- char dummy[1024];
-#ifdef JP
- sprintf(dummy, "%s%s%s", !p_ptr->paralyzed ? "" : p_ptr->free_act ? "彫像状態で" : "麻痺状態で", p_ptr->image ? "幻覚に歪んだ" : "", hit_from);
-#else
- sprintf(dummy, "%s%s", hit_from, !p_ptr->paralyzed ? "" : " while helpless");
-#endif
- my_strcpy(p_ptr->died_from, dummy, sizeof p_ptr->died_from);
- }
-
- /* No longer a winner */
- p_ptr->total_winner = FALSE;
-
- if (winning_seppuku)
- {
- do_cmd_write_nikki(NIKKI_BUNSHOU, 0, _("勝利の後切腹した。", "did Seppuku after the winning."));
- }
- else
- {
- char buf[20];
-
- if (p_ptr->inside_arena)
- strcpy(buf,_("アリーナ", "in the Arena"));
- else if (!current_floor_ptr->dun_level)
- strcpy(buf,_("地上", "on the surface"));
- else if (q_idx && (is_fixed_quest_idx(q_idx) &&
- !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
- strcpy(buf,_("クエスト", "in a quest"));
- else
- sprintf(buf,_("%d階", "level %d"), (int)current_floor_ptr->dun_level);
-
- sprintf(tmp, _("%sで%sに殺された。", "killed by %s %s."), buf, p_ptr->died_from);
- do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
- }
-
- do_cmd_write_nikki(NIKKI_GAMESTART, 1, _("-------- ゲームオーバー --------", "-------- Game Over --------"));
- do_cmd_write_nikki(NIKKI_BUNSHOU, 1, "\n\n\n\n");
-
- flush();
-
- if (get_check_strict(_("画面を保存しますか?", "Dump the screen? "), CHECK_NO_HISTORY))
- {
- do_cmd_save_screen();
- }
-
- flush();
-
- /* Initialize "last message" buffer */
- if (p_ptr->last_message) string_free(p_ptr->last_message);
- p_ptr->last_message = NULL;
-
- /* Hack -- Note death */
- if (!last_words)
- {
-#ifdef JP
- msg_format("あなたは%sました。", android ? "壊れ" : "死に");
-#else
- msg_print(android ? "You are broken." : "You die.");
-#endif
-
- msg_print(NULL);
- }
- else
- {
- if (winning_seppuku)
- {
- get_rnd_line(_("seppuku_j.txt", "seppuku.txt"), 0, death_message);
- }
- else
- {
- get_rnd_line(_("death_j.txt", "death.txt"), 0, death_message);
- }
-
- do
- {
-#ifdef JP
- while (!get_string(winning_seppuku ? "辞世の句: " : "断末魔の叫び: ", death_message, 1024)) ;
-#else
- while (!get_string("Last word: ", death_message, 1024)) ;
-#endif
- }
- while (winning_seppuku && !get_check_strict(_("よろしいですか?", "Are you sure? "), CHECK_NO_HISTORY));
-
- if (death_message[0] == '\0')
- {
-#ifdef JP
- strcpy(death_message, format("あなたは%sました。", android ? "壊れ" : "死に"));
-#else
- strcpy(death_message, android ? "You are broken." : "You die.");
-#endif
- }
- else p_ptr->last_message = string_make(death_message);
-
-#ifdef JP
- if (winning_seppuku)
- {
- int i, len;
- int w = Term->wid;
- int h = Term->hgt;
- int msg_pos_x[9] = { 5, 7, 9, 12, 14, 17, 19, 21, 23};
- int msg_pos_y[9] = { 3, 4, 5, 4, 5, 4, 5, 6, 4};
- concptr str;
- char* str2;
-
- Term_clear();
-
- /* 桜散る */
- for (i = 0; i < 40; i++)
- Term_putstr(randint0(w / 2) * 2, randint0(h), 2, TERM_VIOLET, "υ");
-
- str = death_message;
- if (strncmp(str, "「", 2) == 0) str += 2;
-
- str2 = my_strstr(str, "」");
- if (str2 != NULL) *str2 = '\0';
-
- i = 0;
- while (i < 9)
- {
- str2 = my_strstr(str, " ");
- if (str2 == NULL) len = strlen(str);
- else len = str2 - str;
-
- if (len != 0)
- {
- Term_putstr_v(w * 3 / 4 - 2 - msg_pos_x[i] * 2, msg_pos_y[i], len,
- TERM_WHITE, str);
- if (str2 == NULL) break;
- i++;
- }
- str = str2 + 1;
- if (*str == 0) break;
- }
-
- /* Hide cursor */
- Term_putstr(w-1, h-1, 1, TERM_WHITE, " ");
-
- flush();
-#ifdef WORLD_SCORE
- /* Make screen dump */
- screen_dump = make_screen_dump();
-#endif
-
- /* Wait a key press */
- (void)inkey();
- }
- else
-#endif
- msg_print(death_message);
- }
- }
-
- /* Dead */
- return damage;
- }
-
- handle_stuff();
-
- /* Hitpoint warning */
- if (p_ptr->chp < warning)
- {
- /* Hack -- bell on first notice */
- if (old_chp > warning) bell();
-
- sound(SOUND_WARN);
-
- if (record_danger && (old_chp > warning))
- {
- if (p_ptr->image && damage_type == DAMAGE_ATTACK)
- hit_from = _("何か", "something");
-
- sprintf(tmp,_("%sによってピンチに陥った。", "A critical situation because of %s."),hit_from);
- do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
- }
-
- if (auto_more)
- {
- /* stop auto_more even if DAMAGE_USELIFE */
- p_ptr->now_damaged = TRUE;
- }
-
- msg_print(_("*** 警告:低ヒット・ポイント! ***", "*** LOW HITPOINT WARNING! ***"));
- msg_print(NULL);
- flush();
- }
- if (p_ptr->wild_mode && !p_ptr->leaving && (p_ptr->chp < MAX(warning, p_ptr->mhp/5)))
- {
- change_wild_mode();
- }
- return damage;
-}
-
-
/*
* Gain experience
*/
}
-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;
else total_exp += exp / 16;
if (i == INVEN_BODY) total_exp += exp / 32;
}
- p_ptr->exp = p_ptr->max_exp = total_exp;
+ creature_ptr->exp = creature_ptr->max_exp = total_exp;
/* Check Experience */
check_experience();
choice = inkey();
if ((choice == 'a') || (choice == 'A'))
- set_ele_attack(ATTACK_FIRE, p_ptr->lev/2 + randint1(p_ptr->lev/2));
+ set_ele_attack(p_ptr, ATTACK_FIRE, p_ptr->lev/2 + randint1(p_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(p_ptr, ATTACK_COLD, p_ptr->lev/2 + randint1(p_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(p_ptr, ATTACK_POIS, p_ptr->lev/2 + randint1(p_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(p_ptr, ATTACK_ACID, p_ptr->lev/2 + randint1(p_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(p_ptr, ATTACK_ELEC, p_ptr->lev/2 + randint1(p_ptr->lev/2));
else
{
msg_print(_("魔法剣を使うのをやめた。", "You cancel the temporary branding."));
choice = inkey();
if ((choice == 'a') || (choice == 'A'))
- set_ele_immune(DEFENSE_FIRE, immune_turn);
+ set_ele_immune(p_ptr, DEFENSE_FIRE, immune_turn);
else if ((choice == 'b') || (choice == 'B'))
- set_ele_immune(DEFENSE_COLD, immune_turn);
+ set_ele_immune(p_ptr, DEFENSE_COLD, immune_turn);
else if ((choice == 'c') || (choice == 'C'))
- set_ele_immune(DEFENSE_ACID, immune_turn);
+ set_ele_immune(p_ptr, DEFENSE_ACID, immune_turn);
else if ((choice == 'd') || (choice == 'D'))
- set_ele_immune(DEFENSE_ELEC, immune_turn);
+ set_ele_immune(p_ptr, DEFENSE_ELEC, immune_turn);
else
{
msg_print(_("免疫を付けるのをやめた。", "You cancel the temporary immune."));