3 * @brief プレイヤーのステータス管理 / effects of various "objects"
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
8 * This software may be copied and distributed for educational, research,\n
9 * and not for profit purposes provided that this copyright and statement\n
10 * are included in all such copies. Other copyrights may also apply.\n
12 * 2013 Deskull rearranged comment for Doxygen.\n
19 * @brief プレイヤーの継続行動を設定する。
20 * @param typ 継続行動のID\n
21 * #ACTION_NONE / #ACTION_SEARCH / #ACTION_REST / #ACTION_LEARN / #ACTION_FISH / #ACTION_KAMAE / #ACTION_KATA / #ACTION_SING / #ACTION_HAYAGAKE / #ACTION_SPELL から選択。
24 void set_action(int typ)
26 int prev_typ = p_ptr->action;
38 msg_print(_("探索をやめた。", "You no longer walk carefully."));
39 p_ptr->redraw |= (PR_SPEED);
49 msg_print(_("学習をやめた。", "You stop Learning"));
55 msg_print(_("構えをといた。", "You stop assuming the posture."));
56 p_ptr->special_defense &= ~(KAMAE_MASK);
61 msg_print(_("型を崩した。", "You stop assuming the posture."));
62 p_ptr->special_defense &= ~(KATA_MASK);
63 p_ptr->update |= (PU_MONSTERS);
64 p_ptr->redraw |= (PR_STATUS);
69 msg_print(_("歌うのをやめた。", "You stop singing."));
74 msg_print(_("足が重くなった。", "You are no longer walking extremely fast."));
75 p_ptr->energy_use = 100;
80 msg_print(_("呪文の詠唱を中断した。", "You stopped spelling all spells."));
88 /* If we are requested other action, stop singing */
89 if (prev_typ == ACTION_SING) stop_singing();
90 if (prev_typ == ACTION_SPELL) stop_hex_spell();
92 switch (p_ptr->action)
96 msg_print(_("注意深く歩き始めた。", "You begin to walk carefully."));
97 p_ptr->redraw |= (PR_SPEED);
102 msg_print(_("学習を始めた。", "You begin Learning"));
107 msg_print(_("水面に糸を垂らした...", "You begin fishing..."));
110 case ACTION_HAYAGAKE:
112 msg_print(_("足が羽のように軽くなった。", "You begin to walk extremely fast."));
121 /* Recalculate bonuses */
122 p_ptr->update |= (PU_BONUS);
124 /* Redraw the state */
125 p_ptr->redraw |= (PR_STATE);
129 * @brief プレイヤーの全ての時限効果をリセットする。 / reset timed flags
132 void reset_tim_flags(void)
134 p_ptr->fast = 0; /* Timed -- Fast */
135 p_ptr->lightspeed = 0;
136 p_ptr->slow = 0; /* Timed -- Slow */
137 p_ptr->blind = 0; /* Timed -- Blindness */
138 p_ptr->paralyzed = 0; /* Timed -- Paralysis */
139 p_ptr->confused = 0; /* Timed -- Confusion */
140 p_ptr->afraid = 0; /* Timed -- Fear */
141 p_ptr->image = 0; /* Timed -- Hallucination */
142 p_ptr->poisoned = 0; /* Timed -- Poisoned */
143 p_ptr->cut = 0; /* Timed -- Cut */
144 p_ptr->stun = 0; /* Timed -- Stun */
146 p_ptr->protevil = 0; /* Timed -- Protection */
147 p_ptr->invuln = 0; /* Timed -- Invulnerable */
149 p_ptr->hero = 0; /* Timed -- Heroism */
150 p_ptr->shero = 0; /* Timed -- Super Heroism */
151 p_ptr->shield = 0; /* Timed -- Shield Spell */
152 p_ptr->blessed = 0; /* Timed -- Blessed */
153 p_ptr->tim_invis = 0; /* Timed -- Invisibility */
154 p_ptr->tim_infra = 0; /* Timed -- Infra Vision */
155 p_ptr->tim_regen = 0; /* Timed -- Regeneration */
156 p_ptr->tim_stealth = 0; /* Timed -- Stealth */
158 p_ptr->wraith_form = 0; /* Timed -- Wraith Form */
159 p_ptr->tim_levitation = 0;
160 p_ptr->tim_sh_touki = 0;
161 p_ptr->tim_sh_fire = 0;
162 p_ptr->tim_sh_holy = 0;
163 p_ptr->tim_eyeeye = 0;
165 p_ptr->resist_magic = 0;
168 p_ptr->tim_res_nether = 0;
169 p_ptr->tim_res_time = 0;
170 p_ptr->tim_mimic = 0;
171 p_ptr->mimic_form = 0;
172 p_ptr->tim_reflect = 0;
173 p_ptr->multishadow = 0;
175 p_ptr->action = ACTION_NONE;
178 p_ptr->oppose_acid = 0; /* Timed -- oppose acid */
179 p_ptr->oppose_elec = 0; /* Timed -- oppose lightning */
180 p_ptr->oppose_fire = 0; /* Timed -- oppose heat */
181 p_ptr->oppose_cold = 0; /* Timed -- oppose cold */
182 p_ptr->oppose_pois = 0; /* Timed -- oppose poison */
184 p_ptr->word_recall = 0;
185 p_ptr->alter_reality = 0;
186 p_ptr->sutemi = FALSE;
187 p_ptr->counter = FALSE;
188 p_ptr->ele_attack = 0;
189 p_ptr->ele_immune = 0;
190 p_ptr->special_attack = 0L;
191 p_ptr->special_defense = 0L;
193 while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
194 world_player = FALSE;
196 if (prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
197 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1;
198 if (p_ptr->pclass == CLASS_BERSERKER) p_ptr->shero = 1;
202 (void)set_monster_fast(p_ptr->riding, 0);
203 (void)set_monster_slow(p_ptr->riding, 0);
204 (void)set_monster_invulner(p_ptr->riding, 0, FALSE);
207 if (p_ptr->pclass == CLASS_BARD)
209 p_ptr->magic_num1[0] = 0;
210 p_ptr->magic_num2[0] = 0;
215 * @brief プレイヤーに魔力消去効果を与える。
218 void dispel_player(void)
220 (void)set_fast(0, TRUE);
221 (void)set_lightspeed(0, TRUE);
222 (void)set_slow(0, TRUE);
223 (void)set_shield(0, TRUE);
224 (void)set_blessed(0, TRUE);
225 (void)set_tsuyoshi(0, TRUE);
226 (void)set_hero(0, TRUE);
227 (void)set_shero(0, TRUE);
228 (void)set_protevil(0, TRUE);
229 (void)set_invuln(0, TRUE);
230 (void)set_wraith_form(0, TRUE);
231 (void)set_kabenuke(0, TRUE);
232 (void)set_tim_res_nether(0, TRUE);
233 (void)set_tim_res_time(0, TRUE);
235 (void)set_tim_reflect(0,TRUE);
236 (void)set_multishadow(0,TRUE);
237 (void)set_dustrobe(0,TRUE);
239 (void)set_tim_invis(0, TRUE);
240 (void)set_tim_infra(0, TRUE);
241 (void)set_tim_esp(0, TRUE);
242 (void)set_tim_regen(0, TRUE);
243 (void)set_tim_stealth(0, TRUE);
244 (void)set_tim_levitation(0, TRUE);
245 (void)set_tim_sh_touki(0, TRUE);
246 (void)set_tim_sh_fire(0, TRUE);
247 (void)set_tim_sh_holy(0, TRUE);
248 (void)set_tim_eyeeye(0, TRUE);
249 (void)set_magicdef(0, TRUE);
250 (void)set_resist_magic(0, TRUE);
251 (void)set_oppose_acid(0, TRUE);
252 (void)set_oppose_elec(0, TRUE);
253 (void)set_oppose_fire(0, TRUE);
254 (void)set_oppose_cold(0, TRUE);
255 (void)set_oppose_pois(0, TRUE);
256 (void)set_ultimate_res(0, TRUE);
257 (void)set_mimic(0, 0, TRUE);
258 (void)set_ele_attack(0, 0);
259 (void)set_ele_immune(0, 0);
261 /* Cancel glowing hands */
262 if (p_ptr->special_attack & ATTACK_CONFUSE)
264 p_ptr->special_attack &= ~(ATTACK_CONFUSE);
265 msg_print(_("手の輝きがなくなった。", "Your hands stop glowing."));
268 if (music_singing_any() || hex_spelling_any())
270 cptr str = (music_singing_any()) ? _("歌", "singing") : _("呪文", "spelling");
271 p_ptr->magic_num1[1] = p_ptr->magic_num1[0];
272 p_ptr->magic_num1[0] = 0;
273 msg_format(_("%sが途切れた。", "Your %s is interrupted."), str);
274 p_ptr->action = ACTION_NONE;
276 /* Recalculate bonuses */
277 p_ptr->update |= (PU_BONUS | PU_HP);
280 p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
282 /* Update monsters */
283 p_ptr->update |= (PU_MONSTERS);
286 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
288 p_ptr->energy_need += ENERGY_NEED();
294 * @brief 変身効果の継続時間と変身先をセットする / Set "p_ptr->tim_mimic", and "p_ptr->mimic_form", notice observable changes
297 * @param do_dec 現在の継続時間より長い値のみ上書きする
298 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
300 bool set_mimic(int v, int p, bool do_dec)
304 /* Hack -- Force good values */
305 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
307 if (p_ptr->is_dead) return FALSE;
312 if (p_ptr->tim_mimic && (p_ptr->mimic_form == p) && !do_dec)
314 if (p_ptr->tim_mimic > v) return FALSE;
316 else if ((!p_ptr->tim_mimic) || (p_ptr->mimic_form != p))
318 msg_print(_("自分の体が変わってゆくのを感じた。", "You feel that your body changes."));
327 if (p_ptr->tim_mimic)
329 msg_print(_("変身が解けた。", "You are no longer transformed."));
330 if (p_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(0, TRUE);
338 p_ptr->tim_mimic = v;
340 /* Nothing to notice */
345 if (disturb_state) disturb(0, 1);
348 p_ptr->redraw |= (PR_BASIC | PR_STATUS);
350 /* Recalculate bonuses */
351 p_ptr->update |= (PU_BONUS | PU_HP);
360 * @brief 盲目の継続時間をセットする / Set "p_ptr->blind", notice observable changes
362 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
364 * Note the use of "PU_UN_LITE" and "PU_UN_VIEW", which is needed to\n
365 * memorize any terrain features which suddenly become "visible".\n
366 * Note that blindness is currently the only thing which can affect\n
367 * "player_can_see_bold()".\n
369 bool set_blind(int v)
373 /* Hack -- Force good values */
374 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
376 if (p_ptr->is_dead) return FALSE;
383 if (p_ptr->prace == RACE_ANDROID)
385 msg_print(_("センサーをやられた!", "You are blind!"));
389 msg_print(_("目が見えなくなってしまった!", "You are blind!"));
393 chg_virtue(V_ENLIGHTEN, -1);
402 if (p_ptr->prace == RACE_ANDROID)
404 msg_print(_("センサーが復旧した。", "You can see again."));
408 msg_print(_("やっと目が見えるようになった。", "You can see again."));
418 /* Redraw status bar */
419 p_ptr->redraw |= (PR_STATUS);
421 /* Nothing to notice */
422 if (!notice) return (FALSE);
425 if (disturb_state) disturb(0, 0);
427 /* Fully update the visuals */
428 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
431 p_ptr->redraw |= (PR_MAP);
434 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
445 * @brief 混乱の継続時間をセットする / Set "p_ptr->confused", notice observable changes
447 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
449 bool set_confused(int v)
453 /* Hack -- Force good values */
454 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
456 if (p_ptr->is_dead) return FALSE;
461 if (!p_ptr->confused)
463 msg_print(_("あなたは混乱した!", "You are confused!"));
465 if (p_ptr->action == ACTION_LEARN)
467 msg_print(_("学習が続けられない!", "You cannot continue Learning!"));
470 p_ptr->redraw |= (PR_STATE);
471 p_ptr->action = ACTION_NONE;
473 if (p_ptr->action == ACTION_KAMAE)
475 msg_print(_("構えがとけた。", "Your posture gets loose."));
476 p_ptr->special_defense &= ~(KAMAE_MASK);
477 p_ptr->update |= (PU_BONUS);
478 p_ptr->redraw |= (PR_STATE);
479 p_ptr->action = ACTION_NONE;
481 else if (p_ptr->action == ACTION_KATA)
483 msg_print(_("型が崩れた。", "Your posture gets loose."));
484 p_ptr->special_defense &= ~(KATA_MASK);
485 p_ptr->update |= (PU_BONUS);
486 p_ptr->update |= (PU_MONSTERS);
487 p_ptr->redraw |= (PR_STATE);
488 p_ptr->redraw |= (PR_STATUS);
489 p_ptr->action = ACTION_NONE;
493 if (p_ptr->concent) reset_concentration(TRUE);
496 if (hex_spelling_any()) stop_hex_spell_all();
499 p_ptr->counter = FALSE;
500 chg_virtue(V_HARMONY, -1);
509 msg_print(_("やっと混乱がおさまった。", "You feel less confused now."));
510 p_ptr->special_attack &= ~(ATTACK_SUIKEN);
518 /* Redraw status bar */
519 p_ptr->redraw |= (PR_STATUS);
521 /* Nothing to notice */
522 if (!notice) return (FALSE);
525 if (disturb_state) disturb(0, 0);
536 * @brief 毒の継続時間をセットする / Set "p_ptr->poisoned", notice observable changes
538 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
540 bool set_poisoned(int v)
544 /* Hack -- Force good values */
545 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
547 if (p_ptr->is_dead) return FALSE;
552 if (!p_ptr->poisoned)
554 msg_print(_("毒に侵されてしまった!", "You are poisoned!"));
564 msg_print(_("やっと毒の痛みがなくなった。", "You are no longer poisoned."));
572 /* Redraw status bar */
573 p_ptr->redraw |= (PR_STATUS);
575 /* Nothing to notice */
576 if (!notice) return (FALSE);
579 if (disturb_state) disturb(0, 0);
590 * @brief 恐怖の継続時間をセットする / Set "p_ptr->afraid", notice observable changes
592 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
594 bool set_afraid(int v)
598 /* Hack -- Force good values */
599 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
601 if (p_ptr->is_dead) return FALSE;
608 msg_print(_("何もかも恐くなってきた!", "You are terrified!"));
610 if (p_ptr->special_defense & KATA_MASK)
612 msg_print(_("型が崩れた。", "Your posture gets loose."));
613 p_ptr->special_defense &= ~(KATA_MASK);
614 p_ptr->update |= (PU_BONUS);
615 p_ptr->update |= (PU_MONSTERS);
616 p_ptr->redraw |= (PR_STATE);
617 p_ptr->redraw |= (PR_STATUS);
618 p_ptr->action = ACTION_NONE;
622 p_ptr->counter = FALSE;
623 chg_virtue(V_VALOUR, -1);
632 msg_print(_("やっと恐怖を振り払った。", "You feel bolder now."));
640 /* Redraw status bar */
641 p_ptr->redraw |= (PR_STATUS);
643 /* Nothing to notice */
644 if (!notice) return (FALSE);
647 if (disturb_state) disturb(0, 0);
657 * @brief 麻痺の継続時間をセットする / Set "p_ptr->paralyzed", notice observable changes
659 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
661 bool set_paralyzed(int v)
665 /* Hack -- Force good values */
666 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
668 if (p_ptr->is_dead) return FALSE;
673 if (!p_ptr->paralyzed)
675 msg_print(_("体が麻痺してしまった!", "You are paralyzed!"));
677 if (p_ptr->concent) reset_concentration(TRUE);
680 if (hex_spelling_any()) stop_hex_spell_all();
682 p_ptr->counter = FALSE;
690 if (p_ptr->paralyzed)
692 msg_print(_("やっと動けるようになった。", "You can move again."));
698 p_ptr->paralyzed = v;
700 /* Redraw status bar */
701 p_ptr->redraw |= (PR_STATUS);
703 /* Nothing to notice */
704 if (!notice) return (FALSE);
707 if (disturb_state) disturb(0, 0);
709 /* Redraw the state */
710 p_ptr->redraw |= (PR_STATE);
720 * @brief 幻覚の継続時間をセットする / Set "p_ptr->image", notice observable changes
722 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
723 * @details Note that we must redraw the map when hallucination changes.
725 bool set_image(int v)
729 /* Hack -- Force good values */
730 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
732 if (p_ptr->is_dead) return FALSE;
738 set_tsuyoshi(0, TRUE);
741 msg_print(_("ワーオ!何もかも虹色に見える!", "Oh, wow! Everything looks so cosmic now!"));
744 if (p_ptr->concent) reset_concentration(TRUE);
746 p_ptr->counter = FALSE;
756 msg_print(_("やっとはっきりと物が見えるようになった。", "You can see clearly again."));
764 /* Redraw status bar */
765 p_ptr->redraw |= (PR_STATUS);
767 /* Nothing to notice */
768 if (!notice) return (FALSE);
771 if (disturb_state) disturb(0, 1);
774 p_ptr->redraw |= (PR_MAP);
776 /* Update the health bar */
777 p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH);
779 /* Update monsters */
780 p_ptr->update |= (PU_MONSTERS);
783 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
793 * @brief 加速の継続時間をセットする / Set "p_ptr->fast", notice observable changes
795 * @param do_dec 現在の継続時間より長い値のみ上書きする
796 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
798 bool set_fast(int v, bool do_dec)
802 /* Hack -- Force good values */
803 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
805 if (p_ptr->is_dead) return FALSE;
810 if (p_ptr->fast && !do_dec)
812 if (p_ptr->fast > v) return FALSE;
814 else if (!IS_FAST() && !p_ptr->lightspeed)
816 msg_print(_("素早く動けるようになった!", "You feel yourself moving much faster!"));
818 chg_virtue(V_PATIENCE, -1);
819 chg_virtue(V_DILIGENCE, 1);
826 if (p_ptr->fast && !p_ptr->lightspeed && !music_singing(MUSIC_SPEED) && !music_singing(MUSIC_SHERO))
828 msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
836 /* Nothing to notice */
837 if (!notice) return (FALSE);
840 if (disturb_state) disturb(0, 0);
842 /* Recalculate bonuses */
843 p_ptr->update |= (PU_BONUS);
853 * @brief 光速移動の継続時間をセットする / Set "p_ptr->lightspeed", notice observable changes
855 * @param do_dec 現在の継続時間より長い値のみ上書きする
856 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
858 bool set_lightspeed(int v, bool do_dec)
862 /* Hack -- Force good values */
863 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
865 if (p_ptr->is_dead) return FALSE;
867 if (p_ptr->wild_mode) v = 0;
872 if (p_ptr->lightspeed && !do_dec)
874 if (p_ptr->lightspeed > v) return FALSE;
876 else if (!p_ptr->lightspeed)
878 msg_print(_("非常に素早く動けるようになった!", "You feel yourself moving extremely faster!"));
880 chg_virtue(V_PATIENCE, -1);
881 chg_virtue(V_DILIGENCE, 1);
888 if (p_ptr->lightspeed)
890 msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
896 p_ptr->lightspeed = v;
898 /* Nothing to notice */
899 if (!notice) return (FALSE);
902 if (disturb_state) disturb(0, 0);
904 /* Recalculate bonuses */
905 p_ptr->update |= (PU_BONUS);
915 * @brief 減速の継続時間をセットする / Set "p_ptr->slow", notice observable changes
917 * @param do_dec 現在の継続時間より長い値のみ上書きする
918 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
920 bool set_slow(int v, bool do_dec)
924 /* Hack -- Force good values */
925 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
927 if (p_ptr->is_dead) return FALSE;
932 if (p_ptr->slow && !do_dec)
934 if (p_ptr->slow > v) return FALSE;
936 else if (!p_ptr->slow)
938 msg_print(_("体の動きが遅くなってしまった!", "You feel yourself moving slower!"));
948 msg_print(_("動きの遅さがなくなったようだ。", "You feel yourself speed up."));
956 /* Nothing to notice */
957 if (!notice) return (FALSE);
960 if (disturb_state) disturb(0, 0);
962 /* Recalculate bonuses */
963 p_ptr->update |= (PU_BONUS);
974 * @brief 肌石化の継続時間をセットする / Set "p_ptr->shield", notice observable changes
976 * @param do_dec 現在の継続時間より長い値のみ上書きする
977 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
979 bool set_shield(int v, bool do_dec)
983 /* Hack -- Force good values */
984 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
986 if (p_ptr->is_dead) return FALSE;
991 if (p_ptr->shield && !do_dec)
993 if (p_ptr->shield > v) return FALSE;
995 else if (!p_ptr->shield)
997 msg_print(_("肌が石になった。", "Your skin turns to stone."));
1007 msg_print(_("肌が元に戻った。", "Your skin returns to normal."));
1015 /* Redraw status bar */
1016 p_ptr->redraw |= (PR_STATUS);
1018 /* Nothing to notice */
1019 if (!notice) return (FALSE);
1022 if (disturb_state) disturb(0, 0);
1024 /* Recalculate bonuses */
1025 p_ptr->update |= (PU_BONUS);
1036 * @brief つぶれるの継続時間をセットする / Set "p_ptr->tsubureru", notice observable changes
1038 * @param do_dec 現在の継続時間より長い値のみ上書きする
1039 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1041 bool set_tsubureru(int v, bool do_dec)
1043 bool notice = FALSE;
1045 /* Hack -- Force good values */
1046 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1048 if (p_ptr->is_dead) return FALSE;
1053 if (p_ptr->tsubureru && !do_dec)
1055 if (p_ptr->tsubureru > v) return FALSE;
1057 else if (!p_ptr->tsubureru)
1059 msg_print(_("横に伸びた。", "Your body expands horizontally."));
1067 if (p_ptr->tsubureru)
1069 msg_print(_("もう横に伸びていない。", "Your body returns to normal."));
1075 p_ptr->tsubureru = v;
1077 /* Redraw status bar */
1078 p_ptr->redraw |= (PR_STATUS);
1080 /* Nothing to notice */
1081 if (!notice) return (FALSE);
1084 if (disturb_state) disturb(0, 0);
1086 /* Recalculate bonuses */
1087 p_ptr->update |= (PU_BONUS);
1098 * @brief 魔法の鎧の継続時間をセットする / Set "p_ptr->magicdef", notice observable changes
1100 * @param do_dec 現在の継続時間より長い値のみ上書きする
1101 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1103 bool set_magicdef(int v, bool do_dec)
1105 bool notice = FALSE;
1107 /* Hack -- Force good values */
1108 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1110 if (p_ptr->is_dead) return FALSE;
1115 if (p_ptr->magicdef && !do_dec)
1117 if (p_ptr->magicdef > v) return FALSE;
1119 else if (!p_ptr->magicdef)
1121 msg_print(_("魔法の防御力が増したような気がする。", "You feel more resistant to magic."));
1129 if (p_ptr->magicdef)
1131 msg_print(_("魔法の防御力が元に戻った。", "You feel less resistant to magic."));
1137 p_ptr->magicdef = v;
1139 /* Redraw status bar */
1140 p_ptr->redraw |= (PR_STATUS);
1142 /* Nothing to notice */
1143 if (!notice) return (FALSE);
1146 if (disturb_state) disturb(0, 0);
1148 /* Recalculate bonuses */
1149 p_ptr->update |= (PU_BONUS);
1159 * @brief 祝福の継続時間をセットする / Set "p_ptr->blessed", notice observable changes
1161 * @param do_dec 現在の継続時間より長い値のみ上書きする
1162 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1164 bool set_blessed(int v, bool do_dec)
1166 bool notice = FALSE;
1168 /* Hack -- Force good values */
1169 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1171 if (p_ptr->is_dead) return FALSE;
1176 if (p_ptr->blessed && !do_dec)
1178 if (p_ptr->blessed > v) return FALSE;
1180 else if (!IS_BLESSED())
1182 msg_print(_("高潔な気分になった!", "You feel righteous!"));
1190 if (p_ptr->blessed && !music_singing(MUSIC_BLESS))
1192 msg_print(_("高潔な気分が消え失せた。", "The prayer has expired."));
1200 /* Redraw status bar */
1201 p_ptr->redraw |= (PR_STATUS);
1203 /* Nothing to notice */
1204 if (!notice) return (FALSE);
1207 if (disturb_state) disturb(0, 0);
1209 /* Recalculate bonuses */
1210 p_ptr->update |= (PU_BONUS);
1221 * @brief 士気高揚の継続時間をセットする / Set "p_ptr->hero", notice observable changes
1223 * @param do_dec 現在の継続時間より長い値のみ上書きする
1224 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1226 bool set_hero(int v, bool do_dec)
1228 bool notice = FALSE;
1230 /* Hack -- Force good values */
1231 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1233 if (p_ptr->is_dead) return FALSE;
1238 if (p_ptr->hero && !do_dec)
1240 if (p_ptr->hero > v) return FALSE;
1242 else if (!IS_HERO())
1244 msg_print(_("ヒーローになった気がする!", "You feel like a hero!"));
1252 if (p_ptr->hero && !music_singing(MUSIC_HERO) && !music_singing(MUSIC_SHERO))
1254 msg_print(_("ヒーローの気分が消え失せた。", "The heroism wears off."));
1262 /* Redraw status bar */
1263 p_ptr->redraw |= (PR_STATUS);
1265 /* Nothing to notice */
1266 if (!notice) return (FALSE);
1269 if (disturb_state) disturb(0, 0);
1271 /* Recalculate bonuses */
1272 p_ptr->update |= (PU_BONUS);
1274 /* Recalculate hitpoints */
1275 p_ptr->update |= (PU_HP);
1285 * @brief 狂戦士化の継続時間をセットする / Set "p_ptr->shero", notice observable changes
1287 * @param do_dec 現在の継続時間より長い値のみ上書きする
1288 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1290 bool set_shero(int v, bool do_dec)
1292 bool notice = FALSE;
1294 /* Hack -- Force good values */
1295 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1297 if (p_ptr->is_dead) return FALSE;
1299 if (p_ptr->pclass == CLASS_BERSERKER) v = 1;
1303 if (p_ptr->shero && !do_dec)
1305 if (p_ptr->shero > v) return FALSE;
1307 else if (!p_ptr->shero)
1309 msg_print(_("殺戮マシーンになった気がする!", "You feel like a killing machine!"));
1319 msg_print(_("野蛮な気持ちが消え失せた。", "You feel less Berserk."));
1327 /* Redraw status bar */
1328 p_ptr->redraw |= (PR_STATUS);
1330 /* Nothing to notice */
1331 if (!notice) return (FALSE);
1334 if (disturb_state) disturb(0, 0);
1336 /* Recalculate bonuses */
1337 p_ptr->update |= (PU_BONUS);
1339 /* Recalculate hitpoints */
1340 p_ptr->update |= (PU_HP);
1350 * @brief 対邪悪結界の継続時間をセットする / Set "p_ptr->protevil", notice observable changes
1352 * @param do_dec 現在の継続時間より長い値のみ上書きする
1353 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1355 bool set_protevil(int v, bool do_dec)
1357 bool notice = FALSE;
1359 /* Hack -- Force good values */
1360 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1362 if (p_ptr->is_dead) return FALSE;
1367 if (p_ptr->protevil && !do_dec)
1369 if (p_ptr->protevil > v) return FALSE;
1371 else if (!p_ptr->protevil)
1373 msg_print(_("邪悪なる存在から守られているような感じがする!", "You feel safe from evil!"));
1381 if (p_ptr->protevil)
1383 msg_print(_("邪悪なる存在から守られている感じがなくなった。", "You no longer feel safe from evil."));
1389 p_ptr->protevil = v;
1391 /* Redraw status bar */
1392 p_ptr->redraw |= (PR_STATUS);
1394 /* Nothing to notice */
1395 if (!notice) return (FALSE);
1398 if (disturb_state) disturb(0, 0);
1408 * @brief 幽体化の継続時間をセットする / Set "p_ptr->wraith_form", notice observable changes
1410 * @param do_dec 現在の継続時間より長い値のみ上書きする
1411 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1413 bool set_wraith_form(int v, bool do_dec)
1415 bool notice = FALSE;
1417 /* Hack -- Force good values */
1418 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1420 if (p_ptr->is_dead) return FALSE;
1425 if (p_ptr->wraith_form && !do_dec)
1427 if (p_ptr->wraith_form > v) return FALSE;
1429 else if (!p_ptr->wraith_form)
1431 msg_print(_("物質界を離れて幽鬼のような存在になった!", "You leave the physical world and turn into a wraith-being!"));
1433 chg_virtue(V_UNLIFE, 3);
1434 chg_virtue(V_HONOUR, -2);
1435 chg_virtue(V_SACRIFICE, -2);
1436 chg_virtue(V_VALOUR, -5);
1439 p_ptr->redraw |= (PR_MAP);
1441 /* Update monsters */
1442 p_ptr->update |= (PU_MONSTERS);
1445 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1452 if (p_ptr->wraith_form)
1454 msg_print(_("不透明になった感じがする。", "You feel opaque."));
1458 p_ptr->redraw |= (PR_MAP);
1460 /* Update monsters */
1461 p_ptr->update |= (PU_MONSTERS);
1464 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1469 p_ptr->wraith_form = v;
1471 /* Redraw status bar */
1472 p_ptr->redraw |= (PR_STATUS);
1474 /* Nothing to notice */
1475 if (!notice) return (FALSE);
1478 if (disturb_state) disturb(0, 0);
1480 /* Recalculate bonuses */
1481 p_ptr->update |= (PU_BONUS);
1492 * @brief 無傷球の継続時間をセットする / Set "p_ptr->invuln", notice observable changes
1494 * @param do_dec 現在の継続時間より長い値のみ上書きする
1495 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1497 bool set_invuln(int v, bool do_dec)
1499 bool notice = FALSE;
1501 /* Hack -- Force good values */
1502 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1504 if (p_ptr->is_dead) return FALSE;
1509 if (p_ptr->invuln && !do_dec)
1511 if (p_ptr->invuln > v) return FALSE;
1513 else if (!IS_INVULN())
1515 msg_print(_("無敵だ!", "Invulnerability!"));
1518 chg_virtue(V_UNLIFE, -2);
1519 chg_virtue(V_HONOUR, -2);
1520 chg_virtue(V_SACRIFICE, -3);
1521 chg_virtue(V_VALOUR, -5);
1524 p_ptr->redraw |= (PR_MAP);
1526 /* Update monsters */
1527 p_ptr->update |= (PU_MONSTERS);
1530 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1537 if (p_ptr->invuln && !music_singing(MUSIC_INVULN))
1539 msg_print(_("無敵ではなくなった。", "The invulnerability wears off."));
1543 p_ptr->redraw |= (PR_MAP);
1545 /* Update monsters */
1546 p_ptr->update |= (PU_MONSTERS);
1549 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1551 p_ptr->energy_need += ENERGY_NEED();
1558 /* Redraw status bar */
1559 p_ptr->redraw |= (PR_STATUS);
1561 /* Nothing to notice */
1562 if (!notice) return (FALSE);
1565 if (disturb_state) disturb(0, 0);
1567 /* Recalculate bonuses */
1568 p_ptr->update |= (PU_BONUS);
1578 * @brief 時限ESPの継続時間をセットする / Set "p_ptr->tim_esp", notice observable changes
1580 * @param do_dec 現在の継続時間より長い値のみ上書きする
1581 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1583 bool set_tim_esp(int v, bool do_dec)
1585 bool notice = FALSE;
1587 /* Hack -- Force good values */
1588 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1590 if (p_ptr->is_dead) return FALSE;
1595 if (p_ptr->tim_esp && !do_dec)
1597 if (p_ptr->tim_esp > v) return FALSE;
1599 else if (!IS_TIM_ESP())
1601 msg_print(_("意識が広がった気がする!", "You feel your consciousness expand!"));
1609 if (p_ptr->tim_esp && !music_singing(MUSIC_MIND))
1611 msg_print(_("意識は元に戻った。", "Your consciousness contracts again."));
1619 /* Redraw status bar */
1620 p_ptr->redraw |= (PR_STATUS);
1622 /* Nothing to notice */
1623 if (!notice) return (FALSE);
1626 if (disturb_state) disturb(0, 0);
1628 /* Recalculate bonuses */
1629 p_ptr->update |= (PU_BONUS);
1631 /* Update the monsters */
1632 p_ptr->update |= (PU_MONSTERS);
1642 * @brief 時限透明視の継続時間をセットする / Set "p_ptr->tim_invis", notice observable changes
1644 * @param do_dec 現在の継続時間より長い値のみ上書きする
1645 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1647 bool set_tim_invis(int v, bool do_dec)
1649 bool notice = FALSE;
1651 /* Hack -- Force good values */
1652 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1654 if (p_ptr->is_dead) return FALSE;
1659 if (p_ptr->tim_invis && !do_dec)
1661 if (p_ptr->tim_invis > v) return FALSE;
1663 else if (!p_ptr->tim_invis)
1665 msg_print(_("目が非常に敏感になった気がする!", "Your eyes feel very sensitive!"));
1673 if (p_ptr->tim_invis)
1675 msg_print(_("目の敏感さがなくなったようだ。", "Your eyes feel less sensitive."));
1681 p_ptr->tim_invis = v;
1683 /* Redraw status bar */
1684 p_ptr->redraw |= (PR_STATUS);
1686 /* Nothing to notice */
1687 if (!notice) return (FALSE);
1690 if (disturb_state) disturb(0, 0);
1692 /* Recalculate bonuses */
1693 p_ptr->update |= (PU_BONUS);
1695 /* Update the monsters */
1696 p_ptr->update |= (PU_MONSTERS);
1706 * @brief 時限赤外線視力の継続時間をセットする / Set "p_ptr->tim_infra", notice observable changes
1708 * @param do_dec 現在の継続時間より長い値のみ上書きする
1709 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1711 bool set_tim_infra(int v, bool do_dec)
1713 bool notice = FALSE;
1715 /* Hack -- Force good values */
1716 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1718 if (p_ptr->is_dead) return FALSE;
1723 if (p_ptr->tim_infra && !do_dec)
1725 if (p_ptr->tim_infra > v) return FALSE;
1727 else if (!p_ptr->tim_infra)
1729 msg_print(_("目がランランと輝き始めた!", "Your eyes begin to tingle!"));
1737 if (p_ptr->tim_infra)
1739 msg_print(_("目の輝きがなくなった。", "Your eyes stop tingling."));
1745 p_ptr->tim_infra = v;
1747 /* Redraw status bar */
1748 p_ptr->redraw |= (PR_STATUS);
1750 /* Nothing to notice */
1751 if (!notice) return (FALSE);
1754 if (disturb_state) disturb(0, 0);
1756 /* Recalculate bonuses */
1757 p_ptr->update |= (PU_BONUS);
1759 /* Update the monsters */
1760 p_ptr->update |= (PU_MONSTERS);
1770 * @brief 時限急回復の継続時間をセットする / Set "p_ptr->tim_regen", notice observable changes
1772 * @param do_dec 現在の継続時間より長い値のみ上書きする
1773 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1775 bool set_tim_regen(int v, bool do_dec)
1777 bool notice = FALSE;
1779 /* Hack -- Force good values */
1780 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1782 if (p_ptr->is_dead) return FALSE;
1787 if (p_ptr->tim_regen && !do_dec)
1789 if (p_ptr->tim_regen > v) return FALSE;
1791 else if (!p_ptr->tim_regen)
1793 msg_print(_("回復力が上がった!", "You feel yourself regenerating quickly!"));
1801 if (p_ptr->tim_regen)
1803 msg_print(_("素早く回復する感じがなくなった。", "You feel yourself regenerating slowly."));
1809 p_ptr->tim_regen = v;
1811 /* Redraw status bar */
1812 p_ptr->redraw |= (PR_STATUS);
1814 /* Nothing to notice */
1815 if (!notice) return (FALSE);
1818 if (disturb_state) disturb(0, 0);
1820 /* Recalculate bonuses */
1821 p_ptr->update |= (PU_BONUS);
1831 * @brief 隠密の歌の継続時間をセットする / Set "p_ptr->tim_stealth", notice observable changes
1833 * @param do_dec 現在の継続時間より長い値のみ上書きする
1834 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1836 bool set_tim_stealth(int v, bool do_dec)
1838 bool notice = FALSE;
1840 /* Hack -- Force good values */
1841 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1843 if (p_ptr->is_dead) return FALSE;
1848 if (p_ptr->tim_stealth && !do_dec)
1850 if (p_ptr->tim_stealth > v) return FALSE;
1852 else if (!IS_TIM_STEALTH())
1854 msg_print(_("足音が小さくなった!", "You begin to walk silently!"));
1862 if (p_ptr->tim_stealth && !music_singing(MUSIC_STEALTH))
1864 msg_print(_("足音が大きくなった。", "You no longer walk silently."));
1870 p_ptr->tim_stealth = v;
1872 /* Redraw status bar */
1873 p_ptr->redraw |= (PR_STATUS);
1875 /* Nothing to notice */
1876 if (!notice) return (FALSE);
1879 if (disturb_state) disturb(0, 0);
1881 /* Recalculate bonuses */
1882 p_ptr->update |= (PU_BONUS);
1892 * @brief 超隠密状態をセットする
1893 * @param set TRUEならば超隠密状態になる。
1894 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1896 bool set_superstealth(bool set)
1898 bool notice = FALSE;
1900 if (p_ptr->is_dead) return FALSE;
1905 if (!(p_ptr->special_defense & NINJA_S_STEALTH))
1907 if (cave[p_ptr->y][p_ptr->x].info & CAVE_MNLT)
1909 msg_print(_("敵の目から薄い影の中に覆い隠された。", "You are mantled in weak shadow from ordinary eyes."));
1910 p_ptr->monlite = p_ptr->old_monlite = TRUE;
1914 msg_print(_("敵の目から影の中に覆い隠された!", "You are mantled in shadow from ordinary eyes!"));
1915 p_ptr->monlite = p_ptr->old_monlite = FALSE;
1921 p_ptr->special_defense |= NINJA_S_STEALTH;
1928 if (p_ptr->special_defense & NINJA_S_STEALTH)
1930 msg_print(_("再び敵の目にさらされるようになった。", "You are exposed to common sight once more."));
1934 p_ptr->special_defense &= ~(NINJA_S_STEALTH);
1938 /* Nothing to notice */
1939 if (!notice) return (FALSE);
1941 /* Redraw status bar */
1942 p_ptr->redraw |= (PR_STATUS);
1945 if (disturb_state) disturb(0, 0);
1952 * @brief 一時的浮遊の継続時間をセットする / Set "p_ptr->tim_levitation", notice observable changes
1954 * @param do_dec 現在の継続時間より長い値のみ上書きする
1955 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1957 bool set_tim_levitation(int v, bool do_dec)
1959 bool notice = FALSE;
1961 /* Hack -- Force good values */
1962 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1964 if (p_ptr->is_dead) return FALSE;
1969 if (p_ptr->tim_levitation && !do_dec)
1971 if (p_ptr->tim_levitation > v) return FALSE;
1973 else if (!p_ptr->tim_levitation)
1975 msg_print(_("体が宙に浮き始めた。", "You begin to fly!"));
1983 if (p_ptr->tim_levitation)
1985 msg_print(_("もう宙に浮かべなくなった。", "You stop flying."));
1991 p_ptr->tim_levitation = v;
1993 /* Redraw status bar */
1994 p_ptr->redraw |= (PR_STATUS);
1996 /* Nothing to notice */
1997 if (!notice) return (FALSE);
2000 if (disturb_state) disturb(0, 0);
2002 /* Recalculate bonuses */
2003 p_ptr->update |= (PU_BONUS);
2013 * @brief 一時的闘気のオーラの継続時間をセットする / Set "p_ptr->tim_sh_touki", notice observable changes
2015 * @param do_dec 現在の継続時間より長い値のみ上書きする
2016 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2018 bool set_tim_sh_touki(int v, bool do_dec)
2020 bool notice = FALSE;
2022 /* Hack -- Force good values */
2023 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2025 if (p_ptr->is_dead) return FALSE;
2030 if (p_ptr->tim_sh_touki && !do_dec)
2032 if (p_ptr->tim_sh_touki > v) return FALSE;
2034 else if (!p_ptr->tim_sh_touki)
2036 msg_print(_("体が闘気のオーラで覆われた。", "You have enveloped by the aura of the Force!"));
2044 if (p_ptr->tim_sh_touki)
2046 msg_print(_("闘気が消えた。", "Aura of the Force disappeared."));
2052 p_ptr->tim_sh_touki = v;
2054 /* Redraw status bar */
2055 p_ptr->redraw |= (PR_STATUS);
2057 /* Nothing to notice */
2058 if (!notice) return (FALSE);
2061 if (disturb_state) disturb(0, 0);
2071 * @brief 一時的火炎のオーラの継続時間をセットする / Set "p_ptr->tim_sh_fire", notice observable changes
2073 * @param do_dec 現在の継続時間より長い値のみ上書きする
2074 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2076 bool set_tim_sh_fire(int v, bool do_dec)
2078 bool notice = FALSE;
2080 /* Hack -- Force good values */
2081 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2083 if (p_ptr->is_dead) return FALSE;
2088 if (p_ptr->tim_sh_fire && !do_dec)
2090 if (p_ptr->tim_sh_fire > v) return FALSE;
2092 else if (!p_ptr->tim_sh_fire)
2094 msg_print(_("体が炎のオーラで覆われた。", "You have enveloped by fiery aura!"));
2102 if (p_ptr->tim_sh_fire)
2104 msg_print(_("炎のオーラが消えた。", "Fiery aura disappeared."));
2110 p_ptr->tim_sh_fire = v;
2112 /* Redraw status bar */
2113 p_ptr->redraw |= (PR_STATUS);
2115 /* Nothing to notice */
2116 if (!notice) return (FALSE);
2119 if (disturb_state) disturb(0, 0);
2121 /* Recalculate bonuses */
2122 p_ptr->update |= (PU_BONUS);
2132 * @brief 一時的聖なるのオーラの継続時間をセットする / Set "p_ptr->tim_sh_holy", notice observable changes
2134 * @param do_dec 現在の継続時間より長い値のみ上書きする
2135 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2137 bool set_tim_sh_holy(int v, bool do_dec)
2139 bool notice = FALSE;
2141 /* Hack -- Force good values */
2142 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2144 if (p_ptr->is_dead) return FALSE;
2149 if (p_ptr->tim_sh_holy && !do_dec)
2151 if (p_ptr->tim_sh_holy > v) return FALSE;
2153 else if (!p_ptr->tim_sh_holy)
2155 msg_print(_("体が聖なるオーラで覆われた。", "You have enveloped by holy aura!"));
2163 if (p_ptr->tim_sh_holy)
2165 msg_print(_("聖なるオーラが消えた。", "Holy aura disappeared."));
2171 p_ptr->tim_sh_holy = v;
2173 /* Redraw status bar */
2174 p_ptr->redraw |= (PR_STATUS);
2176 /* Nothing to notice */
2177 if (!notice) return (FALSE);
2180 if (disturb_state) disturb(0, 0);
2182 /* Recalculate bonuses */
2183 p_ptr->update |= (PU_BONUS);
2193 * @brief 目には目をの残り時間をセットする / Set "p_ptr->tim_eyeeye", notice observable changes
2195 * @param do_dec 現在の継続時間より長い値のみ上書きする
2196 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2198 bool set_tim_eyeeye(int v, bool do_dec)
2200 bool notice = FALSE;
2202 /* Hack -- Force good values */
2203 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2205 if (p_ptr->is_dead) return FALSE;
2210 if (p_ptr->tim_eyeeye && !do_dec)
2212 if (p_ptr->tim_eyeeye > v) return FALSE;
2214 else if (!p_ptr->tim_eyeeye)
2216 msg_print(_("法の守り手になった気がした!", "You feel like a keeper of commandments!"));
2224 if (p_ptr->tim_eyeeye)
2226 msg_print(_("懲罰を執行することができなくなった。", "You no longer feel like a keeper."));
2232 p_ptr->tim_eyeeye = v;
2234 /* Redraw status bar */
2235 p_ptr->redraw |= (PR_STATUS);
2237 /* Nothing to notice */
2238 if (!notice) return (FALSE);
2241 if (disturb_state) disturb(0, 0);
2243 /* Recalculate bonuses */
2244 p_ptr->update |= (PU_BONUS);
2255 * @brief 一時的魔法防御の継続時間をセットする / Set "p_ptr->resist_magic", notice observable changes
2257 * @param do_dec 現在の継続時間より長い値のみ上書きする
2258 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2260 bool set_resist_magic(int v, bool do_dec)
2262 bool notice = FALSE;
2264 /* Hack -- Force good values */
2265 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2267 if (p_ptr->is_dead) return FALSE;
2272 if (p_ptr->resist_magic && !do_dec)
2274 if (p_ptr->resist_magic > v) return FALSE;
2276 else if (!p_ptr->resist_magic)
2278 msg_print(_("魔法への耐性がついた。", "You have been protected from magic!"));
2286 if (p_ptr->resist_magic)
2288 msg_print(_("魔法に弱くなった。", "You are no longer protected from magic."));
2294 p_ptr->resist_magic = v;
2296 /* Redraw status bar */
2297 p_ptr->redraw |= (PR_STATUS);
2299 /* Nothing to notice */
2300 if (!notice) return (FALSE);
2303 if (disturb_state) disturb(0, 0);
2305 /* Recalculate bonuses */
2306 p_ptr->update |= (PU_BONUS);
2316 * @brief 一時的反射の継続時間をセットする / Set "p_ptr->tim_reflect", notice observable changes
2318 * @param do_dec 現在の継続時間より長い値のみ上書きする
2319 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2321 bool set_tim_reflect(int v, bool do_dec)
2323 bool notice = FALSE;
2325 /* Hack -- Force good values */
2326 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2328 if (p_ptr->is_dead) return FALSE;
2333 if (p_ptr->tim_reflect && !do_dec)
2335 if (p_ptr->tim_reflect > v) return FALSE;
2337 else if (!p_ptr->tim_reflect)
2339 msg_print(_("体の表面が滑かになった気がする。", "Your body becames smooth."));
2347 if (p_ptr->tim_reflect)
2349 msg_print(_("体の表面が滑かでなくなった。", "Your body is no longer smooth."));
2355 p_ptr->tim_reflect = v;
2357 /* Redraw status bar */
2358 p_ptr->redraw |= (PR_STATUS);
2360 /* Nothing to notice */
2361 if (!notice) return (FALSE);
2364 if (disturb_state) disturb(0, 0);
2366 /* Recalculate bonuses */
2367 p_ptr->update |= (PU_BONUS);
2378 * Set "p_ptr->multishadow", notice observable changes
2380 bool set_multishadow(int v, bool do_dec)
2382 bool notice = FALSE;
2384 /* Hack -- Force good values */
2385 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2387 if (p_ptr->is_dead) return FALSE;
2392 if (p_ptr->multishadow && !do_dec)
2394 if (p_ptr->multishadow > v) return FALSE;
2396 else if (!p_ptr->multishadow)
2398 msg_print(_("あなたの周りに幻影が生まれた。", "Your Shadow enveloped you."));
2406 if (p_ptr->multishadow)
2408 msg_print(_("幻影が消えた。", "Your Shadow disappears."));
2414 p_ptr->multishadow = v;
2416 /* Redraw status bar */
2417 p_ptr->redraw |= (PR_STATUS);
2419 /* Nothing to notice */
2420 if (!notice) return (FALSE);
2423 if (disturb_state) disturb(0, 0);
2425 /* Recalculate bonuses */
2426 p_ptr->update |= (PU_BONUS);
2436 * @brief 一時的破片のオーラの継続時間をセットする / Set "p_ptr->dustrobe", notice observable changes
2438 * @param do_dec 現在の継続時間より長い値のみ上書きする
2439 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2441 bool set_dustrobe(int v, bool do_dec)
2443 bool notice = FALSE;
2445 /* Hack -- Force good values */
2446 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2448 if (p_ptr->is_dead) return FALSE;
2453 if (p_ptr->dustrobe && !do_dec)
2455 if (p_ptr->dustrobe > v) return FALSE;
2457 else if (!p_ptr->dustrobe)
2459 msg_print(_("体が鏡のオーラで覆われた。", "You were enveloped by mirror shards."));
2467 if (p_ptr->dustrobe)
2469 msg_print(_("鏡のオーラが消えた。", "The mirror shards disappear."));
2475 p_ptr->dustrobe = v;
2477 /* Redraw status bar */
2478 p_ptr->redraw |= (PR_STATUS);
2480 /* Nothing to notice */
2481 if (!notice) return (FALSE);
2484 if (disturb_state) disturb(0, 0);
2486 /* Recalculate bonuses */
2487 p_ptr->update |= (PU_BONUS);
2497 * @brief 一時的壁抜けの継続時間をセットする / Set "p_ptr->kabenuke", notice observable changes
2499 * @param do_dec 現在の継続時間より長い値のみ上書きする
2500 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2502 bool set_kabenuke(int v, bool do_dec)
2504 bool notice = FALSE;
2506 /* Hack -- Force good values */
2507 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2509 if (p_ptr->is_dead) return FALSE;
2514 if (p_ptr->kabenuke && !do_dec)
2516 if (p_ptr->kabenuke > v) return FALSE;
2518 else if (!p_ptr->kabenuke)
2520 msg_print(_("体が半物質の状態になった。", "You became ethereal form."));
2528 if (p_ptr->kabenuke)
2530 msg_print(_("体が物質化した。", "You are no longer in an ethereal form."));
2536 p_ptr->kabenuke = v;
2538 /* Redraw status bar */
2539 p_ptr->redraw |= (PR_STATUS);
2541 /* Nothing to notice */
2542 if (!notice) return (FALSE);
2545 if (disturb_state) disturb(0, 0);
2547 /* Recalculate bonuses */
2548 p_ptr->update |= (PU_BONUS);
2558 * @brief オクレ兄さんの継続時間をセットする / Set "p_ptr->tsuyoshi", notice observable changes
2560 * @param do_dec 現在の継続時間より長い値のみ上書きする
2561 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2563 bool set_tsuyoshi(int v, bool do_dec)
2565 bool notice = FALSE;
2567 /* Hack -- Force good values */
2568 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2570 if (p_ptr->is_dead) return FALSE;
2575 if (p_ptr->tsuyoshi && !do_dec)
2577 if (p_ptr->tsuyoshi > v) return FALSE;
2579 else if (!p_ptr->tsuyoshi)
2581 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
2583 chg_virtue(V_VITALITY, 2);
2590 if (p_ptr->tsuyoshi)
2592 msg_print(_("肉体が急速にしぼんでいった。", "Your body had quickly shriveled."));
2594 (void)dec_stat(A_CON, 20, TRUE);
2595 (void)dec_stat(A_STR, 20, TRUE);
2598 chg_virtue(V_VITALITY, -3);
2603 p_ptr->tsuyoshi = v;
2605 /* Redraw status bar */
2606 p_ptr->redraw |= (PR_STATUS);
2608 /* Nothing to notice */
2609 if (!notice) return (FALSE);
2612 if (disturb_state) disturb(0, 0);
2614 /* Recalculate bonuses */
2615 p_ptr->update |= (PU_BONUS);
2617 /* Recalculate hitpoints */
2618 p_ptr->update |= (PU_HP);
2628 * @brief 一時的元素スレイの継続時間をセットする / Set a temporary elemental brand. Clear all other brands. Print status messages. -LM-
2629 * @param attack_type スレイのタイプID
2631 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2633 bool set_ele_attack(u32b attack_type, int v)
2635 /* Hack -- Force good values */
2636 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2638 /* Clear all elemental attacks (only one is allowed at a time). */
2639 if ((p_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
2641 p_ptr->special_attack &= ~(ATTACK_ACID);
2642 msg_print(_("酸で攻撃できなくなった。", "Your temporary acidic brand fades away."));
2644 if ((p_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
2646 p_ptr->special_attack &= ~(ATTACK_ELEC);
2647 msg_print(_("電撃で攻撃できなくなった。", "Your temporary electrical brand fades away."));
2649 if ((p_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
2651 p_ptr->special_attack &= ~(ATTACK_FIRE);
2652 msg_print(_("火炎で攻撃できなくなった。", "Your temporary fiery brand fades away."));
2654 if ((p_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
2656 p_ptr->special_attack &= ~(ATTACK_COLD);
2657 msg_print(_("冷気で攻撃できなくなった。", "Your temporary frost brand fades away."));
2659 if ((p_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
2661 p_ptr->special_attack &= ~(ATTACK_POIS);
2662 msg_print(_("毒で攻撃できなくなった。", "Your temporary poison brand fades away."));
2665 if ((v) && (attack_type))
2667 /* Set attack type. */
2668 p_ptr->special_attack |= (attack_type);
2671 p_ptr->ele_attack = v;
2675 msg_format("%sで攻撃できるようになった!",
2676 ((attack_type == ATTACK_ACID) ? "酸" :
2677 ((attack_type == ATTACK_ELEC) ? "電撃" :
2678 ((attack_type == ATTACK_FIRE) ? "火炎" :
2679 ((attack_type == ATTACK_COLD) ? "冷気" :
2680 ((attack_type == ATTACK_POIS) ? "毒" :
2683 msg_format("For a while, the blows you deal will %s",
2684 ((attack_type == ATTACK_ACID) ? "melt with acid!" :
2685 ((attack_type == ATTACK_ELEC) ? "shock your foes!" :
2686 ((attack_type == ATTACK_FIRE) ? "burn with fire!" :
2687 ((attack_type == ATTACK_COLD) ? "chill to the bone!" :
2688 ((attack_type == ATTACK_POIS) ? "poison your enemies!" :
2689 "do nothing special."))))));
2694 if (disturb_state) disturb(0, 0);
2696 /* Redraw status bar */
2697 p_ptr->redraw |= (PR_STATUS);
2699 p_ptr->update |= (PU_BONUS);
2708 * @brief 一時的元素免疫の継続時間をセットする / Set a temporary elemental brand. Clear all other brands. Print status messages. -LM-
2709 * @param immune_type 免疫のタイプID
2711 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2713 bool set_ele_immune(u32b immune_type, int v)
2715 /* Hack -- Force good values */
2716 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2718 /* Clear all elemental attacks (only one is allowed at a time). */
2719 if ((p_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
2721 p_ptr->special_defense &= ~(DEFENSE_ACID);
2722 msg_print(_("酸の攻撃で傷つけられるようになった。。", "You are no longer immune to acid."));
2724 if ((p_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
2726 p_ptr->special_defense &= ~(DEFENSE_ELEC);
2727 msg_print(_("電撃の攻撃で傷つけられるようになった。。", "You are no longer immune to electricity."));
2729 if ((p_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
2731 p_ptr->special_defense &= ~(DEFENSE_FIRE);
2732 msg_print(_("火炎の攻撃で傷つけられるようになった。。", "You are no longer immune to fire."));
2734 if ((p_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
2736 p_ptr->special_defense &= ~(DEFENSE_COLD);
2737 msg_print(_("冷気の攻撃で傷つけられるようになった。。", "You are no longer immune to cold."));
2739 if ((p_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
2741 p_ptr->special_defense &= ~(DEFENSE_POIS);
2742 msg_print(_("毒の攻撃で傷つけられるようになった。。", "You are no longer immune to poison."));
2745 if ((v) && (immune_type))
2747 /* Set attack type. */
2748 p_ptr->special_defense |= (immune_type);
2751 p_ptr->ele_immune = v;
2755 msg_format("%sの攻撃を受けつけなくなった!",
2756 ((immune_type == DEFENSE_ACID) ? "酸" :
2757 ((immune_type == DEFENSE_ELEC) ? "電撃" :
2758 ((immune_type == DEFENSE_FIRE) ? "火炎" :
2759 ((immune_type == DEFENSE_COLD) ? "冷気" :
2760 ((immune_type == DEFENSE_POIS) ? "毒" :
2763 msg_format("For a while, You are immune to %s",
2764 ((immune_type == DEFENSE_ACID) ? "acid!" :
2765 ((immune_type == DEFENSE_ELEC) ? "electricity!" :
2766 ((immune_type == DEFENSE_FIRE) ? "fire!" :
2767 ((immune_type == DEFENSE_COLD) ? "cold!" :
2768 ((immune_type == DEFENSE_POIS) ? "poison!" :
2769 "do nothing special."))))));
2774 if (disturb_state) disturb(0, 0);
2776 /* Redraw status bar */
2777 p_ptr->redraw |= (PR_STATUS);
2779 p_ptr->update |= (PU_BONUS);
2788 * @brief 一時的酸耐性の継続時間をセットする / Set "p_ptr->oppose_acid", notice observable changes
2790 * @param do_dec 現在の継続時間より長い値のみ上書きする
2791 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2793 bool set_oppose_acid(int v, bool do_dec)
2795 bool notice = FALSE;
2797 /* Hack -- Force good values */
2798 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2800 if (p_ptr->is_dead) return FALSE;
2805 if (p_ptr->oppose_acid && !do_dec)
2807 if (p_ptr->oppose_acid > v) return FALSE;
2809 else if (!IS_OPPOSE_ACID())
2811 msg_print(_("酸への耐性がついた気がする!", "You feel resistant to acid!"));
2819 if (p_ptr->oppose_acid && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2821 msg_print(_("酸への耐性が薄れた気がする。", "You feel less resistant to acid."));
2827 p_ptr->oppose_acid = v;
2829 /* Nothing to notice */
2830 if (!notice) return (FALSE);
2832 /* Redraw status bar */
2833 p_ptr->redraw |= (PR_STATUS);
2836 if (disturb_state) disturb(0, 0);
2846 * @brief 一時的電撃耐性の継続時間をセットする / Set "p_ptr->oppose_elec", notice observable changes
2848 * @param do_dec 現在の継続時間より長い値のみ上書きする
2849 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2851 bool set_oppose_elec(int v, bool do_dec)
2853 bool notice = FALSE;
2855 /* Hack -- Force good values */
2856 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2858 if (p_ptr->is_dead) return FALSE;
2863 if (p_ptr->oppose_elec && !do_dec)
2865 if (p_ptr->oppose_elec > v) return FALSE;
2867 else if (!IS_OPPOSE_ELEC())
2869 msg_print(_("電撃への耐性がついた気がする!", "You feel resistant to electricity!"));
2877 if (p_ptr->oppose_elec && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2879 msg_print(_("電撃への耐性が薄れた気がする。", "You feel less resistant to electricity."));
2885 p_ptr->oppose_elec = v;
2887 /* Nothing to notice */
2888 if (!notice) return (FALSE);
2890 /* Redraw status bar */
2891 p_ptr->redraw |= (PR_STATUS);
2894 if (disturb_state) disturb(0, 0);
2904 * @brief 一時的火炎耐性の継続時間をセットする / Set "p_ptr->oppose_fire", notice observable changes
2906 * @param do_dec 現在の継続時間より長い値のみ上書きする
2907 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2909 bool set_oppose_fire(int v, bool do_dec)
2911 bool notice = FALSE;
2913 /* Hack -- Force good values */
2914 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2916 if (p_ptr->is_dead) return FALSE;
2918 if ((prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
2922 if (p_ptr->oppose_fire && !do_dec)
2924 if (p_ptr->oppose_fire > v) return FALSE;
2926 else if (!IS_OPPOSE_FIRE())
2928 msg_print(_("火への耐性がついた気がする!", "You feel resistant to fire!"));
2936 if (p_ptr->oppose_fire && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2938 msg_print(_("火への耐性が薄れた気がする。", "You feel less resistant to fire."));
2944 p_ptr->oppose_fire = v;
2946 /* Nothing to notice */
2947 if (!notice) return (FALSE);
2949 /* Redraw status bar */
2950 p_ptr->redraw |= (PR_STATUS);
2953 if (disturb_state) disturb(0, 0);
2963 * @brief 一時的冷気耐性の継続時間をセットする / Set "p_ptr->oppose_cold", notice observable changes
2965 * @param do_dec 現在の継続時間より長い値のみ上書きする
2966 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2968 bool set_oppose_cold(int v, bool do_dec)
2970 bool notice = FALSE;
2972 /* Hack -- Force good values */
2973 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2975 if (p_ptr->is_dead) return FALSE;
2980 if (p_ptr->oppose_cold && !do_dec)
2982 if (p_ptr->oppose_cold > v) return FALSE;
2984 else if (!IS_OPPOSE_COLD())
2986 msg_print(_("冷気への耐性がついた気がする!", "You feel resistant to cold!"));
2994 if (p_ptr->oppose_cold && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2996 msg_print(_("冷気への耐性が薄れた気がする。", "You feel less resistant to cold."));
3002 p_ptr->oppose_cold = v;
3004 /* Nothing to notice */
3005 if (!notice) return (FALSE);
3007 /* Redraw status bar */
3008 p_ptr->redraw |= (PR_STATUS);
3011 if (disturb_state) disturb(0, 0);
3021 * @brief 一時的毒耐性の継続時間をセットする / Set "p_ptr->oppose_pois", notice observable changes
3023 * @param do_dec 現在の継続時間より長い値のみ上書きする
3024 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
3026 bool set_oppose_pois(int v, bool do_dec)
3028 bool notice = FALSE;
3030 /* Hack -- Force good values */
3031 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3033 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) v = 1;
3034 if (p_ptr->is_dead) return FALSE;
3039 if (p_ptr->oppose_pois && !do_dec)
3041 if (p_ptr->oppose_pois > v) return FALSE;
3043 else if (!IS_OPPOSE_POIS())
3045 msg_print(_("毒への耐性がついた気がする!", "You feel resistant to poison!"));
3053 if (p_ptr->oppose_pois && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3055 msg_print(_("毒への耐性が薄れた気がする。", "You feel less resistant to poison."));
3061 p_ptr->oppose_pois = v;
3063 /* Nothing to notice */
3064 if (!notice) return (FALSE);
3066 /* Redraw status bar */
3067 p_ptr->redraw |= (PR_STATUS);
3070 if (disturb_state) disturb(0, 0);
3080 * @brief 朦朧の継続時間をセットする / Set "p_ptr->stun", notice observable changes
3082 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
3084 * Note the special code to only notice "range" changes.
3086 bool set_stun(int v)
3088 int old_aux, new_aux;
3089 bool notice = FALSE;
3092 /* Hack -- Force good values */
3093 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3095 if (p_ptr->is_dead) return FALSE;
3097 if (prace_is_(RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
3100 if (p_ptr->stun > 100)
3106 else if (p_ptr->stun > 50)
3112 else if (p_ptr->stun > 0)
3148 if (new_aux > old_aux)
3150 /* Describe the state */
3154 case 1: msg_print(_("意識がもうろうとしてきた。", "You have been stunned.")); break;
3157 case 2: msg_print(_("意識がひどくもうろうとしてきた。", "You have been heavily stunned.")); break;
3160 case 3: msg_print(_("頭がクラクラして意識が遠のいてきた。", "You have been knocked out.")); break;
3163 if (randint1(1000) < v || one_in_(16))
3165 msg_print(_("割れるような頭痛がする。", "A vicious blow hits your head."));
3169 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3170 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3172 else if (one_in_(2))
3174 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3178 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3181 if (p_ptr->special_defense & KATA_MASK)
3183 msg_print(_("型が崩れた。", "Your posture gets loose."));
3184 p_ptr->special_defense &= ~(KATA_MASK);
3185 p_ptr->update |= (PU_BONUS);
3186 p_ptr->update |= (PU_MONSTERS);
3187 p_ptr->redraw |= (PR_STATE);
3188 p_ptr->redraw |= (PR_STATUS);
3189 p_ptr->action = ACTION_NONE;
3193 if (p_ptr->concent) reset_concentration(TRUE);
3196 if (hex_spelling_any()) stop_hex_spell_all();
3203 else if (new_aux < old_aux)
3205 /* Describe the state */
3210 msg_print(_("やっと朦朧状態から回復した。", "You are no longer stunned."));
3212 if (disturb_state) disturb(0, 0);
3224 if (!notice) return (FALSE);
3227 if (disturb_state) disturb(0, 0);
3229 /* Recalculate bonuses */
3230 p_ptr->update |= (PU_BONUS);
3232 /* Redraw the "stun" */
3233 p_ptr->redraw |= (PR_STUN);
3244 * @brief 出血の継続時間をセットする / Set "p_ptr->cut", notice observable changes
3246 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
3248 * Note the special code to only notice "range" changes.
3252 int old_aux, new_aux;
3253 bool notice = FALSE;
3255 /* Hack -- Force good values */
3256 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3258 if (p_ptr->is_dead) return FALSE;
3260 if ((p_ptr->prace == RACE_GOLEM ||
3261 p_ptr->prace == RACE_SKELETON ||
3262 p_ptr->prace == RACE_SPECTRE ||
3263 (p_ptr->prace == RACE_ZOMBIE && p_ptr->lev > 11)) &&
3268 if (p_ptr->cut > 1000)
3274 else if (p_ptr->cut > 200)
3280 else if (p_ptr->cut > 100)
3286 else if (p_ptr->cut > 50)
3292 else if (p_ptr->cut > 25)
3298 else if (p_ptr->cut > 10)
3304 else if (p_ptr->cut > 0)
3364 if (new_aux > old_aux)
3366 /* Describe the state */
3370 case 1: msg_print(_("かすり傷を負ってしまった。", "You have been given a graze.")); break;
3373 case 2: msg_print(_("軽い傷を負ってしまった。", "You have been given a light cut.")); break;
3376 case 3: msg_print(_("ひどい傷を負ってしまった。", "You have been given a bad cut.")); break;
3379 case 4: msg_print(_("大変な傷を負ってしまった。", "You have been given a nasty cut.")); break;
3382 case 5: msg_print(_("重大な傷を負ってしまった。", "You have been given a severe cut.")); break;
3385 case 6: msg_print(_("ひどい深手を負ってしまった。", "You have been given a deep gash.")); break;
3388 case 7: msg_print(_("致命的な傷を負ってしまった。", "You have been given a mortal wound.")); break;
3394 if (randint1(1000) < v || one_in_(16))
3396 if (!p_ptr->sustain_chr)
3398 msg_print(_("ひどい傷跡が残ってしまった。", "You have been horribly scarred."));
3405 else if (new_aux < old_aux)
3407 /* Describe the state */
3412 msg_format(_("やっと%s。", "You are no longer bleeding."), p_ptr->prace == RACE_ANDROID ? "怪我が直った" : "出血が止まった");
3414 if (disturb_state) disturb(0, 0);
3426 if (!notice) return (FALSE);
3429 if (disturb_state) disturb(0, 0);
3431 /* Recalculate bonuses */
3432 p_ptr->update |= (PU_BONUS);
3434 /* Redraw the "cut" */
3435 p_ptr->redraw |= (PR_CUT);
3445 * @brief 空腹状態をセットする / Set "p_ptr->food", notice observable changes
3447 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
3449 * Set "", notice observable changes\n
3451 * The "p_ptr->food" variable can get as large as 20000, allowing the
3452 * addition of the most "filling" item, Elvish Waybread, which adds
3453 * 7500 food units, without overflowing the 32767 maximum limit.\n
3455 * Perhaps we should disturb the player with various messages,
3456 * especially messages about hunger status changes. XXX XXX XXX\n
3458 * Digestion of food is handled in "dungeon.c", in which, normally,
3459 * the player digests about 20 food units per 100 game turns, more
3460 * when "fast", more when "regenerating", less with "slow digestion",
3461 * but when the player is "gorged", he digests 100 food units per 10
3462 * game turns, or a full 1000 food units per 100 game turns.\n
3464 * Note that the player's speed is reduced by 10 units while gorged,
3465 * so if the player eats a single food ration (5000 food units) when
3466 * full (15000 food units), he will be gorged for (5000/100)*10 = 500
3467 * game turns, or 500/(100/5) = 25 player turns (if nothing else is
3468 * affecting the player speed).\n
3470 bool set_food(int v)
3472 int old_aux, new_aux;
3474 bool notice = FALSE;
3476 /* Hack -- Force good values */
3477 v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
3479 /* Fainting / Starving */
3480 if (p_ptr->food < PY_FOOD_FAINT)
3486 else if (p_ptr->food < PY_FOOD_WEAK)
3492 else if (p_ptr->food < PY_FOOD_ALERT)
3498 else if (p_ptr->food < PY_FOOD_FULL)
3504 else if (p_ptr->food < PY_FOOD_MAX)
3515 /* Fainting / Starving */
3516 if (v < PY_FOOD_FAINT)
3522 else if (v < PY_FOOD_WEAK)
3528 else if (v < PY_FOOD_ALERT)
3534 else if (v < PY_FOOD_FULL)
3540 else if (v < PY_FOOD_MAX)
3551 if (old_aux < 1 && new_aux > 0)
3552 chg_virtue(V_PATIENCE, 2);
3553 else if (old_aux < 3 && (old_aux != new_aux))
3554 chg_virtue(V_PATIENCE, 1);
3556 chg_virtue(V_TEMPERANCE, 1);
3558 chg_virtue(V_TEMPERANCE, -1);
3561 if (new_aux > old_aux)
3563 /* Describe the state */
3567 case 1: msg_print(_("まだ空腹で倒れそうだ。", "You are still weak.")); break;
3570 case 2: msg_print(_("まだ空腹だ。", "You are still hungry.")); break;
3573 case 3: msg_print(_("空腹感がおさまった。", "You are no longer hungry.")); break;
3576 case 4: msg_print(_("満腹だ!", "You are full!")); break;
3580 msg_print(_("食べ過ぎだ!", "You have gorged yourself!"));
3581 chg_virtue(V_HARMONY, -1);
3582 chg_virtue(V_PATIENCE, -1);
3583 chg_virtue(V_TEMPERANCE, -2);
3593 else if (new_aux < old_aux)
3595 /* Describe the state */
3598 /* Fainting / Starving */
3599 case 0: msg_print(_("あまりにも空腹で気を失ってしまった!", "You are getting faint from hunger!")); break;
3602 case 1: msg_print(_("お腹が空いて倒れそうだ。", "You are getting weak from hunger!")); break;
3605 case 2: msg_print(_("お腹が空いてきた。", "You are getting hungry.")); break;
3608 case 3: msg_print(_("満腹感がなくなった。", "You are no longer full.")); break;
3611 case 4: msg_print(_("やっとお腹がきつくなくなった。", "You are no longer gorged.")); break;
3614 if (p_ptr->wild_mode && (new_aux < 2))
3626 /* Nothing to notice */
3627 if (!notice) return (FALSE);
3630 if (disturb_state) disturb(0, 0);
3632 /* Recalculate bonuses */
3633 p_ptr->update |= (PU_BONUS);
3636 p_ptr->redraw |= (PR_HUNGER);
3646 * @brief プレイヤーの基本能力値を増加させる / Increases a stat by one randomized level -RAK-
3647 * @param stat 上昇させるステータスID
3648 * @return 実際に上昇した場合TRUEを返す。
3650 * Note that this function (used by stat potions) now restores\n
3651 * the stat BEFORE increasing it.\n
3653 bool inc_stat(int stat)
3657 /* Then augment the current/max stat */
3658 value = p_ptr->stat_cur[stat];
3660 /* Cannot go above 18/100 */
3661 if (value < p_ptr->stat_max_max[stat])
3663 /* Gain one (sometimes two) points */
3666 gain = ((randint0(100) < 75) ? 1 : 2);
3670 /* Gain 1/6 to 1/3 of distance to 18/100 */
3671 else if (value < (p_ptr->stat_max_max[stat]-2))
3673 /* Approximate gain value */
3674 gain = (((p_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
3677 if (gain < 1) gain = 1;
3679 /* Apply the bonus */
3680 value += randint1(gain) + gain / 2;
3683 if (value > (p_ptr->stat_max_max[stat]-1)) value = p_ptr->stat_max_max[stat]-1;
3686 /* Gain one point at a time */
3692 /* Save the new value */
3693 p_ptr->stat_cur[stat] = value;
3695 /* Bring up the maximum too */
3696 if (value > p_ptr->stat_max[stat])
3698 p_ptr->stat_max[stat] = value;
3701 /* Recalculate bonuses */
3702 p_ptr->update |= (PU_BONUS);
3708 /* Nothing to gain */
3713 * @brief プレイヤーの基本能力値を減少させる / Decreases a stat by an amount indended to vary from 0 to 100 percent.
3714 * @param stat 減少させるステータスID
3715 * @param amount 減少させる基本量
3716 * @param permanent TRUEならば現在の最大値を減少させる
3717 * @return 実際に減少した場合TRUEを返す。
3720 * Amount could be a little higher in extreme cases to mangle very high\n
3721 * stats from massive assaults. -CWS\n
3723 * Note that "permanent" means that the *given* amount is permanent,\n
3724 * not that the new value becomes permanent. This may not work exactly\n
3725 * as expected, due to "weirdness" in the algorithm, but in general,\n
3726 * if your stat is already drained, the "max" value will not drop all\n
3727 * the way down to the "cur" value.\n
3729 bool dec_stat(int stat, int amount, int permanent)
3731 int cur, max, loss, same, res = FALSE;
3734 /* Acquire current value */
3735 cur = p_ptr->stat_cur[stat];
3736 max = p_ptr->stat_max[stat];
3738 /* Note when the values are identical */
3739 same = (cur == max);
3741 /* Damage "current" value */
3744 /* Handle "low" values */
3747 if (amount > 90) cur--;
3748 if (amount > 50) cur--;
3749 if (amount > 20) cur--;
3753 /* Handle "high" values */
3756 /* Hack -- Decrement by a random amount between one-quarter */
3757 /* and one-half of the stat bonus times the percentage, with a */
3758 /* minimum damage of half the percentage. -CWS */
3759 loss = (((cur-18) / 2 + 1) / 2 + 1);
3762 if (loss < 1) loss = 1;
3764 /* Randomize the loss */
3765 loss = ((randint1(loss) + loss) * amount) / 100;
3768 if (loss < amount/2) loss = amount/2;
3770 /* Lose some points */
3773 /* Hack -- Only reduce stat to 17 sometimes */
3774 if (cur < 18) cur = (amount <= 20) ? 18 : 17;
3777 /* Prevent illegal values */
3778 if (cur < 3) cur = 3;
3780 /* Something happened */
3781 if (cur != p_ptr->stat_cur[stat]) res = TRUE;
3784 /* Damage "max" value */
3785 if (permanent && (max > 3))
3787 chg_virtue(V_SACRIFICE, 1);
3788 if (stat == A_WIS || stat == A_INT)
3789 chg_virtue(V_ENLIGHTEN, -2);
3791 /* Handle "low" values */
3794 if (amount > 90) max--;
3795 if (amount > 50) max--;
3796 if (amount > 20) max--;
3800 /* Handle "high" values */
3803 /* Hack -- Decrement by a random amount between one-quarter */
3804 /* and one-half of the stat bonus times the percentage, with a */
3805 /* minimum damage of half the percentage. -CWS */
3806 loss = (((max-18) / 2 + 1) / 2 + 1);
3807 loss = ((randint1(loss) + loss) * amount) / 100;
3808 if (loss < amount/2) loss = amount/2;
3810 /* Lose some points */
3813 /* Hack -- Only reduce stat to 17 sometimes */
3814 if (max < 18) max = (amount <= 20) ? 18 : 17;
3817 /* Hack -- keep it clean */
3818 if (same || (max < cur)) max = cur;
3820 /* Something happened */
3821 if (max != p_ptr->stat_max[stat]) res = TRUE;
3827 /* Actually set the stat to its new value. */
3828 p_ptr->stat_cur[stat] = cur;
3829 p_ptr->stat_max[stat] = max;
3831 /* Redisplay the stats later */
3832 p_ptr->redraw |= (PR_STATS);
3834 /* Recalculate bonuses */
3835 p_ptr->update |= (PU_BONUS);
3844 * @brief プレイヤーの基本能力値を回復させる / Restore a stat. Return TRUE only if this actually makes a difference.
3845 * @param stat 回復ステータスID
3846 * @return 実際に回復した場合TRUEを返す。
3848 bool res_stat(int stat)
3850 /* Restore if needed */
3851 if (p_ptr->stat_cur[stat] != p_ptr->stat_max[stat])
3854 p_ptr->stat_cur[stat] = p_ptr->stat_max[stat];
3856 /* Recalculate bonuses */
3857 p_ptr->update |= (PU_BONUS);
3859 /* Redisplay the stats later */
3860 p_ptr->redraw |= (PR_STATS);
3866 /* Nothing to restore */
3872 * Increase players hit points, notice effects
3874 bool hp_player(int num)
3877 vir = virtue_number(V_VITALITY);
3880 num = num * (p_ptr->virtues[vir - 1] + 1250) / 1250;
3882 /* Healing needed */
3883 if (p_ptr->chp < p_ptr->mhp)
3885 if ((num > 0) && (p_ptr->chp < (p_ptr->mhp/3)))
3886 chg_virtue(V_TEMPERANCE, 1);
3887 /* Gain hitpoints */
3890 /* Enforce maximum */
3891 if (p_ptr->chp >= p_ptr->mhp)
3893 p_ptr->chp = p_ptr->mhp;
3894 p_ptr->chp_frac = 0;
3898 p_ptr->redraw |= (PR_HP);
3901 p_ptr->window |= (PW_PLAYER);
3906 msg_print(_("少し気分が良くなった。", "You feel a little better."));
3912 msg_print(_("気分が良くなった。", "You feel better."));
3918 msg_print(_("とても気分が良くなった。", "You feel much better."));
3924 msg_print(_("ひじょうに気分が良くなった。", "You feel very good."));
3937 * Array of stat "descriptions"
3939 static cptr desc_stat_pos[] =
3944 _("器用に", "dextrous"),
3945 _("健康に", "healthy"),
3951 * Array of stat "descriptions"
3953 static cptr desc_stat_neg[] =
3977 bool do_dec_stat(int stat)
3981 /* Access the "sustain" */
3984 case A_STR: if (p_ptr->sustain_str) sust = TRUE; break;
3985 case A_INT: if (p_ptr->sustain_int) sust = TRUE; break;
3986 case A_WIS: if (p_ptr->sustain_wis) sust = TRUE; break;
3987 case A_DEX: if (p_ptr->sustain_dex) sust = TRUE; break;
3988 case A_CON: if (p_ptr->sustain_con) sust = TRUE; break;
3989 case A_CHR: if (p_ptr->sustain_chr) sust = TRUE; break;
3993 if (sust && (!ironman_nightmare || randint0(13)))
3996 msg_format(_("%sなった気がしたが、すぐに元に戻った。", "You feel %s for a moment, but the feeling passes."),
3997 desc_stat_neg[stat]);
4003 /* Attempt to reduce the stat */
4004 if (dec_stat(stat, 10, (ironman_nightmare && !randint0(13))))
4007 msg_format(_("ひどく%sなった気がする。", "You feel very %s."), desc_stat_neg[stat]);
4013 /* Nothing obvious */
4019 * Restore lost "points" in a stat
4021 bool do_res_stat(int stat)
4023 /* Attempt to increase */
4027 msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]);
4033 /* Nothing obvious */
4039 * Gain a "point" in a stat
4041 bool do_inc_stat(int stat)
4045 /* Restore strength */
4046 res = res_stat(stat);
4048 /* Attempt to increase */
4053 chg_virtue(V_ENLIGHTEN, 1);
4054 chg_virtue(V_FAITH, 1);
4056 else if (stat == A_INT)
4058 chg_virtue(V_KNOWLEDGE, 1);
4059 chg_virtue(V_ENLIGHTEN, 1);
4061 else if (stat == A_CON)
4062 chg_virtue(V_VITALITY, 1);
4065 msg_format(_("ワーオ!とても%sなった!", "Wow! You feel very %s!"), desc_stat_pos[stat]);
4071 /* Restoration worked */
4075 msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]);
4081 /* Nothing obvious */
4087 * Restores any drained experience
4089 bool restore_level(void)
4091 /* Restore experience */
4092 if (p_ptr->exp < p_ptr->max_exp)
4095 msg_print(_("経験値が戻ってきた気がする。", "You feel your experience returning."));
4097 /* Restore the experience */
4098 p_ptr->exp = p_ptr->max_exp;
4100 /* Check the experience */
4115 bool lose_all_info(void)
4119 chg_virtue(V_KNOWLEDGE, -5);
4120 chg_virtue(V_ENLIGHTEN, -5);
4122 /* Forget info about objects */
4123 for (i = 0; i < INVEN_TOTAL; i++)
4125 object_type *o_ptr = &inventory[i];
4127 /* Skip non-objects */
4128 if (!o_ptr->k_idx) continue;
4130 /* Allow "protection" by the MENTAL flag */
4131 if (o_ptr->ident & (IDENT_MENTAL)) continue;
4133 /* Remove "default inscriptions" */
4134 o_ptr->feeling = FEEL_NONE;
4136 /* Hack -- Clear the "empty" flag */
4137 o_ptr->ident &= ~(IDENT_EMPTY);
4139 /* Hack -- Clear the "known" flag */
4140 o_ptr->ident &= ~(IDENT_KNOWN);
4142 /* Hack -- Clear the "felt" flag */
4143 o_ptr->ident &= ~(IDENT_SENSE);
4146 /* Recalculate bonuses */
4147 p_ptr->update |= (PU_BONUS);
4149 /* Combine / Reorder the pack (later) */
4150 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
4153 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
4155 /* Mega-Hack -- Forget the map */
4163 void do_poly_wounds(void)
4165 /* Changed to always provide at least _some_ healing */
4166 s16b wounds = p_ptr->cut;
4167 s16b hit_p = (p_ptr->mhp - p_ptr->chp);
4168 s16b change = damroll(p_ptr->lev, 5);
4169 bool Nasty_effect = one_in_(5);
4171 if (!(wounds || hit_p || Nasty_effect)) return;
4173 msg_print(_("傷がより軽いものに変化した。", "Your wounds are polymorphed into less serious ones."));
4177 msg_print(_("新たな傷ができた!", "A new wound was created!"));
4178 take_hit(DAMAGE_LOSELIFE, change / 2, _("変化した傷", "a polymorphed wound"), -1);
4183 set_cut(p_ptr->cut - (change / 2));
4189 * Change player race
4191 void change_race(int new_race, cptr effect_msg)
4193 cptr title = race_info[new_race].title;
4194 int old_race = p_ptr->prace;
4197 msg_format("あなたは%s%sに変化した!", effect_msg, title);
4199 msg_format("You turn into %s %s%s!", (!effect_msg[0] && is_a_vowel(title[0]) ? "an" : "a"), effect_msg, title);
4202 chg_virtue(V_CHANCE, 2);
4204 if (p_ptr->prace < 32)
4206 p_ptr->old_race1 |= 1L << p_ptr->prace;
4210 p_ptr->old_race2 |= 1L << (p_ptr->prace-32);
4212 p_ptr->prace = new_race;
4213 rp_ptr = &race_info[p_ptr->prace];
4215 /* Experience factor */
4216 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
4219 * The speed bonus of Klackons and Sprites are disabled
4220 * and the experience penalty is decreased.
4222 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)))
4223 p_ptr->expfact -= 15;
4225 /* Get character's height and weight */
4226 get_height_weight();
4229 if (p_ptr->pclass == CLASS_SORCERER)
4230 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
4232 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
4234 do_cmd_rerate(FALSE);
4236 /* The experience level may be modified */
4239 p_ptr->redraw |= (PR_BASIC);
4241 p_ptr->update |= (PU_BONUS);
4245 /* Load an autopick preference file */
4246 if (old_race != p_ptr->prace) autopick_load_pref(FALSE);
4248 /* Player's graphic tile may change */
4249 lite_spot(p_ptr->y, p_ptr->x);
4253 void do_poly_self(void)
4255 int power = p_ptr->lev;
4257 msg_print(_("あなたは変化の訪れを感じた...", "You feel a change coming over you..."));
4258 chg_virtue(V_CHANCE, 1);
4260 if ((power > randint0(20)) && one_in_(3) && (p_ptr->prace != RACE_ANDROID))
4262 char effect_msg[80] = "";
4265 /* Some form of racial polymorph... */
4268 if ((power > randint0(5)) && one_in_(4))
4273 if (p_ptr->psex == SEX_MALE)
4275 p_ptr->psex = SEX_FEMALE;
4276 sp_ptr = &sex_info[p_ptr->psex];
4277 sprintf(effect_msg, _("女性の", "female "));
4281 p_ptr->psex = SEX_MALE;
4282 sp_ptr = &sex_info[p_ptr->psex];
4283 sprintf(effect_msg, _("男性の", "male "));
4287 if ((power > randint0(30)) && one_in_(5))
4291 /* Harmful deformity */
4298 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
4304 /* Deformities are discriminated against! */
4305 (void)dec_stat(A_CHR, randint1(6), TRUE);
4310 sprintf(tmp_msg,_("%s", "%s "),effect_msg);
4311 sprintf(effect_msg,_("奇形の%s", "deformed %s "),tmp_msg);
4315 sprintf(effect_msg,_("奇形の", "deformed "));
4319 while ((power > randint0(20)) && one_in_(10))
4321 /* Polymorph into a less mutated form */
4324 if (!lose_mutation(0))
4325 msg_print(_("奇妙なくらい普通になった気がする。", "You feel oddly normal."));
4330 new_race = randint0(MAX_RACES);
4332 while ((new_race == p_ptr->prace) || (new_race == RACE_ANDROID));
4334 change_race(new_race, effect_msg);
4337 if ((power > randint0(30)) && one_in_(6))
4343 msg_format(_("%sの構成が変化した!", "Your internal organs are rearranged!"), p_ptr->prace == RACE_ANDROID ? "機械" : "内臓");
4347 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
4352 msg_print(_("現在の姿で生きていくのは困難なようだ!", "You find living difficult in your present form!"));
4353 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), _("致命的な突然変異", "a lethal mutation"), -1);
4359 if ((power > randint0(20)) && one_in_(4))
4364 do_cmd_rerate(FALSE);
4367 while ((power > randint0(15)) && one_in_(3))
4370 (void)gain_random_mutation(0);
4373 if (power > randint0(5))
4379 /* Note: earlier deductions may have left power < 0 already. */
4389 * Decreases players hit points and sets death flag if necessary
4391 * XXX XXX XXX Invulnerability needs to be changed into a "shield"
4393 * XXX XXX XXX Hack -- this function allows the user to save (or quit)
4394 * the game when he dies, since the "You die." message is shown before
4395 * setting the player to "dead".
4398 int take_hit(int damage_type, int damage, cptr hit_from, int monspell)
4400 int old_chp = p_ptr->chp;
4402 char death_message[1024];
4405 int warning = (p_ptr->mhp * hitpoint_warn / 10);
4408 if (p_ptr->is_dead) return 0;
4410 if (p_ptr->sutemi) damage *= 2;
4411 if (p_ptr->special_defense & KATA_IAI) damage += (damage + 4) / 5;
4413 if (easy_band) damage = (damage+1)/2;
4415 if (damage_type != DAMAGE_USELIFE)
4425 if (monspell >= 0) learn_spell(monspell);
4427 /* Mega-Hack -- Apply "invulnerability" */
4428 if ((damage_type != DAMAGE_USELIFE) && (damage_type != DAMAGE_LOSELIFE))
4430 if (IS_INVULN() && (damage < 9000))
4432 if (damage_type == DAMAGE_FORCE)
4434 msg_print(_("バリアが切り裂かれた!", "The attack cuts your shield of invulnerability open!"));
4436 else if (one_in_(PENETRATE_INVULNERABILITY))
4438 msg_print(_("無敵のバリアを破って攻撃された!", "The attack penetrates your shield of invulnerability!"));
4446 if (CHECK_MULTISHADOW())
4448 if (damage_type == DAMAGE_FORCE)
4450 msg_print(_("幻影もろとも体が切り裂かれた!", "The attack hits Shadow together with you!"));
4452 else if (damage_type == DAMAGE_ATTACK)
4454 msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, you are unharmed!"));
4459 if (p_ptr->wraith_form)
4461 if (damage_type == DAMAGE_FORCE)
4463 msg_print(_("半物質の体が切り裂かれた!", "The attack cuts through your ethereal body!"));
4468 if ((damage == 0) && one_in_(2)) damage = 1;
4472 if (p_ptr->special_defense & KATA_MUSOU)
4475 if ((damage == 0) && one_in_(2)) damage = 1;
4477 } /* not if LOSELIFE USELIFE */
4479 /* Hurt the player */
4480 p_ptr->chp -= damage;
4481 if(damage_type == DAMAGE_GENO && p_ptr->chp < 0)
4483 damage += p_ptr->chp;
4487 /* Display the hitpoints */
4488 p_ptr->redraw |= (PR_HP);
4491 p_ptr->window |= (PW_PLAYER);
4493 if (damage_type != DAMAGE_GENO && p_ptr->chp == 0)
4495 chg_virtue(V_SACRIFICE, 1);
4496 chg_virtue(V_CHANCE, 2);
4502 bool android = (p_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
4504 #ifdef JP /* 死んだ時に強制終了して死を回避できなくしてみた by Habu */
4506 if(!save_player()) msg_print("セーブ失敗!");
4512 chg_virtue(V_SACRIFICE, 10);
4517 p_ptr->leaving = TRUE;
4520 p_ptr->is_dead = TRUE;
4522 if (p_ptr->inside_arena)
4524 cptr m_name = r_name+r_info[arena_info[p_ptr->arena_number].r_idx].name;
4525 msg_format(_("あなたは%sの前に敗れ去った。", "You are beaten by %s."), m_name);
4527 if (record_arena) do_cmd_write_nikki(NIKKI_ARENA, -1 - p_ptr->arena_number, m_name);
4531 int q_idx = quest_number(dun_level);
4532 bool seppuku = streq(hit_from, "Seppuku");
4533 bool winning_seppuku = p_ptr->total_winner && seppuku;
4535 play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_GAMEOVER);
4538 /* Make screen dump */
4539 screen_dump = make_screen_dump();
4542 /* Note cause of death */
4545 strcpy(p_ptr->died_from, hit_from);
4547 if (!winning_seppuku) strcpy(p_ptr->died_from, "切腹");
4554 sprintf(dummy, "%s%s%s", !p_ptr->paralyzed ? "" : p_ptr->free_act ? "彫像状態で" : "麻痺状態で", p_ptr->image ? "幻覚に歪んだ" : "", hit_from);
4556 sprintf(dummy, "%s%s", hit_from, !p_ptr->paralyzed ? "" : " while helpless");
4558 my_strcpy(p_ptr->died_from, dummy, sizeof p_ptr->died_from);
4561 /* No longer a winner */
4562 p_ptr->total_winner = FALSE;
4564 if (winning_seppuku)
4566 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, _("勝利の後切腹した。", "did Seppuku after the winning."));
4572 if (p_ptr->inside_arena)
4573 strcpy(buf,_("アリーナ", "in the Arena"));
4574 else if (!dun_level)
4575 strcpy(buf,_("地上", "on the surface"));
4576 else if (q_idx && (is_fixed_quest_idx(q_idx) &&
4577 !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
4578 strcpy(buf,_("クエスト", "in a quest"));
4580 sprintf(buf,_("%d階", "level %d"), dun_level);
4582 sprintf(tmp, _("%sで%sに殺された。", "killed by %s %s."), buf, p_ptr->died_from);
4583 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
4586 do_cmd_write_nikki(NIKKI_GAMESTART, 1, _("-------- ゲームオーバー --------", "-------- Game Over --------"));
4587 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, "\n\n\n\n");
4591 if (get_check_strict(_("画面を保存しますか?", "Dump the screen? "), CHECK_NO_HISTORY))
4593 do_cmd_save_screen();
4598 /* Initialize "last message" buffer */
4599 if (p_ptr->last_message) string_free(p_ptr->last_message);
4600 p_ptr->last_message = NULL;
4602 /* Hack -- Note death */
4606 msg_format("あなたは%sました。", android ? "壊れ" : "死に");
4608 msg_print(android ? "You are broken." : "You die.");
4615 if (winning_seppuku)
4617 get_rnd_line(_("seppuku_j.txt", "seppuku.txt"), 0, death_message);
4621 get_rnd_line(_("death_j.txt", "death.txt"), 0, death_message);
4627 while (!get_string(winning_seppuku ? "辞世の句: " : "断末魔の叫び: ", death_message, 1024)) ;
4629 while (!get_string("Last word: ", death_message, 1024)) ;
4632 while (winning_seppuku && !get_check_strict(_("よろしいですか?", "Are you sure? "), CHECK_NO_HISTORY));
4634 if (death_message[0] == '\0')
4637 strcpy(death_message, format("あなたは%sました。", android ? "壊れ" : "死に"));
4639 strcpy(death_message, android ? "You are broken." : "You die.");
4642 else p_ptr->last_message = string_make(death_message);
4645 if (winning_seppuku)
4650 int msg_pos_x[9] = { 5, 7, 9, 12, 14, 17, 19, 21, 23};
4651 int msg_pos_y[9] = { 3, 4, 5, 4, 5, 4, 5, 6, 4};
4658 for (i = 0; i < 40; i++)
4659 Term_putstr(randint0(w / 2) * 2, randint0(h), 2, TERM_VIOLET, "υ");
4661 str = death_message;
4662 if (strncmp(str, "「", 2) == 0) str += 2;
4664 str2 = my_strstr(str, "」");
4665 if (str2 != NULL) *str2 = '\0';
4670 str2 = my_strstr(str, " ");
4671 if (str2 == NULL) len = strlen(str);
4672 else len = str2 - str;
4676 Term_putstr_v(w * 3 / 4 - 2 - msg_pos_x[i] * 2, msg_pos_y[i], len,
4678 if (str2 == NULL) break;
4682 if (*str == 0) break;
4686 Term_putstr(w-1, h-1, 1, TERM_WHITE, " ");
4690 /* Make screen dump */
4691 screen_dump = make_screen_dump();
4694 /* Wait a key press */
4699 msg_print(death_message);
4709 /* Hitpoint warning */
4710 if (p_ptr->chp < warning)
4712 /* Hack -- bell on first notice */
4713 if (old_chp > warning) bell();
4717 if (record_danger && (old_chp > warning))
4719 if (p_ptr->image && damage_type == DAMAGE_ATTACK)
4720 hit_from = _("何か", "something");
4722 sprintf(tmp,_("%sによってピンチに陥った。", "A critical situation because of %s."),hit_from);
4723 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
4728 /* stop auto_more even if DAMAGE_USELIFE */
4733 msg_print(_("*** 警告:低ヒット・ポイント! ***", "*** LOW HITPOINT WARNING! ***"));
4737 if (p_ptr->wild_mode && !p_ptr->leaving && (p_ptr->chp < MAX(warning, p_ptr->mhp/5)))
4748 void gain_exp_64(s32b amount, u32b amount_frac)
4750 if (p_ptr->is_dead) return;
4752 if (p_ptr->prace == RACE_ANDROID) return;
4754 /* Gain some experience */
4755 s64b_add(&(p_ptr->exp), &(p_ptr->exp_frac), amount, amount_frac);
4757 /* Slowly recover from experience drainage */
4758 if (p_ptr->exp < p_ptr->max_exp)
4760 /* Gain max experience (20%) (was 10%) */
4761 p_ptr->max_exp += amount / 5;
4764 /* Check Experience */
4772 void gain_exp(s32b amount)
4774 gain_exp_64(amount, 0L);
4778 void calc_android_exp(void)
4782 if (p_ptr->is_dead) return;
4784 if (p_ptr->prace != RACE_ANDROID) return;
4786 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
4788 object_type *o_ptr = &inventory[i];
4790 object_type *q_ptr = &forge;
4792 int level = MAX(k_info[o_ptr->k_idx].level - 8, 1);
4794 if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue;
4795 if (!o_ptr->k_idx) continue;
4797 /* Wipe the object */
4800 object_copy(q_ptr, o_ptr);
4801 q_ptr->discount = 0;
4802 q_ptr->curse_flags = 0L;
4804 if (object_is_fixed_artifact(o_ptr))
4806 level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
4807 level += MIN(20, a_info[o_ptr->name1].rarity/(a_info[o_ptr->name1].gen_flags & TRG_INSTA_ART ? 10 : 3));
4809 else if (object_is_ego(o_ptr))
4811 level += MAX(3, (e_info[o_ptr->name2].rating - 5)/2);
4813 else if (o_ptr->art_name)
4815 s32b total_flags = flag_cost(o_ptr, o_ptr->pval);
4818 if (!object_is_weapon_ammo(o_ptr))
4821 if (total_flags < 15000) fake_level = 10;
4822 else if (total_flags < 35000) fake_level = 25;
4823 else fake_level = 40;
4828 if (total_flags < 20000) fake_level = 10;
4829 else if (total_flags < 45000) fake_level = 25;
4830 else fake_level = 40;
4833 level = MAX(level, (level + MAX(fake_level - 8, 5)) / 2 + 3);
4836 value = object_value_real(q_ptr);
4838 if (value <= 0) continue;
4839 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (p_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
4840 if (value > 5000000L) value = 5000000L;
4841 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
4843 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr) ||
4844 (o_ptr->tval == TV_DRAG_ARMOR) ||
4845 ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) ||
4846 ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) ||
4847 ((o_ptr->tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)) ||
4848 ((o_ptr->tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) ||
4849 ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE)))
4851 if (level > 65) level = 35 + (level - 65) / 5;
4852 else if (level > 35) level = 25 + (level - 35) / 3;
4853 else if (level > 15) level = 15 + (level - 15) / 2;
4854 exp = MIN(100000L, value) * level * level / 2;
4855 if (value > 100000L)
4856 exp += (value - 100000L) * level * level / 8;
4860 exp = MIN(100000L, value) * level;
4861 if (value > 100000L)
4862 exp += (value - 100000L) * level / 4;
4864 if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (buki_motteruka(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
4865 else total_exp += exp / 16;
4866 if (i == INVEN_BODY) total_exp += exp / 32;
4868 p_ptr->exp = p_ptr->max_exp = total_exp;
4870 /* Check Experience */
4878 void lose_exp(s32b amount)
4880 if (p_ptr->prace == RACE_ANDROID) return;
4882 /* Never drop below zero experience */
4883 if (amount > p_ptr->exp) amount = p_ptr->exp;
4885 /* Lose some experience */
4886 p_ptr->exp -= amount;
4888 /* Check Experience */
4895 * If resisted to draining, return FALSE
4897 bool drain_exp(s32b drain, s32b slip, int hold_exp_prob)
4899 /* Androids and their mimics are never drained */
4900 if (p_ptr->prace == RACE_ANDROID) return FALSE;
4902 if (p_ptr->hold_exp && (randint0(100) < hold_exp_prob))
4904 /* Hold experience */
4905 msg_print(_("しかし自己の経験値を守りきった!", "You keep hold of your experience!"));
4909 /* Hold experience failed */
4910 if (p_ptr->hold_exp)
4912 msg_print(_("経験値を少し吸い取られた気がする!", "You feel your experience slipping away!"));
4917 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away!"));
4925 bool set_ultimate_res(int v, bool do_dec)
4927 bool notice = FALSE;
4929 /* Hack -- Force good values */
4930 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
4932 if (p_ptr->is_dead) return FALSE;
4937 if (p_ptr->ult_res && !do_dec)
4939 if (p_ptr->ult_res > v) return FALSE;
4941 else if (!p_ptr->ult_res)
4943 msg_print(_("あらゆることに対して耐性がついた気がする!", "You feel resistant!"));
4953 msg_print(_("あらゆることに対する耐性が薄れた気がする。", "You feel less resistant"));
4961 /* Redraw status bar */
4962 p_ptr->redraw |= (PR_STATUS);
4964 /* Nothing to notice */
4965 if (!notice) return (FALSE);
4968 if (disturb_state) disturb(0, 0);
4970 /* Recalculate bonuses */
4971 p_ptr->update |= (PU_BONUS);
4980 bool set_tim_res_nether(int v, bool do_dec)
4982 bool notice = FALSE;
4984 /* Hack -- Force good values */
4985 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
4987 if (p_ptr->is_dead) return FALSE;
4992 if (p_ptr->tim_res_nether && !do_dec)
4994 if (p_ptr->tim_res_nether > v) return FALSE;
4996 else if (!p_ptr->tim_res_nether)
4998 msg_print(_("地獄の力に対して耐性がついた気がする!", "You feel nether resistant!"));
5006 if (p_ptr->tim_res_nether)
5008 msg_print(_("地獄の力に対する耐性が薄れた気がする。", "You feel less nether resistant"));
5014 p_ptr->tim_res_nether = v;
5016 /* Redraw status bar */
5017 p_ptr->redraw |= (PR_STATUS);
5019 /* Nothing to notice */
5020 if (!notice) return (FALSE);
5023 if (disturb_state) disturb(0, 0);
5025 /* Recalculate bonuses */
5026 p_ptr->update |= (PU_BONUS);
5035 bool set_tim_res_time(int v, bool do_dec)
5037 bool notice = FALSE;
5039 /* Hack -- Force good values */
5040 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5042 if (p_ptr->is_dead) return FALSE;
5047 if (p_ptr->tim_res_time && !do_dec)
5049 if (p_ptr->tim_res_time > v) return FALSE;
5051 else if (!p_ptr->tim_res_time)
5053 msg_print(_("時間逆転の力に対して耐性がついた気がする!", "You feel time resistant!"));
5061 if (p_ptr->tim_res_time)
5063 msg_print(_("時間逆転の力に対する耐性が薄れた気がする。", "You feel less time resistant"));
5069 p_ptr->tim_res_time = v;
5071 /* Redraw status bar */
5072 p_ptr->redraw |= (PR_STATUS);
5074 /* Nothing to notice */
5075 if (!notice) return (FALSE);
5078 if (disturb_state) disturb(0, 0);
5080 /* Recalculate bonuses */
5081 p_ptr->update |= (PU_BONUS);
5092 * Choose a warrior-mage elemental attack. -LM-
5094 bool choose_ele_attack(void)
5100 if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
5102 msg_format(_("武器を持たないと魔法剣は使えない。", "You cannot use temporary branding with no weapon."));
5109 num = (p_ptr->lev - 20) / 5;
5110 c_prt(TERM_RED, _(" a) 焼棄", " a) Fire Brand"), 2, 14);
5113 c_prt(TERM_L_WHITE,_(" b) 凍結", " b) Cold Brand"), 3, 14);
5118 c_prt(TERM_GREEN, _(" c) 毒殺", " c) Poison Brand"), 4, 14);
5123 c_prt(TERM_L_DARK, _(" d) 溶解", " d) Acid Brand"), 5, 14);
5128 c_prt(TERM_BLUE, _(" e) 電撃", " e) Elec Brand"), 6, 14);
5137 prt(_(" どの元素攻撃をしますか?", " Choose a temporary elemental brand "), 1, 14);
5141 if ((choice == 'a') || (choice == 'A'))
5142 set_ele_attack(ATTACK_FIRE, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5143 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
5144 set_ele_attack(ATTACK_COLD, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5145 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
5146 set_ele_attack(ATTACK_POIS, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5147 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
5148 set_ele_attack(ATTACK_ACID, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5149 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
5150 set_ele_attack(ATTACK_ELEC, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5153 msg_print(_("魔法剣を使うのをやめた。", "You cancel the temporary branding."));
5164 * Choose a elemental immune. -LM-
5166 bool choose_ele_immune(int turn)
5173 c_prt(TERM_RED, _(" a) 火炎", " a) Immune Fire"), 2, 14);
5174 c_prt(TERM_L_WHITE,_(" b) 冷気", " b) Immune Cold"), 3, 14);
5175 c_prt(TERM_L_DARK, _(" c) 酸", " c) Immune Acid"), 4, 14);
5176 c_prt(TERM_BLUE, _(" d) 電撃", " d) Immune Elec"), 5, 14);
5184 prt(_(" どの元素の免疫をつけますか?", " Choose a temporary elemental immune "), 1, 14);
5188 if ((choice == 'a') || (choice == 'A'))
5189 set_ele_immune(DEFENSE_FIRE, turn);
5190 else if ((choice == 'b') || (choice == 'B'))
5191 set_ele_immune(DEFENSE_COLD, turn);
5192 else if ((choice == 'c') || (choice == 'C'))
5193 set_ele_immune(DEFENSE_ACID, turn);
5194 else if ((choice == 'd') || (choice == 'D'))
5195 set_ele_immune(DEFENSE_ELEC, turn);
5198 msg_print(_("免疫を付けるのをやめた。", "You cancel the temporary immune."));