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.");
96 msg_print("¼öʸ¤Î±Ó¾§¤òÃæÃǤ·¤¿¡£");
98 msg_print("You stopped spelling all spells.");
107 /* If we are requested other action, stop singing */
108 if (prev_typ == ACTION_SING) stop_singing();
110 switch (p_ptr->action)
115 msg_print("Ãí°Õ¿¼¤¯Ê⤻Ϥ᤿¡£");
117 msg_print("You begin to walk carefully.");
119 p_ptr->redraw |= (PR_SPEED);
125 msg_print("³Ø½¬¤ò»Ï¤á¤¿¡£");
127 msg_print("You begin Learning");
134 msg_print("¿åÌ̤˻å¤ò¿â¤é¤·¤¿¡¥¡¥¡¥");
136 msg_print("You begin fishing...");
140 case ACTION_HAYAGAKE:
143 msg_print("¤¬±©¤Î¤è¤¦¤Ë·Ú¤¯¤Ê¤Ã¤¿¡£");
145 msg_print("You begin to walk extremely fast.");
155 /* Recalculate bonuses */
156 p_ptr->update |= (PU_BONUS);
158 /* Redraw the state */
159 p_ptr->redraw |= (PR_STATE);
162 /* reset timed flags */
163 void reset_tim_flags(void)
165 p_ptr->fast = 0; /* Timed -- Fast */
166 p_ptr->lightspeed = 0;
167 p_ptr->slow = 0; /* Timed -- Slow */
168 p_ptr->blind = 0; /* Timed -- Blindness */
169 p_ptr->paralyzed = 0; /* Timed -- Paralysis */
170 p_ptr->confused = 0; /* Timed -- Confusion */
171 p_ptr->afraid = 0; /* Timed -- Fear */
172 p_ptr->image = 0; /* Timed -- Hallucination */
173 p_ptr->poisoned = 0; /* Timed -- Poisoned */
174 p_ptr->cut = 0; /* Timed -- Cut */
175 p_ptr->stun = 0; /* Timed -- Stun */
177 p_ptr->protevil = 0; /* Timed -- Protection */
178 p_ptr->invuln = 0; /* Timed -- Invulnerable */
180 p_ptr->hero = 0; /* Timed -- Heroism */
181 p_ptr->shero = 0; /* Timed -- Super Heroism */
182 p_ptr->shield = 0; /* Timed -- Shield Spell */
183 p_ptr->blessed = 0; /* Timed -- Blessed */
184 p_ptr->tim_invis = 0; /* Timed -- Invisibility */
185 p_ptr->tim_infra = 0; /* Timed -- Infra Vision */
186 p_ptr->tim_regen = 0; /* Timed -- Regeneration */
187 p_ptr->tim_stealth = 0; /* Timed -- Stealth */
189 p_ptr->wraith_form = 0; /* Timed -- Wraith Form */
190 p_ptr->tim_levitation = 0;
191 p_ptr->tim_sh_touki = 0;
192 p_ptr->tim_sh_fire = 0;
193 p_ptr->tim_sh_holy = 0;
194 p_ptr->tim_eyeeye = 0;
196 p_ptr->resist_magic = 0;
199 p_ptr->tim_res_nether = 0;
200 p_ptr->tim_res_time = 0;
201 p_ptr->tim_mimic = 0;
202 p_ptr->mimic_form = 0;
203 p_ptr->tim_reflect = 0;
204 p_ptr->multishadow = 0;
206 p_ptr->action = ACTION_NONE;
209 p_ptr->oppose_acid = 0; /* Timed -- oppose acid */
210 p_ptr->oppose_elec = 0; /* Timed -- oppose lightning */
211 p_ptr->oppose_fire = 0; /* Timed -- oppose heat */
212 p_ptr->oppose_cold = 0; /* Timed -- oppose cold */
213 p_ptr->oppose_pois = 0; /* Timed -- oppose poison */
215 p_ptr->word_recall = 0;
216 p_ptr->alter_reality = 0;
217 p_ptr->sutemi = FALSE;
218 p_ptr->counter = FALSE;
219 p_ptr->ele_attack = 0;
220 p_ptr->ele_immune = 0;
221 p_ptr->special_attack = 0L;
222 p_ptr->special_defense = 0L;
224 while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
225 world_player = FALSE;
227 if (prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
228 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1;
229 if (p_ptr->pclass == CLASS_BERSERKER) p_ptr->shero = 1;
233 (void)set_monster_fast(p_ptr->riding, 0);
234 (void)set_monster_slow(p_ptr->riding, 0);
235 (void)set_monster_invulner(p_ptr->riding, 0, FALSE);
238 if (p_ptr->pclass == CLASS_BARD)
240 p_ptr->magic_num1[0] = 0;
241 p_ptr->magic_num2[0] = 0;
246 void dispel_player(void)
248 (void)set_fast(0, TRUE);
249 (void)set_lightspeed(0, TRUE);
250 (void)set_slow(0, TRUE);
251 (void)set_shield(0, TRUE);
252 (void)set_blessed(0, TRUE);
253 (void)set_tsuyoshi(0, TRUE);
254 (void)set_hero(0, TRUE);
255 (void)set_shero(0, TRUE);
256 (void)set_protevil(0, TRUE);
257 (void)set_invuln(0, TRUE);
258 (void)set_wraith_form(0, TRUE);
259 (void)set_kabenuke(0, TRUE);
260 (void)set_tim_res_nether(0, TRUE);
261 (void)set_tim_res_time(0, TRUE);
263 (void)set_tim_reflect(0,TRUE);
264 (void)set_multishadow(0,TRUE);
265 (void)set_dustrobe(0,TRUE);
267 (void)set_tim_invis(0, TRUE);
268 (void)set_tim_infra(0, TRUE);
269 (void)set_tim_esp(0, TRUE);
270 (void)set_tim_regen(0, TRUE);
271 (void)set_tim_stealth(0, TRUE);
272 (void)set_tim_levitation(0, TRUE);
273 (void)set_tim_sh_touki(0, TRUE);
274 (void)set_tim_sh_fire(0, TRUE);
275 (void)set_tim_sh_holy(0, TRUE);
276 (void)set_tim_eyeeye(0, TRUE);
277 (void)set_magicdef(0, TRUE);
278 (void)set_resist_magic(0, TRUE);
279 (void)set_oppose_acid(0, TRUE);
280 (void)set_oppose_elec(0, TRUE);
281 (void)set_oppose_fire(0, TRUE);
282 (void)set_oppose_cold(0, TRUE);
283 (void)set_oppose_pois(0, TRUE);
284 (void)set_ultimate_res(0, TRUE);
285 (void)set_mimic(0, 0, TRUE);
286 (void)set_ele_attack(0, 0);
287 (void)set_ele_immune(0, 0);
289 /* Cancel glowing hands */
290 if (p_ptr->special_attack & ATTACK_CONFUSE)
292 p_ptr->special_attack &= ~(ATTACK_CONFUSE);
294 msg_print("¼ê¤Îµ±¤¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
296 msg_print("Your hands stop glowing.");
300 if (music_singing_any() || hex_spelling_any())
303 cptr str = (music_singing_any()) ? "²Î" : "¼öʸ";
305 cptr str = (music_singing_any()) ? "singing" : "spelling";
307 p_ptr->magic_num1[1] = p_ptr->magic_num1[0];
308 p_ptr->magic_num1[0] = 0;
310 msg_format("%s¤¬ÅÓÀڤ줿¡£", str);
312 msg_format("Your %s is interrupted.", str);
314 p_ptr->action = ACTION_NONE;
316 /* Recalculate bonuses */
317 p_ptr->update |= (PU_BONUS | PU_HP);
320 p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
322 /* Update monsters */
323 p_ptr->update |= (PU_MONSTERS);
326 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
328 p_ptr->energy_need += ENERGY_NEED();
334 * Set "p_ptr->tim_mimic", and "p_ptr->mimic_form",
335 * notice observable changes
337 bool set_mimic(int v, int p, bool do_dec)
341 /* Hack -- Force good values */
342 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
344 if (p_ptr->is_dead) return FALSE;
349 if (p_ptr->tim_mimic && (p_ptr->mimic_form == p) && !do_dec)
351 if (p_ptr->tim_mimic > v) return FALSE;
353 else if ((!p_ptr->tim_mimic) || (p_ptr->mimic_form != p))
356 msg_print("¼«Ê¬¤ÎÂΤ¬ÊѤï¤Ã¤Æ¤æ¤¯¤Î¤ò´¶¤¸¤¿¡£");
358 msg_print("You feel that your body changes.");
368 if (p_ptr->tim_mimic)
371 msg_print("ÊѿȤ¬²ò¤±¤¿¡£");
373 msg_print("You are no longer transformed.");
375 if (p_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(0, TRUE);
383 p_ptr->tim_mimic = v;
385 /* Nothing to notice */
394 p_ptr->redraw |= (PR_BASIC | PR_STATUS);
396 /* Recalculate bonuses */
397 p_ptr->update |= (PU_BONUS | PU_HP);
406 * Set "p_ptr->blind", notice observable changes
408 * Note the use of "PU_UN_LITE" and "PU_UN_VIEW", which is needed to
409 * memorize any terrain features which suddenly become "visible".
410 * Note that blindness is currently the only thing which can affect
411 * "player_can_see_bold()".
413 bool set_blind(int v)
417 /* Hack -- Force good values */
418 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
420 if (p_ptr->is_dead) return FALSE;
427 if (p_ptr->prace == RACE_ANDROID)
430 msg_print("¥»¥ó¥µ¡¼¤ò¤ä¤é¤ì¤¿¡ª");
432 msg_print("You are blind!");
438 msg_print("Ìܤ¬¸«¤¨¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
440 msg_print("You are blind!");
445 chg_virtue(V_ENLIGHTEN, -1);
454 if (p_ptr->prace == RACE_ANDROID)
457 msg_print("¥»¥ó¥µ¡¼¤¬Éüµì¤·¤¿¡£");
459 msg_print("You can see again.");
465 msg_print("¤ä¤Ã¤ÈÌܤ¬¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
467 msg_print("You can see again.");
478 /* Redraw status bar */
479 p_ptr->redraw |= (PR_STATUS);
481 /* Nothing to notice */
482 if (!notice) return (FALSE);
485 if (disturb_state) disturb(0, 0);
487 /* Fully update the visuals */
488 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
491 p_ptr->redraw |= (PR_MAP);
494 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
505 * Set "p_ptr->confused", notice observable changes
507 bool set_confused(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->confused)
522 msg_print("¤¢¤Ê¤¿¤Ïº®Í𤷤¿¡ª");
524 msg_print("You are confused!");
527 if (p_ptr->action == ACTION_LEARN)
530 msg_print("³Ø½¬¤¬Â³¤±¤é¤ì¤Ê¤¤¡ª");
532 msg_print("You cannot continue Learning!");
536 p_ptr->redraw |= (PR_STATE);
537 p_ptr->action = ACTION_NONE;
539 if (p_ptr->action == ACTION_KAMAE)
542 msg_print("¹½¤¨¤¬¤È¤±¤¿¡£");
544 msg_print("Your posture gets loose.");
546 p_ptr->special_defense &= ~(KAMAE_MASK);
547 p_ptr->update |= (PU_BONUS);
548 p_ptr->redraw |= (PR_STATE);
549 p_ptr->action = ACTION_NONE;
551 else if (p_ptr->action == ACTION_KATA)
554 msg_print("·¿¤¬Êø¤ì¤¿¡£");
556 msg_print("Your posture gets loose.");
558 p_ptr->special_defense &= ~(KATA_MASK);
559 p_ptr->update |= (PU_BONUS);
560 p_ptr->update |= (PU_MONSTERS);
561 p_ptr->redraw |= (PR_STATE);
562 p_ptr->redraw |= (PR_STATUS);
563 p_ptr->action = ACTION_NONE;
567 if (p_ptr->concent) reset_concentration(TRUE);
570 if (hex_spelling_any()) stop_hex_spell_all();
573 p_ptr->counter = FALSE;
574 chg_virtue(V_HARMONY, -1);
584 msg_print("¤ä¤Ã¤Èº®Í𤬤ª¤µ¤Þ¤Ã¤¿¡£");
586 msg_print("You feel less confused now.");
589 p_ptr->special_attack &= ~(ATTACK_SUIKEN);
597 /* Redraw status bar */
598 p_ptr->redraw |= (PR_STATUS);
600 /* Nothing to notice */
601 if (!notice) return (FALSE);
604 if (disturb_state) disturb(0, 0);
615 * Set "p_ptr->poisoned", notice observable changes
617 bool set_poisoned(int v)
621 /* Hack -- Force good values */
622 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
624 if (p_ptr->is_dead) return FALSE;
629 if (!p_ptr->poisoned)
632 msg_print("ÆǤ˿¯¤µ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
634 msg_print("You are poisoned!");
647 msg_print("¤ä¤Ã¤ÈÆǤÎÄˤߤ¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
649 msg_print("You are no longer poisoned.");
659 /* Redraw status bar */
660 p_ptr->redraw |= (PR_STATUS);
662 /* Nothing to notice */
663 if (!notice) return (FALSE);
666 if (disturb_state) disturb(0, 0);
677 * Set "p_ptr->afraid", notice observable changes
679 bool set_afraid(int v)
683 /* Hack -- Force good values */
684 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
686 if (p_ptr->is_dead) return FALSE;
694 msg_print("²¿¤â¤«¤â¶²¤¯¤Ê¤Ã¤Æ¤¤¿¡ª");
696 msg_print("You are terrified!");
699 if (p_ptr->special_defense & KATA_MASK)
702 msg_print("·¿¤¬Êø¤ì¤¿¡£");
704 msg_print("Your posture gets loose.");
706 p_ptr->special_defense &= ~(KATA_MASK);
707 p_ptr->update |= (PU_BONUS);
708 p_ptr->update |= (PU_MONSTERS);
709 p_ptr->redraw |= (PR_STATE);
710 p_ptr->redraw |= (PR_STATUS);
711 p_ptr->action = ACTION_NONE;
715 p_ptr->counter = FALSE;
716 chg_virtue(V_VALOUR, -1);
726 msg_print("¤ä¤Ã¤È¶²Éݤò¿¶¤êʧ¤Ã¤¿¡£");
728 msg_print("You feel bolder now.");
738 /* Redraw status bar */
739 p_ptr->redraw |= (PR_STATUS);
741 /* Nothing to notice */
742 if (!notice) return (FALSE);
745 if (disturb_state) disturb(0, 0);
756 * Set "p_ptr->paralyzed", notice observable changes
758 bool set_paralyzed(int v)
762 /* Hack -- Force good values */
763 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
765 if (p_ptr->is_dead) return FALSE;
770 if (!p_ptr->paralyzed)
773 msg_print("ÂΤ¬Ëãá㤷¤Æ¤·¤Þ¤Ã¤¿¡ª");
775 msg_print("You are paralyzed!");
779 if (p_ptr->concent) reset_concentration(TRUE);
782 if (hex_spelling_any()) stop_hex_spell_all();
784 p_ptr->counter = FALSE;
792 if (p_ptr->paralyzed)
795 msg_print("¤ä¤Ã¤ÈÆ°¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
797 msg_print("You can move again.");
805 p_ptr->paralyzed = v;
807 /* Redraw status bar */
808 p_ptr->redraw |= (PR_STATUS);
810 /* Nothing to notice */
811 if (!notice) return (FALSE);
814 if (disturb_state) disturb(0, 0);
816 /* Redraw the state */
817 p_ptr->redraw |= (PR_STATE);
828 * Set "p_ptr->image", notice observable changes
830 * Note that we must redraw the map when hallucination changes.
832 bool set_image(int v)
836 /* Hack -- Force good values */
837 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
839 if (p_ptr->is_dead) return FALSE;
845 set_tsuyoshi(0, TRUE);
849 msg_print("¥ï¡¼¥ª¡ª²¿¤â¤«¤âÆú¿§¤Ë¸«¤¨¤ë¡ª");
851 msg_print("Oh, wow! Everything looks so cosmic now!");
855 if (p_ptr->concent) reset_concentration(TRUE);
857 p_ptr->counter = FALSE;
868 msg_print("¤ä¤Ã¤È¤Ï¤Ã¤¤ê¤Èʪ¤¬¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
870 msg_print("You can see clearly again.");
880 /* Redraw status bar */
881 p_ptr->redraw |= (PR_STATUS);
883 /* Nothing to notice */
884 if (!notice) return (FALSE);
887 if (disturb_state) disturb(0, 0);
890 p_ptr->redraw |= (PR_MAP);
892 /* Update the health bar */
893 p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH);
895 /* Update monsters */
896 p_ptr->update |= (PU_MONSTERS);
899 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
910 * Set "p_ptr->fast", notice observable changes
912 bool set_fast(int v, bool do_dec)
916 /* Hack -- Force good values */
917 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
919 if (p_ptr->is_dead) return FALSE;
924 if (p_ptr->fast && !do_dec)
926 if (p_ptr->fast > v) return FALSE;
928 else if (!IS_FAST() && !p_ptr->lightspeed)
931 msg_print("ÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
933 msg_print("You feel yourself moving much faster!");
937 chg_virtue(V_PATIENCE, -1);
938 chg_virtue(V_DILIGENCE, 1);
945 if (p_ptr->fast && !p_ptr->lightspeed && !music_singing(MUSIC_SPEED) && !music_singing(MUSIC_SHERO))
948 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
950 msg_print("You feel yourself slow down.");
960 /* Nothing to notice */
961 if (!notice) return (FALSE);
964 if (disturb_state) disturb(0, 0);
966 /* Recalculate bonuses */
967 p_ptr->update |= (PU_BONUS);
978 * Set "p_ptr->lightspeed", notice observable changes
980 bool set_lightspeed(int v, bool do_dec)
984 /* Hack -- Force good values */
985 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
987 if (p_ptr->is_dead) return FALSE;
989 if (p_ptr->wild_mode) v = 0;
994 if (p_ptr->lightspeed && !do_dec)
996 if (p_ptr->lightspeed > v) return FALSE;
998 else if (!p_ptr->lightspeed)
1001 msg_print("Èó¾ï¤ËÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
1003 msg_print("You feel yourself moving extremely faster!");
1007 chg_virtue(V_PATIENCE, -1);
1008 chg_virtue(V_DILIGENCE, 1);
1015 if (p_ptr->lightspeed)
1018 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1020 msg_print("You feel yourself slow down.");
1028 p_ptr->lightspeed = v;
1030 /* Nothing to notice */
1031 if (!notice) return (FALSE);
1034 if (disturb_state) disturb(0, 0);
1036 /* Recalculate bonuses */
1037 p_ptr->update |= (PU_BONUS);
1048 * Set "p_ptr->slow", notice observable changes
1050 bool set_slow(int v, bool do_dec)
1052 bool notice = FALSE;
1054 /* Hack -- Force good values */
1055 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1057 if (p_ptr->is_dead) return FALSE;
1062 if (p_ptr->slow && !do_dec)
1064 if (p_ptr->slow > v) return FALSE;
1066 else if (!p_ptr->slow)
1069 msg_print("ÂΤÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
1071 msg_print("You feel yourself moving slower!");
1084 msg_print("Æ°¤¤ÎÃÙ¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1086 msg_print("You feel yourself speed up.");
1096 /* Nothing to notice */
1097 if (!notice) return (FALSE);
1100 if (disturb_state) disturb(0, 0);
1102 /* Recalculate bonuses */
1103 p_ptr->update |= (PU_BONUS);
1114 * Set "p_ptr->shield", notice observable changes
1116 bool set_shield(int v, bool do_dec)
1118 bool notice = FALSE;
1120 /* Hack -- Force good values */
1121 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1123 if (p_ptr->is_dead) return FALSE;
1128 if (p_ptr->shield && !do_dec)
1130 if (p_ptr->shield > v) return FALSE;
1132 else if (!p_ptr->shield)
1135 msg_print("È©¤¬ÀФˤʤä¿¡£");
1137 msg_print("Your skin turns to stone.");
1150 msg_print("È©¤¬¸µ¤ËÌá¤Ã¤¿¡£");
1152 msg_print("Your skin returns to normal.");
1162 /* Redraw status bar */
1163 p_ptr->redraw |= (PR_STATUS);
1165 /* Nothing to notice */
1166 if (!notice) return (FALSE);
1169 if (disturb_state) disturb(0, 0);
1171 /* Recalculate bonuses */
1172 p_ptr->update |= (PU_BONUS);
1184 * Set "p_ptr->tsubureru", notice observable changes
1186 bool set_tsubureru(int v, bool do_dec)
1188 bool notice = FALSE;
1190 /* Hack -- Force good values */
1191 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1193 if (p_ptr->is_dead) return FALSE;
1198 if (p_ptr->tsubureru && !do_dec)
1200 if (p_ptr->tsubureru > v) return FALSE;
1202 else if (!p_ptr->tsubureru)
1205 msg_print("²£¤Ë¿¤Ó¤¿¡£");
1207 msg_print("Your body expands horizontally.");
1217 if (p_ptr->tsubureru)
1220 msg_print("¤â¤¦²£¤Ë¿¤Ó¤Æ¤¤¤Ê¤¤¡£");
1222 msg_print("Your body returns to normal.");
1230 p_ptr->tsubureru = v;
1232 /* Redraw status bar */
1233 p_ptr->redraw |= (PR_STATUS);
1235 /* Nothing to notice */
1236 if (!notice) return (FALSE);
1239 if (disturb_state) disturb(0, 0);
1241 /* Recalculate bonuses */
1242 p_ptr->update |= (PU_BONUS);
1254 * Set "p_ptr->magicdef", notice observable changes
1256 bool set_magicdef(int v, bool do_dec)
1258 bool notice = FALSE;
1260 /* Hack -- Force good values */
1261 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1263 if (p_ptr->is_dead) return FALSE;
1268 if (p_ptr->magicdef && !do_dec)
1270 if (p_ptr->magicdef > v) return FALSE;
1272 else if (!p_ptr->magicdef)
1275 msg_print("ËâË¡¤ÎËɸæÎϤ¬Áý¤·¤¿¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1277 msg_print("You feel more resistant to magic.");
1287 if (p_ptr->magicdef)
1290 msg_print("ËâË¡¤ÎËɸæÎϤ¬¸µ¤ËÌá¤Ã¤¿¡£");
1292 msg_print("You feel less resistant to magic.");
1300 p_ptr->magicdef = v;
1302 /* Redraw status bar */
1303 p_ptr->redraw |= (PR_STATUS);
1305 /* Nothing to notice */
1306 if (!notice) return (FALSE);
1309 if (disturb_state) disturb(0, 0);
1311 /* Recalculate bonuses */
1312 p_ptr->update |= (PU_BONUS);
1324 * Set "p_ptr->blessed", notice observable changes
1326 bool set_blessed(int v, bool do_dec)
1328 bool notice = FALSE;
1330 /* Hack -- Force good values */
1331 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1333 if (p_ptr->is_dead) return FALSE;
1338 if (p_ptr->blessed && !do_dec)
1340 if (p_ptr->blessed > v) return FALSE;
1342 else if (!IS_BLESSED())
1345 msg_print("¹â·é¤Êµ¤Ê¬¤Ë¤Ê¤Ã¤¿¡ª");
1347 msg_print("You feel righteous!");
1357 if (p_ptr->blessed && !music_singing(MUSIC_BLESS))
1360 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1362 msg_print("The prayer has expired.");
1372 /* Redraw status bar */
1373 p_ptr->redraw |= (PR_STATUS);
1375 /* Nothing to notice */
1376 if (!notice) return (FALSE);
1379 if (disturb_state) disturb(0, 0);
1381 /* Recalculate bonuses */
1382 p_ptr->update |= (PU_BONUS);
1393 * Set "p_ptr->hero", notice observable changes
1395 bool set_hero(int v, bool do_dec)
1397 bool notice = FALSE;
1399 /* Hack -- Force good values */
1400 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1402 if (p_ptr->is_dead) return FALSE;
1407 if (p_ptr->hero && !do_dec)
1409 if (p_ptr->hero > v) return FALSE;
1411 else if (!IS_HERO())
1414 msg_print("¥Ò¡¼¥í¡¼¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1416 msg_print("You feel like a hero!");
1426 if (p_ptr->hero && !music_singing(MUSIC_HERO) && !music_singing(MUSIC_SHERO))
1429 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1431 msg_print("The heroism wears off.");
1441 /* Redraw status bar */
1442 p_ptr->redraw |= (PR_STATUS);
1444 /* Nothing to notice */
1445 if (!notice) return (FALSE);
1448 if (disturb_state) disturb(0, 0);
1450 /* Recalculate bonuses */
1451 p_ptr->update |= (PU_BONUS);
1453 /* Recalculate hitpoints */
1454 p_ptr->update |= (PU_HP);
1465 * Set "p_ptr->shero", notice observable changes
1467 bool set_shero(int v, bool do_dec)
1469 bool notice = FALSE;
1471 /* Hack -- Force good values */
1472 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1474 if (p_ptr->is_dead) return FALSE;
1476 if (p_ptr->pclass == CLASS_BERSERKER) v = 1;
1480 if (p_ptr->shero && !do_dec)
1482 if (p_ptr->shero > v) return FALSE;
1484 else if (!p_ptr->shero)
1487 msg_print("»¦Ù¤¥Þ¥·¡¼¥ó¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1489 msg_print("You feel like a killing machine!");
1502 msg_print("ÌîÈڤʵ¤»ý¤Á¤¬¾Ã¤¨¼º¤»¤¿¡£");
1504 msg_print("You feel less Berserk.");
1514 /* Redraw status bar */
1515 p_ptr->redraw |= (PR_STATUS);
1517 /* Nothing to notice */
1518 if (!notice) return (FALSE);
1521 if (disturb_state) disturb(0, 0);
1523 /* Recalculate bonuses */
1524 p_ptr->update |= (PU_BONUS);
1526 /* Recalculate hitpoints */
1527 p_ptr->update |= (PU_HP);
1538 * Set "p_ptr->protevil", notice observable changes
1540 bool set_protevil(int v, bool do_dec)
1542 bool notice = FALSE;
1544 /* Hack -- Force good values */
1545 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1547 if (p_ptr->is_dead) return FALSE;
1552 if (p_ptr->protevil && !do_dec)
1554 if (p_ptr->protevil > v) return FALSE;
1556 else if (!p_ptr->protevil)
1559 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Ê´¶¤¸¤¬¤¹¤ë¡ª");
1561 msg_print("You feel safe from evil!");
1571 if (p_ptr->protevil)
1574 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1576 msg_print("You no longer feel safe from evil.");
1584 p_ptr->protevil = v;
1586 /* Redraw status bar */
1587 p_ptr->redraw |= (PR_STATUS);
1589 /* Nothing to notice */
1590 if (!notice) return (FALSE);
1593 if (disturb_state) disturb(0, 0);
1603 * Set "p_ptr->wraith_form", notice observable changes
1605 bool set_wraith_form(int v, bool do_dec)
1607 bool notice = FALSE;
1609 /* Hack -- Force good values */
1610 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1612 if (p_ptr->is_dead) return FALSE;
1617 if (p_ptr->wraith_form && !do_dec)
1619 if (p_ptr->wraith_form > v) return FALSE;
1621 else if (!p_ptr->wraith_form)
1624 msg_print("ʪ¼Á³¦¤òÎ¥¤ì¤ÆÍ©µ´¤Î¤è¤¦¤Ê¸ºß¤Ë¤Ê¤Ã¤¿¡ª");
1626 msg_print("You leave the physical world and turn into a wraith-being!");
1631 chg_virtue(V_UNLIFE, 3);
1632 chg_virtue(V_HONOUR, -2);
1633 chg_virtue(V_SACRIFICE, -2);
1634 chg_virtue(V_VALOUR, -5);
1637 p_ptr->redraw |= (PR_MAP);
1639 /* Update monsters */
1640 p_ptr->update |= (PU_MONSTERS);
1643 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1650 if (p_ptr->wraith_form)
1653 msg_print("ÉÔÆ©ÌÀ¤Ë¤Ê¤Ã¤¿´¶¤¸¤¬¤¹¤ë¡£");
1655 msg_print("You feel opaque.");
1661 p_ptr->redraw |= (PR_MAP);
1663 /* Update monsters */
1664 p_ptr->update |= (PU_MONSTERS);
1667 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1672 p_ptr->wraith_form = v;
1674 /* Redraw status bar */
1675 p_ptr->redraw |= (PR_STATUS);
1677 /* Nothing to notice */
1678 if (!notice) return (FALSE);
1681 if (disturb_state) disturb(0, 0);
1683 /* Recalculate bonuses */
1684 p_ptr->update |= (PU_BONUS);
1696 * Set "p_ptr->invuln", notice observable changes
1698 bool set_invuln(int v, bool do_dec)
1700 bool notice = FALSE;
1702 /* Hack -- Force good values */
1703 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1705 if (p_ptr->is_dead) return FALSE;
1710 if (p_ptr->invuln && !do_dec)
1712 if (p_ptr->invuln > v) return FALSE;
1714 else if (!IS_INVULN())
1717 msg_print("̵Ũ¤À¡ª");
1719 msg_print("Invulnerability!");
1724 chg_virtue(V_UNLIFE, -2);
1725 chg_virtue(V_HONOUR, -2);
1726 chg_virtue(V_SACRIFICE, -3);
1727 chg_virtue(V_VALOUR, -5);
1730 p_ptr->redraw |= (PR_MAP);
1732 /* Update monsters */
1733 p_ptr->update |= (PU_MONSTERS);
1736 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1743 if (p_ptr->invuln && !music_singing(MUSIC_INVULN))
1746 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
1748 msg_print("The invulnerability wears off.");
1754 p_ptr->redraw |= (PR_MAP);
1756 /* Update monsters */
1757 p_ptr->update |= (PU_MONSTERS);
1760 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1762 p_ptr->energy_need += ENERGY_NEED();
1769 /* Redraw status bar */
1770 p_ptr->redraw |= (PR_STATUS);
1772 /* Nothing to notice */
1773 if (!notice) return (FALSE);
1776 if (disturb_state) disturb(0, 0);
1778 /* Recalculate bonuses */
1779 p_ptr->update |= (PU_BONUS);
1790 * Set "p_ptr->tim_esp", notice observable changes
1792 bool set_tim_esp(int v, bool do_dec)
1794 bool notice = FALSE;
1796 /* Hack -- Force good values */
1797 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1799 if (p_ptr->is_dead) return FALSE;
1804 if (p_ptr->tim_esp && !do_dec)
1806 if (p_ptr->tim_esp > v) return FALSE;
1808 else if (!IS_TIM_ESP())
1811 msg_print("°Õ¼±¤¬¹¤¬¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1813 msg_print("You feel your consciousness expand!");
1823 if (p_ptr->tim_esp && !music_singing(MUSIC_MIND))
1826 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
1828 msg_print("Your consciousness contracts again.");
1838 /* Redraw status bar */
1839 p_ptr->redraw |= (PR_STATUS);
1841 /* Nothing to notice */
1842 if (!notice) return (FALSE);
1845 if (disturb_state) disturb(0, 0);
1847 /* Recalculate bonuses */
1848 p_ptr->update |= (PU_BONUS);
1850 /* Update the monsters */
1851 p_ptr->update |= (PU_MONSTERS);
1862 * Set "p_ptr->tim_invis", notice observable changes
1864 bool set_tim_invis(int v, bool do_dec)
1866 bool notice = FALSE;
1868 /* Hack -- Force good values */
1869 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1871 if (p_ptr->is_dead) return FALSE;
1876 if (p_ptr->tim_invis && !do_dec)
1878 if (p_ptr->tim_invis > v) return FALSE;
1880 else if (!p_ptr->tim_invis)
1883 msg_print("Ìܤ¬Èó¾ï¤ËÉÒ´¶¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1885 msg_print("Your eyes feel very sensitive!");
1895 if (p_ptr->tim_invis)
1898 msg_print("ÌܤÎÉÒ´¶¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1900 msg_print("Your eyes feel less sensitive.");
1908 p_ptr->tim_invis = v;
1910 /* Redraw status bar */
1911 p_ptr->redraw |= (PR_STATUS);
1913 /* Nothing to notice */
1914 if (!notice) return (FALSE);
1917 if (disturb_state) disturb(0, 0);
1919 /* Recalculate bonuses */
1920 p_ptr->update |= (PU_BONUS);
1922 /* Update the monsters */
1923 p_ptr->update |= (PU_MONSTERS);
1934 * Set "p_ptr->tim_infra", notice observable changes
1936 bool set_tim_infra(int v, bool do_dec)
1938 bool notice = FALSE;
1940 /* Hack -- Force good values */
1941 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1943 if (p_ptr->is_dead) return FALSE;
1948 if (p_ptr->tim_infra && !do_dec)
1950 if (p_ptr->tim_infra > v) return FALSE;
1952 else if (!p_ptr->tim_infra)
1955 msg_print("Ìܤ¬¥é¥ó¥é¥ó¤Èµ±¤»Ï¤á¤¿¡ª");
1957 msg_print("Your eyes begin to tingle!");
1967 if (p_ptr->tim_infra)
1970 msg_print("Ìܤ層¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1972 msg_print("Your eyes stop tingling.");
1980 p_ptr->tim_infra = v;
1982 /* Redraw status bar */
1983 p_ptr->redraw |= (PR_STATUS);
1985 /* Nothing to notice */
1986 if (!notice) return (FALSE);
1989 if (disturb_state) disturb(0, 0);
1991 /* Recalculate bonuses */
1992 p_ptr->update |= (PU_BONUS);
1994 /* Update the monsters */
1995 p_ptr->update |= (PU_MONSTERS);
2006 * Set "p_ptr->tim_regen", notice observable changes
2008 bool set_tim_regen(int v, bool do_dec)
2010 bool notice = FALSE;
2012 /* Hack -- Force good values */
2013 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2015 if (p_ptr->is_dead) return FALSE;
2020 if (p_ptr->tim_regen && !do_dec)
2022 if (p_ptr->tim_regen > v) return FALSE;
2024 else if (!p_ptr->tim_regen)
2027 msg_print("²óÉüÎϤ¬¾å¤¬¤Ã¤¿¡ª");
2029 msg_print("You feel yourself regenerating quickly!");
2039 if (p_ptr->tim_regen)
2042 msg_print("ÁÇÁ᤯²óÉü¤¹¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
2044 msg_print("You feel yourself regenerating slowly.");
2052 p_ptr->tim_regen = v;
2054 /* Redraw status bar */
2055 p_ptr->redraw |= (PR_STATUS);
2057 /* Nothing to notice */
2058 if (!notice) return (FALSE);
2061 if (disturb_state) disturb(0, 0);
2063 /* Recalculate bonuses */
2064 p_ptr->update |= (PU_BONUS);
2075 * Set "p_ptr->tim_stealth", notice observable changes
2077 bool set_tim_stealth(int v, bool do_dec)
2079 bool notice = FALSE;
2081 /* Hack -- Force good values */
2082 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2084 if (p_ptr->is_dead) return FALSE;
2089 if (p_ptr->tim_stealth && !do_dec)
2091 if (p_ptr->tim_stealth > v) return FALSE;
2093 else if (!IS_TIM_STEALTH())
2096 msg_print("²»¤¬¾®¤µ¤¯¤Ê¤Ã¤¿¡ª");
2098 msg_print("You begin to walk silently!");
2108 if (p_ptr->tim_stealth && !music_singing(MUSIC_STEALTH))
2111 msg_print("²»¤¬Â礤¯¤Ê¤Ã¤¿¡£");
2113 msg_print("You no longer walk silently.");
2121 p_ptr->tim_stealth = v;
2123 /* Redraw status bar */
2124 p_ptr->redraw |= (PR_STATUS);
2126 /* Nothing to notice */
2127 if (!notice) return (FALSE);
2130 if (disturb_state) disturb(0, 0);
2132 /* Recalculate bonuses */
2133 p_ptr->update |= (PU_BONUS);
2143 bool set_superstealth(bool set)
2145 bool notice = FALSE;
2147 if (p_ptr->is_dead) return FALSE;
2152 if (!(p_ptr->special_defense & NINJA_S_STEALTH))
2154 if (cave[py][px].info & CAVE_MNLT)
2157 msg_print("Ũ¤ÎÌܤ«¤éÇö¤¤±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡£");
2159 msg_print("You are mantled in weak shadow from ordinary eyes.");
2161 p_ptr->monlite = p_ptr->old_monlite = TRUE;
2166 msg_print("Ũ¤ÎÌܤ«¤é±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡ª");
2168 msg_print("You are mantled in shadow from ordinary eyes!");
2170 p_ptr->monlite = p_ptr->old_monlite = FALSE;
2176 p_ptr->special_defense |= NINJA_S_STEALTH;
2183 if (p_ptr->special_defense & NINJA_S_STEALTH)
2186 msg_print("ºÆ¤ÓŨ¤ÎÌܤˤµ¤é¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
2188 msg_print("You are exposed to common sight once more.");
2194 p_ptr->special_defense &= ~(NINJA_S_STEALTH);
2198 /* Nothing to notice */
2199 if (!notice) return (FALSE);
2201 /* Redraw status bar */
2202 p_ptr->redraw |= (PR_STATUS);
2205 if (disturb_state) disturb(0, 0);
2213 * Set "p_ptr->tim_levitation", notice observable changes
2215 bool set_tim_levitation(int v, bool do_dec)
2217 bool notice = FALSE;
2219 /* Hack -- Force good values */
2220 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2222 if (p_ptr->is_dead) return FALSE;
2227 if (p_ptr->tim_levitation && !do_dec)
2229 if (p_ptr->tim_levitation > v) return FALSE;
2231 else if (!p_ptr->tim_levitation)
2234 msg_print("ÂΤ¬Ãè¤ËÉ⤻Ϥ᤿¡£");
2236 msg_print("You begin to fly!");
2246 if (p_ptr->tim_levitation)
2249 msg_print("¤â¤¦Ãè¤ËÉ⤫¤Ù¤Ê¤¯¤Ê¤Ã¤¿¡£");
2251 msg_print("You stop flying.");
2259 p_ptr->tim_levitation = v;
2261 /* Redraw status bar */
2262 p_ptr->redraw |= (PR_STATUS);
2264 /* Nothing to notice */
2265 if (!notice) return (FALSE);
2268 if (disturb_state) disturb(0, 0);
2270 /* Recalculate bonuses */
2271 p_ptr->update |= (PU_BONUS);
2282 * Set "p_ptr->tim_sh_touki", notice observable changes
2284 bool set_tim_sh_touki(int v, bool do_dec)
2286 bool notice = FALSE;
2288 /* Hack -- Force good values */
2289 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2291 if (p_ptr->is_dead) return FALSE;
2296 if (p_ptr->tim_sh_touki && !do_dec)
2298 if (p_ptr->tim_sh_touki > v) return FALSE;
2300 else if (!p_ptr->tim_sh_touki)
2303 msg_print("ÂΤ¬Æ®µ¤¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2305 msg_print("You have enveloped by the aura of the Force!");
2315 if (p_ptr->tim_sh_touki)
2318 msg_print("Æ®µ¤¤¬¾Ã¤¨¤¿¡£");
2320 msg_print("Aura of the Force disappeared.");
2328 p_ptr->tim_sh_touki = v;
2330 /* Redraw status bar */
2331 p_ptr->redraw |= (PR_STATUS);
2333 /* Nothing to notice */
2334 if (!notice) return (FALSE);
2337 if (disturb_state) disturb(0, 0);
2348 * Set "p_ptr->tim_sh_fire", notice observable changes
2350 bool set_tim_sh_fire(int v, bool do_dec)
2352 bool notice = FALSE;
2354 /* Hack -- Force good values */
2355 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2357 if (p_ptr->is_dead) return FALSE;
2362 if (p_ptr->tim_sh_fire && !do_dec)
2364 if (p_ptr->tim_sh_fire > v) return FALSE;
2366 else if (!p_ptr->tim_sh_fire)
2369 msg_print("ÂΤ¬±ê¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2371 msg_print("You have enveloped by fiery aura!");
2381 if (p_ptr->tim_sh_fire)
2384 msg_print("±ê¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2386 msg_print("Fiery aura disappeared.");
2394 p_ptr->tim_sh_fire = v;
2396 /* Redraw status bar */
2397 p_ptr->redraw |= (PR_STATUS);
2399 /* Nothing to notice */
2400 if (!notice) return (FALSE);
2403 if (disturb_state) disturb(0, 0);
2405 /* Recalculate bonuses */
2406 p_ptr->update |= (PU_BONUS);
2417 * Set "p_ptr->tim_sh_holy", notice observable changes
2419 bool set_tim_sh_holy(int v, bool do_dec)
2421 bool notice = FALSE;
2423 /* Hack -- Force good values */
2424 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2426 if (p_ptr->is_dead) return FALSE;
2431 if (p_ptr->tim_sh_holy && !do_dec)
2433 if (p_ptr->tim_sh_holy > v) return FALSE;
2435 else if (!p_ptr->tim_sh_holy)
2438 msg_print("ÂΤ¬À»¤Ê¤ë¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2440 msg_print("You have enveloped by holy aura!");
2450 if (p_ptr->tim_sh_holy)
2453 msg_print("À»¤Ê¤ë¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2455 msg_print("Holy aura disappeared.");
2463 p_ptr->tim_sh_holy = v;
2465 /* Redraw status bar */
2466 p_ptr->redraw |= (PR_STATUS);
2468 /* Nothing to notice */
2469 if (!notice) return (FALSE);
2472 if (disturb_state) disturb(0, 0);
2474 /* Recalculate bonuses */
2475 p_ptr->update |= (PU_BONUS);
2487 * Set "p_ptr->tim_eyeeye", notice observable changes
2489 bool set_tim_eyeeye(int v, bool do_dec)
2491 bool notice = FALSE;
2493 /* Hack -- Force good values */
2494 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2496 if (p_ptr->is_dead) return FALSE;
2501 if (p_ptr->tim_eyeeye && !do_dec)
2503 if (p_ptr->tim_eyeeye > v) return FALSE;
2505 else if (!p_ptr->tim_eyeeye)
2508 msg_print("Ë¡¤Î¼é¤ê¼ê¤Ë¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¡ª");
2510 msg_print("You feel like a keeper of commandments!");
2520 if (p_ptr->tim_eyeeye)
2523 msg_print("Ĩȳ¤ò¼¹¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2525 msg_print("You no longer feel like a keeper.");
2533 p_ptr->tim_eyeeye = v;
2535 /* Redraw status bar */
2536 p_ptr->redraw |= (PR_STATUS);
2538 /* Nothing to notice */
2539 if (!notice) return (FALSE);
2542 if (disturb_state) disturb(0, 0);
2544 /* Recalculate bonuses */
2545 p_ptr->update |= (PU_BONUS);
2557 * Set "p_ptr->resist_magic", notice observable changes
2559 bool set_resist_magic(int v, bool do_dec)
2561 bool notice = FALSE;
2563 /* Hack -- Force good values */
2564 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2566 if (p_ptr->is_dead) return FALSE;
2571 if (p_ptr->resist_magic && !do_dec)
2573 if (p_ptr->resist_magic > v) return FALSE;
2575 else if (!p_ptr->resist_magic)
2578 msg_print("ËâË¡¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿¡£");
2580 msg_print("You have been protected from magic!");
2590 if (p_ptr->resist_magic)
2593 msg_print("ËâË¡¤Ë¼å¤¯¤Ê¤Ã¤¿¡£");
2595 msg_print("You are no longer protected from magic.");
2603 p_ptr->resist_magic = v;
2605 /* Redraw status bar */
2606 p_ptr->redraw |= (PR_STATUS);
2608 /* Nothing to notice */
2609 if (!notice) return (FALSE);
2612 if (disturb_state) disturb(0, 0);
2614 /* Recalculate bonuses */
2615 p_ptr->update |= (PU_BONUS);
2626 * Set "p_ptr->tim_reflect", notice observable changes
2628 bool set_tim_reflect(int v, bool do_dec)
2630 bool notice = FALSE;
2632 /* Hack -- Force good values */
2633 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2635 if (p_ptr->is_dead) return FALSE;
2640 if (p_ptr->tim_reflect && !do_dec)
2642 if (p_ptr->tim_reflect > v) return FALSE;
2644 else if (!p_ptr->tim_reflect)
2647 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2649 msg_print("Your body becames smooth.");
2659 if (p_ptr->tim_reflect)
2662 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ç¤Ê¤¯¤Ê¤Ã¤¿¡£");
2664 msg_print("Your body is no longer smooth.");
2672 p_ptr->tim_reflect = v;
2674 /* Redraw status bar */
2675 p_ptr->redraw |= (PR_STATUS);
2677 /* Nothing to notice */
2678 if (!notice) return (FALSE);
2681 if (disturb_state) disturb(0, 0);
2683 /* Recalculate bonuses */
2684 p_ptr->update |= (PU_BONUS);
2695 * Set "p_ptr->multishadow", notice observable changes
2697 bool set_multishadow(int v, bool do_dec)
2699 bool notice = FALSE;
2701 /* Hack -- Force good values */
2702 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2704 if (p_ptr->is_dead) return FALSE;
2709 if (p_ptr->multishadow && !do_dec)
2711 if (p_ptr->multishadow > v) return FALSE;
2713 else if (!p_ptr->multishadow)
2716 msg_print("¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¸¸±Æ¤¬À¸¤Þ¤ì¤¿¡£");
2718 msg_print("Your Shadow enveloped you.");
2728 if (p_ptr->multishadow)
2731 msg_print("¸¸±Æ¤¬¾Ã¤¨¤¿¡£");
2733 msg_print("Your Shadow disappears.");
2741 p_ptr->multishadow = v;
2743 /* Redraw status bar */
2744 p_ptr->redraw |= (PR_STATUS);
2746 /* Nothing to notice */
2747 if (!notice) return (FALSE);
2750 if (disturb_state) disturb(0, 0);
2752 /* Recalculate bonuses */
2753 p_ptr->update |= (PU_BONUS);
2764 * Set "p_ptr->dustrobe", notice observable changes
2766 bool set_dustrobe(int v, bool do_dec)
2768 bool notice = FALSE;
2770 /* Hack -- Force good values */
2771 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2773 if (p_ptr->is_dead) return FALSE;
2778 if (p_ptr->dustrobe && !do_dec)
2780 if (p_ptr->dustrobe > v) return FALSE;
2782 else if (!p_ptr->dustrobe)
2785 msg_print("ÂΤ¬¶À¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2787 msg_print("You were enveloped by mirror shards.");
2797 if (p_ptr->dustrobe)
2800 msg_print("¶À¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2802 msg_print("The mirror shards disappear.");
2810 p_ptr->dustrobe = v;
2812 /* Redraw status bar */
2813 p_ptr->redraw |= (PR_STATUS);
2815 /* Nothing to notice */
2816 if (!notice) return (FALSE);
2819 if (disturb_state) disturb(0, 0);
2821 /* Recalculate bonuses */
2822 p_ptr->update |= (PU_BONUS);
2833 * Set "p_ptr->tim_regen", notice observable changes
2835 bool set_kabenuke(int v, bool do_dec)
2837 bool notice = FALSE;
2839 /* Hack -- Force good values */
2840 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2842 if (p_ptr->is_dead) return FALSE;
2847 if (p_ptr->kabenuke && !do_dec)
2849 if (p_ptr->kabenuke > v) return FALSE;
2851 else if (!p_ptr->kabenuke)
2854 msg_print("ÂΤ¬È¾Êª¼Á¤Î¾õÂ֤ˤʤä¿¡£");
2856 msg_print("You became ethereal form.");
2866 if (p_ptr->kabenuke)
2869 msg_print("ÂΤ¬Êª¼Á²½¤·¤¿¡£");
2871 msg_print("You are no longer in an ethereal form.");
2879 p_ptr->kabenuke = v;
2881 /* Redraw status bar */
2882 p_ptr->redraw |= (PR_STATUS);
2884 /* Nothing to notice */
2885 if (!notice) return (FALSE);
2888 if (disturb_state) disturb(0, 0);
2890 /* Recalculate bonuses */
2891 p_ptr->update |= (PU_BONUS);
2901 bool set_tsuyoshi(int v, bool do_dec)
2903 bool notice = FALSE;
2905 /* Hack -- Force good values */
2906 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2908 if (p_ptr->is_dead) return FALSE;
2913 if (p_ptr->tsuyoshi && !do_dec)
2915 if (p_ptr->tsuyoshi > v) return FALSE;
2917 else if (!p_ptr->tsuyoshi)
2920 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
2922 msg_print("Brother OKURE!");
2926 chg_virtue(V_VITALITY, 2);
2933 if (p_ptr->tsuyoshi)
2936 msg_print("ÆùÂΤ¬µÞ®¤Ë¤·¤Ü¤ó¤Ç¤¤¤Ã¤¿¡£");
2938 msg_print("Your body had quickly shriveled.");
2941 (void)dec_stat(A_CON, 20, TRUE);
2942 (void)dec_stat(A_STR, 20, TRUE);
2945 chg_virtue(V_VITALITY, -3);
2950 p_ptr->tsuyoshi = v;
2952 /* Redraw status bar */
2953 p_ptr->redraw |= (PR_STATUS);
2955 /* Nothing to notice */
2956 if (!notice) return (FALSE);
2959 if (disturb_state) disturb(0, 0);
2961 /* Recalculate bonuses */
2962 p_ptr->update |= (PU_BONUS);
2964 /* Recalculate hitpoints */
2965 p_ptr->update |= (PU_HP);
2976 * Set a temporary elemental brand. Clear all other brands. Print status
2979 bool set_ele_attack(u32b attack_type, int v)
2981 /* Hack -- Force good values */
2982 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2984 /* Clear all elemental attacks (only one is allowed at a time). */
2985 if ((p_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
2987 p_ptr->special_attack &= ~(ATTACK_ACID);
2989 msg_print("»À¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2991 msg_print("Your temporary acidic brand fades away.");
2994 if ((p_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
2996 p_ptr->special_attack &= ~(ATTACK_ELEC);
2998 msg_print("ÅÅ·â¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
3000 msg_print("Your temporary electrical brand fades away.");
3003 if ((p_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
3005 p_ptr->special_attack &= ~(ATTACK_FIRE);
3007 msg_print("²Ð±ê¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
3009 msg_print("Your temporary fiery brand fades away.");
3012 if ((p_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
3014 p_ptr->special_attack &= ~(ATTACK_COLD);
3016 msg_print("Î䵤¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
3018 msg_print("Your temporary frost brand fades away.");
3021 if ((p_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
3023 p_ptr->special_attack &= ~(ATTACK_POIS);
3025 msg_print("ÆǤǹ¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
3027 msg_print("Your temporary poison brand fades away.");
3031 if ((v) && (attack_type))
3033 /* Set attack type. */
3034 p_ptr->special_attack |= (attack_type);
3037 p_ptr->ele_attack = v;
3041 msg_format("%s¤Ç¹¶·â¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª",
3042 ((attack_type == ATTACK_ACID) ? "»À" :
3043 ((attack_type == ATTACK_ELEC) ? "ÅÅ·â" :
3044 ((attack_type == ATTACK_FIRE) ? "²Ð±ê" :
3045 ((attack_type == ATTACK_COLD) ? "Î䵤" :
3046 ((attack_type == ATTACK_POIS) ? "ÆÇ" :
3049 msg_format("For a while, the blows you deal will %s",
3050 ((attack_type == ATTACK_ACID) ? "melt with acid!" :
3051 ((attack_type == ATTACK_ELEC) ? "shock your foes!" :
3052 ((attack_type == ATTACK_FIRE) ? "burn with fire!" :
3053 ((attack_type == ATTACK_COLD) ? "chill to the bone!" :
3054 ((attack_type == ATTACK_POIS) ? "poison your enemies!" :
3055 "do nothing special."))))));
3060 if (disturb_state) disturb(0, 0);
3062 /* Redraw status bar */
3063 p_ptr->redraw |= (PR_STATUS);
3065 p_ptr->update |= (PU_BONUS);
3075 * Set a temporary elemental brand. Clear all other brands. Print status
3078 bool set_ele_immune(u32b immune_type, int v)
3080 /* Hack -- Force good values */
3081 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3083 /* Clear all elemental attacks (only one is allowed at a time). */
3084 if ((p_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
3086 p_ptr->special_defense &= ~(DEFENSE_ACID);
3088 msg_print("»À¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3090 msg_print("You are no longer immune to acid.");
3093 if ((p_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
3095 p_ptr->special_defense &= ~(DEFENSE_ELEC);
3097 msg_print("ÅÅ·â¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3099 msg_print("You are no longer immune to electricity.");
3102 if ((p_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
3104 p_ptr->special_defense &= ~(DEFENSE_FIRE);
3106 msg_print("²Ð±ê¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3108 msg_print("You are no longer immune to fire.");
3111 if ((p_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
3113 p_ptr->special_defense &= ~(DEFENSE_COLD);
3115 msg_print("Î䵤¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3117 msg_print("You are no longer immune to cold.");
3120 if ((p_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
3122 p_ptr->special_defense &= ~(DEFENSE_POIS);
3124 msg_print("ÆǤι¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3126 msg_print("You are no longer immune to poison.");
3130 if ((v) && (immune_type))
3132 /* Set attack type. */
3133 p_ptr->special_defense |= (immune_type);
3136 p_ptr->ele_immune = v;
3140 msg_format("%s¤Î¹¶·â¤ò¼õ¤±¤Ä¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª",
3141 ((immune_type == DEFENSE_ACID) ? "»À" :
3142 ((immune_type == DEFENSE_ELEC) ? "ÅÅ·â" :
3143 ((immune_type == DEFENSE_FIRE) ? "²Ð±ê" :
3144 ((immune_type == DEFENSE_COLD) ? "Î䵤" :
3145 ((immune_type == DEFENSE_POIS) ? "ÆÇ" :
3148 msg_format("For a while, You are immune to %s",
3149 ((immune_type == DEFENSE_ACID) ? "acid!" :
3150 ((immune_type == DEFENSE_ELEC) ? "electricity!" :
3151 ((immune_type == DEFENSE_FIRE) ? "fire!" :
3152 ((immune_type == DEFENSE_COLD) ? "cold!" :
3153 ((immune_type == DEFENSE_POIS) ? "poison!" :
3154 "do nothing special."))))));
3159 if (disturb_state) disturb(0, 0);
3161 /* Redraw status bar */
3162 p_ptr->redraw |= (PR_STATUS);
3164 p_ptr->update |= (PU_BONUS);
3174 * Set "p_ptr->oppose_acid", notice observable changes
3176 bool set_oppose_acid(int v, bool do_dec)
3178 bool notice = FALSE;
3180 /* Hack -- Force good values */
3181 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3183 if (p_ptr->is_dead) return FALSE;
3188 if (p_ptr->oppose_acid && !do_dec)
3190 if (p_ptr->oppose_acid > v) return FALSE;
3192 else if (!IS_OPPOSE_ACID())
3195 msg_print("»À¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3197 msg_print("You feel resistant to acid!");
3207 if (p_ptr->oppose_acid && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3210 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3212 msg_print("You feel less resistant to acid.");
3220 p_ptr->oppose_acid = v;
3222 /* Nothing to notice */
3223 if (!notice) return (FALSE);
3225 /* Redraw status bar */
3226 p_ptr->redraw |= (PR_STATUS);
3229 if (disturb_state) disturb(0, 0);
3240 * Set "p_ptr->oppose_elec", notice observable changes
3242 bool set_oppose_elec(int v, bool do_dec)
3244 bool notice = FALSE;
3246 /* Hack -- Force good values */
3247 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3249 if (p_ptr->is_dead) return FALSE;
3254 if (p_ptr->oppose_elec && !do_dec)
3256 if (p_ptr->oppose_elec > v) return FALSE;
3258 else if (!IS_OPPOSE_ELEC())
3261 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3263 msg_print("You feel resistant to electricity!");
3273 if (p_ptr->oppose_elec && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3276 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3278 msg_print("You feel less resistant to electricity.");
3286 p_ptr->oppose_elec = v;
3288 /* Nothing to notice */
3289 if (!notice) return (FALSE);
3291 /* Redraw status bar */
3292 p_ptr->redraw |= (PR_STATUS);
3295 if (disturb_state) disturb(0, 0);
3306 * Set "p_ptr->oppose_fire", notice observable changes
3308 bool set_oppose_fire(int v, bool do_dec)
3310 bool notice = FALSE;
3312 /* Hack -- Force good values */
3313 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3315 if (p_ptr->is_dead) return FALSE;
3317 if ((prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
3321 if (p_ptr->oppose_fire && !do_dec)
3323 if (p_ptr->oppose_fire > v) return FALSE;
3325 else if (!IS_OPPOSE_FIRE())
3328 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3330 msg_print("You feel resistant to fire!");
3340 if (p_ptr->oppose_fire && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3343 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3345 msg_print("You feel less resistant to fire.");
3353 p_ptr->oppose_fire = v;
3355 /* Nothing to notice */
3356 if (!notice) return (FALSE);
3358 /* Redraw status bar */
3359 p_ptr->redraw |= (PR_STATUS);
3362 if (disturb_state) disturb(0, 0);
3373 * Set "p_ptr->oppose_cold", notice observable changes
3375 bool set_oppose_cold(int v, bool do_dec)
3377 bool notice = FALSE;
3379 /* Hack -- Force good values */
3380 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3382 if (p_ptr->is_dead) return FALSE;
3387 if (p_ptr->oppose_cold && !do_dec)
3389 if (p_ptr->oppose_cold > v) return FALSE;
3391 else if (!IS_OPPOSE_COLD())
3394 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3396 msg_print("You feel resistant to cold!");
3406 if (p_ptr->oppose_cold && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3409 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3411 msg_print("You feel less resistant to cold.");
3419 p_ptr->oppose_cold = v;
3421 /* Nothing to notice */
3422 if (!notice) return (FALSE);
3424 /* Redraw status bar */
3425 p_ptr->redraw |= (PR_STATUS);
3428 if (disturb_state) disturb(0, 0);
3439 * Set "p_ptr->oppose_pois", notice observable changes
3441 bool set_oppose_pois(int v, bool do_dec)
3443 bool notice = FALSE;
3445 /* Hack -- Force good values */
3446 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3448 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) v = 1;
3449 if (p_ptr->is_dead) return FALSE;
3454 if (p_ptr->oppose_pois && !do_dec)
3456 if (p_ptr->oppose_pois > v) return FALSE;
3458 else if (!IS_OPPOSE_POIS())
3461 msg_print("ÆǤؤÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3463 msg_print("You feel resistant to poison!");
3473 if (p_ptr->oppose_pois && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3476 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3478 msg_print("You feel less resistant to poison.");
3486 p_ptr->oppose_pois = v;
3488 /* Nothing to notice */
3489 if (!notice) return (FALSE);
3491 /* Redraw status bar */
3492 p_ptr->redraw |= (PR_STATUS);
3495 if (disturb_state) disturb(0, 0);
3506 * Set "p_ptr->stun", notice observable changes
3508 * Note the special code to only notice "range" changes.
3510 bool set_stun(int v)
3512 int old_aux, new_aux;
3513 bool notice = FALSE;
3516 /* Hack -- Force good values */
3517 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3519 if (p_ptr->is_dead) return FALSE;
3521 if (prace_is_(RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
3524 if (p_ptr->stun > 100)
3530 else if (p_ptr->stun > 50)
3536 else if (p_ptr->stun > 0)
3572 if (new_aux > old_aux)
3574 /* Describe the state */
3580 msg_print("°Õ¼±¤¬¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3582 msg_print("You have been stunned.");
3590 msg_print("°Õ¼±¤¬¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3592 msg_print("You have been heavily stunned.");
3600 msg_print("Ƭ¤¬¥¯¥é¥¯¥é¤·¤Æ°Õ¼±¤¬±ó¤Î¤¤¤Æ¤¤¿¡£");
3602 msg_print("You have been knocked out.");
3608 if (randint1(1000) < v || one_in_(16))
3611 msg_print("³ä¤ì¤ë¤è¤¦¤ÊƬÄˤ¬¤¹¤ë¡£");
3613 msg_print("A vicious blow hits your head.");
3618 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3619 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3621 else if (one_in_(2))
3623 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3627 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3630 if (p_ptr->special_defense & KATA_MASK)
3633 msg_print("·¿¤¬Êø¤ì¤¿¡£");
3635 msg_print("Your posture gets loose.");
3637 p_ptr->special_defense &= ~(KATA_MASK);
3638 p_ptr->update |= (PU_BONUS);
3639 p_ptr->update |= (PU_MONSTERS);
3640 p_ptr->redraw |= (PR_STATE);
3641 p_ptr->redraw |= (PR_STATUS);
3642 p_ptr->action = ACTION_NONE;
3646 if (p_ptr->concent) reset_concentration(TRUE);
3649 if (hex_spelling_any()) stop_hex_spell_all();
3656 else if (new_aux < old_aux)
3658 /* Describe the state */
3664 msg_print("¤ä¤Ã¤ÈÛ¯Û°¾õÂÖ¤«¤é²óÉü¤·¤¿¡£");
3666 msg_print("You are no longer stunned.");
3669 if (disturb_state) disturb(0, 0);
3681 if (!notice) return (FALSE);
3684 if (disturb_state) disturb(0, 0);
3686 /* Recalculate bonuses */
3687 p_ptr->update |= (PU_BONUS);
3689 /* Redraw the "stun" */
3690 p_ptr->redraw |= (PR_STUN);
3701 * Set "p_ptr->cut", notice observable changes
3703 * Note the special code to only notice "range" changes.
3707 int old_aux, new_aux;
3708 bool notice = FALSE;
3710 /* Hack -- Force good values */
3711 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3713 if (p_ptr->is_dead) return FALSE;
3715 if ((p_ptr->prace == RACE_GOLEM ||
3716 p_ptr->prace == RACE_SKELETON ||
3717 p_ptr->prace == RACE_SPECTRE ||
3718 (p_ptr->prace == RACE_ZOMBIE && p_ptr->lev > 11)) &&
3723 if (p_ptr->cut > 1000)
3729 else if (p_ptr->cut > 200)
3735 else if (p_ptr->cut > 100)
3741 else if (p_ptr->cut > 50)
3747 else if (p_ptr->cut > 25)
3753 else if (p_ptr->cut > 10)
3759 else if (p_ptr->cut > 0)
3819 if (new_aux > old_aux)
3821 /* Describe the state */
3827 msg_print("¤«¤¹¤ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3829 msg_print("You have been given a graze.");
3837 msg_print("·Ú¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3839 msg_print("You have been given a light cut.");
3847 msg_print("¤Ò¤É¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3849 msg_print("You have been given a bad cut.");
3857 msg_print("ÂçÊѤʽý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3859 msg_print("You have been given a nasty cut.");
3867 msg_print("½ÅÂç¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3869 msg_print("You have been given a severe cut.");
3877 msg_print("¤Ò¤É¤¤¿¼¼ê¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3879 msg_print("You have been given a deep gash.");
3887 msg_print("Ã×̿Ū¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3889 msg_print("You have been given a mortal wound.");
3898 if (randint1(1000) < v || one_in_(16))
3900 if (!p_ptr->sustain_chr)
3903 msg_print("¤Ò¤É¤¤½ýÀפ¬»Ä¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3905 msg_print("You have been horribly scarred.");
3915 else if (new_aux < old_aux)
3917 /* Describe the state */
3923 msg_format("¤ä¤Ã¤È%s¡£", p_ptr->prace == RACE_ANDROID ? "²ø²æ¤¬Ä¾¤Ã¤¿" : "½Ð·ì¤¬»ß¤Þ¤Ã¤¿");
3925 msg_print("You are no longer bleeding.");
3928 if (disturb_state) disturb(0, 0);
3940 if (!notice) return (FALSE);
3943 if (disturb_state) disturb(0, 0);
3945 /* Recalculate bonuses */
3946 p_ptr->update |= (PU_BONUS);
3948 /* Redraw the "cut" */
3949 p_ptr->redraw |= (PR_CUT);
3960 * Set "p_ptr->food", notice observable changes
3962 * The "p_ptr->food" variable can get as large as 20000, allowing the
3963 * addition of the most "filling" item, Elvish Waybread, which adds
3964 * 7500 food units, without overflowing the 32767 maximum limit.
3966 * Perhaps we should disturb the player with various messages,
3967 * especially messages about hunger status changes. XXX XXX XXX
3969 * Digestion of food is handled in "dungeon.c", in which, normally,
3970 * the player digests about 20 food units per 100 game turns, more
3971 * when "fast", more when "regenerating", less with "slow digestion",
3972 * but when the player is "gorged", he digests 100 food units per 10
3973 * game turns, or a full 1000 food units per 100 game turns.
3975 * Note that the player's speed is reduced by 10 units while gorged,
3976 * so if the player eats a single food ration (5000 food units) when
3977 * full (15000 food units), he will be gorged for (5000/100)*10 = 500
3978 * game turns, or 500/(100/5) = 25 player turns (if nothing else is
3979 * affecting the player speed).
3981 bool set_food(int v)
3983 int old_aux, new_aux;
3985 bool notice = FALSE;
3987 /* Hack -- Force good values */
3988 v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
3990 /* Fainting / Starving */
3991 if (p_ptr->food < PY_FOOD_FAINT)
3997 else if (p_ptr->food < PY_FOOD_WEAK)
4003 else if (p_ptr->food < PY_FOOD_ALERT)
4009 else if (p_ptr->food < PY_FOOD_FULL)
4015 else if (p_ptr->food < PY_FOOD_MAX)
4026 /* Fainting / Starving */
4027 if (v < PY_FOOD_FAINT)
4033 else if (v < PY_FOOD_WEAK)
4039 else if (v < PY_FOOD_ALERT)
4045 else if (v < PY_FOOD_FULL)
4051 else if (v < PY_FOOD_MAX)
4062 if (old_aux < 1 && new_aux > 0)
4063 chg_virtue(V_PATIENCE, 2);
4064 else if (old_aux < 3 && (old_aux != new_aux))
4065 chg_virtue(V_PATIENCE, 1);
4067 chg_virtue(V_TEMPERANCE, 1);
4069 chg_virtue(V_TEMPERANCE, -1);
4072 if (new_aux > old_aux)
4074 /* Describe the state */
4080 msg_print("¤Þ¤À¶õÊ¢¤ÇÅݤ줽¤¦¤À¡£");
4082 msg_print("You are still weak.");
4090 msg_print("¤Þ¤À¶õÊ¢¤À¡£");
4092 msg_print("You are still hungry.");
4100 msg_print("¶õÊ¢´¶¤¬¤ª¤µ¤Þ¤Ã¤¿¡£");
4102 msg_print("You are no longer hungry.");
4110 msg_print("ËþÊ¢¤À¡ª");
4112 msg_print("You are full!");
4120 msg_print("¿©¤Ù²á¤®¤À¡ª");
4122 msg_print("You have gorged yourself!");
4124 chg_virtue(V_HARMONY, -1);
4125 chg_virtue(V_PATIENCE, -1);
4126 chg_virtue(V_TEMPERANCE, -2);
4136 else if (new_aux < old_aux)
4138 /* Describe the state */
4141 /* Fainting / Starving */
4144 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
4146 msg_print("You are getting faint from hunger!");
4154 msg_print("¤ªÊ¢¤¬¶õ¤¤¤ÆÅݤ줽¤¦¤À¡£");
4156 msg_print("You are getting weak from hunger!");
4164 msg_print("¤ªÊ¢¤¬¶õ¤¤¤Æ¤¤¿¡£");
4166 msg_print("You are getting hungry.");
4174 msg_print("ËþÊ¢´¶¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
4176 msg_print("You are no longer full.");
4184 msg_print("¤ä¤Ã¤È¤ªÊ¢¤¬¤¤Ä¤¯¤Ê¤¯¤Ê¤Ã¤¿¡£");
4186 msg_print("You are no longer gorged.");
4192 if (p_ptr->wild_mode && (new_aux < 2))
4204 /* Nothing to notice */
4205 if (!notice) return (FALSE);
4208 if (disturb_state) disturb(0, 0);
4210 /* Recalculate bonuses */
4211 p_ptr->update |= (PU_BONUS);
4214 p_ptr->redraw |= (PR_HUNGER);
4224 * Increases a stat by one randomized level -RAK-
4226 * Note that this function (used by stat potions) now restores
4227 * the stat BEFORE increasing it.
4229 bool inc_stat(int stat)
4233 /* Then augment the current/max stat */
4234 value = p_ptr->stat_cur[stat];
4236 /* Cannot go above 18/100 */
4237 if (value < p_ptr->stat_max_max[stat])
4239 /* Gain one (sometimes two) points */
4242 gain = ((randint0(100) < 75) ? 1 : 2);
4246 /* Gain 1/6 to 1/3 of distance to 18/100 */
4247 else if (value < (p_ptr->stat_max_max[stat]-2))
4249 /* Approximate gain value */
4250 gain = (((p_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
4253 if (gain < 1) gain = 1;
4255 /* Apply the bonus */
4256 value += randint1(gain) + gain / 2;
4259 if (value > (p_ptr->stat_max_max[stat]-1)) value = p_ptr->stat_max_max[stat]-1;
4262 /* Gain one point at a time */
4268 /* Save the new value */
4269 p_ptr->stat_cur[stat] = value;
4271 /* Bring up the maximum too */
4272 if (value > p_ptr->stat_max[stat])
4274 p_ptr->stat_max[stat] = value;
4277 /* Recalculate bonuses */
4278 p_ptr->update |= (PU_BONUS);
4284 /* Nothing to gain */
4291 * Decreases a stat by an amount indended to vary from 0 to 100 percent.
4293 * Amount could be a little higher in extreme cases to mangle very high
4294 * stats from massive assaults. -CWS
4296 * Note that "permanent" means that the *given* amount is permanent,
4297 * not that the new value becomes permanent. This may not work exactly
4298 * as expected, due to "weirdness" in the algorithm, but in general,
4299 * if your stat is already drained, the "max" value will not drop all
4300 * the way down to the "cur" value.
4302 bool dec_stat(int stat, int amount, int permanent)
4304 int cur, max, loss, same, res = FALSE;
4307 /* Acquire current value */
4308 cur = p_ptr->stat_cur[stat];
4309 max = p_ptr->stat_max[stat];
4311 /* Note when the values are identical */
4312 same = (cur == max);
4314 /* Damage "current" value */
4317 /* Handle "low" values */
4320 if (amount > 90) cur--;
4321 if (amount > 50) cur--;
4322 if (amount > 20) cur--;
4326 /* Handle "high" values */
4329 /* Hack -- Decrement by a random amount between one-quarter */
4330 /* and one-half of the stat bonus times the percentage, with a */
4331 /* minimum damage of half the percentage. -CWS */
4332 loss = (((cur-18) / 2 + 1) / 2 + 1);
4335 if (loss < 1) loss = 1;
4337 /* Randomize the loss */
4338 loss = ((randint1(loss) + loss) * amount) / 100;
4341 if (loss < amount/2) loss = amount/2;
4343 /* Lose some points */
4346 /* Hack -- Only reduce stat to 17 sometimes */
4347 if (cur < 18) cur = (amount <= 20) ? 18 : 17;
4350 /* Prevent illegal values */
4351 if (cur < 3) cur = 3;
4353 /* Something happened */
4354 if (cur != p_ptr->stat_cur[stat]) res = TRUE;
4357 /* Damage "max" value */
4358 if (permanent && (max > 3))
4360 chg_virtue(V_SACRIFICE, 1);
4361 if (stat == A_WIS || stat == A_INT)
4362 chg_virtue(V_ENLIGHTEN, -2);
4364 /* Handle "low" values */
4367 if (amount > 90) max--;
4368 if (amount > 50) max--;
4369 if (amount > 20) max--;
4373 /* Handle "high" values */
4376 /* Hack -- Decrement by a random amount between one-quarter */
4377 /* and one-half of the stat bonus times the percentage, with a */
4378 /* minimum damage of half the percentage. -CWS */
4379 loss = (((max-18) / 2 + 1) / 2 + 1);
4380 loss = ((randint1(loss) + loss) * amount) / 100;
4381 if (loss < amount/2) loss = amount/2;
4383 /* Lose some points */
4386 /* Hack -- Only reduce stat to 17 sometimes */
4387 if (max < 18) max = (amount <= 20) ? 18 : 17;
4390 /* Hack -- keep it clean */
4391 if (same || (max < cur)) max = cur;
4393 /* Something happened */
4394 if (max != p_ptr->stat_max[stat]) res = TRUE;
4400 /* Actually set the stat to its new value. */
4401 p_ptr->stat_cur[stat] = cur;
4402 p_ptr->stat_max[stat] = max;
4404 /* Redisplay the stats later */
4405 p_ptr->redraw |= (PR_STATS);
4407 /* Recalculate bonuses */
4408 p_ptr->update |= (PU_BONUS);
4417 * Restore a stat. Return TRUE only if this actually makes a difference.
4419 bool res_stat(int stat)
4421 /* Restore if needed */
4422 if (p_ptr->stat_cur[stat] != p_ptr->stat_max[stat])
4425 p_ptr->stat_cur[stat] = p_ptr->stat_max[stat];
4427 /* Recalculate bonuses */
4428 p_ptr->update |= (PU_BONUS);
4430 /* Redisplay the stats later */
4431 p_ptr->redraw |= (PR_STATS);
4437 /* Nothing to restore */
4443 * Increase players hit points, notice effects
4445 bool hp_player(int num)
4448 vir = virtue_number(V_VITALITY);
4451 num = num * (p_ptr->virtues[vir - 1] + 1250) / 1250;
4453 /* Healing needed */
4454 if (p_ptr->chp < p_ptr->mhp)
4456 if ((num > 0) && (p_ptr->chp < (p_ptr->mhp/3)))
4457 chg_virtue(V_TEMPERANCE, 1);
4458 /* Gain hitpoints */
4461 /* Enforce maximum */
4462 if (p_ptr->chp >= p_ptr->mhp)
4464 p_ptr->chp = p_ptr->mhp;
4465 p_ptr->chp_frac = 0;
4469 p_ptr->redraw |= (PR_HP);
4472 p_ptr->window |= (PW_PLAYER);
4478 msg_print("¾¯¤·µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4480 msg_print("You feel a little better.");
4489 msg_print("µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4491 msg_print("You feel better.");
4500 msg_print("¤È¤Æ¤âµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4502 msg_print("You feel much better.");
4511 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4513 msg_print("You feel very good.");
4528 * Array of stat "descriptions"
4530 static cptr desc_stat_pos[] =
4572 * Array of stat "descriptions"
4574 static cptr desc_stat_neg[] =
4598 bool do_dec_stat(int stat)
4602 /* Access the "sustain" */
4605 case A_STR: if (p_ptr->sustain_str) sust = TRUE; break;
4606 case A_INT: if (p_ptr->sustain_int) sust = TRUE; break;
4607 case A_WIS: if (p_ptr->sustain_wis) sust = TRUE; break;
4608 case A_DEX: if (p_ptr->sustain_dex) sust = TRUE; break;
4609 case A_CON: if (p_ptr->sustain_con) sust = TRUE; break;
4610 case A_CHR: if (p_ptr->sustain_chr) sust = TRUE; break;
4614 if (sust && (!ironman_nightmare || randint0(13)))
4618 msg_format("%s¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¤¬¡¢¤¹¤°¤Ë¸µ¤ËÌá¤Ã¤¿¡£",
4620 msg_format("You feel %s for a moment, but the feeling passes.",
4623 desc_stat_neg[stat]);
4629 /* Attempt to reduce the stat */
4630 if (dec_stat(stat, 10, (ironman_nightmare && !randint0(13))))
4634 msg_format("¤Ò¤É¤¯%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_neg[stat]);
4636 msg_format("You feel very %s.", desc_stat_neg[stat]);
4644 /* Nothing obvious */
4650 * Restore lost "points" in a stat
4652 bool do_res_stat(int stat)
4654 /* Attempt to increase */
4659 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4661 msg_format("You feel less %s.", desc_stat_neg[stat]);
4669 /* Nothing obvious */
4675 * Gain a "point" in a stat
4677 bool do_inc_stat(int stat)
4681 /* Restore strength */
4682 res = res_stat(stat);
4684 /* Attempt to increase */
4689 chg_virtue(V_ENLIGHTEN, 1);
4690 chg_virtue(V_FAITH, 1);
4692 else if (stat == A_INT)
4694 chg_virtue(V_KNOWLEDGE, 1);
4695 chg_virtue(V_ENLIGHTEN, 1);
4697 else if (stat == A_CON)
4698 chg_virtue(V_VITALITY, 1);
4702 msg_format("¥ï¡¼¥ª¡ª¤È¤Æ¤â%s¤Ê¤Ã¤¿¡ª", desc_stat_pos[stat]);
4704 msg_format("Wow! You feel very %s!", desc_stat_pos[stat]);
4712 /* Restoration worked */
4717 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4719 msg_format("You feel less %s.", desc_stat_neg[stat]);
4727 /* Nothing obvious */
4733 * Restores any drained experience
4735 bool restore_level(void)
4737 /* Restore experience */
4738 if (p_ptr->exp < p_ptr->max_exp)
4742 msg_print("À¸Ì¿ÎϤ¬Ìá¤Ã¤Æ¤¤¿µ¤¤¬¤¹¤ë¡£");
4744 msg_print("You feel your life energies returning.");
4748 /* Restore the experience */
4749 p_ptr->exp = p_ptr->max_exp;
4751 /* Check the experience */
4766 bool lose_all_info(void)
4770 chg_virtue(V_KNOWLEDGE, -5);
4771 chg_virtue(V_ENLIGHTEN, -5);
4773 /* Forget info about objects */
4774 for (i = 0; i < INVEN_TOTAL; i++)
4776 object_type *o_ptr = &inventory[i];
4778 /* Skip non-objects */
4779 if (!o_ptr->k_idx) continue;
4781 /* Allow "protection" by the MENTAL flag */
4782 if (o_ptr->ident & (IDENT_MENTAL)) continue;
4784 /* Remove "default inscriptions" */
4785 o_ptr->feeling = FEEL_NONE;
4787 /* Hack -- Clear the "empty" flag */
4788 o_ptr->ident &= ~(IDENT_EMPTY);
4790 /* Hack -- Clear the "known" flag */
4791 o_ptr->ident &= ~(IDENT_KNOWN);
4793 /* Hack -- Clear the "felt" flag */
4794 o_ptr->ident &= ~(IDENT_SENSE);
4797 /* Recalculate bonuses */
4798 p_ptr->update |= (PU_BONUS);
4800 /* Combine / Reorder the pack (later) */
4801 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
4804 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
4806 /* Mega-Hack -- Forget the map */
4814 void do_poly_wounds(void)
4816 /* Changed to always provide at least _some_ healing */
4817 s16b wounds = p_ptr->cut;
4818 s16b hit_p = (p_ptr->mhp - p_ptr->chp);
4819 s16b change = damroll(p_ptr->lev, 5);
4820 bool Nasty_effect = one_in_(5);
4822 if (!(wounds || hit_p || Nasty_effect)) return;
4825 msg_print("½ý¤¬¤è¤ê·Ú¤¤¤â¤Î¤ËÊѲ½¤·¤¿¡£");
4827 msg_print("Your wounds are polymorphed into less serious ones.");
4834 msg_print("¿·¤¿¤Ê½ý¤¬¤Ç¤¤¿¡ª");
4835 take_hit(DAMAGE_LOSELIFE, change / 2, "ÊѲ½¤·¤¿½ý", -1);
4837 msg_print("A new wound was created!");
4838 take_hit(DAMAGE_LOSELIFE, change / 2, "a polymorphed wound", -1);
4845 set_cut(p_ptr->cut - (change / 2));
4851 * Change player race
4853 void change_race(int new_race, cptr effect_msg)
4855 cptr title = race_info[new_race].title;
4856 int old_race = p_ptr->prace;
4859 msg_format("¤¢¤Ê¤¿¤Ï%s%s¤ËÊѲ½¤·¤¿¡ª", effect_msg, title);
4861 msg_format("You turn into %s %s%s!", (!effect_msg[0] && is_a_vowel(title[0]) ? "an" : "a"), effect_msg, title);
4864 chg_virtue(V_CHANCE, 2);
4866 if (p_ptr->prace < 32)
4868 p_ptr->old_race1 |= 1L << p_ptr->prace;
4872 p_ptr->old_race2 |= 1L << (p_ptr->prace-32);
4874 p_ptr->prace = new_race;
4875 rp_ptr = &race_info[p_ptr->prace];
4877 /* Experience factor */
4878 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
4881 * The speed bonus of Klackons and Sprites are disabled
4882 * and the experience penalty is decreased.
4884 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)))
4885 p_ptr->expfact -= 15;
4887 /* Get character's height and weight */
4888 get_height_weight();
4891 if (p_ptr->pclass == CLASS_SORCERER)
4892 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
4894 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
4896 do_cmd_rerate(FALSE);
4898 /* The experience level may be modified */
4901 p_ptr->redraw |= (PR_BASIC);
4903 p_ptr->update |= (PU_BONUS);
4907 /* Load an autopick preference file */
4908 if (old_race != p_ptr->prace) autopick_load_pref(FALSE);
4910 /* Player's graphic tile may change */
4915 void do_poly_self(void)
4917 int power = p_ptr->lev;
4920 msg_print("¤¢¤Ê¤¿¤ÏÊѲ½¤Îˬ¤ì¤ò´¶¤¸¤¿...");
4922 msg_print("You feel a change coming over you...");
4925 chg_virtue(V_CHANCE, 1);
4927 if ((power > randint0(20)) && one_in_(3) && (p_ptr->prace != RACE_ANDROID))
4929 char effect_msg[80] = "";
4930 int new_race, expfact, goalexpfact;
4932 /* Some form of racial polymorph... */
4935 if ((power > randint0(5)) && one_in_(4))
4940 if (p_ptr->psex == SEX_MALE)
4942 p_ptr->psex = SEX_FEMALE;
4943 sp_ptr = &sex_info[p_ptr->psex];
4945 sprintf(effect_msg, "½÷À¤Î");
4947 sprintf(effect_msg, "female ");
4953 p_ptr->psex = SEX_MALE;
4954 sp_ptr = &sex_info[p_ptr->psex];
4956 sprintf(effect_msg, "ÃËÀ¤Î");
4958 sprintf(effect_msg, "male ");
4964 if ((power > randint0(30)) && one_in_(5))
4968 /* Harmful deformity */
4975 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
4981 /* Deformities are discriminated against! */
4982 (void)dec_stat(A_CHR, randint1(6), TRUE);
4988 sprintf(tmp_msg,"%s",effect_msg);
4989 sprintf(effect_msg,"´ñ·Á¤Î%s",tmp_msg);
4991 sprintf(tmp_msg,"%s ",effect_msg);
4992 sprintf(effect_msg,"deformed %s ",tmp_msg);
4999 sprintf(effect_msg,"´ñ·Á¤Î");
5001 sprintf(effect_msg,"deformed ");
5007 while ((power > randint0(20)) && one_in_(10))
5009 /* Polymorph into a less mutated form */
5012 if (!lose_mutation(0))
5014 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
5016 msg_print("You feel oddly normal.");
5022 * Restrict the race choices by exp penalty so
5023 * weak polymorph always means weak race
5028 goalexpfact = 100 + 3 * randint0(power);
5032 new_race = randint0(MAX_RACES);
5033 expfact = race_info[new_race].r_exp;
5035 while (((new_race == p_ptr->prace) && (expfact > goalexpfact)) || (new_race == RACE_ANDROID));
5037 change_race(new_race, effect_msg);
5040 if ((power > randint0(30)) && one_in_(6))
5048 msg_format("%s¤Î¹½À®¤¬ÊѲ½¤·¤¿¡ª", p_ptr->prace == RACE_ANDROID ? "µ¡³£" : "Æâ¡");
5050 msg_print("Your internal organs are rearranged!");
5055 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
5061 msg_print("¸½ºß¤Î»Ñ¤ÇÀ¸¤¤Æ¤¤¤¯¤Î¤Ïº¤Æñ¤Ê¤è¤¦¤À¡ª");
5062 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), "Ã×̿Ū¤ÊÆÍÁ³ÊÑ°Û", -1);
5064 msg_print("You find living difficult in your present form!");
5065 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), "a lethal mutation", -1);
5072 if ((power > randint0(20)) && one_in_(4))
5077 do_cmd_rerate(FALSE);
5080 while ((power > randint0(15)) && one_in_(3))
5083 (void)gain_random_mutation(0);
5086 if (power > randint0(5))
5092 /* Note: earlier deductions may have left power < 0 already. */
5102 * Decreases players hit points and sets death flag if necessary
5104 * XXX XXX XXX Invulnerability needs to be changed into a "shield"
5106 * XXX XXX XXX Hack -- this function allows the user to save (or quit)
5107 * the game when he dies, since the "You die." message is shown before
5108 * setting the player to "dead".
5111 int take_hit(int damage_type, int damage, cptr hit_from, int monspell)
5113 int old_chp = p_ptr->chp;
5115 char death_message[1024];
5118 int warning = (p_ptr->mhp * hitpoint_warn / 10);
5121 if (p_ptr->is_dead) return 0;
5123 if (p_ptr->sutemi) damage *= 2;
5124 if (p_ptr->special_defense & KATA_IAI) damage += (damage + 4) / 5;
5126 if (easy_band) damage = (damage+1)/2;
5128 if (damage_type != DAMAGE_USELIFE)
5138 if (monspell >= 0) learn_spell(monspell);
5140 /* Mega-Hack -- Apply "invulnerability" */
5141 if ((damage_type != DAMAGE_USELIFE) && (damage_type != DAMAGE_LOSELIFE))
5143 if (IS_INVULN() && (damage < 9000))
5145 if (damage_type == DAMAGE_FORCE)
5148 msg_print("¥Ð¥ê¥¢¤¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5150 msg_print("The attack cuts your shield of invulnerability open!");
5153 else if (one_in_(PENETRATE_INVULNERABILITY))
5156 msg_print("̵Ũ¤Î¥Ð¥ê¥¢¤òÇˤäƹ¶·â¤µ¤ì¤¿¡ª");
5158 msg_print("The attack penetrates your shield of invulnerability!");
5167 if (CHECK_MULTISHADOW())
5169 if (damage_type == DAMAGE_FORCE)
5172 msg_print("¸¸±Æ¤â¤í¤È¤âÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5174 msg_print("The attack hits Shadow together with you!");
5177 else if (damage_type == DAMAGE_ATTACK)
5180 msg_print("¹¶·â¤Ï¸¸±Æ¤ËÌ¿Ã椷¡¢¤¢¤Ê¤¿¤Ë¤ÏÆϤ«¤Ê¤«¤Ã¤¿¡£");
5182 msg_print("The attack hits Shadow, you are unharmed!");
5188 if (p_ptr->wraith_form)
5190 if (damage_type == DAMAGE_FORCE)
5193 msg_print("Ⱦʪ¼Á¤ÎÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5195 msg_print("The attack cuts through your ethereal body!");
5201 if ((damage == 0) && one_in_(2)) damage = 1;
5205 if (p_ptr->special_defense & KATA_MUSOU)
5208 if ((damage == 0) && one_in_(2)) damage = 1;
5210 } /* not if LOSELIFE USELIFE */
5212 /* Hurt the player */
5213 p_ptr->chp -= damage;
5214 if(damage_type == DAMAGE_GENO && p_ptr->chp < 0)
5216 damage += p_ptr->chp;
5220 /* Display the hitpoints */
5221 p_ptr->redraw |= (PR_HP);
5224 p_ptr->window |= (PW_PLAYER);
5228 if (damage_type != DAMAGE_GENO && p_ptr->chp == 0)
5230 chg_virtue(V_SACRIFICE, 1);
5231 chg_virtue(V_CHANCE, 2);
5237 bool android = (p_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
5239 #ifdef JP /* »à¤ó¤À»þ¤Ë¶¯À©½ªÎ»¤·¤Æ»à¤ò²óÈò¤Ç¤¤Ê¤¯¤·¤Æ¤ß¤¿ by Habu */
5241 if(!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
5247 chg_virtue(V_SACRIFICE, 10);
5250 p_ptr->leaving = TRUE;
5253 p_ptr->is_dead = TRUE;
5255 if (p_ptr->inside_arena)
5257 cptr m_name = r_name+r_info[arena_info[p_ptr->arena_number].r_idx].name;
5259 msg_format("¤¢¤Ê¤¿¤Ï%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£", m_name);
5261 msg_format("You are beaten by %s.", m_name);
5264 if (record_arena) do_cmd_write_nikki(NIKKI_ARENA, -1 - p_ptr->arena_number, m_name);
5268 int q_idx = quest_number(dun_level);
5269 bool seppuku = streq(hit_from, "Seppuku");
5270 bool winning_seppuku = p_ptr->total_winner && seppuku;
5273 /* Make screen dump */
5274 screen_dump = make_screen_dump();
5277 /* Note cause of death */
5280 strcpy(p_ptr->died_from, hit_from);
5282 if (!winning_seppuku) strcpy(p_ptr->died_from, "ÀÚÊ¢");
5289 sprintf(dummy, "%s%s%s", !p_ptr->paralyzed ? "" : p_ptr->free_act ? "ĦÁü¾õÂÖ¤Ç" : "Ëãáã¾õÂÖ¤Ç", p_ptr->image ? "¸¸³Ð¤ËÏĤó¤À" : "", hit_from);
5291 sprintf(dummy, "%s%s", hit_from, !p_ptr->paralyzed ? "" : " while helpless");
5293 my_strcpy(p_ptr->died_from, dummy, sizeof p_ptr->died_from);
5296 /* No longer a winner */
5297 p_ptr->total_winner = FALSE;
5299 if (winning_seppuku)
5302 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¾¡Íø¤Î¸åÀÚÊ¢¤·¤¿¡£");
5304 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "did Seppuku after the winning.");
5311 if (p_ptr->inside_arena)
5313 strcpy(buf,"¥¢¥ê¡¼¥Ê");
5315 strcpy(buf,"in the Arena");
5317 else if (!dun_level)
5321 strcpy(buf,"on the surface");
5323 else if (q_idx && (is_fixed_quest_idx(q_idx) &&
5324 !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
5326 strcpy(buf,"¥¯¥¨¥¹¥È");
5328 strcpy(buf,"in a quest");
5332 sprintf(buf,"%d³¬", dun_level);
5334 sprintf(buf,"level %d", dun_level);
5338 sprintf(tmp, "%s¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", buf, p_ptr->died_from);
5340 sprintf(tmp, "killed by %s %s.", p_ptr->died_from, buf);
5342 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5346 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- ¥²¡¼¥à¥ª¡¼¥Ð¡¼ --------");
5348 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- Game Over --------");
5350 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, "\n\n\n\n");
5355 if (get_check_strict("²èÌ̤òÊݸ¤·¤Þ¤¹¤«¡©", CHECK_NO_HISTORY))
5357 if (get_check_strict("Dump the screen? ", CHECK_NO_HISTORY))
5360 do_cmd_save_screen();
5365 /* Initialize "last message" buffer */
5366 if (p_ptr->last_message) string_free(p_ptr->last_message);
5367 p_ptr->last_message = NULL;
5369 /* Hack -- Note death */
5373 msg_format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë");
5375 msg_print(android ? "You are broken." : "You die.");
5382 if (winning_seppuku)
5385 get_rnd_line("seppuku_j.txt", 0, death_message);
5387 get_rnd_line("seppuku.txt", 0, death_message);
5393 get_rnd_line("death_j.txt", 0, death_message);
5395 get_rnd_line("death.txt", 0, death_message);
5402 while (!get_string(winning_seppuku ? "¼À¤¤Î¶ç: " : "ÃÇËöËâ¤Î¶«¤Ó: ", death_message, 1024)) ;
5404 while (!get_string("Last word: ", death_message, 1024)) ;
5408 while (winning_seppuku && !get_check_strict("¤è¤í¤·¤¤¤Ç¤¹¤«¡©", CHECK_NO_HISTORY));
5410 while (winning_seppuku && !get_check_strict("Are you sure? ", CHECK_NO_HISTORY));
5413 if (death_message[0] == '\0')
5416 strcpy(death_message, format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë"));
5418 strcpy(death_message, android ? "You are broken." : "You die.");
5421 else p_ptr->last_message = string_make(death_message);
5424 if (winning_seppuku)
5429 int msg_pos_x[9] = { 5, 7, 9, 12, 14, 17, 19, 21, 23};
5430 int msg_pos_y[9] = { 3, 4, 5, 4, 5, 4, 5, 6, 4};
5437 for (i = 0; i < 40; i++)
5438 Term_putstr(randint0(w / 2) * 2, randint0(h), 2, TERM_VIOLET, "¦Ô");
5440 str = death_message;
5441 if (strncmp(str, "¡Ö", 2) == 0) str += 2;
5443 str2 = my_strstr(str, "¡×");
5444 if (str2 != NULL) *str2 = '\0';
5449 str2 = my_strstr(str, " ");
5450 if (str2 == NULL) len = strlen(str);
5451 else len = str2 - str;
5455 Term_putstr_v(w * 3 / 4 - 2 - msg_pos_x[i] * 2, msg_pos_y[i], len,
5457 if (str2 == NULL) break;
5461 if (*str == 0) break;
5465 Term_putstr(w-1, h-1, 1, TERM_WHITE, " ");
5469 /* Make screen dump */
5470 screen_dump = make_screen_dump();
5473 /* Wait a key press */
5478 msg_print(death_message);
5486 /* Hitpoint warning */
5487 if (p_ptr->chp < warning)
5489 /* Hack -- bell on first notice */
5490 if (old_chp > warning) bell();
5494 if (record_danger && (old_chp > warning))
5496 if (p_ptr->image && damage_type == DAMAGE_ATTACK)
5500 hit_from = "something";
5504 sprintf(tmp,"%s¤Ë¤è¤Ã¤Æ¥Ô¥ó¥Á¤Ë´Ù¤Ã¤¿¡£",hit_from);
5506 sprintf(tmp,"A critical situation because of %s.",hit_from);
5508 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5513 /* stop auto_more even if DAMAGE_USELIFE */
5519 msg_print("*** ·Ù¹ð:Äã¥Ò¥Ã¥È¡¦¥Ý¥¤¥ó¥È¡ª ***");
5521 msg_print("*** LOW HITPOINT WARNING! ***");
5527 if (p_ptr->wild_mode && !p_ptr->leaving && (p_ptr->chp < MAX(warning, p_ptr->mhp/5)))
5538 void gain_exp_64(s32b amount, u32b amount_frac)
5540 if (p_ptr->is_dead) return;
5542 if (p_ptr->prace == RACE_ANDROID) return;
5544 /* Gain some experience */
5545 s64b_add(&(p_ptr->exp), &(p_ptr->exp_frac), amount, amount_frac);
5547 /* Slowly recover from experience drainage */
5548 if (p_ptr->exp < p_ptr->max_exp)
5550 /* Gain max experience (20%) (was 10%) */
5551 p_ptr->max_exp += amount / 5;
5554 /* Check Experience */
5562 void gain_exp(s32b amount)
5564 gain_exp_64(amount, 0L);
5568 void calc_android_exp(void)
5572 if (p_ptr->is_dead) return;
5574 if (p_ptr->prace != RACE_ANDROID) return;
5576 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5578 object_type *o_ptr = &inventory[i];
5580 object_type *q_ptr = &forge;
5582 int level = MAX(k_info[o_ptr->k_idx].level - 8, 1);
5584 if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue;
5585 if (!o_ptr->k_idx) continue;
5587 /* Wipe the object */
5590 object_copy(q_ptr, o_ptr);
5591 q_ptr->discount = 0;
5592 q_ptr->curse_flags = 0L;
5594 if (object_is_fixed_artifact(o_ptr))
5596 level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
5597 level += MIN(20, a_info[o_ptr->name1].rarity/(a_info[o_ptr->name1].gen_flags & TRG_INSTA_ART ? 10 : 3));
5599 else if (object_is_ego(o_ptr))
5601 level += MAX(3, (e_info[o_ptr->name2].rating - 5)/2);
5603 else if (o_ptr->art_name)
5605 s32b total_flags = flag_cost(o_ptr, o_ptr->pval);
5608 if (!object_is_weapon_ammo(o_ptr))
5611 if (total_flags < 15000) fake_level = 10;
5612 else if (total_flags < 35000) fake_level = 25;
5613 else fake_level = 40;
5618 if (total_flags < 20000) fake_level = 10;
5619 else if (total_flags < 45000) fake_level = 25;
5620 else fake_level = 40;
5623 level = MAX(level, (level + MAX(fake_level - 8, 5)) / 2 + 3);
5626 value = object_value_real(q_ptr);
5628 if (value <= 0) continue;
5629 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (p_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
5630 if (value > 5000000L) value = 5000000L;
5631 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
5633 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr) ||
5634 (o_ptr->tval == TV_DRAG_ARMOR) ||
5635 ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) ||
5636 ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) ||
5637 ((o_ptr->tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)) ||
5638 ((o_ptr->tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) ||
5639 ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE)))
5641 if (level > 65) level = 35 + (level - 65) / 5;
5642 else if (level > 35) level = 25 + (level - 35) / 3;
5643 else if (level > 15) level = 15 + (level - 15) / 2;
5644 exp = MIN(100000L, value) * level * level / 2;
5645 if (value > 100000L)
5646 exp += (value - 100000L) * level * level / 8;
5650 exp = MIN(100000L, value) * level;
5651 if (value > 100000L)
5652 exp += (value - 100000L) * level / 4;
5654 if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (buki_motteruka(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
5655 else total_exp += exp / 16;
5656 if (i == INVEN_BODY) total_exp += exp / 32;
5658 p_ptr->exp = p_ptr->max_exp = total_exp;
5660 /* Check Experience */
5668 void lose_exp(s32b amount)
5670 if (p_ptr->prace == RACE_ANDROID) return;
5672 /* Never drop below zero experience */
5673 if (amount > p_ptr->exp) amount = p_ptr->exp;
5675 /* Lose some experience */
5676 p_ptr->exp -= amount;
5678 /* Check Experience */
5685 * If resisted to draining, return FALSE
5687 bool drain_exp(s32b drain, s32b slip, int hold_life_prob)
5689 /* Androids and their mimics are never drained */
5690 if (p_ptr->prace == RACE_ANDROID) return FALSE;
5692 if (p_ptr->hold_life && (randint0(100) < hold_life_prob))
5694 /* Hold experience */
5696 msg_print("¤·¤«¤·¼«¸Ê¤ÎÀ¸Ì¿ÎϤò¼é¤ê¤¤Ã¤¿¡ª");
5698 msg_print("You keep hold of your life force!");
5703 /* Hold experience failed */
5704 if (p_ptr->hold_life)
5707 msg_print("À¸Ì¿ÎϤò¾¯¤·µÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
5709 msg_print("You feel your life slipping away!");
5716 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
5718 msg_print("You feel your life draining away!");
5727 bool set_ultimate_res(int v, bool do_dec)
5729 bool notice = FALSE;
5731 /* Hack -- Force good values */
5732 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5734 if (p_ptr->is_dead) return FALSE;
5739 if (p_ptr->ult_res && !do_dec)
5741 if (p_ptr->ult_res > v) return FALSE;
5743 else if (!p_ptr->ult_res)
5746 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5748 msg_print("You feel resistant!");
5761 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5763 msg_print("You feel less resistant");
5773 /* Redraw status bar */
5774 p_ptr->redraw |= (PR_STATUS);
5776 /* Nothing to notice */
5777 if (!notice) return (FALSE);
5780 if (disturb_state) disturb(0, 0);
5782 /* Recalculate bonuses */
5783 p_ptr->update |= (PU_BONUS);
5792 bool set_tim_res_nether(int v, bool do_dec)
5794 bool notice = FALSE;
5796 /* Hack -- Force good values */
5797 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5799 if (p_ptr->is_dead) return FALSE;
5804 if (p_ptr->tim_res_nether && !do_dec)
5806 if (p_ptr->tim_res_nether > v) return FALSE;
5808 else if (!p_ptr->tim_res_nether)
5811 msg_print("ÃϹö¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5813 msg_print("You feel nether resistant!");
5823 if (p_ptr->tim_res_nether)
5826 msg_print("ÃϹö¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5828 msg_print("You feel less nether resistant");
5836 p_ptr->tim_res_nether = v;
5838 /* Redraw status bar */
5839 p_ptr->redraw |= (PR_STATUS);
5841 /* Nothing to notice */
5842 if (!notice) return (FALSE);
5845 if (disturb_state) disturb(0, 0);
5847 /* Recalculate bonuses */
5848 p_ptr->update |= (PU_BONUS);
5857 bool set_tim_res_time(int v, bool do_dec)
5859 bool notice = FALSE;
5861 /* Hack -- Force good values */
5862 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5864 if (p_ptr->is_dead) return FALSE;
5869 if (p_ptr->tim_res_time && !do_dec)
5871 if (p_ptr->tim_res_time > v) return FALSE;
5873 else if (!p_ptr->tim_res_time)
5876 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5878 msg_print("You feel time resistant!");
5888 if (p_ptr->tim_res_time)
5891 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5893 msg_print("You feel less time resistant");
5901 p_ptr->tim_res_time = v;
5903 /* Redraw status bar */
5904 p_ptr->redraw |= (PR_STATUS);
5906 /* Nothing to notice */
5907 if (!notice) return (FALSE);
5910 if (disturb_state) disturb(0, 0);
5912 /* Recalculate bonuses */
5913 p_ptr->update |= (PU_BONUS);
5924 * Choose a warrior-mage elemental attack. -LM-
5926 bool choose_ele_attack(void)
5932 if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
5935 msg_format("Éð´ï¤ò»ý¤¿¤Ê¤¤¤ÈËâË¡·õ¤Ï»È¤¨¤Ê¤¤¡£");
5937 msg_format("You cannot use temporary branding with no weapon.");
5945 num = (p_ptr->lev - 20) / 5;
5948 c_prt(TERM_RED, " a) ¾Æ´þ", 2, 14);
5950 c_prt(TERM_RED, " a) Fire Brand", 2, 14);
5954 if (num >= 2) c_prt(TERM_L_WHITE," b) Åà·ë", 3, 14);
5956 if (num >= 2) c_prt(TERM_L_WHITE," b) Cold Brand", 3, 14);
5958 else prt("", 3, 14);
5961 if (num >= 3) c_prt(TERM_GREEN, " c) ÆÇ»¦", 4, 14);
5963 if (num >= 3) c_prt(TERM_GREEN, " c) Poison Brand", 4, 14);
5965 else prt("", 4, 14);
5968 if (num >= 4) c_prt(TERM_L_DARK, " d) Íϲò", 5, 14);
5970 if (num >= 4) c_prt(TERM_L_DARK, " d) Acid Brand", 5, 14);
5972 else prt("", 5, 14);
5975 if (num >= 5) c_prt(TERM_BLUE, " e) ÅÅ·â", 6, 14);
5977 if (num >= 5) c_prt(TERM_BLUE, " e) Elec Brand", 6, 14);
5979 else prt("", 6, 14);
5987 prt(" ¤É¤Î¸µÁǹ¶·â¤ò¤·¤Þ¤¹¤«¡©", 1, 14);
5989 prt(" Choose a temporary elemental brand ", 1, 14);
5994 if ((choice == 'a') || (choice == 'A'))
5995 set_ele_attack(ATTACK_FIRE, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5996 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
5997 set_ele_attack(ATTACK_COLD, p_ptr->lev/2 + randint1(p_ptr->lev/2));
5998 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
5999 set_ele_attack(ATTACK_POIS, p_ptr->lev/2 + randint1(p_ptr->lev/2));
6000 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
6001 set_ele_attack(ATTACK_ACID, p_ptr->lev/2 + randint1(p_ptr->lev/2));
6002 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
6003 set_ele_attack(ATTACK_ELEC, p_ptr->lev/2 + randint1(p_ptr->lev/2));
6007 msg_print("ËâË¡·õ¤ò»È¤¦¤Î¤ò¤ä¤á¤¿¡£");
6009 msg_print("You cancel the temporary branding.");
6021 * Choose a elemental immune. -LM-
6023 bool choose_ele_immune(int turn)
6031 c_prt(TERM_RED, " a) ²Ð±ê", 2, 14);
6033 c_prt(TERM_RED, " a) Immune Fire", 2, 14);
6037 c_prt(TERM_L_WHITE," b) Î䵤", 3, 14);
6039 c_prt(TERM_L_WHITE," b) Immune Cold", 3, 14);
6043 c_prt(TERM_L_DARK, " c) »À", 4, 14);
6045 c_prt(TERM_L_DARK, " c) Immune Acid", 4, 14);
6049 c_prt(TERM_BLUE, " d) ÅÅ·â", 5, 14);
6051 c_prt(TERM_BLUE, " d) Immune Elec", 5, 14);
6062 prt(" ¤É¤Î¸µÁǤÎÌȱ֤ò¤Ä¤±¤Þ¤¹¤«¡©", 1, 14);
6064 prt(" Choose a temporary elemental immune ", 1, 14);
6069 if ((choice == 'a') || (choice == 'A'))
6070 set_ele_immune(DEFENSE_FIRE, turn);
6071 else if ((choice == 'b') || (choice == 'B'))
6072 set_ele_immune(DEFENSE_COLD, turn);
6073 else if ((choice == 'c') || (choice == 'C'))
6074 set_ele_immune(DEFENSE_ACID, turn);
6075 else if ((choice == 'd') || (choice == 'D'))
6076 set_ele_immune(DEFENSE_ELEC, turn);
6080 msg_print("Ìȱ֤òÉÕ¤±¤ë¤Î¤ò¤ä¤á¤¿¡£");
6082 msg_print("You cancel the temporary immune.");