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 special stance."));
134 creature_ptr->special_defense &= ~(KAMAE_MASK);
139 msg_print(_("型を崩した。", "You stop assuming the special stance."));
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 casting."));
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);
307 (void)set_tim_reflect(creature_ptr, 0,TRUE);
308 (void)set_multishadow(creature_ptr, 0,TRUE);
309 (void)set_dustrobe(creature_ptr, 0,TRUE);
311 (void)set_tim_invis(creature_ptr, 0, TRUE);
312 (void)set_tim_infra(creature_ptr, 0, TRUE);
313 (void)set_tim_esp(creature_ptr, 0, TRUE);
314 (void)set_tim_regen(creature_ptr, 0, TRUE);
315 (void)set_tim_stealth(creature_ptr, 0, TRUE);
316 (void)set_tim_levitation(creature_ptr, 0, TRUE);
317 (void)set_tim_sh_touki(creature_ptr, 0, TRUE);
318 (void)set_tim_sh_fire(creature_ptr, 0, TRUE);
319 (void)set_tim_sh_holy(creature_ptr, 0, TRUE);
320 (void)set_tim_eyeeye(creature_ptr, 0, TRUE);
321 (void)set_magicdef(creature_ptr, 0, TRUE);
322 (void)set_resist_magic(creature_ptr, 0, TRUE);
323 (void)set_oppose_acid(creature_ptr, 0, TRUE);
324 (void)set_oppose_elec(creature_ptr, 0, TRUE);
325 (void)set_oppose_fire(creature_ptr, 0, TRUE);
326 (void)set_oppose_cold(creature_ptr, 0, TRUE);
327 (void)set_oppose_pois(creature_ptr, 0, TRUE);
328 (void)set_ultimate_res(creature_ptr, 0, TRUE);
329 (void)set_mimic(creature_ptr, 0, 0, TRUE);
330 (void)set_ele_attack(creature_ptr, 0, 0);
331 (void)set_ele_immune(creature_ptr, 0, 0);
333 if (creature_ptr->special_attack & ATTACK_CONFUSE)
335 creature_ptr->special_attack &= ~(ATTACK_CONFUSE);
336 msg_print(_("手の輝きがなくなった。", "Your hands stop glowing."));
339 if (music_singing_any(creature_ptr) || hex_spelling_any(creature_ptr))
341 concptr str = (music_singing_any(creature_ptr)) ? _("歌", "singing") : _("呪文", "casting");
342 INTERUPTING_SONG_EFFECT(creature_ptr) = SINGING_SONG_EFFECT(creature_ptr);
343 SINGING_SONG_EFFECT(creature_ptr) = MUSIC_NONE;
344 msg_format(_("%sが途切れた。", "Your %s is interrupted."), str);
346 creature_ptr->action = ACTION_NONE;
347 creature_ptr->update |= (PU_BONUS | PU_HP | PU_MONSTERS);
348 creature_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
349 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
350 creature_ptr->energy_need += ENERGY_NEED();
356 * @brief 変身効果の継続時間と変身先をセットする / Set "tim_mimic", and "mimic_form", notice observable changes
359 * @param do_dec 現在の継続時間より長い値のみ上書きする
360 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
362 bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, MIMIC_RACE_IDX p, bool do_dec)
365 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
367 if (creature_ptr->is_dead) return FALSE;
371 if (creature_ptr->tim_mimic && (creature_ptr->mimic_form == p) && !do_dec)
373 if (creature_ptr->tim_mimic > v) return FALSE;
375 else if ((!creature_ptr->tim_mimic) || (creature_ptr->mimic_form != p))
377 msg_print(_("自分の体が変わってゆくのを感じた。", "You feel that your body changes."));
378 creature_ptr->mimic_form = p;
385 if (creature_ptr->tim_mimic)
387 msg_print(_("変身が解けた。", "You are no longer transformed."));
388 if (creature_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(creature_ptr, 0, TRUE);
389 creature_ptr->mimic_form=0;
395 creature_ptr->tim_mimic = v;
396 if (!notice) return FALSE;
398 if (disturb_state) disturb(creature_ptr, FALSE, TRUE);
400 creature_ptr->redraw |= (PR_BASIC | PR_STATUS);
401 creature_ptr->update |= (PU_BONUS | PU_HP);
403 handle_stuff(creature_ptr);
408 * @brief 盲目の継続時間をセットする / Set "blind", notice observable changes
410 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
412 * Note the use of "PU_UN_LITE" and "PU_UN_VIEW", which is needed to\n
413 * memorize any terrain features which suddenly become "visible".\n
414 * Note that blindness is currently the only thing which can affect\n
415 * "player_can_see_bold()".\n
417 bool set_blind(player_type *creature_ptr, TIME_EFFECT v)
420 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
422 if (creature_ptr->is_dead) return FALSE;
426 if (!creature_ptr->blind)
428 if (creature_ptr->prace == RACE_ANDROID)
430 msg_print(_("センサーをやられた!", "You are blind!"));
434 msg_print(_("目が見えなくなってしまった!", "You are blind!"));
438 chg_virtue(creature_ptr, V_ENLIGHTEN, -1);
444 if (creature_ptr->blind)
446 if (creature_ptr->prace == RACE_ANDROID)
448 msg_print(_("センサーが復旧した。", "You can see again."));
452 msg_print(_("やっと目が見えるようになった。", "You can see again."));
459 creature_ptr->blind = v;
460 creature_ptr->redraw |= (PR_STATUS);
461 if (!notice) return FALSE;
462 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
464 creature_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
465 creature_ptr->redraw |= (PR_MAP);
466 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
467 handle_stuff(creature_ptr);
473 * @brief 混乱の継続時間をセットする / Set "confused", notice observable changes
475 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
477 bool set_confused(player_type *creature_ptr, TIME_EFFECT v)
480 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
482 if (creature_ptr->is_dead) return FALSE;
486 if (!creature_ptr->confused)
488 msg_print(_("あなたは混乱した!", "You are confused!"));
490 if (creature_ptr->action == ACTION_LEARN)
492 msg_print(_("学習が続けられない!", "You cannot continue learning!"));
493 creature_ptr->new_mane = FALSE;
495 creature_ptr->redraw |= (PR_STATE);
496 creature_ptr->action = ACTION_NONE;
498 if (creature_ptr->action == ACTION_KAMAE)
500 msg_print(_("構えがとけた。", "You lose your stance."));
501 creature_ptr->special_defense &= ~(KAMAE_MASK);
502 creature_ptr->update |= (PU_BONUS);
503 creature_ptr->redraw |= (PR_STATE);
504 creature_ptr->action = ACTION_NONE;
506 else if (creature_ptr->action == ACTION_KATA)
508 msg_print(_("型が崩れた。", "You lose your stance."));
509 creature_ptr->special_defense &= ~(KATA_MASK);
510 creature_ptr->update |= (PU_BONUS);
511 creature_ptr->update |= (PU_MONSTERS);
512 creature_ptr->redraw |= (PR_STATE);
513 creature_ptr->redraw |= (PR_STATUS);
514 creature_ptr->action = ACTION_NONE;
518 if (creature_ptr->concent) reset_concentration(creature_ptr, TRUE);
520 if (hex_spelling_any(creature_ptr)) stop_hex_spell_all(creature_ptr);
523 creature_ptr->counter = FALSE;
524 chg_virtue(creature_ptr, V_HARMONY, -1);
529 if (creature_ptr->confused)
531 msg_print(_("やっと混乱がおさまった。", "You feel less confused now."));
532 creature_ptr->special_attack &= ~(ATTACK_SUIKEN);
537 creature_ptr->confused = v;
538 creature_ptr->redraw |= (PR_STATUS);
540 if (!notice) return FALSE;
542 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
543 handle_stuff(creature_ptr);
549 * @brief 毒の継続時間をセットする / Set "poisoned", notice observable changes
551 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
553 bool set_poisoned(player_type *creature_ptr, TIME_EFFECT v)
556 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
558 if (creature_ptr->is_dead) return FALSE;
562 if (!creature_ptr->poisoned)
564 msg_print(_("毒に侵されてしまった!", "You are poisoned!"));
570 if (creature_ptr->poisoned)
572 msg_print(_("やっと毒の痛みがなくなった。", "You are no longer poisoned."));
577 creature_ptr->poisoned = v;
578 creature_ptr->redraw |= (PR_STATUS);
580 if (!notice) return FALSE;
582 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
583 handle_stuff(creature_ptr);
589 * @brief 恐怖の継続時間をセットする / Set "afraid", notice observable changes
591 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
593 bool set_afraid(player_type *creature_ptr, TIME_EFFECT v)
596 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
598 if (creature_ptr->is_dead) return FALSE;
602 if (!creature_ptr->afraid)
604 msg_print(_("何もかも恐くなってきた!", "You are terrified!"));
606 if (creature_ptr->special_defense & KATA_MASK)
608 msg_print(_("型が崩れた。", "You lose your stance."));
609 creature_ptr->special_defense &= ~(KATA_MASK);
610 creature_ptr->update |= (PU_BONUS);
611 creature_ptr->update |= (PU_MONSTERS);
612 creature_ptr->redraw |= (PR_STATE);
613 creature_ptr->redraw |= (PR_STATUS);
614 creature_ptr->action = ACTION_NONE;
618 creature_ptr->counter = FALSE;
619 chg_virtue(creature_ptr, V_VALOUR, -1);
624 if (creature_ptr->afraid)
626 msg_print(_("やっと恐怖を振り払った。", "You feel bolder now."));
631 creature_ptr->afraid = v;
632 creature_ptr->redraw |= (PR_STATUS);
634 if (!notice) return FALSE;
636 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
637 handle_stuff(creature_ptr);
643 * @brief 麻痺の継続時間をセットする / Set "paralyzed", notice observable changes
645 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
647 bool set_paralyzed(player_type *creature_ptr, TIME_EFFECT v)
650 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
652 if (creature_ptr->is_dead) return FALSE;
656 if (!creature_ptr->paralyzed)
658 msg_print(_("体が麻痺してしまった!", "You are paralyzed!"));
659 if (creature_ptr->concent) reset_concentration(creature_ptr, TRUE);
660 if (hex_spelling_any(creature_ptr)) stop_hex_spell_all(creature_ptr);
662 creature_ptr->counter = FALSE;
668 if (creature_ptr->paralyzed)
670 msg_print(_("やっと動けるようになった。", "You can move again."));
675 creature_ptr->paralyzed = v;
676 creature_ptr->redraw |= (PR_STATUS);
678 if (!notice) return FALSE;
680 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
681 creature_ptr->redraw |= (PR_STATE);
682 handle_stuff(creature_ptr);
687 * @brief 幻覚の継続時間をセットする / Set "image", notice observable changes
689 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
690 * @details Note that we must redraw the map when hallucination changes.
692 bool set_image(player_type *creature_ptr, TIME_EFFECT v)
695 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
697 if (creature_ptr->is_dead) return FALSE;
698 if (creature_ptr->pseikaku == SEIKAKU_CHARGEMAN) v = 0;
702 set_tsuyoshi(creature_ptr, 0, TRUE);
703 if (!creature_ptr->image)
705 msg_print(_("ワーオ!何もかも虹色に見える!", "Oh, wow! Everything looks so cosmic now!"));
708 if (creature_ptr->concent) reset_concentration(creature_ptr, TRUE);
710 creature_ptr->counter = FALSE;
716 if (creature_ptr->image)
718 msg_print(_("やっとはっきりと物が見えるようになった。", "You can see clearly again."));
723 creature_ptr->image = v;
724 creature_ptr->redraw |= (PR_STATUS);
726 if (!notice) return FALSE;
728 if (disturb_state) disturb(creature_ptr, FALSE, TRUE);
730 creature_ptr->redraw |= (PR_MAP | PR_HEALTH | PR_UHEALTH);
731 creature_ptr->update |= (PU_MONSTERS);
732 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
733 handle_stuff(creature_ptr);
739 * @brief 加速の継続時間をセットする / Set "fast", notice observable changes
741 * @param do_dec 現在の継続時間より長い値のみ上書きする
742 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
744 bool set_fast(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
747 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
749 if (creature_ptr->is_dead) return FALSE;
753 if (creature_ptr->fast && !do_dec)
755 if (creature_ptr->fast > v) return FALSE;
757 else if (!IS_FAST(creature_ptr) && !creature_ptr->lightspeed)
759 msg_print(_("素早く動けるようになった!", "You feel yourself moving much faster!"));
761 chg_virtue(creature_ptr, V_PATIENCE, -1);
762 chg_virtue(creature_ptr, V_DILIGENCE, 1);
767 if (creature_ptr->fast && !creature_ptr->lightspeed && !music_singing(creature_ptr, MUSIC_SPEED) && !music_singing(creature_ptr, MUSIC_SHERO))
769 msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
774 creature_ptr->fast = v;
775 if (!notice) return FALSE;
777 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
778 creature_ptr->update |= (PU_BONUS);
779 handle_stuff(creature_ptr);
785 * @brief 光速移動の継続時間をセットする / Set "lightspeed", notice observable changes
787 * @param do_dec 現在の継続時間より長い値のみ上書きする
788 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
790 bool set_lightspeed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
793 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
795 if (creature_ptr->is_dead) return FALSE;
797 if (creature_ptr->wild_mode) v = 0;
801 if (creature_ptr->lightspeed && !do_dec)
803 if (creature_ptr->lightspeed > v) return FALSE;
805 else if (!creature_ptr->lightspeed)
807 msg_print(_("非常に素早く動けるようになった!", "You feel yourself moving extremely fast!"));
809 chg_virtue(creature_ptr, V_PATIENCE, -1);
810 chg_virtue(creature_ptr, V_DILIGENCE, 1);
815 if (creature_ptr->lightspeed)
817 msg_print(_("動きの素早さがなくなったようだ。", "You feel yourself slow down."));
822 creature_ptr->lightspeed = v;
824 if (!notice) return FALSE;
826 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
827 creature_ptr->update |= (PU_BONUS);
828 handle_stuff(creature_ptr);
834 * @brief 減速の継続時間をセットする / Set "slow", notice observable changes
836 * @param do_dec 現在の継続時間より長い値のみ上書きする
837 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
839 bool set_slow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
842 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
844 if (creature_ptr->is_dead) return FALSE;
848 if (creature_ptr->slow && !do_dec)
850 if (creature_ptr->slow > v) return FALSE;
852 else if (!creature_ptr->slow)
854 msg_print(_("体の動きが遅くなってしまった!", "You feel yourself moving slower!"));
860 if (creature_ptr->slow)
862 msg_print(_("動きの遅さがなくなったようだ。", "You feel yourself speed up."));
867 creature_ptr->slow = v;
868 if (!notice) return FALSE;
870 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
871 creature_ptr->update |= (PU_BONUS);
872 handle_stuff(creature_ptr);
878 * @brief 肌石化の継続時間をセットする / Set "shield", notice observable changes
880 * @param do_dec 現在の継続時間より長い値のみ上書きする
881 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
883 bool set_shield(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
886 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
888 if (creature_ptr->is_dead) return FALSE;
892 if (creature_ptr->shield && !do_dec)
894 if (creature_ptr->shield > v) return FALSE;
896 else if (!creature_ptr->shield)
898 msg_print(_("肌が石になった。", "Your skin turns to stone."));
904 if (creature_ptr->shield)
906 msg_print(_("肌が元に戻った。", "Your skin returns to normal."));
911 creature_ptr->shield = v;
912 creature_ptr->redraw |= (PR_STATUS);
914 if (!notice) return FALSE;
916 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
917 creature_ptr->update |= (PU_BONUS);
918 handle_stuff(creature_ptr);
924 * @brief つぶれるの継続時間をセットする / Set "tsubureru", notice observable changes
926 * @param do_dec 現在の継続時間より長い値のみ上書きする
927 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
929 bool set_tsubureru(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
932 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
934 if (creature_ptr->is_dead) return FALSE;
938 if (creature_ptr->tsubureru && !do_dec)
940 if (creature_ptr->tsubureru > v) return FALSE;
942 else if (!creature_ptr->tsubureru)
944 msg_print(_("横に伸びた。", "Your body expands horizontally."));
950 if (creature_ptr->tsubureru)
952 msg_print(_("もう横に伸びていない。", "Your body returns to normal."));
957 creature_ptr->tsubureru = v;
958 creature_ptr->redraw |= (PR_STATUS);
960 if (!notice) return FALSE;
962 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
963 creature_ptr->update |= (PU_BONUS);
964 handle_stuff(creature_ptr);
970 * @brief 魔法の鎧の継続時間をセットする / Set "magicdef", notice observable changes
972 * @param do_dec 現在の継続時間より長い値のみ上書きする
973 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
975 bool set_magicdef(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
978 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
980 if (creature_ptr->is_dead) return FALSE;
984 if (creature_ptr->magicdef && !do_dec)
986 if (creature_ptr->magicdef > v) return FALSE;
988 else if (!creature_ptr->magicdef)
990 msg_print(_("魔法の防御力が増したような気がする。", "You feel more resistant to magic."));
996 if (creature_ptr->magicdef)
998 msg_print(_("魔法の防御力が元に戻った。", "You feel less resistant to magic."));
1003 creature_ptr->magicdef = v;
1004 creature_ptr->redraw |= (PR_STATUS);
1006 if (!notice) return FALSE;
1008 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1009 creature_ptr->update |= (PU_BONUS);
1010 handle_stuff(creature_ptr);
1016 * @brief 祝福の継続時間をセットする / Set "blessed", notice observable changes
1018 * @param do_dec 現在の継続時間より長い値のみ上書きする
1019 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1021 bool set_blessed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1023 bool notice = FALSE;
1024 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1026 if (creature_ptr->is_dead) return FALSE;
1030 if (creature_ptr->blessed && !do_dec)
1032 if (creature_ptr->blessed > v) return FALSE;
1034 else if (!is_blessed(creature_ptr))
1036 msg_print(_("高潔な気分になった!", "You feel righteous!"));
1042 if (creature_ptr->blessed && !music_singing(creature_ptr, MUSIC_BLESS))
1044 msg_print(_("高潔な気分が消え失せた。", "The prayer has expired."));
1049 creature_ptr->blessed = v;
1050 creature_ptr->redraw |= (PR_STATUS);
1052 if (!notice) return FALSE;
1054 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1055 creature_ptr->update |= (PU_BONUS);
1056 handle_stuff(creature_ptr);
1062 * @brief 士気高揚の継続時間をセットする / Set "hero", notice observable changes
1064 * @param do_dec 現在の継続時間より長い値のみ上書きする
1065 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1067 bool set_hero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1069 bool notice = FALSE;
1070 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1072 if (creature_ptr->is_dead) return FALSE;
1076 if (creature_ptr->hero && !do_dec)
1078 if (creature_ptr->hero > v) return FALSE;
1080 else if (!IS_HERO(creature_ptr))
1082 msg_print(_("ヒーローになった気がする!", "You feel like a hero!"));
1088 if (creature_ptr->hero && !music_singing(creature_ptr, MUSIC_HERO) && !music_singing(creature_ptr, MUSIC_SHERO))
1090 msg_print(_("ヒーローの気分が消え失せた。", "The heroism wears off."));
1095 creature_ptr->hero = v;
1096 creature_ptr->redraw |= (PR_STATUS);
1098 if (!notice) return FALSE;
1100 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1101 creature_ptr->update |= (PU_BONUS);
1102 creature_ptr->update |= (PU_HP);
1103 handle_stuff(creature_ptr);
1108 * @brief 狂戦士化の継続時間をセットする / Set "shero", notice observable changes
1109 * @param v 継続時間/ 0ならば無条件にリセット
1110 * @param do_dec FALSEの場合現在の継続時間より長い値のみ上書きする
1111 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1113 bool set_shero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1115 bool notice = FALSE;
1116 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1118 if (creature_ptr->is_dead) return FALSE;
1120 if (creature_ptr->pclass == CLASS_BERSERKER) v = 1;
1123 if (creature_ptr->shero && !do_dec)
1125 if (creature_ptr->shero > v) return FALSE;
1127 else if (!creature_ptr->shero)
1129 msg_print(_("殺戮マシーンになった気がする!", "You feel like a killing machine!"));
1135 if (creature_ptr->shero)
1137 msg_print(_("野蛮な気持ちが消え失せた。", "You feel less berserk."));
1142 creature_ptr->shero = v;
1143 creature_ptr->redraw |= (PR_STATUS);
1145 if (!notice) return FALSE;
1147 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1148 creature_ptr->update |= (PU_BONUS);
1149 creature_ptr->update |= (PU_HP);
1150 handle_stuff(creature_ptr);
1156 * @brief 対邪悪結界の継続時間をセットする / Set "protevil", notice observable changes
1158 * @param do_dec 現在の継続時間より長い値のみ上書きする
1159 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1161 bool set_protevil(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1163 bool notice = FALSE;
1164 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1166 if (creature_ptr->is_dead) return FALSE;
1170 if (creature_ptr->protevil && !do_dec)
1172 if (creature_ptr->protevil > v) return FALSE;
1174 else if (!creature_ptr->protevil)
1176 msg_print(_("邪悪なる存在から守られているような感じがする!", "You feel safe from evil!"));
1182 if (creature_ptr->protevil)
1184 msg_print(_("邪悪なる存在から守られている感じがなくなった。", "You no longer feel safe from evil."));
1189 creature_ptr->protevil = v;
1190 creature_ptr->redraw |= (PR_STATUS);
1192 if (!notice) return FALSE;
1194 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1195 handle_stuff(creature_ptr);
1201 * @brief 幽体化の継続時間をセットする / Set "wraith_form", notice observable changes
1203 * @param do_dec 現在の継続時間より長い値のみ上書きする
1204 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1206 bool set_wraith_form(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1208 bool notice = FALSE;
1209 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1211 if (creature_ptr->is_dead) return FALSE;
1215 if (creature_ptr->wraith_form && !do_dec)
1217 if (creature_ptr->wraith_form > v) return FALSE;
1219 else if (!creature_ptr->wraith_form)
1221 msg_print(_("物質界を離れて幽鬼のような存在になった!", "You leave the physical world and turn into a wraith-being!"));
1223 chg_virtue(creature_ptr, V_UNLIFE, 3);
1224 chg_virtue(creature_ptr, V_HONOUR, -2);
1225 chg_virtue(creature_ptr, V_SACRIFICE, -2);
1226 chg_virtue(creature_ptr, V_VALOUR, -5);
1228 creature_ptr->redraw |= (PR_MAP);
1229 creature_ptr->update |= (PU_MONSTERS);
1231 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1236 if (creature_ptr->wraith_form)
1238 msg_print(_("不透明になった感じがする。", "You feel opaque."));
1241 creature_ptr->redraw |= (PR_MAP);
1242 creature_ptr->update |= (PU_MONSTERS);
1244 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1248 creature_ptr->wraith_form = v;
1249 creature_ptr->redraw |= (PR_STATUS);
1251 if (!notice) return FALSE;
1253 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1254 creature_ptr->update |= (PU_BONUS);
1255 handle_stuff(creature_ptr);
1261 * @brief 無傷球の継続時間をセットする / Set "invuln", notice observable changes
1263 * @param do_dec 現在の継続時間より長い値のみ上書きする
1264 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1266 bool set_invuln(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1268 bool notice = FALSE;
1269 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1271 if (creature_ptr->is_dead) return FALSE;
1275 if (creature_ptr->invuln && !do_dec)
1277 if (creature_ptr->invuln > v) return FALSE;
1279 else if (!IS_INVULN(creature_ptr))
1281 msg_print(_("無敵だ!", "Invulnerability!"));
1284 chg_virtue(creature_ptr, V_UNLIFE, -2);
1285 chg_virtue(creature_ptr, V_HONOUR, -2);
1286 chg_virtue(creature_ptr, V_SACRIFICE, -3);
1287 chg_virtue(creature_ptr, V_VALOUR, -5);
1289 creature_ptr->redraw |= (PR_MAP);
1290 creature_ptr->update |= (PU_MONSTERS);
1292 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1297 if (creature_ptr->invuln && !music_singing(creature_ptr, MUSIC_INVULN))
1299 msg_print(_("無敵ではなくなった。", "The invulnerability wears off."));
1302 creature_ptr->redraw |= (PR_MAP);
1303 creature_ptr->update |= (PU_MONSTERS);
1305 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1307 creature_ptr->energy_need += ENERGY_NEED();
1311 creature_ptr->invuln = v;
1312 creature_ptr->redraw |= (PR_STATUS);
1314 if (!notice) return FALSE;
1316 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1317 creature_ptr->update |= (PU_BONUS);
1318 handle_stuff(creature_ptr);
1324 * @brief 時限ESPの継続時間をセットする / Set "tim_esp", notice observable changes
1326 * @param do_dec 現在の継続時間より長い値のみ上書きする
1327 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1329 bool set_tim_esp(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1331 bool notice = FALSE;
1332 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1334 if (creature_ptr->is_dead) return FALSE;
1338 if (creature_ptr->tim_esp && !do_dec)
1340 if (creature_ptr->tim_esp > v) return FALSE;
1342 else if (!is_time_limit_esp(creature_ptr))
1344 msg_print(_("意識が広がった気がする!", "You feel your consciousness expand!"));
1350 if (creature_ptr->tim_esp && !music_singing(creature_ptr, MUSIC_MIND))
1352 msg_print(_("意識は元に戻った。", "Your consciousness contracts again."));
1357 creature_ptr->tim_esp = v;
1358 creature_ptr->redraw |= (PR_STATUS);
1360 if (!notice) return FALSE;
1362 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1363 creature_ptr->update |= (PU_BONUS);
1364 creature_ptr->update |= (PU_MONSTERS);
1365 handle_stuff(creature_ptr);
1371 * @brief 時限透明視の継続時間をセットする / Set "tim_invis", notice observable changes
1373 * @param do_dec 現在の継続時間より長い値のみ上書きする
1374 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1376 bool set_tim_invis(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1378 bool notice = FALSE;
1379 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1381 if (creature_ptr->is_dead) return FALSE;
1385 if (creature_ptr->tim_invis && !do_dec)
1387 if (creature_ptr->tim_invis > v) return FALSE;
1389 else if (!creature_ptr->tim_invis)
1391 msg_print(_("目が非常に敏感になった気がする!", "Your eyes feel very sensitive!"));
1397 if (creature_ptr->tim_invis)
1399 msg_print(_("目の敏感さがなくなったようだ。", "Your eyes feel less sensitive."));
1404 creature_ptr->tim_invis = v;
1405 creature_ptr->redraw |= (PR_STATUS);
1407 if (!notice) return FALSE;
1409 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1410 creature_ptr->update |= (PU_BONUS);
1411 creature_ptr->update |= (PU_MONSTERS);
1412 handle_stuff(creature_ptr);
1418 * @brief 時限赤外線視力の継続時間をセットする / Set "tim_infra", notice observable changes
1420 * @param do_dec 現在の継続時間より長い値のみ上書きする
1421 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1423 bool set_tim_infra(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1425 bool notice = FALSE;
1426 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1428 if (creature_ptr->is_dead) return FALSE;
1432 if (creature_ptr->tim_infra && !do_dec)
1434 if (creature_ptr->tim_infra > v) return FALSE;
1436 else if (!creature_ptr->tim_infra)
1438 msg_print(_("目がランランと輝き始めた!", "Your eyes begin to tingle!"));
1444 if (creature_ptr->tim_infra)
1446 msg_print(_("目の輝きがなくなった。", "Your eyes stop tingling."));
1451 creature_ptr->tim_infra = v;
1452 creature_ptr->redraw |= (PR_STATUS);
1454 if (!notice) return FALSE;
1456 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1457 creature_ptr->update |= (PU_BONUS);
1458 creature_ptr->update |= (PU_MONSTERS);
1459 handle_stuff(creature_ptr);
1465 * @brief 時限急回復の継続時間をセットする / Set "tim_regen", notice observable changes
1467 * @param do_dec 現在の継続時間より長い値のみ上書きする
1468 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1470 bool set_tim_regen(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1472 bool notice = FALSE;
1473 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1475 if (creature_ptr->is_dead) return FALSE;
1479 if (creature_ptr->tim_regen && !do_dec)
1481 if (creature_ptr->tim_regen > v) return FALSE;
1483 else if (!creature_ptr->tim_regen)
1485 msg_print(_("回復力が上がった!", "You feel yourself regenerating quickly!"));
1491 if (creature_ptr->tim_regen)
1493 msg_print(_("素早く回復する感じがなくなった。", "You feel yourself regenerating slowly."));
1498 creature_ptr->tim_regen = v;
1499 creature_ptr->redraw |= (PR_STATUS);
1501 if (!notice) return FALSE;
1503 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1504 creature_ptr->update |= (PU_BONUS);
1505 handle_stuff(creature_ptr);
1511 * @brief 隠密の歌の継続時間をセットする / Set "tim_stealth", notice observable changes
1513 * @param do_dec 現在の継続時間より長い値のみ上書きする
1514 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1516 bool set_tim_stealth(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1518 bool notice = FALSE;
1519 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1521 if (creature_ptr->is_dead) return FALSE;
1525 if (creature_ptr->tim_stealth && !do_dec)
1527 if (creature_ptr->tim_stealth > v) return FALSE;
1529 else if (!is_time_limit_stealth(creature_ptr))
1531 msg_print(_("足音が小さくなった!", "You begin to walk silently!"));
1537 if (creature_ptr->tim_stealth && !music_singing(creature_ptr, MUSIC_STEALTH))
1539 msg_print(_("足音が大きくなった。", "You no longer walk silently."));
1544 creature_ptr->tim_stealth = v;
1545 creature_ptr->redraw |= (PR_STATUS);
1547 if (!notice) return FALSE;
1549 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1550 creature_ptr->update |= (PU_BONUS);
1551 handle_stuff(creature_ptr);
1557 * @brief 超隠密状態をセットする
1558 * @param set TRUEならば超隠密状態になる。
1559 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1561 bool set_superstealth(player_type *creature_ptr, bool set)
1563 bool notice = FALSE;
1565 if (creature_ptr->is_dead) return FALSE;
1569 if (!(creature_ptr->special_defense & NINJA_S_STEALTH))
1571 if (creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & CAVE_MNLT)
1573 msg_print(_("敵の目から薄い影の中に覆い隠された。", "You are mantled in weak shadow from ordinary eyes."));
1574 creature_ptr->monlite = creature_ptr->old_monlite = TRUE;
1578 msg_print(_("敵の目から影の中に覆い隠された!", "You are mantled in shadow from ordinary eyes!"));
1579 creature_ptr->monlite = creature_ptr->old_monlite = FALSE;
1583 creature_ptr->special_defense |= NINJA_S_STEALTH;
1588 if (creature_ptr->special_defense & NINJA_S_STEALTH)
1590 msg_print(_("再び敵の目にさらされるようになった。", "You are exposed to common sight once more."));
1592 creature_ptr->special_defense &= ~(NINJA_S_STEALTH);
1596 if (!notice) return FALSE;
1597 creature_ptr->redraw |= (PR_STATUS);
1599 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1605 * @brief 一時的浮遊の継続時間をセットする / Set "tim_levitation", notice observable changes
1607 * @param do_dec 現在の継続時間より長い値のみ上書きする
1608 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1610 bool set_tim_levitation(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1612 bool notice = FALSE;
1613 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1615 if (creature_ptr->is_dead) return FALSE;
1619 if (creature_ptr->tim_levitation && !do_dec)
1621 if (creature_ptr->tim_levitation > v) return FALSE;
1623 else if (!creature_ptr->tim_levitation)
1625 msg_print(_("体が宙に浮き始めた。", "You begin to fly!"));
1631 if (creature_ptr->tim_levitation)
1633 msg_print(_("もう宙に浮かべなくなった。", "You stop flying."));
1638 creature_ptr->tim_levitation = v;
1639 creature_ptr->redraw |= (PR_STATUS);
1641 if (!notice) return FALSE;
1643 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1644 creature_ptr->update |= (PU_BONUS);
1645 handle_stuff(creature_ptr);
1651 * @brief 一時的闘気のオーラの継続時間をセットする / Set "tim_sh_touki", notice observable changes
1653 * @param do_dec 現在の継続時間より長い値のみ上書きする
1654 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1656 bool set_tim_sh_touki(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1658 bool notice = FALSE;
1659 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1661 if (creature_ptr->is_dead) return FALSE;
1665 if (creature_ptr->tim_sh_touki && !do_dec)
1667 if (creature_ptr->tim_sh_touki > v) return FALSE;
1669 else if (!creature_ptr->tim_sh_touki)
1671 msg_print(_("体が闘気のオーラで覆われた。", "You are enveloped by an aura of the Force!"));
1677 if (creature_ptr->tim_sh_touki)
1679 msg_print(_("闘気が消えた。", "The aura of the Force disappeared."));
1684 creature_ptr->tim_sh_touki = v;
1685 creature_ptr->redraw |= (PR_STATUS);
1687 if (!notice) return FALSE;
1689 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1690 handle_stuff(creature_ptr);
1696 * @brief 一時的火炎のオーラの継続時間をセットする / Set "tim_sh_fire", notice observable changes
1698 * @param do_dec 現在の継続時間より長い値のみ上書きする
1699 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1701 bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1703 bool notice = FALSE;
1704 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1706 if (creature_ptr->is_dead) return FALSE;
1710 if (creature_ptr->tim_sh_fire && !do_dec)
1712 if (creature_ptr->tim_sh_fire > v) return FALSE;
1714 else if (!creature_ptr->tim_sh_fire)
1716 msg_print(_("体が炎のオーラで覆われた。", "You are enveloped by a fiery aura!"));
1722 if (creature_ptr->tim_sh_fire)
1724 msg_print(_("炎のオーラが消えた。", "The fiery aura disappeared."));
1729 creature_ptr->tim_sh_fire = v;
1730 creature_ptr->redraw |= (PR_STATUS);
1732 if (!notice) return FALSE;
1734 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1735 creature_ptr->update |= (PU_BONUS);
1736 handle_stuff(creature_ptr);
1742 * @brief 一時的聖なるのオーラの継続時間をセットする / Set "tim_sh_holy", notice observable changes
1744 * @param do_dec 現在の継続時間より長い値のみ上書きする
1745 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1747 bool set_tim_sh_holy(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1749 bool notice = FALSE;
1750 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1752 if (creature_ptr->is_dead) return FALSE;
1756 if (creature_ptr->tim_sh_holy && !do_dec)
1758 if (creature_ptr->tim_sh_holy > v) return FALSE;
1760 else if (!creature_ptr->tim_sh_holy)
1762 msg_print(_("体が聖なるオーラで覆われた。", "You are enveloped by a holy aura!"));
1768 if (creature_ptr->tim_sh_holy)
1770 msg_print(_("聖なるオーラが消えた。", "The holy aura disappeared."));
1775 creature_ptr->tim_sh_holy = v;
1776 creature_ptr->redraw |= (PR_STATUS);
1778 if (!notice) return FALSE;
1780 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1781 creature_ptr->update |= (PU_BONUS);
1782 handle_stuff(creature_ptr);
1788 * @brief 目には目をの残り時間をセットする / Set "tim_eyeeye", notice observable changes
1790 * @param do_dec 現在の継続時間より長い値のみ上書きする
1791 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1793 bool set_tim_eyeeye(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1795 bool notice = FALSE;
1796 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1798 if (creature_ptr->is_dead) return FALSE;
1802 if (creature_ptr->tim_eyeeye && !do_dec)
1804 if (creature_ptr->tim_eyeeye > v) return FALSE;
1806 else if (!creature_ptr->tim_eyeeye)
1808 msg_print(_("法の守り手になった気がした!", "You feel like a keeper of commandments!"));
1814 if (creature_ptr->tim_eyeeye)
1816 msg_print(_("懲罰を執行することができなくなった。", "You no longer feel like a keeper."));
1821 creature_ptr->tim_eyeeye = v;
1822 creature_ptr->redraw |= (PR_STATUS);
1824 if (!notice) return FALSE;
1826 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1827 creature_ptr->update |= (PU_BONUS);
1828 handle_stuff(creature_ptr);
1834 * @brief 一時的魔法防御の継続時間をセットする / Set "resist_magic", notice observable changes
1836 * @param do_dec 現在の継続時間より長い値のみ上書きする
1837 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1839 bool set_resist_magic(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1841 bool notice = FALSE;
1842 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1844 if (creature_ptr->is_dead) return FALSE;
1848 if (creature_ptr->resist_magic && !do_dec)
1850 if (creature_ptr->resist_magic > v) return FALSE;
1852 else if (!creature_ptr->resist_magic)
1854 msg_print(_("魔法への耐性がついた。", "You have been protected from magic!"));
1860 if (creature_ptr->resist_magic)
1862 msg_print(_("魔法に弱くなった。", "You are no longer protected from magic."));
1867 creature_ptr->resist_magic = v;
1868 creature_ptr->redraw |= (PR_STATUS);
1870 if (!notice) return FALSE;
1872 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1873 creature_ptr->update |= (PU_BONUS);
1874 handle_stuff(creature_ptr);
1880 * @brief 一時的反射の継続時間をセットする / Set "tim_reflect", notice observable changes
1882 * @param do_dec 現在の継続時間より長い値のみ上書きする
1883 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1885 bool set_tim_reflect(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1887 bool notice = FALSE;
1888 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1890 if (creature_ptr->is_dead) return FALSE;
1894 if (creature_ptr->tim_reflect && !do_dec)
1896 if (creature_ptr->tim_reflect > v) return FALSE;
1898 else if (!creature_ptr->tim_reflect)
1900 msg_print(_("体の表面が滑かになった気がする。", "Your body becames smooth."));
1906 if (creature_ptr->tim_reflect)
1908 msg_print(_("体の表面が滑かでなくなった。", "Your body is no longer smooth."));
1913 creature_ptr->tim_reflect = v;
1914 creature_ptr->redraw |= (PR_STATUS);
1916 if (!notice) return FALSE;
1918 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
1919 creature_ptr->update |= (PU_BONUS);
1920 handle_stuff(creature_ptr);
1926 * Set "multishadow", notice observable changes
1928 bool set_multishadow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1930 bool notice = FALSE;
1931 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1933 if (creature_ptr->is_dead) return FALSE;
1937 if (creature_ptr->multishadow && !do_dec)
1939 if (creature_ptr->multishadow > v) return FALSE;
1941 else if (!creature_ptr->multishadow)
1943 msg_print(_("あなたの周りに幻影が生まれた。", "Your Shadow enveloped you."));
1949 if (creature_ptr->multishadow)
1951 msg_print(_("幻影が消えた。", "Your Shadow disappears."));
1956 creature_ptr->multishadow = v;
1957 creature_ptr->redraw |= (PR_STATUS);
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);
1969 * @brief 一時的破片のオーラの継続時間をセットする / Set "dustrobe", notice observable changes
1971 * @param do_dec 現在の継続時間より長い値のみ上書きする
1972 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1974 bool set_dustrobe(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1976 bool notice = FALSE;
1977 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1979 if (creature_ptr->is_dead) return FALSE;
1983 if (creature_ptr->dustrobe && !do_dec)
1985 if (creature_ptr->dustrobe > v) return FALSE;
1987 else if (!creature_ptr->dustrobe)
1989 msg_print(_("体が鏡のオーラで覆われた。", "You were enveloped by mirror shards."));
1995 if (creature_ptr->dustrobe)
1997 msg_print(_("鏡のオーラが消えた。", "The mirror shards disappear."));
2002 creature_ptr->dustrobe = v;
2003 creature_ptr->redraw |= (PR_STATUS);
2005 if (!notice) return FALSE;
2007 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2008 creature_ptr->update |= (PU_BONUS);
2009 handle_stuff(creature_ptr);
2015 * @brief 一時的壁抜けの継続時間をセットする / Set "kabenuke", notice observable changes
2017 * @param do_dec 現在の継続時間より長い値のみ上書きする
2018 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2020 bool set_kabenuke(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2022 bool notice = FALSE;
2023 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2025 if (creature_ptr->is_dead) return FALSE;
2029 if (creature_ptr->kabenuke && !do_dec)
2031 if (creature_ptr->kabenuke > v) return FALSE;
2033 else if (!creature_ptr->kabenuke)
2035 msg_print(_("体が半物質の状態になった。", "You became ethereal."));
2041 if (creature_ptr->kabenuke)
2043 msg_print(_("体が物質化した。", "You are no longer ethereal."));
2048 creature_ptr->kabenuke = v;
2049 creature_ptr->redraw |= (PR_STATUS);
2051 if (!notice) return FALSE;
2053 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2054 creature_ptr->update |= (PU_BONUS);
2055 handle_stuff(creature_ptr);
2061 * @brief オクレ兄さんの継続時間をセットする / Set "tsuyoshi", notice observable changes
2063 * @param do_dec 現在の継続時間より長い値のみ上書きする
2064 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2066 bool set_tsuyoshi(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2068 bool notice = FALSE;
2069 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2071 if (creature_ptr->is_dead) return FALSE;
2075 if (creature_ptr->tsuyoshi && !do_dec)
2077 if (creature_ptr->tsuyoshi > v) return FALSE;
2079 else if (!creature_ptr->tsuyoshi)
2081 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
2083 chg_virtue(creature_ptr, V_VITALITY, 2);
2088 if (creature_ptr->tsuyoshi)
2090 msg_print(_("肉体が急速にしぼんでいった。", "Your body has quickly shriveled."));
2092 (void)dec_stat(creature_ptr, A_CON, 20, TRUE);
2093 (void)dec_stat(creature_ptr, A_STR, 20, TRUE);
2096 chg_virtue(creature_ptr, V_VITALITY, -3);
2100 creature_ptr->tsuyoshi = v;
2101 creature_ptr->redraw |= (PR_STATUS);
2103 if (!notice) return FALSE;
2105 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2106 creature_ptr->update |= (PU_BONUS);
2107 creature_ptr->update |= (PU_HP);
2108 handle_stuff(creature_ptr);
2114 * @brief 一時的元素スレイの継続時間をセットする / Set a temporary elemental brand. Clear all other brands. Print status messages. -LM-
2115 * @param attack_type スレイのタイプID
2117 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2119 bool set_ele_attack(player_type *creature_ptr, u32b attack_type, TIME_EFFECT v)
2121 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2123 if ((creature_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
2125 creature_ptr->special_attack &= ~(ATTACK_ACID);
2126 msg_print(_("酸で攻撃できなくなった。", "Your temporary acidic brand fades away."));
2129 if ((creature_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
2131 creature_ptr->special_attack &= ~(ATTACK_ELEC);
2132 msg_print(_("電撃で攻撃できなくなった。", "Your temporary electrical brand fades away."));
2135 if ((creature_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
2137 creature_ptr->special_attack &= ~(ATTACK_FIRE);
2138 msg_print(_("火炎で攻撃できなくなった。", "Your temporary fiery brand fades away."));
2141 if ((creature_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
2143 creature_ptr->special_attack &= ~(ATTACK_COLD);
2144 msg_print(_("冷気で攻撃できなくなった。", "Your temporary frost brand fades away."));
2147 if ((creature_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
2149 creature_ptr->special_attack &= ~(ATTACK_POIS);
2150 msg_print(_("毒で攻撃できなくなった。", "Your temporary poison brand fades away."));
2153 if ((v) && (attack_type))
2155 creature_ptr->special_attack |= (attack_type);
2156 creature_ptr->ele_attack = v;
2158 msg_format("%sで攻撃できるようになった!",
2159 ((attack_type == ATTACK_ACID) ? "酸" :
2160 ((attack_type == ATTACK_ELEC) ? "電撃" :
2161 ((attack_type == ATTACK_FIRE) ? "火炎" :
2162 ((attack_type == ATTACK_COLD) ? "冷気" :
2163 ((attack_type == ATTACK_POIS) ? "毒" :
2166 msg_format("For a while, the blows you deal will %s",
2167 ((attack_type == ATTACK_ACID) ? "melt with acid!" :
2168 ((attack_type == ATTACK_ELEC) ? "shock your foes!" :
2169 ((attack_type == ATTACK_FIRE) ? "burn with fire!" :
2170 ((attack_type == ATTACK_COLD) ? "chill to the bone!" :
2171 ((attack_type == ATTACK_POIS) ? "poison your enemies!" :
2172 "do nothing special."))))));
2176 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2177 creature_ptr->redraw |= (PR_STATUS);
2178 creature_ptr->update |= (PU_BONUS);
2179 handle_stuff(creature_ptr);
2186 * @brief 一時的元素免疫の継続時間をセットする / Set a temporary elemental brand. Clear all other brands. Print status messages. -LM-
2187 * @param immune_type 免疫のタイプID
2189 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2191 bool set_ele_immune(player_type *creature_ptr, u32b immune_type, TIME_EFFECT v)
2193 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2195 if ((creature_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
2197 creature_ptr->special_defense &= ~(DEFENSE_ACID);
2198 msg_print(_("酸の攻撃で傷つけられるようになった。。", "You are no longer immune to acid."));
2201 if ((creature_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
2203 creature_ptr->special_defense &= ~(DEFENSE_ELEC);
2204 msg_print(_("電撃の攻撃で傷つけられるようになった。。", "You are no longer immune to electricity."));
2207 if ((creature_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
2209 creature_ptr->special_defense &= ~(DEFENSE_FIRE);
2210 msg_print(_("火炎の攻撃で傷つけられるようになった。。", "You are no longer immune to fire."));
2213 if ((creature_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
2215 creature_ptr->special_defense &= ~(DEFENSE_COLD);
2216 msg_print(_("冷気の攻撃で傷つけられるようになった。。", "You are no longer immune to cold."));
2219 if ((creature_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
2221 creature_ptr->special_defense &= ~(DEFENSE_POIS);
2222 msg_print(_("毒の攻撃で傷つけられるようになった。。", "You are no longer immune to poison."));
2225 if ((v) && (immune_type))
2227 creature_ptr->special_defense |= (immune_type);
2228 creature_ptr->ele_immune = v;
2229 msg_format(_("%sの攻撃を受けつけなくなった!", "For a while, You are immune to %s"),
2230 ((immune_type == DEFENSE_ACID) ? _("酸", "acid!") :
2231 ((immune_type == DEFENSE_ELEC) ? _("電撃", "electricity!") :
2232 ((immune_type == DEFENSE_FIRE) ? _("火炎", "fire!") :
2233 ((immune_type == DEFENSE_COLD) ? _("冷気", "cold!") :
2234 ((immune_type == DEFENSE_POIS) ? _("毒", "poison!") :
2235 _("(なし)", "do nothing special.")))))));
2238 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2239 creature_ptr->redraw |= (PR_STATUS);
2240 creature_ptr->update |= (PU_BONUS);
2241 handle_stuff(creature_ptr);
2247 * @brief 一時的酸耐性の継続時間をセットする / Set "oppose_acid", notice observable changes
2249 * @param do_dec 現在の継続時間より長い値のみ上書きする
2250 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2252 bool set_oppose_acid(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2254 bool notice = FALSE;
2255 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2256 if (creature_ptr->is_dead) return FALSE;
2260 if (creature_ptr->oppose_acid && !do_dec)
2262 if (creature_ptr->oppose_acid > v) return FALSE;
2264 else if (!is_oppose_acid(creature_ptr))
2266 msg_print(_("酸への耐性がついた気がする!", "You feel resistant to acid!"));
2272 if (creature_ptr->oppose_acid && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
2274 msg_print(_("酸への耐性が薄れた気がする。", "You feel less resistant to acid."));
2279 creature_ptr->oppose_acid = v;
2281 if (!notice) return FALSE;
2282 creature_ptr->redraw |= (PR_STATUS);
2284 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2285 handle_stuff(creature_ptr);
2291 * @brief 一時的電撃耐性の継続時間をセットする / Set "oppose_elec", notice observable changes
2293 * @param do_dec 現在の継続時間より長い値のみ上書きする
2294 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2296 bool set_oppose_elec(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2298 bool notice = FALSE;
2299 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2301 if (creature_ptr->is_dead) return FALSE;
2305 if (creature_ptr->oppose_elec && !do_dec)
2307 if (creature_ptr->oppose_elec > v) return FALSE;
2309 else if (!is_oppose_elec(creature_ptr))
2311 msg_print(_("電撃への耐性がついた気がする!", "You feel resistant to electricity!"));
2317 if (creature_ptr->oppose_elec && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
2319 msg_print(_("電撃への耐性が薄れた気がする。", "You feel less resistant to electricity."));
2324 creature_ptr->oppose_elec = v;
2326 if (!notice) return FALSE;
2327 creature_ptr->redraw |= (PR_STATUS);
2329 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2330 handle_stuff(creature_ptr);
2336 * @brief 一時的火炎耐性の継続時間をセットする / Set "oppose_fire", notice observable changes
2338 * @param do_dec 現在の継続時間より長い値のみ上書きする
2339 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2341 bool set_oppose_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2343 bool notice = FALSE;
2344 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2345 if (creature_ptr->is_dead) return FALSE;
2347 if ((PRACE_IS_(creature_ptr, RACE_DEMON) && (creature_ptr->lev > 44)) || (creature_ptr->mimic_form == MIMIC_DEMON)) v = 1;
2350 if (creature_ptr->oppose_fire && !do_dec)
2352 if (creature_ptr->oppose_fire > v) return FALSE;
2354 else if (!is_oppose_fire(creature_ptr))
2356 msg_print(_("火への耐性がついた気がする!", "You feel resistant to fire!"));
2362 if (creature_ptr->oppose_fire && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
2364 msg_print(_("火への耐性が薄れた気がする。", "You feel less resistant to fire."));
2369 creature_ptr->oppose_fire = v;
2371 if (!notice) return FALSE;
2372 creature_ptr->redraw |= (PR_STATUS);
2374 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2375 handle_stuff(creature_ptr);
2381 * @brief 一時的冷気耐性の継続時間をセットする / Set "oppose_cold", notice observable changes
2383 * @param do_dec 現在の継続時間より長い値のみ上書きする
2384 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2386 bool set_oppose_cold(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2388 bool notice = FALSE;
2389 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2390 if (creature_ptr->is_dead) return FALSE;
2394 if (creature_ptr->oppose_cold && !do_dec)
2396 if (creature_ptr->oppose_cold > v) return FALSE;
2398 else if (!is_oppose_cold(creature_ptr))
2400 msg_print(_("冷気への耐性がついた気がする!", "You feel resistant to cold!"));
2406 if (creature_ptr->oppose_cold && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
2408 msg_print(_("冷気への耐性が薄れた気がする。", "You feel less resistant to cold."));
2413 creature_ptr->oppose_cold = v;
2415 if (!notice) return FALSE;
2416 creature_ptr->redraw |= (PR_STATUS);
2418 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2419 handle_stuff(creature_ptr);
2425 * @brief 一時的毒耐性の継続時間をセットする / Set "oppose_pois", notice observable changes
2427 * @param do_dec 現在の継続時間より長い値のみ上書きする
2428 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2430 bool set_oppose_pois(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2432 bool notice = FALSE;
2433 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2434 if ((creature_ptr->pclass == CLASS_NINJA) && (creature_ptr->lev > 44)) v = 1;
2435 if (creature_ptr->is_dead) return FALSE;
2439 if (creature_ptr->oppose_pois && !do_dec)
2441 if (creature_ptr->oppose_pois > v) return FALSE;
2443 else if (!is_oppose_pois(creature_ptr))
2445 msg_print(_("毒への耐性がついた気がする!", "You feel resistant to poison!"));
2451 if (creature_ptr->oppose_pois && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
2453 msg_print(_("毒への耐性が薄れた気がする。", "You feel less resistant to poison."));
2458 creature_ptr->oppose_pois = v;
2459 if (!notice) return FALSE;
2460 creature_ptr->redraw |= (PR_STATUS);
2462 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2463 handle_stuff(creature_ptr);
2469 * @brief 朦朧の継続時間をセットする / Set "stun", notice observable changes
2471 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2473 * Note the special code to only notice "range" changes.
2475 bool set_stun(player_type *creature_ptr, TIME_EFFECT v)
2477 int old_aux, new_aux;
2478 bool notice = FALSE;
2479 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2480 if (creature_ptr->is_dead) return FALSE;
2481 if (PRACE_IS_(creature_ptr, RACE_GOLEM) || ((creature_ptr->pclass == CLASS_BERSERKER) && (creature_ptr->lev > 34))) v = 0;
2483 if (creature_ptr->stun > 100)
2487 else if (creature_ptr->stun > 50)
2491 else if (creature_ptr->stun > 0)
2517 if (new_aux > old_aux)
2521 case 1: msg_print(_("意識がもうろうとしてきた。", "You have been stunned.")); break;
2522 case 2: msg_print(_("意識がひどくもうろうとしてきた。", "You have been heavily stunned.")); break;
2523 case 3: msg_print(_("頭がクラクラして意識が遠のいてきた。", "You have been knocked out.")); break;
2526 if (randint1(1000) < v || one_in_(16))
2528 msg_print(_("割れるような頭痛がする。", "A vicious blow hits your head."));
2532 if (!creature_ptr->sustain_int) (void)do_dec_stat(creature_ptr, A_INT);
2533 if (!creature_ptr->sustain_wis) (void)do_dec_stat(creature_ptr, A_WIS);
2535 else if (one_in_(2))
2537 if (!creature_ptr->sustain_int) (void)do_dec_stat(creature_ptr, A_INT);
2541 if (!creature_ptr->sustain_wis) (void)do_dec_stat(creature_ptr, A_WIS);
2545 if (creature_ptr->special_defense & KATA_MASK)
2547 msg_print(_("型が崩れた。", "You lose your stance."));
2548 creature_ptr->special_defense &= ~(KATA_MASK);
2549 creature_ptr->update |= (PU_BONUS);
2550 creature_ptr->update |= (PU_MONSTERS);
2551 creature_ptr->redraw |= (PR_STATE);
2552 creature_ptr->redraw |= (PR_STATUS);
2553 creature_ptr->action = ACTION_NONE;
2556 if (creature_ptr->concent) reset_concentration(creature_ptr, TRUE);
2557 if (hex_spelling_any(creature_ptr)) stop_hex_spell_all(creature_ptr);
2561 else if (new_aux < old_aux)
2565 msg_print(_("やっと朦朧状態から回復した。", "You are no longer stunned."));
2566 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2572 creature_ptr->stun = v;
2574 if (!notice) return FALSE;
2576 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2577 creature_ptr->update |= (PU_BONUS);
2578 creature_ptr->redraw |= (PR_STUN);
2579 handle_stuff(creature_ptr);
2585 * @brief 出血の継続時間をセットする / Set "cut", notice observable changes
2587 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2589 * Note the special code to only notice "range" changes.
2591 bool set_cut(player_type *creature_ptr, TIME_EFFECT v)
2593 int old_aux, new_aux;
2594 bool notice = FALSE;
2595 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2596 if (creature_ptr->is_dead) return FALSE;
2598 if ((creature_ptr->prace == RACE_GOLEM ||
2599 creature_ptr->prace == RACE_SKELETON ||
2600 creature_ptr->prace == RACE_SPECTRE ||
2601 (creature_ptr->prace == RACE_ZOMBIE && creature_ptr->lev > 11)) &&
2602 !creature_ptr->mimic_form)
2605 if (creature_ptr->cut > 1000)
2609 else if (creature_ptr->cut > 200)
2613 else if (creature_ptr->cut > 100)
2617 else if (creature_ptr->cut > 50)
2621 else if (creature_ptr->cut > 25)
2625 else if (creature_ptr->cut > 10)
2629 else if (creature_ptr->cut > 0)
2671 if (new_aux > old_aux)
2675 case 1: msg_print(_("かすり傷を負ってしまった。", "You have been given a graze.")); break;
2676 case 2: msg_print(_("軽い傷を負ってしまった。", "You have been given a light cut.")); break;
2677 case 3: msg_print(_("ひどい傷を負ってしまった。", "You have been given a bad cut.")); break;
2678 case 4: msg_print(_("大変な傷を負ってしまった。", "You have been given a nasty cut.")); break;
2679 case 5: msg_print(_("重大な傷を負ってしまった。", "You have been given a severe cut.")); break;
2680 case 6: msg_print(_("ひどい深手を負ってしまった。", "You have been given a deep gash.")); break;
2681 case 7: msg_print(_("致命的な傷を負ってしまった。", "You have been given a mortal wound.")); break;
2685 if (randint1(1000) < v || one_in_(16))
2687 if (!creature_ptr->sustain_chr)
2689 msg_print(_("ひどい傷跡が残ってしまった。", "You have been horribly scarred."));
2690 do_dec_stat(creature_ptr, A_CHR);
2694 else if (new_aux < old_aux)
2698 msg_format(_("やっと%s。", "You are no longer bleeding."), creature_ptr->prace == RACE_ANDROID ? "怪我が直った" : "出血が止まった");
2699 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2705 creature_ptr->cut = v;
2706 if (!notice) return FALSE;
2708 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2709 creature_ptr->update |= (PU_BONUS);
2710 creature_ptr->redraw |= (PR_CUT);
2711 handle_stuff(creature_ptr);
2717 * @brief 空腹状態をセットする / Set "food", notice observable changes
2719 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
2721 * Set "", notice observable changes\n
2723 * The "food" variable can get as large as 20000, allowing the
2724 * addition of the most "filling" item, Elvish Waybread, which adds
2725 * 7500 food units, without overflowing the 32767 maximum limit.\n
2727 * Perhaps we should disturb the player with various messages,
2728 * especially messages about hunger status changes. \n
2730 * Digestion of food is handled in "dungeon.c", in which, normally,
2731 * the player digests about 20 food units per 100 game turns, more
2732 * when "fast", more when "regenerating", less with "slow digestion",
2733 * but when the player is "gorged", he digests 100 food units per 10
2734 * game turns, or a full 1000 food units per 100 game turns.\n
2736 * Note that the player's speed is reduced by 10 units while gorged,
2737 * so if the player eats a single food ration (5000 food units) when
2738 * full (15000 food units), he will be gorged for (5000/100)*10 = 500
2739 * game turns, or 500/(100/5) = 25 player turns (if nothing else is
2740 * affecting the player speed).\n
2742 bool set_food(player_type *creature_ptr, TIME_EFFECT v)
2744 int old_aux, new_aux;
2746 bool notice = FALSE;
2747 v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
2748 if (creature_ptr->food < PY_FOOD_FAINT)
2752 else if (creature_ptr->food < PY_FOOD_WEAK)
2756 else if (creature_ptr->food < PY_FOOD_ALERT)
2760 else if (creature_ptr->food < PY_FOOD_FULL)
2764 else if (creature_ptr->food < PY_FOOD_MAX)
2773 if (v < PY_FOOD_FAINT)
2777 else if (v < PY_FOOD_WEAK)
2781 else if (v < PY_FOOD_ALERT)
2785 else if (v < PY_FOOD_FULL)
2789 else if (v < PY_FOOD_MAX)
2798 if (old_aux < 1 && new_aux > 0)
2799 chg_virtue(creature_ptr, V_PATIENCE, 2);
2800 else if (old_aux < 3 && (old_aux != new_aux))
2801 chg_virtue(creature_ptr, V_PATIENCE, 1);
2803 chg_virtue(creature_ptr, V_TEMPERANCE, 1);
2805 chg_virtue(creature_ptr, V_TEMPERANCE, -1);
2807 if (new_aux > old_aux)
2811 case 1: msg_print(_("まだ空腹で倒れそうだ。", "You are still weak.")); break;
2812 case 2: msg_print(_("まだ空腹だ。", "You are still hungry.")); break;
2813 case 3: msg_print(_("空腹感がおさまった。", "You are no longer hungry.")); break;
2814 case 4: msg_print(_("満腹だ!", "You are full!")); break;
2817 msg_print(_("食べ過ぎだ!", "You have gorged yourself!"));
2818 chg_virtue(creature_ptr, V_HARMONY, -1);
2819 chg_virtue(creature_ptr, V_PATIENCE, -1);
2820 chg_virtue(creature_ptr, V_TEMPERANCE, -2);
2826 else if (new_aux < old_aux)
2830 case 0: msg_print(_("あまりにも空腹で気を失ってしまった!", "You are getting faint from hunger!")); break;
2831 case 1: msg_print(_("お腹が空いて倒れそうだ。", "You are getting weak from hunger!")); break;
2832 case 2: msg_print(_("お腹が空いてきた。", "You are getting hungry.")); break;
2833 case 3: msg_print(_("満腹感がなくなった。", "You are no longer full.")); break;
2834 case 4: msg_print(_("やっとお腹がきつくなくなった。", "You are no longer gorged.")); break;
2837 if (creature_ptr->wild_mode && (new_aux < 2))
2839 change_wild_mode(creature_ptr, FALSE);
2845 creature_ptr->food = v;
2846 if (!notice) return FALSE;
2848 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
2849 creature_ptr->update |= (PU_BONUS);
2850 creature_ptr->redraw |= (PR_HUNGER);
2851 handle_stuff(creature_ptr);
2858 * @brief プレイヤーの基本能力値を増加させる / Increases a stat by one randomized level -RAK-
2859 * @param stat 上昇させるステータスID
2860 * @return 実際に上昇した場合TRUEを返す。
2862 * Note that this function (used by stat potions) now restores\n
2863 * the stat BEFORE increasing it.\n
2865 bool inc_stat(player_type *creature_ptr, int stat)
2868 BASE_STATUS value = creature_ptr->stat_cur[stat];
2870 if (value < creature_ptr->stat_max_max[stat])
2874 gain = ((randint0(100) < 75) ? 1 : 2);
2877 else if (value < (creature_ptr->stat_max_max[stat]-2))
2879 gain = (((creature_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
2880 if (gain < 1) gain = 1;
2882 value += randint1(gain) + gain / 2;
2883 if (value > (creature_ptr->stat_max_max[stat]-1)) value = creature_ptr->stat_max_max[stat]-1;
2890 creature_ptr->stat_cur[stat] = value;
2891 if (value > creature_ptr->stat_max[stat])
2893 creature_ptr->stat_max[stat] = value;
2896 creature_ptr->update |= (PU_BONUS);
2905 * @brief プレイヤーの基本能力値を減少させる / Decreases a stat by an amount indended to vary from 0 to 100 percent.
2906 * @param stat 減少させるステータスID
2907 * @param amount 減少させる基本量
2908 * @param permanent TRUEならば現在の最大値を減少させる
2909 * @return 実際に減少した場合TRUEを返す。
2912 * Amount could be a little higher in extreme cases to mangle very high\n
2913 * stats from massive assaults. -CWS\n
2915 * Note that "permanent" means that the *given* amount is permanent,\n
2916 * not that the new value becomes permanent. This may not work exactly\n
2917 * as expected, due to "weirdness" in the algorithm, but in general,\n
2918 * if your stat is already drained, the "max" value will not drop all\n
2919 * the way down to the "cur" value.\n
2921 bool dec_stat(player_type *creature_ptr, int stat, int amount, int permanent)
2926 BASE_STATUS cur = creature_ptr->stat_cur[stat];
2927 BASE_STATUS max = creature_ptr->stat_max[stat];
2928 int same = (cur == max);
2933 if (amount > 90) cur--;
2934 if (amount > 50) cur--;
2935 if (amount > 20) cur--;
2940 loss = (((cur-18) / 2 + 1) / 2 + 1);
2941 if (loss < 1) loss = 1;
2943 loss = ((randint1(loss) + loss) * amount) / 100;
2944 if (loss < amount/2) loss = amount/2;
2947 if (cur < 18) cur = (amount <= 20) ? 18 : 17;
2950 if (cur < 3) cur = 3;
2952 if (cur != creature_ptr->stat_cur[stat]) res = TRUE;
2955 if (permanent && (max > 3))
2957 chg_virtue(creature_ptr, V_SACRIFICE, 1);
2958 if (stat == A_WIS || stat == A_INT)
2959 chg_virtue(creature_ptr, V_ENLIGHTEN, -2);
2963 if (amount > 90) max--;
2964 if (amount > 50) max--;
2965 if (amount > 20) max--;
2970 loss = (((max-18) / 2 + 1) / 2 + 1);
2971 loss = ((randint1(loss) + loss) * amount) / 100;
2972 if (loss < amount/2) loss = amount/2;
2975 if (max < 18) max = (amount <= 20) ? 18 : 17;
2978 if (same || (max < cur)) max = cur;
2980 if (max != creature_ptr->stat_max[stat]) res = TRUE;
2985 creature_ptr->stat_cur[stat] = cur;
2986 creature_ptr->stat_max[stat] = max;
2987 creature_ptr->redraw |= (PR_STATS);
2988 creature_ptr->update |= (PU_BONUS);
2996 * @brief プレイヤーの基本能力値を回復させる / Restore a stat. Return TRUE only if this actually makes a difference.
2997 * @param stat 回復ステータスID
2998 * @return 実際に回復した場合TRUEを返す。
3000 bool res_stat(player_type *creature_ptr, int stat)
3002 if (creature_ptr->stat_cur[stat] != creature_ptr->stat_max[stat])
3004 creature_ptr->stat_cur[stat] = creature_ptr->stat_max[stat];
3005 creature_ptr->update |= (PU_BONUS);
3006 creature_ptr->redraw |= (PR_STATS);
3015 * Increase players hit points, notice effects
3017 bool hp_player(player_type *creature_ptr, int num)
3020 vir = virtue_number(creature_ptr, V_VITALITY);
3022 if(num <= 0) return FALSE;
3026 num = num * (creature_ptr->virtues[vir - 1] + 1250) / 1250;
3029 if (creature_ptr->chp < creature_ptr->mhp)
3031 if ((num > 0) && (creature_ptr->chp < (creature_ptr->mhp/3)))
3032 chg_virtue(creature_ptr, V_TEMPERANCE, 1);
3034 creature_ptr->chp += num;
3035 if (creature_ptr->chp >= creature_ptr->mhp)
3037 creature_ptr->chp = creature_ptr->mhp;
3038 creature_ptr->chp_frac = 0;
3041 creature_ptr->redraw |= (PR_HP);
3042 creature_ptr->window |= (PW_PLAYER);
3045 msg_print(_("少し気分が良くなった。", "You feel a little better."));
3049 msg_print(_("気分が良くなった。", "You feel better."));
3053 msg_print(_("とても気分が良くなった。", "You feel much better."));
3057 msg_print(_("ひじょうに気分が良くなった。", "You feel very good."));
3068 * Array of stat "descriptions"
3070 static concptr desc_stat_pos[] =
3072 _("強く", "stronger"),
3073 _("知的に", "smarter"),
3075 _("器用に", "more dextrous"),
3076 _("健康に", "healthier"),
3081 * Array of stat "descriptions"
3083 static concptr desc_stat_neg[] =
3086 _("無知に", "stupider"),
3087 _("愚かに", "more naive"),
3088 _("不器用に", "clumsier"),
3089 _("不健康に", "more sickly"),
3097 bool do_dec_stat(player_type *creature_ptr, int stat)
3101 /* Access the "sustain" */
3104 case A_STR: if (creature_ptr->sustain_str) sust = TRUE; break;
3105 case A_INT: if (creature_ptr->sustain_int) sust = TRUE; break;
3106 case A_WIS: if (creature_ptr->sustain_wis) sust = TRUE; break;
3107 case A_DEX: if (creature_ptr->sustain_dex) sust = TRUE; break;
3108 case A_CON: if (creature_ptr->sustain_con) sust = TRUE; break;
3109 case A_CHR: if (creature_ptr->sustain_chr) sust = TRUE; break;
3112 if (sust && (!ironman_nightmare || randint0(13)))
3114 msg_format(_("%sなった気がしたが、すぐに元に戻った。", "You feel %s for a moment, but the feeling passes."),
3115 desc_stat_neg[stat]);
3120 if (dec_stat(creature_ptr, stat, 10, (ironman_nightmare && !randint0(13))))
3122 msg_format(_("ひどく%sなった気がする。", "You feel %s."), desc_stat_neg[stat]);
3132 * Restore lost "points" in a stat
3134 bool do_res_stat(player_type *creature_ptr, int stat)
3136 if (res_stat(creature_ptr, stat))
3138 msg_format(_("元通りに%sなった気がする。", "You feel %s."), desc_stat_pos[stat]);
3147 * Gain a "point" in a stat
3149 bool do_inc_stat(player_type *creature_ptr, int stat)
3151 bool res = res_stat(creature_ptr, stat);
3152 if (inc_stat(creature_ptr, stat))
3156 chg_virtue(creature_ptr, V_ENLIGHTEN, 1);
3157 chg_virtue(creature_ptr, V_FAITH, 1);
3159 else if (stat == A_INT)
3161 chg_virtue(creature_ptr, V_KNOWLEDGE, 1);
3162 chg_virtue(creature_ptr, V_ENLIGHTEN, 1);
3164 else if (stat == A_CON)
3165 chg_virtue(creature_ptr, V_VITALITY, 1);
3167 msg_format(_("ワーオ!とても%sなった!", "Wow! You feel %s!"), desc_stat_pos[stat]);
3173 msg_format(_("元通りに%sなった気がする。", "You feel %s."), desc_stat_pos[stat]);
3182 * Restores any drained experience
3184 bool restore_level(player_type *creature_ptr)
3186 if (creature_ptr->exp < creature_ptr->max_exp)
3188 msg_print(_("経験値が戻ってきた気がする。", "You feel your experience returning."));
3189 creature_ptr->exp = creature_ptr->max_exp;
3190 check_experience(creature_ptr);
3201 bool lose_all_info(player_type *creature_ptr)
3203 chg_virtue(creature_ptr, V_KNOWLEDGE, -5);
3204 chg_virtue(creature_ptr, V_ENLIGHTEN, -5);
3205 for (int i = 0; i < INVEN_TOTAL; i++)
3207 object_type *o_ptr = &creature_ptr->inventory_list[i];
3208 if (!o_ptr->k_idx) continue;
3209 if (OBJECT_IS_FULL_KNOWN(o_ptr)) continue;
3211 o_ptr->feeling = FEEL_NONE;
3212 o_ptr->ident &= ~(IDENT_EMPTY);
3213 o_ptr->ident &= ~(IDENT_KNOWN);
3214 o_ptr->ident &= ~(IDENT_SENSE);
3217 creature_ptr->update |= (PU_BONUS);
3218 creature_ptr->update |= (PU_COMBINE | PU_REORDER);
3219 creature_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3220 wiz_dark(creature_ptr);
3225 void do_poly_wounds(player_type *creature_ptr)
3227 s16b wounds = creature_ptr->cut;
3228 s16b hit_p = (creature_ptr->mhp - creature_ptr->chp);
3229 s16b change = damroll(creature_ptr->lev, 5);
3230 bool Nasty_effect = one_in_(5);
3231 if (!(wounds || hit_p || Nasty_effect)) return;
3233 msg_print(_("傷がより軽いものに変化した。", "Your wounds are polymorphed into less serious ones."));
3234 hp_player(creature_ptr, change);
3237 msg_print(_("新たな傷ができた!", "A new wound was created!"));
3238 take_hit(creature_ptr, DAMAGE_LOSELIFE, change / 2, _("変化した傷", "a polymorphed wound"), -1);
3239 set_cut(creature_ptr,change);
3243 set_cut(creature_ptr,creature_ptr->cut - (change / 2));
3249 * Change player race
3251 void change_race(player_type *creature_ptr, CHARACTER_IDX new_race, concptr effect_msg)
3253 concptr title = race_info[new_race].title;
3254 int old_race = creature_ptr->prace;
3256 msg_format("あなたは%s%sに変化した!", effect_msg, title);
3258 msg_format("You turn into %s %s%s!", (!effect_msg[0] && is_a_vowel(title[0]) ? "an" : "a"), effect_msg, title);
3261 chg_virtue(creature_ptr, V_CHANCE, 2);
3262 if (creature_ptr->prace < 32)
3264 creature_ptr->old_race1 |= 1L << creature_ptr->prace;
3268 creature_ptr->old_race2 |= 1L << (creature_ptr->prace - 32);
3271 creature_ptr->prace = new_race;
3272 rp_ptr = &race_info[creature_ptr->prace];
3273 creature_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
3275 bool is_special_class = creature_ptr->pclass == CLASS_MONK;
3276 is_special_class |= creature_ptr->pclass == CLASS_FORCETRAINER;
3277 is_special_class |= creature_ptr->pclass == CLASS_NINJA;
3278 bool is_special_race = creature_ptr->prace == RACE_KLACKON;
3279 is_special_race |= creature_ptr->prace == RACE_SPRITE;
3280 if (is_special_class && is_special_race)
3281 creature_ptr->expfact -= 15;
3283 get_height_weight(creature_ptr);
3285 if (creature_ptr->pclass == CLASS_SORCERER)
3286 creature_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
3288 creature_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
3290 roll_hitdice(creature_ptr, 0L);
3291 check_experience(creature_ptr);
3292 creature_ptr->redraw |= (PR_BASIC);
3293 creature_ptr->update |= (PU_BONUS);
3294 handle_stuff(creature_ptr);
3296 if (old_race != creature_ptr->prace) autopick_load_pref(creature_ptr, FALSE);
3298 lite_spot(creature_ptr, creature_ptr->y, creature_ptr->x);
3302 void do_poly_self(player_type *creature_ptr)
3304 int power = creature_ptr->lev;
3306 msg_print(_("あなたは変化の訪れを感じた...", "You feel a change coming over you..."));
3307 chg_virtue(creature_ptr, V_CHANCE, 1);
3309 if ((power > randint0(20)) && one_in_(3) && (creature_ptr->prace != RACE_ANDROID))
3311 char effect_msg[80] = "";
3312 CHARACTER_IDX new_race;
3315 if ((power > randint0(5)) && one_in_(4))
3318 if (creature_ptr->psex == SEX_MALE)
3320 creature_ptr->psex = SEX_FEMALE;
3321 sp_ptr = &sex_info[creature_ptr->psex];
3322 sprintf(effect_msg, _("女性の", "female "));
3326 creature_ptr->psex = SEX_MALE;
3327 sp_ptr = &sex_info[creature_ptr->psex];
3328 sprintf(effect_msg, _("男性の", "male "));
3332 if ((power > randint0(30)) && one_in_(5))
3340 (void)dec_stat(creature_ptr, tmp, randint1(6) + 6, one_in_(3));
3346 (void)dec_stat(creature_ptr, A_CHR, randint1(6), TRUE);
3351 sprintf(tmp_msg,_("%s", "%s "),effect_msg);
3352 sprintf(effect_msg,_("奇形の%s", "deformed %s "),tmp_msg);
3356 sprintf(effect_msg,_("奇形の", "deformed "));
3360 while ((power > randint0(20)) && one_in_(10))
3364 if (!lose_mutation(creature_ptr, 0))
3365 msg_print(_("奇妙なくらい普通になった気がする。", "You feel oddly normal."));
3370 new_race = (CHARACTER_IDX)randint0(MAX_RACES);
3372 while ((new_race == creature_ptr->prace) || (new_race == RACE_ANDROID));
3374 change_race(creature_ptr, new_race, effect_msg);
3377 if ((power > randint0(30)) && one_in_(6))
3381 msg_format(_("%sの構成が変化した!", "Your internal organs are rearranged!"), creature_ptr->prace == RACE_ANDROID ? "機械" : "内臓");
3385 (void)dec_stat(creature_ptr, tmp, randint1(6) + 6, one_in_(3));
3390 msg_print(_("現在の姿で生きていくのは困難なようだ!", "You find living difficult in your present form!"));
3391 take_hit(creature_ptr, DAMAGE_LOSELIFE, damroll(randint1(10), creature_ptr->lev), _("致命的な突然変異", "a lethal mutation"), -1);
3397 if ((power > randint0(20)) && one_in_(4))
3401 get_max_stats(creature_ptr);
3402 roll_hitdice(creature_ptr, 0L);
3405 while ((power > randint0(15)) && one_in_(3))
3408 (void)gain_mutation(creature_ptr, 0);
3411 if (power > randint0(5))
3414 do_poly_wounds(creature_ptr);
3419 status_shuffle(creature_ptr);
3428 void gain_exp_64(player_type *creature_ptr, s32b amount, u32b amount_frac)
3430 if (creature_ptr->is_dead) return;
3431 if (creature_ptr->prace == RACE_ANDROID) return;
3433 s64b_add(&(creature_ptr->exp), &(creature_ptr->exp_frac), amount, amount_frac);
3435 if (creature_ptr->exp < creature_ptr->max_exp)
3437 creature_ptr->max_exp += amount / 5;
3440 check_experience(creature_ptr);
3447 void gain_exp(player_type *creature_ptr, s32b amount)
3449 gain_exp_64(creature_ptr, amount, 0L);
3453 void calc_android_exp(player_type *creature_ptr)
3456 if (creature_ptr->is_dead) return;
3457 if (creature_ptr->prace != RACE_ANDROID) return;
3459 for (int i = INVEN_RARM; i < INVEN_TOTAL; i++)
3461 object_type *o_ptr = &creature_ptr->inventory_list[i];
3463 object_type *q_ptr = &forge;
3465 DEPTH level = MAX(k_info[o_ptr->k_idx].level - 8, 1);
3467 if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue;
3468 if (!o_ptr->k_idx) continue;
3471 object_copy(q_ptr, o_ptr);
3472 q_ptr->discount = 0;
3473 q_ptr->curse_flags = 0L;
3475 if (object_is_fixed_artifact(o_ptr))
3477 level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
3478 level += MIN(20, a_info[o_ptr->name1].rarity/(a_info[o_ptr->name1].gen_flags & TRG_INSTA_ART ? 10 : 3));
3480 else if (object_is_ego(o_ptr))
3482 level += MAX(3, (e_info[o_ptr->name2].rating - 5)/2);
3484 else if (o_ptr->art_name)
3486 s32b total_flags = flag_cost(o_ptr, o_ptr->pval);
3489 if (!object_is_weapon_ammo(o_ptr))
3491 if (total_flags < 15000) fake_level = 10;
3492 else if (total_flags < 35000) fake_level = 25;
3493 else fake_level = 40;
3497 if (total_flags < 20000) fake_level = 10;
3498 else if (total_flags < 45000) fake_level = 25;
3499 else fake_level = 40;
3502 level = MAX(level, (level + MAX(fake_level - 8, 5)) / 2 + 3);
3505 value = object_value_real(q_ptr);
3506 if (value <= 0) continue;
3507 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (creature_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
3508 if (value > 5000000L) value = 5000000L;
3509 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
3511 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr) ||
3512 (o_ptr->tval == TV_DRAG_ARMOR) ||
3513 ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) ||
3514 ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) ||
3515 ((o_ptr->tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)) ||
3516 ((o_ptr->tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) ||
3517 ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE)))
3519 if (level > 65) level = 35 + (level - 65) / 5;
3520 else if (level > 35) level = 25 + (level - 35) / 3;
3521 else if (level > 15) level = 15 + (level - 15) / 2;
3522 exp = MIN(100000L, value) / 2 * level * level;
3523 if (value > 100000L)
3524 exp += (value - 100000L) / 8 * level * level;
3528 exp = MIN(100000L, value) * level;
3529 if (value > 100000L)
3530 exp += (value - 100000L) / 4 * level;
3532 if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(creature_ptr, i))) || (i == INVEN_BOW)) total_exp += exp / 48;
3533 else total_exp += exp / 16;
3534 if (i == INVEN_BODY) total_exp += exp / 32;
3537 creature_ptr->exp = creature_ptr->max_exp = total_exp;
3538 check_experience(creature_ptr);
3545 void lose_exp(player_type *creature_ptr, s32b amount)
3547 if (creature_ptr->prace == RACE_ANDROID) return;
3548 if (amount > creature_ptr->exp) amount = creature_ptr->exp;
3550 creature_ptr->exp -= amount;
3552 check_experience(creature_ptr);
3558 * If resisted to draining, return FALSE
3560 bool drain_exp(player_type *creature_ptr, s32b drain, s32b slip, int hold_exp_prob)
3562 if (creature_ptr->prace == RACE_ANDROID) return FALSE;
3564 if (creature_ptr->hold_exp && (randint0(100) < hold_exp_prob))
3566 msg_print(_("しかし自己の経験値を守りきった!", "You keep hold of your experience!"));
3570 if (creature_ptr->hold_exp)
3572 msg_print(_("経験値を少し吸い取られた気がする!", "You feel your experience slipping away!"));
3573 lose_exp(creature_ptr, slip);
3577 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away!"));
3578 lose_exp(creature_ptr, drain);
3585 bool set_ultimate_res(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
3587 bool notice = FALSE;
3588 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3590 if (creature_ptr->is_dead) return FALSE;
3594 if (creature_ptr->ult_res && !do_dec)
3596 if (creature_ptr->ult_res > v) return FALSE;
3598 else if (!creature_ptr->ult_res)
3600 msg_print(_("あらゆることに対して耐性がついた気がする!", "You feel resistant!"));
3607 if (creature_ptr->ult_res)
3609 msg_print(_("あらゆることに対する耐性が薄れた気がする。", "You feel less resistant"));
3614 creature_ptr->ult_res = v;
3615 creature_ptr->redraw |= (PR_STATUS);
3617 if (!notice) return FALSE;
3619 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
3620 creature_ptr->update |= (PU_BONUS);
3621 handle_stuff(creature_ptr);
3627 bool set_tim_res_nether(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
3629 bool notice = FALSE;
3630 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3632 if (creature_ptr->is_dead) return FALSE;
3636 if (creature_ptr->tim_res_nether && !do_dec)
3638 if (creature_ptr->tim_res_nether > v) return FALSE;
3640 else if (!creature_ptr->tim_res_nether)
3642 msg_print(_("地獄の力に対して耐性がついた気がする!", "You feel nether resistant!"));
3649 if (creature_ptr->tim_res_nether)
3651 msg_print(_("地獄の力に対する耐性が薄れた気がする。", "You feel less nether resistant"));
3656 creature_ptr->tim_res_nether = v;
3657 creature_ptr->redraw |= (PR_STATUS);
3659 if (!notice) return FALSE;
3661 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
3662 creature_ptr->update |= (PU_BONUS);
3663 handle_stuff(creature_ptr);
3668 bool set_tim_res_time(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
3670 bool notice = FALSE;
3671 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3672 if (creature_ptr->is_dead) return FALSE;
3676 if (creature_ptr->tim_res_time && !do_dec)
3678 if (creature_ptr->tim_res_time > v) return FALSE;
3680 else if (!creature_ptr->tim_res_time)
3682 msg_print(_("時間逆転の力に対して耐性がついた気がする!", "You feel time resistant!"));
3688 if (creature_ptr->tim_res_time)
3690 msg_print(_("時間逆転の力に対する耐性が薄れた気がする。", "You feel less time resistant"));
3695 creature_ptr->tim_res_time = v;
3696 creature_ptr->redraw |= (PR_STATUS);
3697 if (!notice) return FALSE;
3699 if (disturb_state) disturb(creature_ptr, FALSE, FALSE);
3700 creature_ptr->update |= (PU_BONUS);
3701 handle_stuff(creature_ptr);
3707 * Choose a warrior-mage elemental attack. -LM-
3709 bool choose_ele_attack(player_type *creature_ptr)
3711 if (!has_melee_weapon(creature_ptr, INVEN_RARM) && !has_melee_weapon(creature_ptr, INVEN_LARM))
3713 msg_format(_("武器を持たないと魔法剣は使えない。", "You cannot use temporary branding with no weapon."));
3718 int num = (creature_ptr->lev - 20) / 5;
3719 c_prt(TERM_RED, _(" a) 焼棄", " a) Fire Brand"), 2, 14);
3722 c_prt(TERM_L_WHITE,_(" b) 凍結", " b) Cold Brand"), 3, 14);
3727 c_prt(TERM_GREEN, _(" c) 毒殺", " c) Poison Brand"), 4, 14);
3732 c_prt(TERM_L_DARK, _(" d) 溶解", " d) Acid Brand"), 5, 14);
3737 c_prt(TERM_BLUE, _(" e) 電撃", " e) Elec Brand"), 6, 14);
3746 prt(_(" どの元素攻撃をしますか?", " Choose a temporary elemental brand "), 1, 14);
3748 char choice = inkey();
3750 if ((choice == 'a') || (choice == 'A'))
3751 set_ele_attack(creature_ptr, ATTACK_FIRE, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
3752 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
3753 set_ele_attack(creature_ptr, ATTACK_COLD, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
3754 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
3755 set_ele_attack(creature_ptr, ATTACK_POIS, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
3756 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
3757 set_ele_attack(creature_ptr, ATTACK_ACID, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
3758 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
3759 set_ele_attack(creature_ptr, ATTACK_ELEC, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
3762 msg_print(_("魔法剣を使うのをやめた。", "You cancel the temporary branding."));
3773 * Choose a elemental immune. -LM-
3775 bool choose_ele_immune(player_type *creature_ptr, TIME_EFFECT immune_turn)
3779 c_prt(TERM_RED, _(" a) 火炎", " a) Immunity to fire"), 2, 14);
3780 c_prt(TERM_L_WHITE,_(" b) 冷気", " b) Immunity to cold"), 3, 14);
3781 c_prt(TERM_L_DARK, _(" c) 酸", " c) Immunity to acid"), 4, 14);
3782 c_prt(TERM_BLUE, _(" d) 電撃", " d) Immunity to elec"), 5, 14);
3790 prt(_(" どの元素の免疫をつけますか?", " Choose a temporary elemental immunity "), 1, 14);
3792 char choice = inkey();
3794 if ((choice == 'a') || (choice == 'A'))
3795 set_ele_immune(creature_ptr, DEFENSE_FIRE, immune_turn);
3796 else if ((choice == 'b') || (choice == 'B'))
3797 set_ele_immune(creature_ptr, DEFENSE_COLD, immune_turn);
3798 else if ((choice == 'c') || (choice == 'C'))
3799 set_ele_immune(creature_ptr, DEFENSE_ACID, immune_turn);
3800 else if ((choice == 'd') || (choice == 'D'))
3801 set_ele_immune(creature_ptr, DEFENSE_ELEC, immune_turn);
3804 msg_print(_("免疫を付けるのをやめた。", "You cancel the temporary immunity."));
3813 bool_hack drop_weapons(player_type *creature_ptr)
3815 INVENTORY_IDX slot = 0;
3816 object_type *o_ptr = NULL;
3818 if (creature_ptr->wild_mode) return FALSE;
3821 if (has_melee_weapon(creature_ptr, INVEN_RARM))
3824 o_ptr = &creature_ptr->inventory_list[INVEN_RARM];
3826 if (has_melee_weapon(creature_ptr, INVEN_LARM) && one_in_(2))
3828 o_ptr = &creature_ptr->inventory_list[INVEN_LARM];
3832 else if (has_melee_weapon(creature_ptr, INVEN_LARM))
3834 o_ptr = &creature_ptr->inventory_list[INVEN_LARM];
3838 if (slot && !object_is_cursed(o_ptr))
3840 msg_print(_("武器を落としてしまった!", "You drop your weapon!"));
3841 drop_from_inventory(creature_ptr, slot, 1);