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 200
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) && !randint0(13))
124 feel = FEEL_EXCELLENT;
129 feel = randint0(3) ? FEEL_GOOD : FEEL_AVERAGE;
134 feel = randint0(2) ? FEEL_CURSED : FEEL_GOOD;
139 feel = randint0(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 != randint0(9000L / (plev * plev + 40))) return;
250 if (0 != randint0(6000L / (plev * plev + 50))) return;
260 case CLASS_HIGH_MAGE:
262 case CLASS_MAGIC_EATER:
264 /* Very bad (light) sensing */
265 if (0 != randint0(240000L / (plev + 5))) return;
274 /* Good (light) sensing */
275 if (0 != randint0(10000L / (plev * plev + 40))) return;
285 if (0 != randint0(20000L / (plev * plev + 40))) return;
297 if (0 != randint0(95000L / (plev * plev + 40))) return;
309 if (0 != randint0(77777L / (plev * plev + 40))) return;
318 case CLASS_WARRIOR_MAGE:
322 if (0 != randint0(75000L / (plev * plev + 40))) return;
328 case CLASS_MINDCRAFTER:
329 case CLASS_MIRROR_MASTER:
332 if (0 != randint0(55000L / (plev * plev + 40))) return;
338 case CLASS_CHAOS_WARRIOR:
341 if (0 != randint0(80000L / (plev * plev + 40))) return;
351 case CLASS_FORCETRAINER:
354 if (0 != randint0(20000L / (plev * plev + 40))) return;
363 if (0 != randint0(20000L / ((plev+50)*(plev+50)))) return;
373 case CLASS_BLUE_MAGE:
376 if (0 != randint0(55000L / (plev * plev + 40))) return;
382 case CLASS_BEASTMASTER:
385 if (0 != randint0(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 != randint0(5))) continue;
447 if ((p_ptr->muta3 & MUT3_GOOD_LUCK) && !randint0(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 != randint0(240000L / (plev + 5))) return;
496 case CLASS_WARRIOR_MAGE:
501 if (0 != randint0(95000L / (plev * plev + 40))) return;
510 case CLASS_FORCETRAINER:
511 case CLASS_MINDCRAFTER:
514 if (0 != randint0(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 != randint0(9000L / (plev * plev + 40))) return;
537 if (0 != randint0(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 != randint0(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 = randint1(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) && one_in_(10))
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)) && !one_in_(2))
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 < EATER_EXT*2; 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 = EATER_EXT*2; i < EATER_EXT*3; 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)) * EATER_ROD_CHARGE/16;
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 (one_in_(2)) 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 (one_in_(2)) 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))
1089 && (turn % (TURNS_PER_TICK*2)))
1091 if (disturb_minor) disturb(0, 0);
1093 msg_print("ÌÀ¤«¤ê¤¬Èù¤«¤Ë¤Ê¤Ã¤Æ¤¤Æ¤¤¤ë¡£");
1095 msg_print("Your light is growing faint.");
1101 /* The light is getting dim */
1102 else if ((o_ptr->xtra4 < 100) && (!(o_ptr->xtra4 % 10)))
1104 if (disturb_minor) disturb(0, 0);
1106 msg_print("ÌÀ¤«¤ê¤¬Èù¤«¤Ë¤Ê¤Ã¤Æ¤¤Æ¤¤¤ë¡£");
1108 msg_print("Your light is growing faint.");
1115 void leave_quest_check(void)
1117 /* Save quset number for dungeon pref file ($LEAVING_QUEST) */
1118 leaving_quest = p_ptr->inside_quest;
1120 /* Leaving an 'only once' quest marks it as failed */
1121 if (leaving_quest &&
1122 ((quest[leaving_quest].flags & QUEST_FLAG_ONCE) || (quest[leaving_quest].type == QUEST_TYPE_RANDOM)) &&
1123 (quest[leaving_quest].status == QUEST_STATUS_TAKEN))
1125 quest[leaving_quest].status = QUEST_STATUS_FAILED;
1126 quest[leaving_quest].complev = (byte)p_ptr->lev;
1127 if (quest[leaving_quest].type == QUEST_TYPE_RANDOM)
1129 r_info[quest[leaving_quest].r_idx].flags1 &= ~(RF1_QUESTOR);
1130 if (record_rand_quest)
1131 do_cmd_write_nikki(NIKKI_RAND_QUEST_F, leaving_quest, NULL);
1133 else if (record_fix_quest)
1134 do_cmd_write_nikki(NIKKI_FIX_QUEST_F, leaving_quest, NULL);
1140 * Forcibly pseudo-identify an object in the inventory
1143 * note: currently this function allows pseudo-id of any object,
1144 * including silly ones like potions & scrolls, which always
1145 * get '{average}'. This should be changed, either to stop such
1146 * items from being pseudo-id'd, or to allow psychometry to
1147 * detect whether the unidentified potion/scroll/etc is
1148 * good (Cure Light Wounds, Restore Strength, etc) or
1149 * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
1151 bool psychometry(void)
1155 char o_name[MAX_NLEN];
1160 item_tester_no_ryoute = TRUE;
1163 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«¡©";
1164 s = "Ä´¤Ù¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
1166 q = "Meditate on which item? ";
1167 s = "You have nothing appropriate.";
1170 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
1172 /* Get the item (in the pack) */
1175 o_ptr = &inventory[item];
1178 /* Get the item (on the floor) */
1181 o_ptr = &o_list[0 - item];
1184 /* It is fully known, no information needed */
1185 if (object_known_p(o_ptr))
1188 msg_print("²¿¤â¿·¤·¤¤¤³¤È¤ÏȽ¤é¤Ê¤«¤Ã¤¿¡£");
1190 msg_print("You cannot find out anything more about that.");
1196 /* Check for a feeling */
1197 feel = value_check_aux1(o_ptr);
1199 /* Get an object description */
1200 object_desc(o_name, o_ptr, FALSE, 0);
1202 /* Skip non-feelings */
1206 msg_format("%s¤«¤é¤ÏÆäËÊѤï¤Ã¤¿»ö¤Ï´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿¡£", o_name);
1208 msg_format("You do not perceive anything unusual about the %s.", o_name);
1215 msg_format("%s¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
1216 o_name, game_inscriptions[feel]);
1218 msg_format("You feel that the %s %s %s...",
1219 o_name, ((o_ptr->number == 1) ? "is" : "are"),
1220 game_inscriptions[feel]);
1224 /* We have "felt" it */
1225 o_ptr->ident |= (IDENT_SENSE);
1228 o_ptr->feeling = feel;
1230 /* Combine / Reorder the pack (later) */
1231 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1234 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1236 /* Something happened */
1241 static void gere_music(s32b music)
1249 stun_monsters(damroll(p_ptr->lev/10,2));
1252 hp_player(damroll(2,6));
1255 project_hack(GF_TURN_ALL, p_ptr->lev);
1258 project_hack(GF_PSI, randint1(p_ptr->lev * 3 / 2));
1261 project(0, 1, py, px, 0, GF_IDENTIFY, PROJECT_ITEM, -1);
1264 confuse_monsters(p_ptr->lev * 2);
1267 project_hack(GF_SOUND, damroll(10 + p_ptr->lev/5,7));
1270 charm_monsters(damroll(10 + p_ptr->lev/15,6));
1273 project(0, 0, py, px,
1274 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
1277 dispel_monsters(randint1(p_ptr->lev * 3));
1278 dispel_evil(randint1(p_ptr->lev * 3));
1285 earthquake(py, px, 10);
1288 stasis_monsters(p_ptr->lev * 4);
1291 dispel_monsters(randint1(p_ptr->lev * 3));
1294 hp_player(damroll(15,10));
1298 case MUSIC_DETECT+19:
1299 wiz_lite(FALSE, FALSE);
1300 case MUSIC_DETECT+11:
1301 case MUSIC_DETECT+12:
1302 case MUSIC_DETECT+13:
1303 case MUSIC_DETECT+14:
1304 case MUSIC_DETECT+15:
1305 case MUSIC_DETECT+16:
1306 case MUSIC_DETECT+17:
1307 case MUSIC_DETECT+18:
1308 map_area(DETECT_RAD_MAP);
1309 if ((p_ptr->lev > 39) && (music < MUSIC_DETECT+19)) p_ptr->magic_num1[0] = music+1;
1310 case MUSIC_DETECT+6:
1311 case MUSIC_DETECT+7:
1312 case MUSIC_DETECT+8:
1313 case MUSIC_DETECT+9:
1314 case MUSIC_DETECT+10:
1315 detect_treasure(DETECT_RAD_DEFAULT);
1316 detect_objects_gold(DETECT_RAD_DEFAULT);
1317 detect_objects_normal(DETECT_RAD_DEFAULT);
1318 if ((p_ptr->lev > 24) && (music < MUSIC_DETECT+11)) p_ptr->magic_num1[0] = music+1;
1319 case MUSIC_DETECT+3:
1320 case MUSIC_DETECT+4:
1321 case MUSIC_DETECT+5:
1322 detect_monsters_invis(DETECT_RAD_DEFAULT);
1323 detect_monsters_normal(DETECT_RAD_DEFAULT);
1324 if ((p_ptr->lev > 19) && (music < MUSIC_DETECT+6)) p_ptr->magic_num1[0] = music+1;
1326 case MUSIC_DETECT+1:
1327 case MUSIC_DETECT+2:
1328 detect_traps(DETECT_RAD_DEFAULT);
1329 detect_doors(DETECT_RAD_DEFAULT);
1330 detect_stairs(DETECT_RAD_DEFAULT);
1331 if ((p_ptr->lev > 14) && (music < MUSIC_DETECT+3)) p_ptr->magic_num1[0] = music+1;
1337 * If player has inscribed the object with "!!", let him know when it's
1340 static void recharged_notice(object_type *o_ptr)
1342 char o_name[MAX_NLEN];
1346 /* No inscription */
1347 if (!o_ptr->inscription) return;
1350 s = strchr(quark_str(o_ptr->inscription), '!');
1352 /* Process notification request. */
1355 /* Find another '!' */
1358 /* Describe (briefly) */
1359 object_desc(o_name, o_ptr, FALSE, 0);
1361 /* Notify the player */
1362 if (o_ptr->number > 1)
1364 msg_format("%s¤ÏºÆ½¼Å¶¤µ¤ì¤¿¡£", o_name);
1365 else msg_format("%s¤ÏºÆ½¼Å¶¤µ¤ì¤¿¡£", o_name);
1367 msg_format("Your %s are recharged.", o_name);
1368 else msg_format("Your %s is recharged.", o_name);
1376 /* Keep looking for '!'s */
1377 s = strchr(s + 1, '!');
1382 static void check_music()
1387 /* Music singed by player */
1388 if(p_ptr->pclass != CLASS_BARD) return;
1389 if(!p_ptr->magic_num1[0] && !p_ptr->magic_num1[1]) return;
1391 s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC - 1][p_ptr->magic_num2[0]];
1393 shouhimana = (s_ptr->smana*(3800-spell_exp[p_ptr->magic_num2[0]])+2399);
1396 else shouhimana *= 4;
1398 if(shouhimana < 1) shouhimana = 1;
1399 shouhimana *= 0x8000;
1400 if ((p_ptr->csp < shouhimana / 0x10000) || (p_ptr->anti_magic))
1407 p_ptr->csp -= shouhimana / 0x10000;
1408 shouhimana = (shouhimana & 0xffff);
1409 if (p_ptr->csp_frac < shouhimana)
1412 p_ptr->csp_frac += (u16b)(0x10000L - shouhimana);
1416 p_ptr->csp_frac -= (u16b)shouhimana;
1419 p_ptr->redraw |= PR_MANA;
1420 if (p_ptr->magic_num1[1])
1422 p_ptr->magic_num1[0] = p_ptr->magic_num1[1];
1423 p_ptr->magic_num1[1] = 0;
1425 msg_print("²Î¤òºÆ³«¤·¤¿¡£");
1427 msg_print("You restart singing.");
1429 p_ptr->action = ACTION_SING;
1431 /* Recalculate bonuses */
1432 p_ptr->update |= (PU_BONUS | PU_HP);
1434 /* Redraw status bar */
1435 p_ptr->redraw |= (PR_STATUS);
1438 if (spell_exp[p_ptr->magic_num2[0]] < 900)
1439 spell_exp[p_ptr->magic_num2[0]]+=5;
1440 else if(spell_exp[p_ptr->magic_num2[0]] < 1200)
1441 {if (one_in_(2) && (dun_level > 4) && ((dun_level + 10) > p_ptr->lev)) spell_exp[p_ptr->magic_num2[0]]+=1;}
1442 else if(spell_exp[p_ptr->magic_num2[0]] < 1400)
1443 {if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel)) spell_exp[p_ptr->magic_num2[0]]+=1;}
1444 else if(spell_exp[p_ptr->magic_num2[0]] < 1600)
1445 {if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel)) spell_exp[p_ptr->magic_num2[0]]+=1;}
1447 gere_music(p_ptr->magic_num1[0]);
1450 /* Choose one of items that have cursed flag */
1451 object_type *choose_cursed_obj_name(u32b flag)
1454 int choices[INVEN_TOTAL-INVEN_RARM];
1457 /* Paranoia -- Player has no warning-item */
1458 if (!(p_ptr->cursed & flag)) return NULL;
1460 /* Search Inventry */
1461 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
1463 object_type *o_ptr = &inventory[i];
1465 if (o_ptr->curse_flags & flag)
1467 choices[number] = i;
1472 /* Choice one of them */
1473 return (&inventory[choices[randint0(number)]]);
1478 * Handle certain things once every 10 game turns
1480 static void process_world(void)
1484 bool cave_no_regen = FALSE;
1485 int upkeep_factor = 0;
1490 const int dec_count = (easy_band ? 2 : 1);
1492 int day, hour, min, prev_min;
1494 s32b len = TURNS_PER_TICK * TOWN_DAWN;
1495 s32b tick = turn % len + len / 4;
1497 extract_day_hour_min(&day, &hour, &min);
1498 prev_min = (1440 * (tick - 20) / len) % 60;
1500 if ((turn - old_turn == (150 - dun_level) * TURNS_PER_TICK)
1502 !(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)))) &&
1503 !(p_ptr->inside_battle))
1506 if (p_ptr->inside_battle && !p_ptr->leaving)
1513 /* Count all hostile monsters */
1514 for (i2 = 0; i2 < cur_wid; ++i2)
1515 for (j2 = 0; j2 < cur_hgt; j2++)
1516 if ((cave[j2][i2].m_idx > 0) && (cave[j2][i2].m_idx != p_ptr->riding))
1519 win_m_idx = cave[j2][i2].m_idx;
1522 if (number_mon == 0)
1525 msg_print("ÁêÂǤÁ¤Ë½ª¤ï¤ê¤Þ¤·¤¿¡£");
1527 msg_print("They have kill each other at the same time.");
1530 p_ptr->energy_need = 0;
1533 else if ((number_mon-1) == 0)
1536 monster_type *wm_ptr;
1538 wm_ptr = &m_list[win_m_idx];
1540 monster_desc(m_name, wm_ptr, 0);
1542 msg_format("%s¤¬¾¡Íø¤·¤¿¡ª", m_name);
1544 msg_format("%s is winner!", m_name);
1548 if (win_m_idx == (sel_monster+1))
1551 msg_print("¤ª¤á¤Ç¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£");
1553 msg_print("Congratulations.");
1556 msg_format("%d¡ð¤ò¼õ¤±¼è¤Ã¤¿¡£", battle_odds);
1558 msg_format("You recieved %d gold.", battle_odds);
1560 p_ptr->au += battle_odds;
1565 msg_print("»ÄÇ°¤Ç¤·¤¿¡£");
1567 msg_print("You lost gold.");
1571 p_ptr->energy_need = 0;
1574 else if(turn - old_turn == 150*TURNS_PER_TICK)
1577 msg_print("¿½¤·Ê¬¤±¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤³¤Î¾¡Éé¤Ï°ú¤Ê¬¤±¤È¤µ¤»¤Æ¤¤¤¿¤À¤¤Þ¤¹¡£");
1579 msg_format("This battle have ended in a draw.");
1581 p_ptr->au += kakekin;
1583 p_ptr->energy_need = 0;
1588 /* Every 20 game turns */
1589 if (turn % TURNS_PER_TICK) return;
1591 /*** Check the Time and Load ***/
1593 if (!(turn % (50*TURNS_PER_TICK)))
1595 /* Check time and load */
1596 if ((0 != check_time()) || (0 != check_load()))
1599 if (closing_flag <= 2)
1604 /* Count warnings */
1609 msg_print("¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¸¤«¤«¤Ã¤Æ¤¤¤Þ¤¹...");
1610 msg_print("¥²¡¼¥à¤ò½ªÎ»¤¹¤ë¤«¥»¡¼¥Ö¤¹¤ë¤«¤·¤Æ²¼¤µ¤¤¡£");
1612 msg_print("The gates to ANGBAND are closing...");
1613 msg_print("Please finish up and/or save your game.");
1623 msg_print("º£¡¢¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¶¤µ¤ì¤Þ¤·¤¿¡£");
1625 msg_print("The gates to ANGBAND are now closed.");
1633 p_ptr->leaving = TRUE;
1638 /*** Attempt timed autosave ***/
1639 if (autosave_t && autosave_freq && !p_ptr->inside_battle)
1641 if (!(turn % ((s32b)autosave_freq * TURNS_PER_TICK)))
1642 do_cmd_save_game(TRUE);
1648 msg_print("²¿¤«¤¬Ê¹¤³¤¨¤¿¡£");
1650 msg_print("You hear noise.");
1654 /*** Handle the wilderness/town (sunshine) ***/
1656 /* While in town/wilderness */
1657 if (!dun_level && !p_ptr->inside_quest && !p_ptr->inside_battle && !p_ptr->inside_arena && !p_ptr->wild_mode)
1659 /* Hack -- Daybreak/Nighfall in town */
1660 if (!(turn % ((TURNS_PER_TICK * TOWN_DAWN) / 2)))
1664 /* Check for dawn */
1665 dawn = (!(turn % (TURNS_PER_TICK * TOWN_DAWN)));
1672 msg_print("Ì뤬ÌÀ¤±¤¿¡£");
1674 msg_print("The sun has risen.");
1678 /* Hack -- Scan the town */
1679 for (y = 0; y < cur_hgt; y++)
1681 for (x = 0; x < cur_wid; x++)
1683 /* Get the cave grid */
1684 c_ptr = &cave[y][x];
1687 c_ptr->info |= (CAVE_GLOW);
1689 /* Hack -- Memorize lit grids if allowed */
1690 if (view_perma_grids) c_ptr->info |= (CAVE_MARK);
1692 /* Hack -- Notice spot */
1703 msg_print("Æü¤¬ÄÀ¤ó¤À¡£");
1705 msg_print("The sun has fallen.");
1709 /* Hack -- Scan the town */
1710 for (y = 0; y < cur_hgt; y++)
1712 for (x = 0; x < cur_wid; x++)
1714 /* Get the cave grid */
1715 c_ptr = &cave[y][x];
1717 /* Darken "boring" features */
1718 if ((c_ptr->feat <= FEAT_INVIS) ||
1719 ((c_ptr->feat >= FEAT_DEEP_WATER) &&
1720 (c_ptr->feat <= FEAT_MOUNTAIN) &&
1721 (c_ptr->feat != FEAT_MUSEUM)) ||
1722 (x == 0) || (x == cur_wid-1) ||
1723 (y == 0) || (y == cur_hgt-1))
1725 /* Forget the grid */
1726 c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK);
1728 /* Hack -- Notice spot */
1735 /* Update the monsters */
1736 p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
1739 p_ptr->redraw |= (PR_MAP);
1742 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1746 /* Set back the rewards once a day */
1747 if (!(turn % (TURNS_PER_TICK*10 * STORE_TURNS)))
1751 /* Reset the rewards */
1752 for (n = 0; n < MAX_BACT; n++)
1754 p_ptr->rewards[n] = FALSE;
1759 if (cheat_xtra) msg_print("Êó½·¤ò¥ê¥»¥Ã¥È");
1761 if (cheat_xtra) msg_print("Rewards reset.");
1767 /*** Process the monsters ***/
1769 /* Check for creature generation. */
1770 if (one_in_(d_info[dungeon_type].max_m_alloc_chance) &&
1771 !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->inside_battle)
1773 /* Make a new monster */
1774 (void)alloc_monster(MAX_SIGHT + 5, FALSE);
1777 /* Hack -- Check for creature regeneration */
1778 if (!(turn % (TURNS_PER_TICK*10)) && !p_ptr->inside_battle) regen_monsters();
1779 if (!(turn % (TURNS_PER_TICK*3))) regen_captured_monsters();
1782 /*** Damage over Time ***/
1784 /* Take damage from poison */
1785 if (p_ptr->poisoned && !p_ptr->invuln)
1789 take_hit(DAMAGE_NOESCAPE, 1, "ÆÇ", -1);
1791 take_hit(DAMAGE_NOESCAPE, 1, "poison", -1);
1797 /* (Vampires) Take damage from sunlight */
1798 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
1800 if (!dun_level && !p_ptr->resist_lite && !p_ptr->invuln && is_daytime())
1802 if (cave[py][px].info & CAVE_GLOW)
1806 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª");
1807 take_hit(DAMAGE_NOESCAPE, 1, "Æü¸÷", -1);
1809 msg_print("The sun's rays scorch your undead flesh!");
1810 take_hit(DAMAGE_NOESCAPE, 1, "sunlight", -1);
1813 cave_no_regen = TRUE;
1817 if (inventory[INVEN_LITE].tval && (inventory[INVEN_LITE].name2 != EGO_LITE_DARKNESS) &&
1818 !p_ptr->resist_lite)
1820 object_type * o_ptr = &inventory[INVEN_LITE];
1821 char o_name [MAX_NLEN];
1822 char ouch [MAX_NLEN+40];
1824 /* Get an object description */
1825 object_desc(o_name, o_ptr, FALSE, 0);
1828 msg_format("%s¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª", o_name);
1830 msg_format("The %s scorches your undead flesh!", o_name);
1834 cave_no_regen = TRUE;
1836 /* Get an object description */
1837 object_desc(o_name, o_ptr, TRUE, 0);
1840 sprintf(ouch, "%s¤òÁõÈ÷¤·¤¿¥À¥á¡¼¥¸", o_name);
1842 sprintf(ouch, "wielding %s", o_name);
1845 if (!p_ptr->invuln) take_hit(DAMAGE_NOESCAPE, 1, ouch, -1);
1849 if ((cave[py][px].feat == FEAT_SHAL_LAVA) &&
1850 !p_ptr->invuln && !p_ptr->immune_fire && !p_ptr->ffall)
1852 int damage = 3000 + randint0(2000);
1854 if (prace_is_(RACE_ENT)) damage += damage/3;
1856 if (p_ptr->resist_fire) damage = damage / 3;
1857 if (p_ptr->oppose_fire) damage = damage / 3;
1858 damage = damage / 100 + (randint0(100) < (damage % 100));
1864 msg_print("ÍÏ´ä¤Ç²Ð½ý¤·¤¿¡ª");
1865 take_hit(DAMAGE_NOESCAPE, damage, "Àõ¤¤ÍÏ´äή", -1);
1867 msg_print("The lava burns you!");
1868 take_hit(DAMAGE_NOESCAPE, damage, "shallow lava", -1);
1871 cave_no_regen = TRUE;
1875 else if ((cave[py][px].feat == FEAT_DEEP_LAVA) &&
1876 !p_ptr->invuln && !p_ptr->immune_fire)
1878 int damage = 6000 + randint0(4000);
1883 if (p_ptr->resist_fire) damage = damage / 3;
1884 if (p_ptr->oppose_fire) damage = damage / 3;
1888 damage = damage / 5;
1891 message = "Ç®¤Ç²Ð½ý¤·¤¿¡ª";
1892 hit_from = "¿¼¤¤ÍÏ´äή¤Î¾å¤ËÉâÍ·¤·¤¿¥À¥á¡¼¥¸";
1894 message = "The heat burns you!";
1895 hit_from = "flying over deep lava";
1902 message = "ÍÏ´ä¤Ç²Ð½ý¤·¤¿¡ª";
1903 hit_from = "¿¼¤¤ÍÏ´äή";
1905 message = "The lava burns you!";
1906 hit_from = "deep lava";
1911 damage = damage / 100 + (randint0(100) < (damage % 100));
1916 take_hit(DAMAGE_NOESCAPE, damage, hit_from, -1);
1918 cave_no_regen = TRUE;
1922 else if ((cave[py][px].feat == FEAT_DEEP_WATER) && !p_ptr->ffall && !p_ptr->can_swim)
1924 if (p_ptr->total_weight > (((u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2))
1928 msg_print("Å®¤ì¤Æ¤¤¤ë¡ª");
1929 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), "Å®¤ì", -1);
1931 msg_print("You are drowning!");
1932 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), "drowning", -1);
1935 cave_no_regen = TRUE;
1942 if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !p_ptr->immune_fire)
1944 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1945 if (prace_is_(RACE_ENT)) damage += damage/3;
1946 if (p_ptr->resist_fire) damage = damage / 3;
1947 if (p_ptr->oppose_fire) damage = damage / 3;
1949 msg_print("Ç®¤¤¡ª");
1950 take_hit(DAMAGE_NOESCAPE, damage, "±ê¤Î¥ª¡¼¥é", -1);
1952 msg_print("It's hot!");
1953 take_hit(DAMAGE_NOESCAPE, damage, "Fire aura", -1);
1956 if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !p_ptr->immune_elec)
1958 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1959 if (p_ptr->resist_elec) damage = damage / 3;
1960 if (p_ptr->oppose_elec) damage = damage / 3;
1962 msg_print("Äˤ¤¡ª");
1963 take_hit(DAMAGE_NOESCAPE, damage, "Åŵ¤¤Î¥ª¡¼¥é", -1);
1965 msg_print("It hurts!");
1966 take_hit(DAMAGE_NOESCAPE, damage, "Elec aura", -1);
1969 if ((r_info[m_list[p_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !p_ptr->immune_cold)
1971 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1972 if (p_ptr->resist_cold) damage = damage / 3;
1973 if (p_ptr->oppose_cold) damage = damage / 3;
1975 msg_print("Î䤿¤¤¡ª");
1976 take_hit(DAMAGE_NOESCAPE, damage, "Î䵤¤Î¥ª¡¼¥é", -1);
1978 msg_print("It's cold!");
1979 take_hit(DAMAGE_NOESCAPE, damage, "Cold aura", -1);
1984 /* Spectres -- take damage when moving through walls */
1986 * Added: ANYBODY takes damage if inside through walls
1987 * without wraith form -- NOTE: Spectres will never be
1988 * reduced below 0 hp by being inside a stone wall; others
1991 if (!cave_floor_bold(py, px))
1993 /* Player can walk through trees */
1994 if ((cave[py][px].feat == FEAT_TREES) || ((cave[py][px].feat == FEAT_MOUNTAIN) && !dun_level && p_ptr->ffall))
1998 else if (!p_ptr->invuln && !p_ptr->wraith_form && !p_ptr->kabenuke &&
1999 ((p_ptr->chp > (p_ptr->lev / 5)) || !p_ptr->pass_wall))
2003 cave_no_regen = TRUE;
2005 if (p_ptr->pass_wall)
2008 msg_print("ÂΤÎʬ»Ò¤¬Ê¬²ò¤·¤¿µ¤¤¬¤¹¤ë¡ª");
2011 msg_print("Your molecules feel disrupted!");
2012 dam_desc = "density";
2019 msg_print("Êø¤ì¤¿´ä¤Ë²¡¤·ÄÙ¤µ¤ì¤¿¡ª");
2020 dam_desc = "¹Å¤¤´ä";
2022 msg_print("You are being crushed!");
2023 dam_desc = "solid rock";
2028 take_hit(DAMAGE_NOESCAPE, 1 + (p_ptr->lev / 5), dam_desc, -1);
2034 monster_race *r_ptr;
2036 if (min != prev_min)
2039 bool old_inside_battle = p_ptr->inside_battle;
2041 do_cmd_write_nikki(NIKKI_HIGAWARI, 0, NULL);
2043 p_ptr->inside_battle = TRUE;
2044 get_mon_num_prep(NULL,NULL);
2046 for (i = 0; i < max_d_idx; i++)
2048 if (max_dlv[i] < d_info[i].mindepth) continue;
2049 if (max_dl < max_dlv[i]) max_dl = max_dlv[i];
2053 today_mon = get_mon_num(max_dl);
2054 r_ptr = &r_info[today_mon];
2056 if (r_ptr->flags1 & RF1_UNIQUE) continue;
2057 if (r_ptr->flags7 & (RF7_UNIQUE_7 | RF7_UNIQUE2)) continue;
2058 if (r_ptr->flags2 & (RF2_MULTIPLY)) continue;
2059 if (!(r_ptr->flags9 & RF9_DROP_CORPSE) || !(r_ptr->flags9 & RF9_DROP_SKELETON)) continue;
2060 if (r_ptr->level < MIN(max_dl/2, 40)) continue;
2061 if (r_ptr->rarity > 10) continue;
2062 if (r_ptr->level == 0) continue;
2065 p_ptr->today_mon = 0;
2066 p_ptr->inside_battle = old_inside_battle;
2070 /* Nightmare mode activates the TY_CURSE at midnight */
2071 if (ironman_nightmare)
2073 /* Require exact minute */
2074 if (min != prev_min)
2076 /* Every 15 minutes after 11:00 pm */
2077 if ((hour == 23) && !(min % 15))
2087 msg_print("±ó¤¯¤ÇÉÔµ¤Ì£¤Ê¾â¤Î²»¤¬ÌĤä¿¡£");
2089 msg_print("You hear a distant bell toll ominously.");
2097 msg_print("±ó¤¯¤Ç¾â¤¬Æó²óÌĤä¿¡£");
2099 msg_print("A distant bell sounds twice.");
2107 msg_print("±ó¤¯¤Ç¾â¤¬»°²óÌĤä¿¡£");
2109 msg_print("A distant bell sounds three times.");
2117 msg_print("±ó¤¯¤Ç¾â¤¬»Í²óÌĤä¿¡£");
2119 msg_print("A distant bell tolls four times.");
2127 /* TY_CURSE activates at mignight! */
2134 msg_print("±ó¤¯¤Ç¾â¤¬²¿²ó¤âÌĤꡢ»à¤ó¤À¤è¤¦¤ÊÀŤ±¤µ¤ÎÃæ¤Ø¾Ã¤¨¤Æ¤¤¤Ã¤¿¡£");
2136 msg_print("A distant bell tolls many times, fading into an deathly silence.");
2139 activate_ty_curse(FALSE, &count);
2144 /* Take damage from cuts */
2145 if (p_ptr->cut && !p_ptr->invuln)
2147 /* Mortal wound or Deep Gash */
2148 if (p_ptr->cut > 1000)
2153 else if (p_ptr->cut > 200)
2159 else if (p_ptr->cut > 100)
2164 else if (p_ptr->cut > 50)
2169 else if (p_ptr->cut > 25)
2174 else if (p_ptr->cut > 10)
2187 take_hit(DAMAGE_NOESCAPE, i, "Ã×Ì¿½ý", -1);
2189 take_hit(DAMAGE_NOESCAPE, i, "a fatal wound", -1);
2195 /*** Check the Food, and Regenerate ***/
2197 if (!p_ptr->inside_battle)
2199 /* Digest normally */
2200 if (p_ptr->food < PY_FOOD_MAX)
2202 /* Every 100 game turns */
2203 if (!(turn % (TURNS_PER_TICK*5)))
2205 /* Basic digestion rate based on speed */
2206 i = /* extract_energy[p_ptr->pspeed] * 2;*/
2207 ((p_ptr->pspeed > 199) ? 49 : ((p_ptr->pspeed < 0) ?
2208 1 : extract_energy[p_ptr->pspeed]));
2210 /* Regeneration takes more food */
2211 if (p_ptr->regenerate) i += 20;
2212 if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK)) i+= 20;
2213 if (p_ptr->cursed & TRC_FAST_DIGEST) i += 30;
2215 /* Slow digestion takes less food */
2216 if (p_ptr->slow_digest) i -= 5;
2218 /* Minimal digestion */
2220 /* Maximal digestion */
2221 if (i > 100) i = 100;
2223 /* Digest some food */
2224 (void)set_food(p_ptr->food - i);
2228 /* Digest quickly when gorged */
2231 /* Digest a lot of food */
2232 (void)set_food(p_ptr->food - 100);
2236 /* Starve to death (slowly) */
2237 if (p_ptr->food < PY_FOOD_STARVE)
2239 /* Calculate damage */
2240 i = (PY_FOOD_STARVE - p_ptr->food) / 10;
2244 if (!p_ptr->invuln) take_hit(DAMAGE_LOSELIFE, i, "¶õÊ¢", -1);
2246 if (!p_ptr->invuln) take_hit(DAMAGE_LOSELIFE, i, "starvation", -1);
2251 /* Default regeneration */
2252 regen_amount = PY_REGEN_NORMAL;
2255 if (p_ptr->food < PY_FOOD_WEAK)
2257 /* Lower regeneration */
2258 if (p_ptr->food < PY_FOOD_STARVE)
2262 else if (p_ptr->food < PY_FOOD_FAINT)
2264 regen_amount = PY_REGEN_FAINT;
2268 regen_amount = PY_REGEN_WEAK;
2272 if ((p_ptr->food < PY_FOOD_FAINT) && !p_ptr->inside_battle)
2274 /* Faint occasionally */
2275 if (!p_ptr->paralyzed && (randint0(100) < 10))
2279 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤À䤷¤Æ¤·¤Þ¤Ã¤¿¡£");
2281 msg_print("You faint from the lack of food.");
2286 /* Hack -- faint (bypass free action) */
2287 (void)set_paralyzed(p_ptr->paralyzed + 1 + randint0(5));
2293 /* Are we walking the pattern? */
2294 if (pattern_effect())
2296 cave_no_regen = TRUE;
2300 /* Regeneration ability */
2301 if (p_ptr->regenerate)
2303 regen_amount = regen_amount * 2;
2305 if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK))
2309 if (p_ptr->cursed & TRC_SLOW_REGEN)
2316 /* Searching or Resting */
2317 if ((p_ptr->action == ACTION_SEARCH) || (p_ptr->action == ACTION_REST))
2319 regen_amount = regen_amount * 2;
2322 upkeep_factor = calculate_upkeep();
2324 /* Regenerate the mana */
2325 /* if (p_ptr->csp < p_ptr->msp) */
2329 s32b upkeep_regen = ((100 - upkeep_factor) * regen_amount);
2330 if ((p_ptr->action == ACTION_LEARN) || (p_ptr->action == ACTION_HAYAGAKE)) upkeep_regen -= regen_amount;
2331 regenmana(upkeep_regen/100);
2333 #ifdef TRACK_FRIENDS
2337 msg_format("£Í£Ð²óÉü: %d/%d", upkeep_regen, regen_amount);
2339 msg_format("Regen: %d/%d", upkeep_regen, regen_amount);
2343 #endif /* TRACK_FRIENDS */
2346 else if (p_ptr->action != ACTION_LEARN)
2348 regenmana(regen_amount);
2351 if (p_ptr->pclass == CLASS_MAGIC_EATER)
2353 regenmagic(regen_amount);
2356 if ((p_ptr->csp == 0) && (p_ptr->csp_frac == 0))
2358 while (upkeep_factor > 100)
2361 msg_print("¤³¤ó¤Ê¤Ë¿¤¯¤Î¥Ú¥Ã¥È¤òÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
2363 msg_print("Such much pets cannot be controled at once!");
2366 do_cmd_pet_dismiss();
2368 upkeep_factor = calculate_upkeep();
2371 msg_format("°Ý»ý£Í£Ð¤Ï %d%%", upkeep_factor);
2373 msg_format("Upkeep: %d%% mana.", upkeep_factor);
2379 /* Poisoned or cut yields no healing */
2380 if (p_ptr->poisoned) regen_amount = 0;
2381 if (p_ptr->cut) regen_amount = 0;
2383 /* Special floor -- Pattern, in a wall -- yields no healing */
2384 if (cave_no_regen) regen_amount = 0;
2386 regen_amount = (regen_amount * mutant_regenerate_mod) / 100;
2388 /* Regenerate Hit Points if needed */
2389 if ((p_ptr->chp < p_ptr->mhp) && !cave_no_regen)
2391 if ((cave[py][px].feat < FEAT_PATTERN_END) &&
2392 (cave[py][px].feat >= FEAT_PATTERN_START))
2394 regenhp(regen_amount / 5); /* Hmmm. this should never happen? */
2398 regenhp(regen_amount);
2403 /*** Timeout Various Things ***/
2406 if (p_ptr->tim_mimic)
2408 (void)set_mimic(p_ptr->tim_mimic - 1, p_ptr->mimic_form, TRUE);
2411 /* Hack -- Hallucinating */
2414 (void)set_image(p_ptr->image - dec_count);
2420 (void)set_blind(p_ptr->blind - dec_count);
2423 /* Times see-invisible */
2424 if (p_ptr->tim_invis)
2426 (void)set_tim_invis(p_ptr->tim_invis - 1, TRUE);
2437 (void)set_tim_esp(p_ptr->tim_esp - 1, TRUE);
2440 /* Timed temporary elemental brands. -LM- */
2441 if (p_ptr->ele_attack)
2443 p_ptr->ele_attack--;
2445 /* Clear all temporary elemental brands. */
2446 if (!p_ptr->ele_attack) set_ele_attack(0, 0);
2449 /* Timed temporary elemental immune. -LM- */
2450 if (p_ptr->ele_immune)
2452 p_ptr->ele_immune--;
2454 /* Clear all temporary elemental brands. */
2455 if (!p_ptr->ele_immune) set_ele_immune(0, 0);
2458 /* Timed infra-vision */
2459 if (p_ptr->tim_infra)
2461 (void)set_tim_infra(p_ptr->tim_infra - 1, TRUE);
2465 if (p_ptr->tim_stealth)
2467 (void)set_tim_stealth(p_ptr->tim_stealth - 1, TRUE);
2470 /* Timed levitation */
2471 if (p_ptr->tim_ffall)
2473 (void)set_tim_ffall(p_ptr->tim_ffall - 1, TRUE);
2476 /* Timed sh_touki */
2477 if (p_ptr->tim_sh_touki)
2479 (void)set_tim_sh_touki(p_ptr->tim_sh_touki - 1, TRUE);
2483 if (p_ptr->tim_sh_fire)
2485 (void)set_tim_sh_fire(p_ptr->tim_sh_fire - 1, TRUE);
2488 /* Timed resist-magic */
2489 if (p_ptr->resist_magic)
2491 (void)set_resist_magic(p_ptr->resist_magic - 1, TRUE);
2494 /* Timed regeneration */
2495 if (p_ptr->tim_regen)
2497 (void)set_tim_regen(p_ptr->tim_regen - 1, TRUE);
2500 /* Timed resist nether */
2501 if (p_ptr->tim_res_nether)
2503 (void)set_tim_res_nether(p_ptr->tim_res_nether - 1, TRUE);
2506 /* Timed resist time */
2507 if (p_ptr->tim_res_time)
2509 (void)set_tim_res_time(p_ptr->tim_res_time - 1, TRUE);
2513 if (p_ptr->tim_reflect)
2515 (void)set_tim_reflect(p_ptr->tim_reflect - 1, TRUE);
2519 if (p_ptr->multishadow)
2521 (void)set_multishadow(p_ptr->multishadow - 1, TRUE);
2524 /* Timed Robe of dust */
2525 if (p_ptr->dustrobe)
2527 (void)set_dustrobe(p_ptr->dustrobe - 1, TRUE);
2530 /* Timed infra-vision */
2531 if (p_ptr->kabenuke)
2533 (void)set_kabenuke(p_ptr->kabenuke - 1, TRUE);
2537 if (p_ptr->paralyzed)
2539 (void)set_paralyzed(p_ptr->paralyzed - dec_count);
2543 if (p_ptr->confused)
2545 (void)set_confused(p_ptr->confused - dec_count);
2551 (void)set_afraid(p_ptr->afraid - dec_count);
2557 (void)set_fast(p_ptr->fast - 1, TRUE);
2563 (void)set_slow(p_ptr->slow - dec_count, TRUE);
2566 /* Protection from evil */
2567 if (p_ptr->protevil)
2569 (void)set_protevil(p_ptr->protevil - 1, TRUE);
2572 /* Invulnerability */
2575 (void)set_invuln(p_ptr->invuln - 1, TRUE);
2579 if (p_ptr->wraith_form)
2581 (void)set_wraith_form(p_ptr->wraith_form - 1, TRUE);
2587 (void)set_hero(p_ptr->hero - 1, TRUE);
2593 (void)set_shero(p_ptr->shero - 1, TRUE);
2599 (void)set_blessed(p_ptr->blessed - 1, TRUE);
2605 (void)set_shield(p_ptr->shield - 1, TRUE);
2609 if (p_ptr->tsubureru)
2611 (void)set_tsubureru(p_ptr->tsubureru - 1, TRUE);
2615 if (p_ptr->magicdef)
2617 (void)set_magicdef(p_ptr->magicdef - 1, TRUE);
2621 if (p_ptr->tsuyoshi)
2623 (void)set_tsuyoshi(p_ptr->tsuyoshi - 1, TRUE);
2627 if (p_ptr->oppose_acid)
2629 (void)set_oppose_acid(p_ptr->oppose_acid - 1, TRUE);
2632 /* Oppose Lightning */
2633 if (p_ptr->oppose_elec)
2635 (void)set_oppose_elec(p_ptr->oppose_elec - 1, TRUE);
2639 if (p_ptr->oppose_fire)
2641 (void)set_oppose_fire(p_ptr->oppose_fire - 1, TRUE);
2645 if (p_ptr->oppose_cold)
2647 (void)set_oppose_cold(p_ptr->oppose_cold - 1, TRUE);
2651 if (p_ptr->oppose_pois)
2653 (void)set_oppose_pois(p_ptr->oppose_pois - 1, TRUE);
2658 (void)set_ultimate_res(p_ptr->ult_res - 1, TRUE);
2661 /*** Poison and Stun and Cut ***/
2664 if (p_ptr->poisoned)
2666 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2668 /* Apply some healing */
2669 (void)set_poisoned(p_ptr->poisoned - adjust);
2675 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2677 /* Apply some healing */
2678 (void)set_stun(p_ptr->stun - adjust);
2684 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2686 /* Hack -- Truly "mortal" wound */
2687 if (p_ptr->cut > 1000) adjust = 0;
2689 /* Apply some healing */
2690 (void)set_cut(p_ptr->cut - adjust);
2695 /*** Process Light ***/
2697 /* Check for light being wielded */
2698 o_ptr = &inventory[INVEN_LITE];
2700 /* Burn some fuel in the current lite */
2701 if (o_ptr->tval == TV_LITE)
2703 /* Hack -- Use some fuel (except on artifacts) */
2704 if (!(artifact_p(o_ptr) || o_ptr->sval == SV_LITE_FEANOR) && (o_ptr->xtra4 > 0))
2706 /* Decrease life-span */
2707 if (o_ptr->name2 == EGO_LITE_LONG)
2709 if (turn % (TURNS_PER_TICK*2)) o_ptr->xtra4--;
2711 else o_ptr->xtra4--;
2713 /* Notice interesting fuel steps */
2714 notice_lite_change(o_ptr);
2718 /* Calculate torch radius */
2719 p_ptr->update |= (PU_TORCH);
2722 /*** Process mutation effects ***/
2723 if (p_ptr->muta2 && !p_ptr->inside_battle && !p_ptr->wild_mode)
2725 if ((p_ptr->muta2 & MUT2_BERS_RAGE) && one_in_(3000))
2729 msg_print("¥¦¥¬¥¡¥¡¥¢¡ª");
2730 msg_print("·ãÅܤÎȯºî¤Ë½±¤ï¤ì¤¿¡ª");
2732 msg_print("RAAAAGHH!");
2733 msg_print("You feel a fit of rage coming over you!");
2736 (void)set_shero(10 + randint1(p_ptr->lev), FALSE);
2739 if ((p_ptr->muta2 & MUT2_COWARDICE) && (randint1(3000) == 13))
2741 if (!(p_ptr->resist_fear || p_ptr->hero || p_ptr->shero))
2745 msg_print("¤È¤Æ¤â°Å¤¤... ¤È¤Æ¤â¶²¤¤¡ª");
2747 msg_print("It's so dark... so scary!");
2750 set_afraid(p_ptr->afraid + 13 + randint1(26));
2754 if ((p_ptr->muta2 & MUT2_RTELEPORT) && (randint1(5000) == 88))
2756 if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) &&
2761 /* Teleport player */
2763 msg_print("¤¢¤Ê¤¿¤Î°ÌÃÖ¤ÏÆÍÁ³¤Ò¤¸¤ç¤¦¤ËÉÔ³ÎÄê¤Ë¤Ê¤Ã¤¿...");
2765 msg_print("Your position suddenly seems very uncertain...");
2769 teleport_player(40);
2773 if ((p_ptr->muta2 & MUT2_ALCOHOL) && (randint1(6400) == 321))
2775 if (!p_ptr->resist_conf && !p_ptr->resist_chaos)
2778 p_ptr->redraw |= PR_EXTRA;
2780 msg_print("¤¤¤Ò¤¤¬¤â¡¼¤í¡¼¤È¤Ò¤Æ¤¤¿¤¤¬¤Õ¤ë...¥Ò¥Ã¥¯¡ª");
2782 msg_print("You feel a SSSCHtupor cOmINg over yOu... *HIC*!");
2787 if (!p_ptr->resist_conf)
2789 (void)set_confused(p_ptr->confused + randint0(20) + 15);
2792 if (!p_ptr->resist_chaos)
2797 if (one_in_(3)) lose_all_info();
2799 teleport_player(100);
2802 msg_print("¤¢¤Ê¤¿¤Ï¸«ÃΤé¤Ì¾ì½ê¤ÇÌܤ¬Àä᤿...Ƭ¤¬Äˤ¤¡£");
2803 msg_print("²¿¤â³Ð¤¨¤Æ¤¤¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ËÍ褿¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
2805 msg_print("You wake up somewhere with a sore head...");
2806 msg_print("You can't remember a thing, or how you got here!");
2815 msg_print("¤¡Á¤ì¤¤¤Ê¤Á¤ç¤ª¤Á¤ç¤é¤È¤ó¤ì¤¤¤ë¡Á");
2817 msg_print("Thishcischs GooDSChtuff!");
2820 (void)set_image(p_ptr->image + randint0(150) + 150);
2826 if ((p_ptr->muta2 & MUT2_HALLU) && (randint1(6400) == 42))
2828 if (!p_ptr->resist_chaos)
2831 p_ptr->redraw |= PR_EXTRA;
2832 (void)set_image(p_ptr->image + randint0(50) + 20);
2836 if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint1(3000) == 13))
2841 msg_print("¥Ö¥¥¡¼¡¼¥Ã¡ª¤ª¤Ã¤È¡£");
2843 msg_print("BRRAAAP! Oops.");
2847 fire_ball(GF_POIS, 0, p_ptr->lev, 3);
2850 if ((p_ptr->muta2 & MUT2_PROD_MANA) &&
2851 !p_ptr->anti_magic && one_in_(9000))
2856 msg_print("ËâË¡¤Î¥¨¥Í¥ë¥®¡¼¤¬ÆÍÁ³¤¢¤Ê¤¿¤ÎÃæ¤Ëή¤ì¹þ¤ó¤Ç¤¤¿¡ª¥¨¥Í¥ë¥®¡¼¤ò²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡ª");
2858 msg_print("Magical energy flows through you! You must release it!");
2863 (void)get_hack_dir(&dire);
2864 fire_ball(GF_MANA, dire, p_ptr->lev * 2, 3);
2867 if ((p_ptr->muta2 & MUT2_ATT_DEMON) &&
2868 !p_ptr->anti_magic && (randint1(6666) == 666))
2870 bool pet = one_in_(6);
2871 bool not_pet = (bool)(!pet);
2873 if (summon_specific((pet ? -1 : 0), py, px,
2874 dun_level, SUMMON_DEMON, TRUE, FALSE, pet, not_pet, not_pet))
2877 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤ò°ú¤´ó¤»¤¿¡ª");
2879 msg_print("You have attracted a demon!");
2886 if ((p_ptr->muta2 & MUT2_SPEED_FLUX) && one_in_(6000))
2892 msg_print("ÀºÎÏŪ¤Ç¤Ê¤¯¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2894 msg_print("You feel less energetic.");
2897 if (p_ptr->fast > 0)
2903 set_slow(randint1(30) + 10, FALSE);
2909 msg_print("ÀºÎÏŪ¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2911 msg_print("You feel more energetic.");
2914 if (p_ptr->slow > 0)
2920 set_fast(randint1(30) + 10, FALSE);
2925 if ((p_ptr->muta2 & MUT2_BANISH_ALL) && one_in_(9000))
2929 msg_print("ÆÍÁ³¤Û¤È¤ó¤É¸ÉÆȤˤʤ俵¤¤¬¤¹¤ë¡£");
2931 msg_print("You suddenly feel almost lonely.");
2934 banish_monsters(100);
2935 if (!dun_level && p_ptr->town_num)
2938 msg_print("Ź¤Î¼ç¿Í¤¬µÖ¤Ë¸þ¤«¤Ã¤ÆÁö¤Ã¤Æ¤¤¤ë¡ª");
2940 msg_print("You see one of the shopkeepers running for the hills!");
2943 store_shuffle(randint0(MAX_STORES));
2948 if ((p_ptr->muta2 & MUT2_EAT_LIGHT) && one_in_(3000))
2953 msg_print("±Æ¤Ë¤Ä¤Ä¤Þ¤ì¤¿¡£");
2955 msg_print("A shadow passes over you.");
2960 /* Absorb light from the current possition */
2961 if (cave[py][px].info & CAVE_GLOW)
2966 o_ptr = &inventory[INVEN_LITE];
2968 /* Absorb some fuel in the current lite */
2969 if (o_ptr->tval == TV_LITE)
2971 /* Use some fuel (except on artifacts) */
2972 if (!artifact_p(o_ptr) && (o_ptr->xtra4 > 0))
2974 /* Heal the player a bit */
2975 hp_player(o_ptr->xtra4 / 20);
2977 /* Decrease life-span of lite */
2981 msg_print("¸÷¸»¤«¤é¥¨¥Í¥ë¥®¡¼¤òµÛ¼ý¤·¤¿¡ª");
2983 msg_print("You absorb energy from your light!");
2987 /* Notice interesting fuel steps */
2988 notice_lite_change(o_ptr);
2993 * Unlite the area (radius 10) around player and
2994 * do 50 points damage to every affected monster
2996 unlite_area(50, 10);
2999 if ((p_ptr->muta2 & MUT2_ATT_ANIMAL) &&
3000 !p_ptr->anti_magic && one_in_(7000))
3002 bool pet = one_in_(3);
3003 bool not_pet = (bool)(!pet);
3005 if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_ANIMAL,
3006 TRUE, FALSE, pet, not_pet, not_pet))
3009 msg_print("ưʪ¤ò°ú¤´ó¤»¤¿¡ª");
3011 msg_print("You have attracted an animal!");
3018 if ((p_ptr->muta2 & MUT2_RAW_CHAOS) &&
3019 !p_ptr->anti_magic && one_in_(8000))
3023 msg_print("¼þ¤ê¤Î¶õ´Ö¤¬ÏĤó¤Ç¤¤¤ëµ¤¤¬¤¹¤ë¡ª");
3025 msg_print("You feel the world warping around you!");
3029 fire_ball(GF_CHAOS, 0, p_ptr->lev, 8);
3031 if ((p_ptr->muta2 & MUT2_NORMALITY) && one_in_(5000))
3033 if (!lose_mutation(0))
3035 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
3037 msg_print("You feel oddly normal.");
3041 if ((p_ptr->muta2 & MUT2_WRAITH) && !p_ptr->anti_magic && one_in_(3000))
3045 msg_print("Èóʪ¼Á²½¤·¤¿¡ª");
3047 msg_print("You feel insubstantial!");
3051 set_wraith_form(randint1(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE);
3053 if ((p_ptr->muta2 & MUT2_POLY_WOUND) && one_in_(3000))
3057 if ((p_ptr->muta2 & MUT2_WASTING) && one_in_(3000))
3059 int which_stat = randint0(6);
3060 int sustained = FALSE;
3065 if (p_ptr->sustain_str) sustained = TRUE;
3068 if (p_ptr->sustain_int) sustained = TRUE;
3071 if (p_ptr->sustain_wis) sustained = TRUE;
3074 if (p_ptr->sustain_dex) sustained = TRUE;
3077 if (p_ptr->sustain_con) sustained = TRUE;
3080 if (p_ptr->sustain_chr) sustained = TRUE;
3084 msg_print("ÉÔÀµ¤Ê¾õÂÖ¡ª");
3086 msg_print("Invalid stat chosen!");
3096 msg_print("¼«Ê¬¤¬¿ê¼å¤·¤Æ¤¤¤¯¤Î¤¬Ê¬¤«¤ë¡ª");
3098 msg_print("You can feel yourself wasting away!");
3102 (void)dec_stat(which_stat, randint1(6) + 6, one_in_(3));
3105 if ((p_ptr->muta2 & MUT2_ATT_DRAGON) &&
3106 !p_ptr->anti_magic && one_in_(3000))
3108 bool pet = one_in_(5);
3109 bool not_pet = (bool)(!pet);
3111 if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_DRAGON,
3112 TRUE, FALSE, pet, not_pet, not_pet))
3115 msg_print("¥É¥é¥´¥ó¤ò°ú¤´ó¤»¤¿¡ª");
3117 msg_print("You have attracted a dragon!");
3123 if ((p_ptr->muta2 & MUT2_WEIRD_MIND) && !p_ptr->anti_magic &&
3126 if (p_ptr->tim_esp > 0)
3129 msg_print("Àº¿À¤Ë¤â¤ä¤¬¤«¤«¤Ã¤¿¡ª");
3131 msg_print("Your mind feels cloudy!");
3134 set_tim_esp(0, TRUE);
3139 msg_print("Àº¿À¤¬¹¤¬¤Ã¤¿¡ª");
3141 msg_print("Your mind expands!");
3144 set_tim_esp(p_ptr->lev, FALSE);
3147 if ((p_ptr->muta2 & MUT2_NAUSEA) && !p_ptr->slow_digest &&
3152 msg_print("°ß¤¬áÛÚ»¤·¡¢¿©»ö¤ò¼º¤Ã¤¿¡ª");
3154 msg_print("Your stomach roils, and you lose your lunch!");
3158 set_food(PY_FOOD_WEAK);
3161 if ((p_ptr->muta2 & MUT2_WALK_SHAD) &&
3162 !p_ptr->anti_magic && one_in_(12000) && !p_ptr->inside_arena)
3167 if ((p_ptr->muta2 & MUT2_WARNING) && one_in_(1000))
3169 int danger_amount = 0;
3172 for (monster = 0; monster < m_max; monster++)
3174 monster_type *m_ptr = &m_list[monster];
3175 monster_race *r_ptr = &r_info[m_ptr->r_idx];
3177 /* Paranoia -- Skip dead monsters */
3178 if (!m_ptr->r_idx) continue;
3180 if (r_ptr->level >= p_ptr->lev)
3182 danger_amount += r_ptr->level - p_ptr->lev + 1;
3186 if (danger_amount > 100)
3188 msg_print("Èó¾ï¤Ë¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
3190 msg_print("You feel utterly terrified!");
3193 else if (danger_amount > 50)
3195 msg_print("¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
3197 msg_print("You feel terrified!");
3200 else if (danger_amount > 20)
3202 msg_print("Èó¾ï¤Ë¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
3204 msg_print("You feel very worried!");
3207 else if (danger_amount > 10)
3209 msg_print("¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
3211 msg_print("You feel paranoid!");
3214 else if (danger_amount > 5)
3216 msg_print("¤Û¤È¤ó¤É°ÂÁ´¤Êµ¤¤¬¤¹¤ë¡£");
3218 msg_print("You feel almost safe.");
3223 msg_print("¼ä¤·¤¤µ¤¤¬¤¹¤ë¡£");
3225 msg_print("You feel lonely.");
3229 if ((p_ptr->muta2 & MUT2_INVULN) && !p_ptr->anti_magic &&
3234 msg_print("̵Ũ¤Êµ¤¤¬¤¹¤ë¡ª");
3236 msg_print("You feel invincible!");
3240 (void)set_invuln(randint1(8) + 8, FALSE);
3242 if ((p_ptr->muta2 & MUT2_SP_TO_HP) && one_in_(2000))
3244 int wounds = p_ptr->mhp - p_ptr->chp;
3248 int healing = p_ptr->csp;
3250 if (healing > wounds)
3256 p_ptr->csp -= healing;
3259 if ((p_ptr->muta2 & MUT2_HP_TO_SP) && !p_ptr->anti_magic &&
3262 int wounds = p_ptr->msp - p_ptr->csp;
3266 int healing = p_ptr->chp;
3268 if (healing > wounds)
3273 p_ptr->csp += healing;
3275 take_hit(DAMAGE_LOSELIFE, healing, "Ƭ¤Ë¾º¤Ã¤¿·ì", -1);
3277 take_hit(DAMAGE_LOSELIFE, healing, "blood rushing to the head", -1);
3282 if ((p_ptr->muta2 & MUT2_DISARM) && one_in_(10000))
3288 msg_print("¤¬¤â¤Ä¤ì¤Æž¤ó¤À¡ª");
3289 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), "žÅÝ", -1);
3291 msg_print("You trip over your own feet!");
3292 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), "tripping", -1);
3297 if (buki_motteruka(INVEN_RARM))
3299 int slot = INVEN_RARM;
3300 o_ptr = &inventory[INVEN_RARM];
3301 if (buki_motteruka(INVEN_LARM) && one_in_(2))
3303 o_ptr = &inventory[INVEN_LARM];
3306 if (!cursed_p(o_ptr))
3309 msg_print("Éð´ï¤òÍ¤Æ¤·¤Þ¤Ã¤¿¡ª");
3311 msg_print("You drop your weapon!");
3314 inven_drop(slot, 1);
3321 /*** Process Inventory ***/
3323 if ((p_ptr->cursed & TRC_P_FLAG_MASK) && !p_ptr->wild_mode)
3326 * Hack: Uncursed teleporting items (e.g. Trump Weapons)
3327 * can actually be useful!
3329 if ((p_ptr->cursed & TRC_TELEPORT_SELF) && one_in_(200))
3332 if (get_check_strict("¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©", CHECK_OKAY_CANCEL))
3334 if (get_check_strict("Teleport? ", CHECK_OKAY_CANCEL))
3338 teleport_player(50);
3341 /* Make a chainsword noise */
3342 if ((p_ptr->cursed & TRC_CHAINSWORD) && one_in_(CHAINSWORD_NOISE))
3346 if (!get_rnd_line("chainswd_j.txt", 0, noise))
3348 if (!get_rnd_line("chainswd.txt", 0, noise))
3351 disturb(FALSE, FALSE);
3354 if ((p_ptr->cursed & TRC_TY_CURSE) && one_in_(TY_CURSE_CHANCE))
3357 (void)activate_ty_curse(FALSE, &count);
3359 /* Handle experience draining */
3360 if ((p_ptr->cursed & TRC_DRAIN_EXP) && one_in_(4))
3362 p_ptr->exp -= (p_ptr->lev+1)/2;
3363 if (p_ptr->exp < 0) p_ptr->exp = 0;
3364 p_ptr->max_exp -= (p_ptr->lev+1)/2;
3365 if (p_ptr->max_exp < 0) p_ptr->max_exp = 0;
3368 /* Add light curse (Later) */
3369 if ((p_ptr->cursed & TRC_ADD_L_CURSE) && one_in_(2000))
3374 o_ptr = choose_cursed_obj_name(TRC_ADD_L_CURSE);
3376 new_curse = get_curse(0, o_ptr);
3377 if (!(o_ptr->curse_flags & new_curse))
3379 char o_name[MAX_NLEN];
3381 object_desc(o_name, o_ptr, FALSE, 0);
3383 o_ptr->curse_flags |= new_curse;
3385 msg_format("°°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬%s¤ò¤È¤ê¤Þ¤¤¤¿...", o_name);
3387 msg_format("There is a malignant black aura surrounding %s...", o_name);
3390 o_ptr->feeling = FEEL_NONE;
3392 p_ptr->update |= (PU_BONUS);
3395 /* Add heavy curse (Later) */
3396 if ((p_ptr->cursed & TRC_ADD_H_CURSE) && one_in_(2000))
3401 o_ptr = choose_cursed_obj_name(TRC_ADD_H_CURSE);
3403 new_curse = get_curse(1, o_ptr);
3404 if (!(o_ptr->curse_flags & new_curse))
3406 char o_name[MAX_NLEN];
3408 object_desc(o_name, o_ptr, FALSE, 0);
3410 o_ptr->curse_flags |= new_curse;
3412 msg_format("°°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬%s¤ò¤È¤ê¤Þ¤¤¤¿...", o_name);
3414 msg_format("There is a malignant black aura surrounding %s...", o_name);
3417 o_ptr->feeling = FEEL_NONE;
3419 p_ptr->update |= (PU_BONUS);
3423 if ((p_ptr->cursed & TRC_CALL_ANIMAL) && one_in_(2500))
3425 if (summon_specific(0, py, px, dun_level, SUMMON_ANIMAL,
3426 TRUE, FALSE, FALSE, TRUE, TRUE))
3428 char o_name[MAX_NLEN];
3430 object_desc(o_name, choose_cursed_obj_name(TRC_CALL_ANIMAL), FALSE, 0);
3432 msg_format("%s¤¬Æ°Êª¤ò°ú¤´ó¤»¤¿¡ª", o_name);
3434 msg_format("%s have attracted an animal!", o_name);
3441 if ((p_ptr->cursed & TRC_CALL_DEMON) && one_in_(1111))
3443 if (summon_specific(0, py, px, dun_level, SUMMON_DEMON,
3444 TRUE, FALSE, FALSE, TRUE, TRUE))
3446 char o_name[MAX_NLEN];
3448 object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DEMON), FALSE, 0);
3450 msg_format("%s¤¬°Ëâ¤ò°ú¤´ó¤»¤¿¡ª", o_name);
3452 msg_format("%s have attracted a demon!", o_name);
3459 if ((p_ptr->cursed & TRC_CALL_DRAGON) && one_in_(800))
3461 if (summon_specific(0, py, px, dun_level, SUMMON_DRAGON,
3462 TRUE, FALSE, FALSE, TRUE, TRUE))
3464 char o_name[MAX_NLEN];
3466 object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DRAGON), FALSE, 0);
3468 msg_format("%s¤¬¥É¥é¥´¥ó¤ò°ú¤´ó¤»¤¿¡ª", o_name);
3470 msg_format("%s have attracted an animal!", o_name);
3476 if ((p_ptr->cursed & TRC_COWARDICE) && one_in_(1500))
3478 if (!(p_ptr->resist_fear || p_ptr->hero || p_ptr->shero))
3482 msg_print("¤È¤Æ¤â°Å¤¤... ¤È¤Æ¤â¶²¤¤¡ª");
3484 msg_print("It's so dark... so scary!");
3487 set_afraid(p_ptr->afraid + 13 + randint1(26));
3490 /* Teleport player */
3491 if ((p_ptr->cursed & TRC_TELEPORT) && one_in_(200) && !p_ptr->anti_tele)
3495 /* Teleport player */
3496 teleport_player(40);
3498 /* Handle HP draining */
3499 if ((p_ptr->cursed & TRC_DRAIN_HP) && one_in_(666))
3501 char o_name[MAX_NLEN];
3503 object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_HP), FALSE, 0);
3505 msg_format("%s¤Ï¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª", o_name);
3507 msg_format("%s drains HP from you!", o_name);
3509 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev*2, 100), o_name, -1);
3511 /* Handle mana draining */
3512 if ((p_ptr->cursed & TRC_DRAIN_MANA) && one_in_(666))
3514 char o_name[MAX_NLEN];
3516 object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_MANA), FALSE, 0);
3518 msg_format("%s¤Ï¤¢¤Ê¤¿¤ÎËâÎϤòµÛ¼ý¤·¤¿¡ª", o_name);
3520 msg_format("%s drains mana from you!", o_name);
3522 p_ptr->csp -= MIN(p_ptr->lev, 50);
3526 p_ptr->csp_frac = 0;
3528 p_ptr->redraw |= PR_MANA;
3532 /* Rarely, take damage from the Jewel of Judgement */
3533 if (one_in_(999) && !p_ptr->anti_magic)
3535 if ((inventory[INVEN_LITE].tval) &&
3536 (inventory[INVEN_LITE].sval == SV_LITE_THRAIN))
3539 msg_print("¡Ø¿³È½¤ÎÊõÀС٤Ϥ¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª");
3540 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "¿³È½¤ÎÊõÀÐ", -1);
3542 msg_print("The Jewel of Judgement drains life from you!");
3543 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "the Jewel of Judgement", -1);
3550 /* Process equipment */
3551 for (j = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
3553 /* Get the object */
3554 o_ptr = &inventory[i];
3556 /* Skip non-objects */
3557 if (!o_ptr->k_idx) continue;
3559 /* Recharge activatable objects */
3560 if (o_ptr->timeout > 0)
3565 /* Notice changes */
3566 if (!o_ptr->timeout)
3568 recharged_notice(o_ptr);
3574 /* Notice changes */
3578 p_ptr->window |= (PW_EQUIP);
3583 * Recharge rods. Rods now use timeout to control charging status,
3584 * and each charging rod in a stack decreases the stack's timeout by
3585 * one per turn. -LM-
3587 for (j = 0, i = 0; i < INVEN_PACK; i++)
3589 o_ptr = &inventory[i];
3590 k_ptr = &k_info[o_ptr->k_idx];
3592 /* Skip non-objects */
3593 if (!o_ptr->k_idx) continue;
3595 /* Examine all charging rods or stacks of charging rods. */
3596 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
3598 /* Determine how many rods are charging. */
3599 temp = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
3600 if (temp > o_ptr->number) temp = o_ptr->number;
3602 /* Decrease timeout by that number. */
3603 o_ptr->timeout -= temp;
3605 /* Boundary control. */
3606 if (o_ptr->timeout < 0) o_ptr->timeout = 0;
3608 /* Notice changes, provide message if object is inscribed. */
3609 if (!(o_ptr->timeout))
3611 recharged_notice(o_ptr);
3617 /* Notice changes */
3621 p_ptr->notice |= (PN_COMBINE);
3624 p_ptr->window |= (PW_INVEN);
3628 /* Feel the inventory */
3633 /*** Process Objects ***/
3635 /* Process objects */
3636 for (i = 1; i < o_max; i++)
3641 /* Skip dead objects */
3642 if (!o_ptr->k_idx) continue;
3644 /* Recharge rods on the ground. No messages. */
3645 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
3648 o_ptr->timeout -= o_ptr->number;
3650 /* Boundary control. */
3651 if (o_ptr->timeout < 0) o_ptr->timeout = 0;
3656 /*** Involuntary Movement ***/
3658 /* Delayed Word-of-Recall */
3659 if (p_ptr->word_recall)
3662 * HACK: Autosave BEFORE resetting the recall counter (rr9)
3663 * The player is yanked up/down as soon as
3664 * he loads the autosaved game.
3666 if (autosave_l && (p_ptr->word_recall == 1) && !p_ptr->inside_battle)
3667 do_cmd_save_game(TRUE);
3669 /* Count down towards recall */
3670 p_ptr->word_recall--;
3672 p_ptr->redraw |= (PR_STATUS);
3674 /* Activate the recall */
3675 if (!p_ptr->word_recall)
3680 /* Determine the level */
3681 if (dun_level || p_ptr->inside_quest)
3684 msg_print("¾å¤Ë°ú¤ÃÄ¥¤ê¤¢¤²¤é¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
3686 msg_print("You feel yourself yanked upwards!");
3689 p_ptr->recall_dungeon = dungeon_type;
3691 do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
3696 leave_quest_check();
3698 p_ptr->inside_quest = 0;
3699 p_ptr->leaving = TRUE;
3704 msg_print("²¼¤Ë°ú¤¤º¤ê¹ß¤í¤µ¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
3706 msg_print("You feel yourself yanked downwards!");
3709 dungeon_type = p_ptr->recall_dungeon;
3712 do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
3715 dun_level = max_dlv[dungeon_type];
3716 if (dun_level < 1) dun_level = 1;
3718 /* Nightmare mode makes recall more dangerous */
3719 if (ironman_nightmare && !randint0(666) && (dungeon_type == DUNGEON_ANGBAND))
3725 else if (dun_level < 99)
3727 dun_level = (dun_level + 99) / 2;
3729 else if (dun_level > 100)
3731 dun_level = d_info[dungeon_type].maxdepth - 1;
3735 if (p_ptr->wild_mode)
3737 p_ptr->wilderness_y = py;
3738 p_ptr->wilderness_x = px;
3742 /* Save player position */
3746 p_ptr->wild_mode = FALSE;
3749 p_ptr->leaving = TRUE;
3751 if (dungeon_type == DUNGEON_ANGBAND)
3753 for (i = MIN_RANDOM_QUEST; i < MAX_RANDOM_QUEST + 1; i++)
3755 if ((quest[i].type == QUEST_TYPE_RANDOM) &&
3756 (quest[i].status == QUEST_STATUS_TAKEN) &&
3757 (quest[i].level < dun_level))
3759 quest[i].status = QUEST_STATUS_FAILED;
3760 quest[i].complev = (byte)p_ptr->lev;
3761 r_info[quest[i].r_idx].flags1 &= ~(RF1_QUESTOR);
3768 sound(SOUND_TPLEVEL);
3776 * Verify use of "wizard" mode
3778 static bool enter_wizard_mode(void)
3780 /* Ask first time */
3783 /* Mention effects */
3785 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥â¡¼¥É¤Ç¤¹¡£ ");
3786 msg_print("°ìÅÙ¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ë¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3788 msg_print("Wizard mode is for debugging and experimenting.");
3789 msg_print("The game will not be scored if you enter wizard mode.");
3794 /* Verify request */
3796 if (!get_check("ËÜÅö¤Ë¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ê¤¿¤¤¤Î¤Ç¤¹¤«? "))
3798 if (!get_check("Are you sure you want to enter wizard mode? "))
3817 * Verify use of "debug" commands
3819 static bool enter_debug_mode(void)
3821 /* Ask first time */
3824 /* Mention effects */
3826 msg_print("¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ ");
3827 msg_print("¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3829 msg_print("The debug commands are for debugging and experimenting.");
3830 msg_print("The game will not be scored if you use debug commands.");
3835 /* Verify request */
3837 if (!get_check("ËÜÅö¤Ë¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? "))
3839 if (!get_check("Are you sure you want to use debug commands? "))
3847 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥Ç¥Ð¥Ã¥°¥â¡¼¥É¤ËÆÍÆþ¤·¤Æ¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
3849 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use debug commands.");
3860 * Hack -- Declare the Debug Routines
3862 extern void do_cmd_debug(void);
3864 #endif /* ALLOW_WIZARD */
3870 * Verify use of "borg" commands
3872 static bool enter_borg_mode(void)
3874 /* Ask first time */
3875 if (!(noscore & 0x0010))
3877 /* Mention effects */
3879 msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ ");
3880 msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3882 msg_print("The borg commands are for debugging and experimenting.");
3883 msg_print("The game will not be scored if you use borg commands.");
3888 /* Verify request */
3890 if (!get_check("ËÜÅö¤Ë¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? "))
3892 if (!get_check("Are you sure you want to use borg commands? "))
3908 * Hack -- Declare the Ben Borg
3910 extern void do_cmd_borg(void);
3912 #endif /* ALLOW_BORG */
3917 * Parse and execute the current command
3918 * Give "Warning" on illegal commands.
3920 * XXX XXX XXX Make some "blocks"
3922 static void process_command(void)
3924 int old_now_message = now_message;
3926 #ifdef ALLOW_REPEAT /* TNB */
3928 /* Handle repeating the last command */
3931 #endif /* ALLOW_REPEAT -- TNB */
3935 /* Parse the command */
3936 switch (command_cmd)
3952 /*** Wizard Commands ***/
3954 /* Toggle Wizard Mode */
3961 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É²ò½ü¡£");
3963 msg_print("Wizard mode off.");
3967 else if (enter_wizard_mode())
3971 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥ÉÆÍÆþ¡£");
3973 msg_print("Wizard mode on.");
3978 /* Update monsters */
3979 p_ptr->update |= (PU_MONSTERS);
3981 /* Redraw "title" */
3982 p_ptr->redraw |= (PR_TITLE);
3990 /* Special "debug" commands */
3993 /* Enter debug mode */
3994 if (enter_debug_mode())
4001 #endif /* ALLOW_WIZARD */
4006 /* Special "borg" commands */
4009 /* Enter borg mode */
4010 if (enter_borg_mode())
4012 if (!p_ptr->wild_mode) do_cmd_borg();
4018 #endif /* ALLOW_BORG */
4022 /*** Inventory Commands ***/
4024 /* Wear/wield equipment */
4027 if (!p_ptr->wild_mode) do_cmd_wield();
4031 /* Take off equipment */
4034 if (!p_ptr->wild_mode) do_cmd_takeoff();
4041 if (!p_ptr->wild_mode) do_cmd_drop();
4045 /* Destroy an item */
4052 /* Equipment list */
4059 /* Inventory list */
4067 /*** Various commands ***/
4069 /* Identify an object */
4076 /* Hack -- toggle windows */
4079 toggle_inven_equip();
4084 /*** Standard "Movement" Commands ***/
4089 if (!p_ptr->wild_mode) do_cmd_alter();
4096 if (!p_ptr->wild_mode) do_cmd_tunnel();
4100 /* Move (usually pick up things) */
4103 #ifdef ALLOW_EASY_DISARM /* TNB */
4107 #else /* ALLOW_EASY_DISARM -- TNB */
4109 do_cmd_walk(always_pickup);
4111 #endif /* ALLOW_EASY_DISARM -- TNB */
4116 /* Move (usually do not pick up) */
4119 #ifdef ALLOW_EASY_DISARM /* TNB */
4123 #else /* ALLOW_EASY_DISARM -- TNB */
4125 do_cmd_walk(!always_pickup);
4127 #endif /* ALLOW_EASY_DISARM -- TNB */
4133 /*** Running, Resting, Searching, Staying */
4135 /* Begin Running -- Arg is Max Distance */
4138 if (!p_ptr->wild_mode) do_cmd_run();
4142 /* Stay still (usually pick things up) */
4145 do_cmd_stay(always_pickup);
4149 /* Stay still (usually do not pick up) */
4152 do_cmd_stay(!always_pickup);
4156 /* Rest -- Arg is time */
4163 /* Search for traps/doors */
4170 /* Toggle search mode */
4173 if (p_ptr->action == ACTION_SEARCH) set_action(ACTION_NONE);
4174 else set_action(ACTION_SEARCH);
4179 /*** Stairs and Doors and Chests and Traps ***/
4184 if (!p_ptr->wild_mode) do_cmd_store();
4188 /* Enter building -KMW- */
4191 if (!p_ptr->wild_mode) do_cmd_bldg();
4195 /* Enter quest level -KMW- */
4198 if (!p_ptr->wild_mode) do_cmd_quest();
4202 /* Go up staircase */
4205 if(!p_ptr->wild_mode && !dun_level && !p_ptr->inside_arena && !p_ptr->inside_quest)
4212 msg_print("½±·â¤«¤éƨ¤²¤ë¤Ë¤Ï¥Þ¥Ã¥×¤Îü¤Þ¤Ç°ÜÆ°¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£");
4214 msg_print("To flee the ambush you have to reach the edge of the map.");
4217 else if (p_ptr->food < PY_FOOD_WEAK)
4220 msg_print("¤½¤ÎÁ°¤Ë¿©»ö¤ò¤È¤é¤Ê¤¤¤È¡£");
4222 msg_print("You must eat something here.");
4227 if (change_wild_mode())
4240 /* Go down staircase */
4243 if(!p_ptr->wild_mode) do_cmd_go_down();
4246 p_ptr->wilderness_x = px;
4247 p_ptr->wilderness_y = py;
4253 /* Open a door or chest */
4256 if (!p_ptr->wild_mode) do_cmd_open();
4263 if (!p_ptr->wild_mode) do_cmd_close();
4267 /* Jam a door with spikes */
4270 if (!p_ptr->wild_mode) do_cmd_spike();
4277 if (!p_ptr->wild_mode) do_cmd_bash();
4281 /* Disarm a trap or chest */
4284 if (!p_ptr->wild_mode) do_cmd_disarm();
4289 /*** Magic and Prayers ***/
4291 /* Gain new spells/prayers */
4294 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4296 msg_print("¼öʸ¤ò³Ø½¬¤¹¤ëɬÍפϤʤ¤¡ª");
4298 msg_print("You don't have to learn spells!");
4300 else if (p_ptr->pclass == CLASS_SAMURAI)
4301 do_cmd_gain_hissatsu();
4302 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4312 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
4313 (p_ptr->pclass == CLASS_BERSERKER) ||
4314 (p_ptr->pclass == CLASS_NINJA) ||
4315 (p_ptr->pclass == CLASS_MIRROR_MASTER)
4316 ) do_cmd_mind_browse();
4317 else if (p_ptr->pclass == CLASS_SMITH)
4319 else do_cmd_browse();
4327 if (!p_ptr->wild_mode)
4329 if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_ARCHER) || (p_ptr->pclass == CLASS_CAVALRY))
4332 msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4334 msg_print("You cannot cast spells!");
4337 else if (dun_level && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
4340 msg_print("¥À¥ó¥¸¥ç¥ó¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4342 msg_print("The arena absorbs all attempted magic!");
4346 else if (p_ptr->anti_magic && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
4350 cptr which_power = "ËâË¡";
4352 cptr which_power = "magic";
4354 if (p_ptr->pclass == CLASS_MINDCRAFTER)
4356 which_power = "ĶǽÎÏ";
4358 which_power = "psionic powers";
4360 else if (p_ptr->pclass == CLASS_IMITATOR)
4362 which_power = "¤â¤Î¤Þ¤Í";
4364 which_power = "imitation";
4366 else if (p_ptr->pclass == CLASS_SAMURAI)
4368 which_power = "ɬ»¦·õ";
4370 which_power = "hissatsu";
4372 else if (p_ptr->pclass == CLASS_MIRROR_MASTER)
4374 which_power = "¶ÀËâË¡";
4376 which_power = "mirror magic";
4378 else if (p_ptr->pclass == CLASS_NINJA)
4380 which_power = "Ǧ½Ñ";
4382 which_power = "ninjutsu";
4384 else if (mp_ptr->spell_book == TV_LIFE_BOOK)
4386 which_power = "µ§¤ê";
4388 which_power = "prayer";
4392 msg_format("È¿ËâË¡¥Ð¥ê¥¢¤¬%s¤ò¼ÙË⤷¤¿¡ª", which_power);
4394 msg_format("An anti-magic shell disrupts your %s!", which_power);
4398 else if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER))
4401 msg_format("¶¸Àï»Î²½¤·¤Æ¤¤¤ÆƬ¤¬²ó¤é¤Ê¤¤¡ª");
4403 msg_format("You cannot think directly!");
4409 if ((p_ptr->pclass == CLASS_MINDCRAFTER) ||
4410 (p_ptr->pclass == CLASS_BERSERKER) ||
4411 (p_ptr->pclass == CLASS_NINJA) ||
4412 (p_ptr->pclass == CLASS_MIRROR_MASTER)
4415 else if (p_ptr->pclass == CLASS_IMITATOR)
4417 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4418 do_cmd_magic_eater();
4419 else if (p_ptr->pclass == CLASS_SAMURAI)
4421 else if (p_ptr->pclass == CLASS_BLUE_MAGE)
4422 do_cmd_cast_learned();
4423 else if (p_ptr->pclass == CLASS_SMITH)
4432 /* Issue a pet command */
4435 if (!p_ptr->wild_mode) do_cmd_pet();
4439 /*** Use various objects ***/
4441 /* Inscribe an object */
4448 /* Uninscribe an object */
4451 do_cmd_uninscribe();
4455 /* Activate an artifact */
4458 if (!p_ptr->wild_mode)
4460 if (!p_ptr->inside_arena)
4465 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4467 msg_print("The arena absorbs all attempted magic!");
4483 /* Fuel your lantern/torch */
4493 if (!p_ptr->wild_mode) do_cmd_fire();
4500 if (!p_ptr->wild_mode)
4502 if (!p_ptr->inside_arena)
4507 msg_print("¥¢¥ê¡¼¥Ê¤Ç¤Ï¥¢¥¤¥Æ¥à¤ò»È¤¨¤Ê¤¤¡ª");
4509 msg_print("You're in the arena now. This is hand-to-hand!");
4521 if (!p_ptr->wild_mode)
4523 if (!p_ptr->inside_arena)
4528 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4530 msg_print("The arena absorbs all attempted magic!");
4542 if (!p_ptr->wild_mode)
4544 if (p_ptr->inside_arena)
4547 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4549 msg_print("The arena absorbs all attempted magic!");
4554 else if (use_command && rogue_like_commands)
4566 /* Quaff a potion */
4569 if (!p_ptr->wild_mode)
4571 if (!p_ptr->inside_arena)
4572 do_cmd_quaff_potion();
4576 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4578 msg_print("The arena absorbs all attempted magic!");
4590 if (!p_ptr->wild_mode)
4592 if (!p_ptr->inside_arena)
4593 do_cmd_read_scroll();
4597 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4599 msg_print("The arena absorbs all attempted magic!");
4611 if (!p_ptr->wild_mode)
4613 if (p_ptr->inside_arena)
4616 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4618 msg_print("The arena absorbs all attempted magic!");
4623 else if (use_command && !rogue_like_commands)
4633 /* Use racial power */
4636 if (!p_ptr->wild_mode) do_cmd_racial_power();
4641 /*** Looking at Things (nearby or on map) ***/
4643 /* Full dungeon map */
4650 /* Locate player on map */
4664 /* Target monster or location */
4667 if (!p_ptr->wild_mode) do_cmd_target();
4673 /*** Help and Such ***/
4682 /* Identify symbol */
4685 do_cmd_query_symbol();
4689 /* Character description */
4692 do_cmd_change_name();
4697 /*** System Commands ***/
4699 /* Hack -- User interface */
4706 /* Single line from a pref file */
4721 do_cmd_edit_autopick();
4725 /* Interact with macros */
4732 /* Interact with visuals */
4740 /* Interact with colors */
4748 /* Interact with options */
4756 /*** Misc Commands ***/
4772 /* Repeat level feeling */
4775 if (!p_ptr->wild_mode) do_cmd_feeling();
4779 /* Show previous message */
4782 do_cmd_message_one();
4786 /* Show previous messages */
4789 do_cmd_messages(old_now_message);
4793 /* Show quest status -KMW- */
4796 do_cmd_checkquest();
4800 /* Redraw the screen */
4803 now_message = old_now_message;
4808 #ifndef VERIFY_SAVEFILE
4810 /* Hack -- Save and don't quit */
4813 do_cmd_save_game(FALSE);
4817 #endif /* VERIFY_SAVEFILE */
4828 do_cmd_save_and_exit();
4832 /* Quit (commit suicide) */
4845 /* Check artifacts, uniques, objects */
4852 /* Load "screen dump" */
4855 do_cmd_load_screen();
4859 /* Save "screen dump" */
4862 do_cmd_save_screen();
4866 /* Make random artifact list */
4869 spoil_random_artifact("randifact.txt");
4873 /* Hack -- Unknown command */
4876 if (flush_failure) flush();
4880 sound(SOUND_ILLEGAL);
4882 if (!get_rnd_line("error_j.txt", 0, error_m))
4884 if (!get_rnd_line("error.txt", 0, error_m))
4891 prt(" '?' ¤Ç¥Ø¥ë¥×¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£", 0, 0);
4893 prt("Type '?' for help.", 0, 0);
4899 if (!energy_use && !now_message)
4900 now_message = old_now_message;
4906 bool monster_tsuri(int r_idx)
4908 monster_race *r_ptr = &r_info[r_idx];
4910 if ((r_ptr->flags7 & RF7_AQUATIC) && !(r_ptr->flags1 & RF1_UNIQUE) && strchr("Jjlw", r_ptr->d_char))
4918 * Process the player
4920 * Notice the annoying code to handle "pack overflow", which
4921 * must come first just in case somebody manages to corrupt
4922 * the savefiles by clever use of menu commands or something.
4924 static void process_player(void)
4928 /*** Apply energy ***/
4933 msg_print("²¿¤«ÊѤï¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
4935 msg_print("You feel different!");
4938 (void)gain_random_mutation(0);
4939 hack_mutation = FALSE;
4942 if (p_ptr->inside_battle)
4944 for(i = 1; i < m_max; i++)
4946 monster_type *m_ptr = &m_list[i];
4948 if (!m_ptr->r_idx) continue;
4950 /* Hack -- Detect monster */
4951 m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
4953 /* Update the monster */
4954 update_mon(i, FALSE);
4959 /* Give the player some energy */
4960 else if (!(load && p_ptr->energy_need <= 0))
4962 p_ptr->energy_need -= (p_ptr->pspeed > 199 ? 49 : (p_ptr->pspeed < 0 ? 1 : extract_energy[p_ptr->pspeed]));
4966 if (p_ptr->energy_need > 0) return;
4967 if (!command_rep) prt_time();
4969 /*** Check for interupts ***/
4971 /* Complete resting */
4978 if ((p_ptr->chp == p_ptr->mhp) &&
4979 (p_ptr->csp >= p_ptr->msp))
4981 set_action(ACTION_NONE);
4985 /* Complete resting */
4986 else if (resting == -2)
4989 if ((p_ptr->chp == p_ptr->mhp) &&
4990 (p_ptr->csp >= p_ptr->msp) &&
4991 !p_ptr->blind && !p_ptr->confused &&
4992 !p_ptr->poisoned && !p_ptr->afraid &&
4993 !p_ptr->stun && !p_ptr->cut &&
4994 !p_ptr->slow && !p_ptr->paralyzed &&
4995 !p_ptr->image && !p_ptr->word_recall)
4997 set_action(ACTION_NONE);
5002 if (p_ptr->action == ACTION_FISH)
5005 Term_xtra(TERM_XTRA_DELAY, 10);
5009 bool success = FALSE;
5010 get_mon_num_prep(monster_tsuri,NULL);
5011 r_idx = get_mon_num(dun_level ? dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level);
5013 if (r_idx && one_in_(2))
5016 y = py+ddy[tsuri_dir];
5017 x = px+ddx[tsuri_dir];
5018 if (place_monster_aux(y, x, r_idx, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE))
5021 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
5023 msg_format("%s¤¬Äà¤ì¤¿¡ª", m_name);
5025 msg_format("You have a good catch!", m_name);
5033 msg_print("±Â¤À¤±¿©¤ï¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª¤¯¤Ã¤½¡Á¡ª");
5035 msg_print("Damn! The fish took a bait away!");
5042 /* Handle "abort" */
5045 /* Check for "player abort" (semi-efficiently for resting) */
5046 if (running || command_rep || (p_ptr->action == ACTION_REST) || (p_ptr->action == ACTION_FISH))
5051 /* Check for a key */
5060 /* Hack -- Show a Message */
5062 msg_print("ÃæÃǤ·¤Þ¤·¤¿¡£");
5064 msg_print("Canceled.");
5071 if (p_ptr->riding && !p_ptr->confused && !p_ptr->blind)
5073 monster_type *m_ptr = &m_list[p_ptr->riding];
5082 /* Acquire the monster name */
5083 monster_desc(m_name, m_ptr, 0);
5085 msg_format("%^s¤òµ¯¤³¤·¤¿¡£", m_name);
5087 msg_format("You have waked %s up.", m_name);
5089 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5090 p_ptr->redraw |= (PR_UHEALTH);
5097 /* Make a "saving throw" against stun */
5098 if (randint0(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
5104 /* Hack -- Recover from stun */
5105 if (m_ptr->stunned > d)
5107 /* Recover somewhat */
5108 m_ptr->stunned -= d;
5119 /* Acquire the monster name */
5120 monster_desc(m_name, m_ptr, 0);
5122 /* Dump a message */
5124 msg_format("%^s¤òÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5126 msg_format("%^s is no longer stunned.", m_name);
5128 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5129 p_ptr->redraw |= (PR_UHEALTH);
5133 if (m_ptr->confused)
5137 /* Make a "saving throw" against stun */
5138 if (randint0(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
5141 d = m_ptr->confused;
5144 /* Hack -- Recover from stun */
5145 if (m_ptr->confused > d)
5147 /* Recover somewhat */
5148 m_ptr->confused -= d;
5157 m_ptr->confused = 0;
5159 /* Acquire the monster name */
5160 monster_desc(m_name, m_ptr, 0);
5162 /* Dump a message */
5164 msg_format("%^s¤òº®Íð¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5166 msg_format("%^s is no longer confused.", m_name);
5168 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5169 p_ptr->redraw |= (PR_UHEALTH);
5177 /* Make a "saving throw" against stun */
5178 if (randint0(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
5184 /* Hack -- Recover from stun */
5185 if (m_ptr->monfear > d)
5187 /* Recover somewhat */
5188 m_ptr->monfear -= d;
5199 /* Acquire the monster name */
5200 monster_desc(m_name, m_ptr, 0);
5202 /* Dump a message */
5204 msg_format("%^s¤ò¶²Éݤ«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5206 msg_format("%^s is no longer fear.", m_name);
5208 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5209 p_ptr->redraw |= (PR_UHEALTH);
5216 /* Handle the player song */
5217 if (!load) check_music();
5222 if (p_ptr->lightspeed)
5224 (void)set_lightspeed(p_ptr->lightspeed - 1, TRUE);
5226 if ((p_ptr->pclass == CLASS_FORCETRAINER) && (p_ptr->magic_num1[0]))
5228 if (p_ptr->magic_num1[0] < 40)
5230 p_ptr->magic_num1[0] = 0;
5232 else p_ptr->magic_num1[0] -= 40;
5233 p_ptr->update |= (PU_BONUS);
5235 if (p_ptr->action == ACTION_LEARN)
5237 int hoge = ((p_ptr->msp * 0x10000L) / 256L)+7680L;
5238 if ((p_ptr->csp * 0x10000L + p_ptr->csp_frac) < hoge)
5241 p_ptr->csp_frac = 0;
5242 set_action(ACTION_NONE);
5246 p_ptr->csp -= (s16b)(hoge >> 16);
5248 if (p_ptr->csp_frac < hoge)
5250 p_ptr->csp_frac += 0x10000L - hoge;
5254 p_ptr->csp_frac -= hoge;
5256 p_ptr->redraw |= PR_MANA;
5259 if (p_ptr->special_defense & KATA_MASK)
5261 if (p_ptr->special_defense & KATA_MUSOU)
5265 set_action(ACTION_NONE);
5270 p_ptr->redraw |= (PR_MANA);
5275 /*** Handle actual user input ***/
5277 /* Repeat until out of energy */
5278 while (p_ptr->energy_need <= 0)
5280 p_ptr->window |= PW_PLAYER;
5281 p_ptr->sutemi = FALSE;
5282 p_ptr->counter = FALSE;
5283 now_damaged = FALSE;
5285 /* Notice stuff (if needed) */
5286 if (p_ptr->notice) notice_stuff();
5288 /* Update stuff (if needed) */
5289 if (p_ptr->update) update_stuff();
5291 /* Redraw stuff (if needed) */
5292 if (p_ptr->redraw) redraw_stuff();
5294 /* Redraw stuff (if needed) */
5295 if (p_ptr->window) window_stuff();
5298 /* Place the cursor on the player */
5299 move_cursor_relative(py, px);
5301 /* Refresh (optional) */
5302 if (fresh_before) Term_fresh();
5305 /* Hack -- Pack Overflow */
5306 if (inventory[INVEN_PACK].k_idx)
5308 int item = INVEN_PACK;
5310 char o_name[MAX_NLEN];
5314 /* Access the slot to be dropped */
5315 o_ptr = &inventory[item];
5322 msg_print("¥¶¥Ã¥¯¤«¤é¥¢¥¤¥Æ¥à¤¬¤¢¤Õ¤ì¤¿¡ª");
5324 msg_print("Your pack overflows!");
5329 object_desc(o_name, o_ptr, TRUE, 3);
5333 msg_format("%s(%c)¤òÍî¤È¤·¤¿¡£", o_name, index_to_label(item));
5335 msg_format("You drop %s (%c).", o_name, index_to_label(item));
5339 /* Drop it (carefully) near the player */
5340 (void)drop_near(o_ptr, 0, py, px);
5342 /* Modify, Describe, Optimize */
5343 inven_item_increase(item, -255);
5344 inven_item_describe(item);
5345 inven_item_optimize(item);
5347 /* Notice stuff (if needed) */
5348 if (p_ptr->notice) notice_stuff();
5350 /* Update stuff (if needed) */
5351 if (p_ptr->update) update_stuff();
5353 /* Redraw stuff (if needed) */
5354 if (p_ptr->redraw) redraw_stuff();
5356 /* Redraw stuff (if needed) */
5357 if (p_ptr->window) window_stuff();
5361 /* Hack -- cancel "lurking browse mode" */
5362 if (!command_new) command_see = FALSE;
5365 /* Assume free turn */
5369 if (p_ptr->inside_battle)
5371 /* Place the cursor on the player */
5372 move_cursor_relative(py, px);
5376 /* Process the command */
5380 /* Paralyzed or Knocked Out */
5381 else if (p_ptr->paralyzed || (p_ptr->stun >= 100))
5388 else if (p_ptr->action == ACTION_REST)
5393 /* Reduce rest count */
5396 if (!resting) set_action(ACTION_NONE);
5398 /* Redraw the state */
5399 p_ptr->redraw |= (PR_STATE);
5407 else if (p_ptr->action == ACTION_FISH)
5420 /* Repeated command */
5421 else if (command_rep)
5423 /* Count this execution */
5426 /* Redraw the state */
5427 p_ptr->redraw |= (PR_STATE);
5432 /* Hack -- Assume messages were seen */
5435 /* Clear the top line */
5438 /* Process the command */
5442 /* Normal command */
5445 /* Place the cursor on the player */
5446 move_cursor_relative(py, px);
5449 /* Get a command (normal) */
5450 request_command(FALSE);
5453 /* Process the command */
5463 /* Use some energy */
5465 p_ptr->energy_need += (s16b)((s32b)energy_use * ENERGY_NEED() / 100L);
5467 p_ptr->energy_need += energy_use * TURNS_PER_TICK / 10;
5469 /* Hack -- constant hallucination */
5470 if (p_ptr->image) p_ptr->redraw |= (PR_MAP);
5473 /* Shimmer monsters if needed */
5474 if (shimmer_monsters)
5476 /* Clear the flag */
5477 shimmer_monsters = FALSE;
5479 /* Shimmer multi-hued monsters */
5480 for (i = 1; i < m_max; i++)
5482 monster_type *m_ptr;
5483 monster_race *r_ptr;
5485 /* Access monster */
5488 /* Skip dead monsters */
5489 if (!m_ptr->r_idx) continue;
5491 /* Access the monster race */
5492 r_ptr = &r_info[m_ptr->r_idx];
5494 /* Skip non-multi-hued monsters */
5495 if (!(r_ptr->flags1 & RF1_ATTR_MULTI)) continue;
5497 /* Reset the flag */
5498 shimmer_monsters = TRUE;
5500 /* Redraw regardless */
5501 lite_spot(m_ptr->fy, m_ptr->fx);
5506 /* Handle monster detection */
5507 if (repair_monsters)
5509 /* Reset the flag */
5510 repair_monsters = FALSE;
5512 /* Rotate detection flags */
5513 for (i = 1; i < m_max; i++)
5515 monster_type *m_ptr;
5517 /* Access monster */
5520 /* Skip dead monsters */
5521 if (!m_ptr->r_idx) continue;
5523 /* Nice monsters get mean */
5524 if (m_ptr->mflag & MFLAG_NICE)
5526 /* Nice monsters get mean */
5527 m_ptr->mflag &= ~(MFLAG_NICE);
5530 /* Handle memorized monsters */
5531 if (m_ptr->mflag & MFLAG_MARK)
5533 /* Maintain detection */
5534 if (m_ptr->mflag & MFLAG_SHOW)
5537 m_ptr->mflag &= ~(MFLAG_SHOW);
5539 /* Still need repairs */
5540 repair_monsters = TRUE;
5543 /* Remove detection */
5547 m_ptr->mflag &= ~(MFLAG_MARK);
5549 /* Assume invisible */
5552 /* Update the monster */
5553 update_mon(i, FALSE);
5555 if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH);
5556 if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH);
5558 /* Redraw regardless */
5559 lite_spot(m_ptr->fy, m_ptr->fx);
5564 if (p_ptr->pclass == CLASS_IMITATOR)
5566 if (mane_num > (p_ptr->lev > 44 ? 3 : p_ptr->lev > 29 ? 2 : 1))
5569 for (i = 0; i < mane_num; i++)
5571 mane_spell[i] = mane_spell[i+1];
5572 mane_dam[i] = mane_dam[i+1];
5576 p_ptr->redraw |= (PR_MANE);
5578 if (p_ptr->action == ACTION_LEARN)
5581 p_ptr->redraw |= (PR_STATE);
5584 if (world_player && (p_ptr->energy_need > - 1000))
5587 p_ptr->redraw |= (PR_MAP);
5589 /* Update monsters */
5590 p_ptr->update |= (PU_MONSTERS);
5593 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5596 msg_print("¡Ö»þ¤ÏÆ°¤¤À¤¹¡Ä¡×");
5598 msg_print("You feel time flowing around you once more.");
5601 world_player = FALSE;
5602 p_ptr->energy_need = ENERGY_NEED();
5608 /* Hack -- notice death */
5609 if (!alive || death)
5611 world_player = FALSE;
5615 /* Handle "leaving" */
5616 if (p_ptr->leaving) break;
5619 /* Update scent trail */
5625 * Interact with the current dungeon level.
5627 * This function will not exit until the level is completed,
5628 * the user dies, or the game is terminated.
5630 static void dungeon(bool load_game)
5632 int quest_num = 0, i, num;
5634 /* Set the base level */
5635 base_level = dun_level;
5637 /* Reset various flags */
5641 p_ptr->leaving = FALSE;
5643 /* Reset the "command" vars */
5651 /* Cancel the target */
5655 ambush_flag = FALSE;
5657 /* Cancel the health bar */
5660 /* Check visual effects */
5661 shimmer_monsters = TRUE;
5662 shimmer_objects = TRUE;
5663 repair_monsters = TRUE;
5664 repair_objects = TRUE;
5670 /* Get index of current quest (if any) */
5671 quest_num = quest_number(dun_level);
5673 /* Inside a quest? */
5676 /* Mark the quest monster */
5677 r_info[quest[quest_num].r_idx].flags1 |= RF1_QUESTOR;
5680 /* Track maximum player level */
5681 if (p_ptr->max_plv < p_ptr->lev)
5683 p_ptr->max_plv = p_ptr->lev;
5687 /* Track maximum dungeon level (if not in quest -KMW-) */
5688 if ((max_dlv[dungeon_type] < dun_level) && !p_ptr->inside_quest)
5690 max_dlv[dungeon_type] = dun_level;
5691 if (record_maxdeapth) do_cmd_write_nikki(NIKKI_MAXDEAPTH, dun_level, NULL);
5694 /* No stairs down from Quest */
5695 if (quest_number(dun_level))
5697 create_down_stair = 0;
5700 /* Paranoia -- no stairs from town or wilderness */
5701 if (!dun_level) create_down_stair = create_up_stair = 0;
5703 /* Option -- no connected stairs */
5704 if (!dungeon_stair) create_down_stair = create_up_stair = 0;
5706 /* Option -- no up stairs */
5707 if (ironman_downward) create_down_stair = create_up_stair = 0;
5709 /* Make a stairway. */
5710 if (create_up_stair || create_down_stair)
5712 /* Place a stairway */
5713 if (cave_valid_bold(py, px))
5716 delete_object(py, px);
5719 if (create_down_stair)
5721 if (create_down_stair == 2) cave_set_feat(py, px, FEAT_MORE_MORE);
5722 else cave_set_feat(py, px, FEAT_MORE);
5726 if (create_up_stair == 2) cave_set_feat(py, px, FEAT_LESS_LESS);
5727 else cave_set_feat(py, px, FEAT_LESS);
5731 /* Cancel the stair request */
5732 create_down_stair = create_up_stair = 0;
5735 /* Validate the panel */
5736 panel_bounds_center();
5738 /* Verify the panel */
5741 /* Flush messages */
5745 /* Enter "xtra" mode */
5746 character_xtra = TRUE;
5749 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
5752 p_ptr->window |= (PW_MONSTER);
5754 /* Redraw dungeon */
5755 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY);
5758 p_ptr->redraw |= (PR_MAP);
5761 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5764 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
5766 /* Calculate torch radius */
5767 p_ptr->update |= (PU_TORCH);
5779 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_DISTANCE | PU_MON_LITE);
5780 p_ptr->update |= (PU_MONSTERS);/*¼«Ê¬¤Ç¸÷¤Ã¤Æ¤¤¤ë¥â¥ó¥¹¥¿¡¼¤Î°Ù */
5788 /* Leave "xtra" mode */
5789 character_xtra = FALSE;
5792 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
5794 /* Combine / Reorder the pack */
5795 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
5812 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();
5814 if (p_ptr->inside_battle)
5818 p_ptr->energy_need = 0;
5825 msg_print("»î¹ç³«»Ï¡ª");
5827 msg_format("Ready..Fight!");
5833 if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] > MUSIC_DETECT))
5834 p_ptr->magic_num1[0] = MUSIC_DETECT;
5836 /* Hack -- notice death or departure */
5837 if (!alive || death) return;
5839 /* Print quest message if appropriate */
5840 if (!p_ptr->inside_quest && (dungeon_type == DUNGEON_ANGBAND))
5842 quest_discovery(random_quest_number(dun_level));
5843 p_ptr->inside_quest = random_quest_number(dun_level);
5845 if ((dun_level == d_info[dungeon_type].maxdepth) && d_info[dungeon_type].final_guardian)
5847 if (r_info[d_info[dungeon_type].final_guardian].max_num)
5849 msg_format("¤³¤Î³¬¤Ë¤Ï%s¤Î¼ç¤Ç¤¢¤ë%s¤¬À³¤ó¤Ç¤¤¤ë¡£",
5850 d_name+d_info[dungeon_type].name,
5851 r_name+r_info[d_info[dungeon_type].final_guardian].name);
5853 msg_format("%^s lives in this level as the keeper of %s.",
5854 r_name+r_info[d_info[dungeon_type].final_guardian].name,
5855 d_name+d_info[dungeon_type].name);
5859 /*** Process this dungeon level ***/
5861 /* Reset the monster generation level */
5862 monster_level = base_level;
5864 /* Reset the object generation level */
5865 object_level = base_level;
5869 if (p_ptr->energy_need > 0 && !p_ptr->inside_battle &&
5870 (dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena))
5871 p_ptr->energy_need = 0;
5873 /* Not leaving dungeon */
5874 p_ptr->leaving_dungeon = FALSE;
5879 int i, correct_inven_cnt = 0;
5881 /* Hack -- Compact the monster list occasionally */
5882 if ((m_cnt + 32 > max_m_idx) && !p_ptr->inside_battle) compact_monsters(64);
5884 /* Hack -- Compress the monster list occasionally */
5885 if ((m_cnt + 32 < m_max) && !p_ptr->inside_battle) compact_monsters(0);
5888 /* Hack -- Compact the object list occasionally */
5889 if (o_cnt + 32 > max_o_idx) compact_objects(64);
5891 /* Hack -- Compress the object list occasionally */
5892 if (o_cnt + 32 < o_max) compact_objects(0);
5895 /* Process the player */
5899 if (p_ptr->notice) notice_stuff();
5902 for (i = 0; i < INVEN_PACK; i++)
5904 object_type *j_ptr = &inventory[i];
5906 /* Skip non-objects */
5907 if (!j_ptr->k_idx) continue;
5909 correct_inven_cnt++;
5913 if (p_ptr->update) update_stuff();
5916 if (p_ptr->redraw) redraw_stuff();
5919 if (p_ptr->window) window_stuff();
5921 /* Hack -- Hilite the player */
5922 move_cursor_relative(py, px);
5924 /* Optional fresh */
5925 if (fresh_after) Term_fresh();
5927 /* Hack -- Notice death or departure */
5928 if (!alive || death) break;
5930 /* Process all of the monsters */
5934 if (p_ptr->notice) notice_stuff();
5937 if (p_ptr->update) update_stuff();
5940 if (p_ptr->redraw) redraw_stuff();
5943 if (p_ptr->window) window_stuff();
5945 /* Hack -- Hilite the player */
5946 move_cursor_relative(py, px);
5948 /* Optional fresh */
5949 if (fresh_after) Term_fresh();
5951 /* Hack -- Notice death or departure */
5952 if (!alive || death) break;
5955 /* Process the world */
5959 if (p_ptr->notice) notice_stuff();
5962 if (p_ptr->update) update_stuff();
5965 if (p_ptr->redraw) redraw_stuff();
5968 if (p_ptr->window) window_stuff();
5970 /* Hack -- Hilite the player */
5971 move_cursor_relative(py, px);
5973 /* Optional fresh */
5974 if (fresh_after) Term_fresh();
5976 /* Hack -- Notice death or departure */
5977 if (!alive || death) break;
5979 /* Handle "leaving" */
5980 if (p_ptr->leaving) break;
5982 /* Count game turns */
5984 if (!p_ptr->wild_mode || wild_regen) dungeon_turn++;
5985 else if (p_ptr->wild_mode && !(turn % ((MAX_HGT + MAX_WID) / 2))) dungeon_turn++;
5986 if (wild_regen) wild_regen--;
5989 /* Inside a quest and non-unique questor? */
5990 if (quest_num && !(r_info[quest[quest_num].r_idx].flags1 & RF1_UNIQUE))
5992 /* Un-mark the quest monster */
5993 r_info[quest[quest_num].r_idx].flags1 &= ~RF1_QUESTOR;
5996 /* Not save-and-quit and not dead? */
5997 if (alive && !death)
5999 for(num = 0; num < 21; num++)
6001 party_mon[num].r_idx = 0;
6006 COPY(&party_mon[0], &m_list[p_ptr->riding], monster_type);
6009 for(i = m_max - 1, num = 1; (i >= 1 && num < 21); i--)
6011 monster_type *m_ptr = &m_list[i];
6013 if (!m_ptr->r_idx) continue;
6014 if (!is_pet(m_ptr)) continue;
6015 if (i == p_ptr->riding) continue;
6017 if (m_ptr->nickname && (player_has_los_bold(m_ptr->fy, m_ptr->fx) || los(m_ptr->fy, m_ptr->fx, py, px)))
6019 if (distance(py, px, m_ptr->fy, m_ptr->fx) > 3) continue;
6023 if (distance(py, px, m_ptr->fy, m_ptr->fx) > 1) continue;
6025 if (m_ptr->confused || m_ptr->stunned || m_ptr->csleep) continue;
6027 COPY(&party_mon[num], &m_list[i], monster_type);
6028 delete_monster_idx(i);
6031 if (record_named_pet)
6033 for (i = m_max - 1; i >=1; i--)
6035 monster_type *m_ptr = &m_list[i];
6038 if (!m_ptr->r_idx) continue;
6039 if (!is_pet(m_ptr)) continue;
6040 if (!m_ptr->nickname) continue;
6041 if (p_ptr->riding == i) continue;
6043 monster_desc(m_name, m_ptr, 0x88);
6044 do_cmd_write_nikki(NIKKI_NAMED_PET, 4, m_name);
6054 * Load some "user pref files"
6056 * Modified by Arcum Dagsson to support
6057 * separate macro files for different realms.
6059 static void load_all_pref_files(void)
6063 /* Access the "user" pref file */
6064 sprintf(buf, "user.prf");
6066 /* Process that file */
6067 process_pref_file(buf);
6069 /* Access the "user" system pref file */
6070 sprintf(buf, "user-%s.prf", ANGBAND_SYS);
6072 /* Process that file */
6073 process_pref_file(buf);
6075 /* Access the "race" pref file */
6076 sprintf(buf, "%s.prf", rp_ptr->title);
6078 /* Process that file */
6079 process_pref_file(buf);
6081 /* Access the "class" pref file */
6082 sprintf(buf, "%s.prf", cp_ptr->title);
6084 /* Process that file */
6085 process_pref_file(buf);
6087 /* Access the "character" pref file */
6088 sprintf(buf, "%s.prf", player_base);
6090 /* Process that file */
6091 process_pref_file(buf);
6094 sprintf(buf, "picktype-%s.prf", player_base);
6096 sprintf(buf, "pickpref-%s.prf", player_base);
6098 process_pickpref_file(buf);
6100 process_pickpref_file("picktype.prf");
6102 process_pickpref_file("pickpref.prf");
6105 /* Access the "realm 1" pref file */
6106 if (p_ptr->realm1 != REALM_NONE)
6108 sprintf(buf, "%s.prf", realm_names[p_ptr->realm1]);
6110 /* Process that file */
6111 process_pref_file(buf);
6114 /* Access the "realm 2" pref file */
6115 if (p_ptr->realm2 != REALM_NONE)
6117 sprintf(buf, "%s.prf", realm_names[p_ptr->realm2]);
6119 /* Process that file */
6120 process_pref_file(buf);
6126 * Actually play a game
6128 * If the "new_game" parameter is true, then, after loading the
6129 * savefile, we will commit suicide, if necessary, to allow the
6130 * player to start a new game.
6132 void play_game(bool new_game)
6135 bool load_game = TRUE;
6145 hack_mutation = FALSE;
6147 /* Hack -- Character is "icky" */
6148 character_icky = TRUE;
6150 /* Make sure main term is active */
6151 Term_activate(angband_term[0]);
6153 /* Initialise the resize hooks */
6154 angband_term[0]->resize_hook = resize_map;
6156 for (i = 1; i < 8; i++)
6158 /* Does the term exist? */
6159 if (angband_term[i])
6161 /* Add the redraw on resize hook */
6162 angband_term[i]->resize_hook = redraw_window;
6166 /* Hack -- turn off the cursor */
6167 (void)Term_set_cursor(0);
6170 /* Attempt to load */
6175 quit("¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤¬²õ¤ì¤Æ¤¤¤Þ¤¹");
6177 quit("broken savefile");
6182 /* Extract the options */
6183 for (i = 0; option_info[i].o_desc; i++)
6185 int os = option_info[i].o_set;
6186 int ob = option_info[i].o_bit;
6188 /* Set the "default" options */
6189 if (option_info[i].o_var)
6192 if (option_flag[os] & (1L << ob))
6195 (*option_info[i].o_var) = TRUE;
6202 (*option_info[i].o_var) = FALSE;
6207 /* Report waited score */
6208 if (wait_report_score)
6214 if (!get_check("ÂÔµ¡¤·¤Æ¤¤¤¿¥¹¥³¥¢ÅÐÏ¿¤òº£¹Ô¤Ê¤¤¤Þ¤¹¤«¡©"))
6216 if (!get_check("Do you register score now? "))
6221 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
6228 start_time = time(NULL);
6230 /* No suspending now */
6231 signals_ignore_tstp();
6233 /* Hack -- Character is now "icky" */
6234 character_icky = TRUE;
6236 /* Build the filename */
6237 path_build(buf, 1024, ANGBAND_DIR_APEX, "scores.raw");
6239 /* Open the high score file, for reading/writing */
6240 highscore_fd = fd_open(buf, O_RDWR);
6242 /* Handle score, show Top scores */
6243 success = send_world_score(TRUE);
6246 if (!success && !get_check("¥¹¥³¥¢ÅÐÏ¿¤òÄü¤á¤Þ¤¹¤«¡©"))
6248 if (!success && !get_check("Do you give up score registration? "))
6252 prt("°ú¤Â³¤ÂÔµ¡¤·¤Þ¤¹¡£", 0, 0);
6254 prt("standing by for future registration...", 0, 0);
6260 wait_report_score = FALSE;
6263 if (!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
6265 if (!save_player()) msg_print("death save failed!");
6268 /* Shut the high score file */
6269 (void)fd_close(highscore_fd);
6271 /* Forget the high score fd */
6274 /* Allow suspending now */
6275 signals_handle_tstp();
6280 /* Nothing loaded */
6281 if (!character_loaded)
6283 /* Make new player */
6286 /* The dungeon is not ready */
6287 character_dungeon = FALSE;
6289 /* Prepare to init the RNG */
6293 /* Process old character */
6296 /* Process the player name */
6297 process_player_name(FALSE);
6306 seed = (time(NULL));
6310 /* Mutate the seed on Unix machines */
6311 seed = ((seed >> 3) * (getpid() << 1));
6315 /* Use the complex RNG */
6318 /* Seed the "complex" RNG */
6319 Rand_state_init(seed);
6322 /* Roll new character */
6325 monster_race *r_ptr;
6327 /* The dungeon is not ready */
6328 character_dungeon = FALSE;
6332 p_ptr->inside_quest = 0;
6333 p_ptr->inside_arena = FALSE;
6334 p_ptr->inside_battle = FALSE;
6338 /* Hack -- seed for flavors */
6339 seed_flavor = randint0(0x10000000);
6341 /* Hack -- seed for town layout */
6342 seed_town = randint0(0x10000000);
6344 /* Roll up a new character */
6351 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "ÊÕ¶¤ÎÃϤ˹ߤêΩ¤Ã¤¿¡£");
6353 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "You are standing in the Outpost.");
6357 get_mon_num_prep(NULL, NULL);
6358 for (i = 0; i < MAX_KUBI; i++)
6364 kubi_r_idx[i] = get_mon_num(MAX_DEPTH - 1);
6365 r_ptr = &r_info[kubi_r_idx[i]];
6367 if(!(r_ptr->flags1 & RF1_UNIQUE)) continue;
6369 if(!(r_ptr->flags9 & RF9_DROP_CORPSE)) continue;
6370 if (r_ptr->rarity > 100) continue;
6372 if(r_ptr->flags6 & RF6_SPECIAL) continue;
6374 for (j = 0; j < i; j++)
6375 if (kubi_r_idx[i] == kubi_r_idx[j])break;
6380 for (i = 0; i < MAX_KUBI -1; i++)
6383 for (j = i; j < MAX_KUBI; j++)
6385 if (r_info[kubi_r_idx[i]].level > r_info[kubi_r_idx[j]].level)
6387 tmp = kubi_r_idx[i];
6388 kubi_r_idx[i] = kubi_r_idx[j];
6389 kubi_r_idx[j] = tmp;
6394 p_ptr->inside_battle = TRUE;
6397 today_mon = get_mon_num(3);
6398 r_ptr = &r_info[today_mon];
6400 if (r_ptr->flags1 & RF1_UNIQUE) continue;
6401 if (r_ptr->flags2 & (RF2_MULTIPLY)) continue;
6402 if (!(r_ptr->flags9 & RF9_DROP_CORPSE) || !(r_ptr->flags9 & RF9_DROP_SKELETON)) continue;
6403 if (r_ptr->rarity > 10) continue;
6404 if (r_ptr->level == 0) continue;
6407 p_ptr->inside_battle = FALSE;
6411 write_level = FALSE;
6414 do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ----¥²¡¼¥àºÆ³«----");
6416 do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ---- Restart Game ----");
6420 * 1.0.9 °ÊÁ°¤Ï¥»¡¼¥ÖÁ°¤Ë p_ptr->riding = -1 ¤È¤·¤Æ¤¤¤¿¤Î¤Ç¡¢ºÆÀßÄ꤬ɬÍפÀ¤Ã¤¿¡£
6421 * ¤â¤¦ÉÔÍפÀ¤¬¡¢°ÊÁ°¤Î¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤È¤Î¸ß´¹¤Î¤¿¤á¤Ë»Ä¤·¤Æ¤ª¤¯¡£
6423 if (p_ptr->riding == -1)
6426 for(i = m_max; i > 0; i--)
6428 if ((m_list[i].fy == py) && (m_list[i].fx == px))
6437 p_ptr->teleport_town = FALSE;
6438 p_ptr->sutemi = FALSE;
6439 world_monster = FALSE;
6440 now_damaged = FALSE;
6442 start_time = time(NULL) - 1;
6443 record_o_name[0] = '\0';
6445 /* Reset map panel */
6446 panel_row_min = cur_hgt;
6447 panel_col_min = cur_wid;
6449 /* Sexy gal gets bonus to maximum weapon skill of whip */
6450 if(p_ptr->pseikaku == SEIKAKU_SEXY)
6451 s_info[p_ptr->pclass].w_max[TV_HAFTED-TV_BOW][SV_WHIP] = 8000;
6453 /* Fill the arrays of floors and walls in the good proportions */
6454 for (i = 0; i < 100; i++)
6456 int lim1, lim2, lim3;
6458 lim1 = d_info[dungeon_type].floor_percent1;
6459 lim2 = lim1 + d_info[dungeon_type].floor_percent2;
6460 lim3 = lim2 + d_info[dungeon_type].floor_percent3;
6463 floor_type[i] = d_info[dungeon_type].floor1;
6465 floor_type[i] = d_info[dungeon_type].floor2;
6467 floor_type[i] = d_info[dungeon_type].floor3;
6469 lim1 = d_info[dungeon_type].fill_percent1;
6470 lim2 = lim1 + d_info[dungeon_type].fill_percent2;
6471 lim3 = lim2 + d_info[dungeon_type].fill_percent3;
6473 fill_type[i] = d_info[dungeon_type].fill_type1;
6475 fill_type[i] = d_info[dungeon_type].fill_type2;
6477 fill_type[i] = d_info[dungeon_type].fill_type3;
6480 /* Flavor the objects */
6488 /* Flash a message */
6490 prt("¤ªÂÔ¤Á²¼¤µ¤¤...", 0, 0);
6492 prt("Please wait...", 0, 0);
6496 /* Flush the message */
6500 /* Hack -- Enter wizard mode */
6501 if (arg_wizard && enter_wizard_mode()) wizard = TRUE;
6503 /* Initialize the town-buildings if necessary */
6504 if (!dun_level && !p_ptr->inside_quest)
6506 /* Init the wilderness */
6508 process_dungeon_file("w_info_j.txt", 0, 0, max_wild_y, max_wild_x);
6511 init_flags = INIT_ONLY_BUILDINGS;
6513 process_dungeon_file("t_info_j.txt", 0, 0, MAX_HGT, MAX_WID);
6518 /* Initialize vault info */
6520 if (init_v_info()) quit("·úÃÛʪ½é´ü²½ÉÔǽ");
6522 if (init_v_info()) quit("Cannot initialize vaults");
6525 /* Generate a dungeon level if needed */
6526 if (!character_dungeon) generate_cave();
6529 /* Character is now "complete" */
6530 character_generated = TRUE;
6533 /* Hack -- Character is no longer "icky" */
6534 character_icky = FALSE;
6540 /* Reset the visual mappings */
6543 /* Load the "pref" files */
6544 load_all_pref_files();
6546 /* React to changes */
6547 Term_xtra(TERM_XTRA_REACT, 0);
6550 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
6553 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
6559 /* Set or clear "rogue_like_commands" if requested */
6560 if (arg_force_original) rogue_like_commands = FALSE;
6561 if (arg_force_roguelike) rogue_like_commands = TRUE;
6563 /* Hack -- Enforce "delayed death" */
6564 if (p_ptr->chp < 0) death = TRUE;
6566 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
6568 if (new_game && ((p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BEASTMASTER)))
6570 monster_type *m_ptr;
6571 int pet_r_idx = ((p_ptr->pclass == CLASS_CAVALRY) ? MON_HORSE : MON_YASE_HORSE);
6572 monster_race *r_ptr = &r_info[pet_r_idx];
6573 place_monster_aux(py, px - 1, pet_r_idx,
6574 FALSE, FALSE, TRUE, TRUE, TRUE, FALSE);
6575 m_ptr = &m_list[hack_m_idx_ii];
6576 m_ptr->mspeed = r_ptr->speed;
6577 m_ptr->maxhp = r_ptr->hdice*(r_ptr->hside+1)/2;
6578 m_ptr->max_maxhp = m_ptr->maxhp;
6579 m_ptr->hp = r_ptr->hdice*(r_ptr->hside+1)/2;
6580 m_ptr->energy_need = ENERGY_NEED() + ENERGY_NEED();
6586 /* Process the level */
6590 if (p_ptr->notice) notice_stuff();
6593 if (p_ptr->update) update_stuff();
6596 if (p_ptr->redraw) redraw_stuff();
6599 if (p_ptr->window) window_stuff();
6602 /* Cancel the target */
6605 /* Cancel the health bar */
6609 /* Forget the lite */
6612 /* Forget the view */
6615 /* Forget the view */
6618 /* Handle "quit and save" */
6619 if (!alive && !death) break;
6621 /* Erase the old cave */
6623 if (!death) wipe_m_list();
6631 /* Accidental Death */
6634 if (p_ptr->inside_arena)
6636 p_ptr->inside_arena = FALSE;
6637 if(p_ptr->arena_number > MAX_ARENA_MONS)
6638 p_ptr->arena_number++;
6640 p_ptr->arena_number = 99;
6643 p_ptr->chp_frac = 0;
6644 p_ptr->exit_bldg = TRUE;
6649 /* Mega-Hack -- Allow player to cheat death */
6651 if ((wizard || cheat_live) && !get_check("»à¤Ë¤Þ¤¹¤«? "))
6653 if ((wizard || cheat_live) && !get_check("Die? "))
6657 /* Mark social class, reset age, if needed */
6658 if (p_ptr->sc) p_ptr->sc = p_ptr->age = 0;
6668 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÇ°¤òÁ÷¤ê¡¢»à¤òµ½¤¤¤¿¡£");
6670 msg_print("You invoke wizard mode and cheat death.");
6676 /* Restore hit points */
6677 p_ptr->chp = p_ptr->mhp;
6678 p_ptr->chp_frac = 0;
6680 if (p_ptr->pclass == CLASS_MAGIC_EATER)
6682 for (i = 0; i < EATER_EXT*2; i++)
6684 p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*EATER_CHARGE;
6686 for (; i < EATER_EXT*3; i++)
6688 p_ptr->magic_num1[i] = 0;
6691 /* Restore spell points */
6692 p_ptr->csp = p_ptr->msp;
6693 p_ptr->csp_frac = 0;
6695 /* Hack -- Healing */
6697 (void)set_confused(0);
6698 (void)set_poisoned(0);
6699 (void)set_afraid(0);
6700 (void)set_paralyzed(0);
6705 /* Hack -- Prevent starvation */
6706 (void)set_food(PY_FOOD_MAX - 1);
6708 /* Hack -- cancel recall */
6709 if (p_ptr->word_recall)
6713 msg_print("Ä¥¤ê¤Ä¤á¤¿Â絤¤¬Î®¤ìµî¤Ã¤¿...");
6715 msg_print("A tension leaves the air around you...");
6720 /* Hack -- Prevent recall */
6721 p_ptr->word_recall = 0;
6722 p_ptr->redraw |= (PR_STATUS);
6725 /* Note cause of death XXX XXX XXX */
6727 (void)strcpy(died_from, "»à¤Îµ½¤");
6729 (void)strcpy(died_from, "Cheating death");
6737 p_ptr->inside_arena = FALSE;
6738 p_ptr->inside_battle = FALSE;
6740 p_ptr->inside_quest = 0;
6741 p_ptr->recall_dungeon = dungeon_type;
6743 if (lite_town || vanilla_town)
6745 p_ptr->wilderness_y = 1;
6746 p_ptr->wilderness_x = 1;
6760 p_ptr->wilderness_y = 48;
6761 p_ptr->wilderness_x = 5;
6767 p_ptr->wild_mode = FALSE;
6768 p_ptr->leaving = TRUE;
6771 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " ¤·¤«¤·¡¢À¸¤Ê֤ä¿¡£");
6773 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " but revived.");
6779 /* Handle "death" */
6782 /* Make a new level */
6793 s32b turn_real(s32b hoge)
6795 if ((p_ptr->prace == RACE_VAMPIRE) ||
6796 (p_ptr->prace == RACE_SKELETON) ||
6797 (p_ptr->prace == RACE_ZOMBIE) ||
6798 (p_ptr->prace == RACE_SPECTRE))
6799 return hoge-(TURNS_PER_TICK * TOWN_DAWN *3/ 4);