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;
991 if (p_ptr->lightspeed && !do_dec)
993 if (p_ptr->lightspeed > v) return FALSE;
995 else if (!p_ptr->lightspeed)
998 msg_print("Èó¾ï¤ËÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
1000 msg_print("You feel yourself moving extremely faster!");
1004 chg_virtue(V_PATIENCE, -1);
1005 chg_virtue(V_DILIGENCE, 1);
1012 if (p_ptr->lightspeed)
1015 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1017 msg_print("You feel yourself slow down.");
1025 p_ptr->lightspeed = v;
1027 /* Nothing to notice */
1028 if (!notice) return (FALSE);
1031 if (disturb_state) disturb(0, 0);
1033 /* Recalculate bonuses */
1034 p_ptr->update |= (PU_BONUS);
1045 * Set "p_ptr->slow", notice observable changes
1047 bool set_slow(int v, bool do_dec)
1049 bool notice = FALSE;
1051 /* Hack -- Force good values */
1052 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1054 if (p_ptr->is_dead) return FALSE;
1059 if (p_ptr->slow && !do_dec)
1061 if (p_ptr->slow > v) return FALSE;
1063 else if (!p_ptr->slow)
1066 msg_print("ÂΤÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
1068 msg_print("You feel yourself moving slower!");
1081 msg_print("Æ°¤¤ÎÃÙ¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1083 msg_print("You feel yourself speed up.");
1093 /* Nothing to notice */
1094 if (!notice) return (FALSE);
1097 if (disturb_state) disturb(0, 0);
1099 /* Recalculate bonuses */
1100 p_ptr->update |= (PU_BONUS);
1111 * Set "p_ptr->shield", notice observable changes
1113 bool set_shield(int v, bool do_dec)
1115 bool notice = FALSE;
1117 /* Hack -- Force good values */
1118 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1120 if (p_ptr->is_dead) return FALSE;
1125 if (p_ptr->shield && !do_dec)
1127 if (p_ptr->shield > v) return FALSE;
1129 else if (!p_ptr->shield)
1132 msg_print("È©¤¬ÀФˤʤä¿¡£");
1134 msg_print("Your skin turns to stone.");
1147 msg_print("È©¤¬¸µ¤ËÌá¤Ã¤¿¡£");
1149 msg_print("Your skin returns to normal.");
1159 /* Redraw status bar */
1160 p_ptr->redraw |= (PR_STATUS);
1162 /* Nothing to notice */
1163 if (!notice) return (FALSE);
1166 if (disturb_state) disturb(0, 0);
1168 /* Recalculate bonuses */
1169 p_ptr->update |= (PU_BONUS);
1181 * Set "p_ptr->tsubureru", notice observable changes
1183 bool set_tsubureru(int v, bool do_dec)
1185 bool notice = FALSE;
1187 /* Hack -- Force good values */
1188 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1190 if (p_ptr->is_dead) return FALSE;
1195 if (p_ptr->tsubureru && !do_dec)
1197 if (p_ptr->tsubureru > v) return FALSE;
1199 else if (!p_ptr->tsubureru)
1202 msg_print("²£¤Ë¿¤Ó¤¿¡£");
1204 msg_print("Your body expands horizontally.");
1214 if (p_ptr->tsubureru)
1217 msg_print("¤â¤¦²£¤Ë¿¤Ó¤Æ¤¤¤Ê¤¤¡£");
1219 msg_print("Your body returns to normal.");
1227 p_ptr->tsubureru = v;
1229 /* Redraw status bar */
1230 p_ptr->redraw |= (PR_STATUS);
1232 /* Nothing to notice */
1233 if (!notice) return (FALSE);
1236 if (disturb_state) disturb(0, 0);
1238 /* Recalculate bonuses */
1239 p_ptr->update |= (PU_BONUS);
1251 * Set "p_ptr->magicdef", notice observable changes
1253 bool set_magicdef(int v, bool do_dec)
1255 bool notice = FALSE;
1257 /* Hack -- Force good values */
1258 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1260 if (p_ptr->is_dead) return FALSE;
1265 if (p_ptr->magicdef && !do_dec)
1267 if (p_ptr->magicdef > v) return FALSE;
1269 else if (!p_ptr->magicdef)
1272 msg_print("ËâË¡¤ÎËɸæÎϤ¬Áý¤·¤¿¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1274 msg_print("You feel more resistant to magic.");
1284 if (p_ptr->magicdef)
1287 msg_print("ËâË¡¤ÎËɸæÎϤ¬¸µ¤ËÌá¤Ã¤¿¡£");
1289 msg_print("You feel less resistant to magic.");
1297 p_ptr->magicdef = v;
1299 /* Redraw status bar */
1300 p_ptr->redraw |= (PR_STATUS);
1302 /* Nothing to notice */
1303 if (!notice) return (FALSE);
1306 if (disturb_state) disturb(0, 0);
1308 /* Recalculate bonuses */
1309 p_ptr->update |= (PU_BONUS);
1321 * Set "p_ptr->blessed", notice observable changes
1323 bool set_blessed(int v, bool do_dec)
1325 bool notice = FALSE;
1327 /* Hack -- Force good values */
1328 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1330 if (p_ptr->is_dead) return FALSE;
1335 if (p_ptr->blessed && !do_dec)
1337 if (p_ptr->blessed > v) return FALSE;
1339 else if (!IS_BLESSED())
1342 msg_print("¹â·é¤Êµ¤Ê¬¤Ë¤Ê¤Ã¤¿¡ª");
1344 msg_print("You feel righteous!");
1354 if (p_ptr->blessed && !music_singing(MUSIC_BLESS))
1357 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1359 msg_print("The prayer has expired.");
1369 /* Redraw status bar */
1370 p_ptr->redraw |= (PR_STATUS);
1372 /* Nothing to notice */
1373 if (!notice) return (FALSE);
1376 if (disturb_state) disturb(0, 0);
1378 /* Recalculate bonuses */
1379 p_ptr->update |= (PU_BONUS);
1390 * Set "p_ptr->hero", notice observable changes
1392 bool set_hero(int v, bool do_dec)
1394 bool notice = FALSE;
1396 /* Hack -- Force good values */
1397 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1399 if (p_ptr->is_dead) return FALSE;
1404 if (p_ptr->hero && !do_dec)
1406 if (p_ptr->hero > v) return FALSE;
1408 else if (!IS_HERO())
1411 msg_print("¥Ò¡¼¥í¡¼¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1413 msg_print("You feel like a hero!");
1423 if (p_ptr->hero && !music_singing(MUSIC_HERO) && !music_singing(MUSIC_SHERO))
1426 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1428 msg_print("The heroism wears off.");
1438 /* Redraw status bar */
1439 p_ptr->redraw |= (PR_STATUS);
1441 /* Nothing to notice */
1442 if (!notice) return (FALSE);
1445 if (disturb_state) disturb(0, 0);
1447 /* Recalculate bonuses */
1448 p_ptr->update |= (PU_BONUS);
1450 /* Recalculate hitpoints */
1451 p_ptr->update |= (PU_HP);
1462 * Set "p_ptr->shero", notice observable changes
1464 bool set_shero(int v, bool do_dec)
1466 bool notice = FALSE;
1468 /* Hack -- Force good values */
1469 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1471 if (p_ptr->is_dead) return FALSE;
1473 if (p_ptr->pclass == CLASS_BERSERKER) v = 1;
1477 if (p_ptr->shero && !do_dec)
1479 if (p_ptr->shero > v) return FALSE;
1481 else if (!p_ptr->shero)
1484 msg_print("»¦Ù¤¥Þ¥·¡¼¥ó¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1486 msg_print("You feel like a killing machine!");
1499 msg_print("ÌîÈڤʵ¤»ý¤Á¤¬¾Ã¤¨¼º¤»¤¿¡£");
1501 msg_print("You feel less Berserk.");
1511 /* Redraw status bar */
1512 p_ptr->redraw |= (PR_STATUS);
1514 /* Nothing to notice */
1515 if (!notice) return (FALSE);
1518 if (disturb_state) disturb(0, 0);
1520 /* Recalculate bonuses */
1521 p_ptr->update |= (PU_BONUS);
1523 /* Recalculate hitpoints */
1524 p_ptr->update |= (PU_HP);
1535 * Set "p_ptr->protevil", notice observable changes
1537 bool set_protevil(int v, bool do_dec)
1539 bool notice = FALSE;
1541 /* Hack -- Force good values */
1542 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1544 if (p_ptr->is_dead) return FALSE;
1549 if (p_ptr->protevil && !do_dec)
1551 if (p_ptr->protevil > v) return FALSE;
1553 else if (!p_ptr->protevil)
1556 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Ê´¶¤¸¤¬¤¹¤ë¡ª");
1558 msg_print("You feel safe from evil!");
1568 if (p_ptr->protevil)
1571 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1573 msg_print("You no longer feel safe from evil.");
1581 p_ptr->protevil = v;
1583 /* Redraw status bar */
1584 p_ptr->redraw |= (PR_STATUS);
1586 /* Nothing to notice */
1587 if (!notice) return (FALSE);
1590 if (disturb_state) disturb(0, 0);
1600 * Set "p_ptr->wraith_form", notice observable changes
1602 bool set_wraith_form(int v, bool do_dec)
1604 bool notice = FALSE;
1606 /* Hack -- Force good values */
1607 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1609 if (p_ptr->is_dead) return FALSE;
1614 if (p_ptr->wraith_form && !do_dec)
1616 if (p_ptr->wraith_form > v) return FALSE;
1618 else if (!p_ptr->wraith_form)
1621 msg_print("ʪ¼Á³¦¤òÎ¥¤ì¤ÆÍ©µ´¤Î¤è¤¦¤Ê¸ºß¤Ë¤Ê¤Ã¤¿¡ª");
1623 msg_print("You leave the physical world and turn into a wraith-being!");
1628 chg_virtue(V_UNLIFE, 3);
1629 chg_virtue(V_HONOUR, -2);
1630 chg_virtue(V_SACRIFICE, -2);
1631 chg_virtue(V_VALOUR, -5);
1634 p_ptr->redraw |= (PR_MAP);
1636 /* Update monsters */
1637 p_ptr->update |= (PU_MONSTERS);
1640 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1647 if (p_ptr->wraith_form)
1650 msg_print("ÉÔÆ©ÌÀ¤Ë¤Ê¤Ã¤¿´¶¤¸¤¬¤¹¤ë¡£");
1652 msg_print("You feel opaque.");
1658 p_ptr->redraw |= (PR_MAP);
1660 /* Update monsters */
1661 p_ptr->update |= (PU_MONSTERS);
1664 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1669 p_ptr->wraith_form = v;
1671 /* Redraw status bar */
1672 p_ptr->redraw |= (PR_STATUS);
1674 /* Nothing to notice */
1675 if (!notice) return (FALSE);
1678 if (disturb_state) disturb(0, 0);
1680 /* Recalculate bonuses */
1681 p_ptr->update |= (PU_BONUS);
1693 * Set "p_ptr->invuln", notice observable changes
1695 bool set_invuln(int v, bool do_dec)
1697 bool notice = FALSE;
1699 /* Hack -- Force good values */
1700 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1702 if (p_ptr->is_dead) return FALSE;
1707 if (p_ptr->invuln && !do_dec)
1709 if (p_ptr->invuln > v) return FALSE;
1711 else if (!IS_INVULN())
1714 msg_print("̵Ũ¤À¡ª");
1716 msg_print("Invulnerability!");
1721 chg_virtue(V_UNLIFE, -2);
1722 chg_virtue(V_HONOUR, -2);
1723 chg_virtue(V_SACRIFICE, -3);
1724 chg_virtue(V_VALOUR, -5);
1727 p_ptr->redraw |= (PR_MAP);
1729 /* Update monsters */
1730 p_ptr->update |= (PU_MONSTERS);
1733 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1740 if (p_ptr->invuln && !music_singing(MUSIC_INVULN))
1743 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
1745 msg_print("The invulnerability wears off.");
1751 p_ptr->redraw |= (PR_MAP);
1753 /* Update monsters */
1754 p_ptr->update |= (PU_MONSTERS);
1757 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1759 p_ptr->energy_need += ENERGY_NEED();
1766 /* Redraw status bar */
1767 p_ptr->redraw |= (PR_STATUS);
1769 /* Nothing to notice */
1770 if (!notice) return (FALSE);
1773 if (disturb_state) disturb(0, 0);
1775 /* Recalculate bonuses */
1776 p_ptr->update |= (PU_BONUS);
1787 * Set "p_ptr->tim_esp", notice observable changes
1789 bool set_tim_esp(int v, bool do_dec)
1791 bool notice = FALSE;
1793 /* Hack -- Force good values */
1794 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1796 if (p_ptr->is_dead) return FALSE;
1801 if (p_ptr->tim_esp && !do_dec)
1803 if (p_ptr->tim_esp > v) return FALSE;
1805 else if (!IS_TIM_ESP())
1808 msg_print("°Õ¼±¤¬¹¤¬¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1810 msg_print("You feel your consciousness expand!");
1820 if (p_ptr->tim_esp && !music_singing(MUSIC_MIND))
1823 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
1825 msg_print("Your consciousness contracts again.");
1835 /* Redraw status bar */
1836 p_ptr->redraw |= (PR_STATUS);
1838 /* Nothing to notice */
1839 if (!notice) return (FALSE);
1842 if (disturb_state) disturb(0, 0);
1844 /* Recalculate bonuses */
1845 p_ptr->update |= (PU_BONUS);
1847 /* Update the monsters */
1848 p_ptr->update |= (PU_MONSTERS);
1859 * Set "p_ptr->tim_invis", notice observable changes
1861 bool set_tim_invis(int v, bool do_dec)
1863 bool notice = FALSE;
1865 /* Hack -- Force good values */
1866 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1868 if (p_ptr->is_dead) return FALSE;
1873 if (p_ptr->tim_invis && !do_dec)
1875 if (p_ptr->tim_invis > v) return FALSE;
1877 else if (!p_ptr->tim_invis)
1880 msg_print("Ìܤ¬Èó¾ï¤ËÉÒ´¶¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1882 msg_print("Your eyes feel very sensitive!");
1892 if (p_ptr->tim_invis)
1895 msg_print("ÌܤÎÉÒ´¶¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1897 msg_print("Your eyes feel less sensitive.");
1905 p_ptr->tim_invis = v;
1907 /* Redraw status bar */
1908 p_ptr->redraw |= (PR_STATUS);
1910 /* Nothing to notice */
1911 if (!notice) return (FALSE);
1914 if (disturb_state) disturb(0, 0);
1916 /* Recalculate bonuses */
1917 p_ptr->update |= (PU_BONUS);
1919 /* Update the monsters */
1920 p_ptr->update |= (PU_MONSTERS);
1931 * Set "p_ptr->tim_infra", notice observable changes
1933 bool set_tim_infra(int v, bool do_dec)
1935 bool notice = FALSE;
1937 /* Hack -- Force good values */
1938 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1940 if (p_ptr->is_dead) return FALSE;
1945 if (p_ptr->tim_infra && !do_dec)
1947 if (p_ptr->tim_infra > v) return FALSE;
1949 else if (!p_ptr->tim_infra)
1952 msg_print("Ìܤ¬¥é¥ó¥é¥ó¤Èµ±¤»Ï¤á¤¿¡ª");
1954 msg_print("Your eyes begin to tingle!");
1964 if (p_ptr->tim_infra)
1967 msg_print("Ìܤ層¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1969 msg_print("Your eyes stop tingling.");
1977 p_ptr->tim_infra = v;
1979 /* Redraw status bar */
1980 p_ptr->redraw |= (PR_STATUS);
1982 /* Nothing to notice */
1983 if (!notice) return (FALSE);
1986 if (disturb_state) disturb(0, 0);
1988 /* Recalculate bonuses */
1989 p_ptr->update |= (PU_BONUS);
1991 /* Update the monsters */
1992 p_ptr->update |= (PU_MONSTERS);
2003 * Set "p_ptr->tim_regen", notice observable changes
2005 bool set_tim_regen(int v, bool do_dec)
2007 bool notice = FALSE;
2009 /* Hack -- Force good values */
2010 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2012 if (p_ptr->is_dead) return FALSE;
2017 if (p_ptr->tim_regen && !do_dec)
2019 if (p_ptr->tim_regen > v) return FALSE;
2021 else if (!p_ptr->tim_regen)
2024 msg_print("²óÉüÎϤ¬¾å¤¬¤Ã¤¿¡ª");
2026 msg_print("You feel yourself regenerating quickly!");
2036 if (p_ptr->tim_regen)
2039 msg_print("ÁÇÁ᤯²óÉü¤¹¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
2041 msg_print("You feel yourself regenerating slowly.");
2049 p_ptr->tim_regen = v;
2051 /* Redraw status bar */
2052 p_ptr->redraw |= (PR_STATUS);
2054 /* Nothing to notice */
2055 if (!notice) return (FALSE);
2058 if (disturb_state) disturb(0, 0);
2060 /* Recalculate bonuses */
2061 p_ptr->update |= (PU_BONUS);
2072 * Set "p_ptr->tim_stealth", notice observable changes
2074 bool set_tim_stealth(int v, bool do_dec)
2076 bool notice = FALSE;
2078 /* Hack -- Force good values */
2079 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2081 if (p_ptr->is_dead) return FALSE;
2086 if (p_ptr->tim_stealth && !do_dec)
2088 if (p_ptr->tim_stealth > v) return FALSE;
2090 else if (!IS_TIM_STEALTH())
2093 msg_print("²»¤¬¾®¤µ¤¯¤Ê¤Ã¤¿¡ª");
2095 msg_print("You begin to walk silently!");
2105 if (p_ptr->tim_stealth && !music_singing(MUSIC_STEALTH))
2108 msg_print("²»¤¬Â礤¯¤Ê¤Ã¤¿¡£");
2110 msg_print("You no longer walk silently.");
2118 p_ptr->tim_stealth = v;
2120 /* Redraw status bar */
2121 p_ptr->redraw |= (PR_STATUS);
2123 /* Nothing to notice */
2124 if (!notice) return (FALSE);
2127 if (disturb_state) disturb(0, 0);
2129 /* Recalculate bonuses */
2130 p_ptr->update |= (PU_BONUS);
2140 bool set_superstealth(bool set)
2142 bool notice = FALSE;
2144 if (p_ptr->is_dead) return FALSE;
2149 if (!(p_ptr->special_defense & NINJA_S_STEALTH))
2151 if (cave[py][px].info & CAVE_MNLT)
2154 msg_print("Ũ¤ÎÌܤ«¤éÇö¤¤±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡£");
2156 msg_print("You are mantled in weak shadow from ordinary eyes.");
2158 p_ptr->monlite = p_ptr->old_monlite = TRUE;
2163 msg_print("Ũ¤ÎÌܤ«¤é±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡ª");
2165 msg_print("You are mantled in shadow from ordinary eyes!");
2167 p_ptr->monlite = p_ptr->old_monlite = FALSE;
2173 p_ptr->special_defense |= NINJA_S_STEALTH;
2180 if (p_ptr->special_defense & NINJA_S_STEALTH)
2183 msg_print("ºÆ¤ÓŨ¤ÎÌܤˤµ¤é¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
2185 msg_print("You are exposed to common sight once more.");
2191 p_ptr->special_defense &= ~(NINJA_S_STEALTH);
2195 /* Nothing to notice */
2196 if (!notice) return (FALSE);
2198 /* Redraw status bar */
2199 p_ptr->redraw |= (PR_STATUS);
2202 if (disturb_state) disturb(0, 0);
2210 * Set "p_ptr->tim_levitation", notice observable changes
2212 bool set_tim_levitation(int v, bool do_dec)
2214 bool notice = FALSE;
2216 /* Hack -- Force good values */
2217 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2219 if (p_ptr->is_dead) return FALSE;
2224 if (p_ptr->tim_levitation && !do_dec)
2226 if (p_ptr->tim_levitation > v) return FALSE;
2228 else if (!p_ptr->tim_levitation)
2231 msg_print("ÂΤ¬Ãè¤ËÉ⤻Ϥ᤿¡£");
2233 msg_print("You begin to fly!");
2243 if (p_ptr->tim_levitation)
2246 msg_print("¤â¤¦Ãè¤ËÉ⤫¤Ù¤Ê¤¯¤Ê¤Ã¤¿¡£");
2248 msg_print("You stop flying.");
2256 p_ptr->tim_levitation = v;
2258 /* Redraw status bar */
2259 p_ptr->redraw |= (PR_STATUS);
2261 /* Nothing to notice */
2262 if (!notice) return (FALSE);
2265 if (disturb_state) disturb(0, 0);
2267 /* Recalculate bonuses */
2268 p_ptr->update |= (PU_BONUS);
2279 * Set "p_ptr->tim_sh_touki", notice observable changes
2281 bool set_tim_sh_touki(int v, bool do_dec)
2283 bool notice = FALSE;
2285 /* Hack -- Force good values */
2286 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2288 if (p_ptr->is_dead) return FALSE;
2293 if (p_ptr->tim_sh_touki && !do_dec)
2295 if (p_ptr->tim_sh_touki > v) return FALSE;
2297 else if (!p_ptr->tim_sh_touki)
2300 msg_print("ÂΤ¬Æ®µ¤¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2302 msg_print("You have enveloped by the aura of the Force!");
2312 if (p_ptr->tim_sh_touki)
2315 msg_print("Æ®µ¤¤¬¾Ã¤¨¤¿¡£");
2317 msg_print("Aura of the Force disappeared.");
2325 p_ptr->tim_sh_touki = v;
2327 /* Redraw status bar */
2328 p_ptr->redraw |= (PR_STATUS);
2330 /* Nothing to notice */
2331 if (!notice) return (FALSE);
2334 if (disturb_state) disturb(0, 0);
2345 * Set "p_ptr->tim_sh_fire", notice observable changes
2347 bool set_tim_sh_fire(int v, bool do_dec)
2349 bool notice = FALSE;
2351 /* Hack -- Force good values */
2352 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2354 if (p_ptr->is_dead) return FALSE;
2359 if (p_ptr->tim_sh_fire && !do_dec)
2361 if (p_ptr->tim_sh_fire > v) return FALSE;
2363 else if (!p_ptr->tim_sh_fire)
2366 msg_print("ÂΤ¬±ê¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2368 msg_print("You have enveloped by fiery aura!");
2378 if (p_ptr->tim_sh_fire)
2381 msg_print("±ê¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2383 msg_print("Fiery aura disappeared.");
2391 p_ptr->tim_sh_fire = v;
2393 /* Redraw status bar */
2394 p_ptr->redraw |= (PR_STATUS);
2396 /* Nothing to notice */
2397 if (!notice) return (FALSE);
2400 if (disturb_state) disturb(0, 0);
2402 /* Recalculate bonuses */
2403 p_ptr->update |= (PU_BONUS);
2414 * Set "p_ptr->tim_sh_holy", notice observable changes
2416 bool set_tim_sh_holy(int v, bool do_dec)
2418 bool notice = FALSE;
2420 /* Hack -- Force good values */
2421 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2423 if (p_ptr->is_dead) return FALSE;
2428 if (p_ptr->tim_sh_holy && !do_dec)
2430 if (p_ptr->tim_sh_holy > v) return FALSE;
2432 else if (!p_ptr->tim_sh_holy)
2435 msg_print("ÂΤ¬À»¤Ê¤ë¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2437 msg_print("You have enveloped by holy aura!");
2447 if (p_ptr->tim_sh_holy)
2450 msg_print("À»¤Ê¤ë¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2452 msg_print("Holy aura disappeared.");
2460 p_ptr->tim_sh_holy = v;
2462 /* Redraw status bar */
2463 p_ptr->redraw |= (PR_STATUS);
2465 /* Nothing to notice */
2466 if (!notice) return (FALSE);
2469 if (disturb_state) disturb(0, 0);
2471 /* Recalculate bonuses */
2472 p_ptr->update |= (PU_BONUS);
2484 * Set "p_ptr->tim_eyeeye", notice observable changes
2486 bool set_tim_eyeeye(int v, bool do_dec)
2488 bool notice = FALSE;
2490 /* Hack -- Force good values */
2491 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2493 if (p_ptr->is_dead) return FALSE;
2498 if (p_ptr->tim_eyeeye && !do_dec)
2500 if (p_ptr->tim_eyeeye > v) return FALSE;
2502 else if (!p_ptr->tim_eyeeye)
2505 msg_print("Ë¡¤Î¼é¤ê¼ê¤Ë¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¡ª");
2507 msg_print("You feel like a keeper of commandments!");
2517 if (p_ptr->tim_eyeeye)
2520 msg_print("Ĩȳ¤ò¼¹¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2522 msg_print("You no longer feel like a keeper.");
2530 p_ptr->tim_eyeeye = v;
2532 /* Redraw status bar */
2533 p_ptr->redraw |= (PR_STATUS);
2535 /* Nothing to notice */
2536 if (!notice) return (FALSE);
2539 if (disturb_state) disturb(0, 0);
2541 /* Recalculate bonuses */
2542 p_ptr->update |= (PU_BONUS);
2554 * Set "p_ptr->resist_magic", notice observable changes
2556 bool set_resist_magic(int v, bool do_dec)
2558 bool notice = FALSE;
2560 /* Hack -- Force good values */
2561 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2563 if (p_ptr->is_dead) return FALSE;
2568 if (p_ptr->resist_magic && !do_dec)
2570 if (p_ptr->resist_magic > v) return FALSE;
2572 else if (!p_ptr->resist_magic)
2575 msg_print("ËâË¡¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿¡£");
2577 msg_print("You have been protected from magic!");
2587 if (p_ptr->resist_magic)
2590 msg_print("ËâË¡¤Ë¼å¤¯¤Ê¤Ã¤¿¡£");
2592 msg_print("You are no longer protected from magic.");
2600 p_ptr->resist_magic = v;
2602 /* Redraw status bar */
2603 p_ptr->redraw |= (PR_STATUS);
2605 /* Nothing to notice */
2606 if (!notice) return (FALSE);
2609 if (disturb_state) disturb(0, 0);
2611 /* Recalculate bonuses */
2612 p_ptr->update |= (PU_BONUS);
2623 * Set "p_ptr->tim_reflect", notice observable changes
2625 bool set_tim_reflect(int v, bool do_dec)
2627 bool notice = FALSE;
2629 /* Hack -- Force good values */
2630 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2632 if (p_ptr->is_dead) return FALSE;
2637 if (p_ptr->tim_reflect && !do_dec)
2639 if (p_ptr->tim_reflect > v) return FALSE;
2641 else if (!p_ptr->tim_reflect)
2644 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2646 msg_print("Your body becames smooth.");
2656 if (p_ptr->tim_reflect)
2659 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ç¤Ê¤¯¤Ê¤Ã¤¿¡£");
2661 msg_print("Your body is no longer smooth.");
2669 p_ptr->tim_reflect = v;
2671 /* Redraw status bar */
2672 p_ptr->redraw |= (PR_STATUS);
2674 /* Nothing to notice */
2675 if (!notice) return (FALSE);
2678 if (disturb_state) disturb(0, 0);
2680 /* Recalculate bonuses */
2681 p_ptr->update |= (PU_BONUS);
2692 * Set "p_ptr->multishadow", notice observable changes
2694 bool set_multishadow(int v, bool do_dec)
2696 bool notice = FALSE;
2698 /* Hack -- Force good values */
2699 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2701 if (p_ptr->is_dead) return FALSE;
2706 if (p_ptr->multishadow && !do_dec)
2708 if (p_ptr->multishadow > v) return FALSE;
2710 else if (!p_ptr->multishadow)
2713 msg_print("¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¸¸±Æ¤¬À¸¤Þ¤ì¤¿¡£");
2715 msg_print("Your Shadow enveloped you.");
2725 if (p_ptr->multishadow)
2728 msg_print("¸¸±Æ¤¬¾Ã¤¨¤¿¡£");
2730 msg_print("Your Shadow disappears.");
2738 p_ptr->multishadow = v;
2740 /* Redraw status bar */
2741 p_ptr->redraw |= (PR_STATUS);
2743 /* Nothing to notice */
2744 if (!notice) return (FALSE);
2747 if (disturb_state) disturb(0, 0);
2749 /* Recalculate bonuses */
2750 p_ptr->update |= (PU_BONUS);
2761 * Set "p_ptr->dustrobe", notice observable changes
2763 bool set_dustrobe(int v, bool do_dec)
2765 bool notice = FALSE;
2767 /* Hack -- Force good values */
2768 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2770 if (p_ptr->is_dead) return FALSE;
2775 if (p_ptr->dustrobe && !do_dec)
2777 if (p_ptr->dustrobe > v) return FALSE;
2779 else if (!p_ptr->dustrobe)
2782 msg_print("ÂΤ¬¶À¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2784 msg_print("You were enveloped by mirror shards.");
2794 if (p_ptr->dustrobe)
2797 msg_print("¶À¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2799 msg_print("The mirror shards disappear.");
2807 p_ptr->dustrobe = v;
2809 /* Redraw status bar */
2810 p_ptr->redraw |= (PR_STATUS);
2812 /* Nothing to notice */
2813 if (!notice) return (FALSE);
2816 if (disturb_state) disturb(0, 0);
2818 /* Recalculate bonuses */
2819 p_ptr->update |= (PU_BONUS);
2830 * Set "p_ptr->tim_regen", notice observable changes
2832 bool set_kabenuke(int v, bool do_dec)
2834 bool notice = FALSE;
2836 /* Hack -- Force good values */
2837 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2839 if (p_ptr->is_dead) return FALSE;
2844 if (p_ptr->kabenuke && !do_dec)
2846 if (p_ptr->kabenuke > v) return FALSE;
2848 else if (!p_ptr->kabenuke)
2851 msg_print("ÂΤ¬È¾Êª¼Á¤Î¾õÂ֤ˤʤä¿¡£");
2853 msg_print("You became ethereal form.");
2863 if (p_ptr->kabenuke)
2866 msg_print("ÂΤ¬Êª¼Á²½¤·¤¿¡£");
2868 msg_print("You are no longer in an ethereal form.");
2876 p_ptr->kabenuke = v;
2878 /* Redraw status bar */
2879 p_ptr->redraw |= (PR_STATUS);
2881 /* Nothing to notice */
2882 if (!notice) return (FALSE);
2885 if (disturb_state) disturb(0, 0);
2887 /* Recalculate bonuses */
2888 p_ptr->update |= (PU_BONUS);
2898 bool set_tsuyoshi(int v, bool do_dec)
2900 bool notice = FALSE;
2902 /* Hack -- Force good values */
2903 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2905 if (p_ptr->is_dead) return FALSE;
2910 if (p_ptr->tsuyoshi && !do_dec)
2912 if (p_ptr->tsuyoshi > v) return FALSE;
2914 else if (!p_ptr->tsuyoshi)
2917 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
2919 msg_print("Brother OKURE!");
2923 chg_virtue(V_VITALITY, 2);
2930 if (p_ptr->tsuyoshi)
2933 msg_print("ÆùÂΤ¬µÞ®¤Ë¤·¤Ü¤ó¤Ç¤¤¤Ã¤¿¡£");
2935 msg_print("Your body had quickly shriveled.");
2938 (void)dec_stat(A_CON, 20, TRUE);
2939 (void)dec_stat(A_STR, 20, TRUE);
2942 chg_virtue(V_VITALITY, -3);
2947 p_ptr->tsuyoshi = v;
2949 /* Redraw status bar */
2950 p_ptr->redraw |= (PR_STATUS);
2952 /* Nothing to notice */
2953 if (!notice) return (FALSE);
2956 if (disturb_state) disturb(0, 0);
2958 /* Recalculate bonuses */
2959 p_ptr->update |= (PU_BONUS);
2961 /* Recalculate hitpoints */
2962 p_ptr->update |= (PU_HP);
2973 * Set a temporary elemental brand. Clear all other brands. Print status
2976 bool set_ele_attack(u32b attack_type, int v)
2978 /* Hack -- Force good values */
2979 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2981 /* Clear all elemental attacks (only one is allowed at a time). */
2982 if ((p_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
2984 p_ptr->special_attack &= ~(ATTACK_ACID);
2986 msg_print("»À¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2988 msg_print("Your temporary acidic brand fades away.");
2991 if ((p_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
2993 p_ptr->special_attack &= ~(ATTACK_ELEC);
2995 msg_print("ÅÅ·â¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2997 msg_print("Your temporary electrical brand fades away.");
3000 if ((p_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
3002 p_ptr->special_attack &= ~(ATTACK_FIRE);
3004 msg_print("²Ð±ê¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
3006 msg_print("Your temporary fiery brand fades away.");
3009 if ((p_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
3011 p_ptr->special_attack &= ~(ATTACK_COLD);
3013 msg_print("Î䵤¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
3015 msg_print("Your temporary frost brand fades away.");
3018 if ((p_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
3020 p_ptr->special_attack &= ~(ATTACK_POIS);
3022 msg_print("ÆǤǹ¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
3024 msg_print("Your temporary poison brand fades away.");
3028 if ((v) && (attack_type))
3030 /* Set attack type. */
3031 p_ptr->special_attack |= (attack_type);
3034 p_ptr->ele_attack = v;
3038 msg_format("%s¤Ç¹¶·â¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª",
3039 ((attack_type == ATTACK_ACID) ? "»À" :
3040 ((attack_type == ATTACK_ELEC) ? "ÅÅ·â" :
3041 ((attack_type == ATTACK_FIRE) ? "²Ð±ê" :
3042 ((attack_type == ATTACK_COLD) ? "Î䵤" :
3043 ((attack_type == ATTACK_POIS) ? "ÆÇ" :
3046 msg_format("For a while, the blows you deal will %s",
3047 ((attack_type == ATTACK_ACID) ? "melt with acid!" :
3048 ((attack_type == ATTACK_ELEC) ? "shock your foes!" :
3049 ((attack_type == ATTACK_FIRE) ? "burn with fire!" :
3050 ((attack_type == ATTACK_COLD) ? "chill to the bone!" :
3051 ((attack_type == ATTACK_POIS) ? "poison your enemies!" :
3052 "do nothing special."))))));
3057 if (disturb_state) disturb(0, 0);
3059 /* Redraw status bar */
3060 p_ptr->redraw |= (PR_STATUS);
3062 p_ptr->update |= (PU_BONUS);
3072 * Set a temporary elemental brand. Clear all other brands. Print status
3075 bool set_ele_immune(u32b immune_type, int v)
3077 /* Hack -- Force good values */
3078 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3080 /* Clear all elemental attacks (only one is allowed at a time). */
3081 if ((p_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
3083 p_ptr->special_defense &= ~(DEFENSE_ACID);
3085 msg_print("»À¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3087 msg_print("You are no longer immune to acid.");
3090 if ((p_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
3092 p_ptr->special_defense &= ~(DEFENSE_ELEC);
3094 msg_print("ÅÅ·â¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3096 msg_print("You are no longer immune to electricity.");
3099 if ((p_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
3101 p_ptr->special_defense &= ~(DEFENSE_FIRE);
3103 msg_print("²Ð±ê¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3105 msg_print("You are no longer immune to fire.");
3108 if ((p_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
3110 p_ptr->special_defense &= ~(DEFENSE_COLD);
3112 msg_print("Î䵤¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3114 msg_print("You are no longer immune to cold.");
3117 if ((p_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
3119 p_ptr->special_defense &= ~(DEFENSE_POIS);
3121 msg_print("ÆǤι¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3123 msg_print("You are no longer immune to poison.");
3127 if ((v) && (immune_type))
3129 /* Set attack type. */
3130 p_ptr->special_defense |= (immune_type);
3133 p_ptr->ele_immune = v;
3137 msg_format("%s¤Î¹¶·â¤ò¼õ¤±¤Ä¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª",
3138 ((immune_type == DEFENSE_ACID) ? "»À" :
3139 ((immune_type == DEFENSE_ELEC) ? "ÅÅ·â" :
3140 ((immune_type == DEFENSE_FIRE) ? "²Ð±ê" :
3141 ((immune_type == DEFENSE_COLD) ? "Î䵤" :
3142 ((immune_type == DEFENSE_POIS) ? "ÆÇ" :
3145 msg_format("For a while, You are immune to %s",
3146 ((immune_type == DEFENSE_ACID) ? "acid!" :
3147 ((immune_type == DEFENSE_ELEC) ? "electricity!" :
3148 ((immune_type == DEFENSE_FIRE) ? "fire!" :
3149 ((immune_type == DEFENSE_COLD) ? "cold!" :
3150 ((immune_type == DEFENSE_POIS) ? "poison!" :
3151 "do nothing special."))))));
3156 if (disturb_state) disturb(0, 0);
3158 /* Redraw status bar */
3159 p_ptr->redraw |= (PR_STATUS);
3161 p_ptr->update |= (PU_BONUS);
3171 * Set "p_ptr->oppose_acid", notice observable changes
3173 bool set_oppose_acid(int v, bool do_dec)
3175 bool notice = FALSE;
3177 /* Hack -- Force good values */
3178 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3180 if (p_ptr->is_dead) return FALSE;
3185 if (p_ptr->oppose_acid && !do_dec)
3187 if (p_ptr->oppose_acid > v) return FALSE;
3189 else if (!IS_OPPOSE_ACID())
3192 msg_print("»À¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3194 msg_print("You feel resistant to acid!");
3204 if (p_ptr->oppose_acid && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3207 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3209 msg_print("You feel less resistant to acid.");
3217 p_ptr->oppose_acid = v;
3219 /* Nothing to notice */
3220 if (!notice) return (FALSE);
3222 /* Redraw status bar */
3223 p_ptr->redraw |= (PR_STATUS);
3226 if (disturb_state) disturb(0, 0);
3237 * Set "p_ptr->oppose_elec", notice observable changes
3239 bool set_oppose_elec(int v, bool do_dec)
3241 bool notice = FALSE;
3243 /* Hack -- Force good values */
3244 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3246 if (p_ptr->is_dead) return FALSE;
3251 if (p_ptr->oppose_elec && !do_dec)
3253 if (p_ptr->oppose_elec > v) return FALSE;
3255 else if (!IS_OPPOSE_ELEC())
3258 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3260 msg_print("You feel resistant to electricity!");
3270 if (p_ptr->oppose_elec && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3273 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3275 msg_print("You feel less resistant to electricity.");
3283 p_ptr->oppose_elec = v;
3285 /* Nothing to notice */
3286 if (!notice) return (FALSE);
3288 /* Redraw status bar */
3289 p_ptr->redraw |= (PR_STATUS);
3292 if (disturb_state) disturb(0, 0);
3303 * Set "p_ptr->oppose_fire", notice observable changes
3305 bool set_oppose_fire(int v, bool do_dec)
3307 bool notice = FALSE;
3309 /* Hack -- Force good values */
3310 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3312 if (p_ptr->is_dead) return FALSE;
3314 if ((prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
3318 if (p_ptr->oppose_fire && !do_dec)
3320 if (p_ptr->oppose_fire > v) return FALSE;
3322 else if (!IS_OPPOSE_FIRE())
3325 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3327 msg_print("You feel resistant to fire!");
3337 if (p_ptr->oppose_fire && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3340 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3342 msg_print("You feel less resistant to fire.");
3350 p_ptr->oppose_fire = v;
3352 /* Nothing to notice */
3353 if (!notice) return (FALSE);
3355 /* Redraw status bar */
3356 p_ptr->redraw |= (PR_STATUS);
3359 if (disturb_state) disturb(0, 0);
3370 * Set "p_ptr->oppose_cold", notice observable changes
3372 bool set_oppose_cold(int v, bool do_dec)
3374 bool notice = FALSE;
3376 /* Hack -- Force good values */
3377 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3379 if (p_ptr->is_dead) return FALSE;
3384 if (p_ptr->oppose_cold && !do_dec)
3386 if (p_ptr->oppose_cold > v) return FALSE;
3388 else if (!IS_OPPOSE_COLD())
3391 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3393 msg_print("You feel resistant to cold!");
3403 if (p_ptr->oppose_cold && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3406 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3408 msg_print("You feel less resistant to cold.");
3416 p_ptr->oppose_cold = v;
3418 /* Nothing to notice */
3419 if (!notice) return (FALSE);
3421 /* Redraw status bar */
3422 p_ptr->redraw |= (PR_STATUS);
3425 if (disturb_state) disturb(0, 0);
3436 * Set "p_ptr->oppose_pois", notice observable changes
3438 bool set_oppose_pois(int v, bool do_dec)
3440 bool notice = FALSE;
3442 /* Hack -- Force good values */
3443 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3445 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) v = 1;
3446 if (p_ptr->is_dead) return FALSE;
3451 if (p_ptr->oppose_pois && !do_dec)
3453 if (p_ptr->oppose_pois > v) return FALSE;
3455 else if (!IS_OPPOSE_POIS())
3458 msg_print("ÆǤؤÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3460 msg_print("You feel resistant to poison!");
3470 if (p_ptr->oppose_pois && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3473 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3475 msg_print("You feel less resistant to poison.");
3483 p_ptr->oppose_pois = v;
3485 /* Nothing to notice */
3486 if (!notice) return (FALSE);
3488 /* Redraw status bar */
3489 p_ptr->redraw |= (PR_STATUS);
3492 if (disturb_state) disturb(0, 0);
3503 * Set "p_ptr->stun", notice observable changes
3505 * Note the special code to only notice "range" changes.
3507 bool set_stun(int v)
3509 int old_aux, new_aux;
3510 bool notice = FALSE;
3513 /* Hack -- Force good values */
3514 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3516 if (p_ptr->is_dead) return FALSE;
3518 if (prace_is_(RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
3521 if (p_ptr->stun > 100)
3527 else if (p_ptr->stun > 50)
3533 else if (p_ptr->stun > 0)
3569 if (new_aux > old_aux)
3571 /* Describe the state */
3577 msg_print("°Õ¼±¤¬¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3579 msg_print("You have been stunned.");
3587 msg_print("°Õ¼±¤¬¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3589 msg_print("You have been heavily stunned.");
3597 msg_print("Ƭ¤¬¥¯¥é¥¯¥é¤·¤Æ°Õ¼±¤¬±ó¤Î¤¤¤Æ¤¤¿¡£");
3599 msg_print("You have been knocked out.");
3605 if (randint1(1000) < v || one_in_(16))
3608 msg_print("³ä¤ì¤ë¤è¤¦¤ÊƬÄˤ¬¤¹¤ë¡£");
3610 msg_print("A vicious blow hits your head.");
3615 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3616 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3618 else if (one_in_(2))
3620 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3624 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3627 if (p_ptr->special_defense & KATA_MASK)
3630 msg_print("·¿¤¬Êø¤ì¤¿¡£");
3632 msg_print("Your posture gets loose.");
3634 p_ptr->special_defense &= ~(KATA_MASK);
3635 p_ptr->update |= (PU_BONUS);
3636 p_ptr->update |= (PU_MONSTERS);
3637 p_ptr->redraw |= (PR_STATE);
3638 p_ptr->redraw |= (PR_STATUS);
3639 p_ptr->action = ACTION_NONE;
3643 if (p_ptr->concent) reset_concentration(TRUE);
3646 if (hex_spelling_any()) stop_hex_spell_all();
3653 else if (new_aux < old_aux)
3655 /* Describe the state */
3661 msg_print("¤ä¤Ã¤ÈÛ¯Û°¾õÂÖ¤«¤é²óÉü¤·¤¿¡£");
3663 msg_print("You are no longer stunned.");
3666 if (disturb_state) disturb(0, 0);
3678 if (!notice) return (FALSE);
3681 if (disturb_state) disturb(0, 0);
3683 /* Recalculate bonuses */
3684 p_ptr->update |= (PU_BONUS);
3686 /* Redraw the "stun" */
3687 p_ptr->redraw |= (PR_STUN);
3698 * Set "p_ptr->cut", notice observable changes
3700 * Note the special code to only notice "range" changes.
3704 int old_aux, new_aux;
3705 bool notice = FALSE;
3707 /* Hack -- Force good values */
3708 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3710 if (p_ptr->is_dead) return FALSE;
3712 if ((p_ptr->prace == RACE_GOLEM ||
3713 p_ptr->prace == RACE_SKELETON ||
3714 p_ptr->prace == RACE_SPECTRE ||
3715 (p_ptr->prace == RACE_ZOMBIE && p_ptr->lev > 11)) &&
3720 if (p_ptr->cut > 1000)
3726 else if (p_ptr->cut > 200)
3732 else if (p_ptr->cut > 100)
3738 else if (p_ptr->cut > 50)
3744 else if (p_ptr->cut > 25)
3750 else if (p_ptr->cut > 10)
3756 else if (p_ptr->cut > 0)
3816 if (new_aux > old_aux)
3818 /* Describe the state */
3824 msg_print("¤«¤¹¤ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3826 msg_print("You have been given a graze.");
3834 msg_print("·Ú¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3836 msg_print("You have been given a light cut.");
3844 msg_print("¤Ò¤É¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3846 msg_print("You have been given a bad cut.");
3854 msg_print("ÂçÊѤʽý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3856 msg_print("You have been given a nasty cut.");
3864 msg_print("½ÅÂç¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3866 msg_print("You have been given a severe cut.");
3874 msg_print("¤Ò¤É¤¤¿¼¼ê¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3876 msg_print("You have been given a deep gash.");
3884 msg_print("Ã×̿Ū¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3886 msg_print("You have been given a mortal wound.");
3895 if (randint1(1000) < v || one_in_(16))
3897 if (!p_ptr->sustain_chr)
3900 msg_print("¤Ò¤É¤¤½ýÀפ¬»Ä¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3902 msg_print("You have been horribly scarred.");
3912 else if (new_aux < old_aux)
3914 /* Describe the state */
3920 msg_format("¤ä¤Ã¤È%s¡£", p_ptr->prace == RACE_ANDROID ? "²ø²æ¤¬Ä¾¤Ã¤¿" : "½Ð·ì¤¬»ß¤Þ¤Ã¤¿");
3922 msg_print("You are no longer bleeding.");
3925 if (disturb_state) disturb(0, 0);
3937 if (!notice) return (FALSE);
3940 if (disturb_state) disturb(0, 0);
3942 /* Recalculate bonuses */
3943 p_ptr->update |= (PU_BONUS);
3945 /* Redraw the "cut" */
3946 p_ptr->redraw |= (PR_CUT);
3957 * Set "p_ptr->food", notice observable changes
3959 * The "p_ptr->food" variable can get as large as 20000, allowing the
3960 * addition of the most "filling" item, Elvish Waybread, which adds
3961 * 7500 food units, without overflowing the 32767 maximum limit.
3963 * Perhaps we should disturb the player with various messages,
3964 * especially messages about hunger status changes. XXX XXX XXX
3966 * Digestion of food is handled in "dungeon.c", in which, normally,
3967 * the player digests about 20 food units per 100 game turns, more
3968 * when "fast", more when "regenerating", less with "slow digestion",
3969 * but when the player is "gorged", he digests 100 food units per 10
3970 * game turns, or a full 1000 food units per 100 game turns.
3972 * Note that the player's speed is reduced by 10 units while gorged,
3973 * so if the player eats a single food ration (5000 food units) when
3974 * full (15000 food units), he will be gorged for (5000/100)*10 = 500
3975 * game turns, or 500/(100/5) = 25 player turns (if nothing else is
3976 * affecting the player speed).
3978 bool set_food(int v)
3980 int old_aux, new_aux;
3982 bool notice = FALSE;
3984 /* Hack -- Force good values */
3985 v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
3987 /* Fainting / Starving */
3988 if (p_ptr->food < PY_FOOD_FAINT)
3994 else if (p_ptr->food < PY_FOOD_WEAK)
4000 else if (p_ptr->food < PY_FOOD_ALERT)
4006 else if (p_ptr->food < PY_FOOD_FULL)
4012 else if (p_ptr->food < PY_FOOD_MAX)
4023 /* Fainting / Starving */
4024 if (v < PY_FOOD_FAINT)
4030 else if (v < PY_FOOD_WEAK)
4036 else if (v < PY_FOOD_ALERT)
4042 else if (v < PY_FOOD_FULL)
4048 else if (v < PY_FOOD_MAX)
4059 if (old_aux < 1 && new_aux > 0)
4060 chg_virtue(V_PATIENCE, 2);
4061 else if (old_aux < 3 && (old_aux != new_aux))
4062 chg_virtue(V_PATIENCE, 1);
4064 chg_virtue(V_TEMPERANCE, 1);
4066 chg_virtue(V_TEMPERANCE, -1);
4069 if (new_aux > old_aux)
4071 /* Describe the state */
4077 msg_print("¤Þ¤À¶õÊ¢¤ÇÅݤ줽¤¦¤À¡£");
4079 msg_print("You are still weak.");
4087 msg_print("¤Þ¤À¶õÊ¢¤À¡£");
4089 msg_print("You are still hungry.");
4097 msg_print("¶õÊ¢´¶¤¬¤ª¤µ¤Þ¤Ã¤¿¡£");
4099 msg_print("You are no longer hungry.");
4107 msg_print("ËþÊ¢¤À¡ª");
4109 msg_print("You are full!");
4117 msg_print("¿©¤Ù²á¤®¤À¡ª");
4119 msg_print("You have gorged yourself!");
4121 chg_virtue(V_HARMONY, -1);
4122 chg_virtue(V_PATIENCE, -1);
4123 chg_virtue(V_TEMPERANCE, -2);
4133 else if (new_aux < old_aux)
4135 /* Describe the state */
4138 /* Fainting / Starving */
4141 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
4143 msg_print("You are getting faint from hunger!");
4151 msg_print("¤ªÊ¢¤¬¶õ¤¤¤ÆÅݤ줽¤¦¤À¡£");
4153 msg_print("You are getting weak from hunger!");
4161 msg_print("¤ªÊ¢¤¬¶õ¤¤¤Æ¤¤¿¡£");
4163 msg_print("You are getting hungry.");
4171 msg_print("ËþÊ¢´¶¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
4173 msg_print("You are no longer full.");
4181 msg_print("¤ä¤Ã¤È¤ªÊ¢¤¬¤¤Ä¤¯¤Ê¤¯¤Ê¤Ã¤¿¡£");
4183 msg_print("You are no longer gorged.");
4189 if (p_ptr->wild_mode && (new_aux < 2))
4201 /* Nothing to notice */
4202 if (!notice) return (FALSE);
4205 if (disturb_state) disturb(0, 0);
4207 /* Recalculate bonuses */
4208 p_ptr->update |= (PU_BONUS);
4211 p_ptr->redraw |= (PR_HUNGER);
4221 * Increases a stat by one randomized level -RAK-
4223 * Note that this function (used by stat potions) now restores
4224 * the stat BEFORE increasing it.
4226 bool inc_stat(int stat)
4230 /* Then augment the current/max stat */
4231 value = p_ptr->stat_cur[stat];
4233 /* Cannot go above 18/100 */
4234 if (value < p_ptr->stat_max_max[stat])
4236 /* Gain one (sometimes two) points */
4239 gain = ((randint0(100) < 75) ? 1 : 2);
4243 /* Gain 1/6 to 1/3 of distance to 18/100 */
4244 else if (value < (p_ptr->stat_max_max[stat]-2))
4246 /* Approximate gain value */
4247 gain = (((p_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
4250 if (gain < 1) gain = 1;
4252 /* Apply the bonus */
4253 value += randint1(gain) + gain / 2;
4256 if (value > (p_ptr->stat_max_max[stat]-1)) value = p_ptr->stat_max_max[stat]-1;
4259 /* Gain one point at a time */
4265 /* Save the new value */
4266 p_ptr->stat_cur[stat] = value;
4268 /* Bring up the maximum too */
4269 if (value > p_ptr->stat_max[stat])
4271 p_ptr->stat_max[stat] = value;
4274 /* Recalculate bonuses */
4275 p_ptr->update |= (PU_BONUS);
4281 /* Nothing to gain */
4288 * Decreases a stat by an amount indended to vary from 0 to 100 percent.
4290 * Amount could be a little higher in extreme cases to mangle very high
4291 * stats from massive assaults. -CWS
4293 * Note that "permanent" means that the *given* amount is permanent,
4294 * not that the new value becomes permanent. This may not work exactly
4295 * as expected, due to "weirdness" in the algorithm, but in general,
4296 * if your stat is already drained, the "max" value will not drop all
4297 * the way down to the "cur" value.
4299 bool dec_stat(int stat, int amount, int permanent)
4301 int cur, max, loss, same, res = FALSE;
4304 /* Acquire current value */
4305 cur = p_ptr->stat_cur[stat];
4306 max = p_ptr->stat_max[stat];
4308 /* Note when the values are identical */
4309 same = (cur == max);
4311 /* Damage "current" value */
4314 /* Handle "low" values */
4317 if (amount > 90) cur--;
4318 if (amount > 50) cur--;
4319 if (amount > 20) cur--;
4323 /* Handle "high" values */
4326 /* Hack -- Decrement by a random amount between one-quarter */
4327 /* and one-half of the stat bonus times the percentage, with a */
4328 /* minimum damage of half the percentage. -CWS */
4329 loss = (((cur-18) / 2 + 1) / 2 + 1);
4332 if (loss < 1) loss = 1;
4334 /* Randomize the loss */
4335 loss = ((randint1(loss) + loss) * amount) / 100;
4338 if (loss < amount/2) loss = amount/2;
4340 /* Lose some points */
4343 /* Hack -- Only reduce stat to 17 sometimes */
4344 if (cur < 18) cur = (amount <= 20) ? 18 : 17;
4347 /* Prevent illegal values */
4348 if (cur < 3) cur = 3;
4350 /* Something happened */
4351 if (cur != p_ptr->stat_cur[stat]) res = TRUE;
4354 /* Damage "max" value */
4355 if (permanent && (max > 3))
4357 chg_virtue(V_SACRIFICE, 1);
4358 if (stat == A_WIS || stat == A_INT)
4359 chg_virtue(V_ENLIGHTEN, -2);
4361 /* Handle "low" values */
4364 if (amount > 90) max--;
4365 if (amount > 50) max--;
4366 if (amount > 20) max--;
4370 /* Handle "high" values */
4373 /* Hack -- Decrement by a random amount between one-quarter */
4374 /* and one-half of the stat bonus times the percentage, with a */
4375 /* minimum damage of half the percentage. -CWS */
4376 loss = (((max-18) / 2 + 1) / 2 + 1);
4377 loss = ((randint1(loss) + loss) * amount) / 100;
4378 if (loss < amount/2) loss = amount/2;
4380 /* Lose some points */
4383 /* Hack -- Only reduce stat to 17 sometimes */
4384 if (max < 18) max = (amount <= 20) ? 18 : 17;
4387 /* Hack -- keep it clean */
4388 if (same || (max < cur)) max = cur;
4390 /* Something happened */
4391 if (max != p_ptr->stat_max[stat]) res = TRUE;
4397 /* Actually set the stat to its new value. */
4398 p_ptr->stat_cur[stat] = cur;
4399 p_ptr->stat_max[stat] = max;
4401 /* Redisplay the stats later */
4402 p_ptr->redraw |= (PR_STATS);
4404 /* Recalculate bonuses */
4405 p_ptr->update |= (PU_BONUS);
4414 * Restore a stat. Return TRUE only if this actually makes a difference.
4416 bool res_stat(int stat)
4418 /* Restore if needed */
4419 if (p_ptr->stat_cur[stat] != p_ptr->stat_max[stat])
4422 p_ptr->stat_cur[stat] = p_ptr->stat_max[stat];
4424 /* Recalculate bonuses */
4425 p_ptr->update |= (PU_BONUS);
4427 /* Redisplay the stats later */
4428 p_ptr->redraw |= (PR_STATS);
4434 /* Nothing to restore */
4440 * Increase players hit points, notice effects
4442 bool hp_player(int num)
4445 vir = virtue_number(V_VITALITY);
4448 num = num * (p_ptr->virtues[vir - 1] + 1250) / 1250;
4450 /* Healing needed */
4451 if (p_ptr->chp < p_ptr->mhp)
4453 if ((num > 0) && (p_ptr->chp < (p_ptr->mhp/3)))
4454 chg_virtue(V_TEMPERANCE, 1);
4455 /* Gain hitpoints */
4458 /* Enforce maximum */
4459 if (p_ptr->chp >= p_ptr->mhp)
4461 p_ptr->chp = p_ptr->mhp;
4462 p_ptr->chp_frac = 0;
4466 p_ptr->redraw |= (PR_HP);
4469 p_ptr->window |= (PW_PLAYER);
4475 msg_print("¾¯¤·µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4477 msg_print("You feel a little better.");
4486 msg_print("µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4488 msg_print("You feel better.");
4497 msg_print("¤È¤Æ¤âµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4499 msg_print("You feel much better.");
4508 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4510 msg_print("You feel very good.");
4525 * Array of stat "descriptions"
4527 static cptr desc_stat_pos[] =
4569 * Array of stat "descriptions"
4571 static cptr desc_stat_neg[] =
4595 bool do_dec_stat(int stat)
4599 /* Access the "sustain" */
4602 case A_STR: if (p_ptr->sustain_str) sust = TRUE; break;
4603 case A_INT: if (p_ptr->sustain_int) sust = TRUE; break;
4604 case A_WIS: if (p_ptr->sustain_wis) sust = TRUE; break;
4605 case A_DEX: if (p_ptr->sustain_dex) sust = TRUE; break;
4606 case A_CON: if (p_ptr->sustain_con) sust = TRUE; break;
4607 case A_CHR: if (p_ptr->sustain_chr) sust = TRUE; break;
4611 if (sust && (!ironman_nightmare || randint0(13)))
4615 msg_format("%s¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¤¬¡¢¤¹¤°¤Ë¸µ¤ËÌá¤Ã¤¿¡£",
4617 msg_format("You feel %s for a moment, but the feeling passes.",
4620 desc_stat_neg[stat]);
4626 /* Attempt to reduce the stat */
4627 if (dec_stat(stat, 10, (ironman_nightmare && !randint0(13))))
4631 msg_format("¤Ò¤É¤¯%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_neg[stat]);
4633 msg_format("You feel very %s.", desc_stat_neg[stat]);
4641 /* Nothing obvious */
4647 * Restore lost "points" in a stat
4649 bool do_res_stat(int stat)
4651 /* Attempt to increase */
4656 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4658 msg_format("You feel less %s.", desc_stat_neg[stat]);
4666 /* Nothing obvious */
4672 * Gain a "point" in a stat
4674 bool do_inc_stat(int stat)
4678 /* Restore strength */
4679 res = res_stat(stat);
4681 /* Attempt to increase */
4686 chg_virtue(V_ENLIGHTEN, 1);
4687 chg_virtue(V_FAITH, 1);
4689 else if (stat == A_INT)
4691 chg_virtue(V_KNOWLEDGE, 1);
4692 chg_virtue(V_ENLIGHTEN, 1);
4694 else if (stat == A_CON)
4695 chg_virtue(V_VITALITY, 1);
4699 msg_format("¥ï¡¼¥ª¡ª¤È¤Æ¤â%s¤Ê¤Ã¤¿¡ª", desc_stat_pos[stat]);
4701 msg_format("Wow! You feel very %s!", desc_stat_pos[stat]);
4709 /* Restoration worked */
4714 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4716 msg_format("You feel less %s.", desc_stat_neg[stat]);
4724 /* Nothing obvious */
4730 * Restores any drained experience
4732 bool restore_level(void)
4734 /* Restore experience */
4735 if (p_ptr->exp < p_ptr->max_exp)
4739 msg_print("À¸Ì¿ÎϤ¬Ìá¤Ã¤Æ¤¤¿µ¤¤¬¤¹¤ë¡£");
4741 msg_print("You feel your life energies returning.");
4745 /* Restore the experience */
4746 p_ptr->exp = p_ptr->max_exp;
4748 /* Check the experience */
4763 bool lose_all_info(void)
4767 chg_virtue(V_KNOWLEDGE, -5);
4768 chg_virtue(V_ENLIGHTEN, -5);
4770 /* Forget info about objects */
4771 for (i = 0; i < INVEN_TOTAL; i++)
4773 object_type *o_ptr = &inventory[i];
4775 /* Skip non-objects */
4776 if (!o_ptr->k_idx) continue;
4778 /* Allow "protection" by the MENTAL flag */
4779 if (o_ptr->ident & (IDENT_MENTAL)) continue;
4781 /* Remove "default inscriptions" */
4782 o_ptr->feeling = FEEL_NONE;
4784 /* Hack -- Clear the "empty" flag */
4785 o_ptr->ident &= ~(IDENT_EMPTY);
4787 /* Hack -- Clear the "known" flag */
4788 o_ptr->ident &= ~(IDENT_KNOWN);
4790 /* Hack -- Clear the "felt" flag */
4791 o_ptr->ident &= ~(IDENT_SENSE);
4794 /* Recalculate bonuses */
4795 p_ptr->update |= (PU_BONUS);
4797 /* Combine / Reorder the pack (later) */
4798 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
4801 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
4803 /* Mega-Hack -- Forget the map */
4811 void do_poly_wounds(void)
4813 /* Changed to always provide at least _some_ healing */
4814 s16b wounds = p_ptr->cut;
4815 s16b hit_p = (p_ptr->mhp - p_ptr->chp);
4816 s16b change = damroll(p_ptr->lev, 5);
4817 bool Nasty_effect = one_in_(5);
4819 if (!(wounds || hit_p || Nasty_effect)) return;
4822 msg_print("½ý¤¬¤è¤ê·Ú¤¤¤â¤Î¤ËÊѲ½¤·¤¿¡£");
4824 msg_print("Your wounds are polymorphed into less serious ones.");
4831 msg_print("¿·¤¿¤Ê½ý¤¬¤Ç¤¤¿¡ª");
4832 take_hit(DAMAGE_LOSELIFE, change / 2, "ÊѲ½¤·¤¿½ý", -1);
4834 msg_print("A new wound was created!");
4835 take_hit(DAMAGE_LOSELIFE, change / 2, "a polymorphed wound", -1);
4842 set_cut(p_ptr->cut - (change / 2));
4848 * Change player race
4850 void change_race(int new_race, cptr effect_msg)
4852 cptr title = race_info[new_race].title;
4853 int old_race = p_ptr->prace;
4856 msg_format("¤¢¤Ê¤¿¤Ï%s%s¤ËÊѲ½¤·¤¿¡ª", effect_msg, title);
4858 msg_format("You turn into %s %s%s!", (!effect_msg[0] && is_a_vowel(title[0]) ? "an" : "a"), effect_msg, title);
4861 chg_virtue(V_CHANCE, 2);
4863 if (p_ptr->prace < 32)
4865 p_ptr->old_race1 |= 1L << p_ptr->prace;
4869 p_ptr->old_race2 |= 1L << (p_ptr->prace-32);
4871 p_ptr->prace = new_race;
4872 rp_ptr = &race_info[p_ptr->prace];
4874 /* Experience factor */
4875 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
4878 * The speed bonus of Klackons and Sprites are disabled
4879 * and the experience penalty is decreased.
4881 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)))
4882 p_ptr->expfact -= 15;
4884 /* Get character's height and weight */
4885 get_height_weight();
4888 if (p_ptr->pclass == CLASS_SORCERER)
4889 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
4891 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
4893 do_cmd_rerate(FALSE);
4895 /* The experience level may be modified */
4898 p_ptr->redraw |= (PR_BASIC);
4900 p_ptr->update |= (PU_BONUS);
4904 /* Load an autopick preference file */
4905 if (old_race != p_ptr->prace) autopick_load_pref(FALSE);
4907 /* Player's graphic tile may change */
4912 void do_poly_self(void)
4914 int power = p_ptr->lev;
4917 msg_print("¤¢¤Ê¤¿¤ÏÊѲ½¤Îˬ¤ì¤ò´¶¤¸¤¿...");
4919 msg_print("You feel a change coming over you...");
4922 chg_virtue(V_CHANCE, 1);
4924 if ((power > randint0(20)) && one_in_(3) && (p_ptr->prace != RACE_ANDROID))
4926 char effect_msg[80] = "";
4927 int new_race, expfact, goalexpfact;
4929 /* Some form of racial polymorph... */
4932 if ((power > randint0(5)) && one_in_(4))
4937 if (p_ptr->psex == SEX_MALE)
4939 p_ptr->psex = SEX_FEMALE;
4940 sp_ptr = &sex_info[p_ptr->psex];
4942 sprintf(effect_msg, "½÷À¤Î");
4944 sprintf(effect_msg, "female ");
4950 p_ptr->psex = SEX_MALE;
4951 sp_ptr = &sex_info[p_ptr->psex];
4953 sprintf(effect_msg, "ÃËÀ¤Î");
4955 sprintf(effect_msg, "male ");
4961 if ((power > randint0(30)) && one_in_(5))
4965 /* Harmful deformity */
4972 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
4978 /* Deformities are discriminated against! */
4979 (void)dec_stat(A_CHR, randint1(6), TRUE);
4985 sprintf(tmp_msg,"%s",effect_msg);
4986 sprintf(effect_msg,"´ñ·Á¤Î%s",tmp_msg);
4988 sprintf(tmp_msg,"%s ",effect_msg);
4989 sprintf(effect_msg,"deformed %s ",tmp_msg);
4996 sprintf(effect_msg,"´ñ·Á¤Î");
4998 sprintf(effect_msg,"deformed ");
5004 while ((power > randint0(20)) && one_in_(10))
5006 /* Polymorph into a less mutated form */
5009 if (!lose_mutation(0))
5011 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
5013 msg_print("You feel oddly normal.");
5019 * Restrict the race choices by exp penalty so
5020 * weak polymorph always means weak race
5025 goalexpfact = 100 + 3 * randint0(power);
5029 new_race = randint0(MAX_RACES);
5030 expfact = race_info[new_race].r_exp;
5032 while (((new_race == p_ptr->prace) && (expfact > goalexpfact)) || (new_race == RACE_ANDROID));
5034 change_race(new_race, effect_msg);
5037 if ((power > randint0(30)) && one_in_(6))
5045 msg_format("%s¤Î¹½À®¤¬ÊѲ½¤·¤¿¡ª", p_ptr->prace == RACE_ANDROID ? "µ¡³£" : "Æâ¡");
5047 msg_print("Your internal organs are rearranged!");
5052 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
5058 msg_print("¸½ºß¤Î»Ñ¤ÇÀ¸¤¤Æ¤¤¤¯¤Î¤Ïº¤Æñ¤Ê¤è¤¦¤À¡ª");
5059 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), "Ã×̿Ū¤ÊÆÍÁ³ÊÑ°Û", -1);
5061 msg_print("You find living difficult in your present form!");
5062 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), "a lethal mutation", -1);
5069 if ((power > randint0(20)) && one_in_(4))
5074 do_cmd_rerate(FALSE);
5077 while ((power > randint0(15)) && one_in_(3))
5080 (void)gain_random_mutation(0);
5083 if (power > randint0(5))
5089 /* Note: earlier deductions may have left power < 0 already. */
5099 * Decreases players hit points and sets death flag if necessary
5101 * XXX XXX XXX Invulnerability needs to be changed into a "shield"
5103 * XXX XXX XXX Hack -- this function allows the user to save (or quit)
5104 * the game when he dies, since the "You die." message is shown before
5105 * setting the player to "dead".
5108 int take_hit(int damage_type, int damage, cptr hit_from, int monspell)
5110 int old_chp = p_ptr->chp;
5112 char death_message[1024];
5115 int warning = (p_ptr->mhp * hitpoint_warn / 10);
5118 if (p_ptr->is_dead) return 0;
5120 if (p_ptr->sutemi) damage *= 2;
5121 if (p_ptr->special_defense & KATA_IAI) damage += (damage + 4) / 5;
5123 if (easy_band) damage = (damage+1)/2;
5125 if (damage_type != DAMAGE_USELIFE)
5135 if (monspell >= 0) learn_spell(monspell);
5137 /* Mega-Hack -- Apply "invulnerability" */
5138 if ((damage_type != DAMAGE_USELIFE) && (damage_type != DAMAGE_LOSELIFE))
5140 if (IS_INVULN() && (damage < 9000))
5142 if (damage_type == DAMAGE_FORCE)
5145 msg_print("¥Ð¥ê¥¢¤¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5147 msg_print("The attack cuts your shield of invulnerability open!");
5150 else if (one_in_(PENETRATE_INVULNERABILITY))
5153 msg_print("̵Ũ¤Î¥Ð¥ê¥¢¤òÇˤäƹ¶·â¤µ¤ì¤¿¡ª");
5155 msg_print("The attack penetrates your shield of invulnerability!");
5164 if (CHECK_MULTISHADOW())
5166 if (damage_type == DAMAGE_FORCE)
5169 msg_print("¸¸±Æ¤â¤í¤È¤âÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5171 msg_print("The attack hits Shadow together with you!");
5174 else if (damage_type == DAMAGE_ATTACK)
5177 msg_print("¹¶·â¤Ï¸¸±Æ¤ËÌ¿Ã椷¡¢¤¢¤Ê¤¿¤Ë¤ÏÆϤ«¤Ê¤«¤Ã¤¿¡£");
5179 msg_print("The attack hits Shadow, you are unharmed!");
5185 if (p_ptr->wraith_form)
5187 if (damage_type == DAMAGE_FORCE)
5190 msg_print("Ⱦʪ¼Á¤ÎÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5192 msg_print("The attack cuts through your ethereal body!");
5198 if ((damage == 0) && one_in_(2)) damage = 1;
5202 if (p_ptr->special_defense & KATA_MUSOU)
5205 if ((damage == 0) && one_in_(2)) damage = 1;
5207 } /* not if LOSELIFE USELIFE */
5209 /* Hurt the player */
5210 p_ptr->chp -= damage;
5211 if(damage_type == DAMAGE_GENO && p_ptr->chp < 0)
5213 damage += p_ptr->chp;
5217 /* Display the hitpoints */
5218 p_ptr->redraw |= (PR_HP);
5221 p_ptr->window |= (PW_PLAYER);
5225 if (damage_type != DAMAGE_GENO && p_ptr->chp == 0)
5227 chg_virtue(V_SACRIFICE, 1);
5228 chg_virtue(V_CHANCE, 2);
5234 bool android = (p_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
5236 #ifdef JP /* »à¤ó¤À»þ¤Ë¶¯À©½ªÎ»¤·¤Æ»à¤ò²óÈò¤Ç¤¤Ê¤¯¤·¤Æ¤ß¤¿ by Habu */
5238 if(!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
5244 chg_virtue(V_SACRIFICE, 10);
5247 p_ptr->leaving = TRUE;
5250 p_ptr->is_dead = TRUE;
5252 if (p_ptr->inside_arena)
5254 cptr m_name = r_name+r_info[arena_info[p_ptr->arena_number].r_idx].name;
5256 msg_format("¤¢¤Ê¤¿¤Ï%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£", m_name);
5258 msg_format("You are beaten by %s.", m_name);
5261 if (record_arena) do_cmd_write_nikki(NIKKI_ARENA, -1 - p_ptr->arena_number, m_name);
5265 int q_idx = quest_number(dun_level);
5266 bool seppuku = streq(hit_from, "Seppuku");
5267 bool winning_seppuku = p_ptr->total_winner && seppuku;
5270 /* Make screen dump */
5271 screen_dump = make_screen_dump();
5274 /* Note cause of death */
5277 strcpy(p_ptr->died_from, hit_from);
5279 if (!winning_seppuku) strcpy(p_ptr->died_from, "ÀÚÊ¢");
5286 sprintf(dummy, "%s%s%s", !p_ptr->paralyzed ? "" : p_ptr->free_act ? "ĦÁü¾õÂÖ¤Ç" : "Ëãáã¾õÂÖ¤Ç", p_ptr->image ? "¸¸³Ð¤ËÏĤó¤À" : "", hit_from);
5288 sprintf(dummy, "%s%s", hit_from, !p_ptr->paralyzed ? "" : " while helpless");
5290 my_strcpy(p_ptr->died_from, dummy, sizeof p_ptr->died_from);
5293 /* No longer a winner */
5294 p_ptr->total_winner = FALSE;
5296 if (winning_seppuku)
5299 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¾¡Íø¤Î¸åÀÚÊ¢¤·¤¿¡£");
5301 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "did Seppuku after the winning.");
5308 if (p_ptr->inside_arena)
5310 strcpy(buf,"¥¢¥ê¡¼¥Ê");
5312 strcpy(buf,"in the Arena");
5314 else if (!dun_level)
5318 strcpy(buf,"on the surface");
5320 else if (q_idx && (is_fixed_quest_idx(q_idx) &&
5321 !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
5323 strcpy(buf,"¥¯¥¨¥¹¥È");
5325 strcpy(buf,"in a quest");
5329 sprintf(buf,"%d³¬", dun_level);
5331 sprintf(buf,"level %d", dun_level);
5335 sprintf(tmp, "%s¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", buf, p_ptr->died_from);
5337 sprintf(tmp, "killed by %s %s.", p_ptr->died_from, buf);
5339 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5343 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- ¥²¡¼¥à¥ª¡¼¥Ð¡¼ --------");
5345 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- Game Over --------");
5347 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, "\n\n\n\n");
5352 if (get_check_strict("²èÌ̤òÊݸ¤·¤Þ¤¹¤«¡©", CHECK_NO_HISTORY))
5354 if (get_check_strict("Dump the screen? ", CHECK_NO_HISTORY))
5357 do_cmd_save_screen();
5362 /* Initialize "last message" buffer */
5363 if (p_ptr->last_message) string_free(p_ptr->last_message);
5364 p_ptr->last_message = NULL;
5366 /* Hack -- Note death */
5370 msg_format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë");
5372 msg_print(android ? "You are broken." : "You die.");
5379 if (winning_seppuku)
5382 get_rnd_line("seppuku_j.txt", 0, death_message);
5384 get_rnd_line("seppuku.txt", 0, death_message);
5390 get_rnd_line("death_j.txt", 0, death_message);
5392 get_rnd_line("death.txt", 0, death_message);
5399 while (!get_string(winning_seppuku ? "¼À¤¤Î¶ç: " : "ÃÇËöËâ¤Î¶«¤Ó: ", death_message, 1024)) ;
5401 while (!get_string("Last word: ", death_message, 1024)) ;
5405 while (winning_seppuku && !get_check_strict("¤è¤í¤·¤¤¤Ç¤¹¤«¡©", CHECK_NO_HISTORY));
5407 while (winning_seppuku && !get_check_strict("Are you sure? ", CHECK_NO_HISTORY));
5410 if (death_message[0] == '\0')
5413 strcpy(death_message, format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë"));
5415 strcpy(death_message, android ? "You are broken." : "You die.");
5418 else p_ptr->last_message = string_make(death_message);
5421 if (winning_seppuku)
5426 int msg_pos_x[9] = { 5, 7, 9, 12, 14, 17, 19, 21, 23};
5427 int msg_pos_y[9] = { 3, 4, 5, 4, 5, 4, 5, 6, 4};
5434 for (i = 0; i < 40; i++)
5435 Term_putstr(randint0(w / 2) * 2, randint0(h), 2, TERM_VIOLET, "¦Ô");
5437 str = death_message;
5438 if (strncmp(str, "¡Ö", 2) == 0) str += 2;
5440 str2 = my_strstr(str, "¡×");
5441 if (str2 != NULL) *str2 = '\0';
5446 str2 = my_strstr(str, " ");
5447 if (str2 == NULL) len = strlen(str);
5448 else len = str2 - str;
5452 Term_putstr_v(w * 3 / 4 - 2 - msg_pos_x[i] * 2, msg_pos_y[i], len,
5454 if (str2 == NULL) break;
5458 if (*str == 0) break;
5462 Term_putstr(w-1, h-1, 1, TERM_WHITE, " ");
5466 /* Make screen dump */
5467 screen_dump = make_screen_dump();
5470 /* Wait a key press */
5475 msg_print(death_message);
5483 /* Hitpoint warning */
5484 if (p_ptr->chp < warning)
5486 /* Hack -- bell on first notice */
5487 if (old_chp > warning) bell();
5491 if (record_danger && (old_chp > warning))
5493 if (p_ptr->image && damage_type == DAMAGE_ATTACK)
5497 hit_from = "something";
5501 sprintf(tmp,"%s¤Ë¤è¤Ã¤Æ¥Ô¥ó¥Á¤Ë´Ù¤Ã¤¿¡£",hit_from);
5503 sprintf(tmp,"A critical situation because of %s.",hit_from);
5505 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5510 /* stop auto_more even if DAMAGE_USELIFE */
5516 msg_print("*** ·Ù¹ð:Äã¥Ò¥Ã¥È¡¦¥Ý¥¤¥ó¥È¡ª ***");
5518 msg_print("*** LOW HITPOINT WARNING! ***");
5524 if (p_ptr->wild_mode && !p_ptr->leaving && (p_ptr->chp < MAX(warning, p_ptr->mhp/5)))
5535 void gain_exp_64(s32b amount, u32b amount_frac)
5537 if (p_ptr->is_dead) return;
5539 if (p_ptr->prace == RACE_ANDROID) return;
5541 /* Gain some experience */
5542 s64b_add(&(p_ptr->exp), &(p_ptr->exp_frac), amount, amount_frac);
5544 /* Slowly recover from experience drainage */
5545 if (p_ptr->exp < p_ptr->max_exp)
5547 /* Gain max experience (20%) (was 10%) */
5548 p_ptr->max_exp += amount / 5;
5551 /* Check Experience */
5559 void gain_exp(s32b amount)
5561 gain_exp_64(amount, 0L);
5565 void calc_android_exp(void)
5569 if (p_ptr->is_dead) return;
5571 if (p_ptr->prace != RACE_ANDROID) return;
5573 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5575 object_type *o_ptr = &inventory[i];
5577 object_type *q_ptr = &forge;
5579 int level = MAX(k_info[o_ptr->k_idx].level - 8, 1);
5581 if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue;
5582 if (!o_ptr->k_idx) continue;
5584 /* Wipe the object */
5587 object_copy(q_ptr, o_ptr);
5588 q_ptr->discount = 0;
5589 q_ptr->curse_flags = 0L;
5591 if (object_is_fixed_artifact(o_ptr))
5593 level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
5594 level += MIN(20, a_info[o_ptr->name1].rarity/(a_info[o_ptr->name1].gen_flags & TRG_INSTA_ART ? 10 : 3));
5596 else if (object_is_ego(o_ptr))
5598 level += MAX(3, (e_info[o_ptr->name2].rating - 5)/2);
5600 else if (o_ptr->art_name)
5602 s32b total_flags = flag_cost(o_ptr, o_ptr->pval);
5605 if (!object_is_weapon_ammo(o_ptr))
5608 if (total_flags < 15000) fake_level = 10;
5609 else if (total_flags < 35000) fake_level = 25;
5610 else fake_level = 40;
5615 if (total_flags < 20000) fake_level = 10;
5616 else if (total_flags < 45000) fake_level = 25;
5617 else fake_level = 40;
5620 level = MAX(level, (level + MAX(fake_level - 8, 5)) / 2 + 3);
5623 value = object_value_real(q_ptr);
5625 if (value <= 0) continue;
5626 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (p_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
5627 if (value > 5000000L) value = 5000000L;
5628 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
5630 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr) ||
5631 (o_ptr->tval == TV_DRAG_ARMOR) ||
5632 ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) ||
5633 ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) ||
5634 ((o_ptr->tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)) ||
5635 ((o_ptr->tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) ||
5636 ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE)))
5638 if (level > 65) level = 35 + (level - 65) / 5;
5639 else if (level > 35) level = 25 + (level - 35) / 3;
5640 else if (level > 15) level = 15 + (level - 15) / 2;
5641 exp = MIN(100000L, value) * level * level / 2;
5642 if (value > 100000L)
5643 exp += (value - 100000L) * level * level / 8;
5647 exp = MIN(100000L, value) * level;
5648 if (value > 100000L)
5649 exp += (value - 100000L) * level / 4;
5651 if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (buki_motteruka(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
5652 else total_exp += exp / 16;
5653 if (i == INVEN_BODY) total_exp += exp / 32;
5655 p_ptr->exp = p_ptr->max_exp = total_exp;
5657 /* Check Experience */
5665 void lose_exp(s32b amount)
5667 if (p_ptr->prace == RACE_ANDROID) return;
5669 /* Never drop below zero experience */
5670 if (amount > p_ptr->exp) amount = p_ptr->exp;
5672 /* Lose some experience */
5673 p_ptr->exp -= amount;
5675 /* Check Experience */
5682 * If resisted to draining, return FALSE
5684 bool drain_exp(s32b drain, s32b slip, int hold_life_prob)
5686 /* Androids and their mimics are never drained */
5687 if (p_ptr->prace == RACE_ANDROID) return FALSE;
5689 if (p_ptr->hold_life && (randint0(100) < hold_life_prob))
5691 /* Hold experience */
5693 msg_print("¤·¤«¤·¼«¸Ê¤ÎÀ¸Ì¿ÎϤò¼é¤ê¤¤Ã¤¿¡ª");
5695 msg_print("You keep hold of your life force!");
5700 /* Hold experience failed */
5701 if (p_ptr->hold_life)
5704 msg_print("À¸Ì¿ÎϤò¾¯¤·µÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
5706 msg_print("You feel your life slipping away!");
5713 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
5715 msg_print("You feel your life draining away!");
5724 bool set_ultimate_res(int v, bool do_dec)
5726 bool notice = FALSE;
5728 /* Hack -- Force good values */
5729 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5731 if (p_ptr->is_dead) return FALSE;
5736 if (p_ptr->ult_res && !do_dec)
5738 if (p_ptr->ult_res > v) return FALSE;
5740 else if (!p_ptr->ult_res)
5743 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5745 msg_print("You feel resistant!");
5758 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5760 msg_print("You feel less resistant");
5770 /* Redraw status bar */
5771 p_ptr->redraw |= (PR_STATUS);
5773 /* Nothing to notice */
5774 if (!notice) return (FALSE);
5777 if (disturb_state) disturb(0, 0);
5779 /* Recalculate bonuses */
5780 p_ptr->update |= (PU_BONUS);
5789 bool set_tim_res_nether(int v, bool do_dec)
5791 bool notice = FALSE;
5793 /* Hack -- Force good values */
5794 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5796 if (p_ptr->is_dead) return FALSE;
5801 if (p_ptr->tim_res_nether && !do_dec)
5803 if (p_ptr->tim_res_nether > v) return FALSE;
5805 else if (!p_ptr->tim_res_nether)
5808 msg_print("ÃϹö¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5810 msg_print("You feel nether resistant!");
5820 if (p_ptr->tim_res_nether)
5823 msg_print("ÃϹö¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5825 msg_print("You feel less nether resistant");
5833 p_ptr->tim_res_nether = v;
5835 /* Redraw status bar */
5836 p_ptr->redraw |= (PR_STATUS);
5838 /* Nothing to notice */
5839 if (!notice) return (FALSE);
5842 if (disturb_state) disturb(0, 0);
5844 /* Recalculate bonuses */
5845 p_ptr->update |= (PU_BONUS);
5854 bool set_tim_res_time(int v, bool do_dec)
5856 bool notice = FALSE;
5858 /* Hack -- Force good values */
5859 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5861 if (p_ptr->is_dead) return FALSE;
5866 if (p_ptr->tim_res_time && !do_dec)
5868 if (p_ptr->tim_res_time > v) return FALSE;
5870 else if (!p_ptr->tim_res_time)
5873 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5875 msg_print("You feel time resistant!");
5885 if (p_ptr->tim_res_time)
5888 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5890 msg_print("You feel less time resistant");
5898 p_ptr->tim_res_time = v;
5900 /* Redraw status bar */
5901 p_ptr->redraw |= (PR_STATUS);
5903 /* Nothing to notice */
5904 if (!notice) return (FALSE);
5907 if (disturb_state) disturb(0, 0);
5909 /* Recalculate bonuses */
5910 p_ptr->update |= (PU_BONUS);
5921 * Choose a warrior-mage elemental attack. -LM-
5923 bool choose_ele_attack(void)
5929 if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
5932 msg_format("Éð´ï¤ò»ý¤¿¤Ê¤¤¤ÈËâË¡·õ¤Ï»È¤¨¤Ê¤¤¡£");
5934 msg_format("You cannot use temporary branding with no weapon.");
5942 num = (p_ptr->lev - 20) / 5;
5945 c_prt(TERM_RED, " a) ¾Æ´þ", 2, 14);
5947 c_prt(TERM_RED, " a) Fire Brand", 2, 14);
5951 if (num >= 2) c_prt(TERM_L_WHITE," b) Åà·ë", 3, 14);
5953 if (num >= 2) c_prt(TERM_L_WHITE," b) Cold Brand", 3, 14);
5955 else prt("", 3, 14);
5958 if (num >= 3) c_prt(TERM_GREEN, " c) ÆÇ»¦", 4, 14);
5960 if (num >= 3) c_prt(TERM_GREEN, " c) Poison Brand", 4, 14);
5962 else prt("", 4, 14);
5965 if (num >= 4) c_prt(TERM_L_DARK, " d) Íϲò", 5, 14);
5967 if (num >= 4) c_prt(TERM_L_DARK, " d) Acid Brand", 5, 14);
5969 else prt("", 5, 14);
5972 if (num >= 5) c_prt(TERM_BLUE, " e) ÅÅ·â", 6, 14);
5974 if (num >= 5) c_prt(TERM_BLUE, " e) Elec Brand", 6, 14);
5976 else prt("", 6, 14);
5984 prt(" ¤É¤Î¸µÁǹ¶·â¤ò¤·¤Þ¤¹¤«¡©", 1, 14);
5986 prt(" Choose a temporary elemental brand ", 1, 14);
5991 if ((choice == 'a') || (choice == 'A'))
5992 set_ele_attack(ATTACK_FIRE, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5993 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
5994 set_ele_attack(ATTACK_COLD, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5995 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
5996 set_ele_attack(ATTACK_POIS, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5997 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
5998 set_ele_attack(ATTACK_ACID, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5999 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
6000 set_ele_attack(ATTACK_ELEC, p_ptr->lev/2 + randint1(p_ptr->lev/2));
6004 msg_print("ËâË¡·õ¤ò»È¤¦¤Î¤ò¤ä¤á¤¿¡£");
6006 msg_print("You cancel the temporary branding.");
6018 * Choose a elemental immune. -LM-
6020 bool choose_ele_immune(int turn)
6028 c_prt(TERM_RED, " a) ²Ð±ê", 2, 14);
6030 c_prt(TERM_RED, " a) Immune Fire", 2, 14);
6034 c_prt(TERM_L_WHITE," b) Î䵤", 3, 14);
6036 c_prt(TERM_L_WHITE," b) Immune Cold", 3, 14);
6040 c_prt(TERM_L_DARK, " c) »À", 4, 14);
6042 c_prt(TERM_L_DARK, " c) Immune Acid", 4, 14);
6046 c_prt(TERM_BLUE, " d) ÅÅ·â", 5, 14);
6048 c_prt(TERM_BLUE, " d) Immune Elec", 5, 14);
6059 prt(" ¤É¤Î¸µÁǤÎÌȱ֤ò¤Ä¤±¤Þ¤¹¤«¡©", 1, 14);
6061 prt(" Choose a temporary elemental immune ", 1, 14);
6066 if ((choice == 'a') || (choice == 'A'))
6067 set_ele_immune(DEFENSE_FIRE, turn);
6068 else if ((choice == 'b') || (choice == 'B'))
6069 set_ele_immune(DEFENSE_COLD, turn);
6070 else if ((choice == 'c') || (choice == 'C'))
6071 set_ele_immune(DEFENSE_ACID, turn);
6072 else if ((choice == 'd') || (choice == 'D'))
6073 set_ele_immune(DEFENSE_ELEC, turn);
6077 msg_print("Ìȱ֤òÉÕ¤±¤ë¤Î¤ò¤ä¤á¤¿¡£");
6079 msg_print("You cancel the temporary immune.");