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
31 #include "spells-status.h"
32 #include "realm-song.h"
33 #include "realm-hex.h"
34 #include "object-ego.h"
35 #include "object-hook.h"
37 #include "spells-floor.h"
38 #include "player-status.h"
39 #include "player-class.h"
40 #include "player-move.h"
41 #include "player-effects.h"
42 #include "player-race.h"
43 #include "player-class.h"
44 #include "player-personality.h"
45 #include "player-sex.h"
46 #include "monster-status.h"
49 #include "monster-spell.h"
51 #include "objectkind.h"
56 #include "view-mainwindow.h"
61 const kamae kamae_shurui[MAX_KAMAE] =
69 {"Genbu", 25, "(Black Tortoise) "},
70 {"Byakko", 30, "(White Tiger) "},
71 {"Seiryuu", 35, "(Blue Dragon) "},
72 {"Suzaku", 40, "(Red Phoenix) "},
79 const kamae kata_shurui[MAX_KATA] =
96 * @brief プレイヤーの継続行動を設定する。
97 * @param typ 継続行動のID\n
98 * #ACTION_NONE / #ACTION_SEARCH / #ACTION_REST / #ACTION_LEARN / #ACTION_FISH / #ACTION_KAMAE / #ACTION_KATA / #ACTION_SING / #ACTION_HAYAGAKE / #ACTION_SPELL から選択。
101 void set_action(ACTION_IDX typ)
103 int prev_typ = p_ptr->action;
115 msg_print(_("探索をやめた。", "You no longer walk carefully."));
116 p_ptr->redraw |= (PR_SPEED);
126 msg_print(_("学習をやめた。", "You stop Learning"));
132 msg_print(_("構えをといた。", "You stop assuming the posture."));
133 p_ptr->special_defense &= ~(KAMAE_MASK);
138 msg_print(_("型を崩した。", "You stop assuming the posture."));
139 p_ptr->special_defense &= ~(KATA_MASK);
140 p_ptr->update |= (PU_MONSTERS);
141 p_ptr->redraw |= (PR_STATUS);
146 msg_print(_("歌うのをやめた。", "You stop singing."));
149 case ACTION_HAYAGAKE:
151 msg_print(_("足が重くなった。", "You are no longer walking extremely fast."));
152 take_turn(p_ptr, 100);
157 msg_print(_("呪文の詠唱を中断した。", "You stopped spelling all spells."));
165 /* If we are requested other action, stop singing */
166 if (prev_typ == ACTION_SING) stop_singing(p_ptr);
167 if (prev_typ == ACTION_SPELL) stop_hex_spell();
169 switch (p_ptr->action)
173 msg_print(_("注意深く歩き始めた。", "You begin to walk carefully."));
174 p_ptr->redraw |= (PR_SPEED);
179 msg_print(_("学習を始めた。", "You begin Learning"));
184 msg_print(_("水面に糸を垂らした...", "You begin fishing..."));
187 case ACTION_HAYAGAKE:
189 msg_print(_("足が羽のように軽くなった。", "You begin to walk extremely fast."));
197 p_ptr->update |= (PU_BONUS);
198 p_ptr->redraw |= (PR_STATE);
202 * @brief プレイヤーの全ての時限効果をリセットする。 / reset timed flags
205 void reset_tim_flags(void)
207 p_ptr->fast = 0; /* Timed -- Fast */
208 p_ptr->lightspeed = 0;
209 p_ptr->slow = 0; /* Timed -- Slow */
210 p_ptr->blind = 0; /* Timed -- Blindness */
211 p_ptr->paralyzed = 0; /* Timed -- Paralysis */
212 p_ptr->confused = 0; /* Timed -- Confusion */
213 p_ptr->afraid = 0; /* Timed -- Fear */
214 p_ptr->image = 0; /* Timed -- Hallucination */
215 p_ptr->poisoned = 0; /* Timed -- Poisoned */
216 p_ptr->cut = 0; /* Timed -- Cut */
217 p_ptr->stun = 0; /* Timed -- Stun */
219 p_ptr->protevil = 0; /* Timed -- Protection */
220 p_ptr->invuln = 0; /* Timed -- Invulnerable */
222 p_ptr->hero = 0; /* Timed -- Heroism */
223 p_ptr->shero = 0; /* Timed -- Super Heroism */
224 p_ptr->shield = 0; /* Timed -- Shield Spell */
225 p_ptr->blessed = 0; /* Timed -- Blessed */
226 p_ptr->tim_invis = 0; /* Timed -- Invisibility */
227 p_ptr->tim_infra = 0; /* Timed -- Infra Vision */
228 p_ptr->tim_regen = 0; /* Timed -- Regeneration */
229 p_ptr->tim_stealth = 0; /* Timed -- Stealth */
231 p_ptr->wraith_form = 0; /* Timed -- Wraith Form */
232 p_ptr->tim_levitation = 0;
233 p_ptr->tim_sh_touki = 0;
234 p_ptr->tim_sh_fire = 0;
235 p_ptr->tim_sh_holy = 0;
236 p_ptr->tim_eyeeye = 0;
238 p_ptr->resist_magic = 0;
241 p_ptr->tim_res_nether = 0;
242 p_ptr->tim_res_time = 0;
243 p_ptr->tim_mimic = 0;
244 p_ptr->mimic_form = 0;
245 p_ptr->tim_reflect = 0;
246 p_ptr->multishadow = 0;
248 p_ptr->action = ACTION_NONE;
250 p_ptr->oppose_acid = 0; /* Timed -- oppose acid */
251 p_ptr->oppose_elec = 0; /* Timed -- oppose lightning */
252 p_ptr->oppose_fire = 0; /* Timed -- oppose heat */
253 p_ptr->oppose_cold = 0; /* Timed -- oppose cold */
254 p_ptr->oppose_pois = 0; /* Timed -- oppose poison */
256 p_ptr->word_recall = 0;
257 p_ptr->alter_reality = 0;
258 p_ptr->sutemi = FALSE;
259 p_ptr->counter = FALSE;
260 p_ptr->ele_attack = 0;
261 p_ptr->ele_immune = 0;
262 p_ptr->special_attack = 0L;
263 p_ptr->special_defense = 0L;
265 while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
266 p_ptr->timewalk = FALSE;
268 if (prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
269 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1;
270 if (p_ptr->pclass == CLASS_BERSERKER) p_ptr->shero = 1;
274 (void)set_monster_fast(p_ptr->riding, 0);
275 (void)set_monster_slow(p_ptr->riding, 0);
276 (void)set_monster_invulner(p_ptr->riding, 0, FALSE);
279 if (p_ptr->pclass == CLASS_BARD)
281 SINGING_SONG_EFFECT(p_ptr) = 0;
282 SINGING_SONG_ID(p_ptr) = 0;
287 * @brief プレイヤーに魔力消去効果を与える。
290 void dispel_player(void)
292 (void)set_fast(0, TRUE);
293 (void)set_lightspeed(0, TRUE);
294 (void)set_slow(0, TRUE);
295 (void)set_shield(0, TRUE);
296 (void)set_blessed(0, TRUE);
297 (void)set_tsuyoshi(0, TRUE);
298 (void)set_hero(0, TRUE);
299 (void)set_shero(0, TRUE);
300 (void)set_protevil(0, TRUE);
301 (void)set_invuln(0, TRUE);
302 (void)set_wraith_form(0, TRUE);
303 (void)set_kabenuke(0, TRUE);
304 (void)set_tim_res_nether(0, TRUE);
305 (void)set_tim_res_time(0, TRUE);
307 (void)set_tim_reflect(0,TRUE);
308 (void)set_multishadow(0,TRUE);
309 (void)set_dustrobe(0,TRUE);
311 (void)set_tim_invis(0, TRUE);
312 (void)set_tim_infra(0, TRUE);
313 (void)set_tim_esp(0, TRUE);
314 (void)set_tim_regen(0, TRUE);
315 (void)set_tim_stealth(0, TRUE);
316 (void)set_tim_levitation(0, TRUE);
317 (void)set_tim_sh_touki(0, TRUE);
318 (void)set_tim_sh_fire(0, TRUE);
319 (void)set_tim_sh_holy(0, TRUE);
320 (void)set_tim_eyeeye(0, TRUE);
321 (void)set_magicdef(0, TRUE);
322 (void)set_resist_magic(0, TRUE);
323 (void)set_oppose_acid(0, TRUE);
324 (void)set_oppose_elec(0, TRUE);
325 (void)set_oppose_fire(0, TRUE);
326 (void)set_oppose_cold(0, TRUE);
327 (void)set_oppose_pois(0, TRUE);
328 (void)set_ultimate_res(0, TRUE);
329 (void)set_mimic(0, 0, TRUE);
330 (void)set_ele_attack(0, 0);
331 (void)set_ele_immune(0, 0);
333 /* Cancel glowing hands */
334 if (p_ptr->special_attack & ATTACK_CONFUSE)
336 p_ptr->special_attack &= ~(ATTACK_CONFUSE);
337 msg_print(_("手の輝きがなくなった。", "Your hands stop glowing."));
340 if (music_singing_any() || hex_spelling_any())
342 concptr str = (music_singing_any()) ? _("歌", "singing") : _("呪文", "spelling");
343 INTERUPTING_SONG_EFFECT(p_ptr) = SINGING_SONG_EFFECT(p_ptr);
344 SINGING_SONG_EFFECT(p_ptr) = MUSIC_NONE;
345 msg_format(_("%sが途切れた。", "Your %s is interrupted."), str);
347 p_ptr->action = ACTION_NONE;
348 p_ptr->update |= (PU_BONUS | PU_HP | PU_MONSTERS);
349 p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
350 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
351 p_ptr->energy_need += ENERGY_NEED();
357 * @brief 変身効果の継続時間と変身先をセットする / Set "p_ptr->tim_mimic", and "p_ptr->mimic_form", notice observable changes
360 * @param do_dec 現在の継続時間より長い値のみ上書きする
361 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
363 bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec)
366 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
368 if (p_ptr->is_dead) return FALSE;
373 if (p_ptr->tim_mimic && (p_ptr->mimic_form == p) && !do_dec)
375 if (p_ptr->tim_mimic > v) return FALSE;
377 else if ((!p_ptr->tim_mimic) || (p_ptr->mimic_form != p))
379 msg_print(_("自分の体が変わってゆくのを感じた。", "You feel that your body changes."));
380 p_ptr->mimic_form = p;
388 if (p_ptr->tim_mimic)
390 msg_print(_("変身が解けた。", "You are no longer transformed."));
391 if (p_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(0, TRUE);
399 p_ptr->tim_mimic = v;
401 /* Nothing to notice */
402 if (!notice) return (FALSE);
404 if (disturb_state) disturb(FALSE, TRUE);
406 p_ptr->redraw |= (PR_BASIC | PR_STATUS);
407 p_ptr->update |= (PU_BONUS | PU_HP);
414 * @brief 盲目の継続時間をセットする / Set "p_ptr->blind", notice observable changes
416 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
418 * Note the use of "PU_UN_LITE" and "PU_UN_VIEW", which is needed to\n
419 * memorize any terrain features which suddenly become "visible".\n
420 * Note that blindness is currently the only thing which can affect\n
421 * "player_can_see_bold()".\n
423 bool set_blind(TIME_EFFECT v)
426 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
428 if (p_ptr->is_dead) return FALSE;
435 if (p_ptr->prace == RACE_ANDROID)
437 msg_print(_("センサーをやられた!", "You are blind!"));
441 msg_print(_("目が見えなくなってしまった!", "You are blind!"));
445 chg_virtue(V_ENLIGHTEN, -1);
454 if (p_ptr->prace == RACE_ANDROID)
456 msg_print(_("センサーが復旧した。", "You can see again."));
460 msg_print(_("やっと目が見えるようになった。", "You can see again."));
469 p_ptr->redraw |= (PR_STATUS);
471 /* Nothing to notice */
472 if (!notice) return (FALSE);
473 if (disturb_state) disturb(FALSE, FALSE);
475 /* Fully update the visuals */
476 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
477 p_ptr->redraw |= (PR_MAP);
478 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
485 * @brief 混乱の継続時間をセットする / Set "p_ptr->confused", notice observable changes
487 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
489 bool set_confused(TIME_EFFECT v)
492 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
494 if (p_ptr->is_dead) return FALSE;
499 if (!p_ptr->confused)
501 msg_print(_("あなたは混乱した!", "You are confused!"));
503 if (p_ptr->action == ACTION_LEARN)
505 msg_print(_("学習が続けられない!", "You cannot continue Learning!"));
508 p_ptr->redraw |= (PR_STATE);
509 p_ptr->action = ACTION_NONE;
511 if (p_ptr->action == ACTION_KAMAE)
513 msg_print(_("構えがとけた。", "Your posture gets loose."));
514 p_ptr->special_defense &= ~(KAMAE_MASK);
515 p_ptr->update |= (PU_BONUS);
516 p_ptr->redraw |= (PR_STATE);
517 p_ptr->action = ACTION_NONE;
519 else if (p_ptr->action == ACTION_KATA)
521 msg_print(_("型が崩れた。", "Your posture gets loose."));
522 p_ptr->special_defense &= ~(KATA_MASK);
523 p_ptr->update |= (PU_BONUS);
524 p_ptr->update |= (PU_MONSTERS);
525 p_ptr->redraw |= (PR_STATE);
526 p_ptr->redraw |= (PR_STATUS);
527 p_ptr->action = ACTION_NONE;
531 if (p_ptr->concent) reset_concentration(TRUE);
534 if (hex_spelling_any()) stop_hex_spell_all();
537 p_ptr->counter = FALSE;
538 chg_virtue(V_HARMONY, -1);
547 msg_print(_("やっと混乱がおさまった。", "You feel less confused now."));
548 p_ptr->special_attack &= ~(ATTACK_SUIKEN);
555 p_ptr->redraw |= (PR_STATUS);
557 /* Nothing to notice */
558 if (!notice) return (FALSE);
560 if (disturb_state) disturb(FALSE, FALSE);
567 * @brief 毒の継続時間をセットする / Set "p_ptr->poisoned", notice observable changes
569 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
571 bool set_poisoned(TIME_EFFECT v)
574 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
576 if (p_ptr->is_dead) return FALSE;
581 if (!p_ptr->poisoned)
583 msg_print(_("毒に侵されてしまった!", "You are poisoned!"));
593 msg_print(_("やっと毒の痛みがなくなった。", "You are no longer poisoned."));
600 p_ptr->redraw |= (PR_STATUS);
602 /* Nothing to notice */
603 if (!notice) return (FALSE);
605 if (disturb_state) disturb(FALSE, FALSE);
612 * @brief 恐怖の継続時間をセットする / Set "p_ptr->afraid", notice observable changes
614 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
616 bool set_afraid(TIME_EFFECT v)
619 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
621 if (p_ptr->is_dead) return FALSE;
628 msg_print(_("何もかも恐くなってきた!", "You are terrified!"));
630 if (p_ptr->special_defense & KATA_MASK)
632 msg_print(_("型が崩れた。", "Your posture gets loose."));
633 p_ptr->special_defense &= ~(KATA_MASK);
634 p_ptr->update |= (PU_BONUS);
635 p_ptr->update |= (PU_MONSTERS);
636 p_ptr->redraw |= (PR_STATE);
637 p_ptr->redraw |= (PR_STATUS);
638 p_ptr->action = ACTION_NONE;
642 p_ptr->counter = FALSE;
643 chg_virtue(V_VALOUR, -1);
652 msg_print(_("やっと恐怖を振り払った。", "You feel bolder now."));
659 p_ptr->redraw |= (PR_STATUS);
661 /* Nothing to notice */
662 if (!notice) return (FALSE);
664 if (disturb_state) disturb(FALSE, FALSE);
670 * @brief 麻痺の継続時間をセットする / Set "p_ptr->paralyzed", notice observable changes
672 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
674 bool set_paralyzed(TIME_EFFECT v)
677 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
679 if (p_ptr->is_dead) return FALSE;
684 if (!p_ptr->paralyzed)
686 msg_print(_("体が麻痺してしまった!", "You are paralyzed!"));
688 if (p_ptr->concent) reset_concentration(TRUE);
691 if (hex_spelling_any()) stop_hex_spell_all();
693 p_ptr->counter = FALSE;
701 if (p_ptr->paralyzed)
703 msg_print(_("やっと動けるようになった。", "You can move again."));
709 p_ptr->paralyzed = v;
710 p_ptr->redraw |= (PR_STATUS);
712 /* Nothing to notice */
713 if (!notice) return (FALSE);
715 if (disturb_state) disturb(FALSE, FALSE);
716 p_ptr->redraw |= (PR_STATE);
722 * @brief 幻覚の継続時間をセットする / Set "p_ptr->image", notice observable changes
724 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
725 * @details Note that we must redraw the map when hallucination changes.
727 bool set_image(TIME_EFFECT v)
730 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
732 if (p_ptr->is_dead) return FALSE;
733 if (p_ptr->pseikaku == SEIKAKU_CHARGEMAN) v = 0;
739 set_tsuyoshi(0, TRUE);
742 msg_print(_("ワーオ!何もかも虹色に見える!", "Oh, wow! Everything looks so cosmic now!"));
745 if (p_ptr->concent) reset_concentration(TRUE);
747 p_ptr->counter = FALSE;
757 msg_print(_("やっとはっきりと物が見えるようになった。", "You can see clearly again."));
764 p_ptr->redraw |= (PR_STATUS);
766 /* Nothing to notice */
767 if (!notice) return (FALSE);
769 if (disturb_state) disturb(FALSE, TRUE);
771 p_ptr->redraw |= (PR_MAP | PR_HEALTH | PR_UHEALTH);
772 p_ptr->update |= (PU_MONSTERS);
773 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
779 * @brief 加速の継続時間をセットする / Set "p_ptr->fast", notice observable changes
781 * @param do_dec 現在の継続時間より長い値のみ上書きする
782 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
784 bool set_fast(TIME_EFFECT v, bool do_dec)
787 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
789 if (p_ptr->is_dead) return FALSE;
794 if (p_ptr->fast && !do_dec)
796 if (p_ptr->fast > v) return FALSE;
798 else if (!IS_FAST() && !p_ptr->lightspeed)
800 msg_print(_("素早く動けるようになった!", "You feel yourself moving much faster!"));
802 chg_virtue(V_PATIENCE, -1);
803 chg_virtue(V_DILIGENCE, 1);
810 if (p_ptr->fast && !p_ptr->lightspeed && !music_singing(MUSIC_SPEED) && !music_singing(MUSIC_SHERO))
812 msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
820 /* Nothing to notice */
821 if (!notice) return (FALSE);
823 if (disturb_state) disturb(FALSE, FALSE);
824 p_ptr->update |= (PU_BONUS);
830 * @brief 光速移動の継続時間をセットする / Set "p_ptr->lightspeed", notice observable changes
832 * @param do_dec 現在の継続時間より長い値のみ上書きする
833 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
835 bool set_lightspeed(TIME_EFFECT v, bool do_dec)
838 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
840 if (p_ptr->is_dead) return FALSE;
842 if (p_ptr->wild_mode) v = 0;
847 if (p_ptr->lightspeed && !do_dec)
849 if (p_ptr->lightspeed > v) return FALSE;
851 else if (!p_ptr->lightspeed)
853 msg_print(_("非常に素早く動けるようになった!", "You feel yourself moving extremely faster!"));
855 chg_virtue(V_PATIENCE, -1);
856 chg_virtue(V_DILIGENCE, 1);
863 if (p_ptr->lightspeed)
865 msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
871 p_ptr->lightspeed = v;
873 /* Nothing to notice */
874 if (!notice) return (FALSE);
876 if (disturb_state) disturb(FALSE, FALSE);
877 p_ptr->update |= (PU_BONUS);
883 * @brief 減速の継続時間をセットする / Set "p_ptr->slow", notice observable changes
885 * @param do_dec 現在の継続時間より長い値のみ上書きする
886 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
888 bool set_slow(TIME_EFFECT v, bool do_dec)
891 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
893 if (p_ptr->is_dead) return FALSE;
898 if (p_ptr->slow && !do_dec)
900 if (p_ptr->slow > v) return FALSE;
902 else if (!p_ptr->slow)
904 msg_print(_("体の動きが遅くなってしまった!", "You feel yourself moving slower!"));
914 msg_print(_("動きの遅さがなくなったようだ。", "You feel yourself speed up."));
922 /* Nothing to notice */
923 if (!notice) return (FALSE);
925 if (disturb_state) disturb(FALSE, FALSE);
926 p_ptr->update |= (PU_BONUS);
933 * @brief 肌石化の継続時間をセットする / Set "p_ptr->shield", notice observable changes
935 * @param do_dec 現在の継続時間より長い値のみ上書きする
936 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
938 bool set_shield(TIME_EFFECT v, bool do_dec)
941 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
943 if (p_ptr->is_dead) return FALSE;
948 if (p_ptr->shield && !do_dec)
950 if (p_ptr->shield > v) return FALSE;
952 else if (!p_ptr->shield)
954 msg_print(_("肌が石になった。", "Your skin turns to stone."));
964 msg_print(_("肌が元に戻った。", "Your skin returns to normal."));
971 p_ptr->redraw |= (PR_STATUS);
973 /* Nothing to notice */
974 if (!notice) return (FALSE);
976 if (disturb_state) disturb(FALSE, FALSE);
977 p_ptr->update |= (PU_BONUS);
984 * @brief つぶれるの継続時間をセットする / Set "p_ptr->tsubureru", notice observable changes
986 * @param do_dec 現在の継続時間より長い値のみ上書きする
987 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
989 bool set_tsubureru(TIME_EFFECT v, bool do_dec)
992 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
994 if (p_ptr->is_dead) return FALSE;
999 if (p_ptr->tsubureru && !do_dec)
1001 if (p_ptr->tsubureru > v) return FALSE;
1003 else if (!p_ptr->tsubureru)
1005 msg_print(_("横に伸びた。", "Your body expands horizontally."));
1013 if (p_ptr->tsubureru)
1015 msg_print(_("もう横に伸びていない。", "Your body returns to normal."));
1021 p_ptr->tsubureru = v;
1022 p_ptr->redraw |= (PR_STATUS);
1024 /* Nothing to notice */
1025 if (!notice) return (FALSE);
1027 if (disturb_state) disturb(FALSE, FALSE);
1028 p_ptr->update |= (PU_BONUS);
1035 * @brief 魔法の鎧の継続時間をセットする / Set "p_ptr->magicdef", notice observable changes
1037 * @param do_dec 現在の継続時間より長い値のみ上書きする
1038 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1040 bool set_magicdef(TIME_EFFECT v, bool do_dec)
1042 bool notice = FALSE;
1043 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1045 if (p_ptr->is_dead) return FALSE;
1050 if (p_ptr->magicdef && !do_dec)
1052 if (p_ptr->magicdef > v) return FALSE;
1054 else if (!p_ptr->magicdef)
1056 msg_print(_("魔法の防御力が増したような気がする。", "You feel more resistant to magic."));
1064 if (p_ptr->magicdef)
1066 msg_print(_("魔法の防御力が元に戻った。", "You feel less resistant to magic."));
1072 p_ptr->magicdef = v;
1073 p_ptr->redraw |= (PR_STATUS);
1075 /* Nothing to notice */
1076 if (!notice) return (FALSE);
1078 if (disturb_state) disturb(FALSE, FALSE);
1079 p_ptr->update |= (PU_BONUS);
1085 * @brief 祝福の継続時間をセットする / Set "p_ptr->blessed", notice observable changes
1087 * @param do_dec 現在の継続時間より長い値のみ上書きする
1088 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1090 bool set_blessed(TIME_EFFECT v, bool do_dec)
1092 bool notice = FALSE;
1093 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1095 if (p_ptr->is_dead) return FALSE;
1100 if (p_ptr->blessed && !do_dec)
1102 if (p_ptr->blessed > v) return FALSE;
1104 else if (!IS_BLESSED())
1106 msg_print(_("高潔な気分になった!", "You feel righteous!"));
1114 if (p_ptr->blessed && !music_singing(MUSIC_BLESS))
1116 msg_print(_("高潔な気分が消え失せた。", "The prayer has expired."));
1123 p_ptr->redraw |= (PR_STATUS);
1125 /* Nothing to notice */
1126 if (!notice) return (FALSE);
1128 if (disturb_state) disturb(FALSE, FALSE);
1129 p_ptr->update |= (PU_BONUS);
1136 * @brief 士気高揚の継続時間をセットする / Set "p_ptr->hero", notice observable changes
1138 * @param do_dec 現在の継続時間より長い値のみ上書きする
1139 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1141 bool set_hero(TIME_EFFECT v, bool do_dec)
1143 bool notice = FALSE;
1144 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1146 if (p_ptr->is_dead) return FALSE;
1151 if (p_ptr->hero && !do_dec)
1153 if (p_ptr->hero > v) return FALSE;
1155 else if (!IS_HERO())
1157 msg_print(_("ヒーローになった気がする!", "You feel like a hero!"));
1165 if (p_ptr->hero && !music_singing(MUSIC_HERO) && !music_singing(MUSIC_SHERO))
1167 msg_print(_("ヒーローの気分が消え失せた。", "The heroism wears off."));
1174 p_ptr->redraw |= (PR_STATUS);
1176 /* Nothing to notice */
1177 if (!notice) return (FALSE);
1179 if (disturb_state) disturb(FALSE, FALSE);
1180 p_ptr->update |= (PU_BONUS);
1182 /* Recalculate hitpoints */
1183 p_ptr->update |= (PU_HP);
1189 * @brief 狂戦士化の継続時間をセットする / Set "p_ptr->shero", notice observable changes
1190 * @param v 継続時間/ 0ならば無条件にリセット
1191 * @param do_dec FALSEの場合現在の継続時間より長い値のみ上書きする
1192 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1194 bool set_shero(TIME_EFFECT v, bool do_dec)
1196 bool notice = FALSE;
1197 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1199 if (p_ptr->is_dead) return FALSE;
1201 if (p_ptr->pclass == CLASS_BERSERKER) v = 1;
1205 if (p_ptr->shero && !do_dec)
1207 if (p_ptr->shero > v) return FALSE;
1209 else if (!p_ptr->shero)
1211 msg_print(_("殺戮マシーンになった気がする!", "You feel like a killing machine!"));
1221 msg_print(_("野蛮な気持ちが消え失せた。", "You feel less Berserk."));
1228 p_ptr->redraw |= (PR_STATUS);
1230 /* Nothing to notice */
1231 if (!notice) return (FALSE);
1233 if (disturb_state) disturb(FALSE, FALSE);
1234 p_ptr->update |= (PU_BONUS);
1236 /* Recalculate hitpoints */
1237 p_ptr->update |= (PU_HP);
1243 * @brief 対邪悪結界の継続時間をセットする / Set "p_ptr->protevil", notice observable changes
1245 * @param do_dec 現在の継続時間より長い値のみ上書きする
1246 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1248 bool set_protevil(TIME_EFFECT v, bool do_dec)
1250 bool notice = FALSE;
1251 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1253 if (p_ptr->is_dead) return FALSE;
1258 if (p_ptr->protevil && !do_dec)
1260 if (p_ptr->protevil > v) return FALSE;
1262 else if (!p_ptr->protevil)
1264 msg_print(_("邪悪なる存在から守られているような感じがする!", "You feel safe from evil!"));
1272 if (p_ptr->protevil)
1274 msg_print(_("邪悪なる存在から守られている感じがなくなった。", "You no longer feel safe from evil."));
1280 p_ptr->protevil = v;
1281 p_ptr->redraw |= (PR_STATUS);
1283 /* Nothing to notice */
1284 if (!notice) return (FALSE);
1286 if (disturb_state) disturb(FALSE, FALSE);
1292 * @brief 幽体化の継続時間をセットする / Set "p_ptr->wraith_form", notice observable changes
1294 * @param do_dec 現在の継続時間より長い値のみ上書きする
1295 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1297 bool set_wraith_form(TIME_EFFECT v, bool do_dec)
1299 bool notice = FALSE;
1300 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1302 if (p_ptr->is_dead) return FALSE;
1307 if (p_ptr->wraith_form && !do_dec)
1309 if (p_ptr->wraith_form > v) return FALSE;
1311 else if (!p_ptr->wraith_form)
1313 msg_print(_("物質界を離れて幽鬼のような存在になった!", "You leave the physical world and current_world_ptr->game_turn into a wraith-being!"));
1315 chg_virtue(V_UNLIFE, 3);
1316 chg_virtue(V_HONOUR, -2);
1317 chg_virtue(V_SACRIFICE, -2);
1318 chg_virtue(V_VALOUR, -5);
1320 p_ptr->redraw |= (PR_MAP);
1321 p_ptr->update |= (PU_MONSTERS);
1323 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1330 if (p_ptr->wraith_form)
1332 msg_print(_("不透明になった感じがする。", "You feel opaque."));
1335 p_ptr->redraw |= (PR_MAP);
1336 p_ptr->update |= (PU_MONSTERS);
1338 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1343 p_ptr->wraith_form = v;
1344 p_ptr->redraw |= (PR_STATUS);
1346 /* Nothing to notice */
1347 if (!notice) return (FALSE);
1349 if (disturb_state) disturb(FALSE, FALSE);
1350 p_ptr->update |= (PU_BONUS);
1357 * @brief 無傷球の継続時間をセットする / Set "p_ptr->invuln", notice observable changes
1359 * @param do_dec 現在の継続時間より長い値のみ上書きする
1360 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1362 bool set_invuln(TIME_EFFECT v, bool do_dec)
1364 bool notice = FALSE;
1365 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1367 if (p_ptr->is_dead) return FALSE;
1372 if (p_ptr->invuln && !do_dec)
1374 if (p_ptr->invuln > v) return FALSE;
1376 else if (!IS_INVULN())
1378 msg_print(_("無敵だ!", "Invulnerability!"));
1381 chg_virtue(V_UNLIFE, -2);
1382 chg_virtue(V_HONOUR, -2);
1383 chg_virtue(V_SACRIFICE, -3);
1384 chg_virtue(V_VALOUR, -5);
1386 p_ptr->redraw |= (PR_MAP);
1387 p_ptr->update |= (PU_MONSTERS);
1389 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1396 if (p_ptr->invuln && !music_singing(MUSIC_INVULN))
1398 msg_print(_("無敵ではなくなった。", "The invulnerability wears off."));
1401 p_ptr->redraw |= (PR_MAP);
1402 p_ptr->update |= (PU_MONSTERS);
1404 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1406 p_ptr->energy_need += ENERGY_NEED();
1412 p_ptr->redraw |= (PR_STATUS);
1414 /* Nothing to notice */
1415 if (!notice) return (FALSE);
1417 if (disturb_state) disturb(FALSE, FALSE);
1418 p_ptr->update |= (PU_BONUS);
1424 * @brief 時限ESPの継続時間をセットする / Set "p_ptr->tim_esp", notice observable changes
1426 * @param do_dec 現在の継続時間より長い値のみ上書きする
1427 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1429 bool set_tim_esp(TIME_EFFECT v, bool do_dec)
1431 bool notice = FALSE;
1432 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1434 if (p_ptr->is_dead) return FALSE;
1439 if (p_ptr->tim_esp && !do_dec)
1441 if (p_ptr->tim_esp > v) return FALSE;
1443 else if (!IS_TIM_ESP())
1445 msg_print(_("意識が広がった気がする!", "You feel your consciousness expand!"));
1453 if (p_ptr->tim_esp && !music_singing(MUSIC_MIND))
1455 msg_print(_("意識は元に戻った。", "Your consciousness contracts again."));
1462 p_ptr->redraw |= (PR_STATUS);
1464 /* Nothing to notice */
1465 if (!notice) return (FALSE);
1467 if (disturb_state) disturb(FALSE, FALSE);
1468 p_ptr->update |= (PU_BONUS);
1469 p_ptr->update |= (PU_MONSTERS);
1475 * @brief 時限透明視の継続時間をセットする / Set "p_ptr->tim_invis", notice observable changes
1477 * @param do_dec 現在の継続時間より長い値のみ上書きする
1478 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1480 bool set_tim_invis(TIME_EFFECT v, bool do_dec)
1482 bool notice = FALSE;
1483 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1485 if (p_ptr->is_dead) return FALSE;
1490 if (p_ptr->tim_invis && !do_dec)
1492 if (p_ptr->tim_invis > v) return FALSE;
1494 else if (!p_ptr->tim_invis)
1496 msg_print(_("目が非常に敏感になった気がする!", "Your eyes feel very sensitive!"));
1504 if (p_ptr->tim_invis)
1506 msg_print(_("目の敏感さがなくなったようだ。", "Your eyes feel less sensitive."));
1512 p_ptr->tim_invis = v;
1513 p_ptr->redraw |= (PR_STATUS);
1515 /* Nothing to notice */
1516 if (!notice) return (FALSE);
1518 if (disturb_state) disturb(FALSE, FALSE);
1519 p_ptr->update |= (PU_BONUS);
1521 /* Update the monsters */
1522 p_ptr->update |= (PU_MONSTERS);
1528 * @brief 時限赤外線視力の継続時間をセットする / Set "p_ptr->tim_infra", notice observable changes
1530 * @param do_dec 現在の継続時間より長い値のみ上書きする
1531 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1533 bool set_tim_infra(TIME_EFFECT v, bool do_dec)
1535 bool notice = FALSE;
1536 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1538 if (p_ptr->is_dead) return FALSE;
1543 if (p_ptr->tim_infra && !do_dec)
1545 if (p_ptr->tim_infra > v) return FALSE;
1547 else if (!p_ptr->tim_infra)
1549 msg_print(_("目がランランと輝き始めた!", "Your eyes begin to tingle!"));
1557 if (p_ptr->tim_infra)
1559 msg_print(_("目の輝きがなくなった。", "Your eyes stop tingling."));
1565 p_ptr->tim_infra = v;
1566 p_ptr->redraw |= (PR_STATUS);
1568 /* Nothing to notice */
1569 if (!notice) return (FALSE);
1571 if (disturb_state) disturb(FALSE, FALSE);
1572 p_ptr->update |= (PU_BONUS);
1574 /* Update the monsters */
1575 p_ptr->update |= (PU_MONSTERS);
1581 * @brief 時限急回復の継続時間をセットする / Set "p_ptr->tim_regen", notice observable changes
1583 * @param do_dec 現在の継続時間より長い値のみ上書きする
1584 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1586 bool set_tim_regen(TIME_EFFECT v, bool do_dec)
1588 bool notice = FALSE;
1589 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1591 if (p_ptr->is_dead) return FALSE;
1596 if (p_ptr->tim_regen && !do_dec)
1598 if (p_ptr->tim_regen > v) return FALSE;
1600 else if (!p_ptr->tim_regen)
1602 msg_print(_("回復力が上がった!", "You feel yourself regenerating quickly!"));
1610 if (p_ptr->tim_regen)
1612 msg_print(_("素早く回復する感じがなくなった。", "You feel yourself regenerating slowly."));
1618 p_ptr->tim_regen = v;
1619 p_ptr->redraw |= (PR_STATUS);
1621 /* Nothing to notice */
1622 if (!notice) return (FALSE);
1624 if (disturb_state) disturb(FALSE, FALSE);
1625 p_ptr->update |= (PU_BONUS);
1631 * @brief 隠密の歌の継続時間をセットする / Set "p_ptr->tim_stealth", notice observable changes
1633 * @param do_dec 現在の継続時間より長い値のみ上書きする
1634 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1636 bool set_tim_stealth(TIME_EFFECT v, bool do_dec)
1638 bool notice = FALSE;
1639 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1641 if (p_ptr->is_dead) return FALSE;
1646 if (p_ptr->tim_stealth && !do_dec)
1648 if (p_ptr->tim_stealth > v) return FALSE;
1650 else if (!IS_TIM_STEALTH())
1652 msg_print(_("足音が小さくなった!", "You begin to walk silently!"));
1660 if (p_ptr->tim_stealth && !music_singing(MUSIC_STEALTH))
1662 msg_print(_("足音が大きくなった。", "You no longer walk silently."));
1668 p_ptr->tim_stealth = v;
1669 p_ptr->redraw |= (PR_STATUS);
1671 /* Nothing to notice */
1672 if (!notice) return (FALSE);
1674 if (disturb_state) disturb(FALSE, FALSE);
1675 p_ptr->update |= (PU_BONUS);
1681 * @brief 超隠密状態をセットする
1682 * @param set TRUEならば超隠密状態になる。
1683 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1685 bool set_superstealth(bool set)
1687 bool notice = FALSE;
1689 if (p_ptr->is_dead) return FALSE;
1694 if (!(p_ptr->special_defense & NINJA_S_STEALTH))
1696 if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_MNLT)
1698 msg_print(_("敵の目から薄い影の中に覆い隠された。", "You are mantled in weak shadow from ordinary eyes."));
1699 p_ptr->monlite = p_ptr->old_monlite = TRUE;
1703 msg_print(_("敵の目から影の中に覆い隠された!", "You are mantled in shadow from ordinary eyes!"));
1704 p_ptr->monlite = p_ptr->old_monlite = FALSE;
1710 p_ptr->special_defense |= NINJA_S_STEALTH;
1717 if (p_ptr->special_defense & NINJA_S_STEALTH)
1719 msg_print(_("再び敵の目にさらされるようになった。", "You are exposed to common sight once more."));
1723 p_ptr->special_defense &= ~(NINJA_S_STEALTH);
1727 /* Nothing to notice */
1728 if (!notice) return (FALSE);
1729 p_ptr->redraw |= (PR_STATUS);
1731 if (disturb_state) disturb(FALSE, FALSE);
1736 * @brief 一時的浮遊の継続時間をセットする / Set "p_ptr->tim_levitation", notice observable changes
1738 * @param do_dec 現在の継続時間より長い値のみ上書きする
1739 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1741 bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
1743 bool notice = FALSE;
1744 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1746 if (p_ptr->is_dead) return FALSE;
1751 if (p_ptr->tim_levitation && !do_dec)
1753 if (p_ptr->tim_levitation > v) return FALSE;
1755 else if (!p_ptr->tim_levitation)
1757 msg_print(_("体が宙に浮き始めた。", "You begin to fly!"));
1765 if (p_ptr->tim_levitation)
1767 msg_print(_("もう宙に浮かべなくなった。", "You stop flying."));
1773 p_ptr->tim_levitation = v;
1774 p_ptr->redraw |= (PR_STATUS);
1776 /* Nothing to notice */
1777 if (!notice) return (FALSE);
1779 if (disturb_state) disturb(FALSE, FALSE);
1780 p_ptr->update |= (PU_BONUS);
1786 * @brief 一時的闘気のオーラの継続時間をセットする / Set "p_ptr->tim_sh_touki", notice observable changes
1788 * @param do_dec 現在の継続時間より長い値のみ上書きする
1789 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1791 bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec)
1793 bool notice = FALSE;
1794 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1796 if (p_ptr->is_dead) return FALSE;
1801 if (p_ptr->tim_sh_touki && !do_dec)
1803 if (p_ptr->tim_sh_touki > v) return FALSE;
1805 else if (!p_ptr->tim_sh_touki)
1807 msg_print(_("体が闘気のオーラで覆われた。", "You have enveloped by the aura of the Force!"));
1815 if (p_ptr->tim_sh_touki)
1817 msg_print(_("闘気が消えた。", "Aura of the Force disappeared."));
1823 p_ptr->tim_sh_touki = v;
1824 p_ptr->redraw |= (PR_STATUS);
1826 /* Nothing to notice */
1827 if (!notice) return (FALSE);
1829 if (disturb_state) disturb(FALSE, FALSE);
1835 * @brief 一時的火炎のオーラの継続時間をセットする / Set "p_ptr->tim_sh_fire", notice observable changes
1837 * @param do_dec 現在の継続時間より長い値のみ上書きする
1838 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1840 bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec)
1842 bool notice = FALSE;
1843 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1845 if (p_ptr->is_dead) return FALSE;
1850 if (p_ptr->tim_sh_fire && !do_dec)
1852 if (p_ptr->tim_sh_fire > v) return FALSE;
1854 else if (!p_ptr->tim_sh_fire)
1856 msg_print(_("体が炎のオーラで覆われた。", "You have enveloped by fiery aura!"));
1864 if (p_ptr->tim_sh_fire)
1866 msg_print(_("炎のオーラが消えた。", "Fiery aura disappeared."));
1872 p_ptr->tim_sh_fire = v;
1873 p_ptr->redraw |= (PR_STATUS);
1875 /* Nothing to notice */
1876 if (!notice) return (FALSE);
1878 if (disturb_state) disturb(FALSE, FALSE);
1879 p_ptr->update |= (PU_BONUS);
1885 * @brief 一時的聖なるのオーラの継続時間をセットする / Set "p_ptr->tim_sh_holy", notice observable changes
1887 * @param do_dec 現在の継続時間より長い値のみ上書きする
1888 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1890 bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec)
1892 bool notice = FALSE;
1893 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1895 if (p_ptr->is_dead) return FALSE;
1900 if (p_ptr->tim_sh_holy && !do_dec)
1902 if (p_ptr->tim_sh_holy > v) return FALSE;
1904 else if (!p_ptr->tim_sh_holy)
1906 msg_print(_("体が聖なるオーラで覆われた。", "You have enveloped by holy aura!"));
1914 if (p_ptr->tim_sh_holy)
1916 msg_print(_("聖なるオーラが消えた。", "Holy aura disappeared."));
1922 p_ptr->tim_sh_holy = v;
1923 p_ptr->redraw |= (PR_STATUS);
1925 /* Nothing to notice */
1926 if (!notice) return (FALSE);
1928 if (disturb_state) disturb(FALSE, FALSE);
1929 p_ptr->update |= (PU_BONUS);
1935 * @brief 目には目をの残り時間をセットする / Set "p_ptr->tim_eyeeye", notice observable changes
1937 * @param do_dec 現在の継続時間より長い値のみ上書きする
1938 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1940 bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec)
1942 bool notice = FALSE;
1943 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1945 if (p_ptr->is_dead) return FALSE;
1950 if (p_ptr->tim_eyeeye && !do_dec)
1952 if (p_ptr->tim_eyeeye > v) return FALSE;
1954 else if (!p_ptr->tim_eyeeye)
1956 msg_print(_("法の守り手になった気がした!", "You feel like a keeper of commandments!"));
1964 if (p_ptr->tim_eyeeye)
1966 msg_print(_("懲罰を執行することができなくなった。", "You no longer feel like a keeper."));
1972 p_ptr->tim_eyeeye = v;
1973 p_ptr->redraw |= (PR_STATUS);
1975 /* Nothing to notice */
1976 if (!notice) return (FALSE);
1978 if (disturb_state) disturb(FALSE, FALSE);
1979 p_ptr->update |= (PU_BONUS);
1986 * @brief 一時的魔法防御の継続時間をセットする / Set "p_ptr->resist_magic", notice observable changes
1988 * @param do_dec 現在の継続時間より長い値のみ上書きする
1989 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1991 bool set_resist_magic(TIME_EFFECT v, bool do_dec)
1993 bool notice = FALSE;
1994 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1996 if (p_ptr->is_dead) return FALSE;
2001 if (p_ptr->resist_magic && !do_dec)
2003 if (p_ptr->resist_magic > v) return FALSE;
2005 else if (!p_ptr->resist_magic)
2007 msg_print(_("魔法への耐性がついた。", "You have been protected from magic!"));
2015 if (p_ptr->resist_magic)
2017 msg_print(_("魔法に弱くなった。", "You are no longer protected from magic."));
2023 p_ptr->resist_magic = v;
2024 p_ptr->redraw |= (PR_STATUS);
2026 /* Nothing to notice */
2027 if (!notice) return (FALSE);
2029 if (disturb_state) disturb(FALSE, FALSE);
2030 p_ptr->update |= (PU_BONUS);
2036 * @brief 一時的反射の継続時間をセットする / Set "p_ptr->tim_reflect", notice observable changes
2038 * @param do_dec 現在の継続時間より長い値のみ上書きする
2039 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2041 bool set_tim_reflect(TIME_EFFECT v, bool do_dec)
2043 bool notice = FALSE;
2044 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2046 if (p_ptr->is_dead) return FALSE;
2051 if (p_ptr->tim_reflect && !do_dec)
2053 if (p_ptr->tim_reflect > v) return FALSE;
2055 else if (!p_ptr->tim_reflect)
2057 msg_print(_("体の表面が滑かになった気がする。", "Your body becames smooth."));
2065 if (p_ptr->tim_reflect)
2067 msg_print(_("体の表面が滑かでなくなった。", "Your body is no longer smooth."));
2073 p_ptr->tim_reflect = v;
2074 p_ptr->redraw |= (PR_STATUS);
2076 /* Nothing to notice */
2077 if (!notice) return (FALSE);
2079 if (disturb_state) disturb(FALSE, FALSE);
2080 p_ptr->update |= (PU_BONUS);
2087 * Set "p_ptr->multishadow", notice observable changes
2089 bool set_multishadow(TIME_EFFECT v, bool do_dec)
2091 bool notice = FALSE;
2092 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2094 if (p_ptr->is_dead) return FALSE;
2099 if (p_ptr->multishadow && !do_dec)
2101 if (p_ptr->multishadow > v) return FALSE;
2103 else if (!p_ptr->multishadow)
2105 msg_print(_("あなたの周りに幻影が生まれた。", "Your Shadow enveloped you."));
2113 if (p_ptr->multishadow)
2115 msg_print(_("幻影が消えた。", "Your Shadow disappears."));
2121 p_ptr->multishadow = v;
2122 p_ptr->redraw |= (PR_STATUS);
2124 /* Nothing to notice */
2125 if (!notice) return (FALSE);
2127 if (disturb_state) disturb(FALSE, FALSE);
2128 p_ptr->update |= (PU_BONUS);
2134 * @brief 一時的破片のオーラの継続時間をセットする / Set "p_ptr->dustrobe", notice observable changes
2136 * @param do_dec 現在の継続時間より長い値のみ上書きする
2137 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2139 bool set_dustrobe(TIME_EFFECT v, bool do_dec)
2141 bool notice = FALSE;
2142 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2144 if (p_ptr->is_dead) return FALSE;
2149 if (p_ptr->dustrobe && !do_dec)
2151 if (p_ptr->dustrobe > v) return FALSE;
2153 else if (!p_ptr->dustrobe)
2155 msg_print(_("体が鏡のオーラで覆われた。", "You were enveloped by mirror shards."));
2163 if (p_ptr->dustrobe)
2165 msg_print(_("鏡のオーラが消えた。", "The mirror shards disappear."));
2171 p_ptr->dustrobe = v;
2172 p_ptr->redraw |= (PR_STATUS);
2174 /* Nothing to notice */
2175 if (!notice) return (FALSE);
2177 if (disturb_state) disturb(FALSE, FALSE);
2178 p_ptr->update |= (PU_BONUS);
2184 * @brief 一時的壁抜けの継続時間をセットする / Set "p_ptr->kabenuke", notice observable changes
2186 * @param do_dec 現在の継続時間より長い値のみ上書きする
2187 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2189 bool set_kabenuke(TIME_EFFECT v, bool do_dec)
2191 bool notice = FALSE;
2192 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2194 if (p_ptr->is_dead) return FALSE;
2199 if (p_ptr->kabenuke && !do_dec)
2201 if (p_ptr->kabenuke > v) return FALSE;
2203 else if (!p_ptr->kabenuke)
2205 msg_print(_("体が半物質の状態になった。", "You became ethereal form."));
2213 if (p_ptr->kabenuke)
2215 msg_print(_("体が物質化した。", "You are no longer in an ethereal form."));
2221 p_ptr->kabenuke = v;
2222 p_ptr->redraw |= (PR_STATUS);
2224 /* Nothing to notice */
2225 if (!notice) return (FALSE);
2227 if (disturb_state) disturb(FALSE, FALSE);
2228 p_ptr->update |= (PU_BONUS);
2234 * @brief オクレ兄さんの継続時間をセットする / Set "p_ptr->tsuyoshi", notice observable changes
2236 * @param do_dec 現在の継続時間より長い値のみ上書きする
2237 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2239 bool set_tsuyoshi(TIME_EFFECT v, bool do_dec)
2241 bool notice = FALSE;
2242 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2244 if (p_ptr->is_dead) return FALSE;
2249 if (p_ptr->tsuyoshi && !do_dec)
2251 if (p_ptr->tsuyoshi > v) return FALSE;
2253 else if (!p_ptr->tsuyoshi)
2255 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
2257 chg_virtue(V_VITALITY, 2);
2264 if (p_ptr->tsuyoshi)
2266 msg_print(_("肉体が急速にしぼんでいった。", "Your body had quickly shriveled."));
2268 (void)dec_stat(A_CON, 20, TRUE);
2269 (void)dec_stat(A_STR, 20, TRUE);
2272 chg_virtue(V_VITALITY, -3);
2277 p_ptr->tsuyoshi = v;
2278 p_ptr->redraw |= (PR_STATUS);
2280 /* Nothing to notice */
2281 if (!notice) return (FALSE);
2283 if (disturb_state) disturb(FALSE, FALSE);
2284 p_ptr->update |= (PU_BONUS);
2286 /* Recalculate hitpoints */
2287 p_ptr->update |= (PU_HP);
2293 * @brief 一時的元素スレイの継続時間をセットする / Set a temporary elemental brand. Clear all other brands. Print status messages. -LM-
2294 * @param attack_type スレイのタイプID
2296 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2298 bool set_ele_attack(u32b attack_type, TIME_EFFECT v)
2300 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2302 /* Clear all elemental attacks (only one is allowed at a time). */
2303 if ((p_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
2305 p_ptr->special_attack &= ~(ATTACK_ACID);
2306 msg_print(_("酸で攻撃できなくなった。", "Your temporary acidic brand fades away."));
2308 if ((p_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
2310 p_ptr->special_attack &= ~(ATTACK_ELEC);
2311 msg_print(_("電撃で攻撃できなくなった。", "Your temporary electrical brand fades away."));
2313 if ((p_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
2315 p_ptr->special_attack &= ~(ATTACK_FIRE);
2316 msg_print(_("火炎で攻撃できなくなった。", "Your temporary fiery brand fades away."));
2318 if ((p_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
2320 p_ptr->special_attack &= ~(ATTACK_COLD);
2321 msg_print(_("冷気で攻撃できなくなった。", "Your temporary frost brand fades away."));
2323 if ((p_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
2325 p_ptr->special_attack &= ~(ATTACK_POIS);
2326 msg_print(_("毒で攻撃できなくなった。", "Your temporary poison brand fades away."));
2329 if ((v) && (attack_type))
2331 /* Set attack type. */
2332 p_ptr->special_attack |= (attack_type);
2335 p_ptr->ele_attack = v;
2338 msg_format("%sで攻撃できるようになった!",
2339 ((attack_type == ATTACK_ACID) ? "酸" :
2340 ((attack_type == ATTACK_ELEC) ? "電撃" :
2341 ((attack_type == ATTACK_FIRE) ? "火炎" :
2342 ((attack_type == ATTACK_COLD) ? "冷気" :
2343 ((attack_type == ATTACK_POIS) ? "毒" :
2346 msg_format("For a while, the blows you deal will %s",
2347 ((attack_type == ATTACK_ACID) ? "melt with acid!" :
2348 ((attack_type == ATTACK_ELEC) ? "shock your foes!" :
2349 ((attack_type == ATTACK_FIRE) ? "burn with fire!" :
2350 ((attack_type == ATTACK_COLD) ? "chill to the bone!" :
2351 ((attack_type == ATTACK_POIS) ? "poison your enemies!" :
2352 "do nothing special."))))));
2356 if (disturb_state) disturb(FALSE, FALSE);
2357 p_ptr->redraw |= (PR_STATUS);
2359 p_ptr->update |= (PU_BONUS);
2366 * @brief 一時的元素免疫の継続時間をセットする / Set a temporary elemental brand. Clear all other brands. Print status messages. -LM-
2367 * @param immune_type 免疫のタイプID
2369 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2371 bool set_ele_immune(u32b immune_type, TIME_EFFECT v)
2373 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2375 /* Clear all elemental attacks (only one is allowed at a time). */
2376 if ((p_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
2378 p_ptr->special_defense &= ~(DEFENSE_ACID);
2379 msg_print(_("酸の攻撃で傷つけられるようになった。。", "You are no longer immune to acid."));
2381 if ((p_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
2383 p_ptr->special_defense &= ~(DEFENSE_ELEC);
2384 msg_print(_("電撃の攻撃で傷つけられるようになった。。", "You are no longer immune to electricity."));
2386 if ((p_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
2388 p_ptr->special_defense &= ~(DEFENSE_FIRE);
2389 msg_print(_("火炎の攻撃で傷つけられるようになった。。", "You are no longer immune to fire."));
2391 if ((p_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
2393 p_ptr->special_defense &= ~(DEFENSE_COLD);
2394 msg_print(_("冷気の攻撃で傷つけられるようになった。。", "You are no longer immune to cold."));
2396 if ((p_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
2398 p_ptr->special_defense &= ~(DEFENSE_POIS);
2399 msg_print(_("毒の攻撃で傷つけられるようになった。。", "You are no longer immune to poison."));
2402 if ((v) && (immune_type))
2404 /* Set attack type. */
2405 p_ptr->special_defense |= (immune_type);
2408 p_ptr->ele_immune = v;
2410 msg_format(_("%sの攻撃を受けつけなくなった!", "For a while, You are immune to %s"),
2411 ((immune_type == DEFENSE_ACID) ? _("酸", "acid!") :
2412 ((immune_type == DEFENSE_ELEC) ? _("電撃", "electricity!") :
2413 ((immune_type == DEFENSE_FIRE) ? _("火炎", "fire!") :
2414 ((immune_type == DEFENSE_COLD) ? _("冷気", "cold!") :
2415 ((immune_type == DEFENSE_POIS) ? _("毒", "poison!") :
2416 _("(なし)", "do nothing special.")))))));
2419 if (disturb_state) disturb(FALSE, FALSE);
2420 p_ptr->redraw |= (PR_STATUS);
2421 p_ptr->update |= (PU_BONUS);
2428 * @brief 一時的酸耐性の継続時間をセットする / Set "p_ptr->oppose_acid", notice observable changes
2430 * @param do_dec 現在の継続時間より長い値のみ上書きする
2431 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2433 bool set_oppose_acid(TIME_EFFECT v, bool do_dec)
2435 bool notice = FALSE;
2436 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2438 if (p_ptr->is_dead) return FALSE;
2443 if (p_ptr->oppose_acid && !do_dec)
2445 if (p_ptr->oppose_acid > v) return FALSE;
2447 else if (!IS_OPPOSE_ACID())
2449 msg_print(_("酸への耐性がついた気がする!", "You feel resistant to acid!"));
2457 if (p_ptr->oppose_acid && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2459 msg_print(_("酸への耐性が薄れた気がする。", "You feel less resistant to acid."));
2465 p_ptr->oppose_acid = v;
2467 /* Nothing to notice */
2468 if (!notice) return (FALSE);
2469 p_ptr->redraw |= (PR_STATUS);
2471 if (disturb_state) disturb(FALSE, FALSE);
2477 * @brief 一時的電撃耐性の継続時間をセットする / Set "p_ptr->oppose_elec", notice observable changes
2479 * @param do_dec 現在の継続時間より長い値のみ上書きする
2480 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2482 bool set_oppose_elec(TIME_EFFECT v, bool do_dec)
2484 bool notice = FALSE;
2485 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2487 if (p_ptr->is_dead) return FALSE;
2492 if (p_ptr->oppose_elec && !do_dec)
2494 if (p_ptr->oppose_elec > v) return FALSE;
2496 else if (!IS_OPPOSE_ELEC())
2498 msg_print(_("電撃への耐性がついた気がする!", "You feel resistant to electricity!"));
2506 if (p_ptr->oppose_elec && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2508 msg_print(_("電撃への耐性が薄れた気がする。", "You feel less resistant to electricity."));
2514 p_ptr->oppose_elec = v;
2516 /* Nothing to notice */
2517 if (!notice) return (FALSE);
2518 p_ptr->redraw |= (PR_STATUS);
2520 if (disturb_state) disturb(FALSE, FALSE);
2526 * @brief 一時的火炎耐性の継続時間をセットする / Set "p_ptr->oppose_fire", notice observable changes
2528 * @param do_dec 現在の継続時間より長い値のみ上書きする
2529 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2531 bool set_oppose_fire(TIME_EFFECT v, bool do_dec)
2533 bool notice = FALSE;
2534 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2536 if (p_ptr->is_dead) return FALSE;
2538 if ((prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
2542 if (p_ptr->oppose_fire && !do_dec)
2544 if (p_ptr->oppose_fire > v) return FALSE;
2546 else if (!IS_OPPOSE_FIRE())
2548 msg_print(_("火への耐性がついた気がする!", "You feel resistant to fire!"));
2556 if (p_ptr->oppose_fire && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2558 msg_print(_("火への耐性が薄れた気がする。", "You feel less resistant to fire."));
2564 p_ptr->oppose_fire = v;
2566 /* Nothing to notice */
2567 if (!notice) return (FALSE);
2568 p_ptr->redraw |= (PR_STATUS);
2570 if (disturb_state) disturb(FALSE, FALSE);
2576 * @brief 一時的冷気耐性の継続時間をセットする / Set "p_ptr->oppose_cold", notice observable changes
2578 * @param do_dec 現在の継続時間より長い値のみ上書きする
2579 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2581 bool set_oppose_cold(TIME_EFFECT v, bool do_dec)
2583 bool notice = FALSE;
2584 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2586 if (p_ptr->is_dead) return FALSE;
2591 if (p_ptr->oppose_cold && !do_dec)
2593 if (p_ptr->oppose_cold > v) return FALSE;
2595 else if (!IS_OPPOSE_COLD())
2597 msg_print(_("冷気への耐性がついた気がする!", "You feel resistant to cold!"));
2605 if (p_ptr->oppose_cold && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2607 msg_print(_("冷気への耐性が薄れた気がする。", "You feel less resistant to cold."));
2613 p_ptr->oppose_cold = v;
2615 /* Nothing to notice */
2616 if (!notice) return (FALSE);
2617 p_ptr->redraw |= (PR_STATUS);
2619 if (disturb_state) disturb(FALSE, FALSE);
2625 * @brief 一時的毒耐性の継続時間をセットする / Set "p_ptr->oppose_pois", notice observable changes
2627 * @param do_dec 現在の継続時間より長い値のみ上書きする
2628 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2630 bool set_oppose_pois(TIME_EFFECT v, bool do_dec)
2632 bool notice = FALSE;
2633 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2635 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) v = 1;
2636 if (p_ptr->is_dead) return FALSE;
2641 if (p_ptr->oppose_pois && !do_dec)
2643 if (p_ptr->oppose_pois > v) return FALSE;
2645 else if (!IS_OPPOSE_POIS())
2647 msg_print(_("毒への耐性がついた気がする!", "You feel resistant to poison!"));
2655 if (p_ptr->oppose_pois && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2657 msg_print(_("毒への耐性が薄れた気がする。", "You feel less resistant to poison."));
2663 p_ptr->oppose_pois = v;
2665 /* Nothing to notice */
2666 if (!notice) return (FALSE);
2667 p_ptr->redraw |= (PR_STATUS);
2669 if (disturb_state) disturb(FALSE, FALSE);
2675 * @brief 朦朧の継続時間をセットする / Set "p_ptr->stun", notice observable changes
2677 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2679 * Note the special code to only notice "range" changes.
2681 bool set_stun(TIME_EFFECT v)
2683 int old_aux, new_aux;
2684 bool notice = FALSE;
2685 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2687 if (p_ptr->is_dead) return FALSE;
2688 if (prace_is_(RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
2691 if (p_ptr->stun > 100)
2697 else if (p_ptr->stun > 50)
2703 else if (p_ptr->stun > 0)
2739 if (new_aux > old_aux)
2741 /* Describe the state */
2745 case 1: msg_print(_("意識がもうろうとしてきた。", "You have been stunned.")); break;
2748 case 2: msg_print(_("意識がひどくもうろうとしてきた。", "You have been heavily stunned.")); break;
2751 case 3: msg_print(_("頭がクラクラして意識が遠のいてきた。", "You have been knocked out.")); break;
2754 if (randint1(1000) < v || one_in_(16))
2756 msg_print(_("割れるような頭痛がする。", "A vicious blow hits your head."));
2760 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
2761 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
2763 else if (one_in_(2))
2765 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
2769 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
2772 if (p_ptr->special_defense & KATA_MASK)
2774 msg_print(_("型が崩れた。", "Your posture gets loose."));
2775 p_ptr->special_defense &= ~(KATA_MASK);
2776 p_ptr->update |= (PU_BONUS);
2777 p_ptr->update |= (PU_MONSTERS);
2778 p_ptr->redraw |= (PR_STATE);
2779 p_ptr->redraw |= (PR_STATUS);
2780 p_ptr->action = ACTION_NONE;
2784 if (p_ptr->concent) reset_concentration(TRUE);
2787 if (hex_spelling_any()) stop_hex_spell_all();
2793 else if (new_aux < old_aux)
2795 /* Describe the state */
2800 msg_print(_("やっと朦朧状態から回復した。", "You are no longer stunned."));
2802 if (disturb_state) disturb(FALSE, FALSE);
2813 if (!notice) return (FALSE);
2815 if (disturb_state) disturb(FALSE, FALSE);
2816 p_ptr->update |= (PU_BONUS);
2818 /* Redraw the "stun" */
2819 p_ptr->redraw |= (PR_STUN);
2826 * @brief 出血の継続時間をセットする / Set "p_ptr->cut", notice observable changes
2828 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2830 * Note the special code to only notice "range" changes.
2832 bool set_cut(TIME_EFFECT v)
2834 int old_aux, new_aux;
2835 bool notice = FALSE;
2836 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2838 if (p_ptr->is_dead) return FALSE;
2840 if ((p_ptr->prace == RACE_GOLEM ||
2841 p_ptr->prace == RACE_SKELETON ||
2842 p_ptr->prace == RACE_SPECTRE ||
2843 (p_ptr->prace == RACE_ZOMBIE && p_ptr->lev > 11)) &&
2848 if (p_ptr->cut > 1000)
2854 else if (p_ptr->cut > 200)
2860 else if (p_ptr->cut > 100)
2866 else if (p_ptr->cut > 50)
2872 else if (p_ptr->cut > 25)
2878 else if (p_ptr->cut > 10)
2884 else if (p_ptr->cut > 0)
2944 if (new_aux > old_aux)
2946 /* Describe the state */
2950 case 1: msg_print(_("かすり傷を負ってしまった。", "You have been given a graze.")); break;
2953 case 2: msg_print(_("軽い傷を負ってしまった。", "You have been given a light cut.")); break;
2956 case 3: msg_print(_("ひどい傷を負ってしまった。", "You have been given a bad cut.")); break;
2959 case 4: msg_print(_("大変な傷を負ってしまった。", "You have been given a nasty cut.")); break;
2962 case 5: msg_print(_("重大な傷を負ってしまった。", "You have been given a severe cut.")); break;
2965 case 6: msg_print(_("ひどい深手を負ってしまった。", "You have been given a deep gash.")); break;
2968 case 7: msg_print(_("致命的な傷を負ってしまった。", "You have been given a mortal wound.")); break;
2973 if (randint1(1000) < v || one_in_(16))
2975 if (!p_ptr->sustain_chr)
2977 msg_print(_("ひどい傷跡が残ってしまった。", "You have been horribly scarred."));
2984 else if (new_aux < old_aux)
2986 /* Describe the state */
2991 msg_format(_("やっと%s。", "You are no longer bleeding."), p_ptr->prace == RACE_ANDROID ? "怪我が直った" : "出血が止まった");
2993 if (disturb_state) disturb(FALSE, FALSE);
3004 if (!notice) return (FALSE);
3006 if (disturb_state) disturb(FALSE, FALSE);
3007 p_ptr->update |= (PU_BONUS);
3009 /* Redraw the "cut" */
3010 p_ptr->redraw |= (PR_CUT);
3016 * @brief 空腹状態をセットする / Set "p_ptr->food", notice observable changes
3018 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
3020 * Set "", notice observable changes\n
3022 * The "p_ptr->food" variable can get as large as 20000, allowing the
3023 * addition of the most "filling" item, Elvish Waybread, which adds
3024 * 7500 food units, without overflowing the 32767 maximum limit.\n
3026 * Perhaps we should disturb the player with various messages,
3027 * especially messages about hunger status changes. \n
3029 * Digestion of food is handled in "dungeon.c", in which, normally,
3030 * the player digests about 20 food units per 100 game turns, more
3031 * when "fast", more when "regenerating", less with "slow digestion",
3032 * but when the player is "gorged", he digests 100 food units per 10
3033 * game turns, or a full 1000 food units per 100 game turns.\n
3035 * Note that the player's speed is reduced by 10 units while gorged,
3036 * so if the player eats a single food ration (5000 food units) when
3037 * full (15000 food units), he will be gorged for (5000/100)*10 = 500
3038 * game turns, or 500/(100/5) = 25 player turns (if nothing else is
3039 * affecting the player speed).\n
3041 bool set_food(TIME_EFFECT v)
3043 int old_aux, new_aux;
3045 bool notice = FALSE;
3046 v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
3048 /* Fainting / Starving */
3049 if (p_ptr->food < PY_FOOD_FAINT)
3055 else if (p_ptr->food < PY_FOOD_WEAK)
3061 else if (p_ptr->food < PY_FOOD_ALERT)
3067 else if (p_ptr->food < PY_FOOD_FULL)
3073 else if (p_ptr->food < PY_FOOD_MAX)
3084 /* Fainting / Starving */
3085 if (v < PY_FOOD_FAINT)
3091 else if (v < PY_FOOD_WEAK)
3097 else if (v < PY_FOOD_ALERT)
3103 else if (v < PY_FOOD_FULL)
3109 else if (v < PY_FOOD_MAX)
3120 if (old_aux < 1 && new_aux > 0)
3121 chg_virtue(V_PATIENCE, 2);
3122 else if (old_aux < 3 && (old_aux != new_aux))
3123 chg_virtue(V_PATIENCE, 1);
3125 chg_virtue(V_TEMPERANCE, 1);
3127 chg_virtue(V_TEMPERANCE, -1);
3130 if (new_aux > old_aux)
3132 /* Describe the state */
3136 case 1: msg_print(_("まだ空腹で倒れそうだ。", "You are still weak.")); break;
3139 case 2: msg_print(_("まだ空腹だ。", "You are still hungry.")); break;
3142 case 3: msg_print(_("空腹感がおさまった。", "You are no longer hungry.")); break;
3145 case 4: msg_print(_("満腹だ!", "You are full!")); break;
3149 msg_print(_("食べ過ぎだ!", "You have gorged yourself!"));
3150 chg_virtue(V_HARMONY, -1);
3151 chg_virtue(V_PATIENCE, -1);
3152 chg_virtue(V_TEMPERANCE, -2);
3162 else if (new_aux < old_aux)
3164 /* Describe the state */
3167 /* Fainting / Starving */
3168 case 0: msg_print(_("あまりにも空腹で気を失ってしまった!", "You are getting faint from hunger!")); break;
3171 case 1: msg_print(_("お腹が空いて倒れそうだ。", "You are getting weak from hunger!")); break;
3174 case 2: msg_print(_("お腹が空いてきた。", "You are getting hungry.")); break;
3177 case 3: msg_print(_("満腹感がなくなった。", "You are no longer full.")); break;
3180 case 4: msg_print(_("やっとお腹がきつくなくなった。", "You are no longer gorged.")); break;
3183 if (p_ptr->wild_mode && (new_aux < 2))
3185 change_wild_mode(FALSE);
3195 /* Nothing to notice */
3196 if (!notice) return (FALSE);
3198 if (disturb_state) disturb(FALSE, FALSE);
3199 p_ptr->update |= (PU_BONUS);
3202 p_ptr->redraw |= (PR_HUNGER);
3208 * @brief プレイヤーの基本能力値を増加させる / Increases a stat by one randomized level -RAK-
3209 * @param stat 上昇させるステータスID
3210 * @return 実際に上昇した場合TRUEを返す。
3212 * Note that this function (used by stat potions) now restores\n
3213 * the stat BEFORE increasing it.\n
3215 bool inc_stat(int stat)
3217 BASE_STATUS value, gain;
3219 /* Then augment the current/max stat */
3220 value = p_ptr->stat_cur[stat];
3222 /* Cannot go above 18/100 */
3223 if (value < p_ptr->stat_max_max[stat])
3225 /* Gain one (sometimes two) points */
3228 gain = ((randint0(100) < 75) ? 1 : 2);
3232 /* Gain 1/6 to 1/3 of distance to 18/100 */
3233 else if (value < (p_ptr->stat_max_max[stat]-2))
3235 /* Approximate gain value */
3236 gain = (((p_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
3237 if (gain < 1) gain = 1;
3239 /* Apply the bonus */
3240 value += randint1(gain) + gain / 2;
3243 if (value > (p_ptr->stat_max_max[stat]-1)) value = p_ptr->stat_max_max[stat]-1;
3246 /* Gain one point at a time */
3252 /* Save the new value */
3253 p_ptr->stat_cur[stat] = value;
3255 /* Bring up the maximum too */
3256 if (value > p_ptr->stat_max[stat])
3258 p_ptr->stat_max[stat] = value;
3260 p_ptr->update |= (PU_BONUS);
3266 /* Nothing to gain */
3271 * @brief プレイヤーの基本能力値を減少させる / Decreases a stat by an amount indended to vary from 0 to 100 percent.
3272 * @param stat 減少させるステータスID
3273 * @param amount 減少させる基本量
3274 * @param permanent TRUEならば現在の最大値を減少させる
3275 * @return 実際に減少した場合TRUEを返す。
3278 * Amount could be a little higher in extreme cases to mangle very high\n
3279 * stats from massive assaults. -CWS\n
3281 * Note that "permanent" means that the *given* amount is permanent,\n
3282 * not that the new value becomes permanent. This may not work exactly\n
3283 * as expected, due to "weirdness" in the algorithm, but in general,\n
3284 * if your stat is already drained, the "max" value will not drop all\n
3285 * the way down to the "cur" value.\n
3287 bool dec_stat(int stat, int amount, int permanent)
3289 BASE_STATUS cur, max;
3294 /* Acquire current value */
3295 cur = p_ptr->stat_cur[stat];
3296 max = p_ptr->stat_max[stat];
3298 /* Note when the values are identical */
3299 same = (cur == max);
3301 /* Damage "current" value */
3304 /* Handle "low" values */
3307 if (amount > 90) cur--;
3308 if (amount > 50) cur--;
3309 if (amount > 20) cur--;
3313 /* Handle "high" values */
3316 /* Hack -- Decrement by a random amount between one-quarter */
3317 /* and one-half of the stat bonus times the percentage, with a */
3318 /* minimum damage of half the percentage. -CWS */
3319 loss = (((cur-18) / 2 + 1) / 2 + 1);
3320 if (loss < 1) loss = 1;
3322 /* Randomize the loss */
3323 loss = ((randint1(loss) + loss) * amount) / 100;
3326 if (loss < amount/2) loss = amount/2;
3328 /* Lose some points */
3331 /* Hack -- Only reduce stat to 17 sometimes */
3332 if (cur < 18) cur = (amount <= 20) ? 18 : 17;
3335 /* Prevent illegal values */
3336 if (cur < 3) cur = 3;
3338 /* Something happened */
3339 if (cur != p_ptr->stat_cur[stat]) res = TRUE;
3342 /* Damage "max" value */
3343 if (permanent && (max > 3))
3345 chg_virtue(V_SACRIFICE, 1);
3346 if (stat == A_WIS || stat == A_INT)
3347 chg_virtue(V_ENLIGHTEN, -2);
3349 /* Handle "low" values */
3352 if (amount > 90) max--;
3353 if (amount > 50) max--;
3354 if (amount > 20) max--;
3358 /* Handle "high" values */
3361 /* Hack -- Decrement by a random amount between one-quarter */
3362 /* and one-half of the stat bonus times the percentage, with a */
3363 /* minimum damage of half the percentage. -CWS */
3364 loss = (((max-18) / 2 + 1) / 2 + 1);
3365 loss = ((randint1(loss) + loss) * amount) / 100;
3366 if (loss < amount/2) loss = amount/2;
3368 /* Lose some points */
3371 /* Hack -- Only reduce stat to 17 sometimes */
3372 if (max < 18) max = (amount <= 20) ? 18 : 17;
3375 /* Hack -- keep it clean */
3376 if (same || (max < cur)) max = cur;
3378 /* Something happened */
3379 if (max != p_ptr->stat_max[stat]) res = TRUE;
3384 /* Actually set the stat to its new value. */
3385 p_ptr->stat_cur[stat] = cur;
3386 p_ptr->stat_max[stat] = max;
3388 p_ptr->redraw |= (PR_STATS);
3389 p_ptr->update |= (PU_BONUS);
3397 * @brief プレイヤーの基本能力値を回復させる / Restore a stat. Return TRUE only if this actually makes a difference.
3398 * @param stat 回復ステータスID
3399 * @return 実際に回復した場合TRUEを返す。
3401 bool res_stat(int stat)
3403 /* Restore if needed */
3404 if (p_ptr->stat_cur[stat] != p_ptr->stat_max[stat])
3406 p_ptr->stat_cur[stat] = p_ptr->stat_max[stat];
3407 p_ptr->update |= (PU_BONUS);
3408 p_ptr->redraw |= (PR_STATS);
3414 /* Nothing to restore */
3420 * Increase players hit points, notice effects
3422 bool hp_player(int num)
3425 vir = virtue_number(V_VITALITY);
3427 if(num <= 0) return (FALSE);
3431 num = num * (p_ptr->virtues[vir - 1] + 1250) / 1250;
3433 /* Healing needed */
3434 if (p_ptr->chp < p_ptr->mhp)
3436 if ((num > 0) && (p_ptr->chp < (p_ptr->mhp/3)))
3437 chg_virtue(V_TEMPERANCE, 1);
3438 /* Gain hitpoints */
3441 /* Enforce maximum */
3442 if (p_ptr->chp >= p_ptr->mhp)
3444 p_ptr->chp = p_ptr->mhp;
3445 p_ptr->chp_frac = 0;
3448 p_ptr->redraw |= (PR_HP);
3450 p_ptr->window |= (PW_PLAYER);
3455 msg_print(_("少し気分が良くなった。", "You feel a little better."));
3461 msg_print(_("気分が良くなった。", "You feel better."));
3467 msg_print(_("とても気分が良くなった。", "You feel much better."));
3473 msg_print(_("ひじょうに気分が良くなった。", "You feel very good."));
3485 * Array of stat "descriptions"
3487 static concptr desc_stat_pos[] =
3492 _("器用に", "dextrous"),
3493 _("健康に", "healthy"),
3499 * Array of stat "descriptions"
3501 static concptr desc_stat_neg[] =
3506 _("不器用に", "clumsy"),
3507 _("不健康に", "sickly"),
3515 bool do_dec_stat(int stat)
3519 /* Access the "sustain" */
3522 case A_STR: if (p_ptr->sustain_str) sust = TRUE; break;
3523 case A_INT: if (p_ptr->sustain_int) sust = TRUE; break;
3524 case A_WIS: if (p_ptr->sustain_wis) sust = TRUE; break;
3525 case A_DEX: if (p_ptr->sustain_dex) sust = TRUE; break;
3526 case A_CON: if (p_ptr->sustain_con) sust = TRUE; break;
3527 case A_CHR: if (p_ptr->sustain_chr) sust = TRUE; break;
3531 if (sust && (!ironman_nightmare || randint0(13)))
3533 msg_format(_("%sなった気がしたが、すぐに元に戻った。", "You feel %s for a moment, but the feeling passes."),
3534 desc_stat_neg[stat]);
3540 /* Attempt to reduce the stat */
3541 if (dec_stat(stat, 10, (ironman_nightmare && !randint0(13))))
3543 msg_format(_("ひどく%sなった気がする。", "You feel very %s."), desc_stat_neg[stat]);
3549 /* Nothing obvious */
3555 * Restore lost "points" in a stat
3557 bool do_res_stat(int stat)
3559 /* Attempt to increase */
3562 msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]);
3567 /* Nothing obvious */
3573 * Gain a "point" in a stat
3575 bool do_inc_stat(int stat)
3579 /* Restore strength */
3580 res = res_stat(stat);
3582 /* Attempt to increase */
3587 chg_virtue(V_ENLIGHTEN, 1);
3588 chg_virtue(V_FAITH, 1);
3590 else if (stat == A_INT)
3592 chg_virtue(V_KNOWLEDGE, 1);
3593 chg_virtue(V_ENLIGHTEN, 1);
3595 else if (stat == A_CON)
3596 chg_virtue(V_VITALITY, 1);
3598 msg_format(_("ワーオ!とても%sなった!", "Wow! You feel very %s!"), desc_stat_pos[stat]);
3603 /* Restoration worked */
3606 msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]);
3611 /* Nothing obvious */
3617 * Restores any drained experience
3619 bool restore_level(void)
3621 /* Restore experience */
3622 if (p_ptr->exp < p_ptr->max_exp)
3624 msg_print(_("経験値が戻ってきた気がする。", "You feel your experience returning."));
3626 /* Restore the experience */
3627 p_ptr->exp = p_ptr->max_exp;
3629 /* Check the experience */
3643 bool lose_all_info(void)
3647 chg_virtue(V_KNOWLEDGE, -5);
3648 chg_virtue(V_ENLIGHTEN, -5);
3650 /* Forget info about objects */
3651 for (i = 0; i < INVEN_TOTAL; i++)
3653 object_type *o_ptr = &p_ptr->inventory_list[i];
3654 if (!o_ptr->k_idx) continue;
3656 /* Allow "protection" by the MENTAL flag */
3657 if (o_ptr->ident & (IDENT_MENTAL)) continue;
3659 /* Remove "default inscriptions" */
3660 o_ptr->feeling = FEEL_NONE;
3662 /* Hack -- Clear the "empty" flag */
3663 o_ptr->ident &= ~(IDENT_EMPTY);
3665 /* Hack -- Clear the "known" flag */
3666 o_ptr->ident &= ~(IDENT_KNOWN);
3668 /* Hack -- Clear the "felt" flag */
3669 o_ptr->ident &= ~(IDENT_SENSE);
3671 p_ptr->update |= (PU_BONUS);
3672 p_ptr->update |= (PU_COMBINE | PU_REORDER);
3674 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3676 /* Mega-Hack -- Forget the map */
3684 void do_poly_wounds(void)
3686 /* Changed to always provide at least _some_ healing */
3687 s16b wounds = p_ptr->cut;
3688 s16b hit_p = (p_ptr->mhp - p_ptr->chp);
3689 s16b change = damroll(p_ptr->lev, 5);
3690 bool Nasty_effect = one_in_(5);
3692 if (!(wounds || hit_p || Nasty_effect)) return;
3694 msg_print(_("傷がより軽いものに変化した。", "Your wounds are polymorphed into less serious ones."));
3698 msg_print(_("新たな傷ができた!", "A new wound was created!"));
3699 take_hit(DAMAGE_LOSELIFE, change / 2, _("変化した傷", "a polymorphed wound"), -1);
3704 set_cut(p_ptr->cut - (change / 2));
3710 * Change player race
3712 void change_race(CHARACTER_IDX new_race, concptr effect_msg)
3714 concptr title = race_info[new_race].title;
3715 int old_race = p_ptr->prace;
3718 msg_format("あなたは%s%sに変化した!", effect_msg, title);
3720 msg_format("You current_world_ptr->game_turn into %s %s%s!", (!effect_msg[0] && is_a_vowel(title[0]) ? "an" : "a"), effect_msg, title);
3723 chg_virtue(V_CHANCE, 2);
3725 if (p_ptr->prace < 32)
3727 p_ptr->old_race1 |= 1L << p_ptr->prace;
3731 p_ptr->old_race2 |= 1L << (p_ptr->prace - 32);
3733 p_ptr->prace = new_race;
3734 rp_ptr = &race_info[p_ptr->prace];
3736 /* Experience factor */
3737 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
3740 * The speed bonus of Klackons and Sprites are disabled
3741 * and the experience penalty is decreased.
3743 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)))
3744 p_ptr->expfact -= 15;
3746 /* Get character's height and weight */
3747 get_height_weight();
3750 if (p_ptr->pclass == CLASS_SORCERER)
3751 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
3753 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
3755 roll_hitdice(p_ptr, 0L);
3757 /* The experience level may be modified */
3760 p_ptr->redraw |= (PR_BASIC);
3762 p_ptr->update |= (PU_BONUS);
3766 /* Load an autopick preference file */
3767 if (old_race != p_ptr->prace) autopick_load_pref(FALSE);
3769 /* Player's graphic tile may change */
3770 lite_spot(p_ptr->y, p_ptr->x);
3774 void do_poly_self(void)
3776 int power = p_ptr->lev;
3778 msg_print(_("あなたは変化の訪れを感じた...", "You feel a change coming over you..."));
3779 chg_virtue(V_CHANCE, 1);
3781 if ((power > randint0(20)) && one_in_(3) && (p_ptr->prace != RACE_ANDROID))
3783 char effect_msg[80] = "";
3784 CHARACTER_IDX new_race;
3786 /* Some form of racial polymorph... */
3789 if ((power > randint0(5)) && one_in_(4))
3794 if (p_ptr->psex == SEX_MALE)
3796 p_ptr->psex = SEX_FEMALE;
3797 sp_ptr = &sex_info[p_ptr->psex];
3798 sprintf(effect_msg, _("女性の", "female "));
3802 p_ptr->psex = SEX_MALE;
3803 sp_ptr = &sex_info[p_ptr->psex];
3804 sprintf(effect_msg, _("男性の", "male "));
3808 if ((power > randint0(30)) && one_in_(5))
3812 /* Harmful deformity */
3819 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
3825 /* Deformities are discriminated against! */
3826 (void)dec_stat(A_CHR, randint1(6), TRUE);
3831 sprintf(tmp_msg,_("%s", "%s "),effect_msg);
3832 sprintf(effect_msg,_("奇形の%s", "deformed %s "),tmp_msg);
3836 sprintf(effect_msg,_("奇形の", "deformed "));
3840 while ((power > randint0(20)) && one_in_(10))
3842 /* Polymorph into a less mutated form */
3845 if (!lose_mutation(0))
3846 msg_print(_("奇妙なくらい普通になった気がする。", "You feel oddly normal."));
3851 new_race = (CHARACTER_IDX)randint0(MAX_RACES);
3853 while ((new_race == p_ptr->prace) || (new_race == RACE_ANDROID));
3855 change_race(new_race, effect_msg);
3858 if ((power > randint0(30)) && one_in_(6))
3864 msg_format(_("%sの構成が変化した!", "Your internal organs are rearranged!"), p_ptr->prace == RACE_ANDROID ? "機械" : "内臓");
3868 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
3873 msg_print(_("現在の姿で生きていくのは困難なようだ!", "You find living difficult in your present form!"));
3874 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), _("致命的な突然変異", "a lethal mutation"), -1);
3880 if ((power > randint0(20)) && one_in_(4))
3885 roll_hitdice(p_ptr, 0L);
3888 while ((power > randint0(15)) && one_in_(3))
3891 (void)gain_mutation(p_ptr, 0);
3894 if (power > randint0(5))
3900 /* Note: earlier deductions may have left power < 0 already. */
3910 * Decreases players hit points and sets death flag if necessary
3912 * Invulnerability needs to be changed into a "shield"
3914 * Hack -- this function allows the user to save (or quit)
3915 * the game when he dies, since the "You die." message is shown before
3916 * setting the player to "dead".
3919 int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
3921 int old_chp = p_ptr->chp;
3923 char death_message[1024];
3926 int warning = (p_ptr->mhp * hitpoint_warn / 10);
3927 if (p_ptr->is_dead) return 0;
3929 if (p_ptr->sutemi) damage *= 2;
3930 if (p_ptr->special_defense & KATA_IAI) damage += (damage + 4) / 5;
3932 if (easy_band) damage = (damage+1)/2;
3934 if (damage_type != DAMAGE_USELIFE)
3936 disturb(TRUE, TRUE);
3939 p_ptr->now_damaged = TRUE;
3943 if (monspell >= 0) learn_spell(monspell);
3945 /* Mega-Hack -- Apply "invulnerability" */
3946 if ((damage_type != DAMAGE_USELIFE) && (damage_type != DAMAGE_LOSELIFE))
3948 if (IS_INVULN() && (damage < 9000))
3950 if (damage_type == DAMAGE_FORCE)
3952 msg_print(_("バリアが切り裂かれた!", "The attack cuts your shield of invulnerability open!"));
3954 else if (one_in_(PENETRATE_INVULNERABILITY))
3956 msg_print(_("無敵のバリアを破って攻撃された!", "The attack penetrates your shield of invulnerability!"));
3964 if (CHECK_MULTISHADOW())
3966 if (damage_type == DAMAGE_FORCE)
3968 msg_print(_("幻影もろとも体が切り裂かれた!", "The attack hits Shadow together with you!"));
3970 else if (damage_type == DAMAGE_ATTACK)
3972 msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, you are unharmed!"));
3977 if (p_ptr->wraith_form)
3979 if (damage_type == DAMAGE_FORCE)
3981 msg_print(_("半物質の体が切り裂かれた!", "The attack cuts through your ethereal body!"));
3986 if ((damage == 0) && one_in_(2)) damage = 1;
3990 if (p_ptr->special_defense & KATA_MUSOU)
3993 if ((damage == 0) && one_in_(2)) damage = 1;
3995 } /* not if LOSELIFE USELIFE */
3997 /* Hurt the player */
3998 p_ptr->chp -= damage;
3999 if(damage_type == DAMAGE_GENO && p_ptr->chp < 0)
4001 damage += p_ptr->chp;
4005 /* Display the hitpoints */
4006 p_ptr->redraw |= (PR_HP);
4008 p_ptr->window |= (PW_PLAYER);
4010 if (damage_type != DAMAGE_GENO && p_ptr->chp == 0)
4012 chg_virtue(V_SACRIFICE, 1);
4013 chg_virtue(V_CHANCE, 2);
4019 bool android = (p_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
4021 #ifdef JP /* 死んだ時に強制終了して死を回避できなくしてみた by Habu */
4023 if(!save_player()) msg_print("セーブ失敗!");
4028 chg_virtue(V_SACRIFICE, 10);
4031 p_ptr->leaving = TRUE;
4034 p_ptr->is_dead = TRUE;
4036 if (p_ptr->inside_arena)
4038 concptr m_name = r_name+r_info[arena_info[p_ptr->arena_number].r_idx].name;
4039 msg_format(_("あなたは%sの前に敗れ去った。", "You are beaten by %s."), m_name);
4041 if (record_arena) do_cmd_write_nikki(NIKKI_ARENA, -1 - p_ptr->arena_number, m_name);
4045 QUEST_IDX q_idx = quest_number(current_floor_ptr->dun_level);
4046 bool seppuku = streq(hit_from, "Seppuku");
4047 bool winning_seppuku = p_ptr->total_winner && seppuku;
4049 play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_GAMEOVER);
4052 /* Make screen dump */
4053 screen_dump = make_screen_dump();
4056 /* Note cause of death */
4059 strcpy(p_ptr->died_from, hit_from);
4061 if (!winning_seppuku) strcpy(p_ptr->died_from, "切腹");
4068 sprintf(dummy, "%s%s%s", !p_ptr->paralyzed ? "" : p_ptr->free_act ? "彫像状態で" : "麻痺状態で", p_ptr->image ? "幻覚に歪んだ" : "", hit_from);
4070 sprintf(dummy, "%s%s", hit_from, !p_ptr->paralyzed ? "" : " while helpless");
4072 my_strcpy(p_ptr->died_from, dummy, sizeof p_ptr->died_from);
4075 /* No longer a winner */
4076 p_ptr->total_winner = FALSE;
4078 if (winning_seppuku)
4080 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, _("勝利の後切腹した。", "did Seppuku after the winning."));
4086 if (p_ptr->inside_arena)
4087 strcpy(buf,_("アリーナ", "in the Arena"));
4088 else if (!current_floor_ptr->dun_level)
4089 strcpy(buf,_("地上", "on the surface"));
4090 else if (q_idx && (is_fixed_quest_idx(q_idx) &&
4091 !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
4092 strcpy(buf,_("クエスト", "in a quest"));
4094 sprintf(buf,_("%d階", "level %d"), (int)current_floor_ptr->dun_level);
4096 sprintf(tmp, _("%sで%sに殺された。", "killed by %s %s."), buf, p_ptr->died_from);
4097 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
4100 do_cmd_write_nikki(NIKKI_GAMESTART, 1, _("-------- ゲームオーバー --------", "-------- Game Over --------"));
4101 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, "\n\n\n\n");
4105 if (get_check_strict(_("画面を保存しますか?", "Dump the screen? "), CHECK_NO_HISTORY))
4107 do_cmd_save_screen();
4112 /* Initialize "last message" buffer */
4113 if (p_ptr->last_message) string_free(p_ptr->last_message);
4114 p_ptr->last_message = NULL;
4116 /* Hack -- Note death */
4120 msg_format("あなたは%sました。", android ? "壊れ" : "死に");
4122 msg_print(android ? "You are broken." : "You die.");
4129 if (winning_seppuku)
4131 get_rnd_line(_("seppuku_j.txt", "seppuku.txt"), 0, death_message);
4135 get_rnd_line(_("death_j.txt", "death.txt"), 0, death_message);
4141 while (!get_string(winning_seppuku ? "辞世の句: " : "断末魔の叫び: ", death_message, 1024)) ;
4143 while (!get_string("Last word: ", death_message, 1024)) ;
4146 while (winning_seppuku && !get_check_strict(_("よろしいですか?", "Are you sure? "), CHECK_NO_HISTORY));
4148 if (death_message[0] == '\0')
4151 strcpy(death_message, format("あなたは%sました。", android ? "壊れ" : "死に"));
4153 strcpy(death_message, android ? "You are broken." : "You die.");
4156 else p_ptr->last_message = string_make(death_message);
4159 if (winning_seppuku)
4164 int msg_pos_x[9] = { 5, 7, 9, 12, 14, 17, 19, 21, 23};
4165 int msg_pos_y[9] = { 3, 4, 5, 4, 5, 4, 5, 6, 4};
4172 for (i = 0; i < 40; i++)
4173 Term_putstr(randint0(w / 2) * 2, randint0(h), 2, TERM_VIOLET, "υ");
4175 str = death_message;
4176 if (strncmp(str, "「", 2) == 0) str += 2;
4178 str2 = my_strstr(str, "」");
4179 if (str2 != NULL) *str2 = '\0';
4184 str2 = my_strstr(str, " ");
4185 if (str2 == NULL) len = strlen(str);
4186 else len = str2 - str;
4190 Term_putstr_v(w * 3 / 4 - 2 - msg_pos_x[i] * 2, msg_pos_y[i], len,
4192 if (str2 == NULL) break;
4196 if (*str == 0) break;
4200 Term_putstr(w-1, h-1, 1, TERM_WHITE, " ");
4204 /* Make screen dump */
4205 screen_dump = make_screen_dump();
4208 /* Wait a key press */
4213 msg_print(death_message);
4223 /* Hitpoint warning */
4224 if (p_ptr->chp < warning)
4226 /* Hack -- bell on first notice */
4227 if (old_chp > warning) bell();
4231 if (record_danger && (old_chp > warning))
4233 if (p_ptr->image && damage_type == DAMAGE_ATTACK)
4234 hit_from = _("何か", "something");
4236 sprintf(tmp,_("%sによってピンチに陥った。", "A critical situation because of %s."),hit_from);
4237 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
4242 /* stop auto_more even if DAMAGE_USELIFE */
4243 p_ptr->now_damaged = TRUE;
4246 msg_print(_("*** 警告:低ヒット・ポイント! ***", "*** LOW HITPOINT WARNING! ***"));
4250 if (p_ptr->wild_mode && !p_ptr->leaving && (p_ptr->chp < MAX(warning, p_ptr->mhp/5)))
4252 change_wild_mode(FALSE);
4261 void gain_exp_64(s32b amount, u32b amount_frac)
4263 if (p_ptr->is_dead) return;
4265 if (p_ptr->prace == RACE_ANDROID) return;
4267 /* Gain some experience */
4268 s64b_add(&(p_ptr->exp), &(p_ptr->exp_frac), amount, amount_frac);
4270 /* Slowly recover from experience drainage */
4271 if (p_ptr->exp < p_ptr->max_exp)
4273 /* Gain max experience (20%) (was 10%) */
4274 p_ptr->max_exp += amount / 5;
4277 /* Check Experience */
4285 void gain_exp(s32b amount)
4287 gain_exp_64(amount, 0L);
4291 void calc_android_exp(void)
4295 if (p_ptr->is_dead) return;
4297 if (p_ptr->prace != RACE_ANDROID) return;
4299 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
4301 object_type *o_ptr = &p_ptr->inventory_list[i];
4303 object_type *q_ptr = &forge;
4305 DEPTH level = MAX(k_info[o_ptr->k_idx].level - 8, 1);
4307 if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue;
4308 if (!o_ptr->k_idx) continue;
4311 object_copy(q_ptr, o_ptr);
4312 q_ptr->discount = 0;
4313 q_ptr->curse_flags = 0L;
4315 if (object_is_fixed_artifact(o_ptr))
4317 level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
4318 level += MIN(20, a_info[o_ptr->name1].rarity/(a_info[o_ptr->name1].gen_flags & TRG_INSTA_ART ? 10 : 3));
4320 else if (object_is_ego(o_ptr))
4322 level += MAX(3, (e_info[o_ptr->name2].rating - 5)/2);
4324 else if (o_ptr->art_name)
4326 s32b total_flags = flag_cost(o_ptr, o_ptr->pval);
4329 if (!object_is_weapon_ammo(o_ptr))
4332 if (total_flags < 15000) fake_level = 10;
4333 else if (total_flags < 35000) fake_level = 25;
4334 else fake_level = 40;
4339 if (total_flags < 20000) fake_level = 10;
4340 else if (total_flags < 45000) fake_level = 25;
4341 else fake_level = 40;
4344 level = MAX(level, (level + MAX(fake_level - 8, 5)) / 2 + 3);
4347 value = object_value_real(q_ptr);
4349 if (value <= 0) continue;
4350 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (p_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
4351 if (value > 5000000L) value = 5000000L;
4352 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
4354 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr) ||
4355 (o_ptr->tval == TV_DRAG_ARMOR) ||
4356 ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) ||
4357 ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) ||
4358 ((o_ptr->tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)) ||
4359 ((o_ptr->tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) ||
4360 ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE)))
4362 if (level > 65) level = 35 + (level - 65) / 5;
4363 else if (level > 35) level = 25 + (level - 35) / 3;
4364 else if (level > 15) level = 15 + (level - 15) / 2;
4365 exp = MIN(100000L, value) / 2 * level * level;
4366 if (value > 100000L)
4367 exp += (value - 100000L) / 8 * level * level;
4371 exp = MIN(100000L, value) * level;
4372 if (value > 100000L)
4373 exp += (value - 100000L) / 4 * level;
4375 if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
4376 else total_exp += exp / 16;
4377 if (i == INVEN_BODY) total_exp += exp / 32;
4379 p_ptr->exp = p_ptr->max_exp = total_exp;
4381 /* Check Experience */
4389 void lose_exp(s32b amount)
4391 if (p_ptr->prace == RACE_ANDROID) return;
4393 /* Never drop below zero experience */
4394 if (amount > p_ptr->exp) amount = p_ptr->exp;
4396 /* Lose some experience */
4397 p_ptr->exp -= amount;
4399 /* Check Experience */
4406 * If resisted to draining, return FALSE
4408 bool drain_exp(s32b drain, s32b slip, int hold_exp_prob)
4410 /* Androids and their mimics are never drained */
4411 if (p_ptr->prace == RACE_ANDROID) return FALSE;
4413 if (p_ptr->hold_exp && (randint0(100) < hold_exp_prob))
4415 /* Hold experience */
4416 msg_print(_("しかし自己の経験値を守りきった!", "You keep hold of your experience!"));
4420 /* Hold experience failed */
4421 if (p_ptr->hold_exp)
4423 msg_print(_("経験値を少し吸い取られた気がする!", "You feel your experience slipping away!"));
4428 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away!"));
4436 bool set_ultimate_res(TIME_EFFECT v, bool do_dec)
4438 bool notice = FALSE;
4439 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
4441 if (p_ptr->is_dead) return FALSE;
4446 if (p_ptr->ult_res && !do_dec)
4448 if (p_ptr->ult_res > v) return FALSE;
4450 else if (!p_ptr->ult_res)
4452 msg_print(_("あらゆることに対して耐性がついた気がする!", "You feel resistant!"));
4462 msg_print(_("あらゆることに対する耐性が薄れた気がする。", "You feel less resistant"));
4469 p_ptr->redraw |= (PR_STATUS);
4471 /* Nothing to notice */
4472 if (!notice) return (FALSE);
4474 if (disturb_state) disturb(FALSE, FALSE);
4475 p_ptr->update |= (PU_BONUS);
4480 bool set_tim_res_nether(TIME_EFFECT v, bool do_dec)
4482 bool notice = FALSE;
4483 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
4485 if (p_ptr->is_dead) return FALSE;
4490 if (p_ptr->tim_res_nether && !do_dec)
4492 if (p_ptr->tim_res_nether > v) return FALSE;
4494 else if (!p_ptr->tim_res_nether)
4496 msg_print(_("地獄の力に対して耐性がついた気がする!", "You feel nether resistant!"));
4504 if (p_ptr->tim_res_nether)
4506 msg_print(_("地獄の力に対する耐性が薄れた気がする。", "You feel less nether resistant"));
4512 p_ptr->tim_res_nether = v;
4513 p_ptr->redraw |= (PR_STATUS);
4515 /* Nothing to notice */
4516 if (!notice) return (FALSE);
4518 if (disturb_state) disturb(FALSE, FALSE);
4519 p_ptr->update |= (PU_BONUS);
4524 bool set_tim_res_time(TIME_EFFECT v, bool do_dec)
4526 bool notice = FALSE;
4527 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
4529 if (p_ptr->is_dead) return FALSE;
4534 if (p_ptr->tim_res_time && !do_dec)
4536 if (p_ptr->tim_res_time > v) return FALSE;
4538 else if (!p_ptr->tim_res_time)
4540 msg_print(_("時間逆転の力に対して耐性がついた気がする!", "You feel time resistant!"));
4548 if (p_ptr->tim_res_time)
4550 msg_print(_("時間逆転の力に対する耐性が薄れた気がする。", "You feel less time resistant"));
4556 p_ptr->tim_res_time = v;
4557 p_ptr->redraw |= (PR_STATUS);
4559 /* Nothing to notice */
4560 if (!notice) return (FALSE);
4562 if (disturb_state) disturb(FALSE, FALSE);
4563 p_ptr->update |= (PU_BONUS);
4570 * Choose a warrior-mage elemental attack. -LM-
4572 bool choose_ele_attack(void)
4578 if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
4580 msg_format(_("武器を持たないと魔法剣は使えない。", "You cannot use temporary branding with no weapon."));
4585 num = (p_ptr->lev - 20) / 5;
4586 c_prt(TERM_RED, _(" a) 焼棄", " a) Fire Brand"), 2, 14);
4589 c_prt(TERM_L_WHITE,_(" b) 凍結", " b) Cold Brand"), 3, 14);
4594 c_prt(TERM_GREEN, _(" c) 毒殺", " c) Poison Brand"), 4, 14);
4599 c_prt(TERM_L_DARK, _(" d) 溶解", " d) Acid Brand"), 5, 14);
4604 c_prt(TERM_BLUE, _(" e) 電撃", " e) Elec Brand"), 6, 14);
4613 prt(_(" どの元素攻撃をしますか?", " Choose a temporary elemental brand "), 1, 14);
4617 if ((choice == 'a') || (choice == 'A'))
4618 set_ele_attack(ATTACK_FIRE, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4619 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
4620 set_ele_attack(ATTACK_COLD, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4621 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
4622 set_ele_attack(ATTACK_POIS, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4623 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
4624 set_ele_attack(ATTACK_ACID, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4625 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
4626 set_ele_attack(ATTACK_ELEC, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4629 msg_print(_("魔法剣を使うのをやめた。", "You cancel the temporary branding."));
4639 * Choose a elemental immune. -LM-
4641 bool choose_ele_immune(TIME_EFFECT immune_turn)
4646 c_prt(TERM_RED, _(" a) 火炎", " a) Immune Fire"), 2, 14);
4647 c_prt(TERM_L_WHITE,_(" b) 冷気", " b) Immune Cold"), 3, 14);
4648 c_prt(TERM_L_DARK, _(" c) 酸", " c) Immune Acid"), 4, 14);
4649 c_prt(TERM_BLUE, _(" d) 電撃", " d) Immune Elec"), 5, 14);
4657 prt(_(" どの元素の免疫をつけますか?", " Choose a temporary elemental immune "), 1, 14);
4661 if ((choice == 'a') || (choice == 'A'))
4662 set_ele_immune(DEFENSE_FIRE, immune_turn);
4663 else if ((choice == 'b') || (choice == 'B'))
4664 set_ele_immune(DEFENSE_COLD, immune_turn);
4665 else if ((choice == 'c') || (choice == 'C'))
4666 set_ele_immune(DEFENSE_ACID, immune_turn);
4667 else if ((choice == 'd') || (choice == 'D'))
4668 set_ele_immune(DEFENSE_ELEC, immune_turn);
4671 msg_print(_("免疫を付けるのをやめた。", "You cancel the temporary immune."));