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 "player-damage.h"
47 #include "monster-status.h"
50 #include "monster-spell.h"
52 #include "objectkind.h"
57 #include "view-mainwindow.h"
62 const kamae kamae_shurui[MAX_KAMAE] =
70 {"Genbu", 25, "(Black Tortoise) "},
71 {"Byakko", 30, "(White Tiger) "},
72 {"Seiryuu", 35, "(Blue Dragon) "},
73 {"Suzaku", 40, "(Red Phoenix) "},
80 const kamae kata_shurui[MAX_KATA] =
97 * @brief プレイヤーの継続行動を設定する。
98 * @param typ 継続行動のID\n
99 * #ACTION_NONE / #ACTION_SEARCH / #ACTION_REST / #ACTION_LEARN / #ACTION_FISH / #ACTION_KAMAE / #ACTION_KATA / #ACTION_SING / #ACTION_HAYAGAKE / #ACTION_SPELL から選択。
102 void set_action(ACTION_IDX typ)
104 int prev_typ = p_ptr->action;
116 msg_print(_("探索をやめた。", "You no longer walk carefully."));
117 p_ptr->redraw |= (PR_SPEED);
127 msg_print(_("学習をやめた。", "You stop Learning"));
128 p_ptr->new_mane = FALSE;
133 msg_print(_("構えをといた。", "You stop assuming the posture."));
134 p_ptr->special_defense &= ~(KAMAE_MASK);
139 msg_print(_("型を崩した。", "You stop assuming the posture."));
140 p_ptr->special_defense &= ~(KATA_MASK);
141 p_ptr->update |= (PU_MONSTERS);
142 p_ptr->redraw |= (PR_STATUS);
147 msg_print(_("歌うのをやめた。", "You stop singing."));
150 case ACTION_HAYAGAKE:
152 msg_print(_("足が重くなった。", "You are no longer walking extremely fast."));
153 take_turn(p_ptr, 100);
158 msg_print(_("呪文の詠唱を中断した。", "You stopped spelling all spells."));
166 /* If we are requested other action, stop singing */
167 if (prev_typ == ACTION_SING) stop_singing(p_ptr);
168 if (prev_typ == ACTION_SPELL) stop_hex_spell();
170 switch (p_ptr->action)
174 msg_print(_("注意深く歩き始めた。", "You begin to walk carefully."));
175 p_ptr->redraw |= (PR_SPEED);
180 msg_print(_("学習を始めた。", "You begin Learning"));
185 msg_print(_("水面に糸を垂らした...", "You begin fishing..."));
188 case ACTION_HAYAGAKE:
190 msg_print(_("足が羽のように軽くなった。", "You begin to walk extremely fast."));
198 p_ptr->update |= (PU_BONUS);
199 p_ptr->redraw |= (PR_STATE);
203 * @brief プレイヤーの全ての時限効果をリセットする。 / reset timed flags
206 void reset_tim_flags(void)
208 p_ptr->fast = 0; /* Timed -- Fast */
209 p_ptr->lightspeed = 0;
210 p_ptr->slow = 0; /* Timed -- Slow */
211 p_ptr->blind = 0; /* Timed -- Blindness */
212 p_ptr->paralyzed = 0; /* Timed -- Paralysis */
213 p_ptr->confused = 0; /* Timed -- Confusion */
214 p_ptr->afraid = 0; /* Timed -- Fear */
215 p_ptr->image = 0; /* Timed -- Hallucination */
216 p_ptr->poisoned = 0; /* Timed -- Poisoned */
217 p_ptr->cut = 0; /* Timed -- Cut */
218 p_ptr->stun = 0; /* Timed -- Stun */
220 p_ptr->protevil = 0; /* Timed -- Protection */
221 p_ptr->invuln = 0; /* Timed -- Invulnerable */
223 p_ptr->hero = 0; /* Timed -- Heroism */
224 p_ptr->shero = 0; /* Timed -- Super Heroism */
225 p_ptr->shield = 0; /* Timed -- Shield Spell */
226 p_ptr->blessed = 0; /* Timed -- Blessed */
227 p_ptr->tim_invis = 0; /* Timed -- Invisibility */
228 p_ptr->tim_infra = 0; /* Timed -- Infra Vision */
229 p_ptr->tim_regen = 0; /* Timed -- Regeneration */
230 p_ptr->tim_stealth = 0; /* Timed -- Stealth */
232 p_ptr->wraith_form = 0; /* Timed -- Wraith Form */
233 p_ptr->tim_levitation = 0;
234 p_ptr->tim_sh_touki = 0;
235 p_ptr->tim_sh_fire = 0;
236 p_ptr->tim_sh_holy = 0;
237 p_ptr->tim_eyeeye = 0;
239 p_ptr->resist_magic = 0;
242 p_ptr->tim_res_nether = 0;
243 p_ptr->tim_res_time = 0;
244 p_ptr->tim_mimic = 0;
245 p_ptr->mimic_form = 0;
246 p_ptr->tim_reflect = 0;
247 p_ptr->multishadow = 0;
249 p_ptr->action = ACTION_NONE;
251 p_ptr->oppose_acid = 0; /* Timed -- oppose acid */
252 p_ptr->oppose_elec = 0; /* Timed -- oppose lightning */
253 p_ptr->oppose_fire = 0; /* Timed -- oppose heat */
254 p_ptr->oppose_cold = 0; /* Timed -- oppose cold */
255 p_ptr->oppose_pois = 0; /* Timed -- oppose poison */
257 p_ptr->word_recall = 0;
258 p_ptr->alter_reality = 0;
259 p_ptr->sutemi = FALSE;
260 p_ptr->counter = FALSE;
261 p_ptr->ele_attack = 0;
262 p_ptr->ele_immune = 0;
263 p_ptr->special_attack = 0L;
264 p_ptr->special_defense = 0L;
266 while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
267 p_ptr->timewalk = FALSE;
269 if (PRACE_IS_(p_ptr, RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
270 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1;
271 if (p_ptr->pclass == CLASS_BERSERKER) p_ptr->shero = 1;
275 (void)set_monster_fast(p_ptr->riding, 0);
276 (void)set_monster_slow(p_ptr->riding, 0);
277 (void)set_monster_invulner(p_ptr->riding, 0, FALSE);
280 if (p_ptr->pclass == CLASS_BARD)
282 SINGING_SONG_EFFECT(p_ptr) = 0;
283 SINGING_SONG_ID(p_ptr) = 0;
288 * @brief プレイヤーに魔力消去効果を与える。
291 void dispel_player(void)
293 (void)set_fast(0, TRUE);
294 (void)set_lightspeed(0, TRUE);
295 (void)set_slow(0, TRUE);
296 (void)set_shield(0, TRUE);
297 (void)set_blessed(0, TRUE);
298 (void)set_tsuyoshi(0, TRUE);
299 (void)set_hero(0, TRUE);
300 (void)set_shero(0, TRUE);
301 (void)set_protevil(0, TRUE);
302 (void)set_invuln(0, TRUE);
303 (void)set_wraith_form(0, TRUE);
304 (void)set_kabenuke(0, TRUE);
305 (void)set_tim_res_nether(0, TRUE);
306 (void)set_tim_res_time(0, TRUE);
308 (void)set_tim_reflect(0,TRUE);
309 (void)set_multishadow(0,TRUE);
310 (void)set_dustrobe(0,TRUE);
312 (void)set_tim_invis(0, TRUE);
313 (void)set_tim_infra(0, TRUE);
314 (void)set_tim_esp(0, TRUE);
315 (void)set_tim_regen(0, TRUE);
316 (void)set_tim_stealth(0, TRUE);
317 (void)set_tim_levitation(0, TRUE);
318 (void)set_tim_sh_touki(0, TRUE);
319 (void)set_tim_sh_fire(0, TRUE);
320 (void)set_tim_sh_holy(0, TRUE);
321 (void)set_tim_eyeeye(0, TRUE);
322 (void)set_magicdef(0, TRUE);
323 (void)set_resist_magic(0, TRUE);
324 (void)set_oppose_acid(0, TRUE);
325 (void)set_oppose_elec(0, TRUE);
326 (void)set_oppose_fire(0, TRUE);
327 (void)set_oppose_cold(0, TRUE);
328 (void)set_oppose_pois(0, TRUE);
329 (void)set_ultimate_res(0, TRUE);
330 (void)set_mimic(p_ptr, 0, 0, TRUE);
331 (void)set_ele_attack(0, 0);
332 (void)set_ele_immune(0, 0);
334 /* Cancel glowing hands */
335 if (p_ptr->special_attack & ATTACK_CONFUSE)
337 p_ptr->special_attack &= ~(ATTACK_CONFUSE);
338 msg_print(_("手の輝きがなくなった。", "Your hands stop glowing."));
341 if (music_singing_any() || hex_spelling_any())
343 concptr str = (music_singing_any()) ? _("歌", "singing") : _("呪文", "spelling");
344 INTERUPTING_SONG_EFFECT(p_ptr) = SINGING_SONG_EFFECT(p_ptr);
345 SINGING_SONG_EFFECT(p_ptr) = MUSIC_NONE;
346 msg_format(_("%sが途切れた。", "Your %s is interrupted."), str);
348 p_ptr->action = ACTION_NONE;
349 p_ptr->update |= (PU_BONUS | PU_HP | PU_MONSTERS);
350 p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
351 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
352 p_ptr->energy_need += ENERGY_NEED();
358 * @brief 変身効果の継続時間と変身先をセットする / Set "p_ptr->tim_mimic", and "p_ptr->mimic_form", notice observable changes
361 * @param do_dec 現在の継続時間より長い値のみ上書きする
362 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
364 bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, IDX p, bool do_dec)
367 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
369 if (creature_ptr->is_dead) return FALSE;
374 if (creature_ptr->tim_mimic && (creature_ptr->mimic_form == p) && !do_dec)
376 if (creature_ptr->tim_mimic > v) return FALSE;
378 else if ((!creature_ptr->tim_mimic) || (creature_ptr->mimic_form != p))
380 msg_print(_("自分の体が変わってゆくのを感じた。", "You feel that your body changes."));
381 creature_ptr->mimic_form = p;
389 if (creature_ptr->tim_mimic)
391 msg_print(_("変身が解けた。", "You are no longer transformed."));
392 if (creature_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(0, TRUE);
393 creature_ptr->mimic_form=0;
400 creature_ptr->tim_mimic = v;
402 /* Nothing to notice */
403 if (!notice) return (FALSE);
405 if (disturb_state) disturb(FALSE, TRUE);
407 creature_ptr->redraw |= (PR_BASIC | PR_STATUS);
408 creature_ptr->update |= (PU_BONUS | PU_HP);
415 * @brief 盲目の継続時間をセットする / Set "p_ptr->blind", notice observable changes
417 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
419 * Note the use of "PU_UN_LITE" and "PU_UN_VIEW", which is needed to\n
420 * memorize any terrain features which suddenly become "visible".\n
421 * Note that blindness is currently the only thing which can affect\n
422 * "player_can_see_bold()".\n
424 bool set_blind(player_type *creature_ptr, TIME_EFFECT v)
427 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
429 if (creature_ptr->is_dead) return FALSE;
434 if (!creature_ptr->blind)
436 if (creature_ptr->prace == RACE_ANDROID)
438 msg_print(_("センサーをやられた!", "You are blind!"));
442 msg_print(_("目が見えなくなってしまった!", "You are blind!"));
446 chg_virtue(V_ENLIGHTEN, -1);
453 if (creature_ptr->blind)
455 if (creature_ptr->prace == RACE_ANDROID)
457 msg_print(_("センサーが復旧した。", "You can see again."));
461 msg_print(_("やっと目が見えるようになった。", "You can see again."));
469 creature_ptr->blind = v;
470 creature_ptr->redraw |= (PR_STATUS);
472 /* Nothing to notice */
473 if (!notice) return (FALSE);
474 if (disturb_state) disturb(FALSE, FALSE);
476 /* Fully update the visuals */
477 creature_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
478 creature_ptr->redraw |= (PR_MAP);
479 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
486 * @brief 混乱の継続時間をセットする / Set "p_ptr->confused", notice observable changes
488 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
490 bool set_confused(player_type *creature_ptr, TIME_EFFECT v)
493 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
495 if (creature_ptr->is_dead) return FALSE;
500 if (!creature_ptr->confused)
502 msg_print(_("あなたは混乱した!", "You are confused!"));
504 if (creature_ptr->action == ACTION_LEARN)
506 msg_print(_("学習が続けられない!", "You cannot continue Learning!"));
507 creature_ptr->new_mane = FALSE;
509 creature_ptr->redraw |= (PR_STATE);
510 creature_ptr->action = ACTION_NONE;
512 if (creature_ptr->action == ACTION_KAMAE)
514 msg_print(_("構えがとけた。", "Your posture gets loose."));
515 creature_ptr->special_defense &= ~(KAMAE_MASK);
516 creature_ptr->update |= (PU_BONUS);
517 creature_ptr->redraw |= (PR_STATE);
518 creature_ptr->action = ACTION_NONE;
520 else if (creature_ptr->action == ACTION_KATA)
522 msg_print(_("型が崩れた。", "Your posture gets loose."));
523 creature_ptr->special_defense &= ~(KATA_MASK);
524 creature_ptr->update |= (PU_BONUS);
525 creature_ptr->update |= (PU_MONSTERS);
526 creature_ptr->redraw |= (PR_STATE);
527 creature_ptr->redraw |= (PR_STATUS);
528 creature_ptr->action = ACTION_NONE;
532 if (creature_ptr->concent) reset_concentration(TRUE);
535 if (hex_spelling_any()) stop_hex_spell_all();
538 creature_ptr->counter = FALSE;
539 chg_virtue(V_HARMONY, -1);
546 if (creature_ptr->confused)
548 msg_print(_("やっと混乱がおさまった。", "You feel less confused now."));
549 creature_ptr->special_attack &= ~(ATTACK_SUIKEN);
555 creature_ptr->confused = v;
556 creature_ptr->redraw |= (PR_STATUS);
558 /* Nothing to notice */
559 if (!notice) return (FALSE);
561 if (disturb_state) disturb(FALSE, FALSE);
568 * @brief 毒の継続時間をセットする / Set "p_ptr->poisoned", notice observable changes
570 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
572 bool set_poisoned(player_type *creature_ptr, TIME_EFFECT v)
575 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
577 if (creature_ptr->is_dead) return FALSE;
582 if (!creature_ptr->poisoned)
584 msg_print(_("毒に侵されてしまった!", "You are poisoned!"));
592 if (creature_ptr->poisoned)
594 msg_print(_("やっと毒の痛みがなくなった。", "You are no longer poisoned."));
600 creature_ptr->poisoned = v;
601 creature_ptr->redraw |= (PR_STATUS);
603 /* Nothing to notice */
604 if (!notice) return (FALSE);
606 if (disturb_state) disturb(FALSE, FALSE);
613 * @brief 恐怖の継続時間をセットする / Set "p_ptr->afraid", notice observable changes
615 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
617 bool set_afraid(player_type *creature_ptr, TIME_EFFECT v)
620 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
622 if (creature_ptr->is_dead) return FALSE;
627 if (!creature_ptr->afraid)
629 msg_print(_("何もかも恐くなってきた!", "You are terrified!"));
631 if (creature_ptr->special_defense & KATA_MASK)
633 msg_print(_("型が崩れた。", "Your posture gets loose."));
634 creature_ptr->special_defense &= ~(KATA_MASK);
635 creature_ptr->update |= (PU_BONUS);
636 creature_ptr->update |= (PU_MONSTERS);
637 creature_ptr->redraw |= (PR_STATE);
638 creature_ptr->redraw |= (PR_STATUS);
639 creature_ptr->action = ACTION_NONE;
643 creature_ptr->counter = FALSE;
644 chg_virtue(V_VALOUR, -1);
651 if (creature_ptr->afraid)
653 msg_print(_("やっと恐怖を振り払った。", "You feel bolder now."));
659 creature_ptr->afraid = v;
660 creature_ptr->redraw |= (PR_STATUS);
662 /* Nothing to notice */
663 if (!notice) return (FALSE);
665 if (disturb_state) disturb(FALSE, FALSE);
671 * @brief 麻痺の継続時間をセットする / Set "p_ptr->paralyzed", notice observable changes
673 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
675 bool set_paralyzed(TIME_EFFECT v)
678 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
680 if (p_ptr->is_dead) return FALSE;
685 if (!p_ptr->paralyzed)
687 msg_print(_("体が麻痺してしまった!", "You are paralyzed!"));
689 if (p_ptr->concent) reset_concentration(TRUE);
692 if (hex_spelling_any()) stop_hex_spell_all();
694 p_ptr->counter = FALSE;
702 if (p_ptr->paralyzed)
704 msg_print(_("やっと動けるようになった。", "You can move again."));
710 p_ptr->paralyzed = v;
711 p_ptr->redraw |= (PR_STATUS);
713 /* Nothing to notice */
714 if (!notice) return (FALSE);
716 if (disturb_state) disturb(FALSE, FALSE);
717 p_ptr->redraw |= (PR_STATE);
723 * @brief 幻覚の継続時間をセットする / Set "p_ptr->image", notice observable changes
725 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
726 * @details Note that we must redraw the map when hallucination changes.
728 bool set_image(TIME_EFFECT v)
731 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
733 if (p_ptr->is_dead) return FALSE;
734 if (p_ptr->pseikaku == SEIKAKU_CHARGEMAN) v = 0;
740 set_tsuyoshi(0, TRUE);
743 msg_print(_("ワーオ!何もかも虹色に見える!", "Oh, wow! Everything looks so cosmic now!"));
746 if (p_ptr->concent) reset_concentration(TRUE);
748 p_ptr->counter = FALSE;
758 msg_print(_("やっとはっきりと物が見えるようになった。", "You can see clearly again."));
765 p_ptr->redraw |= (PR_STATUS);
767 /* Nothing to notice */
768 if (!notice) return (FALSE);
770 if (disturb_state) disturb(FALSE, TRUE);
772 p_ptr->redraw |= (PR_MAP | PR_HEALTH | PR_UHEALTH);
773 p_ptr->update |= (PU_MONSTERS);
774 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
780 * @brief 加速の継続時間をセットする / Set "p_ptr->fast", notice observable changes
782 * @param do_dec 現在の継続時間より長い値のみ上書きする
783 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
785 bool set_fast(TIME_EFFECT v, bool do_dec)
788 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
790 if (p_ptr->is_dead) return FALSE;
795 if (p_ptr->fast && !do_dec)
797 if (p_ptr->fast > v) return FALSE;
799 else if (!IS_FAST() && !p_ptr->lightspeed)
801 msg_print(_("素早く動けるようになった!", "You feel yourself moving much faster!"));
803 chg_virtue(V_PATIENCE, -1);
804 chg_virtue(V_DILIGENCE, 1);
811 if (p_ptr->fast && !p_ptr->lightspeed && !music_singing(MUSIC_SPEED) && !music_singing(MUSIC_SHERO))
813 msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
821 /* Nothing to notice */
822 if (!notice) return (FALSE);
824 if (disturb_state) disturb(FALSE, FALSE);
825 p_ptr->update |= (PU_BONUS);
831 * @brief 光速移動の継続時間をセットする / Set "p_ptr->lightspeed", notice observable changes
833 * @param do_dec 現在の継続時間より長い値のみ上書きする
834 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
836 bool set_lightspeed(TIME_EFFECT v, bool do_dec)
839 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
841 if (p_ptr->is_dead) return FALSE;
843 if (p_ptr->wild_mode) v = 0;
848 if (p_ptr->lightspeed && !do_dec)
850 if (p_ptr->lightspeed > v) return FALSE;
852 else if (!p_ptr->lightspeed)
854 msg_print(_("非常に素早く動けるようになった!", "You feel yourself moving extremely faster!"));
856 chg_virtue(V_PATIENCE, -1);
857 chg_virtue(V_DILIGENCE, 1);
864 if (p_ptr->lightspeed)
866 msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
872 p_ptr->lightspeed = v;
874 /* Nothing to notice */
875 if (!notice) return (FALSE);
877 if (disturb_state) disturb(FALSE, FALSE);
878 p_ptr->update |= (PU_BONUS);
884 * @brief 減速の継続時間をセットする / Set "p_ptr->slow", notice observable changes
886 * @param do_dec 現在の継続時間より長い値のみ上書きする
887 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
889 bool set_slow(TIME_EFFECT v, bool do_dec)
892 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
894 if (p_ptr->is_dead) return FALSE;
899 if (p_ptr->slow && !do_dec)
901 if (p_ptr->slow > v) return FALSE;
903 else if (!p_ptr->slow)
905 msg_print(_("体の動きが遅くなってしまった!", "You feel yourself moving slower!"));
915 msg_print(_("動きの遅さがなくなったようだ。", "You feel yourself speed up."));
923 /* Nothing to notice */
924 if (!notice) return (FALSE);
926 if (disturb_state) disturb(FALSE, FALSE);
927 p_ptr->update |= (PU_BONUS);
934 * @brief 肌石化の継続時間をセットする / Set "p_ptr->shield", notice observable changes
936 * @param do_dec 現在の継続時間より長い値のみ上書きする
937 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
939 bool set_shield(TIME_EFFECT v, bool do_dec)
942 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
944 if (p_ptr->is_dead) return FALSE;
949 if (p_ptr->shield && !do_dec)
951 if (p_ptr->shield > v) return FALSE;
953 else if (!p_ptr->shield)
955 msg_print(_("肌が石になった。", "Your skin turns to stone."));
965 msg_print(_("肌が元に戻った。", "Your skin returns to normal."));
972 p_ptr->redraw |= (PR_STATUS);
974 /* Nothing to notice */
975 if (!notice) return (FALSE);
977 if (disturb_state) disturb(FALSE, FALSE);
978 p_ptr->update |= (PU_BONUS);
985 * @brief つぶれるの継続時間をセットする / Set "p_ptr->tsubureru", notice observable changes
987 * @param do_dec 現在の継続時間より長い値のみ上書きする
988 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
990 bool set_tsubureru(TIME_EFFECT v, bool do_dec)
993 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
995 if (p_ptr->is_dead) return FALSE;
1000 if (p_ptr->tsubureru && !do_dec)
1002 if (p_ptr->tsubureru > v) return FALSE;
1004 else if (!p_ptr->tsubureru)
1006 msg_print(_("横に伸びた。", "Your body expands horizontally."));
1014 if (p_ptr->tsubureru)
1016 msg_print(_("もう横に伸びていない。", "Your body returns to normal."));
1022 p_ptr->tsubureru = v;
1023 p_ptr->redraw |= (PR_STATUS);
1025 /* Nothing to notice */
1026 if (!notice) return (FALSE);
1028 if (disturb_state) disturb(FALSE, FALSE);
1029 p_ptr->update |= (PU_BONUS);
1036 * @brief 魔法の鎧の継続時間をセットする / Set "p_ptr->magicdef", notice observable changes
1038 * @param do_dec 現在の継続時間より長い値のみ上書きする
1039 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1041 bool set_magicdef(TIME_EFFECT v, bool do_dec)
1043 bool notice = FALSE;
1044 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1046 if (p_ptr->is_dead) return FALSE;
1051 if (p_ptr->magicdef && !do_dec)
1053 if (p_ptr->magicdef > v) return FALSE;
1055 else if (!p_ptr->magicdef)
1057 msg_print(_("魔法の防御力が増したような気がする。", "You feel more resistant to magic."));
1065 if (p_ptr->magicdef)
1067 msg_print(_("魔法の防御力が元に戻った。", "You feel less resistant to magic."));
1073 p_ptr->magicdef = v;
1074 p_ptr->redraw |= (PR_STATUS);
1076 /* Nothing to notice */
1077 if (!notice) return (FALSE);
1079 if (disturb_state) disturb(FALSE, FALSE);
1080 p_ptr->update |= (PU_BONUS);
1086 * @brief 祝福の継続時間をセットする / Set "p_ptr->blessed", notice observable changes
1088 * @param do_dec 現在の継続時間より長い値のみ上書きする
1089 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1091 bool set_blessed(TIME_EFFECT v, bool do_dec)
1093 bool notice = FALSE;
1094 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1096 if (p_ptr->is_dead) return FALSE;
1101 if (p_ptr->blessed && !do_dec)
1103 if (p_ptr->blessed > v) return FALSE;
1105 else if (!IS_BLESSED())
1107 msg_print(_("高潔な気分になった!", "You feel righteous!"));
1115 if (p_ptr->blessed && !music_singing(MUSIC_BLESS))
1117 msg_print(_("高潔な気分が消え失せた。", "The prayer has expired."));
1124 p_ptr->redraw |= (PR_STATUS);
1126 /* Nothing to notice */
1127 if (!notice) return (FALSE);
1129 if (disturb_state) disturb(FALSE, FALSE);
1130 p_ptr->update |= (PU_BONUS);
1137 * @brief 士気高揚の継続時間をセットする / Set "p_ptr->hero", notice observable changes
1139 * @param do_dec 現在の継続時間より長い値のみ上書きする
1140 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1142 bool set_hero(TIME_EFFECT v, bool do_dec)
1144 bool notice = FALSE;
1145 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1147 if (p_ptr->is_dead) return FALSE;
1152 if (p_ptr->hero && !do_dec)
1154 if (p_ptr->hero > v) return FALSE;
1156 else if (!IS_HERO())
1158 msg_print(_("ヒーローになった気がする!", "You feel like a hero!"));
1166 if (p_ptr->hero && !music_singing(MUSIC_HERO) && !music_singing(MUSIC_SHERO))
1168 msg_print(_("ヒーローの気分が消え失せた。", "The heroism wears off."));
1175 p_ptr->redraw |= (PR_STATUS);
1177 /* Nothing to notice */
1178 if (!notice) return (FALSE);
1180 if (disturb_state) disturb(FALSE, FALSE);
1181 p_ptr->update |= (PU_BONUS);
1183 /* Recalculate hitpoints */
1184 p_ptr->update |= (PU_HP);
1190 * @brief 狂戦士化の継続時間をセットする / Set "p_ptr->shero", notice observable changes
1191 * @param v 継続時間/ 0ならば無条件にリセット
1192 * @param do_dec FALSEの場合現在の継続時間より長い値のみ上書きする
1193 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1195 bool set_shero(TIME_EFFECT v, bool do_dec)
1197 bool notice = FALSE;
1198 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1200 if (p_ptr->is_dead) return FALSE;
1202 if (p_ptr->pclass == CLASS_BERSERKER) v = 1;
1206 if (p_ptr->shero && !do_dec)
1208 if (p_ptr->shero > v) return FALSE;
1210 else if (!p_ptr->shero)
1212 msg_print(_("殺戮マシーンになった気がする!", "You feel like a killing machine!"));
1222 msg_print(_("野蛮な気持ちが消え失せた。", "You feel less Berserk."));
1229 p_ptr->redraw |= (PR_STATUS);
1231 /* Nothing to notice */
1232 if (!notice) return (FALSE);
1234 if (disturb_state) disturb(FALSE, FALSE);
1235 p_ptr->update |= (PU_BONUS);
1237 /* Recalculate hitpoints */
1238 p_ptr->update |= (PU_HP);
1244 * @brief 対邪悪結界の継続時間をセットする / Set "p_ptr->protevil", notice observable changes
1246 * @param do_dec 現在の継続時間より長い値のみ上書きする
1247 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1249 bool set_protevil(TIME_EFFECT v, bool do_dec)
1251 bool notice = FALSE;
1252 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1254 if (p_ptr->is_dead) return FALSE;
1259 if (p_ptr->protevil && !do_dec)
1261 if (p_ptr->protevil > v) return FALSE;
1263 else if (!p_ptr->protevil)
1265 msg_print(_("邪悪なる存在から守られているような感じがする!", "You feel safe from evil!"));
1273 if (p_ptr->protevil)
1275 msg_print(_("邪悪なる存在から守られている感じがなくなった。", "You no longer feel safe from evil."));
1281 p_ptr->protevil = v;
1282 p_ptr->redraw |= (PR_STATUS);
1284 /* Nothing to notice */
1285 if (!notice) return (FALSE);
1287 if (disturb_state) disturb(FALSE, FALSE);
1293 * @brief 幽体化の継続時間をセットする / Set "p_ptr->wraith_form", notice observable changes
1295 * @param do_dec 現在の継続時間より長い値のみ上書きする
1296 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1298 bool set_wraith_form(TIME_EFFECT v, bool do_dec)
1300 bool notice = FALSE;
1301 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1303 if (p_ptr->is_dead) return FALSE;
1308 if (p_ptr->wraith_form && !do_dec)
1310 if (p_ptr->wraith_form > v) return FALSE;
1312 else if (!p_ptr->wraith_form)
1314 msg_print(_("物質界を離れて幽鬼のような存在になった!", "You leave the physical world and current_world_ptr->game_turn into a wraith-being!"));
1316 chg_virtue(V_UNLIFE, 3);
1317 chg_virtue(V_HONOUR, -2);
1318 chg_virtue(V_SACRIFICE, -2);
1319 chg_virtue(V_VALOUR, -5);
1321 p_ptr->redraw |= (PR_MAP);
1322 p_ptr->update |= (PU_MONSTERS);
1324 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1331 if (p_ptr->wraith_form)
1333 msg_print(_("不透明になった感じがする。", "You feel opaque."));
1336 p_ptr->redraw |= (PR_MAP);
1337 p_ptr->update |= (PU_MONSTERS);
1339 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1344 p_ptr->wraith_form = v;
1345 p_ptr->redraw |= (PR_STATUS);
1347 /* Nothing to notice */
1348 if (!notice) return (FALSE);
1350 if (disturb_state) disturb(FALSE, FALSE);
1351 p_ptr->update |= (PU_BONUS);
1358 * @brief 無傷球の継続時間をセットする / Set "p_ptr->invuln", notice observable changes
1360 * @param do_dec 現在の継続時間より長い値のみ上書きする
1361 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1363 bool set_invuln(TIME_EFFECT v, bool do_dec)
1365 bool notice = FALSE;
1366 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1368 if (p_ptr->is_dead) return FALSE;
1373 if (p_ptr->invuln && !do_dec)
1375 if (p_ptr->invuln > v) return FALSE;
1377 else if (!IS_INVULN())
1379 msg_print(_("無敵だ!", "Invulnerability!"));
1382 chg_virtue(V_UNLIFE, -2);
1383 chg_virtue(V_HONOUR, -2);
1384 chg_virtue(V_SACRIFICE, -3);
1385 chg_virtue(V_VALOUR, -5);
1387 p_ptr->redraw |= (PR_MAP);
1388 p_ptr->update |= (PU_MONSTERS);
1390 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1397 if (p_ptr->invuln && !music_singing(MUSIC_INVULN))
1399 msg_print(_("無敵ではなくなった。", "The invulnerability wears off."));
1402 p_ptr->redraw |= (PR_MAP);
1403 p_ptr->update |= (PU_MONSTERS);
1405 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1407 p_ptr->energy_need += ENERGY_NEED();
1413 p_ptr->redraw |= (PR_STATUS);
1415 /* Nothing to notice */
1416 if (!notice) return (FALSE);
1418 if (disturb_state) disturb(FALSE, FALSE);
1419 p_ptr->update |= (PU_BONUS);
1425 * @brief 時限ESPの継続時間をセットする / Set "p_ptr->tim_esp", notice observable changes
1427 * @param do_dec 現在の継続時間より長い値のみ上書きする
1428 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1430 bool set_tim_esp(TIME_EFFECT v, bool do_dec)
1432 bool notice = FALSE;
1433 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1435 if (p_ptr->is_dead) return FALSE;
1440 if (p_ptr->tim_esp && !do_dec)
1442 if (p_ptr->tim_esp > v) return FALSE;
1444 else if (!IS_TIM_ESP())
1446 msg_print(_("意識が広がった気がする!", "You feel your consciousness expand!"));
1454 if (p_ptr->tim_esp && !music_singing(MUSIC_MIND))
1456 msg_print(_("意識は元に戻った。", "Your consciousness contracts again."));
1463 p_ptr->redraw |= (PR_STATUS);
1465 /* Nothing to notice */
1466 if (!notice) return (FALSE);
1468 if (disturb_state) disturb(FALSE, FALSE);
1469 p_ptr->update |= (PU_BONUS);
1470 p_ptr->update |= (PU_MONSTERS);
1476 * @brief 時限透明視の継続時間をセットする / Set "p_ptr->tim_invis", notice observable changes
1478 * @param do_dec 現在の継続時間より長い値のみ上書きする
1479 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1481 bool set_tim_invis(TIME_EFFECT v, bool do_dec)
1483 bool notice = FALSE;
1484 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1486 if (p_ptr->is_dead) return FALSE;
1491 if (p_ptr->tim_invis && !do_dec)
1493 if (p_ptr->tim_invis > v) return FALSE;
1495 else if (!p_ptr->tim_invis)
1497 msg_print(_("目が非常に敏感になった気がする!", "Your eyes feel very sensitive!"));
1505 if (p_ptr->tim_invis)
1507 msg_print(_("目の敏感さがなくなったようだ。", "Your eyes feel less sensitive."));
1513 p_ptr->tim_invis = v;
1514 p_ptr->redraw |= (PR_STATUS);
1516 /* Nothing to notice */
1517 if (!notice) return (FALSE);
1519 if (disturb_state) disturb(FALSE, FALSE);
1520 p_ptr->update |= (PU_BONUS);
1522 /* Update the monsters */
1523 p_ptr->update |= (PU_MONSTERS);
1529 * @brief 時限赤外線視力の継続時間をセットする / Set "p_ptr->tim_infra", notice observable changes
1531 * @param do_dec 現在の継続時間より長い値のみ上書きする
1532 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1534 bool set_tim_infra(TIME_EFFECT v, bool do_dec)
1536 bool notice = FALSE;
1537 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1539 if (p_ptr->is_dead) return FALSE;
1544 if (p_ptr->tim_infra && !do_dec)
1546 if (p_ptr->tim_infra > v) return FALSE;
1548 else if (!p_ptr->tim_infra)
1550 msg_print(_("目がランランと輝き始めた!", "Your eyes begin to tingle!"));
1558 if (p_ptr->tim_infra)
1560 msg_print(_("目の輝きがなくなった。", "Your eyes stop tingling."));
1566 p_ptr->tim_infra = v;
1567 p_ptr->redraw |= (PR_STATUS);
1569 /* Nothing to notice */
1570 if (!notice) return (FALSE);
1572 if (disturb_state) disturb(FALSE, FALSE);
1573 p_ptr->update |= (PU_BONUS);
1575 /* Update the monsters */
1576 p_ptr->update |= (PU_MONSTERS);
1582 * @brief 時限急回復の継続時間をセットする / Set "p_ptr->tim_regen", notice observable changes
1584 * @param do_dec 現在の継続時間より長い値のみ上書きする
1585 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1587 bool set_tim_regen(TIME_EFFECT v, bool do_dec)
1589 bool notice = FALSE;
1590 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1592 if (p_ptr->is_dead) return FALSE;
1597 if (p_ptr->tim_regen && !do_dec)
1599 if (p_ptr->tim_regen > v) return FALSE;
1601 else if (!p_ptr->tim_regen)
1603 msg_print(_("回復力が上がった!", "You feel yourself regenerating quickly!"));
1611 if (p_ptr->tim_regen)
1613 msg_print(_("素早く回復する感じがなくなった。", "You feel yourself regenerating slowly."));
1619 p_ptr->tim_regen = v;
1620 p_ptr->redraw |= (PR_STATUS);
1622 /* Nothing to notice */
1623 if (!notice) return (FALSE);
1625 if (disturb_state) disturb(FALSE, FALSE);
1626 p_ptr->update |= (PU_BONUS);
1632 * @brief 隠密の歌の継続時間をセットする / Set "p_ptr->tim_stealth", notice observable changes
1634 * @param do_dec 現在の継続時間より長い値のみ上書きする
1635 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1637 bool set_tim_stealth(TIME_EFFECT v, bool do_dec)
1639 bool notice = FALSE;
1640 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1642 if (p_ptr->is_dead) return FALSE;
1647 if (p_ptr->tim_stealth && !do_dec)
1649 if (p_ptr->tim_stealth > v) return FALSE;
1651 else if (!IS_TIM_STEALTH())
1653 msg_print(_("足音が小さくなった!", "You begin to walk silently!"));
1661 if (p_ptr->tim_stealth && !music_singing(MUSIC_STEALTH))
1663 msg_print(_("足音が大きくなった。", "You no longer walk silently."));
1669 p_ptr->tim_stealth = v;
1670 p_ptr->redraw |= (PR_STATUS);
1672 /* Nothing to notice */
1673 if (!notice) return (FALSE);
1675 if (disturb_state) disturb(FALSE, FALSE);
1676 p_ptr->update |= (PU_BONUS);
1682 * @brief 超隠密状態をセットする
1683 * @param set TRUEならば超隠密状態になる。
1684 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1686 bool set_superstealth(bool set)
1688 bool notice = FALSE;
1690 if (p_ptr->is_dead) return FALSE;
1695 if (!(p_ptr->special_defense & NINJA_S_STEALTH))
1697 if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_MNLT)
1699 msg_print(_("敵の目から薄い影の中に覆い隠された。", "You are mantled in weak shadow from ordinary eyes."));
1700 p_ptr->monlite = p_ptr->old_monlite = TRUE;
1704 msg_print(_("敵の目から影の中に覆い隠された!", "You are mantled in shadow from ordinary eyes!"));
1705 p_ptr->monlite = p_ptr->old_monlite = FALSE;
1711 p_ptr->special_defense |= NINJA_S_STEALTH;
1718 if (p_ptr->special_defense & NINJA_S_STEALTH)
1720 msg_print(_("再び敵の目にさらされるようになった。", "You are exposed to common sight once more."));
1724 p_ptr->special_defense &= ~(NINJA_S_STEALTH);
1728 /* Nothing to notice */
1729 if (!notice) return (FALSE);
1730 p_ptr->redraw |= (PR_STATUS);
1732 if (disturb_state) disturb(FALSE, FALSE);
1737 * @brief 一時的浮遊の継続時間をセットする / Set "p_ptr->tim_levitation", notice observable changes
1739 * @param do_dec 現在の継続時間より長い値のみ上書きする
1740 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1742 bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
1744 bool notice = FALSE;
1745 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1747 if (p_ptr->is_dead) return FALSE;
1752 if (p_ptr->tim_levitation && !do_dec)
1754 if (p_ptr->tim_levitation > v) return FALSE;
1756 else if (!p_ptr->tim_levitation)
1758 msg_print(_("体が宙に浮き始めた。", "You begin to fly!"));
1766 if (p_ptr->tim_levitation)
1768 msg_print(_("もう宙に浮かべなくなった。", "You stop flying."));
1774 p_ptr->tim_levitation = v;
1775 p_ptr->redraw |= (PR_STATUS);
1777 /* Nothing to notice */
1778 if (!notice) return (FALSE);
1780 if (disturb_state) disturb(FALSE, FALSE);
1781 p_ptr->update |= (PU_BONUS);
1787 * @brief 一時的闘気のオーラの継続時間をセットする / Set "p_ptr->tim_sh_touki", notice observable changes
1789 * @param do_dec 現在の継続時間より長い値のみ上書きする
1790 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1792 bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec)
1794 bool notice = FALSE;
1795 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1797 if (p_ptr->is_dead) return FALSE;
1802 if (p_ptr->tim_sh_touki && !do_dec)
1804 if (p_ptr->tim_sh_touki > v) return FALSE;
1806 else if (!p_ptr->tim_sh_touki)
1808 msg_print(_("体が闘気のオーラで覆われた。", "You have enveloped by the aura of the Force!"));
1816 if (p_ptr->tim_sh_touki)
1818 msg_print(_("闘気が消えた。", "Aura of the Force disappeared."));
1824 p_ptr->tim_sh_touki = v;
1825 p_ptr->redraw |= (PR_STATUS);
1827 /* Nothing to notice */
1828 if (!notice) return (FALSE);
1830 if (disturb_state) disturb(FALSE, FALSE);
1836 * @brief 一時的火炎のオーラの継続時間をセットする / Set "p_ptr->tim_sh_fire", notice observable changes
1838 * @param do_dec 現在の継続時間より長い値のみ上書きする
1839 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1841 bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec)
1843 bool notice = FALSE;
1844 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1846 if (p_ptr->is_dead) return FALSE;
1851 if (p_ptr->tim_sh_fire && !do_dec)
1853 if (p_ptr->tim_sh_fire > v) return FALSE;
1855 else if (!p_ptr->tim_sh_fire)
1857 msg_print(_("体が炎のオーラで覆われた。", "You have enveloped by fiery aura!"));
1865 if (p_ptr->tim_sh_fire)
1867 msg_print(_("炎のオーラが消えた。", "Fiery aura disappeared."));
1873 p_ptr->tim_sh_fire = v;
1874 p_ptr->redraw |= (PR_STATUS);
1876 /* Nothing to notice */
1877 if (!notice) return (FALSE);
1879 if (disturb_state) disturb(FALSE, FALSE);
1880 p_ptr->update |= (PU_BONUS);
1886 * @brief 一時的聖なるのオーラの継続時間をセットする / Set "p_ptr->tim_sh_holy", notice observable changes
1888 * @param do_dec 現在の継続時間より長い値のみ上書きする
1889 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1891 bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec)
1893 bool notice = FALSE;
1894 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1896 if (p_ptr->is_dead) return FALSE;
1901 if (p_ptr->tim_sh_holy && !do_dec)
1903 if (p_ptr->tim_sh_holy > v) return FALSE;
1905 else if (!p_ptr->tim_sh_holy)
1907 msg_print(_("体が聖なるオーラで覆われた。", "You have enveloped by holy aura!"));
1915 if (p_ptr->tim_sh_holy)
1917 msg_print(_("聖なるオーラが消えた。", "Holy aura disappeared."));
1923 p_ptr->tim_sh_holy = v;
1924 p_ptr->redraw |= (PR_STATUS);
1926 /* Nothing to notice */
1927 if (!notice) return (FALSE);
1929 if (disturb_state) disturb(FALSE, FALSE);
1930 p_ptr->update |= (PU_BONUS);
1936 * @brief 目には目をの残り時間をセットする / Set "p_ptr->tim_eyeeye", notice observable changes
1938 * @param do_dec 現在の継続時間より長い値のみ上書きする
1939 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1941 bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec)
1943 bool notice = FALSE;
1944 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1946 if (p_ptr->is_dead) return FALSE;
1951 if (p_ptr->tim_eyeeye && !do_dec)
1953 if (p_ptr->tim_eyeeye > v) return FALSE;
1955 else if (!p_ptr->tim_eyeeye)
1957 msg_print(_("法の守り手になった気がした!", "You feel like a keeper of commandments!"));
1965 if (p_ptr->tim_eyeeye)
1967 msg_print(_("懲罰を執行することができなくなった。", "You no longer feel like a keeper."));
1973 p_ptr->tim_eyeeye = v;
1974 p_ptr->redraw |= (PR_STATUS);
1976 /* Nothing to notice */
1977 if (!notice) return (FALSE);
1979 if (disturb_state) disturb(FALSE, FALSE);
1980 p_ptr->update |= (PU_BONUS);
1987 * @brief 一時的魔法防御の継続時間をセットする / Set "p_ptr->resist_magic", notice observable changes
1989 * @param do_dec 現在の継続時間より長い値のみ上書きする
1990 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1992 bool set_resist_magic(TIME_EFFECT v, bool do_dec)
1994 bool notice = FALSE;
1995 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1997 if (p_ptr->is_dead) return FALSE;
2002 if (p_ptr->resist_magic && !do_dec)
2004 if (p_ptr->resist_magic > v) return FALSE;
2006 else if (!p_ptr->resist_magic)
2008 msg_print(_("魔法への耐性がついた。", "You have been protected from magic!"));
2016 if (p_ptr->resist_magic)
2018 msg_print(_("魔法に弱くなった。", "You are no longer protected from magic."));
2024 p_ptr->resist_magic = v;
2025 p_ptr->redraw |= (PR_STATUS);
2027 /* Nothing to notice */
2028 if (!notice) return (FALSE);
2030 if (disturb_state) disturb(FALSE, FALSE);
2031 p_ptr->update |= (PU_BONUS);
2037 * @brief 一時的反射の継続時間をセットする / Set "p_ptr->tim_reflect", notice observable changes
2039 * @param do_dec 現在の継続時間より長い値のみ上書きする
2040 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2042 bool set_tim_reflect(TIME_EFFECT v, bool do_dec)
2044 bool notice = FALSE;
2045 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2047 if (p_ptr->is_dead) return FALSE;
2052 if (p_ptr->tim_reflect && !do_dec)
2054 if (p_ptr->tim_reflect > v) return FALSE;
2056 else if (!p_ptr->tim_reflect)
2058 msg_print(_("体の表面が滑かになった気がする。", "Your body becames smooth."));
2066 if (p_ptr->tim_reflect)
2068 msg_print(_("体の表面が滑かでなくなった。", "Your body is no longer smooth."));
2074 p_ptr->tim_reflect = v;
2075 p_ptr->redraw |= (PR_STATUS);
2077 /* Nothing to notice */
2078 if (!notice) return (FALSE);
2080 if (disturb_state) disturb(FALSE, FALSE);
2081 p_ptr->update |= (PU_BONUS);
2088 * Set "p_ptr->multishadow", notice observable changes
2090 bool set_multishadow(TIME_EFFECT v, bool do_dec)
2092 bool notice = FALSE;
2093 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2095 if (p_ptr->is_dead) return FALSE;
2100 if (p_ptr->multishadow && !do_dec)
2102 if (p_ptr->multishadow > v) return FALSE;
2104 else if (!p_ptr->multishadow)
2106 msg_print(_("あなたの周りに幻影が生まれた。", "Your Shadow enveloped you."));
2114 if (p_ptr->multishadow)
2116 msg_print(_("幻影が消えた。", "Your Shadow disappears."));
2122 p_ptr->multishadow = v;
2123 p_ptr->redraw |= (PR_STATUS);
2125 /* Nothing to notice */
2126 if (!notice) return (FALSE);
2128 if (disturb_state) disturb(FALSE, FALSE);
2129 p_ptr->update |= (PU_BONUS);
2135 * @brief 一時的破片のオーラの継続時間をセットする / Set "p_ptr->dustrobe", notice observable changes
2137 * @param do_dec 現在の継続時間より長い値のみ上書きする
2138 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2140 bool set_dustrobe(TIME_EFFECT v, bool do_dec)
2142 bool notice = FALSE;
2143 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2145 if (p_ptr->is_dead) return FALSE;
2150 if (p_ptr->dustrobe && !do_dec)
2152 if (p_ptr->dustrobe > v) return FALSE;
2154 else if (!p_ptr->dustrobe)
2156 msg_print(_("体が鏡のオーラで覆われた。", "You were enveloped by mirror shards."));
2164 if (p_ptr->dustrobe)
2166 msg_print(_("鏡のオーラが消えた。", "The mirror shards disappear."));
2172 p_ptr->dustrobe = v;
2173 p_ptr->redraw |= (PR_STATUS);
2175 /* Nothing to notice */
2176 if (!notice) return (FALSE);
2178 if (disturb_state) disturb(FALSE, FALSE);
2179 p_ptr->update |= (PU_BONUS);
2185 * @brief 一時的壁抜けの継続時間をセットする / Set "p_ptr->kabenuke", notice observable changes
2187 * @param do_dec 現在の継続時間より長い値のみ上書きする
2188 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2190 bool set_kabenuke(TIME_EFFECT v, bool do_dec)
2192 bool notice = FALSE;
2193 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2195 if (p_ptr->is_dead) return FALSE;
2200 if (p_ptr->kabenuke && !do_dec)
2202 if (p_ptr->kabenuke > v) return FALSE;
2204 else if (!p_ptr->kabenuke)
2206 msg_print(_("体が半物質の状態になった。", "You became ethereal form."));
2214 if (p_ptr->kabenuke)
2216 msg_print(_("体が物質化した。", "You are no longer in an ethereal form."));
2222 p_ptr->kabenuke = v;
2223 p_ptr->redraw |= (PR_STATUS);
2225 /* Nothing to notice */
2226 if (!notice) return (FALSE);
2228 if (disturb_state) disturb(FALSE, FALSE);
2229 p_ptr->update |= (PU_BONUS);
2235 * @brief オクレ兄さんの継続時間をセットする / Set "p_ptr->tsuyoshi", notice observable changes
2237 * @param do_dec 現在の継続時間より長い値のみ上書きする
2238 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2240 bool set_tsuyoshi(TIME_EFFECT v, bool do_dec)
2242 bool notice = FALSE;
2243 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2245 if (p_ptr->is_dead) return FALSE;
2250 if (p_ptr->tsuyoshi && !do_dec)
2252 if (p_ptr->tsuyoshi > v) return FALSE;
2254 else if (!p_ptr->tsuyoshi)
2256 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
2258 chg_virtue(V_VITALITY, 2);
2265 if (p_ptr->tsuyoshi)
2267 msg_print(_("肉体が急速にしぼんでいった。", "Your body had quickly shriveled."));
2269 (void)dec_stat(p_ptr, A_CON, 20, TRUE);
2270 (void)dec_stat(p_ptr, A_STR, 20, TRUE);
2273 chg_virtue(V_VITALITY, -3);
2278 p_ptr->tsuyoshi = v;
2279 p_ptr->redraw |= (PR_STATUS);
2281 /* Nothing to notice */
2282 if (!notice) return (FALSE);
2284 if (disturb_state) disturb(FALSE, FALSE);
2285 p_ptr->update |= (PU_BONUS);
2287 /* Recalculate hitpoints */
2288 p_ptr->update |= (PU_HP);
2294 * @brief 一時的元素スレイの継続時間をセットする / Set a temporary elemental brand. Clear all other brands. Print status messages. -LM-
2295 * @param attack_type スレイのタイプID
2297 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2299 bool set_ele_attack(u32b attack_type, TIME_EFFECT v)
2301 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2303 /* Clear all elemental attacks (only one is allowed at a time). */
2304 if ((p_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
2306 p_ptr->special_attack &= ~(ATTACK_ACID);
2307 msg_print(_("酸で攻撃できなくなった。", "Your temporary acidic brand fades away."));
2309 if ((p_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
2311 p_ptr->special_attack &= ~(ATTACK_ELEC);
2312 msg_print(_("電撃で攻撃できなくなった。", "Your temporary electrical brand fades away."));
2314 if ((p_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
2316 p_ptr->special_attack &= ~(ATTACK_FIRE);
2317 msg_print(_("火炎で攻撃できなくなった。", "Your temporary fiery brand fades away."));
2319 if ((p_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
2321 p_ptr->special_attack &= ~(ATTACK_COLD);
2322 msg_print(_("冷気で攻撃できなくなった。", "Your temporary frost brand fades away."));
2324 if ((p_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
2326 p_ptr->special_attack &= ~(ATTACK_POIS);
2327 msg_print(_("毒で攻撃できなくなった。", "Your temporary poison brand fades away."));
2330 if ((v) && (attack_type))
2332 /* Set attack type. */
2333 p_ptr->special_attack |= (attack_type);
2336 p_ptr->ele_attack = v;
2339 msg_format("%sで攻撃できるようになった!",
2340 ((attack_type == ATTACK_ACID) ? "酸" :
2341 ((attack_type == ATTACK_ELEC) ? "電撃" :
2342 ((attack_type == ATTACK_FIRE) ? "火炎" :
2343 ((attack_type == ATTACK_COLD) ? "冷気" :
2344 ((attack_type == ATTACK_POIS) ? "毒" :
2347 msg_format("For a while, the blows you deal will %s",
2348 ((attack_type == ATTACK_ACID) ? "melt with acid!" :
2349 ((attack_type == ATTACK_ELEC) ? "shock your foes!" :
2350 ((attack_type == ATTACK_FIRE) ? "burn with fire!" :
2351 ((attack_type == ATTACK_COLD) ? "chill to the bone!" :
2352 ((attack_type == ATTACK_POIS) ? "poison your enemies!" :
2353 "do nothing special."))))));
2357 if (disturb_state) disturb(FALSE, FALSE);
2358 p_ptr->redraw |= (PR_STATUS);
2360 p_ptr->update |= (PU_BONUS);
2367 * @brief 一時的元素免疫の継続時間をセットする / Set a temporary elemental brand. Clear all other brands. Print status messages. -LM-
2368 * @param immune_type 免疫のタイプID
2370 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2372 bool set_ele_immune(u32b immune_type, TIME_EFFECT v)
2374 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2376 /* Clear all elemental attacks (only one is allowed at a time). */
2377 if ((p_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
2379 p_ptr->special_defense &= ~(DEFENSE_ACID);
2380 msg_print(_("酸の攻撃で傷つけられるようになった。。", "You are no longer immune to acid."));
2382 if ((p_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
2384 p_ptr->special_defense &= ~(DEFENSE_ELEC);
2385 msg_print(_("電撃の攻撃で傷つけられるようになった。。", "You are no longer immune to electricity."));
2387 if ((p_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
2389 p_ptr->special_defense &= ~(DEFENSE_FIRE);
2390 msg_print(_("火炎の攻撃で傷つけられるようになった。。", "You are no longer immune to fire."));
2392 if ((p_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
2394 p_ptr->special_defense &= ~(DEFENSE_COLD);
2395 msg_print(_("冷気の攻撃で傷つけられるようになった。。", "You are no longer immune to cold."));
2397 if ((p_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
2399 p_ptr->special_defense &= ~(DEFENSE_POIS);
2400 msg_print(_("毒の攻撃で傷つけられるようになった。。", "You are no longer immune to poison."));
2403 if ((v) && (immune_type))
2405 /* Set attack type. */
2406 p_ptr->special_defense |= (immune_type);
2409 p_ptr->ele_immune = v;
2411 msg_format(_("%sの攻撃を受けつけなくなった!", "For a while, You are immune to %s"),
2412 ((immune_type == DEFENSE_ACID) ? _("酸", "acid!") :
2413 ((immune_type == DEFENSE_ELEC) ? _("電撃", "electricity!") :
2414 ((immune_type == DEFENSE_FIRE) ? _("火炎", "fire!") :
2415 ((immune_type == DEFENSE_COLD) ? _("冷気", "cold!") :
2416 ((immune_type == DEFENSE_POIS) ? _("毒", "poison!") :
2417 _("(なし)", "do nothing special.")))))));
2420 if (disturb_state) disturb(FALSE, FALSE);
2421 p_ptr->redraw |= (PR_STATUS);
2422 p_ptr->update |= (PU_BONUS);
2429 * @brief 一時的酸耐性の継続時間をセットする / Set "p_ptr->oppose_acid", notice observable changes
2431 * @param do_dec 現在の継続時間より長い値のみ上書きする
2432 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2434 bool set_oppose_acid(TIME_EFFECT v, bool do_dec)
2436 bool notice = FALSE;
2437 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2439 if (p_ptr->is_dead) return FALSE;
2444 if (p_ptr->oppose_acid && !do_dec)
2446 if (p_ptr->oppose_acid > v) return FALSE;
2448 else if (!IS_OPPOSE_ACID())
2450 msg_print(_("酸への耐性がついた気がする!", "You feel resistant to acid!"));
2458 if (p_ptr->oppose_acid && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2460 msg_print(_("酸への耐性が薄れた気がする。", "You feel less resistant to acid."));
2466 p_ptr->oppose_acid = v;
2468 /* Nothing to notice */
2469 if (!notice) return (FALSE);
2470 p_ptr->redraw |= (PR_STATUS);
2472 if (disturb_state) disturb(FALSE, FALSE);
2478 * @brief 一時的電撃耐性の継続時間をセットする / Set "p_ptr->oppose_elec", notice observable changes
2480 * @param do_dec 現在の継続時間より長い値のみ上書きする
2481 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2483 bool set_oppose_elec(TIME_EFFECT v, bool do_dec)
2485 bool notice = FALSE;
2486 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2488 if (p_ptr->is_dead) return FALSE;
2493 if (p_ptr->oppose_elec && !do_dec)
2495 if (p_ptr->oppose_elec > v) return FALSE;
2497 else if (!IS_OPPOSE_ELEC())
2499 msg_print(_("電撃への耐性がついた気がする!", "You feel resistant to electricity!"));
2507 if (p_ptr->oppose_elec && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2509 msg_print(_("電撃への耐性が薄れた気がする。", "You feel less resistant to electricity."));
2515 p_ptr->oppose_elec = v;
2517 /* Nothing to notice */
2518 if (!notice) return (FALSE);
2519 p_ptr->redraw |= (PR_STATUS);
2521 if (disturb_state) disturb(FALSE, FALSE);
2527 * @brief 一時的火炎耐性の継続時間をセットする / Set "p_ptr->oppose_fire", notice observable changes
2529 * @param do_dec 現在の継続時間より長い値のみ上書きする
2530 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2532 bool set_oppose_fire(TIME_EFFECT v, bool do_dec)
2534 bool notice = FALSE;
2535 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2537 if (p_ptr->is_dead) return FALSE;
2539 if ((PRACE_IS_(p_ptr, RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
2543 if (p_ptr->oppose_fire && !do_dec)
2545 if (p_ptr->oppose_fire > v) return FALSE;
2547 else if (!IS_OPPOSE_FIRE())
2549 msg_print(_("火への耐性がついた気がする!", "You feel resistant to fire!"));
2557 if (p_ptr->oppose_fire && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2559 msg_print(_("火への耐性が薄れた気がする。", "You feel less resistant to fire."));
2565 p_ptr->oppose_fire = v;
2567 /* Nothing to notice */
2568 if (!notice) return (FALSE);
2569 p_ptr->redraw |= (PR_STATUS);
2571 if (disturb_state) disturb(FALSE, FALSE);
2577 * @brief 一時的冷気耐性の継続時間をセットする / Set "p_ptr->oppose_cold", notice observable changes
2579 * @param do_dec 現在の継続時間より長い値のみ上書きする
2580 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2582 bool set_oppose_cold(TIME_EFFECT v, bool do_dec)
2584 bool notice = FALSE;
2585 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2587 if (p_ptr->is_dead) return FALSE;
2592 if (p_ptr->oppose_cold && !do_dec)
2594 if (p_ptr->oppose_cold > v) return FALSE;
2596 else if (!IS_OPPOSE_COLD())
2598 msg_print(_("冷気への耐性がついた気がする!", "You feel resistant to cold!"));
2606 if (p_ptr->oppose_cold && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2608 msg_print(_("冷気への耐性が薄れた気がする。", "You feel less resistant to cold."));
2614 p_ptr->oppose_cold = v;
2616 /* Nothing to notice */
2617 if (!notice) return (FALSE);
2618 p_ptr->redraw |= (PR_STATUS);
2620 if (disturb_state) disturb(FALSE, FALSE);
2626 * @brief 一時的毒耐性の継続時間をセットする / Set "p_ptr->oppose_pois", notice observable changes
2628 * @param do_dec 現在の継続時間より長い値のみ上書きする
2629 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2631 bool set_oppose_pois(TIME_EFFECT v, bool do_dec)
2633 bool notice = FALSE;
2634 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2636 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) v = 1;
2637 if (p_ptr->is_dead) return FALSE;
2642 if (p_ptr->oppose_pois && !do_dec)
2644 if (p_ptr->oppose_pois > v) return FALSE;
2646 else if (!IS_OPPOSE_POIS())
2648 msg_print(_("毒への耐性がついた気がする!", "You feel resistant to poison!"));
2656 if (p_ptr->oppose_pois && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2658 msg_print(_("毒への耐性が薄れた気がする。", "You feel less resistant to poison."));
2664 p_ptr->oppose_pois = v;
2666 /* Nothing to notice */
2667 if (!notice) return (FALSE);
2668 p_ptr->redraw |= (PR_STATUS);
2670 if (disturb_state) disturb(FALSE, FALSE);
2676 * @brief 朦朧の継続時間をセットする / Set "p_ptr->stun", notice observable changes
2678 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2680 * Note the special code to only notice "range" changes.
2682 bool set_stun(TIME_EFFECT v)
2684 int old_aux, new_aux;
2685 bool notice = FALSE;
2686 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2688 if (p_ptr->is_dead) return FALSE;
2689 if (PRACE_IS_(p_ptr, RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
2692 if (p_ptr->stun > 100)
2698 else if (p_ptr->stun > 50)
2704 else if (p_ptr->stun > 0)
2740 if (new_aux > old_aux)
2742 /* Describe the state */
2746 case 1: msg_print(_("意識がもうろうとしてきた。", "You have been stunned.")); break;
2749 case 2: msg_print(_("意識がひどくもうろうとしてきた。", "You have been heavily stunned.")); break;
2752 case 3: msg_print(_("頭がクラクラして意識が遠のいてきた。", "You have been knocked out.")); break;
2755 if (randint1(1000) < v || one_in_(16))
2757 msg_print(_("割れるような頭痛がする。", "A vicious blow hits your head."));
2761 if (!p_ptr->sustain_int) (void)do_dec_stat(p_ptr, A_INT);
2762 if (!p_ptr->sustain_wis) (void)do_dec_stat(p_ptr, A_WIS);
2764 else if (one_in_(2))
2766 if (!p_ptr->sustain_int) (void)do_dec_stat(p_ptr, A_INT);
2770 if (!p_ptr->sustain_wis) (void)do_dec_stat(p_ptr, A_WIS);
2773 if (p_ptr->special_defense & KATA_MASK)
2775 msg_print(_("型が崩れた。", "Your posture gets loose."));
2776 p_ptr->special_defense &= ~(KATA_MASK);
2777 p_ptr->update |= (PU_BONUS);
2778 p_ptr->update |= (PU_MONSTERS);
2779 p_ptr->redraw |= (PR_STATE);
2780 p_ptr->redraw |= (PR_STATUS);
2781 p_ptr->action = ACTION_NONE;
2785 if (p_ptr->concent) reset_concentration(TRUE);
2788 if (hex_spelling_any()) stop_hex_spell_all();
2794 else if (new_aux < old_aux)
2796 /* Describe the state */
2801 msg_print(_("やっと朦朧状態から回復した。", "You are no longer stunned."));
2803 if (disturb_state) disturb(FALSE, FALSE);
2814 if (!notice) return (FALSE);
2816 if (disturb_state) disturb(FALSE, FALSE);
2817 p_ptr->update |= (PU_BONUS);
2819 /* Redraw the "stun" */
2820 p_ptr->redraw |= (PR_STUN);
2827 * @brief 出血の継続時間をセットする / Set "p_ptr->cut", notice observable changes
2829 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2831 * Note the special code to only notice "range" changes.
2833 bool set_cut(TIME_EFFECT v)
2835 int old_aux, new_aux;
2836 bool notice = FALSE;
2837 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2839 if (p_ptr->is_dead) return FALSE;
2841 if ((p_ptr->prace == RACE_GOLEM ||
2842 p_ptr->prace == RACE_SKELETON ||
2843 p_ptr->prace == RACE_SPECTRE ||
2844 (p_ptr->prace == RACE_ZOMBIE && p_ptr->lev > 11)) &&
2849 if (p_ptr->cut > 1000)
2855 else if (p_ptr->cut > 200)
2861 else if (p_ptr->cut > 100)
2867 else if (p_ptr->cut > 50)
2873 else if (p_ptr->cut > 25)
2879 else if (p_ptr->cut > 10)
2885 else if (p_ptr->cut > 0)
2945 if (new_aux > old_aux)
2947 /* Describe the state */
2951 case 1: msg_print(_("かすり傷を負ってしまった。", "You have been given a graze.")); break;
2954 case 2: msg_print(_("軽い傷を負ってしまった。", "You have been given a light cut.")); break;
2957 case 3: msg_print(_("ひどい傷を負ってしまった。", "You have been given a bad cut.")); break;
2960 case 4: msg_print(_("大変な傷を負ってしまった。", "You have been given a nasty cut.")); break;
2963 case 5: msg_print(_("重大な傷を負ってしまった。", "You have been given a severe cut.")); break;
2966 case 6: msg_print(_("ひどい深手を負ってしまった。", "You have been given a deep gash.")); break;
2969 case 7: msg_print(_("致命的な傷を負ってしまった。", "You have been given a mortal wound.")); break;
2974 if (randint1(1000) < v || one_in_(16))
2976 if (!p_ptr->sustain_chr)
2978 msg_print(_("ひどい傷跡が残ってしまった。", "You have been horribly scarred."));
2979 do_dec_stat(p_ptr, A_CHR);
2985 else if (new_aux < old_aux)
2987 /* Describe the state */
2992 msg_format(_("やっと%s。", "You are no longer bleeding."), p_ptr->prace == RACE_ANDROID ? "怪我が直った" : "出血が止まった");
2994 if (disturb_state) disturb(FALSE, FALSE);
3005 if (!notice) return (FALSE);
3007 if (disturb_state) disturb(FALSE, FALSE);
3008 p_ptr->update |= (PU_BONUS);
3010 /* Redraw the "cut" */
3011 p_ptr->redraw |= (PR_CUT);
3017 * @brief 空腹状態をセットする / Set "p_ptr->food", notice observable changes
3019 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
3021 * Set "", notice observable changes\n
3023 * The "p_ptr->food" variable can get as large as 20000, allowing the
3024 * addition of the most "filling" item, Elvish Waybread, which adds
3025 * 7500 food units, without overflowing the 32767 maximum limit.\n
3027 * Perhaps we should disturb the player with various messages,
3028 * especially messages about hunger status changes. \n
3030 * Digestion of food is handled in "dungeon.c", in which, normally,
3031 * the player digests about 20 food units per 100 game turns, more
3032 * when "fast", more when "regenerating", less with "slow digestion",
3033 * but when the player is "gorged", he digests 100 food units per 10
3034 * game turns, or a full 1000 food units per 100 game turns.\n
3036 * Note that the player's speed is reduced by 10 units while gorged,
3037 * so if the player eats a single food ration (5000 food units) when
3038 * full (15000 food units), he will be gorged for (5000/100)*10 = 500
3039 * game turns, or 500/(100/5) = 25 player turns (if nothing else is
3040 * affecting the player speed).\n
3042 bool set_food(TIME_EFFECT v)
3044 int old_aux, new_aux;
3046 bool notice = FALSE;
3047 v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
3049 /* Fainting / Starving */
3050 if (p_ptr->food < PY_FOOD_FAINT)
3056 else if (p_ptr->food < PY_FOOD_WEAK)
3062 else if (p_ptr->food < PY_FOOD_ALERT)
3068 else if (p_ptr->food < PY_FOOD_FULL)
3074 else if (p_ptr->food < PY_FOOD_MAX)
3085 /* Fainting / Starving */
3086 if (v < PY_FOOD_FAINT)
3092 else if (v < PY_FOOD_WEAK)
3098 else if (v < PY_FOOD_ALERT)
3104 else if (v < PY_FOOD_FULL)
3110 else if (v < PY_FOOD_MAX)
3121 if (old_aux < 1 && new_aux > 0)
3122 chg_virtue(V_PATIENCE, 2);
3123 else if (old_aux < 3 && (old_aux != new_aux))
3124 chg_virtue(V_PATIENCE, 1);
3126 chg_virtue(V_TEMPERANCE, 1);
3128 chg_virtue(V_TEMPERANCE, -1);
3131 if (new_aux > old_aux)
3133 /* Describe the state */
3137 case 1: msg_print(_("まだ空腹で倒れそうだ。", "You are still weak.")); break;
3140 case 2: msg_print(_("まだ空腹だ。", "You are still hungry.")); break;
3143 case 3: msg_print(_("空腹感がおさまった。", "You are no longer hungry.")); break;
3146 case 4: msg_print(_("満腹だ!", "You are full!")); break;
3150 msg_print(_("食べ過ぎだ!", "You have gorged yourself!"));
3151 chg_virtue(V_HARMONY, -1);
3152 chg_virtue(V_PATIENCE, -1);
3153 chg_virtue(V_TEMPERANCE, -2);
3163 else if (new_aux < old_aux)
3165 /* Describe the state */
3168 /* Fainting / Starving */
3169 case 0: msg_print(_("あまりにも空腹で気を失ってしまった!", "You are getting faint from hunger!")); break;
3172 case 1: msg_print(_("お腹が空いて倒れそうだ。", "You are getting weak from hunger!")); break;
3175 case 2: msg_print(_("お腹が空いてきた。", "You are getting hungry.")); break;
3178 case 3: msg_print(_("満腹感がなくなった。", "You are no longer full.")); break;
3181 case 4: msg_print(_("やっとお腹がきつくなくなった。", "You are no longer gorged.")); break;
3184 if (p_ptr->wild_mode && (new_aux < 2))
3186 change_wild_mode(FALSE);
3196 /* Nothing to notice */
3197 if (!notice) return (FALSE);
3199 if (disturb_state) disturb(FALSE, FALSE);
3200 p_ptr->update |= (PU_BONUS);
3203 p_ptr->redraw |= (PR_HUNGER);
3209 * @brief プレイヤーの基本能力値を増加させる / Increases a stat by one randomized level -RAK-
3210 * @param stat 上昇させるステータスID
3211 * @return 実際に上昇した場合TRUEを返す。
3213 * Note that this function (used by stat potions) now restores\n
3214 * the stat BEFORE increasing it.\n
3216 bool inc_stat(player_type *creature_ptr, int stat)
3218 BASE_STATUS value, gain;
3220 /* Then augment the current/max stat */
3221 value = creature_ptr->stat_cur[stat];
3223 /* Cannot go above 18/100 */
3224 if (value < creature_ptr->stat_max_max[stat])
3226 /* Gain one (sometimes two) points */
3229 gain = ((randint0(100) < 75) ? 1 : 2);
3233 /* Gain 1/6 to 1/3 of distance to 18/100 */
3234 else if (value < (creature_ptr->stat_max_max[stat]-2))
3236 /* Approximate gain value */
3237 gain = (((creature_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
3238 if (gain < 1) gain = 1;
3240 /* Apply the bonus */
3241 value += randint1(gain) + gain / 2;
3244 if (value > (creature_ptr->stat_max_max[stat]-1)) value = creature_ptr->stat_max_max[stat]-1;
3247 /* Gain one point at a time */
3253 /* Save the new value */
3254 creature_ptr->stat_cur[stat] = value;
3256 /* Bring up the maximum too */
3257 if (value > creature_ptr->stat_max[stat])
3259 creature_ptr->stat_max[stat] = value;
3261 creature_ptr->update |= (PU_BONUS);
3267 /* Nothing to gain */
3272 * @brief プレイヤーの基本能力値を減少させる / Decreases a stat by an amount indended to vary from 0 to 100 percent.
3273 * @param stat 減少させるステータスID
3274 * @param amount 減少させる基本量
3275 * @param permanent TRUEならば現在の最大値を減少させる
3276 * @return 実際に減少した場合TRUEを返す。
3279 * Amount could be a little higher in extreme cases to mangle very high\n
3280 * stats from massive assaults. -CWS\n
3282 * Note that "permanent" means that the *given* amount is permanent,\n
3283 * not that the new value becomes permanent. This may not work exactly\n
3284 * as expected, due to "weirdness" in the algorithm, but in general,\n
3285 * if your stat is already drained, the "max" value will not drop all\n
3286 * the way down to the "cur" value.\n
3288 bool dec_stat(player_type *creature_ptr, int stat, int amount, int permanent)
3290 BASE_STATUS cur, max;
3294 /* Acquire current value */
3295 cur = creature_ptr->stat_cur[stat];
3296 max = creature_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 != creature_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 != creature_ptr->stat_max[stat]) res = TRUE;
3384 /* Actually set the stat to its new value. */
3385 creature_ptr->stat_cur[stat] = cur;
3386 creature_ptr->stat_max[stat] = max;
3388 creature_ptr->redraw |= (PR_STATS);
3389 creature_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(player_type *creature_ptr, int stat)
3403 /* Restore if needed */
3404 if (creature_ptr->stat_cur[stat] != creature_ptr->stat_max[stat])
3406 creature_ptr->stat_cur[stat] = creature_ptr->stat_max[stat];
3407 creature_ptr->update |= (PU_BONUS);
3408 creature_ptr->redraw |= (PR_STATS);
3414 /* Nothing to restore */
3420 * Increase players hit points, notice effects
3422 bool hp_player(player_type *creature_ptr, int num)
3425 vir = virtue_number(V_VITALITY);
3427 if(num <= 0) return (FALSE);
3431 num = num * (creature_ptr->virtues[vir - 1] + 1250) / 1250;
3433 /* Healing needed */
3434 if (creature_ptr->chp < creature_ptr->mhp)
3436 if ((num > 0) && (creature_ptr->chp < (creature_ptr->mhp/3)))
3437 chg_virtue(V_TEMPERANCE, 1);
3438 /* Gain hitpoints */
3439 creature_ptr->chp += num;
3441 /* Enforce maximum */
3442 if (creature_ptr->chp >= creature_ptr->mhp)
3444 creature_ptr->chp = creature_ptr->mhp;
3445 creature_ptr->chp_frac = 0;
3448 creature_ptr->redraw |= (PR_HP);
3450 creature_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(player_type *creature_ptr, int stat)
3519 /* Access the "sustain" */
3522 case A_STR: if (creature_ptr->sustain_str) sust = TRUE; break;
3523 case A_INT: if (creature_ptr->sustain_int) sust = TRUE; break;
3524 case A_WIS: if (creature_ptr->sustain_wis) sust = TRUE; break;
3525 case A_DEX: if (creature_ptr->sustain_dex) sust = TRUE; break;
3526 case A_CON: if (creature_ptr->sustain_con) sust = TRUE; break;
3527 case A_CHR: if (creature_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(p_ptr, 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(player_type *creature_ptr, int stat)
3559 /* Attempt to increase */
3560 if (res_stat(creature_ptr, stat))
3562 msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]);
3566 /* Nothing obvious */
3572 * Gain a "point" in a stat
3574 bool do_inc_stat(int stat)
3578 /* Restore strength */
3579 res = res_stat(p_ptr, stat);
3581 /* Attempt to increase */
3582 if (inc_stat(p_ptr, stat))
3586 chg_virtue(V_ENLIGHTEN, 1);
3587 chg_virtue(V_FAITH, 1);
3589 else if (stat == A_INT)
3591 chg_virtue(V_KNOWLEDGE, 1);
3592 chg_virtue(V_ENLIGHTEN, 1);
3594 else if (stat == A_CON)
3595 chg_virtue(V_VITALITY, 1);
3597 msg_format(_("ワーオ!とても%sなった!", "Wow! You feel very %s!"), desc_stat_pos[stat]);
3602 /* Restoration worked */
3605 msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]);
3610 /* Nothing obvious */
3616 * Restores any drained experience
3618 bool restore_level(void)
3620 /* Restore experience */
3621 if (p_ptr->exp < p_ptr->max_exp)
3623 msg_print(_("経験値が戻ってきた気がする。", "You feel your experience returning."));
3625 /* Restore the experience */
3626 p_ptr->exp = p_ptr->max_exp;
3628 /* Check the experience */
3642 bool lose_all_info(void)
3646 chg_virtue(V_KNOWLEDGE, -5);
3647 chg_virtue(V_ENLIGHTEN, -5);
3649 /* Forget info about objects */
3650 for (i = 0; i < INVEN_TOTAL; i++)
3652 object_type *o_ptr = &p_ptr->inventory_list[i];
3653 if (!o_ptr->k_idx) continue;
3655 /* Allow "protection" by the MENTAL flag */
3656 if (o_ptr->ident & (IDENT_MENTAL)) continue;
3658 /* Remove "default inscriptions" */
3659 o_ptr->feeling = FEEL_NONE;
3661 /* Hack -- Clear the "empty" flag */
3662 o_ptr->ident &= ~(IDENT_EMPTY);
3664 /* Hack -- Clear the "known" flag */
3665 o_ptr->ident &= ~(IDENT_KNOWN);
3667 /* Hack -- Clear the "felt" flag */
3668 o_ptr->ident &= ~(IDENT_SENSE);
3670 p_ptr->update |= (PU_BONUS);
3671 p_ptr->update |= (PU_COMBINE | PU_REORDER);
3673 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3675 /* Mega-Hack -- Forget the map */
3683 void do_poly_wounds(void)
3685 /* Changed to always provide at least _some_ healing */
3686 s16b wounds = p_ptr->cut;
3687 s16b hit_p = (p_ptr->mhp - p_ptr->chp);
3688 s16b change = damroll(p_ptr->lev, 5);
3689 bool Nasty_effect = one_in_(5);
3691 if (!(wounds || hit_p || Nasty_effect)) return;
3693 msg_print(_("傷がより軽いものに変化した。", "Your wounds are polymorphed into less serious ones."));
3694 hp_player(p_ptr, change);
3697 msg_print(_("新たな傷ができた!", "A new wound was created!"));
3698 take_hit(DAMAGE_LOSELIFE, change / 2, _("変化した傷", "a polymorphed wound"), -1);
3703 set_cut(p_ptr->cut - (change / 2));
3709 * Change player race
3711 void change_race(CHARACTER_IDX new_race, concptr effect_msg)
3713 concptr title = race_info[new_race].title;
3714 int old_race = p_ptr->prace;
3717 msg_format("あなたは%s%sに変化した!", effect_msg, title);
3719 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);
3722 chg_virtue(V_CHANCE, 2);
3724 if (p_ptr->prace < 32)
3726 p_ptr->old_race1 |= 1L << p_ptr->prace;
3730 p_ptr->old_race2 |= 1L << (p_ptr->prace - 32);
3732 p_ptr->prace = new_race;
3733 rp_ptr = &race_info[p_ptr->prace];
3735 /* Experience factor */
3736 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
3739 * The speed bonus of Klackons and Sprites are disabled
3740 * and the experience penalty is decreased.
3742 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)))
3743 p_ptr->expfact -= 15;
3745 /* Get character's height and weight */
3746 get_height_weight();
3749 if (p_ptr->pclass == CLASS_SORCERER)
3750 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
3752 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
3754 roll_hitdice(p_ptr, 0L);
3756 /* The experience level may be modified */
3759 p_ptr->redraw |= (PR_BASIC);
3761 p_ptr->update |= (PU_BONUS);
3765 /* Load an autopick preference file */
3766 if (old_race != p_ptr->prace) autopick_load_pref(FALSE);
3768 /* Player's graphic tile may change */
3769 lite_spot(p_ptr->y, p_ptr->x);
3773 void do_poly_self(void)
3775 int power = p_ptr->lev;
3777 msg_print(_("あなたは変化の訪れを感じた...", "You feel a change coming over you..."));
3778 chg_virtue(V_CHANCE, 1);
3780 if ((power > randint0(20)) && one_in_(3) && (p_ptr->prace != RACE_ANDROID))
3782 char effect_msg[80] = "";
3783 CHARACTER_IDX new_race;
3785 /* Some form of racial polymorph... */
3788 if ((power > randint0(5)) && one_in_(4))
3793 if (p_ptr->psex == SEX_MALE)
3795 p_ptr->psex = SEX_FEMALE;
3796 sp_ptr = &sex_info[p_ptr->psex];
3797 sprintf(effect_msg, _("女性の", "female "));
3801 p_ptr->psex = SEX_MALE;
3802 sp_ptr = &sex_info[p_ptr->psex];
3803 sprintf(effect_msg, _("男性の", "male "));
3807 if ((power > randint0(30)) && one_in_(5))
3811 /* Harmful deformity */
3818 (void)dec_stat(p_ptr, tmp, randint1(6) + 6, one_in_(3));
3824 /* Deformities are discriminated against! */
3825 (void)dec_stat(p_ptr, A_CHR, randint1(6), TRUE);
3830 sprintf(tmp_msg,_("%s", "%s "),effect_msg);
3831 sprintf(effect_msg,_("奇形の%s", "deformed %s "),tmp_msg);
3835 sprintf(effect_msg,_("奇形の", "deformed "));
3839 while ((power > randint0(20)) && one_in_(10))
3841 /* Polymorph into a less mutated form */
3844 if (!lose_mutation(0))
3845 msg_print(_("奇妙なくらい普通になった気がする。", "You feel oddly normal."));
3850 new_race = (CHARACTER_IDX)randint0(MAX_RACES);
3852 while ((new_race == p_ptr->prace) || (new_race == RACE_ANDROID));
3854 change_race(new_race, effect_msg);
3857 if ((power > randint0(30)) && one_in_(6))
3863 msg_format(_("%sの構成が変化した!", "Your internal organs are rearranged!"), p_ptr->prace == RACE_ANDROID ? "機械" : "内臓");
3867 (void)dec_stat(p_ptr, tmp, randint1(6) + 6, one_in_(3));
3872 msg_print(_("現在の姿で生きていくのは困難なようだ!", "You find living difficult in your present form!"));
3873 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), _("致命的な突然変異", "a lethal mutation"), -1);
3879 if ((power > randint0(20)) && one_in_(4))
3884 roll_hitdice(p_ptr, 0L);
3887 while ((power > randint0(15)) && one_in_(3))
3890 (void)gain_mutation(p_ptr, 0);
3893 if (power > randint0(5))
3899 /* Note: earlier deductions may have left power < 0 already. */
3910 void gain_exp_64(s32b amount, u32b amount_frac)
3912 if (p_ptr->is_dead) return;
3914 if (p_ptr->prace == RACE_ANDROID) return;
3916 /* Gain some experience */
3917 s64b_add(&(p_ptr->exp), &(p_ptr->exp_frac), amount, amount_frac);
3919 /* Slowly recover from experience drainage */
3920 if (p_ptr->exp < p_ptr->max_exp)
3922 /* Gain max experience (20%) (was 10%) */
3923 p_ptr->max_exp += amount / 5;
3926 /* Check Experience */
3934 void gain_exp(s32b amount)
3936 gain_exp_64(amount, 0L);
3940 void calc_android_exp(void)
3944 if (p_ptr->is_dead) return;
3946 if (p_ptr->prace != RACE_ANDROID) return;
3948 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
3950 object_type *o_ptr = &p_ptr->inventory_list[i];
3952 object_type *q_ptr = &forge;
3954 DEPTH level = MAX(k_info[o_ptr->k_idx].level - 8, 1);
3956 if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue;
3957 if (!o_ptr->k_idx) continue;
3960 object_copy(q_ptr, o_ptr);
3961 q_ptr->discount = 0;
3962 q_ptr->curse_flags = 0L;
3964 if (object_is_fixed_artifact(o_ptr))
3966 level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
3967 level += MIN(20, a_info[o_ptr->name1].rarity/(a_info[o_ptr->name1].gen_flags & TRG_INSTA_ART ? 10 : 3));
3969 else if (object_is_ego(o_ptr))
3971 level += MAX(3, (e_info[o_ptr->name2].rating - 5)/2);
3973 else if (o_ptr->art_name)
3975 s32b total_flags = flag_cost(o_ptr, o_ptr->pval);
3978 if (!object_is_weapon_ammo(o_ptr))
3981 if (total_flags < 15000) fake_level = 10;
3982 else if (total_flags < 35000) fake_level = 25;
3983 else fake_level = 40;
3988 if (total_flags < 20000) fake_level = 10;
3989 else if (total_flags < 45000) fake_level = 25;
3990 else fake_level = 40;
3993 level = MAX(level, (level + MAX(fake_level - 8, 5)) / 2 + 3);
3996 value = object_value_real(q_ptr);
3998 if (value <= 0) continue;
3999 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (p_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
4000 if (value > 5000000L) value = 5000000L;
4001 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
4003 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr) ||
4004 (o_ptr->tval == TV_DRAG_ARMOR) ||
4005 ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) ||
4006 ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) ||
4007 ((o_ptr->tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)) ||
4008 ((o_ptr->tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) ||
4009 ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE)))
4011 if (level > 65) level = 35 + (level - 65) / 5;
4012 else if (level > 35) level = 25 + (level - 35) / 3;
4013 else if (level > 15) level = 15 + (level - 15) / 2;
4014 exp = MIN(100000L, value) / 2 * level * level;
4015 if (value > 100000L)
4016 exp += (value - 100000L) / 8 * level * level;
4020 exp = MIN(100000L, value) * level;
4021 if (value > 100000L)
4022 exp += (value - 100000L) / 4 * level;
4024 if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
4025 else total_exp += exp / 16;
4026 if (i == INVEN_BODY) total_exp += exp / 32;
4028 p_ptr->exp = p_ptr->max_exp = total_exp;
4030 /* Check Experience */
4038 void lose_exp(s32b amount)
4040 if (p_ptr->prace == RACE_ANDROID) return;
4042 /* Never drop below zero experience */
4043 if (amount > p_ptr->exp) amount = p_ptr->exp;
4045 /* Lose some experience */
4046 p_ptr->exp -= amount;
4048 /* Check Experience */
4055 * If resisted to draining, return FALSE
4057 bool drain_exp(s32b drain, s32b slip, int hold_exp_prob)
4059 /* Androids and their mimics are never drained */
4060 if (p_ptr->prace == RACE_ANDROID) return FALSE;
4062 if (p_ptr->hold_exp && (randint0(100) < hold_exp_prob))
4064 /* Hold experience */
4065 msg_print(_("しかし自己の経験値を守りきった!", "You keep hold of your experience!"));
4069 /* Hold experience failed */
4070 if (p_ptr->hold_exp)
4072 msg_print(_("経験値を少し吸い取られた気がする!", "You feel your experience slipping away!"));
4077 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away!"));
4085 bool set_ultimate_res(TIME_EFFECT v, bool do_dec)
4087 bool notice = FALSE;
4088 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
4090 if (p_ptr->is_dead) return FALSE;
4095 if (p_ptr->ult_res && !do_dec)
4097 if (p_ptr->ult_res > v) return FALSE;
4099 else if (!p_ptr->ult_res)
4101 msg_print(_("あらゆることに対して耐性がついた気がする!", "You feel resistant!"));
4111 msg_print(_("あらゆることに対する耐性が薄れた気がする。", "You feel less resistant"));
4118 p_ptr->redraw |= (PR_STATUS);
4120 /* Nothing to notice */
4121 if (!notice) return (FALSE);
4123 if (disturb_state) disturb(FALSE, FALSE);
4124 p_ptr->update |= (PU_BONUS);
4129 bool set_tim_res_nether(TIME_EFFECT v, bool do_dec)
4131 bool notice = FALSE;
4132 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
4134 if (p_ptr->is_dead) return FALSE;
4139 if (p_ptr->tim_res_nether && !do_dec)
4141 if (p_ptr->tim_res_nether > v) return FALSE;
4143 else if (!p_ptr->tim_res_nether)
4145 msg_print(_("地獄の力に対して耐性がついた気がする!", "You feel nether resistant!"));
4153 if (p_ptr->tim_res_nether)
4155 msg_print(_("地獄の力に対する耐性が薄れた気がする。", "You feel less nether resistant"));
4161 p_ptr->tim_res_nether = v;
4162 p_ptr->redraw |= (PR_STATUS);
4164 /* Nothing to notice */
4165 if (!notice) return (FALSE);
4167 if (disturb_state) disturb(FALSE, FALSE);
4168 p_ptr->update |= (PU_BONUS);
4173 bool set_tim_res_time(TIME_EFFECT v, bool do_dec)
4175 bool notice = FALSE;
4176 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
4178 if (p_ptr->is_dead) return FALSE;
4183 if (p_ptr->tim_res_time && !do_dec)
4185 if (p_ptr->tim_res_time > v) return FALSE;
4187 else if (!p_ptr->tim_res_time)
4189 msg_print(_("時間逆転の力に対して耐性がついた気がする!", "You feel time resistant!"));
4197 if (p_ptr->tim_res_time)
4199 msg_print(_("時間逆転の力に対する耐性が薄れた気がする。", "You feel less time resistant"));
4205 p_ptr->tim_res_time = v;
4206 p_ptr->redraw |= (PR_STATUS);
4208 /* Nothing to notice */
4209 if (!notice) return (FALSE);
4211 if (disturb_state) disturb(FALSE, FALSE);
4212 p_ptr->update |= (PU_BONUS);
4219 * Choose a warrior-mage elemental attack. -LM-
4221 bool choose_ele_attack(void)
4227 if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
4229 msg_format(_("武器を持たないと魔法剣は使えない。", "You cannot use temporary branding with no weapon."));
4234 num = (p_ptr->lev - 20) / 5;
4235 c_prt(TERM_RED, _(" a) 焼棄", " a) Fire Brand"), 2, 14);
4238 c_prt(TERM_L_WHITE,_(" b) 凍結", " b) Cold Brand"), 3, 14);
4243 c_prt(TERM_GREEN, _(" c) 毒殺", " c) Poison Brand"), 4, 14);
4248 c_prt(TERM_L_DARK, _(" d) 溶解", " d) Acid Brand"), 5, 14);
4253 c_prt(TERM_BLUE, _(" e) 電撃", " e) Elec Brand"), 6, 14);
4262 prt(_(" どの元素攻撃をしますか?", " Choose a temporary elemental brand "), 1, 14);
4266 if ((choice == 'a') || (choice == 'A'))
4267 set_ele_attack(ATTACK_FIRE, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4268 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
4269 set_ele_attack(ATTACK_COLD, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4270 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
4271 set_ele_attack(ATTACK_POIS, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4272 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
4273 set_ele_attack(ATTACK_ACID, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4274 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
4275 set_ele_attack(ATTACK_ELEC, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4278 msg_print(_("魔法剣を使うのをやめた。", "You cancel the temporary branding."));
4288 * Choose a elemental immune. -LM-
4290 bool choose_ele_immune(TIME_EFFECT immune_turn)
4295 c_prt(TERM_RED, _(" a) 火炎", " a) Immune Fire"), 2, 14);
4296 c_prt(TERM_L_WHITE,_(" b) 冷気", " b) Immune Cold"), 3, 14);
4297 c_prt(TERM_L_DARK, _(" c) 酸", " c) Immune Acid"), 4, 14);
4298 c_prt(TERM_BLUE, _(" d) 電撃", " d) Immune Elec"), 5, 14);
4306 prt(_(" どの元素の免疫をつけますか?", " Choose a temporary elemental immune "), 1, 14);
4310 if ((choice == 'a') || (choice == 'A'))
4311 set_ele_immune(DEFENSE_FIRE, immune_turn);
4312 else if ((choice == 'b') || (choice == 'B'))
4313 set_ele_immune(DEFENSE_COLD, immune_turn);
4314 else if ((choice == 'c') || (choice == 'C'))
4315 set_ele_immune(DEFENSE_ACID, immune_turn);
4316 else if ((choice == 'd') || (choice == 'D'))
4317 set_ele_immune(DEFENSE_ELEC, immune_turn);
4320 msg_print(_("免疫を付けるのをやめた。", "You cancel the temporary immune."));