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 begin to walk carefully.");
104 p_ptr->redraw |= (PR_SPEED);
110 msg_print("³Ø½¬¤ò»Ï¤á¤¿¡£");
112 msg_print("You begin Learning");
119 msg_print("¿åÌ̤˻å¤ò¿â¤é¤·¤¿¡¥¡¥¡¥");
121 msg_print("You begin fishing...");
125 case ACTION_HAYAGAKE:
128 msg_print("¤¬±©¤Î¤è¤¦¤Ë·Ú¤¯¤Ê¤Ã¤¿¡£");
130 msg_print("You begin 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->wraith_form = 0; /* Timed -- Wraith Form */
175 p_ptr->tim_ffall = 0;
176 p_ptr->tim_sh_touki = 0;
177 p_ptr->tim_sh_fire = 0;
178 p_ptr->tim_sh_holy = 0;
179 p_ptr->tim_eyeeye = 0;
180 p_ptr->resist_magic = 0;
183 p_ptr->tim_res_nether = 0;
184 p_ptr->tim_res_time = 0;
185 p_ptr->tim_mimic = 0;
186 p_ptr->mimic_form = 0;
187 p_ptr->tim_reflect = 0;
188 p_ptr->multishadow = 0;
190 p_ptr->action = ACTION_NONE;
193 p_ptr->oppose_acid = 0; /* Timed -- oppose acid */
194 p_ptr->oppose_elec = 0; /* Timed -- oppose lightning */
195 p_ptr->oppose_fire = 0; /* Timed -- oppose heat */
196 p_ptr->oppose_cold = 0; /* Timed -- oppose cold */
197 p_ptr->oppose_pois = 0; /* Timed -- oppose poison */
199 p_ptr->word_recall = 0;
200 p_ptr->alter_reality = 0;
201 p_ptr->sutemi = FALSE;
202 p_ptr->counter = FALSE;
203 p_ptr->ele_attack = 0;
204 p_ptr->ele_immune = 0;
205 p_ptr->special_attack = 0L;
206 p_ptr->special_defense = 0L;
208 while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
209 world_player = FALSE;
211 if (prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
212 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1;
213 if (p_ptr->pclass == CLASS_BERSERKER) p_ptr->shero = 1;
217 m_list[p_ptr->riding].fast = 0;
218 m_list[p_ptr->riding].slow = 0;
219 m_list[p_ptr->riding].invulner = 0;
222 if (p_ptr->pclass == CLASS_BARD)
224 p_ptr->magic_num1[0] = 0;
225 p_ptr->magic_num2[0] = 0;
231 * Set "p_ptr->tim_mimic", and "p_ptr->mimic_form",
232 * notice observable changes
234 bool set_mimic(int v, int p, bool do_dec)
238 /* Hack -- Force good values */
239 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
241 if (p_ptr->is_dead) return FALSE;
246 if (p_ptr->tim_mimic && (p_ptr->mimic_form == p) && !do_dec)
248 if (p_ptr->tim_mimic > v) return FALSE;
250 else if ((!p_ptr->tim_mimic) || (p_ptr->mimic_form != p))
253 msg_print("¼«Ê¬¤ÎÂΤ¬ÊѤï¤Ã¤Æ¤æ¤¯¤Î¤ò´¶¤¸¤¿¡£");
255 msg_print("You feel that your body changes.");
265 if (p_ptr->tim_mimic)
268 msg_print("ÊѿȤ¬²ò¤±¤¿¡£");
270 msg_print("You are no longer transformed.");
272 if (p_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(0, TRUE);
280 p_ptr->tim_mimic = v;
282 /* Nothing to notice */
291 p_ptr->redraw |= (PR_BASIC | PR_STATUS);
293 /* Recalculate bonuses */
294 p_ptr->update |= (PU_BONUS | PU_HP);
303 * Set "p_ptr->blind", notice observable changes
305 * Note the use of "PU_UN_LITE" and "PU_UN_VIEW", which is needed to
306 * memorize any terrain features which suddenly become "visible".
307 * Note that blindness is currently the only thing which can affect
308 * "player_can_see_bold()".
310 bool set_blind(int v)
314 /* Hack -- Force good values */
315 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
317 if (p_ptr->is_dead) return FALSE;
324 if (p_ptr->prace == RACE_ANDROID)
327 msg_print("¥»¥ó¥µ¡¼¤ò¤ä¤é¤ì¤¿¡ª");
329 msg_print("You are blind!");
335 msg_print("Ìܤ¬¸«¤¨¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
337 msg_print("You are blind!");
342 chg_virtue(V_ENLIGHTEN, -1);
351 if (p_ptr->prace == RACE_ANDROID)
354 msg_print("¥»¥ó¥µ¡¼¤¬Éüµì¤·¤¿¡£");
356 msg_print("You can see again.");
362 msg_print("¤ä¤Ã¤ÈÌܤ¬¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
364 msg_print("You can see again.");
375 /* Redraw status bar */
376 p_ptr->redraw |= (PR_STATUS);
378 /* Nothing to notice */
379 if (!notice) return (FALSE);
382 if (disturb_state) disturb(0, 0);
384 /* Fully update the visuals */
385 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS);
388 p_ptr->redraw |= (PR_MAP);
391 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
402 * Set "p_ptr->confused", notice observable changes
404 bool set_confused(int v)
408 /* Hack -- Force good values */
409 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
411 if (p_ptr->is_dead) return FALSE;
416 if (!p_ptr->confused)
419 msg_print("¤¢¤Ê¤¿¤Ïº®Í𤷤¿¡ª");
421 msg_print("You are confused!");
424 if (p_ptr->action == ACTION_LEARN)
427 msg_print("³Ø½¬¤¬Â³¤±¤é¤ì¤Ê¤¤¡ª");
429 msg_print("You cannot continue Learning!");
433 p_ptr->redraw |= (PR_STATE);
434 p_ptr->action = ACTION_NONE;
436 if (p_ptr->action == ACTION_KAMAE)
439 msg_print("¹½¤¨¤¬¤È¤±¤¿¡£");
441 msg_print("Your posture gets loose.");
443 p_ptr->special_defense &= ~(KAMAE_MASK);
444 p_ptr->update |= (PU_BONUS);
445 p_ptr->redraw |= (PR_STATE);
446 p_ptr->action = ACTION_NONE;
448 else if (p_ptr->action == ACTION_KATA)
451 msg_print("·¿¤¬Êø¤ì¤¿¡£");
453 msg_print("Your posture gets loose.");
455 p_ptr->special_defense &= ~(KATA_MASK);
456 p_ptr->update |= (PU_BONUS);
457 p_ptr->update |= (PU_MONSTERS);
458 p_ptr->redraw |= (PR_STATE);
459 p_ptr->redraw |= (PR_STATUS);
460 p_ptr->action = ACTION_NONE;
464 p_ptr->counter = FALSE;
465 chg_virtue(V_HARMONY, -1);
475 msg_print("¤ä¤Ã¤Èº®Í𤬤ª¤µ¤Þ¤Ã¤¿¡£");
477 msg_print("You feel less confused now.");
480 p_ptr->special_attack &= ~(ATTACK_SUIKEN);
488 /* Redraw status bar */
489 p_ptr->redraw |= (PR_STATUS);
491 /* Nothing to notice */
492 if (!notice) return (FALSE);
495 if (disturb_state) disturb(0, 0);
506 * Set "p_ptr->poisoned", notice observable changes
508 bool set_poisoned(int v)
512 /* Hack -- Force good values */
513 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
515 if (p_ptr->is_dead) return FALSE;
520 if (!p_ptr->poisoned)
523 msg_print("ÆǤ˿¯¤µ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
525 msg_print("You are poisoned!");
538 msg_print("¤ä¤Ã¤ÈÆǤÎÄˤߤ¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
540 msg_print("You are no longer poisoned.");
550 /* Redraw status bar */
551 p_ptr->redraw |= (PR_STATUS);
553 /* Nothing to notice */
554 if (!notice) return (FALSE);
557 if (disturb_state) disturb(0, 0);
568 * Set "p_ptr->afraid", notice observable changes
570 bool set_afraid(int v)
574 /* Hack -- Force good values */
575 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
577 if (p_ptr->is_dead) return FALSE;
585 msg_print("²¿¤â¤«¤â¶²¤¯¤Ê¤Ã¤Æ¤¤¿¡ª");
587 msg_print("You are terrified!");
590 if (p_ptr->special_defense & KATA_MASK)
593 msg_print("·¿¤¬Êø¤ì¤¿¡£");
595 msg_print("Your posture gets loose.");
597 p_ptr->special_defense &= ~(KATA_MASK);
598 p_ptr->update |= (PU_BONUS);
599 p_ptr->update |= (PU_MONSTERS);
600 p_ptr->redraw |= (PR_STATE);
601 p_ptr->redraw |= (PR_STATUS);
602 p_ptr->action = ACTION_NONE;
606 p_ptr->counter = FALSE;
607 chg_virtue(V_VALOUR, -1);
617 msg_print("¤ä¤Ã¤È¶²Éݤò¿¶¤êʧ¤Ã¤¿¡£");
619 msg_print("You feel bolder now.");
629 /* Redraw status bar */
630 p_ptr->redraw |= (PR_STATUS);
632 /* Nothing to notice */
633 if (!notice) return (FALSE);
636 if (disturb_state) disturb(0, 0);
647 * Set "p_ptr->paralyzed", notice observable changes
649 bool set_paralyzed(int v)
653 /* Hack -- Force good values */
654 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
656 if (p_ptr->is_dead) return FALSE;
661 if (!p_ptr->paralyzed)
664 msg_print("ÂΤ¬Ëãá㤷¤Æ¤·¤Þ¤Ã¤¿¡ª");
666 msg_print("You are paralyzed!");
669 p_ptr->counter = FALSE;
677 if (p_ptr->paralyzed)
680 msg_print("¤ä¤Ã¤ÈÆ°¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
682 msg_print("You can move again.");
690 p_ptr->paralyzed = v;
692 /* Redraw status bar */
693 p_ptr->redraw |= (PR_STATUS);
695 /* Nothing to notice */
696 if (!notice) return (FALSE);
699 if (disturb_state) disturb(0, 0);
701 /* Redraw the state */
702 p_ptr->redraw |= (PR_STATE);
713 * Set "p_ptr->image", notice observable changes
715 * Note that we must redraw the map when hallucination changes.
717 bool set_image(int v)
721 /* Hack -- Force good values */
722 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
724 if (p_ptr->is_dead) return FALSE;
730 set_tsuyoshi(0, TRUE);
734 msg_print("¥ï¡¼¥ª¡ª²¿¤â¤«¤âÆú¿§¤Ë¸«¤¨¤ë¡ª");
736 msg_print("Oh, wow! Everything looks so cosmic now!");
739 p_ptr->counter = FALSE;
750 msg_print("¤ä¤Ã¤È¤Ï¤Ã¤¤ê¤Èʪ¤¬¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
752 msg_print("You can see clearly again.");
762 /* Redraw status bar */
763 p_ptr->redraw |= (PR_STATUS);
765 /* Nothing to notice */
766 if (!notice) return (FALSE);
769 if (disturb_state) disturb(0, 0);
772 p_ptr->redraw |= (PR_MAP);
774 /* Update monsters */
775 p_ptr->update |= (PU_MONSTERS);
778 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
789 * Set "p_ptr->fast", notice observable changes
791 bool set_fast(int v, bool do_dec)
795 /* Hack -- Force good values */
796 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
798 if (p_ptr->is_dead) return FALSE;
803 if (p_ptr->fast && !do_dec)
805 if (p_ptr->fast > v) return FALSE;
807 else if (!p_ptr->fast && !p_ptr->lightspeed)
810 msg_print("ÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
812 msg_print("You feel yourself moving much faster!");
816 chg_virtue(V_PATIENCE, -1);
817 chg_virtue(V_DILIGENCE, 1);
824 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))))
827 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
829 msg_print("You feel yourself slow down.");
839 /* Nothing to notice */
840 if (!notice) return (FALSE);
843 if (disturb_state) disturb(0, 0);
845 /* Recalculate bonuses */
846 p_ptr->update |= (PU_BONUS);
857 * Set "p_ptr->lightspeed", notice observable changes
859 bool set_lightspeed(int v, bool do_dec)
863 /* Hack -- Force good values */
864 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
866 if (p_ptr->is_dead) return FALSE;
871 if (p_ptr->lightspeed && !do_dec)
873 if (p_ptr->lightspeed > v) return FALSE;
875 else if (!p_ptr->lightspeed)
878 msg_print("Èó¾ï¤ËÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
880 msg_print("You feel yourself moving extremely faster!");
884 chg_virtue(V_PATIENCE, -1);
885 chg_virtue(V_DILIGENCE, 1);
892 if (p_ptr->lightspeed)
895 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
897 msg_print("You feel yourself slow down.");
905 p_ptr->lightspeed = v;
907 /* Nothing to notice */
908 if (!notice) return (FALSE);
911 if (disturb_state) disturb(0, 0);
913 /* Recalculate bonuses */
914 p_ptr->update |= (PU_BONUS);
925 * Set "p_ptr->slow", notice observable changes
927 bool set_slow(int v, bool do_dec)
931 /* Hack -- Force good values */
932 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
934 if (p_ptr->is_dead) return FALSE;
939 if (p_ptr->slow && !do_dec)
941 if (p_ptr->slow > v) return FALSE;
943 else if (!p_ptr->slow)
946 msg_print("ÂΤÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
948 msg_print("You feel yourself moving slower!");
961 msg_print("Æ°¤¤ÎÃÙ¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
963 msg_print("You feel yourself speed up.");
973 /* Nothing to notice */
974 if (!notice) return (FALSE);
977 if (disturb_state) disturb(0, 0);
979 /* Recalculate bonuses */
980 p_ptr->update |= (PU_BONUS);
991 * Set "p_ptr->shield", notice observable changes
993 bool set_shield(int v, bool do_dec)
997 /* Hack -- Force good values */
998 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1000 if (p_ptr->is_dead) return FALSE;
1005 if (p_ptr->shield && !do_dec)
1007 if (p_ptr->shield > v) return FALSE;
1009 else if (!p_ptr->shield)
1012 msg_print("È©¤¬ÀФˤʤä¿¡£");
1014 msg_print("Your skin turns to stone.");
1027 msg_print("È©¤¬¸µ¤ËÌá¤Ã¤¿¡£");
1029 msg_print("Your skin returns to normal.");
1039 /* Redraw status bar */
1040 p_ptr->redraw |= (PR_STATUS);
1042 /* Nothing to notice */
1043 if (!notice) return (FALSE);
1046 if (disturb_state) disturb(0, 0);
1048 /* Recalculate bonuses */
1049 p_ptr->update |= (PU_BONUS);
1061 * Set "p_ptr->tsubureru", notice observable changes
1063 bool set_tsubureru(int v, bool do_dec)
1065 bool notice = FALSE;
1067 /* Hack -- Force good values */
1068 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1070 if (p_ptr->is_dead) return FALSE;
1075 if (p_ptr->tsubureru && !do_dec)
1077 if (p_ptr->tsubureru > v) return FALSE;
1079 else if (!p_ptr->tsubureru)
1082 msg_print("²£¤Ë¿¤Ó¤¿¡£");
1084 msg_print("Your body expands horizontally.");
1094 if (p_ptr->tsubureru)
1097 msg_print("¤â¤¦²£¤Ë¿¤Ó¤Æ¤¤¤Ê¤¤¡£");
1099 msg_print("Your body returns to normal.");
1107 p_ptr->tsubureru = v;
1109 /* Redraw status bar */
1110 p_ptr->redraw |= (PR_STATUS);
1112 /* Nothing to notice */
1113 if (!notice) return (FALSE);
1116 if (disturb_state) disturb(0, 0);
1118 /* Recalculate bonuses */
1119 p_ptr->update |= (PU_BONUS);
1131 * Set "p_ptr->magicdef", notice observable changes
1133 bool set_magicdef(int v, bool do_dec)
1135 bool notice = FALSE;
1137 /* Hack -- Force good values */
1138 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1140 if (p_ptr->is_dead) return FALSE;
1145 if (p_ptr->magicdef && !do_dec)
1147 if (p_ptr->magicdef > v) return FALSE;
1149 else if (!p_ptr->magicdef)
1152 msg_print("ËâË¡¤ÎËɸæÎϤ¬Áý¤·¤¿¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1154 msg_print("You feel more resistant to magic.");
1164 if (p_ptr->magicdef)
1167 msg_print("ËâË¡¤ÎËɸæÎϤ¬¸µ¤ËÌá¤Ã¤¿¡£");
1169 msg_print("You feel less resistant to magic.");
1177 p_ptr->magicdef = v;
1179 /* Redraw status bar */
1180 p_ptr->redraw |= (PR_STATUS);
1182 /* Nothing to notice */
1183 if (!notice) return (FALSE);
1186 if (disturb_state) disturb(0, 0);
1188 /* Recalculate bonuses */
1189 p_ptr->update |= (PU_BONUS);
1201 * Set "p_ptr->blessed", notice observable changes
1203 bool set_blessed(int v, bool do_dec)
1205 bool notice = FALSE;
1207 /* Hack -- Force good values */
1208 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1210 if (p_ptr->is_dead) return FALSE;
1215 if (p_ptr->blessed && !do_dec)
1217 if (p_ptr->blessed > v) return FALSE;
1219 else if (!p_ptr->blessed)
1222 msg_print("¹â·é¤Êµ¤Ê¬¤Ë¤Ê¤Ã¤¿¡ª");
1224 msg_print("You feel righteous!");
1234 if (p_ptr->blessed && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_BLESS)))
1237 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1239 msg_print("The prayer has expired.");
1249 /* Redraw status bar */
1250 p_ptr->redraw |= (PR_STATUS);
1252 /* Nothing to notice */
1253 if (!notice) return (FALSE);
1256 if (disturb_state) disturb(0, 0);
1258 /* Recalculate bonuses */
1259 p_ptr->update |= (PU_BONUS);
1270 * Set "p_ptr->hero", notice observable changes
1272 bool set_hero(int v, bool do_dec)
1274 bool notice = FALSE;
1276 /* Hack -- Force good values */
1277 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1279 if (p_ptr->is_dead) return FALSE;
1284 if (p_ptr->hero && !do_dec)
1286 if (p_ptr->hero > v) return FALSE;
1288 else if (!p_ptr->hero)
1291 msg_print("¥Ò¡¼¥í¡¼¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1293 msg_print("You feel like a hero!");
1303 if (p_ptr->hero && ((p_ptr->pclass != CLASS_BARD) || ((p_ptr->magic_num1[0] != MUSIC_HERO) && (p_ptr->magic_num1[0] != MUSIC_SHERO))))
1306 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1308 msg_print("The heroism wears off.");
1318 /* Redraw status bar */
1319 p_ptr->redraw |= (PR_STATUS);
1321 /* Nothing to notice */
1322 if (!notice) return (FALSE);
1325 if (disturb_state) disturb(0, 0);
1327 /* Recalculate bonuses */
1328 p_ptr->update |= (PU_BONUS);
1330 /* Recalculate hitpoints */
1331 p_ptr->update |= (PU_HP);
1342 * Set "p_ptr->shero", notice observable changes
1344 bool set_shero(int v, bool do_dec)
1346 bool notice = FALSE;
1348 /* Hack -- Force good values */
1349 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1351 if (p_ptr->is_dead) return FALSE;
1353 if (p_ptr->pclass == CLASS_BERSERKER) v = 1;
1357 if (p_ptr->shero && !do_dec)
1359 if (p_ptr->shero > v) return FALSE;
1361 else if (!p_ptr->shero)
1364 msg_print("»¦Ù¤¥Þ¥·¡¼¥ó¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1366 msg_print("You feel like a killing machine!");
1379 msg_print("ÌîÈڤʵ¤»ý¤Á¤¬¾Ã¤¨¼º¤»¤¿¡£");
1381 msg_print("You feel less Berserk.");
1391 /* Redraw status bar */
1392 p_ptr->redraw |= (PR_STATUS);
1394 /* Nothing to notice */
1395 if (!notice) return (FALSE);
1398 if (disturb_state) disturb(0, 0);
1400 /* Recalculate bonuses */
1401 p_ptr->update |= (PU_BONUS);
1403 /* Recalculate hitpoints */
1404 p_ptr->update |= (PU_HP);
1415 * Set "p_ptr->protevil", notice observable changes
1417 bool set_protevil(int v, bool do_dec)
1419 bool notice = FALSE;
1421 /* Hack -- Force good values */
1422 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1424 if (p_ptr->is_dead) return FALSE;
1429 if (p_ptr->protevil && !do_dec)
1431 if (p_ptr->protevil > v) return FALSE;
1433 else if (!p_ptr->protevil)
1436 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Ê´¶¤¸¤¬¤¹¤ë¡ª");
1438 msg_print("You feel safe from evil!");
1448 if (p_ptr->protevil)
1451 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1453 msg_print("You no longer feel safe from evil.");
1461 p_ptr->protevil = v;
1463 /* Redraw status bar */
1464 p_ptr->redraw |= (PR_STATUS);
1466 /* Nothing to notice */
1467 if (!notice) return (FALSE);
1470 if (disturb_state) disturb(0, 0);
1480 * Set "p_ptr->wraith_form", notice observable changes
1482 bool set_wraith_form(int v, bool do_dec)
1484 bool notice = FALSE;
1486 /* Hack -- Force good values */
1487 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1489 if (p_ptr->is_dead) return FALSE;
1494 if (p_ptr->wraith_form && !do_dec)
1496 if (p_ptr->wraith_form > v) return FALSE;
1498 else if (!p_ptr->wraith_form)
1501 msg_print("ʪ¼Á³¦¤òÎ¥¤ì¤ÆÍ©µ´¤Î¤è¤¦¤Ê¸ºß¤Ë¤Ê¤Ã¤¿¡ª");
1503 msg_print("You leave the physical world and turn into a wraith-being!");
1508 chg_virtue(V_UNLIFE, 3);
1509 chg_virtue(V_HONOUR, -2);
1510 chg_virtue(V_SACRIFICE, -2);
1511 chg_virtue(V_VALOUR, -5);
1514 p_ptr->redraw |= (PR_MAP);
1516 /* Update monsters */
1517 p_ptr->update |= (PU_MONSTERS);
1520 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1527 if (p_ptr->wraith_form)
1530 msg_print("ÉÔÆ©ÌÀ¤Ë¤Ê¤Ã¤¿´¶¤¸¤¬¤¹¤ë¡£");
1532 msg_print("You feel opaque.");
1538 p_ptr->redraw |= (PR_MAP);
1540 /* Update monsters */
1541 p_ptr->update |= (PU_MONSTERS);
1544 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1549 p_ptr->wraith_form = v;
1551 /* Redraw status bar */
1552 p_ptr->redraw |= (PR_STATUS);
1554 /* Nothing to notice */
1555 if (!notice) return (FALSE);
1558 if (disturb_state) disturb(0, 0);
1560 /* Recalculate bonuses */
1561 p_ptr->update |= (PU_BONUS);
1576 * Set "p_ptr->invuln", notice observable changes
1578 bool set_invuln(int v, bool do_dec)
1580 bool notice = FALSE;
1582 /* Hack -- Force good values */
1583 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1585 if (p_ptr->is_dead) return FALSE;
1590 if (p_ptr->invuln && !do_dec)
1592 if (p_ptr->invuln > v) return FALSE;
1594 else if (!p_ptr->invuln)
1597 msg_print("̵Ũ¤À¡ª");
1599 msg_print("Invulnerability!");
1604 chg_virtue(V_UNLIFE, -2);
1605 chg_virtue(V_HONOUR, -2);
1606 chg_virtue(V_SACRIFICE, -3);
1607 chg_virtue(V_VALOUR, -5);
1610 p_ptr->redraw |= (PR_MAP);
1612 /* Update monsters */
1613 p_ptr->update |= (PU_MONSTERS);
1616 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1623 if (p_ptr->invuln && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_INVULN)))
1626 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
1628 msg_print("The invulnerability wears off.");
1634 p_ptr->redraw |= (PR_MAP);
1636 /* Update monsters */
1637 p_ptr->update |= (PU_MONSTERS);
1640 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1642 p_ptr->energy_need += ENERGY_NEED();
1649 /* Redraw status bar */
1650 p_ptr->redraw |= (PR_STATUS);
1652 /* Nothing to notice */
1653 if (!notice) return (FALSE);
1656 if (disturb_state) disturb(0, 0);
1658 /* Recalculate bonuses */
1659 p_ptr->update |= (PU_BONUS);
1670 * Set "p_ptr->tim_esp", notice observable changes
1672 bool set_tim_esp(int v, bool do_dec)
1674 bool notice = FALSE;
1676 /* Hack -- Force good values */
1677 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1679 if (p_ptr->is_dead) return FALSE;
1684 if (p_ptr->tim_esp && !do_dec)
1686 if (p_ptr->tim_esp > v) return FALSE;
1688 else if (!p_ptr->tim_esp)
1691 msg_print("°Õ¼±¤¬¹¤¬¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1693 msg_print("You feel your consciousness expand!");
1703 if (p_ptr->tim_esp && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_MIND)))
1706 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
1708 msg_print("Your consciousness contracts again.");
1718 /* Redraw status bar */
1719 p_ptr->redraw |= (PR_STATUS);
1721 /* Nothing to notice */
1722 if (!notice) return (FALSE);
1725 if (disturb_state) disturb(0, 0);
1727 /* Recalculate bonuses */
1728 p_ptr->update |= (PU_BONUS);
1730 /* Update the monsters */
1731 p_ptr->update |= (PU_MONSTERS);
1742 * Set "p_ptr->tim_invis", notice observable changes
1744 bool set_tim_invis(int v, bool do_dec)
1746 bool notice = FALSE;
1748 /* Hack -- Force good values */
1749 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1751 if (p_ptr->is_dead) return FALSE;
1756 if (p_ptr->tim_invis && !do_dec)
1758 if (p_ptr->tim_invis > v) return FALSE;
1760 else if (!p_ptr->tim_invis)
1763 msg_print("Ìܤ¬Èó¾ï¤ËÉÒ´¶¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1765 msg_print("Your eyes feel very sensitive!");
1775 if (p_ptr->tim_invis)
1778 msg_print("ÌܤÎÉÒ´¶¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1780 msg_print("Your eyes feel less sensitive.");
1788 p_ptr->tim_invis = v;
1790 /* Redraw status bar */
1791 p_ptr->redraw |= (PR_STATUS);
1793 /* Nothing to notice */
1794 if (!notice) return (FALSE);
1797 if (disturb_state) disturb(0, 0);
1799 /* Recalculate bonuses */
1800 p_ptr->update |= (PU_BONUS);
1802 /* Update the monsters */
1803 p_ptr->update |= (PU_MONSTERS);
1814 * Set "p_ptr->tim_infra", notice observable changes
1816 bool set_tim_infra(int v, bool do_dec)
1818 bool notice = FALSE;
1820 /* Hack -- Force good values */
1821 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1823 if (p_ptr->is_dead) return FALSE;
1828 if (p_ptr->tim_infra && !do_dec)
1830 if (p_ptr->tim_infra > v) return FALSE;
1832 else if (!p_ptr->tim_infra)
1835 msg_print("Ìܤ¬¥é¥ó¥é¥ó¤Èµ±¤»Ï¤á¤¿¡ª");
1837 msg_print("Your eyes begin to tingle!");
1847 if (p_ptr->tim_infra)
1850 msg_print("Ìܤ層¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1852 msg_print("Your eyes stop tingling.");
1860 p_ptr->tim_infra = v;
1862 /* Redraw status bar */
1863 p_ptr->redraw |= (PR_STATUS);
1865 /* Nothing to notice */
1866 if (!notice) return (FALSE);
1869 if (disturb_state) disturb(0, 0);
1871 /* Recalculate bonuses */
1872 p_ptr->update |= (PU_BONUS);
1874 /* Update the monsters */
1875 p_ptr->update |= (PU_MONSTERS);
1886 * Set "p_ptr->tim_regen", notice observable changes
1888 bool set_tim_regen(int v, bool do_dec)
1890 bool notice = FALSE;
1892 /* Hack -- Force good values */
1893 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1895 if (p_ptr->is_dead) return FALSE;
1900 if (p_ptr->tim_regen && !do_dec)
1902 if (p_ptr->tim_regen > v) return FALSE;
1904 else if (!p_ptr->tim_regen)
1907 msg_print("²óÉüÎϤ¬¾å¤¬¤Ã¤¿¡ª");
1909 msg_print("You feel yourself regenerating quickly!");
1919 if (p_ptr->tim_regen)
1922 msg_print("ÁÇÁ᤯²óÉü¤¹¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1924 msg_print("You feel yourself regenerating slowly.");
1932 p_ptr->tim_regen = v;
1934 /* Redraw status bar */
1935 p_ptr->redraw |= (PR_STATUS);
1937 /* Nothing to notice */
1938 if (!notice) return (FALSE);
1941 if (disturb_state) disturb(0, 0);
1943 /* Recalculate bonuses */
1944 p_ptr->update |= (PU_BONUS);
1955 * Set "p_ptr->tim_stealth", notice observable changes
1957 bool set_tim_stealth(int v, bool do_dec)
1959 bool notice = FALSE;
1961 /* Hack -- Force good values */
1962 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1964 if (p_ptr->is_dead) return FALSE;
1969 if (p_ptr->tim_stealth && !do_dec)
1971 if (p_ptr->tim_stealth > v) return FALSE;
1973 else if (!p_ptr->tim_stealth)
1976 msg_print("²»¤¬¾®¤µ¤¯¤Ê¤Ã¤¿¡ª");
1978 msg_print("You begin to walk silently!");
1988 if (p_ptr->tim_stealth && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_STEALTH)))
1991 msg_print("²»¤¬Â礤¯¤Ê¤Ã¤¿¡£");
1993 msg_print("You no longer walk silently.");
2001 p_ptr->tim_stealth = v;
2003 /* Redraw status bar */
2004 p_ptr->redraw |= (PR_STATUS);
2006 /* Nothing to notice */
2007 if (!notice) return (FALSE);
2010 if (disturb_state) disturb(0, 0);
2012 /* Recalculate bonuses */
2013 p_ptr->update |= (PU_BONUS);
2023 bool set_superstealth(bool set)
2025 bool notice = FALSE;
2027 if (p_ptr->is_dead) return FALSE;
2032 if (!(p_ptr->special_defense & NINJA_S_STEALTH))
2034 if (cave[py][px].info & CAVE_MNLT)
2037 msg_print("Ũ¤ÎÌܤ«¤éÇö¤¤±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡£");
2039 msg_print("You are mantled in weak shadow from ordinary eyes.");
2041 p_ptr->monlite = p_ptr->old_monlite = TRUE;
2046 msg_print("Ũ¤ÎÌܤ«¤é±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡ª");
2048 msg_print("You are mantled in shadow from ordinary eyes!");
2050 p_ptr->monlite = p_ptr->old_monlite = FALSE;
2056 p_ptr->special_defense |= NINJA_S_STEALTH;
2063 if (p_ptr->special_defense & NINJA_S_STEALTH)
2066 msg_print("ºÆ¤ÓŨ¤ÎÌܤˤµ¤é¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
2068 msg_print("You are exposed to common sight once more.");
2074 p_ptr->special_defense &= ~(NINJA_S_STEALTH);
2078 /* Nothing to notice */
2079 if (!notice) return (FALSE);
2081 /* Redraw status bar */
2082 p_ptr->redraw |= (PR_STATUS);
2085 if (disturb_state) disturb(0, 0);
2093 * Set "p_ptr->tim_ffall", notice observable changes
2095 bool set_tim_ffall(int v, bool do_dec)
2097 bool notice = FALSE;
2099 /* Hack -- Force good values */
2100 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2102 if (p_ptr->is_dead) return FALSE;
2107 if (p_ptr->tim_ffall && !do_dec)
2109 if (p_ptr->tim_ffall > v) return FALSE;
2111 else if (!p_ptr->tim_ffall)
2114 msg_print("ÂΤ¬Ãè¤ËÉ⤻Ϥ᤿¡£");
2116 msg_print("You begin to fly!");
2126 if (p_ptr->tim_ffall)
2129 msg_print("¤â¤¦Ãè¤ËÉ⤫¤Ù¤Ê¤¯¤Ê¤Ã¤¿¡£");
2131 msg_print("You stop flying.");
2139 p_ptr->tim_ffall = v;
2141 /* Redraw status bar */
2142 p_ptr->redraw |= (PR_STATUS);
2144 /* Nothing to notice */
2145 if (!notice) return (FALSE);
2148 if (disturb_state) disturb(0, 0);
2150 /* Recalculate bonuses */
2151 p_ptr->update |= (PU_BONUS);
2162 * Set "p_ptr->tim_sh_touki", notice observable changes
2164 bool set_tim_sh_touki(int v, bool do_dec)
2166 bool notice = FALSE;
2168 /* Hack -- Force good values */
2169 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2171 if (p_ptr->is_dead) return FALSE;
2176 if (p_ptr->tim_sh_touki && !do_dec)
2178 if (p_ptr->tim_sh_touki > v) return FALSE;
2180 else if (!p_ptr->tim_sh_touki)
2183 msg_print("ÂΤ¬Æ®µ¤¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2185 msg_print("You have enveloped by the aura of the Force!");
2195 if (p_ptr->tim_sh_touki)
2198 msg_print("Æ®µ¤¤¬¾Ã¤¨¤¿¡£");
2200 msg_print("Aura of the Force disappeared.");
2208 p_ptr->tim_sh_touki = v;
2210 /* Redraw status bar */
2211 p_ptr->redraw |= (PR_STATUS);
2213 /* Nothing to notice */
2214 if (!notice) return (FALSE);
2217 if (disturb_state) disturb(0, 0);
2228 * Set "p_ptr->tim_sh_fire", notice observable changes
2230 bool set_tim_sh_fire(int v, bool do_dec)
2232 bool notice = FALSE;
2234 /* Hack -- Force good values */
2235 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2237 if (p_ptr->is_dead) return FALSE;
2242 if (p_ptr->tim_sh_fire && !do_dec)
2244 if (p_ptr->tim_sh_fire > v) return FALSE;
2246 else if (!p_ptr->tim_sh_fire)
2249 msg_print("ÂΤ¬±ê¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2251 msg_print("You have enveloped by fiery aura!");
2261 if (p_ptr->tim_sh_fire)
2264 msg_print("±ê¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2266 msg_print("Fiery aura disappeared.");
2274 p_ptr->tim_sh_fire = v;
2276 /* Redraw status bar */
2277 p_ptr->redraw |= (PR_STATUS);
2279 /* Nothing to notice */
2280 if (!notice) return (FALSE);
2283 if (disturb_state) disturb(0, 0);
2285 /* Recalculate bonuses */
2286 p_ptr->update |= (PU_BONUS);
2297 * Set "p_ptr->tim_sh_holy", notice observable changes
2299 bool set_tim_sh_holy(int v, bool do_dec)
2301 bool notice = FALSE;
2303 /* Hack -- Force good values */
2304 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2306 if (p_ptr->is_dead) return FALSE;
2311 if (p_ptr->tim_sh_holy && !do_dec)
2313 if (p_ptr->tim_sh_holy > v) return FALSE;
2315 else if (!p_ptr->tim_sh_holy)
2318 msg_print("ÂΤ¬À»¤Ê¤ë¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2320 msg_print("You have enveloped by holy aura!");
2330 if (p_ptr->tim_sh_holy)
2333 msg_print("À»¤Ê¤ë¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2335 msg_print("Holy aura disappeared.");
2343 p_ptr->tim_sh_holy = v;
2345 /* Redraw status bar */
2346 p_ptr->redraw |= (PR_STATUS);
2348 /* Nothing to notice */
2349 if (!notice) return (FALSE);
2352 if (disturb_state) disturb(0, 0);
2354 /* Recalculate bonuses */
2355 p_ptr->update |= (PU_BONUS);
2367 * Set "p_ptr->tim_eyeeye", notice observable changes
2369 bool set_tim_eyeeye(int v, bool do_dec)
2371 bool notice = FALSE;
2373 /* Hack -- Force good values */
2374 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2376 if (p_ptr->is_dead) return FALSE;
2381 if (p_ptr->tim_eyeeye && !do_dec)
2383 if (p_ptr->tim_eyeeye > v) return FALSE;
2385 else if (!p_ptr->tim_eyeeye)
2388 msg_print("Ë¡¤Î¼é¤ê¼ê¤Ë¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¡ª");
2390 msg_print("You feel like a keeper of commandments!");
2400 if (p_ptr->tim_eyeeye)
2403 msg_print("Ĩȳ¤ò¼¹¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2405 msg_print("You no longer feel like a keeper.");
2413 p_ptr->tim_eyeeye = v;
2415 /* Redraw status bar */
2416 p_ptr->redraw |= (PR_STATUS);
2418 /* Nothing to notice */
2419 if (!notice) return (FALSE);
2422 if (disturb_state) disturb(0, 0);
2424 /* Recalculate bonuses */
2425 p_ptr->update |= (PU_BONUS);
2437 * Set "p_ptr->resist_magic", notice observable changes
2439 bool set_resist_magic(int v, bool do_dec)
2441 bool notice = FALSE;
2443 /* Hack -- Force good values */
2444 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2446 if (p_ptr->is_dead) return FALSE;
2451 if (p_ptr->resist_magic && !do_dec)
2453 if (p_ptr->resist_magic > v) return FALSE;
2455 else if (!p_ptr->resist_magic)
2458 msg_print("ËâË¡¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿¡£");
2460 msg_print("You have been protected from magic!");
2470 if (p_ptr->resist_magic)
2473 msg_print("ËâË¡¤Ë¼å¤¯¤Ê¤Ã¤¿¡£");
2475 msg_print("You are no longer protected from magic.");
2483 p_ptr->resist_magic = v;
2485 /* Redraw status bar */
2486 p_ptr->redraw |= (PR_STATUS);
2488 /* Nothing to notice */
2489 if (!notice) return (FALSE);
2492 if (disturb_state) disturb(0, 0);
2494 /* Recalculate bonuses */
2495 p_ptr->update |= (PU_BONUS);
2506 * Set "p_ptr->tim_reflect", notice observable changes
2508 bool set_tim_reflect(int v, bool do_dec)
2510 bool notice = FALSE;
2512 /* Hack -- Force good values */
2513 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2515 if (p_ptr->is_dead) return FALSE;
2520 if (p_ptr->tim_reflect && !do_dec)
2522 if (p_ptr->tim_reflect > v) return FALSE;
2524 else if (!p_ptr->tim_reflect)
2527 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2529 msg_print("Your body becames smooth.");
2539 if (p_ptr->tim_reflect)
2542 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ç¤Ê¤¯¤Ê¤Ã¤¿¡£");
2544 msg_print("Your body is no longer smooth.");
2552 p_ptr->tim_reflect = v;
2554 /* Redraw status bar */
2555 p_ptr->redraw |= (PR_STATUS);
2557 /* Nothing to notice */
2558 if (!notice) return (FALSE);
2561 if (disturb_state) disturb(0, 0);
2563 /* Recalculate bonuses */
2564 p_ptr->update |= (PU_BONUS);
2575 * Set "p_ptr->multishadow", notice observable changes
2577 bool set_multishadow(int v, bool do_dec)
2579 bool notice = FALSE;
2581 /* Hack -- Force good values */
2582 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2584 if (p_ptr->is_dead) return FALSE;
2589 if (p_ptr->multishadow && !do_dec)
2591 if (p_ptr->multishadow > v) return FALSE;
2593 else if (!p_ptr->multishadow)
2596 msg_print("¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¸¸±Æ¤¬À¸¤Þ¤ì¤¿¡£");
2598 msg_print("Your Shadow enveloped you.");
2608 if (p_ptr->multishadow)
2611 msg_print("¸¸±Æ¤¬¾Ã¤¨¤¿¡£");
2613 msg_print("Your Shadow disappears.");
2621 p_ptr->multishadow = v;
2623 /* Redraw status bar */
2624 p_ptr->redraw |= (PR_STATUS);
2626 /* Nothing to notice */
2627 if (!notice) return (FALSE);
2630 if (disturb_state) disturb(0, 0);
2632 /* Recalculate bonuses */
2633 p_ptr->update |= (PU_BONUS);
2644 * Set "p_ptr->dustrobe", notice observable changes
2646 bool set_dustrobe(int v, bool do_dec)
2648 bool notice = FALSE;
2650 /* Hack -- Force good values */
2651 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2653 if (p_ptr->is_dead) return FALSE;
2658 if (p_ptr->dustrobe && !do_dec)
2660 if (p_ptr->dustrobe > v) return FALSE;
2662 else if (!p_ptr->dustrobe)
2665 msg_print("ÂΤ¬¶À¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2667 msg_print("You were enveloped by mirror shards.");
2677 if (p_ptr->dustrobe)
2680 msg_print("¶À¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2682 msg_print("The mirror shards disappear.");
2690 p_ptr->dustrobe = v;
2692 /* Redraw status bar */
2693 p_ptr->redraw |= (PR_STATUS);
2695 /* Nothing to notice */
2696 if (!notice) return (FALSE);
2699 if (disturb_state) disturb(0, 0);
2701 /* Recalculate bonuses */
2702 p_ptr->update |= (PU_BONUS);
2713 * Set "p_ptr->tim_regen", notice observable changes
2715 bool set_kabenuke(int v, bool do_dec)
2717 bool notice = FALSE;
2719 /* Hack -- Force good values */
2720 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2722 if (p_ptr->is_dead) return FALSE;
2727 if (p_ptr->kabenuke && !do_dec)
2729 if (p_ptr->kabenuke > v) return FALSE;
2731 else if (!p_ptr->kabenuke)
2734 msg_print("ÂΤ¬È¾Êª¼Á¤Î¾õÂ֤ˤʤä¿¡£");
2736 msg_print("You became ethereal form.");
2746 if (p_ptr->kabenuke)
2749 msg_print("ÂΤ¬Êª¼Á²½¤·¤¿¡£");
2751 msg_print("You are no longer in an ethereal form.");
2759 p_ptr->kabenuke = v;
2761 /* Redraw status bar */
2762 p_ptr->redraw |= (PR_STATUS);
2764 /* Nothing to notice */
2765 if (!notice) return (FALSE);
2768 if (disturb_state) disturb(0, 0);
2778 bool set_tsuyoshi(int v, bool do_dec)
2780 bool notice = FALSE;
2782 /* Hack -- Force good values */
2783 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2785 if (p_ptr->is_dead) return FALSE;
2790 if (p_ptr->tsuyoshi && !do_dec)
2792 if (p_ptr->tsuyoshi > v) return FALSE;
2794 else if (!p_ptr->tsuyoshi)
2797 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
2799 msg_print("Brother OKURE!");
2803 chg_virtue(V_VITALITY, 2);
2810 if (p_ptr->tsuyoshi)
2813 msg_print("ÆùÂΤ¬µÞ®¤Ë¤·¤Ü¤ó¤Ç¤¤¤Ã¤¿¡£");
2815 msg_print("Your body had quickly shriveled.");
2818 (void)dec_stat(A_CON, 20, TRUE);
2819 (void)dec_stat(A_STR, 20, TRUE);
2822 chg_virtue(V_VITALITY, -3);
2827 p_ptr->tsuyoshi = v;
2829 /* Redraw status bar */
2830 p_ptr->redraw |= (PR_STATUS);
2832 /* Nothing to notice */
2833 if (!notice) return (FALSE);
2836 if (disturb_state) disturb(0, 0);
2838 /* Recalculate bonuses */
2839 p_ptr->update |= (PU_BONUS);
2841 /* Recalculate hitpoints */
2842 p_ptr->update |= (PU_HP);
2853 * Set a temporary elemental brand. Clear all other brands. Print status
2856 bool set_ele_attack(u32b attack_type, int v)
2858 /* Hack -- Force good values */
2859 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2861 /* Clear all elemental attacks (only one is allowed at a time). */
2862 if ((p_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
2864 p_ptr->special_attack &= ~(ATTACK_ACID);
2866 msg_print("»À¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2868 msg_print("Your temporary acidic brand fades away.");
2871 if ((p_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
2873 p_ptr->special_attack &= ~(ATTACK_ELEC);
2875 msg_print("ÅÅ·â¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2877 msg_print("Your temporary electrical brand fades away.");
2880 if ((p_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
2882 p_ptr->special_attack &= ~(ATTACK_FIRE);
2884 msg_print("²Ð±ê¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2886 msg_print("Your temporary fiery brand fades away.");
2889 if ((p_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
2891 p_ptr->special_attack &= ~(ATTACK_COLD);
2893 msg_print("Î䵤¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2895 msg_print("Your temporary frost brand fades away.");
2898 if ((p_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
2900 p_ptr->special_attack &= ~(ATTACK_POIS);
2902 msg_print("ÆǤǹ¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2904 msg_print("Your temporary poison brand fades away.");
2908 if ((v) && (attack_type))
2910 /* Set attack type. */
2911 p_ptr->special_attack |= (attack_type);
2914 p_ptr->ele_attack = v;
2918 msg_format("%s¤Ç¹¶·â¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª",
2919 ((attack_type == ATTACK_ACID) ? "»À" :
2920 ((attack_type == ATTACK_ELEC) ? "ÅÅ·â" :
2921 ((attack_type == ATTACK_FIRE) ? "²Ð±ê" :
2922 ((attack_type == ATTACK_COLD) ? "Î䵤" :
2923 ((attack_type == ATTACK_POIS) ? "ÆÇ" :
2926 msg_format("For a while, the blows you deal will %s",
2927 ((attack_type == ATTACK_ACID) ? "melt with acid!" :
2928 ((attack_type == ATTACK_ELEC) ? "shock your foes!" :
2929 ((attack_type == ATTACK_FIRE) ? "burn with fire!" :
2930 ((attack_type == ATTACK_COLD) ? "chill to the bone!" :
2931 ((attack_type == ATTACK_POIS) ? "poison your enemies!" :
2932 "do nothing special."))))));
2937 if (disturb_state) disturb(0, 0);
2939 /* Redraw status bar */
2940 p_ptr->redraw |= (PR_STATUS);
2942 p_ptr->update |= (PU_BONUS);
2952 * Set a temporary elemental brand. Clear all other brands. Print status
2955 bool set_ele_immune(u32b immune_type, int v)
2957 /* Hack -- Force good values */
2958 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2960 /* Clear all elemental attacks (only one is allowed at a time). */
2961 if ((p_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
2963 p_ptr->special_defense &= ~(DEFENSE_ACID);
2965 msg_print("»À¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2967 msg_print("You are no longer immune to acid.");
2970 if ((p_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
2972 p_ptr->special_defense &= ~(DEFENSE_ELEC);
2974 msg_print("ÅÅ·â¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2976 msg_print("You are no longer immune to electricity.");
2979 if ((p_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
2981 p_ptr->special_defense &= ~(DEFENSE_FIRE);
2983 msg_print("²Ð±ê¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2985 msg_print("You are no longer immune to fire.");
2988 if ((p_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
2990 p_ptr->special_defense &= ~(DEFENSE_COLD);
2992 msg_print("Î䵤¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2994 msg_print("You are no longer immune to cold.");
2997 if ((p_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
2999 p_ptr->special_defense &= ~(DEFENSE_POIS);
3001 msg_print("ÆǤι¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3003 msg_print("You are no longer immune to poison.");
3007 if ((v) && (immune_type))
3009 /* Set attack type. */
3010 p_ptr->special_defense |= (immune_type);
3013 p_ptr->ele_immune = v;
3017 msg_format("%s¤Î¹¶·â¤ò¼õ¤±¤Ä¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª",
3018 ((immune_type == DEFENSE_ACID) ? "»À" :
3019 ((immune_type == DEFENSE_ELEC) ? "ÅÅ·â" :
3020 ((immune_type == DEFENSE_FIRE) ? "²Ð±ê" :
3021 ((immune_type == DEFENSE_COLD) ? "Î䵤" :
3022 ((immune_type == DEFENSE_POIS) ? "ÆÇ" :
3025 msg_format("For a while, You are immune to %s",
3026 ((immune_type == DEFENSE_ACID) ? "acid!" :
3027 ((immune_type == DEFENSE_ELEC) ? "electricity!" :
3028 ((immune_type == DEFENSE_FIRE) ? "fire!" :
3029 ((immune_type == DEFENSE_COLD) ? "cold!" :
3030 ((immune_type == DEFENSE_POIS) ? "poison!" :
3031 "do nothing special."))))));
3036 if (disturb_state) disturb(0, 0);
3038 /* Redraw status bar */
3039 p_ptr->redraw |= (PR_STATUS);
3041 p_ptr->update |= (PU_BONUS);
3051 * Set "p_ptr->oppose_acid", notice observable changes
3053 bool set_oppose_acid(int v, bool do_dec)
3055 bool notice = FALSE;
3057 /* Hack -- Force good values */
3058 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3060 if (p_ptr->is_dead) return FALSE;
3065 if (p_ptr->oppose_acid && !do_dec)
3067 if (p_ptr->oppose_acid > v) return FALSE;
3069 else if (!p_ptr->oppose_acid)
3072 msg_print("»À¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3074 msg_print("You feel resistant to acid!");
3084 if (p_ptr->oppose_acid && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3087 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3089 msg_print("You feel less resistant to acid.");
3097 p_ptr->oppose_acid = v;
3099 /* Nothing to notice */
3100 if (!notice) return (FALSE);
3102 /* Redraw status bar */
3103 p_ptr->redraw |= (PR_STATUS);
3106 if (disturb_state) disturb(0, 0);
3117 * Set "p_ptr->oppose_elec", notice observable changes
3119 bool set_oppose_elec(int v, bool do_dec)
3121 bool notice = FALSE;
3123 /* Hack -- Force good values */
3124 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3126 if (p_ptr->is_dead) return FALSE;
3131 if (p_ptr->oppose_elec && !do_dec)
3133 if (p_ptr->oppose_elec > v) return FALSE;
3135 else if (!p_ptr->oppose_elec)
3138 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3140 msg_print("You feel resistant to electricity!");
3150 if (p_ptr->oppose_elec && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3153 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3155 msg_print("You feel less resistant to electricity.");
3163 p_ptr->oppose_elec = v;
3165 /* Nothing to notice */
3166 if (!notice) return (FALSE);
3168 /* Redraw status bar */
3169 p_ptr->redraw |= (PR_STATUS);
3172 if (disturb_state) disturb(0, 0);
3183 * Set "p_ptr->oppose_fire", notice observable changes
3185 bool set_oppose_fire(int v, bool do_dec)
3187 bool notice = FALSE;
3189 /* Hack -- Force good values */
3190 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3192 if (p_ptr->is_dead) return FALSE;
3194 if ((prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
3198 if (p_ptr->oppose_fire && !do_dec)
3200 if (p_ptr->oppose_fire > v) return FALSE;
3202 else if (!p_ptr->oppose_fire)
3205 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3207 msg_print("You feel resistant to fire!");
3217 if (p_ptr->oppose_fire && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3220 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3222 msg_print("You feel less resistant to fire.");
3230 p_ptr->oppose_fire = v;
3232 /* Nothing to notice */
3233 if (!notice) return (FALSE);
3235 /* Redraw status bar */
3236 p_ptr->redraw |= (PR_STATUS);
3239 if (disturb_state) disturb(0, 0);
3250 * Set "p_ptr->oppose_cold", notice observable changes
3252 bool set_oppose_cold(int v, bool do_dec)
3254 bool notice = FALSE;
3256 /* Hack -- Force good values */
3257 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3259 if (p_ptr->is_dead) return FALSE;
3264 if (p_ptr->oppose_cold && !do_dec)
3266 if (p_ptr->oppose_cold > v) return FALSE;
3268 else if (!p_ptr->oppose_cold)
3271 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3273 msg_print("You feel resistant to cold!");
3283 if (p_ptr->oppose_cold && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3286 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3288 msg_print("You feel less resistant to cold.");
3296 p_ptr->oppose_cold = v;
3298 /* Nothing to notice */
3299 if (!notice) return (FALSE);
3301 /* Redraw status bar */
3302 p_ptr->redraw |= (PR_STATUS);
3305 if (disturb_state) disturb(0, 0);
3316 * Set "p_ptr->oppose_pois", notice observable changes
3318 bool set_oppose_pois(int v, bool do_dec)
3320 bool notice = FALSE;
3322 /* Hack -- Force good values */
3323 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3325 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) v = 1;
3326 if (p_ptr->is_dead) return FALSE;
3331 if (p_ptr->oppose_pois && !do_dec)
3333 if (p_ptr->oppose_pois > v) return FALSE;
3335 else if (!p_ptr->oppose_pois)
3338 msg_print("ÆǤؤÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3340 msg_print("You feel resistant to poison!");
3350 if (p_ptr->oppose_pois && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3353 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3355 msg_print("You feel less resistant to poison.");
3363 p_ptr->oppose_pois = v;
3365 /* Nothing to notice */
3366 if (!notice) return (FALSE);
3368 /* Redraw status bar */
3369 p_ptr->redraw |= (PR_STATUS);
3372 if (disturb_state) disturb(0, 0);
3383 * Set "p_ptr->stun", notice observable changes
3385 * Note the special code to only notice "range" changes.
3387 bool set_stun(int v)
3389 int old_aux, new_aux;
3390 bool notice = FALSE;
3393 /* Hack -- Force good values */
3394 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3396 if (p_ptr->is_dead) return FALSE;
3398 if (prace_is_(RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
3401 if (p_ptr->stun > 100)
3407 else if (p_ptr->stun > 50)
3413 else if (p_ptr->stun > 0)
3449 if (new_aux > old_aux)
3451 /* Describe the state */
3457 msg_print("°Õ¼±¤¬¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3459 msg_print("You have been stunned.");
3467 msg_print("°Õ¼±¤¬¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3469 msg_print("You have been heavily stunned.");
3477 msg_print("Ƭ¤¬¥¯¥é¥¯¥é¤·¤Æ°Õ¼±¤¬±ó¤Î¤¤¤Æ¤¤¿¡£");
3479 msg_print("You have been knocked out.");
3485 if (randint1(1000) < v || one_in_(16))
3488 msg_print("³ä¤ì¤ë¤è¤¦¤ÊƬÄˤ¬¤¹¤ë¡£");
3490 msg_print("A vicious blow hits your head.");
3495 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3496 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3498 else if (one_in_(2))
3500 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3504 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3507 if (p_ptr->special_defense & KATA_MASK)
3510 msg_print("·¿¤¬Êø¤ì¤¿¡£");
3512 msg_print("Your posture gets loose.");
3514 p_ptr->special_defense &= ~(KATA_MASK);
3515 p_ptr->update |= (PU_BONUS);
3516 p_ptr->update |= (PU_MONSTERS);
3517 p_ptr->redraw |= (PR_STATE);
3518 p_ptr->redraw |= (PR_STATUS);
3519 p_ptr->action = ACTION_NONE;
3527 else if (new_aux < old_aux)
3529 /* Describe the state */
3535 msg_print("¤ä¤Ã¤ÈÛ¯Û°¾õÂÖ¤«¤é²óÉü¤·¤¿¡£");
3537 msg_print("You are no longer stunned.");
3540 if (disturb_state) disturb(0, 0);
3552 if (!notice) return (FALSE);
3555 if (disturb_state) disturb(0, 0);
3557 /* Recalculate bonuses */
3558 p_ptr->update |= (PU_BONUS);
3560 /* Redraw the "stun" */
3561 p_ptr->redraw |= (PR_STUN);
3572 * Set "p_ptr->cut", notice observable changes
3574 * Note the special code to only notice "range" changes.
3578 int old_aux, new_aux;
3579 bool notice = FALSE;
3581 /* Hack -- Force good values */
3582 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3584 if (p_ptr->is_dead) return FALSE;
3586 if ((p_ptr->prace == RACE_GOLEM ||
3587 p_ptr->prace == RACE_SKELETON ||
3588 p_ptr->prace == RACE_SPECTRE ||
3589 (p_ptr->prace == RACE_ZOMBIE && p_ptr->lev > 11)) &&
3594 if (p_ptr->cut > 1000)
3600 else if (p_ptr->cut > 200)
3606 else if (p_ptr->cut > 100)
3612 else if (p_ptr->cut > 50)
3618 else if (p_ptr->cut > 25)
3624 else if (p_ptr->cut > 10)
3630 else if (p_ptr->cut > 0)
3690 if (new_aux > old_aux)
3692 /* Describe the state */
3698 msg_print("¤«¤¹¤ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3700 msg_print("You have been given a graze.");
3708 msg_print("·Ú¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3710 msg_print("You have been given a light cut.");
3718 msg_print("¤Ò¤É¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3720 msg_print("You have been given a bad cut.");
3728 msg_print("ÂçÊѤʽý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3730 msg_print("You have been given a nasty cut.");
3738 msg_print("½ÅÂç¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3740 msg_print("You have been given a severe cut.");
3748 msg_print("¤Ò¤É¤¤¿¼¼ê¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3750 msg_print("You have been given a deep gash.");
3758 msg_print("Ã×̿Ū¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3760 msg_print("You have been given a mortal wound.");
3769 if (randint1(1000) < v || one_in_(16))
3771 if (!p_ptr->sustain_chr)
3774 msg_print("¤Ò¤É¤¤½ýÀפ¬»Ä¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3776 msg_print("You have been horribly scarred.");
3786 else if (new_aux < old_aux)
3788 /* Describe the state */
3794 msg_format("¤ä¤Ã¤È%s¡£", p_ptr->prace == RACE_ANDROID ? "²ø²æ¤¬Ä¾¤Ã¤¿" : "½Ð·ì¤¬»ß¤Þ¤Ã¤¿");
3796 msg_print("You are no longer bleeding.");
3799 if (disturb_state) disturb(0, 0);
3811 if (!notice) return (FALSE);
3814 if (disturb_state) disturb(0, 0);
3816 /* Recalculate bonuses */
3817 p_ptr->update |= (PU_BONUS);
3819 /* Redraw the "cut" */
3820 p_ptr->redraw |= (PR_CUT);
3831 * Set "p_ptr->food", notice observable changes
3833 * The "p_ptr->food" variable can get as large as 20000, allowing the
3834 * addition of the most "filling" item, Elvish Waybread, which adds
3835 * 7500 food units, without overflowing the 32767 maximum limit.
3837 * Perhaps we should disturb the player with various messages,
3838 * especially messages about hunger status changes. XXX XXX XXX
3840 * Digestion of food is handled in "dungeon.c", in which, normally,
3841 * the player digests about 20 food units per 100 game turns, more
3842 * when "fast", more when "regenerating", less with "slow digestion",
3843 * but when the player is "gorged", he digests 100 food units per 10
3844 * game turns, or a full 1000 food units per 100 game turns.
3846 * Note that the player's speed is reduced by 10 units while gorged,
3847 * so if the player eats a single food ration (5000 food units) when
3848 * full (15000 food units), he will be gorged for (5000/100)*10 = 500
3849 * game turns, or 500/(100/5) = 25 player turns (if nothing else is
3850 * affecting the player speed).
3852 bool set_food(int v)
3854 int old_aux, new_aux;
3856 bool notice = FALSE;
3858 /* Hack -- Force good values */
3859 v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
3861 /* Fainting / Starving */
3862 if (p_ptr->food < PY_FOOD_FAINT)
3868 else if (p_ptr->food < PY_FOOD_WEAK)
3874 else if (p_ptr->food < PY_FOOD_ALERT)
3880 else if (p_ptr->food < PY_FOOD_FULL)
3886 else if (p_ptr->food < PY_FOOD_MAX)
3897 /* Fainting / Starving */
3898 if (v < PY_FOOD_FAINT)
3904 else if (v < PY_FOOD_WEAK)
3910 else if (v < PY_FOOD_ALERT)
3916 else if (v < PY_FOOD_FULL)
3922 else if (v < PY_FOOD_MAX)
3933 if (old_aux < 1 && new_aux > 0)
3934 chg_virtue(V_PATIENCE, 2);
3935 else if (old_aux < 3 && (old_aux != new_aux))
3936 chg_virtue(V_PATIENCE, 1);
3938 chg_virtue(V_TEMPERANCE, 1);
3940 chg_virtue(V_TEMPERANCE, -1);
3943 if (new_aux > old_aux)
3945 /* Describe the state */
3951 msg_print("¤Þ¤À¶õÊ¢¤ÇÅݤ줽¤¦¤À¡£");
3953 msg_print("You are still weak.");
3961 msg_print("¤Þ¤À¶õÊ¢¤À¡£");
3963 msg_print("You are still hungry.");
3971 msg_print("¶õÊ¢´¶¤¬¤ª¤µ¤Þ¤Ã¤¿¡£");
3973 msg_print("You are no longer hungry.");
3981 msg_print("ËþÊ¢¤À¡ª");
3983 msg_print("You are full!");
3991 msg_print("¿©¤Ù²á¤®¤À¡ª");
3993 msg_print("You have gorged yourself!");
3995 chg_virtue(V_HARMONY, -1);
3996 chg_virtue(V_PATIENCE, -1);
3997 chg_virtue(V_TEMPERANCE, -2);
4007 else if (new_aux < old_aux)
4009 /* Describe the state */
4012 /* Fainting / Starving */
4015 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
4017 msg_print("You are getting faint from hunger!");
4025 msg_print("¤ªÊ¢¤¬¶õ¤¤¤ÆÅݤ줽¤¦¤À¡£");
4027 msg_print("You are getting weak from hunger!");
4035 msg_print("¤ªÊ¢¤¬¶õ¤¤¤Æ¤¤¿¡£");
4037 msg_print("You are getting hungry.");
4045 msg_print("ËþÊ¢´¶¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
4047 msg_print("You are no longer full.");
4055 msg_print("¤ä¤Ã¤È¤ªÊ¢¤¬¤¤Ä¤¯¤Ê¤¯¤Ê¤Ã¤¿¡£");
4057 msg_print("You are no longer gorged.");
4063 if (p_ptr->wild_mode && (new_aux < 2))
4065 p_ptr->wilderness_x = px;
4066 p_ptr->wilderness_y = py;
4067 p_ptr->energy_need = 0;
4078 /* Nothing to notice */
4079 if (!notice) return (FALSE);
4082 if (disturb_state) disturb(0, 0);
4084 /* Recalculate bonuses */
4085 p_ptr->update |= (PU_BONUS);
4088 p_ptr->redraw |= (PR_HUNGER);
4098 * Increases a stat by one randomized level -RAK-
4100 * Note that this function (used by stat potions) now restores
4101 * the stat BEFORE increasing it.
4103 bool inc_stat(int stat)
4107 /* Then augment the current/max stat */
4108 value = p_ptr->stat_cur[stat];
4110 /* Cannot go above 18/100 */
4111 if (value < p_ptr->stat_max_max[stat])
4113 /* Gain one (sometimes two) points */
4116 gain = ((randint0(100) < 75) ? 1 : 2);
4120 /* Gain 1/6 to 1/3 of distance to 18/100 */
4121 else if (value < (p_ptr->stat_max_max[stat]-2))
4123 /* Approximate gain value */
4124 gain = (((p_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
4127 if (gain < 1) gain = 1;
4129 /* Apply the bonus */
4130 value += randint1(gain) + gain / 2;
4133 if (value > (p_ptr->stat_max_max[stat]-1)) value = p_ptr->stat_max_max[stat]-1;
4136 /* Gain one point at a time */
4142 /* Save the new value */
4143 p_ptr->stat_cur[stat] = value;
4145 /* Bring up the maximum too */
4146 if (value > p_ptr->stat_max[stat])
4148 p_ptr->stat_max[stat] = value;
4151 /* Recalculate bonuses */
4152 p_ptr->update |= (PU_BONUS);
4158 /* Nothing to gain */
4165 * Decreases a stat by an amount indended to vary from 0 to 100 percent.
4167 * Amount could be a little higher in extreme cases to mangle very high
4168 * stats from massive assaults. -CWS
4170 * Note that "permanent" means that the *given* amount is permanent,
4171 * not that the new value becomes permanent. This may not work exactly
4172 * as expected, due to "weirdness" in the algorithm, but in general,
4173 * if your stat is already drained, the "max" value will not drop all
4174 * the way down to the "cur" value.
4176 bool dec_stat(int stat, int amount, int permanent)
4178 int cur, max, loss, same, res = FALSE;
4181 /* Acquire current value */
4182 cur = p_ptr->stat_cur[stat];
4183 max = p_ptr->stat_max[stat];
4185 /* Note when the values are identical */
4186 same = (cur == max);
4188 /* Damage "current" value */
4191 /* Handle "low" values */
4194 if (amount > 90) cur--;
4195 if (amount > 50) cur--;
4196 if (amount > 20) cur--;
4200 /* Handle "high" values */
4203 /* Hack -- Decrement by a random amount between one-quarter */
4204 /* and one-half of the stat bonus times the percentage, with a */
4205 /* minimum damage of half the percentage. -CWS */
4206 loss = (((cur-18) / 2 + 1) / 2 + 1);
4209 if (loss < 1) loss = 1;
4211 /* Randomize the loss */
4212 loss = ((randint1(loss) + loss) * amount) / 100;
4215 if (loss < amount/2) loss = amount/2;
4217 /* Lose some points */
4220 /* Hack -- Only reduce stat to 17 sometimes */
4221 if (cur < 18) cur = (amount <= 20) ? 18 : 17;
4224 /* Prevent illegal values */
4225 if (cur < 3) cur = 3;
4227 /* Something happened */
4228 if (cur != p_ptr->stat_cur[stat]) res = TRUE;
4231 /* Damage "max" value */
4232 if (permanent && (max > 3))
4234 chg_virtue(V_SACRIFICE, 1);
4235 if (stat == A_WIS || stat == A_INT)
4236 chg_virtue(V_ENLIGHTEN, -2);
4238 /* Handle "low" values */
4241 if (amount > 90) max--;
4242 if (amount > 50) max--;
4243 if (amount > 20) max--;
4247 /* Handle "high" values */
4250 /* Hack -- Decrement by a random amount between one-quarter */
4251 /* and one-half of the stat bonus times the percentage, with a */
4252 /* minimum damage of half the percentage. -CWS */
4253 loss = (((max-18) / 2 + 1) / 2 + 1);
4254 loss = ((randint1(loss) + loss) * amount) / 100;
4255 if (loss < amount/2) loss = amount/2;
4257 /* Lose some points */
4260 /* Hack -- Only reduce stat to 17 sometimes */
4261 if (max < 18) max = (amount <= 20) ? 18 : 17;
4264 /* Hack -- keep it clean */
4265 if (same || (max < cur)) max = cur;
4267 /* Something happened */
4268 if (max != p_ptr->stat_max[stat]) res = TRUE;
4274 /* Actually set the stat to its new value. */
4275 p_ptr->stat_cur[stat] = cur;
4276 p_ptr->stat_max[stat] = max;
4278 /* Redisplay the stats later */
4279 p_ptr->redraw |= (PR_STATS);
4281 /* Recalculate bonuses */
4282 p_ptr->update |= (PU_BONUS);
4291 * Restore a stat. Return TRUE only if this actually makes a difference.
4293 bool res_stat(int stat)
4295 /* Restore if needed */
4296 if (p_ptr->stat_cur[stat] != p_ptr->stat_max[stat])
4299 p_ptr->stat_cur[stat] = p_ptr->stat_max[stat];
4301 /* Recalculate bonuses */
4302 p_ptr->update |= (PU_BONUS);
4304 /* Redisplay the stats later */
4305 p_ptr->redraw |= (PR_STATS);
4311 /* Nothing to restore */
4317 * Increase players hit points, notice effects
4319 bool hp_player(int num)
4322 vir = virtue_number(V_VITALITY);
4325 num = num * (p_ptr->virtues[vir - 1] + 1250) / 1250;
4327 /* Healing needed */
4328 if (p_ptr->chp < p_ptr->mhp)
4330 if ((num > 0) && (p_ptr->chp < (p_ptr->mhp/3)))
4331 chg_virtue(V_TEMPERANCE, 1);
4332 /* Gain hitpoints */
4335 /* Enforce maximum */
4336 if (p_ptr->chp >= p_ptr->mhp)
4338 p_ptr->chp = p_ptr->mhp;
4339 p_ptr->chp_frac = 0;
4343 p_ptr->redraw |= (PR_HP);
4346 p_ptr->window |= (PW_PLAYER);
4352 msg_print("¾¯¤·µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4354 msg_print("You feel a little better.");
4363 msg_print("µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4365 msg_print("You feel better.");
4374 msg_print("¤È¤Æ¤âµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4376 msg_print("You feel much better.");
4385 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4387 msg_print("You feel very good.");
4402 * Array of stat "descriptions"
4404 static cptr desc_stat_pos[] =
4446 * Array of stat "descriptions"
4448 static cptr desc_stat_neg[] =
4472 bool do_dec_stat(int stat)
4476 /* Access the "sustain" */
4479 case A_STR: if (p_ptr->sustain_str) sust = TRUE; break;
4480 case A_INT: if (p_ptr->sustain_int) sust = TRUE; break;
4481 case A_WIS: if (p_ptr->sustain_wis) sust = TRUE; break;
4482 case A_DEX: if (p_ptr->sustain_dex) sust = TRUE; break;
4483 case A_CON: if (p_ptr->sustain_con) sust = TRUE; break;
4484 case A_CHR: if (p_ptr->sustain_chr) sust = TRUE; break;
4488 if (sust && (!ironman_nightmare || randint0(13)))
4492 msg_format("%s¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¤¬¡¢¤¹¤°¤Ë¸µ¤ËÌá¤Ã¤¿¡£",
4494 msg_format("You feel %s for a moment, but the feeling passes.",
4497 desc_stat_neg[stat]);
4503 /* Attempt to reduce the stat */
4504 if (dec_stat(stat, 10, (ironman_nightmare && !randint0(13))))
4508 msg_format("¤Ò¤É¤¯%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_neg[stat]);
4510 msg_format("You feel very %s.", desc_stat_neg[stat]);
4518 /* Nothing obvious */
4524 * Restore lost "points" in a stat
4526 bool do_res_stat(int stat)
4528 /* Attempt to increase */
4533 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4535 msg_format("You feel less %s.", desc_stat_neg[stat]);
4543 /* Nothing obvious */
4549 * Gain a "point" in a stat
4551 bool do_inc_stat(int stat)
4555 /* Restore strength */
4556 res = res_stat(stat);
4558 /* Attempt to increase */
4563 chg_virtue(V_ENLIGHTEN, 1);
4564 chg_virtue(V_FAITH, 1);
4566 else if (stat == A_INT)
4568 chg_virtue(V_KNOWLEDGE, 1);
4569 chg_virtue(V_ENLIGHTEN, 1);
4571 else if (stat == A_CON)
4572 chg_virtue(V_VITALITY, 1);
4576 msg_format("¥ï¡¼¥ª¡ª¤È¤Æ¤â%s¤Ê¤Ã¤¿¡ª", desc_stat_pos[stat]);
4578 msg_format("Wow! You feel very %s!", desc_stat_pos[stat]);
4586 /* Restoration worked */
4591 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4593 msg_format("You feel less %s.", desc_stat_neg[stat]);
4601 /* Nothing obvious */
4607 * Restores any drained experience
4609 bool restore_level(void)
4611 /* Restore experience */
4612 if (p_ptr->exp < p_ptr->max_exp)
4616 msg_print("À¸Ì¿ÎϤ¬Ìá¤Ã¤Æ¤¤¿µ¤¤¬¤¹¤ë¡£");
4618 msg_print("You feel your life energies returning.");
4622 /* Restore the experience */
4623 p_ptr->exp = p_ptr->max_exp;
4625 /* Check the experience */
4640 bool lose_all_info(void)
4644 chg_virtue(V_KNOWLEDGE, -5);
4645 chg_virtue(V_ENLIGHTEN, -5);
4647 /* Forget info about objects */
4648 for (i = 0; i < INVEN_TOTAL; i++)
4650 object_type *o_ptr = &inventory[i];
4652 /* Skip non-objects */
4653 if (!o_ptr->k_idx) continue;
4655 /* Allow "protection" by the MENTAL flag */
4656 if (o_ptr->ident & (IDENT_MENTAL)) continue;
4658 /* Remove "default inscriptions" */
4659 o_ptr->feeling = FEEL_NONE;
4661 /* Hack -- Clear the "empty" flag */
4662 o_ptr->ident &= ~(IDENT_EMPTY);
4664 /* Hack -- Clear the "known" flag */
4665 o_ptr->ident &= ~(IDENT_KNOWN);
4667 /* Hack -- Clear the "felt" flag */
4668 o_ptr->ident &= ~(IDENT_SENSE);
4671 /* Recalculate bonuses */
4672 p_ptr->update |= (PU_BONUS);
4674 /* Combine / Reorder the pack (later) */
4675 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
4678 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
4680 /* Mega-Hack -- Forget the map */
4688 void do_poly_wounds(void)
4690 /* Changed to always provide at least _some_ healing */
4691 s16b wounds = p_ptr->cut;
4692 s16b hit_p = (p_ptr->mhp - p_ptr->chp);
4693 s16b change = damroll(p_ptr->lev, 5);
4694 bool Nasty_effect = one_in_(5);
4696 if (!(wounds || hit_p || Nasty_effect)) return;
4699 msg_print("½ý¤¬¤è¤ê·Ú¤¤¤â¤Î¤ËÊѲ½¤·¤¿¡£");
4701 msg_print("Your wounds are polymorphed into less serious ones.");
4708 msg_print("¿·¤¿¤Ê½ý¤¬¤Ç¤¤¿¡ª");
4709 take_hit(DAMAGE_LOSELIFE, change / 2, "ÊѲ½¤·¤¿½ý", -1);
4711 msg_print("A new wound was created!");
4712 take_hit(DAMAGE_LOSELIFE, change / 2, "a polymorphed wound", -1);
4719 set_cut(p_ptr->cut - (change / 2));
4724 void do_poly_self(void)
4726 int power = p_ptr->lev;
4729 msg_print("¤¢¤Ê¤¿¤ÏÊѲ½¤Îˬ¤ì¤ò´¶¤¸¤¿...");
4731 msg_print("You feel a change coming over you...");
4734 chg_virtue(V_CHANCE, 1);
4736 if ((power > randint0(20)) && one_in_(3) && (p_ptr->prace != RACE_ANDROID))
4738 char effect_msg[80] = "";
4739 int new_race, expfact, goalexpfact, h_percent;
4741 /* Some form of racial polymorph... */
4744 if ((power > randint0(5)) && one_in_(4))
4749 if (p_ptr->psex == SEX_MALE)
4751 p_ptr->psex = SEX_FEMALE;
4752 sp_ptr = &sex_info[p_ptr->psex];
4754 sprintf(effect_msg, "½÷À¤Î");
4756 sprintf(effect_msg, "female ");
4762 p_ptr->psex = SEX_MALE;
4763 sp_ptr = &sex_info[p_ptr->psex];
4765 sprintf(effect_msg, "ÃËÀ¤Î");
4767 sprintf(effect_msg, "male ");
4773 if ((power > randint0(30)) && one_in_(5))
4777 /* Harmful deformity */
4784 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
4790 /* Deformities are discriminated against! */
4791 (void)dec_stat(A_CHR, randint1(6), TRUE);
4797 sprintf(tmp_msg,"%s",effect_msg);
4798 sprintf(effect_msg,"´ñ·Á¤Î%s",tmp_msg);
4800 sprintf(tmp_msg,"%s ",effect_msg);
4801 sprintf(effect_msg,"deformed %s ",tmp_msg);
4808 sprintf(effect_msg,"´ñ·Á¤Î");
4810 sprintf(effect_msg,"deformed ");
4816 while ((power > randint0(20)) && one_in_(10))
4818 /* Polymorph into a less mutated form */
4821 if (!lose_mutation(0))
4823 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
4825 msg_print("You feel oddly normal.");
4831 * Restrict the race choices by exp penalty so
4832 * weak polymorph always means weak race
4837 goalexpfact = 100 + 3 * randint0(power);
4841 new_race = randint0(MAX_RACES);
4842 expfact = race_info[new_race].r_exp;
4844 while (((new_race == p_ptr->prace) && (expfact > goalexpfact)) || (new_race == RACE_ANDROID));
4847 msg_format("¤¢¤Ê¤¿¤Ï%s%s¤ËÊѲ½¤·¤¿¡ª", effect_msg,
4848 race_info[new_race].title);
4852 msg_format("You turn into a%s %s!",
4853 ((new_race == RACE_AMBERITE || new_race == RACE_ELF
4854 || new_race == RACE_IMP) ? "n" : ""),
4855 race_info[new_race].title);
4859 msg_format("You turn into a %s%s!", effect_msg,
4860 race_info[new_race].title);
4864 chg_virtue(V_CHANCE, 2);
4866 if (p_ptr->prace < 32)
4868 p_ptr->old_race1 |= 1L << p_ptr->prace;
4872 p_ptr->old_race2 = 1L << (p_ptr->prace-32);
4874 p_ptr->prace = new_race;
4875 rp_ptr = &race_info[p_ptr->prace];
4877 /* Experience factor */
4878 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
4880 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)))
4881 p_ptr->expfact -= 15;
4884 /* Calculate the height/weight for males */
4885 if (p_ptr->psex == SEX_MALE)
4887 p_ptr->ht = randnor(rp_ptr->m_b_ht, rp_ptr->m_m_ht);
4888 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->m_b_ht);
4889 p_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * h_percent /100
4890 , (int)(rp_ptr->m_m_wt) * h_percent / 300 );
4893 /* Calculate the height/weight for females */
4894 else if (p_ptr->psex == SEX_FEMALE)
4896 p_ptr->ht = randnor(rp_ptr->f_b_ht, rp_ptr->f_m_ht);
4897 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->f_b_ht);
4898 p_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * h_percent /100
4899 , (int)(rp_ptr->f_m_wt) * h_percent / 300 );
4905 if (p_ptr->pclass == CLASS_SORCERER)
4906 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
4908 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
4910 do_cmd_rerate(FALSE);
4912 p_ptr->redraw |= (PR_BASIC);
4914 p_ptr->update |= (PU_BONUS);
4920 if ((power > randint0(30)) && one_in_(6))
4928 msg_format("%s¤Î¹½À®¤¬ÊѲ½¤·¤¿¡ª", p_ptr->prace == RACE_ANDROID ? "µ¡³£" : "Æâ¡");
4930 msg_print("Your internal organs are rearranged!");
4935 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
4941 msg_print("¸½ºß»Ñ¤ÇÀ¸¤¤Æ¤¤¤¯¤Î¤Ïº¤Æñ¤Ê¤è¤¦¤À¡ª");
4942 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), "Ã×̿Ū¤ÊÆÍÁ³ÊÑ°Û", -1);
4944 msg_print("You find living difficult in your present form!");
4945 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), "a lethal mutation", -1);
4952 if ((power > randint0(20)) && one_in_(4))
4957 do_cmd_rerate(FALSE);
4960 while ((power > randint0(15)) && one_in_(3))
4963 (void)gain_random_mutation(0);
4966 if (power > randint0(5))
4972 /* Note: earlier deductions may have left power < 0 already. */
4982 * Decreases players hit points and sets death flag if necessary
4984 * XXX XXX XXX Invulnerability needs to be changed into a "shield"
4986 * XXX XXX XXX Hack -- this function allows the user to save (or quit)
4987 * the game when he dies, since the "You die." message is shown before
4988 * setting the player to "dead".
4990 int take_hit(int damage_type, int damage, cptr hit_from, int monspell)
4992 int old_chp = p_ptr->chp;
4994 char death_message[1024];
4997 int warning = (p_ptr->mhp * hitpoint_warn / 10);
5000 if (p_ptr->is_dead) return 0;
5002 if (p_ptr->sutemi) damage *= 2;
5003 if (p_ptr->special_defense & KATA_IAI) damage += (damage + 4) / 5;
5005 if (easy_band) damage = (damage+1)/2;
5007 if (damage_type != DAMAGE_USELIFE)
5017 if (monspell >= 0) learn_spell(monspell);
5019 /* Mega-Hack -- Apply "invulnerability" */
5020 if ((damage_type != DAMAGE_USELIFE) && (damage_type != DAMAGE_LOSELIFE))
5022 if ((p_ptr->invuln || ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == MUSIC_INVULN))) && (damage < 9000))
5024 if (damage_type == DAMAGE_FORCE)
5027 msg_print("¥Ð¥ê¥¢¤¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5029 msg_print("The attack cuts your shield of invulnerability open!");
5032 else if (one_in_(PENETRATE_INVULNERABILITY))
5035 msg_print("̵Ũ¤Î¥Ð¥ê¥¢¤òÇˤäƹ¶·â¤µ¤ì¤¿¡ª");
5037 msg_print("The attack penetrates your shield of invulnerability!");
5046 /* Multishadow effects is determined by turn */
5047 if (p_ptr->multishadow && (turn & 1))
5049 if (damage_type == DAMAGE_FORCE)
5052 msg_print("¸¸±Æ¤â¤í¤È¤âÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5054 msg_print("The attack hits Shadow together with you!");
5057 else if (damage_type == DAMAGE_ATTACK)
5060 msg_print("¹¶·â¤Ï¸¸±Æ¤ËÌ¿Ã椷¡¢¤¢¤Ê¤¿¤Ë¤ÏÆϤ«¤Ê¤«¤Ã¤¿¡£");
5062 msg_print("The attack hits Shadow, you are unharmed!");
5068 if (p_ptr->wraith_form)
5070 if (damage_type == DAMAGE_FORCE)
5073 msg_print("Ⱦʪ¼Á¤ÎÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5075 msg_print("The attack cuts through your ethereal body!");
5081 if ((damage == 0) && one_in_(2)) damage = 1;
5085 if ((p_ptr->special_defense & KATA_MUSOU))
5088 if ((damage == 0) && one_in_(2)) damage = 1;
5090 } /* not if LOSELIFE USELIFE */
5092 /* Hurt the player */
5093 p_ptr->chp -= damage;
5094 if(damage_type == DAMAGE_GENO && p_ptr->chp < 0)
5096 damage += p_ptr->chp;
5100 /* Display the hitpoints */
5101 p_ptr->redraw |= (PR_HP);
5104 p_ptr->window |= (PW_PLAYER);
5108 if (damage_type != DAMAGE_GENO && p_ptr->chp == 0)
5110 chg_virtue(V_SACRIFICE, 1);
5111 chg_virtue(V_CHANCE, 2);
5118 bool android = (p_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
5120 #ifdef JP /* »à¤ó¤À»þ¤Ë¶¯À©½ªÎ»¤·¤Æ»à¤ò²óÈò¤Ç¤¤Ê¤¯¤·¤Æ¤ß¤¿ by Habu */
5122 if(!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
5128 chg_virtue(V_SACRIFICE, 10);
5131 p_ptr->leaving = TRUE;
5134 p_ptr->is_dead = TRUE;
5136 if (p_ptr->inside_arena)
5138 cptr m_name = r_name+r_info[arena_monsters[p_ptr->arena_number]].name;
5140 msg_format("¤¢¤Ê¤¿¤Ï%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£", m_name);
5142 msg_format("You are beaten by %s.", m_name);
5145 if (record_arena) do_cmd_write_nikki(NIKKI_ARENA, 99, m_name);
5150 /* Make screen dump */
5151 screen_dump = make_screen_dump();
5154 /* Note cause of death */
5156 sprintf(p_ptr->died_from, "%s%s%s", !p_ptr->paralyzed ? "" : p_ptr->free_act ? "ĦÁü¾õÂÖ¤Ç":"Ëãáã¾õÂÖ¤Ç", p_ptr->image ? "¸¸³Ð¤ËÏĤó¤À" : "", hit_from);
5158 sprintf(p_ptr->died_from, "%s%s", hit_from, !p_ptr->paralyzed ? "" : " while helpless");
5161 /* No longer a winner */
5162 p_ptr->total_winner = FALSE;
5164 if (p_ptr->inside_arena)
5166 strcpy(buf,"¥¢¥ê¡¼¥Ê");
5168 strcpy(buf,"in the Arena");
5170 else if (!dun_level)
5174 strcpy(buf,"on the surface");
5176 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)))
5178 strcpy(buf,"¥¯¥¨¥¹¥È");
5180 strcpy(buf,"in a quest");
5184 sprintf(buf,"%d³¬", dun_level);
5186 sprintf(buf,"level %d", dun_level);
5189 sprintf(tmp,"%s¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£",buf, p_ptr->died_from);
5191 sprintf(tmp,"killed by %s %s.", p_ptr->died_from, buf);
5193 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5195 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- ¥²¡¼¥à¥ª¡¼¥Ð¡¼ --------");
5197 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- Game Over --------");
5199 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, "\n\n\n\n");
5204 if (get_check_strict("²èÌ̤òÊݸ¤·¤Þ¤¹¤«¡©", CHECK_NO_HISTORY))
5206 if (get_check_strict("Dump the screen? ", CHECK_NO_HISTORY))
5210 do_cmd_save_screen();
5215 /* Hack -- Note death */
5219 msg_format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë");
5221 msg_print(android ? "You are broken." : "You die.");
5228 if (streq(p_ptr->died_from, "Seppuku"))
5231 get_rnd_line("seppuku_j.txt", 0, death_message);
5233 get_rnd_line("seppuku.txt", 0, death_message);
5239 get_rnd_line("death_j.txt", 0, death_message);
5241 get_rnd_line("death.txt", 0, death_message);
5245 while (!get_string(streq(p_ptr->died_from, "Seppuku") ? "¼À¤¤Î¶ç: " : "ÃÇËöËâ¤Î¶«¤Ó: ", death_message, 1024)) ;
5247 while (!get_string("Last word: ", death_message, 1024)) ;
5249 if (death_message[0] == '\0')
5252 strcpy(death_message, format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë"));
5254 strcpy(death_message, android ? "You are broken." : "You die.");
5257 if (streq(p_ptr->died_from, "Seppuku"))
5263 int msg_pos_x[9] = { 5, 7, 9, 12, 14, 17, 19, 21, 23};
5264 int msg_pos_y[9] = { 3, 4, 5, 4, 5, 4, 5, 6, 4};
5271 for (i = 0; i < 40; i++)
5272 Term_putstr(randint0(w / 2) * 2, randint0(h), 2, TERM_VIOLET, "¦Ô");
5274 str = death_message;
5275 if (strncmp(str, "¡Ö", 2) == 0) str += 2;
5277 str2 = strstr_j(str, "¡×");
5278 if (str2 != NULL) *str2 = '\0';
5283 str2 = strstr_j(str, " ");
5284 if (str2 == NULL) len = strlen(str);
5285 else len = str2 - str;
5289 Term_putstr_v(w * 3 / 4 - 2 - msg_pos_x[i] * 2, msg_pos_y[i], len,
5291 if (str2 == NULL) break;
5295 if (*str == 0) break;
5299 Term_putstr(w-1, h-1, 1, TERM_WHITE, " ");
5303 /* Make screen dump */
5304 screen_dump = make_screen_dump();
5307 /* Wait a key press */
5310 msg_print(death_message);
5314 msg_print(death_message);
5322 /* Hitpoint warning */
5323 if (p_ptr->chp < warning)
5325 /* Hack -- bell on first notice */
5326 if (alert_hitpoint && (old_chp > warning)) bell();
5330 if (record_danger && (old_chp > warning))
5332 if (p_ptr->image && damage_type == DAMAGE_ATTACK)
5336 hit_from = "something";
5340 sprintf(tmp,"%s¤Ë¤è¤Ã¤Æ¥Ô¥ó¥Á¤Ë´Ù¤¤¤Ã¤¿¡£",hit_from);
5342 sprintf(tmp,"A critical situation because of %s.",hit_from);
5344 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5349 /* stop auto_more even if DAMAGE_USELIFE */
5355 msg_print("*** ·Ù¹ð:Äã¥Ò¥Ã¥È¡¦¥Ý¥¤¥ó¥È¡ª ***");
5357 msg_print("*** LOW HITPOINT WARNING! ***");
5363 if (p_ptr->wild_mode && !p_ptr->leaving && (p_ptr->chp < MAX(warning, p_ptr->mhp/5)))
5365 p_ptr->wilderness_x = px;
5366 p_ptr->wilderness_y = py;
5367 p_ptr->energy_need = 0;
5377 void gain_exp(s32b amount)
5379 if (p_ptr->is_dead) return;
5381 if (p_ptr->prace == RACE_ANDROID) return;
5383 /* Gain some experience */
5384 p_ptr->exp += amount;
5386 /* Slowly recover from experience drainage */
5387 if (p_ptr->exp < p_ptr->max_exp)
5389 /* Gain max experience (20%) (was 10%) */
5390 p_ptr->max_exp += amount / 5;
5393 /* Check Experience */
5398 void calc_android_exp(void)
5402 if (p_ptr->is_dead) return;
5404 if (p_ptr->prace != RACE_ANDROID) return;
5406 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5408 object_type *o_ptr = &inventory[i];
5410 object_type *q_ptr = &forge;
5412 int level = MAX(get_object_level(o_ptr) - 8, 1);
5414 if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue;
5415 if (!o_ptr->k_idx) continue;
5417 /* Wipe the object */
5420 object_copy(q_ptr, o_ptr);
5421 q_ptr->discount = 0;
5422 q_ptr->curse_flags = 0L;
5426 level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
5427 level += MIN(20, a_info[o_ptr->name1].rarity/(a_info[o_ptr->name1].gen_flags & TRG_INSTA_ART ? 10 : 3));
5429 else if (o_ptr->name2) level += MAX(3, (e_info[o_ptr->name2].rating - 5)/2);
5430 value = object_value_real(q_ptr);
5432 if (value <= 0) continue;
5433 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (p_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
5434 if (value > 5000000L) value = 5000000L;
5435 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
5437 if (o_ptr->name1 || o_ptr->name2 || o_ptr->art_name ||
5438 (o_ptr->tval == TV_DRAG_ARMOR) ||
5439 ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) ||
5440 ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) ||
5441 ((o_ptr->tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)) ||
5442 ((o_ptr->tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) ||
5443 ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE)))
5445 if (level > 65) level = 35 + (level - 65) / 5;
5446 else if (level > 35) level = 25 + (level - 35) / 3;
5447 else if (level > 15) level = 15 + (level - 15) / 2;
5448 exp = MIN(100000L, value) * level * level / 2;
5449 if (value > 100000L)
5450 exp += (value - 100000L) * level * level / 8;
5454 exp = MIN(100000L, value) * level;
5455 if (value > 100000L)
5456 exp += (value - 100000L) * level / 4;
5458 if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (buki_motteruka(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
5459 else total_exp += exp / 16;
5460 if (i == INVEN_BODY) total_exp += exp / 32;
5462 p_ptr->exp = p_ptr->max_exp = total_exp;
5464 /* Check Experience */
5472 void lose_exp(s32b amount)
5474 if (p_ptr->prace == RACE_ANDROID) return;
5476 /* Never drop below zero experience */
5477 if (amount > p_ptr->exp) amount = p_ptr->exp;
5479 /* Lose some experience */
5480 p_ptr->exp -= amount;
5482 /* Check Experience */
5486 bool set_ultimate_res(int v, bool do_dec)
5488 bool notice = FALSE;
5490 /* Hack -- Force good values */
5491 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5493 if (p_ptr->is_dead) return FALSE;
5498 if (p_ptr->ult_res && !do_dec)
5500 if (p_ptr->ult_res > v) return FALSE;
5502 else if (!p_ptr->ult_res)
5505 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5507 msg_print("You feel resistant!");
5520 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5522 msg_print("You feel less resistant");
5532 /* Redraw status bar */
5533 p_ptr->redraw |= (PR_STATUS);
5535 /* Nothing to notice */
5536 if (!notice) return (FALSE);
5539 if (disturb_state) disturb(0, 0);
5541 /* Recalculate bonuses */
5542 p_ptr->update |= (PU_BONUS);
5551 bool set_tim_res_nether(int v, bool do_dec)
5553 bool notice = FALSE;
5555 /* Hack -- Force good values */
5556 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5558 if (p_ptr->is_dead) return FALSE;
5563 if (p_ptr->tim_res_nether && !do_dec)
5565 if (p_ptr->tim_res_nether > v) return FALSE;
5567 else if (!p_ptr->tim_res_nether)
5570 msg_print("ÃϹö¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5572 msg_print("You feel nether resistant!");
5582 if (p_ptr->tim_res_nether)
5585 msg_print("ÃϹö¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5587 msg_print("You feel less nether resistant");
5595 p_ptr->tim_res_nether = v;
5597 /* Redraw status bar */
5598 p_ptr->redraw |= (PR_STATUS);
5600 /* Nothing to notice */
5601 if (!notice) return (FALSE);
5604 if (disturb_state) disturb(0, 0);
5606 /* Recalculate bonuses */
5607 p_ptr->update |= (PU_BONUS);
5616 bool set_tim_res_time(int v, bool do_dec)
5618 bool notice = FALSE;
5620 /* Hack -- Force good values */
5621 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5623 if (p_ptr->is_dead) return FALSE;
5628 if (p_ptr->tim_res_time && !do_dec)
5630 if (p_ptr->tim_res_time > v) return FALSE;
5632 else if (!p_ptr->tim_res_time)
5635 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5637 msg_print("You feel time resistant!");
5647 if (p_ptr->tim_res_time)
5650 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5652 msg_print("You feel less time resistant");
5660 p_ptr->tim_res_time = v;
5662 /* Redraw status bar */
5663 p_ptr->redraw |= (PR_STATUS);
5665 /* Nothing to notice */
5666 if (!notice) return (FALSE);
5669 if (disturb_state) disturb(0, 0);
5671 /* Recalculate bonuses */
5672 p_ptr->update |= (PU_BONUS);
5683 * Choose a warrior-mage elemental attack. -LM-
5685 bool choose_ele_attack(void)
5694 num = (p_ptr->lev - 20) / 5;
5697 c_prt(TERM_RED, " a) ¾Æ´þ", 2, 14);
5699 c_prt(TERM_RED, " a) Fire Brand", 2, 14);
5703 if (num >= 2) c_prt(TERM_L_WHITE," b) Åà·ë", 3, 14);
5705 if (num >= 2) c_prt(TERM_L_WHITE," b) Cold Brand", 3, 14);
5707 else prt("", 3, 14);
5710 if (num >= 3) c_prt(TERM_GREEN, " c) ÆÇ»¦", 4, 14);
5712 if (num >= 3) c_prt(TERM_GREEN, " c) Poison Brand", 4, 14);
5714 else prt("", 4, 14);
5717 if (num >= 4) c_prt(TERM_L_DARK, " d) Íϲò", 5, 14);
5719 if (num >= 4) c_prt(TERM_L_DARK, " d) Acid Brand", 5, 14);
5721 else prt("", 5, 14);
5724 if (num >= 5) c_prt(TERM_BLUE, " e) ÅÅ·â", 6, 14);
5726 if (num >= 5) c_prt(TERM_BLUE, " e) Elec Brand", 6, 14);
5728 else prt("", 6, 14);
5736 prt(" ¤É¤Î¸µÁǹ¶·â¤ò¤·¤Þ¤¹¤«¡©", 1, 14);
5738 prt(" Choose a temporary elemental brand ", 1, 14);
5743 if ((choice == 'a') || (choice == 'A'))
5744 set_ele_attack(ATTACK_FIRE, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5745 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
5746 set_ele_attack(ATTACK_COLD, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5747 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
5748 set_ele_attack(ATTACK_POIS, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5749 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
5750 set_ele_attack(ATTACK_ACID, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5751 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
5752 set_ele_attack(ATTACK_ELEC, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5756 msg_print("ËâË¡·õ¤ò»È¤¦¤Î¤ò¤ä¤á¤¿¡£");
5758 msg_print("You cancel the temporary branding.");
5770 * Choose a elemental immune. -LM-
5772 bool choose_ele_immune(int turn)
5780 c_prt(TERM_RED, " a) ²Ð±ê", 2, 14);
5782 c_prt(TERM_RED, " a) Immune Fire", 2, 14);
5786 c_prt(TERM_L_WHITE," b) Î䵤", 3, 14);
5788 c_prt(TERM_L_WHITE," b) Immune Cold", 3, 14);
5792 c_prt(TERM_L_DARK, " c) »À", 4, 14);
5794 c_prt(TERM_L_DARK, " c) Immune Acid", 4, 14);
5798 c_prt(TERM_BLUE, " d) ÅÅ·â", 5, 14);
5800 c_prt(TERM_BLUE, " d) Immune Elec", 5, 14);
5811 prt(" ¤É¤Î¸µÁǤÎÌȱ֤ò¤Ä¤±¤Þ¤¹¤«¡©", 1, 14);
5813 prt(" Choose a temporary elemental immune ", 1, 14);
5818 if ((choice == 'a') || (choice == 'A'))
5819 set_ele_immune(DEFENSE_FIRE, turn);
5820 else if ((choice == 'b') || (choice == 'B'))
5821 set_ele_immune(DEFENSE_COLD, turn);
5822 else if ((choice == 'c') || (choice == 'C'))
5823 set_ele_immune(DEFENSE_ACID, turn);
5824 else if ((choice == 'd') || (choice == 'D'))
5825 set_ele_immune(DEFENSE_ELEC, turn);
5829 msg_print("Ìȱ֤òÉÕ¤±¤ë¤Î¤ò¤ä¤á¤¿¡£");
5831 msg_print("You cancel the temporary immune.");