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)
423 msg_print("¹½¤¨¤¬¤È¤±¤¿¡£");
425 msg_print("Your posture gets loose.");
427 p_ptr->special_defense &= ~(KAMAE_MASK);
428 p_ptr->update |= (PU_BONUS);
429 p_ptr->redraw |= (PR_STATE);
430 p_ptr->action = ACTION_NONE;
432 else if (p_ptr->action == ACTION_KATA)
435 msg_print("·¿¤¬Êø¤ì¤¿¡£");
437 msg_print("Your posture gets loose.");
439 p_ptr->special_defense &= ~(KATA_MASK);
440 p_ptr->update |= (PU_BONUS);
441 p_ptr->update |= (PU_MONSTERS);
442 p_ptr->redraw |= (PR_STATE);
443 p_ptr->redraw |= (PR_STATUS);
444 p_ptr->action = ACTION_NONE;
448 p_ptr->counter = FALSE;
449 chg_virtue(V_HARMONY, -1);
459 msg_print("¤ä¤Ã¤Èº®Í𤬤ª¤µ¤Þ¤Ã¤¿¡£");
461 msg_print("You feel less confused now.");
464 p_ptr->special_attack &= ~(ATTACK_SUIKEN);
472 /* Redraw status bar */
473 p_ptr->redraw |= (PR_STATUS);
475 /* Nothing to notice */
476 if (!notice) return (FALSE);
479 if (disturb_state) disturb(0, 0);
490 * Set "p_ptr->poisoned", notice observable changes
492 bool set_poisoned(int v)
496 /* Hack -- Force good values */
497 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
499 if (death) return FALSE;
504 if (!p_ptr->poisoned)
507 msg_print("ÆǤ˿¯¤µ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
509 msg_print("You are poisoned!");
522 msg_print("¤ä¤Ã¤ÈÆǤÎÄˤߤ¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
524 msg_print("You are no longer poisoned.");
534 /* Redraw status bar */
535 p_ptr->redraw |= (PR_STATUS);
537 /* Nothing to notice */
538 if (!notice) return (FALSE);
541 if (disturb_state) disturb(0, 0);
552 * Set "p_ptr->afraid", notice observable changes
554 bool set_afraid(int v)
558 /* Hack -- Force good values */
559 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
561 if (death) return FALSE;
569 msg_print("²¿¤â¤«¤â¶²¤¯¤Ê¤Ã¤Æ¤¤¿¡ª");
571 msg_print("You are terrified!");
574 if (p_ptr->special_defense & KATA_MASK)
577 msg_print("·¿¤¬Êø¤ì¤¿¡£");
579 msg_print("Your posture gets loose.");
581 p_ptr->special_defense &= ~(KATA_MASK);
582 p_ptr->update |= (PU_BONUS);
583 p_ptr->update |= (PU_MONSTERS);
584 p_ptr->redraw |= (PR_STATE);
585 p_ptr->redraw |= (PR_STATUS);
586 p_ptr->action = ACTION_NONE;
590 p_ptr->counter = FALSE;
591 chg_virtue(V_VALOUR, -1);
601 msg_print("¤ä¤Ã¤È¶²Éݤò¿¶¤êʧ¤Ã¤¿¡£");
603 msg_print("You feel bolder now.");
613 /* Redraw status bar */
614 p_ptr->redraw |= (PR_STATUS);
616 /* Nothing to notice */
617 if (!notice) return (FALSE);
620 if (disturb_state) disturb(0, 0);
631 * Set "p_ptr->paralyzed", notice observable changes
633 bool set_paralyzed(int v)
637 /* Hack -- Force good values */
638 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
640 if (death) return FALSE;
645 if (!p_ptr->paralyzed)
648 msg_print("ÂΤ¬Ëãá㤷¤Æ¤·¤Þ¤Ã¤¿¡ª");
650 msg_print("You are paralyzed!");
653 p_ptr->counter = FALSE;
661 if (p_ptr->paralyzed)
664 msg_print("¤ä¤Ã¤ÈÆ°¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
666 msg_print("You can move again.");
674 p_ptr->paralyzed = v;
676 /* Redraw status bar */
677 p_ptr->redraw |= (PR_STATUS);
679 /* Nothing to notice */
680 if (!notice) return (FALSE);
683 if (disturb_state) disturb(0, 0);
685 /* Redraw the state */
686 p_ptr->redraw |= (PR_STATE);
697 * Set "p_ptr->image", notice observable changes
699 * Note that we must redraw the map when hallucination changes.
701 bool set_image(int v)
705 /* Hack -- Force good values */
706 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
708 if (death) return FALSE;
714 set_tsuyoshi(0, TRUE);
718 msg_print("¥ï¡¼¥ª¡ª²¿¤â¤«¤âÆú¿§¤Ë¸«¤¨¤ë¡ª");
720 msg_print("Oh, wow! Everything looks so cosmic now!");
723 p_ptr->counter = FALSE;
734 msg_print("¤ä¤Ã¤È¤Ï¤Ã¤¤ê¤Èʪ¤¬¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
736 msg_print("You can see clearly again.");
746 /* Redraw status bar */
747 p_ptr->redraw |= (PR_STATUS);
749 /* Nothing to notice */
750 if (!notice) return (FALSE);
753 if (disturb_state) disturb(0, 0);
756 p_ptr->redraw |= (PR_MAP);
758 /* Update monsters */
759 p_ptr->update |= (PU_MONSTERS);
762 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
773 * Set "p_ptr->fast", notice observable changes
775 bool set_fast(int v, bool do_dec)
779 /* Hack -- Force good values */
780 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
782 if (death) return FALSE;
787 if (p_ptr->fast && !do_dec)
789 if (p_ptr->fast > v) return FALSE;
791 else if (!p_ptr->fast && !p_ptr->lightspeed)
794 msg_print("ÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
796 msg_print("You feel yourself moving much faster!");
800 chg_virtue(V_PATIENCE, -1);
801 chg_virtue(V_DILIGENCE, 1);
808 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))))
811 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
813 msg_print("You feel yourself slow down.");
823 /* Nothing to notice */
824 if (!notice) return (FALSE);
827 if (disturb_state) disturb(0, 0);
829 /* Recalculate bonuses */
830 p_ptr->update |= (PU_BONUS);
841 * Set "p_ptr->lightspeed", notice observable changes
843 bool set_lightspeed(int v, bool do_dec)
847 /* Hack -- Force good values */
848 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
850 if (death) return FALSE;
855 if (p_ptr->lightspeed && !do_dec)
857 if (p_ptr->lightspeed > v) return FALSE;
859 else if (!p_ptr->lightspeed)
862 msg_print("Èó¾ï¤ËÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
864 msg_print("You feel yourself moving faster!");
868 chg_virtue(V_PATIENCE, -1);
869 chg_virtue(V_DILIGENCE, 1);
876 if (p_ptr->lightspeed)
879 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
881 msg_print("You feel yourself slow down.");
889 p_ptr->lightspeed = v;
891 /* Nothing to notice */
892 if (!notice) return (FALSE);
895 if (disturb_state) disturb(0, 0);
897 /* Recalculate bonuses */
898 p_ptr->update |= (PU_BONUS);
909 * Set "p_ptr->slow", notice observable changes
911 bool set_slow(int v, bool do_dec)
915 /* Hack -- Force good values */
916 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
918 if (death) return FALSE;
923 if (p_ptr->slow && !do_dec)
925 if (p_ptr->slow > v) return FALSE;
927 else if (!p_ptr->slow)
930 msg_print("ÂΤÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
932 msg_print("You feel yourself moving slower!");
945 msg_print("Æ°¤¤ÎÃÙ¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
947 msg_print("You feel yourself speed up.");
957 /* Nothing to notice */
958 if (!notice) return (FALSE);
961 if (disturb_state) disturb(0, 0);
963 /* Recalculate bonuses */
964 p_ptr->update |= (PU_BONUS);
975 * Set "p_ptr->shield", notice observable changes
977 bool set_shield(int v, bool do_dec)
981 /* Hack -- Force good values */
982 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
984 if (death) return FALSE;
989 if (p_ptr->shield && !do_dec)
991 if (p_ptr->shield > v) return FALSE;
993 else if (!p_ptr->shield)
996 msg_print("È©¤¬ÀФˤʤä¿¡£");
998 msg_print("Your skin turns to stone.");
1011 msg_print("È©¤¬¸µ¤ËÌá¤Ã¤¿¡£");
1013 msg_print("Your skin returns to normal.");
1023 /* Redraw status bar */
1024 p_ptr->redraw |= (PR_STATUS);
1026 /* Nothing to notice */
1027 if (!notice) return (FALSE);
1030 if (disturb_state) disturb(0, 0);
1032 /* Recalculate bonuses */
1033 p_ptr->update |= (PU_BONUS);
1045 * Set "p_ptr->tsubureru", notice observable changes
1047 bool set_tsubureru(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 (death) return FALSE;
1059 if (p_ptr->tsubureru && !do_dec)
1061 if (p_ptr->tsubureru > v) return FALSE;
1063 else if (!p_ptr->tsubureru)
1066 msg_print("²£¤Ë¿¤Ó¤¿¡£");
1068 msg_print("You have expand horizontally.");
1078 if (p_ptr->tsubureru)
1081 msg_print("¤â¤¦²£¤Ë¿¤Ó¤Æ¤¤¤Ê¤¤¡£");
1083 msg_print("You are no longer expanded.");
1091 p_ptr->tsubureru = v;
1093 /* Redraw status bar */
1094 p_ptr->redraw |= (PR_STATUS);
1096 /* Nothing to notice */
1097 if (!notice) return (FALSE);
1100 if (disturb_state) disturb(0, 0);
1102 /* Recalculate bonuses */
1103 p_ptr->update |= (PU_BONUS);
1115 * Set "p_ptr->magicdef", notice observable changes
1117 bool set_magicdef(int v, bool do_dec)
1119 bool notice = FALSE;
1121 /* Hack -- Force good values */
1122 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1124 if (death) return FALSE;
1129 if (p_ptr->magicdef && !do_dec)
1131 if (p_ptr->magicdef > v) return FALSE;
1133 else if (!p_ptr->magicdef)
1136 msg_print("ËâË¡¤ÎËɸæÎϤ¬Áý¤·¤¿¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1138 msg_print("You feel your magical vulnerability diminish.");
1148 if (p_ptr->magicdef)
1151 msg_print("ËâË¡¤ÎËɸæÎϤ¬¸µ¤ËÌá¤Ã¤¿¡£");
1153 msg_print("Your magical defences fall to their normal values.");
1161 p_ptr->magicdef = v;
1163 /* Redraw status bar */
1164 p_ptr->redraw |= (PR_STATUS);
1166 /* Nothing to notice */
1167 if (!notice) return (FALSE);
1170 if (disturb_state) disturb(0, 0);
1172 /* Recalculate bonuses */
1173 p_ptr->update |= (PU_BONUS);
1185 * Set "p_ptr->blessed", notice observable changes
1187 bool set_blessed(int v, bool do_dec)
1189 bool notice = FALSE;
1191 /* Hack -- Force good values */
1192 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1194 if (death) return FALSE;
1199 if (p_ptr->blessed && !do_dec)
1201 if (p_ptr->blessed > v) return FALSE;
1203 else if (!p_ptr->blessed)
1206 msg_print("¹â·é¤Êµ¤Ê¬¤Ë¤Ê¤Ã¤¿¡ª");
1208 msg_print("You feel righteous!");
1218 if (p_ptr->blessed && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_BLESS)))
1221 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1223 msg_print("The prayer has expired.");
1233 /* Redraw status bar */
1234 p_ptr->redraw |= (PR_STATUS);
1236 /* Nothing to notice */
1237 if (!notice) return (FALSE);
1240 if (disturb_state) disturb(0, 0);
1242 /* Recalculate bonuses */
1243 p_ptr->update |= (PU_BONUS);
1254 * Set "p_ptr->hero", notice observable changes
1256 bool set_hero(int v, bool do_dec)
1258 bool notice = FALSE;
1260 /* Hack -- Force good values */
1261 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1263 if (death) return FALSE;
1268 if (p_ptr->hero && !do_dec)
1270 if (p_ptr->hero > v) return FALSE;
1272 else if (!p_ptr->hero)
1275 msg_print("¥Ò¡¼¥í¡¼¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1277 msg_print("You feel like a hero!");
1287 if (p_ptr->hero && ((p_ptr->pclass != CLASS_BARD) || ((p_ptr->magic_num1[0] != MUSIC_HERO) && (p_ptr->magic_num1[0] != MUSIC_SHERO))))
1290 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1292 msg_print("The heroism wears off.");
1302 /* Redraw status bar */
1303 p_ptr->redraw |= (PR_STATUS);
1305 /* Nothing to notice */
1306 if (!notice) return (FALSE);
1309 if (disturb_state) disturb(0, 0);
1311 /* Recalculate bonuses */
1312 p_ptr->update |= (PU_BONUS);
1314 /* Recalculate hitpoints */
1315 p_ptr->update |= (PU_HP);
1326 * Set "p_ptr->shero", notice observable changes
1328 bool set_shero(int v, bool do_dec)
1330 bool notice = FALSE;
1332 /* Hack -- Force good values */
1333 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1335 if (death) return FALSE;
1337 if (p_ptr->pclass == CLASS_BERSERKER) v = 1;
1341 if (p_ptr->shero && !do_dec)
1343 if (p_ptr->shero > v) return FALSE;
1345 else if (!p_ptr->shero)
1348 msg_print("»¦Ù¤¥Þ¥·¡¼¥ó¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1350 msg_print("You feel like a killing machine!");
1363 msg_print("ÌîÈڤʵ¤»ý¤Á¤¬¾Ã¤¨¼º¤»¤¿¡£");
1365 msg_print("You feel less Berserk.");
1375 /* Redraw status bar */
1376 p_ptr->redraw |= (PR_STATUS);
1378 /* Nothing to notice */
1379 if (!notice) return (FALSE);
1382 if (disturb_state) disturb(0, 0);
1384 /* Recalculate bonuses */
1385 p_ptr->update |= (PU_BONUS);
1387 /* Recalculate hitpoints */
1388 p_ptr->update |= (PU_HP);
1399 * Set "p_ptr->protevil", notice observable changes
1401 bool set_protevil(int v, bool do_dec)
1403 bool notice = FALSE;
1405 /* Hack -- Force good values */
1406 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1408 if (death) return FALSE;
1413 if (p_ptr->protevil && !do_dec)
1415 if (p_ptr->protevil > v) return FALSE;
1417 else if (!p_ptr->protevil)
1420 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Ê´¶¤¸¤¬¤¹¤ë¡ª");
1422 msg_print("You feel safe from evil!");
1432 if (p_ptr->protevil)
1435 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1437 msg_print("You no longer feel safe from evil.");
1445 p_ptr->protevil = v;
1447 /* Redraw status bar */
1448 p_ptr->redraw |= (PR_STATUS);
1450 /* Nothing to notice */
1451 if (!notice) return (FALSE);
1454 if (disturb_state) disturb(0, 0);
1464 * Set "p_ptr->wraith_form", notice observable changes
1466 bool set_wraith_form(int v, bool do_dec)
1468 bool notice = FALSE;
1470 /* Hack -- Force good values */
1471 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1473 if (death) return FALSE;
1478 if (p_ptr->wraith_form && !do_dec)
1480 if (p_ptr->wraith_form > v) return FALSE;
1482 else if (!p_ptr->wraith_form)
1485 msg_print("ʪ¼Á³¦¤òÎ¥¤ì¤ÆÍ©µ´¤Î¤è¤¦¤Ê¸ºß¤Ë¤Ê¤Ã¤¿¡ª");
1487 msg_print("You leave the physical world and turn into a wraith-being!");
1492 chg_virtue(V_UNLIFE, 3);
1493 chg_virtue(V_HONOUR, -2);
1494 chg_virtue(V_SACRIFICE, -2);
1495 chg_virtue(V_VALOUR, -5);
1498 p_ptr->redraw |= (PR_MAP);
1500 /* Update monsters */
1501 p_ptr->update |= (PU_MONSTERS);
1504 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1511 if (p_ptr->wraith_form)
1514 msg_print("ÉÔÆ©ÌÀ¤Ë¤Ê¤Ã¤¿´¶¤¸¤¬¤¹¤ë¡£");
1516 msg_print("You feel opaque.");
1522 p_ptr->redraw |= (PR_MAP);
1524 /* Update monsters */
1525 p_ptr->update |= (PU_MONSTERS);
1528 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1533 p_ptr->wraith_form = v;
1535 /* Redraw status bar */
1536 p_ptr->redraw |= (PR_STATUS);
1538 /* Nothing to notice */
1539 if (!notice) return (FALSE);
1542 if (disturb_state) disturb(0, 0);
1544 /* Recalculate bonuses */
1545 p_ptr->update |= (PU_BONUS);
1560 * Set "p_ptr->invuln", notice observable changes
1562 bool set_invuln(int v, bool do_dec)
1564 bool notice = FALSE;
1566 /* Hack -- Force good values */
1567 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1569 if (death) return FALSE;
1574 if (p_ptr->invuln && !do_dec)
1576 if (p_ptr->invuln > v) return FALSE;
1578 else if (!p_ptr->invuln)
1581 msg_print("̵Ũ¤À¡ª");
1583 msg_print("Invulnerability!");
1588 chg_virtue(V_UNLIFE, -2);
1589 chg_virtue(V_HONOUR, -2);
1590 chg_virtue(V_SACRIFICE, -3);
1591 chg_virtue(V_VALOUR, -5);
1594 p_ptr->redraw |= (PR_MAP);
1596 /* Update monsters */
1597 p_ptr->update |= (PU_MONSTERS);
1600 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1607 if (p_ptr->invuln && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_INVULN)))
1610 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
1612 msg_print("The invulnerability wears off.");
1618 p_ptr->redraw |= (PR_MAP);
1620 /* Update monsters */
1621 p_ptr->update |= (PU_MONSTERS);
1624 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1626 p_ptr->energy -= 100;
1633 /* Redraw status bar */
1634 p_ptr->redraw |= (PR_STATUS);
1636 /* Nothing to notice */
1637 if (!notice) return (FALSE);
1640 if (disturb_state) disturb(0, 0);
1642 /* Recalculate bonuses */
1643 p_ptr->update |= (PU_BONUS);
1654 * Set "p_ptr->tim_esp", notice observable changes
1656 bool set_tim_esp(int v, bool do_dec)
1658 bool notice = FALSE;
1660 /* Hack -- Force good values */
1661 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1663 if (death) return FALSE;
1668 if (p_ptr->tim_esp && !do_dec)
1670 if (p_ptr->tim_esp > v) return FALSE;
1672 else if (!p_ptr->tim_esp)
1675 msg_print("°Õ¼±¤¬¹¤¬¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1677 msg_print("You feel your consciousness expand!");
1687 if (p_ptr->tim_esp && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_MIND)))
1690 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
1692 msg_print("Your consciousness contracts again.");
1702 /* Redraw status bar */
1703 p_ptr->redraw |= (PR_STATUS);
1705 /* Nothing to notice */
1706 if (!notice) return (FALSE);
1709 if (disturb_state) disturb(0, 0);
1711 /* Recalculate bonuses */
1712 p_ptr->update |= (PU_BONUS);
1714 /* Update the monsters */
1715 p_ptr->update |= (PU_MONSTERS);
1726 * Set "p_ptr->tim_invis", notice observable changes
1728 bool set_tim_invis(int v, bool do_dec)
1730 bool notice = FALSE;
1732 /* Hack -- Force good values */
1733 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1735 if (death) return FALSE;
1740 if (p_ptr->tim_invis && !do_dec)
1742 if (p_ptr->tim_invis > v) return FALSE;
1744 else if (!p_ptr->tim_invis)
1747 msg_print("Ìܤ¬Èó¾ï¤ËÉÒ´¶¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1749 msg_print("Your eyes feel very sensitive!");
1759 if (p_ptr->tim_invis)
1762 msg_print("ÌܤÎÉÒ´¶¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1764 msg_print("Your eyes feel less sensitive.");
1772 p_ptr->tim_invis = v;
1774 /* Redraw status bar */
1775 p_ptr->redraw |= (PR_STATUS);
1777 /* Nothing to notice */
1778 if (!notice) return (FALSE);
1781 if (disturb_state) disturb(0, 0);
1783 /* Recalculate bonuses */
1784 p_ptr->update |= (PU_BONUS);
1786 /* Update the monsters */
1787 p_ptr->update |= (PU_MONSTERS);
1798 * Set "p_ptr->tim_infra", notice observable changes
1800 bool set_tim_infra(int v, bool do_dec)
1802 bool notice = FALSE;
1804 /* Hack -- Force good values */
1805 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1807 if (death) return FALSE;
1812 if (p_ptr->tim_infra && !do_dec)
1814 if (p_ptr->tim_infra > v) return FALSE;
1816 else if (!p_ptr->tim_infra)
1819 msg_print("Ìܤ¬¥é¥ó¥é¥ó¤Èµ±¤»Ï¤á¤¿¡ª");
1821 msg_print("Your eyes began to tingle!");
1831 if (p_ptr->tim_infra)
1834 msg_print("Ìܤ層¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1836 msg_print("Your eyes stop tingling.");
1844 p_ptr->tim_infra = v;
1846 /* Redraw status bar */
1847 p_ptr->redraw |= (PR_STATUS);
1849 /* Nothing to notice */
1850 if (!notice) return (FALSE);
1853 if (disturb_state) disturb(0, 0);
1855 /* Recalculate bonuses */
1856 p_ptr->update |= (PU_BONUS);
1858 /* Update the monsters */
1859 p_ptr->update |= (PU_MONSTERS);
1870 * Set "p_ptr->tim_regen", notice observable changes
1872 bool set_tim_regen(int v, bool do_dec)
1874 bool notice = FALSE;
1876 /* Hack -- Force good values */
1877 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1879 if (death) return FALSE;
1884 if (p_ptr->tim_regen && !do_dec)
1886 if (p_ptr->tim_regen > v) return FALSE;
1888 else if (!p_ptr->tim_regen)
1891 msg_print("²óÉüÎϤ¬¾å¤¬¤Ã¤¿¡ª");
1893 msg_print("You began to regenerate quicker!");
1903 if (p_ptr->tim_regen)
1906 msg_print("ÁÇÁ᤯²óÉü¤¹¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1908 msg_print("You no longer regenerate quicker.");
1916 p_ptr->tim_regen = v;
1918 /* Redraw status bar */
1919 p_ptr->redraw |= (PR_STATUS);
1921 /* Nothing to notice */
1922 if (!notice) return (FALSE);
1925 if (disturb_state) disturb(0, 0);
1927 /* Recalculate bonuses */
1928 p_ptr->update |= (PU_BONUS);
1939 * Set "p_ptr->tim_stealth", notice observable changes
1941 bool set_tim_stealth(int v, bool do_dec)
1943 bool notice = FALSE;
1945 /* Hack -- Force good values */
1946 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1948 if (death) return FALSE;
1953 if (p_ptr->tim_stealth && !do_dec)
1955 if (p_ptr->tim_stealth > v) return FALSE;
1957 else if (!p_ptr->tim_stealth)
1960 msg_print("²»¤¬¾®¤µ¤¯¤Ê¤Ã¤¿¡ª");
1962 msg_print("You began to walk silently!");
1972 if (p_ptr->tim_stealth && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_STEALTH)))
1975 msg_print("²»¤¬Â礤¯¤Ê¤Ã¤¿¡£");
1977 msg_print("You no longer walk silently.");
1985 p_ptr->tim_stealth = v;
1987 /* Redraw status bar */
1988 p_ptr->redraw |= (PR_STATUS);
1990 /* Nothing to notice */
1991 if (!notice) return (FALSE);
1994 if (disturb_state) disturb(0, 0);
1996 /* Recalculate bonuses */
1997 p_ptr->update |= (PU_BONUS);
2007 bool set_superstealth(bool set)
2009 bool notice = FALSE;
2011 if (death) return FALSE;
2016 if (!(p_ptr->special_defense & NINJA_S_STEALTH))
2018 if (cave[py][px].info & CAVE_MNLT)
2021 msg_print("Ũ¤ÎÌܤ«¤éÇö¤¤±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡£");
2023 msg_print("You are mantled in weak shadow from ordinary eyes.");
2025 p_ptr->monlite = p_ptr->old_monlite = TRUE;
2030 msg_print("Ũ¤ÎÌܤ«¤é±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡ª");
2032 msg_print("You are mantled in shadow from ordinary eyes!");
2034 p_ptr->monlite = p_ptr->old_monlite = FALSE;
2040 p_ptr->special_defense |= NINJA_S_STEALTH;
2047 if (p_ptr->special_defense & NINJA_S_STEALTH)
2050 msg_print("ºÆ¤ÓŨ¤ÎÌܤˤµ¤é¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
2052 msg_print("You are exposed to common sight once more.");
2058 p_ptr->special_defense &= ~(NINJA_S_STEALTH);
2062 /* Nothing to notice */
2063 if (!notice) return (FALSE);
2065 /* Redraw status bar */
2066 p_ptr->redraw |= (PR_STATUS);
2069 if (disturb_state) disturb(0, 0);
2077 * Set "p_ptr->tim_ffall", notice observable changes
2079 bool set_tim_ffall(int v, bool do_dec)
2081 bool notice = FALSE;
2083 /* Hack -- Force good values */
2084 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2086 if (death) return FALSE;
2091 if (p_ptr->tim_ffall && !do_dec)
2093 if (p_ptr->tim_ffall > v) return FALSE;
2095 else if (!p_ptr->tim_ffall)
2098 msg_print("ÂΤ¬Ãè¤ËÉ⤻Ϥ᤿¡£");
2100 msg_print("You began to fly!");
2110 if (p_ptr->tim_ffall)
2113 msg_print("¤â¤¦Ãè¤ËÉ⤫¤Ù¤Ê¤¯¤Ê¤Ã¤¿¡£");
2115 msg_print("You no longer flying.");
2123 p_ptr->tim_ffall = v;
2125 /* Redraw status bar */
2126 p_ptr->redraw |= (PR_STATUS);
2128 /* Nothing to notice */
2129 if (!notice) return (FALSE);
2132 if (disturb_state) disturb(0, 0);
2134 /* Recalculate bonuses */
2135 p_ptr->update |= (PU_BONUS);
2146 * Set "p_ptr->tim_sh_touki", notice observable changes
2148 bool set_tim_sh_touki(int v, bool do_dec)
2150 bool notice = FALSE;
2152 /* Hack -- Force good values */
2153 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2155 if (death) return FALSE;
2160 if (p_ptr->tim_sh_touki && !do_dec)
2162 if (p_ptr->tim_sh_touki > v) return FALSE;
2164 else if (!p_ptr->tim_sh_touki)
2167 msg_print("ÂΤ¬Æ®µ¤¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2169 msg_print("You have enveloped by energy aura!");
2179 if (p_ptr->tim_sh_touki)
2182 msg_print("Æ®µ¤¤¬¾Ã¤¨¤¿¡£");
2184 msg_print("Aura of Force disappeared.");
2192 p_ptr->tim_sh_touki = v;
2194 /* Redraw status bar */
2195 p_ptr->redraw |= (PR_STATUS);
2197 /* Nothing to notice */
2198 if (!notice) return (FALSE);
2201 if (disturb_state) disturb(0, 0);
2212 * Set "p_ptr->tim_sh_fire", notice observable changes
2214 bool set_tim_sh_fire(int v, bool do_dec)
2216 bool notice = FALSE;
2218 /* Hack -- Force good values */
2219 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2221 if (death) return FALSE;
2226 if (p_ptr->tim_sh_fire && !do_dec)
2228 if (p_ptr->tim_sh_fire > v) return FALSE;
2230 else if (!p_ptr->tim_sh_fire)
2233 msg_print("ÂΤ¬±ê¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2235 msg_print("You have enveloped by fiery aura!");
2245 if (p_ptr->tim_sh_fire)
2248 msg_print("±ê¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2250 msg_print("Fiery aura disappeared.");
2258 p_ptr->tim_sh_fire = v;
2260 /* Redraw status bar */
2261 p_ptr->redraw |= (PR_STATUS);
2263 /* Nothing to notice */
2264 if (!notice) return (FALSE);
2267 if (disturb_state) disturb(0, 0);
2269 /* Recalculate bonuses */
2270 p_ptr->update |= (PU_BONUS);
2281 * Set "p_ptr->resist_magic", notice observable changes
2283 bool set_resist_magic(int v, bool do_dec)
2285 bool notice = FALSE;
2287 /* Hack -- Force good values */
2288 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2290 if (death) return FALSE;
2295 if (p_ptr->resist_magic && !do_dec)
2297 if (p_ptr->resist_magic > v) return FALSE;
2299 else if (!p_ptr->resist_magic)
2302 msg_print("ËâË¡¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿¡£");
2304 msg_print("You have been protected from magic!");
2314 if (p_ptr->resist_magic)
2317 msg_print("ËâË¡¤Ë¼å¤¯¤Ê¤Ã¤¿¡£");
2319 msg_print("You are no longer protected from magic.");
2327 p_ptr->resist_magic = v;
2329 /* Redraw status bar */
2330 p_ptr->redraw |= (PR_STATUS);
2332 /* Nothing to notice */
2333 if (!notice) return (FALSE);
2336 if (disturb_state) disturb(0, 0);
2338 /* Recalculate bonuses */
2339 p_ptr->update |= (PU_BONUS);
2350 * Set "p_ptr->tim_reflect", notice observable changes
2352 bool set_tim_reflect(int v, bool do_dec)
2354 bool notice = FALSE;
2356 /* Hack -- Force good values */
2357 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2359 if (death) return FALSE;
2364 if (p_ptr->tim_reflect && !do_dec)
2366 if (p_ptr->tim_reflect > v) return FALSE;
2368 else if (!p_ptr->tim_reflect)
2371 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2373 msg_print("Your body becames smooth.");
2383 if (p_ptr->tim_reflect)
2386 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ç¤Ê¤¯¤Ê¤Ã¤¿¡£");
2388 msg_print("Your body is no longer smooth.");
2396 p_ptr->tim_reflect = v;
2398 /* Redraw status bar */
2399 p_ptr->redraw |= (PR_STATUS);
2401 /* Nothing to notice */
2402 if (!notice) return (FALSE);
2405 if (disturb_state) disturb(0, 0);
2407 /* Recalculate bonuses */
2408 p_ptr->update |= (PU_BONUS);
2419 * Set "p_ptr->multishadow", notice observable changes
2421 bool set_multishadow(int v, bool do_dec)
2423 bool notice = FALSE;
2425 /* Hack -- Force good values */
2426 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2428 if (death) return FALSE;
2433 if (p_ptr->multishadow && !do_dec)
2435 if (p_ptr->multishadow > v) return FALSE;
2437 else if (!p_ptr->multishadow)
2440 msg_print("¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¸¸±Æ¤¬À¸¤Þ¤ì¤¿¡£");
2442 msg_print("Your Shadow enveloped you.");
2452 if (p_ptr->multishadow)
2455 msg_print("¸¸±Æ¤¬¾Ã¤¨¤¿¡£");
2457 msg_print("Your Shadow disappears.");
2465 p_ptr->multishadow = v;
2467 /* Redraw status bar */
2468 p_ptr->redraw |= (PR_STATUS);
2470 /* Nothing to notice */
2471 if (!notice) return (FALSE);
2474 if (disturb_state) disturb(0, 0);
2476 /* Recalculate bonuses */
2477 p_ptr->update |= (PU_BONUS);
2488 * Set "p_ptr->dustrobe", notice observable changes
2490 bool set_dustrobe(int v, bool do_dec)
2492 bool notice = FALSE;
2494 /* Hack -- Force good values */
2495 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2497 if (death) return FALSE;
2502 if (p_ptr->dustrobe && !do_dec)
2504 if (p_ptr->dustrobe > v) return FALSE;
2506 else if (!p_ptr->dustrobe)
2509 msg_print("ÂΤ¬¶À¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2511 msg_print("You were enveloped by mirror shards.");
2521 if (p_ptr->dustrobe)
2524 msg_print("¶À¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2526 msg_print("The mirror shards disappear.");
2534 p_ptr->dustrobe = v;
2536 /* Redraw status bar */
2537 p_ptr->redraw |= (PR_STATUS);
2539 /* Nothing to notice */
2540 if (!notice) return (FALSE);
2543 if (disturb_state) disturb(0, 0);
2545 /* Recalculate bonuses */
2546 p_ptr->update |= (PU_BONUS);
2557 * Set "p_ptr->tim_regen", notice observable changes
2559 bool set_kabenuke(int v, bool do_dec)
2561 bool notice = FALSE;
2563 /* Hack -- Force good values */
2564 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2566 if (death) return FALSE;
2571 if (p_ptr->kabenuke && !do_dec)
2573 if (p_ptr->kabenuke > v) return FALSE;
2575 else if (!p_ptr->kabenuke)
2578 msg_print("ÂΤ¬È¾Êª¼Á¤Î¾õÂ֤ˤʤä¿¡£");
2580 msg_print("You became ethereal form.");
2590 if (p_ptr->kabenuke)
2593 msg_print("ÂΤ¬Êª¼Á²½¤·¤¿¡£");
2595 msg_print("You are no longer in an ethereal form.");
2603 p_ptr->kabenuke = v;
2605 /* Redraw status bar */
2606 p_ptr->redraw |= (PR_STATUS);
2608 /* Nothing to notice */
2609 if (!notice) return (FALSE);
2612 if (disturb_state) disturb(0, 0);
2622 bool set_tsuyoshi(int v, bool do_dec)
2624 bool notice = FALSE;
2626 /* Hack -- Force good values */
2627 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2629 if (death) return FALSE;
2634 if (p_ptr->tsuyoshi && !do_dec)
2636 if (p_ptr->tsuyoshi > v) return FALSE;
2638 else if (!p_ptr->tsuyoshi)
2641 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
2643 msg_print("Brother OKURE!");
2647 chg_virtue(V_VITALITY, 2);
2654 if (p_ptr->tsuyoshi)
2657 msg_print("ÆùÂΤ¬µÞ®¤Ë¤·¤Ü¤ó¤Ç¤¤¤Ã¤¿¡£");
2659 msg_print("Your body had quickly shriveled.");
2662 (void)dec_stat(A_CON, 20, TRUE);
2663 (void)dec_stat(A_STR, 20, TRUE);
2666 chg_virtue(V_VITALITY, -3);
2671 p_ptr->tsuyoshi = v;
2673 /* Redraw status bar */
2674 p_ptr->redraw |= (PR_STATUS);
2676 /* Nothing to notice */
2677 if (!notice) return (FALSE);
2680 if (disturb_state) disturb(0, 0);
2682 /* Recalculate bonuses */
2683 p_ptr->update |= (PU_BONUS);
2685 /* Recalculate hitpoints */
2686 p_ptr->update |= (PU_HP);
2697 * Set a temporary elemental brand. Clear all other brands. Print status
2700 bool set_ele_attack(u32b attack_type, int v)
2702 /* Hack -- Force good values */
2703 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2705 /* Clear all elemental attacks (only one is allowed at a time). */
2706 if ((p_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
2708 p_ptr->special_attack &= ~(ATTACK_ACID);
2710 msg_print("»À¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2712 msg_print("Your temporary acidic brand fades away.");
2715 if ((p_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
2717 p_ptr->special_attack &= ~(ATTACK_ELEC);
2719 msg_print("ÅÅ·â¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2721 msg_print("Your temporary electrical brand fades away.");
2724 if ((p_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
2726 p_ptr->special_attack &= ~(ATTACK_FIRE);
2728 msg_print("²Ð±ê¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2730 msg_print("Your temporary fiery brand fades away.");
2733 if ((p_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
2735 p_ptr->special_attack &= ~(ATTACK_COLD);
2737 msg_print("Î䵤¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2739 msg_print("Your temporary frost brand fades away.");
2742 if ((p_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
2744 p_ptr->special_attack &= ~(ATTACK_POIS);
2746 msg_print("ÆǤǹ¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2748 msg_print("Your temporary poison brand fades away.");
2752 if ((v) && (attack_type))
2754 /* Set attack type. */
2755 p_ptr->special_attack |= (attack_type);
2758 p_ptr->ele_attack = v;
2762 msg_format("%s¤Ç¹¶·â¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª",
2763 ((attack_type == ATTACK_ACID) ? "»À" :
2764 ((attack_type == ATTACK_ELEC) ? "ÅÅ·â" :
2765 ((attack_type == ATTACK_FIRE) ? "²Ð±ê" :
2766 ((attack_type == ATTACK_COLD) ? "Î䵤" :
2767 ((attack_type == ATTACK_POIS) ? "ÆÇ" :
2770 msg_format("For a while, the blows you deal will %s",
2771 ((attack_type == ATTACK_ACID) ? "melt with acid!" :
2772 ((attack_type == ATTACK_ELEC) ? "shock your foes!" :
2773 ((attack_type == ATTACK_FIRE) ? "burn with fire!" :
2774 ((attack_type == ATTACK_COLD) ? "chill to the bone!" :
2775 ((attack_type == ATTACK_POIS) ? "poison your enemies!" :
2776 "do nothing special."))))));
2781 if (disturb_state) disturb(0, 0);
2783 /* Redraw status bar */
2784 p_ptr->redraw |= (PR_STATUS);
2786 p_ptr->update |= (PU_BONUS);
2796 * Set a temporary elemental brand. Clear all other brands. Print status
2799 bool set_ele_immune(u32b immune_type, int v)
2801 /* Hack -- Force good values */
2802 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2804 /* Clear all elemental attacks (only one is allowed at a time). */
2805 if ((p_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
2807 p_ptr->special_defense &= ~(DEFENSE_ACID);
2809 msg_print("»À¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2811 msg_print("You are no longer immune to acid.");
2814 if ((p_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
2816 p_ptr->special_defense &= ~(DEFENSE_ELEC);
2818 msg_print("ÅÅ·â¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2820 msg_print("You are no longer immune to electricity.");
2823 if ((p_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
2825 p_ptr->special_defense &= ~(DEFENSE_FIRE);
2827 msg_print("²Ð±ê¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2829 msg_print("You are no longer immune to fire.");
2832 if ((p_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
2834 p_ptr->special_defense &= ~(DEFENSE_COLD);
2836 msg_print("Î䵤¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2838 msg_print("You are no longer immune to cold.");
2841 if ((p_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
2843 p_ptr->special_defense &= ~(DEFENSE_POIS);
2845 msg_print("ÆǤι¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2847 msg_print("You are no longer immune to poison.");
2851 if ((v) && (immune_type))
2853 /* Set attack type. */
2854 p_ptr->special_defense |= (immune_type);
2857 p_ptr->ele_immune = v;
2861 msg_format("%s¤Î¹¶·â¤ò¼õ¤±¤Ä¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª",
2862 ((immune_type == DEFENSE_ACID) ? "»À" :
2863 ((immune_type == DEFENSE_ELEC) ? "ÅÅ·â" :
2864 ((immune_type == DEFENSE_FIRE) ? "²Ð±ê" :
2865 ((immune_type == DEFENSE_COLD) ? "Î䵤" :
2866 ((immune_type == DEFENSE_POIS) ? "ÆÇ" :
2869 msg_format("For a while, You are immune to %s",
2870 ((immune_type == DEFENSE_ACID) ? "acid!" :
2871 ((immune_type == DEFENSE_ELEC) ? "electricity!" :
2872 ((immune_type == DEFENSE_FIRE) ? "fire!" :
2873 ((immune_type == DEFENSE_COLD) ? "cold!" :
2874 ((immune_type == DEFENSE_POIS) ? "poison!" :
2875 "do nothing special."))))));
2880 if (disturb_state) disturb(0, 0);
2882 /* Redraw status bar */
2883 p_ptr->redraw |= (PR_STATUS);
2885 p_ptr->update |= (PU_BONUS);
2895 * Set "p_ptr->oppose_acid", notice observable changes
2897 bool set_oppose_acid(int v, bool do_dec)
2899 bool notice = FALSE;
2901 /* Hack -- Force good values */
2902 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2904 if (death) return FALSE;
2909 if (p_ptr->oppose_acid && !do_dec)
2911 if (p_ptr->oppose_acid > v) return FALSE;
2913 else if (!p_ptr->oppose_acid)
2916 msg_print("»À¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
2918 msg_print("You feel resistant to acid!");
2928 if (p_ptr->oppose_acid && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
2931 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
2933 msg_print("You feel less resistant to acid.");
2941 p_ptr->oppose_acid = v;
2943 /* Nothing to notice */
2944 if (!notice) return (FALSE);
2946 /* Redraw status bar */
2947 p_ptr->redraw |= (PR_STATUS);
2950 if (disturb_state) disturb(0, 0);
2961 * Set "p_ptr->oppose_elec", notice observable changes
2963 bool set_oppose_elec(int v, bool do_dec)
2965 bool notice = FALSE;
2967 /* Hack -- Force good values */
2968 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2970 if (death) return FALSE;
2975 if (p_ptr->oppose_elec && !do_dec)
2977 if (p_ptr->oppose_elec > v) return FALSE;
2979 else if (!p_ptr->oppose_elec)
2982 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
2984 msg_print("You feel resistant to electricity!");
2994 if (p_ptr->oppose_elec && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
2997 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
2999 msg_print("You feel less resistant to electricity.");
3007 p_ptr->oppose_elec = v;
3009 /* Nothing to notice */
3010 if (!notice) return (FALSE);
3012 /* Redraw status bar */
3013 p_ptr->redraw |= (PR_STATUS);
3016 if (disturb_state) disturb(0, 0);
3027 * Set "p_ptr->oppose_fire", notice observable changes
3029 bool set_oppose_fire(int v, bool do_dec)
3031 bool notice = FALSE;
3033 /* Hack -- Force good values */
3034 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3036 if (death) return FALSE;
3038 if ((prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
3042 if (p_ptr->oppose_fire && !do_dec)
3044 if (p_ptr->oppose_fire > v) return FALSE;
3046 else if (!p_ptr->oppose_fire)
3049 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3051 msg_print("You feel resistant to fire!");
3061 if (p_ptr->oppose_fire && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3064 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3066 msg_print("You feel less resistant to fire.");
3074 p_ptr->oppose_fire = v;
3076 /* Nothing to notice */
3077 if (!notice) return (FALSE);
3079 /* Redraw status bar */
3080 p_ptr->redraw |= (PR_STATUS);
3083 if (disturb_state) disturb(0, 0);
3094 * Set "p_ptr->oppose_cold", notice observable changes
3096 bool set_oppose_cold(int v, bool do_dec)
3098 bool notice = FALSE;
3100 /* Hack -- Force good values */
3101 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3103 if (death) return FALSE;
3108 if (p_ptr->oppose_cold && !do_dec)
3110 if (p_ptr->oppose_cold > v) return FALSE;
3112 else if (!p_ptr->oppose_cold)
3115 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3117 msg_print("You feel resistant to cold!");
3127 if (p_ptr->oppose_cold && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3130 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3132 msg_print("You feel less resistant to cold.");
3140 p_ptr->oppose_cold = v;
3142 /* Nothing to notice */
3143 if (!notice) return (FALSE);
3145 /* Redraw status bar */
3146 p_ptr->redraw |= (PR_STATUS);
3149 if (disturb_state) disturb(0, 0);
3160 * Set "p_ptr->oppose_pois", notice observable changes
3162 bool set_oppose_pois(int v, bool do_dec)
3164 bool notice = FALSE;
3166 /* Hack -- Force good values */
3167 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3169 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) v = 1;
3170 if (death) return FALSE;
3175 if (p_ptr->oppose_pois && !do_dec)
3177 if (p_ptr->oppose_pois > v) return FALSE;
3179 else if (!p_ptr->oppose_pois)
3182 msg_print("ÆǤؤÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3184 msg_print("You feel resistant to poison!");
3194 if (p_ptr->oppose_pois && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3197 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3199 msg_print("You feel less resistant to poison.");
3207 p_ptr->oppose_pois = v;
3209 /* Nothing to notice */
3210 if (!notice) return (FALSE);
3212 /* Redraw status bar */
3213 p_ptr->redraw |= (PR_STATUS);
3216 if (disturb_state) disturb(0, 0);
3227 * Set "p_ptr->stun", notice observable changes
3229 * Note the special code to only notice "range" changes.
3231 bool set_stun(int v)
3233 int old_aux, new_aux;
3234 bool notice = FALSE;
3237 /* Hack -- Force good values */
3238 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3240 if (death) return FALSE;
3242 if (prace_is_(RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
3245 if (p_ptr->stun > 100)
3251 else if (p_ptr->stun > 50)
3257 else if (p_ptr->stun > 0)
3293 if (new_aux > old_aux)
3295 /* Describe the state */
3301 msg_print("°Õ¼±¤¬¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3303 msg_print("You have been stunned.");
3311 msg_print("°Õ¼±¤¬¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3313 msg_print("You have been heavily stunned.");
3321 msg_print("Ƭ¤¬¥¯¥é¥¯¥é¤·¤Æ°Õ¼±¤¬±ó¤Î¤¤¤Æ¤¤¿¡£");
3323 msg_print("You have been knocked out.");
3329 if (randint(1000) < v || randint(16) == 1)
3332 msg_print("³ä¤ì¤ë¤è¤¦¤ÊƬÄˤ¬¤¹¤ë¡£");
3334 msg_print("A vicious blow hits your head.");
3337 if (randint(3) == 1)
3339 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3340 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3342 else if (randint(2) == 1)
3344 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3348 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3351 if (p_ptr->special_defense & KATA_MASK)
3354 msg_print("·¿¤¬Êø¤ì¤¿¡£");
3356 msg_print("Your posture gets loose.");
3358 p_ptr->special_defense &= ~(KATA_MASK);
3359 p_ptr->update |= (PU_BONUS);
3360 p_ptr->update |= (PU_MONSTERS);
3361 p_ptr->redraw |= (PR_STATE);
3362 p_ptr->redraw |= (PR_STATUS);
3363 p_ptr->action = ACTION_NONE;
3371 else if (new_aux < old_aux)
3373 /* Describe the state */
3379 msg_print("¤ä¤Ã¤ÈÛ¯Û°¾õÂÖ¤«¤é²óÉü¤·¤¿¡£");
3381 msg_print("You are no longer stunned.");
3384 if (disturb_state) disturb(0, 0);
3396 if (!notice) return (FALSE);
3399 if (disturb_state) disturb(0, 0);
3401 /* Recalculate bonuses */
3402 p_ptr->update |= (PU_BONUS);
3404 /* Redraw the "stun" */
3405 p_ptr->redraw |= (PR_STUN);
3416 * Set "p_ptr->cut", notice observable changes
3418 * Note the special code to only notice "range" changes.
3422 int old_aux, new_aux;
3423 bool notice = FALSE;
3425 /* Hack -- Force good values */
3426 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3428 if (death) return FALSE;
3430 if ((p_ptr->prace == RACE_GOLEM ||
3431 p_ptr->prace == RACE_SKELETON ||
3432 p_ptr->prace == RACE_SPECTRE ||
3433 (p_ptr->prace == RACE_ZOMBIE && p_ptr->lev > 11)) &&
3438 if (p_ptr->cut > 1000)
3444 else if (p_ptr->cut > 200)
3450 else if (p_ptr->cut > 100)
3456 else if (p_ptr->cut > 50)
3462 else if (p_ptr->cut > 25)
3468 else if (p_ptr->cut > 10)
3474 else if (p_ptr->cut > 0)
3534 if (new_aux > old_aux)
3536 /* Describe the state */
3542 msg_print("¤«¤¹¤ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3544 msg_print("You have been given a graze.");
3552 msg_print("·Ú¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3554 msg_print("You have been given a light cut.");
3562 msg_print("¤Ò¤É¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3564 msg_print("You have been given a bad cut.");
3572 msg_print("ÂçÊѤʽý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3574 msg_print("You have been given a nasty cut.");
3582 msg_print("½ÅÂç¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3584 msg_print("You have been given a severe cut.");
3592 msg_print("¤Ò¤É¤¤¿¼¼ê¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3594 msg_print("You have been given a deep gash.");
3602 msg_print("Ã×̿Ū¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3604 msg_print("You have been given a mortal wound.");
3613 if (randint(1000) < v || randint(16) == 1)
3615 if (!p_ptr->sustain_chr)
3618 msg_print("¤Ò¤É¤¤½ýÀפ¬»Ä¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3620 msg_print("You have been horribly scarred.");
3630 else if (new_aux < old_aux)
3632 /* Describe the state */
3638 msg_format("¤ä¤Ã¤È%s¡£", p_ptr->prace == RACE_ANDROID ? "²ø²æ¤¬Ä¾¤Ã¤¿" : "½Ð·ì¤¬»ß¤Þ¤Ã¤¿");
3640 msg_print("You are no longer bleeding.");
3643 if (disturb_state) disturb(0, 0);
3655 if (!notice) return (FALSE);
3658 if (disturb_state) disturb(0, 0);
3660 /* Recalculate bonuses */
3661 p_ptr->update |= (PU_BONUS);
3663 /* Redraw the "cut" */
3664 p_ptr->redraw |= (PR_CUT);
3675 * Set "p_ptr->food", notice observable changes
3677 * The "p_ptr->food" variable can get as large as 20000, allowing the
3678 * addition of the most "filling" item, Elvish Waybread, which adds
3679 * 7500 food units, without overflowing the 32767 maximum limit.
3681 * Perhaps we should disturb the player with various messages,
3682 * especially messages about hunger status changes. XXX XXX XXX
3684 * Digestion of food is handled in "dungeon.c", in which, normally,
3685 * the player digests about 20 food units per 100 game turns, more
3686 * when "fast", more when "regenerating", less with "slow digestion",
3687 * but when the player is "gorged", he digests 100 food units per 10
3688 * game turns, or a full 1000 food units per 100 game turns.
3690 * Note that the player's speed is reduced by 10 units while gorged,
3691 * so if the player eats a single food ration (5000 food units) when
3692 * full (15000 food units), he will be gorged for (5000/100)*10 = 500
3693 * game turns, or 500/(100/5) = 25 player turns (if nothing else is
3694 * affecting the player speed).
3696 bool set_food(int v)
3698 int old_aux, new_aux;
3700 bool notice = FALSE;
3702 /* Hack -- Force good values */
3703 v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
3705 /* Fainting / Starving */
3706 if (p_ptr->food < PY_FOOD_FAINT)
3712 else if (p_ptr->food < PY_FOOD_WEAK)
3718 else if (p_ptr->food < PY_FOOD_ALERT)
3724 else if (p_ptr->food < PY_FOOD_FULL)
3730 else if (p_ptr->food < PY_FOOD_MAX)
3741 /* Fainting / Starving */
3742 if (v < PY_FOOD_FAINT)
3748 else if (v < PY_FOOD_WEAK)
3754 else if (v < PY_FOOD_ALERT)
3760 else if (v < PY_FOOD_FULL)
3766 else if (v < PY_FOOD_MAX)
3777 if (old_aux < 1 && new_aux > 0)
3778 chg_virtue(V_PATIENCE, 2);
3779 else if (old_aux < 3 && (old_aux != new_aux))
3780 chg_virtue(V_PATIENCE, 1);
3782 chg_virtue(V_TEMPERANCE, 1);
3784 chg_virtue(V_TEMPERANCE, -1);
3787 if (new_aux > old_aux)
3789 /* Describe the state */
3795 msg_print("¤Þ¤À¶õÊ¢¤ÇÅݤ줽¤¦¤À¡£");
3797 msg_print("You are still weak.");
3805 msg_print("¤Þ¤À¶õÊ¢¤À¡£");
3807 msg_print("You are still hungry.");
3815 msg_print("¶õÊ¢´¶¤¬¤ª¤µ¤Þ¤Ã¤¿¡£");
3817 msg_print("You are no longer hungry.");
3825 msg_print("ËþÊ¢¤À¡ª");
3827 msg_print("You are full!");
3835 msg_print("¿©¤Ù²á¤®¤À¡ª");
3837 msg_print("You have gorged yourself!");
3839 chg_virtue(V_HARMONY, -1);
3840 chg_virtue(V_PATIENCE, -1);
3841 chg_virtue(V_TEMPERANCE, -2);
3851 else if (new_aux < old_aux)
3853 /* Describe the state */
3856 /* Fainting / Starving */
3859 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
3861 msg_print("You are getting faint from hunger!");
3869 msg_print("¤ªÊ¢¤¬¶õ¤¤¤ÆÅݤ줽¤¦¤À¡£");
3871 msg_print("You are getting weak from hunger!");
3879 msg_print("¤ªÊ¢¤¬¶õ¤¤¤Æ¤¤¿¡£");
3881 msg_print("You are getting hungry.");
3889 msg_print("ËþÊ¢´¶¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
3891 msg_print("You are no longer full.");
3899 msg_print("¤ä¤Ã¤È¤ªÊ¢¤¬¤¤Ä¤¯¤Ê¤¯¤Ê¤Ã¤¿¡£");
3901 msg_print("You are no longer gorged.");
3907 if (p_ptr->wild_mode && (new_aux < 2))
3909 p_ptr->wilderness_x = px;
3910 p_ptr->wilderness_y = py;
3911 p_ptr->energy = 100;
3922 /* Nothing to notice */
3923 if (!notice) return (FALSE);
3926 if (disturb_state) disturb(0, 0);
3928 /* Recalculate bonuses */
3929 p_ptr->update |= (PU_BONUS);
3932 p_ptr->redraw |= (PR_HUNGER);
3942 * Increases a stat by one randomized level -RAK-
3944 * Note that this function (used by stat potions) now restores
3945 * the stat BEFORE increasing it.
3947 bool inc_stat(int stat)
3951 /* Then augment the current/max stat */
3952 value = p_ptr->stat_cur[stat];
3954 /* Cannot go above 18/100 */
3955 if (value < p_ptr->stat_max_max[stat])
3957 /* Gain one (sometimes two) points */
3960 gain = ((rand_int(100) < 75) ? 1 : 2);
3964 /* Gain 1/6 to 1/3 of distance to 18/100 */
3965 else if (value < (p_ptr->stat_max_max[stat]-2))
3967 /* Approximate gain value */
3968 gain = (((p_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
3971 if (gain < 1) gain = 1;
3973 /* Apply the bonus */
3974 value += randint(gain) + gain / 2;
3977 if (value > (p_ptr->stat_max_max[stat]-1)) value = p_ptr->stat_max_max[stat]-1;
3980 /* Gain one point at a time */
3986 /* Save the new value */
3987 p_ptr->stat_cur[stat] = value;
3989 /* Bring up the maximum too */
3990 if (value > p_ptr->stat_max[stat])
3992 p_ptr->stat_max[stat] = value;
3995 /* Recalculate bonuses */
3996 p_ptr->update |= (PU_BONUS);
4002 /* Nothing to gain */
4009 * Decreases a stat by an amount indended to vary from 0 to 100 percent.
4011 * Amount could be a little higher in extreme cases to mangle very high
4012 * stats from massive assaults. -CWS
4014 * Note that "permanent" means that the *given* amount is permanent,
4015 * not that the new value becomes permanent. This may not work exactly
4016 * as expected, due to "weirdness" in the algorithm, but in general,
4017 * if your stat is already drained, the "max" value will not drop all
4018 * the way down to the "cur" value.
4020 bool dec_stat(int stat, int amount, int permanent)
4022 int cur, max, loss, same, res = FALSE;
4025 /* Acquire current value */
4026 cur = p_ptr->stat_cur[stat];
4027 max = p_ptr->stat_max[stat];
4029 /* Note when the values are identical */
4030 same = (cur == max);
4032 /* Damage "current" value */
4035 /* Handle "low" values */
4038 if (amount > 90) cur--;
4039 if (amount > 50) cur--;
4040 if (amount > 20) cur--;
4044 /* Handle "high" values */
4047 /* Hack -- Decrement by a random amount between one-quarter */
4048 /* and one-half of the stat bonus times the percentage, with a */
4049 /* minimum damage of half the percentage. -CWS */
4050 loss = (((cur-18) / 2 + 1) / 2 + 1);
4053 if (loss < 1) loss = 1;
4055 /* Randomize the loss */
4056 loss = ((randint(loss) + loss) * amount) / 100;
4059 if (loss < amount/2) loss = amount/2;
4061 /* Lose some points */
4064 /* Hack -- Only reduce stat to 17 sometimes */
4065 if (cur < 18) cur = (amount <= 20) ? 18 : 17;
4068 /* Prevent illegal values */
4069 if (cur < 3) cur = 3;
4071 /* Something happened */
4072 if (cur != p_ptr->stat_cur[stat]) res = TRUE;
4075 /* Damage "max" value */
4076 if (permanent && (max > 3))
4078 chg_virtue(V_SACRIFICE, 1);
4079 if (stat == A_WIS || stat == A_INT)
4080 chg_virtue(V_ENLIGHTEN, -2);
4082 /* Handle "low" values */
4085 if (amount > 90) max--;
4086 if (amount > 50) max--;
4087 if (amount > 20) max--;
4091 /* Handle "high" values */
4094 /* Hack -- Decrement by a random amount between one-quarter */
4095 /* and one-half of the stat bonus times the percentage, with a */
4096 /* minimum damage of half the percentage. -CWS */
4097 loss = (((max-18) / 2 + 1) / 2 + 1);
4098 loss = ((randint(loss) + loss) * amount) / 100;
4099 if (loss < amount/2) loss = amount/2;
4101 /* Lose some points */
4104 /* Hack -- Only reduce stat to 17 sometimes */
4105 if (max < 18) max = (amount <= 20) ? 18 : 17;
4108 /* Hack -- keep it clean */
4109 if (same || (max < cur)) max = cur;
4111 /* Something happened */
4112 if (max != p_ptr->stat_max[stat]) res = TRUE;
4118 /* Actually set the stat to its new value. */
4119 p_ptr->stat_cur[stat] = cur;
4120 p_ptr->stat_max[stat] = max;
4122 /* Recalculate bonuses */
4123 p_ptr->update |= (PU_BONUS);
4132 * Restore a stat. Return TRUE only if this actually makes a difference.
4134 bool res_stat(int stat)
4136 /* Restore if needed */
4137 if (p_ptr->stat_cur[stat] != p_ptr->stat_max[stat])
4140 p_ptr->stat_cur[stat] = p_ptr->stat_max[stat];
4142 /* Recalculate bonuses */
4143 p_ptr->update |= (PU_BONUS);
4149 /* Nothing to restore */
4155 * Increase players hit points, notice effects
4157 bool hp_player(int num)
4160 vir = virtue_number(V_VITALITY);
4163 num = num * (p_ptr->virtues[vir - 1] + 1250) / 1250;
4165 /* Healing needed */
4166 if (p_ptr->chp < p_ptr->mhp)
4168 if ((num > 0) && (p_ptr->chp < (p_ptr->mhp/3)))
4169 chg_virtue(V_TEMPERANCE, 1);
4170 /* Gain hitpoints */
4173 /* Enforce maximum */
4174 if (p_ptr->chp >= p_ptr->mhp)
4176 p_ptr->chp = p_ptr->mhp;
4177 p_ptr->chp_frac = 0;
4181 p_ptr->redraw |= (PR_HP);
4184 p_ptr->window |= (PW_PLAYER);
4190 msg_print("¾¯¤·µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4192 msg_print("You feel a little better.");
4201 msg_print("µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4203 msg_print("You feel better.");
4212 msg_print("¤È¤Æ¤âµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4214 msg_print("You feel much better.");
4223 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4225 msg_print("You feel very good.");
4240 * Array of stat "descriptions"
4242 static cptr desc_stat_pos[] =
4284 * Array of stat "descriptions"
4286 static cptr desc_stat_neg[] =
4310 bool do_dec_stat(int stat)
4314 /* Access the "sustain" */
4317 case A_STR: if (p_ptr->sustain_str) sust = TRUE; break;
4318 case A_INT: if (p_ptr->sustain_int) sust = TRUE; break;
4319 case A_WIS: if (p_ptr->sustain_wis) sust = TRUE; break;
4320 case A_DEX: if (p_ptr->sustain_dex) sust = TRUE; break;
4321 case A_CON: if (p_ptr->sustain_con) sust = TRUE; break;
4322 case A_CHR: if (p_ptr->sustain_chr) sust = TRUE; break;
4326 if (sust && (!ironman_nightmare || rand_int(13)))
4330 msg_format("%s¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¤¬¡¢¤¹¤°¤Ë¸µ¤ËÌá¤Ã¤¿¡£",
4332 msg_format("You feel %s for a moment, but the feeling passes.",
4335 desc_stat_neg[stat]);
4341 /* Attempt to reduce the stat */
4342 if (dec_stat(stat, 10, (ironman_nightmare && !rand_int(13))))
4346 msg_format("¤Ò¤É¤¯%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_neg[stat]);
4348 msg_format("You feel very %s.", desc_stat_neg[stat]);
4356 /* Nothing obvious */
4362 * Restore lost "points" in a stat
4364 bool do_res_stat(int stat)
4366 /* Attempt to increase */
4371 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4373 msg_format("You feel less %s.", desc_stat_neg[stat]);
4381 /* Nothing obvious */
4387 * Gain a "point" in a stat
4389 bool do_inc_stat(int stat)
4393 /* Restore strength */
4394 res = res_stat(stat);
4396 /* Attempt to increase */
4401 chg_virtue(V_ENLIGHTEN, 1);
4402 chg_virtue(V_FAITH, 1);
4404 else if (stat == A_INT)
4406 chg_virtue(V_KNOWLEDGE, 1);
4407 chg_virtue(V_ENLIGHTEN, 1);
4409 else if (stat == A_CON)
4410 chg_virtue(V_VITALITY, 1);
4414 msg_format("¥ï¡¼¥ª¡ª¤È¤Æ¤â%s¤Ê¤Ã¤¿¡ª", desc_stat_pos[stat]);
4416 msg_format("Wow! You feel very %s!", desc_stat_pos[stat]);
4424 /* Restoration worked */
4429 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4431 msg_format("You feel less %s.", desc_stat_neg[stat]);
4439 /* Nothing obvious */
4445 * Restores any drained experience
4447 bool restore_level(void)
4449 /* Restore experience */
4450 if (p_ptr->exp < p_ptr->max_exp)
4454 msg_print("À¸Ì¿ÎϤ¬Ìá¤Ã¤Æ¤¤¿µ¤¤¬¤¹¤ë¡£");
4456 msg_print("You feel your life energies returning.");
4460 /* Restore the experience */
4461 p_ptr->exp = p_ptr->max_exp;
4463 /* Check the experience */
4478 bool lose_all_info(void)
4482 chg_virtue(V_KNOWLEDGE, -5);
4483 chg_virtue(V_ENLIGHTEN, -5);
4485 /* Forget info about objects */
4486 for (i = 0; i < INVEN_TOTAL; i++)
4488 object_type *o_ptr = &inventory[i];
4490 /* Skip non-objects */
4491 if (!o_ptr->k_idx) continue;
4493 /* Allow "protection" by the MENTAL flag */
4494 if (o_ptr->ident & (IDENT_MENTAL)) continue;
4496 /* Remove "default inscriptions" */
4497 o_ptr->feeling = FEEL_NONE;
4499 /* Hack -- Clear the "empty" flag */
4500 o_ptr->ident &= ~(IDENT_EMPTY);
4502 /* Hack -- Clear the "known" flag */
4503 o_ptr->ident &= ~(IDENT_KNOWN);
4505 /* Hack -- Clear the "felt" flag */
4506 o_ptr->ident &= ~(IDENT_SENSE);
4509 /* Recalculate bonuses */
4510 p_ptr->update |= (PU_BONUS);
4512 /* Combine / Reorder the pack (later) */
4513 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
4516 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
4518 /* Mega-Hack -- Forget the map */
4526 void do_poly_wounds(void)
4528 /* Changed to always provide at least _some_ healing */
4529 s16b wounds = p_ptr->cut;
4530 s16b hit_p = (p_ptr->mhp - p_ptr->chp);
4531 s16b change = damroll(p_ptr->lev, 5);
4532 bool Nasty_effect = (randint(5) == 1);
4534 if (!(wounds || hit_p || Nasty_effect)) return;
4537 msg_print("½ý¤¬¤è¤ê·Ú¤¤¤â¤Î¤ËÊѲ½¤·¤¿¡£");
4539 msg_print("Your wounds are polymorphed into less serious ones.");
4546 msg_print("¿·¤¿¤Ê½ý¤¬¤Ç¤¤¿¡ª");
4547 take_hit(DAMAGE_LOSELIFE, change / 2, "ÊѲ½¤·¤¿½ý", -1);
4549 msg_print("A new wound was created!");
4550 take_hit(DAMAGE_LOSELIFE, change / 2, "a polymorphed wound", -1);
4557 set_cut(p_ptr->cut - (change / 2));
4562 void do_poly_self(void)
4564 int power = p_ptr->lev;
4567 msg_print("¤¢¤Ê¤¿¤ÏÊѲ½¤Îˬ¤ì¤ò´¶¤¸¤¿...");
4569 msg_print("You feel a change coming over you...");
4572 chg_virtue(V_CHANCE, 1);
4574 if ((power > rand_int(20)) && (rand_int(3) == 1) && (p_ptr->prace != RACE_ANDROID))
4576 char effect_msg[80] = "";
4577 int new_race, expfact, goalexpfact, h_percent;
4579 /* Some form of racial polymorph... */
4582 if ((power > rand_int(5)) && (rand_int(4) == 1))
4587 if (p_ptr->psex == SEX_MALE)
4589 p_ptr->psex = SEX_FEMALE;
4590 sp_ptr = &sex_info[p_ptr->psex];
4592 sprintf(effect_msg, "½÷À¤Î");
4594 sprintf(effect_msg, "female ");
4600 p_ptr->psex = SEX_MALE;
4601 sp_ptr = &sex_info[p_ptr->psex];
4603 sprintf(effect_msg, "ÃËÀ¤Î");
4605 sprintf(effect_msg, "male ");
4611 if ((power > rand_int(30)) && (rand_int(5) == 1))
4615 /* Harmful deformity */
4620 if (rand_int(2) == 1)
4622 (void)dec_stat(tmp, randint(6) + 6, (randint(3) == 1));
4628 /* Deformities are discriminated against! */
4629 (void)dec_stat(A_CHR, randint(6), TRUE);
4635 sprintf(tmp_msg,"%s",effect_msg);
4636 sprintf(effect_msg,"´ñ·Á¤Î%s",tmp_msg);
4638 sprintf(tmp_msg,"%s ",effect_msg);
4639 sprintf(effect_msg,"deformed %s ",tmp_msg);
4646 sprintf(effect_msg,"´ñ·Á¤Î");
4648 sprintf(effect_msg,"deformed ");
4654 while ((power > rand_int(20)) && (rand_int(10) == 1))
4656 /* Polymorph into a less mutated form */
4659 if (!lose_mutation(0))
4661 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
4663 msg_print("You feel oddly normal.");
4669 * Restrict the race choices by exp penalty so
4670 * weak polymorph always means weak race
4675 goalexpfact = 100 + 3 * rand_int(power);
4679 new_race = rand_int(MAX_RACES);
4680 expfact = race_info[new_race].r_exp;
4682 while (((new_race == p_ptr->prace) && (expfact > goalexpfact)) || (new_race == RACE_ANDROID));
4685 msg_format("¤¢¤Ê¤¿¤Ï%s%s¤ËÊѲ½¤·¤¿¡ª", effect_msg,
4686 race_info[new_race].title);
4690 msg_format("You turn into a%s %s!",
4691 ((new_race == RACE_AMBERITE || new_race == RACE_ELF
4692 || new_race == RACE_IMP) ? "n" : ""),
4693 race_info[new_race].title);
4697 msg_format("You turn into a %s%s!", effect_msg,
4698 race_info[new_race].title);
4702 chg_virtue(V_CHANCE, 2);
4704 if (p_ptr->prace < 32)
4706 p_ptr->old_race1 |= 1L << p_ptr->prace;
4710 p_ptr->old_race2 = 1L << (p_ptr->prace-32);
4712 p_ptr->prace = new_race;
4713 rp_ptr = &race_info[p_ptr->prace];
4715 /* Experience factor */
4716 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
4718 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)))
4719 p_ptr->expfact -= 15;
4722 /* Calculate the height/weight for males */
4723 if (p_ptr->psex == SEX_MALE)
4725 p_ptr->ht = randnor(rp_ptr->m_b_ht, rp_ptr->m_m_ht);
4726 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->m_b_ht);
4727 p_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * h_percent /100
4728 , (int)(rp_ptr->m_m_wt) * h_percent / 300 );
4731 /* Calculate the height/weight for females */
4732 else if (p_ptr->psex == SEX_FEMALE)
4734 p_ptr->ht = randnor(rp_ptr->f_b_ht, rp_ptr->f_m_ht);
4735 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->f_b_ht);
4736 p_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * h_percent /100
4737 , (int)(rp_ptr->f_m_wt) * h_percent / 300 );
4743 if (p_ptr->pclass == CLASS_SORCERER)
4744 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
4746 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
4748 do_cmd_rerate(FALSE);
4750 p_ptr->redraw |= (PR_BASIC);
4752 p_ptr->update |= (PU_BONUS);
4758 if ((power > rand_int(30)) && (rand_int(6) == 1))
4766 msg_format("%s¤Î¹½À®¤¬ÊѲ½¤·¤¿¡ª", p_ptr->prace == RACE_ANDROID ? "µ¡³£" : "Æâ¡");
4768 msg_print("Your internal organs are rearranged!");
4773 (void)dec_stat(tmp, randint(6) + 6, (randint(3) == 1));
4776 if (randint(6) == 1)
4779 msg_print("¸½ºß»Ñ¤ÇÀ¸¤¤Æ¤¤¤¯¤Î¤Ïº¤Æñ¤Ê¤è¤¦¤À¡ª");
4780 take_hit(DAMAGE_LOSELIFE, damroll(randint(10), p_ptr->lev), "Ã×̿Ū¤ÊÆÍÁ³ÊÑ°Û", -1);
4782 msg_print("You find living difficult in your present form!");
4783 take_hit(DAMAGE_LOSELIFE, damroll(randint(10), p_ptr->lev), "a lethal mutation", -1);
4790 if ((power > rand_int(20)) && (rand_int(4) == 1))
4795 do_cmd_rerate(FALSE);
4798 while ((power > rand_int(15)) && (rand_int(3) == 1))
4801 (void)gain_random_mutation(0);
4804 if (power > rand_int(5))
4810 /* Note: earlier deductions may have left power < 0 already. */
4820 * Decreases players hit points and sets death flag if necessary
4822 * XXX XXX XXX Invulnerability needs to be changed into a "shield"
4824 * XXX XXX XXX Hack -- this function allows the user to save (or quit)
4825 * the game when he dies, since the "You die." message is shown before
4826 * setting the player to "dead".
4828 bool take_hit(int damage_type, int damage, cptr hit_from, int monspell)
4830 int old_chp = p_ptr->chp;
4832 char death_message[1024];
4835 int warning = (p_ptr->mhp * hitpoint_warn / 10);
4838 if (death) return FALSE;
4840 if (p_ptr->sutemi) damage *= 2;
4841 if (p_ptr->special_defense & KATA_IAI) damage += (damage + 4) / 5;
4843 if (easy_band) damage = (damage+1)/2;
4845 if (damage_type != DAMAGE_USELIFE)
4855 if (monspell >= 0) learn_spell(monspell);
4857 /* Mega-Hack -- Apply "invulnerability" */
4858 if ((damage_type != DAMAGE_USELIFE) && (damage_type != DAMAGE_LOSELIFE))
4860 if ((p_ptr->invuln || ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == MUSIC_INVULN))) && (damage < 9000))
4862 if (damage_type == DAMAGE_FORCE)
4865 msg_print("¥Ð¥ê¥¢¤¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
4867 msg_print("The attack cuts your shield of invulnerability open!");
4870 else if (randint(PENETRATE_INVULNERABILITY) == 1)
4873 msg_print("̵Ũ¤Î¥Ð¥ê¥¢¤òÇˤäƹ¶·â¤µ¤ì¤¿¡ª");
4875 msg_print("The attack penetrates your shield of invulnerability!");
4884 /* Multishadow effects is determined by turn */
4885 if (p_ptr->multishadow && (turn & 1))
4887 if (damage_type == DAMAGE_FORCE)
4890 msg_print("¸¸±Æ¤â¤í¤È¤âÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
4892 msg_print("The attack hits Shadow together with you!");
4895 else if (damage_type == DAMAGE_ATTACK)
4898 msg_print("¹¶·â¤Ï¸¸±Æ¤ËÌ¿Ã椷¡¢¤¢¤Ê¤¿¤Ë¤ÏÆϤ«¤Ê¤«¤Ã¤¿¡£");
4900 msg_print("The attack hits Shadow, you are unharmed!");
4906 if (p_ptr->wraith_form)
4908 if (damage_type == DAMAGE_FORCE)
4911 msg_print("Ⱦʪ¼Á¤ÎÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
4913 msg_print("The attack cuts through your ethereal body!");
4919 if ((damage == 0) && (randint(2) == 1)) damage = 1;
4923 if ((p_ptr->special_defense & KATA_MUSOU))
4926 if ((damage == 0) && (randint(2) == 1)) damage = 1;
4928 } /* not if LOSELIFE USELIFE */
4930 /* Hurt the player */
4931 p_ptr->chp -= damage;
4932 if(damage_type == DAMAGE_GENO && p_ptr->chp < 0)
4937 /* Display the hitpoints */
4938 p_ptr->redraw |= (PR_HP);
4941 p_ptr->window |= (PW_PLAYER);
4945 if (damage_type != DAMAGE_GENO && p_ptr->chp == 0)
4947 chg_virtue(V_SACRIFICE, 1);
4948 chg_virtue(V_CHANCE, 2);
4955 bool android = (p_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
4957 #ifdef JP /* »à¤ó¤À»þ¤Ë¶¯À©½ªÎ»¤·¤Æ»à¤ò²óÈò¤Ç¤¤Ê¤¯¤·¤Æ¤ß¤¿ by Habu */
4958 if (!munchkin_death)
4959 if(!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
4965 chg_virtue(V_SACRIFICE, 10);
4968 p_ptr->leaving = TRUE;
4973 if (p_ptr->inside_arena)
4976 msg_format("¤¢¤Ê¤¿¤Ï%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£", r_name+r_info[arena_monsters[p_ptr->arena_number]].name);
4978 msg_format("You are beaten by %s.", r_name+r_info[arena_monsters[p_ptr->arena_number]].name);
4984 /* Note cause of death */
4985 (void)strcpy(died_from, hit_from);
4987 if (p_ptr->image) strcat(died_from,"(?)");
4989 /* No longer a winner */
4990 total_winner = FALSE;
4992 if (p_ptr->inside_arena)
4994 strcpy(buf,"¥¢¥ê¡¼¥Ê");
4996 strcpy(buf,"in the Arena");
4998 else if (!dun_level)
5002 strcpy(buf,"on The surface");
5004 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)))
5006 strcpy(buf,"¥¯¥¨¥¹¥È");
5008 strcpy(buf,"in a quest");
5012 sprintf(buf,"%d³¬", dun_level);
5014 sprintf(buf,"level %d", dun_level);
5017 sprintf(tmp,"%s¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£",buf, died_from);
5019 sprintf(tmp,"killed by %s %s.", died_from, buf);
5021 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5023 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- ¥²¡¼¥à¥ª¡¼¥Ð¡¼ --------");
5025 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- Game Over --------");
5027 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, "\n\n\n\n");
5032 if (get_check("²èÌ̤òÊݸ¤·¤Þ¤¹¤«¡©"))
5034 if (get_check("Dump the screen? "))
5038 do_cmd_save_screen();
5043 /* Hack -- Note death */
5047 msg_format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë");
5049 msg_print(android ? "You are broken." : "You die.");
5056 if (streq(died_from, "Seppuku"))
5059 get_rnd_line("seppuku_j.txt", 0, death_message);
5061 get_rnd_line("seppuku.txt", 0, death_message);
5067 get_rnd_line("death_j.txt", 0, death_message);
5069 get_rnd_line("death.txt", 0, death_message);
5073 if (!get_string(streq(died_from, "Seppuku") ? "¼À¤¤Î¶ç: " : "ÃÇËöËâ¤Î¶«¤Ó: ", death_message, 1024))
5075 if (!get_string("Last word: ", death_message, 1024))
5080 strcpy(death_message, format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë"));
5082 strcpy(death_message, android ? "You are broken." : "You die.");
5085 if (streq(died_from, "Seppuku"))
5091 int msg_pos_x[9] = { 5, 7, 9, 12, 14, 17, 19, 21, 23};
5092 int msg_pos_y[9] = { 3, 4, 5, 4, 5, 4, 5, 6, 4};
5099 for (i = 0; i < 40; i++)
5100 Term_putstr(rand_int(w / 2) * 2, rand_int(h), 2, TERM_VIOLET, "¦Ô");
5102 str = death_message;
5103 if (strncmp(str, "¡Ö", 2) == 0) str += 2;
5105 str2 = strstr_j(str, "¡×");
5106 if (str2 != NULL) str2 = '\0';
5111 str2 = strstr_j(str, " ");
5112 if (str2 == NULL) len = strlen(str);
5113 else len = str2 - str;
5117 Term_putstr_v(w * 3 / 4 - 2 - msg_pos_x[i] * 2, msg_pos_y[i], len,
5119 if (str2 == NULL) break;
5123 if (*str == 0) break;
5128 msg_print(death_message);
5132 msg_print(death_message);
5140 /* Hitpoint warning */
5141 if (p_ptr->chp < warning)
5143 /* Hack -- bell on first notice */
5144 if (alert_hitpoint && (old_chp > warning)) bell();
5148 if (record_danger && (old_chp > warning))
5151 sprintf(tmp,"%s¤Ë¤è¤Ã¤Æ¥Ô¥ó¥Á¤Ë´Ù¤¤¤Ã¤¿¡£",hit_from);
5153 sprintf(tmp,"A critical situation because of %s.",hit_from);
5155 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5160 /* stop auto_more even if DAMAGE_USELIFE */
5166 msg_print("*** ·Ù¹ð:Äã¥Ò¥Ã¥È¡¦¥Ý¥¤¥ó¥È¡ª ***");
5168 msg_print("*** LOW HITPOINT WARNING! ***");
5174 if (p_ptr->wild_mode && !p_ptr->leaving && (p_ptr->chp < MAX(warning, p_ptr->mhp/5)))
5176 p_ptr->wilderness_x = px;
5177 p_ptr->wilderness_y = py;
5178 p_ptr->energy = 100;
5188 void gain_exp(s32b amount)
5192 if (p_ptr->prace == RACE_ANDROID) return;
5194 /* Gain some experience */
5195 p_ptr->exp += amount;
5197 /* Slowly recover from experience drainage */
5198 if (p_ptr->exp < p_ptr->max_exp)
5200 /* Gain max experience (20%) (was 10%) */
5201 p_ptr->max_exp += amount / 5;
5204 /* Check Experience */
5209 void calc_android_exp(void)
5215 if (p_ptr->prace != RACE_ANDROID) return;
5217 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5219 object_type *o_ptr = &inventory[i];
5221 object_type *q_ptr = &forge;
5223 int level = MAX(get_object_level(o_ptr) - 8, 1);
5225 if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue;
5226 if (!o_ptr->k_idx) continue;
5228 /* Wipe the object */
5231 object_copy(q_ptr, o_ptr);
5232 q_ptr->discount = 0;
5233 q_ptr->ident &= ~(IDENT_CURSED);
5234 q_ptr->art_flags3 &= ~(TR3_CURSED | TR3_HEAVY_CURSE | TR3_PERMA_CURSE | TR3_TY_CURSE);
5238 level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
5239 level += MIN(20, a_info[o_ptr->name1].rarity/(a_info[o_ptr->name1].flags3 & TR3_INSTA_ART ? 10 : 3));
5241 else if (o_ptr->name2) level += MAX(3, (e_info[o_ptr->name2].rating - 5)/2);
5242 value = object_value_real(q_ptr);
5244 if (value <= 0) continue;
5245 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (p_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
5246 if (value > 5000000L) value = 5000000L;
5247 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
5249 if (o_ptr->name1 || o_ptr->name2 || o_ptr->art_name ||
5250 (o_ptr->tval == TV_DRAG_ARMOR) ||
5251 ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) ||
5252 ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) ||
5253 ((o_ptr->tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)) ||
5254 ((o_ptr->tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) ||
5255 ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE)))
5257 if (level > 65) level = 35 + (level - 65) / 5;
5258 else if (level > 35) level = 25 + (level - 35) / 3;
5259 else if (level > 15) level = 15 + (level - 15) / 2;
5260 exp = MIN(100000L, value) * level * level / 2;
5261 if (value > 100000L)
5262 exp += (value - 100000L) * level * level / 8;
5266 exp = MIN(100000L, value) * level;
5267 if (value > 100000L)
5268 exp += (value - 100000L) * level / 4;
5270 if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (buki_motteruka(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
5271 else total_exp += exp / 16;
5272 if (i == INVEN_BODY) total_exp += exp / 32;
5274 p_ptr->exp = p_ptr->max_exp = total_exp;
5276 /* Check Experience */
5284 void lose_exp(s32b amount)
5286 if (p_ptr->prace == RACE_ANDROID) return;
5288 /* Never drop below zero experience */
5289 if (amount > p_ptr->exp) amount = p_ptr->exp;
5291 /* Lose some experience */
5292 p_ptr->exp -= amount;
5294 /* Check Experience */
5298 bool set_ultimate_res(int v, bool do_dec)
5300 bool notice = FALSE;
5302 /* Hack -- Force good values */
5303 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5305 if (death) return FALSE;
5310 if (p_ptr->ult_res && !do_dec)
5312 if (p_ptr->ult_res > v) return FALSE;
5314 else if (!p_ptr->ult_res)
5317 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5319 msg_print("You feel resistant!");
5332 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5334 msg_print("You feel less resistant");
5344 /* Redraw status bar */
5345 p_ptr->redraw |= (PR_STATUS);
5347 /* Nothing to notice */
5348 if (!notice) return (FALSE);
5351 if (disturb_state) disturb(0, 0);
5353 /* Recalculate bonuses */
5354 p_ptr->update |= (PU_BONUS);
5363 bool set_tim_res_nether(int v, bool do_dec)
5365 bool notice = FALSE;
5367 /* Hack -- Force good values */
5368 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5370 if (death) return FALSE;
5375 if (p_ptr->tim_res_nether && !do_dec)
5377 if (p_ptr->tim_res_nether > v) return FALSE;
5379 else if (!p_ptr->tim_res_nether)
5382 msg_print("ÃϹö¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5384 msg_print("You feel nether resistant!");
5394 if (p_ptr->tim_res_nether)
5397 msg_print("ÃϹö¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5399 msg_print("You feel less nether resistant");
5407 p_ptr->tim_res_nether = v;
5409 /* Redraw status bar */
5410 p_ptr->redraw |= (PR_STATUS);
5412 /* Nothing to notice */
5413 if (!notice) return (FALSE);
5416 if (disturb_state) disturb(0, 0);
5418 /* Recalculate bonuses */
5419 p_ptr->update |= (PU_BONUS);
5428 bool set_tim_res_time(int v, bool do_dec)
5430 bool notice = FALSE;
5432 /* Hack -- Force good values */
5433 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5435 if (death) return FALSE;
5440 if (p_ptr->tim_res_time && !do_dec)
5442 if (p_ptr->tim_res_time > v) return FALSE;
5444 else if (!p_ptr->tim_res_time)
5447 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5449 msg_print("You feel time resistant!");
5459 if (p_ptr->tim_res_time)
5462 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5464 msg_print("You feel less time resistant");
5472 p_ptr->tim_res_time = v;
5474 /* Redraw status bar */
5475 p_ptr->redraw |= (PR_STATUS);
5477 /* Nothing to notice */
5478 if (!notice) return (FALSE);
5481 if (disturb_state) disturb(0, 0);
5483 /* Recalculate bonuses */
5484 p_ptr->update |= (PU_BONUS);
5495 * Choose a warrior-mage elemental attack. -LM-
5497 bool choose_ele_attack(void)
5506 num = (p_ptr->lev - 20) / 5;
5509 c_prt(TERM_RED, " a) ¾Æ´þ", 2, 14);
5511 c_prt(TERM_RED, " a) Fire Brand", 2, 14);
5515 if (num >= 2) c_prt(TERM_L_WHITE," b) Åà·ë", 3, 14);
5517 if (num >= 2) c_prt(TERM_L_WHITE," b) Cold Brand", 3, 14);
5519 else prt("", 3, 14);
5522 if (num >= 3) c_prt(TERM_GREEN, " c) ÆÇ»¦", 4, 14);
5524 if (num >= 3) c_prt(TERM_GREEN, " c) Poison Brand", 4, 14);
5526 else prt("", 4, 14);
5529 if (num >= 4) c_prt(TERM_L_DARK, " d) Íϲò", 5, 14);
5531 if (num >= 4) c_prt(TERM_L_DARK, " d) Acid Brand", 5, 14);
5533 else prt("", 5, 14);
5536 if (num >= 5) c_prt(TERM_BLUE, " e) ÅÅ·â", 6, 14);
5538 if (num >= 5) c_prt(TERM_BLUE, " e) Elec Brand", 6, 14);
5540 else prt("", 6, 14);
5548 prt(" ¤É¤Î¸µÁǹ¶·â¤ò¤·¤Þ¤¹¤«¡©", 1, 14);
5550 prt(" Choose a temporary elemental brand ", 1, 14);
5555 if ((choice == 'a') || (choice == 'A'))
5556 set_ele_attack(ATTACK_FIRE, p_ptr->lev/2 + randint(p_ptr->lev/2));
5557 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
5558 set_ele_attack(ATTACK_COLD, p_ptr->lev/2 + randint(p_ptr->lev/2));
5559 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
5560 set_ele_attack(ATTACK_POIS, p_ptr->lev/2 + randint(p_ptr->lev/2));
5561 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
5562 set_ele_attack(ATTACK_ACID, p_ptr->lev/2 + randint(p_ptr->lev/2));
5563 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
5564 set_ele_attack(ATTACK_ELEC, p_ptr->lev/2 + randint(p_ptr->lev/2));
5568 msg_print("ËâË¡·õ¤ò»È¤¦¤Î¤ò¤ä¤á¤¿¡£");
5570 msg_print("You cancel the temporary branding.");
5582 * Choose a elemental immune. -LM-
5584 bool choose_ele_immune(int turn)
5592 c_prt(TERM_RED, " a) ²Ð±ê", 2, 14);
5594 c_prt(TERM_RED, " a) Immune Fire", 2, 14);
5598 c_prt(TERM_L_WHITE," b) Î䵤", 3, 14);
5600 c_prt(TERM_L_WHITE," b) Immune Cold", 3, 14);
5604 c_prt(TERM_L_DARK, " c) »À", 4, 14);
5606 c_prt(TERM_L_DARK, " c) Immune Acid", 4, 14);
5610 c_prt(TERM_BLUE, " d) ÅÅ·â", 5, 14);
5612 c_prt(TERM_BLUE, " d) Immune Elec", 5, 14);
5623 prt(" ¤É¤Î¸µÁǤÎÌȱ֤ò¤Ä¤±¤Þ¤¹¤«¡©", 1, 14);
5625 prt(" Choose a temporary elemental immune ", 1, 14);
5630 if ((choice == 'a') || (choice == 'A'))
5631 set_ele_immune(DEFENSE_FIRE, turn);
5632 else if ((choice == 'b') || (choice == 'B'))
5633 set_ele_immune(DEFENSE_COLD, turn);
5634 else if ((choice == 'c') || (choice == 'C'))
5635 set_ele_immune(DEFENSE_ACID, turn);
5636 else if ((choice == 'd') || (choice == 'D'))
5637 set_ele_immune(DEFENSE_ELEC, turn);
5641 msg_print("Ìȱ֤òÉÕ¤±¤ë¤Î¤ò¤ä¤á¤¿¡£");
5643 msg_print("You cancel the temporary immune.");