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(player_type *creature_ptr, ACTION_IDX typ)
104 int prev_typ = creature_ptr->action;
116 msg_print(_("探索をやめた。", "You no longer walk carefully."));
117 creature_ptr->redraw |= (PR_SPEED);
122 creature_ptr->resting = 0;
127 msg_print(_("学習をやめた。", "You stop learning."));
128 creature_ptr->new_mane = FALSE;
133 msg_print(_("構えをといた。", "You stop assuming the posture."));
134 creature_ptr->special_defense &= ~(KAMAE_MASK);
139 msg_print(_("型を崩した。", "You stop assuming the posture."));
140 creature_ptr->special_defense &= ~(KATA_MASK);
141 creature_ptr->update |= (PU_MONSTERS);
142 creature_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(creature_ptr, 100);
158 msg_print(_("呪文の詠唱を中断した。", "You stopped spelling all spells."));
164 creature_ptr->action = typ;
166 /* If we are requested other action, stop singing */
167 if (prev_typ == ACTION_SING) stop_singing(creature_ptr);
168 if (prev_typ == ACTION_SPELL) stop_hex_spell(creature_ptr);
170 switch (creature_ptr->action)
174 msg_print(_("注意深く歩き始めた。", "You begin to walk carefully."));
175 creature_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 creature_ptr->update |= (PU_BONUS);
199 creature_ptr->redraw |= (PR_STATE);
203 * @brief プレイヤーの全ての時限効果をリセットする。 / reset timed flags
206 void reset_tim_flags(player_type *creature_ptr)
208 creature_ptr->fast = 0; /* Timed -- Fast */
209 creature_ptr->lightspeed = 0;
210 creature_ptr->slow = 0; /* Timed -- Slow */
211 creature_ptr->blind = 0; /* Timed -- Blindness */
212 creature_ptr->paralyzed = 0; /* Timed -- Paralysis */
213 creature_ptr->confused = 0; /* Timed -- Confusion */
214 creature_ptr->afraid = 0; /* Timed -- Fear */
215 creature_ptr->image = 0; /* Timed -- Hallucination */
216 creature_ptr->poisoned = 0; /* Timed -- Poisoned */
217 creature_ptr->cut = 0; /* Timed -- Cut */
218 creature_ptr->stun = 0; /* Timed -- Stun */
220 creature_ptr->protevil = 0; /* Timed -- Protection */
221 creature_ptr->invuln = 0; /* Timed -- Invulnerable */
222 creature_ptr->ult_res = 0;
223 creature_ptr->hero = 0; /* Timed -- Heroism */
224 creature_ptr->shero = 0; /* Timed -- Super Heroism */
225 creature_ptr->shield = 0; /* Timed -- Shield Spell */
226 creature_ptr->blessed = 0; /* Timed -- Blessed */
227 creature_ptr->tim_invis = 0; /* Timed -- Invisibility */
228 creature_ptr->tim_infra = 0; /* Timed -- Infra Vision */
229 creature_ptr->tim_regen = 0; /* Timed -- Regeneration */
230 creature_ptr->tim_stealth = 0; /* Timed -- Stealth */
231 creature_ptr->tim_esp = 0;
232 creature_ptr->wraith_form = 0; /* Timed -- Wraith Form */
233 creature_ptr->tim_levitation = 0;
234 creature_ptr->tim_sh_touki = 0;
235 creature_ptr->tim_sh_fire = 0;
236 creature_ptr->tim_sh_holy = 0;
237 creature_ptr->tim_eyeeye = 0;
238 creature_ptr->magicdef = 0;
239 creature_ptr->resist_magic = 0;
240 creature_ptr->tsuyoshi = 0;
241 creature_ptr->kabenuke = 0;
242 creature_ptr->tim_res_nether = 0;
243 creature_ptr->tim_res_time = 0;
244 creature_ptr->tim_mimic = 0;
245 creature_ptr->mimic_form = 0;
246 creature_ptr->tim_reflect = 0;
247 creature_ptr->multishadow = 0;
248 creature_ptr->dustrobe = 0;
249 creature_ptr->action = ACTION_NONE;
251 creature_ptr->oppose_acid = 0; /* Timed -- oppose acid */
252 creature_ptr->oppose_elec = 0; /* Timed -- oppose lightning */
253 creature_ptr->oppose_fire = 0; /* Timed -- oppose heat */
254 creature_ptr->oppose_cold = 0; /* Timed -- oppose cold */
255 creature_ptr->oppose_pois = 0; /* Timed -- oppose poison */
257 creature_ptr->word_recall = 0;
258 creature_ptr->alter_reality = 0;
259 creature_ptr->sutemi = FALSE;
260 creature_ptr->counter = FALSE;
261 creature_ptr->ele_attack = 0;
262 creature_ptr->ele_immune = 0;
263 creature_ptr->special_attack = 0L;
264 creature_ptr->special_defense = 0L;
266 while(creature_ptr->energy_need < 0) creature_ptr->energy_need += ENERGY_NEED();
267 creature_ptr->timewalk = FALSE;
269 if (PRACE_IS_(creature_ptr, RACE_DEMON) && (creature_ptr->lev > 44)) creature_ptr->oppose_fire = 1;
270 if ((creature_ptr->pclass == CLASS_NINJA) && (creature_ptr->lev > 44)) creature_ptr->oppose_pois = 1;
271 if (creature_ptr->pclass == CLASS_BERSERKER) creature_ptr->shero = 1;
273 if (creature_ptr->riding)
275 (void)set_monster_fast(creature_ptr, creature_ptr->riding, 0);
276 (void)set_monster_slow(creature_ptr, creature_ptr->riding, 0);
277 (void)set_monster_invulner(creature_ptr, creature_ptr->riding, 0, FALSE);
280 if (creature_ptr->pclass == CLASS_BARD)
282 SINGING_SONG_EFFECT(creature_ptr) = 0;
283 SINGING_SONG_ID(creature_ptr) = 0;
288 * @brief プレイヤーに魔力消去効果を与える。
291 void dispel_player(player_type *creature_ptr)
293 (void)set_fast(creature_ptr, 0, TRUE);
294 (void)set_lightspeed(creature_ptr, 0, TRUE);
295 (void)set_slow(creature_ptr, 0, TRUE);
296 (void)set_shield(creature_ptr, 0, TRUE);
297 (void)set_blessed(creature_ptr, 0, TRUE);
298 (void)set_tsuyoshi(creature_ptr, 0, TRUE);
299 (void)set_hero(creature_ptr, 0, TRUE);
300 (void)set_shero(creature_ptr, 0, TRUE);
301 (void)set_protevil(creature_ptr, 0, TRUE);
302 (void)set_invuln(creature_ptr, 0, TRUE);
303 (void)set_wraith_form(creature_ptr, 0, TRUE);
304 (void)set_kabenuke(creature_ptr, 0, TRUE);
305 (void)set_tim_res_nether(creature_ptr, 0, TRUE);
306 (void)set_tim_res_time(creature_ptr, 0, TRUE);
308 (void)set_tim_reflect(creature_ptr, 0,TRUE);
309 (void)set_multishadow(creature_ptr, 0,TRUE);
310 (void)set_dustrobe(creature_ptr, 0,TRUE);
312 (void)set_tim_invis(creature_ptr, 0, TRUE);
313 (void)set_tim_infra(creature_ptr, 0, TRUE);
314 (void)set_tim_esp(creature_ptr, 0, TRUE);
315 (void)set_tim_regen(creature_ptr, 0, TRUE);
316 (void)set_tim_stealth(creature_ptr, 0, TRUE);
317 (void)set_tim_levitation(creature_ptr, 0, TRUE);
318 (void)set_tim_sh_touki(creature_ptr, 0, TRUE);
319 (void)set_tim_sh_fire(creature_ptr, 0, TRUE);
320 (void)set_tim_sh_holy(creature_ptr, 0, TRUE);
321 (void)set_tim_eyeeye(creature_ptr, 0, TRUE);
322 (void)set_magicdef(creature_ptr, 0, TRUE);
323 (void)set_resist_magic(creature_ptr, 0, TRUE);
324 (void)set_oppose_acid(creature_ptr, 0, TRUE);
325 (void)set_oppose_elec(creature_ptr, 0, TRUE);
326 (void)set_oppose_fire(creature_ptr, 0, TRUE);
327 (void)set_oppose_cold(creature_ptr, 0, TRUE);
328 (void)set_oppose_pois(creature_ptr, 0, TRUE);
329 (void)set_ultimate_res(creature_ptr, 0, TRUE);
330 (void)set_mimic(creature_ptr, 0, 0, TRUE);
331 (void)set_ele_attack(creature_ptr, 0, 0);
332 (void)set_ele_immune(creature_ptr, 0, 0);
334 /* Cancel glowing hands */
335 if (creature_ptr->special_attack & ATTACK_CONFUSE)
337 creature_ptr->special_attack &= ~(ATTACK_CONFUSE);
338 msg_print(_("手の輝きがなくなった。", "Your hands stop glowing."));
341 if (music_singing_any(creature_ptr) || hex_spelling_any(creature_ptr))
343 concptr str = (music_singing_any(creature_ptr)) ? _("歌", "singing") : _("呪文", "spelling");
344 INTERUPTING_SONG_EFFECT(creature_ptr) = SINGING_SONG_EFFECT(creature_ptr);
345 SINGING_SONG_EFFECT(creature_ptr) = MUSIC_NONE;
346 msg_format(_("%sが途切れた。", "Your %s is interrupted."), str);
348 creature_ptr->action = ACTION_NONE;
349 creature_ptr->update |= (PU_BONUS | PU_HP | PU_MONSTERS);
350 creature_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
351 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
352 creature_ptr->energy_need += ENERGY_NEED();
358 * @brief 変身効果の継続時間と変身先をセットする / Set "tim_mimic", and "mimic_form", notice observable changes
361 * @param do_dec 現在の継続時間より長い値のみ上書きする
362 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
364 bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, MIMIC_RACE_IDX p, bool do_dec)
367 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
369 if (creature_ptr->is_dead) return FALSE;
373 if (creature_ptr->tim_mimic && (creature_ptr->mimic_form == p) && !do_dec)
375 if (creature_ptr->tim_mimic > v) return FALSE;
377 else if ((!creature_ptr->tim_mimic) || (creature_ptr->mimic_form != p))
379 msg_print(_("自分の体が変わってゆくのを感じた。", "You feel that your body changes."));
380 creature_ptr->mimic_form = p;
387 if (creature_ptr->tim_mimic)
389 msg_print(_("変身が解けた。", "You are no longer transformed."));
390 if (creature_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(creature_ptr, 0, TRUE);
391 creature_ptr->mimic_form=0;
398 creature_ptr->tim_mimic = v;
400 /* Nothing to notice */
401 if (!notice) return FALSE;
403 if (disturb_state) disturb(creature_ptr, FALSE, TRUE);
405 creature_ptr->redraw |= (PR_BASIC | PR_STATUS);
406 creature_ptr->update |= (PU_BONUS | PU_HP);
408 handle_stuff(creature_ptr);
413 * @brief 盲目の継続時間をセットする / Set "blind", notice observable changes
415 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
417 * Note the use of "PU_UN_LITE" and "PU_UN_VIEW", which is needed to\n
418 * memorize any terrain features which suddenly become "visible".\n
419 * Note that blindness is currently the only thing which can affect\n
420 * "player_can_see_bold()".\n
422 bool set_blind(player_type *creature_ptr, TIME_EFFECT v)
425 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
427 if (creature_ptr->is_dead) return FALSE;
431 if (!creature_ptr->blind)
433 if (creature_ptr->prace == RACE_ANDROID)
435 msg_print(_("センサーをやられた!", "You are blind!"));
439 msg_print(_("目が見えなくなってしまった!", "You are blind!"));
443 chg_virtue(creature_ptr, V_ENLIGHTEN, -1);
449 if (creature_ptr->blind)
451 if (creature_ptr->prace == RACE_ANDROID)
453 msg_print(_("センサーが復旧した。", "You can see again."));
457 msg_print(_("やっと目が見えるようになった。", "You can see again."));
465 creature_ptr->blind = v;
466 creature_ptr->redraw |= (PR_STATUS);
468 /* Nothing to notice */
469 if (!notice) return FALSE;
470 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
472 /* Fully update the visuals */
473 creature_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
474 creature_ptr->redraw |= (PR_MAP);
475 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
476 handle_stuff(creature_ptr);
482 * @brief 混乱の継続時間をセットする / Set "confused", notice observable changes
484 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
486 bool set_confused(player_type *creature_ptr, TIME_EFFECT v)
489 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
491 if (creature_ptr->is_dead) return FALSE;
495 if (!creature_ptr->confused)
497 msg_print(_("あなたは混乱した!", "You are confused!"));
499 if (creature_ptr->action == ACTION_LEARN)
501 msg_print(_("学習が続けられない!", "You cannot continue learning!"));
502 creature_ptr->new_mane = FALSE;
504 creature_ptr->redraw |= (PR_STATE);
505 creature_ptr->action = ACTION_NONE;
507 if (creature_ptr->action == ACTION_KAMAE)
509 msg_print(_("構えがとけた。", "Your posture gets loose."));
510 creature_ptr->special_defense &= ~(KAMAE_MASK);
511 creature_ptr->update |= (PU_BONUS);
512 creature_ptr->redraw |= (PR_STATE);
513 creature_ptr->action = ACTION_NONE;
515 else if (creature_ptr->action == ACTION_KATA)
517 msg_print(_("型が崩れた。", "Your posture gets loose."));
518 creature_ptr->special_defense &= ~(KATA_MASK);
519 creature_ptr->update |= (PU_BONUS);
520 creature_ptr->update |= (PU_MONSTERS);
521 creature_ptr->redraw |= (PR_STATE);
522 creature_ptr->redraw |= (PR_STATUS);
523 creature_ptr->action = ACTION_NONE;
527 if (creature_ptr->concent) reset_concentration(creature_ptr, TRUE);
529 if (hex_spelling_any(creature_ptr)) stop_hex_spell_all(creature_ptr);
532 creature_ptr->counter = FALSE;
533 chg_virtue(creature_ptr, V_HARMONY, -1);
539 if (creature_ptr->confused)
541 msg_print(_("やっと混乱がおさまった。", "You feel less confused now."));
542 creature_ptr->special_attack &= ~(ATTACK_SUIKEN);
548 creature_ptr->confused = v;
549 creature_ptr->redraw |= (PR_STATUS);
551 /* Nothing to notice */
552 if (!notice) return FALSE;
554 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
555 handle_stuff(creature_ptr);
561 * @brief 毒の継続時間をセットする / Set "poisoned", notice observable changes
563 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
565 bool set_poisoned(player_type *creature_ptr, TIME_EFFECT v)
568 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
570 if (creature_ptr->is_dead) return FALSE;
574 if (!creature_ptr->poisoned)
576 msg_print(_("毒に侵されてしまった!", "You are poisoned!"));
583 if (creature_ptr->poisoned)
585 msg_print(_("やっと毒の痛みがなくなった。", "You are no longer poisoned."));
591 creature_ptr->poisoned = v;
592 creature_ptr->redraw |= (PR_STATUS);
594 /* Nothing to notice */
595 if (!notice) return FALSE;
597 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
598 handle_stuff(creature_ptr);
604 * @brief 恐怖の継続時間をセットする / Set "afraid", notice observable changes
606 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
608 bool set_afraid(player_type *creature_ptr, TIME_EFFECT v)
611 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
613 if (creature_ptr->is_dead) return FALSE;
617 if (!creature_ptr->afraid)
619 msg_print(_("何もかも恐くなってきた!", "You are terrified!"));
621 if (creature_ptr->special_defense & KATA_MASK)
623 msg_print(_("型が崩れた。", "Your posture gets loose."));
624 creature_ptr->special_defense &= ~(KATA_MASK);
625 creature_ptr->update |= (PU_BONUS);
626 creature_ptr->update |= (PU_MONSTERS);
627 creature_ptr->redraw |= (PR_STATE);
628 creature_ptr->redraw |= (PR_STATUS);
629 creature_ptr->action = ACTION_NONE;
633 creature_ptr->counter = FALSE;
634 chg_virtue(creature_ptr, V_VALOUR, -1);
640 if (creature_ptr->afraid)
642 msg_print(_("やっと恐怖を振り払った。", "You feel bolder now."));
648 creature_ptr->afraid = v;
649 creature_ptr->redraw |= (PR_STATUS);
651 /* Nothing to notice */
652 if (!notice) return FALSE;
654 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
655 handle_stuff(creature_ptr);
660 * @brief 麻痺の継続時間をセットする / Set "paralyzed", notice observable changes
662 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
664 bool set_paralyzed(player_type *creature_ptr, TIME_EFFECT v)
667 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
669 if (creature_ptr->is_dead) return FALSE;
673 if (!creature_ptr->paralyzed)
675 msg_print(_("体が麻痺してしまった!", "You are paralyzed!"));
676 if (creature_ptr->concent) reset_concentration(creature_ptr, TRUE);
677 if (hex_spelling_any(creature_ptr)) stop_hex_spell_all(creature_ptr);
679 creature_ptr->counter = FALSE;
686 if (creature_ptr->paralyzed)
688 msg_print(_("やっと動けるようになった。", "You can move again."));
694 creature_ptr->paralyzed = v;
695 creature_ptr->redraw |= (PR_STATUS);
697 /* Nothing to notice */
698 if (!notice) return FALSE;
700 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
701 creature_ptr->redraw |= (PR_STATE);
702 handle_stuff(creature_ptr);
707 * @brief 幻覚の継続時間をセットする / Set "image", notice observable changes
709 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
710 * @details Note that we must redraw the map when hallucination changes.
712 bool set_image(player_type *creature_ptr, TIME_EFFECT v)
715 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
717 if (creature_ptr->is_dead) return FALSE;
718 if (creature_ptr->pseikaku == SEIKAKU_CHARGEMAN) v = 0;
722 set_tsuyoshi(creature_ptr, 0, TRUE);
723 if (!creature_ptr->image)
725 msg_print(_("ワーオ!何もかも虹色に見える!", "Oh, wow! Everything looks so cosmic now!"));
728 if (creature_ptr->concent) reset_concentration(creature_ptr, TRUE);
730 creature_ptr->counter = FALSE;
737 if (creature_ptr->image)
739 msg_print(_("やっとはっきりと物が見えるようになった。", "You can see clearly again."));
745 creature_ptr->image = v;
746 creature_ptr->redraw |= (PR_STATUS);
748 /* Nothing to notice */
749 if (!notice) return FALSE;
751 if (disturb_state) disturb(creature_ptr, FALSE, TRUE);
753 creature_ptr->redraw |= (PR_MAP | PR_HEALTH | PR_UHEALTH);
754 creature_ptr->update |= (PU_MONSTERS);
755 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
756 handle_stuff(creature_ptr);
761 * @brief 加速の継続時間をセットする / Set "fast", notice observable changes
763 * @param do_dec 現在の継続時間より長い値のみ上書きする
764 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
766 bool set_fast(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
769 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
771 if (creature_ptr->is_dead) return FALSE;
775 if (creature_ptr->fast && !do_dec)
777 if (creature_ptr->fast > v) return FALSE;
779 else if (!IS_FAST(creature_ptr) && !creature_ptr->lightspeed)
781 msg_print(_("素早く動けるようになった!", "You feel yourself moving much faster!"));
783 chg_virtue(creature_ptr, V_PATIENCE, -1);
784 chg_virtue(creature_ptr, V_DILIGENCE, 1);
790 if (creature_ptr->fast && !creature_ptr->lightspeed && !music_singing(creature_ptr, MUSIC_SPEED) && !music_singing(creature_ptr, MUSIC_SHERO))
792 msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
798 creature_ptr->fast = v;
800 /* Nothing to notice */
801 if (!notice) return FALSE;
803 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
804 creature_ptr->update |= (PU_BONUS);
805 handle_stuff(creature_ptr);
810 * @brief 光速移動の継続時間をセットする / Set "lightspeed", notice observable changes
812 * @param do_dec 現在の継続時間より長い値のみ上書きする
813 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
815 bool set_lightspeed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
818 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
820 if (creature_ptr->is_dead) return FALSE;
822 if (creature_ptr->wild_mode) v = 0;
826 if (creature_ptr->lightspeed && !do_dec)
828 if (creature_ptr->lightspeed > v) return FALSE;
830 else if (!creature_ptr->lightspeed)
832 msg_print(_("非常に素早く動けるようになった!", "You feel yourself moving extremely fast!"));
834 chg_virtue(creature_ptr, V_PATIENCE, -1);
835 chg_virtue(creature_ptr, V_DILIGENCE, 1);
841 if (creature_ptr->lightspeed)
843 msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
849 creature_ptr->lightspeed = v;
851 /* Nothing to notice */
852 if (!notice) return FALSE;
854 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
855 creature_ptr->update |= (PU_BONUS);
856 handle_stuff(creature_ptr);
861 * @brief 減速の継続時間をセットする / Set "slow", notice observable changes
863 * @param do_dec 現在の継続時間より長い値のみ上書きする
864 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
866 bool set_slow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
869 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
871 if (creature_ptr->is_dead) return FALSE;
875 if (creature_ptr->slow && !do_dec)
877 if (creature_ptr->slow > v) return FALSE;
879 else if (!creature_ptr->slow)
881 msg_print(_("体の動きが遅くなってしまった!", "You feel yourself moving slower!"));
888 if (creature_ptr->slow)
890 msg_print(_("動きの遅さがなくなったようだ。", "You feel yourself speed up."));
896 creature_ptr->slow = v;
898 /* Nothing to notice */
899 if (!notice) return FALSE;
901 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
902 creature_ptr->update |= (PU_BONUS);
903 handle_stuff(creature_ptr);
909 * @brief 肌石化の継続時間をセットする / Set "shield", notice observable changes
911 * @param do_dec 現在の継続時間より長い値のみ上書きする
912 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
914 bool set_shield(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
917 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
919 if (creature_ptr->is_dead) return FALSE;
923 if (creature_ptr->shield && !do_dec)
925 if (creature_ptr->shield > v) return FALSE;
927 else if (!creature_ptr->shield)
929 msg_print(_("肌が石になった。", "Your skin turns to stone."));
936 if (creature_ptr->shield)
938 msg_print(_("肌が元に戻った。", "Your skin returns to normal."));
944 creature_ptr->shield = v;
945 creature_ptr->redraw |= (PR_STATUS);
947 /* Nothing to notice */
948 if (!notice) return FALSE;
950 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
951 creature_ptr->update |= (PU_BONUS);
952 handle_stuff(creature_ptr);
958 * @brief つぶれるの継続時間をセットする / Set "tsubureru", notice observable changes
960 * @param do_dec 現在の継続時間より長い値のみ上書きする
961 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
963 bool set_tsubureru(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
966 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
968 if (creature_ptr->is_dead) return FALSE;
972 if (creature_ptr->tsubureru && !do_dec)
974 if (creature_ptr->tsubureru > v) return FALSE;
976 else if (!creature_ptr->tsubureru)
978 msg_print(_("横に伸びた。", "Your body expands horizontally."));
985 if (creature_ptr->tsubureru)
987 msg_print(_("もう横に伸びていない。", "Your body returns to normal."));
993 creature_ptr->tsubureru = v;
994 creature_ptr->redraw |= (PR_STATUS);
996 /* Nothing to notice */
997 if (!notice) return FALSE;
999 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1000 creature_ptr->update |= (PU_BONUS);
1001 handle_stuff(creature_ptr);
1007 * @brief 魔法の鎧の継続時間をセットする / Set "magicdef", notice observable changes
1009 * @param do_dec 現在の継続時間より長い値のみ上書きする
1010 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1012 bool set_magicdef(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1014 bool notice = FALSE;
1015 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1017 if (creature_ptr->is_dead) return FALSE;
1021 if (creature_ptr->magicdef && !do_dec)
1023 if (creature_ptr->magicdef > v) return FALSE;
1025 else if (!creature_ptr->magicdef)
1027 msg_print(_("魔法の防御力が増したような気がする。", "You feel more resistant to magic."));
1034 if (creature_ptr->magicdef)
1036 msg_print(_("魔法の防御力が元に戻った。", "You feel less resistant to magic."));
1042 creature_ptr->magicdef = v;
1043 creature_ptr->redraw |= (PR_STATUS);
1045 /* Nothing to notice */
1046 if (!notice) return FALSE;
1048 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1049 creature_ptr->update |= (PU_BONUS);
1050 handle_stuff(creature_ptr);
1055 * @brief 祝福の継続時間をセットする / Set "blessed", notice observable changes
1057 * @param do_dec 現在の継続時間より長い値のみ上書きする
1058 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1060 bool set_blessed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1062 bool notice = FALSE;
1063 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1065 if (creature_ptr->is_dead) return FALSE;
1069 if (creature_ptr->blessed && !do_dec)
1071 if (creature_ptr->blessed > v) return FALSE;
1073 else if (!is_blessed(creature_ptr))
1075 msg_print(_("高潔な気分になった!", "You feel righteous!"));
1081 if (creature_ptr->blessed && !music_singing(creature_ptr, MUSIC_BLESS))
1083 msg_print(_("高潔な気分が消え失せた。", "The prayer has expired."));
1089 creature_ptr->blessed = v;
1090 creature_ptr->redraw |= (PR_STATUS);
1092 /* Nothing to notice */
1093 if (!notice) return FALSE;
1095 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1096 creature_ptr->update |= (PU_BONUS);
1097 handle_stuff(creature_ptr);
1103 * @brief 士気高揚の継続時間をセットする / Set "hero", notice observable changes
1105 * @param do_dec 現在の継続時間より長い値のみ上書きする
1106 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1108 bool set_hero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1110 bool notice = FALSE;
1111 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1113 if (creature_ptr->is_dead) return FALSE;
1117 if (creature_ptr->hero && !do_dec)
1119 if (creature_ptr->hero > v) return FALSE;
1121 else if (!IS_HERO(creature_ptr))
1123 msg_print(_("ヒーローになった気がする!", "You feel like a hero!"));
1130 if (creature_ptr->hero && !music_singing(creature_ptr, MUSIC_HERO) && !music_singing(creature_ptr, MUSIC_SHERO))
1132 msg_print(_("ヒーローの気分が消え失せた。", "The heroism wears off."));
1138 creature_ptr->hero = v;
1139 creature_ptr->redraw |= (PR_STATUS);
1141 /* Nothing to notice */
1142 if (!notice) return FALSE;
1144 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1145 creature_ptr->update |= (PU_BONUS);
1147 /* Recalculate hitpoints */
1148 creature_ptr->update |= (PU_HP);
1149 handle_stuff(creature_ptr);
1154 * @brief 狂戦士化の継続時間をセットする / Set "shero", notice observable changes
1155 * @param v 継続時間/ 0ならば無条件にリセット
1156 * @param do_dec FALSEの場合現在の継続時間より長い値のみ上書きする
1157 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1159 bool set_shero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1161 bool notice = FALSE;
1162 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1164 if (creature_ptr->is_dead) return FALSE;
1166 if (creature_ptr->pclass == CLASS_BERSERKER) v = 1;
1169 if (creature_ptr->shero && !do_dec)
1171 if (creature_ptr->shero > v) return FALSE;
1173 else if (!creature_ptr->shero)
1175 msg_print(_("殺戮マシーンになった気がする!", "You feel like a killing machine!"));
1182 if (creature_ptr->shero)
1184 msg_print(_("野蛮な気持ちが消え失せた。", "You feel less berserk."));
1190 creature_ptr->shero = v;
1191 creature_ptr->redraw |= (PR_STATUS);
1193 /* Nothing to notice */
1194 if (!notice) return FALSE;
1196 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1197 creature_ptr->update |= (PU_BONUS);
1199 /* Recalculate hitpoints */
1200 creature_ptr->update |= (PU_HP);
1201 handle_stuff(creature_ptr);
1206 * @brief 対邪悪結界の継続時間をセットする / Set "protevil", notice observable changes
1208 * @param do_dec 現在の継続時間より長い値のみ上書きする
1209 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1211 bool set_protevil(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1213 bool notice = FALSE;
1214 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1216 if (creature_ptr->is_dead) return FALSE;
1220 if (creature_ptr->protevil && !do_dec)
1222 if (creature_ptr->protevil > v) return FALSE;
1224 else if (!creature_ptr->protevil)
1226 msg_print(_("邪悪なる存在から守られているような感じがする!", "You feel safe from evil!"));
1233 if (creature_ptr->protevil)
1235 msg_print(_("邪悪なる存在から守られている感じがなくなった。", "You no longer feel safe from evil."));
1241 creature_ptr->protevil = v;
1242 creature_ptr->redraw |= (PR_STATUS);
1244 /* Nothing to notice */
1245 if (!notice) return FALSE;
1247 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1248 handle_stuff(creature_ptr);
1253 * @brief 幽体化の継続時間をセットする / Set "wraith_form", notice observable changes
1255 * @param do_dec 現在の継続時間より長い値のみ上書きする
1256 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1258 bool set_wraith_form(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1260 bool notice = FALSE;
1261 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1263 if (creature_ptr->is_dead) return FALSE;
1267 if (creature_ptr->wraith_form && !do_dec)
1269 if (creature_ptr->wraith_form > v) return FALSE;
1271 else if (!creature_ptr->wraith_form)
1273 msg_print(_("物質界を離れて幽鬼のような存在になった!", "You leave the physical world and current_world_ptr->game_turn into a wraith-being!"));
1275 chg_virtue(creature_ptr, V_UNLIFE, 3);
1276 chg_virtue(creature_ptr, V_HONOUR, -2);
1277 chg_virtue(creature_ptr, V_SACRIFICE, -2);
1278 chg_virtue(creature_ptr, V_VALOUR, -5);
1280 creature_ptr->redraw |= (PR_MAP);
1281 creature_ptr->update |= (PU_MONSTERS);
1283 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1289 if (creature_ptr->wraith_form)
1291 msg_print(_("不透明になった感じがする。", "You feel opaque."));
1294 creature_ptr->redraw |= (PR_MAP);
1295 creature_ptr->update |= (PU_MONSTERS);
1297 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1302 creature_ptr->wraith_form = v;
1303 creature_ptr->redraw |= (PR_STATUS);
1305 /* Nothing to notice */
1306 if (!notice) return FALSE;
1308 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1309 creature_ptr->update |= (PU_BONUS);
1310 handle_stuff(creature_ptr);
1316 * @brief 無傷球の継続時間をセットする / Set "invuln", notice observable changes
1318 * @param do_dec 現在の継続時間より長い値のみ上書きする
1319 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1321 bool set_invuln(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1323 bool notice = FALSE;
1324 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1326 if (creature_ptr->is_dead) return FALSE;
1330 if (creature_ptr->invuln && !do_dec)
1332 if (creature_ptr->invuln > v) return FALSE;
1334 else if (!IS_INVULN(creature_ptr))
1336 msg_print(_("無敵だ!", "Invulnerability!"));
1339 chg_virtue(creature_ptr, V_UNLIFE, -2);
1340 chg_virtue(creature_ptr, V_HONOUR, -2);
1341 chg_virtue(creature_ptr, V_SACRIFICE, -3);
1342 chg_virtue(creature_ptr, V_VALOUR, -5);
1344 creature_ptr->redraw |= (PR_MAP);
1345 creature_ptr->update |= (PU_MONSTERS);
1347 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1353 if (creature_ptr->invuln && !music_singing(creature_ptr, MUSIC_INVULN))
1355 msg_print(_("無敵ではなくなった。", "The invulnerability wears off."));
1358 creature_ptr->redraw |= (PR_MAP);
1359 creature_ptr->update |= (PU_MONSTERS);
1361 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1363 creature_ptr->energy_need += ENERGY_NEED();
1368 creature_ptr->invuln = v;
1369 creature_ptr->redraw |= (PR_STATUS);
1371 /* Nothing to notice */
1372 if (!notice) return FALSE;
1374 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1375 creature_ptr->update |= (PU_BONUS);
1376 handle_stuff(creature_ptr);
1381 * @brief 時限ESPの継続時間をセットする / Set "tim_esp", notice observable changes
1383 * @param do_dec 現在の継続時間より長い値のみ上書きする
1384 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1386 bool set_tim_esp(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1388 bool notice = FALSE;
1389 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1391 if (creature_ptr->is_dead) return FALSE;
1395 if (creature_ptr->tim_esp && !do_dec)
1397 if (creature_ptr->tim_esp > v) return FALSE;
1399 else if (!is_time_limit_esp(creature_ptr))
1401 msg_print(_("意識が広がった気がする!", "You feel your consciousness expand!"));
1407 if (creature_ptr->tim_esp && !music_singing(creature_ptr, MUSIC_MIND))
1409 msg_print(_("意識は元に戻った。", "Your consciousness contracts again."));
1415 creature_ptr->tim_esp = v;
1416 creature_ptr->redraw |= (PR_STATUS);
1418 /* Nothing to notice */
1419 if (!notice) return FALSE;
1421 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1422 creature_ptr->update |= (PU_BONUS);
1423 creature_ptr->update |= (PU_MONSTERS);
1424 handle_stuff(creature_ptr);
1429 * @brief 時限透明視の継続時間をセットする / Set "tim_invis", notice observable changes
1431 * @param do_dec 現在の継続時間より長い値のみ上書きする
1432 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1434 bool set_tim_invis(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1436 bool notice = FALSE;
1437 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1439 if (creature_ptr->is_dead) return FALSE;
1443 if (creature_ptr->tim_invis && !do_dec)
1445 if (creature_ptr->tim_invis > v) return FALSE;
1447 else if (!creature_ptr->tim_invis)
1449 msg_print(_("目が非常に敏感になった気がする!", "Your eyes feel very sensitive!"));
1456 if (creature_ptr->tim_invis)
1458 msg_print(_("目の敏感さがなくなったようだ。", "Your eyes feel less sensitive."));
1464 creature_ptr->tim_invis = v;
1465 creature_ptr->redraw |= (PR_STATUS);
1467 /* Nothing to notice */
1468 if (!notice) return FALSE;
1470 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1471 creature_ptr->update |= (PU_BONUS);
1473 /* Update the monsters */
1474 creature_ptr->update |= (PU_MONSTERS);
1475 handle_stuff(creature_ptr);
1480 * @brief 時限赤外線視力の継続時間をセットする / Set "tim_infra", notice observable changes
1482 * @param do_dec 現在の継続時間より長い値のみ上書きする
1483 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1485 bool set_tim_infra(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1487 bool notice = FALSE;
1488 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1490 if (creature_ptr->is_dead) return FALSE;
1494 if (creature_ptr->tim_infra && !do_dec)
1496 if (creature_ptr->tim_infra > v) return FALSE;
1498 else if (!creature_ptr->tim_infra)
1500 msg_print(_("目がランランと輝き始めた!", "Your eyes begin to tingle!"));
1507 if (creature_ptr->tim_infra)
1509 msg_print(_("目の輝きがなくなった。", "Your eyes stop tingling."));
1515 creature_ptr->tim_infra = v;
1516 creature_ptr->redraw |= (PR_STATUS);
1518 /* Nothing to notice */
1519 if (!notice) return FALSE;
1521 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1522 creature_ptr->update |= (PU_BONUS);
1524 /* Update the monsters */
1525 creature_ptr->update |= (PU_MONSTERS);
1526 handle_stuff(creature_ptr);
1531 * @brief 時限急回復の継続時間をセットする / Set "tim_regen", notice observable changes
1533 * @param do_dec 現在の継続時間より長い値のみ上書きする
1534 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1536 bool set_tim_regen(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1538 bool notice = FALSE;
1539 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1541 if (creature_ptr->is_dead) return FALSE;
1545 if (creature_ptr->tim_regen && !do_dec)
1547 if (creature_ptr->tim_regen > v) return FALSE;
1549 else if (!creature_ptr->tim_regen)
1551 msg_print(_("回復力が上がった!", "You feel yourself regenerating quickly!"));
1558 if (creature_ptr->tim_regen)
1560 msg_print(_("素早く回復する感じがなくなった。", "You feel yourself regenerating slowly."));
1566 creature_ptr->tim_regen = v;
1567 creature_ptr->redraw |= (PR_STATUS);
1569 /* Nothing to notice */
1570 if (!notice) return FALSE;
1572 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1573 creature_ptr->update |= (PU_BONUS);
1574 handle_stuff(creature_ptr);
1579 * @brief 隠密の歌の継続時間をセットする / Set "tim_stealth", notice observable changes
1581 * @param do_dec 現在の継続時間より長い値のみ上書きする
1582 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1584 bool set_tim_stealth(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1586 bool notice = FALSE;
1587 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1589 if (creature_ptr->is_dead) return FALSE;
1593 if (creature_ptr->tim_stealth && !do_dec)
1595 if (creature_ptr->tim_stealth > v) return FALSE;
1597 else if (!is_time_limit_stealth(creature_ptr))
1599 msg_print(_("足音が小さくなった!", "You begin to walk silently!"));
1606 if (creature_ptr->tim_stealth && !music_singing(creature_ptr, MUSIC_STEALTH))
1608 msg_print(_("足音が大きくなった。", "You no longer walk silently."));
1614 creature_ptr->tim_stealth = v;
1615 creature_ptr->redraw |= (PR_STATUS);
1617 /* Nothing to notice */
1618 if (!notice) return FALSE;
1620 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1621 creature_ptr->update |= (PU_BONUS);
1622 handle_stuff(creature_ptr);
1627 * @brief 超隠密状態をセットする
1628 * @param set TRUEならば超隠密状態になる。
1629 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1631 bool set_superstealth(player_type *creature_ptr, bool set)
1633 bool notice = FALSE;
1635 if (creature_ptr->is_dead) return FALSE;
1639 if (!(creature_ptr->special_defense & NINJA_S_STEALTH))
1641 if (creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & CAVE_MNLT)
1643 msg_print(_("敵の目から薄い影の中に覆い隠された。", "You are mantled in weak shadow from ordinary eyes."));
1644 creature_ptr->monlite = creature_ptr->old_monlite = TRUE;
1648 msg_print(_("敵の目から影の中に覆い隠された!", "You are mantled in shadow from ordinary eyes!"));
1649 creature_ptr->monlite = creature_ptr->old_monlite = FALSE;
1655 creature_ptr->special_defense |= NINJA_S_STEALTH;
1661 if (creature_ptr->special_defense & NINJA_S_STEALTH)
1663 msg_print(_("再び敵の目にさらされるようになった。", "You are exposed to common sight once more."));
1667 creature_ptr->special_defense &= ~(NINJA_S_STEALTH);
1671 /* Nothing to notice */
1672 if (!notice) return FALSE;
1673 creature_ptr->redraw |= (PR_STATUS);
1675 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1680 * @brief 一時的浮遊の継続時間をセットする / Set "tim_levitation", notice observable changes
1682 * @param do_dec 現在の継続時間より長い値のみ上書きする
1683 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1685 bool set_tim_levitation(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1687 bool notice = FALSE;
1688 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1690 if (creature_ptr->is_dead) return FALSE;
1694 if (creature_ptr->tim_levitation && !do_dec)
1696 if (creature_ptr->tim_levitation > v) return FALSE;
1698 else if (!creature_ptr->tim_levitation)
1700 msg_print(_("体が宙に浮き始めた。", "You begin to fly!"));
1707 if (creature_ptr->tim_levitation)
1709 msg_print(_("もう宙に浮かべなくなった。", "You stop flying."));
1715 creature_ptr->tim_levitation = v;
1716 creature_ptr->redraw |= (PR_STATUS);
1718 /* Nothing to notice */
1719 if (!notice) return FALSE;
1721 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1722 creature_ptr->update |= (PU_BONUS);
1723 handle_stuff(creature_ptr);
1728 * @brief 一時的闘気のオーラの継続時間をセットする / Set "tim_sh_touki", notice observable changes
1730 * @param do_dec 現在の継続時間より長い値のみ上書きする
1731 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1733 bool set_tim_sh_touki(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1735 bool notice = FALSE;
1736 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1738 if (creature_ptr->is_dead) return FALSE;
1742 if (creature_ptr->tim_sh_touki && !do_dec)
1744 if (creature_ptr->tim_sh_touki > v) return FALSE;
1746 else if (!creature_ptr->tim_sh_touki)
1748 msg_print(_("体が闘気のオーラで覆われた。", "You have enveloped by the aura of the Force!"));
1755 if (creature_ptr->tim_sh_touki)
1757 msg_print(_("闘気が消えた。", "Aura of the Force disappeared."));
1763 creature_ptr->tim_sh_touki = v;
1764 creature_ptr->redraw |= (PR_STATUS);
1766 /* Nothing to notice */
1767 if (!notice) return FALSE;
1769 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1770 handle_stuff(creature_ptr);
1775 * @brief 一時的火炎のオーラの継続時間をセットする / Set "tim_sh_fire", notice observable changes
1777 * @param do_dec 現在の継続時間より長い値のみ上書きする
1778 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1780 bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1782 bool notice = FALSE;
1783 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1785 if (creature_ptr->is_dead) return FALSE;
1789 if (creature_ptr->tim_sh_fire && !do_dec)
1791 if (creature_ptr->tim_sh_fire > v) return FALSE;
1793 else if (!creature_ptr->tim_sh_fire)
1795 msg_print(_("体が炎のオーラで覆われた。", "You have enveloped by fiery aura!"));
1802 if (creature_ptr->tim_sh_fire)
1804 msg_print(_("炎のオーラが消えた。", "Fiery aura disappeared."));
1810 creature_ptr->tim_sh_fire = v;
1811 creature_ptr->redraw |= (PR_STATUS);
1813 /* Nothing to notice */
1814 if (!notice) return FALSE;
1816 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1817 creature_ptr->update |= (PU_BONUS);
1818 handle_stuff(creature_ptr);
1823 * @brief 一時的聖なるのオーラの継続時間をセットする / Set "tim_sh_holy", notice observable changes
1825 * @param do_dec 現在の継続時間より長い値のみ上書きする
1826 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1828 bool set_tim_sh_holy(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1830 bool notice = FALSE;
1831 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1833 if (creature_ptr->is_dead) return FALSE;
1837 if (creature_ptr->tim_sh_holy && !do_dec)
1839 if (creature_ptr->tim_sh_holy > v) return FALSE;
1841 else if (!creature_ptr->tim_sh_holy)
1843 msg_print(_("体が聖なるオーラで覆われた。", "You have enveloped by holy aura!"));
1850 if (creature_ptr->tim_sh_holy)
1852 msg_print(_("聖なるオーラが消えた。", "Holy aura disappeared."));
1858 creature_ptr->tim_sh_holy = v;
1859 creature_ptr->redraw |= (PR_STATUS);
1861 /* Nothing to notice */
1862 if (!notice) return FALSE;
1864 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1865 creature_ptr->update |= (PU_BONUS);
1866 handle_stuff(creature_ptr);
1871 * @brief 目には目をの残り時間をセットする / Set "tim_eyeeye", notice observable changes
1873 * @param do_dec 現在の継続時間より長い値のみ上書きする
1874 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1876 bool set_tim_eyeeye(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1878 bool notice = FALSE;
1879 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1881 if (creature_ptr->is_dead) return FALSE;
1885 if (creature_ptr->tim_eyeeye && !do_dec)
1887 if (creature_ptr->tim_eyeeye > v) return FALSE;
1889 else if (!creature_ptr->tim_eyeeye)
1891 msg_print(_("法の守り手になった気がした!", "You feel like a keeper of commandments!"));
1898 if (creature_ptr->tim_eyeeye)
1900 msg_print(_("懲罰を執行することができなくなった。", "You no longer feel like a keeper."));
1906 creature_ptr->tim_eyeeye = v;
1907 creature_ptr->redraw |= (PR_STATUS);
1909 /* Nothing to notice */
1910 if (!notice) return FALSE;
1912 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1913 creature_ptr->update |= (PU_BONUS);
1914 handle_stuff(creature_ptr);
1920 * @brief 一時的魔法防御の継続時間をセットする / Set "resist_magic", notice observable changes
1922 * @param do_dec 現在の継続時間より長い値のみ上書きする
1923 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1925 bool set_resist_magic(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1927 bool notice = FALSE;
1928 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1930 if (creature_ptr->is_dead) return FALSE;
1934 if (creature_ptr->resist_magic && !do_dec)
1936 if (creature_ptr->resist_magic > v) return FALSE;
1938 else if (!creature_ptr->resist_magic)
1940 msg_print(_("魔法への耐性がついた。", "You have been protected from magic!"));
1947 if (creature_ptr->resist_magic)
1949 msg_print(_("魔法に弱くなった。", "You are no longer protected from magic."));
1955 creature_ptr->resist_magic = v;
1956 creature_ptr->redraw |= (PR_STATUS);
1958 /* Nothing to notice */
1959 if (!notice) return FALSE;
1961 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1962 creature_ptr->update |= (PU_BONUS);
1963 handle_stuff(creature_ptr);
1968 * @brief 一時的反射の継続時間をセットする / Set "tim_reflect", notice observable changes
1970 * @param do_dec 現在の継続時間より長い値のみ上書きする
1971 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1973 bool set_tim_reflect(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1975 bool notice = FALSE;
1976 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1978 if (creature_ptr->is_dead) return FALSE;
1982 if (creature_ptr->tim_reflect && !do_dec)
1984 if (creature_ptr->tim_reflect > v) return FALSE;
1986 else if (!creature_ptr->tim_reflect)
1988 msg_print(_("体の表面が滑かになった気がする。", "Your body becames smooth."));
1995 if (creature_ptr->tim_reflect)
1997 msg_print(_("体の表面が滑かでなくなった。", "Your body is no longer smooth."));
2003 creature_ptr->tim_reflect = v;
2004 creature_ptr->redraw |= (PR_STATUS);
2006 /* Nothing to notice */
2007 if (!notice) return FALSE;
2009 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2010 creature_ptr->update |= (PU_BONUS);
2011 handle_stuff(creature_ptr);
2017 * Set "multishadow", notice observable changes
2019 bool set_multishadow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2021 bool notice = FALSE;
2022 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2024 if (creature_ptr->is_dead) return FALSE;
2028 if (creature_ptr->multishadow && !do_dec)
2030 if (creature_ptr->multishadow > v) return FALSE;
2032 else if (!creature_ptr->multishadow)
2034 msg_print(_("あなたの周りに幻影が生まれた。", "Your Shadow enveloped you."));
2041 if (creature_ptr->multishadow)
2043 msg_print(_("幻影が消えた。", "Your Shadow disappears."));
2049 creature_ptr->multishadow = v;
2050 creature_ptr->redraw |= (PR_STATUS);
2052 /* Nothing to notice */
2053 if (!notice) return FALSE;
2055 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2056 creature_ptr->update |= (PU_BONUS);
2057 handle_stuff(creature_ptr);
2062 * @brief 一時的破片のオーラの継続時間をセットする / Set "dustrobe", notice observable changes
2064 * @param do_dec 現在の継続時間より長い値のみ上書きする
2065 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2067 bool set_dustrobe(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2069 bool notice = FALSE;
2070 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2072 if (creature_ptr->is_dead) return FALSE;
2076 if (creature_ptr->dustrobe && !do_dec)
2078 if (creature_ptr->dustrobe > v) return FALSE;
2080 else if (!creature_ptr->dustrobe)
2082 msg_print(_("体が鏡のオーラで覆われた。", "You were enveloped by mirror shards."));
2089 if (creature_ptr->dustrobe)
2091 msg_print(_("鏡のオーラが消えた。", "The mirror shards disappear."));
2097 creature_ptr->dustrobe = v;
2098 creature_ptr->redraw |= (PR_STATUS);
2100 /* Nothing to notice */
2101 if (!notice) return FALSE;
2103 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2104 creature_ptr->update |= (PU_BONUS);
2105 handle_stuff(creature_ptr);
2110 * @brief 一時的壁抜けの継続時間をセットする / Set "kabenuke", notice observable changes
2112 * @param do_dec 現在の継続時間より長い値のみ上書きする
2113 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2115 bool set_kabenuke(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2117 bool notice = FALSE;
2118 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2120 if (creature_ptr->is_dead) return FALSE;
2124 if (creature_ptr->kabenuke && !do_dec)
2126 if (creature_ptr->kabenuke > v) return FALSE;
2128 else if (!creature_ptr->kabenuke)
2130 msg_print(_("体が半物質の状態になった。", "You became ethereal."));
2137 if (creature_ptr->kabenuke)
2139 msg_print(_("体が物質化した。", "You are no longer ethereal."));
2145 creature_ptr->kabenuke = v;
2146 creature_ptr->redraw |= (PR_STATUS);
2148 /* Nothing to notice */
2149 if (!notice) return FALSE;
2151 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2152 creature_ptr->update |= (PU_BONUS);
2153 handle_stuff(creature_ptr);
2158 * @brief オクレ兄さんの継続時間をセットする / Set "tsuyoshi", notice observable changes
2160 * @param do_dec 現在の継続時間より長い値のみ上書きする
2161 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2163 bool set_tsuyoshi(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2165 bool notice = FALSE;
2166 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2168 if (creature_ptr->is_dead) return FALSE;
2172 if (creature_ptr->tsuyoshi && !do_dec)
2174 if (creature_ptr->tsuyoshi > v) return FALSE;
2176 else if (!creature_ptr->tsuyoshi)
2178 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
2180 chg_virtue(creature_ptr, V_VITALITY, 2);
2186 if (creature_ptr->tsuyoshi)
2188 msg_print(_("肉体が急速にしぼんでいった。", "Your body has quickly shriveled."));
2190 (void)dec_stat(creature_ptr, A_CON, 20, TRUE);
2191 (void)dec_stat(creature_ptr, A_STR, 20, TRUE);
2194 chg_virtue(creature_ptr, V_VITALITY, -3);
2199 creature_ptr->tsuyoshi = v;
2200 creature_ptr->redraw |= (PR_STATUS);
2202 /* Nothing to notice */
2203 if (!notice) return FALSE;
2205 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2206 creature_ptr->update |= (PU_BONUS);
2208 /* Recalculate hitpoints */
2209 creature_ptr->update |= (PU_HP);
2210 handle_stuff(creature_ptr);
2215 * @brief 一時的元素スレイの継続時間をセットする / Set a temporary elemental brand. Clear all other brands. Print status messages. -LM-
2216 * @param attack_type スレイのタイプID
2218 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2220 bool set_ele_attack(player_type *creature_ptr, u32b attack_type, TIME_EFFECT v)
2222 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2224 /* Clear all elemental attacks (only one is allowed at a time). */
2225 if ((creature_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
2227 creature_ptr->special_attack &= ~(ATTACK_ACID);
2228 msg_print(_("酸で攻撃できなくなった。", "Your temporary acidic brand fades away."));
2230 if ((creature_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
2232 creature_ptr->special_attack &= ~(ATTACK_ELEC);
2233 msg_print(_("電撃で攻撃できなくなった。", "Your temporary electrical brand fades away."));
2235 if ((creature_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
2237 creature_ptr->special_attack &= ~(ATTACK_FIRE);
2238 msg_print(_("火炎で攻撃できなくなった。", "Your temporary fiery brand fades away."));
2240 if ((creature_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
2242 creature_ptr->special_attack &= ~(ATTACK_COLD);
2243 msg_print(_("冷気で攻撃できなくなった。", "Your temporary frost brand fades away."));
2245 if ((creature_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
2247 creature_ptr->special_attack &= ~(ATTACK_POIS);
2248 msg_print(_("毒で攻撃できなくなった。", "Your temporary poison brand fades away."));
2251 if ((v) && (attack_type))
2253 /* Set attack type. */
2254 creature_ptr->special_attack |= (attack_type);
2257 creature_ptr->ele_attack = v;
2260 msg_format("%sで攻撃できるようになった!",
2261 ((attack_type == ATTACK_ACID) ? "酸" :
2262 ((attack_type == ATTACK_ELEC) ? "電撃" :
2263 ((attack_type == ATTACK_FIRE) ? "火炎" :
2264 ((attack_type == ATTACK_COLD) ? "冷気" :
2265 ((attack_type == ATTACK_POIS) ? "毒" :
2268 msg_format("For a while, the blows you deal will %s",
2269 ((attack_type == ATTACK_ACID) ? "melt with acid!" :
2270 ((attack_type == ATTACK_ELEC) ? "shock your foes!" :
2271 ((attack_type == ATTACK_FIRE) ? "burn with fire!" :
2272 ((attack_type == ATTACK_COLD) ? "chill to the bone!" :
2273 ((attack_type == ATTACK_POIS) ? "poison your enemies!" :
2274 "do nothing special."))))));
2278 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2279 creature_ptr->redraw |= (PR_STATUS);
2281 creature_ptr->update |= (PU_BONUS);
2282 handle_stuff(creature_ptr);
2288 * @brief 一時的元素免疫の継続時間をセットする / Set a temporary elemental brand. Clear all other brands. Print status messages. -LM-
2289 * @param immune_type 免疫のタイプID
2291 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2293 bool set_ele_immune(player_type *creature_ptr, u32b immune_type, TIME_EFFECT v)
2295 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2297 /* Clear all elemental attacks (only one is allowed at a time). */
2298 if ((creature_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
2300 creature_ptr->special_defense &= ~(DEFENSE_ACID);
2301 msg_print(_("酸の攻撃で傷つけられるようになった。。", "You are no longer immune to acid."));
2303 if ((creature_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
2305 creature_ptr->special_defense &= ~(DEFENSE_ELEC);
2306 msg_print(_("電撃の攻撃で傷つけられるようになった。。", "You are no longer immune to electricity."));
2308 if ((creature_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
2310 creature_ptr->special_defense &= ~(DEFENSE_FIRE);
2311 msg_print(_("火炎の攻撃で傷つけられるようになった。。", "You are no longer immune to fire."));
2313 if ((creature_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
2315 creature_ptr->special_defense &= ~(DEFENSE_COLD);
2316 msg_print(_("冷気の攻撃で傷つけられるようになった。。", "You are no longer immune to cold."));
2318 if ((creature_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
2320 creature_ptr->special_defense &= ~(DEFENSE_POIS);
2321 msg_print(_("毒の攻撃で傷つけられるようになった。。", "You are no longer immune to poison."));
2324 if ((v) && (immune_type))
2326 /* Set attack type. */
2327 creature_ptr->special_defense |= (immune_type);
2330 creature_ptr->ele_immune = v;
2332 msg_format(_("%sの攻撃を受けつけなくなった!", "For a while, You are immune to %s"),
2333 ((immune_type == DEFENSE_ACID) ? _("酸", "acid!") :
2334 ((immune_type == DEFENSE_ELEC) ? _("電撃", "electricity!") :
2335 ((immune_type == DEFENSE_FIRE) ? _("火炎", "fire!") :
2336 ((immune_type == DEFENSE_COLD) ? _("冷気", "cold!") :
2337 ((immune_type == DEFENSE_POIS) ? _("毒", "poison!") :
2338 _("(なし)", "do nothing special.")))))));
2341 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2342 creature_ptr->redraw |= (PR_STATUS);
2343 creature_ptr->update |= (PU_BONUS);
2344 handle_stuff(creature_ptr);
2350 * @brief 一時的酸耐性の継続時間をセットする / Set "oppose_acid", notice observable changes
2352 * @param do_dec 現在の継続時間より長い値のみ上書きする
2353 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2355 bool set_oppose_acid(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2357 bool notice = FALSE;
2358 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2360 if (creature_ptr->is_dead) return FALSE;
2364 if (creature_ptr->oppose_acid && !do_dec)
2366 if (creature_ptr->oppose_acid > v) return FALSE;
2368 else if (!is_oppose_acid(creature_ptr))
2370 msg_print(_("酸への耐性がついた気がする!", "You feel resistant to acid!"));
2377 if (creature_ptr->oppose_acid && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
2379 msg_print(_("酸への耐性が薄れた気がする。", "You feel less resistant to acid."));
2385 creature_ptr->oppose_acid = v;
2387 /* Nothing to notice */
2388 if (!notice) return FALSE;
2389 creature_ptr->redraw |= (PR_STATUS);
2391 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2392 handle_stuff(creature_ptr);
2397 * @brief 一時的電撃耐性の継続時間をセットする / Set "oppose_elec", notice observable changes
2399 * @param do_dec 現在の継続時間より長い値のみ上書きする
2400 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2402 bool set_oppose_elec(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2404 bool notice = FALSE;
2405 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2407 if (creature_ptr->is_dead) return FALSE;
2411 if (creature_ptr->oppose_elec && !do_dec)
2413 if (creature_ptr->oppose_elec > v) return FALSE;
2415 else if (!is_oppose_elec(creature_ptr))
2417 msg_print(_("電撃への耐性がついた気がする!", "You feel resistant to electricity!"));
2424 if (creature_ptr->oppose_elec && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
2426 msg_print(_("電撃への耐性が薄れた気がする。", "You feel less resistant to electricity."));
2432 creature_ptr->oppose_elec = v;
2434 /* Nothing to notice */
2435 if (!notice) return FALSE;
2436 creature_ptr->redraw |= (PR_STATUS);
2438 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2439 handle_stuff(creature_ptr);
2444 * @brief 一時的火炎耐性の継続時間をセットする / Set "oppose_fire", notice observable changes
2446 * @param do_dec 現在の継続時間より長い値のみ上書きする
2447 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2449 bool set_oppose_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2451 bool notice = FALSE;
2452 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2454 if (creature_ptr->is_dead) return FALSE;
2456 if ((PRACE_IS_(creature_ptr, RACE_DEMON) && (creature_ptr->lev > 44)) || (creature_ptr->mimic_form == MIMIC_DEMON)) v = 1;
2459 if (creature_ptr->oppose_fire && !do_dec)
2461 if (creature_ptr->oppose_fire > v) return FALSE;
2463 else if (!is_oppose_fire(creature_ptr))
2465 msg_print(_("火への耐性がついた気がする!", "You feel resistant to fire!"));
2472 if (creature_ptr->oppose_fire && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
2474 msg_print(_("火への耐性が薄れた気がする。", "You feel less resistant to fire."));
2480 creature_ptr->oppose_fire = v;
2482 /* Nothing to notice */
2483 if (!notice) return FALSE;
2484 creature_ptr->redraw |= (PR_STATUS);
2486 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2487 handle_stuff(creature_ptr);
2492 * @brief 一時的冷気耐性の継続時間をセットする / Set "oppose_cold", notice observable changes
2494 * @param do_dec 現在の継続時間より長い値のみ上書きする
2495 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2497 bool set_oppose_cold(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2499 bool notice = FALSE;
2500 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2502 if (creature_ptr->is_dead) return FALSE;
2506 if (creature_ptr->oppose_cold && !do_dec)
2508 if (creature_ptr->oppose_cold > v) return FALSE;
2510 else if (!is_oppose_cold(creature_ptr))
2512 msg_print(_("冷気への耐性がついた気がする!", "You feel resistant to cold!"));
2519 if (creature_ptr->oppose_cold && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
2521 msg_print(_("冷気への耐性が薄れた気がする。", "You feel less resistant to cold."));
2527 creature_ptr->oppose_cold = v;
2529 /* Nothing to notice */
2530 if (!notice) return FALSE;
2531 creature_ptr->redraw |= (PR_STATUS);
2533 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2534 handle_stuff(creature_ptr);
2539 * @brief 一時的毒耐性の継続時間をセットする / Set "oppose_pois", notice observable changes
2541 * @param do_dec 現在の継続時間より長い値のみ上書きする
2542 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2544 bool set_oppose_pois(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2546 bool notice = FALSE;
2547 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2549 if ((creature_ptr->pclass == CLASS_NINJA) && (creature_ptr->lev > 44)) v = 1;
2550 if (creature_ptr->is_dead) return FALSE;
2554 if (creature_ptr->oppose_pois && !do_dec)
2556 if (creature_ptr->oppose_pois > v) return FALSE;
2558 else if (!is_oppose_pois(creature_ptr))
2560 msg_print(_("毒への耐性がついた気がする!", "You feel resistant to poison!"));
2567 if (creature_ptr->oppose_pois && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
2569 msg_print(_("毒への耐性が薄れた気がする。", "You feel less resistant to poison."));
2575 creature_ptr->oppose_pois = v;
2577 /* Nothing to notice */
2578 if (!notice) return FALSE;
2579 creature_ptr->redraw |= (PR_STATUS);
2581 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2582 handle_stuff(creature_ptr);
2587 * @brief 朦朧の継続時間をセットする / Set "stun", notice observable changes
2589 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2591 * Note the special code to only notice "range" changes.
2593 bool set_stun(player_type *creature_ptr, TIME_EFFECT v)
2595 int old_aux, new_aux;
2596 bool notice = FALSE;
2597 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2599 if (creature_ptr->is_dead) return FALSE;
2600 if (PRACE_IS_(creature_ptr, RACE_GOLEM) || ((creature_ptr->pclass == CLASS_BERSERKER) && (creature_ptr->lev > 34))) v = 0;
2603 if (creature_ptr->stun > 100)
2609 else if (creature_ptr->stun > 50)
2615 else if (creature_ptr->stun > 0)
2651 if (new_aux > old_aux)
2653 /* Describe the state */
2657 case 1: msg_print(_("意識がもうろうとしてきた。", "You have been stunned.")); break;
2660 case 2: msg_print(_("意識がひどくもうろうとしてきた。", "You have been heavily stunned.")); break;
2663 case 3: msg_print(_("頭がクラクラして意識が遠のいてきた。", "You have been knocked out.")); break;
2666 if (randint1(1000) < v || one_in_(16))
2668 msg_print(_("割れるような頭痛がする。", "A vicious blow hits your head."));
2672 if (!creature_ptr->sustain_int) (void)do_dec_stat(creature_ptr, A_INT);
2673 if (!creature_ptr->sustain_wis) (void)do_dec_stat(creature_ptr, A_WIS);
2675 else if (one_in_(2))
2677 if (!creature_ptr->sustain_int) (void)do_dec_stat(creature_ptr, A_INT);
2681 if (!creature_ptr->sustain_wis) (void)do_dec_stat(creature_ptr, A_WIS);
2684 if (creature_ptr->special_defense & KATA_MASK)
2686 msg_print(_("型が崩れた。", "Your posture gets loose."));
2687 creature_ptr->special_defense &= ~(KATA_MASK);
2688 creature_ptr->update |= (PU_BONUS);
2689 creature_ptr->update |= (PU_MONSTERS);
2690 creature_ptr->redraw |= (PR_STATE);
2691 creature_ptr->redraw |= (PR_STATUS);
2692 creature_ptr->action = ACTION_NONE;
2696 if (creature_ptr->concent) reset_concentration(creature_ptr, TRUE);
2697 if (hex_spelling_any(creature_ptr)) stop_hex_spell_all(creature_ptr);
2703 else if (new_aux < old_aux)
2705 /* Describe the state */
2710 msg_print(_("やっと朦朧状態から回復した。", "You are no longer stunned."));
2712 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2720 creature_ptr->stun = v;
2723 if (!notice) return FALSE;
2725 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2726 creature_ptr->update |= (PU_BONUS);
2728 /* Redraw the "stun" */
2729 creature_ptr->redraw |= (PR_STUN);
2730 handle_stuff(creature_ptr);
2736 * @brief 出血の継続時間をセットする / Set "cut", notice observable changes
2738 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2740 * Note the special code to only notice "range" changes.
2742 bool set_cut(player_type *creature_ptr, TIME_EFFECT v)
2744 int old_aux, new_aux;
2745 bool notice = FALSE;
2746 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2748 if (creature_ptr->is_dead) return FALSE;
2750 if ((creature_ptr->prace == RACE_GOLEM ||
2751 creature_ptr->prace == RACE_SKELETON ||
2752 creature_ptr->prace == RACE_SPECTRE ||
2753 (creature_ptr->prace == RACE_ZOMBIE && creature_ptr->lev > 11)) &&
2754 !creature_ptr->mimic_form)
2758 if (creature_ptr->cut > 1000)
2764 else if (creature_ptr->cut > 200)
2770 else if (creature_ptr->cut > 100)
2776 else if (creature_ptr->cut > 50)
2782 else if (creature_ptr->cut > 25)
2788 else if (creature_ptr->cut > 10)
2794 else if (creature_ptr->cut > 0)
2854 if (new_aux > old_aux)
2856 /* Describe the state */
2860 case 1: msg_print(_("かすり傷を負ってしまった。", "You have been given a graze.")); break;
2863 case 2: msg_print(_("軽い傷を負ってしまった。", "You have been given a light cut.")); break;
2866 case 3: msg_print(_("ひどい傷を負ってしまった。", "You have been given a bad cut.")); break;
2869 case 4: msg_print(_("大変な傷を負ってしまった。", "You have been given a nasty cut.")); break;
2872 case 5: msg_print(_("重大な傷を負ってしまった。", "You have been given a severe cut.")); break;
2875 case 6: msg_print(_("ひどい深手を負ってしまった。", "You have been given a deep gash.")); break;
2878 case 7: msg_print(_("致命的な傷を負ってしまった。", "You have been given a mortal wound.")); break;
2883 if (randint1(1000) < v || one_in_(16))
2885 if (!creature_ptr->sustain_chr)
2887 msg_print(_("ひどい傷跡が残ってしまった。", "You have been horribly scarred."));
2888 do_dec_stat(creature_ptr, A_CHR);
2894 else if (new_aux < old_aux)
2896 /* Describe the state */
2901 msg_format(_("やっと%s。", "You are no longer bleeding."), creature_ptr->prace == RACE_ANDROID ? "怪我が直った" : "出血が止まった");
2903 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2911 creature_ptr->cut = v;
2914 if (!notice) return FALSE;
2916 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2917 creature_ptr->update |= (PU_BONUS);
2919 /* Redraw the "cut" */
2920 creature_ptr->redraw |= (PR_CUT);
2921 handle_stuff(creature_ptr);
2926 * @brief 空腹状態をセットする / Set "food", notice observable changes
2928 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2930 * Set "", notice observable changes\n
2932 * The "food" variable can get as large as 20000, allowing the
2933 * addition of the most "filling" item, Elvish Waybread, which adds
2934 * 7500 food units, without overflowing the 32767 maximum limit.\n
2936 * Perhaps we should disturb the player with various messages,
2937 * especially messages about hunger status changes. \n
2939 * Digestion of food is handled in "dungeon.c", in which, normally,
2940 * the player digests about 20 food units per 100 game turns, more
2941 * when "fast", more when "regenerating", less with "slow digestion",
2942 * but when the player is "gorged", he digests 100 food units per 10
2943 * game turns, or a full 1000 food units per 100 game turns.\n
2945 * Note that the player's speed is reduced by 10 units while gorged,
2946 * so if the player eats a single food ration (5000 food units) when
2947 * full (15000 food units), he will be gorged for (5000/100)*10 = 500
2948 * game turns, or 500/(100/5) = 25 player turns (if nothing else is
2949 * affecting the player speed).\n
2951 bool set_food(player_type *creature_ptr, TIME_EFFECT v)
2953 int old_aux, new_aux;
2955 bool notice = FALSE;
2956 v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
2958 /* Fainting / Starving */
2959 if (creature_ptr->food < PY_FOOD_FAINT)
2965 else if (creature_ptr->food < PY_FOOD_WEAK)
2971 else if (creature_ptr->food < PY_FOOD_ALERT)
2977 else if (creature_ptr->food < PY_FOOD_FULL)
2983 else if (creature_ptr->food < PY_FOOD_MAX)
2994 /* Fainting / Starving */
2995 if (v < PY_FOOD_FAINT)
3001 else if (v < PY_FOOD_WEAK)
3007 else if (v < PY_FOOD_ALERT)
3013 else if (v < PY_FOOD_FULL)
3019 else if (v < PY_FOOD_MAX)
3030 if (old_aux < 1 && new_aux > 0)
3031 chg_virtue(creature_ptr, V_PATIENCE, 2);
3032 else if (old_aux < 3 && (old_aux != new_aux))
3033 chg_virtue(creature_ptr, V_PATIENCE, 1);
3035 chg_virtue(creature_ptr, V_TEMPERANCE, 1);
3037 chg_virtue(creature_ptr, V_TEMPERANCE, -1);
3040 if (new_aux > old_aux)
3042 /* Describe the state */
3046 case 1: msg_print(_("まだ空腹で倒れそうだ。", "You are still weak.")); break;
3049 case 2: msg_print(_("まだ空腹だ。", "You are still hungry.")); break;
3052 case 3: msg_print(_("空腹感がおさまった。", "You are no longer hungry.")); break;
3055 case 4: msg_print(_("満腹だ!", "You are full!")); break;
3059 msg_print(_("食べ過ぎだ!", "You have gorged yourself!"));
3060 chg_virtue(creature_ptr, V_HARMONY, -1);
3061 chg_virtue(creature_ptr, V_PATIENCE, -1);
3062 chg_virtue(creature_ptr, V_TEMPERANCE, -2);
3072 else if (new_aux < old_aux)
3074 /* Describe the state */
3077 /* Fainting / Starving */
3078 case 0: msg_print(_("あまりにも空腹で気を失ってしまった!", "You are getting faint from hunger!")); break;
3081 case 1: msg_print(_("お腹が空いて倒れそうだ。", "You are getting weak from hunger!")); break;
3084 case 2: msg_print(_("お腹が空いてきた。", "You are getting hungry.")); break;
3087 case 3: msg_print(_("満腹感がなくなった。", "You are no longer full.")); break;
3090 case 4: msg_print(_("やっとお腹がきつくなくなった。", "You are no longer gorged.")); break;
3093 if (creature_ptr->wild_mode && (new_aux < 2))
3095 change_wild_mode(creature_ptr, FALSE);
3103 creature_ptr->food = v;
3105 /* Nothing to notice */
3106 if (!notice) return FALSE;
3108 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
3109 creature_ptr->update |= (PU_BONUS);
3112 creature_ptr->redraw |= (PR_HUNGER);
3113 handle_stuff(creature_ptr);
3118 * @brief プレイヤーの基本能力値を増加させる / Increases a stat by one randomized level -RAK-
3119 * @param stat 上昇させるステータスID
3120 * @return 実際に上昇した場合TRUEを返す。
3122 * Note that this function (used by stat potions) now restores\n
3123 * the stat BEFORE increasing it.\n
3125 bool inc_stat(player_type *creature_ptr, int stat)
3127 BASE_STATUS value, gain;
3129 /* Then augment the current/max stat */
3130 value = creature_ptr->stat_cur[stat];
3132 /* Cannot go above 18/100 */
3133 if (value < creature_ptr->stat_max_max[stat])
3135 /* Gain one (sometimes two) points */
3138 gain = ((randint0(100) < 75) ? 1 : 2);
3142 /* Gain 1/6 to 1/3 of distance to 18/100 */
3143 else if (value < (creature_ptr->stat_max_max[stat]-2))
3145 /* Approximate gain value */
3146 gain = (((creature_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
3147 if (gain < 1) gain = 1;
3149 /* Apply the bonus */
3150 value += randint1(gain) + gain / 2;
3153 if (value > (creature_ptr->stat_max_max[stat]-1)) value = creature_ptr->stat_max_max[stat]-1;
3156 /* Gain one point at a time */
3162 /* Save the new value */
3163 creature_ptr->stat_cur[stat] = value;
3165 /* Bring up the maximum too */
3166 if (value > creature_ptr->stat_max[stat])
3168 creature_ptr->stat_max[stat] = value;
3170 creature_ptr->update |= (PU_BONUS);
3176 /* Nothing to gain */
3181 * @brief プレイヤーの基本能力値を減少させる / Decreases a stat by an amount indended to vary from 0 to 100 percent.
3182 * @param stat 減少させるステータスID
3183 * @param amount 減少させる基本量
3184 * @param permanent TRUEならば現在の最大値を減少させる
3185 * @return 実際に減少した場合TRUEを返す。
3188 * Amount could be a little higher in extreme cases to mangle very high\n
3189 * stats from massive assaults. -CWS\n
3191 * Note that "permanent" means that the *given* amount is permanent,\n
3192 * not that the new value becomes permanent. This may not work exactly\n
3193 * as expected, due to "weirdness" in the algorithm, but in general,\n
3194 * if your stat is already drained, the "max" value will not drop all\n
3195 * the way down to the "cur" value.\n
3197 bool dec_stat(player_type *creature_ptr, int stat, int amount, int permanent)
3199 BASE_STATUS cur, max;
3203 /* Acquire current value */
3204 cur = creature_ptr->stat_cur[stat];
3205 max = creature_ptr->stat_max[stat];
3207 /* Note when the values are identical */
3208 same = (cur == max);
3210 /* Damage "current" value */
3213 /* Handle "low" values */
3216 if (amount > 90) cur--;
3217 if (amount > 50) cur--;
3218 if (amount > 20) cur--;
3222 /* Handle "high" values */
3225 /* Hack -- Decrement by a random amount between one-quarter */
3226 /* and one-half of the stat bonus times the percentage, with a */
3227 /* minimum damage of half the percentage. -CWS */
3228 loss = (((cur-18) / 2 + 1) / 2 + 1);
3229 if (loss < 1) loss = 1;
3231 /* Randomize the loss */
3232 loss = ((randint1(loss) + loss) * amount) / 100;
3235 if (loss < amount/2) loss = amount/2;
3237 /* Lose some points */
3240 /* Hack -- Only reduce stat to 17 sometimes */
3241 if (cur < 18) cur = (amount <= 20) ? 18 : 17;
3244 /* Prevent illegal values */
3245 if (cur < 3) cur = 3;
3247 /* Something happened */
3248 if (cur != creature_ptr->stat_cur[stat]) res = TRUE;
3251 /* Damage "max" value */
3252 if (permanent && (max > 3))
3254 chg_virtue(creature_ptr, V_SACRIFICE, 1);
3255 if (stat == A_WIS || stat == A_INT)
3256 chg_virtue(creature_ptr, V_ENLIGHTEN, -2);
3258 /* Handle "low" values */
3261 if (amount > 90) max--;
3262 if (amount > 50) max--;
3263 if (amount > 20) max--;
3267 /* Handle "high" values */
3270 /* Hack -- Decrement by a random amount between one-quarter */
3271 /* and one-half of the stat bonus times the percentage, with a */
3272 /* minimum damage of half the percentage. -CWS */
3273 loss = (((max-18) / 2 + 1) / 2 + 1);
3274 loss = ((randint1(loss) + loss) * amount) / 100;
3275 if (loss < amount/2) loss = amount/2;
3277 /* Lose some points */
3280 /* Hack -- Only reduce stat to 17 sometimes */
3281 if (max < 18) max = (amount <= 20) ? 18 : 17;
3284 /* Hack -- keep it clean */
3285 if (same || (max < cur)) max = cur;
3287 /* Something happened */
3288 if (max != creature_ptr->stat_max[stat]) res = TRUE;
3293 /* Actually set the stat to its new value. */
3294 creature_ptr->stat_cur[stat] = cur;
3295 creature_ptr->stat_max[stat] = max;
3297 creature_ptr->redraw |= (PR_STATS);
3298 creature_ptr->update |= (PU_BONUS);
3306 * @brief プレイヤーの基本能力値を回復させる / Restore a stat. Return TRUE only if this actually makes a difference.
3307 * @param stat 回復ステータスID
3308 * @return 実際に回復した場合TRUEを返す。
3310 bool res_stat(player_type *creature_ptr, int stat)
3312 /* Restore if needed */
3313 if (creature_ptr->stat_cur[stat] != creature_ptr->stat_max[stat])
3315 creature_ptr->stat_cur[stat] = creature_ptr->stat_max[stat];
3316 creature_ptr->update |= (PU_BONUS);
3317 creature_ptr->redraw |= (PR_STATS);
3323 /* Nothing to restore */
3329 * Increase players hit points, notice effects
3331 bool hp_player(player_type *creature_ptr, int num)
3334 vir = virtue_number(creature_ptr, V_VITALITY);
3336 if(num <= 0) return FALSE;
3340 num = num * (creature_ptr->virtues[vir - 1] + 1250) / 1250;
3342 /* Healing needed */
3343 if (creature_ptr->chp < creature_ptr->mhp)
3345 if ((num > 0) && (creature_ptr->chp < (creature_ptr->mhp/3)))
3346 chg_virtue(creature_ptr, V_TEMPERANCE, 1);
3347 /* Gain hitpoints */
3348 creature_ptr->chp += num;
3350 /* Enforce maximum */
3351 if (creature_ptr->chp >= creature_ptr->mhp)
3353 creature_ptr->chp = creature_ptr->mhp;
3354 creature_ptr->chp_frac = 0;
3357 creature_ptr->redraw |= (PR_HP);
3359 creature_ptr->window |= (PW_PLAYER);
3364 msg_print(_("少し気分が良くなった。", "You feel a little better."));
3370 msg_print(_("気分が良くなった。", "You feel better."));
3376 msg_print(_("とても気分が良くなった。", "You feel much better."));
3382 msg_print(_("ひじょうに気分が良くなった。", "You feel very good."));
3394 * Array of stat "descriptions"
3396 static concptr desc_stat_pos[] =
3398 _("強く", "stronger"),
3399 _("知的に", "smarter"),
3401 _("器用に", "more dextrous"),
3402 _("健康に", "healthier"),
3407 * Array of stat "descriptions"
3409 static concptr desc_stat_neg[] =
3412 _("無知に", "stupider"),
3413 _("愚かに", "more naive"),
3414 _("不器用に", "clumsier"),
3415 _("不健康に", "more sickly"),
3423 bool do_dec_stat(player_type *creature_ptr, int stat)
3427 /* Access the "sustain" */
3430 case A_STR: if (creature_ptr->sustain_str) sust = TRUE; break;
3431 case A_INT: if (creature_ptr->sustain_int) sust = TRUE; break;
3432 case A_WIS: if (creature_ptr->sustain_wis) sust = TRUE; break;
3433 case A_DEX: if (creature_ptr->sustain_dex) sust = TRUE; break;
3434 case A_CON: if (creature_ptr->sustain_con) sust = TRUE; break;
3435 case A_CHR: if (creature_ptr->sustain_chr) sust = TRUE; break;
3439 if (sust && (!ironman_nightmare || randint0(13)))
3441 msg_format(_("%sなった気がしたが、すぐに元に戻った。", "You feel %s for a moment, but the feeling passes."),
3442 desc_stat_neg[stat]);
3448 /* Attempt to reduce the stat */
3449 if (dec_stat(creature_ptr, stat, 10, (ironman_nightmare && !randint0(13))))
3451 msg_format(_("ひどく%sなった気がする。", "You feel %s."), desc_stat_neg[stat]);
3457 /* Nothing obvious */
3463 * Restore lost "points" in a stat
3465 bool do_res_stat(player_type *creature_ptr, int stat)
3467 /* Attempt to increase */
3468 if (res_stat(creature_ptr, stat))
3470 msg_format(_("元通りに%sなった気がする。", "You feel %s."), desc_stat_pos[stat]);
3474 /* Nothing obvious */
3480 * Gain a "point" in a stat
3482 bool do_inc_stat(player_type *creature_ptr, int stat)
3486 /* Restore strength */
3487 res = res_stat(creature_ptr, stat);
3489 /* Attempt to increase */
3490 if (inc_stat(creature_ptr, stat))
3494 chg_virtue(creature_ptr, V_ENLIGHTEN, 1);
3495 chg_virtue(creature_ptr, V_FAITH, 1);
3497 else if (stat == A_INT)
3499 chg_virtue(creature_ptr, V_KNOWLEDGE, 1);
3500 chg_virtue(creature_ptr, V_ENLIGHTEN, 1);
3502 else if (stat == A_CON)
3503 chg_virtue(creature_ptr, V_VITALITY, 1);
3505 msg_format(_("ワーオ!とても%sなった!", "Wow! You feel %s!"), desc_stat_pos[stat]);
3510 /* Restoration worked */
3513 msg_format(_("元通りに%sなった気がする。", "You feel %s."), desc_stat_pos[stat]);
3518 /* Nothing obvious */
3524 * Restores any drained experience
3526 bool restore_level(player_type *creature_ptr)
3528 /* Restore experience */
3529 if (creature_ptr->exp < creature_ptr->max_exp)
3531 msg_print(_("経験値が戻ってきた気がする。", "You feel your experience returning."));
3533 /* Restore the experience */
3534 creature_ptr->exp = creature_ptr->max_exp;
3536 /* Check the experience */
3537 check_experience(creature_ptr);
3550 bool lose_all_info(player_type *creature_ptr)
3554 chg_virtue(creature_ptr, V_KNOWLEDGE, -5);
3555 chg_virtue(creature_ptr, V_ENLIGHTEN, -5);
3557 /* Forget info about objects */
3558 for (i = 0; i < INVEN_TOTAL; i++)
3560 object_type *o_ptr = &creature_ptr->inventory_list[i];
3561 if (!o_ptr->k_idx) continue;
3563 /* Allow "protection" by the MENTAL flag */
3564 if (o_ptr->ident & (IDENT_MENTAL)) continue;
3566 /* Remove "default inscriptions" */
3567 o_ptr->feeling = FEEL_NONE;
3569 /* Hack -- Clear the "empty" flag */
3570 o_ptr->ident &= ~(IDENT_EMPTY);
3572 /* Hack -- Clear the "known" flag */
3573 o_ptr->ident &= ~(IDENT_KNOWN);
3575 /* Hack -- Clear the "felt" flag */
3576 o_ptr->ident &= ~(IDENT_SENSE);
3578 creature_ptr->update |= (PU_BONUS);
3579 creature_ptr->update |= (PU_COMBINE | PU_REORDER);
3581 creature_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3583 /* Mega-Hack -- Forget the map */
3584 wiz_dark(creature_ptr);
3591 void do_poly_wounds(player_type *creature_ptr)
3593 /* Changed to always provide at least _some_ healing */
3594 s16b wounds = creature_ptr->cut;
3595 s16b hit_p = (creature_ptr->mhp - creature_ptr->chp);
3596 s16b change = damroll(creature_ptr->lev, 5);
3597 bool Nasty_effect = one_in_(5);
3599 if (!(wounds || hit_p || Nasty_effect)) return;
3601 msg_print(_("傷がより軽いものに変化した。", "Your wounds are polymorphed into less serious ones."));
3602 hp_player(creature_ptr, change);
3605 msg_print(_("新たな傷ができた!", "A new wound was created!"));
3606 take_hit(creature_ptr, DAMAGE_LOSELIFE, change / 2, _("変化した傷", "a polymorphed wound"), -1);
3607 set_cut(creature_ptr,change);
3611 set_cut(creature_ptr,creature_ptr->cut - (change / 2));
3617 * Change player race
3619 void change_race(player_type *creature_ptr, CHARACTER_IDX new_race, concptr effect_msg)
3621 concptr title = race_info[new_race].title;
3622 int old_race = creature_ptr->prace;
3625 msg_format("あなたは%s%sに変化した!", effect_msg, title);
3627 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);
3630 chg_virtue(creature_ptr, V_CHANCE, 2);
3632 if (creature_ptr->prace < 32)
3634 creature_ptr->old_race1 |= 1L << creature_ptr->prace;
3638 creature_ptr->old_race2 |= 1L << (creature_ptr->prace - 32);
3640 creature_ptr->prace = new_race;
3641 rp_ptr = &race_info[creature_ptr->prace];
3643 /* Experience factor */
3644 creature_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
3647 * The speed bonus of Klackons and Sprites are disabled
3648 * and the experience penalty is decreased.
3650 if (((creature_ptr->pclass == CLASS_MONK) || (creature_ptr->pclass == CLASS_FORCETRAINER) || (creature_ptr->pclass == CLASS_NINJA)) && ((creature_ptr->prace == RACE_KLACKON) || (creature_ptr->prace == RACE_SPRITE)))
3651 creature_ptr->expfact -= 15;
3653 /* Get character's height and weight */
3654 get_height_weight(creature_ptr);
3657 if (creature_ptr->pclass == CLASS_SORCERER)
3658 creature_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
3660 creature_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
3662 roll_hitdice(creature_ptr, 0L);
3664 /* The experience level may be modified */
3665 check_experience(creature_ptr);
3667 creature_ptr->redraw |= (PR_BASIC);
3669 creature_ptr->update |= (PU_BONUS);
3671 handle_stuff(creature_ptr);
3673 /* Load an autopick preference file */
3674 if (old_race != creature_ptr->prace) autopick_load_pref(creature_ptr, FALSE);
3676 /* Player's graphic tile may change */
3677 lite_spot(creature_ptr, creature_ptr->y, creature_ptr->x);
3681 void do_poly_self(player_type *creature_ptr)
3683 int power = creature_ptr->lev;
3685 msg_print(_("あなたは変化の訪れを感じた...", "You feel a change coming over you..."));
3686 chg_virtue(creature_ptr, V_CHANCE, 1);
3688 if ((power > randint0(20)) && one_in_(3) && (creature_ptr->prace != RACE_ANDROID))
3690 char effect_msg[80] = "";
3691 CHARACTER_IDX new_race;
3693 /* Some form of racial polymorph... */
3696 if ((power > randint0(5)) && one_in_(4))
3701 if (creature_ptr->psex == SEX_MALE)
3703 creature_ptr->psex = SEX_FEMALE;
3704 sp_ptr = &sex_info[creature_ptr->psex];
3705 sprintf(effect_msg, _("女性の", "female "));
3709 creature_ptr->psex = SEX_MALE;
3710 sp_ptr = &sex_info[creature_ptr->psex];
3711 sprintf(effect_msg, _("男性の", "male "));
3715 if ((power > randint0(30)) && one_in_(5))
3719 /* Harmful deformity */
3726 (void)dec_stat(creature_ptr, tmp, randint1(6) + 6, one_in_(3));
3732 /* Deformities are discriminated against! */
3733 (void)dec_stat(creature_ptr, A_CHR, randint1(6), TRUE);
3738 sprintf(tmp_msg,_("%s", "%s "),effect_msg);
3739 sprintf(effect_msg,_("奇形の%s", "deformed %s "),tmp_msg);
3743 sprintf(effect_msg,_("奇形の", "deformed "));
3747 while ((power > randint0(20)) && one_in_(10))
3749 /* Polymorph into a less mutated form */
3752 if (!lose_mutation(creature_ptr, 0))
3753 msg_print(_("奇妙なくらい普通になった気がする。", "You feel oddly normal."));
3758 new_race = (CHARACTER_IDX)randint0(MAX_RACES);
3760 while ((new_race == creature_ptr->prace) || (new_race == RACE_ANDROID));
3762 change_race(creature_ptr, new_race, effect_msg);
3765 if ((power > randint0(30)) && one_in_(6))
3771 msg_format(_("%sの構成が変化した!", "Your internal organs are rearranged!"), creature_ptr->prace == RACE_ANDROID ? "機械" : "内臓");
3775 (void)dec_stat(creature_ptr, tmp, randint1(6) + 6, one_in_(3));
3780 msg_print(_("現在の姿で生きていくのは困難なようだ!", "You find living difficult in your present form!"));
3781 take_hit(creature_ptr, DAMAGE_LOSELIFE, damroll(randint1(10), creature_ptr->lev), _("致命的な突然変異", "a lethal mutation"), -1);
3787 if ((power > randint0(20)) && one_in_(4))
3791 get_max_stats(creature_ptr);
3792 roll_hitdice(creature_ptr, 0L);
3795 while ((power > randint0(15)) && one_in_(3))
3798 (void)gain_mutation(creature_ptr, 0);
3801 if (power > randint0(5))
3804 do_poly_wounds(creature_ptr);
3807 /* Note: earlier deductions may have left power < 0 already. */
3810 status_shuffle(creature_ptr);
3818 void gain_exp_64(player_type *creature_ptr, s32b amount, u32b amount_frac)
3820 if (creature_ptr->is_dead) return;
3822 if (creature_ptr->prace == RACE_ANDROID) return;
3824 /* Gain some experience */
3825 s64b_add(&(creature_ptr->exp), &(creature_ptr->exp_frac), amount, amount_frac);
3827 /* Slowly recover from experience drainage */
3828 if (creature_ptr->exp < creature_ptr->max_exp)
3830 /* Gain max experience (20%) (was 10%) */
3831 creature_ptr->max_exp += amount / 5;
3834 check_experience(creature_ptr);
3841 void gain_exp(player_type *creature_ptr, s32b amount)
3843 gain_exp_64(creature_ptr, amount, 0L);
3847 void calc_android_exp(player_type *creature_ptr)
3851 if (creature_ptr->is_dead) return;
3853 if (creature_ptr->prace != RACE_ANDROID) return;
3855 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
3857 object_type *o_ptr = &creature_ptr->inventory_list[i];
3859 object_type *q_ptr = &forge;
3861 DEPTH level = MAX(k_info[o_ptr->k_idx].level - 8, 1);
3863 if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue;
3864 if (!o_ptr->k_idx) continue;
3867 object_copy(q_ptr, o_ptr);
3868 q_ptr->discount = 0;
3869 q_ptr->curse_flags = 0L;
3871 if (object_is_fixed_artifact(o_ptr))
3873 level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
3874 level += MIN(20, a_info[o_ptr->name1].rarity/(a_info[o_ptr->name1].gen_flags & TRG_INSTA_ART ? 10 : 3));
3876 else if (object_is_ego(o_ptr))
3878 level += MAX(3, (e_info[o_ptr->name2].rating - 5)/2);
3880 else if (o_ptr->art_name)
3882 s32b total_flags = flag_cost(o_ptr, o_ptr->pval);
3885 if (!object_is_weapon_ammo(o_ptr))
3888 if (total_flags < 15000) fake_level = 10;
3889 else if (total_flags < 35000) fake_level = 25;
3890 else fake_level = 40;
3895 if (total_flags < 20000) fake_level = 10;
3896 else if (total_flags < 45000) fake_level = 25;
3897 else fake_level = 40;
3900 level = MAX(level, (level + MAX(fake_level - 8, 5)) / 2 + 3);
3903 value = object_value_real(q_ptr);
3905 if (value <= 0) continue;
3906 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (creature_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
3907 if (value > 5000000L) value = 5000000L;
3908 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
3910 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr) ||
3911 (o_ptr->tval == TV_DRAG_ARMOR) ||
3912 ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) ||
3913 ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) ||
3914 ((o_ptr->tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)) ||
3915 ((o_ptr->tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) ||
3916 ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE)))
3918 if (level > 65) level = 35 + (level - 65) / 5;
3919 else if (level > 35) level = 25 + (level - 35) / 3;
3920 else if (level > 15) level = 15 + (level - 15) / 2;
3921 exp = MIN(100000L, value) / 2 * level * level;
3922 if (value > 100000L)
3923 exp += (value - 100000L) / 8 * level * level;
3927 exp = MIN(100000L, value) * level;
3928 if (value > 100000L)
3929 exp += (value - 100000L) / 4 * level;
3931 if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(creature_ptr, i))) || (i == INVEN_BOW)) total_exp += exp / 48;
3932 else total_exp += exp / 16;
3933 if (i == INVEN_BODY) total_exp += exp / 32;
3935 creature_ptr->exp = creature_ptr->max_exp = total_exp;
3936 check_experience(creature_ptr);
3943 void lose_exp(player_type *creature_ptr, s32b amount)
3945 if (creature_ptr->prace == RACE_ANDROID) return;
3946 if (amount > creature_ptr->exp) amount = creature_ptr->exp;
3948 creature_ptr->exp -= amount;
3950 check_experience(creature_ptr);
3956 * If resisted to draining, return FALSE
3958 bool drain_exp(player_type *creature_ptr, s32b drain, s32b slip, int hold_exp_prob)
3960 /* Androids and their mimics are never drained */
3961 if (creature_ptr->prace == RACE_ANDROID) return FALSE;
3963 if (creature_ptr->hold_exp && (randint0(100) < hold_exp_prob))
3965 /* Hold experience */
3966 msg_print(_("しかし自己の経験値を守りきった!", "You keep hold of your experience!"));
3970 /* Hold experience failed */
3971 if (creature_ptr->hold_exp)
3973 msg_print(_("経験値を少し吸い取られた気がする!", "You feel your experience slipping away!"));
3974 lose_exp(creature_ptr, slip);
3978 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away!"));
3979 lose_exp(creature_ptr, drain);
3986 bool set_ultimate_res(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
3988 bool notice = FALSE;
3989 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3991 if (creature_ptr->is_dead) return FALSE;
3995 if (creature_ptr->ult_res && !do_dec)
3997 if (creature_ptr->ult_res > v) return FALSE;
3999 else if (!creature_ptr->ult_res)
4001 msg_print(_("あらゆることに対して耐性がついた気がする!", "You feel resistant!"));
4008 if (creature_ptr->ult_res)
4010 msg_print(_("あらゆることに対する耐性が薄れた気がする。", "You feel less resistant"));
4016 creature_ptr->ult_res = v;
4017 creature_ptr->redraw |= (PR_STATUS);
4019 /* Nothing to notice */
4020 if (!notice) return FALSE;
4022 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
4023 creature_ptr->update |= (PU_BONUS);
4024 handle_stuff(creature_ptr);
4028 bool set_tim_res_nether(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
4030 bool notice = FALSE;
4031 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
4033 if (creature_ptr->is_dead) return FALSE;
4037 if (creature_ptr->tim_res_nether && !do_dec)
4039 if (creature_ptr->tim_res_nether > v) return FALSE;
4041 else if (!creature_ptr->tim_res_nether)
4043 msg_print(_("地獄の力に対して耐性がついた気がする!", "You feel nether resistant!"));
4050 if (creature_ptr->tim_res_nether)
4052 msg_print(_("地獄の力に対する耐性が薄れた気がする。", "You feel less nether resistant"));
4058 creature_ptr->tim_res_nether = v;
4059 creature_ptr->redraw |= (PR_STATUS);
4061 /* Nothing to notice */
4062 if (!notice) return FALSE;
4064 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
4065 creature_ptr->update |= (PU_BONUS);
4066 handle_stuff(creature_ptr);
4070 bool set_tim_res_time(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
4072 bool notice = FALSE;
4073 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
4075 if (creature_ptr->is_dead) return FALSE;
4079 if (creature_ptr->tim_res_time && !do_dec)
4081 if (creature_ptr->tim_res_time > v) return FALSE;
4083 else if (!creature_ptr->tim_res_time)
4085 msg_print(_("時間逆転の力に対して耐性がついた気がする!", "You feel time resistant!"));
4092 if (creature_ptr->tim_res_time)
4094 msg_print(_("時間逆転の力に対する耐性が薄れた気がする。", "You feel less time resistant"));
4100 creature_ptr->tim_res_time = v;
4101 creature_ptr->redraw |= (PR_STATUS);
4103 /* Nothing to notice */
4104 if (!notice) return FALSE;
4106 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
4107 creature_ptr->update |= (PU_BONUS);
4108 handle_stuff(creature_ptr);
4114 * Choose a warrior-mage elemental attack. -LM-
4116 bool choose_ele_attack(player_type *creature_ptr)
4122 if (!has_melee_weapon(creature_ptr, INVEN_RARM) && !has_melee_weapon(creature_ptr, INVEN_LARM))
4124 msg_format(_("武器を持たないと魔法剣は使えない。", "You cannot use temporary branding with no weapon."));
4129 num = (creature_ptr->lev - 20) / 5;
4130 c_prt(TERM_RED, _(" a) 焼棄", " a) Fire Brand"), 2, 14);
4133 c_prt(TERM_L_WHITE,_(" b) 凍結", " b) Cold Brand"), 3, 14);
4138 c_prt(TERM_GREEN, _(" c) 毒殺", " c) Poison Brand"), 4, 14);
4143 c_prt(TERM_L_DARK, _(" d) 溶解", " d) Acid Brand"), 5, 14);
4148 c_prt(TERM_BLUE, _(" e) 電撃", " e) Elec Brand"), 6, 14);
4157 prt(_(" どの元素攻撃をしますか?", " Choose a temporary elemental brand "), 1, 14);
4161 if ((choice == 'a') || (choice == 'A'))
4162 set_ele_attack(creature_ptr, ATTACK_FIRE, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
4163 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
4164 set_ele_attack(creature_ptr, ATTACK_COLD, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
4165 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
4166 set_ele_attack(creature_ptr, ATTACK_POIS, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
4167 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
4168 set_ele_attack(creature_ptr, ATTACK_ACID, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
4169 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
4170 set_ele_attack(creature_ptr, ATTACK_ELEC, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
4173 msg_print(_("魔法剣を使うのをやめた。", "You cancel the temporary branding."));
4183 * Choose a elemental immune. -LM-
4185 bool choose_ele_immune(player_type *creature_ptr, TIME_EFFECT immune_turn)
4190 c_prt(TERM_RED, _(" a) 火炎", " a) Immunity to fire"), 2, 14);
4191 c_prt(TERM_L_WHITE,_(" b) 冷気", " b) Immunity to cold"), 3, 14);
4192 c_prt(TERM_L_DARK, _(" c) 酸", " c) Immunity to acid"), 4, 14);
4193 c_prt(TERM_BLUE, _(" d) 電撃", " d) Immunity to elec"), 5, 14);
4201 prt(_(" どの元素の免疫をつけますか?", " Choose a temporary elemental immunity "), 1, 14);
4205 if ((choice == 'a') || (choice == 'A'))
4206 set_ele_immune(creature_ptr, DEFENSE_FIRE, immune_turn);
4207 else if ((choice == 'b') || (choice == 'B'))
4208 set_ele_immune(creature_ptr, DEFENSE_COLD, immune_turn);
4209 else if ((choice == 'c') || (choice == 'C'))
4210 set_ele_immune(creature_ptr, DEFENSE_ACID, immune_turn);
4211 else if ((choice == 'd') || (choice == 'D'))
4212 set_ele_immune(creature_ptr, DEFENSE_ELEC, immune_turn);
4215 msg_print(_("免疫を付けるのをやめた。", "You cancel the temporary immunity."));