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->tim_ffall = 0;
175 p_ptr->tim_sh_touki = 0;
176 p_ptr->tim_sh_fire = 0;
177 p_ptr->tim_sh_holy = 0;
178 p_ptr->tim_eyeeye = 0;
179 p_ptr->resist_magic = 0;
182 p_ptr->tim_res_nether = 0;
183 p_ptr->tim_res_time = 0;
184 p_ptr->tim_mimic = 0;
185 p_ptr->mimic_form = 0;
186 p_ptr->tim_reflect = 0;
187 p_ptr->multishadow = 0;
189 p_ptr->action = ACTION_NONE;
192 p_ptr->oppose_acid = 0; /* Timed -- oppose acid */
193 p_ptr->oppose_elec = 0; /* Timed -- oppose lightning */
194 p_ptr->oppose_fire = 0; /* Timed -- oppose heat */
195 p_ptr->oppose_cold = 0; /* Timed -- oppose cold */
196 p_ptr->oppose_pois = 0; /* Timed -- oppose poison */
198 p_ptr->word_recall = FALSE;
199 p_ptr->sutemi = FALSE;
200 p_ptr->counter = FALSE;
201 p_ptr->ele_attack = 0;
202 p_ptr->ele_immune = 0;
203 p_ptr->special_attack = 0L;
204 p_ptr->special_defense = 0L;
206 while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
207 world_player = FALSE;
209 if (prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
210 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1;
211 if (p_ptr->pclass == CLASS_BERSERKER) p_ptr->shero = 1;
215 m_list[p_ptr->riding].fast = 0;
216 m_list[p_ptr->riding].slow = 0;
217 m_list[p_ptr->riding].invulner = 0;
220 if (p_ptr->pclass == CLASS_BARD)
222 p_ptr->magic_num1[0] = 0;
223 p_ptr->magic_num2[0] = 0;
229 * Set "p_ptr->tim_mimic", and "p_ptr->mimic_form",
230 * notice observable changes
232 bool set_mimic(int v, int p, bool do_dec)
236 /* Hack -- Force good values */
237 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
239 if (p_ptr->is_dead) return FALSE;
244 if (p_ptr->tim_mimic && (p_ptr->mimic_form == p) && !do_dec)
246 if (p_ptr->tim_mimic > v) return FALSE;
248 else if ((!p_ptr->tim_mimic) || (p_ptr->mimic_form != p))
251 msg_print("¼«Ê¬¤ÎÂΤ¬ÊѤï¤Ã¤Æ¤æ¤¯¤Î¤ò´¶¤¸¤¿¡£");
253 msg_print("You feel that your body changes.");
263 if (p_ptr->tim_mimic)
266 msg_print("ÊѿȤ¬²ò¤±¤¿¡£");
268 msg_print("You are no longer transformed.");
270 if (p_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(0, TRUE);
278 p_ptr->tim_mimic = v;
280 /* Nothing to notice */
289 p_ptr->redraw |= (PR_BASIC | PR_STATUS);
291 /* Recalculate bonuses */
292 p_ptr->update |= (PU_BONUS | PU_HP);
301 * Set "p_ptr->blind", notice observable changes
303 * Note the use of "PU_UN_LITE" and "PU_UN_VIEW", which is needed to
304 * memorize any terrain features which suddenly become "visible".
305 * Note that blindness is currently the only thing which can affect
306 * "player_can_see_bold()".
308 bool set_blind(int v)
312 /* Hack -- Force good values */
313 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
315 if (p_ptr->is_dead) return FALSE;
322 if (p_ptr->prace == RACE_ANDROID)
325 msg_print("¥»¥ó¥µ¡¼¤ò¤ä¤é¤ì¤¿¡ª");
327 msg_print("You are blind!");
333 msg_print("Ìܤ¬¸«¤¨¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
335 msg_print("You are blind!");
340 chg_virtue(V_ENLIGHTEN, -1);
349 if (p_ptr->prace == RACE_ANDROID)
352 msg_print("¥»¥ó¥µ¡¼¤¬Éüµì¤·¤¿¡£");
354 msg_print("You can see again.");
360 msg_print("¤ä¤Ã¤ÈÌܤ¬¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
362 msg_print("You can see again.");
373 /* Redraw status bar */
374 p_ptr->redraw |= (PR_STATUS);
376 /* Nothing to notice */
377 if (!notice) return (FALSE);
380 if (disturb_state) disturb(0, 0);
382 /* Fully update the visuals */
383 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS);
386 p_ptr->redraw |= (PR_MAP);
389 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
400 * Set "p_ptr->confused", notice observable changes
402 bool set_confused(int v)
406 /* Hack -- Force good values */
407 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
409 if (p_ptr->is_dead) return FALSE;
414 if (!p_ptr->confused)
417 msg_print("¤¢¤Ê¤¿¤Ïº®Í𤷤¿¡ª");
419 msg_print("You are confused!");
422 if (p_ptr->action == ACTION_KAMAE)
425 msg_print("¹½¤¨¤¬¤È¤±¤¿¡£");
427 msg_print("Your posture gets loose.");
429 p_ptr->special_defense &= ~(KAMAE_MASK);
430 p_ptr->update |= (PU_BONUS);
431 p_ptr->redraw |= (PR_STATE);
432 p_ptr->action = ACTION_NONE;
434 else if (p_ptr->action == ACTION_KATA)
437 msg_print("·¿¤¬Êø¤ì¤¿¡£");
439 msg_print("Your posture gets loose.");
441 p_ptr->special_defense &= ~(KATA_MASK);
442 p_ptr->update |= (PU_BONUS);
443 p_ptr->update |= (PU_MONSTERS);
444 p_ptr->redraw |= (PR_STATE);
445 p_ptr->redraw |= (PR_STATUS);
446 p_ptr->action = ACTION_NONE;
450 p_ptr->counter = FALSE;
451 chg_virtue(V_HARMONY, -1);
461 msg_print("¤ä¤Ã¤Èº®Í𤬤ª¤µ¤Þ¤Ã¤¿¡£");
463 msg_print("You feel less confused now.");
466 p_ptr->special_attack &= ~(ATTACK_SUIKEN);
474 /* Redraw status bar */
475 p_ptr->redraw |= (PR_STATUS);
477 /* Nothing to notice */
478 if (!notice) return (FALSE);
481 if (disturb_state) disturb(0, 0);
492 * Set "p_ptr->poisoned", notice observable changes
494 bool set_poisoned(int v)
498 /* Hack -- Force good values */
499 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
501 if (p_ptr->is_dead) return FALSE;
506 if (!p_ptr->poisoned)
509 msg_print("ÆǤ˿¯¤µ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
511 msg_print("You are poisoned!");
524 msg_print("¤ä¤Ã¤ÈÆǤÎÄˤߤ¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
526 msg_print("You are no longer poisoned.");
536 /* Redraw status bar */
537 p_ptr->redraw |= (PR_STATUS);
539 /* Nothing to notice */
540 if (!notice) return (FALSE);
543 if (disturb_state) disturb(0, 0);
554 * Set "p_ptr->afraid", notice observable changes
556 bool set_afraid(int v)
560 /* Hack -- Force good values */
561 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
563 if (p_ptr->is_dead) return FALSE;
571 msg_print("²¿¤â¤«¤â¶²¤¯¤Ê¤Ã¤Æ¤¤¿¡ª");
573 msg_print("You are terrified!");
576 if (p_ptr->special_defense & KATA_MASK)
579 msg_print("·¿¤¬Êø¤ì¤¿¡£");
581 msg_print("Your posture gets loose.");
583 p_ptr->special_defense &= ~(KATA_MASK);
584 p_ptr->update |= (PU_BONUS);
585 p_ptr->update |= (PU_MONSTERS);
586 p_ptr->redraw |= (PR_STATE);
587 p_ptr->redraw |= (PR_STATUS);
588 p_ptr->action = ACTION_NONE;
592 p_ptr->counter = FALSE;
593 chg_virtue(V_VALOUR, -1);
603 msg_print("¤ä¤Ã¤È¶²Éݤò¿¶¤êʧ¤Ã¤¿¡£");
605 msg_print("You feel bolder now.");
615 /* Redraw status bar */
616 p_ptr->redraw |= (PR_STATUS);
618 /* Nothing to notice */
619 if (!notice) return (FALSE);
622 if (disturb_state) disturb(0, 0);
633 * Set "p_ptr->paralyzed", notice observable changes
635 bool set_paralyzed(int v)
639 /* Hack -- Force good values */
640 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
642 if (p_ptr->is_dead) return FALSE;
647 if (!p_ptr->paralyzed)
650 msg_print("ÂΤ¬Ëãá㤷¤Æ¤·¤Þ¤Ã¤¿¡ª");
652 msg_print("You are paralyzed!");
655 p_ptr->counter = FALSE;
663 if (p_ptr->paralyzed)
666 msg_print("¤ä¤Ã¤ÈÆ°¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
668 msg_print("You can move again.");
676 p_ptr->paralyzed = v;
678 /* Redraw status bar */
679 p_ptr->redraw |= (PR_STATUS);
681 /* Nothing to notice */
682 if (!notice) return (FALSE);
685 if (disturb_state) disturb(0, 0);
687 /* Redraw the state */
688 p_ptr->redraw |= (PR_STATE);
699 * Set "p_ptr->image", notice observable changes
701 * Note that we must redraw the map when hallucination changes.
703 bool set_image(int v)
707 /* Hack -- Force good values */
708 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
710 if (p_ptr->is_dead) return FALSE;
716 set_tsuyoshi(0, TRUE);
720 msg_print("¥ï¡¼¥ª¡ª²¿¤â¤«¤âÆú¿§¤Ë¸«¤¨¤ë¡ª");
722 msg_print("Oh, wow! Everything looks so cosmic now!");
725 p_ptr->counter = FALSE;
736 msg_print("¤ä¤Ã¤È¤Ï¤Ã¤¤ê¤Èʪ¤¬¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
738 msg_print("You can see clearly again.");
748 /* Redraw status bar */
749 p_ptr->redraw |= (PR_STATUS);
751 /* Nothing to notice */
752 if (!notice) return (FALSE);
755 if (disturb_state) disturb(0, 0);
758 p_ptr->redraw |= (PR_MAP);
760 /* Update monsters */
761 p_ptr->update |= (PU_MONSTERS);
764 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
775 * Set "p_ptr->fast", notice observable changes
777 bool set_fast(int v, bool do_dec)
781 /* Hack -- Force good values */
782 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
784 if (p_ptr->is_dead) return FALSE;
789 if (p_ptr->fast && !do_dec)
791 if (p_ptr->fast > v) return FALSE;
793 else if (!p_ptr->fast && !p_ptr->lightspeed)
796 msg_print("ÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
798 msg_print("You feel yourself moving much faster!");
802 chg_virtue(V_PATIENCE, -1);
803 chg_virtue(V_DILIGENCE, 1);
810 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))))
813 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
815 msg_print("You feel yourself slow down.");
825 /* Nothing to notice */
826 if (!notice) return (FALSE);
829 if (disturb_state) disturb(0, 0);
831 /* Recalculate bonuses */
832 p_ptr->update |= (PU_BONUS);
843 * Set "p_ptr->lightspeed", notice observable changes
845 bool set_lightspeed(int v, bool do_dec)
849 /* Hack -- Force good values */
850 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
852 if (p_ptr->is_dead) return FALSE;
857 if (p_ptr->lightspeed && !do_dec)
859 if (p_ptr->lightspeed > v) return FALSE;
861 else if (!p_ptr->lightspeed)
864 msg_print("Èó¾ï¤ËÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
866 msg_print("You feel yourself moving extremely faster!");
870 chg_virtue(V_PATIENCE, -1);
871 chg_virtue(V_DILIGENCE, 1);
878 if (p_ptr->lightspeed)
881 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
883 msg_print("You feel yourself slow down.");
891 p_ptr->lightspeed = v;
893 /* Nothing to notice */
894 if (!notice) return (FALSE);
897 if (disturb_state) disturb(0, 0);
899 /* Recalculate bonuses */
900 p_ptr->update |= (PU_BONUS);
911 * Set "p_ptr->slow", notice observable changes
913 bool set_slow(int v, bool do_dec)
917 /* Hack -- Force good values */
918 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
920 if (p_ptr->is_dead) return FALSE;
925 if (p_ptr->slow && !do_dec)
927 if (p_ptr->slow > v) return FALSE;
929 else if (!p_ptr->slow)
932 msg_print("ÂΤÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
934 msg_print("You feel yourself moving slower!");
947 msg_print("Æ°¤¤ÎÃÙ¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
949 msg_print("You feel yourself speed up.");
959 /* Nothing to notice */
960 if (!notice) return (FALSE);
963 if (disturb_state) disturb(0, 0);
965 /* Recalculate bonuses */
966 p_ptr->update |= (PU_BONUS);
977 * Set "p_ptr->shield", notice observable changes
979 bool set_shield(int v, bool do_dec)
983 /* Hack -- Force good values */
984 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
986 if (p_ptr->is_dead) return FALSE;
991 if (p_ptr->shield && !do_dec)
993 if (p_ptr->shield > v) return FALSE;
995 else if (!p_ptr->shield)
998 msg_print("È©¤¬ÀФˤʤä¿¡£");
1000 msg_print("Your skin turns to stone.");
1013 msg_print("È©¤¬¸µ¤ËÌá¤Ã¤¿¡£");
1015 msg_print("Your skin returns to normal.");
1025 /* Redraw status bar */
1026 p_ptr->redraw |= (PR_STATUS);
1028 /* Nothing to notice */
1029 if (!notice) return (FALSE);
1032 if (disturb_state) disturb(0, 0);
1034 /* Recalculate bonuses */
1035 p_ptr->update |= (PU_BONUS);
1047 * Set "p_ptr->tsubureru", notice observable changes
1049 bool set_tsubureru(int v, bool do_dec)
1051 bool notice = FALSE;
1053 /* Hack -- Force good values */
1054 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1056 if (p_ptr->is_dead) return FALSE;
1061 if (p_ptr->tsubureru && !do_dec)
1063 if (p_ptr->tsubureru > v) return FALSE;
1065 else if (!p_ptr->tsubureru)
1068 msg_print("²£¤Ë¿¤Ó¤¿¡£");
1070 msg_print("Your body expands horizontally.");
1080 if (p_ptr->tsubureru)
1083 msg_print("¤â¤¦²£¤Ë¿¤Ó¤Æ¤¤¤Ê¤¤¡£");
1085 msg_print("Your body returns to normal.");
1093 p_ptr->tsubureru = v;
1095 /* Redraw status bar */
1096 p_ptr->redraw |= (PR_STATUS);
1098 /* Nothing to notice */
1099 if (!notice) return (FALSE);
1102 if (disturb_state) disturb(0, 0);
1104 /* Recalculate bonuses */
1105 p_ptr->update |= (PU_BONUS);
1117 * Set "p_ptr->magicdef", notice observable changes
1119 bool set_magicdef(int v, bool do_dec)
1121 bool notice = FALSE;
1123 /* Hack -- Force good values */
1124 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1126 if (p_ptr->is_dead) return FALSE;
1131 if (p_ptr->magicdef && !do_dec)
1133 if (p_ptr->magicdef > v) return FALSE;
1135 else if (!p_ptr->magicdef)
1138 msg_print("ËâË¡¤ÎËɸæÎϤ¬Áý¤·¤¿¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1140 msg_print("You feel more resistant to magic.");
1150 if (p_ptr->magicdef)
1153 msg_print("ËâË¡¤ÎËɸæÎϤ¬¸µ¤ËÌá¤Ã¤¿¡£");
1155 msg_print("You feel less resistant to magic.");
1163 p_ptr->magicdef = v;
1165 /* Redraw status bar */
1166 p_ptr->redraw |= (PR_STATUS);
1168 /* Nothing to notice */
1169 if (!notice) return (FALSE);
1172 if (disturb_state) disturb(0, 0);
1174 /* Recalculate bonuses */
1175 p_ptr->update |= (PU_BONUS);
1187 * Set "p_ptr->blessed", notice observable changes
1189 bool set_blessed(int v, bool do_dec)
1191 bool notice = FALSE;
1193 /* Hack -- Force good values */
1194 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1196 if (p_ptr->is_dead) return FALSE;
1201 if (p_ptr->blessed && !do_dec)
1203 if (p_ptr->blessed > v) return FALSE;
1205 else if (!p_ptr->blessed)
1208 msg_print("¹â·é¤Êµ¤Ê¬¤Ë¤Ê¤Ã¤¿¡ª");
1210 msg_print("You feel righteous!");
1220 if (p_ptr->blessed && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_BLESS)))
1223 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1225 msg_print("The prayer has expired.");
1235 /* Redraw status bar */
1236 p_ptr->redraw |= (PR_STATUS);
1238 /* Nothing to notice */
1239 if (!notice) return (FALSE);
1242 if (disturb_state) disturb(0, 0);
1244 /* Recalculate bonuses */
1245 p_ptr->update |= (PU_BONUS);
1256 * Set "p_ptr->hero", notice observable changes
1258 bool set_hero(int v, bool do_dec)
1260 bool notice = FALSE;
1262 /* Hack -- Force good values */
1263 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1265 if (p_ptr->is_dead) return FALSE;
1270 if (p_ptr->hero && !do_dec)
1272 if (p_ptr->hero > v) return FALSE;
1274 else if (!p_ptr->hero)
1277 msg_print("¥Ò¡¼¥í¡¼¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1279 msg_print("You feel like a hero!");
1289 if (p_ptr->hero && ((p_ptr->pclass != CLASS_BARD) || ((p_ptr->magic_num1[0] != MUSIC_HERO) && (p_ptr->magic_num1[0] != MUSIC_SHERO))))
1292 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1294 msg_print("The heroism wears off.");
1304 /* Redraw status bar */
1305 p_ptr->redraw |= (PR_STATUS);
1307 /* Nothing to notice */
1308 if (!notice) return (FALSE);
1311 if (disturb_state) disturb(0, 0);
1313 /* Recalculate bonuses */
1314 p_ptr->update |= (PU_BONUS);
1316 /* Recalculate hitpoints */
1317 p_ptr->update |= (PU_HP);
1328 * Set "p_ptr->shero", notice observable changes
1330 bool set_shero(int v, bool do_dec)
1332 bool notice = FALSE;
1334 /* Hack -- Force good values */
1335 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1337 if (p_ptr->is_dead) return FALSE;
1339 if (p_ptr->pclass == CLASS_BERSERKER) v = 1;
1343 if (p_ptr->shero && !do_dec)
1345 if (p_ptr->shero > v) return FALSE;
1347 else if (!p_ptr->shero)
1350 msg_print("»¦Ù¤¥Þ¥·¡¼¥ó¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1352 msg_print("You feel like a killing machine!");
1365 msg_print("ÌîÈڤʵ¤»ý¤Á¤¬¾Ã¤¨¼º¤»¤¿¡£");
1367 msg_print("You feel less Berserk.");
1377 /* Redraw status bar */
1378 p_ptr->redraw |= (PR_STATUS);
1380 /* Nothing to notice */
1381 if (!notice) return (FALSE);
1384 if (disturb_state) disturb(0, 0);
1386 /* Recalculate bonuses */
1387 p_ptr->update |= (PU_BONUS);
1389 /* Recalculate hitpoints */
1390 p_ptr->update |= (PU_HP);
1401 * Set "p_ptr->protevil", notice observable changes
1403 bool set_protevil(int v, bool do_dec)
1405 bool notice = FALSE;
1407 /* Hack -- Force good values */
1408 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1410 if (p_ptr->is_dead) return FALSE;
1415 if (p_ptr->protevil && !do_dec)
1417 if (p_ptr->protevil > v) return FALSE;
1419 else if (!p_ptr->protevil)
1422 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Ê´¶¤¸¤¬¤¹¤ë¡ª");
1424 msg_print("You feel safe from evil!");
1434 if (p_ptr->protevil)
1437 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1439 msg_print("You no longer feel safe from evil.");
1447 p_ptr->protevil = v;
1449 /* Redraw status bar */
1450 p_ptr->redraw |= (PR_STATUS);
1452 /* Nothing to notice */
1453 if (!notice) return (FALSE);
1456 if (disturb_state) disturb(0, 0);
1466 * Set "p_ptr->wraith_form", notice observable changes
1468 bool set_wraith_form(int v, bool do_dec)
1470 bool notice = FALSE;
1472 /* Hack -- Force good values */
1473 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1475 if (p_ptr->is_dead) return FALSE;
1480 if (p_ptr->wraith_form && !do_dec)
1482 if (p_ptr->wraith_form > v) return FALSE;
1484 else if (!p_ptr->wraith_form)
1487 msg_print("ʪ¼Á³¦¤òÎ¥¤ì¤ÆÍ©µ´¤Î¤è¤¦¤Ê¸ºß¤Ë¤Ê¤Ã¤¿¡ª");
1489 msg_print("You leave the physical world and turn into a wraith-being!");
1494 chg_virtue(V_UNLIFE, 3);
1495 chg_virtue(V_HONOUR, -2);
1496 chg_virtue(V_SACRIFICE, -2);
1497 chg_virtue(V_VALOUR, -5);
1500 p_ptr->redraw |= (PR_MAP);
1502 /* Update monsters */
1503 p_ptr->update |= (PU_MONSTERS);
1506 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1513 if (p_ptr->wraith_form)
1516 msg_print("ÉÔÆ©ÌÀ¤Ë¤Ê¤Ã¤¿´¶¤¸¤¬¤¹¤ë¡£");
1518 msg_print("You feel opaque.");
1524 p_ptr->redraw |= (PR_MAP);
1526 /* Update monsters */
1527 p_ptr->update |= (PU_MONSTERS);
1530 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1535 p_ptr->wraith_form = v;
1537 /* Redraw status bar */
1538 p_ptr->redraw |= (PR_STATUS);
1540 /* Nothing to notice */
1541 if (!notice) return (FALSE);
1544 if (disturb_state) disturb(0, 0);
1546 /* Recalculate bonuses */
1547 p_ptr->update |= (PU_BONUS);
1562 * Set "p_ptr->invuln", notice observable changes
1564 bool set_invuln(int v, bool do_dec)
1566 bool notice = FALSE;
1568 /* Hack -- Force good values */
1569 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1571 if (p_ptr->is_dead) return FALSE;
1576 if (p_ptr->invuln && !do_dec)
1578 if (p_ptr->invuln > v) return FALSE;
1580 else if (!p_ptr->invuln)
1583 msg_print("̵Ũ¤À¡ª");
1585 msg_print("Invulnerability!");
1590 chg_virtue(V_UNLIFE, -2);
1591 chg_virtue(V_HONOUR, -2);
1592 chg_virtue(V_SACRIFICE, -3);
1593 chg_virtue(V_VALOUR, -5);
1596 p_ptr->redraw |= (PR_MAP);
1598 /* Update monsters */
1599 p_ptr->update |= (PU_MONSTERS);
1602 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1609 if (p_ptr->invuln && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_INVULN)))
1612 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
1614 msg_print("The invulnerability wears off.");
1620 p_ptr->redraw |= (PR_MAP);
1622 /* Update monsters */
1623 p_ptr->update |= (PU_MONSTERS);
1626 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1628 p_ptr->energy_need += ENERGY_NEED();
1635 /* Redraw status bar */
1636 p_ptr->redraw |= (PR_STATUS);
1638 /* Nothing to notice */
1639 if (!notice) return (FALSE);
1642 if (disturb_state) disturb(0, 0);
1644 /* Recalculate bonuses */
1645 p_ptr->update |= (PU_BONUS);
1656 * Set "p_ptr->tim_esp", notice observable changes
1658 bool set_tim_esp(int v, bool do_dec)
1660 bool notice = FALSE;
1662 /* Hack -- Force good values */
1663 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1665 if (p_ptr->is_dead) return FALSE;
1670 if (p_ptr->tim_esp && !do_dec)
1672 if (p_ptr->tim_esp > v) return FALSE;
1674 else if (!p_ptr->tim_esp)
1677 msg_print("°Õ¼±¤¬¹¤¬¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1679 msg_print("You feel your consciousness expand!");
1689 if (p_ptr->tim_esp && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_MIND)))
1692 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
1694 msg_print("Your consciousness contracts again.");
1704 /* Redraw status bar */
1705 p_ptr->redraw |= (PR_STATUS);
1707 /* Nothing to notice */
1708 if (!notice) return (FALSE);
1711 if (disturb_state) disturb(0, 0);
1713 /* Recalculate bonuses */
1714 p_ptr->update |= (PU_BONUS);
1716 /* Update the monsters */
1717 p_ptr->update |= (PU_MONSTERS);
1728 * Set "p_ptr->tim_invis", notice observable changes
1730 bool set_tim_invis(int v, bool do_dec)
1732 bool notice = FALSE;
1734 /* Hack -- Force good values */
1735 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1737 if (p_ptr->is_dead) return FALSE;
1742 if (p_ptr->tim_invis && !do_dec)
1744 if (p_ptr->tim_invis > v) return FALSE;
1746 else if (!p_ptr->tim_invis)
1749 msg_print("Ìܤ¬Èó¾ï¤ËÉÒ´¶¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1751 msg_print("Your eyes feel very sensitive!");
1761 if (p_ptr->tim_invis)
1764 msg_print("ÌܤÎÉÒ´¶¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1766 msg_print("Your eyes feel less sensitive.");
1774 p_ptr->tim_invis = v;
1776 /* Redraw status bar */
1777 p_ptr->redraw |= (PR_STATUS);
1779 /* Nothing to notice */
1780 if (!notice) return (FALSE);
1783 if (disturb_state) disturb(0, 0);
1785 /* Recalculate bonuses */
1786 p_ptr->update |= (PU_BONUS);
1788 /* Update the monsters */
1789 p_ptr->update |= (PU_MONSTERS);
1800 * Set "p_ptr->tim_infra", notice observable changes
1802 bool set_tim_infra(int v, bool do_dec)
1804 bool notice = FALSE;
1806 /* Hack -- Force good values */
1807 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1809 if (p_ptr->is_dead) return FALSE;
1814 if (p_ptr->tim_infra && !do_dec)
1816 if (p_ptr->tim_infra > v) return FALSE;
1818 else if (!p_ptr->tim_infra)
1821 msg_print("Ìܤ¬¥é¥ó¥é¥ó¤Èµ±¤»Ï¤á¤¿¡ª");
1823 msg_print("Your eyes begin to tingle!");
1833 if (p_ptr->tim_infra)
1836 msg_print("Ìܤ層¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1838 msg_print("Your eyes stop tingling.");
1846 p_ptr->tim_infra = v;
1848 /* Redraw status bar */
1849 p_ptr->redraw |= (PR_STATUS);
1851 /* Nothing to notice */
1852 if (!notice) return (FALSE);
1855 if (disturb_state) disturb(0, 0);
1857 /* Recalculate bonuses */
1858 p_ptr->update |= (PU_BONUS);
1860 /* Update the monsters */
1861 p_ptr->update |= (PU_MONSTERS);
1872 * Set "p_ptr->tim_regen", notice observable changes
1874 bool set_tim_regen(int v, bool do_dec)
1876 bool notice = FALSE;
1878 /* Hack -- Force good values */
1879 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1881 if (p_ptr->is_dead) return FALSE;
1886 if (p_ptr->tim_regen && !do_dec)
1888 if (p_ptr->tim_regen > v) return FALSE;
1890 else if (!p_ptr->tim_regen)
1893 msg_print("²óÉüÎϤ¬¾å¤¬¤Ã¤¿¡ª");
1895 msg_print("You feel yourself regenerating quickly!");
1905 if (p_ptr->tim_regen)
1908 msg_print("ÁÇÁ᤯²óÉü¤¹¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1910 msg_print("You feel yourself regenerating slowly.");
1918 p_ptr->tim_regen = v;
1920 /* Redraw status bar */
1921 p_ptr->redraw |= (PR_STATUS);
1923 /* Nothing to notice */
1924 if (!notice) return (FALSE);
1927 if (disturb_state) disturb(0, 0);
1929 /* Recalculate bonuses */
1930 p_ptr->update |= (PU_BONUS);
1941 * Set "p_ptr->tim_stealth", notice observable changes
1943 bool set_tim_stealth(int v, bool do_dec)
1945 bool notice = FALSE;
1947 /* Hack -- Force good values */
1948 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1950 if (p_ptr->is_dead) return FALSE;
1955 if (p_ptr->tim_stealth && !do_dec)
1957 if (p_ptr->tim_stealth > v) return FALSE;
1959 else if (!p_ptr->tim_stealth)
1962 msg_print("²»¤¬¾®¤µ¤¯¤Ê¤Ã¤¿¡ª");
1964 msg_print("You begin to walk silently!");
1974 if (p_ptr->tim_stealth && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_STEALTH)))
1977 msg_print("²»¤¬Â礤¯¤Ê¤Ã¤¿¡£");
1979 msg_print("You no longer walk silently.");
1987 p_ptr->tim_stealth = v;
1989 /* Redraw status bar */
1990 p_ptr->redraw |= (PR_STATUS);
1992 /* Nothing to notice */
1993 if (!notice) return (FALSE);
1996 if (disturb_state) disturb(0, 0);
1998 /* Recalculate bonuses */
1999 p_ptr->update |= (PU_BONUS);
2009 bool set_superstealth(bool set)
2011 bool notice = FALSE;
2013 if (p_ptr->is_dead) return FALSE;
2018 if (!(p_ptr->special_defense & NINJA_S_STEALTH))
2020 if (cave[py][px].info & CAVE_MNLT)
2023 msg_print("Ũ¤ÎÌܤ«¤éÇö¤¤±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡£");
2025 msg_print("You are mantled in weak shadow from ordinary eyes.");
2027 p_ptr->monlite = p_ptr->old_monlite = TRUE;
2032 msg_print("Ũ¤ÎÌܤ«¤é±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡ª");
2034 msg_print("You are mantled in shadow from ordinary eyes!");
2036 p_ptr->monlite = p_ptr->old_monlite = FALSE;
2042 p_ptr->special_defense |= NINJA_S_STEALTH;
2049 if (p_ptr->special_defense & NINJA_S_STEALTH)
2052 msg_print("ºÆ¤ÓŨ¤ÎÌܤˤµ¤é¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
2054 msg_print("You are exposed to common sight once more.");
2060 p_ptr->special_defense &= ~(NINJA_S_STEALTH);
2064 /* Nothing to notice */
2065 if (!notice) return (FALSE);
2067 /* Redraw status bar */
2068 p_ptr->redraw |= (PR_STATUS);
2071 if (disturb_state) disturb(0, 0);
2079 * Set "p_ptr->tim_ffall", notice observable changes
2081 bool set_tim_ffall(int v, bool do_dec)
2083 bool notice = FALSE;
2085 /* Hack -- Force good values */
2086 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2088 if (p_ptr->is_dead) return FALSE;
2093 if (p_ptr->tim_ffall && !do_dec)
2095 if (p_ptr->tim_ffall > v) return FALSE;
2097 else if (!p_ptr->tim_ffall)
2100 msg_print("ÂΤ¬Ãè¤ËÉ⤻Ϥ᤿¡£");
2102 msg_print("You begin to fly!");
2112 if (p_ptr->tim_ffall)
2115 msg_print("¤â¤¦Ãè¤ËÉ⤫¤Ù¤Ê¤¯¤Ê¤Ã¤¿¡£");
2117 msg_print("You stop flying.");
2125 p_ptr->tim_ffall = v;
2127 /* Redraw status bar */
2128 p_ptr->redraw |= (PR_STATUS);
2130 /* Nothing to notice */
2131 if (!notice) return (FALSE);
2134 if (disturb_state) disturb(0, 0);
2136 /* Recalculate bonuses */
2137 p_ptr->update |= (PU_BONUS);
2148 * Set "p_ptr->tim_sh_touki", notice observable changes
2150 bool set_tim_sh_touki(int v, bool do_dec)
2152 bool notice = FALSE;
2154 /* Hack -- Force good values */
2155 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2157 if (p_ptr->is_dead) return FALSE;
2162 if (p_ptr->tim_sh_touki && !do_dec)
2164 if (p_ptr->tim_sh_touki > v) return FALSE;
2166 else if (!p_ptr->tim_sh_touki)
2169 msg_print("ÂΤ¬Æ®µ¤¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2171 msg_print("You have enveloped by the aura of the Force!");
2181 if (p_ptr->tim_sh_touki)
2184 msg_print("Æ®µ¤¤¬¾Ã¤¨¤¿¡£");
2186 msg_print("Aura of the Force disappeared.");
2194 p_ptr->tim_sh_touki = v;
2196 /* Redraw status bar */
2197 p_ptr->redraw |= (PR_STATUS);
2199 /* Nothing to notice */
2200 if (!notice) return (FALSE);
2203 if (disturb_state) disturb(0, 0);
2214 * Set "p_ptr->tim_sh_fire", notice observable changes
2216 bool set_tim_sh_fire(int v, bool do_dec)
2218 bool notice = FALSE;
2220 /* Hack -- Force good values */
2221 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2223 if (p_ptr->is_dead) return FALSE;
2228 if (p_ptr->tim_sh_fire && !do_dec)
2230 if (p_ptr->tim_sh_fire > v) return FALSE;
2232 else if (!p_ptr->tim_sh_fire)
2235 msg_print("ÂΤ¬±ê¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2237 msg_print("You have enveloped by fiery aura!");
2247 if (p_ptr->tim_sh_fire)
2250 msg_print("±ê¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2252 msg_print("Fiery aura disappeared.");
2260 p_ptr->tim_sh_fire = v;
2262 /* Redraw status bar */
2263 p_ptr->redraw |= (PR_STATUS);
2265 /* Nothing to notice */
2266 if (!notice) return (FALSE);
2269 if (disturb_state) disturb(0, 0);
2271 /* Recalculate bonuses */
2272 p_ptr->update |= (PU_BONUS);
2283 * Set "p_ptr->tim_sh_holy", notice observable changes
2285 bool set_tim_sh_holy(int v, bool do_dec)
2287 bool notice = FALSE;
2289 /* Hack -- Force good values */
2290 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2292 if (p_ptr->is_dead) return FALSE;
2297 if (p_ptr->tim_sh_holy && !do_dec)
2299 if (p_ptr->tim_sh_holy > v) return FALSE;
2301 else if (!p_ptr->tim_sh_holy)
2304 msg_print("ÂΤ¬À»¤Ê¤ë¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2306 msg_print("You have enveloped by holy aura!");
2316 if (p_ptr->tim_sh_holy)
2319 msg_print("À»¤Ê¤ë¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2321 msg_print("Holy aura disappeared.");
2329 p_ptr->tim_sh_holy = v;
2331 /* Redraw status bar */
2332 p_ptr->redraw |= (PR_STATUS);
2334 /* Nothing to notice */
2335 if (!notice) return (FALSE);
2338 if (disturb_state) disturb(0, 0);
2340 /* Recalculate bonuses */
2341 p_ptr->update |= (PU_BONUS);
2353 * Set "p_ptr->tim_eyeeye", notice observable changes
2355 bool set_tim_eyeeye(int v, bool do_dec)
2357 bool notice = FALSE;
2359 /* Hack -- Force good values */
2360 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2362 if (p_ptr->is_dead) return FALSE;
2367 if (p_ptr->tim_eyeeye && !do_dec)
2369 if (p_ptr->tim_eyeeye > v) return FALSE;
2371 else if (!p_ptr->tim_eyeeye)
2374 msg_print("Ë¡¤Î¼é¤ê¼ê¤Ë¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¡ª");
2376 msg_print("You feel like a keeper of commandments!");
2386 if (p_ptr->tim_eyeeye)
2389 msg_print("Ĩȳ¤ò¼¹¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2391 msg_print("You no longer feel like a keeper.");
2399 p_ptr->tim_eyeeye = v;
2401 /* Redraw status bar */
2402 p_ptr->redraw |= (PR_STATUS);
2404 /* Nothing to notice */
2405 if (!notice) return (FALSE);
2408 if (disturb_state) disturb(0, 0);
2410 /* Recalculate bonuses */
2411 p_ptr->update |= (PU_BONUS);
2423 * Set "p_ptr->resist_magic", notice observable changes
2425 bool set_resist_magic(int v, bool do_dec)
2427 bool notice = FALSE;
2429 /* Hack -- Force good values */
2430 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2432 if (p_ptr->is_dead) return FALSE;
2437 if (p_ptr->resist_magic && !do_dec)
2439 if (p_ptr->resist_magic > v) return FALSE;
2441 else if (!p_ptr->resist_magic)
2444 msg_print("ËâË¡¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿¡£");
2446 msg_print("You have been protected from magic!");
2456 if (p_ptr->resist_magic)
2459 msg_print("ËâË¡¤Ë¼å¤¯¤Ê¤Ã¤¿¡£");
2461 msg_print("You are no longer protected from magic.");
2469 p_ptr->resist_magic = v;
2471 /* Redraw status bar */
2472 p_ptr->redraw |= (PR_STATUS);
2474 /* Nothing to notice */
2475 if (!notice) return (FALSE);
2478 if (disturb_state) disturb(0, 0);
2480 /* Recalculate bonuses */
2481 p_ptr->update |= (PU_BONUS);
2492 * Set "p_ptr->tim_reflect", notice observable changes
2494 bool set_tim_reflect(int v, bool do_dec)
2496 bool notice = FALSE;
2498 /* Hack -- Force good values */
2499 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2501 if (p_ptr->is_dead) return FALSE;
2506 if (p_ptr->tim_reflect && !do_dec)
2508 if (p_ptr->tim_reflect > v) return FALSE;
2510 else if (!p_ptr->tim_reflect)
2513 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2515 msg_print("Your body becames smooth.");
2525 if (p_ptr->tim_reflect)
2528 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ç¤Ê¤¯¤Ê¤Ã¤¿¡£");
2530 msg_print("Your body is no longer smooth.");
2538 p_ptr->tim_reflect = v;
2540 /* Redraw status bar */
2541 p_ptr->redraw |= (PR_STATUS);
2543 /* Nothing to notice */
2544 if (!notice) return (FALSE);
2547 if (disturb_state) disturb(0, 0);
2549 /* Recalculate bonuses */
2550 p_ptr->update |= (PU_BONUS);
2561 * Set "p_ptr->multishadow", notice observable changes
2563 bool set_multishadow(int v, bool do_dec)
2565 bool notice = FALSE;
2567 /* Hack -- Force good values */
2568 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2570 if (p_ptr->is_dead) return FALSE;
2575 if (p_ptr->multishadow && !do_dec)
2577 if (p_ptr->multishadow > v) return FALSE;
2579 else if (!p_ptr->multishadow)
2582 msg_print("¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¸¸±Æ¤¬À¸¤Þ¤ì¤¿¡£");
2584 msg_print("Your Shadow enveloped you.");
2594 if (p_ptr->multishadow)
2597 msg_print("¸¸±Æ¤¬¾Ã¤¨¤¿¡£");
2599 msg_print("Your Shadow disappears.");
2607 p_ptr->multishadow = v;
2609 /* Redraw status bar */
2610 p_ptr->redraw |= (PR_STATUS);
2612 /* Nothing to notice */
2613 if (!notice) return (FALSE);
2616 if (disturb_state) disturb(0, 0);
2618 /* Recalculate bonuses */
2619 p_ptr->update |= (PU_BONUS);
2630 * Set "p_ptr->dustrobe", notice observable changes
2632 bool set_dustrobe(int v, bool do_dec)
2634 bool notice = FALSE;
2636 /* Hack -- Force good values */
2637 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2639 if (p_ptr->is_dead) return FALSE;
2644 if (p_ptr->dustrobe && !do_dec)
2646 if (p_ptr->dustrobe > v) return FALSE;
2648 else if (!p_ptr->dustrobe)
2651 msg_print("ÂΤ¬¶À¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2653 msg_print("You were enveloped by mirror shards.");
2663 if (p_ptr->dustrobe)
2666 msg_print("¶À¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2668 msg_print("The mirror shards disappear.");
2676 p_ptr->dustrobe = v;
2678 /* Redraw status bar */
2679 p_ptr->redraw |= (PR_STATUS);
2681 /* Nothing to notice */
2682 if (!notice) return (FALSE);
2685 if (disturb_state) disturb(0, 0);
2687 /* Recalculate bonuses */
2688 p_ptr->update |= (PU_BONUS);
2699 * Set "p_ptr->tim_regen", notice observable changes
2701 bool set_kabenuke(int v, bool do_dec)
2703 bool notice = FALSE;
2705 /* Hack -- Force good values */
2706 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2708 if (p_ptr->is_dead) return FALSE;
2713 if (p_ptr->kabenuke && !do_dec)
2715 if (p_ptr->kabenuke > v) return FALSE;
2717 else if (!p_ptr->kabenuke)
2720 msg_print("ÂΤ¬È¾Êª¼Á¤Î¾õÂ֤ˤʤä¿¡£");
2722 msg_print("You became ethereal form.");
2732 if (p_ptr->kabenuke)
2735 msg_print("ÂΤ¬Êª¼Á²½¤·¤¿¡£");
2737 msg_print("You are no longer in an ethereal form.");
2745 p_ptr->kabenuke = v;
2747 /* Redraw status bar */
2748 p_ptr->redraw |= (PR_STATUS);
2750 /* Nothing to notice */
2751 if (!notice) return (FALSE);
2754 if (disturb_state) disturb(0, 0);
2764 bool set_tsuyoshi(int v, bool do_dec)
2766 bool notice = FALSE;
2768 /* Hack -- Force good values */
2769 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2771 if (p_ptr->is_dead) return FALSE;
2776 if (p_ptr->tsuyoshi && !do_dec)
2778 if (p_ptr->tsuyoshi > v) return FALSE;
2780 else if (!p_ptr->tsuyoshi)
2783 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
2785 msg_print("Brother OKURE!");
2789 chg_virtue(V_VITALITY, 2);
2796 if (p_ptr->tsuyoshi)
2799 msg_print("ÆùÂΤ¬µÞ®¤Ë¤·¤Ü¤ó¤Ç¤¤¤Ã¤¿¡£");
2801 msg_print("Your body had quickly shriveled.");
2804 (void)dec_stat(A_CON, 20, TRUE);
2805 (void)dec_stat(A_STR, 20, TRUE);
2808 chg_virtue(V_VITALITY, -3);
2813 p_ptr->tsuyoshi = v;
2815 /* Redraw status bar */
2816 p_ptr->redraw |= (PR_STATUS);
2818 /* Nothing to notice */
2819 if (!notice) return (FALSE);
2822 if (disturb_state) disturb(0, 0);
2824 /* Recalculate bonuses */
2825 p_ptr->update |= (PU_BONUS);
2827 /* Recalculate hitpoints */
2828 p_ptr->update |= (PU_HP);
2839 * Set a temporary elemental brand. Clear all other brands. Print status
2842 bool set_ele_attack(u32b attack_type, int v)
2844 /* Hack -- Force good values */
2845 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2847 /* Clear all elemental attacks (only one is allowed at a time). */
2848 if ((p_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
2850 p_ptr->special_attack &= ~(ATTACK_ACID);
2852 msg_print("»À¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2854 msg_print("Your temporary acidic brand fades away.");
2857 if ((p_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
2859 p_ptr->special_attack &= ~(ATTACK_ELEC);
2861 msg_print("ÅÅ·â¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2863 msg_print("Your temporary electrical brand fades away.");
2866 if ((p_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
2868 p_ptr->special_attack &= ~(ATTACK_FIRE);
2870 msg_print("²Ð±ê¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2872 msg_print("Your temporary fiery brand fades away.");
2875 if ((p_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
2877 p_ptr->special_attack &= ~(ATTACK_COLD);
2879 msg_print("Î䵤¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2881 msg_print("Your temporary frost brand fades away.");
2884 if ((p_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
2886 p_ptr->special_attack &= ~(ATTACK_POIS);
2888 msg_print("ÆǤǹ¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2890 msg_print("Your temporary poison brand fades away.");
2894 if ((v) && (attack_type))
2896 /* Set attack type. */
2897 p_ptr->special_attack |= (attack_type);
2900 p_ptr->ele_attack = v;
2904 msg_format("%s¤Ç¹¶·â¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª",
2905 ((attack_type == ATTACK_ACID) ? "»À" :
2906 ((attack_type == ATTACK_ELEC) ? "ÅÅ·â" :
2907 ((attack_type == ATTACK_FIRE) ? "²Ð±ê" :
2908 ((attack_type == ATTACK_COLD) ? "Î䵤" :
2909 ((attack_type == ATTACK_POIS) ? "ÆÇ" :
2912 msg_format("For a while, the blows you deal will %s",
2913 ((attack_type == ATTACK_ACID) ? "melt with acid!" :
2914 ((attack_type == ATTACK_ELEC) ? "shock your foes!" :
2915 ((attack_type == ATTACK_FIRE) ? "burn with fire!" :
2916 ((attack_type == ATTACK_COLD) ? "chill to the bone!" :
2917 ((attack_type == ATTACK_POIS) ? "poison your enemies!" :
2918 "do nothing special."))))));
2923 if (disturb_state) disturb(0, 0);
2925 /* Redraw status bar */
2926 p_ptr->redraw |= (PR_STATUS);
2928 p_ptr->update |= (PU_BONUS);
2938 * Set a temporary elemental brand. Clear all other brands. Print status
2941 bool set_ele_immune(u32b immune_type, int v)
2943 /* Hack -- Force good values */
2944 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2946 /* Clear all elemental attacks (only one is allowed at a time). */
2947 if ((p_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
2949 p_ptr->special_defense &= ~(DEFENSE_ACID);
2951 msg_print("»À¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2953 msg_print("You are no longer immune to acid.");
2956 if ((p_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
2958 p_ptr->special_defense &= ~(DEFENSE_ELEC);
2960 msg_print("ÅÅ·â¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2962 msg_print("You are no longer immune to electricity.");
2965 if ((p_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
2967 p_ptr->special_defense &= ~(DEFENSE_FIRE);
2969 msg_print("²Ð±ê¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2971 msg_print("You are no longer immune to fire.");
2974 if ((p_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
2976 p_ptr->special_defense &= ~(DEFENSE_COLD);
2978 msg_print("Î䵤¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2980 msg_print("You are no longer immune to cold.");
2983 if ((p_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
2985 p_ptr->special_defense &= ~(DEFENSE_POIS);
2987 msg_print("ÆǤι¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2989 msg_print("You are no longer immune to poison.");
2993 if ((v) && (immune_type))
2995 /* Set attack type. */
2996 p_ptr->special_defense |= (immune_type);
2999 p_ptr->ele_immune = v;
3003 msg_format("%s¤Î¹¶·â¤ò¼õ¤±¤Ä¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª",
3004 ((immune_type == DEFENSE_ACID) ? "»À" :
3005 ((immune_type == DEFENSE_ELEC) ? "ÅÅ·â" :
3006 ((immune_type == DEFENSE_FIRE) ? "²Ð±ê" :
3007 ((immune_type == DEFENSE_COLD) ? "Î䵤" :
3008 ((immune_type == DEFENSE_POIS) ? "ÆÇ" :
3011 msg_format("For a while, You are immune to %s",
3012 ((immune_type == DEFENSE_ACID) ? "acid!" :
3013 ((immune_type == DEFENSE_ELEC) ? "electricity!" :
3014 ((immune_type == DEFENSE_FIRE) ? "fire!" :
3015 ((immune_type == DEFENSE_COLD) ? "cold!" :
3016 ((immune_type == DEFENSE_POIS) ? "poison!" :
3017 "do nothing special."))))));
3022 if (disturb_state) disturb(0, 0);
3024 /* Redraw status bar */
3025 p_ptr->redraw |= (PR_STATUS);
3027 p_ptr->update |= (PU_BONUS);
3037 * Set "p_ptr->oppose_acid", notice observable changes
3039 bool set_oppose_acid(int v, bool do_dec)
3041 bool notice = FALSE;
3043 /* Hack -- Force good values */
3044 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3046 if (p_ptr->is_dead) return FALSE;
3051 if (p_ptr->oppose_acid && !do_dec)
3053 if (p_ptr->oppose_acid > v) return FALSE;
3055 else if (!p_ptr->oppose_acid)
3058 msg_print("»À¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3060 msg_print("You feel resistant to acid!");
3070 if (p_ptr->oppose_acid && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3073 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3075 msg_print("You feel less resistant to acid.");
3083 p_ptr->oppose_acid = v;
3085 /* Nothing to notice */
3086 if (!notice) return (FALSE);
3088 /* Redraw status bar */
3089 p_ptr->redraw |= (PR_STATUS);
3092 if (disturb_state) disturb(0, 0);
3103 * Set "p_ptr->oppose_elec", notice observable changes
3105 bool set_oppose_elec(int v, bool do_dec)
3107 bool notice = FALSE;
3109 /* Hack -- Force good values */
3110 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3112 if (p_ptr->is_dead) return FALSE;
3117 if (p_ptr->oppose_elec && !do_dec)
3119 if (p_ptr->oppose_elec > v) return FALSE;
3121 else if (!p_ptr->oppose_elec)
3124 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3126 msg_print("You feel resistant to electricity!");
3136 if (p_ptr->oppose_elec && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3139 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3141 msg_print("You feel less resistant to electricity.");
3149 p_ptr->oppose_elec = v;
3151 /* Nothing to notice */
3152 if (!notice) return (FALSE);
3154 /* Redraw status bar */
3155 p_ptr->redraw |= (PR_STATUS);
3158 if (disturb_state) disturb(0, 0);
3169 * Set "p_ptr->oppose_fire", notice observable changes
3171 bool set_oppose_fire(int v, bool do_dec)
3173 bool notice = FALSE;
3175 /* Hack -- Force good values */
3176 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3178 if (p_ptr->is_dead) return FALSE;
3180 if ((prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
3184 if (p_ptr->oppose_fire && !do_dec)
3186 if (p_ptr->oppose_fire > v) return FALSE;
3188 else if (!p_ptr->oppose_fire)
3191 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3193 msg_print("You feel resistant to fire!");
3203 if (p_ptr->oppose_fire && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3206 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3208 msg_print("You feel less resistant to fire.");
3216 p_ptr->oppose_fire = v;
3218 /* Nothing to notice */
3219 if (!notice) return (FALSE);
3221 /* Redraw status bar */
3222 p_ptr->redraw |= (PR_STATUS);
3225 if (disturb_state) disturb(0, 0);
3236 * Set "p_ptr->oppose_cold", notice observable changes
3238 bool set_oppose_cold(int v, bool do_dec)
3240 bool notice = FALSE;
3242 /* Hack -- Force good values */
3243 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3245 if (p_ptr->is_dead) return FALSE;
3250 if (p_ptr->oppose_cold && !do_dec)
3252 if (p_ptr->oppose_cold > v) return FALSE;
3254 else if (!p_ptr->oppose_cold)
3257 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3259 msg_print("You feel resistant to cold!");
3269 if (p_ptr->oppose_cold && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3272 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3274 msg_print("You feel less resistant to cold.");
3282 p_ptr->oppose_cold = v;
3284 /* Nothing to notice */
3285 if (!notice) return (FALSE);
3287 /* Redraw status bar */
3288 p_ptr->redraw |= (PR_STATUS);
3291 if (disturb_state) disturb(0, 0);
3302 * Set "p_ptr->oppose_pois", notice observable changes
3304 bool set_oppose_pois(int v, bool do_dec)
3306 bool notice = FALSE;
3308 /* Hack -- Force good values */
3309 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3311 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) v = 1;
3312 if (p_ptr->is_dead) return FALSE;
3317 if (p_ptr->oppose_pois && !do_dec)
3319 if (p_ptr->oppose_pois > v) return FALSE;
3321 else if (!p_ptr->oppose_pois)
3324 msg_print("ÆǤؤÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3326 msg_print("You feel resistant to poison!");
3336 if (p_ptr->oppose_pois && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3339 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3341 msg_print("You feel less resistant to poison.");
3349 p_ptr->oppose_pois = v;
3351 /* Nothing to notice */
3352 if (!notice) return (FALSE);
3354 /* Redraw status bar */
3355 p_ptr->redraw |= (PR_STATUS);
3358 if (disturb_state) disturb(0, 0);
3369 * Set "p_ptr->stun", notice observable changes
3371 * Note the special code to only notice "range" changes.
3373 bool set_stun(int v)
3375 int old_aux, new_aux;
3376 bool notice = FALSE;
3379 /* Hack -- Force good values */
3380 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3382 if (p_ptr->is_dead) return FALSE;
3384 if (prace_is_(RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
3387 if (p_ptr->stun > 100)
3393 else if (p_ptr->stun > 50)
3399 else if (p_ptr->stun > 0)
3435 if (new_aux > old_aux)
3437 /* Describe the state */
3443 msg_print("°Õ¼±¤¬¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3445 msg_print("You have been stunned.");
3453 msg_print("°Õ¼±¤¬¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3455 msg_print("You have been heavily stunned.");
3463 msg_print("Ƭ¤¬¥¯¥é¥¯¥é¤·¤Æ°Õ¼±¤¬±ó¤Î¤¤¤Æ¤¤¿¡£");
3465 msg_print("You have been knocked out.");
3471 if (randint1(1000) < v || one_in_(16))
3474 msg_print("³ä¤ì¤ë¤è¤¦¤ÊƬÄˤ¬¤¹¤ë¡£");
3476 msg_print("A vicious blow hits your head.");
3481 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3482 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3484 else if (one_in_(2))
3486 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3490 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3493 if (p_ptr->special_defense & KATA_MASK)
3496 msg_print("·¿¤¬Êø¤ì¤¿¡£");
3498 msg_print("Your posture gets loose.");
3500 p_ptr->special_defense &= ~(KATA_MASK);
3501 p_ptr->update |= (PU_BONUS);
3502 p_ptr->update |= (PU_MONSTERS);
3503 p_ptr->redraw |= (PR_STATE);
3504 p_ptr->redraw |= (PR_STATUS);
3505 p_ptr->action = ACTION_NONE;
3513 else if (new_aux < old_aux)
3515 /* Describe the state */
3521 msg_print("¤ä¤Ã¤ÈÛ¯Û°¾õÂÖ¤«¤é²óÉü¤·¤¿¡£");
3523 msg_print("You are no longer stunned.");
3526 if (disturb_state) disturb(0, 0);
3538 if (!notice) return (FALSE);
3541 if (disturb_state) disturb(0, 0);
3543 /* Recalculate bonuses */
3544 p_ptr->update |= (PU_BONUS);
3546 /* Redraw the "stun" */
3547 p_ptr->redraw |= (PR_STUN);
3558 * Set "p_ptr->cut", notice observable changes
3560 * Note the special code to only notice "range" changes.
3564 int old_aux, new_aux;
3565 bool notice = FALSE;
3567 /* Hack -- Force good values */
3568 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3570 if (p_ptr->is_dead) return FALSE;
3572 if ((p_ptr->prace == RACE_GOLEM ||
3573 p_ptr->prace == RACE_SKELETON ||
3574 p_ptr->prace == RACE_SPECTRE ||
3575 (p_ptr->prace == RACE_ZOMBIE && p_ptr->lev > 11)) &&
3580 if (p_ptr->cut > 1000)
3586 else if (p_ptr->cut > 200)
3592 else if (p_ptr->cut > 100)
3598 else if (p_ptr->cut > 50)
3604 else if (p_ptr->cut > 25)
3610 else if (p_ptr->cut > 10)
3616 else if (p_ptr->cut > 0)
3676 if (new_aux > old_aux)
3678 /* Describe the state */
3684 msg_print("¤«¤¹¤ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3686 msg_print("You have been given a graze.");
3694 msg_print("·Ú¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3696 msg_print("You have been given a light cut.");
3704 msg_print("¤Ò¤É¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3706 msg_print("You have been given a bad cut.");
3714 msg_print("ÂçÊѤʽý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3716 msg_print("You have been given a nasty cut.");
3724 msg_print("½ÅÂç¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3726 msg_print("You have been given a severe cut.");
3734 msg_print("¤Ò¤É¤¤¿¼¼ê¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3736 msg_print("You have been given a deep gash.");
3744 msg_print("Ã×̿Ū¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3746 msg_print("You have been given a mortal wound.");
3755 if (randint1(1000) < v || one_in_(16))
3757 if (!p_ptr->sustain_chr)
3760 msg_print("¤Ò¤É¤¤½ýÀפ¬»Ä¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3762 msg_print("You have been horribly scarred.");
3772 else if (new_aux < old_aux)
3774 /* Describe the state */
3780 msg_format("¤ä¤Ã¤È%s¡£", p_ptr->prace == RACE_ANDROID ? "²ø²æ¤¬Ä¾¤Ã¤¿" : "½Ð·ì¤¬»ß¤Þ¤Ã¤¿");
3782 msg_print("You are no longer bleeding.");
3785 if (disturb_state) disturb(0, 0);
3797 if (!notice) return (FALSE);
3800 if (disturb_state) disturb(0, 0);
3802 /* Recalculate bonuses */
3803 p_ptr->update |= (PU_BONUS);
3805 /* Redraw the "cut" */
3806 p_ptr->redraw |= (PR_CUT);
3817 * Set "p_ptr->food", notice observable changes
3819 * The "p_ptr->food" variable can get as large as 20000, allowing the
3820 * addition of the most "filling" item, Elvish Waybread, which adds
3821 * 7500 food units, without overflowing the 32767 maximum limit.
3823 * Perhaps we should disturb the player with various messages,
3824 * especially messages about hunger status changes. XXX XXX XXX
3826 * Digestion of food is handled in "dungeon.c", in which, normally,
3827 * the player digests about 20 food units per 100 game turns, more
3828 * when "fast", more when "regenerating", less with "slow digestion",
3829 * but when the player is "gorged", he digests 100 food units per 10
3830 * game turns, or a full 1000 food units per 100 game turns.
3832 * Note that the player's speed is reduced by 10 units while gorged,
3833 * so if the player eats a single food ration (5000 food units) when
3834 * full (15000 food units), he will be gorged for (5000/100)*10 = 500
3835 * game turns, or 500/(100/5) = 25 player turns (if nothing else is
3836 * affecting the player speed).
3838 bool set_food(int v)
3840 int old_aux, new_aux;
3842 bool notice = FALSE;
3844 /* Hack -- Force good values */
3845 v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
3847 /* Fainting / Starving */
3848 if (p_ptr->food < PY_FOOD_FAINT)
3854 else if (p_ptr->food < PY_FOOD_WEAK)
3860 else if (p_ptr->food < PY_FOOD_ALERT)
3866 else if (p_ptr->food < PY_FOOD_FULL)
3872 else if (p_ptr->food < PY_FOOD_MAX)
3883 /* Fainting / Starving */
3884 if (v < PY_FOOD_FAINT)
3890 else if (v < PY_FOOD_WEAK)
3896 else if (v < PY_FOOD_ALERT)
3902 else if (v < PY_FOOD_FULL)
3908 else if (v < PY_FOOD_MAX)
3919 if (old_aux < 1 && new_aux > 0)
3920 chg_virtue(V_PATIENCE, 2);
3921 else if (old_aux < 3 && (old_aux != new_aux))
3922 chg_virtue(V_PATIENCE, 1);
3924 chg_virtue(V_TEMPERANCE, 1);
3926 chg_virtue(V_TEMPERANCE, -1);
3929 if (new_aux > old_aux)
3931 /* Describe the state */
3937 msg_print("¤Þ¤À¶õÊ¢¤ÇÅݤ줽¤¦¤À¡£");
3939 msg_print("You are still weak.");
3947 msg_print("¤Þ¤À¶õÊ¢¤À¡£");
3949 msg_print("You are still hungry.");
3957 msg_print("¶õÊ¢´¶¤¬¤ª¤µ¤Þ¤Ã¤¿¡£");
3959 msg_print("You are no longer hungry.");
3967 msg_print("ËþÊ¢¤À¡ª");
3969 msg_print("You are full!");
3977 msg_print("¿©¤Ù²á¤®¤À¡ª");
3979 msg_print("You have gorged yourself!");
3981 chg_virtue(V_HARMONY, -1);
3982 chg_virtue(V_PATIENCE, -1);
3983 chg_virtue(V_TEMPERANCE, -2);
3993 else if (new_aux < old_aux)
3995 /* Describe the state */
3998 /* Fainting / Starving */
4001 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
4003 msg_print("You are getting faint from hunger!");
4011 msg_print("¤ªÊ¢¤¬¶õ¤¤¤ÆÅݤ줽¤¦¤À¡£");
4013 msg_print("You are getting weak from hunger!");
4021 msg_print("¤ªÊ¢¤¬¶õ¤¤¤Æ¤¤¿¡£");
4023 msg_print("You are getting hungry.");
4031 msg_print("ËþÊ¢´¶¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
4033 msg_print("You are no longer full.");
4041 msg_print("¤ä¤Ã¤È¤ªÊ¢¤¬¤¤Ä¤¯¤Ê¤¯¤Ê¤Ã¤¿¡£");
4043 msg_print("You are no longer gorged.");
4049 if (p_ptr->wild_mode && (new_aux < 2))
4051 p_ptr->wilderness_x = px;
4052 p_ptr->wilderness_y = py;
4053 p_ptr->energy_need = 0;
4064 /* Nothing to notice */
4065 if (!notice) return (FALSE);
4068 if (disturb_state) disturb(0, 0);
4070 /* Recalculate bonuses */
4071 p_ptr->update |= (PU_BONUS);
4074 p_ptr->redraw |= (PR_HUNGER);
4084 * Increases a stat by one randomized level -RAK-
4086 * Note that this function (used by stat potions) now restores
4087 * the stat BEFORE increasing it.
4089 bool inc_stat(int stat)
4093 /* Then augment the current/max stat */
4094 value = p_ptr->stat_cur[stat];
4096 /* Cannot go above 18/100 */
4097 if (value < p_ptr->stat_max_max[stat])
4099 /* Gain one (sometimes two) points */
4102 gain = ((randint0(100) < 75) ? 1 : 2);
4106 /* Gain 1/6 to 1/3 of distance to 18/100 */
4107 else if (value < (p_ptr->stat_max_max[stat]-2))
4109 /* Approximate gain value */
4110 gain = (((p_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
4113 if (gain < 1) gain = 1;
4115 /* Apply the bonus */
4116 value += randint1(gain) + gain / 2;
4119 if (value > (p_ptr->stat_max_max[stat]-1)) value = p_ptr->stat_max_max[stat]-1;
4122 /* Gain one point at a time */
4128 /* Save the new value */
4129 p_ptr->stat_cur[stat] = value;
4131 /* Bring up the maximum too */
4132 if (value > p_ptr->stat_max[stat])
4134 p_ptr->stat_max[stat] = value;
4137 /* Recalculate bonuses */
4138 p_ptr->update |= (PU_BONUS);
4144 /* Nothing to gain */
4151 * Decreases a stat by an amount indended to vary from 0 to 100 percent.
4153 * Amount could be a little higher in extreme cases to mangle very high
4154 * stats from massive assaults. -CWS
4156 * Note that "permanent" means that the *given* amount is permanent,
4157 * not that the new value becomes permanent. This may not work exactly
4158 * as expected, due to "weirdness" in the algorithm, but in general,
4159 * if your stat is already drained, the "max" value will not drop all
4160 * the way down to the "cur" value.
4162 bool dec_stat(int stat, int amount, int permanent)
4164 int cur, max, loss, same, res = FALSE;
4167 /* Acquire current value */
4168 cur = p_ptr->stat_cur[stat];
4169 max = p_ptr->stat_max[stat];
4171 /* Note when the values are identical */
4172 same = (cur == max);
4174 /* Damage "current" value */
4177 /* Handle "low" values */
4180 if (amount > 90) cur--;
4181 if (amount > 50) cur--;
4182 if (amount > 20) cur--;
4186 /* Handle "high" values */
4189 /* Hack -- Decrement by a random amount between one-quarter */
4190 /* and one-half of the stat bonus times the percentage, with a */
4191 /* minimum damage of half the percentage. -CWS */
4192 loss = (((cur-18) / 2 + 1) / 2 + 1);
4195 if (loss < 1) loss = 1;
4197 /* Randomize the loss */
4198 loss = ((randint1(loss) + loss) * amount) / 100;
4201 if (loss < amount/2) loss = amount/2;
4203 /* Lose some points */
4206 /* Hack -- Only reduce stat to 17 sometimes */
4207 if (cur < 18) cur = (amount <= 20) ? 18 : 17;
4210 /* Prevent illegal values */
4211 if (cur < 3) cur = 3;
4213 /* Something happened */
4214 if (cur != p_ptr->stat_cur[stat]) res = TRUE;
4217 /* Damage "max" value */
4218 if (permanent && (max > 3))
4220 chg_virtue(V_SACRIFICE, 1);
4221 if (stat == A_WIS || stat == A_INT)
4222 chg_virtue(V_ENLIGHTEN, -2);
4224 /* Handle "low" values */
4227 if (amount > 90) max--;
4228 if (amount > 50) max--;
4229 if (amount > 20) max--;
4233 /* Handle "high" values */
4236 /* Hack -- Decrement by a random amount between one-quarter */
4237 /* and one-half of the stat bonus times the percentage, with a */
4238 /* minimum damage of half the percentage. -CWS */
4239 loss = (((max-18) / 2 + 1) / 2 + 1);
4240 loss = ((randint1(loss) + loss) * amount) / 100;
4241 if (loss < amount/2) loss = amount/2;
4243 /* Lose some points */
4246 /* Hack -- Only reduce stat to 17 sometimes */
4247 if (max < 18) max = (amount <= 20) ? 18 : 17;
4250 /* Hack -- keep it clean */
4251 if (same || (max < cur)) max = cur;
4253 /* Something happened */
4254 if (max != p_ptr->stat_max[stat]) res = TRUE;
4260 /* Actually set the stat to its new value. */
4261 p_ptr->stat_cur[stat] = cur;
4262 p_ptr->stat_max[stat] = max;
4264 /* Recalculate bonuses */
4265 p_ptr->update |= (PU_BONUS);
4274 * Restore a stat. Return TRUE only if this actually makes a difference.
4276 bool res_stat(int stat)
4278 /* Restore if needed */
4279 if (p_ptr->stat_cur[stat] != p_ptr->stat_max[stat])
4282 p_ptr->stat_cur[stat] = p_ptr->stat_max[stat];
4284 /* Recalculate bonuses */
4285 p_ptr->update |= (PU_BONUS);
4291 /* Nothing to restore */
4297 * Increase players hit points, notice effects
4299 bool hp_player(int num)
4302 vir = virtue_number(V_VITALITY);
4305 num = num * (p_ptr->virtues[vir - 1] + 1250) / 1250;
4307 /* Healing needed */
4308 if (p_ptr->chp < p_ptr->mhp)
4310 if ((num > 0) && (p_ptr->chp < (p_ptr->mhp/3)))
4311 chg_virtue(V_TEMPERANCE, 1);
4312 /* Gain hitpoints */
4315 /* Enforce maximum */
4316 if (p_ptr->chp >= p_ptr->mhp)
4318 p_ptr->chp = p_ptr->mhp;
4319 p_ptr->chp_frac = 0;
4323 p_ptr->redraw |= (PR_HP);
4326 p_ptr->window |= (PW_PLAYER);
4332 msg_print("¾¯¤·µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4334 msg_print("You feel a little better.");
4343 msg_print("µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4345 msg_print("You feel better.");
4354 msg_print("¤È¤Æ¤âµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4356 msg_print("You feel much better.");
4365 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4367 msg_print("You feel very good.");
4382 * Array of stat "descriptions"
4384 static cptr desc_stat_pos[] =
4426 * Array of stat "descriptions"
4428 static cptr desc_stat_neg[] =
4452 bool do_dec_stat(int stat)
4456 /* Access the "sustain" */
4459 case A_STR: if (p_ptr->sustain_str) sust = TRUE; break;
4460 case A_INT: if (p_ptr->sustain_int) sust = TRUE; break;
4461 case A_WIS: if (p_ptr->sustain_wis) sust = TRUE; break;
4462 case A_DEX: if (p_ptr->sustain_dex) sust = TRUE; break;
4463 case A_CON: if (p_ptr->sustain_con) sust = TRUE; break;
4464 case A_CHR: if (p_ptr->sustain_chr) sust = TRUE; break;
4468 if (sust && (!ironman_nightmare || randint0(13)))
4472 msg_format("%s¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¤¬¡¢¤¹¤°¤Ë¸µ¤ËÌá¤Ã¤¿¡£",
4474 msg_format("You feel %s for a moment, but the feeling passes.",
4477 desc_stat_neg[stat]);
4483 /* Attempt to reduce the stat */
4484 if (dec_stat(stat, 10, (ironman_nightmare && !randint0(13))))
4488 msg_format("¤Ò¤É¤¯%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_neg[stat]);
4490 msg_format("You feel very %s.", desc_stat_neg[stat]);
4498 /* Nothing obvious */
4504 * Restore lost "points" in a stat
4506 bool do_res_stat(int stat)
4508 /* Attempt to increase */
4513 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4515 msg_format("You feel less %s.", desc_stat_neg[stat]);
4523 /* Nothing obvious */
4529 * Gain a "point" in a stat
4531 bool do_inc_stat(int stat)
4535 /* Restore strength */
4536 res = res_stat(stat);
4538 /* Attempt to increase */
4543 chg_virtue(V_ENLIGHTEN, 1);
4544 chg_virtue(V_FAITH, 1);
4546 else if (stat == A_INT)
4548 chg_virtue(V_KNOWLEDGE, 1);
4549 chg_virtue(V_ENLIGHTEN, 1);
4551 else if (stat == A_CON)
4552 chg_virtue(V_VITALITY, 1);
4556 msg_format("¥ï¡¼¥ª¡ª¤È¤Æ¤â%s¤Ê¤Ã¤¿¡ª", desc_stat_pos[stat]);
4558 msg_format("Wow! You feel very %s!", desc_stat_pos[stat]);
4566 /* Restoration worked */
4571 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4573 msg_format("You feel less %s.", desc_stat_neg[stat]);
4581 /* Nothing obvious */
4587 * Restores any drained experience
4589 bool restore_level(void)
4591 /* Restore experience */
4592 if (p_ptr->exp < p_ptr->max_exp)
4596 msg_print("À¸Ì¿ÎϤ¬Ìá¤Ã¤Æ¤¤¿µ¤¤¬¤¹¤ë¡£");
4598 msg_print("You feel your life energies returning.");
4602 /* Restore the experience */
4603 p_ptr->exp = p_ptr->max_exp;
4605 /* Check the experience */
4620 bool lose_all_info(void)
4624 chg_virtue(V_KNOWLEDGE, -5);
4625 chg_virtue(V_ENLIGHTEN, -5);
4627 /* Forget info about objects */
4628 for (i = 0; i < INVEN_TOTAL; i++)
4630 object_type *o_ptr = &inventory[i];
4632 /* Skip non-objects */
4633 if (!o_ptr->k_idx) continue;
4635 /* Allow "protection" by the MENTAL flag */
4636 if (o_ptr->ident & (IDENT_MENTAL)) continue;
4638 /* Remove "default inscriptions" */
4639 o_ptr->feeling = FEEL_NONE;
4641 /* Hack -- Clear the "empty" flag */
4642 o_ptr->ident &= ~(IDENT_EMPTY);
4644 /* Hack -- Clear the "known" flag */
4645 o_ptr->ident &= ~(IDENT_KNOWN);
4647 /* Hack -- Clear the "felt" flag */
4648 o_ptr->ident &= ~(IDENT_SENSE);
4651 /* Recalculate bonuses */
4652 p_ptr->update |= (PU_BONUS);
4654 /* Combine / Reorder the pack (later) */
4655 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
4658 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
4660 /* Mega-Hack -- Forget the map */
4668 void do_poly_wounds(void)
4670 /* Changed to always provide at least _some_ healing */
4671 s16b wounds = p_ptr->cut;
4672 s16b hit_p = (p_ptr->mhp - p_ptr->chp);
4673 s16b change = damroll(p_ptr->lev, 5);
4674 bool Nasty_effect = one_in_(5);
4676 if (!(wounds || hit_p || Nasty_effect)) return;
4679 msg_print("½ý¤¬¤è¤ê·Ú¤¤¤â¤Î¤ËÊѲ½¤·¤¿¡£");
4681 msg_print("Your wounds are polymorphed into less serious ones.");
4688 msg_print("¿·¤¿¤Ê½ý¤¬¤Ç¤¤¿¡ª");
4689 take_hit(DAMAGE_LOSELIFE, change / 2, "ÊѲ½¤·¤¿½ý", -1);
4691 msg_print("A new wound was created!");
4692 take_hit(DAMAGE_LOSELIFE, change / 2, "a polymorphed wound", -1);
4699 set_cut(p_ptr->cut - (change / 2));
4704 void do_poly_self(void)
4706 int power = p_ptr->lev;
4709 msg_print("¤¢¤Ê¤¿¤ÏÊѲ½¤Îˬ¤ì¤ò´¶¤¸¤¿...");
4711 msg_print("You feel a change coming over you...");
4714 chg_virtue(V_CHANCE, 1);
4716 if ((power > randint0(20)) && one_in_(3) && (p_ptr->prace != RACE_ANDROID))
4718 char effect_msg[80] = "";
4719 int new_race, expfact, goalexpfact, h_percent;
4721 /* Some form of racial polymorph... */
4724 if ((power > randint0(5)) && one_in_(4))
4729 if (p_ptr->psex == SEX_MALE)
4731 p_ptr->psex = SEX_FEMALE;
4732 sp_ptr = &sex_info[p_ptr->psex];
4734 sprintf(effect_msg, "½÷À¤Î");
4736 sprintf(effect_msg, "female ");
4742 p_ptr->psex = SEX_MALE;
4743 sp_ptr = &sex_info[p_ptr->psex];
4745 sprintf(effect_msg, "ÃËÀ¤Î");
4747 sprintf(effect_msg, "male ");
4753 if ((power > randint0(30)) && one_in_(5))
4757 /* Harmful deformity */
4764 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
4770 /* Deformities are discriminated against! */
4771 (void)dec_stat(A_CHR, randint1(6), TRUE);
4777 sprintf(tmp_msg,"%s",effect_msg);
4778 sprintf(effect_msg,"´ñ·Á¤Î%s",tmp_msg);
4780 sprintf(tmp_msg,"%s ",effect_msg);
4781 sprintf(effect_msg,"deformed %s ",tmp_msg);
4788 sprintf(effect_msg,"´ñ·Á¤Î");
4790 sprintf(effect_msg,"deformed ");
4796 while ((power > randint0(20)) && one_in_(10))
4798 /* Polymorph into a less mutated form */
4801 if (!lose_mutation(0))
4803 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
4805 msg_print("You feel oddly normal.");
4811 * Restrict the race choices by exp penalty so
4812 * weak polymorph always means weak race
4817 goalexpfact = 100 + 3 * randint0(power);
4821 new_race = randint0(MAX_RACES);
4822 expfact = race_info[new_race].r_exp;
4824 while (((new_race == p_ptr->prace) && (expfact > goalexpfact)) || (new_race == RACE_ANDROID));
4827 msg_format("¤¢¤Ê¤¿¤Ï%s%s¤ËÊѲ½¤·¤¿¡ª", effect_msg,
4828 race_info[new_race].title);
4832 msg_format("You turn into a%s %s!",
4833 ((new_race == RACE_AMBERITE || new_race == RACE_ELF
4834 || new_race == RACE_IMP) ? "n" : ""),
4835 race_info[new_race].title);
4839 msg_format("You turn into a %s%s!", effect_msg,
4840 race_info[new_race].title);
4844 chg_virtue(V_CHANCE, 2);
4846 if (p_ptr->prace < 32)
4848 p_ptr->old_race1 |= 1L << p_ptr->prace;
4852 p_ptr->old_race2 = 1L << (p_ptr->prace-32);
4854 p_ptr->prace = new_race;
4855 rp_ptr = &race_info[p_ptr->prace];
4857 /* Experience factor */
4858 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
4860 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)))
4861 p_ptr->expfact -= 15;
4864 /* Calculate the height/weight for males */
4865 if (p_ptr->psex == SEX_MALE)
4867 p_ptr->ht = randnor(rp_ptr->m_b_ht, rp_ptr->m_m_ht);
4868 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->m_b_ht);
4869 p_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * h_percent /100
4870 , (int)(rp_ptr->m_m_wt) * h_percent / 300 );
4873 /* Calculate the height/weight for females */
4874 else if (p_ptr->psex == SEX_FEMALE)
4876 p_ptr->ht = randnor(rp_ptr->f_b_ht, rp_ptr->f_m_ht);
4877 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->f_b_ht);
4878 p_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * h_percent /100
4879 , (int)(rp_ptr->f_m_wt) * h_percent / 300 );
4885 if (p_ptr->pclass == CLASS_SORCERER)
4886 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
4888 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
4890 do_cmd_rerate(FALSE);
4892 p_ptr->redraw |= (PR_BASIC);
4894 p_ptr->update |= (PU_BONUS);
4900 if ((power > randint0(30)) && one_in_(6))
4908 msg_format("%s¤Î¹½À®¤¬ÊѲ½¤·¤¿¡ª", p_ptr->prace == RACE_ANDROID ? "µ¡³£" : "Æâ¡");
4910 msg_print("Your internal organs are rearranged!");
4915 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
4921 msg_print("¸½ºß»Ñ¤ÇÀ¸¤¤Æ¤¤¤¯¤Î¤Ïº¤Æñ¤Ê¤è¤¦¤À¡ª");
4922 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), "Ã×̿Ū¤ÊÆÍÁ³ÊÑ°Û", -1);
4924 msg_print("You find living difficult in your present form!");
4925 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), "a lethal mutation", -1);
4932 if ((power > randint0(20)) && one_in_(4))
4937 do_cmd_rerate(FALSE);
4940 while ((power > randint0(15)) && one_in_(3))
4943 (void)gain_random_mutation(0);
4946 if (power > randint0(5))
4952 /* Note: earlier deductions may have left power < 0 already. */
4962 * Decreases players hit points and sets death flag if necessary
4964 * XXX XXX XXX Invulnerability needs to be changed into a "shield"
4966 * XXX XXX XXX Hack -- this function allows the user to save (or quit)
4967 * the game when he dies, since the "You die." message is shown before
4968 * setting the player to "dead".
4970 int take_hit(int damage_type, int damage, cptr hit_from, int monspell)
4972 int old_chp = p_ptr->chp;
4974 char death_message[1024];
4977 int warning = (p_ptr->mhp * hitpoint_warn / 10);
4980 if (p_ptr->is_dead) return 0;
4982 if (p_ptr->sutemi) damage *= 2;
4983 if (p_ptr->special_defense & KATA_IAI) damage += (damage + 4) / 5;
4985 if (easy_band) damage = (damage+1)/2;
4987 if (damage_type != DAMAGE_USELIFE)
4997 if (monspell >= 0) learn_spell(monspell);
4999 /* Mega-Hack -- Apply "invulnerability" */
5000 if ((damage_type != DAMAGE_USELIFE) && (damage_type != DAMAGE_LOSELIFE))
5002 if ((p_ptr->invuln || ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == MUSIC_INVULN))) && (damage < 9000))
5004 if (damage_type == DAMAGE_FORCE)
5007 msg_print("¥Ð¥ê¥¢¤¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5009 msg_print("The attack cuts your shield of invulnerability open!");
5012 else if (one_in_(PENETRATE_INVULNERABILITY))
5015 msg_print("̵Ũ¤Î¥Ð¥ê¥¢¤òÇˤäƹ¶·â¤µ¤ì¤¿¡ª");
5017 msg_print("The attack penetrates your shield of invulnerability!");
5026 /* Multishadow effects is determined by turn */
5027 if (p_ptr->multishadow && (turn & 1))
5029 if (damage_type == DAMAGE_FORCE)
5032 msg_print("¸¸±Æ¤â¤í¤È¤âÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5034 msg_print("The attack hits Shadow together with you!");
5037 else if (damage_type == DAMAGE_ATTACK)
5040 msg_print("¹¶·â¤Ï¸¸±Æ¤ËÌ¿Ã椷¡¢¤¢¤Ê¤¿¤Ë¤ÏÆϤ«¤Ê¤«¤Ã¤¿¡£");
5042 msg_print("The attack hits Shadow, you are unharmed!");
5048 if (p_ptr->wraith_form)
5050 if (damage_type == DAMAGE_FORCE)
5053 msg_print("Ⱦʪ¼Á¤ÎÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5055 msg_print("The attack cuts through your ethereal body!");
5061 if ((damage == 0) && one_in_(2)) damage = 1;
5065 if ((p_ptr->special_defense & KATA_MUSOU))
5068 if ((damage == 0) && one_in_(2)) damage = 1;
5070 } /* not if LOSELIFE USELIFE */
5072 /* Hurt the player */
5073 p_ptr->chp -= damage;
5074 if(damage_type == DAMAGE_GENO && p_ptr->chp < 0)
5076 damage += p_ptr->chp;
5080 /* Display the hitpoints */
5081 p_ptr->redraw |= (PR_HP);
5084 p_ptr->window |= (PW_PLAYER);
5088 if (damage_type != DAMAGE_GENO && p_ptr->chp == 0)
5090 chg_virtue(V_SACRIFICE, 1);
5091 chg_virtue(V_CHANCE, 2);
5098 bool android = (p_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
5100 #ifdef JP /* »à¤ó¤À»þ¤Ë¶¯À©½ªÎ»¤·¤Æ»à¤ò²óÈò¤Ç¤¤Ê¤¯¤·¤Æ¤ß¤¿ by Habu */
5101 if (!munchkin_death)
5102 if(!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
5108 chg_virtue(V_SACRIFICE, 10);
5111 p_ptr->leaving = TRUE;
5114 p_ptr->is_dead = TRUE;
5116 if (p_ptr->inside_arena)
5118 cptr m_name = r_name+r_info[arena_monsters[p_ptr->arena_number]].name;
5120 msg_format("¤¢¤Ê¤¿¤Ï%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£", m_name);
5122 msg_format("You are beaten by %s.", m_name);
5125 if (record_arena) do_cmd_write_nikki(NIKKI_ARENA, 99, m_name);
5130 /* Make screen dump */
5131 screen_dump = make_screen_dump();
5134 /* Note cause of death */
5136 sprintf(p_ptr->died_from, "%s%s%s", !p_ptr->paralyzed ? "" : p_ptr->free_act ? "ĦÁü¾õÂÖ¤Ç":"Ëãáã¾õÂÖ¤Ç", p_ptr->image ? "¸¸³Ð¤ËÏĤó¤À" : "", hit_from);
5138 sprintf(p_ptr->died_from, "%s%s", hit_from, !p_ptr->paralyzed ? "" : " while helpless");
5141 /* No longer a winner */
5142 p_ptr->total_winner = FALSE;
5144 if (p_ptr->inside_arena)
5146 strcpy(buf,"¥¢¥ê¡¼¥Ê");
5148 strcpy(buf,"in the Arena");
5150 else if (!dun_level)
5154 strcpy(buf,"on The surface");
5156 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)))
5158 strcpy(buf,"¥¯¥¨¥¹¥È");
5160 strcpy(buf,"in a quest");
5164 sprintf(buf,"%d³¬", dun_level);
5166 sprintf(buf,"level %d", dun_level);
5169 sprintf(tmp,"%s¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£",buf, p_ptr->died_from);
5171 sprintf(tmp,"killed by %s %s.", p_ptr->died_from, buf);
5173 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5175 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- ¥²¡¼¥à¥ª¡¼¥Ð¡¼ --------");
5177 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- Game Over --------");
5179 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, "\n\n\n\n");
5184 if (get_check_strict("²èÌ̤òÊݸ¤·¤Þ¤¹¤«¡©", CHECK_NO_HISTORY))
5186 if (get_check_strict("Dump the screen? ", CHECK_NO_HISTORY))
5190 do_cmd_save_screen();
5195 /* Hack -- Note death */
5199 msg_format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë");
5201 msg_print(android ? "You are broken." : "You die.");
5208 if (streq(p_ptr->died_from, "Seppuku"))
5211 get_rnd_line("seppuku_j.txt", 0, death_message);
5213 get_rnd_line("seppuku.txt", 0, death_message);
5219 get_rnd_line("death_j.txt", 0, death_message);
5221 get_rnd_line("death.txt", 0, death_message);
5225 while (!get_string(streq(p_ptr->died_from, "Seppuku") ? "¼À¤¤Î¶ç: " : "ÃÇËöËâ¤Î¶«¤Ó: ", death_message, 1024)) ;
5227 while (!get_string("Last word: ", death_message, 1024)) ;
5229 if (death_message[0] == '\0')
5232 strcpy(death_message, format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë"));
5234 strcpy(death_message, android ? "You are broken." : "You die.");
5237 if (streq(p_ptr->died_from, "Seppuku"))
5243 int msg_pos_x[9] = { 5, 7, 9, 12, 14, 17, 19, 21, 23};
5244 int msg_pos_y[9] = { 3, 4, 5, 4, 5, 4, 5, 6, 4};
5251 for (i = 0; i < 40; i++)
5252 Term_putstr(randint0(w / 2) * 2, randint0(h), 2, TERM_VIOLET, "¦Ô");
5254 str = death_message;
5255 if (strncmp(str, "¡Ö", 2) == 0) str += 2;
5257 str2 = strstr_j(str, "¡×");
5258 if (str2 != NULL) str2 = '\0';
5263 str2 = strstr_j(str, " ");
5264 if (str2 == NULL) len = strlen(str);
5265 else len = str2 - str;
5269 Term_putstr_v(w * 3 / 4 - 2 - msg_pos_x[i] * 2, msg_pos_y[i], len,
5271 if (str2 == NULL) break;
5275 if (*str == 0) break;
5280 msg_print(death_message);
5284 msg_print(death_message);
5292 /* Hitpoint warning */
5293 if (p_ptr->chp < warning)
5295 /* Hack -- bell on first notice */
5296 if (alert_hitpoint && (old_chp > warning)) bell();
5300 if (record_danger && (old_chp > warning))
5302 if (p_ptr->image && damage_type == DAMAGE_ATTACK)
5306 hit_from = "something";
5310 sprintf(tmp,"%s¤Ë¤è¤Ã¤Æ¥Ô¥ó¥Á¤Ë´Ù¤¤¤Ã¤¿¡£",hit_from);
5312 sprintf(tmp,"A critical situation because of %s.",hit_from);
5314 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5319 /* stop auto_more even if DAMAGE_USELIFE */
5325 msg_print("*** ·Ù¹ð:Äã¥Ò¥Ã¥È¡¦¥Ý¥¤¥ó¥È¡ª ***");
5327 msg_print("*** LOW HITPOINT WARNING! ***");
5333 if (p_ptr->wild_mode && !p_ptr->leaving && (p_ptr->chp < MAX(warning, p_ptr->mhp/5)))
5335 p_ptr->wilderness_x = px;
5336 p_ptr->wilderness_y = py;
5337 p_ptr->energy_need = 0;
5347 void gain_exp(s32b amount)
5349 if (p_ptr->is_dead) return;
5351 if (p_ptr->prace == RACE_ANDROID) return;
5353 /* Gain some experience */
5354 p_ptr->exp += amount;
5356 /* Slowly recover from experience drainage */
5357 if (p_ptr->exp < p_ptr->max_exp)
5359 /* Gain max experience (20%) (was 10%) */
5360 p_ptr->max_exp += amount / 5;
5363 /* Check Experience */
5368 void calc_android_exp(void)
5372 if (p_ptr->is_dead) return;
5374 if (p_ptr->prace != RACE_ANDROID) return;
5376 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5378 object_type *o_ptr = &inventory[i];
5380 object_type *q_ptr = &forge;
5382 int level = MAX(get_object_level(o_ptr) - 8, 1);
5384 if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue;
5385 if (!o_ptr->k_idx) continue;
5387 /* Wipe the object */
5390 object_copy(q_ptr, o_ptr);
5391 q_ptr->discount = 0;
5392 q_ptr->curse_flags = 0L;
5396 level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
5397 level += MIN(20, a_info[o_ptr->name1].rarity/(a_info[o_ptr->name1].gen_flags & TRG_INSTA_ART ? 10 : 3));
5399 else if (o_ptr->name2) level += MAX(3, (e_info[o_ptr->name2].rating - 5)/2);
5400 value = object_value_real(q_ptr);
5402 if (value <= 0) continue;
5403 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (p_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
5404 if (value > 5000000L) value = 5000000L;
5405 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
5407 if (o_ptr->name1 || o_ptr->name2 || o_ptr->art_name ||
5408 (o_ptr->tval == TV_DRAG_ARMOR) ||
5409 ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) ||
5410 ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) ||
5411 ((o_ptr->tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)) ||
5412 ((o_ptr->tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) ||
5413 ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE)))
5415 if (level > 65) level = 35 + (level - 65) / 5;
5416 else if (level > 35) level = 25 + (level - 35) / 3;
5417 else if (level > 15) level = 15 + (level - 15) / 2;
5418 exp = MIN(100000L, value) * level * level / 2;
5419 if (value > 100000L)
5420 exp += (value - 100000L) * level * level / 8;
5424 exp = MIN(100000L, value) * level;
5425 if (value > 100000L)
5426 exp += (value - 100000L) * level / 4;
5428 if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (buki_motteruka(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
5429 else total_exp += exp / 16;
5430 if (i == INVEN_BODY) total_exp += exp / 32;
5432 p_ptr->exp = p_ptr->max_exp = total_exp;
5434 /* Check Experience */
5442 void lose_exp(s32b amount)
5444 if (p_ptr->prace == RACE_ANDROID) return;
5446 /* Never drop below zero experience */
5447 if (amount > p_ptr->exp) amount = p_ptr->exp;
5449 /* Lose some experience */
5450 p_ptr->exp -= amount;
5452 /* Check Experience */
5456 bool set_ultimate_res(int v, bool do_dec)
5458 bool notice = FALSE;
5460 /* Hack -- Force good values */
5461 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5463 if (p_ptr->is_dead) return FALSE;
5468 if (p_ptr->ult_res && !do_dec)
5470 if (p_ptr->ult_res > v) return FALSE;
5472 else if (!p_ptr->ult_res)
5475 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5477 msg_print("You feel resistant!");
5490 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5492 msg_print("You feel less resistant");
5502 /* Redraw status bar */
5503 p_ptr->redraw |= (PR_STATUS);
5505 /* Nothing to notice */
5506 if (!notice) return (FALSE);
5509 if (disturb_state) disturb(0, 0);
5511 /* Recalculate bonuses */
5512 p_ptr->update |= (PU_BONUS);
5521 bool set_tim_res_nether(int v, bool do_dec)
5523 bool notice = FALSE;
5525 /* Hack -- Force good values */
5526 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5528 if (p_ptr->is_dead) return FALSE;
5533 if (p_ptr->tim_res_nether && !do_dec)
5535 if (p_ptr->tim_res_nether > v) return FALSE;
5537 else if (!p_ptr->tim_res_nether)
5540 msg_print("ÃϹö¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5542 msg_print("You feel nether resistant!");
5552 if (p_ptr->tim_res_nether)
5555 msg_print("ÃϹö¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5557 msg_print("You feel less nether resistant");
5565 p_ptr->tim_res_nether = v;
5567 /* Redraw status bar */
5568 p_ptr->redraw |= (PR_STATUS);
5570 /* Nothing to notice */
5571 if (!notice) return (FALSE);
5574 if (disturb_state) disturb(0, 0);
5576 /* Recalculate bonuses */
5577 p_ptr->update |= (PU_BONUS);
5586 bool set_tim_res_time(int v, bool do_dec)
5588 bool notice = FALSE;
5590 /* Hack -- Force good values */
5591 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5593 if (p_ptr->is_dead) return FALSE;
5598 if (p_ptr->tim_res_time && !do_dec)
5600 if (p_ptr->tim_res_time > v) return FALSE;
5602 else if (!p_ptr->tim_res_time)
5605 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5607 msg_print("You feel time resistant!");
5617 if (p_ptr->tim_res_time)
5620 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5622 msg_print("You feel less time resistant");
5630 p_ptr->tim_res_time = v;
5632 /* Redraw status bar */
5633 p_ptr->redraw |= (PR_STATUS);
5635 /* Nothing to notice */
5636 if (!notice) return (FALSE);
5639 if (disturb_state) disturb(0, 0);
5641 /* Recalculate bonuses */
5642 p_ptr->update |= (PU_BONUS);
5653 * Choose a warrior-mage elemental attack. -LM-
5655 bool choose_ele_attack(void)
5664 num = (p_ptr->lev - 20) / 5;
5667 c_prt(TERM_RED, " a) ¾Æ´þ", 2, 14);
5669 c_prt(TERM_RED, " a) Fire Brand", 2, 14);
5673 if (num >= 2) c_prt(TERM_L_WHITE," b) Åà·ë", 3, 14);
5675 if (num >= 2) c_prt(TERM_L_WHITE," b) Cold Brand", 3, 14);
5677 else prt("", 3, 14);
5680 if (num >= 3) c_prt(TERM_GREEN, " c) ÆÇ»¦", 4, 14);
5682 if (num >= 3) c_prt(TERM_GREEN, " c) Poison Brand", 4, 14);
5684 else prt("", 4, 14);
5687 if (num >= 4) c_prt(TERM_L_DARK, " d) Íϲò", 5, 14);
5689 if (num >= 4) c_prt(TERM_L_DARK, " d) Acid Brand", 5, 14);
5691 else prt("", 5, 14);
5694 if (num >= 5) c_prt(TERM_BLUE, " e) ÅÅ·â", 6, 14);
5696 if (num >= 5) c_prt(TERM_BLUE, " e) Elec Brand", 6, 14);
5698 else prt("", 6, 14);
5706 prt(" ¤É¤Î¸µÁǹ¶·â¤ò¤·¤Þ¤¹¤«¡©", 1, 14);
5708 prt(" Choose a temporary elemental brand ", 1, 14);
5713 if ((choice == 'a') || (choice == 'A'))
5714 set_ele_attack(ATTACK_FIRE, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5715 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
5716 set_ele_attack(ATTACK_COLD, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5717 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
5718 set_ele_attack(ATTACK_POIS, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5719 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
5720 set_ele_attack(ATTACK_ACID, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5721 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
5722 set_ele_attack(ATTACK_ELEC, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5726 msg_print("ËâË¡·õ¤ò»È¤¦¤Î¤ò¤ä¤á¤¿¡£");
5728 msg_print("You cancel the temporary branding.");
5740 * Choose a elemental immune. -LM-
5742 bool choose_ele_immune(int turn)
5750 c_prt(TERM_RED, " a) ²Ð±ê", 2, 14);
5752 c_prt(TERM_RED, " a) Immune Fire", 2, 14);
5756 c_prt(TERM_L_WHITE," b) Î䵤", 3, 14);
5758 c_prt(TERM_L_WHITE," b) Immune Cold", 3, 14);
5762 c_prt(TERM_L_DARK, " c) »À", 4, 14);
5764 c_prt(TERM_L_DARK, " c) Immune Acid", 4, 14);
5768 c_prt(TERM_BLUE, " d) ÅÅ·â", 5, 14);
5770 c_prt(TERM_BLUE, " d) Immune Elec", 5, 14);
5781 prt(" ¤É¤Î¸µÁǤÎÌȱ֤ò¤Ä¤±¤Þ¤¹¤«¡©", 1, 14);
5783 prt(" Choose a temporary elemental immune ", 1, 14);
5788 if ((choice == 'a') || (choice == 'A'))
5789 set_ele_immune(DEFENSE_FIRE, turn);
5790 else if ((choice == 'b') || (choice == 'B'))
5791 set_ele_immune(DEFENSE_COLD, turn);
5792 else if ((choice == 'c') || (choice == 'C'))
5793 set_ele_immune(DEFENSE_ACID, turn);
5794 else if ((choice == 'd') || (choice == 'D'))
5795 set_ele_immune(DEFENSE_ELEC, turn);
5799 msg_print("Ìȱ֤òÉÕ¤±¤ë¤Î¤ò¤ä¤á¤¿¡£");
5801 msg_print("You cancel the temporary immune.");