3 /* Purpose: effects of various "objects" */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
15 void set_action(int typ)
17 if (typ == p_ptr->action)
28 msg_print("õº÷¤ò¤ä¤á¤¿¡£");
30 msg_print("You no longer walk carefully.");
32 p_ptr->redraw |= (PR_SPEED);
43 msg_print("³Ø½¬¤ò¤ä¤á¤¿¡£");
45 msg_print("You stop Learning");
53 msg_print("¹½¤¨¤ò¤È¤¤¤¿¡£");
55 msg_print("You stop assuming the posture.");
57 p_ptr->special_defense &= ~(KAMAE_MASK);
63 msg_print("·¿¤òÊø¤·¤¿¡£");
65 msg_print("You stop assuming the posture.");
67 p_ptr->special_defense &= ~(KATA_MASK);
68 p_ptr->update |= (PU_MONSTERS);
69 p_ptr->redraw |= (PR_STATUS);
75 msg_print("²Î¤¦¤Î¤ò¤ä¤á¤¿¡£");
77 msg_print("You stop singing.");
84 msg_print("¤¬½Å¤¯¤Ê¤Ã¤¿¡£");
86 msg_print("You are no longer walking extremely fast.");
100 msg_print("Ãí°Õ¿¼¤¯Ê⤻Ϥ᤿¡£");
102 msg_print("You began to walk carefully.");
104 p_ptr->redraw |= (PR_SPEED);
110 msg_print("³Ø½¬¤ò»Ï¤á¤¿¡£");
112 msg_print("You began Learning");
119 msg_print("¿åÌ̤˻å¤ò¿â¤é¤·¤¿¡¥¡¥¡¥");
121 msg_print("You began fishing...");
125 case ACTION_HAYAGAKE:
128 msg_print("¤¬±©¤Î¤è¤¦¤Ë·Ú¤¯¤Ê¤Ã¤¿¡£");
130 msg_print("You began to walk extremely fast.");
140 /* Recalculate bonuses */
141 p_ptr->update |= (PU_BONUS);
143 /* Redraw the state */
144 p_ptr->redraw |= (PR_STATE);
147 /* reset timed flags */
148 void reset_tim_flags(void)
150 p_ptr->fast = 0; /* Timed -- Fast */
151 p_ptr->lightspeed = 0;
152 p_ptr->slow = 0; /* Timed -- Slow */
153 p_ptr->blind = 0; /* Timed -- Blindness */
154 p_ptr->paralyzed = 0; /* Timed -- Paralysis */
155 p_ptr->confused = 0; /* Timed -- Confusion */
156 p_ptr->afraid = 0; /* Timed -- Fear */
157 p_ptr->image = 0; /* Timed -- Hallucination */
158 p_ptr->poisoned = 0; /* Timed -- Poisoned */
159 p_ptr->cut = 0; /* Timed -- Cut */
160 p_ptr->stun = 0; /* Timed -- Stun */
162 p_ptr->protevil = 0; /* Timed -- Protection */
163 p_ptr->invuln = 0; /* Timed -- Invulnerable */
165 p_ptr->hero = 0; /* Timed -- Heroism */
166 p_ptr->shero = 0; /* Timed -- Super Heroism */
167 p_ptr->shield = 0; /* Timed -- Shield Spell */
168 p_ptr->blessed = 0; /* Timed -- Blessed */
169 p_ptr->tim_invis = 0; /* Timed -- Invisibility */
170 p_ptr->tim_infra = 0; /* Timed -- Infra Vision */
171 p_ptr->tim_regen = 0; /* Timed -- Regeneration */
172 p_ptr->tim_stealth = 0; /* Timed -- Stealth */
174 p_ptr->tim_ffall = 0;
175 p_ptr->tim_sh_touki = 0;
176 p_ptr->tim_sh_fire = 0;
177 p_ptr->resist_magic = 0;
180 p_ptr->tim_res_nether = 0;
181 p_ptr->tim_res_time = 0;
182 p_ptr->tim_mimic = 0;
183 p_ptr->mimic_form = 0;
184 p_ptr->tim_reflect = 0;
185 p_ptr->multishadow = 0;
187 p_ptr->action = ACTION_NONE;
190 p_ptr->oppose_acid = 0; /* Timed -- oppose acid */
191 p_ptr->oppose_elec = 0; /* Timed -- oppose lightning */
192 p_ptr->oppose_fire = 0; /* Timed -- oppose heat */
193 p_ptr->oppose_cold = 0; /* Timed -- oppose cold */
194 p_ptr->oppose_pois = 0; /* Timed -- oppose poison */
196 p_ptr->word_recall = FALSE;
197 p_ptr->sutemi = FALSE;
198 p_ptr->counter = FALSE;
199 p_ptr->ele_attack = 0;
200 p_ptr->ele_immune = 0;
201 p_ptr->special_attack = 0L;
202 p_ptr->special_defense = 0L;
204 while(p_ptr->energy > 99) p_ptr->energy -= 100;
205 world_player = FALSE;
207 if (prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
208 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1;
209 if (p_ptr->pclass == CLASS_BERSERKER) p_ptr->shero = 1;
213 m_list[p_ptr->riding].fast = 0;
214 m_list[p_ptr->riding].slow = 0;
215 m_list[p_ptr->riding].invulner = 0;
218 if (p_ptr->pclass == CLASS_BARD)
220 p_ptr->magic_num1[0] = 0;
221 p_ptr->magic_num2[0] = 0;
227 * Set "p_ptr->tim_mimic", and "p_ptr->mimic_form",
228 * notice observable changes
230 bool set_mimic(int v, int p, bool do_dec)
234 /* Hack -- Force good values */
235 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
237 if (death) return FALSE;
242 if (p_ptr->tim_mimic && (p_ptr->mimic_form == p) && !do_dec)
244 if (p_ptr->tim_mimic > v) return FALSE;
246 else if ((!p_ptr->tim_mimic) || (p_ptr->mimic_form != p))
249 msg_print("¼«Ê¬¤ÎÂΤ¬ÊѤï¤Ã¤Æ¤æ¤¯¤Î¤ò´¶¤¸¤¿¡£");
251 msg_print("You feel that your body change.");
261 if (p_ptr->tim_mimic)
264 msg_print("ÊѿȤ¬²ò¤±¤¿¡£");
266 msg_print("You are no longer transformed.");
268 if (p_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(0, TRUE);
276 p_ptr->tim_mimic = v;
278 /* Nothing to notice */
287 p_ptr->redraw |= (PR_BASIC | PR_STATUS);
289 /* Recalculate bonuses */
290 p_ptr->update |= (PU_BONUS | PU_HP);
299 * Set "p_ptr->blind", notice observable changes
301 * Note the use of "PU_UN_LITE" and "PU_UN_VIEW", which is needed to
302 * memorize any terrain features which suddenly become "visible".
303 * Note that blindness is currently the only thing which can affect
304 * "player_can_see_bold()".
306 bool set_blind(int v)
310 /* Hack -- Force good values */
311 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
313 if (death) return FALSE;
320 if (p_ptr->prace == RACE_ANDROID)
323 msg_print("¥»¥ó¥µ¡¼¤ò¤ä¤é¤ì¤¿¡ª");
325 msg_print("You are blind!");
331 msg_print("Ìܤ¬¸«¤¨¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
333 msg_print("You are blind!");
338 chg_virtue(V_ENLIGHTEN, -1);
347 if (p_ptr->prace == RACE_ANDROID)
350 msg_print("¥»¥ó¥µ¡¼¤¬Éüµì¤·¤¿¡£");
352 msg_print("You can see again.");
358 msg_print("¤ä¤Ã¤ÈÌܤ¬¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
360 msg_print("You can see again.");
371 /* Redraw status bar */
372 p_ptr->redraw |= (PR_STATUS);
374 /* Nothing to notice */
375 if (!notice) return (FALSE);
378 if (disturb_state) disturb(0, 0);
380 /* Fully update the visuals */
381 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS);
384 p_ptr->redraw |= (PR_MAP);
387 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
398 * Set "p_ptr->confused", notice observable changes
400 bool set_confused(int v)
404 /* Hack -- Force good values */
405 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
407 if (death) return FALSE;
412 if (!p_ptr->confused)
415 msg_print("¤¢¤Ê¤¿¤Ïº®Í𤷤¿¡ª");
417 msg_print("You are confused!");
420 if (p_ptr->action == ACTION_KAMAE)
422 msg_print("¹½¤¨¤¬¤È¤±¤¿¡£");
423 p_ptr->special_defense &= ~(KAMAE_MASK);
424 p_ptr->update |= (PU_BONUS);
425 p_ptr->redraw |= (PR_STATE);
426 p_ptr->action = ACTION_NONE;
428 else if (p_ptr->action == ACTION_KATA)
430 msg_print("·¿¤¬Êø¤ì¤¿¡£");
431 p_ptr->special_defense &= ~(KATA_MASK);
432 p_ptr->update |= (PU_BONUS);
433 p_ptr->update |= (PU_MONSTERS);
434 p_ptr->redraw |= (PR_STATE);
435 p_ptr->redraw |= (PR_STATUS);
436 p_ptr->action = ACTION_NONE;
440 p_ptr->counter = FALSE;
441 chg_virtue(V_HARMONY, -1);
451 msg_print("¤ä¤Ã¤Èº®Í𤬤ª¤µ¤Þ¤Ã¤¿¡£");
453 msg_print("You feel less confused now.");
456 p_ptr->special_attack &= ~(ATTACK_SUIKEN);
464 /* Redraw status bar */
465 p_ptr->redraw |= (PR_STATUS);
467 /* Nothing to notice */
468 if (!notice) return (FALSE);
471 if (disturb_state) disturb(0, 0);
482 * Set "p_ptr->poisoned", notice observable changes
484 bool set_poisoned(int v)
488 /* Hack -- Force good values */
489 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
491 if (death) return FALSE;
496 if (!p_ptr->poisoned)
499 msg_print("ÆǤ˿¯¤µ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
501 msg_print("You are poisoned!");
514 msg_print("¤ä¤Ã¤ÈÆǤÎÄˤߤ¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
516 msg_print("You are no longer poisoned.");
526 /* Redraw status bar */
527 p_ptr->redraw |= (PR_STATUS);
529 /* Nothing to notice */
530 if (!notice) return (FALSE);
533 if (disturb_state) disturb(0, 0);
544 * Set "p_ptr->afraid", notice observable changes
546 bool set_afraid(int v)
550 /* Hack -- Force good values */
551 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
553 if (death) return FALSE;
561 msg_print("²¿¤â¤«¤â¶²¤¯¤Ê¤Ã¤Æ¤¤¿¡ª");
563 msg_print("You are terrified!");
566 if (p_ptr->special_defense & KATA_MASK)
568 msg_print("·¿¤¬Êø¤ì¤¿¡£");
569 p_ptr->special_defense &= ~(KATA_MASK);
570 p_ptr->update |= (PU_BONUS);
571 p_ptr->update |= (PU_MONSTERS);
572 p_ptr->redraw |= (PR_STATE);
573 p_ptr->redraw |= (PR_STATUS);
574 p_ptr->action = ACTION_NONE;
578 p_ptr->counter = FALSE;
579 chg_virtue(V_VALOUR, -1);
589 msg_print("¤ä¤Ã¤È¶²Éݤò¿¶¤êʧ¤Ã¤¿¡£");
591 msg_print("You feel bolder now.");
601 /* Redraw status bar */
602 p_ptr->redraw |= (PR_STATUS);
604 /* Nothing to notice */
605 if (!notice) return (FALSE);
608 if (disturb_state) disturb(0, 0);
619 * Set "p_ptr->paralyzed", notice observable changes
621 bool set_paralyzed(int v)
625 /* Hack -- Force good values */
626 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
628 if (death) return FALSE;
633 if (!p_ptr->paralyzed)
636 msg_print("ÂΤ¬Ëãá㤷¤Æ¤·¤Þ¤Ã¤¿¡ª");
638 msg_print("You are paralyzed!");
641 p_ptr->counter = FALSE;
649 if (p_ptr->paralyzed)
652 msg_print("¤ä¤Ã¤ÈÆ°¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
654 msg_print("You can move again.");
662 p_ptr->paralyzed = v;
664 /* Redraw status bar */
665 p_ptr->redraw |= (PR_STATUS);
667 /* Nothing to notice */
668 if (!notice) return (FALSE);
671 if (disturb_state) disturb(0, 0);
673 /* Redraw the state */
674 p_ptr->redraw |= (PR_STATE);
685 * Set "p_ptr->image", notice observable changes
687 * Note that we must redraw the map when hallucination changes.
689 bool set_image(int v)
693 /* Hack -- Force good values */
694 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
696 if (death) return FALSE;
702 set_tsuyoshi(0, TRUE);
706 msg_print("¥ï¡¼¥ª¡ª²¿¤â¤«¤âÆú¿§¤Ë¸«¤¨¤ë¡ª");
708 msg_print("Oh, wow! Everything looks so cosmic now!");
711 p_ptr->counter = FALSE;
722 msg_print("¤ä¤Ã¤È¤Ï¤Ã¤¤ê¤Èʪ¤¬¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
724 msg_print("You can see clearly again.");
734 /* Redraw status bar */
735 p_ptr->redraw |= (PR_STATUS);
737 /* Nothing to notice */
738 if (!notice) return (FALSE);
741 if (disturb_state) disturb(0, 0);
744 p_ptr->redraw |= (PR_MAP);
746 /* Update monsters */
747 p_ptr->update |= (PU_MONSTERS);
750 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
761 * Set "p_ptr->fast", notice observable changes
763 bool set_fast(int v, bool do_dec)
767 /* Hack -- Force good values */
768 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
770 if (death) return FALSE;
775 if (p_ptr->fast && !do_dec)
777 if (p_ptr->fast > v) return FALSE;
779 else if (!p_ptr->fast && !p_ptr->lightspeed)
782 msg_print("ÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
784 msg_print("You feel yourself moving much faster!");
788 chg_virtue(V_PATIENCE, -1);
789 chg_virtue(V_DILIGENCE, 1);
796 if (p_ptr->fast && !p_ptr->lightspeed && ((p_ptr->pclass != CLASS_BARD) || ((p_ptr->magic_num1[0] != MUSIC_SPEED) && (p_ptr->magic_num1[0] != MUSIC_SHERO))))
799 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
801 msg_print("You feel yourself slow down.");
811 /* Nothing to notice */
812 if (!notice) return (FALSE);
815 if (disturb_state) disturb(0, 0);
817 /* Recalculate bonuses */
818 p_ptr->update |= (PU_BONUS);
829 * Set "p_ptr->lightspeed", notice observable changes
831 bool set_lightspeed(int v, bool do_dec)
835 /* Hack -- Force good values */
836 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
838 if (death) return FALSE;
843 if (p_ptr->lightspeed && !do_dec)
845 if (p_ptr->lightspeed > v) return FALSE;
847 else if (!p_ptr->lightspeed)
850 msg_print("Èó¾ï¤ËÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
852 msg_print("You feel yourself moving faster!");
856 chg_virtue(V_PATIENCE, -1);
857 chg_virtue(V_DILIGENCE, 1);
864 if (p_ptr->lightspeed)
867 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
869 msg_print("You feel yourself slow down.");
877 p_ptr->lightspeed = v;
879 /* Nothing to notice */
880 if (!notice) return (FALSE);
883 if (disturb_state) disturb(0, 0);
885 /* Recalculate bonuses */
886 p_ptr->update |= (PU_BONUS);
897 * Set "p_ptr->slow", notice observable changes
899 bool set_slow(int v, bool do_dec)
903 /* Hack -- Force good values */
904 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
906 if (death) return FALSE;
911 if (p_ptr->slow && !do_dec)
913 if (p_ptr->slow > v) return FALSE;
915 else if (!p_ptr->slow)
918 msg_print("ÂΤÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
920 msg_print("You feel yourself moving slower!");
933 msg_print("Æ°¤¤ÎÃÙ¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
935 msg_print("You feel yourself speed up.");
945 /* Nothing to notice */
946 if (!notice) return (FALSE);
949 if (disturb_state) disturb(0, 0);
951 /* Recalculate bonuses */
952 p_ptr->update |= (PU_BONUS);
963 * Set "p_ptr->shield", notice observable changes
965 bool set_shield(int v, bool do_dec)
969 /* Hack -- Force good values */
970 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
972 if (death) return FALSE;
977 if (p_ptr->shield && !do_dec)
979 if (p_ptr->shield > v) return FALSE;
981 else if (!p_ptr->shield)
984 msg_print("È©¤¬ÀФˤʤä¿¡£");
986 msg_print("Your skin turns to stone.");
999 msg_print("È©¤¬¸µ¤ËÌá¤Ã¤¿¡£");
1001 msg_print("Your skin returns to normal.");
1011 /* Redraw status bar */
1012 p_ptr->redraw |= (PR_STATUS);
1014 /* Nothing to notice */
1015 if (!notice) return (FALSE);
1018 if (disturb_state) disturb(0, 0);
1020 /* Recalculate bonuses */
1021 p_ptr->update |= (PU_BONUS);
1033 * Set "p_ptr->tsubureru", notice observable changes
1035 bool set_tsubureru(int v, bool do_dec)
1037 bool notice = FALSE;
1039 /* Hack -- Force good values */
1040 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1042 if (death) return FALSE;
1047 if (p_ptr->tsubureru && !do_dec)
1049 if (p_ptr->tsubureru > v) return FALSE;
1051 else if (!p_ptr->tsubureru)
1054 msg_print("²£¤Ë¿¤Ó¤¿¡£");
1056 msg_print("You have expand horizontally.");
1066 if (p_ptr->tsubureru)
1069 msg_print("¤â¤¦²£¤Ë¿¤Ó¤Æ¤¤¤Ê¤¤¡£");
1071 msg_print("You are no longer expanded.");
1079 p_ptr->tsubureru = v;
1081 /* Redraw status bar */
1082 p_ptr->redraw |= (PR_STATUS);
1084 /* Nothing to notice */
1085 if (!notice) return (FALSE);
1088 if (disturb_state) disturb(0, 0);
1090 /* Recalculate bonuses */
1091 p_ptr->update |= (PU_BONUS);
1103 * Set "p_ptr->magicdef", notice observable changes
1105 bool set_magicdef(int v, bool do_dec)
1107 bool notice = FALSE;
1109 /* Hack -- Force good values */
1110 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1112 if (death) return FALSE;
1117 if (p_ptr->magicdef && !do_dec)
1119 if (p_ptr->magicdef > v) return FALSE;
1121 else if (!p_ptr->magicdef)
1124 msg_print("ËâË¡¤ÎËɸæÎϤ¬Áý¤·¤¿¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1126 msg_print("You feel your magical vulnerability diminish.");
1136 if (p_ptr->magicdef)
1139 msg_print("ËâË¡¤ÎËɸæÎϤ¬¸µ¤ËÌá¤Ã¤¿¡£");
1141 msg_print("Your magical defences fall to their normal values.");
1149 p_ptr->magicdef = v;
1151 /* Redraw status bar */
1152 p_ptr->redraw |= (PR_STATUS);
1154 /* Nothing to notice */
1155 if (!notice) return (FALSE);
1158 if (disturb_state) disturb(0, 0);
1160 /* Recalculate bonuses */
1161 p_ptr->update |= (PU_BONUS);
1173 * Set "p_ptr->blessed", notice observable changes
1175 bool set_blessed(int v, bool do_dec)
1177 bool notice = FALSE;
1179 /* Hack -- Force good values */
1180 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1182 if (death) return FALSE;
1187 if (p_ptr->blessed && !do_dec)
1189 if (p_ptr->blessed > v) return FALSE;
1191 else if (!p_ptr->blessed)
1194 msg_print("¹â·é¤Êµ¤Ê¬¤Ë¤Ê¤Ã¤¿¡ª");
1196 msg_print("You feel righteous!");
1206 if (p_ptr->blessed && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_BLESS)))
1209 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1211 msg_print("The prayer has expired.");
1221 /* Redraw status bar */
1222 p_ptr->redraw |= (PR_STATUS);
1224 /* Nothing to notice */
1225 if (!notice) return (FALSE);
1228 if (disturb_state) disturb(0, 0);
1230 /* Recalculate bonuses */
1231 p_ptr->update |= (PU_BONUS);
1242 * Set "p_ptr->hero", notice observable changes
1244 bool set_hero(int v, bool do_dec)
1246 bool notice = FALSE;
1248 /* Hack -- Force good values */
1249 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1251 if (death) return FALSE;
1256 if (p_ptr->hero && !do_dec)
1258 if (p_ptr->hero > v) return FALSE;
1260 else if (!p_ptr->hero)
1263 msg_print("¥Ò¡¼¥í¡¼¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1265 msg_print("You feel like a hero!");
1275 if (p_ptr->hero && ((p_ptr->pclass != CLASS_BARD) || ((p_ptr->magic_num1[0] != MUSIC_HERO) && (p_ptr->magic_num1[0] != MUSIC_SHERO))))
1278 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1280 msg_print("The heroism wears off.");
1290 /* Redraw status bar */
1291 p_ptr->redraw |= (PR_STATUS);
1293 /* Nothing to notice */
1294 if (!notice) return (FALSE);
1297 if (disturb_state) disturb(0, 0);
1299 /* Recalculate bonuses */
1300 p_ptr->update |= (PU_BONUS);
1302 /* Recalculate hitpoints */
1303 p_ptr->update |= (PU_HP);
1314 * Set "p_ptr->shero", notice observable changes
1316 bool set_shero(int v, bool do_dec)
1318 bool notice = FALSE;
1320 /* Hack -- Force good values */
1321 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1323 if (death) return FALSE;
1325 if (p_ptr->pclass == CLASS_BERSERKER) v = 1;
1329 if (p_ptr->shero && !do_dec)
1331 if (p_ptr->shero > v) return FALSE;
1333 else if (!p_ptr->shero)
1336 msg_print("»¦Ù¤¥Þ¥·¡¼¥ó¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1338 msg_print("You feel like a killing machine!");
1351 msg_print("ÌîÈڤʵ¤»ý¤Á¤¬¾Ã¤¨¼º¤»¤¿¡£");
1353 msg_print("You feel less Berserk.");
1363 /* Redraw status bar */
1364 p_ptr->redraw |= (PR_STATUS);
1366 /* Nothing to notice */
1367 if (!notice) return (FALSE);
1370 if (disturb_state) disturb(0, 0);
1372 /* Recalculate bonuses */
1373 p_ptr->update |= (PU_BONUS);
1375 /* Recalculate hitpoints */
1376 p_ptr->update |= (PU_HP);
1387 * Set "p_ptr->protevil", notice observable changes
1389 bool set_protevil(int v, bool do_dec)
1391 bool notice = FALSE;
1393 /* Hack -- Force good values */
1394 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1396 if (death) return FALSE;
1401 if (p_ptr->protevil && !do_dec)
1403 if (p_ptr->protevil > v) return FALSE;
1405 else if (!p_ptr->protevil)
1408 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Ê´¶¤¸¤¬¤¹¤ë¡ª");
1410 msg_print("You feel safe from evil!");
1420 if (p_ptr->protevil)
1423 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1425 msg_print("You no longer feel safe from evil.");
1433 p_ptr->protevil = v;
1435 /* Redraw status bar */
1436 p_ptr->redraw |= (PR_STATUS);
1438 /* Nothing to notice */
1439 if (!notice) return (FALSE);
1442 if (disturb_state) disturb(0, 0);
1452 * Set "p_ptr->wraith_form", notice observable changes
1454 bool set_wraith_form(int v, bool do_dec)
1456 bool notice = FALSE;
1458 /* Hack -- Force good values */
1459 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1461 if (death) return FALSE;
1466 if (p_ptr->wraith_form && !do_dec)
1468 if (p_ptr->wraith_form > v) return FALSE;
1470 else if (!p_ptr->wraith_form)
1473 msg_print("ʪ¼Á³¦¤òÎ¥¤ì¤ÆÍ©µ´¤Î¤è¤¦¤Ê¸ºß¤Ë¤Ê¤Ã¤¿¡ª");
1475 msg_print("You leave the physical world and turn into a wraith-being!");
1480 chg_virtue(V_UNLIFE, 3);
1481 chg_virtue(V_HONOUR, -2);
1482 chg_virtue(V_SACRIFICE, -2);
1483 chg_virtue(V_VALOUR, -5);
1486 p_ptr->redraw |= (PR_MAP);
1488 /* Update monsters */
1489 p_ptr->update |= (PU_MONSTERS);
1492 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1499 if (p_ptr->wraith_form)
1502 msg_print("ÉÔÆ©ÌÀ¤Ë¤Ê¤Ã¤¿´¶¤¸¤¬¤¹¤ë¡£");
1504 msg_print("You feel opaque.");
1510 p_ptr->redraw |= (PR_MAP);
1512 /* Update monsters */
1513 p_ptr->update |= (PU_MONSTERS);
1516 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1521 p_ptr->wraith_form = v;
1523 /* Redraw status bar */
1524 p_ptr->redraw |= (PR_STATUS);
1526 /* Nothing to notice */
1527 if (!notice) return (FALSE);
1530 if (disturb_state) disturb(0, 0);
1532 /* Recalculate bonuses */
1533 p_ptr->update |= (PU_BONUS);
1548 * Set "p_ptr->invuln", notice observable changes
1550 bool set_invuln(int v, bool do_dec)
1552 bool notice = FALSE;
1554 /* Hack -- Force good values */
1555 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1557 if (death) return FALSE;
1562 if (p_ptr->invuln && !do_dec)
1564 if (p_ptr->invuln > v) return FALSE;
1566 else if (!p_ptr->invuln)
1569 msg_print("̵Ũ¤À¡ª");
1571 msg_print("Invulnerability!");
1576 chg_virtue(V_UNLIFE, -2);
1577 chg_virtue(V_HONOUR, -2);
1578 chg_virtue(V_SACRIFICE, -3);
1579 chg_virtue(V_VALOUR, -5);
1582 p_ptr->redraw |= (PR_MAP);
1584 /* Update monsters */
1585 p_ptr->update |= (PU_MONSTERS);
1588 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1595 if (p_ptr->invuln && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_INVULN)))
1598 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
1600 msg_print("The invulnerability wears off.");
1606 p_ptr->redraw |= (PR_MAP);
1608 /* Update monsters */
1609 p_ptr->update |= (PU_MONSTERS);
1612 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1614 p_ptr->energy -= 100;
1621 /* Redraw status bar */
1622 p_ptr->redraw |= (PR_STATUS);
1624 /* Nothing to notice */
1625 if (!notice) return (FALSE);
1628 if (disturb_state) disturb(0, 0);
1630 /* Recalculate bonuses */
1631 p_ptr->update |= (PU_BONUS);
1642 * Set "p_ptr->tim_esp", notice observable changes
1644 bool set_tim_esp(int v, bool do_dec)
1646 bool notice = FALSE;
1648 /* Hack -- Force good values */
1649 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1651 if (death) return FALSE;
1656 if (p_ptr->tim_esp && !do_dec)
1658 if (p_ptr->tim_esp > v) return FALSE;
1660 else if (!p_ptr->tim_esp)
1663 msg_print("°Õ¼±¤¬¹¤¬¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1665 msg_print("You feel your consciousness expand!");
1675 if (p_ptr->tim_esp && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_MIND)))
1678 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
1680 msg_print("Your consciousness contracts again.");
1690 /* Redraw status bar */
1691 p_ptr->redraw |= (PR_STATUS);
1693 /* Nothing to notice */
1694 if (!notice) return (FALSE);
1697 if (disturb_state) disturb(0, 0);
1699 /* Recalculate bonuses */
1700 p_ptr->update |= (PU_BONUS);
1702 /* Update the monsters */
1703 p_ptr->update |= (PU_MONSTERS);
1714 * Set "p_ptr->tim_invis", notice observable changes
1716 bool set_tim_invis(int v, bool do_dec)
1718 bool notice = FALSE;
1720 /* Hack -- Force good values */
1721 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1723 if (death) return FALSE;
1728 if (p_ptr->tim_invis && !do_dec)
1730 if (p_ptr->tim_invis > v) return FALSE;
1732 else if (!p_ptr->tim_invis)
1735 msg_print("Ìܤ¬Èó¾ï¤ËÉÒ´¶¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1737 msg_print("Your eyes feel very sensitive!");
1747 if (p_ptr->tim_invis)
1750 msg_print("ÌܤÎÉÒ´¶¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1752 msg_print("Your eyes feel less sensitive.");
1760 p_ptr->tim_invis = v;
1762 /* Redraw status bar */
1763 p_ptr->redraw |= (PR_STATUS);
1765 /* Nothing to notice */
1766 if (!notice) return (FALSE);
1769 if (disturb_state) disturb(0, 0);
1771 /* Recalculate bonuses */
1772 p_ptr->update |= (PU_BONUS);
1774 /* Update the monsters */
1775 p_ptr->update |= (PU_MONSTERS);
1786 * Set "p_ptr->tim_infra", notice observable changes
1788 bool set_tim_infra(int v, bool do_dec)
1790 bool notice = FALSE;
1792 /* Hack -- Force good values */
1793 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1795 if (death) return FALSE;
1800 if (p_ptr->tim_infra && !do_dec)
1802 if (p_ptr->tim_infra > v) return FALSE;
1804 else if (!p_ptr->tim_infra)
1807 msg_print("Ìܤ¬¥é¥ó¥é¥ó¤Èµ±¤»Ï¤á¤¿¡ª");
1809 msg_print("Your eyes began to tingle!");
1819 if (p_ptr->tim_infra)
1822 msg_print("Ìܤ層¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1824 msg_print("Your eyes stop tingling.");
1832 p_ptr->tim_infra = v;
1834 /* Redraw status bar */
1835 p_ptr->redraw |= (PR_STATUS);
1837 /* Nothing to notice */
1838 if (!notice) return (FALSE);
1841 if (disturb_state) disturb(0, 0);
1843 /* Recalculate bonuses */
1844 p_ptr->update |= (PU_BONUS);
1846 /* Update the monsters */
1847 p_ptr->update |= (PU_MONSTERS);
1858 * Set "p_ptr->tim_regen", notice observable changes
1860 bool set_tim_regen(int v, bool do_dec)
1862 bool notice = FALSE;
1864 /* Hack -- Force good values */
1865 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1867 if (death) return FALSE;
1872 if (p_ptr->tim_regen && !do_dec)
1874 if (p_ptr->tim_regen > v) return FALSE;
1876 else if (!p_ptr->tim_regen)
1879 msg_print("²óÉüÎϤ¬¾å¤¬¤Ã¤¿¡ª");
1881 msg_print("You began to regenerate quicker!");
1891 if (p_ptr->tim_regen)
1894 msg_print("ÁÇÁ᤯²óÉü¤¹¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1896 msg_print("You no longer regenerate quicker.");
1904 p_ptr->tim_regen = v;
1906 /* Redraw status bar */
1907 p_ptr->redraw |= (PR_STATUS);
1909 /* Nothing to notice */
1910 if (!notice) return (FALSE);
1913 if (disturb_state) disturb(0, 0);
1915 /* Recalculate bonuses */
1916 p_ptr->update |= (PU_BONUS);
1927 * Set "p_ptr->tim_stealth", notice observable changes
1929 bool set_tim_stealth(int v, bool do_dec)
1931 bool notice = FALSE;
1933 /* Hack -- Force good values */
1934 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1936 if (death) return FALSE;
1941 if (p_ptr->tim_stealth && !do_dec)
1943 if (p_ptr->tim_stealth > v) return FALSE;
1945 else if (!p_ptr->tim_stealth)
1948 msg_print("²»¤¬¾®¤µ¤¯¤Ê¤Ã¤¿¡ª");
1950 msg_print("You began to walk silently!");
1960 if (p_ptr->tim_stealth && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_STEALTH)))
1963 msg_print("²»¤¬Â礤¯¤Ê¤Ã¤¿¡£");
1965 msg_print("You no longer walk silently.");
1973 p_ptr->tim_stealth = v;
1975 /* Redraw status bar */
1976 p_ptr->redraw |= (PR_STATUS);
1978 /* Nothing to notice */
1979 if (!notice) return (FALSE);
1982 if (disturb_state) disturb(0, 0);
1984 /* Recalculate bonuses */
1985 p_ptr->update |= (PU_BONUS);
1995 bool set_superstealth(bool set)
1997 bool notice = FALSE;
1999 if (death) return FALSE;
2004 if (!(p_ptr->special_defense & NINJA_S_STEALTH))
2006 if (cave[py][px].info & CAVE_MNLT)
2009 msg_print("Ũ¤ÎÌܤ«¤éÇö¤¤±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡£");
2011 msg_print("You are mantled in weak shadow from ordinary eyes.");
2013 p_ptr->monlite = p_ptr->old_monlite = TRUE;
2018 msg_print("Ũ¤ÎÌܤ«¤é±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡ª");
2020 msg_print("You are mantled in shadow from ordinary eyes!");
2022 p_ptr->monlite = p_ptr->old_monlite = FALSE;
2028 p_ptr->special_defense |= NINJA_S_STEALTH;
2035 if (p_ptr->special_defense & NINJA_S_STEALTH)
2038 msg_print("ºÆ¤ÓŨ¤ÎÌܤˤµ¤é¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
2040 msg_print("You are exposed to common sight once more.");
2046 p_ptr->special_defense &= ~(NINJA_S_STEALTH);
2050 /* Nothing to notice */
2051 if (!notice) return (FALSE);
2053 /* Redraw status bar */
2054 p_ptr->redraw |= (PR_STATUS);
2057 if (disturb_state) disturb(0, 0);
2065 * Set "p_ptr->tim_ffall", notice observable changes
2067 bool set_tim_ffall(int v, bool do_dec)
2069 bool notice = FALSE;
2071 /* Hack -- Force good values */
2072 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2074 if (death) return FALSE;
2079 if (p_ptr->tim_ffall && !do_dec)
2081 if (p_ptr->tim_ffall > v) return FALSE;
2083 else if (!p_ptr->tim_ffall)
2086 msg_print("ÂΤ¬Ãè¤ËÉ⤻Ϥ᤿¡£");
2088 msg_print("You began to fly!");
2098 if (p_ptr->tim_ffall)
2101 msg_print("¤â¤¦Ãè¤ËÉ⤫¤Ù¤Ê¤¯¤Ê¤Ã¤¿¡£");
2103 msg_print("You no longer flying.");
2111 p_ptr->tim_ffall = v;
2113 /* Redraw status bar */
2114 p_ptr->redraw |= (PR_STATUS);
2116 /* Nothing to notice */
2117 if (!notice) return (FALSE);
2120 if (disturb_state) disturb(0, 0);
2122 /* Recalculate bonuses */
2123 p_ptr->update |= (PU_BONUS);
2134 * Set "p_ptr->tim_sh_touki", notice observable changes
2136 bool set_tim_sh_touki(int v, bool do_dec)
2138 bool notice = FALSE;
2140 /* Hack -- Force good values */
2141 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2143 if (death) return FALSE;
2148 if (p_ptr->tim_sh_touki && !do_dec)
2150 if (p_ptr->tim_sh_touki > v) return FALSE;
2152 else if (!p_ptr->tim_sh_touki)
2155 msg_print("ÂΤ¬Æ®µ¤¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2157 msg_print("You have enveloped by energy aura!");
2167 if (p_ptr->tim_sh_touki)
2170 msg_print("Æ®µ¤¤¬¾Ã¤¨¤¿¡£");
2172 msg_print("Aura of Force disappeared.");
2180 p_ptr->tim_sh_touki = v;
2182 /* Redraw status bar */
2183 p_ptr->redraw |= (PR_STATUS);
2185 /* Nothing to notice */
2186 if (!notice) return (FALSE);
2189 if (disturb_state) disturb(0, 0);
2200 * Set "p_ptr->tim_sh_fire", notice observable changes
2202 bool set_tim_sh_fire(int v, bool do_dec)
2204 bool notice = FALSE;
2206 /* Hack -- Force good values */
2207 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2209 if (death) return FALSE;
2214 if (p_ptr->tim_sh_fire && !do_dec)
2216 if (p_ptr->tim_sh_fire > v) return FALSE;
2218 else if (!p_ptr->tim_sh_fire)
2221 msg_print("ÂΤ¬±ê¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2223 msg_print("You have enveloped by fiery aura!");
2233 if (p_ptr->tim_sh_fire)
2236 msg_print("±ê¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2238 msg_print("Fiery aura disappeared.");
2246 p_ptr->tim_sh_fire = v;
2248 /* Redraw status bar */
2249 p_ptr->redraw |= (PR_STATUS);
2251 /* Nothing to notice */
2252 if (!notice) return (FALSE);
2255 if (disturb_state) disturb(0, 0);
2257 /* Recalculate bonuses */
2258 p_ptr->update |= (PU_BONUS);
2269 * Set "p_ptr->resist_magic", notice observable changes
2271 bool set_resist_magic(int v, bool do_dec)
2273 bool notice = FALSE;
2275 /* Hack -- Force good values */
2276 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2278 if (death) return FALSE;
2283 if (p_ptr->resist_magic && !do_dec)
2285 if (p_ptr->resist_magic > v) return FALSE;
2287 else if (!p_ptr->resist_magic)
2290 msg_print("ËâË¡¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿¡£");
2292 msg_print("You have been protected from magic!");
2302 if (p_ptr->resist_magic)
2305 msg_print("ËâË¡¤Ë¼å¤¯¤Ê¤Ã¤¿¡£");
2307 msg_print("You are no longer protected from magic.");
2315 p_ptr->resist_magic = v;
2317 /* Redraw status bar */
2318 p_ptr->redraw |= (PR_STATUS);
2320 /* Nothing to notice */
2321 if (!notice) return (FALSE);
2324 if (disturb_state) disturb(0, 0);
2326 /* Recalculate bonuses */
2327 p_ptr->update |= (PU_BONUS);
2338 * Set "p_ptr->tim_reflect", notice observable changes
2340 bool set_tim_reflect(int v, bool do_dec)
2342 bool notice = FALSE;
2344 /* Hack -- Force good values */
2345 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2347 if (death) return FALSE;
2352 if (p_ptr->tim_reflect && !do_dec)
2354 if (p_ptr->tim_reflect > v) return FALSE;
2356 else if (!p_ptr->tim_reflect)
2359 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2361 msg_print("Your body becames smooth.");
2371 if (p_ptr->tim_reflect)
2374 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ç¤Ê¤¯¤Ê¤Ã¤¿¡£");
2376 msg_print("Your body is no longer smooth.");
2384 p_ptr->tim_reflect = v;
2386 /* Redraw status bar */
2387 p_ptr->redraw |= (PR_STATUS);
2389 /* Nothing to notice */
2390 if (!notice) return (FALSE);
2393 if (disturb_state) disturb(0, 0);
2395 /* Recalculate bonuses */
2396 p_ptr->update |= (PU_BONUS);
2407 * Set "p_ptr->multishadow", notice observable changes
2409 bool set_multishadow(int v, bool do_dec)
2411 bool notice = FALSE;
2413 /* Hack -- Force good values */
2414 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2416 if (death) return FALSE;
2421 if (p_ptr->multishadow && !do_dec)
2423 if (p_ptr->multishadow > v) return FALSE;
2425 else if (!p_ptr->multishadow)
2428 msg_print("¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¸¸±Æ¤¬À¸¤Þ¤ì¤¿¡£");
2430 msg_print("Your Shadow enveloped you.");
2440 if (p_ptr->multishadow)
2443 msg_print("¸¸±Æ¤¬¾Ã¤¨¤¿¡£");
2445 msg_print("Your Shadow disappears.");
2453 p_ptr->multishadow = v;
2455 /* Redraw status bar */
2456 p_ptr->redraw |= (PR_STATUS);
2458 /* Nothing to notice */
2459 if (!notice) return (FALSE);
2462 if (disturb_state) disturb(0, 0);
2464 /* Recalculate bonuses */
2465 p_ptr->update |= (PU_BONUS);
2476 * Set "p_ptr->dustrobe", notice observable changes
2478 bool set_dustrobe(int v, bool do_dec)
2480 bool notice = FALSE;
2482 /* Hack -- Force good values */
2483 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2485 if (death) return FALSE;
2490 if (p_ptr->dustrobe && !do_dec)
2492 if (p_ptr->dustrobe > v) return FALSE;
2494 else if (!p_ptr->dustrobe)
2497 msg_print("ÂΤ¬¶À¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2499 msg_print("You were enveloped by mirror shards.");
2509 if (p_ptr->dustrobe)
2512 msg_print("¶À¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2514 msg_print("The mirror shards disappear.");
2522 p_ptr->dustrobe = v;
2524 /* Redraw status bar */
2525 p_ptr->redraw |= (PR_STATUS);
2527 /* Nothing to notice */
2528 if (!notice) return (FALSE);
2531 if (disturb_state) disturb(0, 0);
2533 /* Recalculate bonuses */
2534 p_ptr->update |= (PU_BONUS);
2545 * Set "p_ptr->tim_regen", notice observable changes
2547 bool set_kabenuke(int v, bool do_dec)
2549 bool notice = FALSE;
2551 /* Hack -- Force good values */
2552 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2554 if (death) return FALSE;
2559 if (p_ptr->kabenuke && !do_dec)
2561 if (p_ptr->kabenuke > v) return FALSE;
2563 else if (!p_ptr->kabenuke)
2566 msg_print("ÂΤ¬È¾Êª¼Á¤Î¾õÂ֤ˤʤä¿¡£");
2568 msg_print("You became ethereal form.");
2578 if (p_ptr->kabenuke)
2581 msg_print("ÂΤ¬Êª¼Á²½¤·¤¿¡£");
2583 msg_print("You are no longer in an ethereal form.");
2591 p_ptr->kabenuke = v;
2593 /* Redraw status bar */
2594 p_ptr->redraw |= (PR_STATUS);
2596 /* Nothing to notice */
2597 if (!notice) return (FALSE);
2600 if (disturb_state) disturb(0, 0);
2610 bool set_tsuyoshi(int v, bool do_dec)
2612 bool notice = FALSE;
2614 /* Hack -- Force good values */
2615 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2617 if (death) return FALSE;
2622 if (p_ptr->tsuyoshi && !do_dec)
2624 if (p_ptr->tsuyoshi > v) return FALSE;
2626 else if (!p_ptr->tsuyoshi)
2629 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
2631 msg_print("Brother OKURE!");
2635 chg_virtue(V_VITALITY, 2);
2642 if (p_ptr->tsuyoshi)
2645 msg_print("ÆùÂΤ¬µÞ®¤Ë¤·¤Ü¤ó¤Ç¤¤¤Ã¤¿¡£");
2647 msg_print("Your body had quickly shriveled.");
2650 (void)dec_stat(A_CON, 20, TRUE);
2651 (void)dec_stat(A_STR, 20, TRUE);
2654 chg_virtue(V_VITALITY, -3);
2659 p_ptr->tsuyoshi = v;
2661 /* Redraw status bar */
2662 p_ptr->redraw |= (PR_STATUS);
2664 /* Nothing to notice */
2665 if (!notice) return (FALSE);
2668 if (disturb_state) disturb(0, 0);
2670 /* Recalculate bonuses */
2671 p_ptr->update |= (PU_BONUS);
2673 /* Recalculate hitpoints */
2674 p_ptr->update |= (PU_HP);
2685 * Set a temporary elemental brand. Clear all other brands. Print status
2688 bool set_ele_attack(u32b attack_type, int v)
2690 /* Hack -- Force good values */
2691 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2693 /* Clear all elemental attacks (only one is allowed at a time). */
2694 if ((p_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
2696 p_ptr->special_attack &= ~(ATTACK_ACID);
2698 msg_print("»À¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2700 msg_print("Your temporary acidic brand fades away.");
2703 if ((p_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
2705 p_ptr->special_attack &= ~(ATTACK_ELEC);
2707 msg_print("ÅÅ·â¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2709 msg_print("Your temporary electrical brand fades away.");
2712 if ((p_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
2714 p_ptr->special_attack &= ~(ATTACK_FIRE);
2716 msg_print("²Ð±ê¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2718 msg_print("Your temporary fiery brand fades away.");
2721 if ((p_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
2723 p_ptr->special_attack &= ~(ATTACK_COLD);
2725 msg_print("Î䵤¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2727 msg_print("Your temporary frost brand fades away.");
2730 if ((p_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
2732 p_ptr->special_attack &= ~(ATTACK_POIS);
2734 msg_print("ÆǤǹ¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2736 msg_print("Your temporary poison brand fades away.");
2740 if ((v) && (attack_type))
2742 /* Set attack type. */
2743 p_ptr->special_attack |= (attack_type);
2746 p_ptr->ele_attack = v;
2750 msg_format("%s¤Ç¹¶·â¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª",
2751 ((attack_type == ATTACK_ACID) ? "»À" :
2752 ((attack_type == ATTACK_ELEC) ? "ÅÅ·â" :
2753 ((attack_type == ATTACK_FIRE) ? "²Ð±ê" :
2754 ((attack_type == ATTACK_COLD) ? "Î䵤" :
2755 ((attack_type == ATTACK_POIS) ? "ÆÇ" :
2758 msg_format("For a while, the blows you deal will %s",
2759 ((attack_type == ATTACK_ACID) ? "melt with acid!" :
2760 ((attack_type == ATTACK_ELEC) ? "shock your foes!" :
2761 ((attack_type == ATTACK_FIRE) ? "burn with fire!" :
2762 ((attack_type == ATTACK_COLD) ? "chill to the bone!" :
2763 ((attack_type == ATTACK_POIS) ? "poison your enemies!" :
2764 "do nothing special."))))));
2769 if (disturb_state) disturb(0, 0);
2771 /* Redraw status bar */
2772 p_ptr->redraw |= (PR_STATUS);
2774 p_ptr->update |= (PU_BONUS);
2784 * Set a temporary elemental brand. Clear all other brands. Print status
2787 bool set_ele_immune(u32b immune_type, int v)
2789 /* Hack -- Force good values */
2790 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2792 /* Clear all elemental attacks (only one is allowed at a time). */
2793 if ((p_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
2795 p_ptr->special_defense &= ~(DEFENSE_ACID);
2797 msg_print("»À¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2799 msg_print("You are no longer immune to acid.");
2802 if ((p_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
2804 p_ptr->special_defense &= ~(DEFENSE_ELEC);
2806 msg_print("ÅÅ·â¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2808 msg_print("You are no longer immune to electricity.");
2811 if ((p_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
2813 p_ptr->special_defense &= ~(DEFENSE_FIRE);
2815 msg_print("²Ð±ê¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2817 msg_print("You are no longer immune to fire.");
2820 if ((p_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
2822 p_ptr->special_defense &= ~(DEFENSE_COLD);
2824 msg_print("Î䵤¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2826 msg_print("You are no longer immune to cold.");
2829 if ((p_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
2831 p_ptr->special_defense &= ~(DEFENSE_POIS);
2833 msg_print("ÆǤι¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2835 msg_print("You are no longer immune to poison.");
2839 if ((v) && (immune_type))
2841 /* Set attack type. */
2842 p_ptr->special_defense |= (immune_type);
2845 p_ptr->ele_immune = v;
2849 msg_format("%s¤Î¹¶·â¤ò¼õ¤±¤Ä¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª",
2850 ((immune_type == DEFENSE_ACID) ? "»À" :
2851 ((immune_type == DEFENSE_ELEC) ? "ÅÅ·â" :
2852 ((immune_type == DEFENSE_FIRE) ? "²Ð±ê" :
2853 ((immune_type == DEFENSE_COLD) ? "Î䵤" :
2854 ((immune_type == DEFENSE_POIS) ? "ÆÇ" :
2857 msg_format("For a while, You are immune to %s",
2858 ((immune_type == DEFENSE_ACID) ? "acid!" :
2859 ((immune_type == DEFENSE_ELEC) ? "electricity!" :
2860 ((immune_type == DEFENSE_FIRE) ? "fire!" :
2861 ((immune_type == DEFENSE_COLD) ? "cold!" :
2862 ((immune_type == DEFENSE_POIS) ? "poison!" :
2863 "do nothing special."))))));
2868 if (disturb_state) disturb(0, 0);
2870 /* Redraw status bar */
2871 p_ptr->redraw |= (PR_STATUS);
2873 p_ptr->update |= (PU_BONUS);
2883 * Set "p_ptr->oppose_acid", notice observable changes
2885 bool set_oppose_acid(int v, bool do_dec)
2887 bool notice = FALSE;
2889 /* Hack -- Force good values */
2890 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2892 if (death) return FALSE;
2897 if (p_ptr->oppose_acid && !do_dec)
2899 if (p_ptr->oppose_acid > v) return FALSE;
2901 else if (!p_ptr->oppose_acid)
2904 msg_print("»À¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
2906 msg_print("You feel resistant to acid!");
2916 if (p_ptr->oppose_acid && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
2919 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
2921 msg_print("You feel less resistant to acid.");
2929 p_ptr->oppose_acid = v;
2931 /* Nothing to notice */
2932 if (!notice) return (FALSE);
2934 /* Redraw status bar */
2935 p_ptr->redraw |= (PR_STATUS);
2938 if (disturb_state) disturb(0, 0);
2949 * Set "p_ptr->oppose_elec", notice observable changes
2951 bool set_oppose_elec(int v, bool do_dec)
2953 bool notice = FALSE;
2955 /* Hack -- Force good values */
2956 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2958 if (death) return FALSE;
2963 if (p_ptr->oppose_elec && !do_dec)
2965 if (p_ptr->oppose_elec > v) return FALSE;
2967 else if (!p_ptr->oppose_elec)
2970 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
2972 msg_print("You feel resistant to electricity!");
2982 if (p_ptr->oppose_elec && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
2985 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
2987 msg_print("You feel less resistant to electricity.");
2995 p_ptr->oppose_elec = v;
2997 /* Nothing to notice */
2998 if (!notice) return (FALSE);
3000 /* Redraw status bar */
3001 p_ptr->redraw |= (PR_STATUS);
3004 if (disturb_state) disturb(0, 0);
3015 * Set "p_ptr->oppose_fire", notice observable changes
3017 bool set_oppose_fire(int v, bool do_dec)
3019 bool notice = FALSE;
3021 /* Hack -- Force good values */
3022 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3024 if (death) return FALSE;
3026 if ((prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
3030 if (p_ptr->oppose_fire && !do_dec)
3032 if (p_ptr->oppose_fire > v) return FALSE;
3034 else if (!p_ptr->oppose_fire)
3037 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3039 msg_print("You feel resistant to fire!");
3049 if (p_ptr->oppose_fire && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3052 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3054 msg_print("You feel less resistant to fire.");
3062 p_ptr->oppose_fire = v;
3064 /* Nothing to notice */
3065 if (!notice) return (FALSE);
3067 /* Redraw status bar */
3068 p_ptr->redraw |= (PR_STATUS);
3071 if (disturb_state) disturb(0, 0);
3082 * Set "p_ptr->oppose_cold", notice observable changes
3084 bool set_oppose_cold(int v, bool do_dec)
3086 bool notice = FALSE;
3088 /* Hack -- Force good values */
3089 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3091 if (death) return FALSE;
3096 if (p_ptr->oppose_cold && !do_dec)
3098 if (p_ptr->oppose_cold > v) return FALSE;
3100 else if (!p_ptr->oppose_cold)
3103 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3105 msg_print("You feel resistant to cold!");
3115 if (p_ptr->oppose_cold && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3118 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3120 msg_print("You feel less resistant to cold.");
3128 p_ptr->oppose_cold = v;
3130 /* Nothing to notice */
3131 if (!notice) return (FALSE);
3133 /* Redraw status bar */
3134 p_ptr->redraw |= (PR_STATUS);
3137 if (disturb_state) disturb(0, 0);
3148 * Set "p_ptr->oppose_pois", notice observable changes
3150 bool set_oppose_pois(int v, bool do_dec)
3152 bool notice = FALSE;
3154 /* Hack -- Force good values */
3155 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3157 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) v = 1;
3158 if (death) return FALSE;
3163 if (p_ptr->oppose_pois && !do_dec)
3165 if (p_ptr->oppose_pois > v) return FALSE;
3167 else if (!p_ptr->oppose_pois)
3170 msg_print("ÆǤؤÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3172 msg_print("You feel resistant to poison!");
3182 if (p_ptr->oppose_pois && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3185 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3187 msg_print("You feel less resistant to poison.");
3195 p_ptr->oppose_pois = v;
3197 /* Nothing to notice */
3198 if (!notice) return (FALSE);
3200 /* Redraw status bar */
3201 p_ptr->redraw |= (PR_STATUS);
3204 if (disturb_state) disturb(0, 0);
3215 * Set "p_ptr->stun", notice observable changes
3217 * Note the special code to only notice "range" changes.
3219 bool set_stun(int v)
3221 int old_aux, new_aux;
3222 bool notice = FALSE;
3225 /* Hack -- Force good values */
3226 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3228 if (death) return FALSE;
3230 if (prace_is_(RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
3233 if (p_ptr->stun > 100)
3239 else if (p_ptr->stun > 50)
3245 else if (p_ptr->stun > 0)
3281 if (new_aux > old_aux)
3283 /* Describe the state */
3289 msg_print("°Õ¼±¤¬¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3291 msg_print("You have been stunned.");
3299 msg_print("°Õ¼±¤¬¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3301 msg_print("You have been heavily stunned.");
3309 msg_print("Ƭ¤¬¥¯¥é¥¯¥é¤·¤Æ°Õ¼±¤¬±ó¤Î¤¤¤Æ¤¤¿¡£");
3311 msg_print("You have been knocked out.");
3317 if (randint(1000) < v || randint(16) == 1)
3320 msg_print("³ä¤ì¤ë¤è¤¦¤ÊƬÄˤ¬¤¹¤ë¡£");
3322 msg_print("A vicious blow hits your head.");
3325 if (randint(3) == 1)
3327 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3328 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3330 else if (randint(2) == 1)
3332 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3336 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3339 if (p_ptr->special_defense & KATA_MASK)
3341 msg_print("·¿¤¬Êø¤ì¤¿¡£");
3342 p_ptr->special_defense &= ~(KATA_MASK);
3343 p_ptr->update |= (PU_BONUS);
3344 p_ptr->update |= (PU_MONSTERS);
3345 p_ptr->redraw |= (PR_STATE);
3346 p_ptr->redraw |= (PR_STATUS);
3347 p_ptr->action = ACTION_NONE;
3355 else if (new_aux < old_aux)
3357 /* Describe the state */
3363 msg_print("¤ä¤Ã¤ÈÛ¯Û°¾õÂÖ¤«¤é²óÉü¤·¤¿¡£");
3365 msg_print("You are no longer stunned.");
3368 if (disturb_state) disturb(0, 0);
3380 if (!notice) return (FALSE);
3383 if (disturb_state) disturb(0, 0);
3385 /* Recalculate bonuses */
3386 p_ptr->update |= (PU_BONUS);
3388 /* Redraw the "stun" */
3389 p_ptr->redraw |= (PR_STUN);
3400 * Set "p_ptr->cut", notice observable changes
3402 * Note the special code to only notice "range" changes.
3406 int old_aux, new_aux;
3407 bool notice = FALSE;
3409 /* Hack -- Force good values */
3410 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3412 if (death) return FALSE;
3414 if ((p_ptr->prace == RACE_GOLEM ||
3415 p_ptr->prace == RACE_SKELETON ||
3416 p_ptr->prace == RACE_SPECTRE ||
3417 (p_ptr->prace == RACE_ZOMBIE && p_ptr->lev > 11)) &&
3422 if (p_ptr->cut > 1000)
3428 else if (p_ptr->cut > 200)
3434 else if (p_ptr->cut > 100)
3440 else if (p_ptr->cut > 50)
3446 else if (p_ptr->cut > 25)
3452 else if (p_ptr->cut > 10)
3458 else if (p_ptr->cut > 0)
3518 if (new_aux > old_aux)
3520 /* Describe the state */
3526 msg_print("¤«¤¹¤ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3528 msg_print("You have been given a graze.");
3536 msg_print("·Ú¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3538 msg_print("You have been given a light cut.");
3546 msg_print("¤Ò¤É¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3548 msg_print("You have been given a bad cut.");
3556 msg_print("ÂçÊѤʽý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3558 msg_print("You have been given a nasty cut.");
3566 msg_print("½ÅÂç¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3568 msg_print("You have been given a severe cut.");
3576 msg_print("¤Ò¤É¤¤¿¼¼ê¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3578 msg_print("You have been given a deep gash.");
3586 msg_print("Ã×̿Ū¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3588 msg_print("You have been given a mortal wound.");
3597 if (randint(1000) < v || randint(16) == 1)
3599 if (!p_ptr->sustain_chr)
3602 msg_print("¤Ò¤É¤¤½ýÀפ¬»Ä¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3604 msg_print("You have been horribly scarred.");
3614 else if (new_aux < old_aux)
3616 /* Describe the state */
3622 msg_format("¤ä¤Ã¤È%s¡£", p_ptr->prace == RACE_ANDROID ? "²ø²æ¤¬Ä¾¤Ã¤¿" : "½Ð·ì¤¬»ß¤Þ¤Ã¤¿");
3624 msg_print("You are no longer bleeding.");
3627 if (disturb_state) disturb(0, 0);
3639 if (!notice) return (FALSE);
3642 if (disturb_state) disturb(0, 0);
3644 /* Recalculate bonuses */
3645 p_ptr->update |= (PU_BONUS);
3647 /* Redraw the "cut" */
3648 p_ptr->redraw |= (PR_CUT);
3659 * Set "p_ptr->food", notice observable changes
3661 * The "p_ptr->food" variable can get as large as 20000, allowing the
3662 * addition of the most "filling" item, Elvish Waybread, which adds
3663 * 7500 food units, without overflowing the 32767 maximum limit.
3665 * Perhaps we should disturb the player with various messages,
3666 * especially messages about hunger status changes. XXX XXX XXX
3668 * Digestion of food is handled in "dungeon.c", in which, normally,
3669 * the player digests about 20 food units per 100 game turns, more
3670 * when "fast", more when "regenerating", less with "slow digestion",
3671 * but when the player is "gorged", he digests 100 food units per 10
3672 * game turns, or a full 1000 food units per 100 game turns.
3674 * Note that the player's speed is reduced by 10 units while gorged,
3675 * so if the player eats a single food ration (5000 food units) when
3676 * full (15000 food units), he will be gorged for (5000/100)*10 = 500
3677 * game turns, or 500/(100/5) = 25 player turns (if nothing else is
3678 * affecting the player speed).
3680 bool set_food(int v)
3682 int old_aux, new_aux;
3684 bool notice = FALSE;
3686 /* Hack -- Force good values */
3687 v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
3689 /* Fainting / Starving */
3690 if (p_ptr->food < PY_FOOD_FAINT)
3696 else if (p_ptr->food < PY_FOOD_WEAK)
3702 else if (p_ptr->food < PY_FOOD_ALERT)
3708 else if (p_ptr->food < PY_FOOD_FULL)
3714 else if (p_ptr->food < PY_FOOD_MAX)
3725 /* Fainting / Starving */
3726 if (v < PY_FOOD_FAINT)
3732 else if (v < PY_FOOD_WEAK)
3738 else if (v < PY_FOOD_ALERT)
3744 else if (v < PY_FOOD_FULL)
3750 else if (v < PY_FOOD_MAX)
3761 if (old_aux < 1 && new_aux > 0)
3762 chg_virtue(V_PATIENCE, 2);
3763 else if (old_aux < 3 && (old_aux != new_aux))
3764 chg_virtue(V_PATIENCE, 1);
3766 chg_virtue(V_TEMPERANCE, 1);
3768 chg_virtue(V_TEMPERANCE, -1);
3771 if (new_aux > old_aux)
3773 /* Describe the state */
3779 msg_print("¤Þ¤À¶õÊ¢¤ÇÅݤ줽¤¦¤À¡£");
3781 msg_print("You are still weak.");
3789 msg_print("¤Þ¤À¶õÊ¢¤À¡£");
3791 msg_print("You are still hungry.");
3799 msg_print("¶õÊ¢´¶¤¬¤ª¤µ¤Þ¤Ã¤¿¡£");
3801 msg_print("You are no longer hungry.");
3809 msg_print("ËþÊ¢¤À¡ª");
3811 msg_print("You are full!");
3819 msg_print("¿©¤Ù²á¤®¤À¡ª");
3821 msg_print("You have gorged yourself!");
3823 chg_virtue(V_HARMONY, -1);
3824 chg_virtue(V_PATIENCE, -1);
3825 chg_virtue(V_TEMPERANCE, -2);
3835 else if (new_aux < old_aux)
3837 /* Describe the state */
3840 /* Fainting / Starving */
3843 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
3845 msg_print("You are getting faint from hunger!");
3853 msg_print("¤ªÊ¢¤¬¶õ¤¤¤ÆÅݤ줽¤¦¤À¡£");
3855 msg_print("You are getting weak from hunger!");
3863 msg_print("¤ªÊ¢¤¬¶õ¤¤¤Æ¤¤¿¡£");
3865 msg_print("You are getting hungry.");
3873 msg_print("ËþÊ¢´¶¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
3875 msg_print("You are no longer full.");
3883 msg_print("¤ä¤Ã¤È¤ªÊ¢¤¬¤¤Ä¤¯¤Ê¤¯¤Ê¤Ã¤¿¡£");
3885 msg_print("You are no longer gorged.");
3891 if (p_ptr->wild_mode && (new_aux < 2))
3893 p_ptr->wilderness_x = px;
3894 p_ptr->wilderness_y = py;
3895 p_ptr->energy = 100;
3906 /* Nothing to notice */
3907 if (!notice) return (FALSE);
3910 if (disturb_state) disturb(0, 0);
3912 /* Recalculate bonuses */
3913 p_ptr->update |= (PU_BONUS);
3916 p_ptr->redraw |= (PR_HUNGER);
3926 * Increases a stat by one randomized level -RAK-
3928 * Note that this function (used by stat potions) now restores
3929 * the stat BEFORE increasing it.
3931 bool inc_stat(int stat)
3935 /* Then augment the current/max stat */
3936 value = p_ptr->stat_cur[stat];
3938 /* Cannot go above 18/100 */
3939 if (value < p_ptr->stat_max_max[stat])
3941 /* Gain one (sometimes two) points */
3944 gain = ((rand_int(100) < 75) ? 1 : 2);
3948 /* Gain 1/6 to 1/3 of distance to 18/100 */
3949 else if (value < (p_ptr->stat_max_max[stat]-2))
3951 /* Approximate gain value */
3952 gain = (((p_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
3955 if (gain < 1) gain = 1;
3957 /* Apply the bonus */
3958 value += randint(gain) + gain / 2;
3961 if (value > (p_ptr->stat_max_max[stat]-1)) value = p_ptr->stat_max_max[stat]-1;
3964 /* Gain one point at a time */
3970 /* Save the new value */
3971 p_ptr->stat_cur[stat] = value;
3973 /* Bring up the maximum too */
3974 if (value > p_ptr->stat_max[stat])
3976 p_ptr->stat_max[stat] = value;
3979 /* Recalculate bonuses */
3980 p_ptr->update |= (PU_BONUS);
3986 /* Nothing to gain */
3993 * Decreases a stat by an amount indended to vary from 0 to 100 percent.
3995 * Amount could be a little higher in extreme cases to mangle very high
3996 * stats from massive assaults. -CWS
3998 * Note that "permanent" means that the *given* amount is permanent,
3999 * not that the new value becomes permanent. This may not work exactly
4000 * as expected, due to "weirdness" in the algorithm, but in general,
4001 * if your stat is already drained, the "max" value will not drop all
4002 * the way down to the "cur" value.
4004 bool dec_stat(int stat, int amount, int permanent)
4006 int cur, max, loss, same, res = FALSE;
4009 /* Acquire current value */
4010 cur = p_ptr->stat_cur[stat];
4011 max = p_ptr->stat_max[stat];
4013 /* Note when the values are identical */
4014 same = (cur == max);
4016 /* Damage "current" value */
4019 /* Handle "low" values */
4022 if (amount > 90) cur--;
4023 if (amount > 50) cur--;
4024 if (amount > 20) cur--;
4028 /* Handle "high" values */
4031 /* Hack -- Decrement by a random amount between one-quarter */
4032 /* and one-half of the stat bonus times the percentage, with a */
4033 /* minimum damage of half the percentage. -CWS */
4034 loss = (((cur-18) / 2 + 1) / 2 + 1);
4037 if (loss < 1) loss = 1;
4039 /* Randomize the loss */
4040 loss = ((randint(loss) + loss) * amount) / 100;
4043 if (loss < amount/2) loss = amount/2;
4045 /* Lose some points */
4048 /* Hack -- Only reduce stat to 17 sometimes */
4049 if (cur < 18) cur = (amount <= 20) ? 18 : 17;
4052 /* Prevent illegal values */
4053 if (cur < 3) cur = 3;
4055 /* Something happened */
4056 if (cur != p_ptr->stat_cur[stat]) res = TRUE;
4059 /* Damage "max" value */
4060 if (permanent && (max > 3))
4062 chg_virtue(V_SACRIFICE, 1);
4063 if (stat == A_WIS || stat == A_INT)
4064 chg_virtue(V_ENLIGHTEN, -2);
4066 /* Handle "low" values */
4069 if (amount > 90) max--;
4070 if (amount > 50) max--;
4071 if (amount > 20) max--;
4075 /* Handle "high" values */
4078 /* Hack -- Decrement by a random amount between one-quarter */
4079 /* and one-half of the stat bonus times the percentage, with a */
4080 /* minimum damage of half the percentage. -CWS */
4081 loss = (((max-18) / 2 + 1) / 2 + 1);
4082 loss = ((randint(loss) + loss) * amount) / 100;
4083 if (loss < amount/2) loss = amount/2;
4085 /* Lose some points */
4088 /* Hack -- Only reduce stat to 17 sometimes */
4089 if (max < 18) max = (amount <= 20) ? 18 : 17;
4092 /* Hack -- keep it clean */
4093 if (same || (max < cur)) max = cur;
4095 /* Something happened */
4096 if (max != p_ptr->stat_max[stat]) res = TRUE;
4102 /* Actually set the stat to its new value. */
4103 p_ptr->stat_cur[stat] = cur;
4104 p_ptr->stat_max[stat] = max;
4106 /* Recalculate bonuses */
4107 p_ptr->update |= (PU_BONUS);
4116 * Restore a stat. Return TRUE only if this actually makes a difference.
4118 bool res_stat(int stat)
4120 /* Restore if needed */
4121 if (p_ptr->stat_cur[stat] != p_ptr->stat_max[stat])
4124 p_ptr->stat_cur[stat] = p_ptr->stat_max[stat];
4126 /* Recalculate bonuses */
4127 p_ptr->update |= (PU_BONUS);
4133 /* Nothing to restore */
4139 * Increase players hit points, notice effects
4141 bool hp_player(int num)
4144 vir = virtue_number(V_VITALITY);
4147 num = num * (p_ptr->virtues[vir - 1] + 1250) / 1250;
4149 /* Healing needed */
4150 if (p_ptr->chp < p_ptr->mhp)
4152 // chg_virtue(V_CHANCE, -1);
4153 if ((num > 0) && (p_ptr->chp < (p_ptr->mhp/3)))
4154 chg_virtue(V_TEMPERANCE, 1);
4155 /* Gain hitpoints */
4158 /* Enforce maximum */
4159 if (p_ptr->chp >= p_ptr->mhp)
4161 p_ptr->chp = p_ptr->mhp;
4162 p_ptr->chp_frac = 0;
4166 p_ptr->redraw |= (PR_HP);
4169 p_ptr->window |= (PW_PLAYER);
4175 msg_print("¾¯¤·µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4177 msg_print("You feel a little better.");
4186 msg_print("µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4188 msg_print("You feel better.");
4197 msg_print("¤È¤Æ¤âµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4199 msg_print("You feel much better.");
4208 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4210 msg_print("You feel very good.");
4225 * Array of stat "descriptions"
4227 static cptr desc_stat_pos[] =
4269 * Array of stat "descriptions"
4271 static cptr desc_stat_neg[] =
4295 bool do_dec_stat(int stat)
4299 /* Access the "sustain" */
4302 case A_STR: if (p_ptr->sustain_str) sust = TRUE; break;
4303 case A_INT: if (p_ptr->sustain_int) sust = TRUE; break;
4304 case A_WIS: if (p_ptr->sustain_wis) sust = TRUE; break;
4305 case A_DEX: if (p_ptr->sustain_dex) sust = TRUE; break;
4306 case A_CON: if (p_ptr->sustain_con) sust = TRUE; break;
4307 case A_CHR: if (p_ptr->sustain_chr) sust = TRUE; break;
4311 if (sust && (!ironman_nightmare || rand_int(13)))
4315 msg_format("%s¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¤¬¡¢¤¹¤°¤Ë¸µ¤ËÌá¤Ã¤¿¡£",
4317 msg_format("You feel %s for a moment, but the feeling passes.",
4320 desc_stat_neg[stat]);
4326 /* Attempt to reduce the stat */
4327 if (dec_stat(stat, 10, (ironman_nightmare && !rand_int(13))))
4331 msg_format("¤Ò¤É¤¯%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_neg[stat]);
4333 msg_format("You feel very %s.", desc_stat_neg[stat]);
4341 /* Nothing obvious */
4347 * Restore lost "points" in a stat
4349 bool do_res_stat(int stat)
4351 /* Attempt to increase */
4356 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4358 msg_format("You feel less %s.", desc_stat_neg[stat]);
4366 /* Nothing obvious */
4372 * Gain a "point" in a stat
4374 bool do_inc_stat(int stat)
4378 /* Restore strength */
4379 res = res_stat(stat);
4381 /* Attempt to increase */
4386 chg_virtue(V_ENLIGHTEN, 1);
4387 chg_virtue(V_FAITH, 1);
4389 else if (stat == A_INT)
4391 chg_virtue(V_KNOWLEDGE, 1);
4392 chg_virtue(V_ENLIGHTEN, 1);
4394 else if (stat == A_CON)
4395 chg_virtue(V_VITALITY, 1);
4399 msg_format("¥ï¡¼¥ª¡ª¤È¤Æ¤â%s¤Ê¤Ã¤¿¡ª", desc_stat_pos[stat]);
4401 msg_format("Wow! You feel very %s!", desc_stat_pos[stat]);
4409 /* Restoration worked */
4414 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4416 msg_format("You feel less %s.", desc_stat_neg[stat]);
4424 /* Nothing obvious */
4430 * Restores any drained experience
4432 bool restore_level(void)
4434 /* Restore experience */
4435 if (p_ptr->exp < p_ptr->max_exp)
4439 msg_print("À¸Ì¿ÎϤ¬Ìá¤Ã¤Æ¤¤¿µ¤¤¬¤¹¤ë¡£");
4441 msg_print("You feel your life energies returning.");
4445 /* Restore the experience */
4446 p_ptr->exp = p_ptr->max_exp;
4448 /* Check the experience */
4463 bool lose_all_info(void)
4467 chg_virtue(V_KNOWLEDGE, -5);
4468 chg_virtue(V_ENLIGHTEN, -5);
4470 /* Forget info about objects */
4471 for (i = 0; i < INVEN_TOTAL; i++)
4473 object_type *o_ptr = &inventory[i];
4475 /* Skip non-objects */
4476 if (!o_ptr->k_idx) continue;
4478 /* Allow "protection" by the MENTAL flag */
4479 if (o_ptr->ident & (IDENT_MENTAL)) continue;
4481 /* Remove "default inscriptions" */
4482 o_ptr->feeling = FEEL_NONE;
4484 /* Hack -- Clear the "empty" flag */
4485 o_ptr->ident &= ~(IDENT_EMPTY);
4487 /* Hack -- Clear the "known" flag */
4488 o_ptr->ident &= ~(IDENT_KNOWN);
4490 /* Hack -- Clear the "felt" flag */
4491 o_ptr->ident &= ~(IDENT_SENSE);
4494 /* Recalculate bonuses */
4495 p_ptr->update |= (PU_BONUS);
4497 /* Combine / Reorder the pack (later) */
4498 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
4501 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
4503 /* Mega-Hack -- Forget the map */
4511 void do_poly_wounds(void)
4513 /* Changed to always provide at least _some_ healing */
4514 s16b wounds = p_ptr->cut;
4515 s16b hit_p = (p_ptr->mhp - p_ptr->chp);
4516 s16b change = damroll(p_ptr->lev, 5);
4517 bool Nasty_effect = (randint(5) == 1);
4519 if (!(wounds || hit_p || Nasty_effect)) return;
4522 msg_print("½ý¤¬¤è¤ê·Ú¤¤¤â¤Î¤ËÊѲ½¤·¤¿¡£");
4524 msg_print("Your wounds are polymorphed into less serious ones.");
4531 msg_print("¿·¤¿¤Ê½ý¤¬¤Ç¤¤¿¡ª");
4532 take_hit(DAMAGE_LOSELIFE, change / 2, "ÊѲ½¤·¤¿½ý", -1);
4534 msg_print("A new wound was created!");
4535 take_hit(DAMAGE_LOSELIFE, change / 2, "a polymorphed wound", -1);
4542 set_cut(p_ptr->cut - (change / 2));
4547 void do_poly_self(void)
4549 int power = p_ptr->lev;
4552 msg_print("¤¢¤Ê¤¿¤ÏÊѲ½¤Îˬ¤ì¤ò´¶¤¸¤¿...");
4554 msg_print("You feel a change coming over you...");
4557 chg_virtue(V_CHANCE, 1);
4559 if ((power > rand_int(20)) && (rand_int(3) == 1) && (p_ptr->prace != RACE_ANDROID))
4561 char effect_msg[80] = "";
4562 int new_race, expfact, goalexpfact, h_percent;
4564 /* Some form of racial polymorph... */
4567 if ((power > rand_int(5)) && (rand_int(4) == 1))
4572 if (p_ptr->psex == SEX_MALE)
4574 p_ptr->psex = SEX_FEMALE;
4575 sp_ptr = &sex_info[p_ptr->psex];
4577 sprintf(effect_msg, "½÷À¤Î");
4579 sprintf(effect_msg, "female ");
4585 p_ptr->psex = SEX_MALE;
4586 sp_ptr = &sex_info[p_ptr->psex];
4588 sprintf(effect_msg, "ÃËÀ¤Î");
4590 sprintf(effect_msg, "male ");
4596 if ((power > rand_int(30)) && (rand_int(5) == 1))
4600 /* Harmful deformity */
4605 if (rand_int(2) == 1)
4607 (void)dec_stat(tmp, randint(6) + 6, (randint(3) == 1));
4613 /* Deformities are discriminated against! */
4614 (void)dec_stat(A_CHR, randint(6), TRUE);
4620 sprintf(tmp_msg,"%s",effect_msg);
4621 sprintf(effect_msg,"´ñ·Á¤Î%s",tmp_msg);
4623 sprintf(tmp_msg,"%s ",effect_msg);
4624 sprintf(effect_msg,"deformed %s ",tmp_msg);
4631 sprintf(effect_msg,"´ñ·Á¤Î");
4633 sprintf(effect_msg,"deformed ");
4639 while ((power > rand_int(20)) && (rand_int(10) == 1))
4641 /* Polymorph into a less mutated form */
4644 if (!lose_mutation(0))
4646 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
4648 msg_print("You feel oddly normal.");
4654 * Restrict the race choices by exp penalty so
4655 * weak polymorph always means weak race
4660 goalexpfact = 100 + 3 * rand_int(power);
4664 new_race = rand_int(MAX_RACES);
4665 expfact = race_info[new_race].r_exp;
4667 while (((new_race == p_ptr->prace) && (expfact > goalexpfact)) || (new_race == RACE_ANDROID));
4670 msg_format("¤¢¤Ê¤¿¤Ï%s%s¤ËÊѲ½¤·¤¿¡ª", effect_msg,
4671 race_info[new_race].title);
4675 msg_format("You turn into a%s %s!",
4676 ((new_race == RACE_AMBERITE || new_race == RACE_ELF
4677 || new_race == RACE_IMP) ? "n" : ""),
4678 race_info[new_race].title);
4682 msg_format("You turn into a %s%s!", effect_msg,
4683 race_info[new_race].title);
4687 chg_virtue(V_CHANCE, 2);
4689 if (p_ptr->prace < 32)
4691 p_ptr->old_race1 |= 1L << p_ptr->prace;
4695 p_ptr->old_race2 = 1L << (p_ptr->prace-32);
4697 p_ptr->prace = new_race;
4698 rp_ptr = &race_info[p_ptr->prace];
4700 /* Experience factor */
4701 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
4703 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)))
4704 p_ptr->expfact -= 15;
4707 /* Calculate the height/weight for males */
4708 if (p_ptr->psex == SEX_MALE)
4710 p_ptr->ht = randnor(rp_ptr->m_b_ht, rp_ptr->m_m_ht);
4711 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->m_b_ht);
4712 p_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * h_percent /100
4713 , (int)(rp_ptr->m_m_wt) * h_percent / 300 );
4716 /* Calculate the height/weight for females */
4717 else if (p_ptr->psex == SEX_FEMALE)
4719 p_ptr->ht = randnor(rp_ptr->f_b_ht, rp_ptr->f_m_ht);
4720 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->f_b_ht);
4721 p_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * h_percent /100
4722 , (int)(rp_ptr->f_m_wt) * h_percent / 300 );
4728 if (p_ptr->pclass == CLASS_SORCERER)
4729 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
4731 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
4733 do_cmd_rerate(FALSE);
4735 // p_ptr->max_plv = p_ptr->lev;
4737 p_ptr->redraw |= (PR_BASIC);
4739 p_ptr->update |= (PU_BONUS);
4745 if ((power > rand_int(30)) && (rand_int(6) == 1))
4753 msg_format("%s¤Î¹½À®¤¬ÊѲ½¤·¤¿¡ª", p_ptr->prace == RACE_ANDROID ? "µ¡³£" : "Æâ¡");
4755 msg_print("Your internal organs are rearranged!");
4760 (void)dec_stat(tmp, randint(6) + 6, (randint(3) == 1));
4763 if (randint(6) == 1)
4766 msg_print("¸½ºß»Ñ¤ÇÀ¸¤¤Æ¤¤¤¯¤Î¤Ïº¤Æñ¤Ê¤è¤¦¤À¡ª");
4767 take_hit(DAMAGE_LOSELIFE, damroll(randint(10), p_ptr->lev), "Ã×̿Ū¤ÊÆÍÁ³ÊÑ°Û", -1);
4769 msg_print("You find living difficult in your present form!");
4770 take_hit(DAMAGE_LOSELIFE, damroll(randint(10), p_ptr->lev), "a lethal mutation", -1);
4777 if ((power > rand_int(20)) && (rand_int(4) == 1))
4782 do_cmd_rerate(FALSE);
4785 while ((power > rand_int(15)) && (rand_int(3) == 1))
4788 (void)gain_random_mutation(0);
4791 if (power > rand_int(5))
4797 /* Note: earlier deductions may have left power < 0 already. */
4807 * Decreases players hit points and sets death flag if necessary
4809 * XXX XXX XXX Invulnerability needs to be changed into a "shield"
4811 * XXX XXX XXX Hack -- this function allows the user to save (or quit)
4812 * the game when he dies, since the "You die." message is shown before
4813 * setting the player to "dead".
4815 bool take_hit(int damage_type, int damage, cptr hit_from, int monspell)
4817 int old_chp = p_ptr->chp;
4819 char death_message[1024];
4822 int warning = (p_ptr->mhp * hitpoint_warn / 10);
4825 if (death) return FALSE;
4827 if (p_ptr->sutemi) damage *= 2;
4828 if (p_ptr->special_defense & KATA_IAI) damage += (damage + 4) / 5;
4830 if (easy_band) damage = (damage+1)/2;
4832 if (damage_type != DAMAGE_USELIFE)
4842 if (monspell >= 0) learn_spell(monspell);
4844 /* Mega-Hack -- Apply "invulnerability" */
4845 if ((damage_type != DAMAGE_USELIFE) && (damage_type != DAMAGE_LOSELIFE))
4847 if ((p_ptr->invuln || ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == MUSIC_INVULN))) && (damage < 9000))
4849 if (damage_type == DAMAGE_FORCE)
4852 msg_print("¥Ð¥ê¥¢¤¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
4854 msg_print("The attack cuts your shield of invulnerability open!");
4857 else if (randint(PENETRATE_INVULNERABILITY) == 1)
4860 msg_print("̵Ũ¤Î¥Ð¥ê¥¢¤òÇˤäƹ¶·â¤µ¤ì¤¿¡ª");
4862 msg_print("The attack penetrates your shield of invulnerability!");
4871 /* Multishadow effects is determined by turn */
4872 if (p_ptr->multishadow && (turn & 1))
4874 if (damage_type == DAMAGE_FORCE)
4877 msg_print("¸¸±Æ¤â¤í¤È¤âÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
4879 msg_print("The attack hits Shadow together with you!");
4882 else if (damage_type == DAMAGE_ATTACK)
4885 msg_print("¹¶·â¤Ï¸¸±Æ¤ËÌ¿Ã椷¡¢¤¢¤Ê¤¿¤Ë¤ÏÆϤ«¤Ê¤«¤Ã¤¿¡£");
4887 msg_print("The attack hits Shadow, you are unharmed!");
4893 if (p_ptr->wraith_form)
4895 if (damage_type == DAMAGE_FORCE)
4898 msg_print("Ⱦʪ¼Á¤ÎÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
4900 msg_print("The attack cuts through your ethereal body!");
4906 if ((damage == 0) && (randint(2) == 1)) damage = 1;
4910 if ((p_ptr->special_defense & KATA_MUSOU))
4913 if ((damage == 0) && (randint(2) == 1)) damage = 1;
4915 } /* not if LOSELIFE USELIFE */
4917 /* Hurt the player */
4918 p_ptr->chp -= damage;
4919 if(damage_type == DAMAGE_GENO && p_ptr->chp < 0)
4924 /* Display the hitpoints */
4925 p_ptr->redraw |= (PR_HP);
4928 p_ptr->window |= (PW_PLAYER);
4932 if (damage_type != DAMAGE_GENO && p_ptr->chp == 0)
4934 chg_virtue(V_SACRIFICE, 1);
4935 chg_virtue(V_CHANCE, 2);
4942 bool android = (p_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
4944 #ifdef JP /* »à¤ó¤À»þ¤Ë¶¯À©½ªÎ»¤·¤Æ»à¤ò²óÈò¤Ç¤¤Ê¤¯¤·¤Æ¤ß¤¿ by Habu */
4945 if (!munchkin_death)
4946 if(!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
4952 chg_virtue(V_SACRIFICE, 10);
4955 p_ptr->leaving = TRUE;
4960 if (p_ptr->inside_arena)
4963 msg_format("¤¢¤Ê¤¿¤Ï%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£", r_name+r_info[arena_monsters[p_ptr->arena_number]].name);
4965 msg_format("You are beaten by %s.", r_name+r_info[arena_monsters[p_ptr->arena_number]].name);
4971 /* Note cause of death */
4972 (void)strcpy(died_from, hit_from);
4974 if (p_ptr->image) strcat(died_from,"(?)");
4976 /* No longer a winner */
4977 total_winner = FALSE;
4979 if (p_ptr->inside_arena)
4981 strcpy(buf,"¥¢¥ê¡¼¥Ê");
4983 strcpy(buf,"in the Arena");
4985 else if (!dun_level)
4989 strcpy(buf,"on The surface");
4991 else if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT)))
4993 strcpy(buf,"¥¯¥¨¥¹¥È");
4995 strcpy(buf,"in a quest");
4999 sprintf(buf,"%d³¬", dun_level);
5001 sprintf(buf,"level %d", dun_level);
5004 sprintf(tmp,"%s¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£",buf, died_from);
5006 sprintf(tmp,"killed by %s %s.", died_from, buf);
5008 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5010 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- ¥²¡¼¥à¥ª¡¼¥Ð¡¼ --------");
5012 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- Game Over --------");
5014 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, "\n\n\n\n");
5019 if (get_check("²èÌ̤òÊݸ¤·¤Þ¤¹¤«¡©"))
5021 if (get_check("Dump the screen? "))
5025 do_cmd_save_screen();
5030 /* Hack -- Note death */
5034 msg_format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë");
5036 msg_print(android ? "You are broken." : "You die.");
5043 if (streq(died_from, "Seppuku"))
5046 get_rnd_line("seppuku_j.txt", 0, death_message);
5048 get_rnd_line("seppuku.txt", 0, death_message);
5054 get_rnd_line("death_j.txt", 0, death_message);
5056 get_rnd_line("death.txt", 0, death_message);
5060 if (!get_string(streq(died_from, "Seppuku") ? "¼À¤¤Î¶ç: " : "ÃÇËöËâ¤Î¶«¤Ó: ", death_message, 1024))
5062 if (!get_string("Last word: ", death_message, 1024))
5067 strcpy(death_message, format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë"));
5069 strcpy(death_message, android ? "You are broken." : "You die.");
5072 if (streq(died_from, "Seppuku"))
5078 int msg_pos_x[9] = { 5, 7, 9, 12, 14, 17, 19, 21, 23};
5079 int msg_pos_y[9] = { 3, 4, 5, 4, 5, 4, 5, 6, 4};
5086 for (i = 0; i < 40; i++)
5087 Term_putstr(rand_int(w / 2) * 2, rand_int(h), 2, TERM_VIOLET, "¦Ô");
5089 str = death_message;
5090 if (strncmp(str, "¡Ö", 2) == 0) str += 2;
5092 str2 = strstr_j(str, "¡×");
5093 if (str2 != NULL) str2 = '\0';
5098 str2 = strstr_j(str, " ");
5099 if (str2 == NULL) len = strlen(str);
5100 else len = str2 - str;
5104 Term_putstr_v(w * 3 / 4 - 2 - msg_pos_x[i] * 2, msg_pos_y[i], len,
5106 if (str2 == NULL) break;
5110 if (*str == 0) break;
5115 msg_print(death_message);
5119 msg_print(death_message);
5127 /* Hitpoint warning */
5128 if (p_ptr->chp < warning)
5130 /* Hack -- bell on first notice */
5131 if (alert_hitpoint && (old_chp > warning)) bell();
5135 if (record_danger && (old_chp > warning))
5137 sprintf(tmp,"%s¤Ë¤è¤Ã¤Æ¥Ô¥ó¥Á¤Ë´Ù¤¤¤Ã¤¿¡£",hit_from);
5138 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5143 /* stop auto_more even if DAMAGE_USELIFE */
5149 msg_print("*** ·Ù¹ð:Äã¥Ò¥Ã¥È¡¦¥Ý¥¤¥ó¥È¡ª ***");
5151 msg_print("*** LOW HITPOINT WARNING! ***");
5157 if (p_ptr->wild_mode && !p_ptr->leaving && (p_ptr->chp < MAX(warning, p_ptr->mhp/5)))
5159 p_ptr->wilderness_x = px;
5160 p_ptr->wilderness_y = py;
5161 p_ptr->energy = 100;
5171 void gain_exp(s32b amount)
5175 if (p_ptr->prace == RACE_ANDROID) return;
5177 /* Gain some experience */
5178 p_ptr->exp += amount;
5180 /* Slowly recover from experience drainage */
5181 if (p_ptr->exp < p_ptr->max_exp)
5183 /* Gain max experience (20%) (was 10%) */
5184 p_ptr->max_exp += amount / 5;
5187 /* Check Experience */
5192 void calc_android_exp(void)
5198 if (p_ptr->prace != RACE_ANDROID) return;
5200 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5202 object_type *o_ptr = &inventory[i];
5204 object_type *q_ptr = &forge;
5206 int level = MAX(get_object_level(o_ptr) - 8, 1);
5208 if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue;
5209 if (!o_ptr->k_idx) continue;
5211 /* Wipe the object */
5214 object_copy(q_ptr, o_ptr);
5215 q_ptr->discount = 0;
5216 q_ptr->ident &= ~(IDENT_CURSED);
5217 q_ptr->art_flags3 &= ~(TR3_CURSED | TR3_HEAVY_CURSE | TR3_PERMA_CURSE | TR3_TY_CURSE);
5221 level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
5222 level += MIN(20, a_info[o_ptr->name1].rarity/(a_info[o_ptr->name1].flags3 & TR3_INSTA_ART ? 10 : 3));
5224 else if (o_ptr->name2) level += MAX(3, (e_info[o_ptr->name2].rating - 5)/2);
5225 value = object_value_real(q_ptr);
5227 if (value <= 0) continue;
5228 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (p_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
5229 if (value > 5000000L) value = 5000000L;
5230 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
5232 if (o_ptr->name1 || o_ptr->name2 || o_ptr->art_name ||
5233 (o_ptr->tval == TV_DRAG_ARMOR) ||
5234 ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) ||
5235 ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) ||
5236 ((o_ptr->tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)) ||
5237 ((o_ptr->tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) ||
5238 ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE)))
5240 if (level > 65) level = 35 + (level - 65) / 5;
5241 else if (level > 35) level = 25 + (level - 35) / 3;
5242 else if (level > 15) level = 15 + (level - 15) / 2;
5243 exp = MIN(100000L, value) * level * level / 2;
5244 if (value > 100000L)
5245 exp += (value - 100000L) * level * level / 8;
5249 exp = MIN(100000L, value) * level;
5250 if (value > 100000L)
5251 exp += (value - 100000L) * level / 4;
5253 if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (buki_motteruka(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
5254 else total_exp += exp / 16;
5255 if (i == INVEN_BODY) total_exp += exp / 32;
5257 p_ptr->exp = p_ptr->max_exp = total_exp;
5259 /* Check Experience */
5267 void lose_exp(s32b amount)
5269 if (p_ptr->prace == RACE_ANDROID) return;
5271 /* Never drop below zero experience */
5272 if (amount > p_ptr->exp) amount = p_ptr->exp;
5274 /* Lose some experience */
5275 p_ptr->exp -= amount;
5277 /* Check Experience */
5281 bool set_ultimate_res(int v, bool do_dec)
5283 bool notice = FALSE;
5285 /* Hack -- Force good values */
5286 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5288 if (death) return FALSE;
5293 if (p_ptr->ult_res && !do_dec)
5295 if (p_ptr->ult_res > v) return FALSE;
5297 else if (!p_ptr->ult_res)
5300 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5302 msg_print("You feel resistant!");
5315 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5317 msg_print("You feel less resistant");
5327 /* Redraw status bar */
5328 p_ptr->redraw |= (PR_STATUS);
5330 /* Nothing to notice */
5331 if (!notice) return (FALSE);
5334 if (disturb_state) disturb(0, 0);
5336 /* Recalculate bonuses */
5337 p_ptr->update |= (PU_BONUS);
5346 bool set_tim_res_nether(int v, bool do_dec)
5348 bool notice = FALSE;
5350 /* Hack -- Force good values */
5351 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5353 if (death) return FALSE;
5358 if (p_ptr->tim_res_nether && !do_dec)
5360 if (p_ptr->tim_res_nether > v) return FALSE;
5362 else if (!p_ptr->tim_res_nether)
5365 msg_print("ÃϹö¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5367 msg_print("You feel nether resistant!");
5377 if (p_ptr->tim_res_nether)
5380 msg_print("ÃϹö¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5382 msg_print("You feel less nether resistant");
5390 p_ptr->tim_res_nether = v;
5392 /* Redraw status bar */
5393 p_ptr->redraw |= (PR_STATUS);
5395 /* Nothing to notice */
5396 if (!notice) return (FALSE);
5399 if (disturb_state) disturb(0, 0);
5401 /* Recalculate bonuses */
5402 p_ptr->update |= (PU_BONUS);
5411 bool set_tim_res_time(int v, bool do_dec)
5413 bool notice = FALSE;
5415 /* Hack -- Force good values */
5416 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5418 if (death) return FALSE;
5423 if (p_ptr->tim_res_time && !do_dec)
5425 if (p_ptr->tim_res_time > v) return FALSE;
5427 else if (!p_ptr->tim_res_time)
5430 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5432 msg_print("You feel time resistant!");
5442 if (p_ptr->tim_res_time)
5445 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5447 msg_print("You feel less time resistant");
5455 p_ptr->tim_res_time = v;
5457 /* Redraw status bar */
5458 p_ptr->redraw |= (PR_STATUS);
5460 /* Nothing to notice */
5461 if (!notice) return (FALSE);
5464 if (disturb_state) disturb(0, 0);
5466 /* Recalculate bonuses */
5467 p_ptr->update |= (PU_BONUS);
5478 * Choose a warrior-mage elemental attack. -LM-
5480 bool choose_ele_attack(void)
5489 num = (p_ptr->lev - 20) / 5;
5492 c_prt(TERM_RED, " a) ¾Æ´þ", 2, 14);
5494 c_prt(TERM_RED, " a) Fire Brand", 2, 14);
5498 if (num >= 2) c_prt(TERM_L_WHITE," b) Åà·ë", 3, 14);
5500 if (num >= 2) c_prt(TERM_L_WHITE," b) Cold Brand", 3, 14);
5502 else prt("", 3, 14);
5505 if (num >= 3) c_prt(TERM_GREEN, " c) ÆÇ»¦", 4, 14);
5507 if (num >= 3) c_prt(TERM_GREEN, " c) Poison Brand", 4, 14);
5509 else prt("", 4, 14);
5512 if (num >= 4) c_prt(TERM_L_DARK, " d) Íϲò", 5, 14);
5514 if (num >= 4) c_prt(TERM_L_DARK, " d) Acid Brand", 5, 14);
5516 else prt("", 5, 14);
5519 if (num >= 5) c_prt(TERM_BLUE, " e) ÅÅ·â", 6, 14);
5521 if (num >= 5) c_prt(TERM_BLUE, " e) Elec Brand", 6, 14);
5523 else prt("", 6, 14);
5531 prt(" ¤É¤Î¸µÁǹ¶·â¤ò¤·¤Þ¤¹¤«¡©", 1, 14);
5533 prt(" Choose a temporary elemental brand ", 1, 14);
5538 if ((choice == 'a') || (choice == 'A'))
5539 set_ele_attack(ATTACK_FIRE, p_ptr->lev/2 + randint(p_ptr->lev/2));
5540 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
5541 set_ele_attack(ATTACK_COLD, p_ptr->lev/2 + randint(p_ptr->lev/2));
5542 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
5543 set_ele_attack(ATTACK_POIS, p_ptr->lev/2 + randint(p_ptr->lev/2));
5544 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
5545 set_ele_attack(ATTACK_ACID, p_ptr->lev/2 + randint(p_ptr->lev/2));
5546 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
5547 set_ele_attack(ATTACK_ELEC, p_ptr->lev/2 + randint(p_ptr->lev/2));
5551 msg_print("ËâË¡·õ¤ò»È¤¦¤Î¤ò¤ä¤á¤¿¡£");
5553 msg_print("You cancel the temporary branding.");
5565 * Choose a elemental immune. -LM-
5567 bool choose_ele_immune(int turn)
5575 c_prt(TERM_RED, " a) ²Ð±ê", 2, 14);
5577 c_prt(TERM_RED, " a) Immune Fire", 2, 14);
5581 c_prt(TERM_L_WHITE," b) Î䵤", 3, 14);
5583 c_prt(TERM_L_WHITE," b) Immune Cold", 3, 14);
5587 c_prt(TERM_L_DARK, " c) »À", 4, 14);
5589 c_prt(TERM_L_DARK, " c) Immune Acid", 4, 14);
5593 c_prt(TERM_BLUE, " d) ÅÅ·â", 5, 14);
5595 c_prt(TERM_BLUE, " d) Immune Elec", 5, 14);
5606 prt(" ¤É¤Î¸µÁǤÎÌȱ֤ò¤Ä¤±¤Þ¤¹¤«¡©", 1, 14);
5608 prt(" Choose a temporary elemental immune ", 1, 14);
5613 if ((choice == 'a') || (choice == 'A'))
5614 set_ele_immune(DEFENSE_FIRE, turn);
5615 else if ((choice == 'b') || (choice == 'B'))
5616 set_ele_immune(DEFENSE_COLD, turn);
5617 else if ((choice == 'c') || (choice == 'C'))
5618 set_ele_immune(DEFENSE_ACID, turn);
5619 else if ((choice == 'd') || (choice == 'D'))
5620 set_ele_immune(DEFENSE_ELEC, turn);
5624 msg_print("Ìȱ֤òÉÕ¤±¤ë¤Î¤ò¤ä¤á¤¿¡£");
5626 msg_print("You cancel the temporary immune.");