2 * @brief プレイヤーのステータス管理 / effects of various "objects"
5 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
7 * This software may be copied and distributed for educational, research,
8 * and not for profit purposes provided that this copyright and statement
9 * are included in all such copies. Other copyrights may also apply.
11 * 2013 Deskull rearranged comment for Doxygen.
14 #include "player/player-effects.h"
15 #include "autopick/autopick-reader-writer.h"
16 #include "birth/birth-body-spec.h"
17 #include "birth/birth-stat.h"
18 #include "birth/character-builder.h"
19 #include "cmd-building/cmd-building.h"
20 #include "cmd-io/cmd-dump.h"
21 #include "core/speed-table.h"
22 #include "core/stuff-handler.h"
23 #include "dungeon/quest.h"
24 #include "floor/floor.h"
25 #include "floor/wild.h"
26 #include "game-option/birth-options.h"
27 #include "game-option/disturbance-options.h"
28 #include "grid/grid.h"
29 #include "inventory/inventory-object.h"
30 #include "io/input-key-acceptor.h"
31 #include "io/report.h"
33 #include "locale/vowel-checker.h"
34 #include "mind/stances-table.h"
35 #include "mind/mind-force-trainer.h"
36 #include "mind/mind-sniper.h"
37 #include "monster/monster-status.h"
38 #include "mutation/mutation.h"
39 #include "object-enchant/artifact.h"
40 #include "object-enchant/item-feeling.h"
41 #include "object-enchant/object-ego.h"
42 #include "object-enchant/special-object-flags.h"
43 #include "object-enchant/trg-types.h"
44 #include "object-hook/hook-checker.h"
45 #include "object-hook/hook-enchant.h"
46 #include "object-hook/hook-weapon.h"
47 #include "object/object-generator.h"
48 #include "object/object-kind.h"
49 #include "object/object-value-calc.h"
50 #include "object/object-value.h"
51 #include "perception/object-perception.h"
52 #include "player/avatar.h"
53 #include "player/bad-status-setter.h"
54 #include "player/buff-setter.h"
55 #include "player/player-class.h"
56 #include "player/player-damage.h"
57 #include "player/player-move.h"
58 #include "player/player-personalities-types.h"
59 #include "player/player-personality.h"
60 #include "player/player-race-types.h"
61 #include "player/player-sex.h"
62 #include "player/player-status.h"
63 #include "player/race-info-table.h"
64 #include "realm/realm-song-numbers.h"
65 #include "spell-kind/spells-floor.h"
66 #include "spell-realm/spells-hex.h"
67 #include "spell/spells-status.h"
68 #include "sv-definition/sv-armor-types.h"
69 #include "sv-definition/sv-protector-types.h"
70 #include "sv-definition/sv-weapon-types.h"
71 #include "term/screen-processor.h"
72 #include "term/term-color-types.h"
73 #include "view/display-messages.h"
74 #include "world/world.h"
77 * @brief プレイヤーの継続行動を設定する。
78 * @param typ 継続行動のID\n
79 * #ACTION_NONE / #ACTION_SEARCH / #ACTION_REST / #ACTION_LEARN / #ACTION_FISH / #ACTION_KAMAE / #ACTION_KATA / #ACTION_SING / #ACTION_HAYAGAKE / #ACTION_SPELL
83 void set_action(player_type *creature_ptr, ACTION_IDX typ)
85 int prev_typ = creature_ptr->action;
87 if (typ == prev_typ) {
92 msg_print(_("探索をやめた。", "You no longer walk carefully."));
93 creature_ptr->redraw |= (PR_SPEED);
97 creature_ptr->resting = 0;
101 msg_print(_("学習をやめた。", "You stop learning."));
102 creature_ptr->new_mane = FALSE;
106 msg_print(_("構えをといた。", "You stop assuming the special stance."));
107 creature_ptr->special_defense &= ~(KAMAE_MASK);
111 msg_print(_("型を崩した。", "You stop assuming the special stance."));
112 creature_ptr->special_defense &= ~(KATA_MASK);
113 creature_ptr->update |= (PU_MONSTERS);
114 creature_ptr->redraw |= (PR_STATUS);
118 msg_print(_("歌うのをやめた。", "You stop singing."));
121 case ACTION_HAYAGAKE: {
122 msg_print(_("足が重くなった。", "You are no longer walking extremely fast."));
123 take_turn(creature_ptr, 100);
127 msg_print(_("呪文の詠唱を中断した。", "You stopped casting."));
133 creature_ptr->action = typ;
135 /* If we are requested other action, stop singing */
136 if (prev_typ == ACTION_SING)
137 stop_singing(creature_ptr);
138 if (prev_typ == ACTION_SPELL)
139 stop_hex_spell(creature_ptr);
141 switch (creature_ptr->action) {
142 case ACTION_SEARCH: {
143 msg_print(_("注意深く歩き始めた。", "You begin to walk carefully."));
144 creature_ptr->redraw |= (PR_SPEED);
148 msg_print(_("学習を始めた。", "You begin learning"));
152 msg_print(_("水面に糸を垂らした...", "You begin fishing..."));
155 case ACTION_HAYAGAKE: {
156 msg_print(_("足が羽のように軽くなった。", "You begin to walk extremely fast."));
163 creature_ptr->update |= (PU_BONUS);
164 creature_ptr->redraw |= (PR_STATE);
168 * @brief プレイヤーに魔力消去効果を与える。
171 void dispel_player(player_type *creature_ptr)
173 (void)set_fast(creature_ptr, 0, TRUE);
174 set_lightspeed(creature_ptr, 0, TRUE);
175 (void)set_slow(creature_ptr, 0, TRUE);
176 (void)set_shield(creature_ptr, 0, TRUE);
177 (void)set_blessed(creature_ptr, 0, TRUE);
178 (void)set_tsuyoshi(creature_ptr, 0, TRUE);
179 (void)set_hero(creature_ptr, 0, TRUE);
180 (void)set_shero(creature_ptr, 0, TRUE);
181 (void)set_protevil(creature_ptr, 0, TRUE);
182 (void)set_invuln(creature_ptr, 0, TRUE);
183 (void)set_wraith_form(creature_ptr, 0, TRUE);
184 (void)set_kabenuke(creature_ptr, 0, TRUE);
185 (void)set_tim_res_nether(creature_ptr, 0, TRUE);
186 (void)set_tim_res_time(creature_ptr, 0, TRUE);
187 (void)set_tim_reflect(creature_ptr, 0, TRUE);
188 (void)set_multishadow(creature_ptr, 0, TRUE);
189 (void)set_dustrobe(creature_ptr, 0, TRUE);
191 (void)set_tim_invis(creature_ptr, 0, TRUE);
192 (void)set_tim_infra(creature_ptr, 0, TRUE);
193 (void)set_tim_esp(creature_ptr, 0, TRUE);
194 (void)set_tim_regen(creature_ptr, 0, TRUE);
195 (void)set_tim_stealth(creature_ptr, 0, TRUE);
196 (void)set_tim_levitation(creature_ptr, 0, TRUE);
197 (void)set_tim_sh_touki(creature_ptr, 0, TRUE);
198 (void)set_tim_sh_fire(creature_ptr, 0, TRUE);
199 (void)set_tim_sh_holy(creature_ptr, 0, TRUE);
200 (void)set_tim_eyeeye(creature_ptr, 0, TRUE);
201 (void)set_magicdef(creature_ptr, 0, TRUE);
202 (void)set_resist_magic(creature_ptr, 0, TRUE);
203 (void)set_oppose_acid(creature_ptr, 0, TRUE);
204 (void)set_oppose_elec(creature_ptr, 0, TRUE);
205 (void)set_oppose_fire(creature_ptr, 0, TRUE);
206 (void)set_oppose_cold(creature_ptr, 0, TRUE);
207 (void)set_oppose_pois(creature_ptr, 0, TRUE);
208 (void)set_ultimate_res(creature_ptr, 0, TRUE);
209 (void)set_mimic(creature_ptr, 0, 0, TRUE);
210 (void)set_ele_attack(creature_ptr, 0, 0);
211 (void)set_ele_immune(creature_ptr, 0, 0);
213 if (creature_ptr->special_attack & ATTACK_CONFUSE) {
214 creature_ptr->special_attack &= ~(ATTACK_CONFUSE);
215 msg_print(_("手の輝きがなくなった。", "Your hands stop glowing."));
218 if (music_singing_any(creature_ptr) || hex_spelling_any(creature_ptr)) {
219 concptr str = (music_singing_any(creature_ptr)) ? _("歌", "singing") : _("呪文", "casting");
220 INTERUPTING_SONG_EFFECT(creature_ptr) = SINGING_SONG_EFFECT(creature_ptr);
221 SINGING_SONG_EFFECT(creature_ptr) = MUSIC_NONE;
222 msg_format(_("%sが途切れた。", "Your %s is interrupted."), str);
224 creature_ptr->action = ACTION_NONE;
225 creature_ptr->update |= (PU_BONUS | PU_HP | PU_MONSTERS);
226 creature_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
227 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
228 creature_ptr->energy_need += ENERGY_NEED();
233 * @brief 変身効果の継続時間と変身先をセットする / Set "tim_mimic", and "mimic_form", notice observable changes
236 * @param do_dec 現在の継続時間より長い値のみ上書きする
237 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
239 bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, MIMIC_RACE_IDX p, bool do_dec)
242 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
244 if (creature_ptr->is_dead)
248 if (creature_ptr->tim_mimic && (creature_ptr->mimic_form == p) && !do_dec) {
249 if (creature_ptr->tim_mimic > v)
251 } else if ((!creature_ptr->tim_mimic) || (creature_ptr->mimic_form != p)) {
252 msg_print(_("自分の体が変わってゆくのを感じた。", "You feel that your body changes."));
253 creature_ptr->mimic_form = p;
259 if (creature_ptr->tim_mimic) {
260 msg_print(_("変身が解けた。", "You are no longer transformed."));
261 if (creature_ptr->mimic_form == MIMIC_DEMON)
262 set_oppose_fire(creature_ptr, 0, TRUE);
263 creature_ptr->mimic_form = 0;
269 creature_ptr->tim_mimic = v;
274 disturb(creature_ptr, FALSE, TRUE);
276 creature_ptr->redraw |= (PR_BASIC | PR_STATUS);
277 creature_ptr->update |= (PU_BONUS | PU_HP);
279 handle_stuff(creature_ptr);
284 * @brief 狂戦士化の継続時間をセットする / Set "shero", notice observable changes
285 * @param v 継続時間/ 0ならば無条件にリセット
286 * @param do_dec FALSEの場合現在の継続時間より長い値のみ上書きする
287 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
289 bool set_shero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
292 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
294 if (creature_ptr->is_dead)
297 if (creature_ptr->pclass == CLASS_BERSERKER)
300 if (creature_ptr->shero && !do_dec) {
301 if (creature_ptr->shero > v)
303 } else if (!creature_ptr->shero) {
304 msg_print(_("殺戮マシーンになった気がする!", "You feel like a killing machine!"));
308 if (creature_ptr->shero) {
309 msg_print(_("野蛮な気持ちが消え失せた。", "You feel less berserk."));
314 creature_ptr->shero = v;
315 creature_ptr->redraw |= (PR_STATUS);
321 disturb(creature_ptr, FALSE, FALSE);
322 creature_ptr->update |= (PU_BONUS);
323 creature_ptr->update |= (PU_HP);
324 handle_stuff(creature_ptr);
329 * @brief 対邪悪結界の継続時間をセットする / Set "protevil", notice observable changes
331 * @param do_dec 現在の継続時間より長い値のみ上書きする
332 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
334 bool set_protevil(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
337 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
339 if (creature_ptr->is_dead)
343 if (creature_ptr->protevil && !do_dec) {
344 if (creature_ptr->protevil > v)
346 } else if (!creature_ptr->protevil) {
347 msg_print(_("邪悪なる存在から守られているような感じがする!", "You feel safe from evil!"));
351 if (creature_ptr->protevil) {
352 msg_print(_("邪悪なる存在から守られている感じがなくなった。", "You no longer feel safe from evil."));
357 creature_ptr->protevil = v;
358 creature_ptr->redraw |= (PR_STATUS);
364 disturb(creature_ptr, FALSE, FALSE);
365 handle_stuff(creature_ptr);
370 * @brief 幽体化の継続時間をセットする / Set "wraith_form", notice observable changes
372 * @param do_dec 現在の継続時間より長い値のみ上書きする
373 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
375 bool set_wraith_form(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
378 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
380 if (creature_ptr->is_dead)
384 if (creature_ptr->wraith_form && !do_dec) {
385 if (creature_ptr->wraith_form > v)
387 } else if (!creature_ptr->wraith_form) {
388 msg_print(_("物質界を離れて幽鬼のような存在になった!", "You leave the physical world and turn into a wraith-being!"));
390 chg_virtue(creature_ptr, V_UNLIFE, 3);
391 chg_virtue(creature_ptr, V_HONOUR, -2);
392 chg_virtue(creature_ptr, V_SACRIFICE, -2);
393 chg_virtue(creature_ptr, V_VALOUR, -5);
395 creature_ptr->redraw |= (PR_MAP);
396 creature_ptr->update |= (PU_MONSTERS);
398 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
401 if (creature_ptr->wraith_form) {
402 msg_print(_("不透明になった感じがする。", "You feel opaque."));
405 creature_ptr->redraw |= (PR_MAP);
406 creature_ptr->update |= (PU_MONSTERS);
408 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
412 creature_ptr->wraith_form = v;
413 creature_ptr->redraw |= (PR_STATUS);
419 disturb(creature_ptr, FALSE, FALSE);
420 creature_ptr->update |= (PU_BONUS);
421 handle_stuff(creature_ptr);
426 * @brief 無傷球の継続時間をセットする / Set "invuln", notice observable changes
428 * @param do_dec 現在の継続時間より長い値のみ上書きする
429 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
431 bool set_invuln(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
434 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
436 if (creature_ptr->is_dead)
440 if (creature_ptr->invuln && !do_dec) {
441 if (creature_ptr->invuln > v)
443 } else if (!is_invuln(creature_ptr)) {
444 msg_print(_("無敵だ!", "Invulnerability!"));
447 chg_virtue(creature_ptr, V_UNLIFE, -2);
448 chg_virtue(creature_ptr, V_HONOUR, -2);
449 chg_virtue(creature_ptr, V_SACRIFICE, -3);
450 chg_virtue(creature_ptr, V_VALOUR, -5);
452 creature_ptr->redraw |= (PR_MAP);
453 creature_ptr->update |= (PU_MONSTERS);
455 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
458 if (creature_ptr->invuln && !music_singing(creature_ptr, MUSIC_INVULN)) {
459 msg_print(_("無敵ではなくなった。", "The invulnerability wears off."));
462 creature_ptr->redraw |= (PR_MAP);
463 creature_ptr->update |= (PU_MONSTERS);
465 creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
467 creature_ptr->energy_need += ENERGY_NEED();
471 creature_ptr->invuln = v;
472 creature_ptr->redraw |= (PR_STATUS);
478 disturb(creature_ptr, FALSE, FALSE);
479 creature_ptr->update |= (PU_BONUS);
480 handle_stuff(creature_ptr);
485 * @brief 時限ESPの継続時間をセットする / Set "tim_esp", notice observable changes
487 * @param do_dec 現在の継続時間より長い値のみ上書きする
488 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
490 bool set_tim_esp(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
493 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
495 if (creature_ptr->is_dead)
499 if (creature_ptr->tim_esp && !do_dec) {
500 if (creature_ptr->tim_esp > v)
502 } else if (!is_time_limit_esp(creature_ptr)) {
503 msg_print(_("意識が広がった気がする!", "You feel your consciousness expand!"));
507 if (creature_ptr->tim_esp && !music_singing(creature_ptr, MUSIC_MIND)) {
508 msg_print(_("意識は元に戻った。", "Your consciousness contracts again."));
513 creature_ptr->tim_esp = v;
514 creature_ptr->redraw |= (PR_STATUS);
520 disturb(creature_ptr, FALSE, FALSE);
521 creature_ptr->update |= (PU_BONUS);
522 creature_ptr->update |= (PU_MONSTERS);
523 handle_stuff(creature_ptr);
528 * @brief 時限透明視の継続時間をセットする / Set "tim_invis", notice observable changes
530 * @param do_dec 現在の継続時間より長い値のみ上書きする
531 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
533 bool set_tim_invis(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
536 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
538 if (creature_ptr->is_dead)
542 if (creature_ptr->tim_invis && !do_dec) {
543 if (creature_ptr->tim_invis > v)
545 } else if (!creature_ptr->tim_invis) {
546 msg_print(_("目が非常に敏感になった気がする!", "Your eyes feel very sensitive!"));
550 if (creature_ptr->tim_invis) {
551 msg_print(_("目の敏感さがなくなったようだ。", "Your eyes feel less sensitive."));
556 creature_ptr->tim_invis = v;
557 creature_ptr->redraw |= (PR_STATUS);
563 disturb(creature_ptr, FALSE, FALSE);
564 creature_ptr->update |= (PU_BONUS);
565 creature_ptr->update |= (PU_MONSTERS);
566 handle_stuff(creature_ptr);
571 * @brief 時限赤外線視力の継続時間をセットする / Set "tim_infra", notice observable changes
573 * @param do_dec 現在の継続時間より長い値のみ上書きする
574 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
576 bool set_tim_infra(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
579 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
581 if (creature_ptr->is_dead)
585 if (creature_ptr->tim_infra && !do_dec) {
586 if (creature_ptr->tim_infra > v)
588 } else if (!creature_ptr->tim_infra) {
589 msg_print(_("目がランランと輝き始めた!", "Your eyes begin to tingle!"));
593 if (creature_ptr->tim_infra) {
594 msg_print(_("目の輝きがなくなった。", "Your eyes stop tingling."));
599 creature_ptr->tim_infra = v;
600 creature_ptr->redraw |= (PR_STATUS);
606 disturb(creature_ptr, FALSE, FALSE);
607 creature_ptr->update |= (PU_BONUS);
608 creature_ptr->update |= (PU_MONSTERS);
609 handle_stuff(creature_ptr);
614 * @brief 時限急回復の継続時間をセットする / Set "tim_regen", notice observable changes
616 * @param do_dec 現在の継続時間より長い値のみ上書きする
617 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
619 bool set_tim_regen(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
622 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
624 if (creature_ptr->is_dead)
628 if (creature_ptr->tim_regen && !do_dec) {
629 if (creature_ptr->tim_regen > v)
631 } else if (!creature_ptr->tim_regen) {
632 msg_print(_("回復力が上がった!", "You feel yourself regenerating quickly!"));
636 if (creature_ptr->tim_regen) {
637 msg_print(_("素早く回復する感じがなくなった。", "You feel yourself regenerating slowly."));
642 creature_ptr->tim_regen = v;
643 creature_ptr->redraw |= (PR_STATUS);
649 disturb(creature_ptr, FALSE, FALSE);
650 creature_ptr->update |= (PU_BONUS);
651 handle_stuff(creature_ptr);
656 * @brief 隠密の歌の継続時間をセットする / Set "tim_stealth", notice observable changes
658 * @param do_dec 現在の継続時間より長い値のみ上書きする
659 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
661 bool set_tim_stealth(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
664 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
666 if (creature_ptr->is_dead)
670 if (creature_ptr->tim_stealth && !do_dec) {
671 if (creature_ptr->tim_stealth > v)
673 } else if (!is_time_limit_stealth(creature_ptr)) {
674 msg_print(_("足音が小さくなった!", "You begin to walk silently!"));
678 if (creature_ptr->tim_stealth && !music_singing(creature_ptr, MUSIC_STEALTH)) {
679 msg_print(_("足音が大きくなった。", "You no longer walk silently."));
684 creature_ptr->tim_stealth = v;
685 creature_ptr->redraw |= (PR_STATUS);
691 disturb(creature_ptr, FALSE, FALSE);
692 creature_ptr->update |= (PU_BONUS);
693 handle_stuff(creature_ptr);
699 * @param set TRUEならば超隠密状態になる。
700 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
702 bool set_superstealth(player_type *creature_ptr, bool set)
706 if (creature_ptr->is_dead)
710 if (!(creature_ptr->special_defense & NINJA_S_STEALTH)) {
711 if (creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & CAVE_MNLT) {
712 msg_print(_("敵の目から薄い影の中に覆い隠された。", "You are mantled in weak shadow from ordinary eyes."));
713 creature_ptr->monlite = creature_ptr->old_monlite = TRUE;
715 msg_print(_("敵の目から影の中に覆い隠された!", "You are mantled in shadow from ordinary eyes!"));
716 creature_ptr->monlite = creature_ptr->old_monlite = FALSE;
720 creature_ptr->special_defense |= NINJA_S_STEALTH;
723 if (creature_ptr->special_defense & NINJA_S_STEALTH) {
724 msg_print(_("再び敵の目にさらされるようになった。", "You are exposed to common sight once more."));
726 creature_ptr->special_defense &= ~(NINJA_S_STEALTH);
732 creature_ptr->redraw |= (PR_STATUS);
735 disturb(creature_ptr, FALSE, FALSE);
740 * @brief 一時的浮遊の継続時間をセットする / Set "tim_levitation", notice observable changes
742 * @param do_dec 現在の継続時間より長い値のみ上書きする
743 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
745 bool set_tim_levitation(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
748 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
750 if (creature_ptr->is_dead)
754 if (creature_ptr->tim_levitation && !do_dec) {
755 if (creature_ptr->tim_levitation > v)
757 } else if (!creature_ptr->tim_levitation) {
758 msg_print(_("体が宙に浮き始めた。", "You begin to fly!"));
762 if (creature_ptr->tim_levitation) {
763 msg_print(_("もう宙に浮かべなくなった。", "You stop flying."));
768 creature_ptr->tim_levitation = v;
769 creature_ptr->redraw |= (PR_STATUS);
775 disturb(creature_ptr, FALSE, FALSE);
776 creature_ptr->update |= (PU_BONUS);
777 handle_stuff(creature_ptr);
782 * @brief 一時的闘気のオーラの継続時間をセットする / Set "tim_sh_touki", notice observable changes
784 * @param do_dec 現在の継続時間より長い値のみ上書きする
785 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
787 bool set_tim_sh_touki(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
790 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
792 if (creature_ptr->is_dead)
796 if (creature_ptr->tim_sh_touki && !do_dec) {
797 if (creature_ptr->tim_sh_touki > v)
799 } else if (!creature_ptr->tim_sh_touki) {
800 msg_print(_("体が闘気のオーラで覆われた。", "You are enveloped by an aura of the Force!"));
804 if (creature_ptr->tim_sh_touki) {
805 msg_print(_("闘気が消えた。", "The aura of the Force disappeared."));
810 creature_ptr->tim_sh_touki = v;
811 creature_ptr->redraw |= (PR_STATUS);
817 disturb(creature_ptr, FALSE, FALSE);
818 handle_stuff(creature_ptr);
823 * @brief 一時的火炎のオーラの継続時間をセットする / Set "tim_sh_fire", notice observable changes
825 * @param do_dec 現在の継続時間より長い値のみ上書きする
826 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
828 bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
831 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
833 if (creature_ptr->is_dead)
837 if (creature_ptr->tim_sh_fire && !do_dec) {
838 if (creature_ptr->tim_sh_fire > v)
840 } else if (!creature_ptr->tim_sh_fire) {
841 msg_print(_("体が炎のオーラで覆われた。", "You are enveloped by a fiery aura!"));
845 if (creature_ptr->tim_sh_fire) {
846 msg_print(_("炎のオーラが消えた。", "The fiery aura disappeared."));
851 creature_ptr->tim_sh_fire = v;
852 creature_ptr->redraw |= (PR_STATUS);
858 disturb(creature_ptr, FALSE, FALSE);
859 creature_ptr->update |= (PU_BONUS);
860 handle_stuff(creature_ptr);
865 * @brief 一時的聖なるのオーラの継続時間をセットする / Set "tim_sh_holy", notice observable changes
867 * @param do_dec 現在の継続時間より長い値のみ上書きする
868 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
870 bool set_tim_sh_holy(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
873 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
875 if (creature_ptr->is_dead)
879 if (creature_ptr->tim_sh_holy && !do_dec) {
880 if (creature_ptr->tim_sh_holy > v)
882 } else if (!creature_ptr->tim_sh_holy) {
883 msg_print(_("体が聖なるオーラで覆われた。", "You are enveloped by a holy aura!"));
887 if (creature_ptr->tim_sh_holy) {
888 msg_print(_("聖なるオーラが消えた。", "The holy aura disappeared."));
893 creature_ptr->tim_sh_holy = v;
894 creature_ptr->redraw |= (PR_STATUS);
900 disturb(creature_ptr, FALSE, FALSE);
901 creature_ptr->update |= (PU_BONUS);
902 handle_stuff(creature_ptr);
907 * @brief 目には目をの残り時間をセットする / Set "tim_eyeeye", notice observable changes
909 * @param do_dec 現在の継続時間より長い値のみ上書きする
910 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
912 bool set_tim_eyeeye(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
915 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
917 if (creature_ptr->is_dead)
921 if (creature_ptr->tim_eyeeye && !do_dec) {
922 if (creature_ptr->tim_eyeeye > v)
924 } else if (!creature_ptr->tim_eyeeye) {
925 msg_print(_("法の守り手になった気がした!", "You feel like a keeper of commandments!"));
929 if (creature_ptr->tim_eyeeye) {
930 msg_print(_("懲罰を執行することができなくなった。", "You no longer feel like a keeper."));
935 creature_ptr->tim_eyeeye = v;
936 creature_ptr->redraw |= (PR_STATUS);
942 disturb(creature_ptr, FALSE, FALSE);
943 creature_ptr->update |= (PU_BONUS);
944 handle_stuff(creature_ptr);
949 * @brief 一時的魔法防御の継続時間をセットする / Set "resist_magic", notice observable changes
951 * @param do_dec 現在の継続時間より長い値のみ上書きする
952 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
954 bool set_resist_magic(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
957 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
959 if (creature_ptr->is_dead)
963 if (creature_ptr->resist_magic && !do_dec) {
964 if (creature_ptr->resist_magic > v)
966 } else if (!creature_ptr->resist_magic) {
967 msg_print(_("魔法への耐性がついた。", "You have been protected from magic!"));
971 if (creature_ptr->resist_magic) {
972 msg_print(_("魔法に弱くなった。", "You are no longer protected from magic."));
977 creature_ptr->resist_magic = v;
978 creature_ptr->redraw |= (PR_STATUS);
984 disturb(creature_ptr, FALSE, FALSE);
985 creature_ptr->update |= (PU_BONUS);
986 handle_stuff(creature_ptr);
991 * @brief 一時的反射の継続時間をセットする / Set "tim_reflect", notice observable changes
993 * @param do_dec 現在の継続時間より長い値のみ上書きする
994 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
996 bool set_tim_reflect(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
999 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1001 if (creature_ptr->is_dead)
1005 if (creature_ptr->tim_reflect && !do_dec) {
1006 if (creature_ptr->tim_reflect > v)
1008 } else if (!creature_ptr->tim_reflect) {
1009 msg_print(_("体の表面が滑かになった気がする。", "Your body becames smooth."));
1013 if (creature_ptr->tim_reflect) {
1014 msg_print(_("体の表面が滑かでなくなった。", "Your body is no longer smooth."));
1019 creature_ptr->tim_reflect = v;
1020 creature_ptr->redraw |= (PR_STATUS);
1026 disturb(creature_ptr, FALSE, FALSE);
1027 creature_ptr->update |= (PU_BONUS);
1028 handle_stuff(creature_ptr);
1033 * Set "multishadow", notice observable changes
1035 bool set_multishadow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1037 bool notice = FALSE;
1038 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1040 if (creature_ptr->is_dead)
1044 if (creature_ptr->multishadow && !do_dec) {
1045 if (creature_ptr->multishadow > v)
1047 } else if (!creature_ptr->multishadow) {
1048 msg_print(_("あなたの周りに幻影が生まれた。", "Your Shadow enveloped you."));
1052 if (creature_ptr->multishadow) {
1053 msg_print(_("幻影が消えた。", "Your Shadow disappears."));
1058 creature_ptr->multishadow = v;
1059 creature_ptr->redraw |= (PR_STATUS);
1065 disturb(creature_ptr, FALSE, FALSE);
1066 creature_ptr->update |= (PU_BONUS);
1067 handle_stuff(creature_ptr);
1072 * @brief 一時的破片のオーラの継続時間をセットする / Set "dustrobe", notice observable changes
1074 * @param do_dec 現在の継続時間より長い値のみ上書きする
1075 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1077 bool set_dustrobe(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1079 bool notice = FALSE;
1080 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1082 if (creature_ptr->is_dead)
1086 if (creature_ptr->dustrobe && !do_dec) {
1087 if (creature_ptr->dustrobe > v)
1089 } else if (!creature_ptr->dustrobe) {
1090 msg_print(_("体が鏡のオーラで覆われた。", "You were enveloped by mirror shards."));
1094 if (creature_ptr->dustrobe) {
1095 msg_print(_("鏡のオーラが消えた。", "The mirror shards disappear."));
1100 creature_ptr->dustrobe = v;
1101 creature_ptr->redraw |= (PR_STATUS);
1107 disturb(creature_ptr, FALSE, FALSE);
1108 creature_ptr->update |= (PU_BONUS);
1109 handle_stuff(creature_ptr);
1114 * @brief 一時的壁抜けの継続時間をセットする / Set "kabenuke", notice observable changes
1116 * @param do_dec 現在の継続時間より長い値のみ上書きする
1117 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1119 bool set_kabenuke(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1121 bool notice = FALSE;
1122 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1124 if (creature_ptr->is_dead)
1128 if (creature_ptr->kabenuke && !do_dec) {
1129 if (creature_ptr->kabenuke > v)
1131 } else if (!creature_ptr->kabenuke) {
1132 msg_print(_("体が半物質の状態になった。", "You became ethereal."));
1136 if (creature_ptr->kabenuke) {
1137 msg_print(_("体が物質化した。", "You are no longer ethereal."));
1142 creature_ptr->kabenuke = v;
1143 creature_ptr->redraw |= (PR_STATUS);
1149 disturb(creature_ptr, FALSE, FALSE);
1150 creature_ptr->update |= (PU_BONUS);
1151 handle_stuff(creature_ptr);
1156 * @brief オクレ兄さんの継続時間をセットする / Set "tsuyoshi", notice observable changes
1158 * @param do_dec 現在の継続時間より長い値のみ上書きする
1159 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1161 bool set_tsuyoshi(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)
1170 if (creature_ptr->tsuyoshi && !do_dec) {
1171 if (creature_ptr->tsuyoshi > v)
1173 } else if (!creature_ptr->tsuyoshi) {
1174 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
1176 chg_virtue(creature_ptr, V_VITALITY, 2);
1179 if (creature_ptr->tsuyoshi) {
1180 msg_print(_("肉体が急速にしぼんでいった。", "Your body has quickly shriveled."));
1182 (void)dec_stat(creature_ptr, A_CON, 20, TRUE);
1183 (void)dec_stat(creature_ptr, A_STR, 20, TRUE);
1186 chg_virtue(creature_ptr, V_VITALITY, -3);
1190 creature_ptr->tsuyoshi = v;
1191 creature_ptr->redraw |= (PR_STATUS);
1197 disturb(creature_ptr, FALSE, FALSE);
1198 creature_ptr->update |= (PU_BONUS);
1199 creature_ptr->update |= (PU_HP);
1200 handle_stuff(creature_ptr);
1205 * @brief 一時的元素スレイの継続時間をセットする / Set a temporary elemental brand. Clear all other brands. Print status messages. -LM-
1206 * @param attack_type スレイのタイプID
1208 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1210 bool set_ele_attack(player_type *creature_ptr, u32b attack_type, TIME_EFFECT v)
1212 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1214 if ((creature_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID)) {
1215 creature_ptr->special_attack &= ~(ATTACK_ACID);
1216 msg_print(_("酸で攻撃できなくなった。", "Your temporary acidic brand fades away."));
1219 if ((creature_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC)) {
1220 creature_ptr->special_attack &= ~(ATTACK_ELEC);
1221 msg_print(_("電撃で攻撃できなくなった。", "Your temporary electrical brand fades away."));
1224 if ((creature_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE)) {
1225 creature_ptr->special_attack &= ~(ATTACK_FIRE);
1226 msg_print(_("火炎で攻撃できなくなった。", "Your temporary fiery brand fades away."));
1229 if ((creature_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD)) {
1230 creature_ptr->special_attack &= ~(ATTACK_COLD);
1231 msg_print(_("冷気で攻撃できなくなった。", "Your temporary frost brand fades away."));
1234 if ((creature_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS)) {
1235 creature_ptr->special_attack &= ~(ATTACK_POIS);
1236 msg_print(_("毒で攻撃できなくなった。", "Your temporary poison brand fades away."));
1239 if ((v) && (attack_type)) {
1240 creature_ptr->special_attack |= (attack_type);
1241 creature_ptr->ele_attack = v;
1243 msg_format("%sで攻撃できるようになった!",
1244 ((attack_type == ATTACK_ACID)
1246 : ((attack_type == ATTACK_ELEC)
1248 : ((attack_type == ATTACK_FIRE) ? "火炎"
1249 : ((attack_type == ATTACK_COLD) ? "冷気" : ((attack_type == ATTACK_POIS) ? "毒" : "(なし)"))))));
1251 msg_format("For a while, the blows you deal will %s",
1252 ((attack_type == ATTACK_ACID)
1254 : ((attack_type == ATTACK_ELEC)
1255 ? "shock your foes!"
1256 : ((attack_type == ATTACK_FIRE)
1258 : ((attack_type == ATTACK_COLD) ? "chill to the bone!"
1259 : ((attack_type == ATTACK_POIS) ? "poison your enemies!" : "do nothing special."))))));
1264 disturb(creature_ptr, FALSE, FALSE);
1265 creature_ptr->redraw |= (PR_STATUS);
1266 creature_ptr->update |= (PU_BONUS);
1267 handle_stuff(creature_ptr);
1273 * @brief 一時的元素免疫の継続時間をセットする / Set a temporary elemental brand. Clear all other brands. Print status messages. -LM-
1274 * @param immune_type 免疫のタイプID
1276 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1278 bool set_ele_immune(player_type *creature_ptr, u32b immune_type, TIME_EFFECT v)
1280 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1282 if ((creature_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID)) {
1283 creature_ptr->special_defense &= ~(DEFENSE_ACID);
1284 msg_print(_("酸の攻撃で傷つけられるようになった。。", "You are no longer immune to acid."));
1287 if ((creature_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC)) {
1288 creature_ptr->special_defense &= ~(DEFENSE_ELEC);
1289 msg_print(_("電撃の攻撃で傷つけられるようになった。。", "You are no longer immune to electricity."));
1292 if ((creature_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE)) {
1293 creature_ptr->special_defense &= ~(DEFENSE_FIRE);
1294 msg_print(_("火炎の攻撃で傷つけられるようになった。。", "You are no longer immune to fire."));
1297 if ((creature_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD)) {
1298 creature_ptr->special_defense &= ~(DEFENSE_COLD);
1299 msg_print(_("冷気の攻撃で傷つけられるようになった。。", "You are no longer immune to cold."));
1302 if ((creature_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS)) {
1303 creature_ptr->special_defense &= ~(DEFENSE_POIS);
1304 msg_print(_("毒の攻撃で傷つけられるようになった。。", "You are no longer immune to poison."));
1307 if ((v) && (immune_type)) {
1308 creature_ptr->special_defense |= (immune_type);
1309 creature_ptr->ele_immune = v;
1310 msg_format(_("%sの攻撃を受けつけなくなった!", "For a while, You are immune to %s"),
1311 ((immune_type == DEFENSE_ACID)
1313 : ((immune_type == DEFENSE_ELEC)
1314 ? _("電撃", "electricity!")
1315 : ((immune_type == DEFENSE_FIRE)
1317 : ((immune_type == DEFENSE_COLD)
1319 : ((immune_type == DEFENSE_POIS) ? _("毒", "poison!") : _("(なし)", "do nothing special.")))))));
1323 disturb(creature_ptr, FALSE, FALSE);
1324 creature_ptr->redraw |= (PR_STATUS);
1325 creature_ptr->update |= (PU_BONUS);
1326 handle_stuff(creature_ptr);
1332 * @brief 一時的酸耐性の継続時間をセットする / Set "oppose_acid", notice observable changes
1334 * @param do_dec 現在の継続時間より長い値のみ上書きする
1335 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1337 bool set_oppose_acid(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1339 bool notice = FALSE;
1340 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1341 if (creature_ptr->is_dead)
1345 if (creature_ptr->oppose_acid && !do_dec) {
1346 if (creature_ptr->oppose_acid > v)
1348 } else if (!is_oppose_acid(creature_ptr)) {
1349 msg_print(_("酸への耐性がついた気がする!", "You feel resistant to acid!"));
1353 if (creature_ptr->oppose_acid && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU)) {
1354 msg_print(_("酸への耐性が薄れた気がする。", "You feel less resistant to acid."));
1359 creature_ptr->oppose_acid = v;
1363 creature_ptr->redraw |= (PR_STATUS);
1366 disturb(creature_ptr, FALSE, FALSE);
1367 handle_stuff(creature_ptr);
1372 * @brief 一時的電撃耐性の継続時間をセットする / Set "oppose_elec", notice observable changes
1374 * @param do_dec 現在の継続時間より長い値のみ上書きする
1375 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1377 bool set_oppose_elec(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1379 bool notice = FALSE;
1380 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1382 if (creature_ptr->is_dead)
1386 if (creature_ptr->oppose_elec && !do_dec) {
1387 if (creature_ptr->oppose_elec > v)
1389 } else if (!is_oppose_elec(creature_ptr)) {
1390 msg_print(_("電撃への耐性がついた気がする!", "You feel resistant to electricity!"));
1394 if (creature_ptr->oppose_elec && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU)) {
1395 msg_print(_("電撃への耐性が薄れた気がする。", "You feel less resistant to electricity."));
1400 creature_ptr->oppose_elec = v;
1404 creature_ptr->redraw |= (PR_STATUS);
1407 disturb(creature_ptr, FALSE, FALSE);
1408 handle_stuff(creature_ptr);
1413 * @brief 一時的火炎耐性の継続時間をセットする / Set "oppose_fire", notice observable changes
1415 * @param do_dec 現在の継続時間より長い値のみ上書きする
1416 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1418 bool set_oppose_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1420 bool notice = FALSE;
1421 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1422 if (creature_ptr->is_dead)
1425 if ((is_specific_player_race(creature_ptr, RACE_BALROG) && (creature_ptr->lev > 44)) || (creature_ptr->mimic_form == MIMIC_DEMON))
1428 if (creature_ptr->oppose_fire && !do_dec) {
1429 if (creature_ptr->oppose_fire > v)
1431 } else if (!is_oppose_fire(creature_ptr)) {
1432 msg_print(_("火への耐性がついた気がする!", "You feel resistant to fire!"));
1436 if (creature_ptr->oppose_fire && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU)) {
1437 msg_print(_("火への耐性が薄れた気がする。", "You feel less resistant to fire."));
1442 creature_ptr->oppose_fire = v;
1446 creature_ptr->redraw |= (PR_STATUS);
1449 disturb(creature_ptr, FALSE, FALSE);
1450 handle_stuff(creature_ptr);
1455 * @brief 一時的冷気耐性の継続時間をセットする / Set "oppose_cold", notice observable changes
1457 * @param do_dec 現在の継続時間より長い値のみ上書きする
1458 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1460 bool set_oppose_cold(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1462 bool notice = FALSE;
1463 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1464 if (creature_ptr->is_dead)
1468 if (creature_ptr->oppose_cold && !do_dec) {
1469 if (creature_ptr->oppose_cold > v)
1471 } else if (!is_oppose_cold(creature_ptr)) {
1472 msg_print(_("冷気への耐性がついた気がする!", "You feel resistant to cold!"));
1476 if (creature_ptr->oppose_cold && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU)) {
1477 msg_print(_("冷気への耐性が薄れた気がする。", "You feel less resistant to cold."));
1482 creature_ptr->oppose_cold = v;
1486 creature_ptr->redraw |= (PR_STATUS);
1489 disturb(creature_ptr, FALSE, FALSE);
1490 handle_stuff(creature_ptr);
1495 * @brief 一時的毒耐性の継続時間をセットする / Set "oppose_pois", notice observable changes
1497 * @param do_dec 現在の継続時間より長い値のみ上書きする
1498 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1500 bool set_oppose_pois(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
1502 bool notice = FALSE;
1503 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1504 if ((creature_ptr->pclass == CLASS_NINJA) && (creature_ptr->lev > 44))
1506 if (creature_ptr->is_dead)
1510 if (creature_ptr->oppose_pois && !do_dec) {
1511 if (creature_ptr->oppose_pois > v)
1513 } else if (!is_oppose_pois(creature_ptr)) {
1514 msg_print(_("毒への耐性がついた気がする!", "You feel resistant to poison!"));
1518 if (creature_ptr->oppose_pois && !music_singing(creature_ptr, MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU)) {
1519 msg_print(_("毒への耐性が薄れた気がする。", "You feel less resistant to poison."));
1524 creature_ptr->oppose_pois = v;
1527 creature_ptr->redraw |= (PR_STATUS);
1530 disturb(creature_ptr, FALSE, FALSE);
1531 handle_stuff(creature_ptr);
1536 * @brief 空腹状態をセットする / Set "food", notice observable changes
1538 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
1540 * Set "", notice observable changes\n
1542 * The "food" variable can get as large as 20000, allowing the
1543 * addition of the most "filling" item, Elvish Waybread, which adds
1544 * 7500 food units, without overflowing the 32767 maximum limit.\n
1546 * Perhaps we should disturb the player with various messages,
1547 * especially messages about hunger status changes. \n
1549 * Digestion of food is handled in "dungeon.c", in which, normally,
1550 * the player digests about 20 food units per 100 game turns, more
1551 * when "fast", more when "regenerating", less with "slow digestion",
1552 * but when the player is "gorged", he digests 100 food units per 10
1553 * game turns, or a full 1000 food units per 100 game turns.\n
1555 * Note that the player's speed is reduced by 10 units while gorged,
1556 * so if the player eats a single food ration (5000 food units) when
1557 * full (15000 food units), he will be gorged for (5000/100)*10 = 500
1558 * game turns, or 500/(100/5) = 25 player turns (if nothing else is
1559 * affecting the player speed).\n
1561 bool set_food(player_type *creature_ptr, TIME_EFFECT v)
1563 int old_aux, new_aux;
1565 bool notice = FALSE;
1566 v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
1567 if (creature_ptr->food < PY_FOOD_FAINT) {
1569 } else if (creature_ptr->food < PY_FOOD_WEAK) {
1571 } else if (creature_ptr->food < PY_FOOD_ALERT) {
1573 } else if (creature_ptr->food < PY_FOOD_FULL) {
1575 } else if (creature_ptr->food < PY_FOOD_MAX) {
1581 if (v < PY_FOOD_FAINT) {
1583 } else if (v < PY_FOOD_WEAK) {
1585 } else if (v < PY_FOOD_ALERT) {
1587 } else if (v < PY_FOOD_FULL) {
1589 } else if (v < PY_FOOD_MAX) {
1595 if (old_aux < 1 && new_aux > 0)
1596 chg_virtue(creature_ptr, V_PATIENCE, 2);
1597 else if (old_aux < 3 && (old_aux != new_aux))
1598 chg_virtue(creature_ptr, V_PATIENCE, 1);
1600 chg_virtue(creature_ptr, V_TEMPERANCE, 1);
1602 chg_virtue(creature_ptr, V_TEMPERANCE, -1);
1604 if (new_aux > old_aux) {
1607 msg_print(_("まだ空腹で倒れそうだ。", "You are still weak."));
1610 msg_print(_("まだ空腹だ。", "You are still hungry."));
1613 msg_print(_("空腹感がおさまった。", "You are no longer hungry."));
1616 msg_print(_("満腹だ!", "You are full!"));
1620 msg_print(_("食べ過ぎだ!", "You have gorged yourself!"));
1621 chg_virtue(creature_ptr, V_HARMONY, -1);
1622 chg_virtue(creature_ptr, V_PATIENCE, -1);
1623 chg_virtue(creature_ptr, V_TEMPERANCE, -2);
1628 } else if (new_aux < old_aux) {
1631 msg_print(_("あまりにも空腹で気を失ってしまった!", "You are getting faint from hunger!"));
1634 msg_print(_("お腹が空いて倒れそうだ。", "You are getting weak from hunger!"));
1637 msg_print(_("お腹が空いてきた。", "You are getting hungry."));
1640 msg_print(_("満腹感がなくなった。", "You are no longer full."));
1643 msg_print(_("やっとお腹がきつくなくなった。", "You are no longer gorged."));
1647 if (creature_ptr->wild_mode && (new_aux < 2)) {
1648 change_wild_mode(creature_ptr, FALSE);
1654 creature_ptr->food = v;
1659 disturb(creature_ptr, FALSE, FALSE);
1660 creature_ptr->update |= (PU_BONUS);
1661 creature_ptr->redraw |= (PR_HUNGER);
1662 handle_stuff(creature_ptr);
1668 * @brief プレイヤーの基本能力値を増加させる / Increases a stat by one randomized level -RAK-
1669 * @param stat 上昇させるステータスID
1670 * @return 実際に上昇した場合TRUEを返す。
1672 * Note that this function (used by stat potions) now restores\n
1673 * the stat BEFORE increasing it.\n
1675 bool inc_stat(player_type *creature_ptr, int stat)
1678 BASE_STATUS value = creature_ptr->stat_cur[stat];
1680 if (value < creature_ptr->stat_max_max[stat]) {
1682 gain = ((randint0(100) < 75) ? 1 : 2);
1684 } else if (value < (creature_ptr->stat_max_max[stat] - 2)) {
1685 gain = (((creature_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
1689 value += randint1(gain) + gain / 2;
1690 if (value > (creature_ptr->stat_max_max[stat] - 1))
1691 value = creature_ptr->stat_max_max[stat] - 1;
1696 creature_ptr->stat_cur[stat] = value;
1697 if (value > creature_ptr->stat_max[stat]) {
1698 creature_ptr->stat_max[stat] = value;
1701 creature_ptr->update |= (PU_BONUS);
1709 * @brief プレイヤーの基本能力値を減少させる / Decreases a stat by an amount indended to vary from 0 to 100 percent.
1710 * @param stat 減少させるステータスID
1711 * @param amount 減少させる基本量
1712 * @param permanent TRUEならば現在の最大値を減少させる
1713 * @return 実際に減少した場合TRUEを返す。
1716 * Amount could be a little higher in extreme cases to mangle very high\n
1717 * stats from massive assaults. -CWS\n
1719 * Note that "permanent" means that the *given* amount is permanent,\n
1720 * not that the new value becomes permanent. This may not work exactly\n
1721 * as expected, due to "weirdness" in the algorithm, but in general,\n
1722 * if your stat is already drained, the "max" value will not drop all\n
1723 * the way down to the "cur" value.\n
1725 bool dec_stat(player_type *creature_ptr, int stat, int amount, int permanent)
1730 BASE_STATUS cur = creature_ptr->stat_cur[stat];
1731 BASE_STATUS max = creature_ptr->stat_max[stat];
1732 int same = (cur == max);
1743 loss = (((cur - 18) / 2 + 1) / 2 + 1);
1747 loss = ((randint1(loss) + loss) * amount) / 100;
1748 if (loss < amount / 2)
1753 cur = (amount <= 20) ? 18 : 17;
1759 if (cur != creature_ptr->stat_cur[stat])
1763 if (permanent && (max > 3)) {
1764 chg_virtue(creature_ptr, V_SACRIFICE, 1);
1765 if (stat == A_WIS || stat == A_INT)
1766 chg_virtue(creature_ptr, V_ENLIGHTEN, -2);
1777 loss = (((max - 18) / 2 + 1) / 2 + 1);
1778 loss = ((randint1(loss) + loss) * amount) / 100;
1779 if (loss < amount / 2)
1784 max = (amount <= 20) ? 18 : 17;
1787 if (same || (max < cur))
1790 if (max != creature_ptr->stat_max[stat])
1795 creature_ptr->stat_cur[stat] = cur;
1796 creature_ptr->stat_max[stat] = max;
1797 creature_ptr->redraw |= (PR_STATS);
1798 creature_ptr->update |= (PU_BONUS);
1805 * @brief プレイヤーの基本能力値を回復させる / Restore a stat. Return TRUE only if this actually makes a difference.
1806 * @param stat 回復ステータスID
1807 * @return 実際に回復した場合TRUEを返す。
1809 bool res_stat(player_type *creature_ptr, int stat)
1811 if (creature_ptr->stat_cur[stat] != creature_ptr->stat_max[stat]) {
1812 creature_ptr->stat_cur[stat] = creature_ptr->stat_max[stat];
1813 creature_ptr->update |= (PU_BONUS);
1814 creature_ptr->redraw |= (PR_STATS);
1822 * Increase players hit points, notice effects
1824 bool hp_player(player_type *creature_ptr, int num)
1827 vir = virtue_number(creature_ptr, V_VITALITY);
1833 num = num * (creature_ptr->virtues[vir - 1] + 1250) / 1250;
1836 if (creature_ptr->chp < creature_ptr->mhp) {
1837 if ((num > 0) && (creature_ptr->chp < (creature_ptr->mhp / 3)))
1838 chg_virtue(creature_ptr, V_TEMPERANCE, 1);
1840 creature_ptr->chp += num;
1841 if (creature_ptr->chp >= creature_ptr->mhp) {
1842 creature_ptr->chp = creature_ptr->mhp;
1843 creature_ptr->chp_frac = 0;
1846 creature_ptr->redraw |= (PR_HP);
1847 creature_ptr->window |= (PW_PLAYER);
1849 msg_print(_("少し気分が良くなった。", "You feel a little better."));
1850 } else if (num < 15) {
1851 msg_print(_("気分が良くなった。", "You feel better."));
1852 } else if (num < 35) {
1853 msg_print(_("とても気分が良くなった。", "You feel much better."));
1855 msg_print(_("ひじょうに気分が良くなった。", "You feel very good."));
1865 * Array of stat "descriptions"
1867 static concptr desc_stat_pos[]
1868 = { _("強く", "stronger"), _("知的に", "smarter"), _("賢く", "wiser"), _("器用に", "more dextrous"), _("健康に", "healthier"), _("美しく", "cuter") };
1871 * Array of stat "descriptions"
1873 static concptr desc_stat_neg[]
1874 = { _("弱く", "weaker"), _("無知に", "stupider"), _("愚かに", "more naive"), _("不器用に", "clumsier"), _("不健康に", "more sickly"), _("醜く", "uglier") };
1879 bool do_dec_stat(player_type *creature_ptr, int stat)
1883 /* Access the "sustain" */
1886 if (creature_ptr->sustain_str)
1890 if (creature_ptr->sustain_int)
1894 if (creature_ptr->sustain_wis)
1898 if (creature_ptr->sustain_dex)
1902 if (creature_ptr->sustain_con)
1906 if (creature_ptr->sustain_chr)
1911 if (sust && (!ironman_nightmare || randint0(13))) {
1912 msg_format(_("%sなった気がしたが、すぐに元に戻った。", "You feel %s for a moment, but the feeling passes."), desc_stat_neg[stat]);
1917 if (dec_stat(creature_ptr, stat, 10, (ironman_nightmare && !randint0(13)))) {
1918 msg_format(_("ひどく%sなった気がする。", "You feel %s."), desc_stat_neg[stat]);
1927 * Restore lost "points" in a stat
1929 bool do_res_stat(player_type *creature_ptr, int stat)
1931 if (res_stat(creature_ptr, stat)) {
1932 msg_format(_("元通りに%sなった気がする。", "You feel %s."), desc_stat_pos[stat]);
1940 * Gain a "point" in a stat
1942 bool do_inc_stat(player_type *creature_ptr, int stat)
1944 bool res = res_stat(creature_ptr, stat);
1945 if (inc_stat(creature_ptr, stat)) {
1946 if (stat == A_WIS) {
1947 chg_virtue(creature_ptr, V_ENLIGHTEN, 1);
1948 chg_virtue(creature_ptr, V_FAITH, 1);
1949 } else if (stat == A_INT) {
1950 chg_virtue(creature_ptr, V_KNOWLEDGE, 1);
1951 chg_virtue(creature_ptr, V_ENLIGHTEN, 1);
1952 } else if (stat == A_CON)
1953 chg_virtue(creature_ptr, V_VITALITY, 1);
1955 msg_format(_("ワーオ!とても%sなった!", "Wow! You feel %s!"), desc_stat_pos[stat]);
1960 msg_format(_("元通りに%sなった気がする。", "You feel %s."), desc_stat_pos[stat]);
1968 * Restores any drained experience
1970 bool restore_level(player_type *creature_ptr)
1972 if (creature_ptr->exp < creature_ptr->max_exp) {
1973 msg_print(_("経験値が戻ってきた気がする。", "You feel your experience returning."));
1974 creature_ptr->exp = creature_ptr->max_exp;
1975 check_experience(creature_ptr);
1985 bool lose_all_info(player_type *creature_ptr)
1987 chg_virtue(creature_ptr, V_KNOWLEDGE, -5);
1988 chg_virtue(creature_ptr, V_ENLIGHTEN, -5);
1989 for (int i = 0; i < INVEN_TOTAL; i++) {
1990 object_type *o_ptr = &creature_ptr->inventory_list[i];
1993 if (object_is_fully_known(o_ptr))
1996 o_ptr->feeling = FEEL_NONE;
1997 o_ptr->ident &= ~(IDENT_EMPTY);
1998 o_ptr->ident &= ~(IDENT_KNOWN);
1999 o_ptr->ident &= ~(IDENT_SENSE);
2002 creature_ptr->update |= (PU_BONUS);
2003 creature_ptr->update |= (PU_COMBINE | PU_REORDER);
2004 creature_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2005 wiz_dark(creature_ptr);
2009 void do_poly_wounds(player_type *creature_ptr)
2011 s16b wounds = creature_ptr->cut;
2012 s16b hit_p = (creature_ptr->mhp - creature_ptr->chp);
2013 s16b change = damroll(creature_ptr->lev, 5);
2014 bool Nasty_effect = one_in_(5);
2015 if (!(wounds || hit_p || Nasty_effect))
2018 msg_print(_("傷がより軽いものに変化した。", "Your wounds are polymorphed into less serious ones."));
2019 hp_player(creature_ptr, change);
2021 msg_print(_("新たな傷ができた!", "A new wound was created!"));
2022 take_hit(creature_ptr, DAMAGE_LOSELIFE, change / 2, _("変化した傷", "a polymorphed wound"), -1);
2023 set_cut(creature_ptr, change);
2025 set_cut(creature_ptr, creature_ptr->cut - (change / 2));
2030 * Change player race
2032 void change_race(player_type *creature_ptr, player_race_type new_race, concptr effect_msg)
2034 concptr title = race_info[new_race].title;
2035 int old_race = creature_ptr->prace;
2037 msg_format("あなたは%s%sに変化した!", effect_msg, title);
2039 msg_format("You turn into %s %s%s!", (!effect_msg[0] && is_a_vowel(title[0]) ? "an" : "a"), effect_msg, title);
2042 chg_virtue(creature_ptr, V_CHANCE, 2);
2043 if (creature_ptr->prace < 32) {
2044 creature_ptr->old_race1 |= 1L << creature_ptr->prace;
2046 creature_ptr->old_race2 |= 1L << (creature_ptr->prace - 32);
2049 creature_ptr->prace = new_race;
2050 rp_ptr = &race_info[creature_ptr->prace];
2051 creature_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
2053 bool is_special_class = creature_ptr->pclass == CLASS_MONK;
2054 is_special_class |= creature_ptr->pclass == CLASS_FORCETRAINER;
2055 is_special_class |= creature_ptr->pclass == CLASS_NINJA;
2056 bool is_special_race = creature_ptr->prace == RACE_KLACKON;
2057 is_special_race |= creature_ptr->prace == RACE_SPRITE;
2058 if (is_special_class && is_special_race)
2059 creature_ptr->expfact -= 15;
2061 get_height_weight(creature_ptr);
2063 if (creature_ptr->pclass == CLASS_SORCERER)
2064 creature_ptr->hitdie = rp_ptr->r_mhp / 2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
2066 creature_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
2068 roll_hitdice(creature_ptr, 0L);
2069 check_experience(creature_ptr);
2070 creature_ptr->redraw |= (PR_BASIC);
2071 creature_ptr->update |= (PU_BONUS);
2072 handle_stuff(creature_ptr);
2074 if (old_race != creature_ptr->prace)
2075 autopick_load_pref(creature_ptr, FALSE);
2077 lite_spot(creature_ptr, creature_ptr->y, creature_ptr->x);
2080 void do_poly_self(player_type *creature_ptr)
2082 int power = creature_ptr->lev;
2084 msg_print(_("あなたは変化の訪れを感じた...", "You feel a change coming over you..."));
2085 chg_virtue(creature_ptr, V_CHANCE, 1);
2087 if ((power > randint0(20)) && one_in_(3) && (creature_ptr->prace != RACE_ANDROID)) {
2088 char effect_msg[80] = "";
2089 player_race_type new_race;
2092 if ((power > randint0(5)) && one_in_(4)) {
2094 if (creature_ptr->psex == SEX_MALE) {
2095 creature_ptr->psex = SEX_FEMALE;
2096 sp_ptr = &sex_info[creature_ptr->psex];
2097 sprintf(effect_msg, _("女性の", "female "));
2099 creature_ptr->psex = SEX_MALE;
2100 sp_ptr = &sex_info[creature_ptr->psex];
2101 sprintf(effect_msg, _("男性の", "male "));
2105 if ((power > randint0(30)) && one_in_(5)) {
2108 while (tmp < A_MAX) {
2110 (void)dec_stat(creature_ptr, tmp, randint1(6) + 6, one_in_(3));
2116 (void)dec_stat(creature_ptr, A_CHR, randint1(6), TRUE);
2118 if (effect_msg[0]) {
2120 sprintf(tmp_msg, _("%s", "%s "), effect_msg);
2121 sprintf(effect_msg, _("奇形の%s", "deformed %s "), tmp_msg);
2123 sprintf(effect_msg, _("奇形の", "deformed "));
2127 while ((power > randint0(20)) && one_in_(10)) {
2130 if (!lose_mutation(creature_ptr, 0))
2131 msg_print(_("奇妙なくらい普通になった気がする。", "You feel oddly normal."));
2135 new_race = (player_race_type)randint0(MAX_RACES);
2136 } while ((new_race == creature_ptr->prace) || (new_race == RACE_ANDROID));
2138 change_race(creature_ptr, new_race, effect_msg);
2141 if ((power > randint0(30)) && one_in_(6)) {
2144 msg_format(_("%sの構成が変化した!", "Your internal organs are rearranged!"), creature_ptr->prace == RACE_ANDROID ? "機械" : "内臓");
2146 while (tmp < A_MAX) {
2147 (void)dec_stat(creature_ptr, tmp, randint1(6) + 6, one_in_(3));
2151 msg_print(_("現在の姿で生きていくのは困難なようだ!", "You find living difficult in your present form!"));
2152 take_hit(creature_ptr, DAMAGE_LOSELIFE, damroll(randint1(10), creature_ptr->lev), _("致命的な突然変異", "a lethal mutation"), -1);
2158 if ((power > randint0(20)) && one_in_(4)) {
2161 get_max_stats(creature_ptr);
2162 roll_hitdice(creature_ptr, 0L);
2165 while ((power > randint0(15)) && one_in_(3)) {
2167 (void)gain_mutation(creature_ptr, 0);
2170 if (power > randint0(5)) {
2172 do_poly_wounds(creature_ptr);
2176 status_shuffle(creature_ptr);
2184 void gain_exp_64(player_type *creature_ptr, s32b amount, u32b amount_frac)
2186 if (creature_ptr->is_dead)
2188 if (creature_ptr->prace == RACE_ANDROID)
2191 s64b_add(&(creature_ptr->exp), &(creature_ptr->exp_frac), amount, amount_frac);
2193 if (creature_ptr->exp < creature_ptr->max_exp) {
2194 creature_ptr->max_exp += amount / 5;
2197 check_experience(creature_ptr);
2203 void gain_exp(player_type *creature_ptr, s32b amount) { gain_exp_64(creature_ptr, amount, 0L); }
2205 void calc_android_exp(player_type *creature_ptr)
2208 if (creature_ptr->is_dead)
2210 if (creature_ptr->prace != RACE_ANDROID)
2213 for (int i = INVEN_RARM; i < INVEN_TOTAL; i++) {
2214 object_type *o_ptr = &creature_ptr->inventory_list[i];
2216 object_type *q_ptr = &forge;
2218 DEPTH level = MAX(k_info[o_ptr->k_idx].level - 8, 1);
2220 if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE))
2226 object_copy(q_ptr, o_ptr);
2227 q_ptr->discount = 0;
2228 q_ptr->curse_flags = 0L;
2230 if (object_is_fixed_artifact(o_ptr)) {
2231 level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
2232 level += MIN(20, a_info[o_ptr->name1].rarity / (a_info[o_ptr->name1].gen_flags & TRG_INSTA_ART ? 10 : 3));
2233 } else if (object_is_ego(o_ptr)) {
2234 level += MAX(3, (e_info[o_ptr->name2].rating - 5) / 2);
2235 } else if (o_ptr->art_name) {
2236 s32b total_flags = flag_cost(creature_ptr, o_ptr, o_ptr->pval);
2239 if (!object_is_weapon_ammo(o_ptr)) {
2240 if (total_flags < 15000)
2242 else if (total_flags < 35000)
2247 if (total_flags < 20000)
2249 else if (total_flags < 45000)
2255 level = MAX(level, (level + MAX(fake_level - 8, 5)) / 2 + 3);
2258 value = object_value_real(creature_ptr, q_ptr);
2261 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (creature_ptr->pseikaku != PERSONALITY_SEXY))
2263 if (value > 5000000L)
2265 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD))
2268 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr) || (o_ptr->tval == TV_DRAG_ARMOR) || ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM))
2269 || ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) || ((o_ptr->tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES))
2270 || ((o_ptr->tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) || ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE))) {
2272 level = 35 + (level - 65) / 5;
2273 else if (level > 35)
2274 level = 25 + (level - 35) / 3;
2275 else if (level > 15)
2276 level = 15 + (level - 15) / 2;
2277 exp = MIN(100000L, value) / 2 * level * level;
2278 if (value > 100000L)
2279 exp += (value - 100000L) / 8 * level * level;
2281 exp = MIN(100000L, value) * level;
2282 if (value > 100000L)
2283 exp += (value - 100000L) / 4 * level;
2285 if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(creature_ptr, i))) || (i == INVEN_BOW))
2286 total_exp += exp / 48;
2288 total_exp += exp / 16;
2289 if (i == INVEN_BODY)
2290 total_exp += exp / 32;
2293 creature_ptr->exp = creature_ptr->max_exp = total_exp;
2294 check_experience(creature_ptr);
2300 void lose_exp(player_type *creature_ptr, s32b amount)
2302 if (creature_ptr->prace == RACE_ANDROID)
2304 if (amount > creature_ptr->exp)
2305 amount = creature_ptr->exp;
2307 creature_ptr->exp -= amount;
2309 check_experience(creature_ptr);
2314 * If resisted to draining, return FALSE
2316 bool drain_exp(player_type *creature_ptr, s32b drain, s32b slip, int hold_exp_prob)
2318 if (creature_ptr->prace == RACE_ANDROID)
2321 if (creature_ptr->hold_exp && (randint0(100) < hold_exp_prob)) {
2322 msg_print(_("しかし自己の経験値を守りきった!", "You keep hold of your experience!"));
2326 if (creature_ptr->hold_exp) {
2327 msg_print(_("経験値を少し吸い取られた気がする!", "You feel your experience slipping away!"));
2328 lose_exp(creature_ptr, slip);
2330 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away!"));
2331 lose_exp(creature_ptr, drain);
2337 bool set_ultimate_res(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2339 bool notice = FALSE;
2340 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2342 if (creature_ptr->is_dead)
2346 if (creature_ptr->ult_res && !do_dec) {
2347 if (creature_ptr->ult_res > v)
2349 } else if (!creature_ptr->ult_res) {
2350 msg_print(_("あらゆることに対して耐性がついた気がする!", "You feel resistant!"));
2356 if (creature_ptr->ult_res) {
2357 msg_print(_("あらゆることに対する耐性が薄れた気がする。", "You feel less resistant"));
2362 creature_ptr->ult_res = v;
2363 creature_ptr->redraw |= (PR_STATUS);
2369 disturb(creature_ptr, FALSE, FALSE);
2370 creature_ptr->update |= (PU_BONUS);
2371 handle_stuff(creature_ptr);
2376 bool set_tim_res_nether(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2378 bool notice = FALSE;
2379 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2381 if (creature_ptr->is_dead)
2385 if (creature_ptr->tim_res_nether && !do_dec) {
2386 if (creature_ptr->tim_res_nether > v)
2388 } else if (!creature_ptr->tim_res_nether) {
2389 msg_print(_("地獄の力に対して耐性がついた気がする!", "You feel nether resistant!"));
2395 if (creature_ptr->tim_res_nether) {
2396 msg_print(_("地獄の力に対する耐性が薄れた気がする。", "You feel less nether resistant"));
2401 creature_ptr->tim_res_nether = v;
2402 creature_ptr->redraw |= (PR_STATUS);
2408 disturb(creature_ptr, FALSE, FALSE);
2409 creature_ptr->update |= (PU_BONUS);
2410 handle_stuff(creature_ptr);
2414 bool set_tim_res_time(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
2416 bool notice = FALSE;
2417 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2418 if (creature_ptr->is_dead)
2422 if (creature_ptr->tim_res_time && !do_dec) {
2423 if (creature_ptr->tim_res_time > v)
2425 } else if (!creature_ptr->tim_res_time) {
2426 msg_print(_("時間逆転の力に対して耐性がついた気がする!", "You feel time resistant!"));
2430 if (creature_ptr->tim_res_time) {
2431 msg_print(_("時間逆転の力に対する耐性が薄れた気がする。", "You feel less time resistant"));
2436 creature_ptr->tim_res_time = v;
2437 creature_ptr->redraw |= (PR_STATUS);
2442 disturb(creature_ptr, FALSE, FALSE);
2443 creature_ptr->update |= (PU_BONUS);
2444 handle_stuff(creature_ptr);
2449 * Choose a warrior-mage elemental attack. -LM-
2451 bool choose_ele_attack(player_type *creature_ptr)
2453 if (!has_melee_weapon(creature_ptr, INVEN_RARM) && !has_melee_weapon(creature_ptr, INVEN_LARM)) {
2454 msg_format(_("武器を持たないと魔法剣は使えない。", "You cannot use temporary branding with no weapon."));
2459 int num = (creature_ptr->lev - 20) / 5;
2460 c_prt(TERM_RED, _(" a) 焼棄", " a) Fire Brand"), 2, 14);
2463 c_prt(TERM_L_WHITE, _(" b) 凍結", " b) Cold Brand"), 3, 14);
2468 c_prt(TERM_GREEN, _(" c) 毒殺", " c) Poison Brand"), 4, 14);
2473 c_prt(TERM_L_DARK, _(" d) 溶解", " d) Acid Brand"), 5, 14);
2478 c_prt(TERM_BLUE, _(" e) 電撃", " e) Elec Brand"), 6, 14);
2487 prt(_(" どの元素攻撃をしますか?", " Choose a temporary elemental brand "), 1, 14);
2489 char choice = inkey();
2491 if ((choice == 'a') || (choice == 'A'))
2492 set_ele_attack(creature_ptr, ATTACK_FIRE, creature_ptr->lev / 2 + randint1(creature_ptr->lev / 2));
2493 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
2494 set_ele_attack(creature_ptr, ATTACK_COLD, creature_ptr->lev / 2 + randint1(creature_ptr->lev / 2));
2495 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
2496 set_ele_attack(creature_ptr, ATTACK_POIS, creature_ptr->lev / 2 + randint1(creature_ptr->lev / 2));
2497 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
2498 set_ele_attack(creature_ptr, ATTACK_ACID, creature_ptr->lev / 2 + randint1(creature_ptr->lev / 2));
2499 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
2500 set_ele_attack(creature_ptr, ATTACK_ELEC, creature_ptr->lev / 2 + randint1(creature_ptr->lev / 2));
2502 msg_print(_("魔法剣を使うのをやめた。", "You cancel the temporary branding."));
2512 * Choose a elemental immune. -LM-
2514 bool choose_ele_immune(player_type *creature_ptr, TIME_EFFECT immune_turn)
2518 c_prt(TERM_RED, _(" a) 火炎", " a) Immunity to fire"), 2, 14);
2519 c_prt(TERM_L_WHITE, _(" b) 冷気", " b) Immunity to cold"), 3, 14);
2520 c_prt(TERM_L_DARK, _(" c) 酸", " c) Immunity to acid"), 4, 14);
2521 c_prt(TERM_BLUE, _(" d) 電撃", " d) Immunity to elec"), 5, 14);
2529 prt(_(" どの元素の免疫をつけますか?", " Choose a temporary elemental immunity "), 1, 14);
2531 char choice = inkey();
2533 if ((choice == 'a') || (choice == 'A'))
2534 set_ele_immune(creature_ptr, DEFENSE_FIRE, immune_turn);
2535 else if ((choice == 'b') || (choice == 'B'))
2536 set_ele_immune(creature_ptr, DEFENSE_COLD, immune_turn);
2537 else if ((choice == 'c') || (choice == 'C'))
2538 set_ele_immune(creature_ptr, DEFENSE_ACID, immune_turn);
2539 else if ((choice == 'd') || (choice == 'D'))
2540 set_ele_immune(creature_ptr, DEFENSE_ELEC, immune_turn);
2542 msg_print(_("免疫を付けるのをやめた。", "You cancel the temporary immunity."));
2551 bool drop_weapons(player_type *creature_ptr)
2553 INVENTORY_IDX slot = 0;
2554 object_type *o_ptr = NULL;
2556 if (creature_ptr->wild_mode)
2560 if (has_melee_weapon(creature_ptr, INVEN_RARM)) {
2562 o_ptr = &creature_ptr->inventory_list[INVEN_RARM];
2564 if (has_melee_weapon(creature_ptr, INVEN_LARM) && one_in_(2)) {
2565 o_ptr = &creature_ptr->inventory_list[INVEN_LARM];
2568 } else if (has_melee_weapon(creature_ptr, INVEN_LARM)) {
2569 o_ptr = &creature_ptr->inventory_list[INVEN_LARM];
2573 if (slot && !object_is_cursed(o_ptr)) {
2574 msg_print(_("武器を落としてしまった!", "You drop your weapon!"));
2575 drop_from_inventory(creature_ptr, slot, 1);