4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: effects of various "objects" */
15 void set_action(int typ)
17 int prev_typ = p_ptr->action;
30 msg_print("õº÷¤ò¤ä¤á¤¿¡£");
32 msg_print("You no longer walk carefully.");
34 p_ptr->redraw |= (PR_SPEED);
45 msg_print("³Ø½¬¤ò¤ä¤á¤¿¡£");
47 msg_print("You stop Learning");
55 msg_print("¹½¤¨¤ò¤È¤¤¤¿¡£");
57 msg_print("You stop assuming the posture.");
59 p_ptr->special_defense &= ~(KAMAE_MASK);
65 msg_print("·¿¤òÊø¤·¤¿¡£");
67 msg_print("You stop assuming the posture.");
69 p_ptr->special_defense &= ~(KATA_MASK);
70 p_ptr->update |= (PU_MONSTERS);
71 p_ptr->redraw |= (PR_STATUS);
77 msg_print("²Î¤¦¤Î¤ò¤ä¤á¤¿¡£");
79 msg_print("You stop singing.");
86 msg_print("¤¬½Å¤¯¤Ê¤Ã¤¿¡£");
88 msg_print("You are no longer walking extremely fast.");
95 msg_print("¼öʸ¤Î±Ó¾§¤òÃæÃǤ·¤¿¡£");
97 msg_print("You stopped spelling all spells.");
106 /* If we are requested other action, stop singing */
107 if (prev_typ == ACTION_SING) stop_singing();
109 switch (p_ptr->action)
114 msg_print("Ãí°Õ¿¼¤¯Ê⤻Ϥ᤿¡£");
116 msg_print("You begin to walk carefully.");
118 p_ptr->redraw |= (PR_SPEED);
124 msg_print("³Ø½¬¤ò»Ï¤á¤¿¡£");
126 msg_print("You begin Learning");
133 msg_print("¿åÌ̤˻å¤ò¿â¤é¤·¤¿¡¥¡¥¡¥");
135 msg_print("You begin fishing...");
139 case ACTION_HAYAGAKE:
142 msg_print("¤¬±©¤Î¤è¤¦¤Ë·Ú¤¯¤Ê¤Ã¤¿¡£");
144 msg_print("You begin to walk extremely fast.");
154 /* Recalculate bonuses */
155 p_ptr->update |= (PU_BONUS);
157 /* Redraw the state */
158 p_ptr->redraw |= (PR_STATE);
161 /* reset timed flags */
162 void reset_tim_flags(void)
164 p_ptr->fast = 0; /* Timed -- Fast */
165 p_ptr->lightspeed = 0;
166 p_ptr->slow = 0; /* Timed -- Slow */
167 p_ptr->blind = 0; /* Timed -- Blindness */
168 p_ptr->paralyzed = 0; /* Timed -- Paralysis */
169 p_ptr->confused = 0; /* Timed -- Confusion */
170 p_ptr->afraid = 0; /* Timed -- Fear */
171 p_ptr->image = 0; /* Timed -- Hallucination */
172 p_ptr->poisoned = 0; /* Timed -- Poisoned */
173 p_ptr->cut = 0; /* Timed -- Cut */
174 p_ptr->stun = 0; /* Timed -- Stun */
176 p_ptr->protevil = 0; /* Timed -- Protection */
177 p_ptr->invuln = 0; /* Timed -- Invulnerable */
179 p_ptr->hero = 0; /* Timed -- Heroism */
180 p_ptr->shero = 0; /* Timed -- Super Heroism */
181 p_ptr->shield = 0; /* Timed -- Shield Spell */
182 p_ptr->blessed = 0; /* Timed -- Blessed */
183 p_ptr->tim_invis = 0; /* Timed -- Invisibility */
184 p_ptr->tim_infra = 0; /* Timed -- Infra Vision */
185 p_ptr->tim_regen = 0; /* Timed -- Regeneration */
186 p_ptr->tim_stealth = 0; /* Timed -- Stealth */
188 p_ptr->wraith_form = 0; /* Timed -- Wraith Form */
189 p_ptr->tim_levitation = 0;
190 p_ptr->tim_sh_touki = 0;
191 p_ptr->tim_sh_fire = 0;
192 p_ptr->tim_sh_holy = 0;
193 p_ptr->tim_eyeeye = 0;
195 p_ptr->resist_magic = 0;
198 p_ptr->tim_res_nether = 0;
199 p_ptr->tim_res_time = 0;
200 p_ptr->tim_mimic = 0;
201 p_ptr->mimic_form = 0;
202 p_ptr->tim_reflect = 0;
203 p_ptr->multishadow = 0;
205 p_ptr->action = ACTION_NONE;
208 p_ptr->oppose_acid = 0; /* Timed -- oppose acid */
209 p_ptr->oppose_elec = 0; /* Timed -- oppose lightning */
210 p_ptr->oppose_fire = 0; /* Timed -- oppose heat */
211 p_ptr->oppose_cold = 0; /* Timed -- oppose cold */
212 p_ptr->oppose_pois = 0; /* Timed -- oppose poison */
214 p_ptr->word_recall = 0;
215 p_ptr->alter_reality = 0;
216 p_ptr->sutemi = FALSE;
217 p_ptr->counter = FALSE;
218 p_ptr->ele_attack = 0;
219 p_ptr->ele_immune = 0;
220 p_ptr->special_attack = 0L;
221 p_ptr->special_defense = 0L;
223 while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
224 world_player = FALSE;
226 if (prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
227 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1;
228 if (p_ptr->pclass == CLASS_BERSERKER) p_ptr->shero = 1;
232 (void)set_monster_fast(p_ptr->riding, 0);
233 (void)set_monster_slow(p_ptr->riding, 0);
234 (void)set_monster_invulner(p_ptr->riding, 0, FALSE);
237 if (p_ptr->pclass == CLASS_BARD)
239 p_ptr->magic_num1[0] = 0;
240 p_ptr->magic_num2[0] = 0;
245 void dispel_player(void)
247 (void)set_fast(0, TRUE);
248 (void)set_lightspeed(0, TRUE);
249 (void)set_slow(0, TRUE);
250 (void)set_shield(0, TRUE);
251 (void)set_blessed(0, TRUE);
252 (void)set_tsuyoshi(0, TRUE);
253 (void)set_hero(0, TRUE);
254 (void)set_shero(0, TRUE);
255 (void)set_protevil(0, TRUE);
256 (void)set_invuln(0, TRUE);
257 (void)set_wraith_form(0, TRUE);
258 (void)set_kabenuke(0, TRUE);
259 (void)set_tim_res_nether(0, TRUE);
260 (void)set_tim_res_time(0, TRUE);
262 (void)set_tim_reflect(0,TRUE);
263 (void)set_multishadow(0,TRUE);
264 (void)set_dustrobe(0,TRUE);
266 (void)set_tim_invis(0, TRUE);
267 (void)set_tim_infra(0, TRUE);
268 (void)set_tim_esp(0, TRUE);
269 (void)set_tim_regen(0, TRUE);
270 (void)set_tim_stealth(0, TRUE);
271 (void)set_tim_levitation(0, TRUE);
272 (void)set_tim_sh_touki(0, TRUE);
273 (void)set_tim_sh_fire(0, TRUE);
274 (void)set_tim_sh_holy(0, TRUE);
275 (void)set_tim_eyeeye(0, TRUE);
276 (void)set_magicdef(0, TRUE);
277 (void)set_resist_magic(0, TRUE);
278 (void)set_oppose_acid(0, TRUE);
279 (void)set_oppose_elec(0, TRUE);
280 (void)set_oppose_fire(0, TRUE);
281 (void)set_oppose_cold(0, TRUE);
282 (void)set_oppose_pois(0, TRUE);
283 (void)set_ultimate_res(0, TRUE);
284 (void)set_mimic(0, 0, TRUE);
285 (void)set_ele_attack(0, 0);
286 (void)set_ele_immune(0, 0);
288 /* Cancel glowing hands */
289 if (p_ptr->special_attack & ATTACK_CONFUSE)
291 p_ptr->special_attack &= ~(ATTACK_CONFUSE);
293 msg_print("¼ê¤Îµ±¤¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
295 msg_print("Your hands stop glowing.");
299 if (music_singing_any() || hex_spelling_any())
302 cptr str = (music_singing_any()) ? "²Î" : "¼öʸ";
304 cptr str = (music_singing_any()) ? "singing" : "spelling";
306 p_ptr->magic_num1[1] = p_ptr->magic_num1[0];
307 p_ptr->magic_num1[0] = 0;
309 msg_format("%s¤¬ÅÓÀڤ줿¡£", str);
311 msg_format("Your %s is interrupted.", str);
313 p_ptr->action = ACTION_NONE;
315 /* Recalculate bonuses */
316 p_ptr->update |= (PU_BONUS | PU_HP);
319 p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
321 /* Update monsters */
322 p_ptr->update |= (PU_MONSTERS);
325 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
327 p_ptr->energy_need += ENERGY_NEED();
333 * Set "p_ptr->tim_mimic", and "p_ptr->mimic_form",
334 * notice observable changes
336 bool set_mimic(int v, int p, bool do_dec)
340 /* Hack -- Force good values */
341 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
343 if (p_ptr->is_dead) return FALSE;
348 if (p_ptr->tim_mimic && (p_ptr->mimic_form == p) && !do_dec)
350 if (p_ptr->tim_mimic > v) return FALSE;
352 else if ((!p_ptr->tim_mimic) || (p_ptr->mimic_form != p))
355 msg_print("¼«Ê¬¤ÎÂΤ¬ÊѤï¤Ã¤Æ¤æ¤¯¤Î¤ò´¶¤¸¤¿¡£");
357 msg_print("You feel that your body changes.");
367 if (p_ptr->tim_mimic)
370 msg_print("ÊѿȤ¬²ò¤±¤¿¡£");
372 msg_print("You are no longer transformed.");
374 if (p_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(0, TRUE);
382 p_ptr->tim_mimic = v;
384 /* Nothing to notice */
393 p_ptr->redraw |= (PR_BASIC | PR_STATUS);
395 /* Recalculate bonuses */
396 p_ptr->update |= (PU_BONUS | PU_HP);
405 * Set "p_ptr->blind", notice observable changes
407 * Note the use of "PU_UN_LITE" and "PU_UN_VIEW", which is needed to
408 * memorize any terrain features which suddenly become "visible".
409 * Note that blindness is currently the only thing which can affect
410 * "player_can_see_bold()".
412 bool set_blind(int v)
416 /* Hack -- Force good values */
417 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
419 if (p_ptr->is_dead) return FALSE;
426 if (p_ptr->prace == RACE_ANDROID)
429 msg_print("¥»¥ó¥µ¡¼¤ò¤ä¤é¤ì¤¿¡ª");
431 msg_print("You are blind!");
437 msg_print("Ìܤ¬¸«¤¨¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
439 msg_print("You are blind!");
444 chg_virtue(V_ENLIGHTEN, -1);
453 if (p_ptr->prace == RACE_ANDROID)
456 msg_print("¥»¥ó¥µ¡¼¤¬Éüµì¤·¤¿¡£");
458 msg_print("You can see again.");
464 msg_print("¤ä¤Ã¤ÈÌܤ¬¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
466 msg_print("You can see again.");
477 /* Redraw status bar */
478 p_ptr->redraw |= (PR_STATUS);
480 /* Nothing to notice */
481 if (!notice) return (FALSE);
484 if (disturb_state) disturb(0, 0);
486 /* Fully update the visuals */
487 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
490 p_ptr->redraw |= (PR_MAP);
493 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
504 * Set "p_ptr->confused", notice observable changes
506 bool set_confused(int v)
510 /* Hack -- Force good values */
511 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
513 if (p_ptr->is_dead) return FALSE;
518 if (!p_ptr->confused)
521 msg_print("¤¢¤Ê¤¿¤Ïº®Í𤷤¿¡ª");
523 msg_print("You are confused!");
526 if (p_ptr->action == ACTION_LEARN)
529 msg_print("³Ø½¬¤¬Â³¤±¤é¤ì¤Ê¤¤¡ª");
531 msg_print("You cannot continue Learning!");
535 p_ptr->redraw |= (PR_STATE);
536 p_ptr->action = ACTION_NONE;
538 if (p_ptr->action == ACTION_KAMAE)
541 msg_print("¹½¤¨¤¬¤È¤±¤¿¡£");
543 msg_print("Your posture gets loose.");
545 p_ptr->special_defense &= ~(KAMAE_MASK);
546 p_ptr->update |= (PU_BONUS);
547 p_ptr->redraw |= (PR_STATE);
548 p_ptr->action = ACTION_NONE;
550 else if (p_ptr->action == ACTION_KATA)
553 msg_print("·¿¤¬Êø¤ì¤¿¡£");
555 msg_print("Your posture gets loose.");
557 p_ptr->special_defense &= ~(KATA_MASK);
558 p_ptr->update |= (PU_BONUS);
559 p_ptr->update |= (PU_MONSTERS);
560 p_ptr->redraw |= (PR_STATE);
561 p_ptr->redraw |= (PR_STATUS);
562 p_ptr->action = ACTION_NONE;
566 if (p_ptr->concent) reset_concentration(TRUE);
569 if (hex_spelling_any()) stop_hex_spell_all();
572 p_ptr->counter = FALSE;
573 chg_virtue(V_HARMONY, -1);
583 msg_print("¤ä¤Ã¤Èº®Í𤬤ª¤µ¤Þ¤Ã¤¿¡£");
585 msg_print("You feel less confused now.");
588 p_ptr->special_attack &= ~(ATTACK_SUIKEN);
596 /* Redraw status bar */
597 p_ptr->redraw |= (PR_STATUS);
599 /* Nothing to notice */
600 if (!notice) return (FALSE);
603 if (disturb_state) disturb(0, 0);
614 * Set "p_ptr->poisoned", notice observable changes
616 bool set_poisoned(int v)
620 /* Hack -- Force good values */
621 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
623 if (p_ptr->is_dead) return FALSE;
628 if (!p_ptr->poisoned)
631 msg_print("ÆǤ˿¯¤µ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
633 msg_print("You are poisoned!");
646 msg_print("¤ä¤Ã¤ÈÆǤÎÄˤߤ¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
648 msg_print("You are no longer poisoned.");
658 /* Redraw status bar */
659 p_ptr->redraw |= (PR_STATUS);
661 /* Nothing to notice */
662 if (!notice) return (FALSE);
665 if (disturb_state) disturb(0, 0);
676 * Set "p_ptr->afraid", notice observable changes
678 bool set_afraid(int v)
682 /* Hack -- Force good values */
683 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
685 if (p_ptr->is_dead) return FALSE;
693 msg_print("²¿¤â¤«¤â¶²¤¯¤Ê¤Ã¤Æ¤¤¿¡ª");
695 msg_print("You are terrified!");
698 if (p_ptr->special_defense & KATA_MASK)
701 msg_print("·¿¤¬Êø¤ì¤¿¡£");
703 msg_print("Your posture gets loose.");
705 p_ptr->special_defense &= ~(KATA_MASK);
706 p_ptr->update |= (PU_BONUS);
707 p_ptr->update |= (PU_MONSTERS);
708 p_ptr->redraw |= (PR_STATE);
709 p_ptr->redraw |= (PR_STATUS);
710 p_ptr->action = ACTION_NONE;
714 p_ptr->counter = FALSE;
715 chg_virtue(V_VALOUR, -1);
725 msg_print("¤ä¤Ã¤È¶²Éݤò¿¶¤êʧ¤Ã¤¿¡£");
727 msg_print("You feel bolder now.");
737 /* Redraw status bar */
738 p_ptr->redraw |= (PR_STATUS);
740 /* Nothing to notice */
741 if (!notice) return (FALSE);
744 if (disturb_state) disturb(0, 0);
755 * Set "p_ptr->paralyzed", notice observable changes
757 bool set_paralyzed(int v)
761 /* Hack -- Force good values */
762 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
764 if (p_ptr->is_dead) return FALSE;
769 if (!p_ptr->paralyzed)
772 msg_print("ÂΤ¬Ëãá㤷¤Æ¤·¤Þ¤Ã¤¿¡ª");
774 msg_print("You are paralyzed!");
778 if (p_ptr->concent) reset_concentration(TRUE);
781 if (hex_spelling_any()) stop_hex_spell_all();
783 p_ptr->counter = FALSE;
791 if (p_ptr->paralyzed)
794 msg_print("¤ä¤Ã¤ÈÆ°¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
796 msg_print("You can move again.");
804 p_ptr->paralyzed = v;
806 /* Redraw status bar */
807 p_ptr->redraw |= (PR_STATUS);
809 /* Nothing to notice */
810 if (!notice) return (FALSE);
813 if (disturb_state) disturb(0, 0);
815 /* Redraw the state */
816 p_ptr->redraw |= (PR_STATE);
827 * Set "p_ptr->image", notice observable changes
829 * Note that we must redraw the map when hallucination changes.
831 bool set_image(int v)
835 /* Hack -- Force good values */
836 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
838 if (p_ptr->is_dead) return FALSE;
844 set_tsuyoshi(0, TRUE);
848 msg_print("¥ï¡¼¥ª¡ª²¿¤â¤«¤âÆú¿§¤Ë¸«¤¨¤ë¡ª");
850 msg_print("Oh, wow! Everything looks so cosmic now!");
854 if (p_ptr->concent) reset_concentration(TRUE);
856 p_ptr->counter = FALSE;
867 msg_print("¤ä¤Ã¤È¤Ï¤Ã¤¤ê¤Èʪ¤¬¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
869 msg_print("You can see clearly again.");
879 /* Redraw status bar */
880 p_ptr->redraw |= (PR_STATUS);
882 /* Nothing to notice */
883 if (!notice) return (FALSE);
886 if (disturb_state) disturb(0, 0);
889 p_ptr->redraw |= (PR_MAP);
891 /* Update the health bar */
892 p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH);
894 /* Update monsters */
895 p_ptr->update |= (PU_MONSTERS);
898 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
909 * Set "p_ptr->fast", notice observable changes
911 bool set_fast(int v, bool do_dec)
915 /* Hack -- Force good values */
916 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
918 if (p_ptr->is_dead) return FALSE;
923 if (p_ptr->fast && !do_dec)
925 if (p_ptr->fast > v) return FALSE;
927 else if (!IS_FAST() && !p_ptr->lightspeed)
930 msg_print("ÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
932 msg_print("You feel yourself moving much faster!");
936 chg_virtue(V_PATIENCE, -1);
937 chg_virtue(V_DILIGENCE, 1);
944 if (p_ptr->fast && !p_ptr->lightspeed && !music_singing(MUSIC_SPEED) && !music_singing(MUSIC_SHERO))
947 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
949 msg_print("You feel yourself slow down.");
959 /* Nothing to notice */
960 if (!notice) return (FALSE);
963 if (disturb_state) disturb(0, 0);
965 /* Recalculate bonuses */
966 p_ptr->update |= (PU_BONUS);
977 * Set "p_ptr->lightspeed", notice observable changes
979 bool set_lightspeed(int v, bool do_dec)
983 /* Hack -- Force good values */
984 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
986 if (p_ptr->is_dead) return FALSE;
988 if (p_ptr->wild_mode) v = 0;
993 if (p_ptr->lightspeed && !do_dec)
995 if (p_ptr->lightspeed > v) return FALSE;
997 else if (!p_ptr->lightspeed)
1000 msg_print("Èó¾ï¤ËÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
1002 msg_print("You feel yourself moving extremely faster!");
1006 chg_virtue(V_PATIENCE, -1);
1007 chg_virtue(V_DILIGENCE, 1);
1014 if (p_ptr->lightspeed)
1017 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1019 msg_print("You feel yourself slow down.");
1027 p_ptr->lightspeed = v;
1029 /* Nothing to notice */
1030 if (!notice) return (FALSE);
1033 if (disturb_state) disturb(0, 0);
1035 /* Recalculate bonuses */
1036 p_ptr->update |= (PU_BONUS);
1047 * Set "p_ptr->slow", notice observable changes
1049 bool set_slow(int v, bool do_dec)
1051 bool notice = FALSE;
1053 /* Hack -- Force good values */
1054 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1056 if (p_ptr->is_dead) return FALSE;
1061 if (p_ptr->slow && !do_dec)
1063 if (p_ptr->slow > v) return FALSE;
1065 else if (!p_ptr->slow)
1068 msg_print("ÂΤÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
1070 msg_print("You feel yourself moving slower!");
1083 msg_print("Æ°¤¤ÎÃÙ¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1085 msg_print("You feel yourself speed up.");
1095 /* Nothing to notice */
1096 if (!notice) return (FALSE);
1099 if (disturb_state) disturb(0, 0);
1101 /* Recalculate bonuses */
1102 p_ptr->update |= (PU_BONUS);
1113 * Set "p_ptr->shield", notice observable changes
1115 bool set_shield(int v, bool do_dec)
1117 bool notice = FALSE;
1119 /* Hack -- Force good values */
1120 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1122 if (p_ptr->is_dead) return FALSE;
1127 if (p_ptr->shield && !do_dec)
1129 if (p_ptr->shield > v) return FALSE;
1131 else if (!p_ptr->shield)
1134 msg_print("È©¤¬ÀФˤʤä¿¡£");
1136 msg_print("Your skin turns to stone.");
1149 msg_print("È©¤¬¸µ¤ËÌá¤Ã¤¿¡£");
1151 msg_print("Your skin returns to normal.");
1161 /* Redraw status bar */
1162 p_ptr->redraw |= (PR_STATUS);
1164 /* Nothing to notice */
1165 if (!notice) return (FALSE);
1168 if (disturb_state) disturb(0, 0);
1170 /* Recalculate bonuses */
1171 p_ptr->update |= (PU_BONUS);
1183 * Set "p_ptr->tsubureru", notice observable changes
1185 bool set_tsubureru(int v, bool do_dec)
1187 bool notice = FALSE;
1189 /* Hack -- Force good values */
1190 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1192 if (p_ptr->is_dead) return FALSE;
1197 if (p_ptr->tsubureru && !do_dec)
1199 if (p_ptr->tsubureru > v) return FALSE;
1201 else if (!p_ptr->tsubureru)
1204 msg_print("²£¤Ë¿¤Ó¤¿¡£");
1206 msg_print("Your body expands horizontally.");
1216 if (p_ptr->tsubureru)
1219 msg_print("¤â¤¦²£¤Ë¿¤Ó¤Æ¤¤¤Ê¤¤¡£");
1221 msg_print("Your body returns to normal.");
1229 p_ptr->tsubureru = v;
1231 /* Redraw status bar */
1232 p_ptr->redraw |= (PR_STATUS);
1234 /* Nothing to notice */
1235 if (!notice) return (FALSE);
1238 if (disturb_state) disturb(0, 0);
1240 /* Recalculate bonuses */
1241 p_ptr->update |= (PU_BONUS);
1253 * Set "p_ptr->magicdef", notice observable changes
1255 bool set_magicdef(int v, bool do_dec)
1257 bool notice = FALSE;
1259 /* Hack -- Force good values */
1260 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1262 if (p_ptr->is_dead) return FALSE;
1267 if (p_ptr->magicdef && !do_dec)
1269 if (p_ptr->magicdef > v) return FALSE;
1271 else if (!p_ptr->magicdef)
1274 msg_print("ËâË¡¤ÎËɸæÎϤ¬Áý¤·¤¿¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1276 msg_print("You feel more resistant to magic.");
1286 if (p_ptr->magicdef)
1289 msg_print("ËâË¡¤ÎËɸæÎϤ¬¸µ¤ËÌá¤Ã¤¿¡£");
1291 msg_print("You feel less resistant to magic.");
1299 p_ptr->magicdef = v;
1301 /* Redraw status bar */
1302 p_ptr->redraw |= (PR_STATUS);
1304 /* Nothing to notice */
1305 if (!notice) return (FALSE);
1308 if (disturb_state) disturb(0, 0);
1310 /* Recalculate bonuses */
1311 p_ptr->update |= (PU_BONUS);
1323 * Set "p_ptr->blessed", notice observable changes
1325 bool set_blessed(int v, bool do_dec)
1327 bool notice = FALSE;
1329 /* Hack -- Force good values */
1330 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1332 if (p_ptr->is_dead) return FALSE;
1337 if (p_ptr->blessed && !do_dec)
1339 if (p_ptr->blessed > v) return FALSE;
1341 else if (!IS_BLESSED())
1344 msg_print("¹â·é¤Êµ¤Ê¬¤Ë¤Ê¤Ã¤¿¡ª");
1346 msg_print("You feel righteous!");
1356 if (p_ptr->blessed && !music_singing(MUSIC_BLESS))
1359 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1361 msg_print("The prayer has expired.");
1371 /* Redraw status bar */
1372 p_ptr->redraw |= (PR_STATUS);
1374 /* Nothing to notice */
1375 if (!notice) return (FALSE);
1378 if (disturb_state) disturb(0, 0);
1380 /* Recalculate bonuses */
1381 p_ptr->update |= (PU_BONUS);
1392 * Set "p_ptr->hero", notice observable changes
1394 bool set_hero(int v, bool do_dec)
1396 bool notice = FALSE;
1398 /* Hack -- Force good values */
1399 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1401 if (p_ptr->is_dead) return FALSE;
1406 if (p_ptr->hero && !do_dec)
1408 if (p_ptr->hero > v) return FALSE;
1410 else if (!IS_HERO())
1413 msg_print("¥Ò¡¼¥í¡¼¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1415 msg_print("You feel like a hero!");
1425 if (p_ptr->hero && !music_singing(MUSIC_HERO) && !music_singing(MUSIC_SHERO))
1428 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1430 msg_print("The heroism wears off.");
1440 /* Redraw status bar */
1441 p_ptr->redraw |= (PR_STATUS);
1443 /* Nothing to notice */
1444 if (!notice) return (FALSE);
1447 if (disturb_state) disturb(0, 0);
1449 /* Recalculate bonuses */
1450 p_ptr->update |= (PU_BONUS);
1452 /* Recalculate hitpoints */
1453 p_ptr->update |= (PU_HP);
1464 * Set "p_ptr->shero", notice observable changes
1466 bool set_shero(int v, bool do_dec)
1468 bool notice = FALSE;
1470 /* Hack -- Force good values */
1471 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1473 if (p_ptr->is_dead) return FALSE;
1475 if (p_ptr->pclass == CLASS_BERSERKER) v = 1;
1479 if (p_ptr->shero && !do_dec)
1481 if (p_ptr->shero > v) return FALSE;
1483 else if (!p_ptr->shero)
1486 msg_print("»¦Ù¤¥Þ¥·¡¼¥ó¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1488 msg_print("You feel like a killing machine!");
1501 msg_print("ÌîÈڤʵ¤»ý¤Á¤¬¾Ã¤¨¼º¤»¤¿¡£");
1503 msg_print("You feel less Berserk.");
1513 /* Redraw status bar */
1514 p_ptr->redraw |= (PR_STATUS);
1516 /* Nothing to notice */
1517 if (!notice) return (FALSE);
1520 if (disturb_state) disturb(0, 0);
1522 /* Recalculate bonuses */
1523 p_ptr->update |= (PU_BONUS);
1525 /* Recalculate hitpoints */
1526 p_ptr->update |= (PU_HP);
1537 * Set "p_ptr->protevil", notice observable changes
1539 bool set_protevil(int v, bool do_dec)
1541 bool notice = FALSE;
1543 /* Hack -- Force good values */
1544 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1546 if (p_ptr->is_dead) return FALSE;
1551 if (p_ptr->protevil && !do_dec)
1553 if (p_ptr->protevil > v) return FALSE;
1555 else if (!p_ptr->protevil)
1558 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Ê´¶¤¸¤¬¤¹¤ë¡ª");
1560 msg_print("You feel safe from evil!");
1570 if (p_ptr->protevil)
1573 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1575 msg_print("You no longer feel safe from evil.");
1583 p_ptr->protevil = v;
1585 /* Redraw status bar */
1586 p_ptr->redraw |= (PR_STATUS);
1588 /* Nothing to notice */
1589 if (!notice) return (FALSE);
1592 if (disturb_state) disturb(0, 0);
1602 * Set "p_ptr->wraith_form", notice observable changes
1604 bool set_wraith_form(int v, bool do_dec)
1606 bool notice = FALSE;
1608 /* Hack -- Force good values */
1609 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1611 if (p_ptr->is_dead) return FALSE;
1616 if (p_ptr->wraith_form && !do_dec)
1618 if (p_ptr->wraith_form > v) return FALSE;
1620 else if (!p_ptr->wraith_form)
1623 msg_print("ʪ¼Á³¦¤òÎ¥¤ì¤ÆÍ©µ´¤Î¤è¤¦¤Ê¸ºß¤Ë¤Ê¤Ã¤¿¡ª");
1625 msg_print("You leave the physical world and turn into a wraith-being!");
1630 chg_virtue(V_UNLIFE, 3);
1631 chg_virtue(V_HONOUR, -2);
1632 chg_virtue(V_SACRIFICE, -2);
1633 chg_virtue(V_VALOUR, -5);
1636 p_ptr->redraw |= (PR_MAP);
1638 /* Update monsters */
1639 p_ptr->update |= (PU_MONSTERS);
1642 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1649 if (p_ptr->wraith_form)
1652 msg_print("ÉÔÆ©ÌÀ¤Ë¤Ê¤Ã¤¿´¶¤¸¤¬¤¹¤ë¡£");
1654 msg_print("You feel opaque.");
1660 p_ptr->redraw |= (PR_MAP);
1662 /* Update monsters */
1663 p_ptr->update |= (PU_MONSTERS);
1666 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1671 p_ptr->wraith_form = v;
1673 /* Redraw status bar */
1674 p_ptr->redraw |= (PR_STATUS);
1676 /* Nothing to notice */
1677 if (!notice) return (FALSE);
1680 if (disturb_state) disturb(0, 0);
1682 /* Recalculate bonuses */
1683 p_ptr->update |= (PU_BONUS);
1695 * Set "p_ptr->invuln", notice observable changes
1697 bool set_invuln(int v, bool do_dec)
1699 bool notice = FALSE;
1701 /* Hack -- Force good values */
1702 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1704 if (p_ptr->is_dead) return FALSE;
1709 if (p_ptr->invuln && !do_dec)
1711 if (p_ptr->invuln > v) return FALSE;
1713 else if (!IS_INVULN())
1716 msg_print("̵Ũ¤À¡ª");
1718 msg_print("Invulnerability!");
1723 chg_virtue(V_UNLIFE, -2);
1724 chg_virtue(V_HONOUR, -2);
1725 chg_virtue(V_SACRIFICE, -3);
1726 chg_virtue(V_VALOUR, -5);
1729 p_ptr->redraw |= (PR_MAP);
1731 /* Update monsters */
1732 p_ptr->update |= (PU_MONSTERS);
1735 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1742 if (p_ptr->invuln && !music_singing(MUSIC_INVULN))
1745 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
1747 msg_print("The invulnerability wears off.");
1753 p_ptr->redraw |= (PR_MAP);
1755 /* Update monsters */
1756 p_ptr->update |= (PU_MONSTERS);
1759 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1761 p_ptr->energy_need += ENERGY_NEED();
1768 /* Redraw status bar */
1769 p_ptr->redraw |= (PR_STATUS);
1771 /* Nothing to notice */
1772 if (!notice) return (FALSE);
1775 if (disturb_state) disturb(0, 0);
1777 /* Recalculate bonuses */
1778 p_ptr->update |= (PU_BONUS);
1789 * Set "p_ptr->tim_esp", notice observable changes
1791 bool set_tim_esp(int v, bool do_dec)
1793 bool notice = FALSE;
1795 /* Hack -- Force good values */
1796 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1798 if (p_ptr->is_dead) return FALSE;
1803 if (p_ptr->tim_esp && !do_dec)
1805 if (p_ptr->tim_esp > v) return FALSE;
1807 else if (!IS_TIM_ESP())
1810 msg_print("°Õ¼±¤¬¹¤¬¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1812 msg_print("You feel your consciousness expand!");
1822 if (p_ptr->tim_esp && !music_singing(MUSIC_MIND))
1825 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
1827 msg_print("Your consciousness contracts again.");
1837 /* Redraw status bar */
1838 p_ptr->redraw |= (PR_STATUS);
1840 /* Nothing to notice */
1841 if (!notice) return (FALSE);
1844 if (disturb_state) disturb(0, 0);
1846 /* Recalculate bonuses */
1847 p_ptr->update |= (PU_BONUS);
1849 /* Update the monsters */
1850 p_ptr->update |= (PU_MONSTERS);
1861 * Set "p_ptr->tim_invis", notice observable changes
1863 bool set_tim_invis(int v, bool do_dec)
1865 bool notice = FALSE;
1867 /* Hack -- Force good values */
1868 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1870 if (p_ptr->is_dead) return FALSE;
1875 if (p_ptr->tim_invis && !do_dec)
1877 if (p_ptr->tim_invis > v) return FALSE;
1879 else if (!p_ptr->tim_invis)
1882 msg_print("Ìܤ¬Èó¾ï¤ËÉÒ´¶¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1884 msg_print("Your eyes feel very sensitive!");
1894 if (p_ptr->tim_invis)
1897 msg_print("ÌܤÎÉÒ´¶¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1899 msg_print("Your eyes feel less sensitive.");
1907 p_ptr->tim_invis = v;
1909 /* Redraw status bar */
1910 p_ptr->redraw |= (PR_STATUS);
1912 /* Nothing to notice */
1913 if (!notice) return (FALSE);
1916 if (disturb_state) disturb(0, 0);
1918 /* Recalculate bonuses */
1919 p_ptr->update |= (PU_BONUS);
1921 /* Update the monsters */
1922 p_ptr->update |= (PU_MONSTERS);
1933 * Set "p_ptr->tim_infra", notice observable changes
1935 bool set_tim_infra(int v, bool do_dec)
1937 bool notice = FALSE;
1939 /* Hack -- Force good values */
1940 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1942 if (p_ptr->is_dead) return FALSE;
1947 if (p_ptr->tim_infra && !do_dec)
1949 if (p_ptr->tim_infra > v) return FALSE;
1951 else if (!p_ptr->tim_infra)
1954 msg_print("Ìܤ¬¥é¥ó¥é¥ó¤Èµ±¤»Ï¤á¤¿¡ª");
1956 msg_print("Your eyes begin to tingle!");
1966 if (p_ptr->tim_infra)
1969 msg_print("Ìܤ層¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1971 msg_print("Your eyes stop tingling.");
1979 p_ptr->tim_infra = v;
1981 /* Redraw status bar */
1982 p_ptr->redraw |= (PR_STATUS);
1984 /* Nothing to notice */
1985 if (!notice) return (FALSE);
1988 if (disturb_state) disturb(0, 0);
1990 /* Recalculate bonuses */
1991 p_ptr->update |= (PU_BONUS);
1993 /* Update the monsters */
1994 p_ptr->update |= (PU_MONSTERS);
2005 * Set "p_ptr->tim_regen", notice observable changes
2007 bool set_tim_regen(int v, bool do_dec)
2009 bool notice = FALSE;
2011 /* Hack -- Force good values */
2012 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2014 if (p_ptr->is_dead) return FALSE;
2019 if (p_ptr->tim_regen && !do_dec)
2021 if (p_ptr->tim_regen > v) return FALSE;
2023 else if (!p_ptr->tim_regen)
2026 msg_print("²óÉüÎϤ¬¾å¤¬¤Ã¤¿¡ª");
2028 msg_print("You feel yourself regenerating quickly!");
2038 if (p_ptr->tim_regen)
2041 msg_print("ÁÇÁ᤯²óÉü¤¹¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
2043 msg_print("You feel yourself regenerating slowly.");
2051 p_ptr->tim_regen = v;
2053 /* Redraw status bar */
2054 p_ptr->redraw |= (PR_STATUS);
2056 /* Nothing to notice */
2057 if (!notice) return (FALSE);
2060 if (disturb_state) disturb(0, 0);
2062 /* Recalculate bonuses */
2063 p_ptr->update |= (PU_BONUS);
2074 * Set "p_ptr->tim_stealth", notice observable changes
2076 bool set_tim_stealth(int v, bool do_dec)
2078 bool notice = FALSE;
2080 /* Hack -- Force good values */
2081 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2083 if (p_ptr->is_dead) return FALSE;
2088 if (p_ptr->tim_stealth && !do_dec)
2090 if (p_ptr->tim_stealth > v) return FALSE;
2092 else if (!IS_TIM_STEALTH())
2095 msg_print("²»¤¬¾®¤µ¤¯¤Ê¤Ã¤¿¡ª");
2097 msg_print("You begin to walk silently!");
2107 if (p_ptr->tim_stealth && !music_singing(MUSIC_STEALTH))
2110 msg_print("²»¤¬Â礤¯¤Ê¤Ã¤¿¡£");
2112 msg_print("You no longer walk silently.");
2120 p_ptr->tim_stealth = v;
2122 /* Redraw status bar */
2123 p_ptr->redraw |= (PR_STATUS);
2125 /* Nothing to notice */
2126 if (!notice) return (FALSE);
2129 if (disturb_state) disturb(0, 0);
2131 /* Recalculate bonuses */
2132 p_ptr->update |= (PU_BONUS);
2142 bool set_superstealth(bool set)
2144 bool notice = FALSE;
2146 if (p_ptr->is_dead) return FALSE;
2151 if (!(p_ptr->special_defense & NINJA_S_STEALTH))
2153 if (cave[py][px].info & CAVE_MNLT)
2156 msg_print("Ũ¤ÎÌܤ«¤éÇö¤¤±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡£");
2158 msg_print("You are mantled in weak shadow from ordinary eyes.");
2160 p_ptr->monlite = p_ptr->old_monlite = TRUE;
2165 msg_print("Ũ¤ÎÌܤ«¤é±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡ª");
2167 msg_print("You are mantled in shadow from ordinary eyes!");
2169 p_ptr->monlite = p_ptr->old_monlite = FALSE;
2175 p_ptr->special_defense |= NINJA_S_STEALTH;
2182 if (p_ptr->special_defense & NINJA_S_STEALTH)
2185 msg_print("ºÆ¤ÓŨ¤ÎÌܤˤµ¤é¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
2187 msg_print("You are exposed to common sight once more.");
2193 p_ptr->special_defense &= ~(NINJA_S_STEALTH);
2197 /* Nothing to notice */
2198 if (!notice) return (FALSE);
2200 /* Redraw status bar */
2201 p_ptr->redraw |= (PR_STATUS);
2204 if (disturb_state) disturb(0, 0);
2212 * Set "p_ptr->tim_levitation", notice observable changes
2214 bool set_tim_levitation(int v, bool do_dec)
2216 bool notice = FALSE;
2218 /* Hack -- Force good values */
2219 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2221 if (p_ptr->is_dead) return FALSE;
2226 if (p_ptr->tim_levitation && !do_dec)
2228 if (p_ptr->tim_levitation > v) return FALSE;
2230 else if (!p_ptr->tim_levitation)
2233 msg_print("ÂΤ¬Ãè¤ËÉ⤻Ϥ᤿¡£");
2235 msg_print("You begin to fly!");
2245 if (p_ptr->tim_levitation)
2248 msg_print("¤â¤¦Ãè¤ËÉ⤫¤Ù¤Ê¤¯¤Ê¤Ã¤¿¡£");
2250 msg_print("You stop flying.");
2258 p_ptr->tim_levitation = v;
2260 /* Redraw status bar */
2261 p_ptr->redraw |= (PR_STATUS);
2263 /* Nothing to notice */
2264 if (!notice) return (FALSE);
2267 if (disturb_state) disturb(0, 0);
2269 /* Recalculate bonuses */
2270 p_ptr->update |= (PU_BONUS);
2281 * Set "p_ptr->tim_sh_touki", notice observable changes
2283 bool set_tim_sh_touki(int v, bool do_dec)
2285 bool notice = FALSE;
2287 /* Hack -- Force good values */
2288 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2290 if (p_ptr->is_dead) return FALSE;
2295 if (p_ptr->tim_sh_touki && !do_dec)
2297 if (p_ptr->tim_sh_touki > v) return FALSE;
2299 else if (!p_ptr->tim_sh_touki)
2302 msg_print("ÂΤ¬Æ®µ¤¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2304 msg_print("You have enveloped by the aura of the Force!");
2314 if (p_ptr->tim_sh_touki)
2317 msg_print("Æ®µ¤¤¬¾Ã¤¨¤¿¡£");
2319 msg_print("Aura of the Force disappeared.");
2327 p_ptr->tim_sh_touki = v;
2329 /* Redraw status bar */
2330 p_ptr->redraw |= (PR_STATUS);
2332 /* Nothing to notice */
2333 if (!notice) return (FALSE);
2336 if (disturb_state) disturb(0, 0);
2347 * Set "p_ptr->tim_sh_fire", notice observable changes
2349 bool set_tim_sh_fire(int v, bool do_dec)
2351 bool notice = FALSE;
2353 /* Hack -- Force good values */
2354 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2356 if (p_ptr->is_dead) return FALSE;
2361 if (p_ptr->tim_sh_fire && !do_dec)
2363 if (p_ptr->tim_sh_fire > v) return FALSE;
2365 else if (!p_ptr->tim_sh_fire)
2368 msg_print("ÂΤ¬±ê¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2370 msg_print("You have enveloped by fiery aura!");
2380 if (p_ptr->tim_sh_fire)
2383 msg_print("±ê¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2385 msg_print("Fiery aura disappeared.");
2393 p_ptr->tim_sh_fire = v;
2395 /* Redraw status bar */
2396 p_ptr->redraw |= (PR_STATUS);
2398 /* Nothing to notice */
2399 if (!notice) return (FALSE);
2402 if (disturb_state) disturb(0, 0);
2404 /* Recalculate bonuses */
2405 p_ptr->update |= (PU_BONUS);
2416 * Set "p_ptr->tim_sh_holy", notice observable changes
2418 bool set_tim_sh_holy(int v, bool do_dec)
2420 bool notice = FALSE;
2422 /* Hack -- Force good values */
2423 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2425 if (p_ptr->is_dead) return FALSE;
2430 if (p_ptr->tim_sh_holy && !do_dec)
2432 if (p_ptr->tim_sh_holy > v) return FALSE;
2434 else if (!p_ptr->tim_sh_holy)
2437 msg_print("ÂΤ¬À»¤Ê¤ë¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2439 msg_print("You have enveloped by holy aura!");
2449 if (p_ptr->tim_sh_holy)
2452 msg_print("À»¤Ê¤ë¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2454 msg_print("Holy aura disappeared.");
2462 p_ptr->tim_sh_holy = v;
2464 /* Redraw status bar */
2465 p_ptr->redraw |= (PR_STATUS);
2467 /* Nothing to notice */
2468 if (!notice) return (FALSE);
2471 if (disturb_state) disturb(0, 0);
2473 /* Recalculate bonuses */
2474 p_ptr->update |= (PU_BONUS);
2486 * Set "p_ptr->tim_eyeeye", notice observable changes
2488 bool set_tim_eyeeye(int v, bool do_dec)
2490 bool notice = FALSE;
2492 /* Hack -- Force good values */
2493 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2495 if (p_ptr->is_dead) return FALSE;
2500 if (p_ptr->tim_eyeeye && !do_dec)
2502 if (p_ptr->tim_eyeeye > v) return FALSE;
2504 else if (!p_ptr->tim_eyeeye)
2507 msg_print("Ë¡¤Î¼é¤ê¼ê¤Ë¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¡ª");
2509 msg_print("You feel like a keeper of commandments!");
2519 if (p_ptr->tim_eyeeye)
2522 msg_print("Ĩȳ¤ò¼¹¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2524 msg_print("You no longer feel like a keeper.");
2532 p_ptr->tim_eyeeye = v;
2534 /* Redraw status bar */
2535 p_ptr->redraw |= (PR_STATUS);
2537 /* Nothing to notice */
2538 if (!notice) return (FALSE);
2541 if (disturb_state) disturb(0, 0);
2543 /* Recalculate bonuses */
2544 p_ptr->update |= (PU_BONUS);
2556 * Set "p_ptr->resist_magic", notice observable changes
2558 bool set_resist_magic(int v, bool do_dec)
2560 bool notice = FALSE;
2562 /* Hack -- Force good values */
2563 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2565 if (p_ptr->is_dead) return FALSE;
2570 if (p_ptr->resist_magic && !do_dec)
2572 if (p_ptr->resist_magic > v) return FALSE;
2574 else if (!p_ptr->resist_magic)
2577 msg_print("ËâË¡¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿¡£");
2579 msg_print("You have been protected from magic!");
2589 if (p_ptr->resist_magic)
2592 msg_print("ËâË¡¤Ë¼å¤¯¤Ê¤Ã¤¿¡£");
2594 msg_print("You are no longer protected from magic.");
2602 p_ptr->resist_magic = v;
2604 /* Redraw status bar */
2605 p_ptr->redraw |= (PR_STATUS);
2607 /* Nothing to notice */
2608 if (!notice) return (FALSE);
2611 if (disturb_state) disturb(0, 0);
2613 /* Recalculate bonuses */
2614 p_ptr->update |= (PU_BONUS);
2625 * Set "p_ptr->tim_reflect", notice observable changes
2627 bool set_tim_reflect(int v, bool do_dec)
2629 bool notice = FALSE;
2631 /* Hack -- Force good values */
2632 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2634 if (p_ptr->is_dead) return FALSE;
2639 if (p_ptr->tim_reflect && !do_dec)
2641 if (p_ptr->tim_reflect > v) return FALSE;
2643 else if (!p_ptr->tim_reflect)
2646 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2648 msg_print("Your body becames smooth.");
2658 if (p_ptr->tim_reflect)
2661 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ç¤Ê¤¯¤Ê¤Ã¤¿¡£");
2663 msg_print("Your body is no longer smooth.");
2671 p_ptr->tim_reflect = v;
2673 /* Redraw status bar */
2674 p_ptr->redraw |= (PR_STATUS);
2676 /* Nothing to notice */
2677 if (!notice) return (FALSE);
2680 if (disturb_state) disturb(0, 0);
2682 /* Recalculate bonuses */
2683 p_ptr->update |= (PU_BONUS);
2694 * Set "p_ptr->multishadow", notice observable changes
2696 bool set_multishadow(int v, bool do_dec)
2698 bool notice = FALSE;
2700 /* Hack -- Force good values */
2701 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2703 if (p_ptr->is_dead) return FALSE;
2708 if (p_ptr->multishadow && !do_dec)
2710 if (p_ptr->multishadow > v) return FALSE;
2712 else if (!p_ptr->multishadow)
2715 msg_print("¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¸¸±Æ¤¬À¸¤Þ¤ì¤¿¡£");
2717 msg_print("Your Shadow enveloped you.");
2727 if (p_ptr->multishadow)
2730 msg_print("¸¸±Æ¤¬¾Ã¤¨¤¿¡£");
2732 msg_print("Your Shadow disappears.");
2740 p_ptr->multishadow = v;
2742 /* Redraw status bar */
2743 p_ptr->redraw |= (PR_STATUS);
2745 /* Nothing to notice */
2746 if (!notice) return (FALSE);
2749 if (disturb_state) disturb(0, 0);
2751 /* Recalculate bonuses */
2752 p_ptr->update |= (PU_BONUS);
2763 * Set "p_ptr->dustrobe", notice observable changes
2765 bool set_dustrobe(int v, bool do_dec)
2767 bool notice = FALSE;
2769 /* Hack -- Force good values */
2770 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2772 if (p_ptr->is_dead) return FALSE;
2777 if (p_ptr->dustrobe && !do_dec)
2779 if (p_ptr->dustrobe > v) return FALSE;
2781 else if (!p_ptr->dustrobe)
2784 msg_print("ÂΤ¬¶À¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2786 msg_print("You were enveloped by mirror shards.");
2796 if (p_ptr->dustrobe)
2799 msg_print("¶À¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2801 msg_print("The mirror shards disappear.");
2809 p_ptr->dustrobe = v;
2811 /* Redraw status bar */
2812 p_ptr->redraw |= (PR_STATUS);
2814 /* Nothing to notice */
2815 if (!notice) return (FALSE);
2818 if (disturb_state) disturb(0, 0);
2820 /* Recalculate bonuses */
2821 p_ptr->update |= (PU_BONUS);
2832 * Set "p_ptr->tim_regen", notice observable changes
2834 bool set_kabenuke(int v, bool do_dec)
2836 bool notice = FALSE;
2838 /* Hack -- Force good values */
2839 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2841 if (p_ptr->is_dead) return FALSE;
2846 if (p_ptr->kabenuke && !do_dec)
2848 if (p_ptr->kabenuke > v) return FALSE;
2850 else if (!p_ptr->kabenuke)
2853 msg_print("ÂΤ¬È¾Êª¼Á¤Î¾õÂ֤ˤʤä¿¡£");
2855 msg_print("You became ethereal form.");
2865 if (p_ptr->kabenuke)
2868 msg_print("ÂΤ¬Êª¼Á²½¤·¤¿¡£");
2870 msg_print("You are no longer in an ethereal form.");
2878 p_ptr->kabenuke = v;
2880 /* Redraw status bar */
2881 p_ptr->redraw |= (PR_STATUS);
2883 /* Nothing to notice */
2884 if (!notice) return (FALSE);
2887 if (disturb_state) disturb(0, 0);
2889 /* Recalculate bonuses */
2890 p_ptr->update |= (PU_BONUS);
2900 bool set_tsuyoshi(int v, bool do_dec)
2902 bool notice = FALSE;
2904 /* Hack -- Force good values */
2905 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2907 if (p_ptr->is_dead) return FALSE;
2912 if (p_ptr->tsuyoshi && !do_dec)
2914 if (p_ptr->tsuyoshi > v) return FALSE;
2916 else if (!p_ptr->tsuyoshi)
2919 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
2921 msg_print("Brother OKURE!");
2925 chg_virtue(V_VITALITY, 2);
2932 if (p_ptr->tsuyoshi)
2935 msg_print("ÆùÂΤ¬µÞ®¤Ë¤·¤Ü¤ó¤Ç¤¤¤Ã¤¿¡£");
2937 msg_print("Your body had quickly shriveled.");
2940 (void)dec_stat(A_CON, 20, TRUE);
2941 (void)dec_stat(A_STR, 20, TRUE);
2944 chg_virtue(V_VITALITY, -3);
2949 p_ptr->tsuyoshi = v;
2951 /* Redraw status bar */
2952 p_ptr->redraw |= (PR_STATUS);
2954 /* Nothing to notice */
2955 if (!notice) return (FALSE);
2958 if (disturb_state) disturb(0, 0);
2960 /* Recalculate bonuses */
2961 p_ptr->update |= (PU_BONUS);
2963 /* Recalculate hitpoints */
2964 p_ptr->update |= (PU_HP);
2975 * Set a temporary elemental brand. Clear all other brands. Print status
2978 bool set_ele_attack(u32b attack_type, int v)
2980 /* Hack -- Force good values */
2981 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2983 /* Clear all elemental attacks (only one is allowed at a time). */
2984 if ((p_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
2986 p_ptr->special_attack &= ~(ATTACK_ACID);
2988 msg_print("»À¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2990 msg_print("Your temporary acidic brand fades away.");
2993 if ((p_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
2995 p_ptr->special_attack &= ~(ATTACK_ELEC);
2997 msg_print("ÅÅ·â¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2999 msg_print("Your temporary electrical brand fades away.");
3002 if ((p_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
3004 p_ptr->special_attack &= ~(ATTACK_FIRE);
3006 msg_print("²Ð±ê¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
3008 msg_print("Your temporary fiery brand fades away.");
3011 if ((p_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
3013 p_ptr->special_attack &= ~(ATTACK_COLD);
3015 msg_print("Î䵤¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
3017 msg_print("Your temporary frost brand fades away.");
3020 if ((p_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
3022 p_ptr->special_attack &= ~(ATTACK_POIS);
3024 msg_print("ÆǤǹ¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
3026 msg_print("Your temporary poison brand fades away.");
3030 if ((v) && (attack_type))
3032 /* Set attack type. */
3033 p_ptr->special_attack |= (attack_type);
3036 p_ptr->ele_attack = v;
3040 msg_format("%s¤Ç¹¶·â¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª",
3041 ((attack_type == ATTACK_ACID) ? "»À" :
3042 ((attack_type == ATTACK_ELEC) ? "ÅÅ·â" :
3043 ((attack_type == ATTACK_FIRE) ? "²Ð±ê" :
3044 ((attack_type == ATTACK_COLD) ? "Î䵤" :
3045 ((attack_type == ATTACK_POIS) ? "ÆÇ" :
3048 msg_format("For a while, the blows you deal will %s",
3049 ((attack_type == ATTACK_ACID) ? "melt with acid!" :
3050 ((attack_type == ATTACK_ELEC) ? "shock your foes!" :
3051 ((attack_type == ATTACK_FIRE) ? "burn with fire!" :
3052 ((attack_type == ATTACK_COLD) ? "chill to the bone!" :
3053 ((attack_type == ATTACK_POIS) ? "poison your enemies!" :
3054 "do nothing special."))))));
3059 if (disturb_state) disturb(0, 0);
3061 /* Redraw status bar */
3062 p_ptr->redraw |= (PR_STATUS);
3064 p_ptr->update |= (PU_BONUS);
3074 * Set a temporary elemental brand. Clear all other brands. Print status
3077 bool set_ele_immune(u32b immune_type, int v)
3079 /* Hack -- Force good values */
3080 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3082 /* Clear all elemental attacks (only one is allowed at a time). */
3083 if ((p_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
3085 p_ptr->special_defense &= ~(DEFENSE_ACID);
3087 msg_print("»À¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3089 msg_print("You are no longer immune to acid.");
3092 if ((p_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
3094 p_ptr->special_defense &= ~(DEFENSE_ELEC);
3096 msg_print("ÅÅ·â¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3098 msg_print("You are no longer immune to electricity.");
3101 if ((p_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
3103 p_ptr->special_defense &= ~(DEFENSE_FIRE);
3105 msg_print("²Ð±ê¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3107 msg_print("You are no longer immune to fire.");
3110 if ((p_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
3112 p_ptr->special_defense &= ~(DEFENSE_COLD);
3114 msg_print("Î䵤¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3116 msg_print("You are no longer immune to cold.");
3119 if ((p_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
3121 p_ptr->special_defense &= ~(DEFENSE_POIS);
3123 msg_print("ÆǤι¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3125 msg_print("You are no longer immune to poison.");
3129 if ((v) && (immune_type))
3131 /* Set attack type. */
3132 p_ptr->special_defense |= (immune_type);
3135 p_ptr->ele_immune = v;
3139 msg_format("%s¤Î¹¶·â¤ò¼õ¤±¤Ä¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª",
3140 ((immune_type == DEFENSE_ACID) ? "»À" :
3141 ((immune_type == DEFENSE_ELEC) ? "ÅÅ·â" :
3142 ((immune_type == DEFENSE_FIRE) ? "²Ð±ê" :
3143 ((immune_type == DEFENSE_COLD) ? "Î䵤" :
3144 ((immune_type == DEFENSE_POIS) ? "ÆÇ" :
3147 msg_format("For a while, You are immune to %s",
3148 ((immune_type == DEFENSE_ACID) ? "acid!" :
3149 ((immune_type == DEFENSE_ELEC) ? "electricity!" :
3150 ((immune_type == DEFENSE_FIRE) ? "fire!" :
3151 ((immune_type == DEFENSE_COLD) ? "cold!" :
3152 ((immune_type == DEFENSE_POIS) ? "poison!" :
3153 "do nothing special."))))));
3158 if (disturb_state) disturb(0, 0);
3160 /* Redraw status bar */
3161 p_ptr->redraw |= (PR_STATUS);
3163 p_ptr->update |= (PU_BONUS);
3173 * Set "p_ptr->oppose_acid", notice observable changes
3175 bool set_oppose_acid(int v, bool do_dec)
3177 bool notice = FALSE;
3179 /* Hack -- Force good values */
3180 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3182 if (p_ptr->is_dead) return FALSE;
3187 if (p_ptr->oppose_acid && !do_dec)
3189 if (p_ptr->oppose_acid > v) return FALSE;
3191 else if (!IS_OPPOSE_ACID())
3194 msg_print("»À¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3196 msg_print("You feel resistant to acid!");
3206 if (p_ptr->oppose_acid && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3209 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3211 msg_print("You feel less resistant to acid.");
3219 p_ptr->oppose_acid = v;
3221 /* Nothing to notice */
3222 if (!notice) return (FALSE);
3224 /* Redraw status bar */
3225 p_ptr->redraw |= (PR_STATUS);
3228 if (disturb_state) disturb(0, 0);
3239 * Set "p_ptr->oppose_elec", notice observable changes
3241 bool set_oppose_elec(int v, bool do_dec)
3243 bool notice = FALSE;
3245 /* Hack -- Force good values */
3246 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3248 if (p_ptr->is_dead) return FALSE;
3253 if (p_ptr->oppose_elec && !do_dec)
3255 if (p_ptr->oppose_elec > v) return FALSE;
3257 else if (!IS_OPPOSE_ELEC())
3260 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3262 msg_print("You feel resistant to electricity!");
3272 if (p_ptr->oppose_elec && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3275 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3277 msg_print("You feel less resistant to electricity.");
3285 p_ptr->oppose_elec = v;
3287 /* Nothing to notice */
3288 if (!notice) return (FALSE);
3290 /* Redraw status bar */
3291 p_ptr->redraw |= (PR_STATUS);
3294 if (disturb_state) disturb(0, 0);
3305 * Set "p_ptr->oppose_fire", notice observable changes
3307 bool set_oppose_fire(int v, bool do_dec)
3309 bool notice = FALSE;
3311 /* Hack -- Force good values */
3312 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3314 if (p_ptr->is_dead) return FALSE;
3316 if ((prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
3320 if (p_ptr->oppose_fire && !do_dec)
3322 if (p_ptr->oppose_fire > v) return FALSE;
3324 else if (!IS_OPPOSE_FIRE())
3327 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3329 msg_print("You feel resistant to fire!");
3339 if (p_ptr->oppose_fire && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3342 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3344 msg_print("You feel less resistant to fire.");
3352 p_ptr->oppose_fire = v;
3354 /* Nothing to notice */
3355 if (!notice) return (FALSE);
3357 /* Redraw status bar */
3358 p_ptr->redraw |= (PR_STATUS);
3361 if (disturb_state) disturb(0, 0);
3372 * Set "p_ptr->oppose_cold", notice observable changes
3374 bool set_oppose_cold(int v, bool do_dec)
3376 bool notice = FALSE;
3378 /* Hack -- Force good values */
3379 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3381 if (p_ptr->is_dead) return FALSE;
3386 if (p_ptr->oppose_cold && !do_dec)
3388 if (p_ptr->oppose_cold > v) return FALSE;
3390 else if (!IS_OPPOSE_COLD())
3393 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3395 msg_print("You feel resistant to cold!");
3405 if (p_ptr->oppose_cold && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3408 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3410 msg_print("You feel less resistant to cold.");
3418 p_ptr->oppose_cold = v;
3420 /* Nothing to notice */
3421 if (!notice) return (FALSE);
3423 /* Redraw status bar */
3424 p_ptr->redraw |= (PR_STATUS);
3427 if (disturb_state) disturb(0, 0);
3438 * Set "p_ptr->oppose_pois", notice observable changes
3440 bool set_oppose_pois(int v, bool do_dec)
3442 bool notice = FALSE;
3444 /* Hack -- Force good values */
3445 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3447 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) v = 1;
3448 if (p_ptr->is_dead) return FALSE;
3453 if (p_ptr->oppose_pois && !do_dec)
3455 if (p_ptr->oppose_pois > v) return FALSE;
3457 else if (!IS_OPPOSE_POIS())
3460 msg_print("ÆǤؤÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3462 msg_print("You feel resistant to poison!");
3472 if (p_ptr->oppose_pois && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3475 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3477 msg_print("You feel less resistant to poison.");
3485 p_ptr->oppose_pois = v;
3487 /* Nothing to notice */
3488 if (!notice) return (FALSE);
3490 /* Redraw status bar */
3491 p_ptr->redraw |= (PR_STATUS);
3494 if (disturb_state) disturb(0, 0);
3505 * Set "p_ptr->stun", notice observable changes
3507 * Note the special code to only notice "range" changes.
3509 bool set_stun(int v)
3511 int old_aux, new_aux;
3512 bool notice = FALSE;
3515 /* Hack -- Force good values */
3516 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3518 if (p_ptr->is_dead) return FALSE;
3520 if (prace_is_(RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
3523 if (p_ptr->stun > 100)
3529 else if (p_ptr->stun > 50)
3535 else if (p_ptr->stun > 0)
3571 if (new_aux > old_aux)
3573 /* Describe the state */
3579 msg_print("°Õ¼±¤¬¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3581 msg_print("You have been stunned.");
3589 msg_print("°Õ¼±¤¬¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3591 msg_print("You have been heavily stunned.");
3599 msg_print("Ƭ¤¬¥¯¥é¥¯¥é¤·¤Æ°Õ¼±¤¬±ó¤Î¤¤¤Æ¤¤¿¡£");
3601 msg_print("You have been knocked out.");
3607 if (randint1(1000) < v || one_in_(16))
3610 msg_print("³ä¤ì¤ë¤è¤¦¤ÊƬÄˤ¬¤¹¤ë¡£");
3612 msg_print("A vicious blow hits your head.");
3617 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3618 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3620 else if (one_in_(2))
3622 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3626 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3629 if (p_ptr->special_defense & KATA_MASK)
3632 msg_print("·¿¤¬Êø¤ì¤¿¡£");
3634 msg_print("Your posture gets loose.");
3636 p_ptr->special_defense &= ~(KATA_MASK);
3637 p_ptr->update |= (PU_BONUS);
3638 p_ptr->update |= (PU_MONSTERS);
3639 p_ptr->redraw |= (PR_STATE);
3640 p_ptr->redraw |= (PR_STATUS);
3641 p_ptr->action = ACTION_NONE;
3645 if (p_ptr->concent) reset_concentration(TRUE);
3648 if (hex_spelling_any()) stop_hex_spell_all();
3655 else if (new_aux < old_aux)
3657 /* Describe the state */
3663 msg_print("¤ä¤Ã¤ÈÛ¯Û°¾õÂÖ¤«¤é²óÉü¤·¤¿¡£");
3665 msg_print("You are no longer stunned.");
3668 if (disturb_state) disturb(0, 0);
3680 if (!notice) return (FALSE);
3683 if (disturb_state) disturb(0, 0);
3685 /* Recalculate bonuses */
3686 p_ptr->update |= (PU_BONUS);
3688 /* Redraw the "stun" */
3689 p_ptr->redraw |= (PR_STUN);
3700 * Set "p_ptr->cut", notice observable changes
3702 * Note the special code to only notice "range" changes.
3706 int old_aux, new_aux;
3707 bool notice = FALSE;
3709 /* Hack -- Force good values */
3710 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3712 if (p_ptr->is_dead) return FALSE;
3714 if ((p_ptr->prace == RACE_GOLEM ||
3715 p_ptr->prace == RACE_SKELETON ||
3716 p_ptr->prace == RACE_SPECTRE ||
3717 (p_ptr->prace == RACE_ZOMBIE && p_ptr->lev > 11)) &&
3722 if (p_ptr->cut > 1000)
3728 else if (p_ptr->cut > 200)
3734 else if (p_ptr->cut > 100)
3740 else if (p_ptr->cut > 50)
3746 else if (p_ptr->cut > 25)
3752 else if (p_ptr->cut > 10)
3758 else if (p_ptr->cut > 0)
3818 if (new_aux > old_aux)
3820 /* Describe the state */
3826 msg_print("¤«¤¹¤ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3828 msg_print("You have been given a graze.");
3836 msg_print("·Ú¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3838 msg_print("You have been given a light cut.");
3846 msg_print("¤Ò¤É¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3848 msg_print("You have been given a bad cut.");
3856 msg_print("ÂçÊѤʽý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3858 msg_print("You have been given a nasty cut.");
3866 msg_print("½ÅÂç¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3868 msg_print("You have been given a severe cut.");
3876 msg_print("¤Ò¤É¤¤¿¼¼ê¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3878 msg_print("You have been given a deep gash.");
3886 msg_print("Ã×̿Ū¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3888 msg_print("You have been given a mortal wound.");
3897 if (randint1(1000) < v || one_in_(16))
3899 if (!p_ptr->sustain_chr)
3902 msg_print("¤Ò¤É¤¤½ýÀפ¬»Ä¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3904 msg_print("You have been horribly scarred.");
3914 else if (new_aux < old_aux)
3916 /* Describe the state */
3922 msg_format("¤ä¤Ã¤È%s¡£", p_ptr->prace == RACE_ANDROID ? "²ø²æ¤¬Ä¾¤Ã¤¿" : "½Ð·ì¤¬»ß¤Þ¤Ã¤¿");
3924 msg_print("You are no longer bleeding.");
3927 if (disturb_state) disturb(0, 0);
3939 if (!notice) return (FALSE);
3942 if (disturb_state) disturb(0, 0);
3944 /* Recalculate bonuses */
3945 p_ptr->update |= (PU_BONUS);
3947 /* Redraw the "cut" */
3948 p_ptr->redraw |= (PR_CUT);
3959 * Set "p_ptr->food", notice observable changes
3961 * The "p_ptr->food" variable can get as large as 20000, allowing the
3962 * addition of the most "filling" item, Elvish Waybread, which adds
3963 * 7500 food units, without overflowing the 32767 maximum limit.
3965 * Perhaps we should disturb the player with various messages,
3966 * especially messages about hunger status changes. XXX XXX XXX
3968 * Digestion of food is handled in "dungeon.c", in which, normally,
3969 * the player digests about 20 food units per 100 game turns, more
3970 * when "fast", more when "regenerating", less with "slow digestion",
3971 * but when the player is "gorged", he digests 100 food units per 10
3972 * game turns, or a full 1000 food units per 100 game turns.
3974 * Note that the player's speed is reduced by 10 units while gorged,
3975 * so if the player eats a single food ration (5000 food units) when
3976 * full (15000 food units), he will be gorged for (5000/100)*10 = 500
3977 * game turns, or 500/(100/5) = 25 player turns (if nothing else is
3978 * affecting the player speed).
3980 bool set_food(int v)
3982 int old_aux, new_aux;
3984 bool notice = FALSE;
3986 /* Hack -- Force good values */
3987 v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
3989 /* Fainting / Starving */
3990 if (p_ptr->food < PY_FOOD_FAINT)
3996 else if (p_ptr->food < PY_FOOD_WEAK)
4002 else if (p_ptr->food < PY_FOOD_ALERT)
4008 else if (p_ptr->food < PY_FOOD_FULL)
4014 else if (p_ptr->food < PY_FOOD_MAX)
4025 /* Fainting / Starving */
4026 if (v < PY_FOOD_FAINT)
4032 else if (v < PY_FOOD_WEAK)
4038 else if (v < PY_FOOD_ALERT)
4044 else if (v < PY_FOOD_FULL)
4050 else if (v < PY_FOOD_MAX)
4061 if (old_aux < 1 && new_aux > 0)
4062 chg_virtue(V_PATIENCE, 2);
4063 else if (old_aux < 3 && (old_aux != new_aux))
4064 chg_virtue(V_PATIENCE, 1);
4066 chg_virtue(V_TEMPERANCE, 1);
4068 chg_virtue(V_TEMPERANCE, -1);
4071 if (new_aux > old_aux)
4073 /* Describe the state */
4079 msg_print("¤Þ¤À¶õÊ¢¤ÇÅݤ줽¤¦¤À¡£");
4081 msg_print("You are still weak.");
4089 msg_print("¤Þ¤À¶õÊ¢¤À¡£");
4091 msg_print("You are still hungry.");
4099 msg_print("¶õÊ¢´¶¤¬¤ª¤µ¤Þ¤Ã¤¿¡£");
4101 msg_print("You are no longer hungry.");
4109 msg_print("ËþÊ¢¤À¡ª");
4111 msg_print("You are full!");
4119 msg_print("¿©¤Ù²á¤®¤À¡ª");
4121 msg_print("You have gorged yourself!");
4123 chg_virtue(V_HARMONY, -1);
4124 chg_virtue(V_PATIENCE, -1);
4125 chg_virtue(V_TEMPERANCE, -2);
4135 else if (new_aux < old_aux)
4137 /* Describe the state */
4140 /* Fainting / Starving */
4143 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
4145 msg_print("You are getting faint from hunger!");
4153 msg_print("¤ªÊ¢¤¬¶õ¤¤¤ÆÅݤ줽¤¦¤À¡£");
4155 msg_print("You are getting weak from hunger!");
4163 msg_print("¤ªÊ¢¤¬¶õ¤¤¤Æ¤¤¿¡£");
4165 msg_print("You are getting hungry.");
4173 msg_print("ËþÊ¢´¶¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
4175 msg_print("You are no longer full.");
4183 msg_print("¤ä¤Ã¤È¤ªÊ¢¤¬¤¤Ä¤¯¤Ê¤¯¤Ê¤Ã¤¿¡£");
4185 msg_print("You are no longer gorged.");
4191 if (p_ptr->wild_mode && (new_aux < 2))
4203 /* Nothing to notice */
4204 if (!notice) return (FALSE);
4207 if (disturb_state) disturb(0, 0);
4209 /* Recalculate bonuses */
4210 p_ptr->update |= (PU_BONUS);
4213 p_ptr->redraw |= (PR_HUNGER);
4223 * Increases a stat by one randomized level -RAK-
4225 * Note that this function (used by stat potions) now restores
4226 * the stat BEFORE increasing it.
4228 bool inc_stat(int stat)
4232 /* Then augment the current/max stat */
4233 value = p_ptr->stat_cur[stat];
4235 /* Cannot go above 18/100 */
4236 if (value < p_ptr->stat_max_max[stat])
4238 /* Gain one (sometimes two) points */
4241 gain = ((randint0(100) < 75) ? 1 : 2);
4245 /* Gain 1/6 to 1/3 of distance to 18/100 */
4246 else if (value < (p_ptr->stat_max_max[stat]-2))
4248 /* Approximate gain value */
4249 gain = (((p_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
4252 if (gain < 1) gain = 1;
4254 /* Apply the bonus */
4255 value += randint1(gain) + gain / 2;
4258 if (value > (p_ptr->stat_max_max[stat]-1)) value = p_ptr->stat_max_max[stat]-1;
4261 /* Gain one point at a time */
4267 /* Save the new value */
4268 p_ptr->stat_cur[stat] = value;
4270 /* Bring up the maximum too */
4271 if (value > p_ptr->stat_max[stat])
4273 p_ptr->stat_max[stat] = value;
4276 /* Recalculate bonuses */
4277 p_ptr->update |= (PU_BONUS);
4283 /* Nothing to gain */
4290 * Decreases a stat by an amount indended to vary from 0 to 100 percent.
4292 * Amount could be a little higher in extreme cases to mangle very high
4293 * stats from massive assaults. -CWS
4295 * Note that "permanent" means that the *given* amount is permanent,
4296 * not that the new value becomes permanent. This may not work exactly
4297 * as expected, due to "weirdness" in the algorithm, but in general,
4298 * if your stat is already drained, the "max" value will not drop all
4299 * the way down to the "cur" value.
4301 bool dec_stat(int stat, int amount, int permanent)
4303 int cur, max, loss, same, res = FALSE;
4306 /* Acquire current value */
4307 cur = p_ptr->stat_cur[stat];
4308 max = p_ptr->stat_max[stat];
4310 /* Note when the values are identical */
4311 same = (cur == max);
4313 /* Damage "current" value */
4316 /* Handle "low" values */
4319 if (amount > 90) cur--;
4320 if (amount > 50) cur--;
4321 if (amount > 20) cur--;
4325 /* Handle "high" values */
4328 /* Hack -- Decrement by a random amount between one-quarter */
4329 /* and one-half of the stat bonus times the percentage, with a */
4330 /* minimum damage of half the percentage. -CWS */
4331 loss = (((cur-18) / 2 + 1) / 2 + 1);
4334 if (loss < 1) loss = 1;
4336 /* Randomize the loss */
4337 loss = ((randint1(loss) + loss) * amount) / 100;
4340 if (loss < amount/2) loss = amount/2;
4342 /* Lose some points */
4345 /* Hack -- Only reduce stat to 17 sometimes */
4346 if (cur < 18) cur = (amount <= 20) ? 18 : 17;
4349 /* Prevent illegal values */
4350 if (cur < 3) cur = 3;
4352 /* Something happened */
4353 if (cur != p_ptr->stat_cur[stat]) res = TRUE;
4356 /* Damage "max" value */
4357 if (permanent && (max > 3))
4359 chg_virtue(V_SACRIFICE, 1);
4360 if (stat == A_WIS || stat == A_INT)
4361 chg_virtue(V_ENLIGHTEN, -2);
4363 /* Handle "low" values */
4366 if (amount > 90) max--;
4367 if (amount > 50) max--;
4368 if (amount > 20) max--;
4372 /* Handle "high" values */
4375 /* Hack -- Decrement by a random amount between one-quarter */
4376 /* and one-half of the stat bonus times the percentage, with a */
4377 /* minimum damage of half the percentage. -CWS */
4378 loss = (((max-18) / 2 + 1) / 2 + 1);
4379 loss = ((randint1(loss) + loss) * amount) / 100;
4380 if (loss < amount/2) loss = amount/2;
4382 /* Lose some points */
4385 /* Hack -- Only reduce stat to 17 sometimes */
4386 if (max < 18) max = (amount <= 20) ? 18 : 17;
4389 /* Hack -- keep it clean */
4390 if (same || (max < cur)) max = cur;
4392 /* Something happened */
4393 if (max != p_ptr->stat_max[stat]) res = TRUE;
4399 /* Actually set the stat to its new value. */
4400 p_ptr->stat_cur[stat] = cur;
4401 p_ptr->stat_max[stat] = max;
4403 /* Redisplay the stats later */
4404 p_ptr->redraw |= (PR_STATS);
4406 /* Recalculate bonuses */
4407 p_ptr->update |= (PU_BONUS);
4416 * Restore a stat. Return TRUE only if this actually makes a difference.
4418 bool res_stat(int stat)
4420 /* Restore if needed */
4421 if (p_ptr->stat_cur[stat] != p_ptr->stat_max[stat])
4424 p_ptr->stat_cur[stat] = p_ptr->stat_max[stat];
4426 /* Recalculate bonuses */
4427 p_ptr->update |= (PU_BONUS);
4429 /* Redisplay the stats later */
4430 p_ptr->redraw |= (PR_STATS);
4436 /* Nothing to restore */
4442 * Increase players hit points, notice effects
4444 bool hp_player(int num)
4447 vir = virtue_number(V_VITALITY);
4450 num = num * (p_ptr->virtues[vir - 1] + 1250) / 1250;
4452 /* Healing needed */
4453 if (p_ptr->chp < p_ptr->mhp)
4455 if ((num > 0) && (p_ptr->chp < (p_ptr->mhp/3)))
4456 chg_virtue(V_TEMPERANCE, 1);
4457 /* Gain hitpoints */
4460 /* Enforce maximum */
4461 if (p_ptr->chp >= p_ptr->mhp)
4463 p_ptr->chp = p_ptr->mhp;
4464 p_ptr->chp_frac = 0;
4468 p_ptr->redraw |= (PR_HP);
4471 p_ptr->window |= (PW_PLAYER);
4477 msg_print("¾¯¤·µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4479 msg_print("You feel a little better.");
4488 msg_print("µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4490 msg_print("You feel better.");
4499 msg_print("¤È¤Æ¤âµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4501 msg_print("You feel much better.");
4510 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4512 msg_print("You feel very good.");
4527 * Array of stat "descriptions"
4529 static cptr desc_stat_pos[] =
4571 * Array of stat "descriptions"
4573 static cptr desc_stat_neg[] =
4597 bool do_dec_stat(int stat)
4601 /* Access the "sustain" */
4604 case A_STR: if (p_ptr->sustain_str) sust = TRUE; break;
4605 case A_INT: if (p_ptr->sustain_int) sust = TRUE; break;
4606 case A_WIS: if (p_ptr->sustain_wis) sust = TRUE; break;
4607 case A_DEX: if (p_ptr->sustain_dex) sust = TRUE; break;
4608 case A_CON: if (p_ptr->sustain_con) sust = TRUE; break;
4609 case A_CHR: if (p_ptr->sustain_chr) sust = TRUE; break;
4613 if (sust && (!ironman_nightmare || randint0(13)))
4617 msg_format("%s¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¤¬¡¢¤¹¤°¤Ë¸µ¤ËÌá¤Ã¤¿¡£",
4619 msg_format("You feel %s for a moment, but the feeling passes.",
4622 desc_stat_neg[stat]);
4628 /* Attempt to reduce the stat */
4629 if (dec_stat(stat, 10, (ironman_nightmare && !randint0(13))))
4633 msg_format("¤Ò¤É¤¯%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_neg[stat]);
4635 msg_format("You feel very %s.", desc_stat_neg[stat]);
4643 /* Nothing obvious */
4649 * Restore lost "points" in a stat
4651 bool do_res_stat(int stat)
4653 /* Attempt to increase */
4658 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4660 msg_format("You feel less %s.", desc_stat_neg[stat]);
4668 /* Nothing obvious */
4674 * Gain a "point" in a stat
4676 bool do_inc_stat(int stat)
4680 /* Restore strength */
4681 res = res_stat(stat);
4683 /* Attempt to increase */
4688 chg_virtue(V_ENLIGHTEN, 1);
4689 chg_virtue(V_FAITH, 1);
4691 else if (stat == A_INT)
4693 chg_virtue(V_KNOWLEDGE, 1);
4694 chg_virtue(V_ENLIGHTEN, 1);
4696 else if (stat == A_CON)
4697 chg_virtue(V_VITALITY, 1);
4701 msg_format("¥ï¡¼¥ª¡ª¤È¤Æ¤â%s¤Ê¤Ã¤¿¡ª", desc_stat_pos[stat]);
4703 msg_format("Wow! You feel very %s!", desc_stat_pos[stat]);
4711 /* Restoration worked */
4716 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4718 msg_format("You feel less %s.", desc_stat_neg[stat]);
4726 /* Nothing obvious */
4732 * Restores any drained experience
4734 bool restore_level(void)
4736 /* Restore experience */
4737 if (p_ptr->exp < p_ptr->max_exp)
4741 msg_print("À¸Ì¿ÎϤ¬Ìá¤Ã¤Æ¤¤¿µ¤¤¬¤¹¤ë¡£");
4743 msg_print("You feel your life energies returning.");
4747 /* Restore the experience */
4748 p_ptr->exp = p_ptr->max_exp;
4750 /* Check the experience */
4765 bool lose_all_info(void)
4769 chg_virtue(V_KNOWLEDGE, -5);
4770 chg_virtue(V_ENLIGHTEN, -5);
4772 /* Forget info about objects */
4773 for (i = 0; i < INVEN_TOTAL; i++)
4775 object_type *o_ptr = &inventory[i];
4777 /* Skip non-objects */
4778 if (!o_ptr->k_idx) continue;
4780 /* Allow "protection" by the MENTAL flag */
4781 if (o_ptr->ident & (IDENT_MENTAL)) continue;
4783 /* Remove "default inscriptions" */
4784 o_ptr->feeling = FEEL_NONE;
4786 /* Hack -- Clear the "empty" flag */
4787 o_ptr->ident &= ~(IDENT_EMPTY);
4789 /* Hack -- Clear the "known" flag */
4790 o_ptr->ident &= ~(IDENT_KNOWN);
4792 /* Hack -- Clear the "felt" flag */
4793 o_ptr->ident &= ~(IDENT_SENSE);
4796 /* Recalculate bonuses */
4797 p_ptr->update |= (PU_BONUS);
4799 /* Combine / Reorder the pack (later) */
4800 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
4803 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
4805 /* Mega-Hack -- Forget the map */
4813 void do_poly_wounds(void)
4815 /* Changed to always provide at least _some_ healing */
4816 s16b wounds = p_ptr->cut;
4817 s16b hit_p = (p_ptr->mhp - p_ptr->chp);
4818 s16b change = damroll(p_ptr->lev, 5);
4819 bool Nasty_effect = one_in_(5);
4821 if (!(wounds || hit_p || Nasty_effect)) return;
4824 msg_print("½ý¤¬¤è¤ê·Ú¤¤¤â¤Î¤ËÊѲ½¤·¤¿¡£");
4826 msg_print("Your wounds are polymorphed into less serious ones.");
4833 msg_print("¿·¤¿¤Ê½ý¤¬¤Ç¤¤¿¡ª");
4834 take_hit(DAMAGE_LOSELIFE, change / 2, "ÊѲ½¤·¤¿½ý", -1);
4836 msg_print("A new wound was created!");
4837 take_hit(DAMAGE_LOSELIFE, change / 2, "a polymorphed wound", -1);
4844 set_cut(p_ptr->cut - (change / 2));
4850 * Change player race
4852 void change_race(int new_race, cptr effect_msg)
4854 cptr title = race_info[new_race].title;
4855 int old_race = p_ptr->prace;
4858 msg_format("¤¢¤Ê¤¿¤Ï%s%s¤ËÊѲ½¤·¤¿¡ª", effect_msg, title);
4860 msg_format("You turn into %s %s%s!", (!effect_msg[0] && is_a_vowel(title[0]) ? "an" : "a"), effect_msg, title);
4863 chg_virtue(V_CHANCE, 2);
4865 if (p_ptr->prace < 32)
4867 p_ptr->old_race1 |= 1L << p_ptr->prace;
4871 p_ptr->old_race2 |= 1L << (p_ptr->prace-32);
4873 p_ptr->prace = new_race;
4874 rp_ptr = &race_info[p_ptr->prace];
4876 /* Experience factor */
4877 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
4880 * The speed bonus of Klackons and Sprites are disabled
4881 * and the experience penalty is decreased.
4883 if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_NINJA)) && ((p_ptr->prace == RACE_KLACKON) || (p_ptr->prace == RACE_SPRITE)))
4884 p_ptr->expfact -= 15;
4886 /* Get character's height and weight */
4887 get_height_weight();
4890 if (p_ptr->pclass == CLASS_SORCERER)
4891 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
4893 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
4895 do_cmd_rerate(FALSE);
4897 /* The experience level may be modified */
4900 p_ptr->redraw |= (PR_BASIC);
4902 p_ptr->update |= (PU_BONUS);
4906 /* Load an autopick preference file */
4907 if (old_race != p_ptr->prace) autopick_load_pref(FALSE);
4909 /* Player's graphic tile may change */
4914 void do_poly_self(void)
4916 int power = p_ptr->lev;
4919 msg_print("¤¢¤Ê¤¿¤ÏÊѲ½¤Îˬ¤ì¤ò´¶¤¸¤¿...");
4921 msg_print("You feel a change coming over you...");
4924 chg_virtue(V_CHANCE, 1);
4926 if ((power > randint0(20)) && one_in_(3) && (p_ptr->prace != RACE_ANDROID))
4928 char effect_msg[80] = "";
4929 int new_race, expfact, goalexpfact;
4931 /* Some form of racial polymorph... */
4934 if ((power > randint0(5)) && one_in_(4))
4939 if (p_ptr->psex == SEX_MALE)
4941 p_ptr->psex = SEX_FEMALE;
4942 sp_ptr = &sex_info[p_ptr->psex];
4944 sprintf(effect_msg, "½÷À¤Î");
4946 sprintf(effect_msg, "female ");
4952 p_ptr->psex = SEX_MALE;
4953 sp_ptr = &sex_info[p_ptr->psex];
4955 sprintf(effect_msg, "ÃËÀ¤Î");
4957 sprintf(effect_msg, "male ");
4963 if ((power > randint0(30)) && one_in_(5))
4967 /* Harmful deformity */
4974 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
4980 /* Deformities are discriminated against! */
4981 (void)dec_stat(A_CHR, randint1(6), TRUE);
4987 sprintf(tmp_msg,"%s",effect_msg);
4988 sprintf(effect_msg,"´ñ·Á¤Î%s",tmp_msg);
4990 sprintf(tmp_msg,"%s ",effect_msg);
4991 sprintf(effect_msg,"deformed %s ",tmp_msg);
4998 sprintf(effect_msg,"´ñ·Á¤Î");
5000 sprintf(effect_msg,"deformed ");
5006 while ((power > randint0(20)) && one_in_(10))
5008 /* Polymorph into a less mutated form */
5011 if (!lose_mutation(0))
5013 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
5015 msg_print("You feel oddly normal.");
5021 * Restrict the race choices by exp penalty so
5022 * weak polymorph always means weak race
5027 goalexpfact = 100 + 3 * randint0(power);
5031 new_race = randint0(MAX_RACES);
5032 expfact = race_info[new_race].r_exp;
5034 while (((new_race == p_ptr->prace) && (expfact > goalexpfact)) || (new_race == RACE_ANDROID));
5036 change_race(new_race, effect_msg);
5039 if ((power > randint0(30)) && one_in_(6))
5047 msg_format("%s¤Î¹½À®¤¬ÊѲ½¤·¤¿¡ª", p_ptr->prace == RACE_ANDROID ? "µ¡³£" : "Æâ¡");
5049 msg_print("Your internal organs are rearranged!");
5054 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
5060 msg_print("¸½ºß¤Î»Ñ¤ÇÀ¸¤¤Æ¤¤¤¯¤Î¤Ïº¤Æñ¤Ê¤è¤¦¤À¡ª");
5061 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), "Ã×̿Ū¤ÊÆÍÁ³ÊÑ°Û", -1);
5063 msg_print("You find living difficult in your present form!");
5064 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), "a lethal mutation", -1);
5071 if ((power > randint0(20)) && one_in_(4))
5076 do_cmd_rerate(FALSE);
5079 while ((power > randint0(15)) && one_in_(3))
5082 (void)gain_random_mutation(0);
5085 if (power > randint0(5))
5091 /* Note: earlier deductions may have left power < 0 already. */
5101 * Decreases players hit points and sets death flag if necessary
5103 * XXX XXX XXX Invulnerability needs to be changed into a "shield"
5105 * XXX XXX XXX Hack -- this function allows the user to save (or quit)
5106 * the game when he dies, since the "You die." message is shown before
5107 * setting the player to "dead".
5110 int take_hit(int damage_type, int damage, cptr hit_from, int monspell)
5112 int old_chp = p_ptr->chp;
5114 char death_message[1024];
5117 int warning = (p_ptr->mhp * hitpoint_warn / 10);
5120 if (p_ptr->is_dead) return 0;
5122 if (p_ptr->sutemi) damage *= 2;
5123 if (p_ptr->special_defense & KATA_IAI) damage += (damage + 4) / 5;
5125 if (easy_band) damage = (damage+1)/2;
5127 if (damage_type != DAMAGE_USELIFE)
5137 if (monspell >= 0) learn_spell(monspell);
5139 /* Mega-Hack -- Apply "invulnerability" */
5140 if ((damage_type != DAMAGE_USELIFE) && (damage_type != DAMAGE_LOSELIFE))
5142 if (IS_INVULN() && (damage < 9000))
5144 if (damage_type == DAMAGE_FORCE)
5147 msg_print("¥Ð¥ê¥¢¤¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5149 msg_print("The attack cuts your shield of invulnerability open!");
5152 else if (one_in_(PENETRATE_INVULNERABILITY))
5155 msg_print("̵Ũ¤Î¥Ð¥ê¥¢¤òÇˤäƹ¶·â¤µ¤ì¤¿¡ª");
5157 msg_print("The attack penetrates your shield of invulnerability!");
5166 if (CHECK_MULTISHADOW())
5168 if (damage_type == DAMAGE_FORCE)
5171 msg_print("¸¸±Æ¤â¤í¤È¤âÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5173 msg_print("The attack hits Shadow together with you!");
5176 else if (damage_type == DAMAGE_ATTACK)
5179 msg_print("¹¶·â¤Ï¸¸±Æ¤ËÌ¿Ã椷¡¢¤¢¤Ê¤¿¤Ë¤ÏÆϤ«¤Ê¤«¤Ã¤¿¡£");
5181 msg_print("The attack hits Shadow, you are unharmed!");
5187 if (p_ptr->wraith_form)
5189 if (damage_type == DAMAGE_FORCE)
5192 msg_print("Ⱦʪ¼Á¤ÎÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5194 msg_print("The attack cuts through your ethereal body!");
5200 if ((damage == 0) && one_in_(2)) damage = 1;
5204 if (p_ptr->special_defense & KATA_MUSOU)
5207 if ((damage == 0) && one_in_(2)) damage = 1;
5209 } /* not if LOSELIFE USELIFE */
5211 /* Hurt the player */
5212 p_ptr->chp -= damage;
5213 if(damage_type == DAMAGE_GENO && p_ptr->chp < 0)
5215 damage += p_ptr->chp;
5219 /* Display the hitpoints */
5220 p_ptr->redraw |= (PR_HP);
5223 p_ptr->window |= (PW_PLAYER);
5227 if (damage_type != DAMAGE_GENO && p_ptr->chp == 0)
5229 chg_virtue(V_SACRIFICE, 1);
5230 chg_virtue(V_CHANCE, 2);
5236 bool android = (p_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
5238 #ifdef JP /* »à¤ó¤À»þ¤Ë¶¯À©½ªÎ»¤·¤Æ»à¤ò²óÈò¤Ç¤¤Ê¤¯¤·¤Æ¤ß¤¿ by Habu */
5240 if(!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
5246 chg_virtue(V_SACRIFICE, 10);
5249 p_ptr->leaving = TRUE;
5252 p_ptr->is_dead = TRUE;
5254 if (p_ptr->inside_arena)
5256 cptr m_name = r_name+r_info[arena_info[p_ptr->arena_number].r_idx].name;
5258 msg_format("¤¢¤Ê¤¿¤Ï%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£", m_name);
5260 msg_format("You are beaten by %s.", m_name);
5263 if (record_arena) do_cmd_write_nikki(NIKKI_ARENA, -1 - p_ptr->arena_number, m_name);
5267 int q_idx = quest_number(dun_level);
5268 bool seppuku = streq(hit_from, "Seppuku");
5269 bool winning_seppuku = p_ptr->total_winner && seppuku;
5272 /* Make screen dump */
5273 screen_dump = make_screen_dump();
5276 /* Note cause of death */
5279 strcpy(p_ptr->died_from, hit_from);
5281 if (!winning_seppuku) strcpy(p_ptr->died_from, "ÀÚÊ¢");
5288 sprintf(dummy, "%s%s%s", !p_ptr->paralyzed ? "" : p_ptr->free_act ? "ĦÁü¾õÂÖ¤Ç" : "Ëãáã¾õÂÖ¤Ç", p_ptr->image ? "¸¸³Ð¤ËÏĤó¤À" : "", hit_from);
5290 sprintf(dummy, "%s%s", hit_from, !p_ptr->paralyzed ? "" : " while helpless");
5292 my_strcpy(p_ptr->died_from, dummy, sizeof p_ptr->died_from);
5295 /* No longer a winner */
5296 p_ptr->total_winner = FALSE;
5298 if (winning_seppuku)
5301 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¾¡Íø¤Î¸åÀÚÊ¢¤·¤¿¡£");
5303 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "did Seppuku after the winning.");
5310 if (p_ptr->inside_arena)
5312 strcpy(buf,"¥¢¥ê¡¼¥Ê");
5314 strcpy(buf,"in the Arena");
5316 else if (!dun_level)
5320 strcpy(buf,"on the surface");
5322 else if (q_idx && (is_fixed_quest_idx(q_idx) &&
5323 !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
5325 strcpy(buf,"¥¯¥¨¥¹¥È");
5327 strcpy(buf,"in a quest");
5331 sprintf(buf,"%d³¬", dun_level);
5333 sprintf(buf,"level %d", dun_level);
5337 sprintf(tmp, "%s¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", buf, p_ptr->died_from);
5339 sprintf(tmp, "killed by %s %s.", p_ptr->died_from, buf);
5341 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5345 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- ¥²¡¼¥à¥ª¡¼¥Ð¡¼ --------");
5347 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- Game Over --------");
5349 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, "\n\n\n\n");
5354 if (get_check_strict("²èÌ̤òÊݸ¤·¤Þ¤¹¤«¡©", CHECK_NO_HISTORY))
5356 if (get_check_strict("Dump the screen? ", CHECK_NO_HISTORY))
5359 do_cmd_save_screen();
5364 /* Initialize "last message" buffer */
5365 if (p_ptr->last_message) string_free(p_ptr->last_message);
5366 p_ptr->last_message = NULL;
5368 /* Hack -- Note death */
5372 msg_format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë");
5374 msg_print(android ? "You are broken." : "You die.");
5381 if (winning_seppuku)
5384 get_rnd_line("seppuku_j.txt", 0, death_message);
5386 get_rnd_line("seppuku.txt", 0, death_message);
5392 get_rnd_line("death_j.txt", 0, death_message);
5394 get_rnd_line("death.txt", 0, death_message);
5401 while (!get_string(winning_seppuku ? "¼À¤¤Î¶ç: " : "ÃÇËöËâ¤Î¶«¤Ó: ", death_message, 1024)) ;
5403 while (!get_string("Last word: ", death_message, 1024)) ;
5407 while (winning_seppuku && !get_check_strict("¤è¤í¤·¤¤¤Ç¤¹¤«¡©", CHECK_NO_HISTORY));
5409 while (winning_seppuku && !get_check_strict("Are you sure? ", CHECK_NO_HISTORY));
5412 if (death_message[0] == '\0')
5415 strcpy(death_message, format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë"));
5417 strcpy(death_message, android ? "You are broken." : "You die.");
5420 else p_ptr->last_message = string_make(death_message);
5423 if (winning_seppuku)
5428 int msg_pos_x[9] = { 5, 7, 9, 12, 14, 17, 19, 21, 23};
5429 int msg_pos_y[9] = { 3, 4, 5, 4, 5, 4, 5, 6, 4};
5436 for (i = 0; i < 40; i++)
5437 Term_putstr(randint0(w / 2) * 2, randint0(h), 2, TERM_VIOLET, "¦Ô");
5439 str = death_message;
5440 if (strncmp(str, "¡Ö", 2) == 0) str += 2;
5442 str2 = my_strstr(str, "¡×");
5443 if (str2 != NULL) *str2 = '\0';
5448 str2 = my_strstr(str, " ");
5449 if (str2 == NULL) len = strlen(str);
5450 else len = str2 - str;
5454 Term_putstr_v(w * 3 / 4 - 2 - msg_pos_x[i] * 2, msg_pos_y[i], len,
5456 if (str2 == NULL) break;
5460 if (*str == 0) break;
5464 Term_putstr(w-1, h-1, 1, TERM_WHITE, " ");
5468 /* Make screen dump */
5469 screen_dump = make_screen_dump();
5472 /* Wait a key press */
5477 msg_print(death_message);
5485 /* Hitpoint warning */
5486 if (p_ptr->chp < warning)
5488 /* Hack -- bell on first notice */
5489 if (old_chp > warning) bell();
5493 if (record_danger && (old_chp > warning))
5495 if (p_ptr->image && damage_type == DAMAGE_ATTACK)
5499 hit_from = "something";
5503 sprintf(tmp,"%s¤Ë¤è¤Ã¤Æ¥Ô¥ó¥Á¤Ë´Ù¤Ã¤¿¡£",hit_from);
5505 sprintf(tmp,"A critical situation because of %s.",hit_from);
5507 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5512 /* stop auto_more even if DAMAGE_USELIFE */
5518 msg_print("*** ·Ù¹ð:Äã¥Ò¥Ã¥È¡¦¥Ý¥¤¥ó¥È¡ª ***");
5520 msg_print("*** LOW HITPOINT WARNING! ***");
5526 if (p_ptr->wild_mode && !p_ptr->leaving && (p_ptr->chp < MAX(warning, p_ptr->mhp/5)))
5537 void gain_exp_64(s32b amount, u32b amount_frac)
5539 if (p_ptr->is_dead) return;
5541 if (p_ptr->prace == RACE_ANDROID) return;
5543 /* Gain some experience */
5544 s64b_add(&(p_ptr->exp), &(p_ptr->exp_frac), amount, amount_frac);
5546 /* Slowly recover from experience drainage */
5547 if (p_ptr->exp < p_ptr->max_exp)
5549 /* Gain max experience (20%) (was 10%) */
5550 p_ptr->max_exp += amount / 5;
5553 /* Check Experience */
5561 void gain_exp(s32b amount)
5563 gain_exp_64(amount, 0L);
5567 void calc_android_exp(void)
5571 if (p_ptr->is_dead) return;
5573 if (p_ptr->prace != RACE_ANDROID) return;
5575 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5577 object_type *o_ptr = &inventory[i];
5579 object_type *q_ptr = &forge;
5581 int level = MAX(k_info[o_ptr->k_idx].level - 8, 1);
5583 if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue;
5584 if (!o_ptr->k_idx) continue;
5586 /* Wipe the object */
5589 object_copy(q_ptr, o_ptr);
5590 q_ptr->discount = 0;
5591 q_ptr->curse_flags = 0L;
5593 if (object_is_fixed_artifact(o_ptr))
5595 level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
5596 level += MIN(20, a_info[o_ptr->name1].rarity/(a_info[o_ptr->name1].gen_flags & TRG_INSTA_ART ? 10 : 3));
5598 else if (object_is_ego(o_ptr))
5600 level += MAX(3, (e_info[o_ptr->name2].rating - 5)/2);
5602 else if (o_ptr->art_name)
5604 s32b total_flags = flag_cost(o_ptr, o_ptr->pval);
5607 if (!object_is_weapon_ammo(o_ptr))
5610 if (total_flags < 15000) fake_level = 10;
5611 else if (total_flags < 35000) fake_level = 25;
5612 else fake_level = 40;
5617 if (total_flags < 20000) fake_level = 10;
5618 else if (total_flags < 45000) fake_level = 25;
5619 else fake_level = 40;
5622 level = MAX(level, (level + MAX(fake_level - 8, 5)) / 2 + 3);
5625 value = object_value_real(q_ptr);
5627 if (value <= 0) continue;
5628 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (p_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
5629 if (value > 5000000L) value = 5000000L;
5630 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
5632 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr) ||
5633 (o_ptr->tval == TV_DRAG_ARMOR) ||
5634 ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) ||
5635 ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) ||
5636 ((o_ptr->tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)) ||
5637 ((o_ptr->tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) ||
5638 ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE)))
5640 if (level > 65) level = 35 + (level - 65) / 5;
5641 else if (level > 35) level = 25 + (level - 35) / 3;
5642 else if (level > 15) level = 15 + (level - 15) / 2;
5643 exp = MIN(100000L, value) * level * level / 2;
5644 if (value > 100000L)
5645 exp += (value - 100000L) * level * level / 8;
5649 exp = MIN(100000L, value) * level;
5650 if (value > 100000L)
5651 exp += (value - 100000L) * level / 4;
5653 if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (buki_motteruka(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
5654 else total_exp += exp / 16;
5655 if (i == INVEN_BODY) total_exp += exp / 32;
5657 p_ptr->exp = p_ptr->max_exp = total_exp;
5659 /* Check Experience */
5667 void lose_exp(s32b amount)
5669 if (p_ptr->prace == RACE_ANDROID) return;
5671 /* Never drop below zero experience */
5672 if (amount > p_ptr->exp) amount = p_ptr->exp;
5674 /* Lose some experience */
5675 p_ptr->exp -= amount;
5677 /* Check Experience */
5684 * If resisted to draining, return FALSE
5686 bool drain_exp(s32b drain, s32b slip, int hold_life_prob)
5688 /* Androids and their mimics are never drained */
5689 if (p_ptr->prace == RACE_ANDROID) return FALSE;
5691 if (p_ptr->hold_life && (randint0(100) < hold_life_prob))
5693 /* Hold experience */
5695 msg_print("¤·¤«¤·¼«¸Ê¤ÎÀ¸Ì¿ÎϤò¼é¤ê¤¤Ã¤¿¡ª");
5697 msg_print("You keep hold of your life force!");
5702 /* Hold experience failed */
5703 if (p_ptr->hold_life)
5706 msg_print("À¸Ì¿ÎϤò¾¯¤·µÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
5708 msg_print("You feel your life slipping away!");
5715 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
5717 msg_print("You feel your life draining away!");
5726 bool set_ultimate_res(int v, bool do_dec)
5728 bool notice = FALSE;
5730 /* Hack -- Force good values */
5731 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5733 if (p_ptr->is_dead) return FALSE;
5738 if (p_ptr->ult_res && !do_dec)
5740 if (p_ptr->ult_res > v) return FALSE;
5742 else if (!p_ptr->ult_res)
5745 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5747 msg_print("You feel resistant!");
5760 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5762 msg_print("You feel less resistant");
5772 /* Redraw status bar */
5773 p_ptr->redraw |= (PR_STATUS);
5775 /* Nothing to notice */
5776 if (!notice) return (FALSE);
5779 if (disturb_state) disturb(0, 0);
5781 /* Recalculate bonuses */
5782 p_ptr->update |= (PU_BONUS);
5791 bool set_tim_res_nether(int v, bool do_dec)
5793 bool notice = FALSE;
5795 /* Hack -- Force good values */
5796 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5798 if (p_ptr->is_dead) return FALSE;
5803 if (p_ptr->tim_res_nether && !do_dec)
5805 if (p_ptr->tim_res_nether > v) return FALSE;
5807 else if (!p_ptr->tim_res_nether)
5810 msg_print("ÃϹö¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5812 msg_print("You feel nether resistant!");
5822 if (p_ptr->tim_res_nether)
5825 msg_print("ÃϹö¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5827 msg_print("You feel less nether resistant");
5835 p_ptr->tim_res_nether = v;
5837 /* Redraw status bar */
5838 p_ptr->redraw |= (PR_STATUS);
5840 /* Nothing to notice */
5841 if (!notice) return (FALSE);
5844 if (disturb_state) disturb(0, 0);
5846 /* Recalculate bonuses */
5847 p_ptr->update |= (PU_BONUS);
5856 bool set_tim_res_time(int v, bool do_dec)
5858 bool notice = FALSE;
5860 /* Hack -- Force good values */
5861 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5863 if (p_ptr->is_dead) return FALSE;
5868 if (p_ptr->tim_res_time && !do_dec)
5870 if (p_ptr->tim_res_time > v) return FALSE;
5872 else if (!p_ptr->tim_res_time)
5875 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5877 msg_print("You feel time resistant!");
5887 if (p_ptr->tim_res_time)
5890 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5892 msg_print("You feel less time resistant");
5900 p_ptr->tim_res_time = v;
5902 /* Redraw status bar */
5903 p_ptr->redraw |= (PR_STATUS);
5905 /* Nothing to notice */
5906 if (!notice) return (FALSE);
5909 if (disturb_state) disturb(0, 0);
5911 /* Recalculate bonuses */
5912 p_ptr->update |= (PU_BONUS);
5923 * Choose a warrior-mage elemental attack. -LM-
5925 bool choose_ele_attack(void)
5931 if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
5934 msg_format("Éð´ï¤ò»ý¤¿¤Ê¤¤¤ÈËâË¡·õ¤Ï»È¤¨¤Ê¤¤¡£");
5936 msg_format("You cannot use temporary branding with no weapon.");
5944 num = (p_ptr->lev - 20) / 5;
5947 c_prt(TERM_RED, " a) ¾Æ´þ", 2, 14);
5949 c_prt(TERM_RED, " a) Fire Brand", 2, 14);
5953 if (num >= 2) c_prt(TERM_L_WHITE," b) Åà·ë", 3, 14);
5955 if (num >= 2) c_prt(TERM_L_WHITE," b) Cold Brand", 3, 14);
5957 else prt("", 3, 14);
5960 if (num >= 3) c_prt(TERM_GREEN, " c) ÆÇ»¦", 4, 14);
5962 if (num >= 3) c_prt(TERM_GREEN, " c) Poison Brand", 4, 14);
5964 else prt("", 4, 14);
5967 if (num >= 4) c_prt(TERM_L_DARK, " d) Íϲò", 5, 14);
5969 if (num >= 4) c_prt(TERM_L_DARK, " d) Acid Brand", 5, 14);
5971 else prt("", 5, 14);
5974 if (num >= 5) c_prt(TERM_BLUE, " e) ÅÅ·â", 6, 14);
5976 if (num >= 5) c_prt(TERM_BLUE, " e) Elec Brand", 6, 14);
5978 else prt("", 6, 14);
5986 prt(" ¤É¤Î¸µÁǹ¶·â¤ò¤·¤Þ¤¹¤«¡©", 1, 14);
5988 prt(" Choose a temporary elemental brand ", 1, 14);
5993 if ((choice == 'a') || (choice == 'A'))
5994 set_ele_attack(ATTACK_FIRE, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5995 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
5996 set_ele_attack(ATTACK_COLD, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5997 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
5998 set_ele_attack(ATTACK_POIS, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5999 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
6000 set_ele_attack(ATTACK_ACID, p_ptr->lev/2 + randint1(p_ptr->lev/2));
6001 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
6002 set_ele_attack(ATTACK_ELEC, p_ptr->lev/2 + randint1(p_ptr->lev/2));
6006 msg_print("ËâË¡·õ¤ò»È¤¦¤Î¤ò¤ä¤á¤¿¡£");
6008 msg_print("You cancel the temporary branding.");
6020 * Choose a elemental immune. -LM-
6022 bool choose_ele_immune(int turn)
6030 c_prt(TERM_RED, " a) ²Ð±ê", 2, 14);
6032 c_prt(TERM_RED, " a) Immune Fire", 2, 14);
6036 c_prt(TERM_L_WHITE," b) Î䵤", 3, 14);
6038 c_prt(TERM_L_WHITE," b) Immune Cold", 3, 14);
6042 c_prt(TERM_L_DARK, " c) »À", 4, 14);
6044 c_prt(TERM_L_DARK, " c) Immune Acid", 4, 14);
6048 c_prt(TERM_BLUE, " d) ÅÅ·â", 5, 14);
6050 c_prt(TERM_BLUE, " d) Immune Elec", 5, 14);
6061 prt(" ¤É¤Î¸µÁǤÎÌȱ֤ò¤Ä¤±¤Þ¤¹¤«¡©", 1, 14);
6063 prt(" Choose a temporary elemental immune ", 1, 14);
6068 if ((choice == 'a') || (choice == 'A'))
6069 set_ele_immune(DEFENSE_FIRE, turn);
6070 else if ((choice == 'b') || (choice == 'B'))
6071 set_ele_immune(DEFENSE_COLD, turn);
6072 else if ((choice == 'c') || (choice == 'C'))
6073 set_ele_immune(DEFENSE_ACID, turn);
6074 else if ((choice == 'd') || (choice == 'D'))
6075 set_ele_immune(DEFENSE_ELEC, turn);
6079 msg_print("Ìȱ֤òÉÕ¤±¤ë¤Î¤ò¤ä¤á¤¿¡£");
6081 msg_print("You cancel the temporary immune.");