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->alter_reality = FALSE;
200 p_ptr->sutemi = FALSE;
201 p_ptr->counter = FALSE;
202 p_ptr->ele_attack = 0;
203 p_ptr->ele_immune = 0;
204 p_ptr->special_attack = 0L;
205 p_ptr->special_defense = 0L;
207 while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
208 world_player = FALSE;
210 if (prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
211 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1;
212 if (p_ptr->pclass == CLASS_BERSERKER) p_ptr->shero = 1;
216 m_list[p_ptr->riding].fast = 0;
217 m_list[p_ptr->riding].slow = 0;
218 m_list[p_ptr->riding].invulner = 0;
221 if (p_ptr->pclass == CLASS_BARD)
223 p_ptr->magic_num1[0] = 0;
224 p_ptr->magic_num2[0] = 0;
230 * Set "p_ptr->tim_mimic", and "p_ptr->mimic_form",
231 * notice observable changes
233 bool set_mimic(int v, int p, bool do_dec)
237 /* Hack -- Force good values */
238 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
240 if (p_ptr->is_dead) return FALSE;
245 if (p_ptr->tim_mimic && (p_ptr->mimic_form == p) && !do_dec)
247 if (p_ptr->tim_mimic > v) return FALSE;
249 else if ((!p_ptr->tim_mimic) || (p_ptr->mimic_form != p))
252 msg_print("¼«Ê¬¤ÎÂΤ¬ÊѤï¤Ã¤Æ¤æ¤¯¤Î¤ò´¶¤¸¤¿¡£");
254 msg_print("You feel that your body changes.");
264 if (p_ptr->tim_mimic)
267 msg_print("ÊѿȤ¬²ò¤±¤¿¡£");
269 msg_print("You are no longer transformed.");
271 if (p_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(0, TRUE);
279 p_ptr->tim_mimic = v;
281 /* Nothing to notice */
290 p_ptr->redraw |= (PR_BASIC | PR_STATUS);
292 /* Recalculate bonuses */
293 p_ptr->update |= (PU_BONUS | PU_HP);
302 * Set "p_ptr->blind", notice observable changes
304 * Note the use of "PU_UN_LITE" and "PU_UN_VIEW", which is needed to
305 * memorize any terrain features which suddenly become "visible".
306 * Note that blindness is currently the only thing which can affect
307 * "player_can_see_bold()".
309 bool set_blind(int v)
313 /* Hack -- Force good values */
314 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
316 if (p_ptr->is_dead) return FALSE;
323 if (p_ptr->prace == RACE_ANDROID)
326 msg_print("¥»¥ó¥µ¡¼¤ò¤ä¤é¤ì¤¿¡ª");
328 msg_print("You are blind!");
334 msg_print("Ìܤ¬¸«¤¨¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
336 msg_print("You are blind!");
341 chg_virtue(V_ENLIGHTEN, -1);
350 if (p_ptr->prace == RACE_ANDROID)
353 msg_print("¥»¥ó¥µ¡¼¤¬Éüµì¤·¤¿¡£");
355 msg_print("You can see again.");
361 msg_print("¤ä¤Ã¤ÈÌܤ¬¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
363 msg_print("You can see again.");
374 /* Redraw status bar */
375 p_ptr->redraw |= (PR_STATUS);
377 /* Nothing to notice */
378 if (!notice) return (FALSE);
381 if (disturb_state) disturb(0, 0);
383 /* Fully update the visuals */
384 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS);
387 p_ptr->redraw |= (PR_MAP);
390 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
401 * Set "p_ptr->confused", notice observable changes
403 bool set_confused(int v)
407 /* Hack -- Force good values */
408 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
410 if (p_ptr->is_dead) return FALSE;
415 if (!p_ptr->confused)
418 msg_print("¤¢¤Ê¤¿¤Ïº®Í𤷤¿¡ª");
420 msg_print("You are confused!");
423 if (p_ptr->action == ACTION_LEARN)
426 msg_print("³Ø½¬¤¬Â³¤±¤é¤ì¤Ê¤¤¡ª");
428 msg_print("You cannot continue Learning!");
432 p_ptr->redraw |= (PR_STATE);
433 p_ptr->action = ACTION_NONE;
435 if (p_ptr->action == ACTION_KAMAE)
438 msg_print("¹½¤¨¤¬¤È¤±¤¿¡£");
440 msg_print("Your posture gets loose.");
442 p_ptr->special_defense &= ~(KAMAE_MASK);
443 p_ptr->update |= (PU_BONUS);
444 p_ptr->redraw |= (PR_STATE);
445 p_ptr->action = ACTION_NONE;
447 else if (p_ptr->action == ACTION_KATA)
450 msg_print("·¿¤¬Êø¤ì¤¿¡£");
452 msg_print("Your posture gets loose.");
454 p_ptr->special_defense &= ~(KATA_MASK);
455 p_ptr->update |= (PU_BONUS);
456 p_ptr->update |= (PU_MONSTERS);
457 p_ptr->redraw |= (PR_STATE);
458 p_ptr->redraw |= (PR_STATUS);
459 p_ptr->action = ACTION_NONE;
463 p_ptr->counter = FALSE;
464 chg_virtue(V_HARMONY, -1);
474 msg_print("¤ä¤Ã¤Èº®Í𤬤ª¤µ¤Þ¤Ã¤¿¡£");
476 msg_print("You feel less confused now.");
479 p_ptr->special_attack &= ~(ATTACK_SUIKEN);
487 /* Redraw status bar */
488 p_ptr->redraw |= (PR_STATUS);
490 /* Nothing to notice */
491 if (!notice) return (FALSE);
494 if (disturb_state) disturb(0, 0);
505 * Set "p_ptr->poisoned", notice observable changes
507 bool set_poisoned(int v)
511 /* Hack -- Force good values */
512 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
514 if (p_ptr->is_dead) return FALSE;
519 if (!p_ptr->poisoned)
522 msg_print("ÆǤ˿¯¤µ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
524 msg_print("You are poisoned!");
537 msg_print("¤ä¤Ã¤ÈÆǤÎÄˤߤ¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
539 msg_print("You are no longer poisoned.");
549 /* Redraw status bar */
550 p_ptr->redraw |= (PR_STATUS);
552 /* Nothing to notice */
553 if (!notice) return (FALSE);
556 if (disturb_state) disturb(0, 0);
567 * Set "p_ptr->afraid", notice observable changes
569 bool set_afraid(int v)
573 /* Hack -- Force good values */
574 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
576 if (p_ptr->is_dead) return FALSE;
584 msg_print("²¿¤â¤«¤â¶²¤¯¤Ê¤Ã¤Æ¤¤¿¡ª");
586 msg_print("You are terrified!");
589 if (p_ptr->special_defense & KATA_MASK)
592 msg_print("·¿¤¬Êø¤ì¤¿¡£");
594 msg_print("Your posture gets loose.");
596 p_ptr->special_defense &= ~(KATA_MASK);
597 p_ptr->update |= (PU_BONUS);
598 p_ptr->update |= (PU_MONSTERS);
599 p_ptr->redraw |= (PR_STATE);
600 p_ptr->redraw |= (PR_STATUS);
601 p_ptr->action = ACTION_NONE;
605 p_ptr->counter = FALSE;
606 chg_virtue(V_VALOUR, -1);
616 msg_print("¤ä¤Ã¤È¶²Éݤò¿¶¤êʧ¤Ã¤¿¡£");
618 msg_print("You feel bolder now.");
628 /* Redraw status bar */
629 p_ptr->redraw |= (PR_STATUS);
631 /* Nothing to notice */
632 if (!notice) return (FALSE);
635 if (disturb_state) disturb(0, 0);
646 * Set "p_ptr->paralyzed", notice observable changes
648 bool set_paralyzed(int v)
652 /* Hack -- Force good values */
653 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
655 if (p_ptr->is_dead) return FALSE;
660 if (!p_ptr->paralyzed)
663 msg_print("ÂΤ¬Ëãá㤷¤Æ¤·¤Þ¤Ã¤¿¡ª");
665 msg_print("You are paralyzed!");
668 p_ptr->counter = FALSE;
676 if (p_ptr->paralyzed)
679 msg_print("¤ä¤Ã¤ÈÆ°¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
681 msg_print("You can move again.");
689 p_ptr->paralyzed = v;
691 /* Redraw status bar */
692 p_ptr->redraw |= (PR_STATUS);
694 /* Nothing to notice */
695 if (!notice) return (FALSE);
698 if (disturb_state) disturb(0, 0);
700 /* Redraw the state */
701 p_ptr->redraw |= (PR_STATE);
712 * Set "p_ptr->image", notice observable changes
714 * Note that we must redraw the map when hallucination changes.
716 bool set_image(int v)
720 /* Hack -- Force good values */
721 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
723 if (p_ptr->is_dead) return FALSE;
729 set_tsuyoshi(0, TRUE);
733 msg_print("¥ï¡¼¥ª¡ª²¿¤â¤«¤âÆú¿§¤Ë¸«¤¨¤ë¡ª");
735 msg_print("Oh, wow! Everything looks so cosmic now!");
738 p_ptr->counter = FALSE;
749 msg_print("¤ä¤Ã¤È¤Ï¤Ã¤¤ê¤Èʪ¤¬¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
751 msg_print("You can see clearly again.");
761 /* Redraw status bar */
762 p_ptr->redraw |= (PR_STATUS);
764 /* Nothing to notice */
765 if (!notice) return (FALSE);
768 if (disturb_state) disturb(0, 0);
771 p_ptr->redraw |= (PR_MAP);
773 /* Update monsters */
774 p_ptr->update |= (PU_MONSTERS);
777 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
788 * Set "p_ptr->fast", notice observable changes
790 bool set_fast(int v, bool do_dec)
794 /* Hack -- Force good values */
795 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
797 if (p_ptr->is_dead) return FALSE;
802 if (p_ptr->fast && !do_dec)
804 if (p_ptr->fast > v) return FALSE;
806 else if (!p_ptr->fast && !p_ptr->lightspeed)
809 msg_print("ÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
811 msg_print("You feel yourself moving much faster!");
815 chg_virtue(V_PATIENCE, -1);
816 chg_virtue(V_DILIGENCE, 1);
823 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))))
826 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
828 msg_print("You feel yourself slow down.");
838 /* Nothing to notice */
839 if (!notice) return (FALSE);
842 if (disturb_state) disturb(0, 0);
844 /* Recalculate bonuses */
845 p_ptr->update |= (PU_BONUS);
856 * Set "p_ptr->lightspeed", notice observable changes
858 bool set_lightspeed(int v, bool do_dec)
862 /* Hack -- Force good values */
863 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
865 if (p_ptr->is_dead) return FALSE;
870 if (p_ptr->lightspeed && !do_dec)
872 if (p_ptr->lightspeed > v) return FALSE;
874 else if (!p_ptr->lightspeed)
877 msg_print("Èó¾ï¤ËÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
879 msg_print("You feel yourself moving extremely faster!");
883 chg_virtue(V_PATIENCE, -1);
884 chg_virtue(V_DILIGENCE, 1);
891 if (p_ptr->lightspeed)
894 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
896 msg_print("You feel yourself slow down.");
904 p_ptr->lightspeed = v;
906 /* Nothing to notice */
907 if (!notice) return (FALSE);
910 if (disturb_state) disturb(0, 0);
912 /* Recalculate bonuses */
913 p_ptr->update |= (PU_BONUS);
924 * Set "p_ptr->slow", notice observable changes
926 bool set_slow(int v, bool do_dec)
930 /* Hack -- Force good values */
931 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
933 if (p_ptr->is_dead) return FALSE;
938 if (p_ptr->slow && !do_dec)
940 if (p_ptr->slow > v) return FALSE;
942 else if (!p_ptr->slow)
945 msg_print("ÂΤÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
947 msg_print("You feel yourself moving slower!");
960 msg_print("Æ°¤¤ÎÃÙ¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
962 msg_print("You feel yourself speed up.");
972 /* Nothing to notice */
973 if (!notice) return (FALSE);
976 if (disturb_state) disturb(0, 0);
978 /* Recalculate bonuses */
979 p_ptr->update |= (PU_BONUS);
990 * Set "p_ptr->shield", notice observable changes
992 bool set_shield(int v, bool do_dec)
996 /* Hack -- Force good values */
997 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
999 if (p_ptr->is_dead) return FALSE;
1004 if (p_ptr->shield && !do_dec)
1006 if (p_ptr->shield > v) return FALSE;
1008 else if (!p_ptr->shield)
1011 msg_print("È©¤¬ÀФˤʤä¿¡£");
1013 msg_print("Your skin turns to stone.");
1026 msg_print("È©¤¬¸µ¤ËÌá¤Ã¤¿¡£");
1028 msg_print("Your skin returns to normal.");
1038 /* Redraw status bar */
1039 p_ptr->redraw |= (PR_STATUS);
1041 /* Nothing to notice */
1042 if (!notice) return (FALSE);
1045 if (disturb_state) disturb(0, 0);
1047 /* Recalculate bonuses */
1048 p_ptr->update |= (PU_BONUS);
1060 * Set "p_ptr->tsubureru", notice observable changes
1062 bool set_tsubureru(int v, bool do_dec)
1064 bool notice = FALSE;
1066 /* Hack -- Force good values */
1067 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1069 if (p_ptr->is_dead) return FALSE;
1074 if (p_ptr->tsubureru && !do_dec)
1076 if (p_ptr->tsubureru > v) return FALSE;
1078 else if (!p_ptr->tsubureru)
1081 msg_print("²£¤Ë¿¤Ó¤¿¡£");
1083 msg_print("Your body expands horizontally.");
1093 if (p_ptr->tsubureru)
1096 msg_print("¤â¤¦²£¤Ë¿¤Ó¤Æ¤¤¤Ê¤¤¡£");
1098 msg_print("Your body returns to normal.");
1106 p_ptr->tsubureru = v;
1108 /* Redraw status bar */
1109 p_ptr->redraw |= (PR_STATUS);
1111 /* Nothing to notice */
1112 if (!notice) return (FALSE);
1115 if (disturb_state) disturb(0, 0);
1117 /* Recalculate bonuses */
1118 p_ptr->update |= (PU_BONUS);
1130 * Set "p_ptr->magicdef", notice observable changes
1132 bool set_magicdef(int v, bool do_dec)
1134 bool notice = FALSE;
1136 /* Hack -- Force good values */
1137 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1139 if (p_ptr->is_dead) return FALSE;
1144 if (p_ptr->magicdef && !do_dec)
1146 if (p_ptr->magicdef > v) return FALSE;
1148 else if (!p_ptr->magicdef)
1151 msg_print("ËâË¡¤ÎËɸæÎϤ¬Áý¤·¤¿¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1153 msg_print("You feel more resistant to magic.");
1163 if (p_ptr->magicdef)
1166 msg_print("ËâË¡¤ÎËɸæÎϤ¬¸µ¤ËÌá¤Ã¤¿¡£");
1168 msg_print("You feel less resistant to magic.");
1176 p_ptr->magicdef = v;
1178 /* Redraw status bar */
1179 p_ptr->redraw |= (PR_STATUS);
1181 /* Nothing to notice */
1182 if (!notice) return (FALSE);
1185 if (disturb_state) disturb(0, 0);
1187 /* Recalculate bonuses */
1188 p_ptr->update |= (PU_BONUS);
1200 * Set "p_ptr->blessed", notice observable changes
1202 bool set_blessed(int v, bool do_dec)
1204 bool notice = FALSE;
1206 /* Hack -- Force good values */
1207 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1209 if (p_ptr->is_dead) return FALSE;
1214 if (p_ptr->blessed && !do_dec)
1216 if (p_ptr->blessed > v) return FALSE;
1218 else if (!p_ptr->blessed)
1221 msg_print("¹â·é¤Êµ¤Ê¬¤Ë¤Ê¤Ã¤¿¡ª");
1223 msg_print("You feel righteous!");
1233 if (p_ptr->blessed && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_BLESS)))
1236 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1238 msg_print("The prayer has expired.");
1248 /* Redraw status bar */
1249 p_ptr->redraw |= (PR_STATUS);
1251 /* Nothing to notice */
1252 if (!notice) return (FALSE);
1255 if (disturb_state) disturb(0, 0);
1257 /* Recalculate bonuses */
1258 p_ptr->update |= (PU_BONUS);
1269 * Set "p_ptr->hero", notice observable changes
1271 bool set_hero(int v, bool do_dec)
1273 bool notice = FALSE;
1275 /* Hack -- Force good values */
1276 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1278 if (p_ptr->is_dead) return FALSE;
1283 if (p_ptr->hero && !do_dec)
1285 if (p_ptr->hero > v) return FALSE;
1287 else if (!p_ptr->hero)
1290 msg_print("¥Ò¡¼¥í¡¼¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1292 msg_print("You feel like a hero!");
1302 if (p_ptr->hero && ((p_ptr->pclass != CLASS_BARD) || ((p_ptr->magic_num1[0] != MUSIC_HERO) && (p_ptr->magic_num1[0] != MUSIC_SHERO))))
1305 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1307 msg_print("The heroism wears off.");
1317 /* Redraw status bar */
1318 p_ptr->redraw |= (PR_STATUS);
1320 /* Nothing to notice */
1321 if (!notice) return (FALSE);
1324 if (disturb_state) disturb(0, 0);
1326 /* Recalculate bonuses */
1327 p_ptr->update |= (PU_BONUS);
1329 /* Recalculate hitpoints */
1330 p_ptr->update |= (PU_HP);
1341 * Set "p_ptr->shero", notice observable changes
1343 bool set_shero(int v, bool do_dec)
1345 bool notice = FALSE;
1347 /* Hack -- Force good values */
1348 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1350 if (p_ptr->is_dead) return FALSE;
1352 if (p_ptr->pclass == CLASS_BERSERKER) v = 1;
1356 if (p_ptr->shero && !do_dec)
1358 if (p_ptr->shero > v) return FALSE;
1360 else if (!p_ptr->shero)
1363 msg_print("»¦Ù¤¥Þ¥·¡¼¥ó¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1365 msg_print("You feel like a killing machine!");
1378 msg_print("ÌîÈڤʵ¤»ý¤Á¤¬¾Ã¤¨¼º¤»¤¿¡£");
1380 msg_print("You feel less Berserk.");
1390 /* Redraw status bar */
1391 p_ptr->redraw |= (PR_STATUS);
1393 /* Nothing to notice */
1394 if (!notice) return (FALSE);
1397 if (disturb_state) disturb(0, 0);
1399 /* Recalculate bonuses */
1400 p_ptr->update |= (PU_BONUS);
1402 /* Recalculate hitpoints */
1403 p_ptr->update |= (PU_HP);
1414 * Set "p_ptr->protevil", notice observable changes
1416 bool set_protevil(int v, bool do_dec)
1418 bool notice = FALSE;
1420 /* Hack -- Force good values */
1421 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1423 if (p_ptr->is_dead) return FALSE;
1428 if (p_ptr->protevil && !do_dec)
1430 if (p_ptr->protevil > v) return FALSE;
1432 else if (!p_ptr->protevil)
1435 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Ê´¶¤¸¤¬¤¹¤ë¡ª");
1437 msg_print("You feel safe from evil!");
1447 if (p_ptr->protevil)
1450 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1452 msg_print("You no longer feel safe from evil.");
1460 p_ptr->protevil = v;
1462 /* Redraw status bar */
1463 p_ptr->redraw |= (PR_STATUS);
1465 /* Nothing to notice */
1466 if (!notice) return (FALSE);
1469 if (disturb_state) disturb(0, 0);
1479 * Set "p_ptr->wraith_form", notice observable changes
1481 bool set_wraith_form(int v, bool do_dec)
1483 bool notice = FALSE;
1485 /* Hack -- Force good values */
1486 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1488 if (p_ptr->is_dead) return FALSE;
1493 if (p_ptr->wraith_form && !do_dec)
1495 if (p_ptr->wraith_form > v) return FALSE;
1497 else if (!p_ptr->wraith_form)
1500 msg_print("ʪ¼Á³¦¤òÎ¥¤ì¤ÆÍ©µ´¤Î¤è¤¦¤Ê¸ºß¤Ë¤Ê¤Ã¤¿¡ª");
1502 msg_print("You leave the physical world and turn into a wraith-being!");
1507 chg_virtue(V_UNLIFE, 3);
1508 chg_virtue(V_HONOUR, -2);
1509 chg_virtue(V_SACRIFICE, -2);
1510 chg_virtue(V_VALOUR, -5);
1513 p_ptr->redraw |= (PR_MAP);
1515 /* Update monsters */
1516 p_ptr->update |= (PU_MONSTERS);
1519 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1526 if (p_ptr->wraith_form)
1529 msg_print("ÉÔÆ©ÌÀ¤Ë¤Ê¤Ã¤¿´¶¤¸¤¬¤¹¤ë¡£");
1531 msg_print("You feel opaque.");
1537 p_ptr->redraw |= (PR_MAP);
1539 /* Update monsters */
1540 p_ptr->update |= (PU_MONSTERS);
1543 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1548 p_ptr->wraith_form = v;
1550 /* Redraw status bar */
1551 p_ptr->redraw |= (PR_STATUS);
1553 /* Nothing to notice */
1554 if (!notice) return (FALSE);
1557 if (disturb_state) disturb(0, 0);
1559 /* Recalculate bonuses */
1560 p_ptr->update |= (PU_BONUS);
1575 * Set "p_ptr->invuln", notice observable changes
1577 bool set_invuln(int v, bool do_dec)
1579 bool notice = FALSE;
1581 /* Hack -- Force good values */
1582 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1584 if (p_ptr->is_dead) return FALSE;
1589 if (p_ptr->invuln && !do_dec)
1591 if (p_ptr->invuln > v) return FALSE;
1593 else if (!p_ptr->invuln)
1596 msg_print("̵Ũ¤À¡ª");
1598 msg_print("Invulnerability!");
1603 chg_virtue(V_UNLIFE, -2);
1604 chg_virtue(V_HONOUR, -2);
1605 chg_virtue(V_SACRIFICE, -3);
1606 chg_virtue(V_VALOUR, -5);
1609 p_ptr->redraw |= (PR_MAP);
1611 /* Update monsters */
1612 p_ptr->update |= (PU_MONSTERS);
1615 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1622 if (p_ptr->invuln && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_INVULN)))
1625 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
1627 msg_print("The invulnerability wears off.");
1633 p_ptr->redraw |= (PR_MAP);
1635 /* Update monsters */
1636 p_ptr->update |= (PU_MONSTERS);
1639 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1641 p_ptr->energy_need += ENERGY_NEED();
1648 /* Redraw status bar */
1649 p_ptr->redraw |= (PR_STATUS);
1651 /* Nothing to notice */
1652 if (!notice) return (FALSE);
1655 if (disturb_state) disturb(0, 0);
1657 /* Recalculate bonuses */
1658 p_ptr->update |= (PU_BONUS);
1669 * Set "p_ptr->tim_esp", notice observable changes
1671 bool set_tim_esp(int v, bool do_dec)
1673 bool notice = FALSE;
1675 /* Hack -- Force good values */
1676 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1678 if (p_ptr->is_dead) return FALSE;
1683 if (p_ptr->tim_esp && !do_dec)
1685 if (p_ptr->tim_esp > v) return FALSE;
1687 else if (!p_ptr->tim_esp)
1690 msg_print("°Õ¼±¤¬¹¤¬¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1692 msg_print("You feel your consciousness expand!");
1702 if (p_ptr->tim_esp && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_MIND)))
1705 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
1707 msg_print("Your consciousness contracts again.");
1717 /* Redraw status bar */
1718 p_ptr->redraw |= (PR_STATUS);
1720 /* Nothing to notice */
1721 if (!notice) return (FALSE);
1724 if (disturb_state) disturb(0, 0);
1726 /* Recalculate bonuses */
1727 p_ptr->update |= (PU_BONUS);
1729 /* Update the monsters */
1730 p_ptr->update |= (PU_MONSTERS);
1741 * Set "p_ptr->tim_invis", notice observable changes
1743 bool set_tim_invis(int v, bool do_dec)
1745 bool notice = FALSE;
1747 /* Hack -- Force good values */
1748 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1750 if (p_ptr->is_dead) return FALSE;
1755 if (p_ptr->tim_invis && !do_dec)
1757 if (p_ptr->tim_invis > v) return FALSE;
1759 else if (!p_ptr->tim_invis)
1762 msg_print("Ìܤ¬Èó¾ï¤ËÉÒ´¶¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1764 msg_print("Your eyes feel very sensitive!");
1774 if (p_ptr->tim_invis)
1777 msg_print("ÌܤÎÉÒ´¶¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1779 msg_print("Your eyes feel less sensitive.");
1787 p_ptr->tim_invis = v;
1789 /* Redraw status bar */
1790 p_ptr->redraw |= (PR_STATUS);
1792 /* Nothing to notice */
1793 if (!notice) return (FALSE);
1796 if (disturb_state) disturb(0, 0);
1798 /* Recalculate bonuses */
1799 p_ptr->update |= (PU_BONUS);
1801 /* Update the monsters */
1802 p_ptr->update |= (PU_MONSTERS);
1813 * Set "p_ptr->tim_infra", notice observable changes
1815 bool set_tim_infra(int v, bool do_dec)
1817 bool notice = FALSE;
1819 /* Hack -- Force good values */
1820 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1822 if (p_ptr->is_dead) return FALSE;
1827 if (p_ptr->tim_infra && !do_dec)
1829 if (p_ptr->tim_infra > v) return FALSE;
1831 else if (!p_ptr->tim_infra)
1834 msg_print("Ìܤ¬¥é¥ó¥é¥ó¤Èµ±¤»Ï¤á¤¿¡ª");
1836 msg_print("Your eyes begin to tingle!");
1846 if (p_ptr->tim_infra)
1849 msg_print("Ìܤ層¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1851 msg_print("Your eyes stop tingling.");
1859 p_ptr->tim_infra = v;
1861 /* Redraw status bar */
1862 p_ptr->redraw |= (PR_STATUS);
1864 /* Nothing to notice */
1865 if (!notice) return (FALSE);
1868 if (disturb_state) disturb(0, 0);
1870 /* Recalculate bonuses */
1871 p_ptr->update |= (PU_BONUS);
1873 /* Update the monsters */
1874 p_ptr->update |= (PU_MONSTERS);
1885 * Set "p_ptr->tim_regen", notice observable changes
1887 bool set_tim_regen(int v, bool do_dec)
1889 bool notice = FALSE;
1891 /* Hack -- Force good values */
1892 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1894 if (p_ptr->is_dead) return FALSE;
1899 if (p_ptr->tim_regen && !do_dec)
1901 if (p_ptr->tim_regen > v) return FALSE;
1903 else if (!p_ptr->tim_regen)
1906 msg_print("²óÉüÎϤ¬¾å¤¬¤Ã¤¿¡ª");
1908 msg_print("You feel yourself regenerating quickly!");
1918 if (p_ptr->tim_regen)
1921 msg_print("ÁÇÁ᤯²óÉü¤¹¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1923 msg_print("You feel yourself regenerating slowly.");
1931 p_ptr->tim_regen = v;
1933 /* Redraw status bar */
1934 p_ptr->redraw |= (PR_STATUS);
1936 /* Nothing to notice */
1937 if (!notice) return (FALSE);
1940 if (disturb_state) disturb(0, 0);
1942 /* Recalculate bonuses */
1943 p_ptr->update |= (PU_BONUS);
1954 * Set "p_ptr->tim_stealth", notice observable changes
1956 bool set_tim_stealth(int v, bool do_dec)
1958 bool notice = FALSE;
1960 /* Hack -- Force good values */
1961 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1963 if (p_ptr->is_dead) return FALSE;
1968 if (p_ptr->tim_stealth && !do_dec)
1970 if (p_ptr->tim_stealth > v) return FALSE;
1972 else if (!p_ptr->tim_stealth)
1975 msg_print("²»¤¬¾®¤µ¤¯¤Ê¤Ã¤¿¡ª");
1977 msg_print("You begin to walk silently!");
1987 if (p_ptr->tim_stealth && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_STEALTH)))
1990 msg_print("²»¤¬Â礤¯¤Ê¤Ã¤¿¡£");
1992 msg_print("You no longer walk silently.");
2000 p_ptr->tim_stealth = v;
2002 /* Redraw status bar */
2003 p_ptr->redraw |= (PR_STATUS);
2005 /* Nothing to notice */
2006 if (!notice) return (FALSE);
2009 if (disturb_state) disturb(0, 0);
2011 /* Recalculate bonuses */
2012 p_ptr->update |= (PU_BONUS);
2022 bool set_superstealth(bool set)
2024 bool notice = FALSE;
2026 if (p_ptr->is_dead) return FALSE;
2031 if (!(p_ptr->special_defense & NINJA_S_STEALTH))
2033 if (cave[py][px].info & CAVE_MNLT)
2036 msg_print("Ũ¤ÎÌܤ«¤éÇö¤¤±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡£");
2038 msg_print("You are mantled in weak shadow from ordinary eyes.");
2040 p_ptr->monlite = p_ptr->old_monlite = TRUE;
2045 msg_print("Ũ¤ÎÌܤ«¤é±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡ª");
2047 msg_print("You are mantled in shadow from ordinary eyes!");
2049 p_ptr->monlite = p_ptr->old_monlite = FALSE;
2055 p_ptr->special_defense |= NINJA_S_STEALTH;
2062 if (p_ptr->special_defense & NINJA_S_STEALTH)
2065 msg_print("ºÆ¤ÓŨ¤ÎÌܤˤµ¤é¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
2067 msg_print("You are exposed to common sight once more.");
2073 p_ptr->special_defense &= ~(NINJA_S_STEALTH);
2077 /* Nothing to notice */
2078 if (!notice) return (FALSE);
2080 /* Redraw status bar */
2081 p_ptr->redraw |= (PR_STATUS);
2084 if (disturb_state) disturb(0, 0);
2092 * Set "p_ptr->tim_ffall", notice observable changes
2094 bool set_tim_ffall(int v, bool do_dec)
2096 bool notice = FALSE;
2098 /* Hack -- Force good values */
2099 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2101 if (p_ptr->is_dead) return FALSE;
2106 if (p_ptr->tim_ffall && !do_dec)
2108 if (p_ptr->tim_ffall > v) return FALSE;
2110 else if (!p_ptr->tim_ffall)
2113 msg_print("ÂΤ¬Ãè¤ËÉ⤻Ϥ᤿¡£");
2115 msg_print("You begin to fly!");
2125 if (p_ptr->tim_ffall)
2128 msg_print("¤â¤¦Ãè¤ËÉ⤫¤Ù¤Ê¤¯¤Ê¤Ã¤¿¡£");
2130 msg_print("You stop flying.");
2138 p_ptr->tim_ffall = v;
2140 /* Redraw status bar */
2141 p_ptr->redraw |= (PR_STATUS);
2143 /* Nothing to notice */
2144 if (!notice) return (FALSE);
2147 if (disturb_state) disturb(0, 0);
2149 /* Recalculate bonuses */
2150 p_ptr->update |= (PU_BONUS);
2161 * Set "p_ptr->tim_sh_touki", notice observable changes
2163 bool set_tim_sh_touki(int v, bool do_dec)
2165 bool notice = FALSE;
2167 /* Hack -- Force good values */
2168 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2170 if (p_ptr->is_dead) return FALSE;
2175 if (p_ptr->tim_sh_touki && !do_dec)
2177 if (p_ptr->tim_sh_touki > v) return FALSE;
2179 else if (!p_ptr->tim_sh_touki)
2182 msg_print("ÂΤ¬Æ®µ¤¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2184 msg_print("You have enveloped by the aura of the Force!");
2194 if (p_ptr->tim_sh_touki)
2197 msg_print("Æ®µ¤¤¬¾Ã¤¨¤¿¡£");
2199 msg_print("Aura of the Force disappeared.");
2207 p_ptr->tim_sh_touki = v;
2209 /* Redraw status bar */
2210 p_ptr->redraw |= (PR_STATUS);
2212 /* Nothing to notice */
2213 if (!notice) return (FALSE);
2216 if (disturb_state) disturb(0, 0);
2227 * Set "p_ptr->tim_sh_fire", notice observable changes
2229 bool set_tim_sh_fire(int v, bool do_dec)
2231 bool notice = FALSE;
2233 /* Hack -- Force good values */
2234 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2236 if (p_ptr->is_dead) return FALSE;
2241 if (p_ptr->tim_sh_fire && !do_dec)
2243 if (p_ptr->tim_sh_fire > v) return FALSE;
2245 else if (!p_ptr->tim_sh_fire)
2248 msg_print("ÂΤ¬±ê¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2250 msg_print("You have enveloped by fiery aura!");
2260 if (p_ptr->tim_sh_fire)
2263 msg_print("±ê¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2265 msg_print("Fiery aura disappeared.");
2273 p_ptr->tim_sh_fire = v;
2275 /* Redraw status bar */
2276 p_ptr->redraw |= (PR_STATUS);
2278 /* Nothing to notice */
2279 if (!notice) return (FALSE);
2282 if (disturb_state) disturb(0, 0);
2284 /* Recalculate bonuses */
2285 p_ptr->update |= (PU_BONUS);
2296 * Set "p_ptr->tim_sh_holy", notice observable changes
2298 bool set_tim_sh_holy(int v, bool do_dec)
2300 bool notice = FALSE;
2302 /* Hack -- Force good values */
2303 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2305 if (p_ptr->is_dead) return FALSE;
2310 if (p_ptr->tim_sh_holy && !do_dec)
2312 if (p_ptr->tim_sh_holy > v) return FALSE;
2314 else if (!p_ptr->tim_sh_holy)
2317 msg_print("ÂΤ¬À»¤Ê¤ë¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2319 msg_print("You have enveloped by holy aura!");
2329 if (p_ptr->tim_sh_holy)
2332 msg_print("À»¤Ê¤ë¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2334 msg_print("Holy aura disappeared.");
2342 p_ptr->tim_sh_holy = v;
2344 /* Redraw status bar */
2345 p_ptr->redraw |= (PR_STATUS);
2347 /* Nothing to notice */
2348 if (!notice) return (FALSE);
2351 if (disturb_state) disturb(0, 0);
2353 /* Recalculate bonuses */
2354 p_ptr->update |= (PU_BONUS);
2366 * Set "p_ptr->tim_eyeeye", notice observable changes
2368 bool set_tim_eyeeye(int v, bool do_dec)
2370 bool notice = FALSE;
2372 /* Hack -- Force good values */
2373 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2375 if (p_ptr->is_dead) return FALSE;
2380 if (p_ptr->tim_eyeeye && !do_dec)
2382 if (p_ptr->tim_eyeeye > v) return FALSE;
2384 else if (!p_ptr->tim_eyeeye)
2387 msg_print("Ë¡¤Î¼é¤ê¼ê¤Ë¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¡ª");
2389 msg_print("You feel like a keeper of commandments!");
2399 if (p_ptr->tim_eyeeye)
2402 msg_print("Ĩȳ¤ò¼¹¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2404 msg_print("You no longer feel like a keeper.");
2412 p_ptr->tim_eyeeye = v;
2414 /* Redraw status bar */
2415 p_ptr->redraw |= (PR_STATUS);
2417 /* Nothing to notice */
2418 if (!notice) return (FALSE);
2421 if (disturb_state) disturb(0, 0);
2423 /* Recalculate bonuses */
2424 p_ptr->update |= (PU_BONUS);
2436 * Set "p_ptr->resist_magic", notice observable changes
2438 bool set_resist_magic(int v, bool do_dec)
2440 bool notice = FALSE;
2442 /* Hack -- Force good values */
2443 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2445 if (p_ptr->is_dead) return FALSE;
2450 if (p_ptr->resist_magic && !do_dec)
2452 if (p_ptr->resist_magic > v) return FALSE;
2454 else if (!p_ptr->resist_magic)
2457 msg_print("ËâË¡¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿¡£");
2459 msg_print("You have been protected from magic!");
2469 if (p_ptr->resist_magic)
2472 msg_print("ËâË¡¤Ë¼å¤¯¤Ê¤Ã¤¿¡£");
2474 msg_print("You are no longer protected from magic.");
2482 p_ptr->resist_magic = v;
2484 /* Redraw status bar */
2485 p_ptr->redraw |= (PR_STATUS);
2487 /* Nothing to notice */
2488 if (!notice) return (FALSE);
2491 if (disturb_state) disturb(0, 0);
2493 /* Recalculate bonuses */
2494 p_ptr->update |= (PU_BONUS);
2505 * Set "p_ptr->tim_reflect", notice observable changes
2507 bool set_tim_reflect(int v, bool do_dec)
2509 bool notice = FALSE;
2511 /* Hack -- Force good values */
2512 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2514 if (p_ptr->is_dead) return FALSE;
2519 if (p_ptr->tim_reflect && !do_dec)
2521 if (p_ptr->tim_reflect > v) return FALSE;
2523 else if (!p_ptr->tim_reflect)
2526 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2528 msg_print("Your body becames smooth.");
2538 if (p_ptr->tim_reflect)
2541 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ç¤Ê¤¯¤Ê¤Ã¤¿¡£");
2543 msg_print("Your body is no longer smooth.");
2551 p_ptr->tim_reflect = v;
2553 /* Redraw status bar */
2554 p_ptr->redraw |= (PR_STATUS);
2556 /* Nothing to notice */
2557 if (!notice) return (FALSE);
2560 if (disturb_state) disturb(0, 0);
2562 /* Recalculate bonuses */
2563 p_ptr->update |= (PU_BONUS);
2574 * Set "p_ptr->multishadow", notice observable changes
2576 bool set_multishadow(int v, bool do_dec)
2578 bool notice = FALSE;
2580 /* Hack -- Force good values */
2581 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2583 if (p_ptr->is_dead) return FALSE;
2588 if (p_ptr->multishadow && !do_dec)
2590 if (p_ptr->multishadow > v) return FALSE;
2592 else if (!p_ptr->multishadow)
2595 msg_print("¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¸¸±Æ¤¬À¸¤Þ¤ì¤¿¡£");
2597 msg_print("Your Shadow enveloped you.");
2607 if (p_ptr->multishadow)
2610 msg_print("¸¸±Æ¤¬¾Ã¤¨¤¿¡£");
2612 msg_print("Your Shadow disappears.");
2620 p_ptr->multishadow = v;
2622 /* Redraw status bar */
2623 p_ptr->redraw |= (PR_STATUS);
2625 /* Nothing to notice */
2626 if (!notice) return (FALSE);
2629 if (disturb_state) disturb(0, 0);
2631 /* Recalculate bonuses */
2632 p_ptr->update |= (PU_BONUS);
2643 * Set "p_ptr->dustrobe", notice observable changes
2645 bool set_dustrobe(int v, bool do_dec)
2647 bool notice = FALSE;
2649 /* Hack -- Force good values */
2650 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2652 if (p_ptr->is_dead) return FALSE;
2657 if (p_ptr->dustrobe && !do_dec)
2659 if (p_ptr->dustrobe > v) return FALSE;
2661 else if (!p_ptr->dustrobe)
2664 msg_print("ÂΤ¬¶À¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2666 msg_print("You were enveloped by mirror shards.");
2676 if (p_ptr->dustrobe)
2679 msg_print("¶À¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2681 msg_print("The mirror shards disappear.");
2689 p_ptr->dustrobe = v;
2691 /* Redraw status bar */
2692 p_ptr->redraw |= (PR_STATUS);
2694 /* Nothing to notice */
2695 if (!notice) return (FALSE);
2698 if (disturb_state) disturb(0, 0);
2700 /* Recalculate bonuses */
2701 p_ptr->update |= (PU_BONUS);
2712 * Set "p_ptr->tim_regen", notice observable changes
2714 bool set_kabenuke(int v, bool do_dec)
2716 bool notice = FALSE;
2718 /* Hack -- Force good values */
2719 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2721 if (p_ptr->is_dead) return FALSE;
2726 if (p_ptr->kabenuke && !do_dec)
2728 if (p_ptr->kabenuke > v) return FALSE;
2730 else if (!p_ptr->kabenuke)
2733 msg_print("ÂΤ¬È¾Êª¼Á¤Î¾õÂ֤ˤʤä¿¡£");
2735 msg_print("You became ethereal form.");
2745 if (p_ptr->kabenuke)
2748 msg_print("ÂΤ¬Êª¼Á²½¤·¤¿¡£");
2750 msg_print("You are no longer in an ethereal form.");
2758 p_ptr->kabenuke = v;
2760 /* Redraw status bar */
2761 p_ptr->redraw |= (PR_STATUS);
2763 /* Nothing to notice */
2764 if (!notice) return (FALSE);
2767 if (disturb_state) disturb(0, 0);
2777 bool set_tsuyoshi(int v, bool do_dec)
2779 bool notice = FALSE;
2781 /* Hack -- Force good values */
2782 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2784 if (p_ptr->is_dead) return FALSE;
2789 if (p_ptr->tsuyoshi && !do_dec)
2791 if (p_ptr->tsuyoshi > v) return FALSE;
2793 else if (!p_ptr->tsuyoshi)
2796 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
2798 msg_print("Brother OKURE!");
2802 chg_virtue(V_VITALITY, 2);
2809 if (p_ptr->tsuyoshi)
2812 msg_print("ÆùÂΤ¬µÞ®¤Ë¤·¤Ü¤ó¤Ç¤¤¤Ã¤¿¡£");
2814 msg_print("Your body had quickly shriveled.");
2817 (void)dec_stat(A_CON, 20, TRUE);
2818 (void)dec_stat(A_STR, 20, TRUE);
2821 chg_virtue(V_VITALITY, -3);
2826 p_ptr->tsuyoshi = v;
2828 /* Redraw status bar */
2829 p_ptr->redraw |= (PR_STATUS);
2831 /* Nothing to notice */
2832 if (!notice) return (FALSE);
2835 if (disturb_state) disturb(0, 0);
2837 /* Recalculate bonuses */
2838 p_ptr->update |= (PU_BONUS);
2840 /* Recalculate hitpoints */
2841 p_ptr->update |= (PU_HP);
2852 * Set a temporary elemental brand. Clear all other brands. Print status
2855 bool set_ele_attack(u32b attack_type, int v)
2857 /* Hack -- Force good values */
2858 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2860 /* Clear all elemental attacks (only one is allowed at a time). */
2861 if ((p_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
2863 p_ptr->special_attack &= ~(ATTACK_ACID);
2865 msg_print("»À¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2867 msg_print("Your temporary acidic brand fades away.");
2870 if ((p_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
2872 p_ptr->special_attack &= ~(ATTACK_ELEC);
2874 msg_print("ÅÅ·â¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2876 msg_print("Your temporary electrical brand fades away.");
2879 if ((p_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
2881 p_ptr->special_attack &= ~(ATTACK_FIRE);
2883 msg_print("²Ð±ê¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2885 msg_print("Your temporary fiery brand fades away.");
2888 if ((p_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
2890 p_ptr->special_attack &= ~(ATTACK_COLD);
2892 msg_print("Î䵤¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2894 msg_print("Your temporary frost brand fades away.");
2897 if ((p_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
2899 p_ptr->special_attack &= ~(ATTACK_POIS);
2901 msg_print("ÆǤǹ¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2903 msg_print("Your temporary poison brand fades away.");
2907 if ((v) && (attack_type))
2909 /* Set attack type. */
2910 p_ptr->special_attack |= (attack_type);
2913 p_ptr->ele_attack = v;
2917 msg_format("%s¤Ç¹¶·â¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª",
2918 ((attack_type == ATTACK_ACID) ? "»À" :
2919 ((attack_type == ATTACK_ELEC) ? "ÅÅ·â" :
2920 ((attack_type == ATTACK_FIRE) ? "²Ð±ê" :
2921 ((attack_type == ATTACK_COLD) ? "Î䵤" :
2922 ((attack_type == ATTACK_POIS) ? "ÆÇ" :
2925 msg_format("For a while, the blows you deal will %s",
2926 ((attack_type == ATTACK_ACID) ? "melt with acid!" :
2927 ((attack_type == ATTACK_ELEC) ? "shock your foes!" :
2928 ((attack_type == ATTACK_FIRE) ? "burn with fire!" :
2929 ((attack_type == ATTACK_COLD) ? "chill to the bone!" :
2930 ((attack_type == ATTACK_POIS) ? "poison your enemies!" :
2931 "do nothing special."))))));
2936 if (disturb_state) disturb(0, 0);
2938 /* Redraw status bar */
2939 p_ptr->redraw |= (PR_STATUS);
2941 p_ptr->update |= (PU_BONUS);
2951 * Set a temporary elemental brand. Clear all other brands. Print status
2954 bool set_ele_immune(u32b immune_type, int v)
2956 /* Hack -- Force good values */
2957 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2959 /* Clear all elemental attacks (only one is allowed at a time). */
2960 if ((p_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
2962 p_ptr->special_defense &= ~(DEFENSE_ACID);
2964 msg_print("»À¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2966 msg_print("You are no longer immune to acid.");
2969 if ((p_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
2971 p_ptr->special_defense &= ~(DEFENSE_ELEC);
2973 msg_print("ÅÅ·â¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2975 msg_print("You are no longer immune to electricity.");
2978 if ((p_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
2980 p_ptr->special_defense &= ~(DEFENSE_FIRE);
2982 msg_print("²Ð±ê¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2984 msg_print("You are no longer immune to fire.");
2987 if ((p_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
2989 p_ptr->special_defense &= ~(DEFENSE_COLD);
2991 msg_print("Î䵤¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
2993 msg_print("You are no longer immune to cold.");
2996 if ((p_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
2998 p_ptr->special_defense &= ~(DEFENSE_POIS);
3000 msg_print("ÆǤι¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3002 msg_print("You are no longer immune to poison.");
3006 if ((v) && (immune_type))
3008 /* Set attack type. */
3009 p_ptr->special_defense |= (immune_type);
3012 p_ptr->ele_immune = v;
3016 msg_format("%s¤Î¹¶·â¤ò¼õ¤±¤Ä¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª",
3017 ((immune_type == DEFENSE_ACID) ? "»À" :
3018 ((immune_type == DEFENSE_ELEC) ? "ÅÅ·â" :
3019 ((immune_type == DEFENSE_FIRE) ? "²Ð±ê" :
3020 ((immune_type == DEFENSE_COLD) ? "Î䵤" :
3021 ((immune_type == DEFENSE_POIS) ? "ÆÇ" :
3024 msg_format("For a while, You are immune to %s",
3025 ((immune_type == DEFENSE_ACID) ? "acid!" :
3026 ((immune_type == DEFENSE_ELEC) ? "electricity!" :
3027 ((immune_type == DEFENSE_FIRE) ? "fire!" :
3028 ((immune_type == DEFENSE_COLD) ? "cold!" :
3029 ((immune_type == DEFENSE_POIS) ? "poison!" :
3030 "do nothing special."))))));
3035 if (disturb_state) disturb(0, 0);
3037 /* Redraw status bar */
3038 p_ptr->redraw |= (PR_STATUS);
3040 p_ptr->update |= (PU_BONUS);
3050 * Set "p_ptr->oppose_acid", notice observable changes
3052 bool set_oppose_acid(int v, bool do_dec)
3054 bool notice = FALSE;
3056 /* Hack -- Force good values */
3057 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3059 if (p_ptr->is_dead) return FALSE;
3064 if (p_ptr->oppose_acid && !do_dec)
3066 if (p_ptr->oppose_acid > v) return FALSE;
3068 else if (!p_ptr->oppose_acid)
3071 msg_print("»À¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3073 msg_print("You feel resistant to acid!");
3083 if (p_ptr->oppose_acid && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3086 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3088 msg_print("You feel less resistant to acid.");
3096 p_ptr->oppose_acid = v;
3098 /* Nothing to notice */
3099 if (!notice) return (FALSE);
3101 /* Redraw status bar */
3102 p_ptr->redraw |= (PR_STATUS);
3105 if (disturb_state) disturb(0, 0);
3116 * Set "p_ptr->oppose_elec", notice observable changes
3118 bool set_oppose_elec(int v, bool do_dec)
3120 bool notice = FALSE;
3122 /* Hack -- Force good values */
3123 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3125 if (p_ptr->is_dead) return FALSE;
3130 if (p_ptr->oppose_elec && !do_dec)
3132 if (p_ptr->oppose_elec > v) return FALSE;
3134 else if (!p_ptr->oppose_elec)
3137 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3139 msg_print("You feel resistant to electricity!");
3149 if (p_ptr->oppose_elec && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3152 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3154 msg_print("You feel less resistant to electricity.");
3162 p_ptr->oppose_elec = v;
3164 /* Nothing to notice */
3165 if (!notice) return (FALSE);
3167 /* Redraw status bar */
3168 p_ptr->redraw |= (PR_STATUS);
3171 if (disturb_state) disturb(0, 0);
3182 * Set "p_ptr->oppose_fire", notice observable changes
3184 bool set_oppose_fire(int v, bool do_dec)
3186 bool notice = FALSE;
3188 /* Hack -- Force good values */
3189 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3191 if (p_ptr->is_dead) return FALSE;
3193 if ((prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
3197 if (p_ptr->oppose_fire && !do_dec)
3199 if (p_ptr->oppose_fire > v) return FALSE;
3201 else if (!p_ptr->oppose_fire)
3204 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3206 msg_print("You feel resistant to fire!");
3216 if (p_ptr->oppose_fire && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3219 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3221 msg_print("You feel less resistant to fire.");
3229 p_ptr->oppose_fire = v;
3231 /* Nothing to notice */
3232 if (!notice) return (FALSE);
3234 /* Redraw status bar */
3235 p_ptr->redraw |= (PR_STATUS);
3238 if (disturb_state) disturb(0, 0);
3249 * Set "p_ptr->oppose_cold", notice observable changes
3251 bool set_oppose_cold(int v, bool do_dec)
3253 bool notice = FALSE;
3255 /* Hack -- Force good values */
3256 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3258 if (p_ptr->is_dead) return FALSE;
3263 if (p_ptr->oppose_cold && !do_dec)
3265 if (p_ptr->oppose_cold > v) return FALSE;
3267 else if (!p_ptr->oppose_cold)
3270 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3272 msg_print("You feel resistant to cold!");
3282 if (p_ptr->oppose_cold && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3285 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3287 msg_print("You feel less resistant to cold.");
3295 p_ptr->oppose_cold = v;
3297 /* Nothing to notice */
3298 if (!notice) return (FALSE);
3300 /* Redraw status bar */
3301 p_ptr->redraw |= (PR_STATUS);
3304 if (disturb_state) disturb(0, 0);
3315 * Set "p_ptr->oppose_pois", notice observable changes
3317 bool set_oppose_pois(int v, bool do_dec)
3319 bool notice = FALSE;
3321 /* Hack -- Force good values */
3322 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3324 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) v = 1;
3325 if (p_ptr->is_dead) return FALSE;
3330 if (p_ptr->oppose_pois && !do_dec)
3332 if (p_ptr->oppose_pois > v) return FALSE;
3334 else if (!p_ptr->oppose_pois)
3337 msg_print("ÆǤؤÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3339 msg_print("You feel resistant to poison!");
3349 if (p_ptr->oppose_pois && ((p_ptr->pclass != CLASS_BARD) || (p_ptr->magic_num1[0] != MUSIC_RESIST)) && !(p_ptr->special_defense & KATA_MUSOU))
3352 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3354 msg_print("You feel less resistant to poison.");
3362 p_ptr->oppose_pois = v;
3364 /* Nothing to notice */
3365 if (!notice) return (FALSE);
3367 /* Redraw status bar */
3368 p_ptr->redraw |= (PR_STATUS);
3371 if (disturb_state) disturb(0, 0);
3382 * Set "p_ptr->stun", notice observable changes
3384 * Note the special code to only notice "range" changes.
3386 bool set_stun(int v)
3388 int old_aux, new_aux;
3389 bool notice = FALSE;
3392 /* Hack -- Force good values */
3393 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3395 if (p_ptr->is_dead) return FALSE;
3397 if (prace_is_(RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
3400 if (p_ptr->stun > 100)
3406 else if (p_ptr->stun > 50)
3412 else if (p_ptr->stun > 0)
3448 if (new_aux > old_aux)
3450 /* Describe the state */
3456 msg_print("°Õ¼±¤¬¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3458 msg_print("You have been stunned.");
3466 msg_print("°Õ¼±¤¬¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3468 msg_print("You have been heavily stunned.");
3476 msg_print("Ƭ¤¬¥¯¥é¥¯¥é¤·¤Æ°Õ¼±¤¬±ó¤Î¤¤¤Æ¤¤¿¡£");
3478 msg_print("You have been knocked out.");
3484 if (randint1(1000) < v || one_in_(16))
3487 msg_print("³ä¤ì¤ë¤è¤¦¤ÊƬÄˤ¬¤¹¤ë¡£");
3489 msg_print("A vicious blow hits your head.");
3494 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3495 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3497 else if (one_in_(2))
3499 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3503 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3506 if (p_ptr->special_defense & KATA_MASK)
3509 msg_print("·¿¤¬Êø¤ì¤¿¡£");
3511 msg_print("Your posture gets loose.");
3513 p_ptr->special_defense &= ~(KATA_MASK);
3514 p_ptr->update |= (PU_BONUS);
3515 p_ptr->update |= (PU_MONSTERS);
3516 p_ptr->redraw |= (PR_STATE);
3517 p_ptr->redraw |= (PR_STATUS);
3518 p_ptr->action = ACTION_NONE;
3526 else if (new_aux < old_aux)
3528 /* Describe the state */
3534 msg_print("¤ä¤Ã¤ÈÛ¯Û°¾õÂÖ¤«¤é²óÉü¤·¤¿¡£");
3536 msg_print("You are no longer stunned.");
3539 if (disturb_state) disturb(0, 0);
3551 if (!notice) return (FALSE);
3554 if (disturb_state) disturb(0, 0);
3556 /* Recalculate bonuses */
3557 p_ptr->update |= (PU_BONUS);
3559 /* Redraw the "stun" */
3560 p_ptr->redraw |= (PR_STUN);
3571 * Set "p_ptr->cut", notice observable changes
3573 * Note the special code to only notice "range" changes.
3577 int old_aux, new_aux;
3578 bool notice = FALSE;
3580 /* Hack -- Force good values */
3581 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3583 if (p_ptr->is_dead) return FALSE;
3585 if ((p_ptr->prace == RACE_GOLEM ||
3586 p_ptr->prace == RACE_SKELETON ||
3587 p_ptr->prace == RACE_SPECTRE ||
3588 (p_ptr->prace == RACE_ZOMBIE && p_ptr->lev > 11)) &&
3593 if (p_ptr->cut > 1000)
3599 else if (p_ptr->cut > 200)
3605 else if (p_ptr->cut > 100)
3611 else if (p_ptr->cut > 50)
3617 else if (p_ptr->cut > 25)
3623 else if (p_ptr->cut > 10)
3629 else if (p_ptr->cut > 0)
3689 if (new_aux > old_aux)
3691 /* Describe the state */
3697 msg_print("¤«¤¹¤ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3699 msg_print("You have been given a graze.");
3707 msg_print("·Ú¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3709 msg_print("You have been given a light cut.");
3717 msg_print("¤Ò¤É¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3719 msg_print("You have been given a bad cut.");
3727 msg_print("ÂçÊѤʽý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3729 msg_print("You have been given a nasty cut.");
3737 msg_print("½ÅÂç¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3739 msg_print("You have been given a severe cut.");
3747 msg_print("¤Ò¤É¤¤¿¼¼ê¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3749 msg_print("You have been given a deep gash.");
3757 msg_print("Ã×̿Ū¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3759 msg_print("You have been given a mortal wound.");
3768 if (randint1(1000) < v || one_in_(16))
3770 if (!p_ptr->sustain_chr)
3773 msg_print("¤Ò¤É¤¤½ýÀפ¬»Ä¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3775 msg_print("You have been horribly scarred.");
3785 else if (new_aux < old_aux)
3787 /* Describe the state */
3793 msg_format("¤ä¤Ã¤È%s¡£", p_ptr->prace == RACE_ANDROID ? "²ø²æ¤¬Ä¾¤Ã¤¿" : "½Ð·ì¤¬»ß¤Þ¤Ã¤¿");
3795 msg_print("You are no longer bleeding.");
3798 if (disturb_state) disturb(0, 0);
3810 if (!notice) return (FALSE);
3813 if (disturb_state) disturb(0, 0);
3815 /* Recalculate bonuses */
3816 p_ptr->update |= (PU_BONUS);
3818 /* Redraw the "cut" */
3819 p_ptr->redraw |= (PR_CUT);
3830 * Set "p_ptr->food", notice observable changes
3832 * The "p_ptr->food" variable can get as large as 20000, allowing the
3833 * addition of the most "filling" item, Elvish Waybread, which adds
3834 * 7500 food units, without overflowing the 32767 maximum limit.
3836 * Perhaps we should disturb the player with various messages,
3837 * especially messages about hunger status changes. XXX XXX XXX
3839 * Digestion of food is handled in "dungeon.c", in which, normally,
3840 * the player digests about 20 food units per 100 game turns, more
3841 * when "fast", more when "regenerating", less with "slow digestion",
3842 * but when the player is "gorged", he digests 100 food units per 10
3843 * game turns, or a full 1000 food units per 100 game turns.
3845 * Note that the player's speed is reduced by 10 units while gorged,
3846 * so if the player eats a single food ration (5000 food units) when
3847 * full (15000 food units), he will be gorged for (5000/100)*10 = 500
3848 * game turns, or 500/(100/5) = 25 player turns (if nothing else is
3849 * affecting the player speed).
3851 bool set_food(int v)
3853 int old_aux, new_aux;
3855 bool notice = FALSE;
3857 /* Hack -- Force good values */
3858 v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
3860 /* Fainting / Starving */
3861 if (p_ptr->food < PY_FOOD_FAINT)
3867 else if (p_ptr->food < PY_FOOD_WEAK)
3873 else if (p_ptr->food < PY_FOOD_ALERT)
3879 else if (p_ptr->food < PY_FOOD_FULL)
3885 else if (p_ptr->food < PY_FOOD_MAX)
3896 /* Fainting / Starving */
3897 if (v < PY_FOOD_FAINT)
3903 else if (v < PY_FOOD_WEAK)
3909 else if (v < PY_FOOD_ALERT)
3915 else if (v < PY_FOOD_FULL)
3921 else if (v < PY_FOOD_MAX)
3932 if (old_aux < 1 && new_aux > 0)
3933 chg_virtue(V_PATIENCE, 2);
3934 else if (old_aux < 3 && (old_aux != new_aux))
3935 chg_virtue(V_PATIENCE, 1);
3937 chg_virtue(V_TEMPERANCE, 1);
3939 chg_virtue(V_TEMPERANCE, -1);
3942 if (new_aux > old_aux)
3944 /* Describe the state */
3950 msg_print("¤Þ¤À¶õÊ¢¤ÇÅݤ줽¤¦¤À¡£");
3952 msg_print("You are still weak.");
3960 msg_print("¤Þ¤À¶õÊ¢¤À¡£");
3962 msg_print("You are still hungry.");
3970 msg_print("¶õÊ¢´¶¤¬¤ª¤µ¤Þ¤Ã¤¿¡£");
3972 msg_print("You are no longer hungry.");
3980 msg_print("ËþÊ¢¤À¡ª");
3982 msg_print("You are full!");
3990 msg_print("¿©¤Ù²á¤®¤À¡ª");
3992 msg_print("You have gorged yourself!");
3994 chg_virtue(V_HARMONY, -1);
3995 chg_virtue(V_PATIENCE, -1);
3996 chg_virtue(V_TEMPERANCE, -2);
4006 else if (new_aux < old_aux)
4008 /* Describe the state */
4011 /* Fainting / Starving */
4014 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
4016 msg_print("You are getting faint from hunger!");
4024 msg_print("¤ªÊ¢¤¬¶õ¤¤¤ÆÅݤ줽¤¦¤À¡£");
4026 msg_print("You are getting weak from hunger!");
4034 msg_print("¤ªÊ¢¤¬¶õ¤¤¤Æ¤¤¿¡£");
4036 msg_print("You are getting hungry.");
4044 msg_print("ËþÊ¢´¶¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
4046 msg_print("You are no longer full.");
4054 msg_print("¤ä¤Ã¤È¤ªÊ¢¤¬¤¤Ä¤¯¤Ê¤¯¤Ê¤Ã¤¿¡£");
4056 msg_print("You are no longer gorged.");
4062 if (p_ptr->wild_mode && (new_aux < 2))
4064 p_ptr->wilderness_x = px;
4065 p_ptr->wilderness_y = py;
4066 p_ptr->energy_need = 0;
4077 /* Nothing to notice */
4078 if (!notice) return (FALSE);
4081 if (disturb_state) disturb(0, 0);
4083 /* Recalculate bonuses */
4084 p_ptr->update |= (PU_BONUS);
4087 p_ptr->redraw |= (PR_HUNGER);
4097 * Increases a stat by one randomized level -RAK-
4099 * Note that this function (used by stat potions) now restores
4100 * the stat BEFORE increasing it.
4102 bool inc_stat(int stat)
4106 /* Then augment the current/max stat */
4107 value = p_ptr->stat_cur[stat];
4109 /* Cannot go above 18/100 */
4110 if (value < p_ptr->stat_max_max[stat])
4112 /* Gain one (sometimes two) points */
4115 gain = ((randint0(100) < 75) ? 1 : 2);
4119 /* Gain 1/6 to 1/3 of distance to 18/100 */
4120 else if (value < (p_ptr->stat_max_max[stat]-2))
4122 /* Approximate gain value */
4123 gain = (((p_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
4126 if (gain < 1) gain = 1;
4128 /* Apply the bonus */
4129 value += randint1(gain) + gain / 2;
4132 if (value > (p_ptr->stat_max_max[stat]-1)) value = p_ptr->stat_max_max[stat]-1;
4135 /* Gain one point at a time */
4141 /* Save the new value */
4142 p_ptr->stat_cur[stat] = value;
4144 /* Bring up the maximum too */
4145 if (value > p_ptr->stat_max[stat])
4147 p_ptr->stat_max[stat] = value;
4150 /* Recalculate bonuses */
4151 p_ptr->update |= (PU_BONUS);
4157 /* Nothing to gain */
4164 * Decreases a stat by an amount indended to vary from 0 to 100 percent.
4166 * Amount could be a little higher in extreme cases to mangle very high
4167 * stats from massive assaults. -CWS
4169 * Note that "permanent" means that the *given* amount is permanent,
4170 * not that the new value becomes permanent. This may not work exactly
4171 * as expected, due to "weirdness" in the algorithm, but in general,
4172 * if your stat is already drained, the "max" value will not drop all
4173 * the way down to the "cur" value.
4175 bool dec_stat(int stat, int amount, int permanent)
4177 int cur, max, loss, same, res = FALSE;
4180 /* Acquire current value */
4181 cur = p_ptr->stat_cur[stat];
4182 max = p_ptr->stat_max[stat];
4184 /* Note when the values are identical */
4185 same = (cur == max);
4187 /* Damage "current" value */
4190 /* Handle "low" values */
4193 if (amount > 90) cur--;
4194 if (amount > 50) cur--;
4195 if (amount > 20) cur--;
4199 /* Handle "high" values */
4202 /* Hack -- Decrement by a random amount between one-quarter */
4203 /* and one-half of the stat bonus times the percentage, with a */
4204 /* minimum damage of half the percentage. -CWS */
4205 loss = (((cur-18) / 2 + 1) / 2 + 1);
4208 if (loss < 1) loss = 1;
4210 /* Randomize the loss */
4211 loss = ((randint1(loss) + loss) * amount) / 100;
4214 if (loss < amount/2) loss = amount/2;
4216 /* Lose some points */
4219 /* Hack -- Only reduce stat to 17 sometimes */
4220 if (cur < 18) cur = (amount <= 20) ? 18 : 17;
4223 /* Prevent illegal values */
4224 if (cur < 3) cur = 3;
4226 /* Something happened */
4227 if (cur != p_ptr->stat_cur[stat]) res = TRUE;
4230 /* Damage "max" value */
4231 if (permanent && (max > 3))
4233 chg_virtue(V_SACRIFICE, 1);
4234 if (stat == A_WIS || stat == A_INT)
4235 chg_virtue(V_ENLIGHTEN, -2);
4237 /* Handle "low" values */
4240 if (amount > 90) max--;
4241 if (amount > 50) max--;
4242 if (amount > 20) max--;
4246 /* Handle "high" values */
4249 /* Hack -- Decrement by a random amount between one-quarter */
4250 /* and one-half of the stat bonus times the percentage, with a */
4251 /* minimum damage of half the percentage. -CWS */
4252 loss = (((max-18) / 2 + 1) / 2 + 1);
4253 loss = ((randint1(loss) + loss) * amount) / 100;
4254 if (loss < amount/2) loss = amount/2;
4256 /* Lose some points */
4259 /* Hack -- Only reduce stat to 17 sometimes */
4260 if (max < 18) max = (amount <= 20) ? 18 : 17;
4263 /* Hack -- keep it clean */
4264 if (same || (max < cur)) max = cur;
4266 /* Something happened */
4267 if (max != p_ptr->stat_max[stat]) res = TRUE;
4273 /* Actually set the stat to its new value. */
4274 p_ptr->stat_cur[stat] = cur;
4275 p_ptr->stat_max[stat] = max;
4277 /* Redisplay the stats later */
4278 p_ptr->redraw |= (PR_STATS);
4280 /* Recalculate bonuses */
4281 p_ptr->update |= (PU_BONUS);
4290 * Restore a stat. Return TRUE only if this actually makes a difference.
4292 bool res_stat(int stat)
4294 /* Restore if needed */
4295 if (p_ptr->stat_cur[stat] != p_ptr->stat_max[stat])
4298 p_ptr->stat_cur[stat] = p_ptr->stat_max[stat];
4300 /* Recalculate bonuses */
4301 p_ptr->update |= (PU_BONUS);
4303 /* Redisplay the stats later */
4304 p_ptr->redraw |= (PR_STATS);
4310 /* Nothing to restore */
4316 * Increase players hit points, notice effects
4318 bool hp_player(int num)
4321 vir = virtue_number(V_VITALITY);
4324 num = num * (p_ptr->virtues[vir - 1] + 1250) / 1250;
4326 /* Healing needed */
4327 if (p_ptr->chp < p_ptr->mhp)
4329 if ((num > 0) && (p_ptr->chp < (p_ptr->mhp/3)))
4330 chg_virtue(V_TEMPERANCE, 1);
4331 /* Gain hitpoints */
4334 /* Enforce maximum */
4335 if (p_ptr->chp >= p_ptr->mhp)
4337 p_ptr->chp = p_ptr->mhp;
4338 p_ptr->chp_frac = 0;
4342 p_ptr->redraw |= (PR_HP);
4345 p_ptr->window |= (PW_PLAYER);
4351 msg_print("¾¯¤·µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4353 msg_print("You feel a little better.");
4362 msg_print("µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4364 msg_print("You feel better.");
4373 msg_print("¤È¤Æ¤âµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4375 msg_print("You feel much better.");
4384 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4386 msg_print("You feel very good.");
4401 * Array of stat "descriptions"
4403 static cptr desc_stat_pos[] =
4445 * Array of stat "descriptions"
4447 static cptr desc_stat_neg[] =
4471 bool do_dec_stat(int stat)
4475 /* Access the "sustain" */
4478 case A_STR: if (p_ptr->sustain_str) sust = TRUE; break;
4479 case A_INT: if (p_ptr->sustain_int) sust = TRUE; break;
4480 case A_WIS: if (p_ptr->sustain_wis) sust = TRUE; break;
4481 case A_DEX: if (p_ptr->sustain_dex) sust = TRUE; break;
4482 case A_CON: if (p_ptr->sustain_con) sust = TRUE; break;
4483 case A_CHR: if (p_ptr->sustain_chr) sust = TRUE; break;
4487 if (sust && (!ironman_nightmare || randint0(13)))
4491 msg_format("%s¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¤¬¡¢¤¹¤°¤Ë¸µ¤ËÌá¤Ã¤¿¡£",
4493 msg_format("You feel %s for a moment, but the feeling passes.",
4496 desc_stat_neg[stat]);
4502 /* Attempt to reduce the stat */
4503 if (dec_stat(stat, 10, (ironman_nightmare && !randint0(13))))
4507 msg_format("¤Ò¤É¤¯%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_neg[stat]);
4509 msg_format("You feel very %s.", desc_stat_neg[stat]);
4517 /* Nothing obvious */
4523 * Restore lost "points" in a stat
4525 bool do_res_stat(int stat)
4527 /* Attempt to increase */
4532 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4534 msg_format("You feel less %s.", desc_stat_neg[stat]);
4542 /* Nothing obvious */
4548 * Gain a "point" in a stat
4550 bool do_inc_stat(int stat)
4554 /* Restore strength */
4555 res = res_stat(stat);
4557 /* Attempt to increase */
4562 chg_virtue(V_ENLIGHTEN, 1);
4563 chg_virtue(V_FAITH, 1);
4565 else if (stat == A_INT)
4567 chg_virtue(V_KNOWLEDGE, 1);
4568 chg_virtue(V_ENLIGHTEN, 1);
4570 else if (stat == A_CON)
4571 chg_virtue(V_VITALITY, 1);
4575 msg_format("¥ï¡¼¥ª¡ª¤È¤Æ¤â%s¤Ê¤Ã¤¿¡ª", desc_stat_pos[stat]);
4577 msg_format("Wow! You feel very %s!", desc_stat_pos[stat]);
4585 /* Restoration worked */
4590 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4592 msg_format("You feel less %s.", desc_stat_neg[stat]);
4600 /* Nothing obvious */
4606 * Restores any drained experience
4608 bool restore_level(void)
4610 /* Restore experience */
4611 if (p_ptr->exp < p_ptr->max_exp)
4615 msg_print("À¸Ì¿ÎϤ¬Ìá¤Ã¤Æ¤¤¿µ¤¤¬¤¹¤ë¡£");
4617 msg_print("You feel your life energies returning.");
4621 /* Restore the experience */
4622 p_ptr->exp = p_ptr->max_exp;
4624 /* Check the experience */
4639 bool lose_all_info(void)
4643 chg_virtue(V_KNOWLEDGE, -5);
4644 chg_virtue(V_ENLIGHTEN, -5);
4646 /* Forget info about objects */
4647 for (i = 0; i < INVEN_TOTAL; i++)
4649 object_type *o_ptr = &inventory[i];
4651 /* Skip non-objects */
4652 if (!o_ptr->k_idx) continue;
4654 /* Allow "protection" by the MENTAL flag */
4655 if (o_ptr->ident & (IDENT_MENTAL)) continue;
4657 /* Remove "default inscriptions" */
4658 o_ptr->feeling = FEEL_NONE;
4660 /* Hack -- Clear the "empty" flag */
4661 o_ptr->ident &= ~(IDENT_EMPTY);
4663 /* Hack -- Clear the "known" flag */
4664 o_ptr->ident &= ~(IDENT_KNOWN);
4666 /* Hack -- Clear the "felt" flag */
4667 o_ptr->ident &= ~(IDENT_SENSE);
4670 /* Recalculate bonuses */
4671 p_ptr->update |= (PU_BONUS);
4673 /* Combine / Reorder the pack (later) */
4674 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
4677 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
4679 /* Mega-Hack -- Forget the map */
4687 void do_poly_wounds(void)
4689 /* Changed to always provide at least _some_ healing */
4690 s16b wounds = p_ptr->cut;
4691 s16b hit_p = (p_ptr->mhp - p_ptr->chp);
4692 s16b change = damroll(p_ptr->lev, 5);
4693 bool Nasty_effect = one_in_(5);
4695 if (!(wounds || hit_p || Nasty_effect)) return;
4698 msg_print("½ý¤¬¤è¤ê·Ú¤¤¤â¤Î¤ËÊѲ½¤·¤¿¡£");
4700 msg_print("Your wounds are polymorphed into less serious ones.");
4707 msg_print("¿·¤¿¤Ê½ý¤¬¤Ç¤¤¿¡ª");
4708 take_hit(DAMAGE_LOSELIFE, change / 2, "ÊѲ½¤·¤¿½ý", -1);
4710 msg_print("A new wound was created!");
4711 take_hit(DAMAGE_LOSELIFE, change / 2, "a polymorphed wound", -1);
4718 set_cut(p_ptr->cut - (change / 2));
4723 void do_poly_self(void)
4725 int power = p_ptr->lev;
4728 msg_print("¤¢¤Ê¤¿¤ÏÊѲ½¤Îˬ¤ì¤ò´¶¤¸¤¿...");
4730 msg_print("You feel a change coming over you...");
4733 chg_virtue(V_CHANCE, 1);
4735 if ((power > randint0(20)) && one_in_(3) && (p_ptr->prace != RACE_ANDROID))
4737 char effect_msg[80] = "";
4738 int new_race, expfact, goalexpfact, h_percent;
4740 /* Some form of racial polymorph... */
4743 if ((power > randint0(5)) && one_in_(4))
4748 if (p_ptr->psex == SEX_MALE)
4750 p_ptr->psex = SEX_FEMALE;
4751 sp_ptr = &sex_info[p_ptr->psex];
4753 sprintf(effect_msg, "½÷À¤Î");
4755 sprintf(effect_msg, "female ");
4761 p_ptr->psex = SEX_MALE;
4762 sp_ptr = &sex_info[p_ptr->psex];
4764 sprintf(effect_msg, "ÃËÀ¤Î");
4766 sprintf(effect_msg, "male ");
4772 if ((power > randint0(30)) && one_in_(5))
4776 /* Harmful deformity */
4783 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
4789 /* Deformities are discriminated against! */
4790 (void)dec_stat(A_CHR, randint1(6), TRUE);
4796 sprintf(tmp_msg,"%s",effect_msg);
4797 sprintf(effect_msg,"´ñ·Á¤Î%s",tmp_msg);
4799 sprintf(tmp_msg,"%s ",effect_msg);
4800 sprintf(effect_msg,"deformed %s ",tmp_msg);
4807 sprintf(effect_msg,"´ñ·Á¤Î");
4809 sprintf(effect_msg,"deformed ");
4815 while ((power > randint0(20)) && one_in_(10))
4817 /* Polymorph into a less mutated form */
4820 if (!lose_mutation(0))
4822 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
4824 msg_print("You feel oddly normal.");
4830 * Restrict the race choices by exp penalty so
4831 * weak polymorph always means weak race
4836 goalexpfact = 100 + 3 * randint0(power);
4840 new_race = randint0(MAX_RACES);
4841 expfact = race_info[new_race].r_exp;
4843 while (((new_race == p_ptr->prace) && (expfact > goalexpfact)) || (new_race == RACE_ANDROID));
4846 msg_format("¤¢¤Ê¤¿¤Ï%s%s¤ËÊѲ½¤·¤¿¡ª", effect_msg,
4847 race_info[new_race].title);
4851 msg_format("You turn into a%s %s!",
4852 ((new_race == RACE_AMBERITE || new_race == RACE_ELF
4853 || new_race == RACE_IMP) ? "n" : ""),
4854 race_info[new_race].title);
4858 msg_format("You turn into a %s%s!", effect_msg,
4859 race_info[new_race].title);
4863 chg_virtue(V_CHANCE, 2);
4865 if (p_ptr->prace < 32)
4867 p_ptr->old_race1 |= 1L << p_ptr->prace;
4871 p_ptr->old_race2 = 1L << (p_ptr->prace-32);
4873 p_ptr->prace = new_race;
4874 rp_ptr = &race_info[p_ptr->prace];
4876 /* Experience factor */
4877 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
4879 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)))
4880 p_ptr->expfact -= 15;
4883 /* Calculate the height/weight for males */
4884 if (p_ptr->psex == SEX_MALE)
4886 p_ptr->ht = randnor(rp_ptr->m_b_ht, rp_ptr->m_m_ht);
4887 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->m_b_ht);
4888 p_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * h_percent /100
4889 , (int)(rp_ptr->m_m_wt) * h_percent / 300 );
4892 /* Calculate the height/weight for females */
4893 else if (p_ptr->psex == SEX_FEMALE)
4895 p_ptr->ht = randnor(rp_ptr->f_b_ht, rp_ptr->f_m_ht);
4896 h_percent = (int)(p_ptr->ht) * 100 / (int)(rp_ptr->f_b_ht);
4897 p_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * h_percent /100
4898 , (int)(rp_ptr->f_m_wt) * h_percent / 300 );
4904 if (p_ptr->pclass == CLASS_SORCERER)
4905 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
4907 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
4909 do_cmd_rerate(FALSE);
4911 p_ptr->redraw |= (PR_BASIC);
4913 p_ptr->update |= (PU_BONUS);
4919 if ((power > randint0(30)) && one_in_(6))
4927 msg_format("%s¤Î¹½À®¤¬ÊѲ½¤·¤¿¡ª", p_ptr->prace == RACE_ANDROID ? "µ¡³£" : "Æâ¡");
4929 msg_print("Your internal organs are rearranged!");
4934 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
4940 msg_print("¸½ºß»Ñ¤ÇÀ¸¤¤Æ¤¤¤¯¤Î¤Ïº¤Æñ¤Ê¤è¤¦¤À¡ª");
4941 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), "Ã×̿Ū¤ÊÆÍÁ³ÊÑ°Û", -1);
4943 msg_print("You find living difficult in your present form!");
4944 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), "a lethal mutation", -1);
4951 if ((power > randint0(20)) && one_in_(4))
4956 do_cmd_rerate(FALSE);
4959 while ((power > randint0(15)) && one_in_(3))
4962 (void)gain_random_mutation(0);
4965 if (power > randint0(5))
4971 /* Note: earlier deductions may have left power < 0 already. */
4981 * Decreases players hit points and sets death flag if necessary
4983 * XXX XXX XXX Invulnerability needs to be changed into a "shield"
4985 * XXX XXX XXX Hack -- this function allows the user to save (or quit)
4986 * the game when he dies, since the "You die." message is shown before
4987 * setting the player to "dead".
4989 int take_hit(int damage_type, int damage, cptr hit_from, int monspell)
4991 int old_chp = p_ptr->chp;
4993 char death_message[1024];
4996 int warning = (p_ptr->mhp * hitpoint_warn / 10);
4999 if (p_ptr->is_dead) return 0;
5001 if (p_ptr->sutemi) damage *= 2;
5002 if (p_ptr->special_defense & KATA_IAI) damage += (damage + 4) / 5;
5004 if (easy_band) damage = (damage+1)/2;
5006 if (damage_type != DAMAGE_USELIFE)
5016 if (monspell >= 0) learn_spell(monspell);
5018 /* Mega-Hack -- Apply "invulnerability" */
5019 if ((damage_type != DAMAGE_USELIFE) && (damage_type != DAMAGE_LOSELIFE))
5021 if ((p_ptr->invuln || ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == MUSIC_INVULN))) && (damage < 9000))
5023 if (damage_type == DAMAGE_FORCE)
5026 msg_print("¥Ð¥ê¥¢¤¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5028 msg_print("The attack cuts your shield of invulnerability open!");
5031 else if (one_in_(PENETRATE_INVULNERABILITY))
5034 msg_print("̵Ũ¤Î¥Ð¥ê¥¢¤òÇˤäƹ¶·â¤µ¤ì¤¿¡ª");
5036 msg_print("The attack penetrates your shield of invulnerability!");
5045 /* Multishadow effects is determined by turn */
5046 if (p_ptr->multishadow && (turn & 1))
5048 if (damage_type == DAMAGE_FORCE)
5051 msg_print("¸¸±Æ¤â¤í¤È¤âÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5053 msg_print("The attack hits Shadow together with you!");
5056 else if (damage_type == DAMAGE_ATTACK)
5059 msg_print("¹¶·â¤Ï¸¸±Æ¤ËÌ¿Ã椷¡¢¤¢¤Ê¤¿¤Ë¤ÏÆϤ«¤Ê¤«¤Ã¤¿¡£");
5061 msg_print("The attack hits Shadow, you are unharmed!");
5067 if (p_ptr->wraith_form)
5069 if (damage_type == DAMAGE_FORCE)
5072 msg_print("Ⱦʪ¼Á¤ÎÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5074 msg_print("The attack cuts through your ethereal body!");
5080 if ((damage == 0) && one_in_(2)) damage = 1;
5084 if ((p_ptr->special_defense & KATA_MUSOU))
5087 if ((damage == 0) && one_in_(2)) damage = 1;
5089 } /* not if LOSELIFE USELIFE */
5091 /* Hurt the player */
5092 p_ptr->chp -= damage;
5093 if(damage_type == DAMAGE_GENO && p_ptr->chp < 0)
5095 damage += p_ptr->chp;
5099 /* Display the hitpoints */
5100 p_ptr->redraw |= (PR_HP);
5103 p_ptr->window |= (PW_PLAYER);
5107 if (damage_type != DAMAGE_GENO && p_ptr->chp == 0)
5109 chg_virtue(V_SACRIFICE, 1);
5110 chg_virtue(V_CHANCE, 2);
5117 bool android = (p_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
5119 #ifdef JP /* »à¤ó¤À»þ¤Ë¶¯À©½ªÎ»¤·¤Æ»à¤ò²óÈò¤Ç¤¤Ê¤¯¤·¤Æ¤ß¤¿ by Habu */
5121 if(!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
5127 chg_virtue(V_SACRIFICE, 10);
5130 p_ptr->leaving = TRUE;
5133 p_ptr->is_dead = TRUE;
5135 if (p_ptr->inside_arena)
5137 cptr m_name = r_name+r_info[arena_monsters[p_ptr->arena_number]].name;
5139 msg_format("¤¢¤Ê¤¿¤Ï%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£", m_name);
5141 msg_format("You are beaten by %s.", m_name);
5144 if (record_arena) do_cmd_write_nikki(NIKKI_ARENA, 99, m_name);
5149 /* Make screen dump */
5150 screen_dump = make_screen_dump();
5153 /* Note cause of death */
5155 sprintf(p_ptr->died_from, "%s%s%s", !p_ptr->paralyzed ? "" : p_ptr->free_act ? "ĦÁü¾õÂÖ¤Ç":"Ëãáã¾õÂÖ¤Ç", p_ptr->image ? "¸¸³Ð¤ËÏĤó¤À" : "", hit_from);
5157 sprintf(p_ptr->died_from, "%s%s", hit_from, !p_ptr->paralyzed ? "" : " while helpless");
5160 /* No longer a winner */
5161 p_ptr->total_winner = FALSE;
5163 if (p_ptr->inside_arena)
5165 strcpy(buf,"¥¢¥ê¡¼¥Ê");
5167 strcpy(buf,"in the Arena");
5169 else if (!dun_level)
5173 strcpy(buf,"on the surface");
5175 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)))
5177 strcpy(buf,"¥¯¥¨¥¹¥È");
5179 strcpy(buf,"in a quest");
5183 sprintf(buf,"%d³¬", dun_level);
5185 sprintf(buf,"level %d", dun_level);
5188 sprintf(tmp,"%s¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£",buf, p_ptr->died_from);
5190 sprintf(tmp,"killed by %s %s.", p_ptr->died_from, buf);
5192 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5194 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- ¥²¡¼¥à¥ª¡¼¥Ð¡¼ --------");
5196 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- Game Over --------");
5198 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, "\n\n\n\n");
5203 if (get_check_strict("²èÌ̤òÊݸ¤·¤Þ¤¹¤«¡©", CHECK_NO_HISTORY))
5205 if (get_check_strict("Dump the screen? ", CHECK_NO_HISTORY))
5209 do_cmd_save_screen();
5214 /* Hack -- Note death */
5218 msg_format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë");
5220 msg_print(android ? "You are broken." : "You die.");
5227 if (streq(p_ptr->died_from, "Seppuku"))
5230 get_rnd_line("seppuku_j.txt", 0, death_message);
5232 get_rnd_line("seppuku.txt", 0, death_message);
5238 get_rnd_line("death_j.txt", 0, death_message);
5240 get_rnd_line("death.txt", 0, death_message);
5244 while (!get_string(streq(p_ptr->died_from, "Seppuku") ? "¼À¤¤Î¶ç: " : "ÃÇËöËâ¤Î¶«¤Ó: ", death_message, 1024)) ;
5246 while (!get_string("Last word: ", death_message, 1024)) ;
5248 if (death_message[0] == '\0')
5251 strcpy(death_message, format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë"));
5253 strcpy(death_message, android ? "You are broken." : "You die.");
5256 if (streq(p_ptr->died_from, "Seppuku"))
5262 int msg_pos_x[9] = { 5, 7, 9, 12, 14, 17, 19, 21, 23};
5263 int msg_pos_y[9] = { 3, 4, 5, 4, 5, 4, 5, 6, 4};
5270 for (i = 0; i < 40; i++)
5271 Term_putstr(randint0(w / 2) * 2, randint0(h), 2, TERM_VIOLET, "¦Ô");
5273 str = death_message;
5274 if (strncmp(str, "¡Ö", 2) == 0) str += 2;
5276 str2 = strstr_j(str, "¡×");
5277 if (str2 != NULL) *str2 = '\0';
5282 str2 = strstr_j(str, " ");
5283 if (str2 == NULL) len = strlen(str);
5284 else len = str2 - str;
5288 Term_putstr_v(w * 3 / 4 - 2 - msg_pos_x[i] * 2, msg_pos_y[i], len,
5290 if (str2 == NULL) break;
5294 if (*str == 0) break;
5298 Term_putstr(w-1, h-1, 1, TERM_WHITE, " ");
5302 /* Make screen dump */
5303 screen_dump = make_screen_dump();
5306 /* Wait a key press */
5309 msg_print(death_message);
5313 msg_print(death_message);
5321 /* Hitpoint warning */
5322 if (p_ptr->chp < warning)
5324 /* Hack -- bell on first notice */
5325 if (alert_hitpoint && (old_chp > warning)) bell();
5329 if (record_danger && (old_chp > warning))
5331 if (p_ptr->image && damage_type == DAMAGE_ATTACK)
5335 hit_from = "something";
5339 sprintf(tmp,"%s¤Ë¤è¤Ã¤Æ¥Ô¥ó¥Á¤Ë´Ù¤¤¤Ã¤¿¡£",hit_from);
5341 sprintf(tmp,"A critical situation because of %s.",hit_from);
5343 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5348 /* stop auto_more even if DAMAGE_USELIFE */
5354 msg_print("*** ·Ù¹ð:Äã¥Ò¥Ã¥È¡¦¥Ý¥¤¥ó¥È¡ª ***");
5356 msg_print("*** LOW HITPOINT WARNING! ***");
5362 if (p_ptr->wild_mode && !p_ptr->leaving && (p_ptr->chp < MAX(warning, p_ptr->mhp/5)))
5364 p_ptr->wilderness_x = px;
5365 p_ptr->wilderness_y = py;
5366 p_ptr->energy_need = 0;
5376 void gain_exp(s32b amount)
5378 if (p_ptr->is_dead) return;
5380 if (p_ptr->prace == RACE_ANDROID) return;
5382 /* Gain some experience */
5383 p_ptr->exp += amount;
5385 /* Slowly recover from experience drainage */
5386 if (p_ptr->exp < p_ptr->max_exp)
5388 /* Gain max experience (20%) (was 10%) */
5389 p_ptr->max_exp += amount / 5;
5392 /* Check Experience */
5397 void calc_android_exp(void)
5401 if (p_ptr->is_dead) return;
5403 if (p_ptr->prace != RACE_ANDROID) return;
5405 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5407 object_type *o_ptr = &inventory[i];
5409 object_type *q_ptr = &forge;
5411 int level = MAX(get_object_level(o_ptr) - 8, 1);
5413 if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue;
5414 if (!o_ptr->k_idx) continue;
5416 /* Wipe the object */
5419 object_copy(q_ptr, o_ptr);
5420 q_ptr->discount = 0;
5421 q_ptr->curse_flags = 0L;
5425 level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
5426 level += MIN(20, a_info[o_ptr->name1].rarity/(a_info[o_ptr->name1].gen_flags & TRG_INSTA_ART ? 10 : 3));
5428 else if (o_ptr->name2) level += MAX(3, (e_info[o_ptr->name2].rating - 5)/2);
5429 value = object_value_real(q_ptr);
5431 if (value <= 0) continue;
5432 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (p_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
5433 if (value > 5000000L) value = 5000000L;
5434 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
5436 if (o_ptr->name1 || o_ptr->name2 || o_ptr->art_name ||
5437 (o_ptr->tval == TV_DRAG_ARMOR) ||
5438 ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) ||
5439 ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) ||
5440 ((o_ptr->tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)) ||
5441 ((o_ptr->tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) ||
5442 ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE)))
5444 if (level > 65) level = 35 + (level - 65) / 5;
5445 else if (level > 35) level = 25 + (level - 35) / 3;
5446 else if (level > 15) level = 15 + (level - 15) / 2;
5447 exp = MIN(100000L, value) * level * level / 2;
5448 if (value > 100000L)
5449 exp += (value - 100000L) * level * level / 8;
5453 exp = MIN(100000L, value) * level;
5454 if (value > 100000L)
5455 exp += (value - 100000L) * level / 4;
5457 if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (buki_motteruka(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
5458 else total_exp += exp / 16;
5459 if (i == INVEN_BODY) total_exp += exp / 32;
5461 p_ptr->exp = p_ptr->max_exp = total_exp;
5463 /* Check Experience */
5471 void lose_exp(s32b amount)
5473 if (p_ptr->prace == RACE_ANDROID) return;
5475 /* Never drop below zero experience */
5476 if (amount > p_ptr->exp) amount = p_ptr->exp;
5478 /* Lose some experience */
5479 p_ptr->exp -= amount;
5481 /* Check Experience */
5485 bool set_ultimate_res(int v, bool do_dec)
5487 bool notice = FALSE;
5489 /* Hack -- Force good values */
5490 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5492 if (p_ptr->is_dead) return FALSE;
5497 if (p_ptr->ult_res && !do_dec)
5499 if (p_ptr->ult_res > v) return FALSE;
5501 else if (!p_ptr->ult_res)
5504 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5506 msg_print("You feel resistant!");
5519 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5521 msg_print("You feel less resistant");
5531 /* Redraw status bar */
5532 p_ptr->redraw |= (PR_STATUS);
5534 /* Nothing to notice */
5535 if (!notice) return (FALSE);
5538 if (disturb_state) disturb(0, 0);
5540 /* Recalculate bonuses */
5541 p_ptr->update |= (PU_BONUS);
5550 bool set_tim_res_nether(int v, bool do_dec)
5552 bool notice = FALSE;
5554 /* Hack -- Force good values */
5555 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5557 if (p_ptr->is_dead) return FALSE;
5562 if (p_ptr->tim_res_nether && !do_dec)
5564 if (p_ptr->tim_res_nether > v) return FALSE;
5566 else if (!p_ptr->tim_res_nether)
5569 msg_print("ÃϹö¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5571 msg_print("You feel nether resistant!");
5581 if (p_ptr->tim_res_nether)
5584 msg_print("ÃϹö¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5586 msg_print("You feel less nether resistant");
5594 p_ptr->tim_res_nether = v;
5596 /* Redraw status bar */
5597 p_ptr->redraw |= (PR_STATUS);
5599 /* Nothing to notice */
5600 if (!notice) return (FALSE);
5603 if (disturb_state) disturb(0, 0);
5605 /* Recalculate bonuses */
5606 p_ptr->update |= (PU_BONUS);
5615 bool set_tim_res_time(int v, bool do_dec)
5617 bool notice = FALSE;
5619 /* Hack -- Force good values */
5620 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5622 if (p_ptr->is_dead) return FALSE;
5627 if (p_ptr->tim_res_time && !do_dec)
5629 if (p_ptr->tim_res_time > v) return FALSE;
5631 else if (!p_ptr->tim_res_time)
5634 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5636 msg_print("You feel time resistant!");
5646 if (p_ptr->tim_res_time)
5649 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5651 msg_print("You feel less time resistant");
5659 p_ptr->tim_res_time = v;
5661 /* Redraw status bar */
5662 p_ptr->redraw |= (PR_STATUS);
5664 /* Nothing to notice */
5665 if (!notice) return (FALSE);
5668 if (disturb_state) disturb(0, 0);
5670 /* Recalculate bonuses */
5671 p_ptr->update |= (PU_BONUS);
5682 * Choose a warrior-mage elemental attack. -LM-
5684 bool choose_ele_attack(void)
5693 num = (p_ptr->lev - 20) / 5;
5696 c_prt(TERM_RED, " a) ¾Æ´þ", 2, 14);
5698 c_prt(TERM_RED, " a) Fire Brand", 2, 14);
5702 if (num >= 2) c_prt(TERM_L_WHITE," b) Åà·ë", 3, 14);
5704 if (num >= 2) c_prt(TERM_L_WHITE," b) Cold Brand", 3, 14);
5706 else prt("", 3, 14);
5709 if (num >= 3) c_prt(TERM_GREEN, " c) ÆÇ»¦", 4, 14);
5711 if (num >= 3) c_prt(TERM_GREEN, " c) Poison Brand", 4, 14);
5713 else prt("", 4, 14);
5716 if (num >= 4) c_prt(TERM_L_DARK, " d) Íϲò", 5, 14);
5718 if (num >= 4) c_prt(TERM_L_DARK, " d) Acid Brand", 5, 14);
5720 else prt("", 5, 14);
5723 if (num >= 5) c_prt(TERM_BLUE, " e) ÅÅ·â", 6, 14);
5725 if (num >= 5) c_prt(TERM_BLUE, " e) Elec Brand", 6, 14);
5727 else prt("", 6, 14);
5735 prt(" ¤É¤Î¸µÁǹ¶·â¤ò¤·¤Þ¤¹¤«¡©", 1, 14);
5737 prt(" Choose a temporary elemental brand ", 1, 14);
5742 if ((choice == 'a') || (choice == 'A'))
5743 set_ele_attack(ATTACK_FIRE, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5744 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
5745 set_ele_attack(ATTACK_COLD, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5746 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
5747 set_ele_attack(ATTACK_POIS, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5748 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
5749 set_ele_attack(ATTACK_ACID, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5750 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
5751 set_ele_attack(ATTACK_ELEC, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5755 msg_print("ËâË¡·õ¤ò»È¤¦¤Î¤ò¤ä¤á¤¿¡£");
5757 msg_print("You cancel the temporary branding.");
5769 * Choose a elemental immune. -LM-
5771 bool choose_ele_immune(int turn)
5779 c_prt(TERM_RED, " a) ²Ð±ê", 2, 14);
5781 c_prt(TERM_RED, " a) Immune Fire", 2, 14);
5785 c_prt(TERM_L_WHITE," b) Î䵤", 3, 14);
5787 c_prt(TERM_L_WHITE," b) Immune Cold", 3, 14);
5791 c_prt(TERM_L_DARK, " c) »À", 4, 14);
5793 c_prt(TERM_L_DARK, " c) Immune Acid", 4, 14);
5797 c_prt(TERM_BLUE, " d) ÅÅ·â", 5, 14);
5799 c_prt(TERM_BLUE, " d) Immune Elec", 5, 14);
5810 prt(" ¤É¤Î¸µÁǤÎÌȱ֤ò¤Ä¤±¤Þ¤¹¤«¡©", 1, 14);
5812 prt(" Choose a temporary elemental immune ", 1, 14);
5817 if ((choice == 'a') || (choice == 'A'))
5818 set_ele_immune(DEFENSE_FIRE, turn);
5819 else if ((choice == 'b') || (choice == 'B'))
5820 set_ele_immune(DEFENSE_COLD, turn);
5821 else if ((choice == 'c') || (choice == 'C'))
5822 set_ele_immune(DEFENSE_ACID, turn);
5823 else if ((choice == 'd') || (choice == 'D'))
5824 set_ele_immune(DEFENSE_ELEC, turn);
5828 msg_print("Ìȱ֤òÉÕ¤±¤ë¤Î¤ò¤ä¤á¤¿¡£");
5830 msg_print("You cancel the temporary immune.");