3 * @brief ¥×¥ì¥¤¥ä¡¼¤Î¥¹¥Æ¡¼¥¿¥¹´ÉÍý / effects of various "objects"
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
8 * This software may be copied and distributed for educational, research,\n
9 * and not for profit purposes provided that this copyright and statement\n
10 * are included in all such copies. Other copyrights may also apply.\n
12 * 2013 Deskull rearranged comment for Doxygen.\n
19 * @brief ¥×¥ì¥¤¥ä¡¼¤Î·Ñ³¹ÔÆ°¤òÀßÄꤹ¤ë¡£
20 * @param typ ·Ñ³¹ÔÆ°¤ÎID\n
21 * #ACTION_NONE / #ACTION_SEARCH / #ACTION_REST / #ACTION_LEARN / #ACTION_FISH / #ACTION_KAMAE / #ACTION_KATA / #ACTION_SING / #ACTION_HAYAGAKE / #ACTION_SPELL ¤«¤éÁªÂò¡£
24 void set_action(int typ)
26 int prev_typ = p_ptr->action;
39 msg_print("õº÷¤ò¤ä¤á¤¿¡£");
41 msg_print("You no longer walk carefully.");
43 p_ptr->redraw |= (PR_SPEED);
54 msg_print("³Ø½¬¤ò¤ä¤á¤¿¡£");
56 msg_print("You stop Learning");
64 msg_print("¹½¤¨¤ò¤È¤¤¤¿¡£");
66 msg_print("You stop assuming the posture.");
68 p_ptr->special_defense &= ~(KAMAE_MASK);
74 msg_print("·¿¤òÊø¤·¤¿¡£");
76 msg_print("You stop assuming the posture.");
78 p_ptr->special_defense &= ~(KATA_MASK);
79 p_ptr->update |= (PU_MONSTERS);
80 p_ptr->redraw |= (PR_STATUS);
86 msg_print("²Î¤¦¤Î¤ò¤ä¤á¤¿¡£");
88 msg_print("You stop singing.");
95 msg_print("¤¬½Å¤¯¤Ê¤Ã¤¿¡£");
97 msg_print("You are no longer walking extremely fast.");
105 msg_print("¼öʸ¤Î±Ó¾§¤òÃæÃǤ·¤¿¡£");
107 msg_print("You stopped spelling all spells.");
116 /* If we are requested other action, stop singing */
117 if (prev_typ == ACTION_SING) stop_singing();
118 if (prev_typ == ACTION_SPELL) stop_hex_spell();
120 switch (p_ptr->action)
125 msg_print("Ãí°Õ¿¼¤¯Ê⤻Ϥ᤿¡£");
127 msg_print("You begin to walk carefully.");
129 p_ptr->redraw |= (PR_SPEED);
135 msg_print("³Ø½¬¤ò»Ï¤á¤¿¡£");
137 msg_print("You begin Learning");
144 msg_print("¿åÌ̤˻å¤ò¿â¤é¤·¤¿¡¥¡¥¡¥");
146 msg_print("You begin fishing...");
150 case ACTION_HAYAGAKE:
153 msg_print("¤¬±©¤Î¤è¤¦¤Ë·Ú¤¯¤Ê¤Ã¤¿¡£");
155 msg_print("You begin to walk extremely fast.");
165 /* Recalculate bonuses */
166 p_ptr->update |= (PU_BONUS);
168 /* Redraw the state */
169 p_ptr->redraw |= (PR_STATE);
173 * @brief ¥×¥ì¥¤¥ä¡¼¤ÎÁ´¤Æ¤Î»þ¸Â¸ú²Ì¤ò¥ê¥»¥Ã¥È¤¹¤ë¡£ / reset timed flags
176 void reset_tim_flags(void)
178 p_ptr->fast = 0; /* Timed -- Fast */
179 p_ptr->lightspeed = 0;
180 p_ptr->slow = 0; /* Timed -- Slow */
181 p_ptr->blind = 0; /* Timed -- Blindness */
182 p_ptr->paralyzed = 0; /* Timed -- Paralysis */
183 p_ptr->confused = 0; /* Timed -- Confusion */
184 p_ptr->afraid = 0; /* Timed -- Fear */
185 p_ptr->image = 0; /* Timed -- Hallucination */
186 p_ptr->poisoned = 0; /* Timed -- Poisoned */
187 p_ptr->cut = 0; /* Timed -- Cut */
188 p_ptr->stun = 0; /* Timed -- Stun */
190 p_ptr->protevil = 0; /* Timed -- Protection */
191 p_ptr->invuln = 0; /* Timed -- Invulnerable */
193 p_ptr->hero = 0; /* Timed -- Heroism */
194 p_ptr->shero = 0; /* Timed -- Super Heroism */
195 p_ptr->shield = 0; /* Timed -- Shield Spell */
196 p_ptr->blessed = 0; /* Timed -- Blessed */
197 p_ptr->tim_invis = 0; /* Timed -- Invisibility */
198 p_ptr->tim_infra = 0; /* Timed -- Infra Vision */
199 p_ptr->tim_regen = 0; /* Timed -- Regeneration */
200 p_ptr->tim_stealth = 0; /* Timed -- Stealth */
202 p_ptr->wraith_form = 0; /* Timed -- Wraith Form */
203 p_ptr->tim_levitation = 0;
204 p_ptr->tim_sh_touki = 0;
205 p_ptr->tim_sh_fire = 0;
206 p_ptr->tim_sh_holy = 0;
207 p_ptr->tim_eyeeye = 0;
209 p_ptr->resist_magic = 0;
212 p_ptr->tim_res_nether = 0;
213 p_ptr->tim_res_time = 0;
214 p_ptr->tim_mimic = 0;
215 p_ptr->mimic_form = 0;
216 p_ptr->tim_reflect = 0;
217 p_ptr->multishadow = 0;
219 p_ptr->action = ACTION_NONE;
222 p_ptr->oppose_acid = 0; /* Timed -- oppose acid */
223 p_ptr->oppose_elec = 0; /* Timed -- oppose lightning */
224 p_ptr->oppose_fire = 0; /* Timed -- oppose heat */
225 p_ptr->oppose_cold = 0; /* Timed -- oppose cold */
226 p_ptr->oppose_pois = 0; /* Timed -- oppose poison */
228 p_ptr->word_recall = 0;
229 p_ptr->alter_reality = 0;
230 p_ptr->sutemi = FALSE;
231 p_ptr->counter = FALSE;
232 p_ptr->ele_attack = 0;
233 p_ptr->ele_immune = 0;
234 p_ptr->special_attack = 0L;
235 p_ptr->special_defense = 0L;
237 while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
238 world_player = FALSE;
240 if (prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
241 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1;
242 if (p_ptr->pclass == CLASS_BERSERKER) p_ptr->shero = 1;
246 (void)set_monster_fast(p_ptr->riding, 0);
247 (void)set_monster_slow(p_ptr->riding, 0);
248 (void)set_monster_invulner(p_ptr->riding, 0, FALSE);
251 if (p_ptr->pclass == CLASS_BARD)
253 p_ptr->magic_num1[0] = 0;
254 p_ptr->magic_num2[0] = 0;
259 * @brief ¥×¥ì¥¤¥ä¡¼¤ËËâÎϾõî¸ú²Ì¤òÍ¿¤¨¤ë¡£
262 void dispel_player(void)
264 (void)set_fast(0, TRUE);
265 (void)set_lightspeed(0, TRUE);
266 (void)set_slow(0, TRUE);
267 (void)set_shield(0, TRUE);
268 (void)set_blessed(0, TRUE);
269 (void)set_tsuyoshi(0, TRUE);
270 (void)set_hero(0, TRUE);
271 (void)set_shero(0, TRUE);
272 (void)set_protevil(0, TRUE);
273 (void)set_invuln(0, TRUE);
274 (void)set_wraith_form(0, TRUE);
275 (void)set_kabenuke(0, TRUE);
276 (void)set_tim_res_nether(0, TRUE);
277 (void)set_tim_res_time(0, TRUE);
279 (void)set_tim_reflect(0,TRUE);
280 (void)set_multishadow(0,TRUE);
281 (void)set_dustrobe(0,TRUE);
283 (void)set_tim_invis(0, TRUE);
284 (void)set_tim_infra(0, TRUE);
285 (void)set_tim_esp(0, TRUE);
286 (void)set_tim_regen(0, TRUE);
287 (void)set_tim_stealth(0, TRUE);
288 (void)set_tim_levitation(0, TRUE);
289 (void)set_tim_sh_touki(0, TRUE);
290 (void)set_tim_sh_fire(0, TRUE);
291 (void)set_tim_sh_holy(0, TRUE);
292 (void)set_tim_eyeeye(0, TRUE);
293 (void)set_magicdef(0, TRUE);
294 (void)set_resist_magic(0, TRUE);
295 (void)set_oppose_acid(0, TRUE);
296 (void)set_oppose_elec(0, TRUE);
297 (void)set_oppose_fire(0, TRUE);
298 (void)set_oppose_cold(0, TRUE);
299 (void)set_oppose_pois(0, TRUE);
300 (void)set_ultimate_res(0, TRUE);
301 (void)set_mimic(0, 0, TRUE);
302 (void)set_ele_attack(0, 0);
303 (void)set_ele_immune(0, 0);
305 /* Cancel glowing hands */
306 if (p_ptr->special_attack & ATTACK_CONFUSE)
308 p_ptr->special_attack &= ~(ATTACK_CONFUSE);
310 msg_print("¼ê¤Îµ±¤¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
312 msg_print("Your hands stop glowing.");
316 if (music_singing_any() || hex_spelling_any())
319 cptr str = (music_singing_any()) ? "²Î" : "¼öʸ";
321 cptr str = (music_singing_any()) ? "singing" : "spelling";
323 p_ptr->magic_num1[1] = p_ptr->magic_num1[0];
324 p_ptr->magic_num1[0] = 0;
326 msg_format("%s¤¬ÅÓÀڤ줿¡£", str);
328 msg_format("Your %s is interrupted.", str);
330 p_ptr->action = ACTION_NONE;
332 /* Recalculate bonuses */
333 p_ptr->update |= (PU_BONUS | PU_HP);
336 p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
338 /* Update monsters */
339 p_ptr->update |= (PU_MONSTERS);
342 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
344 p_ptr->energy_need += ENERGY_NEED();
350 * @brief Êѿȸú²Ì¤Î·Ñ³»þ´Ö¤ÈÊÑ¿ÈÀè¤ò¥»¥Ã¥È¤¹¤ë / Set "p_ptr->tim_mimic", and "p_ptr->mimic_form", notice observable changes
353 * @do_dec ¸½ºß¤Î·Ñ³»þ´Ö¤è¤êŤ¤ÃͤΤ߾å½ñ¤¤¹¤ë
354 * @return ¥¹¥Æ¡¼¥¿¥¹¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ÊѲ½¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
356 bool set_mimic(int v, int p, bool do_dec)
360 /* Hack -- Force good values */
361 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
363 if (p_ptr->is_dead) return FALSE;
368 if (p_ptr->tim_mimic && (p_ptr->mimic_form == p) && !do_dec)
370 if (p_ptr->tim_mimic > v) return FALSE;
372 else if ((!p_ptr->tim_mimic) || (p_ptr->mimic_form != p))
375 msg_print("¼«Ê¬¤ÎÂΤ¬ÊѤï¤Ã¤Æ¤æ¤¯¤Î¤ò´¶¤¸¤¿¡£");
377 msg_print("You feel that your body changes.");
387 if (p_ptr->tim_mimic)
390 msg_print("ÊѿȤ¬²ò¤±¤¿¡£");
392 msg_print("You are no longer transformed.");
394 if (p_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(0, TRUE);
402 p_ptr->tim_mimic = v;
404 /* Nothing to notice */
409 if (disturb_state) disturb(0, 1);
412 p_ptr->redraw |= (PR_BASIC | PR_STATUS);
414 /* Recalculate bonuses */
415 p_ptr->update |= (PU_BONUS | PU_HP);
424 * @brief ÌÕÌܤηѳ»þ´Ö¤ò¥»¥Ã¥È¤¹¤ë / Set "p_ptr->blind", notice observable changes
426 * @return ¥¹¥Æ¡¼¥¿¥¹¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ÊѲ½¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
428 * Note the use of "PU_UN_LITE" and "PU_UN_VIEW", which is needed to\n
429 * memorize any terrain features which suddenly become "visible".\n
430 * Note that blindness is currently the only thing which can affect\n
431 * "player_can_see_bold()".\noo
433 bool set_blind(int v)
437 /* Hack -- Force good values */
438 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
440 if (p_ptr->is_dead) return FALSE;
447 if (p_ptr->prace == RACE_ANDROID)
450 msg_print("¥»¥ó¥µ¡¼¤ò¤ä¤é¤ì¤¿¡ª");
452 msg_print("You are blind!");
458 msg_print("Ìܤ¬¸«¤¨¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
460 msg_print("You are blind!");
465 chg_virtue(V_ENLIGHTEN, -1);
474 if (p_ptr->prace == RACE_ANDROID)
477 msg_print("¥»¥ó¥µ¡¼¤¬Éüµì¤·¤¿¡£");
479 msg_print("You can see again.");
485 msg_print("¤ä¤Ã¤ÈÌܤ¬¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
487 msg_print("You can see again.");
498 /* Redraw status bar */
499 p_ptr->redraw |= (PR_STATUS);
501 /* Nothing to notice */
502 if (!notice) return (FALSE);
505 if (disturb_state) disturb(0, 0);
507 /* Fully update the visuals */
508 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
511 p_ptr->redraw |= (PR_MAP);
514 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
525 * @brief º®Íð¤Î·Ñ³»þ´Ö¤ò¥»¥Ã¥È¤¹¤ë / Set "p_ptr->confused", notice observable changes
527 * @return ¥¹¥Æ¡¼¥¿¥¹¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ÊѲ½¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
529 bool set_confused(int v)
533 /* Hack -- Force good values */
534 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
536 if (p_ptr->is_dead) return FALSE;
541 if (!p_ptr->confused)
544 msg_print("¤¢¤Ê¤¿¤Ïº®Í𤷤¿¡ª");
546 msg_print("You are confused!");
549 if (p_ptr->action == ACTION_LEARN)
552 msg_print("³Ø½¬¤¬Â³¤±¤é¤ì¤Ê¤¤¡ª");
554 msg_print("You cannot continue Learning!");
558 p_ptr->redraw |= (PR_STATE);
559 p_ptr->action = ACTION_NONE;
561 if (p_ptr->action == ACTION_KAMAE)
564 msg_print("¹½¤¨¤¬¤È¤±¤¿¡£");
566 msg_print("Your posture gets loose.");
568 p_ptr->special_defense &= ~(KAMAE_MASK);
569 p_ptr->update |= (PU_BONUS);
570 p_ptr->redraw |= (PR_STATE);
571 p_ptr->action = ACTION_NONE;
573 else if (p_ptr->action == ACTION_KATA)
576 msg_print("·¿¤¬Êø¤ì¤¿¡£");
578 msg_print("Your posture gets loose.");
580 p_ptr->special_defense &= ~(KATA_MASK);
581 p_ptr->update |= (PU_BONUS);
582 p_ptr->update |= (PU_MONSTERS);
583 p_ptr->redraw |= (PR_STATE);
584 p_ptr->redraw |= (PR_STATUS);
585 p_ptr->action = ACTION_NONE;
589 if (p_ptr->concent) reset_concentration(TRUE);
592 if (hex_spelling_any()) stop_hex_spell_all();
595 p_ptr->counter = FALSE;
596 chg_virtue(V_HARMONY, -1);
606 msg_print("¤ä¤Ã¤Èº®Í𤬤ª¤µ¤Þ¤Ã¤¿¡£");
608 msg_print("You feel less confused now.");
611 p_ptr->special_attack &= ~(ATTACK_SUIKEN);
619 /* Redraw status bar */
620 p_ptr->redraw |= (PR_STATUS);
622 /* Nothing to notice */
623 if (!notice) return (FALSE);
626 if (disturb_state) disturb(0, 0);
637 * @brief ÆǤηѳ»þ´Ö¤ò¥»¥Ã¥È¤¹¤ë / Set "p_ptr->poisoned", notice observable changes
639 * @return ¥¹¥Æ¡¼¥¿¥¹¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ÊѲ½¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
641 bool set_poisoned(int v)
645 /* Hack -- Force good values */
646 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
648 if (p_ptr->is_dead) return FALSE;
653 if (!p_ptr->poisoned)
656 msg_print("ÆǤ˿¯¤µ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
658 msg_print("You are poisoned!");
671 msg_print("¤ä¤Ã¤ÈÆǤÎÄˤߤ¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
673 msg_print("You are no longer poisoned.");
683 /* Redraw status bar */
684 p_ptr->redraw |= (PR_STATUS);
686 /* Nothing to notice */
687 if (!notice) return (FALSE);
690 if (disturb_state) disturb(0, 0);
701 * @brief ¶²Éݤηѳ»þ´Ö¤ò¥»¥Ã¥È¤¹¤ë / Set "p_ptr->afraid", notice observable changes
703 * @return ¥¹¥Æ¡¼¥¿¥¹¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ÊѲ½¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
705 bool set_afraid(int v)
709 /* Hack -- Force good values */
710 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
712 if (p_ptr->is_dead) return FALSE;
720 msg_print("²¿¤â¤«¤â¶²¤¯¤Ê¤Ã¤Æ¤¤¿¡ª");
722 msg_print("You are terrified!");
725 if (p_ptr->special_defense & KATA_MASK)
728 msg_print("·¿¤¬Êø¤ì¤¿¡£");
730 msg_print("Your posture gets loose.");
732 p_ptr->special_defense &= ~(KATA_MASK);
733 p_ptr->update |= (PU_BONUS);
734 p_ptr->update |= (PU_MONSTERS);
735 p_ptr->redraw |= (PR_STATE);
736 p_ptr->redraw |= (PR_STATUS);
737 p_ptr->action = ACTION_NONE;
741 p_ptr->counter = FALSE;
742 chg_virtue(V_VALOUR, -1);
752 msg_print("¤ä¤Ã¤È¶²Éݤò¿¶¤êʧ¤Ã¤¿¡£");
754 msg_print("You feel bolder now.");
764 /* Redraw status bar */
765 p_ptr->redraw |= (PR_STATUS);
767 /* Nothing to notice */
768 if (!notice) return (FALSE);
771 if (disturb_state) disturb(0, 0);
781 * @brief Ëãáã¤Î·Ñ³»þ´Ö¤ò¥»¥Ã¥È¤¹¤ë / Set "p_ptr->paralyzed", notice observable changes
783 * @return ¥¹¥Æ¡¼¥¿¥¹¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ÊѲ½¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
785 bool set_paralyzed(int v)
789 /* Hack -- Force good values */
790 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
792 if (p_ptr->is_dead) return FALSE;
797 if (!p_ptr->paralyzed)
800 msg_print("ÂΤ¬Ëãá㤷¤Æ¤·¤Þ¤Ã¤¿¡ª");
802 msg_print("You are paralyzed!");
806 if (p_ptr->concent) reset_concentration(TRUE);
809 if (hex_spelling_any()) stop_hex_spell_all();
811 p_ptr->counter = FALSE;
819 if (p_ptr->paralyzed)
822 msg_print("¤ä¤Ã¤ÈÆ°¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
824 msg_print("You can move again.");
832 p_ptr->paralyzed = v;
834 /* Redraw status bar */
835 p_ptr->redraw |= (PR_STATUS);
837 /* Nothing to notice */
838 if (!notice) return (FALSE);
841 if (disturb_state) disturb(0, 0);
843 /* Redraw the state */
844 p_ptr->redraw |= (PR_STATE);
854 * @brief ¸¸³Ð¤Î·Ñ³»þ´Ö¤ò¥»¥Ã¥È¤¹¤ë / Set "p_ptr->image", notice observable changes
856 * @return ¥¹¥Æ¡¼¥¿¥¹¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ÊѲ½¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
857 * @details Note that we must redraw the map when hallucination changes.
859 bool set_image(int v)
863 /* Hack -- Force good values */
864 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
866 if (p_ptr->is_dead) return FALSE;
872 set_tsuyoshi(0, TRUE);
876 msg_print("¥ï¡¼¥ª¡ª²¿¤â¤«¤âÆú¿§¤Ë¸«¤¨¤ë¡ª");
878 msg_print("Oh, wow! Everything looks so cosmic now!");
882 if (p_ptr->concent) reset_concentration(TRUE);
884 p_ptr->counter = FALSE;
895 msg_print("¤ä¤Ã¤È¤Ï¤Ã¤¤ê¤Èʪ¤¬¸«¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
897 msg_print("You can see clearly again.");
907 /* Redraw status bar */
908 p_ptr->redraw |= (PR_STATUS);
910 /* Nothing to notice */
911 if (!notice) return (FALSE);
914 if (disturb_state) disturb(0, 1);
917 p_ptr->redraw |= (PR_MAP);
919 /* Update the health bar */
920 p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH);
922 /* Update monsters */
923 p_ptr->update |= (PU_MONSTERS);
926 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
936 * @brief ²Ã®¤Î·Ñ³»þ´Ö¤ò¥»¥Ã¥È¤¹¤ë / Set "p_ptr->fast", notice observable changes
938 * @do_dec ¸½ºß¤Î·Ñ³»þ´Ö¤è¤êŤ¤ÃͤΤ߾å½ñ¤¤¹¤ë
939 * @return ¥¹¥Æ¡¼¥¿¥¹¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ÊѲ½¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
941 bool set_fast(int v, bool do_dec)
945 /* Hack -- Force good values */
946 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
948 if (p_ptr->is_dead) return FALSE;
953 if (p_ptr->fast && !do_dec)
955 if (p_ptr->fast > v) return FALSE;
957 else if (!IS_FAST() && !p_ptr->lightspeed)
960 msg_print("ÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
962 msg_print("You feel yourself moving much faster!");
966 chg_virtue(V_PATIENCE, -1);
967 chg_virtue(V_DILIGENCE, 1);
974 if (p_ptr->fast && !p_ptr->lightspeed && !music_singing(MUSIC_SPEED) && !music_singing(MUSIC_SHERO))
977 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
979 msg_print("You feel yourself slow down.");
989 /* Nothing to notice */
990 if (!notice) return (FALSE);
993 if (disturb_state) disturb(0, 0);
995 /* Recalculate bonuses */
996 p_ptr->update |= (PU_BONUS);
1006 * @brief ¸÷®°ÜÆ°¤Î·Ñ³»þ´Ö¤ò¥»¥Ã¥È¤¹¤ë / Set "p_ptr->lightspeed", notice observable changes
1008 * @do_dec ¸½ºß¤Î·Ñ³»þ´Ö¤è¤êŤ¤ÃͤΤ߾å½ñ¤¤¹¤ë
1009 * @return ¥¹¥Æ¡¼¥¿¥¹¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ÊѲ½¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
1011 bool set_lightspeed(int v, bool do_dec)
1013 bool notice = FALSE;
1015 /* Hack -- Force good values */
1016 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1018 if (p_ptr->is_dead) return FALSE;
1020 if (p_ptr->wild_mode) v = 0;
1025 if (p_ptr->lightspeed && !do_dec)
1027 if (p_ptr->lightspeed > v) return FALSE;
1029 else if (!p_ptr->lightspeed)
1032 msg_print("Èó¾ï¤ËÁÇÁ᤯ư¤±¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª");
1034 msg_print("You feel yourself moving extremely faster!");
1038 chg_virtue(V_PATIENCE, -1);
1039 chg_virtue(V_DILIGENCE, 1);
1046 if (p_ptr->lightspeed)
1049 msg_print("Æ°¤¤ÎÁÇÁᤵ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1051 msg_print("You feel yourself slow down.");
1059 p_ptr->lightspeed = v;
1061 /* Nothing to notice */
1062 if (!notice) return (FALSE);
1065 if (disturb_state) disturb(0, 0);
1067 /* Recalculate bonuses */
1068 p_ptr->update |= (PU_BONUS);
1078 * @brief ¸ºÂ®¤Î·Ñ³»þ´Ö¤ò¥»¥Ã¥È¤¹¤ë / Set "p_ptr->slow", notice observable changes
1080 * @do_dec ¸½ºß¤Î·Ñ³»þ´Ö¤è¤êŤ¤ÃͤΤ߾å½ñ¤¤¹¤ë
1081 * @return ¥¹¥Æ¡¼¥¿¥¹¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ÊѲ½¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
1083 bool set_slow(int v, bool do_dec)
1085 bool notice = FALSE;
1087 /* Hack -- Force good values */
1088 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1090 if (p_ptr->is_dead) return FALSE;
1095 if (p_ptr->slow && !do_dec)
1097 if (p_ptr->slow > v) return FALSE;
1099 else if (!p_ptr->slow)
1102 msg_print("ÂΤÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
1104 msg_print("You feel yourself moving slower!");
1117 msg_print("Æ°¤¤ÎÃÙ¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1119 msg_print("You feel yourself speed up.");
1129 /* Nothing to notice */
1130 if (!notice) return (FALSE);
1133 if (disturb_state) disturb(0, 0);
1135 /* Recalculate bonuses */
1136 p_ptr->update |= (PU_BONUS);
1147 * @brief È©Àв½¤Î·Ñ³»þ´Ö¤ò¥»¥Ã¥È¤¹¤ë / Set "p_ptr->shield", notice observable changes
1149 * @do_dec ¸½ºß¤Î·Ñ³»þ´Ö¤è¤êŤ¤ÃͤΤ߾å½ñ¤¤¹¤ë
1150 * @return ¥¹¥Æ¡¼¥¿¥¹¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ÊѲ½¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
1152 bool set_shield(int v, bool do_dec)
1154 bool notice = FALSE;
1156 /* Hack -- Force good values */
1157 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1159 if (p_ptr->is_dead) return FALSE;
1164 if (p_ptr->shield && !do_dec)
1166 if (p_ptr->shield > v) return FALSE;
1168 else if (!p_ptr->shield)
1171 msg_print("È©¤¬ÀФˤʤä¿¡£");
1173 msg_print("Your skin turns to stone.");
1186 msg_print("È©¤¬¸µ¤ËÌá¤Ã¤¿¡£");
1188 msg_print("Your skin returns to normal.");
1198 /* Redraw status bar */
1199 p_ptr->redraw |= (PR_STATUS);
1201 /* Nothing to notice */
1202 if (!notice) return (FALSE);
1205 if (disturb_state) disturb(0, 0);
1207 /* Recalculate bonuses */
1208 p_ptr->update |= (PU_BONUS);
1219 * @brief ¤Ä¤Ö¤ì¤ë¤Î·Ñ³»þ´Ö¤ò¥»¥Ã¥È¤¹¤ë / Set "p_ptr->tsubureru", notice observable changes
1221 * @do_dec ¸½ºß¤Î·Ñ³»þ´Ö¤è¤êŤ¤ÃͤΤ߾å½ñ¤¤¹¤ë
1222 * @return ¥¹¥Æ¡¼¥¿¥¹¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ÊѲ½¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
1224 bool set_tsubureru(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->tsubureru && !do_dec)
1238 if (p_ptr->tsubureru > v) return FALSE;
1240 else if (!p_ptr->tsubureru)
1243 msg_print("²£¤Ë¿¤Ó¤¿¡£");
1245 msg_print("Your body expands horizontally.");
1255 if (p_ptr->tsubureru)
1258 msg_print("¤â¤¦²£¤Ë¿¤Ó¤Æ¤¤¤Ê¤¤¡£");
1260 msg_print("Your body returns to normal.");
1268 p_ptr->tsubureru = 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);
1291 * @brief ËâË¡¤Î³»¤Î·Ñ³»þ´Ö¤ò¥»¥Ã¥È¤¹¤ë / Set "p_ptr->magicdef", notice observable changes
1293 * @do_dec ¸½ºß¤Î·Ñ³»þ´Ö¤è¤êŤ¤ÃͤΤ߾å½ñ¤¤¹¤ë
1294 * @return ¥¹¥Æ¡¼¥¿¥¹¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ÊѲ½¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
1296 bool set_magicdef(int v, bool do_dec)
1298 bool notice = FALSE;
1300 /* Hack -- Force good values */
1301 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1303 if (p_ptr->is_dead) return FALSE;
1308 if (p_ptr->magicdef && !do_dec)
1310 if (p_ptr->magicdef > v) return FALSE;
1312 else if (!p_ptr->magicdef)
1315 msg_print("ËâË¡¤ÎËɸæÎϤ¬Áý¤·¤¿¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1317 msg_print("You feel more resistant to magic.");
1327 if (p_ptr->magicdef)
1330 msg_print("ËâË¡¤ÎËɸæÎϤ¬¸µ¤ËÌá¤Ã¤¿¡£");
1332 msg_print("You feel less resistant to magic.");
1340 p_ptr->magicdef = v;
1342 /* Redraw status bar */
1343 p_ptr->redraw |= (PR_STATUS);
1345 /* Nothing to notice */
1346 if (!notice) return (FALSE);
1349 if (disturb_state) disturb(0, 0);
1351 /* Recalculate bonuses */
1352 p_ptr->update |= (PU_BONUS);
1362 * @brief ½ËÊ¡¤Î·Ñ³»þ´Ö¤ò¥»¥Ã¥È¤¹¤ë / Set "p_ptr->blessed", notice observable changes
1364 * @do_dec ¸½ºß¤Î·Ñ³»þ´Ö¤è¤êŤ¤ÃͤΤ߾å½ñ¤¤¹¤ë
1365 * @return ¥¹¥Æ¡¼¥¿¥¹¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ÊѲ½¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
1367 bool set_blessed(int v, bool do_dec)
1369 bool notice = FALSE;
1371 /* Hack -- Force good values */
1372 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1374 if (p_ptr->is_dead) return FALSE;
1379 if (p_ptr->blessed && !do_dec)
1381 if (p_ptr->blessed > v) return FALSE;
1383 else if (!IS_BLESSED())
1386 msg_print("¹â·é¤Êµ¤Ê¬¤Ë¤Ê¤Ã¤¿¡ª");
1388 msg_print("You feel righteous!");
1398 if (p_ptr->blessed && !music_singing(MUSIC_BLESS))
1401 msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1403 msg_print("The prayer has expired.");
1413 /* Redraw status bar */
1414 p_ptr->redraw |= (PR_STATUS);
1416 /* Nothing to notice */
1417 if (!notice) return (FALSE);
1420 if (disturb_state) disturb(0, 0);
1422 /* Recalculate bonuses */
1423 p_ptr->update |= (PU_BONUS);
1434 * @brief »Îµ¤¹âÍȤηѳ»þ´Ö¤ò¥»¥Ã¥È¤¹¤ë / Set "p_ptr->hero", notice observable changes
1436 * @do_dec ¸½ºß¤Î·Ñ³»þ´Ö¤è¤êŤ¤ÃͤΤ߾å½ñ¤¤¹¤ë
1437 * @return ¥¹¥Æ¡¼¥¿¥¹¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ÊѲ½¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
1439 bool set_hero(int v, bool do_dec)
1441 bool notice = FALSE;
1443 /* Hack -- Force good values */
1444 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1446 if (p_ptr->is_dead) return FALSE;
1451 if (p_ptr->hero && !do_dec)
1453 if (p_ptr->hero > v) return FALSE;
1455 else if (!IS_HERO())
1458 msg_print("¥Ò¡¼¥í¡¼¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1460 msg_print("You feel like a hero!");
1470 if (p_ptr->hero && !music_singing(MUSIC_HERO) && !music_singing(MUSIC_SHERO))
1473 msg_print("¥Ò¡¼¥í¡¼¤Îµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
1475 msg_print("The heroism wears off.");
1485 /* Redraw status bar */
1486 p_ptr->redraw |= (PR_STATUS);
1488 /* Nothing to notice */
1489 if (!notice) return (FALSE);
1492 if (disturb_state) disturb(0, 0);
1494 /* Recalculate bonuses */
1495 p_ptr->update |= (PU_BONUS);
1497 /* Recalculate hitpoints */
1498 p_ptr->update |= (PU_HP);
1508 * @brief ¶¸Àï»Î²½¤Î·Ñ³»þ´Ö¤ò¥»¥Ã¥È¤¹¤ë / Set "p_ptr->shero", notice observable changes
1510 * @do_dec ¸½ºß¤Î·Ñ³»þ´Ö¤è¤êŤ¤ÃͤΤ߾å½ñ¤¤¹¤ë
1511 * @return ¥¹¥Æ¡¼¥¿¥¹¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ÊѲ½¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
1513 bool set_shero(int v, bool do_dec)
1515 bool notice = FALSE;
1517 /* Hack -- Force good values */
1518 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1520 if (p_ptr->is_dead) return FALSE;
1522 if (p_ptr->pclass == CLASS_BERSERKER) v = 1;
1526 if (p_ptr->shero && !do_dec)
1528 if (p_ptr->shero > v) return FALSE;
1530 else if (!p_ptr->shero)
1533 msg_print("»¦Ù¤¥Þ¥·¡¼¥ó¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1535 msg_print("You feel like a killing machine!");
1548 msg_print("ÌîÈڤʵ¤»ý¤Á¤¬¾Ã¤¨¼º¤»¤¿¡£");
1550 msg_print("You feel less Berserk.");
1560 /* Redraw status bar */
1561 p_ptr->redraw |= (PR_STATUS);
1563 /* Nothing to notice */
1564 if (!notice) return (FALSE);
1567 if (disturb_state) disturb(0, 0);
1569 /* Recalculate bonuses */
1570 p_ptr->update |= (PU_BONUS);
1572 /* Recalculate hitpoints */
1573 p_ptr->update |= (PU_HP);
1583 * @brief Âмٰ·ë³¦¤Î·Ñ³»þ´Ö¤ò¥»¥Ã¥È¤¹¤ë / Set "p_ptr->protevil", notice observable changes
1585 * @do_dec ¸½ºß¤Î·Ñ³»þ´Ö¤è¤êŤ¤ÃͤΤ߾å½ñ¤¤¹¤ë
1586 * @return ¥¹¥Æ¡¼¥¿¥¹¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ÊѲ½¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
1588 bool set_protevil(int v, bool do_dec)
1590 bool notice = FALSE;
1592 /* Hack -- Force good values */
1593 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1595 if (p_ptr->is_dead) return FALSE;
1600 if (p_ptr->protevil && !do_dec)
1602 if (p_ptr->protevil > v) return FALSE;
1604 else if (!p_ptr->protevil)
1607 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Ê´¶¤¸¤¬¤¹¤ë¡ª");
1609 msg_print("You feel safe from evil!");
1619 if (p_ptr->protevil)
1622 msg_print("¼Ù°¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
1624 msg_print("You no longer feel safe from evil.");
1632 p_ptr->protevil = v;
1634 /* Redraw status bar */
1635 p_ptr->redraw |= (PR_STATUS);
1637 /* Nothing to notice */
1638 if (!notice) return (FALSE);
1641 if (disturb_state) disturb(0, 0);
1651 * @brief Í©Âβ½¤Î·Ñ³»þ´Ö¤ò¥»¥Ã¥È¤¹¤ë / Set "p_ptr->wraith_form", notice observable changes
1653 * @do_dec ¸½ºß¤Î·Ñ³»þ´Ö¤è¤êŤ¤ÃͤΤ߾å½ñ¤¤¹¤ë
1654 * @return ¥¹¥Æ¡¼¥¿¥¹¤Ë±Æ¶Á¤òµÚ¤Ü¤¹ÊѲ½¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
1656 bool set_wraith_form(int v, bool do_dec)
1658 bool notice = FALSE;
1660 /* Hack -- Force good values */
1661 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1663 if (p_ptr->is_dead) return FALSE;
1668 if (p_ptr->wraith_form && !do_dec)
1670 if (p_ptr->wraith_form > v) return FALSE;
1672 else if (!p_ptr->wraith_form)
1675 msg_print("ʪ¼Á³¦¤òÎ¥¤ì¤ÆÍ©µ´¤Î¤è¤¦¤Ê¸ºß¤Ë¤Ê¤Ã¤¿¡ª");
1677 msg_print("You leave the physical world and turn into a wraith-being!");
1682 chg_virtue(V_UNLIFE, 3);
1683 chg_virtue(V_HONOUR, -2);
1684 chg_virtue(V_SACRIFICE, -2);
1685 chg_virtue(V_VALOUR, -5);
1688 p_ptr->redraw |= (PR_MAP);
1690 /* Update monsters */
1691 p_ptr->update |= (PU_MONSTERS);
1694 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1701 if (p_ptr->wraith_form)
1704 msg_print("ÉÔÆ©ÌÀ¤Ë¤Ê¤Ã¤¿´¶¤¸¤¬¤¹¤ë¡£");
1706 msg_print("You feel opaque.");
1712 p_ptr->redraw |= (PR_MAP);
1714 /* Update monsters */
1715 p_ptr->update |= (PU_MONSTERS);
1718 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1723 p_ptr->wraith_form = v;
1725 /* Redraw status bar */
1726 p_ptr->redraw |= (PR_STATUS);
1728 /* Nothing to notice */
1729 if (!notice) return (FALSE);
1732 if (disturb_state) disturb(0, 0);
1734 /* Recalculate bonuses */
1735 p_ptr->update |= (PU_BONUS);
1747 * Set "p_ptr->invuln", notice observable changes
1749 bool set_invuln(int v, bool do_dec)
1751 bool notice = FALSE;
1753 /* Hack -- Force good values */
1754 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1756 if (p_ptr->is_dead) return FALSE;
1761 if (p_ptr->invuln && !do_dec)
1763 if (p_ptr->invuln > v) return FALSE;
1765 else if (!IS_INVULN())
1768 msg_print("̵Ũ¤À¡ª");
1770 msg_print("Invulnerability!");
1775 chg_virtue(V_UNLIFE, -2);
1776 chg_virtue(V_HONOUR, -2);
1777 chg_virtue(V_SACRIFICE, -3);
1778 chg_virtue(V_VALOUR, -5);
1781 p_ptr->redraw |= (PR_MAP);
1783 /* Update monsters */
1784 p_ptr->update |= (PU_MONSTERS);
1787 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1794 if (p_ptr->invuln && !music_singing(MUSIC_INVULN))
1797 msg_print("̵Ũ¤Ç¤Ï¤Ê¤¯¤Ê¤Ã¤¿¡£");
1799 msg_print("The invulnerability wears off.");
1805 p_ptr->redraw |= (PR_MAP);
1807 /* Update monsters */
1808 p_ptr->update |= (PU_MONSTERS);
1811 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1813 p_ptr->energy_need += ENERGY_NEED();
1820 /* Redraw status bar */
1821 p_ptr->redraw |= (PR_STATUS);
1823 /* Nothing to notice */
1824 if (!notice) return (FALSE);
1827 if (disturb_state) disturb(0, 0);
1829 /* Recalculate bonuses */
1830 p_ptr->update |= (PU_BONUS);
1841 * Set "p_ptr->tim_esp", notice observable changes
1843 bool set_tim_esp(int v, bool do_dec)
1845 bool notice = FALSE;
1847 /* Hack -- Force good values */
1848 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1850 if (p_ptr->is_dead) return FALSE;
1855 if (p_ptr->tim_esp && !do_dec)
1857 if (p_ptr->tim_esp > v) return FALSE;
1859 else if (!IS_TIM_ESP())
1862 msg_print("°Õ¼±¤¬¹¤¬¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1864 msg_print("You feel your consciousness expand!");
1874 if (p_ptr->tim_esp && !music_singing(MUSIC_MIND))
1877 msg_print("°Õ¼±¤Ï¸µ¤ËÌá¤Ã¤¿¡£");
1879 msg_print("Your consciousness contracts again.");
1889 /* Redraw status bar */
1890 p_ptr->redraw |= (PR_STATUS);
1892 /* Nothing to notice */
1893 if (!notice) return (FALSE);
1896 if (disturb_state) disturb(0, 0);
1898 /* Recalculate bonuses */
1899 p_ptr->update |= (PU_BONUS);
1901 /* Update the monsters */
1902 p_ptr->update |= (PU_MONSTERS);
1913 * Set "p_ptr->tim_invis", notice observable changes
1915 bool set_tim_invis(int v, bool do_dec)
1917 bool notice = FALSE;
1919 /* Hack -- Force good values */
1920 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1922 if (p_ptr->is_dead) return FALSE;
1927 if (p_ptr->tim_invis && !do_dec)
1929 if (p_ptr->tim_invis > v) return FALSE;
1931 else if (!p_ptr->tim_invis)
1934 msg_print("Ìܤ¬Èó¾ï¤ËÉÒ´¶¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
1936 msg_print("Your eyes feel very sensitive!");
1946 if (p_ptr->tim_invis)
1949 msg_print("ÌܤÎÉÒ´¶¤µ¤¬¤Ê¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£");
1951 msg_print("Your eyes feel less sensitive.");
1959 p_ptr->tim_invis = v;
1961 /* Redraw status bar */
1962 p_ptr->redraw |= (PR_STATUS);
1964 /* Nothing to notice */
1965 if (!notice) return (FALSE);
1968 if (disturb_state) disturb(0, 0);
1970 /* Recalculate bonuses */
1971 p_ptr->update |= (PU_BONUS);
1973 /* Update the monsters */
1974 p_ptr->update |= (PU_MONSTERS);
1985 * Set "p_ptr->tim_infra", notice observable changes
1987 bool set_tim_infra(int v, bool do_dec)
1989 bool notice = FALSE;
1991 /* Hack -- Force good values */
1992 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
1994 if (p_ptr->is_dead) return FALSE;
1999 if (p_ptr->tim_infra && !do_dec)
2001 if (p_ptr->tim_infra > v) return FALSE;
2003 else if (!p_ptr->tim_infra)
2006 msg_print("Ìܤ¬¥é¥ó¥é¥ó¤Èµ±¤»Ï¤á¤¿¡ª");
2008 msg_print("Your eyes begin to tingle!");
2018 if (p_ptr->tim_infra)
2021 msg_print("Ìܤ層¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
2023 msg_print("Your eyes stop tingling.");
2031 p_ptr->tim_infra = v;
2033 /* Redraw status bar */
2034 p_ptr->redraw |= (PR_STATUS);
2036 /* Nothing to notice */
2037 if (!notice) return (FALSE);
2040 if (disturb_state) disturb(0, 0);
2042 /* Recalculate bonuses */
2043 p_ptr->update |= (PU_BONUS);
2045 /* Update the monsters */
2046 p_ptr->update |= (PU_MONSTERS);
2057 * Set "p_ptr->tim_regen", notice observable changes
2059 bool set_tim_regen(int v, bool do_dec)
2061 bool notice = FALSE;
2063 /* Hack -- Force good values */
2064 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2066 if (p_ptr->is_dead) return FALSE;
2071 if (p_ptr->tim_regen && !do_dec)
2073 if (p_ptr->tim_regen > v) return FALSE;
2075 else if (!p_ptr->tim_regen)
2078 msg_print("²óÉüÎϤ¬¾å¤¬¤Ã¤¿¡ª");
2080 msg_print("You feel yourself regenerating quickly!");
2090 if (p_ptr->tim_regen)
2093 msg_print("ÁÇÁ᤯²óÉü¤¹¤ë´¶¤¸¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
2095 msg_print("You feel yourself regenerating slowly.");
2103 p_ptr->tim_regen = v;
2105 /* Redraw status bar */
2106 p_ptr->redraw |= (PR_STATUS);
2108 /* Nothing to notice */
2109 if (!notice) return (FALSE);
2112 if (disturb_state) disturb(0, 0);
2114 /* Recalculate bonuses */
2115 p_ptr->update |= (PU_BONUS);
2126 * Set "p_ptr->tim_stealth", notice observable changes
2128 bool set_tim_stealth(int v, bool do_dec)
2130 bool notice = FALSE;
2132 /* Hack -- Force good values */
2133 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2135 if (p_ptr->is_dead) return FALSE;
2140 if (p_ptr->tim_stealth && !do_dec)
2142 if (p_ptr->tim_stealth > v) return FALSE;
2144 else if (!IS_TIM_STEALTH())
2147 msg_print("²»¤¬¾®¤µ¤¯¤Ê¤Ã¤¿¡ª");
2149 msg_print("You begin to walk silently!");
2159 if (p_ptr->tim_stealth && !music_singing(MUSIC_STEALTH))
2162 msg_print("²»¤¬Â礤¯¤Ê¤Ã¤¿¡£");
2164 msg_print("You no longer walk silently.");
2172 p_ptr->tim_stealth = v;
2174 /* Redraw status bar */
2175 p_ptr->redraw |= (PR_STATUS);
2177 /* Nothing to notice */
2178 if (!notice) return (FALSE);
2181 if (disturb_state) disturb(0, 0);
2183 /* Recalculate bonuses */
2184 p_ptr->update |= (PU_BONUS);
2194 bool set_superstealth(bool set)
2196 bool notice = FALSE;
2198 if (p_ptr->is_dead) return FALSE;
2203 if (!(p_ptr->special_defense & NINJA_S_STEALTH))
2205 if (cave[py][px].info & CAVE_MNLT)
2208 msg_print("Ũ¤ÎÌܤ«¤éÇö¤¤±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡£");
2210 msg_print("You are mantled in weak shadow from ordinary eyes.");
2212 p_ptr->monlite = p_ptr->old_monlite = TRUE;
2217 msg_print("Ũ¤ÎÌܤ«¤é±Æ¤ÎÃæ¤Ëʤ¤¤±£¤µ¤ì¤¿¡ª");
2219 msg_print("You are mantled in shadow from ordinary eyes!");
2221 p_ptr->monlite = p_ptr->old_monlite = FALSE;
2227 p_ptr->special_defense |= NINJA_S_STEALTH;
2234 if (p_ptr->special_defense & NINJA_S_STEALTH)
2237 msg_print("ºÆ¤ÓŨ¤ÎÌܤˤµ¤é¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£");
2239 msg_print("You are exposed to common sight once more.");
2245 p_ptr->special_defense &= ~(NINJA_S_STEALTH);
2249 /* Nothing to notice */
2250 if (!notice) return (FALSE);
2252 /* Redraw status bar */
2253 p_ptr->redraw |= (PR_STATUS);
2256 if (disturb_state) disturb(0, 0);
2264 * Set "p_ptr->tim_levitation", notice observable changes
2266 bool set_tim_levitation(int v, bool do_dec)
2268 bool notice = FALSE;
2270 /* Hack -- Force good values */
2271 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2273 if (p_ptr->is_dead) return FALSE;
2278 if (p_ptr->tim_levitation && !do_dec)
2280 if (p_ptr->tim_levitation > v) return FALSE;
2282 else if (!p_ptr->tim_levitation)
2285 msg_print("ÂΤ¬Ãè¤ËÉ⤻Ϥ᤿¡£");
2287 msg_print("You begin to fly!");
2297 if (p_ptr->tim_levitation)
2300 msg_print("¤â¤¦Ãè¤ËÉ⤫¤Ù¤Ê¤¯¤Ê¤Ã¤¿¡£");
2302 msg_print("You stop flying.");
2310 p_ptr->tim_levitation = v;
2312 /* Redraw status bar */
2313 p_ptr->redraw |= (PR_STATUS);
2315 /* Nothing to notice */
2316 if (!notice) return (FALSE);
2319 if (disturb_state) disturb(0, 0);
2321 /* Recalculate bonuses */
2322 p_ptr->update |= (PU_BONUS);
2333 * Set "p_ptr->tim_sh_touki", notice observable changes
2335 bool set_tim_sh_touki(int v, bool do_dec)
2337 bool notice = FALSE;
2339 /* Hack -- Force good values */
2340 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2342 if (p_ptr->is_dead) return FALSE;
2347 if (p_ptr->tim_sh_touki && !do_dec)
2349 if (p_ptr->tim_sh_touki > v) return FALSE;
2351 else if (!p_ptr->tim_sh_touki)
2354 msg_print("ÂΤ¬Æ®µ¤¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2356 msg_print("You have enveloped by the aura of the Force!");
2366 if (p_ptr->tim_sh_touki)
2369 msg_print("Æ®µ¤¤¬¾Ã¤¨¤¿¡£");
2371 msg_print("Aura of the Force disappeared.");
2379 p_ptr->tim_sh_touki = v;
2381 /* Redraw status bar */
2382 p_ptr->redraw |= (PR_STATUS);
2384 /* Nothing to notice */
2385 if (!notice) return (FALSE);
2388 if (disturb_state) disturb(0, 0);
2399 * Set "p_ptr->tim_sh_fire", notice observable changes
2401 bool set_tim_sh_fire(int v, bool do_dec)
2403 bool notice = FALSE;
2405 /* Hack -- Force good values */
2406 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2408 if (p_ptr->is_dead) return FALSE;
2413 if (p_ptr->tim_sh_fire && !do_dec)
2415 if (p_ptr->tim_sh_fire > v) return FALSE;
2417 else if (!p_ptr->tim_sh_fire)
2420 msg_print("ÂΤ¬±ê¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2422 msg_print("You have enveloped by fiery aura!");
2432 if (p_ptr->tim_sh_fire)
2435 msg_print("±ê¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2437 msg_print("Fiery aura disappeared.");
2445 p_ptr->tim_sh_fire = v;
2447 /* Redraw status bar */
2448 p_ptr->redraw |= (PR_STATUS);
2450 /* Nothing to notice */
2451 if (!notice) return (FALSE);
2454 if (disturb_state) disturb(0, 0);
2456 /* Recalculate bonuses */
2457 p_ptr->update |= (PU_BONUS);
2468 * Set "p_ptr->tim_sh_holy", notice observable changes
2470 bool set_tim_sh_holy(int v, bool do_dec)
2472 bool notice = FALSE;
2474 /* Hack -- Force good values */
2475 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2477 if (p_ptr->is_dead) return FALSE;
2482 if (p_ptr->tim_sh_holy && !do_dec)
2484 if (p_ptr->tim_sh_holy > v) return FALSE;
2486 else if (!p_ptr->tim_sh_holy)
2489 msg_print("ÂΤ¬À»¤Ê¤ë¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2491 msg_print("You have enveloped by holy aura!");
2501 if (p_ptr->tim_sh_holy)
2504 msg_print("À»¤Ê¤ë¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2506 msg_print("Holy aura disappeared.");
2514 p_ptr->tim_sh_holy = v;
2516 /* Redraw status bar */
2517 p_ptr->redraw |= (PR_STATUS);
2519 /* Nothing to notice */
2520 if (!notice) return (FALSE);
2523 if (disturb_state) disturb(0, 0);
2525 /* Recalculate bonuses */
2526 p_ptr->update |= (PU_BONUS);
2538 * Set "p_ptr->tim_eyeeye", notice observable changes
2540 bool set_tim_eyeeye(int v, bool do_dec)
2542 bool notice = FALSE;
2544 /* Hack -- Force good values */
2545 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2547 if (p_ptr->is_dead) return FALSE;
2552 if (p_ptr->tim_eyeeye && !do_dec)
2554 if (p_ptr->tim_eyeeye > v) return FALSE;
2556 else if (!p_ptr->tim_eyeeye)
2559 msg_print("Ë¡¤Î¼é¤ê¼ê¤Ë¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¡ª");
2561 msg_print("You feel like a keeper of commandments!");
2571 if (p_ptr->tim_eyeeye)
2574 msg_print("Ĩȳ¤ò¼¹¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
2576 msg_print("You no longer feel like a keeper.");
2584 p_ptr->tim_eyeeye = v;
2586 /* Redraw status bar */
2587 p_ptr->redraw |= (PR_STATUS);
2589 /* Nothing to notice */
2590 if (!notice) return (FALSE);
2593 if (disturb_state) disturb(0, 0);
2595 /* Recalculate bonuses */
2596 p_ptr->update |= (PU_BONUS);
2608 * Set "p_ptr->resist_magic", notice observable changes
2610 bool set_resist_magic(int v, bool do_dec)
2612 bool notice = FALSE;
2614 /* Hack -- Force good values */
2615 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2617 if (p_ptr->is_dead) return FALSE;
2622 if (p_ptr->resist_magic && !do_dec)
2624 if (p_ptr->resist_magic > v) return FALSE;
2626 else if (!p_ptr->resist_magic)
2629 msg_print("ËâË¡¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿¡£");
2631 msg_print("You have been protected from magic!");
2641 if (p_ptr->resist_magic)
2644 msg_print("ËâË¡¤Ë¼å¤¯¤Ê¤Ã¤¿¡£");
2646 msg_print("You are no longer protected from magic.");
2654 p_ptr->resist_magic = v;
2656 /* Redraw status bar */
2657 p_ptr->redraw |= (PR_STATUS);
2659 /* Nothing to notice */
2660 if (!notice) return (FALSE);
2663 if (disturb_state) disturb(0, 0);
2665 /* Recalculate bonuses */
2666 p_ptr->update |= (PU_BONUS);
2677 * Set "p_ptr->tim_reflect", notice observable changes
2679 bool set_tim_reflect(int v, bool do_dec)
2681 bool notice = FALSE;
2683 /* Hack -- Force good values */
2684 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2686 if (p_ptr->is_dead) return FALSE;
2691 if (p_ptr->tim_reflect && !do_dec)
2693 if (p_ptr->tim_reflect > v) return FALSE;
2695 else if (!p_ptr->tim_reflect)
2698 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2700 msg_print("Your body becames smooth.");
2710 if (p_ptr->tim_reflect)
2713 msg_print("ÂΤÎɽÌ̤¬³ê¤«¤Ç¤Ê¤¯¤Ê¤Ã¤¿¡£");
2715 msg_print("Your body is no longer smooth.");
2723 p_ptr->tim_reflect = v;
2725 /* Redraw status bar */
2726 p_ptr->redraw |= (PR_STATUS);
2728 /* Nothing to notice */
2729 if (!notice) return (FALSE);
2732 if (disturb_state) disturb(0, 0);
2734 /* Recalculate bonuses */
2735 p_ptr->update |= (PU_BONUS);
2746 * Set "p_ptr->multishadow", notice observable changes
2748 bool set_multishadow(int v, bool do_dec)
2750 bool notice = FALSE;
2752 /* Hack -- Force good values */
2753 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2755 if (p_ptr->is_dead) return FALSE;
2760 if (p_ptr->multishadow && !do_dec)
2762 if (p_ptr->multishadow > v) return FALSE;
2764 else if (!p_ptr->multishadow)
2767 msg_print("¤¢¤Ê¤¿¤Î¼þ¤ê¤Ë¸¸±Æ¤¬À¸¤Þ¤ì¤¿¡£");
2769 msg_print("Your Shadow enveloped you.");
2779 if (p_ptr->multishadow)
2782 msg_print("¸¸±Æ¤¬¾Ã¤¨¤¿¡£");
2784 msg_print("Your Shadow disappears.");
2792 p_ptr->multishadow = v;
2794 /* Redraw status bar */
2795 p_ptr->redraw |= (PR_STATUS);
2797 /* Nothing to notice */
2798 if (!notice) return (FALSE);
2801 if (disturb_state) disturb(0, 0);
2803 /* Recalculate bonuses */
2804 p_ptr->update |= (PU_BONUS);
2815 * Set "p_ptr->dustrobe", notice observable changes
2817 bool set_dustrobe(int v, bool do_dec)
2819 bool notice = FALSE;
2821 /* Hack -- Force good values */
2822 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2824 if (p_ptr->is_dead) return FALSE;
2829 if (p_ptr->dustrobe && !do_dec)
2831 if (p_ptr->dustrobe > v) return FALSE;
2833 else if (!p_ptr->dustrobe)
2836 msg_print("ÂΤ¬¶À¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
2838 msg_print("You were enveloped by mirror shards.");
2848 if (p_ptr->dustrobe)
2851 msg_print("¶À¤Î¥ª¡¼¥é¤¬¾Ã¤¨¤¿¡£");
2853 msg_print("The mirror shards disappear.");
2861 p_ptr->dustrobe = v;
2863 /* Redraw status bar */
2864 p_ptr->redraw |= (PR_STATUS);
2866 /* Nothing to notice */
2867 if (!notice) return (FALSE);
2870 if (disturb_state) disturb(0, 0);
2872 /* Recalculate bonuses */
2873 p_ptr->update |= (PU_BONUS);
2884 * Set "p_ptr->tim_regen", notice observable changes
2886 bool set_kabenuke(int v, bool do_dec)
2888 bool notice = FALSE;
2890 /* Hack -- Force good values */
2891 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2893 if (p_ptr->is_dead) return FALSE;
2898 if (p_ptr->kabenuke && !do_dec)
2900 if (p_ptr->kabenuke > v) return FALSE;
2902 else if (!p_ptr->kabenuke)
2905 msg_print("ÂΤ¬È¾Êª¼Á¤Î¾õÂ֤ˤʤä¿¡£");
2907 msg_print("You became ethereal form.");
2917 if (p_ptr->kabenuke)
2920 msg_print("ÂΤ¬Êª¼Á²½¤·¤¿¡£");
2922 msg_print("You are no longer in an ethereal form.");
2930 p_ptr->kabenuke = v;
2932 /* Redraw status bar */
2933 p_ptr->redraw |= (PR_STATUS);
2935 /* Nothing to notice */
2936 if (!notice) return (FALSE);
2939 if (disturb_state) disturb(0, 0);
2941 /* Recalculate bonuses */
2942 p_ptr->update |= (PU_BONUS);
2952 bool set_tsuyoshi(int v, bool do_dec)
2954 bool notice = FALSE;
2956 /* Hack -- Force good values */
2957 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
2959 if (p_ptr->is_dead) return FALSE;
2964 if (p_ptr->tsuyoshi && !do_dec)
2966 if (p_ptr->tsuyoshi > v) return FALSE;
2968 else if (!p_ptr->tsuyoshi)
2971 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
2973 msg_print("Brother OKURE!");
2977 chg_virtue(V_VITALITY, 2);
2984 if (p_ptr->tsuyoshi)
2987 msg_print("ÆùÂΤ¬µÞ®¤Ë¤·¤Ü¤ó¤Ç¤¤¤Ã¤¿¡£");
2989 msg_print("Your body had quickly shriveled.");
2992 (void)dec_stat(A_CON, 20, TRUE);
2993 (void)dec_stat(A_STR, 20, TRUE);
2996 chg_virtue(V_VITALITY, -3);
3001 p_ptr->tsuyoshi = v;
3003 /* Redraw status bar */
3004 p_ptr->redraw |= (PR_STATUS);
3006 /* Nothing to notice */
3007 if (!notice) return (FALSE);
3010 if (disturb_state) disturb(0, 0);
3012 /* Recalculate bonuses */
3013 p_ptr->update |= (PU_BONUS);
3015 /* Recalculate hitpoints */
3016 p_ptr->update |= (PU_HP);
3027 * Set a temporary elemental brand. Clear all other brands. Print status
3030 bool set_ele_attack(u32b attack_type, int v)
3032 /* Hack -- Force good values */
3033 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3035 /* Clear all elemental attacks (only one is allowed at a time). */
3036 if ((p_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
3038 p_ptr->special_attack &= ~(ATTACK_ACID);
3040 msg_print("»À¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
3042 msg_print("Your temporary acidic brand fades away.");
3045 if ((p_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
3047 p_ptr->special_attack &= ~(ATTACK_ELEC);
3049 msg_print("ÅÅ·â¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
3051 msg_print("Your temporary electrical brand fades away.");
3054 if ((p_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
3056 p_ptr->special_attack &= ~(ATTACK_FIRE);
3058 msg_print("²Ð±ê¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
3060 msg_print("Your temporary fiery brand fades away.");
3063 if ((p_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
3065 p_ptr->special_attack &= ~(ATTACK_COLD);
3067 msg_print("Î䵤¤Ç¹¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
3069 msg_print("Your temporary frost brand fades away.");
3072 if ((p_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
3074 p_ptr->special_attack &= ~(ATTACK_POIS);
3076 msg_print("ÆǤǹ¶·â¤Ç¤¤Ê¤¯¤Ê¤Ã¤¿¡£");
3078 msg_print("Your temporary poison brand fades away.");
3082 if ((v) && (attack_type))
3084 /* Set attack type. */
3085 p_ptr->special_attack |= (attack_type);
3088 p_ptr->ele_attack = v;
3092 msg_format("%s¤Ç¹¶·â¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡ª",
3093 ((attack_type == ATTACK_ACID) ? "»À" :
3094 ((attack_type == ATTACK_ELEC) ? "ÅÅ·â" :
3095 ((attack_type == ATTACK_FIRE) ? "²Ð±ê" :
3096 ((attack_type == ATTACK_COLD) ? "Î䵤" :
3097 ((attack_type == ATTACK_POIS) ? "ÆÇ" :
3100 msg_format("For a while, the blows you deal will %s",
3101 ((attack_type == ATTACK_ACID) ? "melt with acid!" :
3102 ((attack_type == ATTACK_ELEC) ? "shock your foes!" :
3103 ((attack_type == ATTACK_FIRE) ? "burn with fire!" :
3104 ((attack_type == ATTACK_COLD) ? "chill to the bone!" :
3105 ((attack_type == ATTACK_POIS) ? "poison your enemies!" :
3106 "do nothing special."))))));
3111 if (disturb_state) disturb(0, 0);
3113 /* Redraw status bar */
3114 p_ptr->redraw |= (PR_STATUS);
3116 p_ptr->update |= (PU_BONUS);
3126 * Set a temporary elemental brand. Clear all other brands. Print status
3129 bool set_ele_immune(u32b immune_type, int v)
3131 /* Hack -- Force good values */
3132 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3134 /* Clear all elemental attacks (only one is allowed at a time). */
3135 if ((p_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
3137 p_ptr->special_defense &= ~(DEFENSE_ACID);
3139 msg_print("»À¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3141 msg_print("You are no longer immune to acid.");
3144 if ((p_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
3146 p_ptr->special_defense &= ~(DEFENSE_ELEC);
3148 msg_print("ÅÅ·â¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3150 msg_print("You are no longer immune to electricity.");
3153 if ((p_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
3155 p_ptr->special_defense &= ~(DEFENSE_FIRE);
3157 msg_print("²Ð±ê¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3159 msg_print("You are no longer immune to fire.");
3162 if ((p_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
3164 p_ptr->special_defense &= ~(DEFENSE_COLD);
3166 msg_print("Î䵤¤Î¹¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3168 msg_print("You are no longer immune to cold.");
3171 if ((p_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
3173 p_ptr->special_defense &= ~(DEFENSE_POIS);
3175 msg_print("ÆǤι¶·â¤Ç½ý¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¡£");
3177 msg_print("You are no longer immune to poison.");
3181 if ((v) && (immune_type))
3183 /* Set attack type. */
3184 p_ptr->special_defense |= (immune_type);
3187 p_ptr->ele_immune = v;
3191 msg_format("%s¤Î¹¶·â¤ò¼õ¤±¤Ä¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª",
3192 ((immune_type == DEFENSE_ACID) ? "»À" :
3193 ((immune_type == DEFENSE_ELEC) ? "ÅÅ·â" :
3194 ((immune_type == DEFENSE_FIRE) ? "²Ð±ê" :
3195 ((immune_type == DEFENSE_COLD) ? "Î䵤" :
3196 ((immune_type == DEFENSE_POIS) ? "ÆÇ" :
3199 msg_format("For a while, You are immune to %s",
3200 ((immune_type == DEFENSE_ACID) ? "acid!" :
3201 ((immune_type == DEFENSE_ELEC) ? "electricity!" :
3202 ((immune_type == DEFENSE_FIRE) ? "fire!" :
3203 ((immune_type == DEFENSE_COLD) ? "cold!" :
3204 ((immune_type == DEFENSE_POIS) ? "poison!" :
3205 "do nothing special."))))));
3210 if (disturb_state) disturb(0, 0);
3212 /* Redraw status bar */
3213 p_ptr->redraw |= (PR_STATUS);
3215 p_ptr->update |= (PU_BONUS);
3225 * Set "p_ptr->oppose_acid", notice observable changes
3227 bool set_oppose_acid(int v, bool do_dec)
3229 bool notice = FALSE;
3231 /* Hack -- Force good values */
3232 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3234 if (p_ptr->is_dead) return FALSE;
3239 if (p_ptr->oppose_acid && !do_dec)
3241 if (p_ptr->oppose_acid > v) return FALSE;
3243 else if (!IS_OPPOSE_ACID())
3246 msg_print("»À¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3248 msg_print("You feel resistant to acid!");
3258 if (p_ptr->oppose_acid && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3261 msg_print("»À¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3263 msg_print("You feel less resistant to acid.");
3271 p_ptr->oppose_acid = v;
3273 /* Nothing to notice */
3274 if (!notice) return (FALSE);
3276 /* Redraw status bar */
3277 p_ptr->redraw |= (PR_STATUS);
3280 if (disturb_state) disturb(0, 0);
3291 * Set "p_ptr->oppose_elec", notice observable changes
3293 bool set_oppose_elec(int v, bool do_dec)
3295 bool notice = FALSE;
3297 /* Hack -- Force good values */
3298 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3300 if (p_ptr->is_dead) return FALSE;
3305 if (p_ptr->oppose_elec && !do_dec)
3307 if (p_ptr->oppose_elec > v) return FALSE;
3309 else if (!IS_OPPOSE_ELEC())
3312 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3314 msg_print("You feel resistant to electricity!");
3324 if (p_ptr->oppose_elec && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3327 msg_print("ÅÅ·â¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3329 msg_print("You feel less resistant to electricity.");
3337 p_ptr->oppose_elec = v;
3339 /* Nothing to notice */
3340 if (!notice) return (FALSE);
3342 /* Redraw status bar */
3343 p_ptr->redraw |= (PR_STATUS);
3346 if (disturb_state) disturb(0, 0);
3357 * Set "p_ptr->oppose_fire", notice observable changes
3359 bool set_oppose_fire(int v, bool do_dec)
3361 bool notice = FALSE;
3363 /* Hack -- Force good values */
3364 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3366 if (p_ptr->is_dead) return FALSE;
3368 if ((prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
3372 if (p_ptr->oppose_fire && !do_dec)
3374 if (p_ptr->oppose_fire > v) return FALSE;
3376 else if (!IS_OPPOSE_FIRE())
3379 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3381 msg_print("You feel resistant to fire!");
3391 if (p_ptr->oppose_fire && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3394 msg_print("²Ð¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3396 msg_print("You feel less resistant to fire.");
3404 p_ptr->oppose_fire = v;
3406 /* Nothing to notice */
3407 if (!notice) return (FALSE);
3409 /* Redraw status bar */
3410 p_ptr->redraw |= (PR_STATUS);
3413 if (disturb_state) disturb(0, 0);
3424 * Set "p_ptr->oppose_cold", notice observable changes
3426 bool set_oppose_cold(int v, bool do_dec)
3428 bool notice = FALSE;
3430 /* Hack -- Force good values */
3431 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3433 if (p_ptr->is_dead) return FALSE;
3438 if (p_ptr->oppose_cold && !do_dec)
3440 if (p_ptr->oppose_cold > v) return FALSE;
3442 else if (!IS_OPPOSE_COLD())
3445 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3447 msg_print("You feel resistant to cold!");
3457 if (p_ptr->oppose_cold && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3460 msg_print("Î䵤¤Ø¤ÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3462 msg_print("You feel less resistant to cold.");
3470 p_ptr->oppose_cold = v;
3472 /* Nothing to notice */
3473 if (!notice) return (FALSE);
3475 /* Redraw status bar */
3476 p_ptr->redraw |= (PR_STATUS);
3479 if (disturb_state) disturb(0, 0);
3490 * Set "p_ptr->oppose_pois", notice observable changes
3492 bool set_oppose_pois(int v, bool do_dec)
3494 bool notice = FALSE;
3496 /* Hack -- Force good values */
3497 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3499 if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) v = 1;
3500 if (p_ptr->is_dead) return FALSE;
3505 if (p_ptr->oppose_pois && !do_dec)
3507 if (p_ptr->oppose_pois > v) return FALSE;
3509 else if (!IS_OPPOSE_POIS())
3512 msg_print("ÆǤؤÎÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
3514 msg_print("You feel resistant to poison!");
3524 if (p_ptr->oppose_pois && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
3527 msg_print("ÆǤؤÎÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
3529 msg_print("You feel less resistant to poison.");
3537 p_ptr->oppose_pois = v;
3539 /* Nothing to notice */
3540 if (!notice) return (FALSE);
3542 /* Redraw status bar */
3543 p_ptr->redraw |= (PR_STATUS);
3546 if (disturb_state) disturb(0, 0);
3557 * Set "p_ptr->stun", notice observable changes
3559 * Note the special code to only notice "range" changes.
3561 bool set_stun(int v)
3563 int old_aux, new_aux;
3564 bool notice = FALSE;
3567 /* Hack -- Force good values */
3568 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3570 if (p_ptr->is_dead) return FALSE;
3572 if (prace_is_(RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
3575 if (p_ptr->stun > 100)
3581 else if (p_ptr->stun > 50)
3587 else if (p_ptr->stun > 0)
3623 if (new_aux > old_aux)
3625 /* Describe the state */
3631 msg_print("°Õ¼±¤¬¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3633 msg_print("You have been stunned.");
3641 msg_print("°Õ¼±¤¬¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤Æ¤¤¿¡£");
3643 msg_print("You have been heavily stunned.");
3651 msg_print("Ƭ¤¬¥¯¥é¥¯¥é¤·¤Æ°Õ¼±¤¬±ó¤Î¤¤¤Æ¤¤¿¡£");
3653 msg_print("You have been knocked out.");
3659 if (randint1(1000) < v || one_in_(16))
3662 msg_print("³ä¤ì¤ë¤è¤¦¤ÊƬÄˤ¬¤¹¤ë¡£");
3664 msg_print("A vicious blow hits your head.");
3669 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3670 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3672 else if (one_in_(2))
3674 if (!p_ptr->sustain_int) (void)do_dec_stat(A_INT);
3678 if (!p_ptr->sustain_wis) (void)do_dec_stat(A_WIS);
3681 if (p_ptr->special_defense & KATA_MASK)
3684 msg_print("·¿¤¬Êø¤ì¤¿¡£");
3686 msg_print("Your posture gets loose.");
3688 p_ptr->special_defense &= ~(KATA_MASK);
3689 p_ptr->update |= (PU_BONUS);
3690 p_ptr->update |= (PU_MONSTERS);
3691 p_ptr->redraw |= (PR_STATE);
3692 p_ptr->redraw |= (PR_STATUS);
3693 p_ptr->action = ACTION_NONE;
3697 if (p_ptr->concent) reset_concentration(TRUE);
3700 if (hex_spelling_any()) stop_hex_spell_all();
3707 else if (new_aux < old_aux)
3709 /* Describe the state */
3715 msg_print("¤ä¤Ã¤ÈÛ¯Û°¾õÂÖ¤«¤é²óÉü¤·¤¿¡£");
3717 msg_print("You are no longer stunned.");
3720 if (disturb_state) disturb(0, 0);
3732 if (!notice) return (FALSE);
3735 if (disturb_state) disturb(0, 0);
3737 /* Recalculate bonuses */
3738 p_ptr->update |= (PU_BONUS);
3740 /* Redraw the "stun" */
3741 p_ptr->redraw |= (PR_STUN);
3752 * Set "p_ptr->cut", notice observable changes
3754 * Note the special code to only notice "range" changes.
3758 int old_aux, new_aux;
3759 bool notice = FALSE;
3761 /* Hack -- Force good values */
3762 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
3764 if (p_ptr->is_dead) return FALSE;
3766 if ((p_ptr->prace == RACE_GOLEM ||
3767 p_ptr->prace == RACE_SKELETON ||
3768 p_ptr->prace == RACE_SPECTRE ||
3769 (p_ptr->prace == RACE_ZOMBIE && p_ptr->lev > 11)) &&
3774 if (p_ptr->cut > 1000)
3780 else if (p_ptr->cut > 200)
3786 else if (p_ptr->cut > 100)
3792 else if (p_ptr->cut > 50)
3798 else if (p_ptr->cut > 25)
3804 else if (p_ptr->cut > 10)
3810 else if (p_ptr->cut > 0)
3870 if (new_aux > old_aux)
3872 /* Describe the state */
3878 msg_print("¤«¤¹¤ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3880 msg_print("You have been given a graze.");
3888 msg_print("·Ú¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3890 msg_print("You have been given a light cut.");
3898 msg_print("¤Ò¤É¤¤½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3900 msg_print("You have been given a bad cut.");
3908 msg_print("ÂçÊѤʽý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3910 msg_print("You have been given a nasty cut.");
3918 msg_print("½ÅÂç¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3920 msg_print("You have been given a severe cut.");
3928 msg_print("¤Ò¤É¤¤¿¼¼ê¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3930 msg_print("You have been given a deep gash.");
3938 msg_print("Ã×̿Ū¤Ê½ý¤òÉé¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3940 msg_print("You have been given a mortal wound.");
3949 if (randint1(1000) < v || one_in_(16))
3951 if (!p_ptr->sustain_chr)
3954 msg_print("¤Ò¤É¤¤½ýÀפ¬»Ä¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
3956 msg_print("You have been horribly scarred.");
3966 else if (new_aux < old_aux)
3968 /* Describe the state */
3974 msg_format("¤ä¤Ã¤È%s¡£", p_ptr->prace == RACE_ANDROID ? "²ø²æ¤¬Ä¾¤Ã¤¿" : "½Ð·ì¤¬»ß¤Þ¤Ã¤¿");
3976 msg_print("You are no longer bleeding.");
3979 if (disturb_state) disturb(0, 0);
3991 if (!notice) return (FALSE);
3994 if (disturb_state) disturb(0, 0);
3996 /* Recalculate bonuses */
3997 p_ptr->update |= (PU_BONUS);
3999 /* Redraw the "cut" */
4000 p_ptr->redraw |= (PR_CUT);
4011 * Set "p_ptr->food", notice observable changes
4013 * The "p_ptr->food" variable can get as large as 20000, allowing the
4014 * addition of the most "filling" item, Elvish Waybread, which adds
4015 * 7500 food units, without overflowing the 32767 maximum limit.
4017 * Perhaps we should disturb the player with various messages,
4018 * especially messages about hunger status changes. XXX XXX XXX
4020 * Digestion of food is handled in "dungeon.c", in which, normally,
4021 * the player digests about 20 food units per 100 game turns, more
4022 * when "fast", more when "regenerating", less with "slow digestion",
4023 * but when the player is "gorged", he digests 100 food units per 10
4024 * game turns, or a full 1000 food units per 100 game turns.
4026 * Note that the player's speed is reduced by 10 units while gorged,
4027 * so if the player eats a single food ration (5000 food units) when
4028 * full (15000 food units), he will be gorged for (5000/100)*10 = 500
4029 * game turns, or 500/(100/5) = 25 player turns (if nothing else is
4030 * affecting the player speed).
4032 bool set_food(int v)
4034 int old_aux, new_aux;
4036 bool notice = FALSE;
4038 /* Hack -- Force good values */
4039 v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
4041 /* Fainting / Starving */
4042 if (p_ptr->food < PY_FOOD_FAINT)
4048 else if (p_ptr->food < PY_FOOD_WEAK)
4054 else if (p_ptr->food < PY_FOOD_ALERT)
4060 else if (p_ptr->food < PY_FOOD_FULL)
4066 else if (p_ptr->food < PY_FOOD_MAX)
4077 /* Fainting / Starving */
4078 if (v < PY_FOOD_FAINT)
4084 else if (v < PY_FOOD_WEAK)
4090 else if (v < PY_FOOD_ALERT)
4096 else if (v < PY_FOOD_FULL)
4102 else if (v < PY_FOOD_MAX)
4113 if (old_aux < 1 && new_aux > 0)
4114 chg_virtue(V_PATIENCE, 2);
4115 else if (old_aux < 3 && (old_aux != new_aux))
4116 chg_virtue(V_PATIENCE, 1);
4118 chg_virtue(V_TEMPERANCE, 1);
4120 chg_virtue(V_TEMPERANCE, -1);
4123 if (new_aux > old_aux)
4125 /* Describe the state */
4131 msg_print("¤Þ¤À¶õÊ¢¤ÇÅݤ줽¤¦¤À¡£");
4133 msg_print("You are still weak.");
4141 msg_print("¤Þ¤À¶õÊ¢¤À¡£");
4143 msg_print("You are still hungry.");
4151 msg_print("¶õÊ¢´¶¤¬¤ª¤µ¤Þ¤Ã¤¿¡£");
4153 msg_print("You are no longer hungry.");
4161 msg_print("ËþÊ¢¤À¡ª");
4163 msg_print("You are full!");
4171 msg_print("¿©¤Ù²á¤®¤À¡ª");
4173 msg_print("You have gorged yourself!");
4175 chg_virtue(V_HARMONY, -1);
4176 chg_virtue(V_PATIENCE, -1);
4177 chg_virtue(V_TEMPERANCE, -2);
4187 else if (new_aux < old_aux)
4189 /* Describe the state */
4192 /* Fainting / Starving */
4195 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤¤ò¼º¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
4197 msg_print("You are getting faint from hunger!");
4205 msg_print("¤ªÊ¢¤¬¶õ¤¤¤ÆÅݤ줽¤¦¤À¡£");
4207 msg_print("You are getting weak from hunger!");
4215 msg_print("¤ªÊ¢¤¬¶õ¤¤¤Æ¤¤¿¡£");
4217 msg_print("You are getting hungry.");
4225 msg_print("ËþÊ¢´¶¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
4227 msg_print("You are no longer full.");
4235 msg_print("¤ä¤Ã¤È¤ªÊ¢¤¬¤¤Ä¤¯¤Ê¤¯¤Ê¤Ã¤¿¡£");
4237 msg_print("You are no longer gorged.");
4243 if (p_ptr->wild_mode && (new_aux < 2))
4255 /* Nothing to notice */
4256 if (!notice) return (FALSE);
4259 if (disturb_state) disturb(0, 0);
4261 /* Recalculate bonuses */
4262 p_ptr->update |= (PU_BONUS);
4265 p_ptr->redraw |= (PR_HUNGER);
4275 * Increases a stat by one randomized level -RAK-
4277 * Note that this function (used by stat potions) now restores
4278 * the stat BEFORE increasing it.
4280 bool inc_stat(int stat)
4284 /* Then augment the current/max stat */
4285 value = p_ptr->stat_cur[stat];
4287 /* Cannot go above 18/100 */
4288 if (value < p_ptr->stat_max_max[stat])
4290 /* Gain one (sometimes two) points */
4293 gain = ((randint0(100) < 75) ? 1 : 2);
4297 /* Gain 1/6 to 1/3 of distance to 18/100 */
4298 else if (value < (p_ptr->stat_max_max[stat]-2))
4300 /* Approximate gain value */
4301 gain = (((p_ptr->stat_max_max[stat]) - value) / 2 + 3) / 2;
4304 if (gain < 1) gain = 1;
4306 /* Apply the bonus */
4307 value += randint1(gain) + gain / 2;
4310 if (value > (p_ptr->stat_max_max[stat]-1)) value = p_ptr->stat_max_max[stat]-1;
4313 /* Gain one point at a time */
4319 /* Save the new value */
4320 p_ptr->stat_cur[stat] = value;
4322 /* Bring up the maximum too */
4323 if (value > p_ptr->stat_max[stat])
4325 p_ptr->stat_max[stat] = value;
4328 /* Recalculate bonuses */
4329 p_ptr->update |= (PU_BONUS);
4335 /* Nothing to gain */
4342 * Decreases a stat by an amount indended to vary from 0 to 100 percent.
4344 * Amount could be a little higher in extreme cases to mangle very high
4345 * stats from massive assaults. -CWS
4347 * Note that "permanent" means that the *given* amount is permanent,
4348 * not that the new value becomes permanent. This may not work exactly
4349 * as expected, due to "weirdness" in the algorithm, but in general,
4350 * if your stat is already drained, the "max" value will not drop all
4351 * the way down to the "cur" value.
4353 bool dec_stat(int stat, int amount, int permanent)
4355 int cur, max, loss, same, res = FALSE;
4358 /* Acquire current value */
4359 cur = p_ptr->stat_cur[stat];
4360 max = p_ptr->stat_max[stat];
4362 /* Note when the values are identical */
4363 same = (cur == max);
4365 /* Damage "current" value */
4368 /* Handle "low" values */
4371 if (amount > 90) cur--;
4372 if (amount > 50) cur--;
4373 if (amount > 20) cur--;
4377 /* Handle "high" values */
4380 /* Hack -- Decrement by a random amount between one-quarter */
4381 /* and one-half of the stat bonus times the percentage, with a */
4382 /* minimum damage of half the percentage. -CWS */
4383 loss = (((cur-18) / 2 + 1) / 2 + 1);
4386 if (loss < 1) loss = 1;
4388 /* Randomize the loss */
4389 loss = ((randint1(loss) + loss) * amount) / 100;
4392 if (loss < amount/2) loss = amount/2;
4394 /* Lose some points */
4397 /* Hack -- Only reduce stat to 17 sometimes */
4398 if (cur < 18) cur = (amount <= 20) ? 18 : 17;
4401 /* Prevent illegal values */
4402 if (cur < 3) cur = 3;
4404 /* Something happened */
4405 if (cur != p_ptr->stat_cur[stat]) res = TRUE;
4408 /* Damage "max" value */
4409 if (permanent && (max > 3))
4411 chg_virtue(V_SACRIFICE, 1);
4412 if (stat == A_WIS || stat == A_INT)
4413 chg_virtue(V_ENLIGHTEN, -2);
4415 /* Handle "low" values */
4418 if (amount > 90) max--;
4419 if (amount > 50) max--;
4420 if (amount > 20) max--;
4424 /* Handle "high" values */
4427 /* Hack -- Decrement by a random amount between one-quarter */
4428 /* and one-half of the stat bonus times the percentage, with a */
4429 /* minimum damage of half the percentage. -CWS */
4430 loss = (((max-18) / 2 + 1) / 2 + 1);
4431 loss = ((randint1(loss) + loss) * amount) / 100;
4432 if (loss < amount/2) loss = amount/2;
4434 /* Lose some points */
4437 /* Hack -- Only reduce stat to 17 sometimes */
4438 if (max < 18) max = (amount <= 20) ? 18 : 17;
4441 /* Hack -- keep it clean */
4442 if (same || (max < cur)) max = cur;
4444 /* Something happened */
4445 if (max != p_ptr->stat_max[stat]) res = TRUE;
4451 /* Actually set the stat to its new value. */
4452 p_ptr->stat_cur[stat] = cur;
4453 p_ptr->stat_max[stat] = max;
4455 /* Redisplay the stats later */
4456 p_ptr->redraw |= (PR_STATS);
4458 /* Recalculate bonuses */
4459 p_ptr->update |= (PU_BONUS);
4468 * Restore a stat. Return TRUE only if this actually makes a difference.
4470 bool res_stat(int stat)
4472 /* Restore if needed */
4473 if (p_ptr->stat_cur[stat] != p_ptr->stat_max[stat])
4476 p_ptr->stat_cur[stat] = p_ptr->stat_max[stat];
4478 /* Recalculate bonuses */
4479 p_ptr->update |= (PU_BONUS);
4481 /* Redisplay the stats later */
4482 p_ptr->redraw |= (PR_STATS);
4488 /* Nothing to restore */
4494 * Increase players hit points, notice effects
4496 bool hp_player(int num)
4499 vir = virtue_number(V_VITALITY);
4502 num = num * (p_ptr->virtues[vir - 1] + 1250) / 1250;
4504 /* Healing needed */
4505 if (p_ptr->chp < p_ptr->mhp)
4507 if ((num > 0) && (p_ptr->chp < (p_ptr->mhp/3)))
4508 chg_virtue(V_TEMPERANCE, 1);
4509 /* Gain hitpoints */
4512 /* Enforce maximum */
4513 if (p_ptr->chp >= p_ptr->mhp)
4515 p_ptr->chp = p_ptr->mhp;
4516 p_ptr->chp_frac = 0;
4520 p_ptr->redraw |= (PR_HP);
4523 p_ptr->window |= (PW_PLAYER);
4529 msg_print("¾¯¤·µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4531 msg_print("You feel a little better.");
4540 msg_print("µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4542 msg_print("You feel better.");
4551 msg_print("¤È¤Æ¤âµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4553 msg_print("You feel much better.");
4562 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤¿¡£");
4564 msg_print("You feel very good.");
4579 * Array of stat "descriptions"
4581 static cptr desc_stat_pos[] =
4623 * Array of stat "descriptions"
4625 static cptr desc_stat_neg[] =
4649 bool do_dec_stat(int stat)
4653 /* Access the "sustain" */
4656 case A_STR: if (p_ptr->sustain_str) sust = TRUE; break;
4657 case A_INT: if (p_ptr->sustain_int) sust = TRUE; break;
4658 case A_WIS: if (p_ptr->sustain_wis) sust = TRUE; break;
4659 case A_DEX: if (p_ptr->sustain_dex) sust = TRUE; break;
4660 case A_CON: if (p_ptr->sustain_con) sust = TRUE; break;
4661 case A_CHR: if (p_ptr->sustain_chr) sust = TRUE; break;
4665 if (sust && (!ironman_nightmare || randint0(13)))
4669 msg_format("%s¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¤¬¡¢¤¹¤°¤Ë¸µ¤ËÌá¤Ã¤¿¡£",
4671 msg_format("You feel %s for a moment, but the feeling passes.",
4674 desc_stat_neg[stat]);
4680 /* Attempt to reduce the stat */
4681 if (dec_stat(stat, 10, (ironman_nightmare && !randint0(13))))
4685 msg_format("¤Ò¤É¤¯%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_neg[stat]);
4687 msg_format("You feel very %s.", desc_stat_neg[stat]);
4695 /* Nothing obvious */
4701 * Restore lost "points" in a stat
4703 bool do_res_stat(int stat)
4705 /* Attempt to increase */
4710 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4712 msg_format("You feel less %s.", desc_stat_neg[stat]);
4720 /* Nothing obvious */
4726 * Gain a "point" in a stat
4728 bool do_inc_stat(int stat)
4732 /* Restore strength */
4733 res = res_stat(stat);
4735 /* Attempt to increase */
4740 chg_virtue(V_ENLIGHTEN, 1);
4741 chg_virtue(V_FAITH, 1);
4743 else if (stat == A_INT)
4745 chg_virtue(V_KNOWLEDGE, 1);
4746 chg_virtue(V_ENLIGHTEN, 1);
4748 else if (stat == A_CON)
4749 chg_virtue(V_VITALITY, 1);
4753 msg_format("¥ï¡¼¥ª¡ª¤È¤Æ¤â%s¤Ê¤Ã¤¿¡ª", desc_stat_pos[stat]);
4755 msg_format("Wow! You feel very %s!", desc_stat_pos[stat]);
4763 /* Restoration worked */
4768 msg_format("¸µÄ̤ê¤Ë%s¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£", desc_stat_pos[stat]);
4770 msg_format("You feel less %s.", desc_stat_neg[stat]);
4778 /* Nothing obvious */
4784 * Restores any drained experience
4786 bool restore_level(void)
4788 /* Restore experience */
4789 if (p_ptr->exp < p_ptr->max_exp)
4793 msg_print("À¸Ì¿ÎϤ¬Ìá¤Ã¤Æ¤¤¿µ¤¤¬¤¹¤ë¡£");
4795 msg_print("You feel your life energies returning.");
4799 /* Restore the experience */
4800 p_ptr->exp = p_ptr->max_exp;
4802 /* Check the experience */
4817 bool lose_all_info(void)
4821 chg_virtue(V_KNOWLEDGE, -5);
4822 chg_virtue(V_ENLIGHTEN, -5);
4824 /* Forget info about objects */
4825 for (i = 0; i < INVEN_TOTAL; i++)
4827 object_type *o_ptr = &inventory[i];
4829 /* Skip non-objects */
4830 if (!o_ptr->k_idx) continue;
4832 /* Allow "protection" by the MENTAL flag */
4833 if (o_ptr->ident & (IDENT_MENTAL)) continue;
4835 /* Remove "default inscriptions" */
4836 o_ptr->feeling = FEEL_NONE;
4838 /* Hack -- Clear the "empty" flag */
4839 o_ptr->ident &= ~(IDENT_EMPTY);
4841 /* Hack -- Clear the "known" flag */
4842 o_ptr->ident &= ~(IDENT_KNOWN);
4844 /* Hack -- Clear the "felt" flag */
4845 o_ptr->ident &= ~(IDENT_SENSE);
4848 /* Recalculate bonuses */
4849 p_ptr->update |= (PU_BONUS);
4851 /* Combine / Reorder the pack (later) */
4852 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
4855 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
4857 /* Mega-Hack -- Forget the map */
4865 void do_poly_wounds(void)
4867 /* Changed to always provide at least _some_ healing */
4868 s16b wounds = p_ptr->cut;
4869 s16b hit_p = (p_ptr->mhp - p_ptr->chp);
4870 s16b change = damroll(p_ptr->lev, 5);
4871 bool Nasty_effect = one_in_(5);
4873 if (!(wounds || hit_p || Nasty_effect)) return;
4876 msg_print("½ý¤¬¤è¤ê·Ú¤¤¤â¤Î¤ËÊѲ½¤·¤¿¡£");
4878 msg_print("Your wounds are polymorphed into less serious ones.");
4885 msg_print("¿·¤¿¤Ê½ý¤¬¤Ç¤¤¿¡ª");
4886 take_hit(DAMAGE_LOSELIFE, change / 2, "ÊѲ½¤·¤¿½ý", -1);
4888 msg_print("A new wound was created!");
4889 take_hit(DAMAGE_LOSELIFE, change / 2, "a polymorphed wound", -1);
4896 set_cut(p_ptr->cut - (change / 2));
4902 * Change player race
4904 void change_race(int new_race, cptr effect_msg)
4906 cptr title = race_info[new_race].title;
4907 int old_race = p_ptr->prace;
4910 msg_format("¤¢¤Ê¤¿¤Ï%s%s¤ËÊѲ½¤·¤¿¡ª", effect_msg, title);
4912 msg_format("You turn into %s %s%s!", (!effect_msg[0] && is_a_vowel(title[0]) ? "an" : "a"), effect_msg, title);
4915 chg_virtue(V_CHANCE, 2);
4917 if (p_ptr->prace < 32)
4919 p_ptr->old_race1 |= 1L << p_ptr->prace;
4923 p_ptr->old_race2 |= 1L << (p_ptr->prace-32);
4925 p_ptr->prace = new_race;
4926 rp_ptr = &race_info[p_ptr->prace];
4928 /* Experience factor */
4929 p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
4932 * The speed bonus of Klackons and Sprites are disabled
4933 * and the experience penalty is decreased.
4935 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)))
4936 p_ptr->expfact -= 15;
4938 /* Get character's height and weight */
4939 get_height_weight();
4942 if (p_ptr->pclass == CLASS_SORCERER)
4943 p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
4945 p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
4947 do_cmd_rerate(FALSE);
4949 /* The experience level may be modified */
4952 p_ptr->redraw |= (PR_BASIC);
4954 p_ptr->update |= (PU_BONUS);
4958 /* Load an autopick preference file */
4959 if (old_race != p_ptr->prace) autopick_load_pref(FALSE);
4961 /* Player's graphic tile may change */
4966 void do_poly_self(void)
4968 int power = p_ptr->lev;
4971 msg_print("¤¢¤Ê¤¿¤ÏÊѲ½¤Îˬ¤ì¤ò´¶¤¸¤¿...");
4973 msg_print("You feel a change coming over you...");
4976 chg_virtue(V_CHANCE, 1);
4978 if ((power > randint0(20)) && one_in_(3) && (p_ptr->prace != RACE_ANDROID))
4980 char effect_msg[80] = "";
4983 /* Some form of racial polymorph... */
4986 if ((power > randint0(5)) && one_in_(4))
4991 if (p_ptr->psex == SEX_MALE)
4993 p_ptr->psex = SEX_FEMALE;
4994 sp_ptr = &sex_info[p_ptr->psex];
4996 sprintf(effect_msg, "½÷À¤Î");
4998 sprintf(effect_msg, "female ");
5004 p_ptr->psex = SEX_MALE;
5005 sp_ptr = &sex_info[p_ptr->psex];
5007 sprintf(effect_msg, "ÃËÀ¤Î");
5009 sprintf(effect_msg, "male ");
5015 if ((power > randint0(30)) && one_in_(5))
5019 /* Harmful deformity */
5026 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
5032 /* Deformities are discriminated against! */
5033 (void)dec_stat(A_CHR, randint1(6), TRUE);
5039 sprintf(tmp_msg,"%s",effect_msg);
5040 sprintf(effect_msg,"´ñ·Á¤Î%s",tmp_msg);
5042 sprintf(tmp_msg,"%s ",effect_msg);
5043 sprintf(effect_msg,"deformed %s ",tmp_msg);
5050 sprintf(effect_msg,"´ñ·Á¤Î");
5052 sprintf(effect_msg,"deformed ");
5058 while ((power > randint0(20)) && one_in_(10))
5060 /* Polymorph into a less mutated form */
5063 if (!lose_mutation(0))
5065 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
5067 msg_print("You feel oddly normal.");
5074 new_race = randint0(MAX_RACES);
5076 while ((new_race == p_ptr->prace) || (new_race == RACE_ANDROID));
5078 change_race(new_race, effect_msg);
5081 if ((power > randint0(30)) && one_in_(6))
5089 msg_format("%s¤Î¹½À®¤¬ÊѲ½¤·¤¿¡ª", p_ptr->prace == RACE_ANDROID ? "µ¡³£" : "Æâ¡");
5091 msg_print("Your internal organs are rearranged!");
5096 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
5102 msg_print("¸½ºß¤Î»Ñ¤ÇÀ¸¤¤Æ¤¤¤¯¤Î¤Ïº¤Æñ¤Ê¤è¤¦¤À¡ª");
5103 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), "Ã×̿Ū¤ÊÆÍÁ³ÊÑ°Û", -1);
5105 msg_print("You find living difficult in your present form!");
5106 take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), "a lethal mutation", -1);
5113 if ((power > randint0(20)) && one_in_(4))
5118 do_cmd_rerate(FALSE);
5121 while ((power > randint0(15)) && one_in_(3))
5124 (void)gain_random_mutation(0);
5127 if (power > randint0(5))
5133 /* Note: earlier deductions may have left power < 0 already. */
5143 * Decreases players hit points and sets death flag if necessary
5145 * XXX XXX XXX Invulnerability needs to be changed into a "shield"
5147 * XXX XXX XXX Hack -- this function allows the user to save (or quit)
5148 * the game when he dies, since the "You die." message is shown before
5149 * setting the player to "dead".
5152 int take_hit(int damage_type, int damage, cptr hit_from, int monspell)
5154 int old_chp = p_ptr->chp;
5156 char death_message[1024];
5159 int warning = (p_ptr->mhp * hitpoint_warn / 10);
5162 if (p_ptr->is_dead) return 0;
5164 if (p_ptr->sutemi) damage *= 2;
5165 if (p_ptr->special_defense & KATA_IAI) damage += (damage + 4) / 5;
5167 if (easy_band) damage = (damage+1)/2;
5169 if (damage_type != DAMAGE_USELIFE)
5179 if (monspell >= 0) learn_spell(monspell);
5181 /* Mega-Hack -- Apply "invulnerability" */
5182 if ((damage_type != DAMAGE_USELIFE) && (damage_type != DAMAGE_LOSELIFE))
5184 if (IS_INVULN() && (damage < 9000))
5186 if (damage_type == DAMAGE_FORCE)
5189 msg_print("¥Ð¥ê¥¢¤¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5191 msg_print("The attack cuts your shield of invulnerability open!");
5194 else if (one_in_(PENETRATE_INVULNERABILITY))
5197 msg_print("̵Ũ¤Î¥Ð¥ê¥¢¤òÇˤäƹ¶·â¤µ¤ì¤¿¡ª");
5199 msg_print("The attack penetrates your shield of invulnerability!");
5208 if (CHECK_MULTISHADOW())
5210 if (damage_type == DAMAGE_FORCE)
5213 msg_print("¸¸±Æ¤â¤í¤È¤âÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5215 msg_print("The attack hits Shadow together with you!");
5218 else if (damage_type == DAMAGE_ATTACK)
5221 msg_print("¹¶·â¤Ï¸¸±Æ¤ËÌ¿Ã椷¡¢¤¢¤Ê¤¿¤Ë¤ÏÆϤ«¤Ê¤«¤Ã¤¿¡£");
5223 msg_print("The attack hits Shadow, you are unharmed!");
5229 if (p_ptr->wraith_form)
5231 if (damage_type == DAMAGE_FORCE)
5234 msg_print("Ⱦʪ¼Á¤ÎÂΤ¬ÀÚ¤êÎö¤«¤ì¤¿¡ª");
5236 msg_print("The attack cuts through your ethereal body!");
5242 if ((damage == 0) && one_in_(2)) damage = 1;
5246 if (p_ptr->special_defense & KATA_MUSOU)
5249 if ((damage == 0) && one_in_(2)) damage = 1;
5251 } /* not if LOSELIFE USELIFE */
5253 /* Hurt the player */
5254 p_ptr->chp -= damage;
5255 if(damage_type == DAMAGE_GENO && p_ptr->chp < 0)
5257 damage += p_ptr->chp;
5261 /* Display the hitpoints */
5262 p_ptr->redraw |= (PR_HP);
5265 p_ptr->window |= (PW_PLAYER);
5267 if (damage_type != DAMAGE_GENO && p_ptr->chp == 0)
5269 chg_virtue(V_SACRIFICE, 1);
5270 chg_virtue(V_CHANCE, 2);
5276 bool android = (p_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
5278 #ifdef JP /* »à¤ó¤À»þ¤Ë¶¯À©½ªÎ»¤·¤Æ»à¤ò²óÈò¤Ç¤¤Ê¤¯¤·¤Æ¤ß¤¿ by Habu */
5280 if(!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
5286 chg_virtue(V_SACRIFICE, 10);
5291 p_ptr->leaving = TRUE;
5294 p_ptr->is_dead = TRUE;
5296 if (p_ptr->inside_arena)
5298 cptr m_name = r_name+r_info[arena_info[p_ptr->arena_number].r_idx].name;
5300 msg_format("¤¢¤Ê¤¿¤Ï%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£", m_name);
5302 msg_format("You are beaten by %s.", m_name);
5305 if (record_arena) do_cmd_write_nikki(NIKKI_ARENA, -1 - p_ptr->arena_number, m_name);
5309 int q_idx = quest_number(dun_level);
5310 bool seppuku = streq(hit_from, "Seppuku");
5311 bool winning_seppuku = p_ptr->total_winner && seppuku;
5314 /* Make screen dump */
5315 screen_dump = make_screen_dump();
5318 /* Note cause of death */
5321 strcpy(p_ptr->died_from, hit_from);
5323 if (!winning_seppuku) strcpy(p_ptr->died_from, "ÀÚÊ¢");
5330 sprintf(dummy, "%s%s%s", !p_ptr->paralyzed ? "" : p_ptr->free_act ? "ĦÁü¾õÂÖ¤Ç" : "Ëãáã¾õÂÖ¤Ç", p_ptr->image ? "¸¸³Ð¤ËÏĤó¤À" : "", hit_from);
5332 sprintf(dummy, "%s%s", hit_from, !p_ptr->paralyzed ? "" : " while helpless");
5334 my_strcpy(p_ptr->died_from, dummy, sizeof p_ptr->died_from);
5337 /* No longer a winner */
5338 p_ptr->total_winner = FALSE;
5340 if (winning_seppuku)
5343 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¾¡Íø¤Î¸åÀÚÊ¢¤·¤¿¡£");
5345 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "did Seppuku after the winning.");
5352 if (p_ptr->inside_arena)
5354 strcpy(buf,"¥¢¥ê¡¼¥Ê");
5356 strcpy(buf,"in the Arena");
5358 else if (!dun_level)
5362 strcpy(buf,"on the surface");
5364 else if (q_idx && (is_fixed_quest_idx(q_idx) &&
5365 !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
5367 strcpy(buf,"¥¯¥¨¥¹¥È");
5369 strcpy(buf,"in a quest");
5373 sprintf(buf,"%d³¬", dun_level);
5375 sprintf(buf,"level %d", dun_level);
5379 sprintf(tmp, "%s¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", buf, p_ptr->died_from);
5381 sprintf(tmp, "killed by %s %s.", p_ptr->died_from, buf);
5383 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5387 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- ¥²¡¼¥à¥ª¡¼¥Ð¡¼ --------");
5389 do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- Game Over --------");
5391 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, "\n\n\n\n");
5396 if (get_check_strict("²èÌ̤òÊݸ¤·¤Þ¤¹¤«¡©", CHECK_NO_HISTORY))
5398 if (get_check_strict("Dump the screen? ", CHECK_NO_HISTORY))
5401 do_cmd_save_screen();
5406 /* Initialize "last message" buffer */
5407 if (p_ptr->last_message) string_free(p_ptr->last_message);
5408 p_ptr->last_message = NULL;
5410 /* Hack -- Note death */
5414 msg_format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë");
5416 msg_print(android ? "You are broken." : "You die.");
5423 if (winning_seppuku)
5426 get_rnd_line("seppuku_j.txt", 0, death_message);
5428 get_rnd_line("seppuku.txt", 0, death_message);
5434 get_rnd_line("death_j.txt", 0, death_message);
5436 get_rnd_line("death.txt", 0, death_message);
5443 while (!get_string(winning_seppuku ? "¼À¤¤Î¶ç: " : "ÃÇËöËâ¤Î¶«¤Ó: ", death_message, 1024)) ;
5445 while (!get_string("Last word: ", death_message, 1024)) ;
5449 while (winning_seppuku && !get_check_strict("¤è¤í¤·¤¤¤Ç¤¹¤«¡©", CHECK_NO_HISTORY));
5451 while (winning_seppuku && !get_check_strict("Are you sure? ", CHECK_NO_HISTORY));
5454 if (death_message[0] == '\0')
5457 strcpy(death_message, format("¤¢¤Ê¤¿¤Ï%s¤Þ¤·¤¿¡£", android ? "²õ¤ì" : "»à¤Ë"));
5459 strcpy(death_message, android ? "You are broken." : "You die.");
5462 else p_ptr->last_message = string_make(death_message);
5465 if (winning_seppuku)
5470 int msg_pos_x[9] = { 5, 7, 9, 12, 14, 17, 19, 21, 23};
5471 int msg_pos_y[9] = { 3, 4, 5, 4, 5, 4, 5, 6, 4};
5478 for (i = 0; i < 40; i++)
5479 Term_putstr(randint0(w / 2) * 2, randint0(h), 2, TERM_VIOLET, "¦Ô");
5481 str = death_message;
5482 if (strncmp(str, "¡Ö", 2) == 0) str += 2;
5484 str2 = my_strstr(str, "¡×");
5485 if (str2 != NULL) *str2 = '\0';
5490 str2 = my_strstr(str, " ");
5491 if (str2 == NULL) len = strlen(str);
5492 else len = str2 - str;
5496 Term_putstr_v(w * 3 / 4 - 2 - msg_pos_x[i] * 2, msg_pos_y[i], len,
5498 if (str2 == NULL) break;
5502 if (*str == 0) break;
5506 Term_putstr(w-1, h-1, 1, TERM_WHITE, " ");
5510 /* Make screen dump */
5511 screen_dump = make_screen_dump();
5514 /* Wait a key press */
5519 msg_print(death_message);
5529 /* Hitpoint warning */
5530 if (p_ptr->chp < warning)
5532 /* Hack -- bell on first notice */
5533 if (old_chp > warning) bell();
5537 if (record_danger && (old_chp > warning))
5539 if (p_ptr->image && damage_type == DAMAGE_ATTACK)
5543 hit_from = "something";
5547 sprintf(tmp,"%s¤Ë¤è¤Ã¤Æ¥Ô¥ó¥Á¤Ë´Ù¤Ã¤¿¡£",hit_from);
5549 sprintf(tmp,"A critical situation because of %s.",hit_from);
5551 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
5556 /* stop auto_more even if DAMAGE_USELIFE */
5562 msg_print("*** ·Ù¹ð:Äã¥Ò¥Ã¥È¡¦¥Ý¥¤¥ó¥È¡ª ***");
5564 msg_print("*** LOW HITPOINT WARNING! ***");
5570 if (p_ptr->wild_mode && !p_ptr->leaving && (p_ptr->chp < MAX(warning, p_ptr->mhp/5)))
5581 void gain_exp_64(s32b amount, u32b amount_frac)
5583 if (p_ptr->is_dead) return;
5585 if (p_ptr->prace == RACE_ANDROID) return;
5587 /* Gain some experience */
5588 s64b_add(&(p_ptr->exp), &(p_ptr->exp_frac), amount, amount_frac);
5590 /* Slowly recover from experience drainage */
5591 if (p_ptr->exp < p_ptr->max_exp)
5593 /* Gain max experience (20%) (was 10%) */
5594 p_ptr->max_exp += amount / 5;
5597 /* Check Experience */
5605 void gain_exp(s32b amount)
5607 gain_exp_64(amount, 0L);
5611 void calc_android_exp(void)
5615 if (p_ptr->is_dead) return;
5617 if (p_ptr->prace != RACE_ANDROID) return;
5619 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
5621 object_type *o_ptr = &inventory[i];
5623 object_type *q_ptr = &forge;
5625 int level = MAX(k_info[o_ptr->k_idx].level - 8, 1);
5627 if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue;
5628 if (!o_ptr->k_idx) continue;
5630 /* Wipe the object */
5633 object_copy(q_ptr, o_ptr);
5634 q_ptr->discount = 0;
5635 q_ptr->curse_flags = 0L;
5637 if (object_is_fixed_artifact(o_ptr))
5639 level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
5640 level += MIN(20, a_info[o_ptr->name1].rarity/(a_info[o_ptr->name1].gen_flags & TRG_INSTA_ART ? 10 : 3));
5642 else if (object_is_ego(o_ptr))
5644 level += MAX(3, (e_info[o_ptr->name2].rating - 5)/2);
5646 else if (o_ptr->art_name)
5648 s32b total_flags = flag_cost(o_ptr, o_ptr->pval);
5651 if (!object_is_weapon_ammo(o_ptr))
5654 if (total_flags < 15000) fake_level = 10;
5655 else if (total_flags < 35000) fake_level = 25;
5656 else fake_level = 40;
5661 if (total_flags < 20000) fake_level = 10;
5662 else if (total_flags < 45000) fake_level = 25;
5663 else fake_level = 40;
5666 level = MAX(level, (level + MAX(fake_level - 8, 5)) / 2 + 3);
5669 value = object_value_real(q_ptr);
5671 if (value <= 0) continue;
5672 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (p_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
5673 if (value > 5000000L) value = 5000000L;
5674 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
5676 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr) ||
5677 (o_ptr->tval == TV_DRAG_ARMOR) ||
5678 ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) ||
5679 ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) ||
5680 ((o_ptr->tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)) ||
5681 ((o_ptr->tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) ||
5682 ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE)))
5684 if (level > 65) level = 35 + (level - 65) / 5;
5685 else if (level > 35) level = 25 + (level - 35) / 3;
5686 else if (level > 15) level = 15 + (level - 15) / 2;
5687 exp = MIN(100000L, value) * level * level / 2;
5688 if (value > 100000L)
5689 exp += (value - 100000L) * level * level / 8;
5693 exp = MIN(100000L, value) * level;
5694 if (value > 100000L)
5695 exp += (value - 100000L) * level / 4;
5697 if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (buki_motteruka(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
5698 else total_exp += exp / 16;
5699 if (i == INVEN_BODY) total_exp += exp / 32;
5701 p_ptr->exp = p_ptr->max_exp = total_exp;
5703 /* Check Experience */
5711 void lose_exp(s32b amount)
5713 if (p_ptr->prace == RACE_ANDROID) return;
5715 /* Never drop below zero experience */
5716 if (amount > p_ptr->exp) amount = p_ptr->exp;
5718 /* Lose some experience */
5719 p_ptr->exp -= amount;
5721 /* Check Experience */
5728 * If resisted to draining, return FALSE
5730 bool drain_exp(s32b drain, s32b slip, int hold_life_prob)
5732 /* Androids and their mimics are never drained */
5733 if (p_ptr->prace == RACE_ANDROID) return FALSE;
5735 if (p_ptr->hold_life && (randint0(100) < hold_life_prob))
5737 /* Hold experience */
5739 msg_print("¤·¤«¤·¼«¸Ê¤ÎÀ¸Ì¿ÎϤò¼é¤ê¤¤Ã¤¿¡ª");
5741 msg_print("You keep hold of your life force!");
5746 /* Hold experience failed */
5747 if (p_ptr->hold_life)
5750 msg_print("À¸Ì¿ÎϤò¾¯¤·µÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
5752 msg_print("You feel your life slipping away!");
5759 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
5761 msg_print("You feel your life draining away!");
5770 bool set_ultimate_res(int v, bool do_dec)
5772 bool notice = FALSE;
5774 /* Hack -- Force good values */
5775 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5777 if (p_ptr->is_dead) return FALSE;
5782 if (p_ptr->ult_res && !do_dec)
5784 if (p_ptr->ult_res > v) return FALSE;
5786 else if (!p_ptr->ult_res)
5789 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5791 msg_print("You feel resistant!");
5804 msg_print("¤¢¤é¤æ¤ë¤³¤È¤ËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5806 msg_print("You feel less resistant");
5816 /* Redraw status bar */
5817 p_ptr->redraw |= (PR_STATUS);
5819 /* Nothing to notice */
5820 if (!notice) return (FALSE);
5823 if (disturb_state) disturb(0, 0);
5825 /* Recalculate bonuses */
5826 p_ptr->update |= (PU_BONUS);
5835 bool set_tim_res_nether(int v, bool do_dec)
5837 bool notice = FALSE;
5839 /* Hack -- Force good values */
5840 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5842 if (p_ptr->is_dead) return FALSE;
5847 if (p_ptr->tim_res_nether && !do_dec)
5849 if (p_ptr->tim_res_nether > v) return FALSE;
5851 else if (!p_ptr->tim_res_nether)
5854 msg_print("ÃϹö¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5856 msg_print("You feel nether resistant!");
5866 if (p_ptr->tim_res_nether)
5869 msg_print("ÃϹö¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5871 msg_print("You feel less nether resistant");
5879 p_ptr->tim_res_nether = v;
5881 /* Redraw status bar */
5882 p_ptr->redraw |= (PR_STATUS);
5884 /* Nothing to notice */
5885 if (!notice) return (FALSE);
5888 if (disturb_state) disturb(0, 0);
5890 /* Recalculate bonuses */
5891 p_ptr->update |= (PU_BONUS);
5900 bool set_tim_res_time(int v, bool do_dec)
5902 bool notice = FALSE;
5904 /* Hack -- Force good values */
5905 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
5907 if (p_ptr->is_dead) return FALSE;
5912 if (p_ptr->tim_res_time && !do_dec)
5914 if (p_ptr->tim_res_time > v) return FALSE;
5916 else if (!p_ptr->tim_res_time)
5919 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ·¤ÆÂÑÀ¤¬¤Ä¤¤¤¿µ¤¤¬¤¹¤ë¡ª");
5921 msg_print("You feel time resistant!");
5931 if (p_ptr->tim_res_time)
5934 msg_print("»þ´ÖµÕž¤ÎÎϤËÂФ¹¤ëÂÑÀ¤¬Çö¤ì¤¿µ¤¤¬¤¹¤ë¡£");
5936 msg_print("You feel less time resistant");
5944 p_ptr->tim_res_time = v;
5946 /* Redraw status bar */
5947 p_ptr->redraw |= (PR_STATUS);
5949 /* Nothing to notice */
5950 if (!notice) return (FALSE);
5953 if (disturb_state) disturb(0, 0);
5955 /* Recalculate bonuses */
5956 p_ptr->update |= (PU_BONUS);
5967 * Choose a warrior-mage elemental attack. -LM-
5969 bool choose_ele_attack(void)
5975 if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
5978 msg_format("Éð´ï¤ò»ý¤¿¤Ê¤¤¤ÈËâË¡·õ¤Ï»È¤¨¤Ê¤¤¡£");
5980 msg_format("You cannot use temporary branding with no weapon.");
5988 num = (p_ptr->lev - 20) / 5;
5991 c_prt(TERM_RED, " a) ¾Æ´þ", 2, 14);
5993 c_prt(TERM_RED, " a) Fire Brand", 2, 14);
5997 if (num >= 2) c_prt(TERM_L_WHITE," b) Åà·ë", 3, 14);
5999 if (num >= 2) c_prt(TERM_L_WHITE," b) Cold Brand", 3, 14);
6001 else prt("", 3, 14);
6004 if (num >= 3) c_prt(TERM_GREEN, " c) ÆÇ»¦", 4, 14);
6006 if (num >= 3) c_prt(TERM_GREEN, " c) Poison Brand", 4, 14);
6008 else prt("", 4, 14);
6011 if (num >= 4) c_prt(TERM_L_DARK, " d) Íϲò", 5, 14);
6013 if (num >= 4) c_prt(TERM_L_DARK, " d) Acid Brand", 5, 14);
6015 else prt("", 5, 14);
6018 if (num >= 5) c_prt(TERM_BLUE, " e) ÅÅ·â", 6, 14);
6020 if (num >= 5) c_prt(TERM_BLUE, " e) Elec Brand", 6, 14);
6022 else prt("", 6, 14);
6030 prt(" ¤É¤Î¸µÁǹ¶·â¤ò¤·¤Þ¤¹¤«¡©", 1, 14);
6032 prt(" Choose a temporary elemental brand ", 1, 14);
6037 if ((choice == 'a') || (choice == 'A'))
6038 set_ele_attack(ATTACK_FIRE, p_ptr->lev/2 + randint1(p_ptr->lev/2));
6039 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
6040 set_ele_attack(ATTACK_COLD, p_ptr->lev/2 + randint1(p_ptr->lev/2));
6041 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
6042 set_ele_attack(ATTACK_POIS, p_ptr->lev/2 + randint1(p_ptr->lev/2));
6043 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
6044 set_ele_attack(ATTACK_ACID, p_ptr->lev/2 + randint1(p_ptr->lev/2));
6045 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
6046 set_ele_attack(ATTACK_ELEC, p_ptr->lev/2 + randint1(p_ptr->lev/2));
6050 msg_print("ËâË¡·õ¤ò»È¤¦¤Î¤ò¤ä¤á¤¿¡£");
6052 msg_print("You cancel the temporary branding.");
6064 * Choose a elemental immune. -LM-
6066 bool choose_ele_immune(int turn)
6074 c_prt(TERM_RED, " a) ²Ð±ê", 2, 14);
6076 c_prt(TERM_RED, " a) Immune Fire", 2, 14);
6080 c_prt(TERM_L_WHITE," b) Î䵤", 3, 14);
6082 c_prt(TERM_L_WHITE," b) Immune Cold", 3, 14);
6086 c_prt(TERM_L_DARK, " c) »À", 4, 14);
6088 c_prt(TERM_L_DARK, " c) Immune Acid", 4, 14);
6092 c_prt(TERM_BLUE, " d) ÅÅ·â", 5, 14);
6094 c_prt(TERM_BLUE, " d) Immune Elec", 5, 14);
6105 prt(" ¤É¤Î¸µÁǤÎÌȱ֤ò¤Ä¤±¤Þ¤¹¤«¡©", 1, 14);
6107 prt(" Choose a temporary elemental immune ", 1, 14);
6112 if ((choice == 'a') || (choice == 'A'))
6113 set_ele_immune(DEFENSE_FIRE, turn);
6114 else if ((choice == 'b') || (choice == 'B'))
6115 set_ele_immune(DEFENSE_COLD, turn);
6116 else if ((choice == 'c') || (choice == 'C'))
6117 set_ele_immune(DEFENSE_ACID, turn);
6118 else if ((choice == 'd') || (choice == 'D'))
6119 set_ele_immune(DEFENSE_ELEC, turn);
6123 msg_print("Ìȱ֤òÉÕ¤±¤ë¤Î¤ò¤ä¤á¤¿¡£");
6125 msg_print("You cancel the temporary immune.");