4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: effects of various "objects" */
15 void set_action(int typ)
17 int prev_typ = p_ptr->action;
30 msg_print("õº÷¤ò¤ä¤á¤¿¡£");
32 msg_print("You no longer walk carefully.");
34 p_ptr->redraw |= (PR_SPEED);
45 msg_print("³Ø½¬¤ò¤ä¤á¤¿¡£");
47 msg_print("You stop Learning");
55 msg_print("¹½¤¨¤ò¤È¤¤¤¿¡£");
57 msg_print("You stop assuming the posture.");
59 p_ptr->special_defense &= ~(KAMAE_MASK);
65 msg_print("·¿¤òÊø¤·¤¿¡£");
67 msg_print("You stop assuming the posture.");
69 p_ptr->special_defense &= ~(KATA_MASK);
70 p_ptr->update |= (PU_MONSTERS);
71 p_ptr->redraw |= (PR_STATUS);
77 msg_print("²Î¤¦¤Î¤ò¤ä¤á¤¿¡£");
79 msg_print("You stop singing.");
86 msg_print("¤¬½Å¤¯¤Ê¤Ã¤¿¡£");
88 msg_print("You are no longer walking extremely fast.");
97 /* If we are requested other action, stop singing */
98 if (prev_typ == ACTION_SING) stop_singing();
100 switch (p_ptr->action)
105 msg_print("Ãí°Õ¿¼¤¯Ê⤻Ϥ᤿¡£");
107 msg_print("You begin to walk carefully.");
109 p_ptr->redraw |= (PR_SPEED);
115 msg_print("³Ø½¬¤ò»Ï¤á¤¿¡£");
117 msg_print("You begin Learning");
124 msg_print("¿åÌ̤˻å¤ò¿â¤é¤·¤¿¡¥¡¥¡¥");
126 msg_print("You begin fishing...");
130 case ACTION_HAYAGAKE:
133 msg_print("¤¬±©¤Î¤è¤¦¤Ë·Ú¤¯¤Ê¤Ã¤¿¡£");
135 msg_print("You begin to walk extremely fast.");
145 /* Recalculate bonuses */
146 p_ptr->update |= (PU_BONUS);
148 /* Redraw the state */
149 p_ptr->redraw |= (PR_STATE);
152 /* reset timed flags */
153 void reset_tim_flags(void)
155 p_ptr->fast = 0; /* Timed -- Fast */
156 p_ptr->lightspeed = 0;
157 p_ptr->slow = 0; /* Timed -- Slow */
158 p_ptr->blind = 0; /* Timed -- Blindness */
159 p_ptr->paralyzed = 0; /* Timed -- Paralysis */
160 p_ptr->confused = 0; /* Timed -- Confusion */
161 p_ptr->afraid = 0; /* Timed -- Fear */
162 p_ptr->image = 0; /* Timed -- Hallucination */
163 p_ptr->poisoned = 0; /* Timed -- Poisoned */
164 p_ptr->cut = 0; /* Timed -- Cut */
165 p_ptr->stun = 0; /* Timed -- Stun */
167 p_ptr->protevil = 0; /* Timed -- Protection */
168 p_ptr->invuln = 0; /* Timed -- Invulnerable */
170 p_ptr->hero = 0; /* Timed -- Heroism */
171 p_ptr->shero = 0; /* Timed -- Super Heroism */
172 p_ptr->shield = 0; /* Timed -- Shield Spell */
173 p_ptr->blessed = 0; /* Timed -- Blessed */
174 p_ptr->tim_invis = 0; /* Timed -- Invisibility */
175 p_ptr->tim_infra = 0; /* Timed -- Infra Vision */
176 p_ptr->tim_regen = 0; /* Timed -- Regeneration */
177 p_ptr->tim_stealth = 0; /* Timed -- Stealth */
179 p_ptr->wraith_form = 0; /* Timed -- Wraith Form */
180 p_ptr->tim_levitation = 0;
181 p_ptr->tim_sh_touki = 0;
182 p_ptr->tim_sh_fire = 0;
183 p_ptr->tim_sh_holy = 0;
184 p_ptr->tim_eyeeye = 0;
186 p_ptr->resist_magic = 0;
189 p_ptr->tim_res_nether = 0;
190 p_ptr->tim_res_time = 0;
191 p_ptr->tim_mimic = 0;
192 p_ptr->mimic_form = 0;
193 p_ptr->tim_reflect = 0;
194 p_ptr->multishadow = 0;
196 p_ptr->action = ACTION_NONE;
199 p_ptr->oppose_acid = 0; /* Timed -- oppose acid */
200 p_ptr->oppose_elec = 0; /* Timed -- oppose lightning */
201 p_ptr->oppose_fire = 0; /* Timed -- oppose heat */
202 p_ptr->oppose_cold = 0; /* Timed -- oppose cold */
203 p_ptr->oppose_pois = 0; /* Timed -- oppose poison */
205 p_ptr->word_recall = 0;
206 p_ptr->alter_reality = 0;
207 p_ptr->sutemi = FALSE;
208 p_ptr->counter = FALSE;
209 p_ptr->ele_attack = 0;
210 p_ptr->ele_immune = 0;
211 p_ptr->special_attack = 0L;
212 p_ptr->special_defense = 0L;
214 while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
215 world_player = FALSE;
217 if (prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
218 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1;
219 if (p_ptr->pclass == CLASS_BERSERKER) p_ptr->shero = 1;
223 (void)set_monster_fast(p_ptr->riding, 0);
224 (void)set_monster_slow(p_ptr->riding, 0);
225 (void)set_monster_invulner(p_ptr->riding, 0, FALSE);
228 if (p_ptr->pclass == CLASS_BARD)
230 p_ptr->magic_num1[0] = 0;
231 p_ptr->magic_num2[0] = 0;
236 void dispel_player(void)
238 (void)set_fast(0, TRUE);
239 (void)set_lightspeed(0, TRUE);
240 (void)set_slow(0, TRUE);
241 (void)set_shield(0, TRUE);
242 (void)set_blessed(0, TRUE);
243 (void)set_tsuyoshi(0, TRUE);
244 (void)set_hero(0, TRUE);
245 (void)set_shero(0, TRUE);
246 (void)set_protevil(0, TRUE);
247 (void)set_invuln(0, TRUE);
248 (void)set_wraith_form(0, TRUE);
249 (void)set_kabenuke(0, TRUE);
250 (void)set_tim_res_nether(0, TRUE);
251 (void)set_tim_res_time(0, TRUE);
253 (void)set_tim_reflect(0,TRUE);
254 (void)set_multishadow(0,TRUE);
255 (void)set_dustrobe(0,TRUE);
257 (void)set_tim_invis(0, TRUE);
258 (void)set_tim_infra(0, TRUE);
259 (void)set_tim_esp(0, TRUE);
260 (void)set_tim_regen(0, TRUE);
261 (void)set_tim_stealth(0, TRUE);
262 (void)set_tim_levitation(0, TRUE);
263 (void)set_tim_sh_touki(0, TRUE);
264 (void)set_tim_sh_fire(0, TRUE);
265 (void)set_tim_sh_holy(0, TRUE);
266 (void)set_tim_eyeeye(0, TRUE);
267 (void)set_magicdef(0, TRUE);
268 (void)set_resist_magic(0, TRUE);
269 (void)set_oppose_acid(0, TRUE);
270 (void)set_oppose_elec(0, TRUE);
271 (void)set_oppose_fire(0, TRUE);
272 (void)set_oppose_cold(0, TRUE);
273 (void)set_oppose_pois(0, TRUE);
274 (void)set_ultimate_res(0, TRUE);
275 (void)set_mimic(0, 0, TRUE);
276 (void)set_ele_attack(0, 0);
277 (void)set_ele_immune(0, 0);
279 /* Cancel glowing hands */
280 if (p_ptr->special_attack & ATTACK_CONFUSE)
282 p_ptr->special_attack &= ~(ATTACK_CONFUSE);
284 msg_print("¼ê¤Îµ±¤¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
286 msg_print("Your hands stop glowing.");
290 if (music_singing_any())
292 p_ptr->magic_num1[1] = p_ptr->magic_num1[0];
293 p_ptr->magic_num1[0] = 0;
295 msg_print("²Î¤¬ÅÓÀڤ줿¡£");
297 msg_print("Your singing is interrupted.");
299 p_ptr->action = ACTION_NONE;
301 /* Recalculate bonuses */
302 p_ptr->update |= (PU_BONUS | PU_HP);
305 p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
307 /* Update monsters */
308 p_ptr->update |= (PU_MONSTERS);
311 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
313 p_ptr->energy_need += ENERGY_NEED();
319 * Set "p_ptr->tim_mimic", and "p_ptr->mimic_form",
320 * notice observable changes
322 bool set_mimic(int v, int p, bool do_dec)
326 /* Hack -- Force good values */
327 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
329 if (p_ptr->is_dead) return FALSE;
334 if (p_ptr->tim_mimic && (p_ptr->mimic_form == p) && !do_dec)
336 if (p_ptr->tim_mimic > v) return FALSE;
338 else if ((!p_ptr->tim_mimic) || (p_ptr->mimic_form != p))
341 msg_print("¼«Ê¬¤ÎÂΤ¬ÊѤï¤Ã¤Æ¤æ¤¯¤Î¤ò´¶¤¸¤¿¡£");
343 msg_print("You feel that your body changes.");
353 if (p_ptr->tim_mimic)
356 msg_print("ÊѿȤ¬²ò¤±¤¿¡£");
358 msg_print("You are no longer transformed.");
360 if (p_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(0, TRUE);
368 p_ptr->tim_mimic = v;
370 /* Nothing to notice */
379 p_ptr->redraw |= (PR_BASIC | PR_STATUS);
381 /* Recalculate bonuses */
382 p_ptr->update |= (PU_BONUS | PU_HP);
391 * Set "p_ptr->blind", notice observable changes
393 * Note the use of "PU_UN_LITE" and "PU_UN_VIEW", which is needed to
394 * memorize any terrain features which suddenly become "visible".
395 * Note that blindness is currently the only thing which can affect
396 * "player_can_see_bold()".
398 bool set_blind(int v)
402 /* Hack -- Force good values */
403 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
405 if (p_ptr->is_dead) return FALSE;
412 if (p_ptr->prace == RACE_ANDROID)
415 msg_print("¥»¥ó¥µ¡¼¤ò¤ä¤é¤ì¤¿¡ª");
417 msg_print("You are blind!");
423 msg_print("Ìܤ¬¸«¤¨¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
425 msg_print("You are blind!");
430 chg_virtue(V_ENLIGHTEN, -1);
439 if (p_ptr->prace == RACE_ANDROID)
442 msg_print("¥»¥ó¥µ¡¼¤¬Éüµì¤·¤¿¡£");
444 msg_print("You can see again.");
450 msg_print("¤ä¤Ã¤ÈÌܤ¬¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
452 msg_print("You can see again.");
463 /* Redraw status bar */
464 p_ptr->redraw |= (PR_STATUS);
466 /* Nothing to notice */
467 if (!notice) return (FALSE);
470 if (disturb_state) disturb(0, 0);
472 /* Fully update the visuals */
473 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
476 p_ptr->redraw |= (PR_MAP);
479 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
490 * Set "p_ptr->confused", notice observable changes
492 bool set_confused(int v)
496 /* Hack -- Force good values */
497 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
499 if (p_ptr->is_dead) return FALSE;
504 if (!p_ptr->confused)
507 msg_print("¤¢¤Ê¤¿¤Ïº®Í𤷤¿¡ª");
509 msg_print("You are confused!");
512 if (p_ptr->action == ACTION_LEARN)
515 msg_print("³Ø½¬¤¬Â³¤±¤é¤ì¤Ê¤¤¡ª");
517 msg_print("You cannot continue Learning!");
521 p_ptr->redraw |= (PR_STATE);
522 p_ptr->action = ACTION_NONE;
524 if (p_ptr->action == ACTION_KAMAE)
527 msg_print("¹½¤¨¤¬¤È¤±¤¿¡£");
529 msg_print("Your posture gets loose.");
531 p_ptr->special_defense &= ~(KAMAE_MASK);
532 p_ptr->update |= (PU_BONUS);
533 p_ptr->redraw |= (PR_STATE);
534 p_ptr->action = ACTION_NONE;
536 else if (p_ptr->action == ACTION_KATA)
539 msg_print("·¿¤¬Êø¤ì¤¿¡£");
541 msg_print("Your posture gets loose.");
543 p_ptr->special_defense &= ~(KATA_MASK);
544 p_ptr->update |= (PU_BONUS);
545 p_ptr->update |= (PU_MONSTERS);
546 p_ptr->redraw |= (PR_STATE);
547 p_ptr->redraw |= (PR_STATUS);
548 p_ptr->action = ACTION_NONE;
552 p_ptr->counter = FALSE;
553 chg_virtue(V_HARMONY, -1);
563 msg_print("¤ä¤Ã¤Èº®Í𤬤ª¤µ¤Þ¤Ã¤¿¡£");
565 msg_print("You feel less confused now.");
568 p_ptr->special_attack &= ~(ATTACK_SUIKEN);
576 /* Redraw status bar */
577 p_ptr->redraw |= (PR_STATUS);
579 /* Nothing to notice */
580 if (!notice) return (FALSE);
583 if (disturb_state) disturb(0, 0);
594 * Set "p_ptr->poisoned", notice observable changes
596 bool set_poisoned(int v)
600 /* Hack -- Force good values */
601 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
603 if (p_ptr->is_dead) return FALSE;
608 if (!p_ptr->poisoned)
611 msg_print("ÆǤ˿¯¤µ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
613 msg_print("You are poisoned!");
626 msg_print("¤ä¤Ã¤ÈÆǤÎÄˤߤ¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
628 msg_print("You are no longer poisoned.");
638 /* Redraw status bar */
639 p_ptr->redraw |= (PR_STATUS);
641 /* Nothing to notice */
642 if (!notice) return (FALSE);
645 if (disturb_state) disturb(0, 0);
656 * Set "p_ptr->afraid", notice observable changes
658 bool set_afraid(int v)
662 /* Hack -- Force good values */
663 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
665 if (p_ptr->is_dead) return FALSE;
673 msg_print("²¿¤â¤«¤â¶²¤¯¤Ê¤Ã¤Æ¤¤¿¡ª");
675 msg_print("You are terrified!");
678 if (p_ptr->special_defense & KATA_MASK)
681 msg_print("·¿¤¬Êø¤ì¤¿¡£");
683 msg_print("Your posture gets loose.");
685 p_ptr->special_defense &= ~(KATA_MASK);
686 p_ptr->update |= (PU_BONUS);
687 p_ptr->update |= (PU_MONSTERS);
688 p_ptr->redraw |= (PR_STATE);
689 p_ptr->redraw |= (PR_STATUS);
690 p_ptr->action = ACTION_NONE;
694 p_ptr->counter = FALSE;
695 chg_virtue(V_VALOUR, -1);
705 msg_print("¤ä¤Ã¤È¶²Éݤò¿¶¤êʧ¤Ã¤¿¡£");
707 msg_print("You feel bolder now.");
717 /* Redraw status bar */
718 p_ptr->redraw |= (PR_STATUS);
720 /* Nothing to notice */
721 if (!notice) return (FALSE);
724 if (disturb_state) disturb(0, 0);
735 * Set "p_ptr->paralyzed", notice observable changes
737 bool set_paralyzed(int v)
741 /* Hack -- Force good values */
742 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
744 if (p_ptr->is_dead) return FALSE;
749 if (!p_ptr->paralyzed)
752 msg_print("ÂΤ¬Ëãá㤷¤Æ¤·¤Þ¤Ã¤¿¡ª");
754 msg_print("You are paralyzed!");
757 p_ptr->counter = FALSE;
765 if (p_ptr->paralyzed)
768 msg_print("¤ä¤Ã¤ÈÆ°¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
770 msg_print("You can move again.");
778 p_ptr->paralyzed = v;
780 /* Redraw status bar */
781 p_ptr->redraw |= (PR_STATUS);
783 /* Nothing to notice */
784 if (!notice) return (FALSE);
787 if (disturb_state) disturb(0, 0);
789 /* Redraw the state */
790 p_ptr->redraw |= (PR_STATE);
801 * Set "p_ptr->image", notice observable changes
803 * Note that we must redraw the map when hallucination changes.
805 bool set_image(int v)
809 /* Hack -- Force good values */
810 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
812 if (p_ptr->is_dead) return FALSE;
818 set_tsuyoshi(0, TRUE);
822 msg_print("¥ï¡¼¥ª¡ª²¿¤â¤«¤âÆú¿§¤Ë¸«¤¨¤ë¡ª");
824 msg_print("Oh, wow! Everything looks so cosmic now!");
827 p_ptr->counter = FALSE;
838 msg_print("¤ä¤Ã¤È¤Ï¤Ã¤¤ê¤Èʪ¤¬¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
840 msg_print("You can see clearly again.");
850 /* Redraw status bar */
851 p_ptr->redraw |= (PR_STATUS);
853 /* Nothing to notice */
854 if (!notice) return (FALSE);
857 if (disturb_state) disturb(0, 0);
860 p_ptr->redraw |= (PR_MAP);
862 /* Update the health bar */
863 p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH);
865 /* Update monsters */
866 p_ptr->update |= (PU_MONSTERS);
869 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
880 * Set "p_ptr->fast", notice observable changes
882 bool set_fast(int v, bool do_dec)
886 /* Hack -- Force good values */
887 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
889 if (p_ptr->is_dead) return FALSE;
894 if (p_ptr->fast && !do_dec)
896 if (p_ptr->fast > v) return FALSE;
898 else if (!IS_FAST() && !p_ptr->lightspeed)
901 msg_print("ÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
903 msg_print("You feel yourself moving much faster!");
907 chg_virtue(V_PATIENCE, -1);
908 chg_virtue(V_DILIGENCE, 1);
915 if (p_ptr->fast && !p_ptr->lightspeed && !music_singing(MUSIC_SPEED) && !music_singing(MUSIC_SHERO))
918 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
920 msg_print("You feel yourself slow down.");
930 /* Nothing to notice */
931 if (!notice) return (FALSE);
934 if (disturb_state) disturb(0, 0);
936 /* Recalculate bonuses */
937 p_ptr->update |= (PU_BONUS);
948 * Set "p_ptr->lightspeed", notice observable changes
950 bool set_lightspeed(int v, bool do_dec)
954 /* Hack -- Force good values */
955 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
957 if (p_ptr->is_dead) return FALSE;
962 if (p_ptr->lightspeed && !do_dec)
964 if (p_ptr->lightspeed > v) return FALSE;
966 else if (!p_ptr->lightspeed)
969 msg_print("Èó¾ï¤ËÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
971 msg_print("You feel yourself moving extremely faster!");
975 chg_virtue(V_PATIENCE, -1);
976 chg_virtue(V_DILIGENCE, 1);
983 if (p_ptr->lightspeed)
986 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
988 msg_print("You feel yourself slow down.");
996 p_ptr->lightspeed = v;
998 /* Nothing to notice */
999 if (!notice) return (FALSE);
1002 if (disturb_state) disturb(0, 0);
1004 /* Recalculate bonuses */
1005 p_ptr->update |= (PU_BONUS);
1016 * Set "p_ptr->slow", notice observable changes
1018 bool set_slow(int v, bool do_dec)
1020 bool notice = FALSE;
1022 /* Hack -- Force good values */
1023 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1025 if (p_ptr->is_dead) return FALSE;
1030 if (p_ptr->slow && !do_dec)
1032 if (p_ptr->slow > v) return FALSE;
1034 else if (!p_ptr->slow)
1037 msg_print("ÂΤÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
1039 msg_print("You feel yourself moving slower!");
1052 msg_print("Æ°¤¤ÎÃÙ¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1054 msg_print("You feel yourself speed up.");
1064 /* Nothing to notice */
1065 if (!notice) return (FALSE);
1068 if (disturb_state) disturb(0, 0);
1070 /* Recalculate bonuses */
1071 p_ptr->update |= (PU_BONUS);
1082 * Set "p_ptr->shield", notice observable changes
1084 bool set_shield(int v, bool do_dec)
1086 bool notice = FALSE;
1088 /* Hack -- Force good values */
1089 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1091 if (p_ptr->is_dead) return FALSE;
1096 if (p_ptr->shield && !do_dec)
1098 if (p_ptr->shield > v) return FALSE;
1100 else if (!p_ptr->shield)
1103 msg_print("È©¤¬ÀФˤʤä¿¡£");
1105 msg_print("Your skin turns to stone.");
1118 msg_print("È©¤¬¸µ¤ËÌá¤Ã¤¿¡£");
1120 msg_print("Your skin returns to normal.");
1130 /* Redraw status bar */
1131 p_ptr->redraw |= (PR_STATUS);
1133 /* Nothing to notice */
1134 if (!notice) return (FALSE);
1137 if (disturb_state) disturb(0, 0);
1139 /* Recalculate bonuses */
1140 p_ptr->update |= (PU_BONUS);
1152 * Set "p_ptr->tsubureru", notice observable changes
1154 bool set_tsubureru(int v, bool do_dec)
1156 bool notice = FALSE;
1158 /* Hack -- Force good values */
1159 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1161 if (p_ptr->is_dead) return FALSE;
1166 if (p_ptr->tsubureru && !do_dec)
1168 if (p_ptr->tsubureru > v) return FALSE;
1170 else if (!p_ptr->tsubureru)
1173 msg_print("²£¤Ë¿¤Ó¤¿¡£");
1175 msg_print("Your body expands horizontally.");
1185 if (p_ptr->tsubureru)
1188 msg_print("¤â¤¦²£¤Ë¿¤Ó¤Æ¤¤¤Ê¤¤¡£");
1190 msg_print("Your body returns to normal.");
1198 p_ptr->tsubureru = v;
1200 /* Redraw status bar */
1201 p_ptr->redraw |= (PR_STATUS);
1203 /* Nothing to notice */
1204 if (!notice) return (FALSE);
1207 if (disturb_state) disturb(0, 0);
1209 /* Recalculate bonuses */
1210 p_ptr->update |= (PU_BONUS);
1222 * Set "p_ptr->magicdef", notice observable changes
1224 bool set_magicdef(int v, bool do_dec)
1226 bool notice = FALSE;
1228 /* Hack -- Force good values */
1229 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1231 if (p_ptr->is_dead) return FALSE;
1236 if (p_ptr->magicdef && !do_dec)
1238 if (p_ptr->magicdef > v) return FALSE;
1240 else if (!p_ptr->magicdef)
1243 msg_print("ËâË¡¤ÎËɸæÎϤ¬Áý¤·¤¿¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1245 msg_print("You feel more resistant to magic.");
1255 if (p_ptr->magicdef)
1258 msg_print("ËâË¡¤ÎËɸæÎϤ¬¸µ¤ËÌá¤Ã¤¿¡£");
1260 msg_print("You feel less resistant to magic.");
1268 p_ptr->magicdef = v;
1270 /* Redraw status bar */
1271 p_ptr->redraw |= (PR_STATUS);
1273 /* Nothing to notice */
1274 if (!notice) return (FALSE);
1277 if (disturb_state) disturb(0, 0);
1279 /* Recalculate bonuses */
1280 p_ptr->update |= (PU_BONUS);
1292 * Set "p_ptr->blessed", notice observable changes
1294 bool set_blessed(int v, bool do_dec)
1296 bool notice = FALSE;
1298 /* Hack -- Force good values */
1299 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1301 if (p_ptr->is_dead) return FALSE;
1306 if (p_ptr->blessed && !do_dec)
1308 if (p_ptr->blessed > v) return FALSE;
1310 else if (!IS_BLESSED())
1313 msg_print("¹â·é¤Êµ¤Ê¬¤Ë¤Ê¤Ã¤¿¡ª");
1315 msg_print("You feel righteous!");
1325 if (p_ptr->blessed && !music_singing(MUSIC_BLESS))
1328 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1330 msg_print("The prayer has expired.");
1340 /* Redraw status bar */
1341 p_ptr->redraw |= (PR_STATUS);
1343 /* Nothing to notice */
1344 if (!notice) return (FALSE);
1347 if (disturb_state) disturb(0, 0);
1349 /* Recalculate bonuses */
1350 p_ptr->update |= (PU_BONUS);
1361 * Set "p_ptr->hero", notice observable changes
1363 bool set_hero(int v, bool do_dec)
1365 bool notice = FALSE;
1367 /* Hack -- Force good values */
1368 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1370 if (p_ptr->is_dead) return FALSE;
1375 if (p_ptr->hero && !do_dec)
1377 if (p_ptr->hero > v) return FALSE;
1379 else if (!IS_HERO())
1382 msg_print("¥Ò¡¼¥í¡¼¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1384 msg_print("You feel like a hero!");
1394 if (p_ptr->hero && !music_singing(MUSIC_HERO) && !music_singing(MUSIC_SHERO))
1397 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1399 msg_print("The heroism wears off.");
1409 /* Redraw status bar */
1410 p_ptr->redraw |= (PR_STATUS);
1412 /* Nothing to notice */
1413 if (!notice) return (FALSE);
1416 if (disturb_state) disturb(0, 0);
1418 /* Recalculate bonuses */
1419 p_ptr->update |= (PU_BONUS);
1421 /* Recalculate hitpoints */
1422 p_ptr->update |= (PU_HP);
1433 * Set "p_ptr->shero", notice observable changes
1435 bool set_shero(int v, bool do_dec)
1437 bool notice = FALSE;
1439 /* Hack -- Force good values */
1440 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1442 if (p_ptr->is_dead) return FALSE;
1444 if (p_ptr->pclass == CLASS_BERSERKER) v = 1;
1448 if (p_ptr->shero && !do_dec)
1450 if (p_ptr->shero > v) return FALSE;
1452 else if (!p_ptr->shero)
1455 msg_print("»¦Ù¤¥Þ¥·¡¼¥ó¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1457 msg_print("You feel like a killing machine!");
1470 msg_print("ÌîÈڤʵ¤»ý¤Á¤¬¾Ã¤¨¼º¤»¤¿¡£");
1472 msg_print("You feel less Berserk.");
1482 /* Redraw status bar */
1483 p_ptr->redraw |= (PR_STATUS);
1485 /* Nothing to notice */
1486 if (!notice) return (FALSE);
1489 if (disturb_state) disturb(0, 0);
1491 /* Recalculate bonuses */
1492 p_ptr->update |= (PU_BONUS);
1494 /* Recalculate hitpoints */
1495 p_ptr->update |= (PU_HP);
1506 * Set "p_ptr->protevil", notice observable changes
1508 bool set_protevil(int v, bool do_dec)
1510 bool notice = FALSE;
1512 /* Hack -- Force good values */
1513 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1515 if (p_ptr->is_dead) return FALSE;
1520 if (p_ptr->protevil && !do_dec)
1522 if (p_ptr->protevil > v) return FALSE;
1524 else if (!p_ptr->protevil)
1527 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Ê´¶¤¸¤¬¤¹¤ë¡ª");
1529 msg_print("You feel safe from evil!");
1539 if (p_ptr->protevil)
1542 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1544 msg_print("You no longer feel safe from evil.");
1552 p_ptr->protevil = v;
1554 /* Redraw status bar */
1555 p_ptr->redraw |= (PR_STATUS);
1557 /* Nothing to notice */
1558 if (!notice) return (FALSE);
1561 if (disturb_state) disturb(0, 0);
1571 * Set "p_ptr->wraith_form", notice observable changes
1573 bool set_wraith_form(int v, bool do_dec)
1575 bool notice = FALSE;
1577 /* Hack -- Force good values */
1578 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1580 if (p_ptr->is_dead) return FALSE;
1585 if (p_ptr->wraith_form && !do_dec)
1587 if (p_ptr->wraith_form > v) return FALSE;
1589 else if (!p_ptr->wraith_form)
1592 msg_print("ʪ¼Á³¦¤òÎ¥¤ì¤ÆÍ©µ´¤Î¤è¤¦¤Ê¸ºß¤Ë¤Ê¤Ã¤¿¡ª");
1594 msg_print("You leave the physical world and turn into a wraith-being!");
1599 chg_virtue(V_UNLIFE, 3);
1600 chg_virtue(V_HONOUR, -2);
1601 chg_virtue(V_SACRIFICE, -2);
1602 chg_virtue(V_VALOUR, -5);
1605 p_ptr->redraw |= (PR_MAP);
1607 /* Update monsters */
1608 p_ptr->update |= (PU_MONSTERS);
1611 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1618 if (p_ptr->wraith_form)
1621 msg_print("ÉÔÆ©ÌÀ¤Ë¤Ê¤Ã¤¿´¶¤¸¤¬¤¹¤ë¡£");
1623 msg_print("You feel opaque.");
1629 p_ptr->redraw |= (PR_MAP);
1631 /* Update monsters */
1632 p_ptr->update |= (PU_MONSTERS);
1635 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1640 p_ptr->wraith_form = v;
1642 /* Redraw status bar */
1643 p_ptr->redraw |= (PR_STATUS);
1645 /* Nothing to notice */
1646 if (!notice) return (FALSE);
1649 if (disturb_state) disturb(0, 0);
1651 /* Recalculate bonuses */
1652 p_ptr->update |= (PU_BONUS);
1664 * Set "p_ptr->invuln", notice observable changes
1666 bool set_invuln(int v, bool do_dec)
1668 bool notice = FALSE;
1670 /* Hack -- Force good values */
1671 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1673 if (p_ptr->is_dead) return FALSE;
1678 if (p_ptr->invuln && !do_dec)
1680 if (p_ptr->invuln > v) return FALSE;
1682 else if (!IS_INVULN())
1685 msg_print("̵Ũ¤À¡ª");
1687 msg_print("Invulnerability!");
1692 chg_virtue(V_UNLIFE, -2);
1693 chg_virtue(V_HONOUR, -2);
1694 chg_virtue(V_SACRIFICE, -3);
1695 chg_virtue(V_VALOUR, -5);
1698 p_ptr->redraw |= (PR_MAP);
1700 /* Update monsters */
1701 p_ptr->update |= (PU_MONSTERS);
1704 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1711 if (p_ptr->invuln && !music_singing(MUSIC_INVULN))
1714 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
1716 msg_print("The invulnerability wears off.");
1722 p_ptr->redraw |= (PR_MAP);
1724 /* Update monsters */
1725 p_ptr->update |= (PU_MONSTERS);
1728 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1730 p_ptr->energy_need += ENERGY_NEED();
1737 /* Redraw status bar */
1738 p_ptr->redraw |= (PR_STATUS);
1740 /* Nothing to notice */
1741 if (!notice) return (FALSE);
1744 if (disturb_state) disturb(0, 0);
1746 /* Recalculate bonuses */
1747 p_ptr->update |= (PU_BONUS);
1758 * Set "p_ptr->tim_esp", notice observable changes
1760 bool set_tim_esp(int v, bool do_dec)
1762 bool notice = FALSE;
1764 /* Hack -- Force good values */
1765 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1767 if (p_ptr->is_dead) return FALSE;
1772 if (p_ptr->tim_esp && !do_dec)
1774 if (p_ptr->tim_esp > v) return FALSE;
1776 else if (!IS_TIM_ESP())
1779 msg_print("°Õ¼±¤¬¹¤¬¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1781 msg_print("You feel your consciousness expand!");
1791 if (p_ptr->tim_esp && !music_singing(MUSIC_MIND))
1794 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
1796 msg_print("Your consciousness contracts again.");
1806 /* Redraw status bar */
1807 p_ptr->redraw |= (PR_STATUS);
1809 /* Nothing to notice */
1810 if (!notice) return (FALSE);
1813 if (disturb_state) disturb(0, 0);
1815 /* Recalculate bonuses */
1816 p_ptr->update |= (PU_BONUS);
1818 /* Update the monsters */
1819 p_ptr->update |= (PU_MONSTERS);
1830 * Set "p_ptr->tim_invis", notice observable changes
1832 bool set_tim_invis(int v, bool do_dec)
1834 bool notice = FALSE;
1836 /* Hack -- Force good values */
1837 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1839 if (p_ptr->is_dead) return FALSE;
1844 if (p_ptr->tim_invis && !do_dec)
1846 if (p_ptr->tim_invis > v) return FALSE;
1848 else if (!p_ptr->tim_invis)
1851 msg_print("Ìܤ¬Èó¾ï¤ËÉÒ´¶¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1853 msg_print("Your eyes feel very sensitive!");
1863 if (p_ptr->tim_invis)
1866 msg_print("ÌܤÎÉÒ´¶¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1868 msg_print("Your eyes feel less sensitive.");
1876 p_ptr->tim_invis = v;
1878 /* Redraw status bar */
1879 p_ptr->redraw |= (PR_STATUS);
1881 /* Nothing to notice */
1882 if (!notice) return (FALSE);
1885 if (disturb_state) disturb(0, 0);
1887 /* Recalculate bonuses */
1888 p_ptr->update |= (PU_BONUS);
1890 /* Update the monsters */
1891 p_ptr->update |= (PU_MONSTERS);
1902 * Set "p_ptr->tim_infra", notice observable changes
1904 bool set_tim_infra(int v, bool do_dec)
1906 bool notice = FALSE;
1908 /* Hack -- Force good values */
1909 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1911 if (p_ptr->is_dead) return FALSE;
1916 if (p_ptr->tim_infra && !do_dec)
1918 if (p_ptr->tim_infra > v) return FALSE;
1920 else if (!p_ptr->tim_infra)
1923 msg_print("Ìܤ¬¥é¥ó¥é¥ó¤Èµ±¤»Ï¤á¤¿¡ª");
1925 msg_print("Your eyes begin to tingle!");
1935 if (p_ptr->tim_infra)
1938 msg_print("Ìܤ層¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1940 msg_print("Your eyes stop tingling.");
1948 p_ptr->tim_infra = v;
1950 /* Redraw status bar */
1951 p_ptr->redraw |= (PR_STATUS);
1953 /* Nothing to notice */
1954 if (!notice) return (FALSE);
1957 if (disturb_state) disturb(0, 0);
1959 /* Recalculate bonuses */
1960 p_ptr->update |= (PU_BONUS);
1962 /* Update the monsters */
1963 p_ptr->update |= (PU_MONSTERS);
1974 * Set "p_ptr->tim_regen", notice observable changes
1976 bool set_tim_regen(int v, bool do_dec)
1978 bool notice = FALSE;
1980 /* Hack -- Force good values */
1981 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1983 if (p_ptr->is_dead) return FALSE;
1988 if (p_ptr->tim_regen && !do_dec)
1990 if (p_ptr->tim_regen > v) return FALSE;
1992 else if (!p_ptr->tim_regen)
1995 msg_print("²óÉüÎϤ¬¾å¤¬¤Ã¤¿¡ª");
1997 msg_print("You feel yourself regenerating quickly!");
2007 if (p_ptr->tim_regen)
2010 msg_print("ÁÇÁ᤯²óÉü¤¹¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
2012 msg_print("You feel yourself regenerating slowly.");
2020 p_ptr->tim_regen = v;
2022 /* Redraw status bar */
2023 p_ptr->redraw |= (PR_STATUS);
2025 /* Nothing to notice */
2026 if (!notice) return (FALSE);
2029 if (disturb_state) disturb(0, 0);
2031 /* Recalculate bonuses */
2032 p_ptr->update |= (PU_BONUS);
2043 * Set "p_ptr->tim_stealth", notice observable changes
2045 bool set_tim_stealth(int v, bool do_dec)
2047 bool notice = FALSE;
2049 /* Hack -- Force good values */
2050 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2052 if (p_ptr->is_dead) return FALSE;
2057 if (p_ptr->tim_stealth && !do_dec)
2059 if (p_ptr->tim_stealth > v) return FALSE;
2061 else if (!IS_TIM_STEALTH())
2064 msg_print("²»¤¬¾®¤µ¤¯¤Ê¤Ã¤¿¡ª");
2066 msg_print("You begin to walk silently!");
2076 if (p_ptr->tim_stealth && !music_singing(MUSIC_STEALTH))
2079 msg_print("²»¤¬Â礤¯¤Ê¤Ã¤¿¡£");
2081 msg_print("You no longer walk silently.");
2089 p_ptr->tim_stealth = v;
2091 /* Redraw status bar */
2092 p_ptr->redraw |= (PR_STATUS);
2094 /* Nothing to notice */
2095 if (!notice) return (FALSE);
2098 if (disturb_state) disturb(0, 0);
2100 /* Recalculate bonuses */
2101 p_ptr->update |= (PU_BONUS);
2111 bool set_superstealth(bool set)
2113 bool notice = FALSE;
2115 if (p_ptr->is_dead) return FALSE;
2120 if (!(p_ptr->special_defense & NINJA_S_STEALTH))
2122 if (cave[py][px].info & CAVE_MNLT)
2125 msg_print("Ũ¤ÎÌܤ«¤éÇö¤¤±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡£");
2127 msg_print("You are mantled in weak shadow from ordinary eyes.");
2129 p_ptr->monlite = p_ptr->old_monlite = TRUE;
2134 msg_print("Ũ¤ÎÌܤ«¤é±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡ª");
2136 msg_print("You are mantled in shadow from ordinary eyes!");
2138 p_ptr->monlite = p_ptr->old_monlite = FALSE;
2144 p_ptr->special_defense |= NINJA_S_STEALTH;
2151 if (p_ptr->special_defense & NINJA_S_STEALTH)
2154 msg_print("ºÆ¤ÓŨ¤ÎÌܤˤµ¤é¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
2156 msg_print("You are exposed to common sight once more.");
2162 p_ptr->special_defense &= ~(NINJA_S_STEALTH);
2166 /* Nothing to notice */
2167 if (!notice) return (FALSE);
2169 /* Redraw status bar */
2170 p_ptr->redraw |= (PR_STATUS);
2173 if (disturb_state) disturb(0, 0);
2181 * Set "p_ptr->tim_levitation", notice observable changes
2183 bool set_tim_levitation(int v, bool do_dec)
2185 bool notice = FALSE;
2187 /* Hack -- Force good values */
2188 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2190 if (p_ptr->is_dead) return FALSE;
2195 if (p_ptr->tim_levitation && !do_dec)
2197 if (p_ptr->tim_levitation > v) return FALSE;
2199 else if (!p_ptr->tim_levitation)
2202 msg_print("ÂΤ¬Ãè¤ËÉ⤻Ϥ᤿¡£");
2204 msg_print("You begin to fly!");
2214 if (p_ptr->tim_levitation)
2217 msg_print("¤â¤¦Ãè¤ËÉ⤫¤Ù¤Ê¤¯¤Ê¤Ã¤¿¡£");
2219 msg_print("You stop flying.");
2227 p_ptr->tim_levitation = v;
2229 /* Redraw status bar */
2230 p_ptr->redraw |= (PR_STATUS);
2232 /* Nothing to notice */
2233 if (!notice) return (FALSE);
2236 if (disturb_state) disturb(0, 0);
2238 /* Recalculate bonuses */
2239 p_ptr->update |= (PU_BONUS);
2250 * Set "p_ptr->tim_sh_touki", notice observable changes
2252 bool set_tim_sh_touki(int v, bool do_dec)
2254 bool notice = FALSE;
2256 /* Hack -- Force good values */
2257 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2259 if (p_ptr->is_dead) return FALSE;
2264 if (p_ptr->tim_sh_touki && !do_dec)
2266 if (p_ptr->tim_sh_touki > v) return FALSE;
2268 else if (!p_ptr->tim_sh_touki)
2271 msg_print("ÂΤ¬Æ®µ¤¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2273 msg_print("You have enveloped by the aura of the Force!");
2283 if (p_ptr->tim_sh_touki)
2286 msg_print("Æ®µ¤¤¬¾Ã¤¨¤¿¡£");
2288 msg_print("Aura of the Force disappeared.");
2296 p_ptr->tim_sh_touki = v;
2298 /* Redraw status bar */
2299 p_ptr->redraw |= (PR_STATUS);
2301 /* Nothing to notice */
2302 if (!notice) return (FALSE);
2305 if (disturb_state) disturb(0, 0);
2316 * Set "p_ptr->tim_sh_fire", notice observable changes
2318 bool set_tim_sh_fire(int v, bool do_dec)
2320 bool notice = FALSE;
2322 /* Hack -- Force good values */
2323 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2325 if (p_ptr->is_dead) return FALSE;
2330 if (p_ptr->tim_sh_fire && !do_dec)
2332 if (p_ptr->tim_sh_fire > v) return FALSE;
2334 else if (!p_ptr->tim_sh_fire)
2337 msg_print("ÂΤ¬±ê¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2339 msg_print("You have enveloped by fiery aura!");
2349 if (p_ptr->tim_sh_fire)
2352 msg_print("±ê¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2354 msg_print("Fiery aura disappeared.");
2362 p_ptr->tim_sh_fire = v;
2364 /* Redraw status bar */
2365 p_ptr->redraw |= (PR_STATUS);
2367 /* Nothing to notice */
2368 if (!notice) return (FALSE);
2371 if (disturb_state) disturb(0, 0);
2373 /* Recalculate bonuses */
2374 p_ptr->update |= (PU_BONUS);
2385 * Set "p_ptr->tim_sh_holy", notice observable changes
2387 bool set_tim_sh_holy(int v, bool do_dec)
2389 bool notice = FALSE;
2391 /* Hack -- Force good values */
2392 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2394 if (p_ptr->is_dead) return FALSE;
2399 if (p_ptr->tim_sh_holy && !do_dec)
2401 if (p_ptr->tim_sh_holy > v) return FALSE;
2403 else if (!p_ptr->tim_sh_holy)
2406 msg_print("ÂΤ¬À»¤Ê¤ë¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2408 msg_print("You have enveloped by holy aura!");
2418 if (p_ptr->tim_sh_holy)
2421 msg_print("À»¤Ê¤ë¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2423 msg_print("Holy aura disappeared.");
2431 p_ptr->tim_sh_holy = v;
2433 /* Redraw status bar */
2434 p_ptr->redraw |= (PR_STATUS);
2436 /* Nothing to notice */
2437 if (!notice) return (FALSE);
2440 if (disturb_state) disturb(0, 0);
2442 /* Recalculate bonuses */
2443 p_ptr->update |= (PU_BONUS);
2455 * Set "p_ptr->tim_eyeeye", notice observable changes
2457 bool set_tim_eyeeye(int v, bool do_dec)
2459 bool notice = FALSE;
2461 /* Hack -- Force good values */
2462 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2464 if (p_ptr->is_dead) return FALSE;
2469 if (p_ptr->tim_eyeeye && !do_dec)
2471 if (p_ptr->tim_eyeeye > v) return FALSE;
2473 else if (!p_ptr->tim_eyeeye)
2476 msg_print("Ë¡¤Î¼é¤ê¼ê¤Ë¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¡ª");
2478 msg_print("You feel like a keeper of commandments!");
2488 if (p_ptr->tim_eyeeye)
2491 msg_print("Ĩȳ¤ò¼¹¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2493 msg_print("You no longer feel like a keeper.");
2501 p_ptr->tim_eyeeye = v;
2503 /* Redraw status bar */
2504 p_ptr->redraw |= (PR_STATUS);
2506 /* Nothing to notice */
2507 if (!notice) return (FALSE);
2510 if (disturb_state) disturb(0, 0);
2512 /* Recalculate bonuses */
2513 p_ptr->update |= (PU_BONUS);
2525 * Set "p_ptr->resist_magic", notice observable changes
2527 bool set_resist_magic(int v, bool do_dec)
2529 bool notice = FALSE;
2531 /* Hack -- Force good values */
2532 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2534 if (p_ptr->is_dead) return FALSE;
2539 if (p_ptr->resist_magic && !do_dec)
2541 if (p_ptr->resist_magic > v) return FALSE;
2543 else if (!p_ptr->resist_magic)
2546 msg_print("ËâË¡¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿¡£");
2548 msg_print("You have been protected from magic!");
2558 if (p_ptr->resist_magic)
2561 msg_print("ËâË¡¤Ë¼å¤¯¤Ê¤Ã¤¿¡£");
2563 msg_print("You are no longer protected from magic.");
2571 p_ptr->resist_magic = v;
2573 /* Redraw status bar */
2574 p_ptr->redraw |= (PR_STATUS);
2576 /* Nothing to notice */
2577 if (!notice) return (FALSE);
2580 if (disturb_state) disturb(0, 0);
2582 /* Recalculate bonuses */
2583 p_ptr->update |= (PU_BONUS);
2594 * Set "p_ptr->tim_reflect", notice observable changes
2596 bool set_tim_reflect(int v, bool do_dec)
2598 bool notice = FALSE;
2600 /* Hack -- Force good values */
2601 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2603 if (p_ptr->is_dead) return FALSE;
2608 if (p_ptr->tim_reflect && !do_dec)
2610 if (p_ptr->tim_reflect > v) return FALSE;
2612 else if (!p_ptr->tim_reflect)
2615 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2617 msg_print("Your body becames smooth.");
2627 if (p_ptr->tim_reflect)
2630 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ç¤Ê¤¯¤Ê¤Ã¤¿¡£");
2632 msg_print("Your body is no longer smooth.");
2640 p_ptr->tim_reflect = v;
2642 /* Redraw status bar */
2643 p_ptr->redraw |= (PR_STATUS);
2645 /* Nothing to notice */
2646 if (!notice) return (FALSE);
2649 if (disturb_state) disturb(0, 0);
2651 /* Recalculate bonuses */
2652 p_ptr->update |= (PU_BONUS);
2663 * Set "p_ptr->multishadow", notice observable changes
2665 bool set_multishadow(int v, bool do_dec)
2667 bool notice = FALSE;
2669 /* Hack -- Force good values */
2670 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2672 if (p_ptr->is_dead) return FALSE;
2677 if (p_ptr->multishadow && !do_dec)
2679 if (p_ptr->multishadow > v) return FALSE;
2681 else if (!p_ptr->multishadow)
2684 msg_print("¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¸¸±Æ¤¬À¸¤Þ¤ì¤¿¡£");
2686 msg_print("Your Shadow enveloped you.");
2696 if (p_ptr->multishadow)
2699 msg_print("¸¸±Æ¤¬¾Ã¤¨¤¿¡£");
2701 msg_print("Your Shadow disappears.");
2709 p_ptr->multishadow = v;
2711 /* Redraw status bar */
2712 p_ptr->redraw |= (PR_STATUS);
2714 /* Nothing to notice */
2715 if (!notice) return (FALSE);
2718 if (disturb_state) disturb(0, 0);
2720 /* Recalculate bonuses */
2721 p_ptr->update |= (PU_BONUS);
2732 * Set "p_ptr->dustrobe", notice observable changes
2734 bool set_dustrobe(int v, bool do_dec)
2736 bool notice = FALSE;
2738 /* Hack -- Force good values */
2739 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2741 if (p_ptr->is_dead) return FALSE;
2746 if (p_ptr->dustrobe && !do_dec)
2748 if (p_ptr->dustrobe > v) return FALSE;
2750 else if (!p_ptr->dustrobe)
2753 msg_print("ÂΤ¬¶À¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2755 msg_print("You were enveloped by mirror shards.");
2765 if (p_ptr->dustrobe)
2768 msg_print("¶À¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2770 msg_print("The mirror shards disappear.");
2778 p_ptr->dustrobe = v;
2780 /* Redraw status bar */
2781 p_ptr->redraw |= (PR_STATUS);
2783 /* Nothing to notice */
2784 if (!notice) return (FALSE);
2787 if (disturb_state) disturb(0, 0);
2789 /* Recalculate bonuses */
2790 p_ptr->update |= (PU_BONUS);
2801 * Set "p_ptr->tim_regen", notice observable changes
2803 bool set_kabenuke(int v, bool do_dec)
2805 bool notice = FALSE;
2807 /* Hack -- Force good values */
2808 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2810 if (p_ptr->is_dead) return FALSE;
2815 if (p_ptr->kabenuke && !do_dec)
2817 if (p_ptr->kabenuke > v) return FALSE;
2819 else if (!p_ptr->kabenuke)
2822 msg_print("ÂΤ¬È¾Êª¼Á¤Î¾õÂ֤ˤʤä¿¡£");
2824 msg_print("You became ethereal form.");
2834 if (p_ptr->kabenuke)
2837 msg_print("ÂΤ¬Êª¼Á²½¤·¤¿¡£");
2839 msg_print("You are no longer in an ethereal form.");
2847 p_ptr->kabenuke = v;
2849 /* Redraw status bar */
2850 p_ptr->redraw |= (PR_STATUS);
2852 /* Nothing to notice */
2853 if (!notice) return (FALSE);
2856 if (disturb_state) disturb(0, 0);
2858 /* Recalculate bonuses */
2859 p_ptr->update |= (PU_BONUS);
2869 bool set_tsuyoshi(int v, bool do_dec)
2871 bool notice = FALSE;
2873 /* Hack -- Force good values */
2874 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2876 if (p_ptr->is_dead) return FALSE;
2881 if (p_ptr->tsuyoshi && !do_dec)
2883 if (p_ptr->tsuyoshi > v) return FALSE;
2885 else if (!p_ptr->tsuyoshi)
2888 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
2890 msg_print("Brother OKURE!");
2894 chg_virtue(V_VITALITY, 2);
2901 if (p_ptr->tsuyoshi)
2904 msg_print("ÆùÂΤ¬µÞ®¤Ë¤·¤Ü¤ó¤Ç¤¤¤Ã¤¿¡£");
2906 msg_print("Your body had quickly shriveled.");
2909 (void)dec_stat(A_CON, 20, TRUE);
2910 (void)dec_stat(A_STR, 20, TRUE);
2913 chg_virtue(V_VITALITY, -3);
2918 p_ptr->tsuyoshi = v;
2920 /* Redraw status bar */
2921 p_ptr->redraw |= (PR_STATUS);
2923 /* Nothing to notice */
2924 if (!notice) return (FALSE);
2927 if (disturb_state) disturb(0, 0);
2929 /* Recalculate bonuses */
2930 p_ptr->update |= (PU_BONUS);
2932 /* Recalculate hitpoints */
2933 p_ptr->update |= (PU_HP);
2944 * Set a temporary elemental brand. Clear all other brands. Print status
2947 bool set_ele_attack(u32b attack_type, int v)
2949 /* Hack -- Force good values */
2950 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2952 /* Clear all elemental attacks (only one is allowed at a time). */
2953 if ((p_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
2955 p_ptr->special_attack &= ~(ATTACK_ACID);
2957 msg_print("»À¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2959 msg_print("Your temporary acidic brand fades away.");
2962 if ((p_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
2964 p_ptr->special_attack &= ~(ATTACK_ELEC);
2966 msg_print("ÅÅ·â¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2968 msg_print("Your temporary electrical brand fades away.");
2971 if ((p_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
2973 p_ptr->special_attack &= ~(ATTACK_FIRE);
2975 msg_print("²Ð±ê¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2977 msg_print("Your temporary fiery brand fades away.");
2980 if ((p_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
2982 p_ptr->special_attack &= ~(ATTACK_COLD);
2984 msg_print("Î䵤¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2986 msg_print("Your temporary frost brand fades away.");
2989 if ((p_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
2991 p_ptr->special_attack &= ~(ATTACK_POIS);
2993 msg_print("ÆǤǹ¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2995 msg_print("Your temporary poison brand fades away.");
2999 if ((v) && (attack_type))
3001 /* Set attack type. */
3002 p_ptr->special_attack |= (attack_type);
3005 p_ptr->ele_attack = v;
3009 msg_format("%s¤Ç¹¶·â¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª",
3010 ((attack_type == ATTACK_ACID) ? "»À" :
3011 ((attack_type == ATTACK_ELEC) ? "ÅÅ·â" :
3012 ((attack_type == ATTACK_FIRE) ? "²Ð±ê" :
3013 ((attack_type == ATTACK_COLD) ? "Î䵤" :
3014 ((attack_type == ATTACK_POIS) ? "ÆÇ" :
3017 msg_format("For a while, the blows you deal will %s",
3018 ((attack_type == ATTACK_ACID) ? "melt with acid!" :
3019 ((attack_type == ATTACK_ELEC) ? "shock your foes!" :
3020 ((attack_type == ATTACK_FIRE) ? "burn with fire!" :
3021 ((attack_type == ATTACK_COLD) ? "chill to the bone!" :
3022 ((attack_type == ATTACK_POIS) ? "poison your enemies!" :
3023 "do nothing special."))))));
3028 if (disturb_state) disturb(0, 0);
3030 /* Redraw status bar */
3031 p_ptr->redraw |= (PR_STATUS);
3033 p_ptr->update |= (PU_BONUS);
3043 * Set a temporary elemental brand. Clear all other brands. Print status
3046 bool set_ele_immune(u32b immune_type, int v)
3048 /* Hack -- Force good values */
3049 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3051 /* Clear all elemental attacks (only one is allowed at a time). */
3052 if ((p_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
3054 p_ptr->special_defense &= ~(DEFENSE_ACID);
3056 msg_print("»À¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3058 msg_print("You are no longer immune to acid.");
3061 if ((p_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
3063 p_ptr->special_defense &= ~(DEFENSE_ELEC);
3065 msg_print("ÅÅ·â¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3067 msg_print("You are no longer immune to electricity.");
3070 if ((p_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
3072 p_ptr->special_defense &= ~(DEFENSE_FIRE);
3074 msg_print("²Ð±ê¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3076 msg_print("You are no longer immune to fire.");
3079 if ((p_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
3081 p_ptr->special_defense &= ~(DEFENSE_COLD);
3083 msg_print("Î䵤¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3085 msg_print("You are no longer immune to cold.");
3088 if ((p_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
3090 p_ptr->special_defense &= ~(DEFENSE_POIS);
3092 msg_print("ÆǤι¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3094 msg_print("You are no longer immune to poison.");
3098 if ((v) && (immune_type))
3100 /* Set attack type. */
3101 p_ptr->special_defense |= (immune_type);
3104 p_ptr->ele_immune = v;
3108 msg_format("%s¤Î¹¶·â¤ò¼õ¤±¤Ä¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª",
3109 ((immune_type == DEFENSE_ACID) ? "»À" :
3110 ((immune_type == DEFENSE_ELEC) ? "ÅÅ·â" :
3111 ((immune_type == DEFENSE_FIRE) ? "²Ð±ê" :
3112 ((immune_type == DEFENSE_COLD) ? "Î䵤" :
3113 ((immune_type == DEFENSE_POIS) ? "ÆÇ" :
3116 msg_format("For a while, You are immune to %s",
3117 ((immune_type == DEFENSE_ACID) ? "acid!" :
3118 ((immune_type == DEFENSE_ELEC) ? "electricity!" :
3119 ((immune_type == DEFENSE_FIRE) ? "fire!" :
3120 ((immune_type == DEFENSE_COLD) ? "cold!" :
3121 ((immune_type == DEFENSE_POIS) ? "poison!" :
3122 "do nothing special."))))));
3127 if (disturb_state) disturb(0, 0);
3129 /* Redraw status bar */
3130 p_ptr->redraw |= (PR_STATUS);
3132 p_ptr->update |= (PU_BONUS);
3142 * Set "p_ptr->oppose_acid", notice observable changes
3144 bool set_oppose_acid(int v, bool do_dec)
3146 bool notice = FALSE;
3148 /* Hack -- Force good values */
3149 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3151 if (p_ptr->is_dead) return FALSE;
3156 if (p_ptr->oppose_acid && !do_dec)
3158 if (p_ptr->oppose_acid > v) return FALSE;
3160 else if (!IS_OPPOSE_ACID())
3163 msg_print("»À¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3165 msg_print("You feel resistant to acid!");
3175 if (p_ptr->oppose_acid && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3178 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3180 msg_print("You feel less resistant to acid.");
3188 p_ptr->oppose_acid = v;
3190 /* Nothing to notice */
3191 if (!notice) return (FALSE);
3193 /* Redraw status bar */
3194 p_ptr->redraw |= (PR_STATUS);
3197 if (disturb_state) disturb(0, 0);
3208 * Set "p_ptr->oppose_elec", notice observable changes
3210 bool set_oppose_elec(int v, bool do_dec)
3212 bool notice = FALSE;
3214 /* Hack -- Force good values */
3215 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3217 if (p_ptr->is_dead) return FALSE;
3222 if (p_ptr->oppose_elec && !do_dec)
3224 if (p_ptr->oppose_elec > v) return FALSE;
3226 else if (!IS_OPPOSE_ELEC())
3229 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3231 msg_print("You feel resistant to electricity!");
3241 if (p_ptr->oppose_elec && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3244 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3246 msg_print("You feel less resistant to electricity.");
3254 p_ptr->oppose_elec = v;
3256 /* Nothing to notice */
3257 if (!notice) return (FALSE);
3259 /* Redraw status bar */
3260 p_ptr->redraw |= (PR_STATUS);
3263 if (disturb_state) disturb(0, 0);
3274 * Set "p_ptr->oppose_fire", notice observable changes
3276 bool set_oppose_fire(int v, bool do_dec)
3278 bool notice = FALSE;
3280 /* Hack -- Force good values */
3281 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3283 if (p_ptr->is_dead) return FALSE;
3285 if ((prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
3289 if (p_ptr->oppose_fire && !do_dec)
3291 if (p_ptr->oppose_fire > v) return FALSE;
3293 else if (!IS_OPPOSE_FIRE())
3296 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3298 msg_print("You feel resistant to fire!");
3308 if (p_ptr->oppose_fire && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3311 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3313 msg_print("You feel less resistant to fire.");
3321 p_ptr->oppose_fire = v;
3323 /* Nothing to notice */
3324 if (!notice) return (FALSE);
3326 /* Redraw status bar */
3327 p_ptr->redraw |= (PR_STATUS);
3330 if (disturb_state) disturb(0, 0);
3341 * Set "p_ptr->oppose_cold", notice observable changes
3343 bool set_oppose_cold(int v, bool do_dec)
3345 bool notice = FALSE;
3347 /* Hack -- Force good values */
3348 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3350 if (p_ptr->is_dead) return FALSE;
3355 if (p_ptr->oppose_cold && !do_dec)
3357 if (p_ptr->oppose_cold > v) return FALSE;
3359 else if (!IS_OPPOSE_COLD())
3362 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3364 msg_print("You feel resistant to cold!");
3374 if (p_ptr->oppose_cold && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3377 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3379 msg_print("You feel less resistant to cold.");
3387 p_ptr->oppose_cold = v;
3389 /* Nothing to notice */
3390 if (!notice) return (FALSE);
3392 /* Redraw status bar */
3393 p_ptr->redraw |= (PR_STATUS);
3396 if (disturb_state) disturb(0, 0);
3407 * Set "p_ptr->oppose_pois", notice observable changes
3409 bool set_oppose_pois(int v, bool do_dec)
3411 bool notice = FALSE;
3413 /* Hack -- Force good values */
3414 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3416 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) v = 1;
3417 if (p_ptr->is_dead) return FALSE;
3422 if (p_ptr->oppose_pois && !do_dec)
3424 if (p_ptr->oppose_pois > v) return FALSE;
3426 else if (!IS_OPPOSE_POIS())
3429 msg_print("ÆǤؤÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3431 msg_print("You feel resistant to poison!");
3441 if (p_ptr->oppose_pois && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3444 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3446 msg_print("You feel less resistant to poison.");
3454 p_ptr->oppose_pois = v;
3456 /* Nothing to notice */
3457 if (!notice) return (FALSE);
3459 /* Redraw status bar */
3460 p_ptr->redraw |= (PR_STATUS);
3463 if (disturb_state) disturb(0, 0);
3474 * Set "p_ptr->stun", notice observable changes
3476 * Note the special code to only notice "range" changes.
3478 bool set_stun(int v)
3480 int old_aux, new_aux;
3481 bool notice = FALSE;
3484 /* Hack -- Force good values */
3485 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3487 if (p_ptr->is_dead) return FALSE;
3489 if (prace_is_(RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
3492 if (p_ptr->stun > 100)
3498 else if (p_ptr->stun > 50)
3504 else if (p_ptr->stun > 0)
3540 if (new_aux > old_aux)
3542 /* Describe the state */
3548 msg_print("°Õ¼±¤¬¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3550 msg_print("You have been stunned.");
3558 msg_print("°Õ¼±¤¬¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3560 msg_print("You have been heavily stunned.");
3568 msg_print("Ƭ¤¬¥¯¥é¥¯¥é¤·¤Æ°Õ¼±¤¬±ó¤Î¤¤¤Æ¤¤¿¡£");
3570 msg_print("You have been knocked out.");
3576 if (randint1(1000) < v || one_in_(16))
3579 msg_print("³ä¤ì¤ë¤è¤¦¤ÊƬÄˤ¬¤¹¤ë¡£");
3581 msg_print("A vicious blow hits your head.");
3586 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3587 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3589 else if (one_in_(2))
3591 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3595 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3598 if (p_ptr->special_defense & KATA_MASK)
3601 msg_print("·¿¤¬Êø¤ì¤¿¡£");
3603 msg_print("Your posture gets loose.");
3605 p_ptr->special_defense &= ~(KATA_MASK);
3606 p_ptr->update |= (PU_BONUS);
3607 p_ptr->update |= (PU_MONSTERS);
3608 p_ptr->redraw |= (PR_STATE);
3609 p_ptr->redraw |= (PR_STATUS);
3610 p_ptr->action = ACTION_NONE;
3618 else if (new_aux < old_aux)
3620 /* Describe the state */
3626 msg_print("¤ä¤Ã¤ÈÛ¯Û°¾õÂÖ¤«¤é²óÉü¤·¤¿¡£");
3628 msg_print("You are no longer stunned.");
3631 if (disturb_state) disturb(0, 0);
3643 if (!notice) return (FALSE);
3646 if (disturb_state) disturb(0, 0);
3648 /* Recalculate bonuses */
3649 p_ptr->update |= (PU_BONUS);
3651 /* Redraw the "stun" */
3652 p_ptr->redraw |= (PR_STUN);
3663 * Set "p_ptr->cut", notice observable changes
3665 * Note the special code to only notice "range" changes.
3669 int old_aux, new_aux;
3670 bool notice = FALSE;
3672 /* Hack -- Force good values */
3673 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3675 if (p_ptr->is_dead) return FALSE;
3677 if ((p_ptr->prace == RACE_GOLEM ||
3678 p_ptr->prace == RACE_SKELETON ||
3679 p_ptr->prace == RACE_SPECTRE ||
3680 (p_ptr->prace == RACE_ZOMBIE && p_ptr->lev > 11)) &&
3685 if (p_ptr->cut > 1000)
3691 else if (p_ptr->cut > 200)
3697 else if (p_ptr->cut > 100)
3703 else if (p_ptr->cut > 50)
3709 else if (p_ptr->cut > 25)
3715 else if (p_ptr->cut > 10)
3721 else if (p_ptr->cut > 0)
3781 if (new_aux > old_aux)
3783 /* Describe the state */
3789 msg_print("¤«¤¹¤ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3791 msg_print("You have been given a graze.");
3799 msg_print("·Ú¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3801 msg_print("You have been given a light cut.");
3809 msg_print("¤Ò¤É¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3811 msg_print("You have been given a bad cut.");
3819 msg_print("ÂçÊѤʽý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3821 msg_print("You have been given a nasty cut.");
3829 msg_print("½ÅÂç¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3831 msg_print("You have been given a severe cut.");
3839 msg_print("¤Ò¤É¤¤¿¼¼ê¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3841 msg_print("You have been given a deep gash.");
3849 msg_print("Ã×̿Ū¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3851 msg_print("You have been given a mortal wound.");
3860 if (randint1(1000) < v || one_in_(16))
3862 if (!p_ptr->sustain_chr)
3865 msg_print("¤Ò¤É¤¤½ýÀפ¬»Ä¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3867 msg_print("You have been horribly scarred.");
3877 else if (new_aux < old_aux)
3879 /* Describe the state */
3885 msg_format("¤ä¤Ã¤È%s¡£", p_ptr->prace == RACE_ANDROID ? "²ø²æ¤¬Ä¾¤Ã¤¿" : "½Ð·ì¤¬»ß¤Þ¤Ã¤¿");
3887 msg_print("You are no longer bleeding.");
3890 if (disturb_state) disturb(0, 0);
3902 if (!notice) return (FALSE);
3905 if (disturb_state) disturb(0, 0);
3907 /* Recalculate bonuses */
3908 p_ptr->update |= (PU_BONUS);
3910 /* Redraw the "cut" */
3911 p_ptr->redraw |= (PR_CUT);
3922 * Set "p_ptr->food", notice observable changes
3924 * The "p_ptr->food" variable can get as large as 20000, allowing the
3925 * addition of the most "filling" item, Elvish Waybread, which adds
3926 * 7500 food units, without overflowing the 32767 maximum limit.
3928 * Perhaps we should disturb the player with various messages,
3929 * especially messages about hunger status changes. XXX XXX XXX
3931 * Digestion of food is handled in "dungeon.c", in which, normally,
3932 * the player digests about 20 food units per 100 game turns, more
3933 * when "fast", more when "regenerating", less with "slow digestion",
3934 * but when the player is "gorged", he digests 100 food units per 10
3935 * game turns, or a full 1000 food units per 100 game turns.
3937 * Note that the player's speed is reduced by 10 units while gorged,
3938 * so if the player eats a single food ration (5000 food units) when
3939 * full (15000 food units), he will be gorged for (5000/100)*10 = 500
3940 * game turns, or 500/(100/5) = 25 player turns (if nothing else is
3941 * affecting the player speed).
3943 bool set_food(int v)
3945 int old_aux, new_aux;
3947 bool notice = FALSE;
3949 /* Hack -- Force good values */
3950 v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
3952 /* Fainting / Starving */
3953 if (p_ptr->food < PY_FOOD_FAINT)
3959 else if (p_ptr->food < PY_FOOD_WEAK)
3965 else if (p_ptr->food < PY_FOOD_ALERT)
3971 else if (p_ptr->food < PY_FOOD_FULL)
3977 else if (p_ptr->food < PY_FOOD_MAX)
3988 /* Fainting / Starving */
3989 if (v < PY_FOOD_FAINT)
3995 else if (v < PY_FOOD_WEAK)
4001 else if (v < PY_FOOD_ALERT)
4007 else if (v < PY_FOOD_FULL)
4013 else if (v < PY_FOOD_MAX)
4024 if (old_aux < 1 && new_aux > 0)
4025 chg_virtue(V_PATIENCE, 2);
4026 else if (old_aux < 3 && (old_aux != new_aux))
4027 chg_virtue(V_PATIENCE, 1);
4029 chg_virtue(V_TEMPERANCE, 1);
4031 chg_virtue(V_TEMPERANCE, -1);
4034 if (new_aux > old_aux)
4036 /* Describe the state */
4042 msg_print("¤Þ¤À¶õÊ¢¤ÇÅݤ줽¤¦¤À¡£");
4044 msg_print("You are still weak.");
4052 msg_print("¤Þ¤À¶õÊ¢¤À¡£");
4054 msg_print("You are still hungry.");
4062 msg_print("¶õÊ¢´¶¤¬¤ª¤µ¤Þ¤Ã¤¿¡£");
4064 msg_print("You are no longer hungry.");
4072 msg_print("ËþÊ¢¤À¡ª");
4074 msg_print("You are full!");
4082 msg_print("¿©¤Ù²á¤®¤À¡ª");
4084 msg_print("You have gorged yourself!");
4086 chg_virtue(V_HARMONY, -1);
4087 chg_virtue(V_PATIENCE, -1);
4088 chg_virtue(V_TEMPERANCE, -2);
4098 else if (new_aux < old_aux)
4100 /* Describe the state */
4103 /* Fainting / Starving */
4106 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
4108 msg_print("You are getting faint from hunger!");
4116 msg_print("¤ªÊ¢¤¬¶õ¤¤¤ÆÅݤ줽¤¦¤À¡£");
4118 msg_print("You are getting weak from hunger!");
4126 msg_print("¤ªÊ¢¤¬¶õ¤¤¤Æ¤¤¿¡£");
4128 msg_print("You are getting hungry.");
4136 msg_print("ËþÊ¢´¶¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
4138 msg_print("You are no longer full.");
4146 msg_print("¤ä¤Ã¤È¤ªÊ¢¤¬¤¤Ä¤¯¤Ê¤¯¤Ê¤Ã¤¿¡£");
4148 msg_print("You are no longer gorged.");
4154 if (p_ptr->wild_mode && (new_aux < 2))
4166 /* Nothing to notice */
4167 if (!notice) return (FALSE);
4170 if (disturb_state) disturb(0, 0);
4172 /* Recalculate bonuses */
4173 p_ptr->update |= (PU_BONUS);
4176 p_ptr->redraw |= (PR_HUNGER);
4186 * Increases a stat by one randomized level -RAK-
4188 * Note that this function (used by stat potions) now restores
4189 * the stat BEFORE increasing it.
4191 bool inc_stat(int stat)
4195 /* Then augment the current/max stat */
4196 value = p_ptr->stat_cur[stat];
4198 /* Cannot go above 18/100 */
4199 if (value < p_ptr->stat_max_max[stat])
4201 /* Gain one (sometimes two) points */
4204 gain = ((randint0(100) < 75) ? 1 : 2);
4208 /* Gain 1/6 to 1/3 of distance to 18/100 */
4209 else if (value < (p_ptr->stat_max_max[stat]-2))
4211 /* Approximate gain value */
4212 gain = (((p_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
4215 if (gain < 1) gain = 1;
4217 /* Apply the bonus */
4218 value += randint1(gain) + gain / 2;
4221 if (value > (p_ptr->stat_max_max[stat]-1)) value = p_ptr->stat_max_max[stat]-1;
4224 /* Gain one point at a time */
4230 /* Save the new value */
4231 p_ptr->stat_cur[stat] = value;
4233 /* Bring up the maximum too */
4234 if (value > p_ptr->stat_max[stat])
4236 p_ptr->stat_max[stat] = value;
4239 /* Recalculate bonuses */
4240 p_ptr->update |= (PU_BONUS);
4246 /* Nothing to gain */
4253 * Decreases a stat by an amount indended to vary from 0 to 100 percent.
4255 * Amount could be a little higher in extreme cases to mangle very high
4256 * stats from massive assaults. -CWS
4258 * Note that "permanent" means that the *given* amount is permanent,
4259 * not that the new value becomes permanent. This may not work exactly
4260 * as expected, due to "weirdness" in the algorithm, but in general,
4261 * if your stat is already drained, the "max" value will not drop all
4262 * the way down to the "cur" value.
4264 bool dec_stat(int stat, int amount, int permanent)
4266 int cur, max, loss, same, res = FALSE;
4269 /* Acquire current value */
4270 cur = p_ptr->stat_cur[stat];
4271 max = p_ptr->stat_max[stat];
4273 /* Note when the values are identical */
4274 same = (cur == max);
4276 /* Damage "current" value */
4279 /* Handle "low" values */
4282 if (amount > 90) cur--;
4283 if (amount > 50) cur--;
4284 if (amount > 20) cur--;
4288 /* Handle "high" values */
4291 /* Hack -- Decrement by a random amount between one-quarter */
4292 /* and one-half of the stat bonus times the percentage, with a */
4293 /* minimum damage of half the percentage. -CWS */
4294 loss = (((cur-18) / 2 + 1) / 2 + 1);
4297 if (loss < 1) loss = 1;
4299 /* Randomize the loss */
4300 loss = ((randint1(loss) + loss) * amount) / 100;
4303 if (loss < amount/2) loss = amount/2;
4305 /* Lose some points */
4308 /* Hack -- Only reduce stat to 17 sometimes */
4309 if (cur < 18) cur = (amount <= 20) ? 18 : 17;
4312 /* Prevent illegal values */
4313 if (cur < 3) cur = 3;
4315 /* Something happened */
4316 if (cur != p_ptr->stat_cur[stat]) res = TRUE;
4319 /* Damage "max" value */
4320 if (permanent && (max > 3))
4322 chg_virtue(V_SACRIFICE, 1);
4323 if (stat == A_WIS || stat == A_INT)
4324 chg_virtue(V_ENLIGHTEN, -2);
4326 /* Handle "low" values */
4329 if (amount > 90) max--;
4330 if (amount > 50) max--;
4331 if (amount > 20) max--;
4335 /* Handle "high" values */
4338 /* Hack -- Decrement by a random amount between one-quarter */
4339 /* and one-half of the stat bonus times the percentage, with a */
4340 /* minimum damage of half the percentage. -CWS */
4341 loss = (((max-18) / 2 + 1) / 2 + 1);
4342 loss = ((randint1(loss) + loss) * amount) / 100;
4343 if (loss < amount/2) loss = amount/2;
4345 /* Lose some points */
4348 /* Hack -- Only reduce stat to 17 sometimes */
4349 if (max < 18) max = (amount <= 20) ? 18 : 17;
4352 /* Hack -- keep it clean */
4353 if (same || (max < cur)) max = cur;
4355 /* Something happened */
4356 if (max != p_ptr->stat_max[stat]) res = TRUE;
4362 /* Actually set the stat to its new value. */
4363 p_ptr->stat_cur[stat] = cur;
4364 p_ptr->stat_max[stat] = max;
4366 /* Redisplay the stats later */
4367 p_ptr->redraw |= (PR_STATS);
4369 /* Recalculate bonuses */
4370 p_ptr->update |= (PU_BONUS);
4379 * Restore a stat. Return TRUE only if this actually makes a difference.
4381 bool res_stat(int stat)
4383 /* Restore if needed */
4384 if (p_ptr->stat_cur[stat] != p_ptr->stat_max[stat])
4387 p_ptr->stat_cur[stat] = p_ptr->stat_max[stat];
4389 /* Recalculate bonuses */
4390 p_ptr->update |= (PU_BONUS);
4392 /* Redisplay the stats later */
4393 p_ptr->redraw |= (PR_STATS);
4399 /* Nothing to restore */
4405 * Increase players hit points, notice effects
4407 bool hp_player(int num)
4410 vir = virtue_number(V_VITALITY);
4413 num = num * (p_ptr->virtues[vir - 1] + 1250) / 1250;
4415 /* Healing needed */
4416 if (p_ptr->chp < p_ptr->mhp)
4418 if ((num > 0) && (p_ptr->chp < (p_ptr->mhp/3)))
4419 chg_virtue(V_TEMPERANCE, 1);
4420 /* Gain hitpoints */
4423 /* Enforce maximum */
4424 if (p_ptr->chp >= p_ptr->mhp)
4426 p_ptr->chp = p_ptr->mhp;
4427 p_ptr->chp_frac = 0;
4431 p_ptr->redraw |= (PR_HP);
4434 p_ptr->window |= (PW_PLAYER);
4440 msg_print("¾¯¤·µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4442 msg_print("You feel a little better.");
4451 msg_print("µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4453 msg_print("You feel better.");
4462 msg_print("¤È¤Æ¤âµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4464 msg_print("You feel much better.");
4473 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4475 msg_print("You feel very good.");
4490 * Array of stat "descriptions"
4492 static cptr desc_stat_pos[] =
4534 * Array of stat "descriptions"
4536 static cptr desc_stat_neg[] =
4560 bool do_dec_stat(int stat)
4564 /* Access the "sustain" */
4567 case A_STR: if (p_ptr->sustain_str) sust = TRUE; break;
4568 case A_INT: if (p_ptr->sustain_int) sust = TRUE; break;
4569 case A_WIS: if (p_ptr->sustain_wis) sust = TRUE; break;
4570 case A_DEX: if (p_ptr->sustain_dex) sust = TRUE; break;
4571 case A_CON: if (p_ptr->sustain_con) sust = TRUE; break;
4572 case A_CHR: if (p_ptr->sustain_chr) sust = TRUE; break;
4576 if (sust && (!ironman_nightmare || randint0(13)))
4580 msg_format("%s¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¤¬¡¢¤¹¤°¤Ë¸µ¤ËÌá¤Ã¤¿¡£",
4582 msg_format("You feel %s for a moment, but the feeling passes.",
4585 desc_stat_neg[stat]);
4591 /* Attempt to reduce the stat */
4592 if (dec_stat(stat, 10, (ironman_nightmare && !randint0(13))))
4596 msg_format("¤Ò¤É¤¯%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_neg[stat]);
4598 msg_format("You feel very %s.", desc_stat_neg[stat]);
4606 /* Nothing obvious */
4612 * Restore lost "points" in a stat
4614 bool do_res_stat(int stat)
4616 /* Attempt to increase */
4621 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4623 msg_format("You feel less %s.", desc_stat_neg[stat]);
4631 /* Nothing obvious */
4637 * Gain a "point" in a stat
4639 bool do_inc_stat(int stat)
4643 /* Restore strength */
4644 res = res_stat(stat);
4646 /* Attempt to increase */
4651 chg_virtue(V_ENLIGHTEN, 1);
4652 chg_virtue(V_FAITH, 1);
4654 else if (stat == A_INT)
4656 chg_virtue(V_KNOWLEDGE, 1);
4657 chg_virtue(V_ENLIGHTEN, 1);
4659 else if (stat == A_CON)
4660 chg_virtue(V_VITALITY, 1);
4664 msg_format("¥ï¡¼¥ª¡ª¤È¤Æ¤â%s¤Ê¤Ã¤¿¡ª", desc_stat_pos[stat]);
4666 msg_format("Wow! You feel very %s!", desc_stat_pos[stat]);
4674 /* Restoration worked */
4679 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4681 msg_format("You feel less %s.", desc_stat_neg[stat]);
4689 /* Nothing obvious */
4695 * Restores any drained experience
4697 bool restore_level(void)
4699 /* Restore experience */
4700 if (p_ptr->exp < p_ptr->max_exp)
4704 msg_print("À¸Ì¿ÎϤ¬Ìá¤Ã¤Æ¤¤¿µ¤¤¬¤¹¤ë¡£");
4706 msg_print("You feel your life energies returning.");
4710 /* Restore the experience */
4711 p_ptr->exp = p_ptr->max_exp;
4713 /* Check the experience */
4728 bool lose_all_info(void)
4732 chg_virtue(V_KNOWLEDGE, -5);
4733 chg_virtue(V_ENLIGHTEN, -5);
4735 /* Forget info about objects */
4736 for (i = 0; i < INVEN_TOTAL; i++)
4738 object_type *o_ptr = &inventory[i];
4740 /* Skip non-objects */
4741 if (!o_ptr->k_idx) continue;
4743 /* Allow "protection" by the MENTAL flag */
4744 if (o_ptr->ident & (IDENT_MENTAL)) continue;
4746 /* Remove "default inscriptions" */
4747 o_ptr->feeling = FEEL_NONE;
4749 /* Hack -- Clear the "empty" flag */
4750 o_ptr->ident &= ~(IDENT_EMPTY);
4752 /* Hack -- Clear the "known" flag */
4753 o_ptr->ident &= ~(IDENT_KNOWN);
4755 /* Hack -- Clear the "felt" flag */
4756 o_ptr->ident &= ~(IDENT_SENSE);
4759 /* Recalculate bonuses */
4760 p_ptr->update |= (PU_BONUS);
4762 /* Combine / Reorder the pack (later) */
4763 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
4766 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
4768 /* Mega-Hack -- Forget the map */
4776 void do_poly_wounds(void)
4778 /* Changed to always provide at least _some_ healing */
4779 s16b wounds = p_ptr->cut;
4780 s16b hit_p = (p_ptr->mhp - p_ptr->chp);
4781 s16b change = damroll(p_ptr->lev, 5);
4782 bool Nasty_effect = one_in_(5);
4784 if (!(wounds || hit_p || Nasty_effect)) return;
4787 msg_print("½ý¤¬¤è¤ê·Ú¤¤¤â¤Î¤ËÊѲ½¤·¤¿¡£");
4789 msg_print("Your wounds are polymorphed into less serious ones.");
4796 msg_print("¿·¤¿¤Ê½ý¤¬¤Ç¤¤¿¡ª");
4797 take_hit(DAMAGE_LOSELIFE, change / 2, "ÊѲ½¤·¤¿½ý", -1);
4799 msg_print("A new wound was created!");
4800 take_hit(DAMAGE_LOSELIFE, change / 2, "a polymorphed wound", -1);
4807 set_cut(p_ptr->cut - (change / 2));
4813 * Change player race
4815 void change_race(int new_race, cptr effect_msg)
4817 cptr title = race_info[new_race].title;
4818 int old_race = p_ptr->prace;
4821 msg_format("¤¢¤Ê¤¿¤Ï%s%s¤ËÊѲ½¤·¤¿¡ª", effect_msg, title);
4823 msg_format("You turn into %s %s%s!", (!effect_msg[0] && is_a_vowel(title[0]) ? "an" : "a"), effect_msg, title);
4826 chg_virtue(V_CHANCE, 2);
4828 if (p_ptr->prace < 32)
4830 p_ptr->old_race1 |= 1L << p_ptr->prace;
4834 p_ptr->old_race2 |= 1L << (p_ptr->prace-32);
4836 p_ptr->prace = new_race;
4837 rp_ptr = &race_info[p_ptr->prace];
4839 /* Experience factor */
4840 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
4843 * The speed bonus of Klackons and Sprites are disabled
4844 * and the experience penalty is decreased.
4846 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)))
4847 p_ptr->expfact -= 15;
4849 /* Get character's height and weight */
4850 get_height_weight();
4853 if (p_ptr->pclass == CLASS_SORCERER)
4854 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
4856 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
4858 do_cmd_rerate(FALSE);
4860 /* The experience level may be modified */
4863 p_ptr->redraw |= (PR_BASIC);
4865 p_ptr->update |= (PU_BONUS);
4869 /* Load an autopick preference file */
4870 if (old_race != p_ptr->prace) autopick_load_pref(FALSE);
4872 /* Player's graphic tile may change */
4877 void do_poly_self(void)
4879 int power = p_ptr->lev;
4882 msg_print("¤¢¤Ê¤¿¤ÏÊѲ½¤Îˬ¤ì¤ò´¶¤¸¤¿...");
4884 msg_print("You feel a change coming over you...");
4887 chg_virtue(V_CHANCE, 1);
4889 if ((power > randint0(20)) && one_in_(3) && (p_ptr->prace != RACE_ANDROID))
4891 char effect_msg[80] = "";
4892 int new_race, expfact, goalexpfact;
4894 /* Some form of racial polymorph... */
4897 if ((power > randint0(5)) && one_in_(4))
4902 if (p_ptr->psex == SEX_MALE)
4904 p_ptr->psex = SEX_FEMALE;
4905 sp_ptr = &sex_info[p_ptr->psex];
4907 sprintf(effect_msg, "½÷À¤Î");
4909 sprintf(effect_msg, "female ");
4915 p_ptr->psex = SEX_MALE;
4916 sp_ptr = &sex_info[p_ptr->psex];
4918 sprintf(effect_msg, "ÃËÀ¤Î");
4920 sprintf(effect_msg, "male ");
4926 if ((power > randint0(30)) && one_in_(5))
4930 /* Harmful deformity */
4937 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
4943 /* Deformities are discriminated against! */
4944 (void)dec_stat(A_CHR, randint1(6), TRUE);
4950 sprintf(tmp_msg,"%s",effect_msg);
4951 sprintf(effect_msg,"´ñ·Á¤Î%s",tmp_msg);
4953 sprintf(tmp_msg,"%s ",effect_msg);
4954 sprintf(effect_msg,"deformed %s ",tmp_msg);
4961 sprintf(effect_msg,"´ñ·Á¤Î");
4963 sprintf(effect_msg,"deformed ");
4969 while ((power > randint0(20)) && one_in_(10))
4971 /* Polymorph into a less mutated form */
4974 if (!lose_mutation(0))
4976 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
4978 msg_print("You feel oddly normal.");
4984 * Restrict the race choices by exp penalty so
4985 * weak polymorph always means weak race
4990 goalexpfact = 100 + 3 * randint0(power);
4994 new_race = randint0(MAX_RACES);
4995 expfact = race_info[new_race].r_exp;
4997 while (((new_race == p_ptr->prace) && (expfact > goalexpfact)) || (new_race == RACE_ANDROID));
4999 change_race(new_race, effect_msg);
5002 if ((power > randint0(30)) && one_in_(6))
5010 msg_format("%s¤Î¹½À®¤¬ÊѲ½¤·¤¿¡ª", p_ptr->prace == RACE_ANDROID ? "µ¡³£" : "Æâ¡");
5012 msg_print("Your internal organs are rearranged!");
5017 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
5023 msg_print("¸½ºß¤Î»Ñ¤ÇÀ¸¤¤Æ¤¤¤¯¤Î¤Ïº¤Æñ¤Ê¤è¤¦¤À¡ª");
5024 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), "Ã×̿Ū¤ÊÆÍÁ³ÊÑ°Û", -1);
5026 msg_print("You find living difficult in your present form!");
5027 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), "a lethal mutation", -1);
5034 if ((power > randint0(20)) && one_in_(4))
5039 do_cmd_rerate(FALSE);
5042 while ((power > randint0(15)) && one_in_(3))
5045 (void)gain_random_mutation(0);
5048 if (power > randint0(5))
5054 /* Note: earlier deductions may have left power < 0 already. */
5064 * Decreases players hit points and sets death flag if necessary
5066 * XXX XXX XXX Invulnerability needs to be changed into a "shield"
5068 * XXX XXX XXX Hack -- this function allows the user to save (or quit)
5069 * the game when he dies, since the "You die." message is shown before
5070 * setting the player to "dead".
5073 int take_hit(int damage_type, int damage, cptr hit_from, int monspell)
5075 int old_chp = p_ptr->chp;
5077 char death_message[1024];
5080 int warning = (p_ptr->mhp * hitpoint_warn / 10);
5083 if (p_ptr->is_dead) return 0;
5085 if (p_ptr->sutemi) damage *= 2;
5086 if (p_ptr->special_defense & KATA_IAI) damage += (damage + 4) / 5;
5088 if (easy_band) damage = (damage+1)/2;
5090 if (damage_type != DAMAGE_USELIFE)
5100 if (monspell >= 0) learn_spell(monspell);
5102 /* Mega-Hack -- Apply "invulnerability" */
5103 if ((damage_type != DAMAGE_USELIFE) && (damage_type != DAMAGE_LOSELIFE))
5105 if (IS_INVULN() && (damage < 9000))
5107 if (damage_type == DAMAGE_FORCE)
5110 msg_print("¥Ð¥ê¥¢¤¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5112 msg_print("The attack cuts your shield of invulnerability open!");
5115 else if (one_in_(PENETRATE_INVULNERABILITY))
5118 msg_print("̵Ũ¤Î¥Ð¥ê¥¢¤òÇˤäƹ¶·â¤µ¤ì¤¿¡ª");
5120 msg_print("The attack penetrates your shield of invulnerability!");
5129 if (CHECK_MULTISHADOW())
5131 if (damage_type == DAMAGE_FORCE)
5134 msg_print("¸¸±Æ¤â¤í¤È¤âÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5136 msg_print("The attack hits Shadow together with you!");
5139 else if (damage_type == DAMAGE_ATTACK)
5142 msg_print("¹¶·â¤Ï¸¸±Æ¤ËÌ¿Ã椷¡¢¤¢¤Ê¤¿¤Ë¤ÏÆϤ«¤Ê¤«¤Ã¤¿¡£");
5144 msg_print("The attack hits Shadow, you are unharmed!");
5150 if (p_ptr->wraith_form)
5152 if (damage_type == DAMAGE_FORCE)
5155 msg_print("Ⱦʪ¼Á¤ÎÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5157 msg_print("The attack cuts through your ethereal body!");
5163 if ((damage == 0) && one_in_(2)) damage = 1;
5167 if (p_ptr->special_defense & KATA_MUSOU)
5170 if ((damage == 0) && one_in_(2)) damage = 1;
5172 } /* not if LOSELIFE USELIFE */
5174 /* Hurt the player */
5175 p_ptr->chp -= damage;
5176 if(damage_type == DAMAGE_GENO && p_ptr->chp < 0)
5178 damage += p_ptr->chp;
5182 /* Display the hitpoints */
5183 p_ptr->redraw |= (PR_HP);
5186 p_ptr->window |= (PW_PLAYER);
5190 if (damage_type != DAMAGE_GENO && p_ptr->chp == 0)
5192 chg_virtue(V_SACRIFICE, 1);
5193 chg_virtue(V_CHANCE, 2);
5199 bool android = (p_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
5201 #ifdef JP /* »à¤ó¤À»þ¤Ë¶¯À©½ªÎ»¤·¤Æ»à¤ò²óÈò¤Ç¤¤Ê¤¯¤·¤Æ¤ß¤¿ by Habu */
5203 if(!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
5209 chg_virtue(V_SACRIFICE, 10);
5212 p_ptr->leaving = TRUE;
5215 p_ptr->is_dead = TRUE;
5217 if (p_ptr->inside_arena)
5219 cptr m_name = r_name+r_info[arena_info[p_ptr->arena_number].r_idx].name;
5221 msg_format("¤¢¤Ê¤¿¤Ï%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£", m_name);
5223 msg_format("You are beaten by %s.", m_name);
5226 if (record_arena) do_cmd_write_nikki(NIKKI_ARENA, -1 - p_ptr->arena_number, m_name);
5230 int q_idx = quest_number(dun_level);
5231 bool seppuku = streq(hit_from, "Seppuku");
5232 bool winning_seppuku = p_ptr->total_winner && seppuku;
5235 /* Make screen dump */
5236 screen_dump = make_screen_dump();
5239 /* Note cause of death */
5242 strcpy(p_ptr->died_from, hit_from);
5244 if (!winning_seppuku) strcpy(p_ptr->died_from, "ÀÚÊ¢");
5251 sprintf(dummy, "%s%s%s", !p_ptr->paralyzed ? "" : p_ptr->free_act ? "ĦÁü¾õÂÖ¤Ç" : "Ëãáã¾õÂÖ¤Ç", p_ptr->image ? "¸¸³Ð¤ËÏĤó¤À" : "", hit_from);
5253 sprintf(dummy, "%s%s", hit_from, !p_ptr->paralyzed ? "" : " while helpless");
5255 my_strcpy(p_ptr->died_from, dummy, sizeof p_ptr->died_from);
5258 /* No longer a winner */
5259 p_ptr->total_winner = FALSE;
5261 if (winning_seppuku)
5264 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¾¡Íø¤Î¸åÀÚÊ¢¤·¤¿¡£");
5266 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "did Seppuku after the winning.");
5273 if (p_ptr->inside_arena)
5275 strcpy(buf,"¥¢¥ê¡¼¥Ê");
5277 strcpy(buf,"in the Arena");
5279 else if (!dun_level)
5283 strcpy(buf,"on the surface");
5285 else if (q_idx && (is_fixed_quest_idx(q_idx) &&
5286 !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
5288 strcpy(buf,"¥¯¥¨¥¹¥È");
5290 strcpy(buf,"in a quest");
5294 sprintf(buf,"%d³¬", dun_level);
5296 sprintf(buf,"level %d", dun_level);
5300 sprintf(tmp, "%s¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", buf, p_ptr->died_from);
5302 sprintf(tmp, "killed by %s %s.", p_ptr->died_from, buf);
5304 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5308 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- ¥²¡¼¥à¥ª¡¼¥Ð¡¼ --------");
5310 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- Game Over --------");
5312 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, "\n\n\n\n");
5317 if (get_check_strict("²èÌ̤òÊݸ¤·¤Þ¤¹¤«¡©", CHECK_NO_HISTORY))
5319 if (get_check_strict("Dump the screen? ", CHECK_NO_HISTORY))
5322 do_cmd_save_screen();
5327 /* Initialize "last message" buffer */
5328 if (p_ptr->last_message) string_free(p_ptr->last_message);
5329 p_ptr->last_message = NULL;
5331 /* Hack -- Note death */
5335 msg_format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë");
5337 msg_print(android ? "You are broken." : "You die.");
5344 if (winning_seppuku)
5347 get_rnd_line("seppuku_j.txt", 0, death_message);
5349 get_rnd_line("seppuku.txt", 0, death_message);
5355 get_rnd_line("death_j.txt", 0, death_message);
5357 get_rnd_line("death.txt", 0, death_message);
5364 while (!get_string(winning_seppuku ? "¼À¤¤Î¶ç: " : "ÃÇËöËâ¤Î¶«¤Ó: ", death_message, 1024)) ;
5366 while (!get_string("Last word: ", death_message, 1024)) ;
5370 while (winning_seppuku && !get_check_strict("¤è¤í¤·¤¤¤Ç¤¹¤«¡©", CHECK_NO_HISTORY));
5372 while (winning_seppuku && !get_check_strict("Are you sure? ", CHECK_NO_HISTORY));
5375 if (death_message[0] == '\0')
5378 strcpy(death_message, format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë"));
5380 strcpy(death_message, android ? "You are broken." : "You die.");
5383 else p_ptr->last_message = string_make(death_message);
5386 if (winning_seppuku)
5391 int msg_pos_x[9] = { 5, 7, 9, 12, 14, 17, 19, 21, 23};
5392 int msg_pos_y[9] = { 3, 4, 5, 4, 5, 4, 5, 6, 4};
5399 for (i = 0; i < 40; i++)
5400 Term_putstr(randint0(w / 2) * 2, randint0(h), 2, TERM_VIOLET, "¦Ô");
5402 str = death_message;
5403 if (strncmp(str, "¡Ö", 2) == 0) str += 2;
5405 str2 = my_strstr(str, "¡×");
5406 if (str2 != NULL) *str2 = '\0';
5411 str2 = my_strstr(str, " ");
5412 if (str2 == NULL) len = strlen(str);
5413 else len = str2 - str;
5417 Term_putstr_v(w * 3 / 4 - 2 - msg_pos_x[i] * 2, msg_pos_y[i], len,
5419 if (str2 == NULL) break;
5423 if (*str == 0) break;
5427 Term_putstr(w-1, h-1, 1, TERM_WHITE, " ");
5431 /* Make screen dump */
5432 screen_dump = make_screen_dump();
5435 /* Wait a key press */
5440 msg_print(death_message);
5448 /* Hitpoint warning */
5449 if (p_ptr->chp < warning)
5451 /* Hack -- bell on first notice */
5452 if (old_chp > warning) bell();
5456 if (record_danger && (old_chp > warning))
5458 if (p_ptr->image && damage_type == DAMAGE_ATTACK)
5462 hit_from = "something";
5466 sprintf(tmp,"%s¤Ë¤è¤Ã¤Æ¥Ô¥ó¥Á¤Ë´Ù¤Ã¤¿¡£",hit_from);
5468 sprintf(tmp,"A critical situation because of %s.",hit_from);
5470 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5475 /* stop auto_more even if DAMAGE_USELIFE */
5481 msg_print("*** ·Ù¹ð:Äã¥Ò¥Ã¥È¡¦¥Ý¥¤¥ó¥È¡ª ***");
5483 msg_print("*** LOW HITPOINT WARNING! ***");
5489 if (p_ptr->wild_mode && !p_ptr->leaving && (p_ptr->chp < MAX(warning, p_ptr->mhp/5)))
5500 void gain_exp_64(s32b amount, u32b amount_frac)
5502 if (p_ptr->is_dead) return;
5504 if (p_ptr->prace == RACE_ANDROID) return;
5506 /* Gain some experience */
5507 s64b_add(&(p_ptr->exp), &(p_ptr->exp_frac), amount, amount_frac);
5509 /* Slowly recover from experience drainage */
5510 if (p_ptr->exp < p_ptr->max_exp)
5512 /* Gain max experience (20%) (was 10%) */
5513 p_ptr->max_exp += amount / 5;
5516 /* Check Experience */
5524 void gain_exp(s32b amount)
5526 gain_exp_64(amount, 0L);
5530 void calc_android_exp(void)
5534 if (p_ptr->is_dead) return;
5536 if (p_ptr->prace != RACE_ANDROID) return;
5538 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5540 object_type *o_ptr = &inventory[i];
5542 object_type *q_ptr = &forge;
5544 int level = MAX(k_info[o_ptr->k_idx].level - 8, 1);
5546 if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue;
5547 if (!o_ptr->k_idx) continue;
5549 /* Wipe the object */
5552 object_copy(q_ptr, o_ptr);
5553 q_ptr->discount = 0;
5554 q_ptr->curse_flags = 0L;
5556 if (object_is_fixed_artifact(o_ptr))
5558 level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
5559 level += MIN(20, a_info[o_ptr->name1].rarity/(a_info[o_ptr->name1].gen_flags & TRG_INSTA_ART ? 10 : 3));
5561 else if (object_is_ego(o_ptr))
5563 level += MAX(3, (e_info[o_ptr->name2].rating - 5)/2);
5565 else if (o_ptr->art_name)
5567 s32b total_flags = flag_cost(o_ptr, o_ptr->pval);
5570 if (!object_is_weapon_ammo(o_ptr))
5573 if (total_flags < 15000) fake_level = 10;
5574 else if (total_flags < 35000) fake_level = 25;
5575 else fake_level = 40;
5580 if (total_flags < 20000) fake_level = 10;
5581 else if (total_flags < 45000) fake_level = 25;
5582 else fake_level = 40;
5585 level = MAX(level, (level + MAX(fake_level - 8, 5)) / 2 + 3);
5588 value = object_value_real(q_ptr);
5590 if (value <= 0) continue;
5591 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (p_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
5592 if (value > 5000000L) value = 5000000L;
5593 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
5595 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr) ||
5596 (o_ptr->tval == TV_DRAG_ARMOR) ||
5597 ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) ||
5598 ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) ||
5599 ((o_ptr->tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)) ||
5600 ((o_ptr->tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) ||
5601 ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE)))
5603 if (level > 65) level = 35 + (level - 65) / 5;
5604 else if (level > 35) level = 25 + (level - 35) / 3;
5605 else if (level > 15) level = 15 + (level - 15) / 2;
5606 exp = MIN(100000L, value) * level * level / 2;
5607 if (value > 100000L)
5608 exp += (value - 100000L) * level * level / 8;
5612 exp = MIN(100000L, value) * level;
5613 if (value > 100000L)
5614 exp += (value - 100000L) * level / 4;
5616 if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (buki_motteruka(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
5617 else total_exp += exp / 16;
5618 if (i == INVEN_BODY) total_exp += exp / 32;
5620 p_ptr->exp = p_ptr->max_exp = total_exp;
5622 /* Check Experience */
5630 void lose_exp(s32b amount)
5632 if (p_ptr->prace == RACE_ANDROID) return;
5634 /* Never drop below zero experience */
5635 if (amount > p_ptr->exp) amount = p_ptr->exp;
5637 /* Lose some experience */
5638 p_ptr->exp -= amount;
5640 /* Check Experience */
5647 * If resisted to draining, return FALSE
5649 bool drain_exp(s32b drain, s32b slip, int hold_life_prob)
5651 /* Androids and their mimics are never drained */
5652 if (p_ptr->prace == RACE_ANDROID) return FALSE;
5654 if (p_ptr->hold_life && (randint0(100) < hold_life_prob))
5656 /* Hold experience */
5658 msg_print("¤·¤«¤·¼«¸Ê¤ÎÀ¸Ì¿ÎϤò¼é¤ê¤¤Ã¤¿¡ª");
5660 msg_print("You keep hold of your life force!");
5665 /* Hold experience failed */
5666 if (p_ptr->hold_life)
5669 msg_print("À¸Ì¿ÎϤò¾¯¤·µÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
5671 msg_print("You feel your life slipping away!");
5678 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
5680 msg_print("You feel your life draining away!");
5689 bool set_ultimate_res(int v, bool do_dec)
5691 bool notice = FALSE;
5693 /* Hack -- Force good values */
5694 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5696 if (p_ptr->is_dead) return FALSE;
5701 if (p_ptr->ult_res && !do_dec)
5703 if (p_ptr->ult_res > v) return FALSE;
5705 else if (!p_ptr->ult_res)
5708 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5710 msg_print("You feel resistant!");
5723 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5725 msg_print("You feel less resistant");
5735 /* Redraw status bar */
5736 p_ptr->redraw |= (PR_STATUS);
5738 /* Nothing to notice */
5739 if (!notice) return (FALSE);
5742 if (disturb_state) disturb(0, 0);
5744 /* Recalculate bonuses */
5745 p_ptr->update |= (PU_BONUS);
5754 bool set_tim_res_nether(int v, bool do_dec)
5756 bool notice = FALSE;
5758 /* Hack -- Force good values */
5759 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5761 if (p_ptr->is_dead) return FALSE;
5766 if (p_ptr->tim_res_nether && !do_dec)
5768 if (p_ptr->tim_res_nether > v) return FALSE;
5770 else if (!p_ptr->tim_res_nether)
5773 msg_print("ÃϹö¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5775 msg_print("You feel nether resistant!");
5785 if (p_ptr->tim_res_nether)
5788 msg_print("ÃϹö¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5790 msg_print("You feel less nether resistant");
5798 p_ptr->tim_res_nether = v;
5800 /* Redraw status bar */
5801 p_ptr->redraw |= (PR_STATUS);
5803 /* Nothing to notice */
5804 if (!notice) return (FALSE);
5807 if (disturb_state) disturb(0, 0);
5809 /* Recalculate bonuses */
5810 p_ptr->update |= (PU_BONUS);
5819 bool set_tim_res_time(int v, bool do_dec)
5821 bool notice = FALSE;
5823 /* Hack -- Force good values */
5824 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5826 if (p_ptr->is_dead) return FALSE;
5831 if (p_ptr->tim_res_time && !do_dec)
5833 if (p_ptr->tim_res_time > v) return FALSE;
5835 else if (!p_ptr->tim_res_time)
5838 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5840 msg_print("You feel time resistant!");
5850 if (p_ptr->tim_res_time)
5853 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5855 msg_print("You feel less time resistant");
5863 p_ptr->tim_res_time = v;
5865 /* Redraw status bar */
5866 p_ptr->redraw |= (PR_STATUS);
5868 /* Nothing to notice */
5869 if (!notice) return (FALSE);
5872 if (disturb_state) disturb(0, 0);
5874 /* Recalculate bonuses */
5875 p_ptr->update |= (PU_BONUS);
5886 * Choose a warrior-mage elemental attack. -LM-
5888 bool choose_ele_attack(void)
5894 if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
5897 msg_format("Éð´ï¤ò»ý¤¿¤Ê¤¤¤ÈËâË¡·õ¤Ï»È¤¨¤Ê¤¤¡£");
5899 msg_format("You cannot use temporary branding with no weapon.");
5907 num = (p_ptr->lev - 20) / 5;
5910 c_prt(TERM_RED, " a) ¾Æ´þ", 2, 14);
5912 c_prt(TERM_RED, " a) Fire Brand", 2, 14);
5916 if (num >= 2) c_prt(TERM_L_WHITE," b) Åà·ë", 3, 14);
5918 if (num >= 2) c_prt(TERM_L_WHITE," b) Cold Brand", 3, 14);
5920 else prt("", 3, 14);
5923 if (num >= 3) c_prt(TERM_GREEN, " c) ÆÇ»¦", 4, 14);
5925 if (num >= 3) c_prt(TERM_GREEN, " c) Poison Brand", 4, 14);
5927 else prt("", 4, 14);
5930 if (num >= 4) c_prt(TERM_L_DARK, " d) Íϲò", 5, 14);
5932 if (num >= 4) c_prt(TERM_L_DARK, " d) Acid Brand", 5, 14);
5934 else prt("", 5, 14);
5937 if (num >= 5) c_prt(TERM_BLUE, " e) ÅÅ·â", 6, 14);
5939 if (num >= 5) c_prt(TERM_BLUE, " e) Elec Brand", 6, 14);
5941 else prt("", 6, 14);
5949 prt(" ¤É¤Î¸µÁǹ¶·â¤ò¤·¤Þ¤¹¤«¡©", 1, 14);
5951 prt(" Choose a temporary elemental brand ", 1, 14);
5956 if ((choice == 'a') || (choice == 'A'))
5957 set_ele_attack(ATTACK_FIRE, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5958 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
5959 set_ele_attack(ATTACK_COLD, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5960 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
5961 set_ele_attack(ATTACK_POIS, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5962 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
5963 set_ele_attack(ATTACK_ACID, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5964 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
5965 set_ele_attack(ATTACK_ELEC, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5969 msg_print("ËâË¡·õ¤ò»È¤¦¤Î¤ò¤ä¤á¤¿¡£");
5971 msg_print("You cancel the temporary branding.");
5983 * Choose a elemental immune. -LM-
5985 bool choose_ele_immune(int turn)
5993 c_prt(TERM_RED, " a) ²Ð±ê", 2, 14);
5995 c_prt(TERM_RED, " a) Immune Fire", 2, 14);
5999 c_prt(TERM_L_WHITE," b) Î䵤", 3, 14);
6001 c_prt(TERM_L_WHITE," b) Immune Cold", 3, 14);
6005 c_prt(TERM_L_DARK, " c) »À", 4, 14);
6007 c_prt(TERM_L_DARK, " c) Immune Acid", 4, 14);
6011 c_prt(TERM_BLUE, " d) ÅÅ·â", 5, 14);
6013 c_prt(TERM_BLUE, " d) Immune Elec", 5, 14);
6024 prt(" ¤É¤Î¸µÁǤÎÌȱ֤ò¤Ä¤±¤Þ¤¹¤«¡©", 1, 14);
6026 prt(" Choose a temporary elemental immune ", 1, 14);
6031 if ((choice == 'a') || (choice == 'A'))
6032 set_ele_immune(DEFENSE_FIRE, turn);
6033 else if ((choice == 'b') || (choice == 'B'))
6034 set_ele_immune(DEFENSE_COLD, turn);
6035 else if ((choice == 'c') || (choice == 'C'))
6036 set_ele_immune(DEFENSE_ACID, turn);
6037 else if ((choice == 'd') || (choice == 'D'))
6038 set_ele_immune(DEFENSE_ELEC, turn);
6042 msg_print("Ìȱ֤òÉÕ¤±¤ë¤Î¤ò¤ä¤á¤¿¡£");
6044 msg_print("You cancel the temporary immune.");