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;
224 /*** Check for "sensing" ***/
226 /* No sensing when confused */
227 if (p_ptr->confused) return;
229 /* Analyze the class */
230 switch (p_ptr->pclass)
238 if (0 != rand_int(9000L / (plev * plev + 40))) return;
250 if (0 != rand_int(6000L / (plev * plev + 50))) return;
260 case CLASS_HIGH_MAGE:
262 case CLASS_MAGIC_EATER:
264 /* Very bad (light) sensing */
265 if (0 != rand_int(240000L / (plev + 5))) return;
274 /* Good (light) sensing */
275 if (0 != rand_int(10000L / (plev * plev + 40))) return;
285 if (0 != rand_int(20000L / (plev * plev + 40))) return;
297 if (0 != rand_int(95000L / (plev * plev + 40))) return;
309 if (0 != rand_int(77777L / (plev * plev + 40))) return;
318 case CLASS_WARRIOR_MAGE:
322 if (0 != rand_int(75000L / (plev * plev + 40))) return;
328 case CLASS_MINDCRAFTER:
329 case CLASS_MIRROR_MASTER:
332 if (0 != rand_int(55000L / (plev * plev + 40))) return;
338 case CLASS_CHAOS_WARRIOR:
341 if (0 != rand_int(80000L / (plev * plev + 40))) return;
351 case CLASS_FORCETRAINER:
354 if (0 != rand_int(20000L / (plev * plev + 40))) return;
363 if (0 != rand_int(20000L / ((plev+50)*(plev+50)))) return;
373 case CLASS_BLUE_MAGE:
376 if (0 != rand_int(55000L / (plev * plev + 40))) return;
382 case CLASS_BEASTMASTER:
385 if (0 != rand_int(65000L / (plev * plev + 40))) return;
390 case CLASS_BERSERKER:
400 if (compare_virtue(V_KNOWLEDGE, 100, VIRTUE_LARGE)) heavy = TRUE;
402 /*** Sense everything ***/
404 /* Check everything */
405 for (i = 0; i < INVEN_TOTAL; i++)
409 o_ptr = &inventory[i];
411 /* Skip empty slots */
412 if (!o_ptr->k_idx) continue;
414 /* Valid "tval" codes */
440 /* Skip non-sense machines */
443 /* Occasional failure on inventory items */
444 if ((i < INVEN_RARM) && (0 != rand_int(5))) continue;
447 if ((p_ptr->muta3 & MUT3_GOOD_LUCK) && !rand_int(13))
452 sense_inventory_aux(i, heavy);
457 static void sense_inventory2(void)
460 int plev = p_ptr->lev;
464 /*** Check for "sensing" ***/
466 /* No sensing when confused */
467 if (p_ptr->confused) return;
469 /* Analyze the class */
470 switch (p_ptr->pclass)
476 case CLASS_BERSERKER:
483 case CLASS_CHAOS_WARRIOR:
485 case CLASS_BEASTMASTER:
488 /* Very bad (light) sensing */
489 if (0 != rand_int(240000L / (plev + 5))) return;
496 case CLASS_WARRIOR_MAGE:
501 if (0 != rand_int(95000L / (plev * plev + 40))) return;
510 case CLASS_FORCETRAINER:
511 case CLASS_MINDCRAFTER:
514 if (0 != rand_int(20000L / (plev * plev + 40))) return;
521 case CLASS_HIGH_MAGE:
523 case CLASS_MAGIC_EATER:
524 case CLASS_MIRROR_MASTER:
525 case CLASS_BLUE_MAGE:
528 if (0 != rand_int(9000L / (plev * plev + 40))) return;
537 if (0 != rand_int(20000L / ((plev+50)*(plev+50)))) return;
544 /*** Sense everything ***/
546 /* Check everything */
547 for (i = 0; i < INVEN_TOTAL; i++)
551 o_ptr = &inventory[i];
553 /* Skip empty slots */
554 if (!o_ptr->k_idx) continue;
556 /* Valid "tval" codes */
569 /* Skip non-sense machines */
572 /* Occasional failure on inventory items */
573 if ((i < INVEN_RARM) && (0 != rand_int(5))) continue;
575 sense_inventory_aux(i, TRUE);
582 * Go to any level (ripped off from wiz_jump)
584 static void pattern_teleport(void)
591 if (get_check("¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©"))
593 if (get_check("Teleport level? "))
600 /* Only downward in ironman mode */
601 if (ironman_downward)
602 min_level = dun_level;
605 if (dungeon_type == DUNGEON_ANGBAND)
608 max_level = MAX_DEPTH - 1;
609 else if (dun_level == 100)
612 else max_level = d_info[dungeon_type].maxdepth;
616 sprintf(ppp, "¥Æ¥ì¥Ý¡¼¥ÈÀè:(%d-%d)", min_level, max_level);
618 sprintf(ppp, "Teleport to level (%d-%d): ", min_level, max_level);
623 sprintf(tmp_val, "%d", dun_level);
625 /* Ask for a level */
626 if (!get_string(ppp, tmp_val, 10)) return;
628 /* Extract request */
629 command_arg = atoi(tmp_val);
632 else if (get_check("Ä̾ï¥Æ¥ì¥Ý¡¼¥È¡©"))
634 else if (get_check("Normal teleport? "))
638 teleport_player(200);
647 if (command_arg < min_level) command_arg = min_level;
650 if (command_arg > max_level) command_arg = max_level;
654 msg_format("%d ³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤·¤¿¡£", command_arg);
656 msg_format("You teleport to dungeon level %d.", command_arg);
660 if (autosave_l) do_cmd_save_game(TRUE);
663 dun_level = command_arg;
666 p_ptr->leaving = TRUE;
670 static void wreck_the_pattern(void)
672 int to_ruin = 0, r_y, r_x;
674 if (cave[py][px].feat == FEAT_PATTERN_XTRA2)
681 msg_print("¥Ñ¥¿¡¼¥ó¤ò·ì¤Ç±ø¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
682 msg_print("²¿¤«¶²¤í¤·¤¤»ö¤¬µ¯¤³¤Ã¤¿¡ª");
684 msg_print("You bleed on the Pattern!");
685 msg_print("Something terrible happens!");
691 take_hit(DAMAGE_NOESCAPE, damroll(10, 8), "¥Ñ¥¿¡¼¥ó»²õ", -1);
693 take_hit(DAMAGE_NOESCAPE, damroll(10, 8), "corrupting the Pattern", -1);
697 to_ruin = randint(45) + 35;
701 scatter(&r_y, &r_x, py, px, 4, 0);
703 if ((cave[r_y][r_x].feat >= FEAT_PATTERN_START) &&
704 (cave[r_y][r_x].feat < FEAT_PATTERN_XTRA2))
706 cave_set_feat(r_y, r_x, FEAT_PATTERN_XTRA2);
710 cave_set_feat(py, px, FEAT_PATTERN_XTRA2);
714 /* Returns TRUE if we are on the Pattern... */
715 static bool pattern_effect(void)
717 if ((cave[py][px].feat < FEAT_PATTERN_START) ||
718 (cave[py][px].feat > FEAT_PATTERN_XTRA2))
721 if ((prace_is_(RACE_AMBERITE)) &&
722 (p_ptr->cut > 0) && (randint(10) == 1))
727 if (cave[py][px].feat == FEAT_PATTERN_END)
729 (void)set_poisoned(0);
735 (void)do_res_stat(A_STR);
736 (void)do_res_stat(A_INT);
737 (void)do_res_stat(A_WIS);
738 (void)do_res_stat(A_DEX);
739 (void)do_res_stat(A_CON);
740 (void)do_res_stat(A_CHR);
741 (void)restore_level();
742 (void)hp_player(1000);
743 cave_set_feat(py, px, FEAT_PATTERN_OLD);
745 msg_print("¡Ö¥Ñ¥¿¡¼¥ó¡×¤Î¤³¤ÎÉôʬ¤Ï¾¤ÎÉôʬ¤è¤ê¶¯ÎϤǤʤ¤¤è¤¦¤À¡£");
747 msg_print("This section of the Pattern looks less powerful.");
754 * We could make the healing effect of the
755 * Pattern center one-time only to avoid various kinds
756 * of abuse, like luring the win monster into fighting you
757 * in the middle of the pattern...
760 else if (cave[py][px].feat == FEAT_PATTERN_OLD)
764 else if (cave[py][px].feat == FEAT_PATTERN_XTRA1)
768 else if (cave[py][px].feat == FEAT_PATTERN_XTRA2)
772 take_hit(DAMAGE_NOESCAPE, 200, "²õ¤ì¤¿¡Ö¥Ñ¥¿¡¼¥ó¡×¤òÊ⤤¤¿¥À¥á¡¼¥¸", -1);
774 take_hit(DAMAGE_NOESCAPE, 200, "walking the corrupted Pattern", -1);
780 if ((prace_is_(RACE_AMBERITE)) && (randint(2) != 1))
782 else if (!p_ptr->invuln)
784 take_hit(DAMAGE_NOESCAPE, damroll(1,3), "¡Ö¥Ñ¥¿¡¼¥ó¡×¤òÊ⤤¤¿¥À¥á¡¼¥¸", -1);
786 take_hit(DAMAGE_NOESCAPE, damroll(1, 3), "walking the Pattern", -1);
799 * Regenerate hit points -RAK-
801 static void regenhp(int percent)
803 s32b new_chp, new_chp_frac;
806 if (p_ptr->special_defense & KATA_KOUKIJIN) return;
807 if (p_ptr->action == ACTION_HAYAGAKE) return;
808 /* Save the old hitpoints */
809 old_chp = p_ptr->chp;
811 /* Extract the new hitpoints */
812 new_chp = ((long)p_ptr->mhp) * percent + PY_REGEN_HPBASE;
813 p_ptr->chp += (s16b)(new_chp >> 16); /* div 65536 */
815 /* check for overflow */
816 if ((p_ptr->chp < 0) && (old_chp > 0)) p_ptr->chp = MAX_SHORT;
817 new_chp_frac = (new_chp & 0xFFFF) + p_ptr->chp_frac; /* mod 65536 */
818 if (new_chp_frac >= 0x10000L)
820 p_ptr->chp_frac = (u16b)(new_chp_frac - 0x10000L);
825 p_ptr->chp_frac = (u16b)new_chp_frac;
829 if (p_ptr->chp >= p_ptr->mhp)
831 p_ptr->chp = p_ptr->mhp;
836 if (old_chp != p_ptr->chp)
839 p_ptr->redraw |= (PR_HP);
842 p_ptr->window |= (PW_PLAYER);
850 * Regenerate mana points -RAK-
852 static void regenmana(int percent)
854 s32b new_mana, new_mana_frac;
856 bool old_csp_msp = (p_ptr->csp > p_ptr->msp);
858 if (p_ptr->special_defense & KATA_KOUKIJIN) return;
859 if ((p_ptr->pclass == CLASS_SAMURAI) && (p_ptr->regenerate)) percent /= 2;
860 old_csp = p_ptr->csp;
861 new_mana = ((long)p_ptr->msp) * percent + PY_REGEN_MNBASE;
862 if (old_csp_msp && (new_mana > 0))
866 p_ptr->csp -= (s16b)(new_mana >> 16); /* div 65536 */
867 new_mana_frac = p_ptr->csp_frac + 0x10000L - (new_mana & 0xFFFF);
871 if (old_csp_msp) new_mana += ((((long)p_ptr->msp) * percent + PY_REGEN_MNBASE) * 32);
872 p_ptr->csp += (s16b)(new_mana >> 16); /* div 65536 */
874 new_mana_frac = (new_mana & 0xFFFF) + p_ptr->csp_frac; /* mod 65536 */
876 if (new_mana_frac >= 0x10000L)
878 p_ptr->csp_frac = (u16b)(new_mana_frac - 0x10000L);
883 p_ptr->csp_frac = (u16b)(new_mana_frac);
886 /* check for overflow */
893 /* Must set frac to zero even if equal */
894 if ((old_csp_msp && p_ptr->csp < p_ptr->msp) || (!old_csp_msp && p_ptr->csp >= p_ptr->msp))
896 p_ptr->csp = p_ptr->msp;
901 if (old_csp != p_ptr->csp)
904 p_ptr->redraw |= (PR_MANA);
907 p_ptr->window |= (PW_PLAYER);
908 p_ptr->window |= (PW_SPELL);
919 static void regenmagic(int percent)
924 for (i = 0; i < 72; i++)
926 if (!p_ptr->magic_num2[i]) continue;
927 if (p_ptr->magic_num1[i] == ((long)p_ptr->magic_num2[i] << 16)) continue;
928 new_mana = ((long)p_ptr->magic_num2[i]+adj_mag_mana[A_INT]+13) * percent / 8;
929 p_ptr->magic_num1[i] += new_mana;
931 /* Must set frac to zero even if equal */
932 if (p_ptr->magic_num1[i] > (p_ptr->magic_num2[i] << 16))
934 p_ptr->magic_num1[i] = ((long)p_ptr->magic_num2[i] << 16);
938 for (i = 72; i < 108; i++)
940 if (!p_ptr->magic_num1[i]) continue;
941 if (!p_ptr->magic_num2[i]) continue;
942 p_ptr->magic_num1[i] -= (long)(p_ptr->magic_num2[i] * (adj_mag_mana[A_INT] + 10)) * 0x1000;
943 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
954 * Regenerate the monsters (once per 100 game turns)
956 * XXX XXX XXX Should probably be done during monster turns.
958 static void regen_monsters(void)
963 /* Regenerate everyone */
964 for (i = 1; i < m_max; i++)
966 /* Check the i'th monster */
967 monster_type *m_ptr = &m_list[i];
968 monster_race *r_ptr = &r_info[m_ptr->r_idx];
971 /* Skip dead monsters */
972 if (!m_ptr->r_idx) continue;
974 /* Allow regeneration (if needed) */
975 if (m_ptr->hp < m_ptr->maxhp)
977 /* Hack -- Base regeneration */
978 frac = m_ptr->maxhp / 100;
980 /* Hack -- Minimal regeneration rate */
981 if (!frac) if (randint(2) == 1) frac = 1;
983 /* Hack -- Some monsters regenerate quickly */
984 if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2;
986 /* Hack -- Regenerate */
989 /* Do not over-regenerate */
990 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
992 /* Redraw (later) if needed */
993 if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH);
994 if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH);
1001 * Regenerate the monsters (once per 100 game turns)
1003 * XXX XXX XXX Should probably be done during monster turns.
1005 static void regen_captured_monsters(void)
1010 /* Regenerate everyone */
1011 for (i = 0; i < INVEN_TOTAL; i++)
1013 monster_race *r_ptr;
1014 object_type *o_ptr = &inventory[i];
1016 if (!o_ptr->k_idx) continue;
1017 if (o_ptr->tval != TV_CAPTURE) continue;
1018 if (!o_ptr->pval) continue;
1022 r_ptr = &r_info[o_ptr->pval];
1024 /* Allow regeneration (if needed) */
1025 if (o_ptr->xtra4 < o_ptr->xtra5)
1027 /* Hack -- Base regeneration */
1028 frac = o_ptr->xtra5 / 100;
1030 /* Hack -- Minimal regeneration rate */
1031 if (!frac) if (randint(2) == 1) frac = 1;
1033 /* Hack -- Some monsters regenerate quickly */
1034 if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2;
1036 /* Hack -- Regenerate */
1037 o_ptr->xtra4 += frac;
1039 /* Do not over-regenerate */
1040 if (o_ptr->xtra4 > o_ptr->xtra5) o_ptr->xtra4 = o_ptr->xtra5;
1047 p_ptr->notice |= (PN_COMBINE);
1050 p_ptr->window |= (PW_INVEN);
1051 p_ptr->window |= (PW_EQUIP);
1057 static void notice_lite_change(object_type *o_ptr)
1059 /* Hack -- notice interesting fuel steps */
1060 if ((o_ptr->xtra4 < 100) || (!(o_ptr->xtra4 % 100)))
1063 p_ptr->window |= (PW_EQUIP);
1066 /* Hack -- Special treatment when blind */
1069 /* Hack -- save some light for later */
1070 if (o_ptr->xtra4 == 0) o_ptr->xtra4++;
1073 /* The light is now out */
1074 else if (o_ptr->xtra4 == 0)
1078 msg_print("ÌÀ¤«¤ê¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1080 msg_print("Your light has gone out!");
1082 p_ptr->update |= (PU_BONUS);
1085 /* The light is getting dim */
1086 else if (o_ptr->name2 == EGO_LITE_LONG)
1088 if ((o_ptr->xtra4 < 50) && (!(o_ptr->xtra4 % 5)) && (turn % 40))
1090 if (disturb_minor) disturb(0, 0);
1092 msg_print("ÌÀ¤«¤ê¤¬Èù¤«¤Ë¤Ê¤Ã¤Æ¤¤Æ¤¤¤ë¡£");
1094 msg_print("Your light is growing faint.");
1100 /* The light is getting dim */
1101 else if ((o_ptr->xtra4 < 100) && (!(o_ptr->xtra4 % 10)))
1103 if (disturb_minor) disturb(0, 0);
1105 msg_print("ÌÀ¤«¤ê¤¬Èù¤«¤Ë¤Ê¤Ã¤Æ¤¤Æ¤¤¤ë¡£");
1107 msg_print("Your light is growing faint.");
1115 * Forcibly pseudo-identify an object in the inventory
1118 * note: currently this function allows pseudo-id of any object,
1119 * including silly ones like potions & scrolls, which always
1120 * get '{average}'. This should be changed, either to stop such
1121 * items from being pseudo-id'd, or to allow psychometry to
1122 * detect whether the unidentified potion/scroll/etc is
1123 * good (Cure Light Wounds, Restore Strength, etc) or
1124 * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
1126 bool psychometry(void)
1130 char o_name[MAX_NLEN];
1135 item_tester_no_ryoute = TRUE;
1138 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«¡©";
1139 s = "Ä´¤Ù¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
1141 q = "Meditate on which item? ";
1142 s = "You have nothing appropriate.";
1145 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
1147 /* Get the item (in the pack) */
1150 o_ptr = &inventory[item];
1153 /* Get the item (on the floor) */
1156 o_ptr = &o_list[0 - item];
1159 /* It is fully known, no information needed */
1160 if (object_known_p(o_ptr))
1163 msg_print("²¿¤â¿·¤·¤¤¤³¤È¤ÏȽ¤é¤Ê¤«¤Ã¤¿¡£");
1165 msg_print("You cannot find out anything more about that.");
1171 /* Check for a feeling */
1172 feel = value_check_aux1(o_ptr);
1174 /* Get an object description */
1175 object_desc(o_name, o_ptr, FALSE, 0);
1177 /* Skip non-feelings */
1181 msg_format("%s¤«¤é¤ÏÆäËÊѤï¤Ã¤¿»ö¤Ï´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿¡£", o_name);
1183 msg_format("You do not perceive anything unusual about the %s.", o_name);
1190 msg_format("%s¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
1191 o_name, game_inscriptions[feel]);
1193 msg_format("You feel that the %s %s %s...",
1194 o_name, ((o_ptr->number == 1) ? "is" : "are"),
1195 game_inscriptions[feel]);
1199 /* We have "felt" it */
1200 o_ptr->ident |= (IDENT_SENSE);
1203 o_ptr->feeling = feel;
1205 /* Combine / Reorder the pack (later) */
1206 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1209 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1211 /* Something happened */
1216 static void gere_music(s32b music)
1224 stun_monsters(damroll(p_ptr->lev/10,2));
1227 hp_player(damroll(2,6));
1230 project_hack(GF_TURN_ALL, p_ptr->lev);
1233 project_hack(GF_PSI, randint(p_ptr->lev * 3 / 2));
1236 project(0, 1, py, px, 0, GF_IDENTIFY, PROJECT_ITEM, -1);
1239 confuse_monsters(p_ptr->lev * 2);
1242 project_hack(GF_SOUND, damroll(10 + p_ptr->lev/5,7));
1245 charm_monsters(damroll(10 + p_ptr->lev/15,6));
1248 project(0, 0, py, px,
1249 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
1252 dispel_monsters(randint(p_ptr->lev * 3));
1253 dispel_evil(randint(p_ptr->lev * 3));
1260 earthquake(py, px, 10);
1263 stasis_monsters(p_ptr->lev * 4);
1266 dispel_monsters(randint(p_ptr->lev * 3));
1269 hp_player(damroll(15,10));
1273 case MUSIC_DETECT+19:
1274 wiz_lite(FALSE, FALSE);
1275 case MUSIC_DETECT+11:
1276 case MUSIC_DETECT+12:
1277 case MUSIC_DETECT+13:
1278 case MUSIC_DETECT+14:
1279 case MUSIC_DETECT+15:
1280 case MUSIC_DETECT+16:
1281 case MUSIC_DETECT+17:
1282 case MUSIC_DETECT+18:
1283 map_area(DETECT_RAD_MAP);
1284 if ((p_ptr->lev > 39) && (music < MUSIC_DETECT+19)) p_ptr->magic_num1[0] = music+1;
1285 case MUSIC_DETECT+6:
1286 case MUSIC_DETECT+7:
1287 case MUSIC_DETECT+8:
1288 case MUSIC_DETECT+9:
1289 case MUSIC_DETECT+10:
1290 detect_treasure(DETECT_RAD_DEFAULT);
1291 detect_objects_gold(DETECT_RAD_DEFAULT);
1292 detect_objects_normal(DETECT_RAD_DEFAULT);
1293 if ((p_ptr->lev > 24) && (music < MUSIC_DETECT+11)) p_ptr->magic_num1[0] = music+1;
1294 case MUSIC_DETECT+3:
1295 case MUSIC_DETECT+4:
1296 case MUSIC_DETECT+5:
1297 detect_monsters_invis(DETECT_RAD_DEFAULT);
1298 detect_monsters_normal(DETECT_RAD_DEFAULT);
1299 if ((p_ptr->lev > 19) && (music < MUSIC_DETECT+6)) p_ptr->magic_num1[0] = music+1;
1301 case MUSIC_DETECT+1:
1302 case MUSIC_DETECT+2:
1303 detect_traps(DETECT_RAD_DEFAULT);
1304 detect_doors(DETECT_RAD_DEFAULT);
1305 detect_stairs(DETECT_RAD_DEFAULT);
1306 if ((p_ptr->lev > 14) && (music < MUSIC_DETECT+3)) p_ptr->magic_num1[0] = music+1;
1312 * If player has inscribed the object with "!!", let him know when it's
1315 static void recharged_notice(object_type *o_ptr)
1317 char o_name[MAX_NLEN];
1321 /* No inscription */
1322 if (!o_ptr->inscription) return;
1325 s = strchr(quark_str(o_ptr->inscription), '!');
1327 /* Process notification request. */
1330 /* Find another '!' */
1333 /* Describe (briefly) */
1334 object_desc(o_name, o_ptr, FALSE, 0);
1336 /* Notify the player */
1337 if (o_ptr->number > 1)
1339 msg_format("%s¤ÏºÆ½¼Å¶¤µ¤ì¤¿¡£", o_name);
1340 else msg_format("%s¤ÏºÆ½¼Å¶¤µ¤ì¤¿¡£", o_name);
1342 msg_format("Your %s are recharged.", o_name);
1343 else msg_format("Your %s is recharged.", o_name);
1351 /* Keep looking for '!'s */
1352 s = strchr(s + 1, '!');
1357 static void check_music()
1362 /* Music singed by player */
1363 if(p_ptr->pclass != CLASS_BARD) return;
1364 if(!p_ptr->magic_num1[0] && !p_ptr->magic_num1[1]) return;
1366 s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC - 1][p_ptr->magic_num2[0]];
1368 shouhimana = (s_ptr->smana*(3800-spell_exp[p_ptr->magic_num2[0]])+2399);
1371 else shouhimana *= 4;
1373 if(shouhimana < 1) shouhimana = 1;
1374 shouhimana *= 0x8000;
1375 if ((p_ptr->csp < shouhimana / 0x10000) || (p_ptr->anti_magic))
1382 p_ptr->csp -= shouhimana / 0x10000;
1383 shouhimana = (shouhimana & 0xffff);
1384 if (p_ptr->csp_frac < shouhimana)
1387 p_ptr->csp_frac += (u16b)(0x10000L - shouhimana);
1391 p_ptr->csp_frac -= (u16b)shouhimana;
1394 p_ptr->redraw |= PR_MANA;
1395 if (p_ptr->magic_num1[1])
1397 p_ptr->magic_num1[0] = p_ptr->magic_num1[1];
1398 p_ptr->magic_num1[1] = 0;
1400 msg_print("²Î¤òºÆ³«¤·¤¿¡£");
1402 msg_print("You restart singing.");
1404 p_ptr->action = ACTION_SING;
1406 /* Recalculate bonuses */
1407 p_ptr->update |= (PU_BONUS | PU_HP);
1409 /* Redraw status bar */
1410 p_ptr->redraw |= (PR_STATUS);
1413 if (spell_exp[p_ptr->magic_num2[0]] < 900)
1414 spell_exp[p_ptr->magic_num2[0]]+=5;
1415 else if(spell_exp[p_ptr->magic_num2[0]] < 1200)
1416 {if (one_in_(2) && (dun_level > 4) && ((dun_level + 10) > p_ptr->lev)) spell_exp[p_ptr->magic_num2[0]]+=1;}
1417 else if(spell_exp[p_ptr->magic_num2[0]] < 1400)
1418 {if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel)) spell_exp[p_ptr->magic_num2[0]]+=1;}
1419 else if(spell_exp[p_ptr->magic_num2[0]] < 1600)
1420 {if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel)) spell_exp[p_ptr->magic_num2[0]]+=1;}
1422 gere_music(p_ptr->magic_num1[0]);
1426 * Handle certain things once every 10 game turns
1428 static void process_world(void)
1432 bool cave_no_regen = FALSE;
1433 int upkeep_factor = 0;
1436 u32b f1 = 0 , f2 = 0 , f3 = 0;
1439 const int dec_count = (easy_band ? 2 : 1);
1441 int hour, min, prev_min;
1442 s32b len = 20L * TOWN_DAWN;
1443 s32b tick = turn % len + len / 4;
1445 hour = (24 * tick / len) % 24;
1446 min = (1440 * tick / len) % 60;
1447 prev_min = (1440 * (tick - 20) / len) % 60;
1449 if ((turn - old_turn == (3000 - dun_level*20)) && (dun_level) &&
1450 !(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)))) &&
1451 !(p_ptr->inside_battle))
1454 if (p_ptr->inside_battle && !p_ptr->leaving)
1461 /* Count all hostile monsters */
1462 for (i2 = 0; i2 < cur_wid; ++i2)
1463 for (j2 = 0; j2 < cur_hgt; j2++)
1464 if ((cave[j2][i2].m_idx > 0) && (cave[j2][i2].m_idx != p_ptr->riding))
1467 win_m_idx = cave[j2][i2].m_idx;
1470 if (number_mon == 0)
1473 msg_print("ÁêÂǤÁ¤Ë½ª¤ï¤ê¤Þ¤·¤¿¡£");
1475 msg_print("They have kill each other at the same time.");
1478 p_ptr->energy = 100;
1481 else if ((number_mon-1) == 0)
1484 monster_type *wm_ptr;
1486 wm_ptr = &m_list[win_m_idx];
1488 monster_desc(m_name, wm_ptr, 0);
1490 msg_format("%s¤¬¾¡Íø¤·¤¿¡ª", m_name);
1492 msg_format("%s is winner!", m_name);
1496 if (win_m_idx == (sel_monster+1))
1499 msg_print("¤ª¤á¤Ç¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£");
1501 msg_print("Congratulations.");
1504 msg_format("%d¡ð¤ò¼õ¤±¼è¤Ã¤¿¡£", battle_odds);
1506 msg_format("You recieved %d gold.", battle_odds);
1508 p_ptr->au += battle_odds;
1513 msg_print("»ÄÇ°¤Ç¤·¤¿¡£");
1515 msg_print("You lost gold.");
1519 p_ptr->energy = 100;
1522 else if(turn - old_turn == 3000L)
1525 msg_print("¿½¤·Ê¬¤±¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤³¤Î¾¡Éé¤Ï°ú¤Ê¬¤±¤È¤µ¤»¤Æ¤¤¤¿¤À¤¤Þ¤¹¡£");
1527 msg_format("This battle have ended in a draw.");
1529 p_ptr->au += kakekin;
1531 p_ptr->energy = 100;
1536 /* Every 20 game turns */
1537 if (turn % 20) return;
1539 /*** Check the Time and Load ***/
1543 /* Check time and load */
1544 if ((0 != check_time()) || (0 != check_load()))
1547 if (closing_flag <= 2)
1552 /* Count warnings */
1557 msg_print("¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¸¤«¤«¤Ã¤Æ¤¤¤Þ¤¹...");
1558 msg_print("¥²¡¼¥à¤ò½ªÎ»¤¹¤ë¤«¥»¡¼¥Ö¤¹¤ë¤«¤·¤Æ²¼¤µ¤¤¡£");
1560 msg_print("The gates to ANGBAND are closing...");
1561 msg_print("Please finish up and/or save your game.");
1571 msg_print("º£¡¢¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¶¤µ¤ì¤Þ¤·¤¿¡£");
1573 msg_print("The gates to ANGBAND are now closed.");
1581 p_ptr->leaving = TRUE;
1586 /*** Attempt timed autosave ***/
1587 if (autosave_t && autosave_freq && !p_ptr->inside_battle)
1589 if (!(turn % ((s32b)autosave_freq * 20)))
1590 do_cmd_save_game(TRUE);
1596 msg_print("²¿¤«¤¬Ê¹¤³¤¨¤¿¡£");
1598 msg_print("You hear noise.");
1602 /*** Handle the wilderness/town (sunshine) ***/
1604 /* While in town/wilderness */
1605 if (!dun_level && !p_ptr->inside_quest && !p_ptr->inside_battle && !p_ptr->inside_arena && !p_ptr->wild_mode)
1607 /* Hack -- Daybreak/Nighfall in town */
1608 if (!(turn % ((20L * TOWN_DAWN) / 2)))
1612 /* Check for dawn */
1613 dawn = (!(turn % (20L * TOWN_DAWN)));
1620 msg_print("Ì뤬ÌÀ¤±¤¿¡£");
1622 msg_print("The sun has risen.");
1626 /* Hack -- Scan the town */
1627 for (y = 0; y < cur_hgt; y++)
1629 for (x = 0; x < cur_wid; x++)
1631 /* Get the cave grid */
1632 c_ptr = &cave[y][x];
1635 c_ptr->info |= (CAVE_GLOW);
1637 /* Hack -- Memorize lit grids if allowed */
1638 if (view_perma_grids) c_ptr->info |= (CAVE_MARK);
1640 /* Hack -- Notice spot */
1651 msg_print("Æü¤¬ÄÀ¤ó¤À¡£");
1653 msg_print("The sun has fallen.");
1657 /* Hack -- Scan the town */
1658 for (y = 0; y < cur_hgt; y++)
1660 for (x = 0; x < cur_wid; x++)
1662 /* Get the cave grid */
1663 c_ptr = &cave[y][x];
1665 /* Darken "boring" features */
1666 if ((c_ptr->feat <= FEAT_INVIS) ||
1667 ((c_ptr->feat >= FEAT_DEEP_WATER) &&
1668 (c_ptr->feat <= FEAT_TREES) &&
1669 (c_ptr->feat != FEAT_MUSEUM)))
1671 /* Forget the grid */
1672 c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK);
1674 /* Hack -- Notice spot */
1681 /* Update the monsters */
1682 p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
1685 p_ptr->redraw |= (PR_MAP);
1688 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1692 /* Set back the rewards once a day */
1693 if (!(turn % (200L * STORE_TURNS)))
1697 /* Reset the rewards */
1698 for (n = 0; n < MAX_BACT; n++)
1700 p_ptr->rewards[n] = FALSE;
1705 if (cheat_xtra) msg_print("Êó½·¤ò¥ê¥»¥Ã¥È");
1707 if (cheat_xtra) msg_print("Rewards reset.");
1713 /*** Process the monsters ***/
1715 /* Check for creature generation. */
1716 if ((rand_int(d_info[dungeon_type].max_m_alloc_chance) == 0) &&
1717 !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->inside_battle)
1719 /* Make a new monster */
1720 (void)alloc_monster(MAX_SIGHT + 5, FALSE);
1723 /* Hack -- Check for creature regeneration */
1724 if (!(turn % 200) && !p_ptr->inside_battle) regen_monsters();
1725 if (!(turn % 60)) regen_captured_monsters();
1728 /*** Damage over Time ***/
1730 /* Take damage from poison */
1731 if (p_ptr->poisoned && !p_ptr->invuln)
1735 take_hit(DAMAGE_NOESCAPE, 1, "ÆÇ", -1);
1737 take_hit(DAMAGE_NOESCAPE, 1, "poison", -1);
1743 /* (Vampires) Take damage from sunlight */
1744 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
1746 if (!dun_level && !p_ptr->resist_lite && !p_ptr->invuln &&
1747 (!((turn / ((20L * TOWN_DAWN) / 2)) % 2)))
1749 if (cave[py][px].info & CAVE_GLOW)
1753 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª");
1754 take_hit(DAMAGE_NOESCAPE, 1, "Æü¸÷", -1);
1756 msg_print("The sun's rays scorch your undead flesh!");
1757 take_hit(DAMAGE_NOESCAPE, 1, "sunlight", -1);
1760 cave_no_regen = TRUE;
1764 if (inventory[INVEN_LITE].tval && (inventory[INVEN_LITE].name2 != EGO_LITE_DARKNESS) &&
1765 !p_ptr->resist_lite)
1767 object_type * o_ptr = &inventory[INVEN_LITE];
1768 char o_name [MAX_NLEN];
1769 char ouch [MAX_NLEN+40];
1771 /* Get an object description */
1772 object_desc(o_name, o_ptr, FALSE, 0);
1775 msg_format("%s¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª", o_name);
1777 msg_format("The %s scorches your undead flesh!", o_name);
1781 cave_no_regen = TRUE;
1783 /* Get an object description */
1784 object_desc(o_name, o_ptr, TRUE, 0);
1787 sprintf(ouch, "%s¤òÁõÈ÷¤·¤¿¥À¥á¡¼¥¸", o_name);
1789 sprintf(ouch, "wielding %s", o_name);
1792 if (!p_ptr->invuln) take_hit(DAMAGE_NOESCAPE, 1, ouch, -1);
1796 if ((cave[py][px].feat == FEAT_SHAL_LAVA) &&
1797 !p_ptr->invuln && !p_ptr->immune_fire && !p_ptr->ffall)
1799 int damage = 3000 + rand_int(2000);
1801 if (prace_is_(RACE_ENT)) damage += damage/3;
1803 if (p_ptr->resist_fire) damage = damage / 3;
1804 if (p_ptr->oppose_fire) damage = damage / 3;
1805 damage = damage / 100 + (rand_int(100) < (damage % 100));
1811 msg_print("ÍÏ´ä¤Ç²Ð½ý¤·¤¿¡ª");
1812 take_hit(DAMAGE_NOESCAPE, damage, "Àõ¤¤ÍÏ´äή", -1);
1814 msg_print("The lava burns you!");
1815 take_hit(DAMAGE_NOESCAPE, damage, "shallow lava", -1);
1818 cave_no_regen = TRUE;
1822 else if ((cave[py][px].feat == FEAT_DEEP_LAVA) &&
1823 !p_ptr->invuln && !p_ptr->immune_fire)
1825 int damage = 6000 + rand_int(4000);
1830 if (p_ptr->resist_fire) damage = damage / 3;
1831 if (p_ptr->oppose_fire) damage = damage / 3;
1835 damage = damage / 5;
1838 message = "Ç®¤Ç²Ð½ý¤·¤¿¡ª";
1839 hit_from = "¿¼¤¤ÍÏ´äή¤Î¾å¤ËÉâÍ·¤·¤¿¥À¥á¡¼¥¸";
1841 message = "The heat burns you!";
1842 hit_from = "flying over deep lava";
1849 message = "ÍÏ´ä¤Ç²Ð½ý¤·¤¿¡ª";
1850 hit_from = "¿¼¤¤ÍÏ´äή";
1852 message = "The lava burns you!";
1853 hit_from = "deep lava";
1858 damage = damage / 100 + (rand_int(100) < (damage % 100));
1863 take_hit(DAMAGE_NOESCAPE, damage, hit_from, -1);
1865 cave_no_regen = TRUE;
1869 else if ((cave[py][px].feat == FEAT_DEEP_WATER) && !p_ptr->ffall && !p_ptr->can_swim)
1871 if (p_ptr->total_weight > (((u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2))
1875 msg_print("Å®¤ì¤Æ¤¤¤ë¡ª");
1876 take_hit(DAMAGE_NOESCAPE, randint(p_ptr->lev), "Å®¤ì", -1);
1878 msg_print("You are drowning!");
1879 take_hit(DAMAGE_NOESCAPE, randint(p_ptr->lev), "drowning", -1);
1882 cave_no_regen = TRUE;
1889 if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !p_ptr->immune_fire)
1891 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1892 if (prace_is_(RACE_ENT)) damage += damage/3;
1893 if (p_ptr->resist_fire) damage = damage / 3;
1894 if (p_ptr->oppose_fire) damage = damage / 3;
1896 msg_print("Ç®¤¤¡ª");
1897 take_hit(DAMAGE_NOESCAPE, damage, "±ê¤Î¥ª¡¼¥é", -1);
1899 msg_print("It's hot!");
1900 take_hit(DAMAGE_NOESCAPE, damage, "Fire aura", -1);
1903 if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !p_ptr->immune_elec)
1905 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1906 if (p_ptr->resist_elec) damage = damage / 3;
1907 if (p_ptr->oppose_elec) damage = damage / 3;
1909 msg_print("Äˤ¤¡ª");
1910 take_hit(DAMAGE_NOESCAPE, damage, "Åŵ¤¤Î¥ª¡¼¥é", -1);
1912 msg_print("It hurts!");
1913 take_hit(DAMAGE_NOESCAPE, damage, "Elec aura", -1);
1916 if ((r_info[m_list[p_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !p_ptr->immune_cold)
1918 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1919 if (p_ptr->resist_cold) damage = damage / 3;
1920 if (p_ptr->oppose_cold) damage = damage / 3;
1922 msg_print("Î䤿¤¤¡ª");
1923 take_hit(DAMAGE_NOESCAPE, damage, "Î䵤¤Î¥ª¡¼¥é", -1);
1925 msg_print("It's cold!");
1926 take_hit(DAMAGE_NOESCAPE, damage, "Cold aura", -1);
1931 /* Spectres -- take damage when moving through walls */
1933 * Added: ANYBODY takes damage if inside through walls
1934 * without wraith form -- NOTE: Spectres will never be
1935 * reduced below 0 hp by being inside a stone wall; others
1938 if (!cave_floor_bold(py, px))
1940 /* Player can walk through trees */
1941 if ((cave[py][px].feat == FEAT_TREES) || ((cave[py][px].feat == FEAT_MOUNTAIN) && !dun_level && p_ptr->ffall))
1945 else if (!p_ptr->invuln && !p_ptr->wraith_form && !p_ptr->kabenuke &&
1946 ((p_ptr->chp > (p_ptr->lev / 5)) || !p_ptr->pass_wall))
1950 cave_no_regen = TRUE;
1952 if (p_ptr->pass_wall)
1955 msg_print("ÂΤÎʬ»Ò¤¬Ê¬²ò¤·¤¿µ¤¤¬¤¹¤ë¡ª");
1958 msg_print("Your molecules feel disrupted!");
1959 dam_desc = "density";
1966 msg_print("Êø¤ì¤¿´ä¤Ë²¡¤·ÄÙ¤µ¤ì¤¿¡ª");
1967 dam_desc = "¹Å¤¤´ä";
1969 msg_print("You are being crushed!");
1970 dam_desc = "solid rock";
1975 take_hit(DAMAGE_NOESCAPE, 1 + (p_ptr->lev / 5), dam_desc, -1);
1981 monster_race *r_ptr;
1983 if (min != prev_min)
1986 bool old_inside_battle = p_ptr->inside_battle;
1988 do_cmd_write_nikki(NIKKI_HIGAWARI, 0, NULL);
1990 p_ptr->inside_battle = TRUE;
1991 get_mon_num_prep(NULL,NULL);
1993 for (i = 0; i < max_d_idx; i++)
1995 if (max_dlv[i] < d_info[i].mindepth) continue;
1996 if (max_dl < max_dlv[i]) max_dl = max_dlv[i];
2000 today_mon = get_mon_num(max_dl);
2001 r_ptr = &r_info[today_mon];
2003 if (r_ptr->flags1 & RF1_UNIQUE) continue;
2004 if (r_ptr->flags7 & (RF7_UNIQUE_7 | RF7_UNIQUE2)) continue;
2005 if (r_ptr->flags2 & (RF2_MULTIPLY)) continue;
2006 if (!(r_ptr->flags9 & RF9_DROP_CORPSE) || !(r_ptr->flags9 & RF9_DROP_SKELETON)) continue;
2007 if (r_ptr->level < MIN(max_dl/2, 40)) continue;
2008 if (r_ptr->rarity > 10) continue;
2009 if (r_ptr->level == 0) continue;
2012 p_ptr->today_mon = 0;
2013 p_ptr->inside_battle = old_inside_battle;
2017 /* Nightmare mode activates the TY_CURSE at midnight */
2018 if (ironman_nightmare)
2020 /* Require exact minute */
2021 if (min != prev_min)
2023 /* Every 15 minutes after 11:00 pm */
2024 if ((hour == 23) && !(min % 15))
2034 msg_print("±ó¤¯¤ÇÉÔµ¤Ì£¤Ê¾â¤Î²»¤¬ÌĤä¿¡£");
2036 msg_print("You hear a distant bell toll ominously.");
2044 msg_print("±ó¤¯¤Ç¾â¤¬Æó²óÌĤä¿¡£");
2046 msg_print("A distant bell sounds twice.");
2054 msg_print("±ó¤¯¤Ç¾â¤¬»°²óÌĤä¿¡£");
2056 msg_print("A distant bell sounds three times.");
2064 msg_print("±ó¤¯¤Ç¾â¤¬»Í²óÌĤä¿¡£");
2066 msg_print("A distant bell tolls four times.");
2074 /* TY_CURSE activates at mignight! */
2081 msg_print("±ó¤¯¤Ç¾â¤¬²¿²ó¤âÌĤꡢ»à¤ó¤À¤è¤¦¤ÊÀŤ±¤µ¤ÎÃæ¤Ø¾Ã¤¨¤Æ¤¤¤Ã¤¿¡£");
2083 msg_print("A distant bell tolls many times, fading into an deathly silence.");
2086 activate_ty_curse(FALSE, &count);
2091 /* Take damage from cuts */
2092 if (p_ptr->cut && !p_ptr->invuln)
2094 /* Mortal wound or Deep Gash */
2095 if (p_ptr->cut > 1000)
2100 else if (p_ptr->cut > 200)
2106 else if (p_ptr->cut > 100)
2111 else if (p_ptr->cut > 50)
2116 else if (p_ptr->cut > 25)
2121 else if (p_ptr->cut > 10)
2134 take_hit(DAMAGE_NOESCAPE, i, "Ã×Ì¿½ý", -1);
2136 take_hit(DAMAGE_NOESCAPE, i, "a fatal wound", -1);
2142 /*** Check the Food, and Regenerate ***/
2144 if (!p_ptr->inside_battle)
2146 /* Digest normally */
2147 if (p_ptr->food < PY_FOOD_MAX)
2149 /* Every 100 game turns */
2152 /* Basic digestion rate based on speed */
2153 i = /* extract_energy[p_ptr->pspeed] * 2;*/
2154 ((p_ptr->pspeed > 199) ? 49 : ((p_ptr->pspeed < 0) ?
2155 1 : extract_energy[p_ptr->pspeed]));
2157 /* Regeneration takes more food */
2158 if (p_ptr->regenerate) i += 20;
2159 if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK)) i+= 20;
2161 /* Slow digestion takes less food */
2162 if (p_ptr->slow_digest) i -= 5;
2164 /* Minimal digestion */
2167 /* Digest some food */
2168 (void)set_food(p_ptr->food - i);
2172 /* Digest quickly when gorged */
2175 /* Digest a lot of food */
2176 (void)set_food(p_ptr->food - 100);
2180 /* Starve to death (slowly) */
2181 if (p_ptr->food < PY_FOOD_STARVE)
2183 /* Calculate damage */
2184 i = (PY_FOOD_STARVE - p_ptr->food) / 10;
2188 if (!p_ptr->invuln) take_hit(DAMAGE_LOSELIFE, i, "¶õÊ¢", -1);
2190 if (!p_ptr->invuln) take_hit(DAMAGE_LOSELIFE, i, "starvation", -1);
2195 /* Default regeneration */
2196 regen_amount = PY_REGEN_NORMAL;
2199 if (p_ptr->food < PY_FOOD_WEAK)
2201 /* Lower regeneration */
2202 if (p_ptr->food < PY_FOOD_STARVE)
2206 else if (p_ptr->food < PY_FOOD_FAINT)
2208 regen_amount = PY_REGEN_FAINT;
2212 regen_amount = PY_REGEN_WEAK;
2216 if ((p_ptr->food < PY_FOOD_FAINT) && !p_ptr->inside_battle)
2218 /* Faint occasionally */
2219 if (!p_ptr->paralyzed && (rand_int(100) < 10))
2223 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤À䤷¤Æ¤·¤Þ¤Ã¤¿¡£");
2225 msg_print("You faint from the lack of food.");
2230 /* Hack -- faint (bypass free action) */
2231 (void)set_paralyzed(p_ptr->paralyzed + 1 + rand_int(5));
2237 /* Are we walking the pattern? */
2238 if (pattern_effect())
2240 cave_no_regen = TRUE;
2244 /* Regeneration ability */
2245 if (p_ptr->regenerate)
2247 regen_amount = regen_amount * 2;
2249 if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK))
2256 /* Searching or Resting */
2257 if ((p_ptr->action == ACTION_SEARCH) || (p_ptr->action == ACTION_REST))
2259 regen_amount = regen_amount * 2;
2262 upkeep_factor = calculate_upkeep();
2264 /* Regenerate the mana */
2265 /* if (p_ptr->csp < p_ptr->msp) */
2269 s32b upkeep_regen = ((100 - upkeep_factor) * regen_amount);
2270 if ((p_ptr->action == ACTION_LEARN) || (p_ptr->action == ACTION_HAYAGAKE)) upkeep_regen -= regen_amount;
2271 regenmana(upkeep_regen/100);
2273 #ifdef TRACK_FRIENDS
2277 msg_format("£Í£Ð²óÉü: %d/%d", upkeep_regen, regen_amount);
2279 msg_format("Regen: %d/%d", upkeep_regen, regen_amount);
2283 #endif /* TRACK_FRIENDS */
2286 else if (p_ptr->action != ACTION_LEARN)
2288 regenmana(regen_amount);
2291 if (p_ptr->pclass == CLASS_MAGIC_EATER)
2293 regenmagic(regen_amount);
2296 if ((p_ptr->csp == 0) && (p_ptr->csp_frac == 0))
2298 while (upkeep_factor > 100)
2301 msg_print("¤³¤ó¤Ê¤Ë¿¤¯¤Î¥Ú¥Ã¥È¤òÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
2303 msg_print("Such much pets cannot be controled at once!");
2305 do_cmd_pet_dismiss();
2307 upkeep_factor = calculate_upkeep();
2310 msg_format("°Ý»ý£Í£Ð¤Ï %d%%", upkeep_factor);
2312 msg_format("Upkeep: %d%% mana.", upkeep_factor);
2318 /* Poisoned or cut yields no healing */
2319 if (p_ptr->poisoned) regen_amount = 0;
2320 if (p_ptr->cut) regen_amount = 0;
2322 /* Special floor -- Pattern, in a wall -- yields no healing */
2323 if (cave_no_regen) regen_amount = 0;
2325 regen_amount = (regen_amount * mutant_regenerate_mod) / 100;
2327 /* Regenerate Hit Points if needed */
2328 if ((p_ptr->chp < p_ptr->mhp) && !cave_no_regen)
2330 if ((cave[py][px].feat < FEAT_PATTERN_END) &&
2331 (cave[py][px].feat >= FEAT_PATTERN_START))
2333 regenhp(regen_amount / 5); /* Hmmm. this should never happen? */
2337 regenhp(regen_amount);
2342 /*** Timeout Various Things ***/
2345 if (p_ptr->tim_mimic)
2347 (void)set_mimic(p_ptr->tim_mimic - 1, p_ptr->mimic_form, TRUE);
2350 /* Hack -- Hallucinating */
2353 (void)set_image(p_ptr->image - dec_count);
2359 (void)set_blind(p_ptr->blind - dec_count);
2362 /* Times see-invisible */
2363 if (p_ptr->tim_invis)
2365 (void)set_tim_invis(p_ptr->tim_invis - 1, TRUE);
2376 (void)set_tim_esp(p_ptr->tim_esp - 1, TRUE);
2379 /* Timed temporary elemental brands. -LM- */
2380 if (p_ptr->ele_attack)
2382 p_ptr->ele_attack--;
2384 /* Clear all temporary elemental brands. */
2385 if (!p_ptr->ele_attack) set_ele_attack(0, 0);
2388 /* Timed temporary elemental immune. -LM- */
2389 if (p_ptr->ele_immune)
2391 p_ptr->ele_immune--;
2393 /* Clear all temporary elemental brands. */
2394 if (!p_ptr->ele_immune) set_ele_immune(0, 0);
2397 /* Timed infra-vision */
2398 if (p_ptr->tim_infra)
2400 (void)set_tim_infra(p_ptr->tim_infra - 1, TRUE);
2404 if (p_ptr->tim_stealth)
2406 (void)set_tim_stealth(p_ptr->tim_stealth - 1, TRUE);
2409 /* Timed levitation */
2410 if (p_ptr->tim_ffall)
2412 (void)set_tim_ffall(p_ptr->tim_ffall - 1, TRUE);
2415 /* Timed sh_touki */
2416 if (p_ptr->tim_sh_touki)
2418 (void)set_tim_sh_touki(p_ptr->tim_sh_touki - 1, TRUE);
2422 if (p_ptr->tim_sh_fire)
2424 (void)set_tim_sh_fire(p_ptr->tim_sh_fire - 1, TRUE);
2427 /* Timed resist-magic */
2428 if (p_ptr->resist_magic)
2430 (void)set_resist_magic(p_ptr->resist_magic - 1, TRUE);
2433 /* Timed regeneration */
2434 if (p_ptr->tim_regen)
2436 (void)set_tim_regen(p_ptr->tim_regen - 1, TRUE);
2439 /* Timed resist nether */
2440 if (p_ptr->tim_res_nether)
2442 (void)set_tim_res_nether(p_ptr->tim_res_nether - 1, TRUE);
2445 /* Timed resist time */
2446 if (p_ptr->tim_res_time)
2448 (void)set_tim_res_time(p_ptr->tim_res_time - 1, TRUE);
2452 if (p_ptr->tim_reflect)
2454 (void)set_tim_reflect(p_ptr->tim_reflect - 1, TRUE);
2458 if (p_ptr->multishadow)
2460 (void)set_multishadow(p_ptr->multishadow - 1, TRUE);
2463 /* Timed Robe of dust */
2464 if (p_ptr->dustrobe)
2466 (void)set_dustrobe(p_ptr->dustrobe - 1, TRUE);
2469 /* Timed infra-vision */
2470 if (p_ptr->kabenuke)
2472 (void)set_kabenuke(p_ptr->kabenuke - 1, TRUE);
2476 if (p_ptr->paralyzed)
2478 (void)set_paralyzed(p_ptr->paralyzed - dec_count);
2482 if (p_ptr->confused)
2484 (void)set_confused(p_ptr->confused - dec_count);
2490 (void)set_afraid(p_ptr->afraid - dec_count);
2496 (void)set_fast(p_ptr->fast - 1, TRUE);
2502 (void)set_slow(p_ptr->slow - dec_count, TRUE);
2505 /* Protection from evil */
2506 if (p_ptr->protevil)
2508 (void)set_protevil(p_ptr->protevil - 1, TRUE);
2511 /* Invulnerability */
2514 (void)set_invuln(p_ptr->invuln - 1, TRUE);
2518 if (p_ptr->wraith_form)
2520 (void)set_wraith_form(p_ptr->wraith_form - 1, TRUE);
2526 (void)set_hero(p_ptr->hero - 1, TRUE);
2532 (void)set_shero(p_ptr->shero - 1, TRUE);
2538 (void)set_blessed(p_ptr->blessed - 1, TRUE);
2544 (void)set_shield(p_ptr->shield - 1, TRUE);
2548 if (p_ptr->tsubureru)
2550 (void)set_tsubureru(p_ptr->tsubureru - 1, TRUE);
2554 if (p_ptr->magicdef)
2556 (void)set_magicdef(p_ptr->magicdef - 1, TRUE);
2560 if (p_ptr->tsuyoshi)
2562 (void)set_tsuyoshi(p_ptr->tsuyoshi - 1, TRUE);
2566 if (p_ptr->oppose_acid)
2568 (void)set_oppose_acid(p_ptr->oppose_acid - 1, TRUE);
2571 /* Oppose Lightning */
2572 if (p_ptr->oppose_elec)
2574 (void)set_oppose_elec(p_ptr->oppose_elec - 1, TRUE);
2578 if (p_ptr->oppose_fire)
2580 (void)set_oppose_fire(p_ptr->oppose_fire - 1, TRUE);
2584 if (p_ptr->oppose_cold)
2586 (void)set_oppose_cold(p_ptr->oppose_cold - 1, TRUE);
2590 if (p_ptr->oppose_pois)
2592 (void)set_oppose_pois(p_ptr->oppose_pois - 1, TRUE);
2597 (void)set_ultimate_res(p_ptr->ult_res - 1, TRUE);
2600 /*** Poison and Stun and Cut ***/
2603 if (p_ptr->poisoned)
2605 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2607 /* Apply some healing */
2608 (void)set_poisoned(p_ptr->poisoned - adjust);
2614 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2616 /* Apply some healing */
2617 (void)set_stun(p_ptr->stun - adjust);
2623 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2625 /* Hack -- Truly "mortal" wound */
2626 if (p_ptr->cut > 1000) adjust = 0;
2628 /* Apply some healing */
2629 (void)set_cut(p_ptr->cut - adjust);
2634 /*** Process Light ***/
2636 /* Check for light being wielded */
2637 o_ptr = &inventory[INVEN_LITE];
2639 /* Burn some fuel in the current lite */
2640 if (o_ptr->tval == TV_LITE)
2642 /* Hack -- Use some fuel (except on artifacts) */
2643 if (!(artifact_p(o_ptr) || o_ptr->sval == SV_LITE_FEANOR) && (o_ptr->xtra4 > 0))
2645 /* Decrease life-span */
2646 if (o_ptr->name2 == EGO_LITE_LONG)
2648 if (turn % 40) o_ptr->xtra4--;
2650 else o_ptr->xtra4--;
2652 /* Notice interesting fuel steps */
2653 notice_lite_change(o_ptr);
2657 /* Calculate torch radius */
2658 p_ptr->update |= (PU_TORCH);
2661 /*** Process mutation effects ***/
2662 if (p_ptr->muta2 && !p_ptr->inside_battle && !p_ptr->wild_mode)
2664 if ((p_ptr->muta2 & MUT2_BERS_RAGE) && (randint(3000) == 1))
2668 msg_print("¥¦¥¬¥¡¥¡¥¢¡ª");
2669 msg_print("·ãÅܤÎȯºî¤Ë½±¤ï¤ì¤¿¡ª");
2671 msg_print("RAAAAGHH!");
2672 msg_print("You feel a fit of rage coming over you!");
2675 (void)set_shero(10 + randint(p_ptr->lev), FALSE);
2678 if ((p_ptr->muta2 & MUT2_COWARDICE) && (randint(3000) == 13))
2680 if (!(p_ptr->resist_fear || p_ptr->hero || p_ptr->shero))
2684 msg_print("¤È¤Æ¤â°Å¤¤... ¤È¤Æ¤â¶²¤¤¡ª");
2686 msg_print("It's so dark... so scary!");
2689 set_afraid(p_ptr->afraid + 13 + randint(26));
2693 if ((p_ptr->muta2 & MUT2_RTELEPORT) && (randint(5000) == 88))
2695 if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) &&
2700 /* Teleport player */
2702 msg_print("¤¢¤Ê¤¿¤Î°ÌÃÖ¤ÏÆÍÁ³¤Ò¤¸¤ç¤¦¤ËÉÔ³ÎÄê¤Ë¤Ê¤Ã¤¿...");
2704 msg_print("Your position suddenly seems very uncertain...");
2708 teleport_player(40);
2712 if ((p_ptr->muta2 & MUT2_ALCOHOL) && (randint(6400) == 321))
2714 if (!p_ptr->resist_conf && !p_ptr->resist_chaos)
2717 p_ptr->redraw |= PR_EXTRA;
2719 msg_print("¤¤¤Ò¤¤¬¤â¡¼¤í¡¼¤È¤Ò¤Æ¤¤¿¤¤¬¤Õ¤ë...¥Ò¥Ã¥¯¡ª");
2721 msg_print("You feel a SSSCHtupor cOmINg over yOu... *HIC*!");
2726 if (!p_ptr->resist_conf)
2728 (void)set_confused(p_ptr->confused + rand_int(20) + 15);
2731 if (!p_ptr->resist_chaos)
2736 if (one_in_(3)) lose_all_info();
2738 teleport_player(100);
2741 msg_print("¤¢¤Ê¤¿¤Ï¸«ÃΤé¤Ì¾ì½ê¤ÇÌܤ¬Àä᤿...Ƭ¤¬Äˤ¤¡£");
2742 msg_print("²¿¤â³Ð¤¨¤Æ¤¤¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ËÍ褿¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
2744 msg_print("You wake up somewhere with a sore head...");
2745 msg_print("You can't remember a thing, or how you got here!");
2754 msg_print("¤¡Á¤ì¤¤¤Ê¤Á¤ç¤ª¤Á¤ç¤é¤È¤ó¤ì¤¤¤ë¡Á");
2756 msg_print("Thishcischs GooDSChtuff!");
2759 (void)set_image(p_ptr->image + rand_int(150) + 150);
2765 if ((p_ptr->muta2 & MUT2_HALLU) && (randint(6400) == 42))
2767 if (!p_ptr->resist_chaos)
2770 p_ptr->redraw |= PR_EXTRA;
2771 (void)set_image(p_ptr->image + rand_int(50) + 20);
2775 if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint(3000) == 13))
2780 msg_print("¥Ö¥¥¡¼¡¼¥Ã¡ª¤ª¤Ã¤È¡£");
2782 msg_print("BRRAAAP! Oops.");
2786 fire_ball(GF_POIS, 0, p_ptr->lev, 3);
2789 if ((p_ptr->muta2 & MUT2_PROD_MANA) &&
2790 !p_ptr->anti_magic && (randint(9000) == 1))
2795 msg_print("ËâË¡¤Î¥¨¥Í¥ë¥®¡¼¤¬ÆÍÁ³¤¢¤Ê¤¿¤ÎÃæ¤Ëή¤ì¹þ¤ó¤Ç¤¤¿¡ª¥¨¥Í¥ë¥®¡¼¤ò²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡ª");
2797 msg_print("Magical energy flows through you! You must release it!");
2802 (void)get_hack_dir(&dire);
2803 fire_ball(GF_MANA, dire, p_ptr->lev * 2, 3);
2806 if ((p_ptr->muta2 & MUT2_ATT_DEMON) &&
2807 !p_ptr->anti_magic && (randint(6666) == 666))
2809 bool pet = (randint(6) == 1);
2810 bool not_pet = (bool)(!pet);
2812 if (summon_specific((pet ? -1 : 0), py, px,
2813 dun_level, SUMMON_DEMON, TRUE, FALSE, pet, not_pet, not_pet))
2816 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤ò°ú¤´ó¤»¤¿¡ª");
2818 msg_print("You have attracted a demon!");
2825 if ((p_ptr->muta2 & MUT2_SPEED_FLUX) && (randint(6000) == 1))
2828 if (randint(2) == 1)
2831 msg_print("ÀºÎÏŪ¤Ç¤Ê¤¯¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2833 msg_print("You feel less energetic.");
2836 if (p_ptr->fast > 0)
2842 set_slow(randint(30) + 10, FALSE);
2848 msg_print("ÀºÎÏŪ¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2850 msg_print("You feel more energetic.");
2853 if (p_ptr->slow > 0)
2859 set_fast(randint(30) + 10, FALSE);
2864 if ((p_ptr->muta2 & MUT2_BANISH_ALL) && (randint(9000) == 1))
2868 msg_print("ÆÍÁ³¤Û¤È¤ó¤É¸ÉÆȤˤʤ俵¤¤¬¤¹¤ë¡£");
2870 msg_print("You suddenly feel almost lonely.");
2873 banish_monsters(100);
2874 if (!dun_level && p_ptr->town_num)
2877 msg_print("Ź¤Î¼ç¿Í¤¬µÖ¤Ë¸þ¤«¤Ã¤ÆÁö¤Ã¤Æ¤¤¤ë¡ª");
2879 msg_print("You see one of the shopkeepers running for the hills!");
2882 store_shuffle(rand_int(MAX_STORES));
2887 if ((p_ptr->muta2 & MUT2_EAT_LIGHT) && one_in_(3000))
2892 msg_print("±Æ¤Ë¤Ä¤Ä¤Þ¤ì¤¿¡£");
2894 msg_print("A shadow passes over you.");
2899 /* Absorb light from the current possition */
2900 if (cave[py][px].info & CAVE_GLOW)
2905 o_ptr = &inventory[INVEN_LITE];
2907 /* Absorb some fuel in the current lite */
2908 if (o_ptr->tval == TV_LITE)
2910 /* Use some fuel (except on artifacts) */
2911 if (!artifact_p(o_ptr) && (o_ptr->xtra4 > 0))
2913 /* Heal the player a bit */
2914 hp_player(o_ptr->xtra4 / 20);
2916 /* Decrease life-span of lite */
2920 msg_print("¸÷¸»¤«¤é¥¨¥Í¥ë¥®¡¼¤òµÛ¼ý¤·¤¿¡ª");
2922 msg_print("You absorb energy from your light!");
2926 /* Notice interesting fuel steps */
2927 notice_lite_change(o_ptr);
2932 * Unlite the area (radius 10) around player and
2933 * do 50 points damage to every affected monster
2935 unlite_area(50, 10);
2938 if ((p_ptr->muta2 & MUT2_ATT_ANIMAL) &&
2939 !p_ptr->anti_magic && one_in_(7000))
2941 bool pet = (randint(3) == 1);
2942 bool not_pet = (bool)(!pet);
2944 if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_ANIMAL,
2945 TRUE, FALSE, pet, not_pet, not_pet))
2948 msg_print("ưʪ¤ò°ú¤´ó¤»¤¿¡ª");
2950 msg_print("You have attracted an animal!");
2957 if ((p_ptr->muta2 & MUT2_RAW_CHAOS) &&
2958 !p_ptr->anti_magic && one_in_(8000))
2962 msg_print("¼þ¤ê¤Î¶õ´Ö¤¬ÏĤó¤Ç¤¤¤ëµ¤¤¬¤¹¤ë¡ª");
2964 msg_print("You feel the world warping around you!");
2968 fire_ball(GF_CHAOS, 0, p_ptr->lev, 8);
2970 if ((p_ptr->muta2 & MUT2_NORMALITY) && one_in_(5000))
2972 if (!lose_mutation(0))
2974 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
2976 msg_print("You feel oddly normal.");
2980 if ((p_ptr->muta2 & MUT2_WRAITH) && !p_ptr->anti_magic && one_in_(3000))
2984 msg_print("Èóʪ¼Á²½¤·¤¿¡ª");
2986 msg_print("You feel insubstantial!");
2990 set_wraith_form(randint(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE);
2992 if ((p_ptr->muta2 & MUT2_POLY_WOUND) && one_in_(3000))
2996 if ((p_ptr->muta2 & MUT2_WASTING) && one_in_(3000))
2998 int which_stat = rand_int(6);
2999 int sustained = FALSE;
3004 if (p_ptr->sustain_str) sustained = TRUE;
3007 if (p_ptr->sustain_int) sustained = TRUE;
3010 if (p_ptr->sustain_wis) sustained = TRUE;
3013 if (p_ptr->sustain_dex) sustained = TRUE;
3016 if (p_ptr->sustain_con) sustained = TRUE;
3019 if (p_ptr->sustain_chr) sustained = TRUE;
3023 msg_print("ÉÔÀµ¤Ê¾õÂÖ¡ª");
3025 msg_print("Invalid stat chosen!");
3035 msg_print("¼«Ê¬¤¬¿ê¼å¤·¤Æ¤¤¤¯¤Î¤¬Ê¬¤«¤ë¡ª");
3037 msg_print("You can feel yourself wasting away!");
3041 (void)dec_stat(which_stat, randint(6) + 6, randint(3) == 1);
3044 if ((p_ptr->muta2 & MUT2_ATT_DRAGON) &&
3045 !p_ptr->anti_magic && one_in_(3000))
3047 bool pet = (randint(5) == 1);
3048 bool not_pet = (bool)(!pet);
3050 if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_DRAGON,
3051 TRUE, FALSE, pet, not_pet, not_pet))
3054 msg_print("¥É¥é¥´¥ó¤ò°ú¤´ó¤»¤¿¡ª");
3056 msg_print("You have attracted a dragon!");
3062 if ((p_ptr->muta2 & MUT2_WEIRD_MIND) && !p_ptr->anti_magic &&
3065 if (p_ptr->tim_esp > 0)
3068 msg_print("Àº¿À¤Ë¤â¤ä¤¬¤«¤«¤Ã¤¿¡ª");
3070 msg_print("Your mind feels cloudy!");
3073 set_tim_esp(0, TRUE);
3078 msg_print("Àº¿À¤¬¹¤¬¤Ã¤¿¡ª");
3080 msg_print("Your mind expands!");
3083 set_tim_esp(p_ptr->lev, FALSE);
3086 if ((p_ptr->muta2 & MUT2_NAUSEA) && !p_ptr->slow_digest &&
3091 msg_print("°ß¤¬áÛÚ»¤·¡¢¿©»ö¤ò¼º¤Ã¤¿¡ª");
3093 msg_print("Your stomach roils, and you lose your lunch!");
3097 set_food(PY_FOOD_WEAK);
3100 if ((p_ptr->muta2 & MUT2_WALK_SHAD) &&
3101 !p_ptr->anti_magic && one_in_(12000) && !p_ptr->inside_arena)
3106 if ((p_ptr->muta2 & MUT2_WARNING) && one_in_(1000))
3108 int danger_amount = 0;
3111 for (monster = 0; monster < m_max; monster++)
3113 monster_type *m_ptr = &m_list[monster];
3114 monster_race *r_ptr = &r_info[m_ptr->r_idx];
3116 /* Paranoia -- Skip dead monsters */
3117 if (!m_ptr->r_idx) continue;
3119 if (r_ptr->level >= p_ptr->lev)
3121 danger_amount += r_ptr->level - p_ptr->lev + 1;
3125 if (danger_amount > 100)
3127 msg_print("Èó¾ï¤Ë¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
3129 msg_print("You feel utterly terrified!");
3132 else if (danger_amount > 50)
3134 msg_print("¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
3136 msg_print("You feel terrified!");
3139 else if (danger_amount > 20)
3141 msg_print("Èó¾ï¤Ë¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
3143 msg_print("You feel very worried!");
3146 else if (danger_amount > 10)
3148 msg_print("¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
3150 msg_print("You feel paranoid!");
3153 else if (danger_amount > 5)
3155 msg_print("¤Û¤È¤ó¤É°ÂÁ´¤Êµ¤¤¬¤¹¤ë¡£");
3157 msg_print("You feel almost safe.");
3162 msg_print("¼ä¤·¤¤µ¤¤¬¤¹¤ë¡£");
3164 msg_print("You feel lonely.");
3168 if ((p_ptr->muta2 & MUT2_INVULN) && !p_ptr->anti_magic &&
3173 msg_print("̵Ũ¤Êµ¤¤¬¤¹¤ë¡ª");
3175 msg_print("You feel invincible!");
3179 (void)set_invuln(randint(8) + 8, FALSE);
3181 if ((p_ptr->muta2 & MUT2_SP_TO_HP) && one_in_(2000))
3183 int wounds = p_ptr->mhp - p_ptr->chp;
3187 int healing = p_ptr->csp;
3189 if (healing > wounds)
3195 p_ptr->csp -= healing;
3198 if ((p_ptr->muta2 & MUT2_HP_TO_SP) && !p_ptr->anti_magic &&
3201 int wounds = p_ptr->msp - p_ptr->csp;
3205 int healing = p_ptr->chp;
3207 if (healing > wounds)
3212 p_ptr->csp += healing;
3214 take_hit(DAMAGE_LOSELIFE, healing, "Ƭ¤Ë¾º¤Ã¤¿·ì", -1);
3216 take_hit(DAMAGE_LOSELIFE, healing, "blood rushing to the head", -1);
3221 if ((p_ptr->muta2 & MUT2_DISARM) && one_in_(10000))
3227 msg_print("¤¬¤â¤Ä¤ì¤Æž¤ó¤À¡ª");
3228 take_hit(DAMAGE_NOESCAPE, randint(p_ptr->wt / 6), "žÅÝ", -1);
3230 msg_print("You trip over your own feet!");
3231 take_hit(DAMAGE_NOESCAPE, randint(p_ptr->wt / 6), "tripping", -1);
3236 if (buki_motteruka(INVEN_RARM))
3238 int slot = INVEN_RARM;
3239 o_ptr = &inventory[INVEN_RARM];
3240 if (buki_motteruka(INVEN_LARM) && one_in_(2))
3242 o_ptr = &inventory[INVEN_LARM];
3245 if (!cursed_p(o_ptr))
3248 msg_print("Éð´ï¤òÍ¤Æ¤·¤Þ¤Ã¤¿¡ª");
3250 msg_print("You drop your weapon!");
3253 inven_drop(slot, 1);
3260 /*** Process Inventory ***/
3262 /* Handle experience draining */
3263 if (p_ptr->exp_drain)
3265 if (rand_int(100) < 25)
3267 p_ptr->exp -= (p_ptr->lev+1)/2;
3268 if (p_ptr->exp < 0) p_ptr->exp = 0;
3269 p_ptr->max_exp -= (p_ptr->lev+1)/2;
3270 if (p_ptr->max_exp < 0) p_ptr->max_exp = 0;
3275 /* Rarely, take damage from the Jewel of Judgement */
3276 if ((randint(999) == 1) && !p_ptr->anti_magic)
3278 if ((inventory[INVEN_LITE].tval) &&
3279 (inventory[INVEN_LITE].sval == SV_LITE_THRAIN))
3282 msg_print("¡Ø¿³È½¤ÎÊõÀС٤Ϥ¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª");
3283 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "¿³È½¤ÎÊõÀÐ", -1);
3285 msg_print("The Jewel of Judgement drains life from you!");
3286 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "the Jewel of Judgement", -1);
3293 /* Process equipment */
3294 for (j = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
3296 /* Get the object */
3297 o_ptr = &inventory[i];
3299 object_flags(o_ptr, &f1, &f2, &f3);
3301 /* Skip non-objects */
3302 if (!o_ptr->k_idx) continue;
3304 if (!p_ptr->inside_battle)
3307 if ((f3 & TR3_TY_CURSE) && (randint(TY_CURSE_CHANCE) == 1))
3311 (void)activate_ty_curse(FALSE, &count);
3314 /* Make a chainsword noise */
3315 if ((o_ptr->name1 == ART_CHAINSWORD) && randint(CHAINSWORD_NOISE) == 1)
3319 if (!get_rnd_line("chainswd_j.txt", 0, noise))
3321 if (!get_rnd_line("chainswd.txt", 0, noise))
3325 disturb(FALSE, FALSE);
3329 * Hack: Uncursed teleporting items (e.g. Trump Weapons)
3330 * can actually be useful!
3332 if ((f3 & TR3_TELEPORT) && (rand_int(100) < 1))
3334 if ((o_ptr->ident & IDENT_CURSED) && !p_ptr->anti_tele)
3338 /* Teleport player */
3339 teleport_player(40);
3343 if (p_ptr->wild_mode || (o_ptr->inscription &&
3344 (strchr(quark_str(o_ptr->inscription),'.'))))
3347 /* msg_print("Teleport aborted.") */ ;
3350 else if (get_check_strict("¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©", 1))
3352 else if (get_check("Teleport? "))
3357 teleport_player(50);
3363 /* Recharge activatable objects */
3364 if (o_ptr->timeout > 0)
3369 /* Notice changes */
3370 if (!o_ptr->timeout)
3372 recharged_notice(o_ptr);
3378 /* Notice changes */
3382 p_ptr->window |= (PW_EQUIP);
3387 * Recharge rods. Rods now use timeout to control charging status,
3388 * and each charging rod in a stack decreases the stack's timeout by
3389 * one per turn. -LM-
3391 for (j = 0, i = 0; i < INVEN_PACK; i++)
3393 o_ptr = &inventory[i];
3394 k_ptr = &k_info[o_ptr->k_idx];
3396 /* Skip non-objects */
3397 if (!o_ptr->k_idx) continue;
3399 /* Examine all charging rods or stacks of charging rods. */
3400 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
3402 /* Determine how many rods are charging. */
3403 temp = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
3404 if (temp > o_ptr->number) temp = o_ptr->number;
3406 /* Decrease timeout by that number. */
3407 o_ptr->timeout -= temp;
3409 /* Boundary control. */
3410 if (o_ptr->timeout < 0) o_ptr->timeout = 0;
3412 /* Notice changes, provide message if object is inscribed. */
3413 if (!(o_ptr->timeout))
3415 recharged_notice(o_ptr);
3421 /* Notice changes */
3425 p_ptr->notice |= (PN_COMBINE);
3428 p_ptr->window |= (PW_INVEN);
3432 /* Feel the inventory */
3437 /*** Process Objects ***/
3439 /* Process objects */
3440 for (i = 1; i < o_max; i++)
3445 /* Skip dead objects */
3446 if (!o_ptr->k_idx) continue;
3448 /* Recharge rods on the ground. No messages. */
3449 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
3452 o_ptr->timeout -= o_ptr->number;
3454 /* Boundary control. */
3455 if (o_ptr->timeout < 0) o_ptr->timeout = 0;
3460 /*** Involuntary Movement ***/
3462 /* Delayed Word-of-Recall */
3463 if (p_ptr->word_recall)
3466 * HACK: Autosave BEFORE resetting the recall counter (rr9)
3467 * The player is yanked up/down as soon as
3468 * he loads the autosaved game.
3470 if (autosave_l && (p_ptr->word_recall == 1) && !p_ptr->inside_battle)
3471 do_cmd_save_game(TRUE);
3473 /* Count down towards recall */
3474 p_ptr->word_recall--;
3476 p_ptr->redraw |= (PR_STATUS);
3478 /* Activate the recall */
3479 if (!p_ptr->word_recall)
3484 /* Determine the level */
3485 if (dun_level || p_ptr->inside_quest)
3488 msg_print("¾å¤Ë°ú¤ÃÄ¥¤ê¤¢¤²¤é¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
3490 msg_print("You feel yourself yanked upwards!");
3493 p_ptr->recall_dungeon = dungeon_type;
3495 do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
3500 leaving_quest = p_ptr->inside_quest;
3502 /* Leaving an 'only once' quest marks it as failed */
3503 if (leaving_quest &&
3504 ((quest[leaving_quest].flags & QUEST_FLAG_ONCE) || (quest[leaving_quest].type == QUEST_TYPE_RANDOM)) &&
3505 (quest[leaving_quest].status == QUEST_STATUS_TAKEN))
3507 quest[leaving_quest].status = QUEST_STATUS_FAILED;
3508 quest[leaving_quest].complev = (byte)p_ptr->lev;
3509 if (quest[leaving_quest].type == QUEST_TYPE_RANDOM)
3511 r_info[quest[leaving_quest].r_idx].flags1 &= ~(RF1_QUESTOR);
3512 if (record_rand_quest)
3513 do_cmd_write_nikki(NIKKI_RAND_QUEST_F, leaving_quest, NULL);
3515 else if (record_fix_quest)
3516 do_cmd_write_nikki(NIKKI_FIX_QUEST_F, leaving_quest, NULL);
3519 p_ptr->inside_quest = 0;
3520 p_ptr->leaving = TRUE;
3525 msg_print("²¼¤Ë°ú¤¤º¤ê¹ß¤í¤µ¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
3527 msg_print("You feel yourself yanked downwards!");
3530 dungeon_type = p_ptr->recall_dungeon;
3533 do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
3536 dun_level = max_dlv[dungeon_type];
3537 if (dun_level < 1) dun_level = 1;
3539 /* Nightmare mode makes recall more dangerous */
3540 if (ironman_nightmare && !rand_int(666) && (dungeon_type == DUNGEON_ANGBAND))
3546 else if (dun_level < 99)
3548 dun_level = (dun_level + 99) / 2;
3550 else if (dun_level > 100)
3552 dun_level = d_info[dungeon_type].maxdepth - 1;
3556 if (p_ptr->wild_mode)
3558 p_ptr->wilderness_y = py;
3559 p_ptr->wilderness_x = px;
3563 /* Save player position */
3567 p_ptr->wild_mode = FALSE;
3570 p_ptr->leaving = TRUE;
3572 if (dungeon_type == DUNGEON_ANGBAND)
3574 for (i = MIN_RANDOM_QUEST; i < MAX_RANDOM_QUEST + 1; i++)
3576 if ((quest[i].type == QUEST_TYPE_RANDOM) &&
3577 (quest[i].status == QUEST_STATUS_TAKEN) &&
3578 (quest[i].level < dun_level))
3580 quest[i].status = QUEST_STATUS_FAILED;
3581 quest[i].complev = (byte)p_ptr->lev;
3582 r_info[quest[i].r_idx].flags1 &= ~(RF1_QUESTOR);
3589 sound(SOUND_TPLEVEL);
3597 * Verify use of "wizard" mode
3599 static bool enter_wizard_mode(void)
3601 /* Ask first time */
3604 /* Mention effects */
3606 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥â¡¼¥É¤Ç¤¹¡£ ");
3607 msg_print("°ìÅÙ¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ë¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3609 msg_print("Wizard mode is for debugging and experimenting.");
3610 msg_print("The game will not be scored if you enter wizard mode.");
3615 /* Verify request */
3617 if (!get_check("ËÜÅö¤Ë¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ê¤¿¤¤¤Î¤Ç¤¹¤«? "))
3619 if (!get_check("Are you sure you want to enter wizard mode? "))
3638 * Verify use of "debug" commands
3640 static bool enter_debug_mode(void)
3642 /* Ask first time */
3645 /* Mention effects */
3647 msg_print("¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ ");
3648 msg_print("¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3650 msg_print("The debug commands are for debugging and experimenting.");
3651 msg_print("The game will not be scored if you use debug commands.");
3656 /* Verify request */
3658 if (!get_check("ËÜÅö¤Ë¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? "))
3660 if (!get_check("Are you sure you want to use debug commands? "))
3668 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥Ç¥Ð¥Ã¥°¥â¡¼¥É¤ËÆÍÆþ¤·¤Æ¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
3670 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use debug commands.");
3681 * Hack -- Declare the Debug Routines
3683 extern void do_cmd_debug(void);
3685 #endif /* ALLOW_WIZARD */
3691 * Verify use of "borg" commands
3693 static bool enter_borg_mode(void)
3695 /* Ask first time */
3696 if (!(noscore & 0x0010))
3698 /* Mention effects */
3700 msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ ");
3701 msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3703 msg_print("The borg commands are for debugging and experimenting.");
3704 msg_print("The game will not be scored if you use borg commands.");
3709 /* Verify request */
3711 if (!get_check("ËÜÅö¤Ë¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? "))
3713 if (!get_check("Are you sure you want to use borg commands? "))
3729 * Hack -- Declare the Ben Borg
3731 extern void do_cmd_borg(void);
3733 #endif /* ALLOW_BORG */
3738 * Parse and execute the current command
3739 * Give "Warning" on illegal commands.
3741 * XXX XXX XXX Make some "blocks"
3743 static void process_command(void)
3745 int old_now_message = now_message;
3747 #ifdef ALLOW_REPEAT /* TNB */
3749 /* Handle repeating the last command */
3752 #endif /* ALLOW_REPEAT -- TNB */
3756 /* Parse the command */
3757 switch (command_cmd)
3773 /*** Wizard Commands ***/
3775 /* Toggle Wizard Mode */
3782 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É²ò½ü¡£");
3784 msg_print("Wizard mode off.");
3788 else if (enter_wizard_mode())
3792 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥ÉÆÍÆþ¡£");
3794 msg_print("Wizard mode on.");
3799 /* Update monsters */
3800 p_ptr->update |= (PU_MONSTERS);
3802 /* Redraw "title" */
3803 p_ptr->redraw |= (PR_TITLE);
3811 /* Special "debug" commands */
3814 /* Enter debug mode */
3815 if (enter_debug_mode())
3822 #endif /* ALLOW_WIZARD */
3827 /* Special "borg" commands */
3830 /* Enter borg mode */
3831 if (enter_borg_mode())
3833 if (!p_ptr->wild_mode) do_cmd_borg();
3839 #endif /* ALLOW_BORG */
3843 /*** Inventory Commands ***/
3845 /* Wear/wield equipment */
3848 if (!p_ptr->wild_mode) do_cmd_wield();
3852 /* Take off equipment */
3855 if (!p_ptr->wild_mode) do_cmd_takeoff();
3862 if (!p_ptr->wild_mode) do_cmd_drop();
3866 /* Destroy an item */
3873 /* Equipment list */
3880 /* Inventory list */
3888 /*** Various commands ***/
3890 /* Identify an object */
3897 /* Hack -- toggle windows */
3900 toggle_inven_equip();
3905 /*** Standard "Movement" Commands ***/
3910 if (!p_ptr->wild_mode) do_cmd_alter();
3917 if (!p_ptr->wild_mode) do_cmd_tunnel();
3921 /* Move (usually pick up things) */
3924 #ifdef ALLOW_EASY_DISARM /* TNB */
3928 #else /* ALLOW_EASY_DISARM -- TNB */
3930 do_cmd_walk(always_pickup);
3932 #endif /* ALLOW_EASY_DISARM -- TNB */
3937 /* Move (usually do not pick up) */
3940 #ifdef ALLOW_EASY_DISARM /* TNB */
3944 #else /* ALLOW_EASY_DISARM -- TNB */
3946 do_cmd_walk(!always_pickup);
3948 #endif /* ALLOW_EASY_DISARM -- TNB */
3954 /*** Running, Resting, Searching, Staying */
3956 /* Begin Running -- Arg is Max Distance */
3959 if (!p_ptr->wild_mode) do_cmd_run();
3963 /* Stay still (usually pick things up) */
3966 do_cmd_stay(always_pickup);
3970 /* Stay still (usually do not pick up) */
3973 do_cmd_stay(!always_pickup);
3977 /* Rest -- Arg is time */
3984 /* Search for traps/doors */
3991 /* Toggle search mode */
3994 if (p_ptr->action == ACTION_SEARCH) set_action(ACTION_NONE);
3995 else set_action(ACTION_SEARCH);
4000 /*** Stairs and Doors and Chests and Traps ***/
4005 if (!p_ptr->wild_mode) do_cmd_store();
4009 /* Enter building -KMW- */
4012 if (!p_ptr->wild_mode) do_cmd_bldg();
4016 /* Enter quest level -KMW- */
4019 if (!p_ptr->wild_mode) do_cmd_quest();
4023 /* Go up staircase */
4026 if(!p_ptr->wild_mode && !dun_level && !p_ptr->inside_arena && !p_ptr->inside_quest)
4033 msg_print("½±·â¤«¤éƨ¤²¤ë¤Ë¤Ï¥Þ¥Ã¥×¤Îü¤Þ¤Ç°ÜÆ°¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£");
4035 msg_print("To flee the ambush you have to reach the edge of the map.");
4038 else if (p_ptr->food < PY_FOOD_WEAK)
4041 msg_print("¤½¤ÎÁ°¤Ë¿©»ö¤ò¤È¤é¤Ê¤¤¤È¡£");
4043 msg_print("You must eat something here.");
4048 if (change_wild_mode())
4061 /* Go down staircase */
4064 if(!p_ptr->wild_mode) do_cmd_go_down();
4067 p_ptr->wilderness_x = px;
4068 p_ptr->wilderness_y = py;
4074 /* Open a door or chest */
4077 if (!p_ptr->wild_mode) do_cmd_open();
4084 if (!p_ptr->wild_mode) do_cmd_close();
4088 /* Jam a door with spikes */
4091 if (!p_ptr->wild_mode) do_cmd_spike();
4098 if (!p_ptr->wild_mode) do_cmd_bash();
4102 /* Disarm a trap or chest */
4105 if (!p_ptr->wild_mode) do_cmd_disarm();
4110 /*** Magic and Prayers ***/
4112 /* Gain new spells/prayers */
4115 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4117 msg_print("¼öʸ¤ò³Ø½¬¤¹¤ëɬÍפϤʤ¤¡ª");
4119 msg_print("You don't have to learn spells!");
4121 else if (p_ptr->pclass == CLASS_SAMURAI)
4122 do_cmd_gain_hissatsu();
4123 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4133 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
4134 (p_ptr->pclass == CLASS_BERSERKER) ||
4135 (p_ptr->pclass == CLASS_NINJA) ||
4136 (p_ptr->pclass == CLASS_MIRROR_MASTER)
4137 ) do_cmd_mind_browse();
4138 else if (p_ptr->pclass == CLASS_SMITH)
4140 else do_cmd_browse();
4148 if (!p_ptr->wild_mode)
4150 if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_ARCHER) || (p_ptr->pclass == CLASS_CAVALRY))
4153 msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4155 msg_print("You cannot cast spells!");
4158 else if (dun_level && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
4161 msg_print("¥À¥ó¥¸¥ç¥ó¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4163 msg_print("The arena absorbs all attempted magic!");
4167 else if (p_ptr->anti_magic && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
4171 cptr which_power = "ËâË¡";
4173 cptr which_power = "magic";
4175 if (p_ptr->pclass == CLASS_MINDCRAFTER)
4177 which_power = "ĶǽÎÏ";
4179 which_power = "psionic powers";
4181 else if (p_ptr->pclass == CLASS_IMITATOR)
4183 which_power = "¤â¤Î¤Þ¤Í";
4185 which_power = "imitation";
4187 else if (p_ptr->pclass == CLASS_SAMURAI)
4189 which_power = "ɬ»¦·õ";
4191 which_power = "hissatsu";
4193 else if (p_ptr->pclass == CLASS_MIRROR_MASTER)
4195 which_power = "¶ÀËâË¡";
4197 which_power = "mirror magic";
4199 else if (p_ptr->pclass == CLASS_NINJA)
4201 which_power = "Ǧ½Ñ";
4203 which_power = "ninjutsu";
4205 else if (mp_ptr->spell_book == TV_LIFE_BOOK)
4207 which_power = "µ§¤ê";
4209 which_power = "prayer";
4213 msg_format("È¿ËâË¡¥Ð¥ê¥¢¤¬%s¤ò¼ÙË⤷¤¿¡ª", which_power);
4215 msg_format("An anti-magic shell disrupts your %s!", which_power);
4219 else if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER))
4222 msg_format("¶¸Àï»Î²½¤·¤Æ¤¤¤ÆƬ¤¬²ó¤é¤Ê¤¤¡ª");
4224 msg_format("You cannot think directly!");
4230 if ((p_ptr->pclass == CLASS_MINDCRAFTER) ||
4231 (p_ptr->pclass == CLASS_BERSERKER) ||
4232 (p_ptr->pclass == CLASS_NINJA) ||
4233 (p_ptr->pclass == CLASS_MIRROR_MASTER)
4236 else if (p_ptr->pclass == CLASS_IMITATOR)
4238 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4239 do_cmd_magic_eater();
4240 else if (p_ptr->pclass == CLASS_SAMURAI)
4242 else if (p_ptr->pclass == CLASS_BLUE_MAGE)
4243 do_cmd_cast_learned();
4244 else if (p_ptr->pclass == CLASS_SMITH)
4253 /* Issue a pet command */
4256 if (!p_ptr->wild_mode) do_cmd_pet();
4260 /*** Use various objects ***/
4262 /* Inscribe an object */
4269 /* Uninscribe an object */
4272 do_cmd_uninscribe();
4276 /* Activate an artifact */
4279 if (!p_ptr->wild_mode)
4281 if (!p_ptr->inside_arena)
4286 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4288 msg_print("The arena absorbs all attempted magic!");
4304 /* Fuel your lantern/torch */
4314 if (!p_ptr->wild_mode) do_cmd_fire();
4321 if (!p_ptr->wild_mode)
4323 if (!p_ptr->inside_arena)
4328 msg_print("¥¢¥ê¡¼¥Ê¤Ç¤Ï¥¢¥¤¥Æ¥à¤ò»È¤¨¤Ê¤¤¡ª");
4330 msg_print("You're in the arena now. This is hand-to-hand!");
4342 if (!p_ptr->wild_mode)
4344 if (!p_ptr->inside_arena)
4349 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4351 msg_print("The arena absorbs all attempted magic!");
4363 if (!p_ptr->wild_mode)
4365 if (p_ptr->inside_arena)
4368 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4370 msg_print("The arena absorbs all attempted magic!");
4375 else if (use_command && rogue_like_commands)
4387 /* Quaff a potion */
4390 if (!p_ptr->wild_mode)
4392 if (!p_ptr->inside_arena)
4393 do_cmd_quaff_potion();
4397 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4399 msg_print("The arena absorbs all attempted magic!");
4411 if (!p_ptr->wild_mode)
4413 if (!p_ptr->inside_arena)
4414 do_cmd_read_scroll();
4418 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4420 msg_print("The arena absorbs all attempted magic!");
4432 if (!p_ptr->wild_mode)
4434 if (p_ptr->inside_arena)
4437 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4439 msg_print("The arena absorbs all attempted magic!");
4444 else if (use_command && !rogue_like_commands)
4454 /* Use racial power */
4457 if (!p_ptr->wild_mode) do_cmd_racial_power();
4462 /*** Looking at Things (nearby or on map) ***/
4464 /* Full dungeon map */
4471 /* Locate player on map */
4485 /* Target monster or location */
4488 if (!p_ptr->wild_mode) do_cmd_target();
4494 /*** Help and Such ***/
4503 /* Identify symbol */
4506 do_cmd_query_symbol();
4510 /* Character description */
4513 do_cmd_change_name();
4518 /*** System Commands ***/
4520 /* Hack -- User interface */
4527 /* Single line from a pref file */
4540 /* Interact with macros */
4547 /* Interact with visuals */
4555 /* Interact with colors */
4563 /* Interact with options */
4571 /*** Misc Commands ***/
4587 /* Repeat level feeling */
4590 if (!p_ptr->wild_mode) do_cmd_feeling();
4594 /* Show previous message */
4597 do_cmd_message_one();
4601 /* Show previous messages */
4604 do_cmd_messages(old_now_message);
4608 /* Show quest status -KMW- */
4611 do_cmd_checkquest();
4615 /* Redraw the screen */
4618 now_message = old_now_message;
4623 #ifndef VERIFY_SAVEFILE
4625 /* Hack -- Save and don't quit */
4628 do_cmd_save_game(FALSE);
4632 #endif /* VERIFY_SAVEFILE */
4643 do_cmd_save_and_exit();
4647 /* Quit (commit suicide) */
4660 /* Check artifacts, uniques, objects */
4667 /* Load "screen dump" */
4670 do_cmd_load_screen();
4674 /* Save "screen dump" */
4677 do_cmd_save_screen();
4681 /* Make random artifact list */
4684 spoil_random_artifact("randifact.txt");
4688 /* Hack -- Unknown command */
4691 if (flush_failure) flush();
4692 if (randint(2) == 1)
4695 sound(SOUND_ILLEGAL);
4697 if (!get_rnd_line("error_j.txt", 0, error_m))
4699 if (!get_rnd_line("error.txt", 0, error_m))
4706 prt(" '?' ¤Ç¥Ø¥ë¥×¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£", 0, 0);
4708 prt("Type '?' for help.", 0, 0);
4714 if (!energy_use && !now_message)
4715 now_message = old_now_message;
4721 bool monster_tsuri(int r_idx)
4723 monster_race *r_ptr = &r_info[r_idx];
4725 if ((r_ptr->flags7 & RF7_AQUATIC) && !(r_ptr->flags1 & RF1_UNIQUE) && strchr("Jjlw", r_ptr->d_char))
4733 * Process the player
4735 * Notice the annoying code to handle "pack overflow", which
4736 * must come first just in case somebody manages to corrupt
4737 * the savefiles by clever use of menu commands or something.
4739 static void process_player(void)
4743 /*** Apply energy ***/
4748 msg_print("²¿¤«ÊѤï¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
4750 msg_print("You feel different!");
4753 (void)gain_random_mutation(0);
4754 hack_mutation = FALSE;
4757 if (p_ptr->inside_battle)
4759 for(i = 1; i < m_max; i++)
4761 monster_type *m_ptr = &m_list[i];
4763 if (!m_ptr->r_idx) continue;
4765 /* Hack -- Detect monster */
4766 m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
4768 /* Update the monster */
4769 update_mon(i, FALSE);
4774 /* Give the player some energy */
4775 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))
4776 p_ptr->energy += gain_energy();
4779 if (p_ptr->energy < 100) return;
4780 if (!command_rep) prt_time();
4782 /*** Check for interupts ***/
4784 /* Complete resting */
4791 if ((p_ptr->chp == p_ptr->mhp) &&
4792 (p_ptr->csp >= p_ptr->msp))
4794 set_action(ACTION_NONE);
4798 /* Complete resting */
4799 else if (resting == -2)
4802 if ((p_ptr->chp == p_ptr->mhp) &&
4803 (p_ptr->csp >= p_ptr->msp) &&
4804 !p_ptr->blind && !p_ptr->confused &&
4805 !p_ptr->poisoned && !p_ptr->afraid &&
4806 !p_ptr->stun && !p_ptr->cut &&
4807 !p_ptr->slow && !p_ptr->paralyzed &&
4808 !p_ptr->image && !p_ptr->word_recall)
4810 set_action(ACTION_NONE);
4815 if (p_ptr->action == ACTION_FISH)
4818 Term_xtra(TERM_XTRA_DELAY, 10);
4822 bool success = FALSE;
4823 get_mon_num_prep(monster_tsuri,NULL);
4824 r_idx = get_mon_num(dun_level ? dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level);
4826 if (r_idx && one_in_(2))
4829 y = py+ddy[tsuri_dir];
4830 x = px+ddx[tsuri_dir];
4831 if (place_monster_aux(y, x, r_idx, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE))
4834 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
4836 msg_format("%s¤¬Äà¤ì¤¿¡ª", m_name);
4838 msg_format("You have a good catch!", m_name);
4846 msg_print("±Â¤À¤±¿©¤ï¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª¤¯¤Ã¤½¡Á¡ª");
4848 msg_print("Damn! The fish took a bait away!");
4855 /* Handle "abort" */
4858 /* Check for "player abort" (semi-efficiently for resting) */
4859 if (running || command_rep || (p_ptr->action == ACTION_REST) || (p_ptr->action == ACTION_FISH))
4864 /* Check for a key */
4873 /* Hack -- Show a Message */
4875 msg_print("ÃæÃǤ·¤Þ¤·¤¿¡£");
4877 msg_print("Canceled.");
4884 if (p_ptr->riding && !p_ptr->confused && !p_ptr->blind)
4886 monster_type *m_ptr = &m_list[p_ptr->riding];
4895 /* Acquire the monster name */
4896 monster_desc(m_name, m_ptr, 0);
4898 msg_format("%^s¤òµ¯¤³¤·¤¿¡£", m_name);
4900 msg_format("You have waked %s up.", m_name);
4902 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
4903 p_ptr->redraw |= (PR_UHEALTH);
4910 /* Make a "saving throw" against stun */
4911 if (rand_int(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
4917 /* Hack -- Recover from stun */
4918 if (m_ptr->stunned > d)
4920 /* Recover somewhat */
4921 m_ptr->stunned -= d;
4932 /* Acquire the monster name */
4933 monster_desc(m_name, m_ptr, 0);
4935 /* Dump a message */
4937 msg_format("%^s¤òÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
4939 msg_format("%^s is no longer stunned.", m_name);
4941 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
4942 p_ptr->redraw |= (PR_UHEALTH);
4946 if (m_ptr->confused)
4950 /* Make a "saving throw" against stun */
4951 if (rand_int(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
4954 d = m_ptr->confused;
4957 /* Hack -- Recover from stun */
4958 if (m_ptr->confused > d)
4960 /* Recover somewhat */
4961 m_ptr->confused -= d;
4970 m_ptr->confused = 0;
4972 /* Acquire the monster name */
4973 monster_desc(m_name, m_ptr, 0);
4975 /* Dump a message */
4977 msg_format("%^s¤òº®Íð¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
4979 msg_format("%^s is no longer confused.", m_name);
4981 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
4982 p_ptr->redraw |= (PR_UHEALTH);
4990 /* Make a "saving throw" against stun */
4991 if (rand_int(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
4997 /* Hack -- Recover from stun */
4998 if (m_ptr->monfear > d)
5000 /* Recover somewhat */
5001 m_ptr->monfear -= d;
5012 /* Acquire the monster name */
5013 monster_desc(m_name, m_ptr, 0);
5015 /* Dump a message */
5017 msg_format("%^s¤ò¶²Éݤ«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5019 msg_format("%^s is no longer fear.", m_name);
5021 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5022 p_ptr->redraw |= (PR_UHEALTH);
5029 /* Handle the player song */
5030 if (!load) check_music();
5035 if (p_ptr->lightspeed)
5037 (void)set_lightspeed(p_ptr->lightspeed - 1, TRUE);
5039 if ((p_ptr->pclass == CLASS_FORCETRAINER) && (p_ptr->magic_num1[0]))
5041 if (p_ptr->magic_num1[0] < 40)
5043 p_ptr->magic_num1[0] = 0;
5045 else p_ptr->magic_num1[0] -= 40;
5047 if (p_ptr->action == ACTION_LEARN)
5049 int hoge = ((p_ptr->msp * 0x10000L) / 256L)+7680L;
5050 if ((p_ptr->csp * 0x10000L + p_ptr->csp_frac) < hoge)
5053 p_ptr->csp_frac = 0;
5054 set_action(ACTION_NONE);
5058 p_ptr->csp -= (s16b)(hoge >> 16);
5060 if (p_ptr->csp_frac < hoge)
5062 p_ptr->csp_frac += 0x10000L - hoge;
5066 p_ptr->csp_frac -= hoge;
5068 p_ptr->redraw |= PR_MANA;
5071 if (p_ptr->special_defense & KATA_MASK)
5073 if (p_ptr->special_defense & KATA_MUSOU)
5077 set_action(ACTION_NONE);
5082 p_ptr->redraw |= (PR_MANA);
5087 /*** Handle actual user input ***/
5089 /* Repeat until out of energy */
5090 while (p_ptr->energy >= 100)
5092 p_ptr->window |= PW_PLAYER;
5093 p_ptr->sutemi = FALSE;
5094 p_ptr->counter = FALSE;
5095 now_damaged = FALSE;
5097 /* Notice stuff (if needed) */
5098 if (p_ptr->notice) notice_stuff();
5100 /* Update stuff (if needed) */
5101 if (p_ptr->update) update_stuff();
5103 /* Redraw stuff (if needed) */
5104 if (p_ptr->redraw) redraw_stuff();
5106 /* Redraw stuff (if needed) */
5107 if (p_ptr->window) window_stuff();
5110 /* Place the cursor on the player */
5111 move_cursor_relative(py, px);
5113 /* Refresh (optional) */
5114 if (fresh_before) Term_fresh();
5117 /* Hack -- Pack Overflow */
5118 if (inventory[INVEN_PACK].k_idx)
5120 int item = INVEN_PACK;
5122 char o_name[MAX_NLEN];
5126 /* Access the slot to be dropped */
5127 o_ptr = &inventory[item];
5134 msg_print("¥¶¥Ã¥¯¤«¤é¥¢¥¤¥Æ¥à¤¬¤¢¤Õ¤ì¤¿¡ª");
5136 msg_print("Your pack overflows!");
5141 object_desc(o_name, o_ptr, TRUE, 3);
5145 msg_format("%s(%c)¤òÍî¤È¤·¤¿¡£", o_name, index_to_label(item));
5147 msg_format("You drop %s (%c).", o_name, index_to_label(item));
5151 /* Drop it (carefully) near the player */
5152 (void)drop_near(o_ptr, 0, py, px);
5154 /* Modify, Describe, Optimize */
5155 inven_item_increase(item, -255);
5156 inven_item_describe(item);
5157 inven_item_optimize(item);
5159 /* Notice stuff (if needed) */
5160 if (p_ptr->notice) notice_stuff();
5162 /* Update stuff (if needed) */
5163 if (p_ptr->update) update_stuff();
5165 /* Redraw stuff (if needed) */
5166 if (p_ptr->redraw) redraw_stuff();
5168 /* Redraw stuff (if needed) */
5169 if (p_ptr->window) window_stuff();
5173 /* Hack -- cancel "lurking browse mode" */
5174 if (!command_new) command_see = FALSE;
5177 /* Assume free turn */
5181 if (p_ptr->inside_battle)
5183 /* Place the cursor on the player */
5184 move_cursor_relative(py, px);
5188 /* Process the command */
5192 /* Paralyzed or Knocked Out */
5193 else if (p_ptr->paralyzed || (p_ptr->stun >= 100))
5200 else if (p_ptr->action == ACTION_REST)
5205 /* Reduce rest count */
5208 if (!resting) set_action(ACTION_NONE);
5210 /* Redraw the state */
5211 p_ptr->redraw |= (PR_STATE);
5219 else if (p_ptr->action == ACTION_FISH)
5232 /* Repeated command */
5233 else if (command_rep)
5235 /* Count this execution */
5238 /* Redraw the state */
5239 p_ptr->redraw |= (PR_STATE);
5244 /* Hack -- Assume messages were seen */
5247 /* Clear the top line */
5250 /* Process the command */
5254 /* Normal command */
5257 /* Place the cursor on the player */
5258 move_cursor_relative(py, px);
5261 /* Get a command (normal) */
5262 request_command(FALSE);
5265 /* Process the command */
5275 /* Use some energy */
5276 p_ptr->energy -= energy_use;
5279 /* Hack -- constant hallucination */
5280 if (p_ptr->image) p_ptr->redraw |= (PR_MAP);
5283 /* Shimmer monsters if needed */
5284 if (shimmer_monsters)
5286 /* Clear the flag */
5287 shimmer_monsters = FALSE;
5289 /* Shimmer multi-hued monsters */
5290 for (i = 1; i < m_max; i++)
5292 monster_type *m_ptr;
5293 monster_race *r_ptr;
5295 /* Access monster */
5298 /* Skip dead monsters */
5299 if (!m_ptr->r_idx) continue;
5301 /* Access the monster race */
5302 r_ptr = &r_info[m_ptr->r_idx];
5304 /* Skip non-multi-hued monsters */
5305 if (!(r_ptr->flags1 & RF1_ATTR_MULTI)) continue;
5307 /* Reset the flag */
5308 shimmer_monsters = TRUE;
5310 /* Redraw regardless */
5311 lite_spot(m_ptr->fy, m_ptr->fx);
5316 /* Handle monster detection */
5317 if (repair_monsters)
5319 /* Reset the flag */
5320 repair_monsters = FALSE;
5322 /* Rotate detection flags */
5323 for (i = 1; i < m_max; i++)
5325 monster_type *m_ptr;
5327 /* Access monster */
5330 /* Skip dead monsters */
5331 if (!m_ptr->r_idx) continue;
5333 /* Nice monsters get mean */
5334 if (m_ptr->mflag & MFLAG_NICE)
5336 /* Nice monsters get mean */
5337 m_ptr->mflag &= ~(MFLAG_NICE);
5340 /* Handle memorized monsters */
5341 if (m_ptr->mflag & MFLAG_MARK)
5343 /* Maintain detection */
5344 if (m_ptr->mflag & MFLAG_SHOW)
5347 m_ptr->mflag &= ~(MFLAG_SHOW);
5349 /* Still need repairs */
5350 repair_monsters = TRUE;
5353 /* Remove detection */
5357 m_ptr->mflag &= ~(MFLAG_MARK);
5359 /* Assume invisible */
5362 /* Update the monster */
5363 update_mon(i, FALSE);
5365 if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH);
5366 if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH);
5368 /* Redraw regardless */
5369 lite_spot(m_ptr->fy, m_ptr->fx);
5374 if (p_ptr->pclass == CLASS_IMITATOR)
5376 if (mane_num > (p_ptr->lev > 44 ? 3 : p_ptr->lev > 29 ? 2 : 1))
5379 for (i = 0; i < mane_num; i++)
5381 mane_spell[i] = mane_spell[i+1];
5382 mane_dam[i] = mane_dam[i+1];
5386 p_ptr->redraw |= (PR_MANE);
5388 if (p_ptr->action == ACTION_LEARN)
5391 p_ptr->redraw |= (PR_STATE);
5394 if (world_player && (p_ptr->energy < 1000))
5397 p_ptr->redraw |= (PR_MAP);
5399 /* Update monsters */
5400 p_ptr->update |= (PU_MONSTERS);
5403 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5406 msg_print("¡Ö»þ¤ÏÆ°¤¤À¤¹¡Ä¡×");
5408 msg_print("You feel time flowing around you once more.");
5411 world_player = FALSE;
5418 /* Hack -- notice death */
5419 if (!alive || death)
5421 world_player = FALSE;
5425 /* Handle "leaving" */
5426 if (p_ptr->leaving) break;
5429 /* Update scent trail */
5435 * Interact with the current dungeon level.
5437 * This function will not exit until the level is completed,
5438 * the user dies, or the game is terminated.
5440 static void dungeon(bool load_game)
5442 int quest_num = 0, i, num;
5444 /* Set the base level */
5445 base_level = dun_level;
5447 /* Reset various flags */
5451 p_ptr->leaving = FALSE;
5453 /* Reset the "command" vars */
5461 /* Cancel the target */
5465 ambush_flag = FALSE;
5467 /* Cancel the health bar */
5470 /* Check visual effects */
5471 shimmer_monsters = TRUE;
5472 shimmer_objects = TRUE;
5473 repair_monsters = TRUE;
5474 repair_objects = TRUE;
5480 /* Get index of current quest (if any) */
5481 quest_num = quest_number(dun_level);
5483 /* Inside a quest? */
5486 /* Mark the quest monster */
5487 r_info[quest[quest_num].r_idx].flags1 |= RF1_QUESTOR;
5490 /* Track maximum player level */
5491 if (p_ptr->max_plv < p_ptr->lev)
5493 p_ptr->max_plv = p_ptr->lev;
5497 /* Track maximum dungeon level (if not in quest -KMW-) */
5498 if ((max_dlv[dungeon_type] < dun_level) && !p_ptr->inside_quest)
5500 max_dlv[dungeon_type] = dun_level;
5501 if (record_maxdeapth) do_cmd_write_nikki(NIKKI_MAXDEAPTH, dun_level, NULL);
5504 /* No stairs down from Quest */
5505 if (quest_number(dun_level))
5507 create_down_stair = 0;
5510 /* Paranoia -- no stairs from town or wilderness */
5511 if (!dun_level) create_down_stair = create_up_stair = 0;
5513 /* Option -- no connected stairs */
5514 if (!dungeon_stair) create_down_stair = create_up_stair = 0;
5516 /* Option -- no up stairs */
5517 if (ironman_downward) create_down_stair = create_up_stair = 0;
5519 /* Make a stairway. */
5520 if (create_up_stair || create_down_stair)
5522 /* Place a stairway */
5523 if (cave_valid_bold(py, px))
5526 delete_object(py, px);
5529 if (create_down_stair)
5531 if (create_down_stair == 2) cave_set_feat(py, px, FEAT_MORE_MORE);
5532 else cave_set_feat(py, px, FEAT_MORE);
5536 if (create_up_stair == 2) cave_set_feat(py, px, FEAT_LESS_LESS);
5537 else cave_set_feat(py, px, FEAT_LESS);
5541 /* Cancel the stair request */
5542 create_down_stair = create_up_stair = 0;
5546 /* Verify the panel */
5549 /* Validate the panel */
5552 panel_bounds_center();
5560 /* Flush messages */
5564 /* Enter "xtra" mode */
5565 character_xtra = TRUE;
5568 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
5571 p_ptr->window |= (PW_MONSTER);
5573 /* Redraw dungeon */
5574 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY);
5577 p_ptr->redraw |= (PR_MAP);
5580 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5583 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
5585 /* Calculate torch radius */
5586 p_ptr->update |= (PU_TORCH);
5598 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_DISTANCE | PU_MON_LITE);
5599 p_ptr->update |= (PU_MONSTERS);/*¼«Ê¬¤Ç¸÷¤Ã¤Æ¤¤¤ë¥â¥ó¥¹¥¿¡¼¤Î°Ù */
5607 /* Leave "xtra" mode */
5608 character_xtra = FALSE;
5611 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
5613 /* Combine / Reorder the pack */
5614 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
5631 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();
5633 if (p_ptr->inside_battle)
5637 p_ptr->energy = 100;
5644 msg_print("»î¹ç³«»Ï¡ª");
5646 msg_format("Ready..Fight!");
5652 if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] > MUSIC_DETECT))
5653 p_ptr->magic_num1[0] = MUSIC_DETECT;
5655 /* Hack -- notice death or departure */
5656 if (!alive || death) return;
5658 /* Print quest message if appropriate */
5659 if (!p_ptr->inside_quest && (dungeon_type == DUNGEON_ANGBAND))
5661 quest_discovery(random_quest_number(dun_level));
5662 p_ptr->inside_quest = random_quest_number(dun_level);
5664 if ((dun_level == d_info[dungeon_type].maxdepth) && d_info[dungeon_type].final_guardian)
5666 if (r_info[d_info[dungeon_type].final_guardian].max_num)
5668 msg_format("¤³¤Î³¬¤Ë¤Ï%s¤Î¼ç¤Ç¤¢¤ë%s¤¬À³¤ó¤Ç¤¤¤ë¡£",
5669 d_name+d_info[dungeon_type].name,
5670 r_name+r_info[d_info[dungeon_type].final_guardian].name);
5672 msg_format("%^s lives in this level as the keeper of %s.",
5673 r_name+r_info[d_info[dungeon_type].final_guardian].name,
5674 d_name+d_info[dungeon_type].name);
5678 /*** Process this dungeon level ***/
5680 /* Reset the monster generation level */
5681 monster_level = base_level;
5683 /* Reset the object generation level */
5684 object_level = base_level;
5688 if (p_ptr->energy < 100 && !p_ptr->inside_battle && (dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena)) p_ptr->energy = 100;
5689 /* Not leaving dungeon */
5690 p_ptr->leaving_dungeon = FALSE;
5695 int i, correct_inven_cnt = 0;
5697 /* Hack -- Compact the monster list occasionally */
5698 if ((m_cnt + 32 > max_m_idx) && !p_ptr->inside_battle) compact_monsters(64);
5700 /* Hack -- Compress the monster list occasionally */
5701 if ((m_cnt + 32 < m_max) && !p_ptr->inside_battle) compact_monsters(0);
5704 /* Hack -- Compact the object list occasionally */
5705 if (o_cnt + 32 > max_o_idx) compact_objects(64);
5707 /* Hack -- Compress the object list occasionally */
5708 if (o_cnt + 32 < o_max) compact_objects(0);
5711 /* Process the player */
5715 if (p_ptr->notice) notice_stuff();
5718 for (i = 0; i < INVEN_PACK; i++)
5720 object_type *j_ptr = &inventory[i];
5722 /* Skip non-objects */
5723 if (!j_ptr->k_idx) continue;
5725 correct_inven_cnt++;
5729 if (p_ptr->update) update_stuff();
5732 if (p_ptr->redraw) redraw_stuff();
5735 if (p_ptr->window) window_stuff();
5737 /* Hack -- Hilite the player */
5738 move_cursor_relative(py, px);
5740 /* Optional fresh */
5741 if (fresh_after) Term_fresh();
5743 /* Hack -- Notice death or departure */
5744 if (!alive || death) break;
5746 /* Process all of the monsters */
5750 if (p_ptr->notice) notice_stuff();
5753 if (p_ptr->update) update_stuff();
5756 if (p_ptr->redraw) redraw_stuff();
5759 if (p_ptr->window) window_stuff();
5761 /* Hack -- Hilite the player */
5762 move_cursor_relative(py, px);
5764 /* Optional fresh */
5765 if (fresh_after) Term_fresh();
5767 /* Hack -- Notice death or departure */
5768 if (!alive || death) break;
5771 /* Process the world */
5775 if (p_ptr->notice) notice_stuff();
5778 if (p_ptr->update) update_stuff();
5781 if (p_ptr->redraw) redraw_stuff();
5784 if (p_ptr->window) window_stuff();
5786 /* Hack -- Hilite the player */
5787 move_cursor_relative(py, px);
5789 /* Optional fresh */
5790 if (fresh_after) Term_fresh();
5792 /* Hack -- Notice death or departure */
5793 if (!alive || death) break;
5795 /* Handle "leaving" */
5796 if (p_ptr->leaving) break;
5798 /* Count game turns */
5800 if (!p_ptr->wild_mode || wild_regen) dungeon_turn++;
5801 else if (p_ptr->wild_mode && !(turn % ((MAX_HGT + MAX_WID) / 2))) dungeon_turn++;
5802 if (wild_regen) wild_regen--;
5805 /* Inside a quest and non-unique questor? */
5806 if (quest_num && !(r_info[quest[quest_num].r_idx].flags1 & RF1_UNIQUE))
5808 /* Un-mark the quest monster */
5809 r_info[quest[quest_num].r_idx].flags1 &= ~RF1_QUESTOR;
5812 /* Not save-and-quit and not dead? */
5813 if (alive && !death)
5815 for(num = 0; num < 21; num++)
5817 party_mon[num].r_idx = 0;
5822 COPY(&party_mon[0], &m_list[p_ptr->riding], monster_type);
5825 for(i = m_max - 1, num = 1; (i >= 1 && num < 21); i--)
5827 monster_type *m_ptr = &m_list[i];
5829 if (!m_ptr->r_idx) continue;
5830 if (!is_pet(m_ptr)) continue;
5831 if (i == p_ptr->riding) continue;
5833 if (m_ptr->nickname && (player_has_los_bold(m_ptr->fy, m_ptr->fx) || los(m_ptr->fy, m_ptr->fx, py, px)))
5835 if (distance(py, px, m_ptr->fy, m_ptr->fx) > 3) continue;
5839 if (distance(py, px, m_ptr->fy, m_ptr->fx) > 1) continue;
5841 if (m_ptr->confused || m_ptr->stunned || m_ptr->csleep) continue;
5843 COPY(&party_mon[num], &m_list[i], monster_type);
5844 delete_monster_idx(i);
5847 if (record_named_pet)
5849 for (i = m_max - 1; i >=1; i--)
5851 monster_type *m_ptr = &m_list[i];
5854 if (!m_ptr->r_idx) continue;
5855 if (!is_pet(m_ptr)) continue;
5856 if (!m_ptr->nickname) continue;
5857 if (p_ptr->riding == i) continue;
5859 monster_desc(m_name, m_ptr, 0x88);
5860 do_cmd_write_nikki(NIKKI_NAMED_PET, 4, m_name);
5870 * Load some "user pref files"
5872 * Modified by Arcum Dagsson to support
5873 * separate macro files for different realms.
5875 static void load_all_pref_files(void)
5879 /* Access the "race" pref file */
5880 sprintf(buf, "%s.prf", rp_ptr->title);
5882 /* Process that file */
5883 process_pref_file(buf);
5885 /* Access the "class" pref file */
5886 sprintf(buf, "%s.prf", cp_ptr->title);
5888 /* Process that file */
5889 process_pref_file(buf);
5891 /* Access the "character" pref file */
5892 sprintf(buf, "%s.prf", player_base);
5894 /* Process that file */
5895 process_pref_file(buf);
5898 sprintf(buf, "picktype-%s.prf", player_base);
5900 sprintf(buf, "pickpref-%s.prf", player_base);
5902 process_pickpref_file(buf);
5904 process_pickpref_file("picktype.prf");
5906 process_pickpref_file("pickpref.prf");
5909 /* Access the "realm 1" pref file */
5910 if (p_ptr->realm1 != REALM_NONE)
5912 sprintf(buf, "%s.prf", realm_names[p_ptr->realm1]);
5914 /* Process that file */
5915 process_pref_file(buf);
5918 /* Access the "realm 2" pref file */
5919 if (p_ptr->realm2 != REALM_NONE)
5921 sprintf(buf, "%s.prf", realm_names[p_ptr->realm2]);
5923 /* Process that file */
5924 process_pref_file(buf);
5930 * Actually play a game
5932 * If the "new_game" parameter is true, then, after loading the
5933 * savefile, we will commit suicide, if necessary, to allow the
5934 * player to start a new game.
5936 void play_game(bool new_game)
5939 bool load_game = TRUE;
5949 hack_mutation = FALSE;
5951 /* Hack -- Character is "icky" */
5952 character_icky = TRUE;
5954 /* Hack -- turn off the cursor */
5955 (void)Term_set_cursor(0);
5958 /* Attempt to load */
5963 quit("¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤¬²õ¤ì¤Æ¤¤¤Þ¤¹");
5965 quit("broken savefile");
5970 /* Extract the options */
5971 for (i = 0; option_info[i].o_desc; i++)
5973 int os = option_info[i].o_set;
5974 int ob = option_info[i].o_bit;
5976 /* Set the "default" options */
5977 if (option_info[i].o_var)
5980 if (option_flag[os] & (1L << ob))
5983 (*option_info[i].o_var) = TRUE;
5990 (*option_info[i].o_var) = FALSE;
5995 /* Report waited score */
5996 if (wait_report_score)
6002 if (!get_check("ÂÔµ¡¤·¤Æ¤¤¤¿¥¹¥³¥¢ÅÐÏ¿¤òº£¹Ô¤Ê¤¤¤Þ¤¹¤«¡©"))
6004 if (!get_check("Do you register score now? "))
6009 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
6016 start_time = time(NULL);
6018 /* No suspending now */
6019 signals_ignore_tstp();
6021 /* Hack -- Character is now "icky" */
6022 character_icky = TRUE;
6024 /* Build the filename */
6025 path_build(buf, 1024, ANGBAND_DIR_APEX, "scores.raw");
6027 /* Open the high score file, for reading/writing */
6028 highscore_fd = fd_open(buf, O_RDWR);
6030 /* Handle score, show Top scores */
6031 success = send_world_score(TRUE);
6034 if (!success && !get_check("¥¹¥³¥¢ÅÐÏ¿¤òÄü¤á¤Þ¤¹¤«¡©"))
6036 if (!success && !get_check("Do you give up score registration? "))
6040 prt("°ú¤Â³¤ÂÔµ¡¤·¤Þ¤¹¡£", 0, 0);
6042 prt("standing by for future registration...", 0, 0);
6048 wait_report_score = FALSE;
6051 if (!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
6053 if (!save_player()) msg_print("death save failed!");
6056 /* Shut the high score file */
6057 (void)fd_close(highscore_fd);
6059 /* Forget the high score fd */
6062 /* Allow suspending now */
6063 signals_handle_tstp();
6068 /* Nothing loaded */
6069 if (!character_loaded)
6071 /* Make new player */
6074 /* The dungeon is not ready */
6075 character_dungeon = FALSE;
6077 /* Prepare to init the RNG */
6081 /* Process old character */
6084 /* Process the player name */
6085 process_player_name(FALSE);
6094 seed = (time(NULL));
6098 /* Mutate the seed on Unix machines */
6099 seed = ((seed >> 3) * (getpid() << 1));
6103 /* Use the complex RNG */
6106 /* Seed the "complex" RNG */
6107 Rand_state_init(seed);
6110 /* Roll new character */
6113 monster_race *r_ptr;
6115 /* The dungeon is not ready */
6116 character_dungeon = FALSE;
6120 p_ptr->inside_quest = 0;
6121 p_ptr->inside_arena = FALSE;
6122 p_ptr->inside_battle = FALSE;
6126 /* Hack -- seed for flavors */
6127 seed_flavor = rand_int(0x10000000);
6129 /* Hack -- seed for town layout */
6130 seed_town = rand_int(0x10000000);
6132 /* Roll up a new character */
6139 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "ÊÕ¶¤ÎÃϤ˹ߤêΩ¤Ã¤¿¡£");
6141 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "You are standing in the Outpost.");
6145 get_mon_num_prep(NULL, NULL);
6146 for (i = 0; i < MAX_KUBI; i++)
6152 kubi_r_idx[i] = get_mon_num(MAX_DEPTH - 1);
6153 r_ptr = &r_info[kubi_r_idx[i]];
6155 if(!(r_ptr->flags1 & RF1_UNIQUE)) continue;
6157 if(!(r_ptr->flags9 & RF9_DROP_CORPSE)) continue;
6158 if (r_ptr->rarity > 100) continue;
6160 if(r_ptr->flags6 & RF6_SPECIAL) continue;
6162 for (j = 0; j < i; j++)
6163 if (kubi_r_idx[i] == kubi_r_idx[j])break;
6168 for (i = 0; i < MAX_KUBI -1; i++)
6171 for (j = i; j < MAX_KUBI; j++)
6173 if (r_info[kubi_r_idx[i]].level > r_info[kubi_r_idx[j]].level)
6175 tmp = kubi_r_idx[i];
6176 kubi_r_idx[i] = kubi_r_idx[j];
6177 kubi_r_idx[j] = tmp;
6182 p_ptr->inside_battle = TRUE;
6185 today_mon = get_mon_num(3);
6186 r_ptr = &r_info[today_mon];
6188 if (r_ptr->flags1 & RF1_UNIQUE) continue;
6189 if (r_ptr->flags2 & (RF2_MULTIPLY)) continue;
6190 if (!(r_ptr->flags9 & RF9_DROP_CORPSE) || !(r_ptr->flags9 & RF9_DROP_SKELETON)) continue;
6191 if (r_ptr->rarity > 10) continue;
6192 if (r_ptr->level == 0) continue;
6195 p_ptr->inside_battle = FALSE;
6199 write_level = FALSE;
6202 do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ----¥²¡¼¥àºÆ³«----");
6204 do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ---- Restart Game ----");
6208 * 1.0.9 °ÊÁ°¤Ï¥»¡¼¥ÖÁ°¤Ë p_ptr->riding = -1 ¤È¤·¤Æ¤¤¤¿¤Î¤Ç¡¢ºÆÀßÄ꤬ɬÍפÀ¤Ã¤¿¡£
6209 * ¤â¤¦ÉÔÍפÀ¤¬¡¢°ÊÁ°¤Î¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤È¤Î¸ß´¹¤Î¤¿¤á¤Ë»Ä¤·¤Æ¤ª¤¯¡£
6211 if (p_ptr->riding == -1)
6214 for(i = m_max; i > 0; i--)
6216 if ((m_list[i].fy == py) && (m_list[i].fx == px))
6225 p_ptr->teleport_town = FALSE;
6226 p_ptr->sutemi = FALSE;
6227 world_monster = FALSE;
6228 now_damaged = FALSE;
6230 start_time = time(NULL) - 1;
6231 record_o_name[0] = '\0';
6233 /* Sexy gal gets bonus to maximum weapon skill of whip */
6234 if(p_ptr->pseikaku == SEIKAKU_SEXY)
6235 s_info[p_ptr->pclass].w_max[TV_HAFTED-TV_BOW][SV_WHIP] = 8000;
6237 /* Fill the arrays of floors and walls in the good proportions */
6238 for (i = 0; i < 100; i++)
6240 int lim1, lim2, lim3;
6242 lim1 = d_info[dungeon_type].floor_percent1;
6243 lim2 = lim1 + d_info[dungeon_type].floor_percent2;
6244 lim3 = lim2 + d_info[dungeon_type].floor_percent3;
6247 floor_type[i] = d_info[dungeon_type].floor1;
6249 floor_type[i] = d_info[dungeon_type].floor2;
6251 floor_type[i] = d_info[dungeon_type].floor3;
6253 lim1 = d_info[dungeon_type].fill_percent1;
6254 lim2 = lim1 + d_info[dungeon_type].fill_percent2;
6255 lim3 = lim2 + d_info[dungeon_type].fill_percent3;
6257 fill_type[i] = d_info[dungeon_type].fill_type1;
6259 fill_type[i] = d_info[dungeon_type].fill_type2;
6261 fill_type[i] = d_info[dungeon_type].fill_type3;
6264 /* Flavor the objects */
6273 /* Flash a message */
6275 prt("¤ªÂÔ¤Á²¼¤µ¤¤...", 0, 0);
6277 prt("Please wait...", 0, 0);
6281 /* Flush the message */
6285 /* Hack -- Enter wizard mode */
6286 if (arg_wizard && enter_wizard_mode()) wizard = TRUE;
6288 /* Initialize the town-buildings if necessary */
6289 if (!dun_level && !p_ptr->inside_quest)
6291 /* Init the wilderness */
6293 process_dungeon_file("w_info_j.txt", 0, 0, max_wild_y, max_wild_x);
6296 init_flags = INIT_ONLY_BUILDINGS;
6298 process_dungeon_file("t_info_j.txt", 0, 0, MAX_HGT, MAX_WID);
6303 /* Initialize vault info */
6305 if (init_v_info()) quit("·úÃÛʪ½é´ü²½ÉÔǽ");
6307 if (init_v_info()) quit("Cannot initialize vaults");
6310 /* Generate a dungeon level if needed */
6311 if (!character_dungeon) generate_cave();
6314 /* Character is now "complete" */
6315 character_generated = TRUE;
6318 /* Hack -- Character is no longer "icky" */
6319 character_icky = FALSE;
6325 /* Reset the visual mappings */
6328 /* Load the "pref" files */
6329 load_all_pref_files();
6331 /* React to changes */
6332 Term_xtra(TERM_XTRA_REACT, 0);
6335 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
6338 p_ptr->window |= (PW_MONSTER);
6344 /* Set or clear "rogue_like_commands" if requested */
6345 if (arg_force_original) rogue_like_commands = FALSE;
6346 if (arg_force_roguelike) rogue_like_commands = TRUE;
6348 /* Hack -- Enforce "delayed death" */
6349 if (p_ptr->chp < 0) death = TRUE;
6351 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
6353 if (new_game && ((p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BEASTMASTER)))
6355 monster_type *m_ptr;
6356 int pet_r_idx = ((p_ptr->pclass == CLASS_CAVALRY) ? MON_HORSE : MON_YASE_HORSE);
6357 monster_race *r_ptr = &r_info[pet_r_idx];
6358 place_monster_aux(py, px - 1, pet_r_idx,
6359 FALSE, FALSE, TRUE, TRUE, TRUE, FALSE);
6360 m_ptr = &m_list[hack_m_idx_ii];
6361 m_ptr->mspeed = r_ptr->speed;
6362 m_ptr->maxhp = r_ptr->hdice*(r_ptr->hside+1)/2;
6363 m_ptr->max_maxhp = m_ptr->maxhp;
6364 m_ptr->hp = r_ptr->hdice*(r_ptr->hside+1)/2;
6365 m_ptr->energy = -100;
6371 /* Process the level */
6375 if (p_ptr->notice) notice_stuff();
6378 if (p_ptr->update) update_stuff();
6381 if (p_ptr->redraw) redraw_stuff();
6384 if (p_ptr->window) window_stuff();
6387 /* Cancel the target */
6390 /* Cancel the health bar */
6394 /* Forget the lite */
6397 /* Forget the view */
6400 /* Forget the view */
6403 /* Handle "quit and save" */
6404 if (!alive && !death) break;
6406 /* Erase the old cave */
6408 if (!death) wipe_m_list();
6416 /* Accidental Death */
6419 if (p_ptr->inside_arena)
6421 p_ptr->inside_arena = FALSE;
6422 if(p_ptr->arena_number > MAX_ARENA_MONS)
6423 p_ptr->arena_number++;
6425 p_ptr->arena_number = 99;
6428 p_ptr->chp_frac = 0;
6429 p_ptr->exit_bldg = TRUE;
6434 /* Mega-Hack -- Allow player to cheat death */
6436 if ((wizard || cheat_live) && !get_check("»à¤Ë¤Þ¤¹¤«? "))
6438 if ((wizard || cheat_live) && !get_check("Die? "))
6442 /* Mark social class, reset age, if needed */
6443 if (p_ptr->sc) p_ptr->sc = p_ptr->age = 0;
6453 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÇ°¤òÁ÷¤ê¡¢»à¤òµ½¤¤¤¿¡£");
6455 msg_print("You invoke wizard mode and cheat death.");
6461 /* Restore hit points */
6462 p_ptr->chp = p_ptr->mhp;
6463 p_ptr->chp_frac = 0;
6465 if (p_ptr->pclass == CLASS_MAGIC_EATER)
6467 for (i = 0; i < 72; i++)
6469 p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*0x10000;
6471 for (; i < 108; i++)
6473 p_ptr->magic_num1[i] = 0;
6476 /* Restore spell points */
6477 p_ptr->csp = p_ptr->msp;
6478 p_ptr->csp_frac = 0;
6480 /* Hack -- Healing */
6482 (void)set_confused(0);
6483 (void)set_poisoned(0);
6484 (void)set_afraid(0);
6485 (void)set_paralyzed(0);
6490 /* Hack -- Prevent starvation */
6491 (void)set_food(PY_FOOD_MAX - 1);
6493 /* Hack -- cancel recall */
6494 if (p_ptr->word_recall)
6498 msg_print("Ä¥¤ê¤Ä¤á¤¿Â絤¤¬Î®¤ìµî¤Ã¤¿...");
6500 msg_print("A tension leaves the air around you...");
6505 /* Hack -- Prevent recall */
6506 p_ptr->word_recall = 0;
6507 p_ptr->redraw |= (PR_STATUS);
6510 /* Note cause of death XXX XXX XXX */
6512 (void)strcpy(died_from, "»à¤Îµ½¤");
6514 (void)strcpy(died_from, "Cheating death");
6522 p_ptr->inside_arena = FALSE;
6523 p_ptr->inside_battle = FALSE;
6525 p_ptr->inside_quest = 0;
6526 p_ptr->recall_dungeon = dungeon_type;
6528 if (lite_town || vanilla_town)
6530 p_ptr->wilderness_y = 1;
6531 p_ptr->wilderness_x = 1;
6545 p_ptr->wilderness_y = 48;
6546 p_ptr->wilderness_x = 5;
6552 p_ptr->wild_mode = FALSE;
6553 p_ptr->leaving = TRUE;
6556 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " ¤·¤«¤·¡¢À¸¤Ê֤ä¿¡£");
6558 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " but revived.");
6564 /* Handle "death" */
6567 /* Make a new level */
6578 s32b turn_real(s32b hoge)
6580 if ((p_ptr->prace == RACE_VAMPIRE) ||
6581 (p_ptr->prace == RACE_SKELETON) ||
6582 (p_ptr->prace == RACE_ZOMBIE) ||
6583 (p_ptr->prace == RACE_SPECTRE))
6584 return hoge-(60L * TOWN_DAWN) / 4;