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
27 #include "spells-status.h"
28 #include "realm-hex.h"
29 #include "object-ego.h"
30 #include "object-hook.h"
32 #include "spells-floor.h"
33 #include "player-status.h"
34 #include "player-class.h"
35 #include "player-move.h"
36 #include "player-effects.h"
37 #include "player-race.h"
38 #include "player-class.h"
39 #include "player-personality.h"
40 #include "player-sex.h"
41 #include "monster-status.h"
44 #include "monster-spell.h"
46 #include "objectkind.h"
54 const kamae kamae_shurui[MAX_KAMAE] =
62 {"Genbu", 25, "(Black Tortoise) "},
63 {"Byakko", 30, "(White Tiger) "},
64 {"Seiryuu", 35, "(Blue Dragon) "},
65 {"Suzaku", 40, "(Red Phoenix) "},
72 const kamae kata_shurui[MAX_KATA] =
89 * @brief プレイヤーの継続行動を設定する。
90 * @param typ 継続行動のID\n
91 * #ACTION_NONE / #ACTION_SEARCH / #ACTION_REST / #ACTION_LEARN / #ACTION_FISH / #ACTION_KAMAE / #ACTION_KATA / #ACTION_SING / #ACTION_HAYAGAKE / #ACTION_SPELL から選択。
94 void set_action(ACTION_IDX typ)
96 int prev_typ = p_ptr->action;
108 msg_print(_("探索をやめた。", "You no longer walk carefully."));
109 p_ptr->redraw |= (PR_SPEED);
119 msg_print(_("学習をやめた。", "You stop Learning"));
125 msg_print(_("構えをといた。", "You stop assuming the posture."));
126 p_ptr->special_defense &= ~(KAMAE_MASK);
131 msg_print(_("型を崩した。", "You stop assuming the posture."));
132 p_ptr->special_defense &= ~(KATA_MASK);
133 p_ptr->update |= (PU_MONSTERS);
134 p_ptr->redraw |= (PR_STATUS);
139 msg_print(_("歌うのをやめた。", "You stop singing."));
142 case ACTION_HAYAGAKE:
144 msg_print(_("足が重くなった。", "You are no longer walking extremely fast."));
145 take_turn(p_ptr, 100);
150 msg_print(_("呪文の詠唱を中断した。", "You stopped spelling all spells."));
158 /* If we are requested other action, stop singing */
159 if (prev_typ == ACTION_SING) stop_singing(p_ptr);
160 if (prev_typ == ACTION_SPELL) stop_hex_spell();
162 switch (p_ptr->action)
166 msg_print(_("注意深く歩き始めた。", "You begin to walk carefully."));
167 p_ptr->redraw |= (PR_SPEED);
172 msg_print(_("学習を始めた。", "You begin Learning"));
177 msg_print(_("水面に糸を垂らした...", "You begin fishing..."));
180 case ACTION_HAYAGAKE:
182 msg_print(_("足が羽のように軽くなった。", "You begin to walk extremely fast."));
190 p_ptr->update |= (PU_BONUS);
191 p_ptr->redraw |= (PR_STATE);
195 * @brief プレイヤーの全ての時限効果をリセットする。 / reset timed flags
198 void reset_tim_flags(void)
200 p_ptr->fast = 0; /* Timed -- Fast */
201 p_ptr->lightspeed = 0;
202 p_ptr->slow = 0; /* Timed -- Slow */
203 p_ptr->blind = 0; /* Timed -- Blindness */
204 p_ptr->paralyzed = 0; /* Timed -- Paralysis */
205 p_ptr->confused = 0; /* Timed -- Confusion */
206 p_ptr->afraid = 0; /* Timed -- Fear */
207 p_ptr->image = 0; /* Timed -- Hallucination */
208 p_ptr->poisoned = 0; /* Timed -- Poisoned */
209 p_ptr->cut = 0; /* Timed -- Cut */
210 p_ptr->stun = 0; /* Timed -- Stun */
212 p_ptr->protevil = 0; /* Timed -- Protection */
213 p_ptr->invuln = 0; /* Timed -- Invulnerable */
215 p_ptr->hero = 0; /* Timed -- Heroism */
216 p_ptr->shero = 0; /* Timed -- Super Heroism */
217 p_ptr->shield = 0; /* Timed -- Shield Spell */
218 p_ptr->blessed = 0; /* Timed -- Blessed */
219 p_ptr->tim_invis = 0; /* Timed -- Invisibility */
220 p_ptr->tim_infra = 0; /* Timed -- Infra Vision */
221 p_ptr->tim_regen = 0; /* Timed -- Regeneration */
222 p_ptr->tim_stealth = 0; /* Timed -- Stealth */
224 p_ptr->wraith_form = 0; /* Timed -- Wraith Form */
225 p_ptr->tim_levitation = 0;
226 p_ptr->tim_sh_touki = 0;
227 p_ptr->tim_sh_fire = 0;
228 p_ptr->tim_sh_holy = 0;
229 p_ptr->tim_eyeeye = 0;
231 p_ptr->resist_magic = 0;
234 p_ptr->tim_res_nether = 0;
235 p_ptr->tim_res_time = 0;
236 p_ptr->tim_mimic = 0;
237 p_ptr->mimic_form = 0;
238 p_ptr->tim_reflect = 0;
239 p_ptr->multishadow = 0;
241 p_ptr->action = ACTION_NONE;
243 p_ptr->oppose_acid = 0; /* Timed -- oppose acid */
244 p_ptr->oppose_elec = 0; /* Timed -- oppose lightning */
245 p_ptr->oppose_fire = 0; /* Timed -- oppose heat */
246 p_ptr->oppose_cold = 0; /* Timed -- oppose cold */
247 p_ptr->oppose_pois = 0; /* Timed -- oppose poison */
249 p_ptr->word_recall = 0;
250 p_ptr->alter_reality = 0;
251 p_ptr->sutemi = FALSE;
252 p_ptr->counter = FALSE;
253 p_ptr->ele_attack = 0;
254 p_ptr->ele_immune = 0;
255 p_ptr->special_attack = 0L;
256 p_ptr->special_defense = 0L;
258 while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
259 p_ptr->timewalk = FALSE;
261 if (prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
262 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1;
263 if (p_ptr->pclass == CLASS_BERSERKER) p_ptr->shero = 1;
267 (void)set_monster_fast(p_ptr->riding, 0);
268 (void)set_monster_slow(p_ptr->riding, 0);
269 (void)set_monster_invulner(p_ptr->riding, 0, FALSE);
272 if (p_ptr->pclass == CLASS_BARD)
274 SINGING_SONG_EFFECT(p_ptr) = 0;
275 SINGING_SONG_ID(p_ptr) = 0;
280 * @brief プレイヤーに魔力消去効果を与える。
283 void dispel_player(void)
285 (void)set_fast(0, TRUE);
286 (void)set_lightspeed(0, TRUE);
287 (void)set_slow(0, TRUE);
288 (void)set_shield(0, TRUE);
289 (void)set_blessed(0, TRUE);
290 (void)set_tsuyoshi(0, TRUE);
291 (void)set_hero(0, TRUE);
292 (void)set_shero(0, TRUE);
293 (void)set_protevil(0, TRUE);
294 (void)set_invuln(0, TRUE);
295 (void)set_wraith_form(0, TRUE);
296 (void)set_kabenuke(0, TRUE);
297 (void)set_tim_res_nether(0, TRUE);
298 (void)set_tim_res_time(0, TRUE);
300 (void)set_tim_reflect(0,TRUE);
301 (void)set_multishadow(0,TRUE);
302 (void)set_dustrobe(0,TRUE);
304 (void)set_tim_invis(0, TRUE);
305 (void)set_tim_infra(0, TRUE);
306 (void)set_tim_esp(0, TRUE);
307 (void)set_tim_regen(0, TRUE);
308 (void)set_tim_stealth(0, TRUE);
309 (void)set_tim_levitation(0, TRUE);
310 (void)set_tim_sh_touki(0, TRUE);
311 (void)set_tim_sh_fire(0, TRUE);
312 (void)set_tim_sh_holy(0, TRUE);
313 (void)set_tim_eyeeye(0, TRUE);
314 (void)set_magicdef(0, TRUE);
315 (void)set_resist_magic(0, TRUE);
316 (void)set_oppose_acid(0, TRUE);
317 (void)set_oppose_elec(0, TRUE);
318 (void)set_oppose_fire(0, TRUE);
319 (void)set_oppose_cold(0, TRUE);
320 (void)set_oppose_pois(0, TRUE);
321 (void)set_ultimate_res(0, TRUE);
322 (void)set_mimic(0, 0, TRUE);
323 (void)set_ele_attack(0, 0);
324 (void)set_ele_immune(0, 0);
326 /* Cancel glowing hands */
327 if (p_ptr->special_attack & ATTACK_CONFUSE)
329 p_ptr->special_attack &= ~(ATTACK_CONFUSE);
330 msg_print(_("手の輝きがなくなった。", "Your hands stop glowing."));
333 if (music_singing_any() || hex_spelling_any())
335 concptr str = (music_singing_any()) ? _("歌", "singing") : _("呪文", "spelling");
336 INTERUPTING_SONG_EFFECT(p_ptr) = SINGING_SONG_EFFECT(p_ptr);
337 SINGING_SONG_EFFECT(p_ptr) = MUSIC_NONE;
338 msg_format(_("%sが途切れた。", "Your %s is interrupted."), str);
340 p_ptr->action = ACTION_NONE;
341 p_ptr->update |= (PU_BONUS | PU_HP | PU_MONSTERS);
342 p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
343 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
344 p_ptr->energy_need += ENERGY_NEED();
350 * @brief 変身効果の継続時間と変身先をセットする / Set "p_ptr->tim_mimic", and "p_ptr->mimic_form", notice observable changes
353 * @param do_dec 現在の継続時間より長い値のみ上書きする
354 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
356 bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec)
359 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
361 if (p_ptr->is_dead) return FALSE;
366 if (p_ptr->tim_mimic && (p_ptr->mimic_form == p) && !do_dec)
368 if (p_ptr->tim_mimic > v) return FALSE;
370 else if ((!p_ptr->tim_mimic) || (p_ptr->mimic_form != p))
372 msg_print(_("自分の体が変わってゆくのを感じた。", "You feel that your body changes."));
373 p_ptr->mimic_form = p;
381 if (p_ptr->tim_mimic)
383 msg_print(_("変身が解けた。", "You are no longer transformed."));
384 if (p_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(0, TRUE);
392 p_ptr->tim_mimic = v;
394 /* Nothing to notice */
395 if (!notice) return (FALSE);
397 if (disturb_state) disturb(FALSE, TRUE);
399 p_ptr->redraw |= (PR_BASIC | PR_STATUS);
400 p_ptr->update |= (PU_BONUS | PU_HP);
407 * @brief 盲目の継続時間をセットする / Set "p_ptr->blind", notice observable changes
409 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
411 * Note the use of "PU_UN_LITE" and "PU_UN_VIEW", which is needed to\n
412 * memorize any terrain features which suddenly become "visible".\n
413 * Note that blindness is currently the only thing which can affect\n
414 * "player_can_see_bold()".\n
416 bool set_blind(TIME_EFFECT v)
419 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
421 if (p_ptr->is_dead) return FALSE;
428 if (p_ptr->prace == RACE_ANDROID)
430 msg_print(_("センサーをやられた!", "You are blind!"));
434 msg_print(_("目が見えなくなってしまった!", "You are blind!"));
438 chg_virtue(V_ENLIGHTEN, -1);
447 if (p_ptr->prace == RACE_ANDROID)
449 msg_print(_("センサーが復旧した。", "You can see again."));
453 msg_print(_("やっと目が見えるようになった。", "You can see again."));
462 p_ptr->redraw |= (PR_STATUS);
464 /* Nothing to notice */
465 if (!notice) return (FALSE);
466 if (disturb_state) disturb(FALSE, FALSE);
468 /* Fully update the visuals */
469 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
470 p_ptr->redraw |= (PR_MAP);
471 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
478 * @brief 混乱の継続時間をセットする / Set "p_ptr->confused", notice observable changes
480 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
482 bool set_confused(TIME_EFFECT v)
485 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
487 if (p_ptr->is_dead) return FALSE;
492 if (!p_ptr->confused)
494 msg_print(_("あなたは混乱した!", "You are confused!"));
496 if (p_ptr->action == ACTION_LEARN)
498 msg_print(_("学習が続けられない!", "You cannot continue Learning!"));
501 p_ptr->redraw |= (PR_STATE);
502 p_ptr->action = ACTION_NONE;
504 if (p_ptr->action == ACTION_KAMAE)
506 msg_print(_("構えがとけた。", "Your posture gets loose."));
507 p_ptr->special_defense &= ~(KAMAE_MASK);
508 p_ptr->update |= (PU_BONUS);
509 p_ptr->redraw |= (PR_STATE);
510 p_ptr->action = ACTION_NONE;
512 else if (p_ptr->action == ACTION_KATA)
514 msg_print(_("型が崩れた。", "Your posture gets loose."));
515 p_ptr->special_defense &= ~(KATA_MASK);
516 p_ptr->update |= (PU_BONUS);
517 p_ptr->update |= (PU_MONSTERS);
518 p_ptr->redraw |= (PR_STATE);
519 p_ptr->redraw |= (PR_STATUS);
520 p_ptr->action = ACTION_NONE;
524 if (p_ptr->concent) reset_concentration(TRUE);
527 if (hex_spelling_any()) stop_hex_spell_all();
530 p_ptr->counter = FALSE;
531 chg_virtue(V_HARMONY, -1);
540 msg_print(_("やっと混乱がおさまった。", "You feel less confused now."));
541 p_ptr->special_attack &= ~(ATTACK_SUIKEN);
548 p_ptr->redraw |= (PR_STATUS);
550 /* Nothing to notice */
551 if (!notice) return (FALSE);
553 if (disturb_state) disturb(FALSE, FALSE);
560 * @brief 毒の継続時間をセットする / Set "p_ptr->poisoned", notice observable changes
562 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
564 bool set_poisoned(TIME_EFFECT v)
567 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
569 if (p_ptr->is_dead) return FALSE;
574 if (!p_ptr->poisoned)
576 msg_print(_("毒に侵されてしまった!", "You are poisoned!"));
586 msg_print(_("やっと毒の痛みがなくなった。", "You are no longer poisoned."));
593 p_ptr->redraw |= (PR_STATUS);
595 /* Nothing to notice */
596 if (!notice) return (FALSE);
598 if (disturb_state) disturb(FALSE, FALSE);
605 * @brief 恐怖の継続時間をセットする / Set "p_ptr->afraid", notice observable changes
607 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
609 bool set_afraid(TIME_EFFECT v)
612 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
614 if (p_ptr->is_dead) return FALSE;
621 msg_print(_("何もかも恐くなってきた!", "You are terrified!"));
623 if (p_ptr->special_defense & KATA_MASK)
625 msg_print(_("型が崩れた。", "Your posture gets loose."));
626 p_ptr->special_defense &= ~(KATA_MASK);
627 p_ptr->update |= (PU_BONUS);
628 p_ptr->update |= (PU_MONSTERS);
629 p_ptr->redraw |= (PR_STATE);
630 p_ptr->redraw |= (PR_STATUS);
631 p_ptr->action = ACTION_NONE;
635 p_ptr->counter = FALSE;
636 chg_virtue(V_VALOUR, -1);
645 msg_print(_("やっと恐怖を振り払った。", "You feel bolder now."));
652 p_ptr->redraw |= (PR_STATUS);
654 /* Nothing to notice */
655 if (!notice) return (FALSE);
657 if (disturb_state) disturb(FALSE, FALSE);
663 * @brief 麻痺の継続時間をセットする / Set "p_ptr->paralyzed", notice observable changes
665 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
667 bool set_paralyzed(TIME_EFFECT v)
670 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
672 if (p_ptr->is_dead) return FALSE;
677 if (!p_ptr->paralyzed)
679 msg_print(_("体が麻痺してしまった!", "You are paralyzed!"));
681 if (p_ptr->concent) reset_concentration(TRUE);
684 if (hex_spelling_any()) stop_hex_spell_all();
686 p_ptr->counter = FALSE;
694 if (p_ptr->paralyzed)
696 msg_print(_("やっと動けるようになった。", "You can move again."));
702 p_ptr->paralyzed = v;
703 p_ptr->redraw |= (PR_STATUS);
705 /* Nothing to notice */
706 if (!notice) return (FALSE);
708 if (disturb_state) disturb(FALSE, FALSE);
709 p_ptr->redraw |= (PR_STATE);
715 * @brief 幻覚の継続時間をセットする / Set "p_ptr->image", notice observable changes
717 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
718 * @details Note that we must redraw the map when hallucination changes.
720 bool set_image(TIME_EFFECT v)
723 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
725 if (p_ptr->is_dead) return FALSE;
726 if (p_ptr->pseikaku == SEIKAKU_CHARGEMAN) v = 0;
732 set_tsuyoshi(0, TRUE);
735 msg_print(_("ワーオ!何もかも虹色に見える!", "Oh, wow! Everything looks so cosmic now!"));
738 if (p_ptr->concent) reset_concentration(TRUE);
740 p_ptr->counter = FALSE;
750 msg_print(_("やっとはっきりと物が見えるようになった。", "You can see clearly again."));
757 p_ptr->redraw |= (PR_STATUS);
759 /* Nothing to notice */
760 if (!notice) return (FALSE);
762 if (disturb_state) disturb(FALSE, TRUE);
764 p_ptr->redraw |= (PR_MAP | PR_HEALTH | PR_UHEALTH);
765 p_ptr->update |= (PU_MONSTERS);
766 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
772 * @brief 加速の継続時間をセットする / Set "p_ptr->fast", notice observable changes
774 * @param do_dec 現在の継続時間より長い値のみ上書きする
775 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
777 bool set_fast(TIME_EFFECT v, bool do_dec)
780 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
782 if (p_ptr->is_dead) return FALSE;
787 if (p_ptr->fast && !do_dec)
789 if (p_ptr->fast > v) return FALSE;
791 else if (!IS_FAST() && !p_ptr->lightspeed)
793 msg_print(_("素早く動けるようになった!", "You feel yourself moving much faster!"));
795 chg_virtue(V_PATIENCE, -1);
796 chg_virtue(V_DILIGENCE, 1);
803 if (p_ptr->fast && !p_ptr->lightspeed && !music_singing(MUSIC_SPEED) && !music_singing(MUSIC_SHERO))
805 msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
813 /* Nothing to notice */
814 if (!notice) return (FALSE);
816 if (disturb_state) disturb(FALSE, FALSE);
817 p_ptr->update |= (PU_BONUS);
823 * @brief 光速移動の継続時間をセットする / Set "p_ptr->lightspeed", notice observable changes
825 * @param do_dec 現在の継続時間より長い値のみ上書きする
826 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
828 bool set_lightspeed(TIME_EFFECT v, bool do_dec)
831 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
833 if (p_ptr->is_dead) return FALSE;
835 if (p_ptr->wild_mode) v = 0;
840 if (p_ptr->lightspeed && !do_dec)
842 if (p_ptr->lightspeed > v) return FALSE;
844 else if (!p_ptr->lightspeed)
846 msg_print(_("非常に素早く動けるようになった!", "You feel yourself moving extremely faster!"));
848 chg_virtue(V_PATIENCE, -1);
849 chg_virtue(V_DILIGENCE, 1);
856 if (p_ptr->lightspeed)
858 msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
864 p_ptr->lightspeed = v;
866 /* Nothing to notice */
867 if (!notice) return (FALSE);
869 if (disturb_state) disturb(FALSE, FALSE);
870 p_ptr->update |= (PU_BONUS);
876 * @brief 減速の継続時間をセットする / Set "p_ptr->slow", notice observable changes
878 * @param do_dec 現在の継続時間より長い値のみ上書きする
879 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
881 bool set_slow(TIME_EFFECT v, bool do_dec)
884 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
886 if (p_ptr->is_dead) return FALSE;
891 if (p_ptr->slow && !do_dec)
893 if (p_ptr->slow > v) return FALSE;
895 else if (!p_ptr->slow)
897 msg_print(_("体の動きが遅くなってしまった!", "You feel yourself moving slower!"));
907 msg_print(_("動きの遅さがなくなったようだ。", "You feel yourself speed up."));
915 /* Nothing to notice */
916 if (!notice) return (FALSE);
918 if (disturb_state) disturb(FALSE, FALSE);
919 p_ptr->update |= (PU_BONUS);
926 * @brief 肌石化の継続時間をセットする / Set "p_ptr->shield", notice observable changes
928 * @param do_dec 現在の継続時間より長い値のみ上書きする
929 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
931 bool set_shield(TIME_EFFECT v, bool do_dec)
934 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
936 if (p_ptr->is_dead) return FALSE;
941 if (p_ptr->shield && !do_dec)
943 if (p_ptr->shield > v) return FALSE;
945 else if (!p_ptr->shield)
947 msg_print(_("肌が石になった。", "Your skin turns to stone."));
957 msg_print(_("肌が元に戻った。", "Your skin returns to normal."));
964 p_ptr->redraw |= (PR_STATUS);
966 /* Nothing to notice */
967 if (!notice) return (FALSE);
969 if (disturb_state) disturb(FALSE, FALSE);
970 p_ptr->update |= (PU_BONUS);
977 * @brief つぶれるの継続時間をセットする / Set "p_ptr->tsubureru", notice observable changes
979 * @param do_dec 現在の継続時間より長い値のみ上書きする
980 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
982 bool set_tsubureru(TIME_EFFECT v, bool do_dec)
985 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
987 if (p_ptr->is_dead) return FALSE;
992 if (p_ptr->tsubureru && !do_dec)
994 if (p_ptr->tsubureru > v) return FALSE;
996 else if (!p_ptr->tsubureru)
998 msg_print(_("横に伸びた。", "Your body expands horizontally."));
1006 if (p_ptr->tsubureru)
1008 msg_print(_("もう横に伸びていない。", "Your body returns to normal."));
1014 p_ptr->tsubureru = v;
1015 p_ptr->redraw |= (PR_STATUS);
1017 /* Nothing to notice */
1018 if (!notice) return (FALSE);
1020 if (disturb_state) disturb(FALSE, FALSE);
1021 p_ptr->update |= (PU_BONUS);
1028 * @brief 魔法の鎧の継続時間をセットする / Set "p_ptr->magicdef", notice observable changes
1030 * @param do_dec 現在の継続時間より長い値のみ上書きする
1031 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1033 bool set_magicdef(TIME_EFFECT v, bool do_dec)
1035 bool notice = FALSE;
1036 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1038 if (p_ptr->is_dead) return FALSE;
1043 if (p_ptr->magicdef && !do_dec)
1045 if (p_ptr->magicdef > v) return FALSE;
1047 else if (!p_ptr->magicdef)
1049 msg_print(_("魔法の防御力が増したような気がする。", "You feel more resistant to magic."));
1057 if (p_ptr->magicdef)
1059 msg_print(_("魔法の防御力が元に戻った。", "You feel less resistant to magic."));
1065 p_ptr->magicdef = v;
1066 p_ptr->redraw |= (PR_STATUS);
1068 /* Nothing to notice */
1069 if (!notice) return (FALSE);
1071 if (disturb_state) disturb(FALSE, FALSE);
1072 p_ptr->update |= (PU_BONUS);
1078 * @brief 祝福の継続時間をセットする / Set "p_ptr->blessed", notice observable changes
1080 * @param do_dec 現在の継続時間より長い値のみ上書きする
1081 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1083 bool set_blessed(TIME_EFFECT v, bool do_dec)
1085 bool notice = FALSE;
1086 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1088 if (p_ptr->is_dead) return FALSE;
1093 if (p_ptr->blessed && !do_dec)
1095 if (p_ptr->blessed > v) return FALSE;
1097 else if (!IS_BLESSED())
1099 msg_print(_("高潔な気分になった!", "You feel righteous!"));
1107 if (p_ptr->blessed && !music_singing(MUSIC_BLESS))
1109 msg_print(_("高潔な気分が消え失せた。", "The prayer has expired."));
1116 p_ptr->redraw |= (PR_STATUS);
1118 /* Nothing to notice */
1119 if (!notice) return (FALSE);
1121 if (disturb_state) disturb(FALSE, FALSE);
1122 p_ptr->update |= (PU_BONUS);
1129 * @brief 士気高揚の継続時間をセットする / Set "p_ptr->hero", notice observable changes
1131 * @param do_dec 現在の継続時間より長い値のみ上書きする
1132 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1134 bool set_hero(TIME_EFFECT v, bool do_dec)
1136 bool notice = FALSE;
1137 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1139 if (p_ptr->is_dead) return FALSE;
1144 if (p_ptr->hero && !do_dec)
1146 if (p_ptr->hero > v) return FALSE;
1148 else if (!IS_HERO())
1150 msg_print(_("ヒーローになった気がする!", "You feel like a hero!"));
1158 if (p_ptr->hero && !music_singing(MUSIC_HERO) && !music_singing(MUSIC_SHERO))
1160 msg_print(_("ヒーローの気分が消え失せた。", "The heroism wears off."));
1167 p_ptr->redraw |= (PR_STATUS);
1169 /* Nothing to notice */
1170 if (!notice) return (FALSE);
1172 if (disturb_state) disturb(FALSE, FALSE);
1173 p_ptr->update |= (PU_BONUS);
1175 /* Recalculate hitpoints */
1176 p_ptr->update |= (PU_HP);
1182 * @brief 狂戦士化の継続時間をセットする / Set "p_ptr->shero", notice observable changes
1183 * @param v 継続時間/ 0ならば無条件にリセット
1184 * @param do_dec FALSEの場合現在の継続時間より長い値のみ上書きする
1185 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1187 bool set_shero(TIME_EFFECT v, bool do_dec)
1189 bool notice = FALSE;
1190 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1192 if (p_ptr->is_dead) return FALSE;
1194 if (p_ptr->pclass == CLASS_BERSERKER) v = 1;
1198 if (p_ptr->shero && !do_dec)
1200 if (p_ptr->shero > v) return FALSE;
1202 else if (!p_ptr->shero)
1204 msg_print(_("殺戮マシーンになった気がする!", "You feel like a killing machine!"));
1214 msg_print(_("野蛮な気持ちが消え失せた。", "You feel less Berserk."));
1221 p_ptr->redraw |= (PR_STATUS);
1223 /* Nothing to notice */
1224 if (!notice) return (FALSE);
1226 if (disturb_state) disturb(FALSE, FALSE);
1227 p_ptr->update |= (PU_BONUS);
1229 /* Recalculate hitpoints */
1230 p_ptr->update |= (PU_HP);
1236 * @brief 対邪悪結界の継続時間をセットする / Set "p_ptr->protevil", notice observable changes
1238 * @param do_dec 現在の継続時間より長い値のみ上書きする
1239 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1241 bool set_protevil(TIME_EFFECT v, bool do_dec)
1243 bool notice = FALSE;
1244 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1246 if (p_ptr->is_dead) return FALSE;
1251 if (p_ptr->protevil && !do_dec)
1253 if (p_ptr->protevil > v) return FALSE;
1255 else if (!p_ptr->protevil)
1257 msg_print(_("邪悪なる存在から守られているような感じがする!", "You feel safe from evil!"));
1265 if (p_ptr->protevil)
1267 msg_print(_("邪悪なる存在から守られている感じがなくなった。", "You no longer feel safe from evil."));
1273 p_ptr->protevil = v;
1274 p_ptr->redraw |= (PR_STATUS);
1276 /* Nothing to notice */
1277 if (!notice) return (FALSE);
1279 if (disturb_state) disturb(FALSE, FALSE);
1285 * @brief 幽体化の継続時間をセットする / Set "p_ptr->wraith_form", notice observable changes
1287 * @param do_dec 現在の継続時間より長い値のみ上書きする
1288 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1290 bool set_wraith_form(TIME_EFFECT v, bool do_dec)
1292 bool notice = FALSE;
1293 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1295 if (p_ptr->is_dead) return FALSE;
1300 if (p_ptr->wraith_form && !do_dec)
1302 if (p_ptr->wraith_form > v) return FALSE;
1304 else if (!p_ptr->wraith_form)
1306 msg_print(_("物質界を離れて幽鬼のような存在になった!", "You leave the physical world and current_world_ptr->game_turn into a wraith-being!"));
1308 chg_virtue(V_UNLIFE, 3);
1309 chg_virtue(V_HONOUR, -2);
1310 chg_virtue(V_SACRIFICE, -2);
1311 chg_virtue(V_VALOUR, -5);
1313 p_ptr->redraw |= (PR_MAP);
1314 p_ptr->update |= (PU_MONSTERS);
1316 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1323 if (p_ptr->wraith_form)
1325 msg_print(_("不透明になった感じがする。", "You feel opaque."));
1328 p_ptr->redraw |= (PR_MAP);
1329 p_ptr->update |= (PU_MONSTERS);
1331 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1336 p_ptr->wraith_form = v;
1337 p_ptr->redraw |= (PR_STATUS);
1339 /* Nothing to notice */
1340 if (!notice) return (FALSE);
1342 if (disturb_state) disturb(FALSE, FALSE);
1343 p_ptr->update |= (PU_BONUS);
1350 * @brief 無傷球の継続時間をセットする / Set "p_ptr->invuln", notice observable changes
1352 * @param do_dec 現在の継続時間より長い値のみ上書きする
1353 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1355 bool set_invuln(TIME_EFFECT v, bool do_dec)
1357 bool notice = FALSE;
1358 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1360 if (p_ptr->is_dead) return FALSE;
1365 if (p_ptr->invuln && !do_dec)
1367 if (p_ptr->invuln > v) return FALSE;
1369 else if (!IS_INVULN())
1371 msg_print(_("無敵だ!", "Invulnerability!"));
1374 chg_virtue(V_UNLIFE, -2);
1375 chg_virtue(V_HONOUR, -2);
1376 chg_virtue(V_SACRIFICE, -3);
1377 chg_virtue(V_VALOUR, -5);
1379 p_ptr->redraw |= (PR_MAP);
1380 p_ptr->update |= (PU_MONSTERS);
1382 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1389 if (p_ptr->invuln && !music_singing(MUSIC_INVULN))
1391 msg_print(_("無敵ではなくなった。", "The invulnerability wears off."));
1394 p_ptr->redraw |= (PR_MAP);
1395 p_ptr->update |= (PU_MONSTERS);
1397 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1399 p_ptr->energy_need += ENERGY_NEED();
1405 p_ptr->redraw |= (PR_STATUS);
1407 /* Nothing to notice */
1408 if (!notice) return (FALSE);
1410 if (disturb_state) disturb(FALSE, FALSE);
1411 p_ptr->update |= (PU_BONUS);
1417 * @brief 時限ESPの継続時間をセットする / Set "p_ptr->tim_esp", notice observable changes
1419 * @param do_dec 現在の継続時間より長い値のみ上書きする
1420 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1422 bool set_tim_esp(TIME_EFFECT v, bool do_dec)
1424 bool notice = FALSE;
1425 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1427 if (p_ptr->is_dead) return FALSE;
1432 if (p_ptr->tim_esp && !do_dec)
1434 if (p_ptr->tim_esp > v) return FALSE;
1436 else if (!IS_TIM_ESP())
1438 msg_print(_("意識が広がった気がする!", "You feel your consciousness expand!"));
1446 if (p_ptr->tim_esp && !music_singing(MUSIC_MIND))
1448 msg_print(_("意識は元に戻った。", "Your consciousness contracts again."));
1455 p_ptr->redraw |= (PR_STATUS);
1457 /* Nothing to notice */
1458 if (!notice) return (FALSE);
1460 if (disturb_state) disturb(FALSE, FALSE);
1461 p_ptr->update |= (PU_BONUS);
1462 p_ptr->update |= (PU_MONSTERS);
1468 * @brief 時限透明視の継続時間をセットする / Set "p_ptr->tim_invis", notice observable changes
1470 * @param do_dec 現在の継続時間より長い値のみ上書きする
1471 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1473 bool set_tim_invis(TIME_EFFECT v, bool do_dec)
1475 bool notice = FALSE;
1476 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1478 if (p_ptr->is_dead) return FALSE;
1483 if (p_ptr->tim_invis && !do_dec)
1485 if (p_ptr->tim_invis > v) return FALSE;
1487 else if (!p_ptr->tim_invis)
1489 msg_print(_("目が非常に敏感になった気がする!", "Your eyes feel very sensitive!"));
1497 if (p_ptr->tim_invis)
1499 msg_print(_("目の敏感さがなくなったようだ。", "Your eyes feel less sensitive."));
1505 p_ptr->tim_invis = v;
1506 p_ptr->redraw |= (PR_STATUS);
1508 /* Nothing to notice */
1509 if (!notice) return (FALSE);
1511 if (disturb_state) disturb(FALSE, FALSE);
1512 p_ptr->update |= (PU_BONUS);
1514 /* Update the monsters */
1515 p_ptr->update |= (PU_MONSTERS);
1521 * @brief 時限赤外線視力の継続時間をセットする / Set "p_ptr->tim_infra", notice observable changes
1523 * @param do_dec 現在の継続時間より長い値のみ上書きする
1524 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1526 bool set_tim_infra(TIME_EFFECT v, bool do_dec)
1528 bool notice = FALSE;
1529 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1531 if (p_ptr->is_dead) return FALSE;
1536 if (p_ptr->tim_infra && !do_dec)
1538 if (p_ptr->tim_infra > v) return FALSE;
1540 else if (!p_ptr->tim_infra)
1542 msg_print(_("目がランランと輝き始めた!", "Your eyes begin to tingle!"));
1550 if (p_ptr->tim_infra)
1552 msg_print(_("目の輝きがなくなった。", "Your eyes stop tingling."));
1558 p_ptr->tim_infra = v;
1559 p_ptr->redraw |= (PR_STATUS);
1561 /* Nothing to notice */
1562 if (!notice) return (FALSE);
1564 if (disturb_state) disturb(FALSE, FALSE);
1565 p_ptr->update |= (PU_BONUS);
1567 /* Update the monsters */
1568 p_ptr->update |= (PU_MONSTERS);
1574 * @brief 時限急回復の継続時間をセットする / Set "p_ptr->tim_regen", notice observable changes
1576 * @param do_dec 現在の継続時間より長い値のみ上書きする
1577 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1579 bool set_tim_regen(TIME_EFFECT v, bool do_dec)
1581 bool notice = FALSE;
1582 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1584 if (p_ptr->is_dead) return FALSE;
1589 if (p_ptr->tim_regen && !do_dec)
1591 if (p_ptr->tim_regen > v) return FALSE;
1593 else if (!p_ptr->tim_regen)
1595 msg_print(_("回復力が上がった!", "You feel yourself regenerating quickly!"));
1603 if (p_ptr->tim_regen)
1605 msg_print(_("素早く回復する感じがなくなった。", "You feel yourself regenerating slowly."));
1611 p_ptr->tim_regen = v;
1612 p_ptr->redraw |= (PR_STATUS);
1614 /* Nothing to notice */
1615 if (!notice) return (FALSE);
1617 if (disturb_state) disturb(FALSE, FALSE);
1618 p_ptr->update |= (PU_BONUS);
1624 * @brief 隠密の歌の継続時間をセットする / Set "p_ptr->tim_stealth", notice observable changes
1626 * @param do_dec 現在の継続時間より長い値のみ上書きする
1627 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1629 bool set_tim_stealth(TIME_EFFECT v, bool do_dec)
1631 bool notice = FALSE;
1632 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1634 if (p_ptr->is_dead) return FALSE;
1639 if (p_ptr->tim_stealth && !do_dec)
1641 if (p_ptr->tim_stealth > v) return FALSE;
1643 else if (!IS_TIM_STEALTH())
1645 msg_print(_("足音が小さくなった!", "You begin to walk silently!"));
1653 if (p_ptr->tim_stealth && !music_singing(MUSIC_STEALTH))
1655 msg_print(_("足音が大きくなった。", "You no longer walk silently."));
1661 p_ptr->tim_stealth = v;
1662 p_ptr->redraw |= (PR_STATUS);
1664 /* Nothing to notice */
1665 if (!notice) return (FALSE);
1667 if (disturb_state) disturb(FALSE, FALSE);
1668 p_ptr->update |= (PU_BONUS);
1674 * @brief 超隠密状態をセットする
1675 * @param set TRUEならば超隠密状態になる。
1676 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1678 bool set_superstealth(bool set)
1680 bool notice = FALSE;
1682 if (p_ptr->is_dead) return FALSE;
1687 if (!(p_ptr->special_defense & NINJA_S_STEALTH))
1689 if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_MNLT)
1691 msg_print(_("敵の目から薄い影の中に覆い隠された。", "You are mantled in weak shadow from ordinary eyes."));
1692 p_ptr->monlite = p_ptr->old_monlite = TRUE;
1696 msg_print(_("敵の目から影の中に覆い隠された!", "You are mantled in shadow from ordinary eyes!"));
1697 p_ptr->monlite = p_ptr->old_monlite = FALSE;
1703 p_ptr->special_defense |= NINJA_S_STEALTH;
1710 if (p_ptr->special_defense & NINJA_S_STEALTH)
1712 msg_print(_("再び敵の目にさらされるようになった。", "You are exposed to common sight once more."));
1716 p_ptr->special_defense &= ~(NINJA_S_STEALTH);
1720 /* Nothing to notice */
1721 if (!notice) return (FALSE);
1722 p_ptr->redraw |= (PR_STATUS);
1724 if (disturb_state) disturb(FALSE, FALSE);
1729 * @brief 一時的浮遊の継続時間をセットする / Set "p_ptr->tim_levitation", notice observable changes
1731 * @param do_dec 現在の継続時間より長い値のみ上書きする
1732 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1734 bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
1736 bool notice = FALSE;
1737 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1739 if (p_ptr->is_dead) return FALSE;
1744 if (p_ptr->tim_levitation && !do_dec)
1746 if (p_ptr->tim_levitation > v) return FALSE;
1748 else if (!p_ptr->tim_levitation)
1750 msg_print(_("体が宙に浮き始めた。", "You begin to fly!"));
1758 if (p_ptr->tim_levitation)
1760 msg_print(_("もう宙に浮かべなくなった。", "You stop flying."));
1766 p_ptr->tim_levitation = v;
1767 p_ptr->redraw |= (PR_STATUS);
1769 /* Nothing to notice */
1770 if (!notice) return (FALSE);
1772 if (disturb_state) disturb(FALSE, FALSE);
1773 p_ptr->update |= (PU_BONUS);
1779 * @brief 一時的闘気のオーラの継続時間をセットする / Set "p_ptr->tim_sh_touki", notice observable changes
1781 * @param do_dec 現在の継続時間より長い値のみ上書きする
1782 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1784 bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec)
1786 bool notice = FALSE;
1787 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1789 if (p_ptr->is_dead) return FALSE;
1794 if (p_ptr->tim_sh_touki && !do_dec)
1796 if (p_ptr->tim_sh_touki > v) return FALSE;
1798 else if (!p_ptr->tim_sh_touki)
1800 msg_print(_("体が闘気のオーラで覆われた。", "You have enveloped by the aura of the Force!"));
1808 if (p_ptr->tim_sh_touki)
1810 msg_print(_("闘気が消えた。", "Aura of the Force disappeared."));
1816 p_ptr->tim_sh_touki = v;
1817 p_ptr->redraw |= (PR_STATUS);
1819 /* Nothing to notice */
1820 if (!notice) return (FALSE);
1822 if (disturb_state) disturb(FALSE, FALSE);
1828 * @brief 一時的火炎のオーラの継続時間をセットする / Set "p_ptr->tim_sh_fire", notice observable changes
1830 * @param do_dec 現在の継続時間より長い値のみ上書きする
1831 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1833 bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec)
1835 bool notice = FALSE;
1836 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1838 if (p_ptr->is_dead) return FALSE;
1843 if (p_ptr->tim_sh_fire && !do_dec)
1845 if (p_ptr->tim_sh_fire > v) return FALSE;
1847 else if (!p_ptr->tim_sh_fire)
1849 msg_print(_("体が炎のオーラで覆われた。", "You have enveloped by fiery aura!"));
1857 if (p_ptr->tim_sh_fire)
1859 msg_print(_("炎のオーラが消えた。", "Fiery aura disappeared."));
1865 p_ptr->tim_sh_fire = v;
1866 p_ptr->redraw |= (PR_STATUS);
1868 /* Nothing to notice */
1869 if (!notice) return (FALSE);
1871 if (disturb_state) disturb(FALSE, FALSE);
1872 p_ptr->update |= (PU_BONUS);
1878 * @brief 一時的聖なるのオーラの継続時間をセットする / Set "p_ptr->tim_sh_holy", notice observable changes
1880 * @param do_dec 現在の継続時間より長い値のみ上書きする
1881 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1883 bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec)
1885 bool notice = FALSE;
1886 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1888 if (p_ptr->is_dead) return FALSE;
1893 if (p_ptr->tim_sh_holy && !do_dec)
1895 if (p_ptr->tim_sh_holy > v) return FALSE;
1897 else if (!p_ptr->tim_sh_holy)
1899 msg_print(_("体が聖なるオーラで覆われた。", "You have enveloped by holy aura!"));
1907 if (p_ptr->tim_sh_holy)
1909 msg_print(_("聖なるオーラが消えた。", "Holy aura disappeared."));
1915 p_ptr->tim_sh_holy = v;
1916 p_ptr->redraw |= (PR_STATUS);
1918 /* Nothing to notice */
1919 if (!notice) return (FALSE);
1921 if (disturb_state) disturb(FALSE, FALSE);
1922 p_ptr->update |= (PU_BONUS);
1928 * @brief 目には目をの残り時間をセットする / Set "p_ptr->tim_eyeeye", notice observable changes
1930 * @param do_dec 現在の継続時間より長い値のみ上書きする
1931 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1933 bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec)
1935 bool notice = FALSE;
1936 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1938 if (p_ptr->is_dead) return FALSE;
1943 if (p_ptr->tim_eyeeye && !do_dec)
1945 if (p_ptr->tim_eyeeye > v) return FALSE;
1947 else if (!p_ptr->tim_eyeeye)
1949 msg_print(_("法の守り手になった気がした!", "You feel like a keeper of commandments!"));
1957 if (p_ptr->tim_eyeeye)
1959 msg_print(_("懲罰を執行することができなくなった。", "You no longer feel like a keeper."));
1965 p_ptr->tim_eyeeye = v;
1966 p_ptr->redraw |= (PR_STATUS);
1968 /* Nothing to notice */
1969 if (!notice) return (FALSE);
1971 if (disturb_state) disturb(FALSE, FALSE);
1972 p_ptr->update |= (PU_BONUS);
1979 * @brief 一時的魔法防御の継続時間をセットする / Set "p_ptr->resist_magic", notice observable changes
1981 * @param do_dec 現在の継続時間より長い値のみ上書きする
1982 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1984 bool set_resist_magic(TIME_EFFECT v, bool do_dec)
1986 bool notice = FALSE;
1987 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1989 if (p_ptr->is_dead) return FALSE;
1994 if (p_ptr->resist_magic && !do_dec)
1996 if (p_ptr->resist_magic > v) return FALSE;
1998 else if (!p_ptr->resist_magic)
2000 msg_print(_("魔法への耐性がついた。", "You have been protected from magic!"));
2008 if (p_ptr->resist_magic)
2010 msg_print(_("魔法に弱くなった。", "You are no longer protected from magic."));
2016 p_ptr->resist_magic = v;
2017 p_ptr->redraw |= (PR_STATUS);
2019 /* Nothing to notice */
2020 if (!notice) return (FALSE);
2022 if (disturb_state) disturb(FALSE, FALSE);
2023 p_ptr->update |= (PU_BONUS);
2029 * @brief 一時的反射の継続時間をセットする / Set "p_ptr->tim_reflect", notice observable changes
2031 * @param do_dec 現在の継続時間より長い値のみ上書きする
2032 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2034 bool set_tim_reflect(TIME_EFFECT v, bool do_dec)
2036 bool notice = FALSE;
2037 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2039 if (p_ptr->is_dead) return FALSE;
2044 if (p_ptr->tim_reflect && !do_dec)
2046 if (p_ptr->tim_reflect > v) return FALSE;
2048 else if (!p_ptr->tim_reflect)
2050 msg_print(_("体の表面が滑かになった気がする。", "Your body becames smooth."));
2058 if (p_ptr->tim_reflect)
2060 msg_print(_("体の表面が滑かでなくなった。", "Your body is no longer smooth."));
2066 p_ptr->tim_reflect = v;
2067 p_ptr->redraw |= (PR_STATUS);
2069 /* Nothing to notice */
2070 if (!notice) return (FALSE);
2072 if (disturb_state) disturb(FALSE, FALSE);
2073 p_ptr->update |= (PU_BONUS);
2080 * Set "p_ptr->multishadow", notice observable changes
2082 bool set_multishadow(TIME_EFFECT v, bool do_dec)
2084 bool notice = FALSE;
2085 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2087 if (p_ptr->is_dead) return FALSE;
2092 if (p_ptr->multishadow && !do_dec)
2094 if (p_ptr->multishadow > v) return FALSE;
2096 else if (!p_ptr->multishadow)
2098 msg_print(_("あなたの周りに幻影が生まれた。", "Your Shadow enveloped you."));
2106 if (p_ptr->multishadow)
2108 msg_print(_("幻影が消えた。", "Your Shadow disappears."));
2114 p_ptr->multishadow = v;
2115 p_ptr->redraw |= (PR_STATUS);
2117 /* Nothing to notice */
2118 if (!notice) return (FALSE);
2120 if (disturb_state) disturb(FALSE, FALSE);
2121 p_ptr->update |= (PU_BONUS);
2127 * @brief 一時的破片のオーラの継続時間をセットする / Set "p_ptr->dustrobe", notice observable changes
2129 * @param do_dec 現在の継続時間より長い値のみ上書きする
2130 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2132 bool set_dustrobe(TIME_EFFECT v, bool do_dec)
2134 bool notice = FALSE;
2135 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2137 if (p_ptr->is_dead) return FALSE;
2142 if (p_ptr->dustrobe && !do_dec)
2144 if (p_ptr->dustrobe > v) return FALSE;
2146 else if (!p_ptr->dustrobe)
2148 msg_print(_("体が鏡のオーラで覆われた。", "You were enveloped by mirror shards."));
2156 if (p_ptr->dustrobe)
2158 msg_print(_("鏡のオーラが消えた。", "The mirror shards disappear."));
2164 p_ptr->dustrobe = v;
2165 p_ptr->redraw |= (PR_STATUS);
2167 /* Nothing to notice */
2168 if (!notice) return (FALSE);
2170 if (disturb_state) disturb(FALSE, FALSE);
2171 p_ptr->update |= (PU_BONUS);
2177 * @brief 一時的壁抜けの継続時間をセットする / Set "p_ptr->kabenuke", notice observable changes
2179 * @param do_dec 現在の継続時間より長い値のみ上書きする
2180 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2182 bool set_kabenuke(TIME_EFFECT v, bool do_dec)
2184 bool notice = FALSE;
2185 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2187 if (p_ptr->is_dead) return FALSE;
2192 if (p_ptr->kabenuke && !do_dec)
2194 if (p_ptr->kabenuke > v) return FALSE;
2196 else if (!p_ptr->kabenuke)
2198 msg_print(_("体が半物質の状態になった。", "You became ethereal form."));
2206 if (p_ptr->kabenuke)
2208 msg_print(_("体が物質化した。", "You are no longer in an ethereal form."));
2214 p_ptr->kabenuke = v;
2215 p_ptr->redraw |= (PR_STATUS);
2217 /* Nothing to notice */
2218 if (!notice) return (FALSE);
2220 if (disturb_state) disturb(FALSE, FALSE);
2221 p_ptr->update |= (PU_BONUS);
2227 * @brief オクレ兄さんの継続時間をセットする / Set "p_ptr->tsuyoshi", notice observable changes
2229 * @param do_dec 現在の継続時間より長い値のみ上書きする
2230 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2232 bool set_tsuyoshi(TIME_EFFECT v, bool do_dec)
2234 bool notice = FALSE;
2235 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2237 if (p_ptr->is_dead) return FALSE;
2242 if (p_ptr->tsuyoshi && !do_dec)
2244 if (p_ptr->tsuyoshi > v) return FALSE;
2246 else if (!p_ptr->tsuyoshi)
2248 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
2250 chg_virtue(V_VITALITY, 2);
2257 if (p_ptr->tsuyoshi)
2259 msg_print(_("肉体が急速にしぼんでいった。", "Your body had quickly shriveled."));
2261 (void)dec_stat(A_CON, 20, TRUE);
2262 (void)dec_stat(A_STR, 20, TRUE);
2265 chg_virtue(V_VITALITY, -3);
2270 p_ptr->tsuyoshi = v;
2271 p_ptr->redraw |= (PR_STATUS);
2273 /* Nothing to notice */
2274 if (!notice) return (FALSE);
2276 if (disturb_state) disturb(FALSE, FALSE);
2277 p_ptr->update |= (PU_BONUS);
2279 /* Recalculate hitpoints */
2280 p_ptr->update |= (PU_HP);
2286 * @brief 一時的元素スレイの継続時間をセットする / Set a temporary elemental brand. Clear all other brands. Print status messages. -LM-
2287 * @param attack_type スレイのタイプID
2289 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2291 bool set_ele_attack(u32b attack_type, TIME_EFFECT v)
2293 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2295 /* Clear all elemental attacks (only one is allowed at a time). */
2296 if ((p_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
2298 p_ptr->special_attack &= ~(ATTACK_ACID);
2299 msg_print(_("酸で攻撃できなくなった。", "Your temporary acidic brand fades away."));
2301 if ((p_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
2303 p_ptr->special_attack &= ~(ATTACK_ELEC);
2304 msg_print(_("電撃で攻撃できなくなった。", "Your temporary electrical brand fades away."));
2306 if ((p_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
2308 p_ptr->special_attack &= ~(ATTACK_FIRE);
2309 msg_print(_("火炎で攻撃できなくなった。", "Your temporary fiery brand fades away."));
2311 if ((p_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
2313 p_ptr->special_attack &= ~(ATTACK_COLD);
2314 msg_print(_("冷気で攻撃できなくなった。", "Your temporary frost brand fades away."));
2316 if ((p_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
2318 p_ptr->special_attack &= ~(ATTACK_POIS);
2319 msg_print(_("毒で攻撃できなくなった。", "Your temporary poison brand fades away."));
2322 if ((v) && (attack_type))
2324 /* Set attack type. */
2325 p_ptr->special_attack |= (attack_type);
2328 p_ptr->ele_attack = v;
2331 msg_format("%sで攻撃できるようになった!",
2332 ((attack_type == ATTACK_ACID) ? "酸" :
2333 ((attack_type == ATTACK_ELEC) ? "電撃" :
2334 ((attack_type == ATTACK_FIRE) ? "火炎" :
2335 ((attack_type == ATTACK_COLD) ? "冷気" :
2336 ((attack_type == ATTACK_POIS) ? "毒" :
2339 msg_format("For a while, the blows you deal will %s",
2340 ((attack_type == ATTACK_ACID) ? "melt with acid!" :
2341 ((attack_type == ATTACK_ELEC) ? "shock your foes!" :
2342 ((attack_type == ATTACK_FIRE) ? "burn with fire!" :
2343 ((attack_type == ATTACK_COLD) ? "chill to the bone!" :
2344 ((attack_type == ATTACK_POIS) ? "poison your enemies!" :
2345 "do nothing special."))))));
2349 if (disturb_state) disturb(FALSE, FALSE);
2350 p_ptr->redraw |= (PR_STATUS);
2352 p_ptr->update |= (PU_BONUS);
2359 * @brief 一時的元素免疫の継続時間をセットする / Set a temporary elemental brand. Clear all other brands. Print status messages. -LM-
2360 * @param immune_type 免疫のタイプID
2362 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2364 bool set_ele_immune(u32b immune_type, TIME_EFFECT v)
2366 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2368 /* Clear all elemental attacks (only one is allowed at a time). */
2369 if ((p_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
2371 p_ptr->special_defense &= ~(DEFENSE_ACID);
2372 msg_print(_("酸の攻撃で傷つけられるようになった。。", "You are no longer immune to acid."));
2374 if ((p_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
2376 p_ptr->special_defense &= ~(DEFENSE_ELEC);
2377 msg_print(_("電撃の攻撃で傷つけられるようになった。。", "You are no longer immune to electricity."));
2379 if ((p_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
2381 p_ptr->special_defense &= ~(DEFENSE_FIRE);
2382 msg_print(_("火炎の攻撃で傷つけられるようになった。。", "You are no longer immune to fire."));
2384 if ((p_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
2386 p_ptr->special_defense &= ~(DEFENSE_COLD);
2387 msg_print(_("冷気の攻撃で傷つけられるようになった。。", "You are no longer immune to cold."));
2389 if ((p_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
2391 p_ptr->special_defense &= ~(DEFENSE_POIS);
2392 msg_print(_("毒の攻撃で傷つけられるようになった。。", "You are no longer immune to poison."));
2395 if ((v) && (immune_type))
2397 /* Set attack type. */
2398 p_ptr->special_defense |= (immune_type);
2401 p_ptr->ele_immune = v;
2403 msg_format(_("%sの攻撃を受けつけなくなった!", "For a while, You are immune to %s"),
2404 ((immune_type == DEFENSE_ACID) ? _("酸", "acid!") :
2405 ((immune_type == DEFENSE_ELEC) ? _("電撃", "electricity!") :
2406 ((immune_type == DEFENSE_FIRE) ? _("火炎", "fire!") :
2407 ((immune_type == DEFENSE_COLD) ? _("冷気", "cold!") :
2408 ((immune_type == DEFENSE_POIS) ? _("毒", "poison!") :
2409 _("(なし)", "do nothing special.")))))));
2412 if (disturb_state) disturb(FALSE, FALSE);
2413 p_ptr->redraw |= (PR_STATUS);
2414 p_ptr->update |= (PU_BONUS);
2421 * @brief 一時的酸耐性の継続時間をセットする / Set "p_ptr->oppose_acid", notice observable changes
2423 * @param do_dec 現在の継続時間より長い値のみ上書きする
2424 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2426 bool set_oppose_acid(TIME_EFFECT v, bool do_dec)
2428 bool notice = FALSE;
2429 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2431 if (p_ptr->is_dead) return FALSE;
2436 if (p_ptr->oppose_acid && !do_dec)
2438 if (p_ptr->oppose_acid > v) return FALSE;
2440 else if (!IS_OPPOSE_ACID())
2442 msg_print(_("酸への耐性がついた気がする!", "You feel resistant to acid!"));
2450 if (p_ptr->oppose_acid && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2452 msg_print(_("酸への耐性が薄れた気がする。", "You feel less resistant to acid."));
2458 p_ptr->oppose_acid = v;
2460 /* Nothing to notice */
2461 if (!notice) return (FALSE);
2462 p_ptr->redraw |= (PR_STATUS);
2464 if (disturb_state) disturb(FALSE, FALSE);
2470 * @brief 一時的電撃耐性の継続時間をセットする / Set "p_ptr->oppose_elec", notice observable changes
2472 * @param do_dec 現在の継続時間より長い値のみ上書きする
2473 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2475 bool set_oppose_elec(TIME_EFFECT v, bool do_dec)
2477 bool notice = FALSE;
2478 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2480 if (p_ptr->is_dead) return FALSE;
2485 if (p_ptr->oppose_elec && !do_dec)
2487 if (p_ptr->oppose_elec > v) return FALSE;
2489 else if (!IS_OPPOSE_ELEC())
2491 msg_print(_("電撃への耐性がついた気がする!", "You feel resistant to electricity!"));
2499 if (p_ptr->oppose_elec && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2501 msg_print(_("電撃への耐性が薄れた気がする。", "You feel less resistant to electricity."));
2507 p_ptr->oppose_elec = v;
2509 /* Nothing to notice */
2510 if (!notice) return (FALSE);
2511 p_ptr->redraw |= (PR_STATUS);
2513 if (disturb_state) disturb(FALSE, FALSE);
2519 * @brief 一時的火炎耐性の継続時間をセットする / Set "p_ptr->oppose_fire", notice observable changes
2521 * @param do_dec 現在の継続時間より長い値のみ上書きする
2522 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2524 bool set_oppose_fire(TIME_EFFECT v, bool do_dec)
2526 bool notice = FALSE;
2527 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2529 if (p_ptr->is_dead) return FALSE;
2531 if ((prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
2535 if (p_ptr->oppose_fire && !do_dec)
2537 if (p_ptr->oppose_fire > v) return FALSE;
2539 else if (!IS_OPPOSE_FIRE())
2541 msg_print(_("火への耐性がついた気がする!", "You feel resistant to fire!"));
2549 if (p_ptr->oppose_fire && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2551 msg_print(_("火への耐性が薄れた気がする。", "You feel less resistant to fire."));
2557 p_ptr->oppose_fire = v;
2559 /* Nothing to notice */
2560 if (!notice) return (FALSE);
2561 p_ptr->redraw |= (PR_STATUS);
2563 if (disturb_state) disturb(FALSE, FALSE);
2569 * @brief 一時的冷気耐性の継続時間をセットする / Set "p_ptr->oppose_cold", notice observable changes
2571 * @param do_dec 現在の継続時間より長い値のみ上書きする
2572 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2574 bool set_oppose_cold(TIME_EFFECT v, bool do_dec)
2576 bool notice = FALSE;
2577 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2579 if (p_ptr->is_dead) return FALSE;
2584 if (p_ptr->oppose_cold && !do_dec)
2586 if (p_ptr->oppose_cold > v) return FALSE;
2588 else if (!IS_OPPOSE_COLD())
2590 msg_print(_("冷気への耐性がついた気がする!", "You feel resistant to cold!"));
2598 if (p_ptr->oppose_cold && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2600 msg_print(_("冷気への耐性が薄れた気がする。", "You feel less resistant to cold."));
2606 p_ptr->oppose_cold = v;
2608 /* Nothing to notice */
2609 if (!notice) return (FALSE);
2610 p_ptr->redraw |= (PR_STATUS);
2612 if (disturb_state) disturb(FALSE, FALSE);
2618 * @brief 一時的毒耐性の継続時間をセットする / Set "p_ptr->oppose_pois", notice observable changes
2620 * @param do_dec 現在の継続時間より長い値のみ上書きする
2621 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2623 bool set_oppose_pois(TIME_EFFECT v, bool do_dec)
2625 bool notice = FALSE;
2626 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2628 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) v = 1;
2629 if (p_ptr->is_dead) return FALSE;
2634 if (p_ptr->oppose_pois && !do_dec)
2636 if (p_ptr->oppose_pois > v) return FALSE;
2638 else if (!IS_OPPOSE_POIS())
2640 msg_print(_("毒への耐性がついた気がする!", "You feel resistant to poison!"));
2648 if (p_ptr->oppose_pois && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2650 msg_print(_("毒への耐性が薄れた気がする。", "You feel less resistant to poison."));
2656 p_ptr->oppose_pois = v;
2658 /* Nothing to notice */
2659 if (!notice) return (FALSE);
2660 p_ptr->redraw |= (PR_STATUS);
2662 if (disturb_state) disturb(FALSE, FALSE);
2668 * @brief 朦朧の継続時間をセットする / Set "p_ptr->stun", notice observable changes
2670 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2672 * Note the special code to only notice "range" changes.
2674 bool set_stun(TIME_EFFECT v)
2676 int old_aux, new_aux;
2677 bool notice = FALSE;
2678 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2680 if (p_ptr->is_dead) return FALSE;
2681 if (prace_is_(RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
2684 if (p_ptr->stun > 100)
2690 else if (p_ptr->stun > 50)
2696 else if (p_ptr->stun > 0)
2732 if (new_aux > old_aux)
2734 /* Describe the state */
2738 case 1: msg_print(_("意識がもうろうとしてきた。", "You have been stunned.")); break;
2741 case 2: msg_print(_("意識がひどくもうろうとしてきた。", "You have been heavily stunned.")); break;
2744 case 3: msg_print(_("頭がクラクラして意識が遠のいてきた。", "You have been knocked out.")); break;
2747 if (randint1(1000) < v || one_in_(16))
2749 msg_print(_("割れるような頭痛がする。", "A vicious blow hits your head."));
2753 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
2754 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
2756 else if (one_in_(2))
2758 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
2762 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
2765 if (p_ptr->special_defense & KATA_MASK)
2767 msg_print(_("型が崩れた。", "Your posture gets loose."));
2768 p_ptr->special_defense &= ~(KATA_MASK);
2769 p_ptr->update |= (PU_BONUS);
2770 p_ptr->update |= (PU_MONSTERS);
2771 p_ptr->redraw |= (PR_STATE);
2772 p_ptr->redraw |= (PR_STATUS);
2773 p_ptr->action = ACTION_NONE;
2777 if (p_ptr->concent) reset_concentration(TRUE);
2780 if (hex_spelling_any()) stop_hex_spell_all();
2786 else if (new_aux < old_aux)
2788 /* Describe the state */
2793 msg_print(_("やっと朦朧状態から回復した。", "You are no longer stunned."));
2795 if (disturb_state) disturb(FALSE, FALSE);
2806 if (!notice) return (FALSE);
2808 if (disturb_state) disturb(FALSE, FALSE);
2809 p_ptr->update |= (PU_BONUS);
2811 /* Redraw the "stun" */
2812 p_ptr->redraw |= (PR_STUN);
2819 * @brief 出血の継続時間をセットする / Set "p_ptr->cut", notice observable changes
2821 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2823 * Note the special code to only notice "range" changes.
2825 bool set_cut(TIME_EFFECT v)
2827 int old_aux, new_aux;
2828 bool notice = FALSE;
2829 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2831 if (p_ptr->is_dead) return FALSE;
2833 if ((p_ptr->prace == RACE_GOLEM ||
2834 p_ptr->prace == RACE_SKELETON ||
2835 p_ptr->prace == RACE_SPECTRE ||
2836 (p_ptr->prace == RACE_ZOMBIE && p_ptr->lev > 11)) &&
2841 if (p_ptr->cut > 1000)
2847 else if (p_ptr->cut > 200)
2853 else if (p_ptr->cut > 100)
2859 else if (p_ptr->cut > 50)
2865 else if (p_ptr->cut > 25)
2871 else if (p_ptr->cut > 10)
2877 else if (p_ptr->cut > 0)
2937 if (new_aux > old_aux)
2939 /* Describe the state */
2943 case 1: msg_print(_("かすり傷を負ってしまった。", "You have been given a graze.")); break;
2946 case 2: msg_print(_("軽い傷を負ってしまった。", "You have been given a light cut.")); break;
2949 case 3: msg_print(_("ひどい傷を負ってしまった。", "You have been given a bad cut.")); break;
2952 case 4: msg_print(_("大変な傷を負ってしまった。", "You have been given a nasty cut.")); break;
2955 case 5: msg_print(_("重大な傷を負ってしまった。", "You have been given a severe cut.")); break;
2958 case 6: msg_print(_("ひどい深手を負ってしまった。", "You have been given a deep gash.")); break;
2961 case 7: msg_print(_("致命的な傷を負ってしまった。", "You have been given a mortal wound.")); break;
2966 if (randint1(1000) < v || one_in_(16))
2968 if (!p_ptr->sustain_chr)
2970 msg_print(_("ひどい傷跡が残ってしまった。", "You have been horribly scarred."));
2977 else if (new_aux < old_aux)
2979 /* Describe the state */
2984 msg_format(_("やっと%s。", "You are no longer bleeding."), p_ptr->prace == RACE_ANDROID ? "怪我が直った" : "出血が止まった");
2986 if (disturb_state) disturb(FALSE, FALSE);
2997 if (!notice) return (FALSE);
2999 if (disturb_state) disturb(FALSE, FALSE);
3000 p_ptr->update |= (PU_BONUS);
3002 /* Redraw the "cut" */
3003 p_ptr->redraw |= (PR_CUT);
3009 * @brief 空腹状態をセットする / Set "p_ptr->food", notice observable changes
3011 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
3013 * Set "", notice observable changes\n
3015 * The "p_ptr->food" variable can get as large as 20000, allowing the
3016 * addition of the most "filling" item, Elvish Waybread, which adds
3017 * 7500 food units, without overflowing the 32767 maximum limit.\n
3019 * Perhaps we should disturb the player with various messages,
3020 * especially messages about hunger status changes. \n
3022 * Digestion of food is handled in "dungeon.c", in which, normally,
3023 * the player digests about 20 food units per 100 game turns, more
3024 * when "fast", more when "regenerating", less with "slow digestion",
3025 * but when the player is "gorged", he digests 100 food units per 10
3026 * game turns, or a full 1000 food units per 100 game turns.\n
3028 * Note that the player's speed is reduced by 10 units while gorged,
3029 * so if the player eats a single food ration (5000 food units) when
3030 * full (15000 food units), he will be gorged for (5000/100)*10 = 500
3031 * game turns, or 500/(100/5) = 25 player turns (if nothing else is
3032 * affecting the player speed).\n
3034 bool set_food(TIME_EFFECT v)
3036 int old_aux, new_aux;
3038 bool notice = FALSE;
3039 v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
3041 /* Fainting / Starving */
3042 if (p_ptr->food < PY_FOOD_FAINT)
3048 else if (p_ptr->food < PY_FOOD_WEAK)
3054 else if (p_ptr->food < PY_FOOD_ALERT)
3060 else if (p_ptr->food < PY_FOOD_FULL)
3066 else if (p_ptr->food < PY_FOOD_MAX)
3077 /* Fainting / Starving */
3078 if (v < PY_FOOD_FAINT)
3084 else if (v < PY_FOOD_WEAK)
3090 else if (v < PY_FOOD_ALERT)
3096 else if (v < PY_FOOD_FULL)
3102 else if (v < PY_FOOD_MAX)
3113 if (old_aux < 1 && new_aux > 0)
3114 chg_virtue(V_PATIENCE, 2);
3115 else if (old_aux < 3 && (old_aux != new_aux))
3116 chg_virtue(V_PATIENCE, 1);
3118 chg_virtue(V_TEMPERANCE, 1);
3120 chg_virtue(V_TEMPERANCE, -1);
3123 if (new_aux > old_aux)
3125 /* Describe the state */
3129 case 1: msg_print(_("まだ空腹で倒れそうだ。", "You are still weak.")); break;
3132 case 2: msg_print(_("まだ空腹だ。", "You are still hungry.")); break;
3135 case 3: msg_print(_("空腹感がおさまった。", "You are no longer hungry.")); break;
3138 case 4: msg_print(_("満腹だ!", "You are full!")); break;
3142 msg_print(_("食べ過ぎだ!", "You have gorged yourself!"));
3143 chg_virtue(V_HARMONY, -1);
3144 chg_virtue(V_PATIENCE, -1);
3145 chg_virtue(V_TEMPERANCE, -2);
3155 else if (new_aux < old_aux)
3157 /* Describe the state */
3160 /* Fainting / Starving */
3161 case 0: msg_print(_("あまりにも空腹で気を失ってしまった!", "You are getting faint from hunger!")); break;
3164 case 1: msg_print(_("お腹が空いて倒れそうだ。", "You are getting weak from hunger!")); break;
3167 case 2: msg_print(_("お腹が空いてきた。", "You are getting hungry.")); break;
3170 case 3: msg_print(_("満腹感がなくなった。", "You are no longer full.")); break;
3173 case 4: msg_print(_("やっとお腹がきつくなくなった。", "You are no longer gorged.")); break;
3176 if (p_ptr->wild_mode && (new_aux < 2))
3188 /* Nothing to notice */
3189 if (!notice) return (FALSE);
3191 if (disturb_state) disturb(FALSE, FALSE);
3192 p_ptr->update |= (PU_BONUS);
3195 p_ptr->redraw |= (PR_HUNGER);
3201 * @brief プレイヤーの基本能力値を増加させる / Increases a stat by one randomized level -RAK-
3202 * @param stat 上昇させるステータスID
3203 * @return 実際に上昇した場合TRUEを返す。
3205 * Note that this function (used by stat potions) now restores\n
3206 * the stat BEFORE increasing it.\n
3208 bool inc_stat(int stat)
3210 BASE_STATUS value, gain;
3212 /* Then augment the current/max stat */
3213 value = p_ptr->stat_cur[stat];
3215 /* Cannot go above 18/100 */
3216 if (value < p_ptr->stat_max_max[stat])
3218 /* Gain one (sometimes two) points */
3221 gain = ((randint0(100) < 75) ? 1 : 2);
3225 /* Gain 1/6 to 1/3 of distance to 18/100 */
3226 else if (value < (p_ptr->stat_max_max[stat]-2))
3228 /* Approximate gain value */
3229 gain = (((p_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
3230 if (gain < 1) gain = 1;
3232 /* Apply the bonus */
3233 value += randint1(gain) + gain / 2;
3236 if (value > (p_ptr->stat_max_max[stat]-1)) value = p_ptr->stat_max_max[stat]-1;
3239 /* Gain one point at a time */
3245 /* Save the new value */
3246 p_ptr->stat_cur[stat] = value;
3248 /* Bring up the maximum too */
3249 if (value > p_ptr->stat_max[stat])
3251 p_ptr->stat_max[stat] = value;
3253 p_ptr->update |= (PU_BONUS);
3259 /* Nothing to gain */
3264 * @brief プレイヤーの基本能力値を減少させる / Decreases a stat by an amount indended to vary from 0 to 100 percent.
3265 * @param stat 減少させるステータスID
3266 * @param amount 減少させる基本量
3267 * @param permanent TRUEならば現在の最大値を減少させる
3268 * @return 実際に減少した場合TRUEを返す。
3271 * Amount could be a little higher in extreme cases to mangle very high\n
3272 * stats from massive assaults. -CWS\n
3274 * Note that "permanent" means that the *given* amount is permanent,\n
3275 * not that the new value becomes permanent. This may not work exactly\n
3276 * as expected, due to "weirdness" in the algorithm, but in general,\n
3277 * if your stat is already drained, the "max" value will not drop all\n
3278 * the way down to the "cur" value.\n
3280 bool dec_stat(int stat, int amount, int permanent)
3282 BASE_STATUS cur, max;
3287 /* Acquire current value */
3288 cur = p_ptr->stat_cur[stat];
3289 max = p_ptr->stat_max[stat];
3291 /* Note when the values are identical */
3292 same = (cur == max);
3294 /* Damage "current" value */
3297 /* Handle "low" values */
3300 if (amount > 90) cur--;
3301 if (amount > 50) cur--;
3302 if (amount > 20) cur--;
3306 /* Handle "high" values */
3309 /* Hack -- Decrement by a random amount between one-quarter */
3310 /* and one-half of the stat bonus times the percentage, with a */
3311 /* minimum damage of half the percentage. -CWS */
3312 loss = (((cur-18) / 2 + 1) / 2 + 1);
3313 if (loss < 1) loss = 1;
3315 /* Randomize the loss */
3316 loss = ((randint1(loss) + loss) * amount) / 100;
3319 if (loss < amount/2) loss = amount/2;
3321 /* Lose some points */
3324 /* Hack -- Only reduce stat to 17 sometimes */
3325 if (cur < 18) cur = (amount <= 20) ? 18 : 17;
3328 /* Prevent illegal values */
3329 if (cur < 3) cur = 3;
3331 /* Something happened */
3332 if (cur != p_ptr->stat_cur[stat]) res = TRUE;
3335 /* Damage "max" value */
3336 if (permanent && (max > 3))
3338 chg_virtue(V_SACRIFICE, 1);
3339 if (stat == A_WIS || stat == A_INT)
3340 chg_virtue(V_ENLIGHTEN, -2);
3342 /* Handle "low" values */
3345 if (amount > 90) max--;
3346 if (amount > 50) max--;
3347 if (amount > 20) max--;
3351 /* Handle "high" values */
3354 /* Hack -- Decrement by a random amount between one-quarter */
3355 /* and one-half of the stat bonus times the percentage, with a */
3356 /* minimum damage of half the percentage. -CWS */
3357 loss = (((max-18) / 2 + 1) / 2 + 1);
3358 loss = ((randint1(loss) + loss) * amount) / 100;
3359 if (loss < amount/2) loss = amount/2;
3361 /* Lose some points */
3364 /* Hack -- Only reduce stat to 17 sometimes */
3365 if (max < 18) max = (amount <= 20) ? 18 : 17;
3368 /* Hack -- keep it clean */
3369 if (same || (max < cur)) max = cur;
3371 /* Something happened */
3372 if (max != p_ptr->stat_max[stat]) res = TRUE;
3377 /* Actually set the stat to its new value. */
3378 p_ptr->stat_cur[stat] = cur;
3379 p_ptr->stat_max[stat] = max;
3381 p_ptr->redraw |= (PR_STATS);
3382 p_ptr->update |= (PU_BONUS);
3390 * @brief プレイヤーの基本能力値を回復させる / Restore a stat. Return TRUE only if this actually makes a difference.
3391 * @param stat 回復ステータスID
3392 * @return 実際に回復した場合TRUEを返す。
3394 bool res_stat(int stat)
3396 /* Restore if needed */
3397 if (p_ptr->stat_cur[stat] != p_ptr->stat_max[stat])
3399 p_ptr->stat_cur[stat] = p_ptr->stat_max[stat];
3400 p_ptr->update |= (PU_BONUS);
3401 p_ptr->redraw |= (PR_STATS);
3407 /* Nothing to restore */
3413 * Increase players hit points, notice effects
3415 bool hp_player(int num)
3418 vir = virtue_number(V_VITALITY);
3420 if(num <= 0) return (FALSE);
3424 num = num * (p_ptr->virtues[vir - 1] + 1250) / 1250;
3426 /* Healing needed */
3427 if (p_ptr->chp < p_ptr->mhp)
3429 if ((num > 0) && (p_ptr->chp < (p_ptr->mhp/3)))
3430 chg_virtue(V_TEMPERANCE, 1);
3431 /* Gain hitpoints */
3434 /* Enforce maximum */
3435 if (p_ptr->chp >= p_ptr->mhp)
3437 p_ptr->chp = p_ptr->mhp;
3438 p_ptr->chp_frac = 0;
3441 p_ptr->redraw |= (PR_HP);
3443 p_ptr->window |= (PW_PLAYER);
3448 msg_print(_("少し気分が良くなった。", "You feel a little better."));
3454 msg_print(_("気分が良くなった。", "You feel better."));
3460 msg_print(_("とても気分が良くなった。", "You feel much better."));
3466 msg_print(_("ひじょうに気分が良くなった。", "You feel very good."));
3478 * Array of stat "descriptions"
3480 static concptr desc_stat_pos[] =
3485 _("器用に", "dextrous"),
3486 _("健康に", "healthy"),
3492 * Array of stat "descriptions"
3494 static concptr desc_stat_neg[] =
3499 _("不器用に", "clumsy"),
3500 _("不健康に", "sickly"),
3508 bool do_dec_stat(int stat)
3512 /* Access the "sustain" */
3515 case A_STR: if (p_ptr->sustain_str) sust = TRUE; break;
3516 case A_INT: if (p_ptr->sustain_int) sust = TRUE; break;
3517 case A_WIS: if (p_ptr->sustain_wis) sust = TRUE; break;
3518 case A_DEX: if (p_ptr->sustain_dex) sust = TRUE; break;
3519 case A_CON: if (p_ptr->sustain_con) sust = TRUE; break;
3520 case A_CHR: if (p_ptr->sustain_chr) sust = TRUE; break;
3524 if (sust && (!ironman_nightmare || randint0(13)))
3526 msg_format(_("%sなった気がしたが、すぐに元に戻った。", "You feel %s for a moment, but the feeling passes."),
3527 desc_stat_neg[stat]);
3533 /* Attempt to reduce the stat */
3534 if (dec_stat(stat, 10, (ironman_nightmare && !randint0(13))))
3536 msg_format(_("ひどく%sなった気がする。", "You feel very %s."), desc_stat_neg[stat]);
3542 /* Nothing obvious */
3548 * Restore lost "points" in a stat
3550 bool do_res_stat(int stat)
3552 /* Attempt to increase */
3555 msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]);
3560 /* Nothing obvious */
3566 * Gain a "point" in a stat
3568 bool do_inc_stat(int stat)
3572 /* Restore strength */
3573 res = res_stat(stat);
3575 /* Attempt to increase */
3580 chg_virtue(V_ENLIGHTEN, 1);
3581 chg_virtue(V_FAITH, 1);
3583 else if (stat == A_INT)
3585 chg_virtue(V_KNOWLEDGE, 1);
3586 chg_virtue(V_ENLIGHTEN, 1);
3588 else if (stat == A_CON)
3589 chg_virtue(V_VITALITY, 1);
3591 msg_format(_("ワーオ!とても%sなった!", "Wow! You feel very %s!"), desc_stat_pos[stat]);
3596 /* Restoration worked */
3599 msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]);
3604 /* Nothing obvious */
3610 * Restores any drained experience
3612 bool restore_level(void)
3614 /* Restore experience */
3615 if (p_ptr->exp < p_ptr->max_exp)
3617 msg_print(_("経験値が戻ってきた気がする。", "You feel your experience returning."));
3619 /* Restore the experience */
3620 p_ptr->exp = p_ptr->max_exp;
3622 /* Check the experience */
3636 bool lose_all_info(void)
3640 chg_virtue(V_KNOWLEDGE, -5);
3641 chg_virtue(V_ENLIGHTEN, -5);
3643 /* Forget info about objects */
3644 for (i = 0; i < INVEN_TOTAL; i++)
3646 object_type *o_ptr = &p_ptr->inventory_list[i];
3647 if (!o_ptr->k_idx) continue;
3649 /* Allow "protection" by the MENTAL flag */
3650 if (o_ptr->ident & (IDENT_MENTAL)) continue;
3652 /* Remove "default inscriptions" */
3653 o_ptr->feeling = FEEL_NONE;
3655 /* Hack -- Clear the "empty" flag */
3656 o_ptr->ident &= ~(IDENT_EMPTY);
3658 /* Hack -- Clear the "known" flag */
3659 o_ptr->ident &= ~(IDENT_KNOWN);
3661 /* Hack -- Clear the "felt" flag */
3662 o_ptr->ident &= ~(IDENT_SENSE);
3664 p_ptr->update |= (PU_BONUS);
3665 p_ptr->update |= (PU_COMBINE | PU_REORDER);
3667 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3669 /* Mega-Hack -- Forget the map */
3677 void do_poly_wounds(void)
3679 /* Changed to always provide at least _some_ healing */
3680 s16b wounds = p_ptr->cut;
3681 s16b hit_p = (p_ptr->mhp - p_ptr->chp);
3682 s16b change = damroll(p_ptr->lev, 5);
3683 bool Nasty_effect = one_in_(5);
3685 if (!(wounds || hit_p || Nasty_effect)) return;
3687 msg_print(_("傷がより軽いものに変化した。", "Your wounds are polymorphed into less serious ones."));
3691 msg_print(_("新たな傷ができた!", "A new wound was created!"));
3692 take_hit(DAMAGE_LOSELIFE, change / 2, _("変化した傷", "a polymorphed wound"), -1);
3697 set_cut(p_ptr->cut - (change / 2));
3703 * Change player race
3705 void change_race(CHARACTER_IDX new_race, concptr effect_msg)
3707 concptr title = race_info[new_race].title;
3708 int old_race = p_ptr->prace;
3711 msg_format("あなたは%s%sに変化した!", effect_msg, title);
3713 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);
3716 chg_virtue(V_CHANCE, 2);
3718 if (p_ptr->prace < 32)
3720 p_ptr->old_race1 |= 1L << p_ptr->prace;
3724 p_ptr->old_race2 |= 1L << (p_ptr->prace - 32);
3726 p_ptr->prace = new_race;
3727 rp_ptr = &race_info[p_ptr->prace];
3729 /* Experience factor */
3730 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
3733 * The speed bonus of Klackons and Sprites are disabled
3734 * and the experience penalty is decreased.
3736 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)))
3737 p_ptr->expfact -= 15;
3739 /* Get character's height and weight */
3740 get_height_weight();
3743 if (p_ptr->pclass == CLASS_SORCERER)
3744 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
3746 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
3748 roll_hitdice(p_ptr, 0L);
3750 /* The experience level may be modified */
3753 p_ptr->redraw |= (PR_BASIC);
3755 p_ptr->update |= (PU_BONUS);
3759 /* Load an autopick preference file */
3760 if (old_race != p_ptr->prace) autopick_load_pref(FALSE);
3762 /* Player's graphic tile may change */
3763 lite_spot(p_ptr->y, p_ptr->x);
3767 void do_poly_self(void)
3769 int power = p_ptr->lev;
3771 msg_print(_("あなたは変化の訪れを感じた...", "You feel a change coming over you..."));
3772 chg_virtue(V_CHANCE, 1);
3774 if ((power > randint0(20)) && one_in_(3) && (p_ptr->prace != RACE_ANDROID))
3776 char effect_msg[80] = "";
3777 CHARACTER_IDX new_race;
3779 /* Some form of racial polymorph... */
3782 if ((power > randint0(5)) && one_in_(4))
3787 if (p_ptr->psex == SEX_MALE)
3789 p_ptr->psex = SEX_FEMALE;
3790 sp_ptr = &sex_info[p_ptr->psex];
3791 sprintf(effect_msg, _("女性の", "female "));
3795 p_ptr->psex = SEX_MALE;
3796 sp_ptr = &sex_info[p_ptr->psex];
3797 sprintf(effect_msg, _("男性の", "male "));
3801 if ((power > randint0(30)) && one_in_(5))
3805 /* Harmful deformity */
3812 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
3818 /* Deformities are discriminated against! */
3819 (void)dec_stat(A_CHR, randint1(6), TRUE);
3824 sprintf(tmp_msg,_("%s", "%s "),effect_msg);
3825 sprintf(effect_msg,_("奇形の%s", "deformed %s "),tmp_msg);
3829 sprintf(effect_msg,_("奇形の", "deformed "));
3833 while ((power > randint0(20)) && one_in_(10))
3835 /* Polymorph into a less mutated form */
3838 if (!lose_mutation(0))
3839 msg_print(_("奇妙なくらい普通になった気がする。", "You feel oddly normal."));
3844 new_race = (CHARACTER_IDX)randint0(MAX_RACES);
3846 while ((new_race == p_ptr->prace) || (new_race == RACE_ANDROID));
3848 change_race(new_race, effect_msg);
3851 if ((power > randint0(30)) && one_in_(6))
3857 msg_format(_("%sの構成が変化した!", "Your internal organs are rearranged!"), p_ptr->prace == RACE_ANDROID ? "機械" : "内臓");
3861 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
3866 msg_print(_("現在の姿で生きていくのは困難なようだ!", "You find living difficult in your present form!"));
3867 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), _("致命的な突然変異", "a lethal mutation"), -1);
3873 if ((power > randint0(20)) && one_in_(4))
3878 roll_hitdice(p_ptr, 0L);
3881 while ((power > randint0(15)) && one_in_(3))
3884 (void)gain_mutation(p_ptr, 0);
3887 if (power > randint0(5))
3893 /* Note: earlier deductions may have left power < 0 already. */
3903 * Decreases players hit points and sets death flag if necessary
3905 * Invulnerability needs to be changed into a "shield"
3907 * Hack -- this function allows the user to save (or quit)
3908 * the game when he dies, since the "You die." message is shown before
3909 * setting the player to "dead".
3912 int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
3914 int old_chp = p_ptr->chp;
3916 char death_message[1024];
3919 int warning = (p_ptr->mhp * hitpoint_warn / 10);
3920 if (p_ptr->is_dead) return 0;
3922 if (p_ptr->sutemi) damage *= 2;
3923 if (p_ptr->special_defense & KATA_IAI) damage += (damage + 4) / 5;
3925 if (easy_band) damage = (damage+1)/2;
3927 if (damage_type != DAMAGE_USELIFE)
3929 disturb(TRUE, TRUE);
3932 p_ptr->now_damaged = TRUE;
3936 if (monspell >= 0) learn_spell(monspell);
3938 /* Mega-Hack -- Apply "invulnerability" */
3939 if ((damage_type != DAMAGE_USELIFE) && (damage_type != DAMAGE_LOSELIFE))
3941 if (IS_INVULN() && (damage < 9000))
3943 if (damage_type == DAMAGE_FORCE)
3945 msg_print(_("バリアが切り裂かれた!", "The attack cuts your shield of invulnerability open!"));
3947 else if (one_in_(PENETRATE_INVULNERABILITY))
3949 msg_print(_("無敵のバリアを破って攻撃された!", "The attack penetrates your shield of invulnerability!"));
3957 if (CHECK_MULTISHADOW())
3959 if (damage_type == DAMAGE_FORCE)
3961 msg_print(_("幻影もろとも体が切り裂かれた!", "The attack hits Shadow together with you!"));
3963 else if (damage_type == DAMAGE_ATTACK)
3965 msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, you are unharmed!"));
3970 if (p_ptr->wraith_form)
3972 if (damage_type == DAMAGE_FORCE)
3974 msg_print(_("半物質の体が切り裂かれた!", "The attack cuts through your ethereal body!"));
3979 if ((damage == 0) && one_in_(2)) damage = 1;
3983 if (p_ptr->special_defense & KATA_MUSOU)
3986 if ((damage == 0) && one_in_(2)) damage = 1;
3988 } /* not if LOSELIFE USELIFE */
3990 /* Hurt the player */
3991 p_ptr->chp -= damage;
3992 if(damage_type == DAMAGE_GENO && p_ptr->chp < 0)
3994 damage += p_ptr->chp;
3998 /* Display the hitpoints */
3999 p_ptr->redraw |= (PR_HP);
4001 p_ptr->window |= (PW_PLAYER);
4003 if (damage_type != DAMAGE_GENO && p_ptr->chp == 0)
4005 chg_virtue(V_SACRIFICE, 1);
4006 chg_virtue(V_CHANCE, 2);
4012 bool android = (p_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
4014 #ifdef JP /* 死んだ時に強制終了して死を回避できなくしてみた by Habu */
4016 if(!save_player()) msg_print("セーブ失敗!");
4021 chg_virtue(V_SACRIFICE, 10);
4024 p_ptr->leaving = TRUE;
4027 p_ptr->is_dead = TRUE;
4029 if (p_ptr->inside_arena)
4031 concptr m_name = r_name+r_info[arena_info[p_ptr->arena_number].r_idx].name;
4032 msg_format(_("あなたは%sの前に敗れ去った。", "You are beaten by %s."), m_name);
4034 if (record_arena) do_cmd_write_nikki(NIKKI_ARENA, -1 - p_ptr->arena_number, m_name);
4038 QUEST_IDX q_idx = quest_number(current_floor_ptr->dun_level);
4039 bool seppuku = streq(hit_from, "Seppuku");
4040 bool winning_seppuku = p_ptr->total_winner && seppuku;
4042 play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_GAMEOVER);
4045 /* Make screen dump */
4046 screen_dump = make_screen_dump();
4049 /* Note cause of death */
4052 strcpy(p_ptr->died_from, hit_from);
4054 if (!winning_seppuku) strcpy(p_ptr->died_from, "切腹");
4061 sprintf(dummy, "%s%s%s", !p_ptr->paralyzed ? "" : p_ptr->free_act ? "彫像状態で" : "麻痺状態で", p_ptr->image ? "幻覚に歪んだ" : "", hit_from);
4063 sprintf(dummy, "%s%s", hit_from, !p_ptr->paralyzed ? "" : " while helpless");
4065 my_strcpy(p_ptr->died_from, dummy, sizeof p_ptr->died_from);
4068 /* No longer a winner */
4069 p_ptr->total_winner = FALSE;
4071 if (winning_seppuku)
4073 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, _("勝利の後切腹した。", "did Seppuku after the winning."));
4079 if (p_ptr->inside_arena)
4080 strcpy(buf,_("アリーナ", "in the Arena"));
4081 else if (!current_floor_ptr->dun_level)
4082 strcpy(buf,_("地上", "on the surface"));
4083 else if (q_idx && (is_fixed_quest_idx(q_idx) &&
4084 !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
4085 strcpy(buf,_("クエスト", "in a quest"));
4087 sprintf(buf,_("%d階", "level %d"), (int)current_floor_ptr->dun_level);
4089 sprintf(tmp, _("%sで%sに殺された。", "killed by %s %s."), buf, p_ptr->died_from);
4090 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
4093 do_cmd_write_nikki(NIKKI_GAMESTART, 1, _("-------- ゲームオーバー --------", "-------- Game Over --------"));
4094 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, "\n\n\n\n");
4098 if (get_check_strict(_("画面を保存しますか?", "Dump the screen? "), CHECK_NO_HISTORY))
4100 do_cmd_save_screen();
4105 /* Initialize "last message" buffer */
4106 if (p_ptr->last_message) string_free(p_ptr->last_message);
4107 p_ptr->last_message = NULL;
4109 /* Hack -- Note death */
4113 msg_format("あなたは%sました。", android ? "壊れ" : "死に");
4115 msg_print(android ? "You are broken." : "You die.");
4122 if (winning_seppuku)
4124 get_rnd_line(_("seppuku_j.txt", "seppuku.txt"), 0, death_message);
4128 get_rnd_line(_("death_j.txt", "death.txt"), 0, death_message);
4134 while (!get_string(winning_seppuku ? "辞世の句: " : "断末魔の叫び: ", death_message, 1024)) ;
4136 while (!get_string("Last word: ", death_message, 1024)) ;
4139 while (winning_seppuku && !get_check_strict(_("よろしいですか?", "Are you sure? "), CHECK_NO_HISTORY));
4141 if (death_message[0] == '\0')
4144 strcpy(death_message, format("あなたは%sました。", android ? "壊れ" : "死に"));
4146 strcpy(death_message, android ? "You are broken." : "You die.");
4149 else p_ptr->last_message = string_make(death_message);
4152 if (winning_seppuku)
4157 int msg_pos_x[9] = { 5, 7, 9, 12, 14, 17, 19, 21, 23};
4158 int msg_pos_y[9] = { 3, 4, 5, 4, 5, 4, 5, 6, 4};
4165 for (i = 0; i < 40; i++)
4166 Term_putstr(randint0(w / 2) * 2, randint0(h), 2, TERM_VIOLET, "υ");
4168 str = death_message;
4169 if (strncmp(str, "「", 2) == 0) str += 2;
4171 str2 = my_strstr(str, "」");
4172 if (str2 != NULL) *str2 = '\0';
4177 str2 = my_strstr(str, " ");
4178 if (str2 == NULL) len = strlen(str);
4179 else len = str2 - str;
4183 Term_putstr_v(w * 3 / 4 - 2 - msg_pos_x[i] * 2, msg_pos_y[i], len,
4185 if (str2 == NULL) break;
4189 if (*str == 0) break;
4193 Term_putstr(w-1, h-1, 1, TERM_WHITE, " ");
4197 /* Make screen dump */
4198 screen_dump = make_screen_dump();
4201 /* Wait a key press */
4206 msg_print(death_message);
4216 /* Hitpoint warning */
4217 if (p_ptr->chp < warning)
4219 /* Hack -- bell on first notice */
4220 if (old_chp > warning) bell();
4224 if (record_danger && (old_chp > warning))
4226 if (p_ptr->image && damage_type == DAMAGE_ATTACK)
4227 hit_from = _("何か", "something");
4229 sprintf(tmp,_("%sによってピンチに陥った。", "A critical situation because of %s."),hit_from);
4230 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
4235 /* stop auto_more even if DAMAGE_USELIFE */
4236 p_ptr->now_damaged = TRUE;
4239 msg_print(_("*** 警告:低ヒット・ポイント! ***", "*** LOW HITPOINT WARNING! ***"));
4243 if (p_ptr->wild_mode && !p_ptr->leaving && (p_ptr->chp < MAX(warning, p_ptr->mhp/5)))
4254 void gain_exp_64(s32b amount, u32b amount_frac)
4256 if (p_ptr->is_dead) return;
4258 if (p_ptr->prace == RACE_ANDROID) return;
4260 /* Gain some experience */
4261 s64b_add(&(p_ptr->exp), &(p_ptr->exp_frac), amount, amount_frac);
4263 /* Slowly recover from experience drainage */
4264 if (p_ptr->exp < p_ptr->max_exp)
4266 /* Gain max experience (20%) (was 10%) */
4267 p_ptr->max_exp += amount / 5;
4270 /* Check Experience */
4278 void gain_exp(s32b amount)
4280 gain_exp_64(amount, 0L);
4284 void calc_android_exp(void)
4288 if (p_ptr->is_dead) return;
4290 if (p_ptr->prace != RACE_ANDROID) return;
4292 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
4294 object_type *o_ptr = &p_ptr->inventory_list[i];
4296 object_type *q_ptr = &forge;
4298 DEPTH level = MAX(k_info[o_ptr->k_idx].level - 8, 1);
4300 if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue;
4301 if (!o_ptr->k_idx) continue;
4304 object_copy(q_ptr, o_ptr);
4305 q_ptr->discount = 0;
4306 q_ptr->curse_flags = 0L;
4308 if (object_is_fixed_artifact(o_ptr))
4310 level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
4311 level += MIN(20, a_info[o_ptr->name1].rarity/(a_info[o_ptr->name1].gen_flags & TRG_INSTA_ART ? 10 : 3));
4313 else if (object_is_ego(o_ptr))
4315 level += MAX(3, (e_info[o_ptr->name2].rating - 5)/2);
4317 else if (o_ptr->art_name)
4319 s32b total_flags = flag_cost(o_ptr, o_ptr->pval);
4322 if (!object_is_weapon_ammo(o_ptr))
4325 if (total_flags < 15000) fake_level = 10;
4326 else if (total_flags < 35000) fake_level = 25;
4327 else fake_level = 40;
4332 if (total_flags < 20000) fake_level = 10;
4333 else if (total_flags < 45000) fake_level = 25;
4334 else fake_level = 40;
4337 level = MAX(level, (level + MAX(fake_level - 8, 5)) / 2 + 3);
4340 value = object_value_real(q_ptr);
4342 if (value <= 0) continue;
4343 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (p_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
4344 if (value > 5000000L) value = 5000000L;
4345 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
4347 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr) ||
4348 (o_ptr->tval == TV_DRAG_ARMOR) ||
4349 ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) ||
4350 ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) ||
4351 ((o_ptr->tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)) ||
4352 ((o_ptr->tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) ||
4353 ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE)))
4355 if (level > 65) level = 35 + (level - 65) / 5;
4356 else if (level > 35) level = 25 + (level - 35) / 3;
4357 else if (level > 15) level = 15 + (level - 15) / 2;
4358 exp = MIN(100000L, value) / 2 * level * level;
4359 if (value > 100000L)
4360 exp += (value - 100000L) / 8 * level * level;
4364 exp = MIN(100000L, value) * level;
4365 if (value > 100000L)
4366 exp += (value - 100000L) / 4 * level;
4368 if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
4369 else total_exp += exp / 16;
4370 if (i == INVEN_BODY) total_exp += exp / 32;
4372 p_ptr->exp = p_ptr->max_exp = total_exp;
4374 /* Check Experience */
4382 void lose_exp(s32b amount)
4384 if (p_ptr->prace == RACE_ANDROID) return;
4386 /* Never drop below zero experience */
4387 if (amount > p_ptr->exp) amount = p_ptr->exp;
4389 /* Lose some experience */
4390 p_ptr->exp -= amount;
4392 /* Check Experience */
4399 * If resisted to draining, return FALSE
4401 bool drain_exp(s32b drain, s32b slip, int hold_exp_prob)
4403 /* Androids and their mimics are never drained */
4404 if (p_ptr->prace == RACE_ANDROID) return FALSE;
4406 if (p_ptr->hold_exp && (randint0(100) < hold_exp_prob))
4408 /* Hold experience */
4409 msg_print(_("しかし自己の経験値を守りきった!", "You keep hold of your experience!"));
4413 /* Hold experience failed */
4414 if (p_ptr->hold_exp)
4416 msg_print(_("経験値を少し吸い取られた気がする!", "You feel your experience slipping away!"));
4421 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away!"));
4429 bool set_ultimate_res(TIME_EFFECT v, bool do_dec)
4431 bool notice = FALSE;
4432 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
4434 if (p_ptr->is_dead) return FALSE;
4439 if (p_ptr->ult_res && !do_dec)
4441 if (p_ptr->ult_res > v) return FALSE;
4443 else if (!p_ptr->ult_res)
4445 msg_print(_("あらゆることに対して耐性がついた気がする!", "You feel resistant!"));
4455 msg_print(_("あらゆることに対する耐性が薄れた気がする。", "You feel less resistant"));
4462 p_ptr->redraw |= (PR_STATUS);
4464 /* Nothing to notice */
4465 if (!notice) return (FALSE);
4467 if (disturb_state) disturb(FALSE, FALSE);
4468 p_ptr->update |= (PU_BONUS);
4473 bool set_tim_res_nether(TIME_EFFECT v, bool do_dec)
4475 bool notice = FALSE;
4476 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
4478 if (p_ptr->is_dead) return FALSE;
4483 if (p_ptr->tim_res_nether && !do_dec)
4485 if (p_ptr->tim_res_nether > v) return FALSE;
4487 else if (!p_ptr->tim_res_nether)
4489 msg_print(_("地獄の力に対して耐性がついた気がする!", "You feel nether resistant!"));
4497 if (p_ptr->tim_res_nether)
4499 msg_print(_("地獄の力に対する耐性が薄れた気がする。", "You feel less nether resistant"));
4505 p_ptr->tim_res_nether = v;
4506 p_ptr->redraw |= (PR_STATUS);
4508 /* Nothing to notice */
4509 if (!notice) return (FALSE);
4511 if (disturb_state) disturb(FALSE, FALSE);
4512 p_ptr->update |= (PU_BONUS);
4517 bool set_tim_res_time(TIME_EFFECT v, bool do_dec)
4519 bool notice = FALSE;
4520 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
4522 if (p_ptr->is_dead) return FALSE;
4527 if (p_ptr->tim_res_time && !do_dec)
4529 if (p_ptr->tim_res_time > v) return FALSE;
4531 else if (!p_ptr->tim_res_time)
4533 msg_print(_("時間逆転の力に対して耐性がついた気がする!", "You feel time resistant!"));
4541 if (p_ptr->tim_res_time)
4543 msg_print(_("時間逆転の力に対する耐性が薄れた気がする。", "You feel less time resistant"));
4549 p_ptr->tim_res_time = v;
4550 p_ptr->redraw |= (PR_STATUS);
4552 /* Nothing to notice */
4553 if (!notice) return (FALSE);
4555 if (disturb_state) disturb(FALSE, FALSE);
4556 p_ptr->update |= (PU_BONUS);
4563 * Choose a warrior-mage elemental attack. -LM-
4565 bool choose_ele_attack(void)
4571 if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
4573 msg_format(_("武器を持たないと魔法剣は使えない。", "You cannot use temporary branding with no weapon."));
4578 num = (p_ptr->lev - 20) / 5;
4579 c_prt(TERM_RED, _(" a) 焼棄", " a) Fire Brand"), 2, 14);
4582 c_prt(TERM_L_WHITE,_(" b) 凍結", " b) Cold Brand"), 3, 14);
4587 c_prt(TERM_GREEN, _(" c) 毒殺", " c) Poison Brand"), 4, 14);
4592 c_prt(TERM_L_DARK, _(" d) 溶解", " d) Acid Brand"), 5, 14);
4597 c_prt(TERM_BLUE, _(" e) 電撃", " e) Elec Brand"), 6, 14);
4606 prt(_(" どの元素攻撃をしますか?", " Choose a temporary elemental brand "), 1, 14);
4610 if ((choice == 'a') || (choice == 'A'))
4611 set_ele_attack(ATTACK_FIRE, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4612 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
4613 set_ele_attack(ATTACK_COLD, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4614 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
4615 set_ele_attack(ATTACK_POIS, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4616 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
4617 set_ele_attack(ATTACK_ACID, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4618 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
4619 set_ele_attack(ATTACK_ELEC, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4622 msg_print(_("魔法剣を使うのをやめた。", "You cancel the temporary branding."));
4632 * Choose a elemental immune. -LM-
4634 bool choose_ele_immune(TIME_EFFECT immune_turn)
4639 c_prt(TERM_RED, _(" a) 火炎", " a) Immune Fire"), 2, 14);
4640 c_prt(TERM_L_WHITE,_(" b) 冷気", " b) Immune Cold"), 3, 14);
4641 c_prt(TERM_L_DARK, _(" c) 酸", " c) Immune Acid"), 4, 14);
4642 c_prt(TERM_BLUE, _(" d) 電撃", " d) Immune Elec"), 5, 14);
4650 prt(_(" どの元素の免疫をつけますか?", " Choose a temporary elemental immune "), 1, 14);
4654 if ((choice == 'a') || (choice == 'A'))
4655 set_ele_immune(DEFENSE_FIRE, immune_turn);
4656 else if ((choice == 'b') || (choice == 'B'))
4657 set_ele_immune(DEFENSE_COLD, immune_turn);
4658 else if ((choice == 'c') || (choice == 'C'))
4659 set_ele_immune(DEFENSE_ACID, immune_turn);
4660 else if ((choice == 'd') || (choice == 'D'))
4661 set_ele_immune(DEFENSE_ELEC, immune_turn);
4664 msg_print(_("免疫を付けるのをやめた。", "You cancel the temporary immune."));