3 /* Purpose: Angband game engine */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
15 #define TY_CURSE_CHANCE 100
16 #define CHAINSWORD_NOISE 100
18 static bool load = TRUE;
19 static int wild_regen = 20;
22 * Return a "feeling" (or NULL) about an item. Method 1 (Heavy).
24 static byte value_check_aux1(object_type *o_ptr)
27 if (artifact_p(o_ptr) || o_ptr->art_name)
30 if (cursed_p(o_ptr) || broken_p(o_ptr)) return FEEL_TERRIBLE;
37 if (ego_item_p(o_ptr))
40 if (cursed_p(o_ptr) || broken_p(o_ptr)) return FEEL_WORTHLESS;
43 return FEEL_EXCELLENT;
47 if (cursed_p(o_ptr)) return FEEL_CURSED;
50 if (broken_p(o_ptr)) return FEEL_BROKEN;
52 if ((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) return FEEL_AVERAGE;
54 /* Good "armor" bonus */
55 if (o_ptr->to_a > 0) return FEEL_GOOD;
57 /* Good "weapon" bonus */
58 if (o_ptr->to_h + o_ptr->to_d > 0) return FEEL_GOOD;
60 /* Default to "average" */
66 * Return a "feeling" (or NULL) about an item. Method 2 (Light).
68 static byte value_check_aux2(object_type *o_ptr)
70 /* Cursed items (all of them) */
71 if (cursed_p(o_ptr)) return FEEL_CURSED;
73 /* Broken items (all of them) */
74 if (broken_p(o_ptr)) return FEEL_BROKEN;
76 /* Artifacts -- except cursed/broken ones */
77 if (artifact_p(o_ptr) || o_ptr->art_name) return FEEL_GOOD;
79 /* Ego-Items -- except cursed/broken ones */
80 if (ego_item_p(o_ptr)) return FEEL_GOOD;
82 /* Good armor bonus */
83 if (o_ptr->to_a > 0) return FEEL_GOOD;
85 /* Good weapon bonuses */
86 if (o_ptr->to_h + o_ptr->to_d > 0) return FEEL_GOOD;
94 static void sense_inventory_aux(int slot, bool heavy)
97 object_type *o_ptr = &inventory[slot];
98 char o_name[MAX_NLEN];
100 /* We know about it already, do not tell us again */
101 if (o_ptr->ident & (IDENT_SENSE))return;
103 /* It is fully known, no information needed */
104 if (object_known_p(o_ptr)) return;
106 /* Check for a feeling */
107 feel = (heavy ? value_check_aux1(o_ptr) : value_check_aux2(o_ptr));
109 /* Skip non-feelings */
113 if ((p_ptr->muta3 & MUT3_BAD_LUCK) && !rand_int(13))
124 feel = FEEL_EXCELLENT;
129 feel = rand_int(3) ? FEEL_GOOD : FEEL_AVERAGE;
134 feel = rand_int(2) ? FEEL_CURSED : FEEL_GOOD;
139 feel = rand_int(3) ? FEEL_CURSED : FEEL_AVERAGE;
144 feel = FEEL_WORTHLESS;
149 feel = FEEL_TERRIBLE;
155 /* Stop everything */
156 if (disturb_minor) disturb(0, 0);
158 /* Get an object description */
159 object_desc(o_name, o_ptr, FALSE, 0);
161 /* Message (equipment) */
162 if (slot >= INVEN_RARM)
165 msg_format("%s%s(%c)¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
166 describe_use(slot),o_name, index_to_label(slot),game_inscriptions[feel]);
168 msg_format("You feel the %s (%c) you are %s %s %s...",
169 o_name, index_to_label(slot), describe_use(slot),
170 ((o_ptr->number == 1) ? "is" : "are"),
171 game_inscriptions[feel]);
176 /* Message (inventory) */
180 msg_format("¥¶¥Ã¥¯¤ÎÃæ¤Î%s(%c)¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
181 o_name, index_to_label(slot),game_inscriptions[feel]);
183 msg_format("You feel the %s (%c) in your pack %s %s...",
184 o_name, index_to_label(slot),
185 ((o_ptr->number == 1) ? "is" : "are"),
186 game_inscriptions[feel]);
191 /* We have "felt" it */
192 o_ptr->ident |= (IDENT_SENSE);
194 /* Set the "inscription" */
195 o_ptr->feeling = feel;
197 /* Combine / Reorder the pack (later) */
198 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
201 p_ptr->window |= (PW_INVEN | PW_EQUIP);
207 * Sense the inventory
209 * Class 0 = Warrior --> fast and heavy
210 * Class 1 = Mage --> slow and light
211 * Class 2 = Priest --> fast but light
212 * Class 3 = Rogue --> okay and heavy
213 * Class 4 = Ranger --> slow but heavy (changed!)
214 * Class 5 = Paladin --> slow but heavy
216 static void sense_inventory1(void)
219 int plev = p_ptr->lev;
225 #endif /* USE_SCRIPT */
228 /*** Check for "sensing" ***/
230 /* No sensing when confused */
231 if (p_ptr->confused) return;
235 result = sense_inventory_callback();
242 #endif /* USE_SCRIPT */
245 /* Analyze the class */
246 switch (p_ptr->pclass)
254 if (0 != rand_int(9000L / (plev * plev + 40))) return;
266 if (0 != rand_int(6000L / (plev * plev + 50))) return;
276 case CLASS_HIGH_MAGE:
278 case CLASS_MAGIC_EATER:
280 /* Very bad (light) sensing */
281 if (0 != rand_int(240000L / (plev + 5))) return;
290 /* Good (light) sensing */
291 if (0 != rand_int(10000L / (plev * plev + 40))) return;
301 if (0 != rand_int(20000L / (plev * plev + 40))) return;
313 if (0 != rand_int(95000L / (plev * plev + 40))) return;
325 if (0 != rand_int(77777L / (plev * plev + 40))) return;
334 case CLASS_WARRIOR_MAGE:
338 if (0 != rand_int(75000L / (plev * plev + 40))) return;
344 case CLASS_MINDCRAFTER:
345 case CLASS_MIRROR_MASTER:
348 if (0 != rand_int(55000L / (plev * plev + 40))) return;
354 case CLASS_CHAOS_WARRIOR:
357 if (0 != rand_int(80000L / (plev * plev + 40))) return;
367 case CLASS_FORCETRAINER:
370 if (0 != rand_int(20000L / (plev * plev + 40))) return;
379 if (0 != rand_int(20000L / ((plev+50)*(plev+50)))) return;
389 case CLASS_BLUE_MAGE:
392 if (0 != rand_int(55000L / (plev * plev + 40))) return;
398 case CLASS_BEASTMASTER:
401 if (0 != rand_int(65000L / (plev * plev + 40))) return;
406 case CLASS_BERSERKER:
417 if (compare_virtue(V_KNOWLEDGE, 100, VIRTUE_LARGE)) heavy = TRUE;
419 /*** Sense everything ***/
421 /* Check everything */
422 for (i = 0; i < INVEN_TOTAL; i++)
426 o_ptr = &inventory[i];
428 /* Skip empty slots */
429 if (!o_ptr->k_idx) continue;
431 /* Valid "tval" codes */
457 /* Skip non-sense machines */
460 /* Occasional failure on inventory items */
461 if ((i < INVEN_RARM) && (0 != rand_int(5))) continue;
464 if ((p_ptr->muta3 & MUT3_GOOD_LUCK) && !rand_int(13))
469 sense_inventory_aux(i, heavy);
474 static void sense_inventory2(void)
477 int plev = p_ptr->lev;
482 #endif /* USE_SCRIPT */
485 /*** Check for "sensing" ***/
487 /* No sensing when confused */
488 if (p_ptr->confused) return;
492 result = sense_inventory_callback();
496 #endif /* USE_SCRIPT */
499 /* Analyze the class */
500 switch (p_ptr->pclass)
506 case CLASS_BERSERKER:
513 case CLASS_CHAOS_WARRIOR:
515 case CLASS_BEASTMASTER:
518 /* Very bad (light) sensing */
519 if (0 != rand_int(240000L / (plev + 5))) return;
526 case CLASS_WARRIOR_MAGE:
531 if (0 != rand_int(95000L / (plev * plev + 40))) return;
540 case CLASS_FORCETRAINER:
541 case CLASS_MINDCRAFTER:
544 if (0 != rand_int(20000L / (plev * plev + 40))) return;
551 case CLASS_HIGH_MAGE:
553 case CLASS_MAGIC_EATER:
554 case CLASS_MIRROR_MASTER:
555 case CLASS_BLUE_MAGE:
558 if (0 != rand_int(9000L / (plev * plev + 40))) return;
567 if (0 != rand_int(20000L / ((plev+50)*(plev+50)))) return;
575 /*** Sense everything ***/
577 /* Check everything */
578 for (i = 0; i < INVEN_TOTAL; i++)
582 o_ptr = &inventory[i];
584 /* Skip empty slots */
585 if (!o_ptr->k_idx) continue;
587 /* Valid "tval" codes */
600 /* Skip non-sense machines */
603 /* Occasional failure on inventory items */
604 if ((i < INVEN_RARM) && (0 != rand_int(5))) continue;
606 sense_inventory_aux(i, TRUE);
613 * Go to any level (ripped off from wiz_jump)
615 static void pattern_teleport(void)
622 if (get_check("¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©"))
624 if (get_check("Teleport level? "))
631 /* Only downward in ironman mode */
632 if (ironman_downward)
633 min_level = dun_level;
636 if (dungeon_type == DUNGEON_ANGBAND)
639 max_level = MAX_DEPTH - 1;
640 else if (dun_level == 100)
643 else max_level = d_info[dungeon_type].maxdepth;
647 sprintf(ppp, "¥Æ¥ì¥Ý¡¼¥ÈÀè:(%d-%d)", min_level, max_level);
649 sprintf(ppp, "Teleport to level (%d-%d): ", min_level, max_level);
654 sprintf(tmp_val, "%d", dun_level);
656 /* Ask for a level */
657 if (!get_string(ppp, tmp_val, 10)) return;
659 /* Extract request */
660 command_arg = atoi(tmp_val);
663 else if (get_check("Ä̾ï¥Æ¥ì¥Ý¡¼¥È¡©"))
665 else if (get_check("Normal teleport? "))
669 teleport_player(200);
678 if (command_arg < min_level) command_arg = min_level;
681 if (command_arg > max_level) command_arg = max_level;
685 msg_format("%d ³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤·¤¿¡£", command_arg);
687 msg_format("You teleport to dungeon level %d.", command_arg);
691 if (autosave_l) do_cmd_save_game(TRUE);
694 dun_level = command_arg;
697 p_ptr->leaving = TRUE;
701 static void wreck_the_pattern(void)
703 int to_ruin = 0, r_y, r_x;
705 if (cave[py][px].feat == FEAT_PATTERN_XTRA2)
712 msg_print("¥Ñ¥¿¡¼¥ó¤ò·ì¤Ç±ø¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
713 msg_print("²¿¤«¶²¤í¤·¤¤»ö¤¬µ¯¤³¤Ã¤¿¡ª");
715 msg_print("You bleed on the Pattern!");
716 msg_print("Something terrible happens!");
722 take_hit(DAMAGE_NOESCAPE, damroll(10, 8), "¥Ñ¥¿¡¼¥ó»²õ", -1);
724 take_hit(DAMAGE_NOESCAPE, damroll(10, 8), "corrupting the Pattern", -1);
728 to_ruin = randint(45) + 35;
732 scatter(&r_y, &r_x, py, px, 4, 0);
734 if ((cave[r_y][r_x].feat >= FEAT_PATTERN_START) &&
735 (cave[r_y][r_x].feat < FEAT_PATTERN_XTRA2))
737 cave_set_feat(r_y, r_x, FEAT_PATTERN_XTRA2);
741 cave_set_feat(py, px, FEAT_PATTERN_XTRA2);
745 /* Returns TRUE if we are on the Pattern... */
746 static bool pattern_effect(void)
748 if ((cave[py][px].feat < FEAT_PATTERN_START) ||
749 (cave[py][px].feat > FEAT_PATTERN_XTRA2))
752 if ((prace_is_(RACE_AMBERITE)) &&
753 (p_ptr->cut > 0) && (randint(10) == 1))
758 if (cave[py][px].feat == FEAT_PATTERN_END)
760 (void)set_poisoned(0);
766 (void)do_res_stat(A_STR);
767 (void)do_res_stat(A_INT);
768 (void)do_res_stat(A_WIS);
769 (void)do_res_stat(A_DEX);
770 (void)do_res_stat(A_CON);
771 (void)do_res_stat(A_CHR);
772 (void)restore_level();
773 (void)hp_player(1000);
774 cave_set_feat(py, px, FEAT_PATTERN_OLD);
776 msg_print("¡Ö¥Ñ¥¿¡¼¥ó¡×¤Î¤³¤ÎÉôʬ¤Ï¾¤ÎÉôʬ¤è¤ê¶¯ÎϤǤʤ¤¤è¤¦¤À¡£");
778 msg_print("This section of the Pattern looks less powerful.");
785 * We could make the healing effect of the
786 * Pattern center one-time only to avoid various kinds
787 * of abuse, like luring the win monster into fighting you
788 * in the middle of the pattern...
791 else if (cave[py][px].feat == FEAT_PATTERN_OLD)
795 else if (cave[py][px].feat == FEAT_PATTERN_XTRA1)
799 else if (cave[py][px].feat == FEAT_PATTERN_XTRA2)
803 take_hit(DAMAGE_NOESCAPE, 200, "²õ¤ì¤¿¡Ö¥Ñ¥¿¡¼¥ó¡×¤òÊ⤤¤¿¥À¥á¡¼¥¸", -1);
805 take_hit(DAMAGE_NOESCAPE, 200, "walking the corrupted Pattern", -1);
811 if ((prace_is_(RACE_AMBERITE)) && (randint(2) != 1))
813 else if (!p_ptr->invuln)
815 take_hit(DAMAGE_NOESCAPE, damroll(1,3), "¡Ö¥Ñ¥¿¡¼¥ó¡×¤òÊ⤤¤¿¥À¥á¡¼¥¸", -1);
817 take_hit(DAMAGE_NOESCAPE, damroll(1, 3), "walking the Pattern", -1);
830 * Regenerate hit points -RAK-
832 static void regenhp(int percent)
834 s32b new_chp, new_chp_frac;
837 if (p_ptr->special_defense & KATA_KOUKIJIN) return;
838 if (p_ptr->action == ACTION_HAYAGAKE) return;
839 /* Save the old hitpoints */
840 old_chp = p_ptr->chp;
842 /* Extract the new hitpoints */
843 new_chp = ((long)p_ptr->mhp) * percent + PY_REGEN_HPBASE;
844 p_ptr->chp += (s16b)(new_chp >> 16); /* div 65536 */
846 /* check for overflow */
847 if ((p_ptr->chp < 0) && (old_chp > 0)) p_ptr->chp = MAX_SHORT;
848 new_chp_frac = (new_chp & 0xFFFF) + p_ptr->chp_frac; /* mod 65536 */
849 if (new_chp_frac >= 0x10000L)
851 p_ptr->chp_frac = (u16b)(new_chp_frac - 0x10000L);
856 p_ptr->chp_frac = (u16b)new_chp_frac;
860 if (p_ptr->chp >= p_ptr->mhp)
862 p_ptr->chp = p_ptr->mhp;
867 if (old_chp != p_ptr->chp)
870 p_ptr->redraw |= (PR_HP);
873 p_ptr->window |= (PW_PLAYER);
881 * Regenerate mana points -RAK-
883 static void regenmana(int percent)
885 s32b new_mana, new_mana_frac;
887 bool old_csp_msp = (p_ptr->csp > p_ptr->msp);
889 if (p_ptr->special_defense & KATA_KOUKIJIN) return;
890 if ((p_ptr->pclass == CLASS_SAMURAI) && (p_ptr->regenerate)) percent /= 2;
891 old_csp = p_ptr->csp;
892 new_mana = ((long)p_ptr->msp) * percent + PY_REGEN_MNBASE;
893 if (old_csp_msp && (new_mana > 0))
897 p_ptr->csp -= (s16b)(new_mana >> 16); /* div 65536 */
898 new_mana_frac = p_ptr->csp_frac + 0x10000L - (new_mana & 0xFFFF);
902 if (old_csp_msp) new_mana += ((((long)p_ptr->msp) * percent + PY_REGEN_MNBASE) * 32);
903 p_ptr->csp += (s16b)(new_mana >> 16); /* div 65536 */
905 new_mana_frac = (new_mana & 0xFFFF) + p_ptr->csp_frac; /* mod 65536 */
907 if (new_mana_frac >= 0x10000L)
909 p_ptr->csp_frac = (u16b)(new_mana_frac - 0x10000L);
914 p_ptr->csp_frac = (u16b)(new_mana_frac);
917 /* check for overflow */
924 /* Must set frac to zero even if equal */
925 if ((old_csp_msp && p_ptr->csp < p_ptr->msp) || (!old_csp_msp && p_ptr->csp >= p_ptr->msp))
927 p_ptr->csp = p_ptr->msp;
932 if (old_csp != p_ptr->csp)
935 p_ptr->redraw |= (PR_MANA);
938 p_ptr->window |= (PW_PLAYER);
939 p_ptr->window |= (PW_SPELL);
950 static void regenmagic(int percent)
955 for (i = 0; i < 72; i++)
957 if (!p_ptr->magic_num2[i]) continue;
958 if (p_ptr->magic_num1[i] == ((long)p_ptr->magic_num2[i] << 16)) continue;
959 new_mana = ((long)p_ptr->magic_num2[i]+adj_mag_mana[A_INT]+13) * percent / 8;
960 p_ptr->magic_num1[i] += new_mana;
962 /* Must set frac to zero even if equal */
963 if (p_ptr->magic_num1[i] > (p_ptr->magic_num2[i] << 16))
965 p_ptr->magic_num1[i] = ((long)p_ptr->magic_num2[i] << 16);
969 for (i = 72; i < 108; i++)
971 if (!p_ptr->magic_num1[i]) continue;
972 if (!p_ptr->magic_num2[i]) continue;
973 p_ptr->magic_num1[i] -= (long)(p_ptr->magic_num2[i] * (adj_mag_mana[A_INT] + 10)) * 0x1000;
974 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
985 * Regenerate the monsters (once per 100 game turns)
987 * XXX XXX XXX Should probably be done during monster turns.
989 static void regen_monsters(void)
994 /* Regenerate everyone */
995 for (i = 1; i < m_max; i++)
997 /* Check the i'th monster */
998 monster_type *m_ptr = &m_list[i];
999 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1002 /* Skip dead monsters */
1003 if (!m_ptr->r_idx) continue;
1005 /* Allow regeneration (if needed) */
1006 if (m_ptr->hp < m_ptr->maxhp)
1008 /* Hack -- Base regeneration */
1009 frac = m_ptr->maxhp / 100;
1011 /* Hack -- Minimal regeneration rate */
1012 if (!frac) if (randint(2) == 1) frac = 1;
1014 /* Hack -- Some monsters regenerate quickly */
1015 if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2;
1017 /* Hack -- Regenerate */
1020 /* Do not over-regenerate */
1021 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
1023 /* Redraw (later) if needed */
1024 if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH);
1025 if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH);
1032 * Regenerate the monsters (once per 100 game turns)
1034 * XXX XXX XXX Should probably be done during monster turns.
1036 static void regen_captured_monsters(void)
1041 /* Regenerate everyone */
1042 for (i = 0; i < INVEN_TOTAL; i++)
1044 monster_race *r_ptr;
1045 object_type *o_ptr = &inventory[i];
1047 if (!o_ptr->k_idx) continue;
1048 if (o_ptr->tval != TV_CAPTURE) continue;
1049 if (!o_ptr->pval) continue;
1053 r_ptr = &r_info[o_ptr->pval];
1055 /* Allow regeneration (if needed) */
1056 if (o_ptr->xtra4 < o_ptr->xtra5)
1058 /* Hack -- Base regeneration */
1059 frac = o_ptr->xtra5 / 100;
1061 /* Hack -- Minimal regeneration rate */
1062 if (!frac) if (randint(2) == 1) frac = 1;
1064 /* Hack -- Some monsters regenerate quickly */
1065 if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2;
1067 /* Hack -- Regenerate */
1068 o_ptr->xtra4 += frac;
1070 /* Do not over-regenerate */
1071 if (o_ptr->xtra4 > o_ptr->xtra5) o_ptr->xtra4 = o_ptr->xtra5;
1078 p_ptr->notice |= (PN_COMBINE);
1081 p_ptr->window |= (PW_INVEN);
1082 p_ptr->window |= (PW_EQUIP);
1088 static void notice_lite_change(object_type *o_ptr)
1090 /* Hack -- notice interesting fuel steps */
1091 if ((o_ptr->xtra4 < 100) || (!(o_ptr->xtra4 % 100)))
1094 p_ptr->window |= (PW_EQUIP);
1097 /* Hack -- Special treatment when blind */
1100 /* Hack -- save some light for later */
1101 if (o_ptr->xtra4 == 0) o_ptr->xtra4++;
1104 /* The light is now out */
1105 else if (o_ptr->xtra4 == 0)
1109 msg_print("ÌÀ¤«¤ê¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1111 msg_print("Your light has gone out!");
1113 p_ptr->update |= (PU_BONUS);
1116 /* The light is getting dim */
1117 else if (o_ptr->name2 == EGO_LITE_LONG)
1119 if ((o_ptr->xtra4 < 50) && (!(o_ptr->xtra4 % 5)) && (turn % 40))
1121 if (disturb_minor) disturb(0, 0);
1123 msg_print("ÌÀ¤«¤ê¤¬Èù¤«¤Ë¤Ê¤Ã¤Æ¤¤Æ¤¤¤ë¡£");
1125 msg_print("Your light is growing faint.");
1131 /* The light is getting dim */
1132 else if ((o_ptr->xtra4 < 100) && (!(o_ptr->xtra4 % 10)))
1134 if (disturb_minor) disturb(0, 0);
1136 msg_print("ÌÀ¤«¤ê¤¬Èù¤«¤Ë¤Ê¤Ã¤Æ¤¤Æ¤¤¤ë¡£");
1138 msg_print("Your light is growing faint.");
1146 * Forcibly pseudo-identify an object in the inventory
1149 * note: currently this function allows pseudo-id of any object,
1150 * including silly ones like potions & scrolls, which always
1151 * get '{average}'. This should be changed, either to stop such
1152 * items from being pseudo-id'd, or to allow psychometry to
1153 * detect whether the unidentified potion/scroll/etc is
1154 * good (Cure Light Wounds, Restore Strength, etc) or
1155 * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
1157 bool psychometry(void)
1161 char o_name[MAX_NLEN];
1166 item_tester_no_ryoute = TRUE;
1169 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«¡©";
1170 s = "Ä´¤Ù¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
1172 q = "Meditate on which item? ";
1173 s = "You have nothing appropriate.";
1176 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
1178 /* Get the item (in the pack) */
1181 o_ptr = &inventory[item];
1184 /* Get the item (on the floor) */
1187 o_ptr = &o_list[0 - item];
1190 /* It is fully known, no information needed */
1191 if (object_known_p(o_ptr))
1194 msg_print("²¿¤â¿·¤·¤¤¤³¤È¤ÏȽ¤é¤Ê¤«¤Ã¤¿¡£");
1196 msg_print("You cannot find out anything more about that.");
1202 /* Check for a feeling */
1203 feel = value_check_aux1(o_ptr);
1205 /* Get an object description */
1206 object_desc(o_name, o_ptr, FALSE, 0);
1208 /* Skip non-feelings */
1212 msg_format("%s¤«¤é¤ÏÆäËÊѤï¤Ã¤¿»ö¤Ï´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿¡£", o_name);
1214 msg_format("You do not perceive anything unusual about the %s.", o_name);
1221 msg_format("%s¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
1222 o_name, game_inscriptions[feel]);
1224 msg_format("You feel that the %s %s %s...",
1225 o_name, ((o_ptr->number == 1) ? "is" : "are"),
1226 game_inscriptions[feel]);
1230 /* We have "felt" it */
1231 o_ptr->ident |= (IDENT_SENSE);
1234 o_ptr->feeling = feel;
1236 /* Combine / Reorder the pack (later) */
1237 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1240 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1242 /* Something happened */
1247 static void gere_music(s32b music)
1255 stun_monsters(damroll(p_ptr->lev/10,2));
1258 hp_player(damroll(2,6));
1261 project_hack(GF_TURN_ALL, p_ptr->lev);
1264 project_hack(GF_PSI, randint(p_ptr->lev * 3 / 2));
1267 project(0, 1, py, px, 0, GF_IDENTIFY, PROJECT_ITEM, -1);
1270 confuse_monsters(p_ptr->lev * 2);
1273 project_hack(GF_SOUND, damroll(10 + p_ptr->lev/5,7));
1276 charm_monsters(damroll(10 + p_ptr->lev/15,6));
1279 project(0, 0, py, px,
1280 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
1283 dispel_monsters(randint(p_ptr->lev * 3));
1284 dispel_evil(randint(p_ptr->lev * 3));
1291 earthquake(py, px, 10);
1294 stasis_monsters(p_ptr->lev * 4);
1297 dispel_monsters(randint(p_ptr->lev * 3));
1300 hp_player(damroll(15,10));
1304 case MUSIC_DETECT+19:
1305 wiz_lite(FALSE, FALSE);
1306 case MUSIC_DETECT+11:
1307 case MUSIC_DETECT+12:
1308 case MUSIC_DETECT+13:
1309 case MUSIC_DETECT+14:
1310 case MUSIC_DETECT+15:
1311 case MUSIC_DETECT+16:
1312 case MUSIC_DETECT+17:
1313 case MUSIC_DETECT+18:
1314 map_area(DETECT_RAD_MAP);
1315 if ((p_ptr->lev > 39) && (music < MUSIC_DETECT+19)) p_ptr->magic_num1[0] = music+1;
1316 case MUSIC_DETECT+6:
1317 case MUSIC_DETECT+7:
1318 case MUSIC_DETECT+8:
1319 case MUSIC_DETECT+9:
1320 case MUSIC_DETECT+10:
1321 detect_treasure(DETECT_RAD_DEFAULT);
1322 detect_objects_gold(DETECT_RAD_DEFAULT);
1323 detect_objects_normal(DETECT_RAD_DEFAULT);
1324 if ((p_ptr->lev > 24) && (music < MUSIC_DETECT+11)) p_ptr->magic_num1[0] = music+1;
1325 case MUSIC_DETECT+3:
1326 case MUSIC_DETECT+4:
1327 case MUSIC_DETECT+5:
1328 detect_monsters_invis(DETECT_RAD_DEFAULT);
1329 detect_monsters_normal(DETECT_RAD_DEFAULT);
1330 if ((p_ptr->lev > 19) && (music < MUSIC_DETECT+6)) p_ptr->magic_num1[0] = music+1;
1332 case MUSIC_DETECT+1:
1333 case MUSIC_DETECT+2:
1334 detect_traps(DETECT_RAD_DEFAULT);
1335 detect_doors(DETECT_RAD_DEFAULT);
1336 detect_stairs(DETECT_RAD_DEFAULT);
1337 if ((p_ptr->lev > 14) && (music < MUSIC_DETECT+3)) p_ptr->magic_num1[0] = music+1;
1343 * If player has inscribed the object with "!!", let him know when it's
1346 static void recharged_notice(object_type *o_ptr)
1348 char o_name[MAX_NLEN];
1352 /* No inscription */
1353 if (!o_ptr->inscription) return;
1356 s = strchr(quark_str(o_ptr->inscription), '!');
1358 /* Process notification request. */
1361 /* Find another '!' */
1364 /* Describe (briefly) */
1365 object_desc(o_name, o_ptr, FALSE, 0);
1367 /* Notify the player */
1368 if (o_ptr->number > 1)
1370 msg_format("%s¤ÏºÆ½¼Å¶¤µ¤ì¤¿¡£", o_name);
1371 else msg_format("%s¤ÏºÆ½¼Å¶¤µ¤ì¤¿¡£", o_name);
1373 msg_format("Your %s are recharged.", o_name);
1374 else msg_format("Your %s is recharged.", o_name);
1382 /* Keep looking for '!'s */
1383 s = strchr(s + 1, '!');
1388 static void check_music()
1393 /* Music singed by player */
1394 if(p_ptr->pclass != CLASS_BARD) return;
1395 if(!p_ptr->magic_num1[0] && !p_ptr->magic_num1[1]) return;
1397 s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC - 1][p_ptr->magic_num2[0]];
1399 shouhimana = (s_ptr->smana*(3800-spell_exp[p_ptr->magic_num2[0]])+2399);
1402 else shouhimana *= 4;
1404 if(shouhimana < 1) shouhimana = 1;
1405 shouhimana *= 0x8000;
1406 if ((p_ptr->csp < shouhimana / 0x10000) || (p_ptr->anti_magic))
1413 p_ptr->csp -= shouhimana / 0x10000;
1414 shouhimana = (shouhimana & 0xffff);
1415 if (p_ptr->csp_frac < shouhimana)
1418 p_ptr->csp_frac += (u16b)(0x10000L - shouhimana);
1422 p_ptr->csp_frac -= (u16b)shouhimana;
1425 p_ptr->redraw |= PR_MANA;
1426 if (p_ptr->magic_num1[1])
1428 p_ptr->magic_num1[0] = p_ptr->magic_num1[1];
1429 p_ptr->magic_num1[1] = 0;
1431 msg_print("²Î¤òºÆ³«¤·¤¿¡£");
1433 msg_print("You restart singing.");
1435 p_ptr->action = ACTION_SING;
1437 /* Recalculate bonuses */
1438 p_ptr->update |= (PU_BONUS | PU_HP);
1440 /* Redraw status bar */
1441 p_ptr->redraw |= (PR_STATUS);
1444 if (spell_exp[p_ptr->magic_num2[0]] < 900)
1445 spell_exp[p_ptr->magic_num2[0]]+=5;
1446 else if(spell_exp[p_ptr->magic_num2[0]] < 1200)
1447 {if (one_in_(2) && (dun_level > 4) && ((dun_level + 10) > p_ptr->lev)) spell_exp[p_ptr->magic_num2[0]]+=1;}
1448 else if(spell_exp[p_ptr->magic_num2[0]] < 1400)
1449 {if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel)) spell_exp[p_ptr->magic_num2[0]]+=1;}
1450 else if(spell_exp[p_ptr->magic_num2[0]] < 1600)
1451 {if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel)) spell_exp[p_ptr->magic_num2[0]]+=1;}
1453 gere_music(p_ptr->magic_num1[0]);
1457 * Handle certain things once every 10 game turns
1459 static void process_world(void)
1463 bool cave_no_regen = FALSE;
1464 int upkeep_factor = 0;
1467 u32b f1 = 0 , f2 = 0 , f3 = 0;
1470 const int dec_count = (easy_band ? 2 : 1);
1472 int hour, min, prev_min;
1473 s32b len = 20L * TOWN_DAWN;
1474 s32b tick = turn % len + len / 4;
1476 hour = (24 * tick / len) % 24;
1477 min = (1440 * tick / len) % 60;
1478 prev_min = (1440 * (tick - 20) / len) % 60;
1480 if ((turn - old_turn == (3000 - dun_level*20)) && (dun_level) &&
1481 !(quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT || !(quest[quest_number(dun_level)].flags & QUEST_FLAG_PRESET)))) &&
1482 !(p_ptr->inside_battle))
1485 if (p_ptr->inside_battle && !p_ptr->leaving)
1492 /* Count all hostile monsters */
1493 for (i2 = 0; i2 < cur_wid; ++i2)
1494 for (j2 = 0; j2 < cur_hgt; j2++)
1495 if ((cave[j2][i2].m_idx > 0) && (cave[j2][i2].m_idx != p_ptr->riding))
1498 win_m_idx = cave[j2][i2].m_idx;
1501 if (number_mon == 0)
1504 msg_print("ÁêÂǤÁ¤Ë½ª¤ï¤ê¤Þ¤·¤¿¡£");
1506 msg_print("They have kill each other at the same time.");
1509 p_ptr->energy = 100;
1512 else if ((number_mon-1) == 0)
1515 monster_type *wm_ptr;
1517 wm_ptr = &m_list[win_m_idx];
1519 monster_desc(m_name, wm_ptr, 0);
1521 msg_format("%s¤¬¾¡Íø¤·¤¿¡ª", m_name);
1523 msg_format("%s is winner!", m_name);
1527 if (win_m_idx == (sel_monster+1))
1530 msg_print("¤ª¤á¤Ç¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£");
1532 msg_print("Congratulations.");
1535 msg_format("%d¡ð¤ò¼õ¤±¼è¤Ã¤¿¡£", battle_odds);
1537 msg_format("You recieved %d gold.", battle_odds);
1539 p_ptr->au += battle_odds;
1544 msg_print("»ÄÇ°¤Ç¤·¤¿¡£");
1546 msg_print("You lost gold.");
1550 p_ptr->energy = 100;
1553 else if(turn - old_turn == 3000L)
1556 msg_print("¿½¤·Ê¬¤±¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤³¤Î¾¡Éé¤Ï°ú¤Ê¬¤±¤È¤µ¤»¤Æ¤¤¤¿¤À¤¤Þ¤¹¡£");
1558 msg_format("This battle have ended in a draw.");
1560 p_ptr->au += kakekin;
1562 p_ptr->energy = 100;
1567 /* Every 20 game turns */
1568 if (turn % 20) return;
1570 /*** Check the Time and Load ***/
1574 /* Check time and load */
1575 if ((0 != check_time()) || (0 != check_load()))
1578 if (closing_flag <= 2)
1583 /* Count warnings */
1588 msg_print("¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¸¤«¤«¤Ã¤Æ¤¤¤Þ¤¹...");
1589 msg_print("¥²¡¼¥à¤ò½ªÎ»¤¹¤ë¤«¥»¡¼¥Ö¤¹¤ë¤«¤·¤Æ²¼¤µ¤¤¡£");
1591 msg_print("The gates to ANGBAND are closing...");
1592 msg_print("Please finish up and/or save your game.");
1602 msg_print("º£¡¢¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¶¤µ¤ì¤Þ¤·¤¿¡£");
1604 msg_print("The gates to ANGBAND are now closed.");
1612 p_ptr->leaving = TRUE;
1617 /*** Attempt timed autosave ***/
1618 if (autosave_t && autosave_freq && !p_ptr->inside_battle)
1620 if (!(turn % ((s32b)autosave_freq * 20)))
1621 do_cmd_save_game(TRUE);
1627 msg_print("²¿¤«¤¬Ê¹¤³¤¨¤¿¡£");
1629 msg_print("You hear noise.");
1633 /*** Handle the wilderness/town (sunshine) ***/
1635 /* While in town/wilderness */
1636 if (!dun_level && !p_ptr->inside_quest && !p_ptr->inside_battle && !p_ptr->inside_arena && !p_ptr->wild_mode)
1638 /* Hack -- Daybreak/Nighfall in town */
1639 if (!(turn % ((20L * TOWN_DAWN) / 2)))
1643 /* Check for dawn */
1644 dawn = (!(turn % (20L * TOWN_DAWN)));
1651 msg_print("Ì뤬ÌÀ¤±¤¿¡£");
1653 msg_print("The sun has risen.");
1657 /* Hack -- Scan the town */
1658 for (y = 0; y < cur_hgt; y++)
1660 for (x = 0; x < cur_wid; x++)
1662 /* Get the cave grid */
1663 c_ptr = &cave[y][x];
1666 c_ptr->info |= (CAVE_GLOW);
1668 /* Hack -- Memorize lit grids if allowed */
1669 if (view_perma_grids) c_ptr->info |= (CAVE_MARK);
1671 /* Hack -- Notice spot */
1682 msg_print("Æü¤¬ÄÀ¤ó¤À¡£");
1684 msg_print("The sun has fallen.");
1688 /* Hack -- Scan the town */
1689 for (y = 0; y < cur_hgt; y++)
1691 for (x = 0; x < cur_wid; x++)
1693 /* Get the cave grid */
1694 c_ptr = &cave[y][x];
1696 /* Darken "boring" features */
1697 if ((c_ptr->feat <= FEAT_INVIS) ||
1698 ((c_ptr->feat >= FEAT_DEEP_WATER) &&
1699 (c_ptr->feat <= FEAT_TREES) &&
1700 (c_ptr->feat != FEAT_MUSEUM)))
1702 /* Forget the grid */
1703 c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK);
1705 /* Hack -- Notice spot */
1712 /* Update the monsters */
1713 p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
1716 p_ptr->redraw |= (PR_MAP);
1719 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1723 /* Set back the rewards once a day */
1724 if (!(turn % (200L * STORE_TURNS)))
1728 /* Reset the rewards */
1729 for (n = 0; n < MAX_BACT; n++)
1731 p_ptr->rewards[n] = FALSE;
1736 if (cheat_xtra) msg_print("Êó½·¤ò¥ê¥»¥Ã¥È");
1738 if (cheat_xtra) msg_print("Rewards reset.");
1744 /*** Process the monsters ***/
1746 /* Check for creature generation. */
1747 if ((rand_int(d_info[dungeon_type].max_m_alloc_chance) == 0) &&
1748 !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->inside_battle)
1750 /* Make a new monster */
1751 (void)alloc_monster(MAX_SIGHT + 5, FALSE);
1754 /* Hack -- Check for creature regeneration */
1755 if (!(turn % 200) && !p_ptr->inside_battle) regen_monsters();
1756 if (!(turn % 60)) regen_captured_monsters();
1759 /*** Damage over Time ***/
1761 /* Take damage from poison */
1762 if (p_ptr->poisoned && !p_ptr->invuln)
1766 take_hit(DAMAGE_NOESCAPE, 1, "ÆÇ", -1);
1768 take_hit(DAMAGE_NOESCAPE, 1, "poison", -1);
1774 /* (Vampires) Take damage from sunlight */
1775 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
1777 if (!dun_level && !p_ptr->resist_lite && !p_ptr->invuln &&
1778 (!((turn / ((20L * TOWN_DAWN) / 2)) % 2)))
1780 if (cave[py][px].info & CAVE_GLOW)
1784 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª");
1785 take_hit(DAMAGE_NOESCAPE, 1, "Æü¸÷", -1);
1787 msg_print("The sun's rays scorch your undead flesh!");
1788 take_hit(DAMAGE_NOESCAPE, 1, "sunlight", -1);
1791 cave_no_regen = TRUE;
1795 if (inventory[INVEN_LITE].tval && (inventory[INVEN_LITE].name2 != EGO_LITE_DARKNESS) &&
1796 !p_ptr->resist_lite)
1798 object_type * o_ptr = &inventory[INVEN_LITE];
1799 char o_name [MAX_NLEN];
1800 char ouch [MAX_NLEN+40];
1802 /* Get an object description */
1803 object_desc(o_name, o_ptr, FALSE, 0);
1806 msg_format("%s¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª", o_name);
1808 msg_format("The %s scorches your undead flesh!", o_name);
1812 cave_no_regen = TRUE;
1814 /* Get an object description */
1815 object_desc(o_name, o_ptr, TRUE, 0);
1818 sprintf(ouch, "%s¤òÁõÈ÷¤·¤¿¥À¥á¡¼¥¸", o_name);
1820 sprintf(ouch, "wielding %s", o_name);
1823 if (!p_ptr->invuln) take_hit(DAMAGE_NOESCAPE, 1, ouch, -1);
1827 if ((cave[py][px].feat == FEAT_SHAL_LAVA) &&
1828 !p_ptr->invuln && !p_ptr->immune_fire && !p_ptr->ffall)
1830 int damage = 3000 + rand_int(2000);
1832 if (prace_is_(RACE_ENT)) damage += damage/3;
1834 if (p_ptr->resist_fire) damage = damage / 3;
1835 if (p_ptr->oppose_fire) damage = damage / 3;
1836 damage = damage / 100 + (rand_int(100) < (damage % 100));
1842 msg_print("ÍÏ´ä¤Ç²Ð½ý¤·¤¿¡ª");
1843 take_hit(DAMAGE_NOESCAPE, damage, "Àõ¤¤ÍÏ´äή", -1);
1845 msg_print("The lava burns you!");
1846 take_hit(DAMAGE_NOESCAPE, damage, "shallow lava", -1);
1849 cave_no_regen = TRUE;
1853 else if ((cave[py][px].feat == FEAT_DEEP_LAVA) &&
1854 !p_ptr->invuln && !p_ptr->immune_fire)
1856 int damage = 6000 + rand_int(4000);
1861 if (p_ptr->resist_fire) damage = damage / 3;
1862 if (p_ptr->oppose_fire) damage = damage / 3;
1866 damage = damage / 5;
1869 message = "Ç®¤Ç²Ð½ý¤·¤¿¡ª";
1870 hit_from = "¿¼¤¤ÍÏ´äή¤Î¾å¤ËÉâÍ·¤·¤¿¥À¥á¡¼¥¸";
1872 message = "The heat burns you!";
1873 hit_from = "flying over deep lava";
1880 message = "ÍÏ´ä¤Ç²Ð½ý¤·¤¿¡ª";
1881 hit_from = "¿¼¤¤ÍÏ´äή";
1883 message = "The lava burns you!";
1884 hit_from = "deep lava";
1889 damage = damage / 100 + (rand_int(100) < (damage % 100));
1894 take_hit(DAMAGE_NOESCAPE, damage, hit_from, -1);
1896 cave_no_regen = TRUE;
1900 else if ((cave[py][px].feat == FEAT_DEEP_WATER) && !p_ptr->ffall && !p_ptr->can_swim)
1902 if (p_ptr->total_weight > (((u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2))
1906 msg_print("Å®¤ì¤Æ¤¤¤ë¡ª");
1907 take_hit(DAMAGE_NOESCAPE, randint(p_ptr->lev), "Å®¤ì", -1);
1909 msg_print("You are drowning!");
1910 take_hit(DAMAGE_NOESCAPE, randint(p_ptr->lev), "drowning", -1);
1913 cave_no_regen = TRUE;
1920 if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !p_ptr->immune_fire)
1922 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1923 if (prace_is_(RACE_ENT)) damage += damage/3;
1924 if (p_ptr->resist_fire) damage = damage / 3;
1925 if (p_ptr->oppose_fire) damage = damage / 3;
1927 msg_print("Ç®¤¤¡ª");
1928 take_hit(DAMAGE_NOESCAPE, damage, "±ê¤Î¥ª¡¼¥é", -1);
1930 msg_print("It's hot!");
1931 take_hit(DAMAGE_NOESCAPE, damage, "Fire aura", -1);
1934 if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !p_ptr->immune_elec)
1936 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1937 if (p_ptr->resist_elec) damage = damage / 3;
1938 if (p_ptr->oppose_elec) damage = damage / 3;
1940 msg_print("Äˤ¤¡ª");
1941 take_hit(DAMAGE_NOESCAPE, damage, "Åŵ¤¤Î¥ª¡¼¥é", -1);
1943 msg_print("It hurts!");
1944 take_hit(DAMAGE_NOESCAPE, damage, "Elec aura", -1);
1947 if ((r_info[m_list[p_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !p_ptr->immune_cold)
1949 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1950 if (p_ptr->resist_cold) damage = damage / 3;
1951 if (p_ptr->oppose_cold) damage = damage / 3;
1953 msg_print("Î䤿¤¤¡ª");
1954 take_hit(DAMAGE_NOESCAPE, damage, "Î䵤¤Î¥ª¡¼¥é", -1);
1956 msg_print("It's cold!");
1957 take_hit(DAMAGE_NOESCAPE, damage, "Cold aura", -1);
1962 /* Spectres -- take damage when moving through walls */
1964 * Added: ANYBODY takes damage if inside through walls
1965 * without wraith form -- NOTE: Spectres will never be
1966 * reduced below 0 hp by being inside a stone wall; others
1969 if (!cave_floor_bold(py, px))
1971 /* Player can walk through trees */
1972 if ((cave[py][px].feat == FEAT_TREES) || ((cave[py][px].feat == FEAT_MOUNTAIN) && !dun_level && p_ptr->ffall))
1976 else if (!p_ptr->invuln && !p_ptr->wraith_form && !p_ptr->kabenuke &&
1977 ((p_ptr->chp > (p_ptr->lev / 5)) || !p_ptr->pass_wall))
1981 cave_no_regen = TRUE;
1983 if (p_ptr->pass_wall)
1986 msg_print("ÂΤÎʬ»Ò¤¬Ê¬²ò¤·¤¿µ¤¤¬¤¹¤ë¡ª");
1989 msg_print("Your molecules feel disrupted!");
1990 dam_desc = "density";
1997 msg_print("Êø¤ì¤¿´ä¤Ë²¡¤·ÄÙ¤µ¤ì¤¿¡ª");
1998 dam_desc = "¹Å¤¤´ä";
2000 msg_print("You are being crushed!");
2001 dam_desc = "solid rock";
2006 take_hit(DAMAGE_NOESCAPE, 1 + (p_ptr->lev / 5), dam_desc, -1);
2012 monster_race *r_ptr;
2014 if (min != prev_min)
2017 bool old_inside_battle = p_ptr->inside_battle;
2019 do_cmd_write_nikki(NIKKI_HIGAWARI, 0, NULL);
2021 p_ptr->inside_battle = TRUE;
2022 get_mon_num_prep(NULL,NULL);
2024 for (i = 0; i < max_d_idx; i++)
2026 if (max_dlv[i] < d_info[i].mindepth) continue;
2027 if (max_dl < max_dlv[i]) max_dl = max_dlv[i];
2031 today_mon = get_mon_num(max_dl);
2032 r_ptr = &r_info[today_mon];
2034 if (r_ptr->flags1 & RF1_UNIQUE) continue;
2035 if (r_ptr->flags7 & (RF7_UNIQUE_7 | RF7_UNIQUE2)) continue;
2036 if (r_ptr->flags2 & (RF2_MULTIPLY)) continue;
2037 if (!(r_ptr->flags9 & RF9_DROP_CORPSE) || !(r_ptr->flags9 & RF9_DROP_SKELETON)) continue;
2038 if (r_ptr->level < MIN(max_dl/2, 40)) continue;
2039 if (r_ptr->rarity > 10) continue;
2040 if (r_ptr->level == 0) continue;
2043 p_ptr->today_mon = 0;
2044 p_ptr->inside_battle = old_inside_battle;
2048 /* Nightmare mode activates the TY_CURSE at midnight */
2049 if (ironman_nightmare)
2051 /* Require exact minute */
2052 if (min != prev_min)
2054 /* Every 15 minutes after 11:00 pm */
2055 if ((hour == 23) && !(min % 15))
2065 msg_print("±ó¤¯¤ÇÉÔµ¤Ì£¤Ê¾â¤Î²»¤¬ÌĤä¿¡£");
2067 msg_print("You hear a distant bell toll ominously.");
2075 msg_print("±ó¤¯¤Ç¾â¤¬Æó²óÌĤä¿¡£");
2077 msg_print("A distant bell sounds twice.");
2085 msg_print("±ó¤¯¤Ç¾â¤¬»°²óÌĤä¿¡£");
2087 msg_print("A distant bell sounds three times.");
2095 msg_print("±ó¤¯¤Ç¾â¤¬»Í²óÌĤä¿¡£");
2097 msg_print("A distant bell tolls four times.");
2105 /* TY_CURSE activates at mignight! */
2112 msg_print("±ó¤¯¤Ç¾â¤¬²¿²ó¤âÌĤꡢ»à¤ó¤À¤è¤¦¤ÊÀŤ±¤µ¤ÎÃæ¤Ø¾Ã¤¨¤Æ¤¤¤Ã¤¿¡£");
2114 msg_print("A distant bell tolls many times, fading into an deathly silence.");
2117 activate_ty_curse(FALSE, &count);
2122 /* Take damage from cuts */
2123 if (p_ptr->cut && !p_ptr->invuln)
2125 /* Mortal wound or Deep Gash */
2126 if (p_ptr->cut > 1000)
2131 else if (p_ptr->cut > 200)
2137 else if (p_ptr->cut > 100)
2142 else if (p_ptr->cut > 50)
2147 else if (p_ptr->cut > 25)
2152 else if (p_ptr->cut > 10)
2165 take_hit(DAMAGE_NOESCAPE, i, "Ã×Ì¿½ý", -1);
2167 take_hit(DAMAGE_NOESCAPE, i, "a fatal wound", -1);
2173 /*** Check the Food, and Regenerate ***/
2175 if (!p_ptr->inside_battle)
2177 /* Digest normally */
2178 if (p_ptr->food < PY_FOOD_MAX)
2180 /* Every 100 game turns */
2183 /* Basic digestion rate based on speed */
2184 i = /* extract_energy[p_ptr->pspeed] * 2;*/
2185 ((p_ptr->pspeed > 199) ? 49 : ((p_ptr->pspeed < 0) ?
2186 1 : extract_energy[p_ptr->pspeed]));
2188 /* Regeneration takes more food */
2189 if (p_ptr->regenerate) i += 20;
2190 if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK)) i+= 20;
2192 /* Slow digestion takes less food */
2193 if (p_ptr->slow_digest) i -= 5;
2195 /* Minimal digestion */
2198 /* Digest some food */
2199 (void)set_food(p_ptr->food - i);
2203 /* Digest quickly when gorged */
2206 /* Digest a lot of food */
2207 (void)set_food(p_ptr->food - 100);
2211 /* Starve to death (slowly) */
2212 if (p_ptr->food < PY_FOOD_STARVE)
2214 /* Calculate damage */
2215 i = (PY_FOOD_STARVE - p_ptr->food) / 10;
2219 if (!p_ptr->invuln) take_hit(DAMAGE_LOSELIFE, i, "¶õÊ¢", -1);
2221 if (!p_ptr->invuln) take_hit(DAMAGE_LOSELIFE, i, "starvation", -1);
2226 /* Default regeneration */
2227 regen_amount = PY_REGEN_NORMAL;
2230 if (p_ptr->food < PY_FOOD_WEAK)
2232 /* Lower regeneration */
2233 if (p_ptr->food < PY_FOOD_STARVE)
2237 else if (p_ptr->food < PY_FOOD_FAINT)
2239 regen_amount = PY_REGEN_FAINT;
2243 regen_amount = PY_REGEN_WEAK;
2247 if ((p_ptr->food < PY_FOOD_FAINT) && !p_ptr->inside_battle)
2249 /* Faint occasionally */
2250 if (!p_ptr->paralyzed && (rand_int(100) < 10))
2254 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤À䤷¤Æ¤·¤Þ¤Ã¤¿¡£");
2256 msg_print("You faint from the lack of food.");
2261 /* Hack -- faint (bypass free action) */
2262 (void)set_paralyzed(p_ptr->paralyzed + 1 + rand_int(5));
2268 /* Are we walking the pattern? */
2269 if (pattern_effect())
2271 cave_no_regen = TRUE;
2275 /* Regeneration ability */
2276 if (p_ptr->regenerate)
2278 regen_amount = regen_amount * 2;
2280 if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK))
2287 /* Searching or Resting */
2288 if ((p_ptr->action == ACTION_SEARCH) || (p_ptr->action == ACTION_REST))
2290 regen_amount = regen_amount * 2;
2293 upkeep_factor = calculate_upkeep();
2295 /* Regenerate the mana */
2296 /* if (p_ptr->csp < p_ptr->msp) */
2300 s32b upkeep_regen = ((100 - upkeep_factor) * regen_amount);
2301 if ((p_ptr->action == ACTION_LEARN) || (p_ptr->action == ACTION_HAYAGAKE)) upkeep_regen -= regen_amount;
2302 regenmana(upkeep_regen/100);
2304 #ifdef TRACK_FRIENDS
2308 msg_format("£Í£Ð²óÉü: %d/%d", upkeep_regen, regen_amount);
2310 msg_format("Regen: %d/%d", upkeep_regen, regen_amount);
2314 #endif /* TRACK_FRIENDS */
2317 else if (p_ptr->action != ACTION_LEARN)
2319 regenmana(regen_amount);
2322 if (p_ptr->pclass == CLASS_MAGIC_EATER)
2324 regenmagic(regen_amount);
2327 if ((p_ptr->csp == 0) && (p_ptr->csp_frac == 0))
2329 while (upkeep_factor > 100)
2332 msg_print("¤³¤ó¤Ê¤Ë¿¤¯¤Î¥Ú¥Ã¥È¤òÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
2334 msg_print("Such much pets cannot be controled at once!");
2336 do_cmd_pet_dismiss();
2338 upkeep_factor = calculate_upkeep();
2341 msg_format("°Ý»ý£Í£Ð¤Ï %d%%", upkeep_factor);
2343 msg_format("Upkeep: %d%% mana.", upkeep_factor);
2349 /* Poisoned or cut yields no healing */
2350 if (p_ptr->poisoned) regen_amount = 0;
2351 if (p_ptr->cut) regen_amount = 0;
2353 /* Special floor -- Pattern, in a wall -- yields no healing */
2354 if (cave_no_regen) regen_amount = 0;
2356 regen_amount = (regen_amount * mutant_regenerate_mod) / 100;
2358 /* Regenerate Hit Points if needed */
2359 if ((p_ptr->chp < p_ptr->mhp) && !cave_no_regen)
2361 if ((cave[py][px].feat < FEAT_PATTERN_END) &&
2362 (cave[py][px].feat >= FEAT_PATTERN_START))
2364 regenhp(regen_amount / 5); /* Hmmm. this should never happen? */
2368 regenhp(regen_amount);
2373 /*** Timeout Various Things ***/
2376 if (p_ptr->tim_mimic)
2378 (void)set_mimic(p_ptr->tim_mimic - 1, p_ptr->mimic_form, TRUE);
2381 /* Hack -- Hallucinating */
2384 (void)set_image(p_ptr->image - dec_count);
2390 (void)set_blind(p_ptr->blind - dec_count);
2393 /* Times see-invisible */
2394 if (p_ptr->tim_invis)
2396 (void)set_tim_invis(p_ptr->tim_invis - 1, TRUE);
2407 (void)set_tim_esp(p_ptr->tim_esp - 1, TRUE);
2410 /* Timed temporary elemental brands. -LM- */
2411 if (p_ptr->ele_attack)
2413 p_ptr->ele_attack--;
2415 /* Clear all temporary elemental brands. */
2416 if (!p_ptr->ele_attack) set_ele_attack(0, 0);
2419 /* Timed temporary elemental immune. -LM- */
2420 if (p_ptr->ele_immune)
2422 p_ptr->ele_immune--;
2424 /* Clear all temporary elemental brands. */
2425 if (!p_ptr->ele_immune) set_ele_immune(0, 0);
2428 /* Timed infra-vision */
2429 if (p_ptr->tim_infra)
2431 (void)set_tim_infra(p_ptr->tim_infra - 1, TRUE);
2435 if (p_ptr->tim_stealth)
2437 (void)set_tim_stealth(p_ptr->tim_stealth - 1, TRUE);
2440 /* Timed levitation */
2441 if (p_ptr->tim_ffall)
2443 (void)set_tim_ffall(p_ptr->tim_ffall - 1, TRUE);
2446 /* Timed sh_touki */
2447 if (p_ptr->tim_sh_touki)
2449 (void)set_tim_sh_touki(p_ptr->tim_sh_touki - 1, TRUE);
2453 if (p_ptr->tim_sh_fire)
2455 (void)set_tim_sh_fire(p_ptr->tim_sh_fire - 1, TRUE);
2458 /* Timed resist-magic */
2459 if (p_ptr->resist_magic)
2461 (void)set_resist_magic(p_ptr->resist_magic - 1, TRUE);
2464 /* Timed regeneration */
2465 if (p_ptr->tim_regen)
2467 (void)set_tim_regen(p_ptr->tim_regen - 1, TRUE);
2470 /* Timed resist nether */
2471 if (p_ptr->tim_res_nether)
2473 (void)set_tim_res_nether(p_ptr->tim_res_nether - 1, TRUE);
2476 /* Timed resist time */
2477 if (p_ptr->tim_res_time)
2479 (void)set_tim_res_time(p_ptr->tim_res_time - 1, TRUE);
2483 if (p_ptr->tim_reflect)
2485 (void)set_tim_reflect(p_ptr->tim_reflect - 1, TRUE);
2489 if (p_ptr->multishadow)
2491 (void)set_multishadow(p_ptr->multishadow - 1, TRUE);
2494 /* Timed Robe of dust */
2495 if (p_ptr->dustrobe)
2497 (void)set_dustrobe(p_ptr->dustrobe - 1, TRUE);
2500 /* Timed infra-vision */
2501 if (p_ptr->kabenuke)
2503 (void)set_kabenuke(p_ptr->kabenuke - 1, TRUE);
2507 if (p_ptr->paralyzed)
2509 (void)set_paralyzed(p_ptr->paralyzed - dec_count);
2513 if (p_ptr->confused)
2515 (void)set_confused(p_ptr->confused - dec_count);
2521 (void)set_afraid(p_ptr->afraid - dec_count);
2527 (void)set_fast(p_ptr->fast - 1, TRUE);
2533 (void)set_slow(p_ptr->slow - dec_count, TRUE);
2536 /* Protection from evil */
2537 if (p_ptr->protevil)
2539 (void)set_protevil(p_ptr->protevil - 1, TRUE);
2542 /* Invulnerability */
2545 (void)set_invuln(p_ptr->invuln - 1, TRUE);
2549 if (p_ptr->wraith_form)
2551 (void)set_wraith_form(p_ptr->wraith_form - 1, TRUE);
2557 (void)set_hero(p_ptr->hero - 1, TRUE);
2563 (void)set_shero(p_ptr->shero - 1, TRUE);
2569 (void)set_blessed(p_ptr->blessed - 1, TRUE);
2575 (void)set_shield(p_ptr->shield - 1, TRUE);
2579 if (p_ptr->tsubureru)
2581 (void)set_tsubureru(p_ptr->tsubureru - 1, TRUE);
2585 if (p_ptr->magicdef)
2587 (void)set_magicdef(p_ptr->magicdef - 1, TRUE);
2591 if (p_ptr->tsuyoshi)
2593 (void)set_tsuyoshi(p_ptr->tsuyoshi - 1, TRUE);
2597 if (p_ptr->oppose_acid)
2599 (void)set_oppose_acid(p_ptr->oppose_acid - 1, TRUE);
2602 /* Oppose Lightning */
2603 if (p_ptr->oppose_elec)
2605 (void)set_oppose_elec(p_ptr->oppose_elec - 1, TRUE);
2609 if (p_ptr->oppose_fire)
2611 (void)set_oppose_fire(p_ptr->oppose_fire - 1, TRUE);
2615 if (p_ptr->oppose_cold)
2617 (void)set_oppose_cold(p_ptr->oppose_cold - 1, TRUE);
2621 if (p_ptr->oppose_pois)
2623 (void)set_oppose_pois(p_ptr->oppose_pois - 1, TRUE);
2628 (void)set_ultimate_res(p_ptr->ult_res - 1, TRUE);
2631 /*** Poison and Stun and Cut ***/
2634 if (p_ptr->poisoned)
2636 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2638 /* Apply some healing */
2639 (void)set_poisoned(p_ptr->poisoned - adjust);
2645 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2647 /* Apply some healing */
2648 (void)set_stun(p_ptr->stun - adjust);
2654 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2656 /* Hack -- Truly "mortal" wound */
2657 if (p_ptr->cut > 1000) adjust = 0;
2659 /* Apply some healing */
2660 (void)set_cut(p_ptr->cut - adjust);
2665 /*** Process Light ***/
2667 /* Check for light being wielded */
2668 o_ptr = &inventory[INVEN_LITE];
2670 /* Burn some fuel in the current lite */
2671 if (o_ptr->tval == TV_LITE)
2673 /* Hack -- Use some fuel (except on artifacts) */
2674 if (!(artifact_p(o_ptr) || o_ptr->sval == SV_LITE_FEANOR) && (o_ptr->xtra4 > 0))
2676 /* Decrease life-span */
2677 if (o_ptr->name2 == EGO_LITE_LONG)
2679 if (turn % 40) o_ptr->xtra4--;
2681 else o_ptr->xtra4--;
2683 /* Notice interesting fuel steps */
2684 notice_lite_change(o_ptr);
2688 /* Calculate torch radius */
2689 p_ptr->update |= (PU_TORCH);
2692 /*** Process mutation effects ***/
2693 if (p_ptr->muta2 && !p_ptr->inside_battle && !p_ptr->wild_mode)
2695 if ((p_ptr->muta2 & MUT2_BERS_RAGE) && (randint(3000) == 1))
2699 msg_print("¥¦¥¬¥¡¥¡¥¢¡ª");
2700 msg_print("·ãÅܤÎȯºî¤Ë½±¤ï¤ì¤¿¡ª");
2702 msg_print("RAAAAGHH!");
2703 msg_print("You feel a fit of rage coming over you!");
2706 (void)set_shero(10 + randint(p_ptr->lev), FALSE);
2709 if ((p_ptr->muta2 & MUT2_COWARDICE) && (randint(3000) == 13))
2711 if (!(p_ptr->resist_fear || p_ptr->hero || p_ptr->shero))
2715 msg_print("¤È¤Æ¤â°Å¤¤... ¤È¤Æ¤â¶²¤¤¡ª");
2717 msg_print("It's so dark... so scary!");
2720 set_afraid(p_ptr->afraid + 13 + randint(26));
2724 if ((p_ptr->muta2 & MUT2_RTELEPORT) && (randint(5000) == 88))
2726 if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) &&
2731 /* Teleport player */
2733 msg_print("¤¢¤Ê¤¿¤Î°ÌÃÖ¤ÏÆÍÁ³¤Ò¤¸¤ç¤¦¤ËÉÔ³ÎÄê¤Ë¤Ê¤Ã¤¿...");
2735 msg_print("Your position suddenly seems very uncertain...");
2739 teleport_player(40);
2743 if ((p_ptr->muta2 & MUT2_ALCOHOL) && (randint(6400) == 321))
2745 if (!p_ptr->resist_conf && !p_ptr->resist_chaos)
2748 p_ptr->redraw |= PR_EXTRA;
2750 msg_print("¤¤¤Ò¤¤¬¤â¡¼¤í¡¼¤È¤Ò¤Æ¤¤¿¤¤¬¤Õ¤ë...¥Ò¥Ã¥¯¡ª");
2752 msg_print("You feel a SSSCHtupor cOmINg over yOu... *HIC*!");
2757 if (!p_ptr->resist_conf)
2759 (void)set_confused(p_ptr->confused + rand_int(20) + 15);
2762 if (!p_ptr->resist_chaos)
2767 if (one_in_(3)) lose_all_info();
2769 teleport_player(100);
2772 msg_print("¤¢¤Ê¤¿¤Ï¸«ÃΤé¤Ì¾ì½ê¤ÇÌܤ¬Àä᤿...Ƭ¤¬Äˤ¤¡£");
2773 msg_print("²¿¤â³Ð¤¨¤Æ¤¤¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ËÍ褿¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
2775 msg_print("You wake up somewhere with a sore head...");
2776 msg_print("You can't remember a thing, or how you got here!");
2785 msg_print("¤¡Á¤ì¤¤¤Ê¤Á¤ç¤ª¤Á¤ç¤é¤È¤ó¤ì¤¤¤ë¡Á");
2787 msg_print("Thishcischs GooDSChtuff!");
2790 (void)set_image(p_ptr->image + rand_int(150) + 150);
2796 if ((p_ptr->muta2 & MUT2_HALLU) && (randint(6400) == 42))
2798 if (!p_ptr->resist_chaos)
2801 p_ptr->redraw |= PR_EXTRA;
2802 (void)set_image(p_ptr->image + rand_int(50) + 20);
2806 if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint(3000) == 13))
2811 msg_print("¥Ö¥¥¡¼¡¼¥Ã¡ª¤ª¤Ã¤È¡£");
2813 msg_print("BRRAAAP! Oops.");
2817 fire_ball(GF_POIS, 0, p_ptr->lev, 3);
2820 if ((p_ptr->muta2 & MUT2_PROD_MANA) &&
2821 !p_ptr->anti_magic && (randint(9000) == 1))
2826 msg_print("ËâË¡¤Î¥¨¥Í¥ë¥®¡¼¤¬ÆÍÁ³¤¢¤Ê¤¿¤ÎÃæ¤Ëή¤ì¹þ¤ó¤Ç¤¤¿¡ª¥¨¥Í¥ë¥®¡¼¤ò²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡ª");
2828 msg_print("Magical energy flows through you! You must release it!");
2833 (void)get_hack_dir(&dire);
2834 fire_ball(GF_MANA, dire, p_ptr->lev * 2, 3);
2837 if ((p_ptr->muta2 & MUT2_ATT_DEMON) &&
2838 !p_ptr->anti_magic && (randint(6666) == 666))
2840 bool pet = (randint(6) == 1);
2841 bool not_pet = (bool)(!pet);
2843 if (summon_specific((pet ? -1 : 0), py, px,
2844 dun_level, SUMMON_DEMON, TRUE, FALSE, pet, not_pet, not_pet))
2847 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤ò°ú¤´ó¤»¤¿¡ª");
2849 msg_print("You have attracted a demon!");
2856 if ((p_ptr->muta2 & MUT2_SPEED_FLUX) && (randint(6000) == 1))
2859 if (randint(2) == 1)
2862 msg_print("ÀºÎÏŪ¤Ç¤Ê¤¯¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2864 msg_print("You feel less energetic.");
2867 if (p_ptr->fast > 0)
2873 set_slow(randint(30) + 10, FALSE);
2879 msg_print("ÀºÎÏŪ¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2881 msg_print("You feel more energetic.");
2884 if (p_ptr->slow > 0)
2890 set_fast(randint(30) + 10, FALSE);
2895 if ((p_ptr->muta2 & MUT2_BANISH_ALL) && (randint(9000) == 1))
2899 msg_print("ÆÍÁ³¤Û¤È¤ó¤É¸ÉÆȤˤʤ俵¤¤¬¤¹¤ë¡£");
2901 msg_print("You suddenly feel almost lonely.");
2904 banish_monsters(100);
2905 if (!dun_level && p_ptr->town_num)
2908 msg_print("Ź¤Î¼ç¿Í¤¬µÖ¤Ë¸þ¤«¤Ã¤ÆÁö¤Ã¤Æ¤¤¤ë¡ª");
2910 msg_print("You see one of the shopkeepers running for the hills!");
2913 store_shuffle(rand_int(MAX_STORES));
2918 if ((p_ptr->muta2 & MUT2_EAT_LIGHT) && one_in_(3000))
2923 msg_print("±Æ¤Ë¤Ä¤Ä¤Þ¤ì¤¿¡£");
2925 msg_print("A shadow passes over you.");
2930 /* Absorb light from the current possition */
2931 if (cave[py][px].info & CAVE_GLOW)
2936 o_ptr = &inventory[INVEN_LITE];
2938 /* Absorb some fuel in the current lite */
2939 if (o_ptr->tval == TV_LITE)
2941 /* Use some fuel (except on artifacts) */
2942 if (!artifact_p(o_ptr) && (o_ptr->xtra4 > 0))
2944 /* Heal the player a bit */
2945 hp_player(o_ptr->xtra4 / 20);
2947 /* Decrease life-span of lite */
2951 msg_print("¸÷¸»¤«¤é¥¨¥Í¥ë¥®¡¼¤òµÛ¼ý¤·¤¿¡ª");
2953 msg_print("You absorb energy from your light!");
2957 /* Notice interesting fuel steps */
2958 notice_lite_change(o_ptr);
2963 * Unlite the area (radius 10) around player and
2964 * do 50 points damage to every affected monster
2966 unlite_area(50, 10);
2969 if ((p_ptr->muta2 & MUT2_ATT_ANIMAL) &&
2970 !p_ptr->anti_magic && one_in_(7000))
2972 bool pet = (randint(3) == 1);
2973 bool not_pet = (bool)(!pet);
2975 if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_ANIMAL,
2976 TRUE, FALSE, pet, not_pet, not_pet))
2979 msg_print("ưʪ¤ò°ú¤´ó¤»¤¿¡ª");
2981 msg_print("You have attracted an animal!");
2988 if ((p_ptr->muta2 & MUT2_RAW_CHAOS) &&
2989 !p_ptr->anti_magic && one_in_(8000))
2993 msg_print("¼þ¤ê¤Î¶õ´Ö¤¬ÏĤó¤Ç¤¤¤ëµ¤¤¬¤¹¤ë¡ª");
2995 msg_print("You feel the world warping around you!");
2999 fire_ball(GF_CHAOS, 0, p_ptr->lev, 8);
3001 if ((p_ptr->muta2 & MUT2_NORMALITY) && one_in_(5000))
3003 if (!lose_mutation(0))
3005 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
3007 msg_print("You feel oddly normal.");
3011 if ((p_ptr->muta2 & MUT2_WRAITH) && !p_ptr->anti_magic && one_in_(3000))
3015 msg_print("Èóʪ¼Á²½¤·¤¿¡ª");
3017 msg_print("You feel insubstantial!");
3021 set_wraith_form(randint(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE);
3023 if ((p_ptr->muta2 & MUT2_POLY_WOUND) && one_in_(3000))
3027 if ((p_ptr->muta2 & MUT2_WASTING) && one_in_(3000))
3029 int which_stat = rand_int(6);
3030 int sustained = FALSE;
3035 if (p_ptr->sustain_str) sustained = TRUE;
3038 if (p_ptr->sustain_int) sustained = TRUE;
3041 if (p_ptr->sustain_wis) sustained = TRUE;
3044 if (p_ptr->sustain_dex) sustained = TRUE;
3047 if (p_ptr->sustain_con) sustained = TRUE;
3050 if (p_ptr->sustain_chr) sustained = TRUE;
3054 msg_print("ÉÔÀµ¤Ê¾õÂÖ¡ª");
3056 msg_print("Invalid stat chosen!");
3066 msg_print("¼«Ê¬¤¬¿ê¼å¤·¤Æ¤¤¤¯¤Î¤¬Ê¬¤«¤ë¡ª");
3068 msg_print("You can feel yourself wasting away!");
3072 (void)dec_stat(which_stat, randint(6) + 6, randint(3) == 1);
3075 if ((p_ptr->muta2 & MUT2_ATT_DRAGON) &&
3076 !p_ptr->anti_magic && one_in_(3000))
3078 bool pet = (randint(5) == 1);
3079 bool not_pet = (bool)(!pet);
3081 if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_DRAGON,
3082 TRUE, FALSE, pet, not_pet, not_pet))
3085 msg_print("¥É¥é¥´¥ó¤ò°ú¤´ó¤»¤¿¡ª");
3087 msg_print("You have attracted a dragon!");
3093 if ((p_ptr->muta2 & MUT2_WEIRD_MIND) && !p_ptr->anti_magic &&
3096 if (p_ptr->tim_esp > 0)
3099 msg_print("Àº¿À¤Ë¤â¤ä¤¬¤«¤«¤Ã¤¿¡ª");
3101 msg_print("Your mind feels cloudy!");
3104 set_tim_esp(0, TRUE);
3109 msg_print("Àº¿À¤¬¹¤¬¤Ã¤¿¡ª");
3111 msg_print("Your mind expands!");
3114 set_tim_esp(p_ptr->lev, FALSE);
3117 if ((p_ptr->muta2 & MUT2_NAUSEA) && !p_ptr->slow_digest &&
3122 msg_print("°ß¤¬áÛÚ»¤·¡¢¿©»ö¤ò¼º¤Ã¤¿¡ª");
3124 msg_print("Your stomach roils, and you lose your lunch!");
3128 set_food(PY_FOOD_WEAK);
3131 if ((p_ptr->muta2 & MUT2_WALK_SHAD) &&
3132 !p_ptr->anti_magic && one_in_(12000) && !p_ptr->inside_arena)
3137 if ((p_ptr->muta2 & MUT2_WARNING) && one_in_(1000))
3139 int danger_amount = 0;
3142 for (monster = 0; monster < m_max; monster++)
3144 monster_type *m_ptr = &m_list[monster];
3145 monster_race *r_ptr = &r_info[m_ptr->r_idx];
3147 /* Paranoia -- Skip dead monsters */
3148 if (!m_ptr->r_idx) continue;
3150 if (r_ptr->level >= p_ptr->lev)
3152 danger_amount += r_ptr->level - p_ptr->lev + 1;
3156 if (danger_amount > 100)
3158 msg_print("Èó¾ï¤Ë¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
3160 msg_print("You feel utterly terrified!");
3163 else if (danger_amount > 50)
3165 msg_print("¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
3167 msg_print("You feel terrified!");
3170 else if (danger_amount > 20)
3172 msg_print("Èó¾ï¤Ë¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
3174 msg_print("You feel very worried!");
3177 else if (danger_amount > 10)
3179 msg_print("¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
3181 msg_print("You feel paranoid!");
3184 else if (danger_amount > 5)
3186 msg_print("¤Û¤È¤ó¤É°ÂÁ´¤Êµ¤¤¬¤¹¤ë¡£");
3188 msg_print("You feel almost safe.");
3193 msg_print("¼ä¤·¤¤µ¤¤¬¤¹¤ë¡£");
3195 msg_print("You feel lonely.");
3199 if ((p_ptr->muta2 & MUT2_INVULN) && !p_ptr->anti_magic &&
3204 msg_print("̵Ũ¤Êµ¤¤¬¤¹¤ë¡ª");
3206 msg_print("You feel invincible!");
3210 (void)set_invuln(randint(8) + 8, FALSE);
3212 if ((p_ptr->muta2 & MUT2_SP_TO_HP) && one_in_(2000))
3214 int wounds = p_ptr->mhp - p_ptr->chp;
3218 int healing = p_ptr->csp;
3220 if (healing > wounds)
3226 p_ptr->csp -= healing;
3229 if ((p_ptr->muta2 & MUT2_HP_TO_SP) && !p_ptr->anti_magic &&
3232 int wounds = p_ptr->msp - p_ptr->csp;
3236 int healing = p_ptr->chp;
3238 if (healing > wounds)
3243 p_ptr->csp += healing;
3245 take_hit(DAMAGE_LOSELIFE, healing, "Ƭ¤Ë¾º¤Ã¤¿·ì", -1);
3247 take_hit(DAMAGE_LOSELIFE, healing, "blood rushing to the head", -1);
3252 if ((p_ptr->muta2 & MUT2_DISARM) && one_in_(10000))
3258 msg_print("¤¬¤â¤Ä¤ì¤Æž¤ó¤À¡ª");
3259 take_hit(DAMAGE_NOESCAPE, randint(p_ptr->wt / 6), "žÅÝ", -1);
3261 msg_print("You trip over your own feet!");
3262 take_hit(DAMAGE_NOESCAPE, randint(p_ptr->wt / 6), "tripping", -1);
3267 if (buki_motteruka(INVEN_RARM))
3269 int slot = INVEN_RARM;
3270 o_ptr = &inventory[INVEN_RARM];
3271 if (buki_motteruka(INVEN_LARM) && one_in_(2))
3273 o_ptr = &inventory[INVEN_LARM];
3276 if (!cursed_p(o_ptr))
3279 msg_print("Éð´ï¤òÍ¤Æ¤·¤Þ¤Ã¤¿¡ª");
3281 msg_print("You drop your weapon!");
3284 inven_drop(slot, 1);
3291 /*** Process Inventory ***/
3293 /* Handle experience draining */
3294 if (p_ptr->exp_drain)
3296 if (rand_int(100) < 25)
3298 p_ptr->exp -= (p_ptr->lev+1)/2;
3299 if (p_ptr->exp < 0) p_ptr->exp = 0;
3300 p_ptr->max_exp -= (p_ptr->lev+1)/2;
3301 if (p_ptr->max_exp < 0) p_ptr->max_exp = 0;
3306 /* Rarely, take damage from the Jewel of Judgement */
3307 if ((randint(999) == 1) && !p_ptr->anti_magic)
3309 if ((inventory[INVEN_LITE].tval) &&
3310 (inventory[INVEN_LITE].sval == SV_LITE_THRAIN))
3313 msg_print("¡Ø¿³È½¤ÎÊõÀС٤Ϥ¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª");
3314 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "¿³È½¤ÎÊõÀÐ", -1);
3316 msg_print("The Jewel of Judgement drains life from you!");
3317 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "the Jewel of Judgement", -1);
3324 /* Process equipment */
3325 for (j = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
3327 /* Get the object */
3328 o_ptr = &inventory[i];
3330 object_flags(o_ptr, &f1, &f2, &f3);
3332 /* Skip non-objects */
3333 if (!o_ptr->k_idx) continue;
3335 if (!p_ptr->inside_battle)
3338 if ((f3 & TR3_TY_CURSE) && (randint(TY_CURSE_CHANCE) == 1))
3342 (void)activate_ty_curse(FALSE, &count);
3345 /* Make a chainsword noise */
3346 if ((o_ptr->name1 == ART_CHAINSWORD) && randint(CHAINSWORD_NOISE) == 1)
3350 if (!get_rnd_line("chainswd_j.txt", 0, noise))
3352 if (!get_rnd_line("chainswd.txt", 0, noise))
3356 disturb(FALSE, FALSE);
3360 * Hack: Uncursed teleporting items (e.g. Trump Weapons)
3361 * can actually be useful!
3363 if ((f3 & TR3_TELEPORT) && (rand_int(100) < 1))
3365 if ((o_ptr->ident & IDENT_CURSED) && !p_ptr->anti_tele)
3369 /* Teleport player */
3370 teleport_player(40);
3374 if (p_ptr->wild_mode || (o_ptr->inscription &&
3375 (strchr(quark_str(o_ptr->inscription),'.'))))
3378 /* msg_print("Teleport aborted.") */ ;
3381 else if (get_check("¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©"))
3383 else if (get_check("Teleport? "))
3388 teleport_player(50);
3394 /* Recharge activatable objects */
3395 if (o_ptr->timeout > 0)
3400 /* Notice changes */
3401 if (!o_ptr->timeout)
3403 recharged_notice(o_ptr);
3409 /* Notice changes */
3413 p_ptr->window |= (PW_EQUIP);
3418 * Recharge rods. Rods now use timeout to control charging status,
3419 * and each charging rod in a stack decreases the stack's timeout by
3420 * one per turn. -LM-
3422 for (j = 0, i = 0; i < INVEN_PACK; i++)
3424 o_ptr = &inventory[i];
3425 k_ptr = &k_info[o_ptr->k_idx];
3427 /* Skip non-objects */
3428 if (!o_ptr->k_idx) continue;
3430 /* Examine all charging rods or stacks of charging rods. */
3431 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
3433 /* Determine how many rods are charging. */
3434 temp = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
3435 if (temp > o_ptr->number) temp = o_ptr->number;
3437 /* Decrease timeout by that number. */
3438 o_ptr->timeout -= temp;
3440 /* Boundary control. */
3441 if (o_ptr->timeout < 0) o_ptr->timeout = 0;
3443 /* Notice changes, provide message if object is inscribed. */
3444 if (!(o_ptr->timeout))
3446 recharged_notice(o_ptr);
3452 /* Notice changes */
3456 p_ptr->notice |= (PN_COMBINE);
3459 p_ptr->window |= (PW_INVEN);
3463 /* Feel the inventory */
3468 /*** Process Objects ***/
3470 /* Process objects */
3471 for (i = 1; i < o_max; i++)
3476 /* Skip dead objects */
3477 if (!o_ptr->k_idx) continue;
3479 /* Recharge rods on the ground. No messages. */
3480 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
3483 o_ptr->timeout -= o_ptr->number;
3485 /* Boundary control. */
3486 if (o_ptr->timeout < 0) o_ptr->timeout = 0;
3491 /*** Involuntary Movement ***/
3493 /* Delayed Word-of-Recall */
3494 if (p_ptr->word_recall)
3497 * HACK: Autosave BEFORE resetting the recall counter (rr9)
3498 * The player is yanked up/down as soon as
3499 * he loads the autosaved game.
3501 if (autosave_l && (p_ptr->word_recall == 1) && !p_ptr->inside_battle)
3502 do_cmd_save_game(TRUE);
3504 /* Count down towards recall */
3505 p_ptr->word_recall--;
3507 p_ptr->redraw |= (PR_STATUS);
3509 /* Activate the recall */
3510 if (!p_ptr->word_recall)
3515 /* Determine the level */
3516 if (dun_level || p_ptr->inside_quest)
3519 msg_print("¾å¤Ë°ú¤ÃÄ¥¤ê¤¢¤²¤é¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
3521 msg_print("You feel yourself yanked upwards!");
3524 p_ptr->recall_dungeon = dungeon_type;
3526 do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
3531 leaving_quest = p_ptr->inside_quest;
3533 /* Leaving an 'only once' quest marks it as failed */
3534 if (leaving_quest &&
3535 ((quest[leaving_quest].flags & QUEST_FLAG_ONCE) || (quest[leaving_quest].type == QUEST_TYPE_RANDOM)) &&
3536 (quest[leaving_quest].status == QUEST_STATUS_TAKEN))
3538 quest[leaving_quest].status = QUEST_STATUS_FAILED;
3539 quest[leaving_quest].complev = (byte)p_ptr->lev;
3540 if (quest[leaving_quest].type == QUEST_TYPE_RANDOM)
3542 r_info[quest[leaving_quest].r_idx].flags1 &= ~(RF1_QUESTOR);
3543 if (record_rand_quest)
3544 do_cmd_write_nikki(NIKKI_RAND_QUEST_F, leaving_quest, NULL);
3546 else if (record_fix_quest)
3547 do_cmd_write_nikki(NIKKI_FIX_QUEST_F, leaving_quest, NULL);
3550 p_ptr->inside_quest = 0;
3551 p_ptr->leaving = TRUE;
3556 msg_print("²¼¤Ë°ú¤¤º¤ê¹ß¤í¤µ¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
3558 msg_print("You feel yourself yanked downwards!");
3561 dungeon_type = p_ptr->recall_dungeon;
3564 do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
3567 dun_level = max_dlv[dungeon_type];
3568 if (dun_level < 1) dun_level = 1;
3570 /* Nightmare mode makes recall more dangerous */
3571 if (ironman_nightmare && !rand_int(666) && (dungeon_type == DUNGEON_ANGBAND))
3577 else if (dun_level < 99)
3579 dun_level = (dun_level + 99) / 2;
3581 else if (dun_level > 100)
3583 dun_level = d_info[dungeon_type].maxdepth - 1;
3587 if (p_ptr->wild_mode)
3589 p_ptr->wilderness_y = py;
3590 p_ptr->wilderness_x = px;
3594 /* Save player position */
3598 p_ptr->wild_mode = FALSE;
3601 p_ptr->leaving = TRUE;
3603 if (dungeon_type == DUNGEON_ANGBAND)
3605 for (i = MIN_RANDOM_QUEST; i < MAX_RANDOM_QUEST + 1; i++)
3607 if ((quest[i].type == QUEST_TYPE_RANDOM) &&
3608 (quest[i].status == QUEST_STATUS_TAKEN) &&
3609 (quest[i].level < dun_level))
3611 quest[i].status = QUEST_STATUS_FAILED;
3612 quest[i].complev = (byte)p_ptr->lev;
3613 r_info[quest[i].r_idx].flags1 &= ~(RF1_QUESTOR);
3620 sound(SOUND_TPLEVEL);
3628 * Verify use of "wizard" mode
3630 static bool enter_wizard_mode(void)
3632 /* Ask first time */
3635 /* Mention effects */
3637 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥â¡¼¥É¤Ç¤¹¡£ ");
3638 msg_print("°ìÅÙ¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ë¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3640 msg_print("Wizard mode is for debugging and experimenting.");
3641 msg_print("The game will not be scored if you enter wizard mode.");
3646 /* Verify request */
3648 if (!get_check("ËÜÅö¤Ë¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ê¤¿¤¤¤Î¤Ç¤¹¤«? "))
3650 if (!get_check("Are you sure you want to enter wizard mode? "))
3669 * Verify use of "debug" commands
3671 static bool enter_debug_mode(void)
3673 /* Ask first time */
3676 /* Mention effects */
3678 msg_print("¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ ");
3679 msg_print("¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3681 msg_print("The debug commands are for debugging and experimenting.");
3682 msg_print("The game will not be scored if you use debug commands.");
3687 /* Verify request */
3689 if (!get_check("ËÜÅö¤Ë¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? "))
3691 if (!get_check("Are you sure you want to use debug commands? "))
3699 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥Ç¥Ð¥Ã¥°¥â¡¼¥É¤ËÆÍÆþ¤·¤Æ¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
3701 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use debug commands.");
3712 * Hack -- Declare the Debug Routines
3714 extern void do_cmd_debug(void);
3716 #endif /* ALLOW_WIZARD */
3722 * Verify use of "borg" commands
3724 static bool enter_borg_mode(void)
3726 /* Ask first time */
3727 if (!(noscore & 0x0010))
3729 /* Mention effects */
3731 msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ ");
3732 msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3734 msg_print("The borg commands are for debugging and experimenting.");
3735 msg_print("The game will not be scored if you use borg commands.");
3740 /* Verify request */
3742 if (!get_check("ËÜÅö¤Ë¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? "))
3744 if (!get_check("Are you sure you want to use borg commands? "))
3760 * Hack -- Declare the Ben Borg
3762 extern void do_cmd_borg(void);
3764 #endif /* ALLOW_BORG */
3769 * Parse and execute the current command
3770 * Give "Warning" on illegal commands.
3772 * XXX XXX XXX Make some "blocks"
3774 static void process_command(void)
3776 int old_now_message = now_message;
3778 #ifdef ALLOW_REPEAT /* TNB */
3780 /* Handle repeating the last command */
3783 #endif /* ALLOW_REPEAT -- TNB */
3787 /* Parse the command */
3788 switch (command_cmd)
3803 /*** Wizard Commands ***/
3805 /* Toggle Wizard Mode */
3812 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É²ò½ü¡£");
3814 msg_print("Wizard mode off.");
3818 else if (enter_wizard_mode())
3822 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥ÉÆÍÆþ¡£");
3824 msg_print("Wizard mode on.");
3829 /* Update monsters */
3830 p_ptr->update |= (PU_MONSTERS);
3832 /* Redraw "title" */
3833 p_ptr->redraw |= (PR_TITLE);
3841 /* Special "debug" commands */
3844 /* Enter debug mode */
3845 if (enter_debug_mode())
3852 #endif /* ALLOW_WIZARD */
3857 /* Special "borg" commands */
3860 /* Enter borg mode */
3861 if (enter_borg_mode())
3863 if (!p_ptr->wild_mode) do_cmd_borg();
3869 #endif /* ALLOW_BORG */
3873 /*** Inventory Commands ***/
3875 /* Wear/wield equipment */
3878 if (!p_ptr->wild_mode) do_cmd_wield();
3882 /* Take off equipment */
3885 if (!p_ptr->wild_mode) do_cmd_takeoff();
3892 if (!p_ptr->wild_mode) do_cmd_drop();
3896 /* Destroy an item */
3903 /* Equipment list */
3910 /* Inventory list */
3918 /*** Various commands ***/
3920 /* Identify an object */
3927 /* Hack -- toggle windows */
3930 toggle_inven_equip();
3935 /*** Standard "Movement" Commands ***/
3940 if (!p_ptr->wild_mode) do_cmd_alter();
3947 if (!p_ptr->wild_mode) do_cmd_tunnel();
3951 /* Move (usually pick up things) */
3954 #ifdef ALLOW_EASY_DISARM /* TNB */
3958 #else /* ALLOW_EASY_DISARM -- TNB */
3960 do_cmd_walk(always_pickup);
3962 #endif /* ALLOW_EASY_DISARM -- TNB */
3967 /* Move (usually do not pick up) */
3970 #ifdef ALLOW_EASY_DISARM /* TNB */
3974 #else /* ALLOW_EASY_DISARM -- TNB */
3976 do_cmd_walk(!always_pickup);
3978 #endif /* ALLOW_EASY_DISARM -- TNB */
3984 /*** Running, Resting, Searching, Staying */
3986 /* Begin Running -- Arg is Max Distance */
3989 if (!p_ptr->wild_mode) do_cmd_run();
3993 /* Stay still (usually pick things up) */
3996 do_cmd_stay(always_pickup);
4000 /* Stay still (usually do not pick up) */
4003 do_cmd_stay(!always_pickup);
4007 /* Rest -- Arg is time */
4014 /* Search for traps/doors */
4021 /* Toggle search mode */
4024 if (p_ptr->action == ACTION_SEARCH) set_action(ACTION_NONE);
4025 else set_action(ACTION_SEARCH);
4030 /*** Stairs and Doors and Chests and Traps ***/
4035 if (!p_ptr->wild_mode) do_cmd_store();
4039 /* Enter building -KMW- */
4042 if (!p_ptr->wild_mode) do_cmd_bldg();
4046 /* Enter quest level -KMW- */
4049 if (!p_ptr->wild_mode) do_cmd_quest();
4053 /* Go up staircase */
4056 if(!p_ptr->wild_mode && !dun_level && !p_ptr->inside_arena && !p_ptr->inside_quest)
4063 msg_print("½±·â¤«¤éƨ¤²¤ë¤Ë¤Ï¥Þ¥Ã¥×¤Îü¤Þ¤Ç°ÜÆ°¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£");
4065 msg_print("To flee the ambush you have to reach the edge of the map.");
4068 else if (p_ptr->food < PY_FOOD_WEAK)
4071 msg_print("¤½¤ÎÁ°¤Ë¿©»ö¤ò¤È¤é¤Ê¤¤¤È¡£");
4073 msg_print("You must eat something here.");
4078 if (change_wild_mode())
4091 /* Go down staircase */
4094 if(!p_ptr->wild_mode) do_cmd_go_down();
4097 p_ptr->wilderness_x = px;
4098 p_ptr->wilderness_y = py;
4104 /* Open a door or chest */
4107 if (!p_ptr->wild_mode) do_cmd_open();
4114 if (!p_ptr->wild_mode) do_cmd_close();
4118 /* Jam a door with spikes */
4121 if (!p_ptr->wild_mode) do_cmd_spike();
4128 if (!p_ptr->wild_mode) do_cmd_bash();
4132 /* Disarm a trap or chest */
4135 if (!p_ptr->wild_mode) do_cmd_disarm();
4140 /*** Magic and Prayers ***/
4142 /* Gain new spells/prayers */
4145 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4147 msg_print("¼öʸ¤ò³Ø½¬¤¹¤ëɬÍפϤʤ¤¡ª");
4149 msg_print("You don't have to learn spells!");
4151 else if (p_ptr->pclass == CLASS_SAMURAI)
4152 do_cmd_gain_hissatsu();
4153 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4163 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
4164 (p_ptr->pclass == CLASS_BERSERKER) ||
4165 (p_ptr->pclass == CLASS_NINJA) ||
4166 (p_ptr->pclass == CLASS_MIRROR_MASTER)
4167 ) do_cmd_mind_browse();
4168 else if (p_ptr->pclass == CLASS_SMITH)
4170 else do_cmd_browse();
4178 if (!p_ptr->wild_mode)
4180 if (dun_level && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
4183 msg_print("¥À¥ó¥¸¥ç¥ó¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4185 msg_print("The arena absorbs all attempted magic!");
4190 else if (p_ptr->anti_magic && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
4193 cptr which_power = "ËâË¡";
4195 cptr which_power = "magic";
4198 if (p_ptr->pclass == CLASS_MINDCRAFTER)
4200 which_power = "ĶǽÎÏ";
4202 which_power = "psionic powers";
4205 else if (p_ptr->pclass == CLASS_IMITATOR)
4207 which_power = "¤â¤Î¤Þ¤Í";
4209 which_power = "mane";
4212 else if (p_ptr->pclass == CLASS_SAMURAI)
4214 which_power = "ɬ»¦·õ";
4216 which_power = "hissatsu";
4218 else if (p_ptr->pclass == CLASS_MIRROR_MASTER)
4220 which_power = "¶ÀËâË¡";
4222 which_power = "mirror magic";
4225 else if (p_ptr->pclass == CLASS_NINJA)
4227 which_power = "Ǧ½Ñ";
4229 which_power = "ninjutsu";
4232 else if (mp_ptr->spell_book == TV_LIFE_BOOK)
4234 which_power = "µ§¤ê";
4236 which_power = "prayer";
4241 msg_format("È¿ËâË¡¥Ð¥ê¥¢¤¬%s¤ò¼ÙË⤷¤¿¡ª", which_power);
4243 msg_format("An anti-magic shell disrupts your %s!", which_power);
4249 else if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER))
4252 msg_format("¶¸Àï»Î²½¤·¤Æ¤¤¤ÆƬ¤¬²ó¤é¤Ê¤¤¡ª");
4254 msg_format("You cannot think directly!");
4260 if ((p_ptr->pclass == CLASS_MINDCRAFTER) ||
4261 (p_ptr->pclass == CLASS_BERSERKER) ||
4262 (p_ptr->pclass == CLASS_NINJA) ||
4263 (p_ptr->pclass == CLASS_MIRROR_MASTER)
4266 else if (p_ptr->pclass == CLASS_IMITATOR)
4268 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4269 do_cmd_magic_eater();
4270 else if (p_ptr->pclass == CLASS_SAMURAI)
4272 else if (p_ptr->pclass == CLASS_BLUE_MAGE)
4273 do_cmd_cast_learned();
4274 else if (p_ptr->pclass == CLASS_SMITH)
4283 /* Issue a pet command */
4286 if (!p_ptr->wild_mode) do_cmd_pet();
4290 /*** Use various objects ***/
4292 /* Inscribe an object */
4299 /* Uninscribe an object */
4302 do_cmd_uninscribe();
4306 /* Activate an artifact */
4309 if (!p_ptr->wild_mode)
4311 if (!p_ptr->inside_arena)
4316 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4318 msg_print("The arena absorbs all attempted magic!");
4334 /* Fuel your lantern/torch */
4344 if (!p_ptr->wild_mode) do_cmd_fire();
4351 if (!p_ptr->wild_mode)
4353 if (!p_ptr->inside_arena)
4358 msg_print("¥¢¥ê¡¼¥Ê¤Ç¤Ï¥¢¥¤¥Æ¥à¤ò»È¤¨¤Ê¤¤¡ª");
4360 msg_print("You're in the arena now. This is hand-to-hand!");
4372 if (!p_ptr->wild_mode)
4374 if (!p_ptr->inside_arena)
4379 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4381 msg_print("The arena absorbs all attempted magic!");
4393 if (!p_ptr->wild_mode)
4395 if (p_ptr->inside_arena)
4398 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4400 msg_print("The arena absorbs all attempted magic!");
4405 else if (use_command && rogue_like_commands)
4417 /* Quaff a potion */
4420 if (!p_ptr->wild_mode)
4422 if (!p_ptr->inside_arena)
4423 do_cmd_quaff_potion();
4427 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4429 msg_print("The arena absorbs all attempted magic!");
4441 if (!p_ptr->wild_mode)
4443 if (!p_ptr->inside_arena)
4444 do_cmd_read_scroll();
4448 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4450 msg_print("The arena absorbs all attempted magic!");
4462 if (!p_ptr->wild_mode)
4464 if (p_ptr->inside_arena)
4467 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4469 msg_print("The arena absorbs all attempted magic!");
4474 else if (use_command && !rogue_like_commands)
4484 /* Use racial power */
4487 if (!p_ptr->wild_mode) do_cmd_racial_power();
4492 /*** Looking at Things (nearby or on map) ***/
4494 /* Full dungeon map */
4501 /* Locate player on map */
4515 /* Target monster or location */
4518 if (!p_ptr->wild_mode) do_cmd_target();
4524 /*** Help and Such ***/
4533 /* Identify symbol */
4536 do_cmd_query_symbol();
4540 /* Character description */
4543 do_cmd_change_name();
4548 /*** System Commands ***/
4550 /* Hack -- User interface */
4557 /* Single line from a pref file */
4570 /* Interact with macros */
4577 /* Interact with visuals */
4585 /* Interact with colors */
4593 /* Interact with options */
4601 /*** Misc Commands ***/
4617 /* Repeat level feeling */
4620 if (!p_ptr->wild_mode) do_cmd_feeling();
4624 /* Show previous message */
4627 do_cmd_message_one();
4631 /* Show previous messages */
4634 do_cmd_messages(old_now_message);
4638 /* Show quest status -KMW- */
4641 do_cmd_checkquest();
4645 /* Redraw the screen */
4648 now_message = old_now_message;
4653 #ifndef VERIFY_SAVEFILE
4655 /* Hack -- Save and don't quit */
4658 do_cmd_save_game(FALSE);
4662 #endif /* VERIFY_SAVEFILE */
4673 do_cmd_save_and_exit();
4677 /* Quit (commit suicide) */
4690 /* Check artifacts, uniques, objects */
4697 /* Load "screen dump" */
4700 do_cmd_load_screen();
4704 /* Save "screen dump" */
4707 do_cmd_save_screen();
4711 /* Make random artifact list */
4714 spoil_random_artifact("randifact.txt");
4718 /* Hack -- Unknown command */
4721 if (flush_failure) flush();
4722 if (randint(2) == 1)
4725 sound(SOUND_ILLEGAL);
4727 if (!get_rnd_line("error_j.txt", 0, error_m))
4729 if (!get_rnd_line("error.txt", 0, error_m))
4736 prt(" '?' ¤Ç¥Ø¥ë¥×¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£", 0, 0);
4738 prt("Type '?' for help.", 0, 0);
4744 if (!energy_use && !now_message)
4745 now_message = old_now_message;
4751 bool monster_tsuri(int r_idx)
4753 monster_race *r_ptr = &r_info[r_idx];
4755 if ((r_ptr->flags7 & RF7_AQUATIC) && !(r_ptr->flags1 & RF1_UNIQUE) && strchr("Jjlw", r_ptr->d_char))
4763 * Process the player
4765 * Notice the annoying code to handle "pack overflow", which
4766 * must come first just in case somebody manages to corrupt
4767 * the savefiles by clever use of menu commands or something.
4769 static void process_player(void)
4773 /*** Apply energy ***/
4778 msg_print("²¿¤«ÊѤï¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
4780 msg_print("You feel different!");
4783 (void)gain_random_mutation(0);
4784 hack_mutation = FALSE;
4787 if (p_ptr->inside_battle)
4789 for(i = 1; i < m_max; i++)
4791 monster_type *m_ptr = &m_list[i];
4793 if (!m_ptr->r_idx) continue;
4795 /* Hack -- Detect monster */
4796 m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
4798 /* Update the monster */
4799 update_mon(i, FALSE);
4804 /* Give the player some energy */
4805 else if((rand_int(60) < ((p_ptr->pspeed > 199) ? 49 : ((p_ptr->pspeed < 0) ? 1 : extract_energy[p_ptr->pspeed]))) && !(load && p_ptr->energy >= 100))
4806 p_ptr->energy += gain_energy();
4809 if (p_ptr->energy < 100) return;
4810 if (!command_rep) prt_time();
4812 /*** Check for interupts ***/
4814 /* Complete resting */
4821 if ((p_ptr->chp == p_ptr->mhp) &&
4822 (p_ptr->csp >= p_ptr->msp))
4825 set_action(ACTION_NONE);
4829 /* Complete resting */
4830 else if (resting == -2)
4833 if ((p_ptr->chp == p_ptr->mhp) &&
4834 (p_ptr->csp >= p_ptr->msp) &&
4835 !p_ptr->blind && !p_ptr->confused &&
4836 !p_ptr->poisoned && !p_ptr->afraid &&
4837 !p_ptr->stun && !p_ptr->cut &&
4838 !p_ptr->slow && !p_ptr->paralyzed &&
4839 !p_ptr->image && !p_ptr->word_recall)
4842 set_action(ACTION_NONE);
4847 if (p_ptr->action == ACTION_FISH)
4850 Term_xtra(TERM_XTRA_DELAY, 10);
4854 bool success = FALSE;
4855 get_mon_num_prep(monster_tsuri,NULL);
4856 r_idx = get_mon_num(dun_level ? dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level);
4858 if (r_idx && one_in_(2))
4861 y = py+ddy[tsuri_dir];
4862 x = px+ddx[tsuri_dir];
4863 if (place_monster_aux(y, x, r_idx, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE))
4866 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
4868 msg_format("%s¤¬Äà¤ì¤¿¡ª", m_name);
4870 msg_format("You have a good catch!", m_name);
4878 msg_print("±Â¤À¤±¿©¤ï¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª¤¯¤Ã¤½¡Á¡ª");
4880 msg_print("Damn! The fish took a bait away!");
4887 /* Handle "abort" */
4890 /* Check for "player abort" (semi-efficiently for resting) */
4891 if (running || command_rep || (p_ptr->action == ACTION_REST) || (p_ptr->action == ACTION_FISH))
4896 /* Check for a key */
4905 /* Hack -- Show a Message */
4907 msg_print("ÃæÃǤ·¤Þ¤·¤¿¡£");
4909 msg_print("Canceled.");
4916 if (p_ptr->riding && !p_ptr->confused && !p_ptr->blind)
4918 monster_type *m_ptr = &m_list[p_ptr->riding];
4927 /* Acquire the monster name */
4928 monster_desc(m_name, m_ptr, 0);
4930 msg_format("%^s¤òµ¯¤³¤·¤¿¡£", m_name);
4932 msg_format("You have waked %s up.", m_name);
4934 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
4935 p_ptr->redraw |= (PR_UHEALTH);
4942 /* Make a "saving throw" against stun */
4943 if (rand_int(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
4949 /* Hack -- Recover from stun */
4950 if (m_ptr->stunned > d)
4952 /* Recover somewhat */
4953 m_ptr->stunned -= d;
4964 /* Acquire the monster name */
4965 monster_desc(m_name, m_ptr, 0);
4967 /* Dump a message */
4969 msg_format("%^s¤òÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
4971 msg_format("%^s is no longer stunned.", m_name);
4973 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
4974 p_ptr->redraw |= (PR_UHEALTH);
4978 if (m_ptr->confused)
4982 /* Make a "saving throw" against stun */
4983 if (rand_int(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
4986 d = m_ptr->confused;
4989 /* Hack -- Recover from stun */
4990 if (m_ptr->confused > d)
4992 /* Recover somewhat */
4993 m_ptr->confused -= d;
5002 m_ptr->confused = 0;
5004 /* Acquire the monster name */
5005 monster_desc(m_name, m_ptr, 0);
5007 /* Dump a message */
5009 msg_format("%^s¤òº®Íð¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5011 msg_format("%^s is no longer confused.", m_name);
5013 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5014 p_ptr->redraw |= (PR_UHEALTH);
5022 /* Make a "saving throw" against stun */
5023 if (rand_int(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
5029 /* Hack -- Recover from stun */
5030 if (m_ptr->monfear > d)
5032 /* Recover somewhat */
5033 m_ptr->monfear -= d;
5044 /* Acquire the monster name */
5045 monster_desc(m_name, m_ptr, 0);
5047 /* Dump a message */
5049 msg_format("%^s¤ò¶²Éݤ«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5051 msg_format("%^s is no longer fear.", m_name);
5053 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5054 p_ptr->redraw |= (PR_UHEALTH);
5061 /* Handle the player song */
5062 if (!load) check_music();
5067 if (p_ptr->lightspeed)
5069 (void)set_lightspeed(p_ptr->lightspeed - 1, TRUE);
5071 if ((p_ptr->pclass == CLASS_FORCETRAINER) && (p_ptr->magic_num1[0]))
5073 if (p_ptr->magic_num1[0] < 40)
5075 p_ptr->magic_num1[0] = 0;
5077 else p_ptr->magic_num1[0] -= 40;
5079 if (p_ptr->action == ACTION_LEARN)
5081 int hoge = ((p_ptr->msp * 0x10000L) / 256L)+7680L;
5082 if ((p_ptr->csp * 0x10000L + p_ptr->csp_frac) < hoge)
5085 p_ptr->csp_frac = 0;
5086 set_action(ACTION_NONE);
5090 p_ptr->csp -= (s16b)(hoge >> 16);
5092 if (p_ptr->csp_frac < hoge)
5094 p_ptr->csp_frac += 0x10000L - hoge;
5098 p_ptr->csp_frac -= hoge;
5100 p_ptr->redraw |= PR_MANA;
5103 if (p_ptr->special_defense & KATA_MASK)
5105 if (p_ptr->special_defense & KATA_MUSOU)
5109 set_action(ACTION_NONE);
5114 p_ptr->redraw |= (PR_MANA);
5119 /*** Handle actual user input ***/
5121 /* Repeat until out of energy */
5122 while (p_ptr->energy >= 100)
5124 p_ptr->window |= PW_PLAYER;
5125 p_ptr->sutemi = FALSE;
5126 p_ptr->counter = FALSE;
5127 now_damaged = FALSE;
5129 /* Notice stuff (if needed) */
5130 if (p_ptr->notice) notice_stuff();
5132 /* Update stuff (if needed) */
5133 if (p_ptr->update) update_stuff();
5135 /* Redraw stuff (if needed) */
5136 if (p_ptr->redraw) redraw_stuff();
5138 /* Redraw stuff (if needed) */
5139 if (p_ptr->window) window_stuff();
5142 /* Place the cursor on the player */
5143 move_cursor_relative(py, px);
5145 /* Refresh (optional) */
5146 if (fresh_before) Term_fresh();
5149 /* Hack -- Pack Overflow */
5150 if (inventory[INVEN_PACK].k_idx)
5152 int item = INVEN_PACK;
5154 char o_name[MAX_NLEN];
5158 /* Access the slot to be dropped */
5159 o_ptr = &inventory[item];
5166 msg_print("¥¶¥Ã¥¯¤«¤é¥¢¥¤¥Æ¥à¤¬¤¢¤Õ¤ì¤¿¡ª");
5168 msg_print("Your pack overflows!");
5173 object_desc(o_name, o_ptr, TRUE, 3);
5177 msg_format("%s(%c)¤òÍî¤È¤·¤¿¡£", o_name, index_to_label(item));
5179 msg_format("You drop %s (%c).", o_name, index_to_label(item));
5183 /* Drop it (carefully) near the player */
5184 (void)drop_near(o_ptr, 0, py, px);
5186 /* Modify, Describe, Optimize */
5187 inven_item_increase(item, -255);
5188 inven_item_describe(item);
5189 inven_item_optimize(item);
5191 /* Notice stuff (if needed) */
5192 if (p_ptr->notice) notice_stuff();
5194 /* Update stuff (if needed) */
5195 if (p_ptr->update) update_stuff();
5197 /* Redraw stuff (if needed) */
5198 if (p_ptr->redraw) redraw_stuff();
5200 /* Redraw stuff (if needed) */
5201 if (p_ptr->window) window_stuff();
5205 /* Hack -- cancel "lurking browse mode" */
5206 if (!command_new) command_see = FALSE;
5209 /* Assume free turn */
5213 if (p_ptr->inside_battle)
5215 /* Place the cursor on the player */
5216 move_cursor_relative(py, px);
5220 /* Process the command */
5224 /* Paralyzed or Knocked Out */
5225 else if (p_ptr->paralyzed || (p_ptr->stun >= 100))
5232 else if (p_ptr->action == ACTION_REST)
5237 /* Reduce rest count */
5240 if (!resting) set_action(ACTION_NONE);
5242 /* Redraw the state */
5243 p_ptr->redraw |= (PR_STATE);
5251 else if (p_ptr->action == ACTION_FISH)
5264 /* Repeated command */
5265 else if (command_rep)
5267 /* Count this execution */
5270 /* Redraw the state */
5271 p_ptr->redraw |= (PR_STATE);
5276 /* Hack -- Assume messages were seen */
5279 /* Clear the top line */
5282 /* Process the command */
5286 /* Normal command */
5289 /* Place the cursor on the player */
5290 move_cursor_relative(py, px);
5293 /* Get a command (normal) */
5294 request_command(FALSE);
5297 /* Process the command */
5307 /* Use some energy */
5308 p_ptr->energy -= energy_use;
5311 /* Hack -- constant hallucination */
5312 if (p_ptr->image) p_ptr->redraw |= (PR_MAP);
5315 /* Shimmer monsters if needed */
5316 if (shimmer_monsters)
5318 /* Clear the flag */
5319 shimmer_monsters = FALSE;
5321 /* Shimmer multi-hued monsters */
5322 for (i = 1; i < m_max; i++)
5324 monster_type *m_ptr;
5325 monster_race *r_ptr;
5327 /* Access monster */
5330 /* Skip dead monsters */
5331 if (!m_ptr->r_idx) continue;
5333 /* Access the monster race */
5334 r_ptr = &r_info[m_ptr->r_idx];
5336 /* Skip non-multi-hued monsters */
5337 if (!(r_ptr->flags1 & RF1_ATTR_MULTI)) continue;
5339 /* Reset the flag */
5340 shimmer_monsters = TRUE;
5342 /* Redraw regardless */
5343 lite_spot(m_ptr->fy, m_ptr->fx);
5348 /* Handle monster detection */
5349 if (repair_monsters)
5351 /* Reset the flag */
5352 repair_monsters = FALSE;
5354 /* Rotate detection flags */
5355 for (i = 1; i < m_max; i++)
5357 monster_type *m_ptr;
5359 /* Access monster */
5362 /* Skip dead monsters */
5363 if (!m_ptr->r_idx) continue;
5365 /* Nice monsters get mean */
5366 if (m_ptr->mflag & MFLAG_NICE)
5368 /* Nice monsters get mean */
5369 m_ptr->mflag &= ~(MFLAG_NICE);
5372 /* Handle memorized monsters */
5373 if (m_ptr->mflag & MFLAG_MARK)
5375 /* Maintain detection */
5376 if (m_ptr->mflag & MFLAG_SHOW)
5379 m_ptr->mflag &= ~(MFLAG_SHOW);
5381 /* Still need repairs */
5382 repair_monsters = TRUE;
5385 /* Remove detection */
5389 m_ptr->mflag &= ~(MFLAG_MARK);
5391 /* Assume invisible */
5394 /* Update the monster */
5395 update_mon(i, FALSE);
5397 if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH);
5398 if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH);
5400 /* Redraw regardless */
5401 lite_spot(m_ptr->fy, m_ptr->fx);
5406 if (p_ptr->pclass == CLASS_IMITATOR)
5408 if (mane_num > (p_ptr->lev > 44 ? 3 : p_ptr->lev > 29 ? 2 : 1))
5411 for (i = 0; i < mane_num; i++)
5413 mane_spell[i] = mane_spell[i+1];
5414 mane_dam[i] = mane_dam[i+1];
5418 p_ptr->redraw |= (PR_MANE);
5420 if (p_ptr->action == ACTION_LEARN)
5423 p_ptr->redraw |= (PR_STATE);
5426 if (world_player && (p_ptr->energy < 1000))
5429 p_ptr->redraw |= (PR_MAP);
5431 /* Update monsters */
5432 p_ptr->update |= (PU_MONSTERS);
5435 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5438 msg_print("¡Ö»þ¤ÏÆ°¤¤À¤¹¡Ä¡×");
5440 msg_print("You feel time flowing around you once more.");
5443 world_player = FALSE;
5450 /* Hack -- notice death */
5451 if (!alive || death)
5453 world_player = FALSE;
5457 /* Handle "leaving" */
5458 if (p_ptr->leaving) break;
5464 * Interact with the current dungeon level.
5466 * This function will not exit until the level is completed,
5467 * the user dies, or the game is terminated.
5469 static void dungeon(bool load_game)
5471 int quest_num = 0, i, num;
5473 /* Set the base level */
5474 base_level = dun_level;
5476 /* Reset various flags */
5480 p_ptr->leaving = FALSE;
5482 /* Reset the "command" vars */
5490 /* Cancel the target */
5494 ambush_flag = FALSE;
5496 /* Cancel the health bar */
5499 /* Check visual effects */
5500 shimmer_monsters = TRUE;
5501 shimmer_objects = TRUE;
5502 repair_monsters = TRUE;
5503 repair_objects = TRUE;
5509 /* Get index of current quest (if any) */
5510 quest_num = quest_number(dun_level);
5512 /* Inside a quest? */
5515 /* Mark the quest monster */
5516 r_info[quest[quest_num].r_idx].flags1 |= RF1_QUESTOR;
5519 /* Track maximum player level */
5520 if (p_ptr->max_plv < p_ptr->lev)
5522 p_ptr->max_plv = p_ptr->lev;
5526 /* Track maximum dungeon level (if not in quest -KMW-) */
5527 if ((max_dlv[dungeon_type] < dun_level) && !p_ptr->inside_quest)
5529 max_dlv[dungeon_type] = dun_level;
5530 if (record_maxdeapth) do_cmd_write_nikki(NIKKI_MAXDEAPTH, dun_level, NULL);
5533 /* No stairs down from Quest */
5534 if (quest_number(dun_level))
5536 create_down_stair = 0;
5539 /* Paranoia -- no stairs from town or wilderness */
5540 if (!dun_level) create_down_stair = create_up_stair = 0;
5542 /* Option -- no connected stairs */
5543 if (!dungeon_stair) create_down_stair = create_up_stair = 0;
5545 /* Option -- no up stairs */
5546 if (ironman_downward) create_down_stair = create_up_stair = 0;
5548 /* Make a stairway. */
5549 if (create_up_stair || create_down_stair)
5551 /* Place a stairway */
5552 if (cave_valid_bold(py, px))
5555 delete_object(py, px);
5558 if (create_down_stair)
5560 if (create_down_stair == 2) cave_set_feat(py, px, FEAT_MORE_MORE);
5561 else cave_set_feat(py, px, FEAT_MORE);
5565 if (create_up_stair == 2) cave_set_feat(py, px, FEAT_LESS_LESS);
5566 else cave_set_feat(py, px, FEAT_LESS);
5570 /* Cancel the stair request */
5571 create_down_stair = create_up_stair = 0;
5575 /* Verify the panel */
5578 /* Validate the panel */
5581 panel_bounds_center();
5589 /* Flush messages */
5593 /* Enter "xtra" mode */
5594 character_xtra = TRUE;
5597 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
5600 p_ptr->window |= (PW_MONSTER);
5602 /* Redraw dungeon */
5603 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY);
5606 p_ptr->redraw |= (PR_MAP);
5609 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5612 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
5614 /* Calculate torch radius */
5615 p_ptr->update |= (PU_TORCH);
5627 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_DISTANCE | PU_MON_LITE);
5628 p_ptr->update |= (PU_MONSTERS);/*¼«Ê¬¤Ç¸÷¤Ã¤Æ¤¤¤ë¥â¥ó¥¹¥¿¡¼¤Î°Ù */
5636 /* Leave "xtra" mode */
5637 character_xtra = FALSE;
5640 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
5642 /* Combine / Reorder the pack */
5643 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
5660 if (quest_number(dun_level) && ((quest_number(dun_level) < MIN_RANDOM_QUEST) && !(quest_number(dun_level) == QUEST_OBERON || quest_number(dun_level) == QUEST_SERPENT || !(quest[quest_number(dun_level)].flags & QUEST_FLAG_PRESET)))) do_cmd_feeling();
5662 if (p_ptr->inside_battle)
5666 p_ptr->energy = 100;
5673 msg_print("»î¹ç³«»Ï¡ª");
5675 msg_format("Ready..Fight!");
5681 if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] > MUSIC_DETECT))
5682 p_ptr->magic_num1[0] = MUSIC_DETECT;
5684 /* Hack -- notice death or departure */
5685 if (!alive || death) return;
5687 /* Print quest message if appropriate */
5688 if (!p_ptr->inside_quest && (dungeon_type == DUNGEON_ANGBAND))
5690 quest_discovery(random_quest_number(dun_level));
5691 p_ptr->inside_quest = random_quest_number(dun_level);
5693 if ((dun_level == d_info[dungeon_type].maxdepth) && d_info[dungeon_type].final_guardian)
5695 if (r_info[d_info[dungeon_type].final_guardian].max_num)
5697 msg_format("¤³¤Î³¬¤Ë¤Ï%s¤Î¼ç¤Ç¤¢¤ë%s¤¬À³¤ó¤Ç¤¤¤ë¡£",
5698 d_name+d_info[dungeon_type].name,
5699 r_name+r_info[d_info[dungeon_type].final_guardian].name);
5701 msg_format("%^s lives in this level as the keeper of %s.",
5702 r_name+r_info[d_info[dungeon_type].final_guardian].name,
5703 d_name+d_info[dungeon_type].name);
5707 /*** Process this dungeon level ***/
5709 /* Reset the monster generation level */
5710 monster_level = base_level;
5712 /* Reset the object generation level */
5713 object_level = base_level;
5717 if (p_ptr->energy < 100 && !p_ptr->inside_battle && (dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena)) p_ptr->energy = 100;
5718 /* Not leaving dungeon */
5719 p_ptr->leaving_dungeon = FALSE;
5724 int i, correct_inven_cnt = 0;
5726 /* Hack -- Compact the monster list occasionally */
5727 if ((m_cnt + 32 > max_m_idx) && !p_ptr->inside_battle) compact_monsters(64);
5729 /* Hack -- Compress the monster list occasionally */
5730 if ((m_cnt + 32 < m_max) && !p_ptr->inside_battle) compact_monsters(0);
5733 /* Hack -- Compact the object list occasionally */
5734 if (o_cnt + 32 > max_o_idx) compact_objects(64);
5736 /* Hack -- Compress the object list occasionally */
5737 if (o_cnt + 32 < o_max) compact_objects(0);
5740 /* Process the player */
5744 if (p_ptr->notice) notice_stuff();
5747 for (i = 0; i < INVEN_PACK; i++)
5749 object_type *j_ptr = &inventory[i];
5751 /* Skip non-objects */
5752 if (!j_ptr->k_idx) continue;
5754 correct_inven_cnt++;
5758 if (p_ptr->update) update_stuff();
5761 if (p_ptr->redraw) redraw_stuff();
5764 if (p_ptr->window) window_stuff();
5766 /* Hack -- Hilite the player */
5767 move_cursor_relative(py, px);
5769 /* Optional fresh */
5770 if (fresh_after) Term_fresh();
5772 /* Hack -- Notice death or departure */
5773 if (!alive || death) break;
5775 /* Process all of the monsters */
5779 if (p_ptr->notice) notice_stuff();
5782 if (p_ptr->update) update_stuff();
5785 if (p_ptr->redraw) redraw_stuff();
5788 if (p_ptr->window) window_stuff();
5790 /* Hack -- Hilite the player */
5791 move_cursor_relative(py, px);
5793 /* Optional fresh */
5794 if (fresh_after) Term_fresh();
5796 /* Hack -- Notice death or departure */
5797 if (!alive || death) break;
5800 /* Process the world */
5804 if (p_ptr->notice) notice_stuff();
5807 if (p_ptr->update) update_stuff();
5810 if (p_ptr->redraw) redraw_stuff();
5813 if (p_ptr->window) window_stuff();
5815 /* Hack -- Hilite the player */
5816 move_cursor_relative(py, px);
5818 /* Optional fresh */
5819 if (fresh_after) Term_fresh();
5821 /* Hack -- Notice death or departure */
5822 if (!alive || death) break;
5824 /* Handle "leaving" */
5825 if (p_ptr->leaving) break;
5827 /* Count game turns */
5829 if (!p_ptr->wild_mode || wild_regen) dungeon_turn++;
5830 else if (p_ptr->wild_mode && !(turn % ((MAX_HGT + MAX_WID) / 2))) dungeon_turn++;
5831 if (wild_regen) wild_regen--;
5834 /* Inside a quest and non-unique questor? */
5835 if (quest_num && !(r_info[quest[quest_num].r_idx].flags1 & RF1_UNIQUE))
5837 /* Un-mark the quest monster */
5838 r_info[quest[quest_num].r_idx].flags1 &= ~RF1_QUESTOR;
5844 COPY(&riding_mon, &m_list[p_ptr->riding], monster_type);
5848 riding_mon.r_idx = 0;
5850 for(num = 0; num < 20; num++)
5852 party_mon[num].r_idx = 0;
5854 for(i = m_max - 1, num = 0; (i >= 1 && num < 20); i--)
5856 monster_type *m_ptr = &m_list[i];
5858 if (!m_ptr->r_idx) continue;
5859 if (!is_pet(m_ptr)) continue;
5860 if (i == p_ptr->riding) continue;
5861 if (m_ptr->nickname && (player_has_los_bold(m_ptr->fy, m_ptr->fx) || los(m_ptr->fy, m_ptr->fx, py, px)))
5863 if (distance(py, px, m_ptr->fy, m_ptr->fx) > 3) continue;
5867 if (distance(py, px, m_ptr->fy, m_ptr->fx) > 1) continue;
5869 if (m_ptr->confused || m_ptr->stunned || m_ptr->csleep) continue;
5870 COPY(&party_mon[num], &m_list[i], monster_type);
5871 delete_monster_idx(i);
5874 if (record_named_pet)
5876 for (i = m_max - 1; i >=1; i--)
5878 monster_type *m_ptr = &m_list[i];
5881 if (!m_ptr->r_idx) continue;
5882 if (!is_pet(m_ptr)) continue;
5883 if (!m_ptr->nickname) continue;
5884 if (p_ptr->riding == i) continue;
5886 monster_desc(m_name, m_ptr, 0x88);
5887 do_cmd_write_nikki(NIKKI_NAMED_PET, 4, m_name);
5891 if (p_ptr->riding) p_ptr->riding = -1;
5898 * Load some "user pref files"
5900 * Modified by Arcum Dagsson to support
5901 * separate macro files for different realms.
5903 static void load_all_pref_files(void)
5907 /* Access the "race" pref file */
5908 sprintf(buf, "%s.prf", rp_ptr->title);
5910 /* Process that file */
5911 process_pref_file(buf);
5913 /* Access the "class" pref file */
5914 sprintf(buf, "%s.prf", cp_ptr->title);
5916 /* Process that file */
5917 process_pref_file(buf);
5919 /* Access the "character" pref file */
5920 sprintf(buf, "%s.prf", player_base);
5922 /* Process that file */
5923 process_pref_file(buf);
5926 sprintf(buf, "picktype-%s.prf", player_base);
5928 sprintf(buf, "pickpref-%s.prf", player_base);
5930 process_pickpref_file(buf);
5932 process_pickpref_file("picktype.prf");
5934 process_pickpref_file("pickpref.prf");
5937 /* Access the "realm 1" pref file */
5938 if (p_ptr->realm1 != REALM_NONE)
5940 sprintf(buf, "%s.prf", realm_names[p_ptr->realm1]);
5942 /* Process that file */
5943 process_pref_file(buf);
5946 /* Access the "realm 2" pref file */
5947 if (p_ptr->realm2 != REALM_NONE)
5949 sprintf(buf, "%s.prf", realm_names[p_ptr->realm2]);
5951 /* Process that file */
5952 process_pref_file(buf);
5958 * Actually play a game
5960 * If the "new_game" parameter is true, then, after loading the
5961 * savefile, we will commit suicide, if necessary, to allow the
5962 * player to start a new game.
5964 void play_game(bool new_game)
5967 bool load_game = TRUE;
5977 hack_mutation = FALSE;
5979 /* Hack -- Character is "icky" */
5980 character_icky = TRUE;
5982 /* Hack -- turn off the cursor */
5983 (void)Term_set_cursor(0);
5986 /* Attempt to load */
5991 quit("¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤¬²õ¤ì¤Æ¤¤¤Þ¤¹");
5993 quit("broken savefile");
5998 /* Extract the options */
5999 for (i = 0; option_info[i].o_desc; i++)
6001 int os = option_info[i].o_set;
6002 int ob = option_info[i].o_bit;
6004 /* Set the "default" options */
6005 if (option_info[i].o_var)
6008 if (option_flag[os] & (1L << ob))
6011 (*option_info[i].o_var) = TRUE;
6018 (*option_info[i].o_var) = FALSE;
6023 /* Report waited score */
6024 if (wait_report_score)
6030 if (!get_check("ÂÔµ¡¤·¤Æ¤¤¤¿¥¹¥³¥¢ÅÐÏ¿¤òº£¹Ô¤Ê¤¤¤Þ¤¹¤«¡©"))
6032 if (!get_check("Do you register score now? "))
6037 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
6044 start_time = time(NULL);
6046 /* No suspending now */
6047 signals_ignore_tstp();
6049 /* Hack -- Character is now "icky" */
6050 character_icky = TRUE;
6052 /* Build the filename */
6053 path_build(buf, 1024, ANGBAND_DIR_APEX, "scores.raw");
6055 /* Open the high score file, for reading/writing */
6056 highscore_fd = fd_open(buf, O_RDWR);
6058 /* Handle score, show Top scores */
6059 success = send_world_score(TRUE);
6062 if (!success && !get_check("¥¹¥³¥¢ÅÐÏ¿¤òÄü¤á¤Þ¤¹¤«¡©"))
6064 if (!success && !get_check("Do you give up score registration? "))
6068 prt("°ú¤Â³¤ÂÔµ¡¤·¤Þ¤¹¡£", 0, 0);
6070 prt("standing by for future registration...", 0, 0);
6076 wait_report_score = FALSE;
6079 if (!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
6081 if (!save_player()) msg_print("death save failed!");
6084 /* Shut the high score file */
6085 (void)fd_close(highscore_fd);
6087 /* Forget the high score fd */
6090 /* Allow suspending now */
6091 signals_handle_tstp();
6096 /* Nothing loaded */
6097 if (!character_loaded)
6099 /* Make new player */
6102 /* The dungeon is not ready */
6103 character_dungeon = FALSE;
6105 /* Prepare to init the RNG */
6109 /* Process old character */
6112 /* Process the player name */
6113 process_player_name(FALSE);
6122 seed = (time(NULL));
6126 /* Mutate the seed on Unix machines */
6127 seed = ((seed >> 3) * (getpid() << 1));
6131 /* Use the complex RNG */
6134 /* Seed the "complex" RNG */
6135 Rand_state_init(seed);
6138 /* Roll new character */
6141 monster_race *r_ptr;
6143 /* The dungeon is not ready */
6144 character_dungeon = FALSE;
6148 p_ptr->inside_quest = 0;
6149 p_ptr->inside_arena = FALSE;
6150 p_ptr->inside_battle = FALSE;
6154 /* Hack -- seed for flavors */
6155 seed_flavor = rand_int(0x10000000);
6157 /* Hack -- seed for town layout */
6158 seed_town = rand_int(0x10000000);
6160 /* Roll up a new character */
6167 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "ÊÕ¶¤ÎÃϤ˹ߤêΩ¤Ã¤¿¡£");
6169 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "You are standing in the Outpost.");
6173 get_mon_num_prep(NULL, NULL);
6174 for (i = 0; i < MAX_KUBI; i++)
6180 kubi_r_idx[i] = get_mon_num(MAX_DEPTH - 1);
6181 r_ptr = &r_info[kubi_r_idx[i]];
6183 if(!(r_ptr->flags1 & RF1_UNIQUE)) continue;
6185 if(!(r_ptr->flags9 & RF9_DROP_CORPSE)) continue;
6186 if (r_ptr->rarity > 100) continue;
6188 if(r_ptr->flags6 & RF6_SPECIAL) continue;
6190 for (j = 0; j < i; j++)
6191 if (kubi_r_idx[i] == kubi_r_idx[j])break;
6196 for (i = 0; i < MAX_KUBI -1; i++)
6199 for (j = i; j < MAX_KUBI; j++)
6201 if (r_info[kubi_r_idx[i]].level > r_info[kubi_r_idx[j]].level)
6203 tmp = kubi_r_idx[i];
6204 kubi_r_idx[i] = kubi_r_idx[j];
6205 kubi_r_idx[j] = tmp;
6210 p_ptr->inside_battle = TRUE;
6213 today_mon = get_mon_num(3);
6214 r_ptr = &r_info[today_mon];
6216 if (r_ptr->flags1 & RF1_UNIQUE) continue;
6217 if (r_ptr->flags2 & (RF2_MULTIPLY)) continue;
6218 if (!(r_ptr->flags9 & RF9_DROP_CORPSE) || !(r_ptr->flags9 & RF9_DROP_SKELETON)) continue;
6219 if (r_ptr->rarity > 10) continue;
6220 if (r_ptr->level == 0) continue;
6223 p_ptr->inside_battle = FALSE;
6227 write_level = FALSE;
6230 do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ----¥²¡¼¥àºÆ³«----");
6232 do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ---- Restart Game ----");
6238 for(i = m_max; i > 0; i--)
6240 if ((m_list[i].fy == py) && (m_list[i].fx == px))
6249 p_ptr->teleport_town = FALSE;
6250 p_ptr->sutemi = FALSE;
6251 world_monster = FALSE;
6252 now_damaged = FALSE;
6254 start_time = time(NULL);
6255 record_o_name[0] = '\0';
6257 /* Fill the arrays of floors and walls in the good proportions */
6258 for (i = 0; i < 100; i++)
6260 int lim1, lim2, lim3;
6262 lim1 = d_info[dungeon_type].floor_percent1;
6263 lim2 = lim1 + d_info[dungeon_type].floor_percent2;
6264 lim3 = lim2 + d_info[dungeon_type].floor_percent3;
6267 floor_type[i] = d_info[dungeon_type].floor1;
6269 floor_type[i] = d_info[dungeon_type].floor2;
6271 floor_type[i] = d_info[dungeon_type].floor3;
6273 lim1 = d_info[dungeon_type].fill_percent1;
6274 lim2 = lim1 + d_info[dungeon_type].fill_percent2;
6275 lim3 = lim2 + d_info[dungeon_type].fill_percent3;
6277 fill_type[i] = d_info[dungeon_type].fill_type1;
6279 fill_type[i] = d_info[dungeon_type].fill_type2;
6281 fill_type[i] = d_info[dungeon_type].fill_type3;
6284 /* Flavor the objects */
6293 /* Flash a message */
6295 prt("¤ªÂÔ¤Á²¼¤µ¤¤...", 0, 0);
6297 prt("Please wait...", 0, 0);
6301 /* Flush the message */
6305 /* Hack -- Enter wizard mode */
6306 if (arg_wizard && enter_wizard_mode()) wizard = TRUE;
6308 /* Initialize the town-buildings if necessary */
6309 if (!dun_level && !p_ptr->inside_quest)
6311 /* Init the wilderness */
6313 process_dungeon_file("w_info_j.txt", 0, 0, max_wild_y, max_wild_x);
6316 init_flags = INIT_ONLY_BUILDINGS;
6318 process_dungeon_file("t_info_j.txt", 0, 0, MAX_HGT, MAX_WID);
6323 /* Initialize vault info */
6325 if (init_v_info()) quit("·úÃÛʪ½é´ü²½ÉÔǽ");
6327 if (init_v_info()) quit("Cannot initialize vaults");
6330 /* Generate a dungeon level if needed */
6331 if (!character_dungeon) generate_cave();
6334 /* Character is now "complete" */
6335 character_generated = TRUE;
6338 /* Hack -- Character is no longer "icky" */
6339 character_icky = FALSE;
6345 /* Reset the visual mappings */
6348 /* Load the "pref" files */
6349 load_all_pref_files();
6351 /* React to changes */
6352 Term_xtra(TERM_XTRA_REACT, 0);
6355 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
6358 p_ptr->window |= (PW_MONSTER);
6364 /* Set or clear "rogue_like_commands" if requested */
6365 if (arg_force_original) rogue_like_commands = FALSE;
6366 if (arg_force_roguelike) rogue_like_commands = TRUE;
6368 /* Hack -- Enforce "delayed death" */
6369 if (p_ptr->chp < 0) death = TRUE;
6371 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
6373 if (new_game && ((p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BEASTMASTER)))
6375 monster_type *m_ptr;
6376 int pet_r_idx = ((p_ptr->pclass == CLASS_CAVALRY) ? MON_HORSE : MON_YASE_HORSE);
6377 monster_race *r_ptr = &r_info[pet_r_idx];
6378 place_monster_aux(py, px - 1, pet_r_idx,
6379 FALSE, FALSE, TRUE, TRUE, TRUE, FALSE);
6380 m_ptr = &m_list[hack_m_idx_ii];
6381 m_ptr->mspeed = r_ptr->speed;
6382 m_ptr->maxhp = r_ptr->hdice*(r_ptr->hside+1)/2;
6383 m_ptr->max_maxhp = m_ptr->maxhp;
6384 m_ptr->hp = r_ptr->hdice*(r_ptr->hside+1)/2;
6385 m_ptr->energy = -100;
6392 /* Save the current coordinates */
6393 s32b wild_y = p_ptr->wilderness_y;
6394 s32b wild_x = p_ptr->wilderness_x;
6395 s16b level = dun_level;
6398 enter_wilderness_callback(wild_y, wild_x);
6400 enter_level_callback(level);
6401 #endif /* USE_SCRIPT */
6403 /* Process the level */
6407 if (p_ptr->notice) notice_stuff();
6410 if (p_ptr->update) update_stuff();
6413 if (p_ptr->redraw) redraw_stuff();
6416 if (p_ptr->window) window_stuff();
6419 /* Cancel the target */
6422 /* Cancel the health bar */
6426 /* Forget the lite */
6429 /* Forget the view */
6432 /* Forget the view */
6435 /* Handle "quit and save" */
6436 if (!alive && !death) break;
6438 /* Erase the old cave */
6440 if (!death) wipe_m_list();
6450 leave_wilderness_callback(wild_y, wild_x);
6452 leave_level_callback(level);
6453 #endif /* USE_SCRIPT */
6455 /* Accidental Death */
6458 if (p_ptr->inside_arena)
6460 p_ptr->inside_arena = FALSE;
6461 if(p_ptr->arena_number > MAX_ARENA_MONS)
6462 p_ptr->arena_number++;
6464 p_ptr->arena_number = 99;
6467 p_ptr->chp_frac = 0;
6468 p_ptr->exit_bldg = TRUE;
6473 /* Mega-Hack -- Allow player to cheat death */
6475 if ((wizard || cheat_live) && !get_check("»à¤Ë¤Þ¤¹¤«? "))
6477 if ((wizard || cheat_live) && !get_check("Die? "))
6481 /* Mark social class, reset age, if needed */
6482 if (p_ptr->sc) p_ptr->sc = p_ptr->age = 0;
6492 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÇ°¤òÁ÷¤ê¡¢»à¤òµ½¤¤¤¿¡£");
6494 msg_print("You invoke wizard mode and cheat death.");
6500 /* Restore hit points */
6501 p_ptr->chp = p_ptr->mhp;
6502 p_ptr->chp_frac = 0;
6504 if (p_ptr->pclass == CLASS_MAGIC_EATER)
6506 for (i = 0; i < 72; i++)
6508 p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*0x10000;
6510 for (; i < 108; i++)
6512 p_ptr->magic_num1[i] = 0;
6515 /* Restore spell points */
6516 p_ptr->csp = p_ptr->msp;
6517 p_ptr->csp_frac = 0;
6519 /* Hack -- Healing */
6521 (void)set_confused(0);
6522 (void)set_poisoned(0);
6523 (void)set_afraid(0);
6524 (void)set_paralyzed(0);
6529 /* Hack -- Prevent starvation */
6530 (void)set_food(PY_FOOD_MAX - 1);
6532 /* Hack -- cancel recall */
6533 if (p_ptr->word_recall)
6537 msg_print("Ä¥¤ê¤Ä¤á¤¿Â絤¤¬Î®¤ìµî¤Ã¤¿...");
6539 msg_print("A tension leaves the air around you...");
6544 /* Hack -- Prevent recall */
6545 p_ptr->word_recall = 0;
6546 p_ptr->redraw |= (PR_STATUS);
6549 /* Note cause of death XXX XXX XXX */
6551 (void)strcpy(died_from, "»à¤Îµ½¤");
6553 (void)strcpy(died_from, "Cheating death");
6561 p_ptr->inside_arena = FALSE;
6562 p_ptr->inside_battle = FALSE;
6564 p_ptr->inside_quest = 0;
6565 p_ptr->recall_dungeon = dungeon_type;
6567 if (lite_town || vanilla_town)
6569 p_ptr->wilderness_y = 1;
6570 p_ptr->wilderness_x = 1;
6584 p_ptr->wilderness_y = 48;
6585 p_ptr->wilderness_x = 5;
6591 p_ptr->wild_mode = FALSE;
6592 p_ptr->leaving = TRUE;
6595 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " ¤·¤«¤·¡¢À¸¤Ê֤ä¿¡£");
6597 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " but revived.");
6603 /* Handle "death" */
6606 /* Make a new level */
6617 s32b turn_real(s32b hoge)
6619 if ((p_ptr->prace == RACE_VAMPIRE) ||
6620 (p_ptr->prace == RACE_SKELETON) ||
6621 (p_ptr->prace == RACE_ZOMBIE) ||
6622 (p_ptr->prace == RACE_SPECTRE))
6623 return hoge-(60L * TOWN_DAWN) / 4;