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_frac += 0x10000L;
899 p_ptr->csp -= (s16b)(new_mana >> 16); /* div 65536 */
900 new_mana_frac = p_ptr->csp_frac - (new_mana & 0xFFFF);
904 if (old_csp_msp) new_mana += ((((long)p_ptr->msp) * percent + PY_REGEN_MNBASE) * 32);
905 p_ptr->csp += (s16b)(new_mana >> 16); /* div 65536 */
907 new_mana_frac = (new_mana & 0xFFFF) + p_ptr->csp_frac; /* mod 65536 */
909 if (new_mana_frac >= 0x10000L)
911 p_ptr->csp_frac = (u16b)(new_mana_frac - 0x10000L);
916 p_ptr->csp_frac = (u16b)(new_mana_frac);
919 /* check for overflow */
926 /* Must set frac to zero even if equal */
927 if ((old_csp_msp && p_ptr->csp < p_ptr->msp) || (!old_csp_msp && p_ptr->csp >= p_ptr->msp))
929 p_ptr->csp = p_ptr->msp;
934 if (old_csp != p_ptr->csp)
937 p_ptr->redraw |= (PR_MANA);
940 p_ptr->window |= (PW_PLAYER);
941 p_ptr->window |= (PW_SPELL);
952 static void regenmagic(int percent)
957 for (i = 0; i < 72; i++)
959 if (!p_ptr->magic_num2[i]) continue;
960 if (p_ptr->magic_num1[i] == ((long)p_ptr->magic_num2[i] << 16)) continue;
961 new_mana = ((long)p_ptr->magic_num2[i]+adj_mag_mana[A_INT]+13) * percent / 8;
962 p_ptr->magic_num1[i] += new_mana;
964 /* Must set frac to zero even if equal */
965 if (p_ptr->magic_num1[i] > (p_ptr->magic_num2[i] << 16))
967 p_ptr->magic_num1[i] = ((long)p_ptr->magic_num2[i] << 16);
971 for (i = 72; i < 108; i++)
973 if (!p_ptr->magic_num1[i]) continue;
974 if (!p_ptr->magic_num2[i]) continue;
975 p_ptr->magic_num1[i] -= (long)(p_ptr->magic_num2[i] * (adj_mag_mana[A_INT] + 10)) * 0x1000;
976 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
987 * Regenerate the monsters (once per 100 game turns)
989 * XXX XXX XXX Should probably be done during monster turns.
991 static void regen_monsters(void)
996 /* Regenerate everyone */
997 for (i = 1; i < m_max; i++)
999 /* Check the i'th monster */
1000 monster_type *m_ptr = &m_list[i];
1001 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1004 /* Skip dead monsters */
1005 if (!m_ptr->r_idx) continue;
1007 /* Allow regeneration (if needed) */
1008 if (m_ptr->hp < m_ptr->maxhp)
1010 /* Hack -- Base regeneration */
1011 frac = m_ptr->maxhp / 100;
1013 /* Hack -- Minimal regeneration rate */
1014 if (!frac) if (randint(2) == 1) frac = 1;
1016 /* Hack -- Some monsters regenerate quickly */
1017 if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2;
1019 /* Hack -- Regenerate */
1022 /* Do not over-regenerate */
1023 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
1025 /* Redraw (later) if needed */
1026 if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH);
1027 if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH);
1034 * Regenerate the monsters (once per 100 game turns)
1036 * XXX XXX XXX Should probably be done during monster turns.
1038 static void regen_captured_monsters(void)
1043 /* Regenerate everyone */
1044 for (i = 0; i < INVEN_TOTAL; i++)
1046 monster_race *r_ptr;
1047 object_type *o_ptr = &inventory[i];
1049 if (!o_ptr->k_idx) continue;
1050 if (o_ptr->tval != TV_CAPTURE) continue;
1051 if (!o_ptr->pval) continue;
1055 r_ptr = &r_info[o_ptr->pval];
1057 /* Allow regeneration (if needed) */
1058 if (o_ptr->xtra4 < o_ptr->xtra5)
1060 /* Hack -- Base regeneration */
1061 frac = o_ptr->xtra5 / 100;
1063 /* Hack -- Minimal regeneration rate */
1064 if (!frac) if (randint(2) == 1) frac = 1;
1066 /* Hack -- Some monsters regenerate quickly */
1067 if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2;
1069 /* Hack -- Regenerate */
1070 o_ptr->xtra4 += frac;
1072 /* Do not over-regenerate */
1073 if (o_ptr->xtra4 > o_ptr->xtra5) o_ptr->xtra4 = o_ptr->xtra5;
1080 p_ptr->notice |= (PN_COMBINE);
1083 p_ptr->window |= (PW_INVEN);
1084 p_ptr->window |= (PW_EQUIP);
1090 static void notice_lite_change(object_type *o_ptr)
1092 /* Hack -- notice interesting fuel steps */
1093 if ((o_ptr->xtra4 < 100) || (!(o_ptr->xtra4 % 100)))
1096 p_ptr->window |= (PW_EQUIP);
1099 /* Hack -- Special treatment when blind */
1102 /* Hack -- save some light for later */
1103 if (o_ptr->xtra4 == 0) o_ptr->xtra4++;
1106 /* The light is now out */
1107 else if (o_ptr->xtra4 == 0)
1111 msg_print("ÌÀ¤«¤ê¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1113 msg_print("Your light has gone out!");
1115 p_ptr->update |= (PU_BONUS);
1118 /* The light is getting dim */
1119 else if (o_ptr->name2 == EGO_LITE_LONG)
1121 if ((o_ptr->xtra4 < 50) && (!(o_ptr->xtra4 % 5)) && (turn % 40))
1123 if (disturb_minor) disturb(0, 0);
1125 msg_print("ÌÀ¤«¤ê¤¬Èù¤«¤Ë¤Ê¤Ã¤Æ¤¤Æ¤¤¤ë¡£");
1127 msg_print("Your light is growing faint.");
1133 /* The light is getting dim */
1134 else if ((o_ptr->xtra4 < 100) && (!(o_ptr->xtra4 % 10)))
1136 if (disturb_minor) disturb(0, 0);
1138 msg_print("ÌÀ¤«¤ê¤¬Èù¤«¤Ë¤Ê¤Ã¤Æ¤¤Æ¤¤¤ë¡£");
1140 msg_print("Your light is growing faint.");
1148 * Forcibly pseudo-identify an object in the inventory
1151 * note: currently this function allows pseudo-id of any object,
1152 * including silly ones like potions & scrolls, which always
1153 * get '{average}'. This should be changed, either to stop such
1154 * items from being pseudo-id'd, or to allow psychometry to
1155 * detect whether the unidentified potion/scroll/etc is
1156 * good (Cure Light Wounds, Restore Strength, etc) or
1157 * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
1159 bool psychometry(void)
1163 char o_name[MAX_NLEN];
1168 item_tester_no_ryoute = TRUE;
1171 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«¡©";
1172 s = "Ä´¤Ù¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
1174 q = "Meditate on which item? ";
1175 s = "You have nothing appropriate.";
1178 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
1180 /* Get the item (in the pack) */
1183 o_ptr = &inventory[item];
1186 /* Get the item (on the floor) */
1189 o_ptr = &o_list[0 - item];
1192 /* It is fully known, no information needed */
1193 if (object_known_p(o_ptr))
1196 msg_print("²¿¤â¿·¤·¤¤¤³¤È¤ÏȽ¤é¤Ê¤«¤Ã¤¿¡£");
1198 msg_print("You cannot find out anything more about that.");
1204 /* Check for a feeling */
1205 feel = value_check_aux1(o_ptr);
1207 /* Get an object description */
1208 object_desc(o_name, o_ptr, FALSE, 0);
1210 /* Skip non-feelings */
1214 msg_format("%s¤«¤é¤ÏÆäËÊѤï¤Ã¤¿»ö¤Ï´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿¡£", o_name);
1216 msg_format("You do not perceive anything unusual about the %s.", o_name);
1223 msg_format("%s¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
1224 o_name, game_inscriptions[feel]);
1226 msg_format("You feel that the %s %s %s...",
1227 o_name, ((o_ptr->number == 1) ? "is" : "are"),
1228 game_inscriptions[feel]);
1232 /* We have "felt" it */
1233 o_ptr->ident |= (IDENT_SENSE);
1236 o_ptr->feeling = feel;
1238 /* Combine / Reorder the pack (later) */
1239 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1242 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1244 /* Something happened */
1249 static void gere_music(s16b music)
1257 stun_monsters(damroll(p_ptr->lev/10,2));
1260 hp_player(damroll(2,6));
1263 project_hack(GF_TURN_ALL, p_ptr->lev);
1266 project_hack(GF_PSI, randint(p_ptr->lev * 3 / 2));
1269 project(0, 1, py, px, 0, GF_IDENTIFY, PROJECT_ITEM, -1);
1272 confuse_monsters(p_ptr->lev * 2);
1275 project_hack(GF_SOUND, damroll(10 + p_ptr->lev/5,7));
1278 charm_monsters(damroll(10 + p_ptr->lev/15,6));
1281 project(0, 0, py, px,
1282 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
1285 dispel_monsters(randint(p_ptr->lev * 3));
1286 dispel_evil(randint(p_ptr->lev * 3));
1293 earthquake(py, px, 10);
1296 stasis_monsters(p_ptr->lev * 4);
1299 dispel_monsters(randint(p_ptr->lev * 3));
1302 hp_player(damroll(15,10));
1306 case MUSIC_DETECT+19:
1307 wiz_lite(FALSE, FALSE);
1308 case MUSIC_DETECT+11:
1309 case MUSIC_DETECT+12:
1310 case MUSIC_DETECT+13:
1311 case MUSIC_DETECT+14:
1312 case MUSIC_DETECT+15:
1313 case MUSIC_DETECT+16:
1314 case MUSIC_DETECT+17:
1315 case MUSIC_DETECT+18:
1316 map_area(DETECT_RAD_MAP);
1317 if ((p_ptr->lev > 39) && (music < MUSIC_DETECT+19)) p_ptr->magic_num1[0] = music+1;
1318 case MUSIC_DETECT+6:
1319 case MUSIC_DETECT+7:
1320 case MUSIC_DETECT+8:
1321 case MUSIC_DETECT+9:
1322 case MUSIC_DETECT+10:
1323 detect_treasure(DETECT_RAD_DEFAULT);
1324 detect_objects_gold(DETECT_RAD_DEFAULT);
1325 detect_objects_normal(DETECT_RAD_DEFAULT);
1326 if ((p_ptr->lev > 24) && (music < MUSIC_DETECT+11)) p_ptr->magic_num1[0] = music+1;
1327 case MUSIC_DETECT+3:
1328 case MUSIC_DETECT+4:
1329 case MUSIC_DETECT+5:
1330 detect_monsters_invis(DETECT_RAD_DEFAULT);
1331 detect_monsters_normal(DETECT_RAD_DEFAULT);
1332 if ((p_ptr->lev > 19) && (music < MUSIC_DETECT+6)) p_ptr->magic_num1[0] = music+1;
1334 case MUSIC_DETECT+1:
1335 case MUSIC_DETECT+2:
1336 detect_traps(DETECT_RAD_DEFAULT);
1337 detect_doors(DETECT_RAD_DEFAULT);
1338 detect_stairs(DETECT_RAD_DEFAULT);
1339 if ((p_ptr->lev > 14) && (music < MUSIC_DETECT+3)) p_ptr->magic_num1[0] = music+1;
1345 * If player has inscribed the object with "!!", let him know when it's
1348 static void recharged_notice(object_type *o_ptr)
1350 char o_name[MAX_NLEN];
1354 /* No inscription */
1355 if (!o_ptr->inscription) return;
1358 s = strchr(quark_str(o_ptr->inscription), '!');
1360 /* Process notification request. */
1363 /* Find another '!' */
1366 /* Describe (briefly) */
1367 object_desc(o_name, o_ptr, FALSE, 0);
1369 /* Notify the player */
1370 if (o_ptr->number > 1)
1372 msg_format("%s¤ÏºÆ½¼Å¶¤µ¤ì¤¿¡£", o_name);
1373 else msg_format("%s¤ÏºÆ½¼Å¶¤µ¤ì¤¿¡£", o_name);
1375 msg_format("Your %s are recharged.", o_name);
1376 else msg_format("Your %s is recharged.", o_name);
1384 /* Keep looking for '!'s */
1385 s = strchr(s + 1, '!');
1390 static void check_music()
1395 /* Music singed by player */
1396 if(p_ptr->pclass != CLASS_BARD) return;
1397 if(!p_ptr->magic_num1[0] && !p_ptr->magic_num1[1]) return;
1399 s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC - 1][p_ptr->magic_num2[0]];
1401 shouhimana = (s_ptr->smana*(3800-spell_exp[p_ptr->magic_num2[0]])+2399);
1404 else shouhimana *= 4;
1406 if(shouhimana < 1) shouhimana = 1;
1407 shouhimana *= 0x8000;
1408 if ((p_ptr->csp < shouhimana / 0x10000) || (p_ptr->anti_magic))
1415 p_ptr->csp -= shouhimana / 0x10000;
1416 shouhimana = (shouhimana % 0x10000);
1417 if (p_ptr->csp_frac < shouhimana)
1420 p_ptr->csp_frac += 0x10000;
1422 p_ptr->csp_frac -= shouhimana;
1424 p_ptr->redraw |= PR_MANA;
1425 if (p_ptr->magic_num1[1])
1427 p_ptr->magic_num1[0] = p_ptr->magic_num1[1];
1428 p_ptr->magic_num1[1] = 0;
1429 msg_print("²Î¤òºÆ³«¤·¤¿¡£");
1430 p_ptr->action = ACTION_SING;
1432 /* Recalculate bonuses */
1433 p_ptr->update |= (PU_BONUS | PU_HP);
1435 /* Redraw status bar */
1436 p_ptr->redraw |= (PR_STATUS);
1439 if (spell_exp[p_ptr->magic_num2[0]] < 900)
1440 spell_exp[p_ptr->magic_num2[0]]+=5;
1441 else if(spell_exp[p_ptr->magic_num2[0]] < 1200)
1442 {if (one_in_(2) && (dun_level > 4) && ((dun_level + 10) > p_ptr->lev)) spell_exp[p_ptr->magic_num2[0]]+=1;}
1443 else if(spell_exp[p_ptr->magic_num2[0]] < 1400)
1444 {if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel)) spell_exp[p_ptr->magic_num2[0]]+=1;}
1445 else if(spell_exp[p_ptr->magic_num2[0]] < 1600)
1446 {if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel)) spell_exp[p_ptr->magic_num2[0]]+=1;}
1448 gere_music(p_ptr->magic_num1[0]);
1452 * Handle certain things once every 10 game turns
1454 static void process_world(void)
1458 bool cave_no_regen = FALSE;
1459 int upkeep_factor = 0;
1462 u32b f1 = 0 , f2 = 0 , f3 = 0;
1465 const int dec_count = (easy_band ? 2 : 1);
1467 int hour, min, prev_min;
1468 s32b len = 20L * TOWN_DAWN;
1469 s32b tick = turn % len + len / 4;
1471 hour = (24 * tick / len) % 24;
1472 min = (1440 * tick / len) % 60;
1473 prev_min = (1440 * (tick - 20) / len) % 60;
1475 if ((turn - old_turn == (3000 - dun_level*20)) && (dun_level) &&
1476 !(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)))) &&
1477 !(p_ptr->inside_battle))
1480 if (p_ptr->inside_battle && !p_ptr->leaving)
1487 /* Count all hostile monsters */
1488 for (i2 = 0; i2 < cur_wid; ++i2)
1489 for (j2 = 0; j2 < cur_hgt; j2++)
1490 if ((cave[j2][i2].m_idx > 0) && (cave[j2][i2].m_idx != p_ptr->riding))
1493 win_m_idx = cave[j2][i2].m_idx;
1496 if (number_mon == 0)
1499 msg_print("ÁêÂǤÁ¤Ë½ª¤ï¤ê¤Þ¤·¤¿¡£");
1501 msg_print("They have kill each other at the same time.");
1504 p_ptr->energy = 100;
1507 else if ((number_mon-1) == 0)
1510 monster_type *wm_ptr;
1512 wm_ptr = &m_list[win_m_idx];
1514 monster_desc(m_name, wm_ptr, 0);
1516 msg_format("%s¤¬¾¡Íø¤·¤¿¡ª", m_name);
1518 msg_format("%s is winner!", m_name);
1522 if (win_m_idx == (sel_monster+1))
1525 msg_print("¤ª¤á¤Ç¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£");
1527 msg_print("Congratulations.");
1530 msg_format("%d¡ð¤ò¼õ¤±¼è¤Ã¤¿¡£", battle_odds);
1532 msg_format("You recieved %d gold.", battle_odds);
1534 p_ptr->au += battle_odds;
1539 msg_print("»ÄÇ°¤Ç¤·¤¿¡£");
1541 msg_print("You lost gold.");
1545 p_ptr->energy = 100;
1548 else if(turn - old_turn == 3000L)
1551 msg_print("¿½¤·Ê¬¤±¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤³¤Î¾¡Éé¤Ï°ú¤Ê¬¤±¤È¤µ¤»¤Æ¤¤¤¿¤À¤¤Þ¤¹¡£");
1553 msg_format("This battle have ended in a draw.");
1555 p_ptr->au += kakekin;
1557 p_ptr->energy = 100;
1562 /* Every 20 game turns */
1563 if (turn % 20) return;
1565 /*** Check the Time and Load ***/
1569 /* Check time and load */
1570 if ((0 != check_time()) || (0 != check_load()))
1573 if (closing_flag <= 2)
1578 /* Count warnings */
1583 msg_print("¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¸¤«¤«¤Ã¤Æ¤¤¤Þ¤¹...");
1584 msg_print("¥²¡¼¥à¤ò½ªÎ»¤¹¤ë¤«¥»¡¼¥Ö¤¹¤ë¤«¤·¤Æ²¼¤µ¤¤¡£");
1586 msg_print("The gates to ANGBAND are closing...");
1587 msg_print("Please finish up and/or save your game.");
1597 msg_print("º£¡¢¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¶¤µ¤ì¤Þ¤·¤¿¡£");
1599 msg_print("The gates to ANGBAND are now closed.");
1607 p_ptr->leaving = TRUE;
1612 /*** Attempt timed autosave ***/
1613 if (autosave_t && autosave_freq && !p_ptr->inside_battle)
1615 if (!(turn % ((s32b)autosave_freq * 20)))
1616 do_cmd_save_game(TRUE);
1622 msg_print("²¿¤«¤¬Ê¹¤³¤¨¤¿¡£");
1624 msg_print("You hear noise.");
1628 /*** Handle the wilderness/town (sunshine) ***/
1630 /* While in town/wilderness */
1631 if (!dun_level && !p_ptr->inside_quest && !p_ptr->inside_battle && !p_ptr->inside_arena && !p_ptr->wild_mode)
1633 /* Hack -- Daybreak/Nighfall in town */
1634 if (!(turn % ((20L * TOWN_DAWN) / 2)))
1638 /* Check for dawn */
1639 dawn = (!(turn % (20L * TOWN_DAWN)));
1646 msg_print("Ì뤬ÌÀ¤±¤¿¡£");
1648 msg_print("The sun has risen.");
1652 /* Hack -- Scan the town */
1653 for (y = 0; y < cur_hgt; y++)
1655 for (x = 0; x < cur_wid; x++)
1657 /* Get the cave grid */
1658 c_ptr = &cave[y][x];
1661 c_ptr->info |= (CAVE_GLOW);
1663 /* Hack -- Memorize lit grids if allowed */
1664 if (view_perma_grids) c_ptr->info |= (CAVE_MARK);
1666 /* Hack -- Notice spot */
1677 msg_print("Æü¤¬ÄÀ¤ó¤À¡£");
1679 msg_print("The sun has fallen.");
1683 /* Hack -- Scan the town */
1684 for (y = 0; y < cur_hgt; y++)
1686 for (x = 0; x < cur_wid; x++)
1688 /* Get the cave grid */
1689 c_ptr = &cave[y][x];
1691 /* Darken "boring" features */
1692 if ((c_ptr->feat <= FEAT_INVIS) ||
1693 ((c_ptr->feat >= FEAT_DEEP_WATER) &&
1694 (c_ptr->feat <= FEAT_TREES) &&
1695 (c_ptr->feat != FEAT_MUSEUM)))
1697 /* Forget the grid */
1698 c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK);
1700 /* Hack -- Notice spot */
1707 /* Update the monsters */
1708 p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
1711 p_ptr->redraw |= (PR_MAP);
1714 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1718 /* Set back the rewards once a day */
1719 if (!(turn % (200L * STORE_TURNS)))
1723 /* Reset the rewards */
1724 for (n = 0; n < MAX_BACT; n++)
1726 p_ptr->rewards[n] = FALSE;
1731 if (cheat_xtra) msg_print("Êó½·¤ò¥ê¥»¥Ã¥È");
1733 if (cheat_xtra) msg_print("Rewards reset.");
1739 /*** Process the monsters ***/
1741 /* Check for creature generation. */
1742 if ((rand_int(d_info[dungeon_type].max_m_alloc_chance) == 0) &&
1743 !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->inside_battle)
1745 /* Make a new monster */
1746 (void)alloc_monster(MAX_SIGHT + 5, FALSE);
1749 /* Hack -- Check for creature regeneration */
1750 if (!(turn % 200) && !p_ptr->inside_battle) regen_monsters();
1751 if (!(turn % 60)) regen_captured_monsters();
1754 /*** Damage over Time ***/
1756 /* Take damage from poison */
1757 if (p_ptr->poisoned && !p_ptr->invuln)
1761 take_hit(DAMAGE_NOESCAPE, 1, "ÆÇ", -1);
1763 take_hit(DAMAGE_NOESCAPE, 1, "poison", -1);
1769 /* (Vampires) Take damage from sunlight */
1770 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
1772 if (!dun_level && !p_ptr->resist_lite && !p_ptr->invuln &&
1773 (!((turn / ((20L * TOWN_DAWN) / 2)) % 2)))
1775 if (cave[py][px].info & CAVE_GLOW)
1779 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª");
1780 take_hit(DAMAGE_NOESCAPE, 1, "Æü¸÷", -1);
1782 msg_print("The sun's rays scorch your undead flesh!");
1783 take_hit(DAMAGE_NOESCAPE, 1, "sunlight", -1);
1786 cave_no_regen = TRUE;
1790 if (inventory[INVEN_LITE].tval && (inventory[INVEN_LITE].name2 != EGO_LITE_DARKNESS) &&
1791 !p_ptr->resist_lite)
1793 object_type * o_ptr = &inventory[INVEN_LITE];
1794 char o_name [MAX_NLEN];
1795 char ouch [MAX_NLEN+40];
1797 /* Get an object description */
1798 object_desc(o_name, o_ptr, FALSE, 0);
1801 msg_format("%s¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª", o_name);
1803 msg_format("The %s scorches your undead flesh!", o_name);
1807 cave_no_regen = TRUE;
1809 /* Get an object description */
1810 object_desc(o_name, o_ptr, TRUE, 0);
1813 sprintf(ouch, "%s¤òÁõÈ÷¤·¤¿¥À¥á¡¼¥¸", o_name);
1815 sprintf(ouch, "wielding %s", o_name);
1818 if (!p_ptr->invuln) take_hit(DAMAGE_NOESCAPE, 1, ouch, -1);
1822 if ((cave[py][px].feat == FEAT_SHAL_LAVA) &&
1823 !p_ptr->invuln && !p_ptr->immune_fire && !p_ptr->ffall)
1825 int damage = 3000 + rand_int(2000);
1827 if (prace_is_(RACE_ENT)) damage += damage/3;
1829 if (p_ptr->resist_fire) damage = damage / 3;
1830 if (p_ptr->oppose_fire) damage = damage / 3;
1831 damage = damage / 100 + (rand_int(100) < (damage % 100));
1837 msg_print("ÍÏ´ä¤Ç²Ð½ý¤·¤¿¡ª");
1838 take_hit(DAMAGE_NOESCAPE, damage, "Àõ¤¤ÍÏ´äή", -1);
1840 msg_print("The lava burns you!");
1841 take_hit(DAMAGE_NOESCAPE, damage, "shallow lava", -1);
1844 cave_no_regen = TRUE;
1848 else if ((cave[py][px].feat == FEAT_DEEP_LAVA) &&
1849 !p_ptr->invuln && !p_ptr->immune_fire)
1851 int damage = 6000 + rand_int(4000);
1856 if (p_ptr->resist_fire) damage = damage / 3;
1857 if (p_ptr->oppose_fire) damage = damage / 3;
1861 damage = damage / 5;
1864 message = "Ç®¤Ç²Ð½ý¤·¤¿¡ª";
1865 hit_from = "¿¼¤¤ÍÏ´äή¤Î¾å¤ËÉâÍ·¤·¤¿¥À¥á¡¼¥¸";
1867 message = "The heat burns you!";
1868 hit_from = "flying over deep lava";
1875 message = "ÍÏ´ä¤Ç²Ð½ý¤·¤¿¡ª";
1876 hit_from = "¿¼¤¤ÍÏ´äή";
1878 message = "The lava burns you!";
1879 hit_from = "deep lava";
1884 damage = damage / 100 + (rand_int(100) < (damage % 100));
1889 take_hit(DAMAGE_NOESCAPE, damage, hit_from, -1);
1891 cave_no_regen = TRUE;
1895 else if ((cave[py][px].feat == FEAT_DEEP_WATER) && !p_ptr->ffall && !p_ptr->can_swim)
1897 if (p_ptr->total_weight > ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2))
1901 msg_print("Å®¤ì¤Æ¤¤¤ë¡ª");
1902 take_hit(DAMAGE_NOESCAPE, randint(p_ptr->lev), "Å®¤ì", -1);
1904 msg_print("You are drowning!");
1905 take_hit(DAMAGE_NOESCAPE, randint(p_ptr->lev), "drowning", -1);
1908 cave_no_regen = TRUE;
1915 if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !p_ptr->immune_fire)
1917 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1918 if (prace_is_(RACE_ENT)) damage += damage/3;
1919 if (p_ptr->resist_fire) damage = damage / 3;
1920 if (p_ptr->oppose_fire) damage = damage / 3;
1922 msg_print("Ç®¤¤¡ª");
1923 take_hit(DAMAGE_NOESCAPE, damage, "±ê¤Î¥ª¡¼¥é", -1);
1925 msg_print("It's hot!");
1926 take_hit(DAMAGE_NOESCAPE, damage, "Fire aura", -1);
1929 if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !p_ptr->immune_elec)
1931 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1932 if (p_ptr->resist_elec) damage = damage / 3;
1933 if (p_ptr->oppose_elec) damage = damage / 3;
1935 msg_print("Äˤ¤¡ª");
1936 take_hit(DAMAGE_NOESCAPE, damage, "Åŵ¤¤Î¥ª¡¼¥é", -1);
1938 msg_print("It hurts!");
1939 take_hit(DAMAGE_NOESCAPE, damage, "Elec aura", -1);
1942 if ((r_info[m_list[p_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !p_ptr->immune_cold)
1944 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1945 if (p_ptr->resist_cold) damage = damage / 3;
1946 if (p_ptr->oppose_cold) damage = damage / 3;
1948 msg_print("Î䤿¤¤¡ª");
1949 take_hit(DAMAGE_NOESCAPE, damage, "Î䵤¤Î¥ª¡¼¥é", -1);
1951 msg_print("It's cold!");
1952 take_hit(DAMAGE_NOESCAPE, damage, "Cold aura", -1);
1957 /* Spectres -- take damage when moving through walls */
1959 * Added: ANYBODY takes damage if inside through walls
1960 * without wraith form -- NOTE: Spectres will never be
1961 * reduced below 0 hp by being inside a stone wall; others
1964 if (!cave_floor_bold(py, px))
1966 /* Player can walk through trees */
1967 if ((cave[py][px].feat == FEAT_TREES) || ((cave[py][px].feat == FEAT_MOUNTAIN) && !dun_level && p_ptr->ffall))
1971 else if (!p_ptr->invuln && !p_ptr->wraith_form && !p_ptr->kabenuke &&
1972 ((p_ptr->chp > (p_ptr->lev / 5)) || !p_ptr->pass_wall))
1976 cave_no_regen = TRUE;
1978 if (p_ptr->pass_wall)
1981 msg_print("ÂΤÎʬ»Ò¤¬Ê¬²ò¤·¤¿µ¤¤¬¤¹¤ë¡ª");
1984 msg_print("Your molecules feel disrupted!");
1985 dam_desc = "density";
1992 msg_print("Êø¤ì¤¿´ä¤Ë²¡¤·ÄÙ¤µ¤ì¤¿¡ª");
1993 dam_desc = "¹Å¤¤´ä";
1995 msg_print("You are being crushed!");
1996 dam_desc = "solid rock";
2001 take_hit(DAMAGE_NOESCAPE, 1 + (p_ptr->lev / 5), dam_desc, -1);
2007 monster_race *r_ptr;
2009 if (min != prev_min)
2012 bool old_inside_battle = p_ptr->inside_battle;
2014 do_cmd_write_nikki(NIKKI_HIGAWARI, 0, NULL);
2016 p_ptr->inside_battle = TRUE;
2017 get_mon_num_prep(NULL,NULL);
2019 for (i = 0; i < max_d_idx; i++)
2021 if (max_dlv[i] < d_info[i].mindepth) continue;
2022 if (max_dl < max_dlv[i]) max_dl = max_dlv[i];
2026 today_mon = get_mon_num(max_dl);
2027 r_ptr = &r_info[today_mon];
2029 if (r_ptr->flags1 & RF1_UNIQUE) continue;
2030 if (r_ptr->flags7 & (RF7_UNIQUE_7 | RF7_UNIQUE2)) continue;
2031 if (r_ptr->flags2 & (RF2_MULTIPLY)) continue;
2032 if (!(r_ptr->flags9 & RF9_DROP_CORPSE) || !(r_ptr->flags9 & RF9_DROP_SKELETON)) continue;
2033 if (r_ptr->level < MIN(max_dl/2, 40)) continue;
2034 if (r_ptr->rarity > 10) continue;
2035 if (r_ptr->level == 0) continue;
2038 p_ptr->today_mon = 0;
2039 p_ptr->inside_battle = old_inside_battle;
2043 /* Nightmare mode activates the TY_CURSE at midnight */
2044 if (ironman_nightmare)
2046 /* Require exact minute */
2047 if (min != prev_min)
2049 /* Every 15 minutes after 11:00 pm */
2050 if ((hour == 23) && !(min % 15))
2060 msg_print("±ó¤¯¤ÇÉÔµ¤Ì£¤Ê¾â¤Î²»¤¬ÌĤä¿¡£");
2062 msg_print("You hear a distant bell toll ominously.");
2070 msg_print("±ó¤¯¤Ç¾â¤¬Æó²óÌĤä¿¡£");
2072 msg_print("A distant bell sounds twice.");
2080 msg_print("±ó¤¯¤Ç¾â¤¬»°²óÌĤä¿¡£");
2082 msg_print("A distant bell sounds three times.");
2090 msg_print("±ó¤¯¤Ç¾â¤¬»Í²óÌĤä¿¡£");
2092 msg_print("A distant bell tolls four times.");
2100 /* TY_CURSE activates at mignight! */
2107 msg_print("±ó¤¯¤Ç¾â¤¬²¿²ó¤âÌĤꡢ»à¤ó¤À¤è¤¦¤ÊÀŤ±¤µ¤ÎÃæ¤Ø¾Ã¤¨¤Æ¤¤¤Ã¤¿¡£");
2109 msg_print("A distant bell tolls many times, fading into an deathly silence.");
2112 activate_ty_curse(FALSE, &count);
2117 /* Take damage from cuts */
2118 if (p_ptr->cut && !p_ptr->invuln)
2120 /* Mortal wound or Deep Gash */
2121 if (p_ptr->cut > 1000)
2126 else if (p_ptr->cut > 200)
2132 else if (p_ptr->cut > 100)
2137 else if (p_ptr->cut > 50)
2142 else if (p_ptr->cut > 25)
2147 else if (p_ptr->cut > 10)
2160 take_hit(DAMAGE_NOESCAPE, i, "Ã×Ì¿½ý", -1);
2162 take_hit(DAMAGE_NOESCAPE, i, "a fatal wound", -1);
2168 /*** Check the Food, and Regenerate ***/
2170 if (!p_ptr->inside_battle)
2172 /* Digest normally */
2173 if (p_ptr->food < PY_FOOD_MAX)
2175 /* Every 100 game turns */
2178 /* Basic digestion rate based on speed */
2179 i = /* extract_energy[p_ptr->pspeed] * 2;*/
2180 ((p_ptr->pspeed > 199) ? 49 : ((p_ptr->pspeed < 0) ?
2181 1 : extract_energy[p_ptr->pspeed]));
2183 /* Regeneration takes more food */
2184 if (p_ptr->regenerate) i += 20;
2185 if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK)) i+= 20;
2187 /* Slow digestion takes less food */
2188 if (p_ptr->slow_digest) i -= 5;
2190 /* Minimal digestion */
2193 /* Digest some food */
2194 (void)set_food(p_ptr->food - i);
2198 /* Digest quickly when gorged */
2201 /* Digest a lot of food */
2202 (void)set_food(p_ptr->food - 100);
2206 /* Starve to death (slowly) */
2207 if (p_ptr->food < PY_FOOD_STARVE)
2209 /* Calculate damage */
2210 i = (PY_FOOD_STARVE - p_ptr->food) / 10;
2214 if (!p_ptr->invuln) take_hit(DAMAGE_LOSELIFE, i, "¶õÊ¢", -1);
2216 if (!p_ptr->invuln) take_hit(DAMAGE_LOSELIFE, i, "starvation", -1);
2221 /* Default regeneration */
2222 regen_amount = PY_REGEN_NORMAL;
2225 if (p_ptr->food < PY_FOOD_WEAK)
2227 /* Lower regeneration */
2228 if (p_ptr->food < PY_FOOD_STARVE)
2232 else if (p_ptr->food < PY_FOOD_FAINT)
2234 regen_amount = PY_REGEN_FAINT;
2238 regen_amount = PY_REGEN_WEAK;
2242 if ((p_ptr->food < PY_FOOD_FAINT) && !p_ptr->inside_battle)
2244 /* Faint occasionally */
2245 if (!p_ptr->paralyzed && (rand_int(100) < 10))
2249 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤À䤷¤Æ¤·¤Þ¤Ã¤¿¡£");
2251 msg_print("You faint from the lack of food.");
2256 /* Hack -- faint (bypass free action) */
2257 (void)set_paralyzed(p_ptr->paralyzed + 1 + rand_int(5));
2263 /* Are we walking the pattern? */
2264 if (pattern_effect())
2266 cave_no_regen = TRUE;
2270 /* Regeneration ability */
2271 if (p_ptr->regenerate)
2273 regen_amount = regen_amount * 2;
2275 if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK))
2282 /* Searching or Resting */
2283 if ((p_ptr->action == ACTION_SEARCH) || (p_ptr->action == ACTION_REST))
2285 regen_amount = regen_amount * 2;
2288 upkeep_factor = calculate_upkeep();
2290 /* Regenerate the mana */
2291 /* if (p_ptr->csp < p_ptr->msp) */
2295 s32b upkeep_regen = ((100 - upkeep_factor) * regen_amount);
2296 if ((p_ptr->action == ACTION_LEARN) || (p_ptr->action == ACTION_HAYAGAKE)) upkeep_regen -= regen_amount;
2297 regenmana(upkeep_regen/100);
2299 #ifdef TRACK_FRIENDS
2303 msg_format("£Í£Ð²óÉü: %d/%d", upkeep_regen, regen_amount);
2305 msg_format("Regen: %d/%d", upkeep_regen, regen_amount);
2309 #endif /* TRACK_FRIENDS */
2312 else if (p_ptr->action != ACTION_LEARN)
2314 regenmana(regen_amount);
2317 if (p_ptr->pclass == CLASS_MAGIC_EATER)
2319 regenmagic(regen_amount);
2322 if ((p_ptr->csp == 0) && (p_ptr->csp_frac == 0))
2324 while (upkeep_factor > 100)
2327 msg_print("¤³¤ó¤Ê¤Ë¿¤¯¤Î¥Ú¥Ã¥È¤òÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
2329 msg_print("Such much pets cannot be controled at once!");
2331 do_cmd_pet_dismiss();
2333 upkeep_factor = calculate_upkeep();
2336 msg_format("°Ý»ý£Í£Ð¤Ï %d%%", upkeep_factor);
2338 msg_format("Upkeep: %d%% mana.", upkeep_factor);
2344 /* Poisoned or cut yields no healing */
2345 if (p_ptr->poisoned) regen_amount = 0;
2346 if (p_ptr->cut) regen_amount = 0;
2348 /* Special floor -- Pattern, in a wall -- yields no healing */
2349 if (cave_no_regen) regen_amount = 0;
2351 regen_amount = (regen_amount * mutant_regenerate_mod) / 100;
2353 /* Regenerate Hit Points if needed */
2354 if ((p_ptr->chp < p_ptr->mhp) && !cave_no_regen)
2356 if ((cave[py][px].feat < FEAT_PATTERN_END) &&
2357 (cave[py][px].feat >= FEAT_PATTERN_START))
2359 regenhp(regen_amount / 5); /* Hmmm. this should never happen? */
2363 regenhp(regen_amount);
2368 /*** Timeout Various Things ***/
2371 if (p_ptr->tim_mimic)
2373 (void)set_mimic(p_ptr->tim_mimic - 1, p_ptr->mimic_form, TRUE);
2376 /* Hack -- Hallucinating */
2379 (void)set_image(p_ptr->image - dec_count);
2385 (void)set_blind(p_ptr->blind - dec_count);
2388 /* Times see-invisible */
2389 if (p_ptr->tim_invis)
2391 (void)set_tim_invis(p_ptr->tim_invis - 1, TRUE);
2402 (void)set_tim_esp(p_ptr->tim_esp - 1, TRUE);
2405 /* Timed temporary elemental brands. -LM- */
2406 if (p_ptr->ele_attack)
2408 p_ptr->ele_attack--;
2410 /* Clear all temporary elemental brands. */
2411 if (!p_ptr->ele_attack) set_ele_attack(0, 0);
2414 /* Timed temporary elemental immune. -LM- */
2415 if (p_ptr->ele_immune)
2417 p_ptr->ele_immune--;
2419 /* Clear all temporary elemental brands. */
2420 if (!p_ptr->ele_immune) set_ele_immune(0, 0);
2423 /* Timed infra-vision */
2424 if (p_ptr->tim_infra)
2426 (void)set_tim_infra(p_ptr->tim_infra - 1, TRUE);
2430 if (p_ptr->tim_stealth)
2432 (void)set_tim_stealth(p_ptr->tim_stealth - 1, TRUE);
2435 /* Timed levitation */
2436 if (p_ptr->tim_ffall)
2438 (void)set_tim_ffall(p_ptr->tim_ffall - 1, TRUE);
2441 /* Timed sh_touki */
2442 if (p_ptr->tim_sh_touki)
2444 (void)set_tim_sh_touki(p_ptr->tim_sh_touki - 1, TRUE);
2448 if (p_ptr->tim_sh_fire)
2450 (void)set_tim_sh_fire(p_ptr->tim_sh_fire - 1, TRUE);
2453 /* Timed resist-magic */
2454 if (p_ptr->resist_magic)
2456 (void)set_resist_magic(p_ptr->resist_magic - 1, TRUE);
2459 /* Timed regeneration */
2460 if (p_ptr->tim_regen)
2462 (void)set_tim_regen(p_ptr->tim_regen - 1, TRUE);
2465 /* Timed resist nether */
2466 if (p_ptr->tim_res_nether)
2468 (void)set_tim_res_nether(p_ptr->tim_res_nether - 1, TRUE);
2471 /* Timed resist time */
2472 if (p_ptr->tim_res_time)
2474 (void)set_tim_res_time(p_ptr->tim_res_time - 1, TRUE);
2478 if (p_ptr->tim_reflect)
2480 (void)set_tim_reflect(p_ptr->tim_reflect - 1, TRUE);
2484 if (p_ptr->multishadow)
2486 (void)set_multishadow(p_ptr->multishadow - 1, TRUE);
2489 /* Timed Robe of dust */
2490 if (p_ptr->dustrobe)
2492 (void)set_dustrobe(p_ptr->dustrobe - 1, TRUE);
2495 /* Timed infra-vision */
2496 if (p_ptr->kabenuke)
2498 (void)set_kabenuke(p_ptr->kabenuke - 1, TRUE);
2502 if (p_ptr->paralyzed)
2504 (void)set_paralyzed(p_ptr->paralyzed - dec_count);
2508 if (p_ptr->confused)
2510 (void)set_confused(p_ptr->confused - dec_count);
2516 (void)set_afraid(p_ptr->afraid - dec_count);
2522 (void)set_fast(p_ptr->fast - 1, TRUE);
2528 (void)set_slow(p_ptr->slow - dec_count, TRUE);
2531 /* Protection from evil */
2532 if (p_ptr->protevil)
2534 (void)set_protevil(p_ptr->protevil - 1, TRUE);
2537 /* Invulnerability */
2540 (void)set_invuln(p_ptr->invuln - 1, TRUE);
2544 if (p_ptr->wraith_form)
2546 (void)set_wraith_form(p_ptr->wraith_form - 1, TRUE);
2552 (void)set_hero(p_ptr->hero - 1, TRUE);
2558 (void)set_shero(p_ptr->shero - 1, TRUE);
2564 (void)set_blessed(p_ptr->blessed - 1, TRUE);
2570 (void)set_shield(p_ptr->shield - 1, TRUE);
2574 if (p_ptr->tsubureru)
2576 (void)set_tsubureru(p_ptr->tsubureru - 1, TRUE);
2580 if (p_ptr->magicdef)
2582 (void)set_magicdef(p_ptr->magicdef - 1, TRUE);
2586 if (p_ptr->tsuyoshi)
2588 (void)set_tsuyoshi(p_ptr->tsuyoshi - 1, TRUE);
2592 if (p_ptr->oppose_acid)
2594 (void)set_oppose_acid(p_ptr->oppose_acid - 1, TRUE);
2597 /* Oppose Lightning */
2598 if (p_ptr->oppose_elec)
2600 (void)set_oppose_elec(p_ptr->oppose_elec - 1, TRUE);
2604 if (p_ptr->oppose_fire)
2606 (void)set_oppose_fire(p_ptr->oppose_fire - 1, TRUE);
2610 if (p_ptr->oppose_cold)
2612 (void)set_oppose_cold(p_ptr->oppose_cold - 1, TRUE);
2616 if (p_ptr->oppose_pois)
2618 (void)set_oppose_pois(p_ptr->oppose_pois - 1, TRUE);
2623 (void)set_ultimate_res(p_ptr->ult_res - 1, TRUE);
2626 /*** Poison and Stun and Cut ***/
2629 if (p_ptr->poisoned)
2631 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2633 /* Apply some healing */
2634 (void)set_poisoned(p_ptr->poisoned - adjust);
2640 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2642 /* Apply some healing */
2643 (void)set_stun(p_ptr->stun - adjust);
2649 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2651 /* Hack -- Truly "mortal" wound */
2652 if (p_ptr->cut > 1000) adjust = 0;
2654 /* Apply some healing */
2655 (void)set_cut(p_ptr->cut - adjust);
2660 /*** Process Light ***/
2662 /* Check for light being wielded */
2663 o_ptr = &inventory[INVEN_LITE];
2665 /* Burn some fuel in the current lite */
2666 if (o_ptr->tval == TV_LITE)
2668 /* Hack -- Use some fuel (except on artifacts) */
2669 if (!(artifact_p(o_ptr) || o_ptr->sval == SV_LITE_FEANOR) && (o_ptr->xtra4 > 0))
2671 /* Decrease life-span */
2672 if (o_ptr->name2 == EGO_LITE_LONG)
2674 if (turn % 40) o_ptr->xtra4--;
2676 else o_ptr->xtra4--;
2678 /* Notice interesting fuel steps */
2679 notice_lite_change(o_ptr);
2683 /* Calculate torch radius */
2684 p_ptr->update |= (PU_TORCH);
2687 /*** Process mutation effects ***/
2688 if (p_ptr->muta2 && !p_ptr->inside_battle && !p_ptr->wild_mode)
2690 if ((p_ptr->muta2 & MUT2_BERS_RAGE) && (randint(3000) == 1))
2694 msg_print("¥¦¥¬¥¡¥¡¥¢¡ª");
2695 msg_print("·ãÅܤÎȯºî¤Ë½±¤ï¤ì¤¿¡ª");
2697 msg_print("RAAAAGHH!");
2698 msg_print("You feel a fit of rage coming over you!");
2701 (void)set_shero(10 + randint(p_ptr->lev), FALSE);
2704 if ((p_ptr->muta2 & MUT2_COWARDICE) && (randint(3000) == 13))
2706 if (!(p_ptr->resist_fear || p_ptr->hero || p_ptr->shero))
2710 msg_print("¤È¤Æ¤â°Å¤¤... ¤È¤Æ¤â¶²¤¤¡ª");
2712 msg_print("It's so dark... so scary!");
2715 set_afraid(p_ptr->afraid + 13 + randint(26));
2719 if ((p_ptr->muta2 & MUT2_RTELEPORT) && (randint(5000) == 88))
2721 if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) &&
2726 /* Teleport player */
2728 msg_print("¤¢¤Ê¤¿¤Î°ÌÃÖ¤ÏÆÍÁ³¤Ò¤¸¤ç¤¦¤ËÉÔ³ÎÄê¤Ë¤Ê¤Ã¤¿...");
2730 msg_print("Your position suddenly seems very uncertain...");
2734 teleport_player(40);
2738 if ((p_ptr->muta2 & MUT2_ALCOHOL) && (randint(6400) == 321))
2740 if (!p_ptr->resist_conf && !p_ptr->resist_chaos)
2743 p_ptr->redraw |= PR_EXTRA;
2745 msg_print("¤¤¤Ò¤¤¬¤â¡¼¤í¡¼¤È¤Ò¤Æ¤¤¿¤¤¬¤Õ¤ë...¥Ò¥Ã¥¯¡ª");
2747 msg_print("You feel a SSSCHtupor cOmINg over yOu... *HIC*!");
2752 if (!p_ptr->resist_conf)
2754 (void)set_confused(p_ptr->confused + rand_int(20) + 15);
2757 if (!p_ptr->resist_chaos)
2762 if (one_in_(3)) lose_all_info();
2764 teleport_player(100);
2767 msg_print("¤¢¤Ê¤¿¤Ï¸«ÃΤé¤Ì¾ì½ê¤ÇÌܤ¬Àä᤿...Ƭ¤¬Äˤ¤¡£");
2768 msg_print("²¿¤â³Ð¤¨¤Æ¤¤¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ËÍ褿¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
2770 msg_print("You wake up somewhere with a sore head...");
2771 msg_print("You can't remember a thing, or how you got here!");
2780 msg_print("¤¡Á¤ì¤¤¤Ê¤Á¤ç¤ª¤Á¤ç¤é¤È¤ó¤ì¤¤¤ë¡Á");
2782 msg_print("Thishcischs GooDSChtuff!");
2785 (void)set_image(p_ptr->image + rand_int(150) + 150);
2791 if ((p_ptr->muta2 & MUT2_HALLU) && (randint(6400) == 42))
2793 if (!p_ptr->resist_chaos)
2796 p_ptr->redraw |= PR_EXTRA;
2797 (void)set_image(p_ptr->image + rand_int(50) + 20);
2801 if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint(3000) == 13))
2806 msg_print("¥Ö¥¥¡¼¡¼¥Ã¡ª¤ª¤Ã¤È¡£");
2808 msg_print("BRRAAAP! Oops.");
2812 fire_ball(GF_POIS, 0, p_ptr->lev, 3);
2815 if ((p_ptr->muta2 & MUT2_PROD_MANA) &&
2816 !p_ptr->anti_magic && (randint(9000) == 1))
2821 msg_print("ËâË¡¤Î¥¨¥Í¥ë¥®¡¼¤¬ÆÍÁ³¤¢¤Ê¤¿¤ÎÃæ¤Ëή¤ì¹þ¤ó¤Ç¤¤¿¡ª¥¨¥Í¥ë¥®¡¼¤ò²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡ª");
2823 msg_print("Magical energy flows through you! You must release it!");
2828 (void)get_hack_dir(&dire);
2829 fire_ball(GF_MANA, dire, p_ptr->lev * 2, 3);
2832 if ((p_ptr->muta2 & MUT2_ATT_DEMON) &&
2833 !p_ptr->anti_magic && (randint(6666) == 666))
2835 bool pet = (randint(6) == 1);
2837 if (summon_specific((pet ? -1 : 0), py, px,
2838 dun_level, SUMMON_DEMON, TRUE, FALSE, pet, !pet, !pet))
2841 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤ò°ú¤´ó¤»¤¿¡ª");
2843 msg_print("You have attracted a demon!");
2850 if ((p_ptr->muta2 & MUT2_SPEED_FLUX) && (randint(6000) == 1))
2853 if (randint(2) == 1)
2856 msg_print("ÀºÎÏŪ¤Ç¤Ê¤¯¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2858 msg_print("You feel less energetic.");
2861 if (p_ptr->fast > 0)
2867 set_slow(randint(30) + 10, FALSE);
2873 msg_print("ÀºÎÏŪ¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2875 msg_print("You feel more energetic.");
2878 if (p_ptr->slow > 0)
2884 set_fast(randint(30) + 10, FALSE);
2889 if ((p_ptr->muta2 & MUT2_BANISH_ALL) && (randint(9000) == 1))
2893 msg_print("ÆÍÁ³¤Û¤È¤ó¤É¸ÉÆȤˤʤ俵¤¤¬¤¹¤ë¡£");
2895 msg_print("You suddenly feel almost lonely.");
2898 banish_monsters(100);
2899 if (!dun_level && p_ptr->town_num)
2902 msg_print("Ź¤Î¼ç¿Í¤¬µÖ¤Ë¸þ¤«¤Ã¤ÆÁö¤Ã¤Æ¤¤¤ë¡ª");
2904 msg_print("You see one of the shopkeepers running for the hills!");
2907 store_shuffle(rand_int(MAX_STORES));
2912 if ((p_ptr->muta2 & MUT2_EAT_LIGHT) && one_in_(3000))
2917 msg_print("±Æ¤Ë¤Ä¤Ä¤Þ¤ì¤¿¡£");
2919 msg_print("A shadow passes over you.");
2924 /* Absorb light from the current possition */
2925 if (cave[py][px].info & CAVE_GLOW)
2930 o_ptr = &inventory[INVEN_LITE];
2932 /* Absorb some fuel in the current lite */
2933 if (o_ptr->tval == TV_LITE)
2935 /* Use some fuel (except on artifacts) */
2936 if (!artifact_p(o_ptr) && (o_ptr->xtra4 > 0))
2938 /* Heal the player a bit */
2939 hp_player(o_ptr->xtra4 / 20);
2941 /* Decrease life-span of lite */
2945 msg_print("¸÷¸»¤«¤é¥¨¥Í¥ë¥®¡¼¤òµÛ¼ý¤·¤¿¡ª");
2947 msg_print("You absorb energy from your light!");
2951 /* Notice interesting fuel steps */
2952 notice_lite_change(o_ptr);
2957 * Unlite the area (radius 10) around player and
2958 * do 50 points damage to every affected monster
2960 unlite_area(50, 10);
2963 if ((p_ptr->muta2 & MUT2_ATT_ANIMAL) &&
2964 !p_ptr->anti_magic && one_in_(7000))
2966 bool pet = (randint(3) == 1);
2968 if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_ANIMAL,
2969 TRUE, FALSE, pet, !pet, !pet))
2972 msg_print("ưʪ¤ò°ú¤´ó¤»¤¿¡ª");
2974 msg_print("You have attracted an animal!");
2981 if ((p_ptr->muta2 & MUT2_RAW_CHAOS) &&
2982 !p_ptr->anti_magic && one_in_(8000))
2986 msg_print("¼þ¤ê¤Î¶õ´Ö¤¬ÏĤó¤Ç¤¤¤ëµ¤¤¬¤¹¤ë¡ª");
2988 msg_print("You feel the world warping around you!");
2992 fire_ball(GF_CHAOS, 0, p_ptr->lev, 8);
2994 if ((p_ptr->muta2 & MUT2_NORMALITY) && one_in_(5000))
2996 if (!lose_mutation(0))
2998 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
3000 msg_print("You feel oddly normal.");
3004 if ((p_ptr->muta2 & MUT2_WRAITH) && !p_ptr->anti_magic && one_in_(3000))
3008 msg_print("Èóʪ¼Á²½¤·¤¿¡ª");
3010 msg_print("You feel insubstantial!");
3014 set_wraith_form(randint(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE);
3016 if ((p_ptr->muta2 & MUT2_POLY_WOUND) && one_in_(3000))
3020 if ((p_ptr->muta2 & MUT2_WASTING) && one_in_(3000))
3022 int which_stat = rand_int(6);
3023 int sustained = FALSE;
3028 if (p_ptr->sustain_str) sustained = TRUE;
3031 if (p_ptr->sustain_int) sustained = TRUE;
3034 if (p_ptr->sustain_wis) sustained = TRUE;
3037 if (p_ptr->sustain_dex) sustained = TRUE;
3040 if (p_ptr->sustain_con) sustained = TRUE;
3043 if (p_ptr->sustain_chr) sustained = TRUE;
3047 msg_print("ÉÔÀµ¤Ê¾õÂÖ¡ª");
3049 msg_print("Invalid stat chosen!");
3059 msg_print("¼«Ê¬¤¬¿ê¼å¤·¤Æ¤¤¤¯¤Î¤¬Ê¬¤«¤ë¡ª");
3061 msg_print("You can feel yourself wasting away!");
3065 (void)dec_stat(which_stat, randint(6) + 6, randint(3) == 1);
3068 if ((p_ptr->muta2 & MUT2_ATT_DRAGON) &&
3069 !p_ptr->anti_magic && one_in_(3000))
3071 bool pet = (randint(5) == 1);
3073 if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_DRAGON,
3074 TRUE, FALSE, pet, !pet, !pet))
3077 msg_print("¥É¥é¥´¥ó¤ò°ú¤´ó¤»¤¿¡ª");
3079 msg_print("You have attracted a dragon!");
3085 if ((p_ptr->muta2 & MUT2_WEIRD_MIND) && !p_ptr->anti_magic &&
3088 if (p_ptr->tim_esp > 0)
3091 msg_print("Àº¿À¤Ë¤â¤ä¤¬¤«¤«¤Ã¤¿¡ª");
3093 msg_print("Your mind feels cloudy!");
3096 set_tim_esp(0, TRUE);
3101 msg_print("Àº¿À¤¬¹¤¬¤Ã¤¿¡ª");
3103 msg_print("Your mind expands!");
3106 set_tim_esp(p_ptr->lev, FALSE);
3109 if ((p_ptr->muta2 & MUT2_NAUSEA) && !p_ptr->slow_digest &&
3114 msg_print("°ß¤¬áÛÚ»¤·¡¢¿©»ö¤ò¼º¤Ã¤¿¡ª");
3116 msg_print("Your stomach roils, and you lose your lunch!");
3120 set_food(PY_FOOD_WEAK);
3123 if ((p_ptr->muta2 & MUT2_WALK_SHAD) &&
3124 !p_ptr->anti_magic && one_in_(12000) && !p_ptr->inside_arena)
3129 if ((p_ptr->muta2 & MUT2_WARNING) && one_in_(1000))
3131 int danger_amount = 0;
3134 for (monster = 0; monster < m_max; monster++)
3136 monster_type *m_ptr = &m_list[monster];
3137 monster_race *r_ptr = &r_info[m_ptr->r_idx];
3139 /* Paranoia -- Skip dead monsters */
3140 if (!m_ptr->r_idx) continue;
3142 if (r_ptr->level >= p_ptr->lev)
3144 danger_amount += r_ptr->level - p_ptr->lev + 1;
3148 if (danger_amount > 100)
3150 msg_print("Èó¾ï¤Ë¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
3152 msg_print("You feel utterly terrified!");
3155 else if (danger_amount > 50)
3157 msg_print("¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
3159 msg_print("You feel terrified!");
3162 else if (danger_amount > 20)
3164 msg_print("Èó¾ï¤Ë¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
3166 msg_print("You feel very worried!");
3169 else if (danger_amount > 10)
3171 msg_print("¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
3173 msg_print("You feel paranoid!");
3176 else if (danger_amount > 5)
3178 msg_print("¤Û¤È¤ó¤É°ÂÁ´¤Êµ¤¤¬¤¹¤ë¡£");
3180 msg_print("You feel almost safe.");
3185 msg_print("¼ä¤·¤¤µ¤¤¬¤¹¤ë¡£");
3187 msg_print("You feel lonely.");
3191 if ((p_ptr->muta2 & MUT2_INVULN) && !p_ptr->anti_magic &&
3196 msg_print("̵Ũ¤Êµ¤¤¬¤¹¤ë¡ª");
3198 msg_print("You feel invincible!");
3202 (void)set_invuln(randint(8) + 8, FALSE);
3204 if ((p_ptr->muta2 & MUT2_SP_TO_HP) && one_in_(2000))
3206 int wounds = p_ptr->mhp - p_ptr->chp;
3210 int healing = p_ptr->csp;
3212 if (healing > wounds)
3218 p_ptr->csp -= healing;
3221 if ((p_ptr->muta2 & MUT2_HP_TO_SP) && !p_ptr->anti_magic &&
3224 int wounds = p_ptr->msp - p_ptr->csp;
3228 int healing = p_ptr->chp;
3230 if (healing > wounds)
3235 p_ptr->csp += healing;
3237 take_hit(DAMAGE_LOSELIFE, healing, "Ƭ¤Ë¾º¤Ã¤¿·ì", -1);
3239 take_hit(DAMAGE_LOSELIFE, healing, "blood rushing to the head", -1);
3244 if ((p_ptr->muta2 & MUT2_DISARM) && one_in_(10000))
3250 msg_print("¤¬¤â¤Ä¤ì¤Æž¤ó¤À¡ª");
3251 take_hit(DAMAGE_NOESCAPE, randint(p_ptr->wt / 6), "žÅÝ", -1);
3253 msg_print("You trip over your own feet!");
3254 take_hit(DAMAGE_NOESCAPE, randint(p_ptr->wt / 6), "tripping", -1);
3259 if (buki_motteruka(INVEN_RARM))
3261 int slot = INVEN_RARM;
3262 o_ptr = &inventory[INVEN_RARM];
3263 if (buki_motteruka(INVEN_LARM) && one_in_(2))
3265 o_ptr = &inventory[INVEN_LARM];
3268 if (!cursed_p(o_ptr))
3271 msg_print("Éð´ï¤òÍ¤Æ¤·¤Þ¤Ã¤¿¡ª");
3273 msg_print("You drop your weapon!");
3276 inven_drop(slot, 1);
3283 /*** Process Inventory ***/
3285 /* Handle experience draining */
3286 if (p_ptr->exp_drain)
3288 if (rand_int(100) < 25)
3290 p_ptr->exp -= (p_ptr->lev+1)/2;
3291 if (p_ptr->exp < 0) p_ptr->exp = 0;
3292 p_ptr->max_exp -= (p_ptr->lev+1)/2;
3293 if (p_ptr->max_exp < 0) p_ptr->max_exp = 0;
3298 /* Rarely, take damage from the Jewel of Judgement */
3299 if ((randint(999) == 1) && !p_ptr->anti_magic)
3301 if ((inventory[INVEN_LITE].tval) &&
3302 (inventory[INVEN_LITE].sval == SV_LITE_THRAIN))
3305 msg_print("¡Ø¿³È½¤ÎÊõÀС٤Ϥ¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª");
3306 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "¿³È½¤ÎÊõÀÐ", -1);
3308 msg_print("The Jewel of Judgement drains life from you!");
3309 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "the Jewel of Judgement", -1);
3316 /* Process equipment */
3317 for (j = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
3319 /* Get the object */
3320 o_ptr = &inventory[i];
3322 object_flags(o_ptr, &f1, &f2, &f3);
3324 /* Skip non-objects */
3325 if (!o_ptr->k_idx) continue;
3327 if (!p_ptr->inside_battle)
3330 if ((f3 & TR3_TY_CURSE) && (randint(TY_CURSE_CHANCE) == 1))
3334 (void)activate_ty_curse(FALSE, &count);
3337 /* Make a chainsword noise */
3338 if ((o_ptr->name1 == ART_CHAINSWORD) && randint(CHAINSWORD_NOISE) == 1)
3342 if (!get_rnd_line("chainswd_j.txt", 0, noise))
3344 if (!get_rnd_line("chainswd.txt", 0, noise))
3348 disturb(FALSE, FALSE);
3352 * Hack: Uncursed teleporting items (e.g. Trump Weapons)
3353 * can actually be useful!
3355 if ((f3 & TR3_TELEPORT) && (rand_int(100) < 1))
3357 if ((o_ptr->ident & IDENT_CURSED) && !p_ptr->anti_tele)
3361 /* Teleport player */
3362 teleport_player(40);
3366 if (p_ptr->wild_mode || (o_ptr->inscription &&
3367 (strchr(quark_str(o_ptr->inscription),'.'))))
3370 /* msg_print("Teleport aborted.") */ ;
3373 else if (get_check("¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©"))
3375 else if (get_check("Teleport? "))
3380 teleport_player(50);
3386 /* Recharge activatable objects */
3387 if (o_ptr->timeout > 0)
3392 /* Notice changes */
3393 if (!o_ptr->timeout)
3395 recharged_notice(o_ptr);
3401 /* Notice changes */
3405 p_ptr->window |= (PW_EQUIP);
3410 * Recharge rods. Rods now use timeout to control charging status,
3411 * and each charging rod in a stack decreases the stack's timeout by
3412 * one per turn. -LM-
3414 for (j = 0, i = 0; i < INVEN_PACK; i++)
3416 o_ptr = &inventory[i];
3417 k_ptr = &k_info[o_ptr->k_idx];
3419 /* Skip non-objects */
3420 if (!o_ptr->k_idx) continue;
3422 /* Examine all charging rods or stacks of charging rods. */
3423 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
3425 /* Determine how many rods are charging. */
3426 temp = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
3427 if (temp > o_ptr->number) temp = o_ptr->number;
3429 /* Decrease timeout by that number. */
3430 o_ptr->timeout -= temp;
3432 /* Boundary control. */
3433 if (o_ptr->timeout < 0) o_ptr->timeout = 0;
3435 /* Notice changes, provide message if object is inscribed. */
3436 if (!(o_ptr->timeout))
3438 recharged_notice(o_ptr);
3444 /* Notice changes */
3448 p_ptr->notice |= (PN_COMBINE);
3451 p_ptr->window |= (PW_INVEN);
3455 /* Feel the inventory */
3460 /*** Process Objects ***/
3462 /* Process objects */
3463 for (i = 1; i < o_max; i++)
3468 /* Skip dead objects */
3469 if (!o_ptr->k_idx) continue;
3471 /* Recharge rods on the ground. No messages. */
3472 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
3475 o_ptr->timeout -= o_ptr->number;
3477 /* Boundary control. */
3478 if (o_ptr->timeout < 0) o_ptr->timeout = 0;
3483 /*** Involuntary Movement ***/
3485 /* Delayed Word-of-Recall */
3486 if (p_ptr->word_recall)
3489 * HACK: Autosave BEFORE resetting the recall counter (rr9)
3490 * The player is yanked up/down as soon as
3491 * he loads the autosaved game.
3493 if (autosave_l && (p_ptr->word_recall == 1) && !p_ptr->inside_battle)
3494 do_cmd_save_game(TRUE);
3496 /* Count down towards recall */
3497 p_ptr->word_recall--;
3499 p_ptr->redraw |= (PR_STATUS);
3501 /* Activate the recall */
3502 if (!p_ptr->word_recall)
3507 /* Determine the level */
3508 if (dun_level || p_ptr->inside_quest)
3511 msg_print("¾å¤Ë°ú¤ÃÄ¥¤ê¤¢¤²¤é¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
3513 msg_print("You feel yourself yanked upwards!");
3516 p_ptr->recall_dungeon = dungeon_type;
3518 do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
3523 leaving_quest = p_ptr->inside_quest;
3525 /* Leaving an 'only once' quest marks it as failed */
3526 if (leaving_quest &&
3527 ((quest[leaving_quest].flags & QUEST_FLAG_ONCE) || (quest[leaving_quest].type == QUEST_TYPE_RANDOM)) &&
3528 (quest[leaving_quest].status == QUEST_STATUS_TAKEN))
3530 quest[leaving_quest].status = QUEST_STATUS_FAILED;
3531 quest[leaving_quest].complev = p_ptr->lev;
3532 if (quest[leaving_quest].type == QUEST_TYPE_RANDOM)
3534 r_info[quest[leaving_quest].r_idx].flags1 &= ~(RF1_QUESTOR);
3535 if (record_rand_quest)
3536 do_cmd_write_nikki(NIKKI_RAND_QUEST_F, leaving_quest, NULL);
3538 else if (record_fix_quest)
3539 do_cmd_write_nikki(NIKKI_FIX_QUEST_F, leaving_quest, NULL);
3542 p_ptr->inside_quest = 0;
3543 p_ptr->leaving = TRUE;
3548 msg_print("²¼¤Ë°ú¤¤º¤ê¹ß¤í¤µ¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
3550 msg_print("You feel yourself yanked downwards!");
3553 dungeon_type = p_ptr->recall_dungeon;
3556 do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
3559 dun_level = max_dlv[dungeon_type];
3560 if (dun_level < 1) dun_level = 1;
3562 /* Nightmare mode makes recall more dangerous */
3563 if (ironman_nightmare && !rand_int(666) && (dungeon_type == DUNGEON_ANGBAND))
3569 else if (dun_level < 99)
3571 dun_level = (dun_level + 99) / 2;
3573 else if (dun_level > 100)
3575 dun_level = d_info[dungeon_type].maxdepth - 1;
3579 if (p_ptr->wild_mode)
3581 p_ptr->wilderness_y = py;
3582 p_ptr->wilderness_x = px;
3586 /* Save player position */
3590 p_ptr->wild_mode = FALSE;
3593 p_ptr->leaving = TRUE;
3595 if (dungeon_type == DUNGEON_ANGBAND)
3597 for (i = MIN_RANDOM_QUEST; i < MAX_RANDOM_QUEST + 1; i++)
3599 if ((quest[i].type == QUEST_TYPE_RANDOM) &&
3600 (quest[i].status == QUEST_STATUS_TAKEN) &&
3601 (quest[i].level < dun_level))
3603 quest[i].status = QUEST_STATUS_FAILED;
3604 quest[i].complev = p_ptr->lev;
3605 r_info[quest[i].r_idx].flags1 &= ~(RF1_QUESTOR);
3612 sound(SOUND_TPLEVEL);
3620 * Verify use of "wizard" mode
3622 static bool enter_wizard_mode(void)
3624 /* Ask first time */
3627 /* Mention effects */
3629 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥â¡¼¥É¤Ç¤¹¡£ ");
3630 msg_print("°ìÅÙ¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ë¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3632 msg_print("Wizard mode is for debugging and experimenting.");
3633 msg_print("The game will not be scored if you enter wizard mode.");
3638 /* Verify request */
3640 if (!get_check("ËÜÅö¤Ë¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ê¤¿¤¤¤Î¤Ç¤¹¤«? "))
3642 if (!get_check("Are you sure you want to enter wizard mode? "))
3661 * Verify use of "debug" commands
3663 static bool enter_debug_mode(void)
3665 /* Ask first time */
3668 /* Mention effects */
3670 msg_print("¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ ");
3671 msg_print("¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3673 msg_print("The debug commands are for debugging and experimenting.");
3674 msg_print("The game will not be scored if you use debug commands.");
3679 /* Verify request */
3681 if (!get_check("ËÜÅö¤Ë¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? "))
3683 if (!get_check("Are you sure you want to use debug commands? "))
3691 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥Ç¥Ð¥Ã¥°¥â¡¼¥É¤ËÆÍÆþ¤·¤Æ¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
3693 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use debug commands.");
3704 * Hack -- Declare the Debug Routines
3706 extern void do_cmd_debug(void);
3708 #endif /* ALLOW_WIZARD */
3714 * Verify use of "borg" commands
3716 static bool enter_borg_mode(void)
3718 /* Ask first time */
3719 if (!(noscore & 0x0010))
3721 /* Mention effects */
3723 msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ ");
3724 msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3726 msg_print("The borg commands are for debugging and experimenting.");
3727 msg_print("The game will not be scored if you use borg commands.");
3732 /* Verify request */
3734 if (!get_check("ËÜÅö¤Ë¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? "))
3736 if (!get_check("Are you sure you want to use borg commands? "))
3752 * Hack -- Declare the Ben Borg
3754 extern void do_cmd_borg(void);
3756 #endif /* ALLOW_BORG */
3761 * Parse and execute the current command
3762 * Give "Warning" on illegal commands.
3764 * XXX XXX XXX Make some "blocks"
3766 static void process_command(void)
3768 int old_now_message = now_message;
3770 #ifdef ALLOW_REPEAT /* TNB */
3772 /* Handle repeating the last command */
3775 #endif /* ALLOW_REPEAT -- TNB */
3779 /* Parse the command */
3780 switch (command_cmd)
3795 /*** Wizard Commands ***/
3797 /* Toggle Wizard Mode */
3804 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É²ò½ü¡£");
3806 msg_print("Wizard mode off.");
3810 else if (enter_wizard_mode())
3814 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥ÉÆÍÆþ¡£");
3816 msg_print("Wizard mode on.");
3821 /* Update monsters */
3822 p_ptr->update |= (PU_MONSTERS);
3824 /* Redraw "title" */
3825 p_ptr->redraw |= (PR_TITLE);
3833 /* Special "debug" commands */
3836 /* Enter debug mode */
3837 if (enter_debug_mode())
3844 #endif /* ALLOW_WIZARD */
3849 /* Special "borg" commands */
3852 /* Enter borg mode */
3853 if (enter_borg_mode())
3855 if (!p_ptr->wild_mode) do_cmd_borg();
3861 #endif /* ALLOW_BORG */
3865 /*** Inventory Commands ***/
3867 /* Wear/wield equipment */
3870 if (!p_ptr->wild_mode) do_cmd_wield();
3874 /* Take off equipment */
3877 if (!p_ptr->wild_mode) do_cmd_takeoff();
3884 if (!p_ptr->wild_mode) do_cmd_drop();
3888 /* Destroy an item */
3895 /* Equipment list */
3902 /* Inventory list */
3910 /*** Various commands ***/
3912 /* Identify an object */
3919 /* Hack -- toggle windows */
3922 toggle_inven_equip();
3927 /*** Standard "Movement" Commands ***/
3932 if (!p_ptr->wild_mode) do_cmd_alter();
3939 if (!p_ptr->wild_mode) do_cmd_tunnel();
3943 /* Move (usually pick up things) */
3946 #ifdef ALLOW_EASY_DISARM /* TNB */
3950 #else /* ALLOW_EASY_DISARM -- TNB */
3952 do_cmd_walk(always_pickup);
3954 #endif /* ALLOW_EASY_DISARM -- TNB */
3959 /* Move (usually do not pick up) */
3962 #ifdef ALLOW_EASY_DISARM /* TNB */
3966 #else /* ALLOW_EASY_DISARM -- TNB */
3968 do_cmd_walk(!always_pickup);
3970 #endif /* ALLOW_EASY_DISARM -- TNB */
3976 /*** Running, Resting, Searching, Staying */
3978 /* Begin Running -- Arg is Max Distance */
3981 if (!p_ptr->wild_mode) do_cmd_run();
3985 /* Stay still (usually pick things up) */
3988 do_cmd_stay(always_pickup);
3992 /* Stay still (usually do not pick up) */
3995 do_cmd_stay(!always_pickup);
3999 /* Rest -- Arg is time */
4006 /* Search for traps/doors */
4013 /* Toggle search mode */
4016 if (p_ptr->action == ACTION_SEARCH) set_action(ACTION_NONE);
4017 else set_action(ACTION_SEARCH);
4022 /*** Stairs and Doors and Chests and Traps ***/
4027 if (!p_ptr->wild_mode) do_cmd_store();
4031 /* Enter building -KMW- */
4034 if (!p_ptr->wild_mode) do_cmd_bldg();
4038 /* Enter quest level -KMW- */
4041 if (!p_ptr->wild_mode) do_cmd_quest();
4045 /* Go up staircase */
4048 if(!p_ptr->wild_mode && !dun_level && !p_ptr->inside_arena && !p_ptr->inside_quest)
4055 msg_print("½±·â¤«¤éƨ¤²¤ë¤Ë¤Ï¥Þ¥Ã¥×¤Îü¤Þ¤Ç°ÜÆ°¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£");
4057 msg_print("To flee the ambush you have to reach the edge of the map.");
4060 else if (p_ptr->food < PY_FOOD_WEAK)
4063 msg_print("¤½¤ÎÁ°¤Ë¿©»ö¤ò¤È¤é¤Ê¤¤¤È¡£");
4065 msg_print("You must eat something here.");
4070 if (change_wild_mode())
4083 /* Go down staircase */
4086 if(!p_ptr->wild_mode) do_cmd_go_down();
4089 p_ptr->wilderness_x = px;
4090 p_ptr->wilderness_y = py;
4096 /* Open a door or chest */
4099 if (!p_ptr->wild_mode) do_cmd_open();
4106 if (!p_ptr->wild_mode) do_cmd_close();
4110 /* Jam a door with spikes */
4113 if (!p_ptr->wild_mode) do_cmd_spike();
4120 if (!p_ptr->wild_mode) do_cmd_bash();
4124 /* Disarm a trap or chest */
4127 if (!p_ptr->wild_mode) do_cmd_disarm();
4132 /*** Magic and Prayers ***/
4134 /* Gain new spells/prayers */
4137 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4139 msg_print("¼öʸ¤ò³Ø½¬¤¹¤ëɬÍפϤʤ¤¡ª");
4141 msg_print("You don't have to learn spells!");
4143 else if (p_ptr->pclass == CLASS_SAMURAI)
4144 do_cmd_gain_hissatsu();
4145 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4155 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
4156 (p_ptr->pclass == CLASS_BERSERKER) ||
4157 (p_ptr->pclass == CLASS_NINJA) ||
4158 (p_ptr->pclass == CLASS_MIRROR_MASTER)
4159 ) do_cmd_mind_browse();
4160 else if (p_ptr->pclass == CLASS_SMITH)
4162 else do_cmd_browse();
4170 if (!p_ptr->wild_mode)
4172 if (dun_level && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
4175 msg_print("¥À¥ó¥¸¥ç¥ó¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4177 msg_print("The arena absorbs all attempted magic!");
4182 else if (p_ptr->anti_magic && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
4185 cptr which_power = "ËâË¡";
4187 cptr which_power = "magic";
4190 if (p_ptr->pclass == CLASS_MINDCRAFTER)
4192 which_power = "ĶǽÎÏ";
4194 which_power = "psionic powers";
4197 else if (p_ptr->pclass == CLASS_IMITATOR)
4199 which_power = "¤â¤Î¤Þ¤Í";
4201 which_power = "mane";
4204 else if (p_ptr->pclass == CLASS_SAMURAI)
4206 which_power = "ɬ»¦·õ";
4208 which_power = "hissatsu";
4210 else if (p_ptr->pclass == CLASS_MIRROR_MASTER)
4212 which_power = "¶ÀËâË¡";
4214 which_power = "mirror magic";
4217 else if (p_ptr->pclass == CLASS_NINJA)
4219 which_power = "Ǧ½Ñ";
4221 which_power = "ninjutsu";
4224 else if (mp_ptr->spell_book == TV_LIFE_BOOK)
4226 which_power = "µ§¤ê";
4228 which_power = "prayer";
4233 msg_format("È¿ËâË¡¥Ð¥ê¥¢¤¬%s¤ò¼ÙË⤷¤¿¡ª", which_power);
4235 msg_format("An anti-magic shell disrupts your %s!", which_power);
4241 else if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER))
4244 msg_format("¶¸Àï»Î²½¤·¤Æ¤¤¤ÆƬ¤¬²ó¤é¤Ê¤¤¡ª");
4246 msg_format("You cannot think directly!");
4252 if ((p_ptr->pclass == CLASS_MINDCRAFTER) ||
4253 (p_ptr->pclass == CLASS_BERSERKER) ||
4254 (p_ptr->pclass == CLASS_NINJA) ||
4255 (p_ptr->pclass == CLASS_MIRROR_MASTER)
4258 else if (p_ptr->pclass == CLASS_IMITATOR)
4260 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4261 do_cmd_magic_eater();
4262 else if (p_ptr->pclass == CLASS_SAMURAI)
4264 else if (p_ptr->pclass == CLASS_BLUE_MAGE)
4265 do_cmd_cast_learned();
4266 else if (p_ptr->pclass == CLASS_SMITH)
4275 /* Issue a pet command */
4278 if (!p_ptr->wild_mode) do_cmd_pet();
4282 /*** Use various objects ***/
4284 /* Inscribe an object */
4291 /* Uninscribe an object */
4294 do_cmd_uninscribe();
4298 /* Activate an artifact */
4301 if (!p_ptr->wild_mode)
4303 if (!p_ptr->inside_arena)
4308 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4310 msg_print("The arena absorbs all attempted magic!");
4326 /* Fuel your lantern/torch */
4336 if (!p_ptr->wild_mode) do_cmd_fire();
4343 if (!p_ptr->wild_mode)
4345 if (!p_ptr->inside_arena)
4350 msg_print("¥¢¥ê¡¼¥Ê¤Ç¤Ï¥¢¥¤¥Æ¥à¤ò»È¤¨¤Ê¤¤¡ª");
4352 msg_print("You're in the arena now. This is hand-to-hand!");
4364 if (!p_ptr->wild_mode)
4366 if (!p_ptr->inside_arena)
4371 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4373 msg_print("The arena absorbs all attempted magic!");
4385 if (!p_ptr->wild_mode)
4387 if (p_ptr->inside_arena)
4390 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4392 msg_print("The arena absorbs all attempted magic!");
4397 else if (use_command && rogue_like_commands)
4409 /* Quaff a potion */
4412 if (!p_ptr->wild_mode)
4414 if (!p_ptr->inside_arena)
4415 do_cmd_quaff_potion();
4419 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4421 msg_print("The arena absorbs all attempted magic!");
4433 if (!p_ptr->wild_mode)
4435 if (!p_ptr->inside_arena)
4436 do_cmd_read_scroll();
4440 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4442 msg_print("The arena absorbs all attempted magic!");
4454 if (!p_ptr->wild_mode)
4456 if (p_ptr->inside_arena)
4459 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4461 msg_print("The arena absorbs all attempted magic!");
4466 else if (use_command && !rogue_like_commands)
4476 /* Use racial power */
4479 if (!p_ptr->wild_mode) do_cmd_racial_power();
4484 /*** Looking at Things (nearby or on map) ***/
4486 /* Full dungeon map */
4493 /* Locate player on map */
4507 /* Target monster or location */
4510 if (!p_ptr->wild_mode) do_cmd_target();
4516 /*** Help and Such ***/
4525 /* Identify symbol */
4528 do_cmd_query_symbol();
4532 /* Character description */
4535 do_cmd_change_name();
4540 /*** System Commands ***/
4542 /* Hack -- User interface */
4549 /* Single line from a pref file */
4562 /* Interact with macros */
4569 /* Interact with visuals */
4577 /* Interact with colors */
4585 /* Interact with options */
4593 /*** Misc Commands ***/
4609 /* Repeat level feeling */
4612 if (!p_ptr->wild_mode) do_cmd_feeling();
4616 /* Show previous message */
4619 do_cmd_message_one();
4623 /* Show previous messages */
4626 do_cmd_messages(old_now_message);
4630 /* Show quest status -KMW- */
4633 do_cmd_checkquest();
4637 /* Redraw the screen */
4640 now_message = old_now_message;
4645 #ifndef VERIFY_SAVEFILE
4647 /* Hack -- Save and don't quit */
4650 do_cmd_save_game(FALSE);
4654 #endif /* VERIFY_SAVEFILE */
4665 do_cmd_save_and_exit();
4669 /* Quit (commit suicide) */
4682 /* Check artifacts, uniques, objects */
4689 /* Load "screen dump" */
4692 do_cmd_load_screen();
4696 /* Save "screen dump" */
4699 do_cmd_save_screen();
4703 /* Make random artifact list */
4706 spoil_random_artifact("randifact.txt");
4710 /* Hack -- Unknown command */
4713 if (flush_failure) flush();
4714 if (randint(2) == 1)
4717 sound(SOUND_ILLEGAL);
4719 if (!get_rnd_line("error_j.txt", 0, error_m))
4721 if (!get_rnd_line("error.txt", 0, error_m))
4728 prt(" '?' ¤Ç¥Ø¥ë¥×¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£", 0, 0);
4730 prt("Type '?' for help.", 0, 0);
4736 if (!energy_use && !now_message)
4737 now_message = old_now_message;
4743 bool monster_tsuri(int r_idx)
4745 monster_race *r_ptr = &r_info[r_idx];
4747 if ((r_ptr->flags7 & RF7_AQUATIC) && !(r_ptr->flags1 & RF1_UNIQUE) && strchr("Jjlw", r_ptr->d_char))
4755 * Process the player
4757 * Notice the annoying code to handle "pack overflow", which
4758 * must come first just in case somebody manages to corrupt
4759 * the savefiles by clever use of menu commands or something.
4761 static void process_player(void)
4765 /*** Apply energy ***/
4770 msg_print("²¿¤«ÊѤï¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
4772 msg_print("You feel different!");
4775 (void)gain_random_mutation(0);
4776 hack_mutation = FALSE;
4779 if (p_ptr->inside_battle)
4781 for(i = 1; i < m_max; i++)
4783 monster_type *m_ptr = &m_list[i];
4785 if (!m_ptr->r_idx) continue;
4787 /* Hack -- Detect monster */
4788 m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
4790 /* Update the monster */
4791 update_mon(i, FALSE);
4796 /* Give the player some energy */
4797 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))
4798 p_ptr->energy += gain_energy();
4801 if (p_ptr->energy < 100) return;
4802 if (!command_rep) prt_time();
4804 /*** Check for interupts ***/
4806 /* Complete resting */
4813 if ((p_ptr->chp == p_ptr->mhp) &&
4814 (p_ptr->csp >= p_ptr->msp))
4817 set_action(ACTION_NONE);
4821 /* Complete resting */
4822 else if (resting == -2)
4825 if ((p_ptr->chp == p_ptr->mhp) &&
4826 (p_ptr->csp >= p_ptr->msp) &&
4827 !p_ptr->blind && !p_ptr->confused &&
4828 !p_ptr->poisoned && !p_ptr->afraid &&
4829 !p_ptr->stun && !p_ptr->cut &&
4830 !p_ptr->slow && !p_ptr->paralyzed &&
4831 !p_ptr->image && !p_ptr->word_recall)
4834 set_action(ACTION_NONE);
4839 if (p_ptr->action == ACTION_FISH)
4842 Term_xtra(TERM_XTRA_DELAY, 10);
4846 bool success = FALSE;
4847 get_mon_num_prep(monster_tsuri,NULL);
4848 r_idx = get_mon_num(dun_level ? dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level);
4850 if (r_idx && one_in_(2))
4853 y = py+ddy[tsuri_dir];
4854 x = px+ddx[tsuri_dir];
4855 if (place_monster_aux(y, x, r_idx, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE))
4858 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
4860 msg_format("%s¤¬Äà¤ì¤¿¡ª", m_name);
4862 msg_format("You have a good catch!", m_name);
4870 msg_print("±Â¤À¤±¿©¤ï¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª¤¯¤Ã¤½¡Á¡ª");
4872 msg_print("Damn! The fish took a bait away!");
4879 /* Handle "abort" */
4882 /* Check for "player abort" (semi-efficiently for resting) */
4883 if (running || command_rep || (p_ptr->action == ACTION_REST) || (p_ptr->action == ACTION_FISH))
4888 /* Check for a key */
4897 /* Hack -- Show a Message */
4899 msg_print("ÃæÃǤ·¤Þ¤·¤¿¡£");
4901 msg_print("Canceled.");
4908 if (p_ptr->riding && !p_ptr->confused && !p_ptr->blind)
4910 monster_type *m_ptr = &m_list[p_ptr->riding];
4919 /* Acquire the monster name */
4920 monster_desc(m_name, m_ptr, 0);
4922 msg_format("%^s¤òµ¯¤³¤·¤¿¡£", m_name);
4924 msg_format("You have waked %s up.", m_name);
4926 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
4927 p_ptr->redraw |= (PR_UHEALTH);
4934 /* Make a "saving throw" against stun */
4935 if (rand_int(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
4941 /* Hack -- Recover from stun */
4942 if (m_ptr->stunned > d)
4944 /* Recover somewhat */
4945 m_ptr->stunned -= d;
4956 /* Acquire the monster name */
4957 monster_desc(m_name, m_ptr, 0);
4959 /* Dump a message */
4961 msg_format("%^s¤òÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
4963 msg_format("%^s is no longer stunned.", m_name);
4965 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
4966 p_ptr->redraw |= (PR_UHEALTH);
4970 if (m_ptr->confused)
4974 /* Make a "saving throw" against stun */
4975 if (rand_int(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
4978 d = m_ptr->confused;
4981 /* Hack -- Recover from stun */
4982 if (m_ptr->confused > d)
4984 /* Recover somewhat */
4985 m_ptr->confused -= d;
4994 m_ptr->confused = 0;
4996 /* Acquire the monster name */
4997 monster_desc(m_name, m_ptr, 0);
4999 /* Dump a message */
5001 msg_format("%^s¤òº®Íð¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5003 msg_format("%^s is no longer confused.", m_name);
5005 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5006 p_ptr->redraw |= (PR_UHEALTH);
5014 /* Make a "saving throw" against stun */
5015 if (rand_int(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
5021 /* Hack -- Recover from stun */
5022 if (m_ptr->monfear > d)
5024 /* Recover somewhat */
5025 m_ptr->monfear -= d;
5036 /* Acquire the monster name */
5037 monster_desc(m_name, m_ptr, 0);
5039 /* Dump a message */
5041 msg_format("%^s¤ò¶²Éݤ«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5043 msg_format("%^s is no longer fear.", m_name);
5045 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5046 p_ptr->redraw |= (PR_UHEALTH);
5053 /* Handle the player song */
5054 if (!load) check_music();
5059 if (p_ptr->lightspeed)
5061 (void)set_lightspeed(p_ptr->lightspeed - 1, TRUE);
5063 if ((p_ptr->pclass == CLASS_FORCETRAINER) && (p_ptr->magic_num1[0]))
5065 if (p_ptr->magic_num1[0] < 40)
5067 p_ptr->magic_num1[0] = 0;
5069 else p_ptr->magic_num1[0] -= 40;
5071 if (p_ptr->action == ACTION_LEARN)
5073 int hoge = ((p_ptr->msp * 0x10000L) / 256L)+7680L;
5074 if ((p_ptr->csp * 0x10000L + p_ptr->csp_frac) < hoge)
5077 p_ptr->csp_frac = 0;
5078 set_action(ACTION_NONE);
5082 p_ptr->csp -= (hoge / 0x10000L);
5084 if (p_ptr->csp_frac < hoge)
5086 p_ptr->csp_frac += 0x10000L;
5089 p_ptr->csp_frac -= hoge;
5091 p_ptr->redraw |= PR_MANA;
5094 if (p_ptr->special_defense & KATA_MASK)
5096 if (p_ptr->special_defense & KATA_MUSOU)
5100 set_action(ACTION_NONE);
5105 p_ptr->redraw |= (PR_MANA);
5110 /*** Handle actual user input ***/
5112 /* Repeat until out of energy */
5113 while (p_ptr->energy >= 100)
5115 p_ptr->window |= PW_PLAYER;
5116 p_ptr->sutemi = FALSE;
5117 p_ptr->counter = FALSE;
5118 now_damaged = FALSE;
5120 /* Notice stuff (if needed) */
5121 if (p_ptr->notice) notice_stuff();
5123 /* Update stuff (if needed) */
5124 if (p_ptr->update) update_stuff();
5126 /* Redraw stuff (if needed) */
5127 if (p_ptr->redraw) redraw_stuff();
5129 /* Redraw stuff (if needed) */
5130 if (p_ptr->window) window_stuff();
5133 /* Place the cursor on the player */
5134 move_cursor_relative(py, px);
5136 /* Refresh (optional) */
5137 if (fresh_before) Term_fresh();
5140 /* Hack -- Pack Overflow */
5141 if (inventory[INVEN_PACK].k_idx)
5143 int item = INVEN_PACK;
5145 char o_name[MAX_NLEN];
5149 /* Access the slot to be dropped */
5150 o_ptr = &inventory[item];
5157 msg_print("¥¶¥Ã¥¯¤«¤é¥¢¥¤¥Æ¥à¤¬¤¢¤Õ¤ì¤¿¡ª");
5159 msg_print("Your pack overflows!");
5164 object_desc(o_name, o_ptr, TRUE, 3);
5168 msg_format("%s(%c)¤òÍî¤È¤·¤¿¡£", o_name, index_to_label(item));
5170 msg_format("You drop %s (%c).", o_name, index_to_label(item));
5174 /* Drop it (carefully) near the player */
5175 (void)drop_near(o_ptr, 0, py, px);
5177 /* Modify, Describe, Optimize */
5178 inven_item_increase(item, -255);
5179 inven_item_describe(item);
5180 inven_item_optimize(item);
5182 /* Notice stuff (if needed) */
5183 if (p_ptr->notice) notice_stuff();
5185 /* Update stuff (if needed) */
5186 if (p_ptr->update) update_stuff();
5188 /* Redraw stuff (if needed) */
5189 if (p_ptr->redraw) redraw_stuff();
5191 /* Redraw stuff (if needed) */
5192 if (p_ptr->window) window_stuff();
5196 /* Hack -- cancel "lurking browse mode" */
5197 if (!command_new) command_see = FALSE;
5200 /* Assume free turn */
5204 if (p_ptr->inside_battle)
5206 /* Place the cursor on the player */
5207 move_cursor_relative(py, px);
5211 /* Process the command */
5215 /* Paralyzed or Knocked Out */
5216 else if (p_ptr->paralyzed || (p_ptr->stun >= 100))
5223 else if (p_ptr->action == ACTION_REST)
5228 /* Reduce rest count */
5231 if (!resting) set_action(ACTION_NONE);
5233 /* Redraw the state */
5234 p_ptr->redraw |= (PR_STATE);
5242 else if (p_ptr->action == ACTION_FISH)
5255 /* Repeated command */
5256 else if (command_rep)
5258 /* Count this execution */
5261 /* Redraw the state */
5262 p_ptr->redraw |= (PR_STATE);
5267 /* Hack -- Assume messages were seen */
5270 /* Clear the top line */
5273 /* Process the command */
5277 /* Normal command */
5280 /* Place the cursor on the player */
5281 move_cursor_relative(py, px);
5284 /* Get a command (normal) */
5285 request_command(FALSE);
5288 /* Process the command */
5298 /* Use some energy */
5299 p_ptr->energy -= energy_use;
5302 /* Hack -- constant hallucination */
5303 if (p_ptr->image) p_ptr->redraw |= (PR_MAP);
5306 /* Shimmer monsters if needed */
5307 if (shimmer_monsters)
5309 /* Clear the flag */
5310 shimmer_monsters = FALSE;
5312 /* Shimmer multi-hued monsters */
5313 for (i = 1; i < m_max; i++)
5315 monster_type *m_ptr;
5316 monster_race *r_ptr;
5318 /* Access monster */
5321 /* Skip dead monsters */
5322 if (!m_ptr->r_idx) continue;
5324 /* Access the monster race */
5325 r_ptr = &r_info[m_ptr->r_idx];
5327 /* Skip non-multi-hued monsters */
5328 if (!(r_ptr->flags1 & RF1_ATTR_MULTI)) continue;
5330 /* Reset the flag */
5331 shimmer_monsters = TRUE;
5333 /* Redraw regardless */
5334 lite_spot(m_ptr->fy, m_ptr->fx);
5339 /* Handle monster detection */
5340 if (repair_monsters)
5342 /* Reset the flag */
5343 repair_monsters = FALSE;
5345 /* Rotate detection flags */
5346 for (i = 1; i < m_max; i++)
5348 monster_type *m_ptr;
5350 /* Access monster */
5353 /* Skip dead monsters */
5354 if (!m_ptr->r_idx) continue;
5356 /* Nice monsters get mean */
5357 if (m_ptr->mflag & MFLAG_NICE)
5359 /* Nice monsters get mean */
5360 m_ptr->mflag &= ~(MFLAG_NICE);
5363 /* Handle memorized monsters */
5364 if (m_ptr->mflag & MFLAG_MARK)
5366 /* Maintain detection */
5367 if (m_ptr->mflag & MFLAG_SHOW)
5370 m_ptr->mflag &= ~(MFLAG_SHOW);
5372 /* Still need repairs */
5373 repair_monsters = TRUE;
5376 /* Remove detection */
5380 m_ptr->mflag &= ~(MFLAG_MARK);
5382 /* Assume invisible */
5385 /* Update the monster */
5386 update_mon(i, FALSE);
5388 if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH);
5389 if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH);
5391 /* Redraw regardless */
5392 lite_spot(m_ptr->fy, m_ptr->fx);
5397 if (p_ptr->pclass == CLASS_IMITATOR)
5399 if (mane_num > (p_ptr->lev > 44 ? 3 : p_ptr->lev > 29 ? 2 : 1))
5402 for (i = 0; i < mane_num; i++)
5404 mane_spell[i] = mane_spell[i+1];
5405 mane_dam[i] = mane_dam[i+1];
5409 p_ptr->redraw |= (PR_MANE);
5411 if (p_ptr->action == ACTION_LEARN)
5414 p_ptr->redraw |= (PR_STATE);
5417 if (world_player && (p_ptr->energy < 1000))
5420 p_ptr->redraw |= (PR_MAP);
5422 /* Update monsters */
5423 p_ptr->update |= (PU_MONSTERS);
5426 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5429 msg_print("¡Ö»þ¤ÏÆ°¤¤À¤¹¡Ä¡×");
5431 msg_print("You feel time flowing around you once more.");
5434 world_player = FALSE;
5441 /* Hack -- notice death */
5442 if (!alive || death)
5444 world_player = FALSE;
5448 /* Handle "leaving" */
5449 if (p_ptr->leaving) break;
5455 * Interact with the current dungeon level.
5457 * This function will not exit until the level is completed,
5458 * the user dies, or the game is terminated.
5460 static void dungeon(bool load_game)
5462 int quest_num = 0, i, num;
5464 /* Set the base level */
5465 base_level = dun_level;
5467 /* Reset various flags */
5471 p_ptr->leaving = FALSE;
5473 /* Reset the "command" vars */
5481 /* Cancel the target */
5485 ambush_flag = FALSE;
5487 /* Cancel the health bar */
5490 /* Check visual effects */
5491 shimmer_monsters = TRUE;
5492 shimmer_objects = TRUE;
5493 repair_monsters = TRUE;
5494 repair_objects = TRUE;
5500 /* Get index of current quest (if any) */
5501 quest_num = quest_number(dun_level);
5503 /* Inside a quest? */
5506 /* Mark the quest monster */
5507 r_info[quest[quest_num].r_idx].flags1 |= RF1_QUESTOR;
5510 /* Track maximum player level */
5511 if (p_ptr->max_plv < p_ptr->lev)
5513 p_ptr->max_plv = p_ptr->lev;
5517 /* Track maximum dungeon level (if not in quest -KMW-) */
5518 if ((max_dlv[dungeon_type] < dun_level) && !p_ptr->inside_quest)
5520 max_dlv[dungeon_type] = dun_level;
5521 if (record_maxdeapth) do_cmd_write_nikki(NIKKI_MAXDEAPTH, dun_level, NULL);
5524 /* No stairs down from Quest */
5525 if (quest_number(dun_level))
5527 create_down_stair = 0;
5530 /* Paranoia -- no stairs from town or wilderness */
5531 if (!dun_level) create_down_stair = create_up_stair = 0;
5533 /* Option -- no connected stairs */
5534 if (!dungeon_stair) create_down_stair = create_up_stair = 0;
5536 /* Option -- no up stairs */
5537 if (ironman_downward) create_down_stair = create_up_stair = 0;
5539 /* Make a stairway. */
5540 if (create_up_stair || create_down_stair)
5542 /* Place a stairway */
5543 if (cave_valid_bold(py, px))
5546 delete_object(py, px);
5549 if (create_down_stair)
5551 if (create_down_stair == 2) cave_set_feat(py, px, FEAT_MORE_MORE);
5552 else cave_set_feat(py, px, FEAT_MORE);
5556 if (create_up_stair == 2) cave_set_feat(py, px, FEAT_LESS_LESS);
5557 else cave_set_feat(py, px, FEAT_LESS);
5561 /* Cancel the stair request */
5562 create_down_stair = create_up_stair = 0;
5566 /* Verify the panel */
5569 /* Validate the panel */
5572 panel_bounds_center();
5580 /* Flush messages */
5584 /* Enter "xtra" mode */
5585 character_xtra = TRUE;
5588 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
5591 p_ptr->window |= (PW_MONSTER);
5593 /* Redraw dungeon */
5594 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY);
5597 p_ptr->redraw |= (PR_MAP);
5600 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5603 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
5605 /* Calculate torch radius */
5606 p_ptr->update |= (PU_TORCH);
5618 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_DISTANCE | PU_MON_LITE);
5619 p_ptr->update |= (PU_MONSTERS);/*¼«Ê¬¤Ç¸÷¤Ã¤Æ¤¤¤ë¥â¥ó¥¹¥¿¡¼¤Î°Ù*/
5627 /* Leave "xtra" mode */
5628 character_xtra = FALSE;
5631 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
5633 /* Combine / Reorder the pack */
5634 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
5651 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();
5653 if (p_ptr->inside_battle)
5657 p_ptr->energy = 100;
5664 msg_print("»î¹ç³«»Ï¡ª");
5666 msg_format("Ready..Fight!");
5672 if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] > MUSIC_DETECT))
5673 p_ptr->magic_num1[0] = MUSIC_DETECT;
5675 /* Hack -- notice death or departure */
5676 if (!alive || death) return;
5678 /* Print quest message if appropriate */
5679 if (!p_ptr->inside_quest && (dungeon_type == DUNGEON_ANGBAND))
5681 quest_discovery(random_quest_number(dun_level));
5682 p_ptr->inside_quest = random_quest_number(dun_level);
5684 if ((dun_level == d_info[dungeon_type].maxdepth) && d_info[dungeon_type].final_guardian)
5686 if (r_info[d_info[dungeon_type].final_guardian].max_num)
5688 msg_format("¤³¤Î³¬¤Ë¤Ï%s¤Î¼ç¤Ç¤¢¤ë%s¤¬À³¤ó¤Ç¤¤¤ë¡£",
5689 d_name+d_info[dungeon_type].name,
5690 r_name+r_info[d_info[dungeon_type].final_guardian].name);
5692 msg_format("%^s lives in this level as the keeper of %s.",
5693 r_name+r_info[d_info[dungeon_type].final_guardian].name,
5694 d_name+d_info[dungeon_type].name);
5698 /*** Process this dungeon level ***/
5700 /* Reset the monster generation level */
5701 monster_level = base_level;
5703 /* Reset the object generation level */
5704 object_level = base_level;
5708 if (p_ptr->energy < 100 && !p_ptr->inside_battle && (dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena)) p_ptr->energy = 100;
5709 /* Not leaving dungeon */
5710 p_ptr->leaving_dungeon = FALSE;
5715 int i, correct_inven_cnt = 0;
5717 /* Hack -- Compact the monster list occasionally */
5718 if ((m_cnt + 32 > max_m_idx) && !p_ptr->inside_battle) compact_monsters(64);
5720 /* Hack -- Compress the monster list occasionally */
5721 if ((m_cnt + 32 < m_max) && !p_ptr->inside_battle) compact_monsters(0);
5724 /* Hack -- Compact the object list occasionally */
5725 if (o_cnt + 32 > max_o_idx) compact_objects(64);
5727 /* Hack -- Compress the object list occasionally */
5728 if (o_cnt + 32 < o_max) compact_objects(0);
5731 /* Process the player */
5735 if (p_ptr->notice) notice_stuff();
5738 for (i = 0; i < INVEN_PACK; i++)
5740 object_type *j_ptr = &inventory[i];
5742 /* Skip non-objects */
5743 if (!j_ptr->k_idx) continue;
5745 correct_inven_cnt++;
5749 if (p_ptr->update) update_stuff();
5752 if (p_ptr->redraw) redraw_stuff();
5755 if (p_ptr->window) window_stuff();
5757 /* Hack -- Hilite the player */
5758 move_cursor_relative(py, px);
5760 /* Optional fresh */
5761 if (fresh_after) Term_fresh();
5763 /* Hack -- Notice death or departure */
5764 if (!alive || death) break;
5766 /* Process all of the monsters */
5770 if (p_ptr->notice) notice_stuff();
5773 if (p_ptr->update) update_stuff();
5776 if (p_ptr->redraw) redraw_stuff();
5779 if (p_ptr->window) window_stuff();
5781 /* Hack -- Hilite the player */
5782 move_cursor_relative(py, px);
5784 /* Optional fresh */
5785 if (fresh_after) Term_fresh();
5787 /* Hack -- Notice death or departure */
5788 if (!alive || death) break;
5791 /* Process the world */
5795 if (p_ptr->notice) notice_stuff();
5798 if (p_ptr->update) update_stuff();
5801 if (p_ptr->redraw) redraw_stuff();
5804 if (p_ptr->window) window_stuff();
5806 /* Hack -- Hilite the player */
5807 move_cursor_relative(py, px);
5809 /* Optional fresh */
5810 if (fresh_after) Term_fresh();
5812 /* Hack -- Notice death or departure */
5813 if (!alive || death) break;
5815 /* Handle "leaving" */
5816 if (p_ptr->leaving) break;
5818 /* Count game turns */
5820 if (!p_ptr->wild_mode || wild_regen) dungeon_turn++;
5821 else if (p_ptr->wild_mode && !(turn % ((MAX_HGT + MAX_WID) / 2))) dungeon_turn++;
5822 if (wild_regen) wild_regen--;
5825 /* Inside a quest and non-unique questor? */
5826 if (quest_num && !(r_info[quest[quest_num].r_idx].flags1 & RF1_UNIQUE))
5828 /* Un-mark the quest monster */
5829 r_info[quest[quest_num].r_idx].flags1 &= ~RF1_QUESTOR;
5835 COPY(&riding_mon, &m_list[p_ptr->riding], monster_type);
5839 riding_mon.r_idx = 0;
5841 for(num = 0; num < 20; num++)
5843 party_mon[num].r_idx = 0;
5845 for(i = m_max - 1, num = 0; (i >= 1 && num < 20); i--)
5847 monster_type *m_ptr = &m_list[i];
5849 if (!m_ptr->r_idx) continue;
5850 if (!is_pet(m_ptr)) continue;
5851 if (i == p_ptr->riding) continue;
5852 if (m_ptr->nickname && (player_has_los_bold(m_ptr->fy, m_ptr->fx) || los(m_ptr->fy, m_ptr->fx, py, px)))
5854 if (distance(py, px, m_ptr->fy, m_ptr->fx) > 3) continue;
5858 if (distance(py, px, m_ptr->fy, m_ptr->fx) > 1) continue;
5860 if (m_ptr->confused || m_ptr->stunned || m_ptr->csleep) continue;
5861 COPY(&party_mon[num], &m_list[i], monster_type);
5862 delete_monster_idx(i);
5865 if (record_named_pet)
5867 for (i = m_max - 1; i >=1; i--)
5869 monster_type *m_ptr = &m_list[i];
5872 if (!m_ptr->r_idx) continue;
5873 if (!is_pet(m_ptr)) continue;
5874 if (!m_ptr->nickname) continue;
5875 if (p_ptr->riding == i) continue;
5877 monster_desc(m_name, m_ptr, 0x88);
5878 do_cmd_write_nikki(NIKKI_NAMED_PET, 4, m_name);
5882 if (p_ptr->riding) p_ptr->riding = -1;
5889 * Load some "user pref files"
5891 * Modified by Arcum Dagsson to support
5892 * separate macro files for different realms.
5894 static void load_all_pref_files(void)
5898 /* Access the "race" pref file */
5899 sprintf(buf, "%s.prf", rp_ptr->title);
5901 /* Process that file */
5902 process_pref_file(buf);
5904 /* Access the "class" pref file */
5905 sprintf(buf, "%s.prf", cp_ptr->title);
5907 /* Process that file */
5908 process_pref_file(buf);
5910 /* Access the "character" pref file */
5911 sprintf(buf, "%s.prf", player_base);
5913 /* Process that file */
5914 process_pref_file(buf);
5917 sprintf(buf, "picktype-%s.prf", player_base);
5919 sprintf(buf, "pickpref-%s.prf", player_base);
5921 process_pickpref_file(buf);
5923 process_pickpref_file("picktype.prf");
5925 process_pickpref_file("pickpref.prf");
5928 /* Access the "realm 1" pref file */
5929 if (p_ptr->realm1 != REALM_NONE)
5931 sprintf(buf, "%s.prf", realm_names[p_ptr->realm1]);
5933 /* Process that file */
5934 process_pref_file(buf);
5937 /* Access the "realm 2" pref file */
5938 if (p_ptr->realm2 != REALM_NONE)
5940 sprintf(buf, "%s.prf", realm_names[p_ptr->realm2]);
5942 /* Process that file */
5943 process_pref_file(buf);
5949 * Actually play a game
5951 * If the "new_game" parameter is true, then, after loading the
5952 * savefile, we will commit suicide, if necessary, to allow the
5953 * player to start a new game.
5955 void play_game(bool new_game)
5958 bool load_game = TRUE;
5968 hack_mutation = FALSE;
5970 /* Hack -- Character is "icky" */
5971 character_icky = TRUE;
5973 /* Hack -- turn off the cursor */
5974 (void)Term_set_cursor(0);
5977 /* Attempt to load */
5982 quit("¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤¬²õ¤ì¤Æ¤¤¤Þ¤¹");
5984 quit("broken savefile");
5989 /* Extract the options */
5990 for (i = 0; option_info[i].o_desc; i++)
5992 int os = option_info[i].o_set;
5993 int ob = option_info[i].o_bit;
5995 /* Set the "default" options */
5996 if (option_info[i].o_var)
5999 if (option_flag[os] & (1L << ob))
6002 (*option_info[i].o_var) = TRUE;
6009 (*option_info[i].o_var) = FALSE;
6014 /* Report waited score */
6015 if (wait_report_score)
6021 if (!get_check("ÂÔµ¡¤·¤Æ¤¤¤¿¥¹¥³¥¢ÅÐÏ¿¤òº£¹Ô¤Ê¤¤¤Þ¤¹¤«¡©"))
6023 if (!get_check("Do you register score now? "))
6028 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
6035 start_time = time(NULL);
6037 /* No suspending now */
6038 signals_ignore_tstp();
6040 /* Hack -- Character is now "icky" */
6041 character_icky = TRUE;
6043 /* Build the filename */
6044 path_build(buf, 1024, ANGBAND_DIR_APEX, "scores.raw");
6046 /* Open the high score file, for reading/writing */
6047 highscore_fd = fd_open(buf, O_RDWR);
6049 /* Handle score, show Top scores */
6050 success = send_world_score(TRUE);
6053 if (!success && !get_check("¥¹¥³¥¢ÅÐÏ¿¤òÄü¤á¤Þ¤¹¤«¡©"))
6055 if (!success && !get_check("Do you give up score registration? "))
6059 prt("°ú¤Â³¤ÂÔµ¡¤·¤Þ¤¹¡£", 0, 0);
6061 prt("standing by for future registration...", 0, 0);
6067 wait_report_score = FALSE;
6070 if (!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
6072 if (!save_player()) msg_print("death save failed!");
6075 /* Shut the high score file */
6076 (void)fd_close(highscore_fd);
6078 /* Forget the high score fd */
6081 /* Allow suspending now */
6082 signals_handle_tstp();
6087 /* Nothing loaded */
6088 if (!character_loaded)
6090 /* Make new player */
6093 /* The dungeon is not ready */
6094 character_dungeon = FALSE;
6096 /* Prepare to init the RNG */
6100 /* Process old character */
6103 /* Process the player name */
6104 process_player_name(FALSE);
6113 seed = (time(NULL));
6117 /* Mutate the seed on Unix machines */
6118 seed = ((seed >> 3) * (getpid() << 1));
6122 /* Use the complex RNG */
6125 /* Seed the "complex" RNG */
6126 Rand_state_init(seed);
6129 /* Roll new character */
6132 monster_race *r_ptr;
6134 /* The dungeon is not ready */
6135 character_dungeon = FALSE;
6139 p_ptr->inside_quest = 0;
6140 p_ptr->inside_arena = 0;
6141 p_ptr->inside_battle = FALSE;
6145 /* Hack -- seed for flavors */
6146 seed_flavor = rand_int(0x10000000);
6148 /* Hack -- seed for town layout */
6149 seed_town = rand_int(0x10000000);
6151 /* Roll up a new character */
6158 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "ÊÕ¶¤ÎÃϤ˹ߤêΩ¤Ã¤¿¡£");
6160 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "You are standing in the Outpost.");
6164 get_mon_num_prep(NULL, NULL);
6165 for (i = 0; i < MAX_KUBI; i++)
6171 kubi_r_idx[i] = get_mon_num(MAX_DEPTH - 1);
6172 r_ptr = &r_info[kubi_r_idx[i]];
6174 if(!(r_ptr->flags1 & RF1_UNIQUE)) continue;
6176 if(!(r_ptr->flags9 & RF9_DROP_CORPSE)) continue;
6177 if (r_ptr->rarity > 100) continue;
6179 if(r_ptr->flags6 & RF6_SPECIAL) continue;
6181 for (j = 0; j < i; j++)
6182 if (kubi_r_idx[i] == kubi_r_idx[j])break;
6187 for (i = 0; i < MAX_KUBI -1; i++)
6190 for (j = i; j < MAX_KUBI; j++)
6192 if (r_info[kubi_r_idx[i]].level > r_info[kubi_r_idx[j]].level)
6194 tmp = kubi_r_idx[i];
6195 kubi_r_idx[i] = kubi_r_idx[j];
6196 kubi_r_idx[j] = tmp;
6201 p_ptr->inside_battle = TRUE;
6204 today_mon = get_mon_num(3);
6205 r_ptr = &r_info[today_mon];
6207 if (r_ptr->flags1 & RF1_UNIQUE) continue;
6208 if (r_ptr->flags2 & (RF2_MULTIPLY)) continue;
6209 if (!(r_ptr->flags9 & RF9_DROP_CORPSE) || !(r_ptr->flags9 & RF9_DROP_SKELETON)) continue;
6210 if (r_ptr->rarity > 10) continue;
6211 if (r_ptr->level == 0) continue;
6214 p_ptr->inside_battle = FALSE;
6218 write_level = FALSE;
6221 do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ----¥²¡¼¥àºÆ³«----");
6223 do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ---- Restart Game ----");
6229 for(i = m_max; i > 0; i--)
6231 if ((m_list[i].fy == py) && (m_list[i].fx == px))
6240 p_ptr->teleport_town = FALSE;
6241 p_ptr->sutemi = FALSE;
6242 world_monster = FALSE;
6243 now_damaged = FALSE;
6245 start_time = time(NULL);
6246 record_o_name[0] = '\0';
6248 /* Fill the arrays of floors and walls in the good proportions */
6249 for (i = 0; i < 100; i++)
6251 int lim1, lim2, lim3;
6253 lim1 = d_info[dungeon_type].floor_percent1;
6254 lim2 = lim1 + d_info[dungeon_type].floor_percent2;
6255 lim3 = lim2 + d_info[dungeon_type].floor_percent3;
6258 floor_type[i] = d_info[dungeon_type].floor1;
6260 floor_type[i] = d_info[dungeon_type].floor2;
6262 floor_type[i] = d_info[dungeon_type].floor3;
6264 lim1 = d_info[dungeon_type].fill_percent1;
6265 lim2 = lim1 + d_info[dungeon_type].fill_percent2;
6266 lim3 = lim2 + d_info[dungeon_type].fill_percent3;
6268 fill_type[i] = d_info[dungeon_type].fill_type1;
6270 fill_type[i] = d_info[dungeon_type].fill_type2;
6272 fill_type[i] = d_info[dungeon_type].fill_type3;
6275 /* Flavor the objects */
6284 /* Flash a message */
6286 prt("¤ªÂÔ¤Á²¼¤µ¤¤...", 0, 0);
6288 prt("Please wait...", 0, 0);
6292 /* Flush the message */
6296 /* Hack -- Enter wizard mode */
6297 if (arg_wizard && enter_wizard_mode()) wizard = TRUE;
6299 /* Initialize the town-buildings if necessary */
6300 if (!dun_level && !p_ptr->inside_quest)
6302 /* Init the wilderness */
6304 process_dungeon_file("w_info_j.txt", 0, 0, max_wild_y, max_wild_x);
6307 init_flags = INIT_ONLY_BUILDINGS;
6309 process_dungeon_file("t_info_j.txt", 0, 0, MAX_HGT, MAX_WID);
6314 /* Initialize vault info */
6316 if (init_v_info()) quit("·úÃÛʪ½é´ü²½ÉÔǽ");
6318 if (init_v_info()) quit("Cannot initialize vaults");
6321 /* Generate a dungeon level if needed */
6322 if (!character_dungeon) generate_cave();
6325 /* Character is now "complete" */
6326 character_generated = TRUE;
6329 /* Hack -- Character is no longer "icky" */
6330 character_icky = FALSE;
6336 /* Reset the visual mappings */
6339 /* Load the "pref" files */
6340 load_all_pref_files();
6342 /* React to changes */
6343 Term_xtra(TERM_XTRA_REACT, 0);
6346 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
6349 p_ptr->window |= (PW_MONSTER);
6355 /* Set or clear "rogue_like_commands" if requested */
6356 if (arg_force_original) rogue_like_commands = FALSE;
6357 if (arg_force_roguelike) rogue_like_commands = TRUE;
6359 /* Hack -- Enforce "delayed death" */
6360 if (p_ptr->chp < 0) death = TRUE;
6362 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
6364 if (new_game && ((p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BEASTMASTER)))
6366 monster_type *m_ptr;
6367 int pet_r_idx = ((p_ptr->pclass == CLASS_CAVALRY) ? MON_HORSE : MON_YASE_HORSE);
6368 monster_race *r_ptr = &r_info[pet_r_idx];
6369 place_monster_aux(py, px - 1, pet_r_idx,
6370 FALSE, FALSE, TRUE, TRUE, TRUE, FALSE);
6371 m_ptr = &m_list[hack_m_idx_ii];
6372 m_ptr->mspeed = r_ptr->speed;
6373 m_ptr->maxhp = r_ptr->hdice*(r_ptr->hside+1)/2;
6374 m_ptr->max_maxhp = m_ptr->maxhp;
6375 m_ptr->hp = r_ptr->hdice*(r_ptr->hside+1)/2;
6376 m_ptr->energy = -100;
6383 /* Save the current coordinates */
6384 s32b wild_y = p_ptr->wilderness_y;
6385 s32b wild_x = p_ptr->wilderness_x;
6386 s16b level = dun_level;
6389 enter_wilderness_callback(wild_y, wild_x);
6391 enter_level_callback(level);
6392 #endif /* USE_SCRIPT */
6394 /* Process the level */
6398 if (p_ptr->notice) notice_stuff();
6401 if (p_ptr->update) update_stuff();
6404 if (p_ptr->redraw) redraw_stuff();
6407 if (p_ptr->window) window_stuff();
6410 /* Cancel the target */
6413 /* Cancel the health bar */
6417 /* Forget the lite */
6420 /* Forget the view */
6423 /* Forget the view */
6426 /* Handle "quit and save" */
6427 if (!alive && !death) break;
6429 /* Erase the old cave */
6431 if (!death) wipe_m_list();
6441 leave_wilderness_callback(wild_y, wild_x);
6443 leave_level_callback(level);
6444 #endif /* USE_SCRIPT */
6446 /* Accidental Death */
6449 if (p_ptr->inside_arena)
6451 p_ptr->inside_arena = FALSE;
6452 if(p_ptr->arena_number > MAX_ARENA_MONS)
6453 p_ptr->arena_number++;
6455 p_ptr->arena_number = 99;
6458 p_ptr->chp_frac = 0;
6459 p_ptr->exit_bldg = TRUE;
6464 /* Mega-Hack -- Allow player to cheat death */
6466 if ((wizard || cheat_live) && !get_check("»à¤Ë¤Þ¤¹¤«? "))
6468 if ((wizard || cheat_live) && !get_check("Die? "))
6472 /* Mark social class, reset age, if needed */
6473 if (p_ptr->sc) p_ptr->sc = p_ptr->age = 0;
6483 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÇ°¤òÁ÷¤ê¡¢»à¤òµ½¤¤¤¿¡£");
6485 msg_print("You invoke wizard mode and cheat death.");
6491 /* Restore hit points */
6492 p_ptr->chp = p_ptr->mhp;
6493 p_ptr->chp_frac = 0;
6495 if (p_ptr->pclass == CLASS_MAGIC_EATER)
6497 for (i = 0; i < 72; i++)
6499 p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*0x10000;
6501 for (; i < 108; i++)
6503 p_ptr->magic_num1[i] = 0;
6506 /* Restore spell points */
6507 p_ptr->csp = p_ptr->msp;
6508 p_ptr->csp_frac = 0;
6510 /* Hack -- Healing */
6512 (void)set_confused(0);
6513 (void)set_poisoned(0);
6514 (void)set_afraid(0);
6515 (void)set_paralyzed(0);
6520 /* Hack -- Prevent starvation */
6521 (void)set_food(PY_FOOD_MAX - 1);
6523 /* Hack -- cancel recall */
6524 if (p_ptr->word_recall)
6528 msg_print("Ä¥¤ê¤Ä¤á¤¿Â絤¤¬Î®¤ìµî¤Ã¤¿...");
6530 msg_print("A tension leaves the air around you...");
6535 /* Hack -- Prevent recall */
6536 p_ptr->word_recall = 0;
6537 p_ptr->redraw |= (PR_STATUS);
6540 /* Note cause of death XXX XXX XXX */
6542 (void)strcpy(died_from, "»à¤Îµ½¤");
6544 (void)strcpy(died_from, "Cheating death");
6552 p_ptr->inside_arena = 0;
6553 p_ptr->inside_battle = 0;
6555 p_ptr->inside_quest = 0;
6556 p_ptr->recall_dungeon = dungeon_type;
6558 if (lite_town || vanilla_town)
6560 p_ptr->wilderness_y = 1;
6561 p_ptr->wilderness_x = 1;
6575 p_ptr->wilderness_y = 48;
6576 p_ptr->wilderness_x = 5;
6582 p_ptr->wild_mode = FALSE;
6583 p_ptr->leaving = TRUE;
6586 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " ¤·¤«¤·¡¢À¸¤Ê֤ä¿¡£");
6588 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " but revived.");
6594 /* Handle "death" */
6597 /* Make a new level */
6608 s32b turn_real(s32b hoge)
6610 if ((p_ptr->prace == RACE_VAMPIRE) ||
6611 (p_ptr->prace == RACE_SKELETON) ||
6612 (p_ptr->prace == RACE_ZOMBIE) ||
6613 (p_ptr->prace == RACE_SPECTRE))
6614 return hoge-(60L * TOWN_DAWN) / 4;