3 /* Purpose: Angband game engine */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
15 #define TY_CURSE_CHANCE 100
16 #define CHAINSWORD_NOISE 100
18 static bool load = TRUE;
19 static int wild_regen = 20;
22 * Return a "feeling" (or NULL) about an item. Method 1 (Heavy).
24 static byte value_check_aux1(object_type *o_ptr)
27 if (artifact_p(o_ptr) || o_ptr->art_name)
30 if (cursed_p(o_ptr) || broken_p(o_ptr)) return FEEL_TERRIBLE;
37 if (ego_item_p(o_ptr))
40 if (cursed_p(o_ptr) || broken_p(o_ptr)) return FEEL_WORTHLESS;
43 return FEEL_EXCELLENT;
47 if (cursed_p(o_ptr)) return FEEL_CURSED;
50 if (broken_p(o_ptr)) return FEEL_BROKEN;
52 if ((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) return FEEL_AVERAGE;
54 /* Good "armor" bonus */
55 if (o_ptr->to_a > 0) return FEEL_GOOD;
57 /* Good "weapon" bonus */
58 if (o_ptr->to_h + o_ptr->to_d > 0) return FEEL_GOOD;
60 /* Default to "average" */
66 * Return a "feeling" (or NULL) about an item. Method 2 (Light).
68 static byte value_check_aux2(object_type *o_ptr)
70 /* Cursed items (all of them) */
71 if (cursed_p(o_ptr)) return FEEL_CURSED;
73 /* Broken items (all of them) */
74 if (broken_p(o_ptr)) return FEEL_BROKEN;
76 /* Artifacts -- except cursed/broken ones */
77 if (artifact_p(o_ptr) || o_ptr->art_name) return FEEL_GOOD;
79 /* Ego-Items -- except cursed/broken ones */
80 if (ego_item_p(o_ptr)) return FEEL_GOOD;
82 /* Good armor bonus */
83 if (o_ptr->to_a > 0) return FEEL_GOOD;
85 /* Good weapon bonuses */
86 if (o_ptr->to_h + o_ptr->to_d > 0) return FEEL_GOOD;
94 static void sense_inventory_aux(int slot, bool heavy)
97 object_type *o_ptr = &inventory[slot];
98 char o_name[MAX_NLEN];
100 /* We know about it already, do not tell us again */
101 if (o_ptr->ident & (IDENT_SENSE))return;
103 /* It is fully known, no information needed */
104 if (object_known_p(o_ptr)) return;
106 /* Check for a feeling */
107 feel = (heavy ? value_check_aux1(o_ptr) : value_check_aux2(o_ptr));
109 /* Skip non-feelings */
113 if ((p_ptr->muta3 & MUT3_BAD_LUCK) && !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)) && (turn % 40))
1090 if (disturb_minor) disturb(0, 0);
1092 msg_print("ÌÀ¤«¤ê¤¬Èù¤«¤Ë¤Ê¤Ã¤Æ¤¤Æ¤¤¤ë¡£");
1094 msg_print("Your light is growing faint.");
1100 /* The light is getting dim */
1101 else if ((o_ptr->xtra4 < 100) && (!(o_ptr->xtra4 % 10)))
1103 if (disturb_minor) disturb(0, 0);
1105 msg_print("ÌÀ¤«¤ê¤¬Èù¤«¤Ë¤Ê¤Ã¤Æ¤¤Æ¤¤¤ë¡£");
1107 msg_print("Your light is growing faint.");
1114 void leave_quest_check(void)
1116 /* Save quset number for dungeon pref file ($LEAVING_QUEST) */
1117 leaving_quest = p_ptr->inside_quest;
1119 /* Leaving an 'only once' quest marks it as failed */
1120 if (leaving_quest &&
1121 ((quest[leaving_quest].flags & QUEST_FLAG_ONCE) || (quest[leaving_quest].type == QUEST_TYPE_RANDOM)) &&
1122 (quest[leaving_quest].status == QUEST_STATUS_TAKEN))
1124 quest[leaving_quest].status = QUEST_STATUS_FAILED;
1125 quest[leaving_quest].complev = (byte)p_ptr->lev;
1126 if (quest[leaving_quest].type == QUEST_TYPE_RANDOM)
1128 r_info[quest[leaving_quest].r_idx].flags1 &= ~(RF1_QUESTOR);
1129 if (record_rand_quest)
1130 do_cmd_write_nikki(NIKKI_RAND_QUEST_F, leaving_quest, NULL);
1132 else if (record_fix_quest)
1133 do_cmd_write_nikki(NIKKI_FIX_QUEST_F, leaving_quest, NULL);
1139 * Forcibly pseudo-identify an object in the inventory
1142 * note: currently this function allows pseudo-id of any object,
1143 * including silly ones like potions & scrolls, which always
1144 * get '{average}'. This should be changed, either to stop such
1145 * items from being pseudo-id'd, or to allow psychometry to
1146 * detect whether the unidentified potion/scroll/etc is
1147 * good (Cure Light Wounds, Restore Strength, etc) or
1148 * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
1150 bool psychometry(void)
1154 char o_name[MAX_NLEN];
1159 item_tester_no_ryoute = TRUE;
1162 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«¡©";
1163 s = "Ä´¤Ù¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
1165 q = "Meditate on which item? ";
1166 s = "You have nothing appropriate.";
1169 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
1171 /* Get the item (in the pack) */
1174 o_ptr = &inventory[item];
1177 /* Get the item (on the floor) */
1180 o_ptr = &o_list[0 - item];
1183 /* It is fully known, no information needed */
1184 if (object_known_p(o_ptr))
1187 msg_print("²¿¤â¿·¤·¤¤¤³¤È¤ÏȽ¤é¤Ê¤«¤Ã¤¿¡£");
1189 msg_print("You cannot find out anything more about that.");
1195 /* Check for a feeling */
1196 feel = value_check_aux1(o_ptr);
1198 /* Get an object description */
1199 object_desc(o_name, o_ptr, FALSE, 0);
1201 /* Skip non-feelings */
1205 msg_format("%s¤«¤é¤ÏÆäËÊѤï¤Ã¤¿»ö¤Ï´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿¡£", o_name);
1207 msg_format("You do not perceive anything unusual about the %s.", o_name);
1214 msg_format("%s¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
1215 o_name, game_inscriptions[feel]);
1217 msg_format("You feel that the %s %s %s...",
1218 o_name, ((o_ptr->number == 1) ? "is" : "are"),
1219 game_inscriptions[feel]);
1223 /* We have "felt" it */
1224 o_ptr->ident |= (IDENT_SENSE);
1227 o_ptr->feeling = feel;
1229 /* Combine / Reorder the pack (later) */
1230 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1233 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1235 /* Something happened */
1240 static void gere_music(s32b music)
1248 stun_monsters(damroll(p_ptr->lev/10,2));
1251 hp_player(damroll(2,6));
1254 project_hack(GF_TURN_ALL, p_ptr->lev);
1257 project_hack(GF_PSI, randint1(p_ptr->lev * 3 / 2));
1260 project(0, 1, py, px, 0, GF_IDENTIFY, PROJECT_ITEM, -1);
1263 confuse_monsters(p_ptr->lev * 2);
1266 project_hack(GF_SOUND, damroll(10 + p_ptr->lev/5,7));
1269 charm_monsters(damroll(10 + p_ptr->lev/15,6));
1272 project(0, 0, py, px,
1273 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
1276 dispel_monsters(randint1(p_ptr->lev * 3));
1277 dispel_evil(randint1(p_ptr->lev * 3));
1284 earthquake(py, px, 10);
1287 stasis_monsters(p_ptr->lev * 4);
1290 dispel_monsters(randint1(p_ptr->lev * 3));
1293 hp_player(damroll(15,10));
1297 case MUSIC_DETECT+19:
1298 wiz_lite(FALSE, FALSE);
1299 case MUSIC_DETECT+11:
1300 case MUSIC_DETECT+12:
1301 case MUSIC_DETECT+13:
1302 case MUSIC_DETECT+14:
1303 case MUSIC_DETECT+15:
1304 case MUSIC_DETECT+16:
1305 case MUSIC_DETECT+17:
1306 case MUSIC_DETECT+18:
1307 map_area(DETECT_RAD_MAP);
1308 if ((p_ptr->lev > 39) && (music < MUSIC_DETECT+19)) p_ptr->magic_num1[0] = music+1;
1309 case MUSIC_DETECT+6:
1310 case MUSIC_DETECT+7:
1311 case MUSIC_DETECT+8:
1312 case MUSIC_DETECT+9:
1313 case MUSIC_DETECT+10:
1314 detect_treasure(DETECT_RAD_DEFAULT);
1315 detect_objects_gold(DETECT_RAD_DEFAULT);
1316 detect_objects_normal(DETECT_RAD_DEFAULT);
1317 if ((p_ptr->lev > 24) && (music < MUSIC_DETECT+11)) p_ptr->magic_num1[0] = music+1;
1318 case MUSIC_DETECT+3:
1319 case MUSIC_DETECT+4:
1320 case MUSIC_DETECT+5:
1321 detect_monsters_invis(DETECT_RAD_DEFAULT);
1322 detect_monsters_normal(DETECT_RAD_DEFAULT);
1323 if ((p_ptr->lev > 19) && (music < MUSIC_DETECT+6)) p_ptr->magic_num1[0] = music+1;
1325 case MUSIC_DETECT+1:
1326 case MUSIC_DETECT+2:
1327 detect_traps(DETECT_RAD_DEFAULT);
1328 detect_doors(DETECT_RAD_DEFAULT);
1329 detect_stairs(DETECT_RAD_DEFAULT);
1330 if ((p_ptr->lev > 14) && (music < MUSIC_DETECT+3)) p_ptr->magic_num1[0] = music+1;
1336 * If player has inscribed the object with "!!", let him know when it's
1339 static void recharged_notice(object_type *o_ptr)
1341 char o_name[MAX_NLEN];
1345 /* No inscription */
1346 if (!o_ptr->inscription) return;
1349 s = strchr(quark_str(o_ptr->inscription), '!');
1351 /* Process notification request. */
1354 /* Find another '!' */
1357 /* Describe (briefly) */
1358 object_desc(o_name, o_ptr, FALSE, 0);
1360 /* Notify the player */
1361 if (o_ptr->number > 1)
1363 msg_format("%s¤ÏºÆ½¼Å¶¤µ¤ì¤¿¡£", o_name);
1364 else msg_format("%s¤ÏºÆ½¼Å¶¤µ¤ì¤¿¡£", o_name);
1366 msg_format("Your %s are recharged.", o_name);
1367 else msg_format("Your %s is recharged.", o_name);
1375 /* Keep looking for '!'s */
1376 s = strchr(s + 1, '!');
1381 static void check_music()
1386 /* Music singed by player */
1387 if(p_ptr->pclass != CLASS_BARD) return;
1388 if(!p_ptr->magic_num1[0] && !p_ptr->magic_num1[1]) return;
1390 s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC - 1][p_ptr->magic_num2[0]];
1392 shouhimana = (s_ptr->smana*(3800-spell_exp[p_ptr->magic_num2[0]])+2399);
1395 else shouhimana *= 4;
1397 if(shouhimana < 1) shouhimana = 1;
1398 shouhimana *= 0x8000;
1399 if ((p_ptr->csp < shouhimana / 0x10000) || (p_ptr->anti_magic))
1406 p_ptr->csp -= shouhimana / 0x10000;
1407 shouhimana = (shouhimana & 0xffff);
1408 if (p_ptr->csp_frac < shouhimana)
1411 p_ptr->csp_frac += (u16b)(0x10000L - shouhimana);
1415 p_ptr->csp_frac -= (u16b)shouhimana;
1418 p_ptr->redraw |= PR_MANA;
1419 if (p_ptr->magic_num1[1])
1421 p_ptr->magic_num1[0] = p_ptr->magic_num1[1];
1422 p_ptr->magic_num1[1] = 0;
1424 msg_print("²Î¤òºÆ³«¤·¤¿¡£");
1426 msg_print("You restart singing.");
1428 p_ptr->action = ACTION_SING;
1430 /* Recalculate bonuses */
1431 p_ptr->update |= (PU_BONUS | PU_HP);
1433 /* Redraw status bar */
1434 p_ptr->redraw |= (PR_STATUS);
1437 if (spell_exp[p_ptr->magic_num2[0]] < 900)
1438 spell_exp[p_ptr->magic_num2[0]]+=5;
1439 else if(spell_exp[p_ptr->magic_num2[0]] < 1200)
1440 {if (one_in_(2) && (dun_level > 4) && ((dun_level + 10) > p_ptr->lev)) spell_exp[p_ptr->magic_num2[0]]+=1;}
1441 else if(spell_exp[p_ptr->magic_num2[0]] < 1400)
1442 {if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel)) spell_exp[p_ptr->magic_num2[0]]+=1;}
1443 else if(spell_exp[p_ptr->magic_num2[0]] < 1600)
1444 {if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel)) spell_exp[p_ptr->magic_num2[0]]+=1;}
1446 gere_music(p_ptr->magic_num1[0]);
1449 /* Choose one of items that have cursed flag */
1450 object_type *choose_cursed_obj_name(u32b flag)
1453 int choices[INVEN_TOTAL-INVEN_RARM];
1456 /* Paranoia -- Player has no warning-item */
1457 if (!(p_ptr->cursed & flag)) return NULL;
1459 /* Search Inventry */
1460 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
1462 object_type *o_ptr = &inventory[i];
1464 if (o_ptr->curse_flags & flag)
1466 choices[number] = i;
1471 /* Choice one of them */
1472 return (&inventory[choices[randint0(number)]]);
1477 * Handle certain things once every 10 game turns
1479 static void process_world(void)
1483 bool cave_no_regen = FALSE;
1484 int upkeep_factor = 0;
1489 const int dec_count = (easy_band ? 2 : 1);
1491 int hour, min, prev_min;
1492 s32b len = 20L * TOWN_DAWN;
1493 s32b tick = turn % len + len / 4;
1495 hour = (24 * tick / len) % 24;
1496 min = (1440 * tick / len) % 60;
1497 prev_min = (1440 * (tick - 20) / len) % 60;
1499 if ((turn - old_turn == (3000 - dun_level*20)) && (dun_level) &&
1500 !(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)))) &&
1501 !(p_ptr->inside_battle))
1504 if (p_ptr->inside_battle && !p_ptr->leaving)
1511 /* Count all hostile monsters */
1512 for (i2 = 0; i2 < cur_wid; ++i2)
1513 for (j2 = 0; j2 < cur_hgt; j2++)
1514 if ((cave[j2][i2].m_idx > 0) && (cave[j2][i2].m_idx != p_ptr->riding))
1517 win_m_idx = cave[j2][i2].m_idx;
1520 if (number_mon == 0)
1523 msg_print("ÁêÂǤÁ¤Ë½ª¤ï¤ê¤Þ¤·¤¿¡£");
1525 msg_print("They have kill each other at the same time.");
1528 p_ptr->energy = 100;
1531 else if ((number_mon-1) == 0)
1534 monster_type *wm_ptr;
1536 wm_ptr = &m_list[win_m_idx];
1538 monster_desc(m_name, wm_ptr, 0);
1540 msg_format("%s¤¬¾¡Íø¤·¤¿¡ª", m_name);
1542 msg_format("%s is winner!", m_name);
1546 if (win_m_idx == (sel_monster+1))
1549 msg_print("¤ª¤á¤Ç¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£");
1551 msg_print("Congratulations.");
1554 msg_format("%d¡ð¤ò¼õ¤±¼è¤Ã¤¿¡£", battle_odds);
1556 msg_format("You recieved %d gold.", battle_odds);
1558 p_ptr->au += battle_odds;
1563 msg_print("»ÄÇ°¤Ç¤·¤¿¡£");
1565 msg_print("You lost gold.");
1569 p_ptr->energy = 100;
1572 else if(turn - old_turn == 3000L)
1575 msg_print("¿½¤·Ê¬¤±¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤³¤Î¾¡Éé¤Ï°ú¤Ê¬¤±¤È¤µ¤»¤Æ¤¤¤¿¤À¤¤Þ¤¹¡£");
1577 msg_format("This battle have ended in a draw.");
1579 p_ptr->au += kakekin;
1581 p_ptr->energy = 100;
1586 /* Every 20 game turns */
1587 if (turn % 20) return;
1589 /*** Check the Time and Load ***/
1593 /* Check time and load */
1594 if ((0 != check_time()) || (0 != check_load()))
1597 if (closing_flag <= 2)
1602 /* Count warnings */
1607 msg_print("¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¸¤«¤«¤Ã¤Æ¤¤¤Þ¤¹...");
1608 msg_print("¥²¡¼¥à¤ò½ªÎ»¤¹¤ë¤«¥»¡¼¥Ö¤¹¤ë¤«¤·¤Æ²¼¤µ¤¤¡£");
1610 msg_print("The gates to ANGBAND are closing...");
1611 msg_print("Please finish up and/or save your game.");
1621 msg_print("º£¡¢¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¶¤µ¤ì¤Þ¤·¤¿¡£");
1623 msg_print("The gates to ANGBAND are now closed.");
1631 p_ptr->leaving = TRUE;
1636 /*** Attempt timed autosave ***/
1637 if (autosave_t && autosave_freq && !p_ptr->inside_battle)
1639 if (!(turn % ((s32b)autosave_freq * 20)))
1640 do_cmd_save_game(TRUE);
1646 msg_print("²¿¤«¤¬Ê¹¤³¤¨¤¿¡£");
1648 msg_print("You hear noise.");
1652 /*** Handle the wilderness/town (sunshine) ***/
1654 /* While in town/wilderness */
1655 if (!dun_level && !p_ptr->inside_quest && !p_ptr->inside_battle && !p_ptr->inside_arena && !p_ptr->wild_mode)
1657 /* Hack -- Daybreak/Nighfall in town */
1658 if (!(turn % ((20L * TOWN_DAWN) / 2)))
1662 /* Check for dawn */
1663 dawn = (!(turn % (20L * TOWN_DAWN)));
1670 msg_print("Ì뤬ÌÀ¤±¤¿¡£");
1672 msg_print("The sun has risen.");
1676 /* Hack -- Scan the town */
1677 for (y = 0; y < cur_hgt; y++)
1679 for (x = 0; x < cur_wid; x++)
1681 /* Get the cave grid */
1682 c_ptr = &cave[y][x];
1685 c_ptr->info |= (CAVE_GLOW);
1687 /* Hack -- Memorize lit grids if allowed */
1688 if (view_perma_grids) c_ptr->info |= (CAVE_MARK);
1690 /* Hack -- Notice spot */
1701 msg_print("Æü¤¬ÄÀ¤ó¤À¡£");
1703 msg_print("The sun has fallen.");
1707 /* Hack -- Scan the town */
1708 for (y = 0; y < cur_hgt; y++)
1710 for (x = 0; x < cur_wid; x++)
1712 /* Get the cave grid */
1713 c_ptr = &cave[y][x];
1715 /* Darken "boring" features */
1716 if ((c_ptr->feat <= FEAT_INVIS) ||
1717 ((c_ptr->feat >= FEAT_DEEP_WATER) &&
1718 (c_ptr->feat <= FEAT_TREES) &&
1719 (c_ptr->feat != FEAT_MUSEUM)))
1721 /* Forget the grid */
1722 c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK);
1724 /* Hack -- Notice spot */
1731 /* Update the monsters */
1732 p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
1735 p_ptr->redraw |= (PR_MAP);
1738 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1742 /* Set back the rewards once a day */
1743 if (!(turn % (200L * STORE_TURNS)))
1747 /* Reset the rewards */
1748 for (n = 0; n < MAX_BACT; n++)
1750 p_ptr->rewards[n] = FALSE;
1755 if (cheat_xtra) msg_print("Êó½·¤ò¥ê¥»¥Ã¥È");
1757 if (cheat_xtra) msg_print("Rewards reset.");
1763 /*** Process the monsters ***/
1765 /* Check for creature generation. */
1766 if (one_in_(d_info[dungeon_type].max_m_alloc_chance) &&
1767 !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->inside_battle)
1769 /* Make a new monster */
1770 (void)alloc_monster(MAX_SIGHT + 5, FALSE);
1773 /* Hack -- Check for creature regeneration */
1774 if (!(turn % 200) && !p_ptr->inside_battle) regen_monsters();
1775 if (!(turn % 60)) regen_captured_monsters();
1778 /*** Damage over Time ***/
1780 /* Take damage from poison */
1781 if (p_ptr->poisoned && !p_ptr->invuln)
1785 take_hit(DAMAGE_NOESCAPE, 1, "ÆÇ", -1);
1787 take_hit(DAMAGE_NOESCAPE, 1, "poison", -1);
1793 /* (Vampires) Take damage from sunlight */
1794 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
1796 if (!dun_level && !p_ptr->resist_lite && !p_ptr->invuln &&
1797 (!((turn / ((20L * TOWN_DAWN) / 2)) % 2)))
1799 if (cave[py][px].info & CAVE_GLOW)
1803 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª");
1804 take_hit(DAMAGE_NOESCAPE, 1, "Æü¸÷", -1);
1806 msg_print("The sun's rays scorch your undead flesh!");
1807 take_hit(DAMAGE_NOESCAPE, 1, "sunlight", -1);
1810 cave_no_regen = TRUE;
1814 if (inventory[INVEN_LITE].tval && (inventory[INVEN_LITE].name2 != EGO_LITE_DARKNESS) &&
1815 !p_ptr->resist_lite)
1817 object_type * o_ptr = &inventory[INVEN_LITE];
1818 char o_name [MAX_NLEN];
1819 char ouch [MAX_NLEN+40];
1821 /* Get an object description */
1822 object_desc(o_name, o_ptr, FALSE, 0);
1825 msg_format("%s¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª", o_name);
1827 msg_format("The %s scorches your undead flesh!", o_name);
1831 cave_no_regen = TRUE;
1833 /* Get an object description */
1834 object_desc(o_name, o_ptr, TRUE, 0);
1837 sprintf(ouch, "%s¤òÁõÈ÷¤·¤¿¥À¥á¡¼¥¸", o_name);
1839 sprintf(ouch, "wielding %s", o_name);
1842 if (!p_ptr->invuln) take_hit(DAMAGE_NOESCAPE, 1, ouch, -1);
1846 if ((cave[py][px].feat == FEAT_SHAL_LAVA) &&
1847 !p_ptr->invuln && !p_ptr->immune_fire && !p_ptr->ffall)
1849 int damage = 3000 + randint0(2000);
1851 if (prace_is_(RACE_ENT)) damage += damage/3;
1853 if (p_ptr->resist_fire) damage = damage / 3;
1854 if (p_ptr->oppose_fire) damage = damage / 3;
1855 damage = damage / 100 + (randint0(100) < (damage % 100));
1861 msg_print("ÍÏ´ä¤Ç²Ð½ý¤·¤¿¡ª");
1862 take_hit(DAMAGE_NOESCAPE, damage, "Àõ¤¤ÍÏ´äή", -1);
1864 msg_print("The lava burns you!");
1865 take_hit(DAMAGE_NOESCAPE, damage, "shallow lava", -1);
1868 cave_no_regen = TRUE;
1872 else if ((cave[py][px].feat == FEAT_DEEP_LAVA) &&
1873 !p_ptr->invuln && !p_ptr->immune_fire)
1875 int damage = 6000 + randint0(4000);
1880 if (p_ptr->resist_fire) damage = damage / 3;
1881 if (p_ptr->oppose_fire) damage = damage / 3;
1885 damage = damage / 5;
1888 message = "Ç®¤Ç²Ð½ý¤·¤¿¡ª";
1889 hit_from = "¿¼¤¤ÍÏ´äή¤Î¾å¤ËÉâÍ·¤·¤¿¥À¥á¡¼¥¸";
1891 message = "The heat burns you!";
1892 hit_from = "flying over deep lava";
1899 message = "ÍÏ´ä¤Ç²Ð½ý¤·¤¿¡ª";
1900 hit_from = "¿¼¤¤ÍÏ´äή";
1902 message = "The lava burns you!";
1903 hit_from = "deep lava";
1908 damage = damage / 100 + (randint0(100) < (damage % 100));
1913 take_hit(DAMAGE_NOESCAPE, damage, hit_from, -1);
1915 cave_no_regen = TRUE;
1919 else if ((cave[py][px].feat == FEAT_DEEP_WATER) && !p_ptr->ffall && !p_ptr->can_swim)
1921 if (p_ptr->total_weight > (((u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2))
1925 msg_print("Å®¤ì¤Æ¤¤¤ë¡ª");
1926 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), "Å®¤ì", -1);
1928 msg_print("You are drowning!");
1929 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), "drowning", -1);
1932 cave_no_regen = TRUE;
1939 if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !p_ptr->immune_fire)
1941 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1942 if (prace_is_(RACE_ENT)) damage += damage/3;
1943 if (p_ptr->resist_fire) damage = damage / 3;
1944 if (p_ptr->oppose_fire) damage = damage / 3;
1946 msg_print("Ç®¤¤¡ª");
1947 take_hit(DAMAGE_NOESCAPE, damage, "±ê¤Î¥ª¡¼¥é", -1);
1949 msg_print("It's hot!");
1950 take_hit(DAMAGE_NOESCAPE, damage, "Fire aura", -1);
1953 if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !p_ptr->immune_elec)
1955 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1956 if (p_ptr->resist_elec) damage = damage / 3;
1957 if (p_ptr->oppose_elec) damage = damage / 3;
1959 msg_print("Äˤ¤¡ª");
1960 take_hit(DAMAGE_NOESCAPE, damage, "Åŵ¤¤Î¥ª¡¼¥é", -1);
1962 msg_print("It hurts!");
1963 take_hit(DAMAGE_NOESCAPE, damage, "Elec aura", -1);
1966 if ((r_info[m_list[p_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !p_ptr->immune_cold)
1968 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1969 if (p_ptr->resist_cold) damage = damage / 3;
1970 if (p_ptr->oppose_cold) damage = damage / 3;
1972 msg_print("Î䤿¤¤¡ª");
1973 take_hit(DAMAGE_NOESCAPE, damage, "Î䵤¤Î¥ª¡¼¥é", -1);
1975 msg_print("It's cold!");
1976 take_hit(DAMAGE_NOESCAPE, damage, "Cold aura", -1);
1981 /* Spectres -- take damage when moving through walls */
1983 * Added: ANYBODY takes damage if inside through walls
1984 * without wraith form -- NOTE: Spectres will never be
1985 * reduced below 0 hp by being inside a stone wall; others
1988 if (!cave_floor_bold(py, px))
1990 /* Player can walk through trees */
1991 if ((cave[py][px].feat == FEAT_TREES) || ((cave[py][px].feat == FEAT_MOUNTAIN) && !dun_level && p_ptr->ffall))
1995 else if (!p_ptr->invuln && !p_ptr->wraith_form && !p_ptr->kabenuke &&
1996 ((p_ptr->chp > (p_ptr->lev / 5)) || !p_ptr->pass_wall))
2000 cave_no_regen = TRUE;
2002 if (p_ptr->pass_wall)
2005 msg_print("ÂΤÎʬ»Ò¤¬Ê¬²ò¤·¤¿µ¤¤¬¤¹¤ë¡ª");
2008 msg_print("Your molecules feel disrupted!");
2009 dam_desc = "density";
2016 msg_print("Êø¤ì¤¿´ä¤Ë²¡¤·ÄÙ¤µ¤ì¤¿¡ª");
2017 dam_desc = "¹Å¤¤´ä";
2019 msg_print("You are being crushed!");
2020 dam_desc = "solid rock";
2025 take_hit(DAMAGE_NOESCAPE, 1 + (p_ptr->lev / 5), dam_desc, -1);
2031 monster_race *r_ptr;
2033 if (min != prev_min)
2036 bool old_inside_battle = p_ptr->inside_battle;
2038 do_cmd_write_nikki(NIKKI_HIGAWARI, 0, NULL);
2040 p_ptr->inside_battle = TRUE;
2041 get_mon_num_prep(NULL,NULL);
2043 for (i = 0; i < max_d_idx; i++)
2045 if (max_dlv[i] < d_info[i].mindepth) continue;
2046 if (max_dl < max_dlv[i]) max_dl = max_dlv[i];
2050 today_mon = get_mon_num(max_dl);
2051 r_ptr = &r_info[today_mon];
2053 if (r_ptr->flags1 & RF1_UNIQUE) continue;
2054 if (r_ptr->flags7 & (RF7_UNIQUE_7 | RF7_UNIQUE2)) continue;
2055 if (r_ptr->flags2 & (RF2_MULTIPLY)) continue;
2056 if (!(r_ptr->flags9 & RF9_DROP_CORPSE) || !(r_ptr->flags9 & RF9_DROP_SKELETON)) continue;
2057 if (r_ptr->level < MIN(max_dl/2, 40)) continue;
2058 if (r_ptr->rarity > 10) continue;
2059 if (r_ptr->level == 0) continue;
2062 p_ptr->today_mon = 0;
2063 p_ptr->inside_battle = old_inside_battle;
2067 /* Nightmare mode activates the TY_CURSE at midnight */
2068 if (ironman_nightmare)
2070 /* Require exact minute */
2071 if (min != prev_min)
2073 /* Every 15 minutes after 11:00 pm */
2074 if ((hour == 23) && !(min % 15))
2084 msg_print("±ó¤¯¤ÇÉÔµ¤Ì£¤Ê¾â¤Î²»¤¬ÌĤä¿¡£");
2086 msg_print("You hear a distant bell toll ominously.");
2094 msg_print("±ó¤¯¤Ç¾â¤¬Æó²óÌĤä¿¡£");
2096 msg_print("A distant bell sounds twice.");
2104 msg_print("±ó¤¯¤Ç¾â¤¬»°²óÌĤä¿¡£");
2106 msg_print("A distant bell sounds three times.");
2114 msg_print("±ó¤¯¤Ç¾â¤¬»Í²óÌĤä¿¡£");
2116 msg_print("A distant bell tolls four times.");
2124 /* TY_CURSE activates at mignight! */
2131 msg_print("±ó¤¯¤Ç¾â¤¬²¿²ó¤âÌĤꡢ»à¤ó¤À¤è¤¦¤ÊÀŤ±¤µ¤ÎÃæ¤Ø¾Ã¤¨¤Æ¤¤¤Ã¤¿¡£");
2133 msg_print("A distant bell tolls many times, fading into an deathly silence.");
2136 activate_ty_curse(FALSE, &count);
2141 /* Take damage from cuts */
2142 if (p_ptr->cut && !p_ptr->invuln)
2144 /* Mortal wound or Deep Gash */
2145 if (p_ptr->cut > 1000)
2150 else if (p_ptr->cut > 200)
2156 else if (p_ptr->cut > 100)
2161 else if (p_ptr->cut > 50)
2166 else if (p_ptr->cut > 25)
2171 else if (p_ptr->cut > 10)
2184 take_hit(DAMAGE_NOESCAPE, i, "Ã×Ì¿½ý", -1);
2186 take_hit(DAMAGE_NOESCAPE, i, "a fatal wound", -1);
2192 /*** Check the Food, and Regenerate ***/
2194 if (!p_ptr->inside_battle)
2196 /* Digest normally */
2197 if (p_ptr->food < PY_FOOD_MAX)
2199 /* Every 100 game turns */
2202 /* Basic digestion rate based on speed */
2203 i = /* extract_energy[p_ptr->pspeed] * 2;*/
2204 ((p_ptr->pspeed > 199) ? 49 : ((p_ptr->pspeed < 0) ?
2205 1 : extract_energy[p_ptr->pspeed]));
2207 /* Regeneration takes more food */
2208 if (p_ptr->regenerate) i += 20;
2209 if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK)) i+= 20;
2210 if (p_ptr->cursed & TRC_FAST_DIGEST) i += 30;
2212 /* Slow digestion takes less food */
2213 if (p_ptr->slow_digest) i -= 5;
2215 /* Minimal digestion */
2217 /* Maximal digestion */
2218 if (i > 100) i = 100;
2220 /* Digest some food */
2221 (void)set_food(p_ptr->food - i);
2225 /* Digest quickly when gorged */
2228 /* Digest a lot of food */
2229 (void)set_food(p_ptr->food - 100);
2233 /* Starve to death (slowly) */
2234 if (p_ptr->food < PY_FOOD_STARVE)
2236 /* Calculate damage */
2237 i = (PY_FOOD_STARVE - p_ptr->food) / 10;
2241 if (!p_ptr->invuln) take_hit(DAMAGE_LOSELIFE, i, "¶õÊ¢", -1);
2243 if (!p_ptr->invuln) take_hit(DAMAGE_LOSELIFE, i, "starvation", -1);
2248 /* Default regeneration */
2249 regen_amount = PY_REGEN_NORMAL;
2252 if (p_ptr->food < PY_FOOD_WEAK)
2254 /* Lower regeneration */
2255 if (p_ptr->food < PY_FOOD_STARVE)
2259 else if (p_ptr->food < PY_FOOD_FAINT)
2261 regen_amount = PY_REGEN_FAINT;
2265 regen_amount = PY_REGEN_WEAK;
2269 if ((p_ptr->food < PY_FOOD_FAINT) && !p_ptr->inside_battle)
2271 /* Faint occasionally */
2272 if (!p_ptr->paralyzed && (randint0(100) < 10))
2276 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤À䤷¤Æ¤·¤Þ¤Ã¤¿¡£");
2278 msg_print("You faint from the lack of food.");
2283 /* Hack -- faint (bypass free action) */
2284 (void)set_paralyzed(p_ptr->paralyzed + 1 + randint0(5));
2290 /* Are we walking the pattern? */
2291 if (pattern_effect())
2293 cave_no_regen = TRUE;
2297 /* Regeneration ability */
2298 if (p_ptr->regenerate)
2300 regen_amount = regen_amount * 2;
2302 if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK))
2306 if (p_ptr->cursed & TRC_SLOW_REGEN)
2313 /* Searching or Resting */
2314 if ((p_ptr->action == ACTION_SEARCH) || (p_ptr->action == ACTION_REST))
2316 regen_amount = regen_amount * 2;
2319 upkeep_factor = calculate_upkeep();
2321 /* Regenerate the mana */
2322 /* if (p_ptr->csp < p_ptr->msp) */
2326 s32b upkeep_regen = ((100 - upkeep_factor) * regen_amount);
2327 if ((p_ptr->action == ACTION_LEARN) || (p_ptr->action == ACTION_HAYAGAKE)) upkeep_regen -= regen_amount;
2328 regenmana(upkeep_regen/100);
2330 #ifdef TRACK_FRIENDS
2334 msg_format("£Í£Ð²óÉü: %d/%d", upkeep_regen, regen_amount);
2336 msg_format("Regen: %d/%d", upkeep_regen, regen_amount);
2340 #endif /* TRACK_FRIENDS */
2343 else if (p_ptr->action != ACTION_LEARN)
2345 regenmana(regen_amount);
2348 if (p_ptr->pclass == CLASS_MAGIC_EATER)
2350 regenmagic(regen_amount);
2353 if ((p_ptr->csp == 0) && (p_ptr->csp_frac == 0))
2355 while (upkeep_factor > 100)
2358 msg_print("¤³¤ó¤Ê¤Ë¿¤¯¤Î¥Ú¥Ã¥È¤òÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
2360 msg_print("Such much pets cannot be controled at once!");
2363 do_cmd_pet_dismiss();
2365 upkeep_factor = calculate_upkeep();
2368 msg_format("°Ý»ý£Í£Ð¤Ï %d%%", upkeep_factor);
2370 msg_format("Upkeep: %d%% mana.", upkeep_factor);
2376 /* Poisoned or cut yields no healing */
2377 if (p_ptr->poisoned) regen_amount = 0;
2378 if (p_ptr->cut) regen_amount = 0;
2380 /* Special floor -- Pattern, in a wall -- yields no healing */
2381 if (cave_no_regen) regen_amount = 0;
2383 regen_amount = (regen_amount * mutant_regenerate_mod) / 100;
2385 /* Regenerate Hit Points if needed */
2386 if ((p_ptr->chp < p_ptr->mhp) && !cave_no_regen)
2388 if ((cave[py][px].feat < FEAT_PATTERN_END) &&
2389 (cave[py][px].feat >= FEAT_PATTERN_START))
2391 regenhp(regen_amount / 5); /* Hmmm. this should never happen? */
2395 regenhp(regen_amount);
2400 /*** Timeout Various Things ***/
2403 if (p_ptr->tim_mimic)
2405 (void)set_mimic(p_ptr->tim_mimic - 1, p_ptr->mimic_form, TRUE);
2408 /* Hack -- Hallucinating */
2411 (void)set_image(p_ptr->image - dec_count);
2417 (void)set_blind(p_ptr->blind - dec_count);
2420 /* Times see-invisible */
2421 if (p_ptr->tim_invis)
2423 (void)set_tim_invis(p_ptr->tim_invis - 1, TRUE);
2434 (void)set_tim_esp(p_ptr->tim_esp - 1, TRUE);
2437 /* Timed temporary elemental brands. -LM- */
2438 if (p_ptr->ele_attack)
2440 p_ptr->ele_attack--;
2442 /* Clear all temporary elemental brands. */
2443 if (!p_ptr->ele_attack) set_ele_attack(0, 0);
2446 /* Timed temporary elemental immune. -LM- */
2447 if (p_ptr->ele_immune)
2449 p_ptr->ele_immune--;
2451 /* Clear all temporary elemental brands. */
2452 if (!p_ptr->ele_immune) set_ele_immune(0, 0);
2455 /* Timed infra-vision */
2456 if (p_ptr->tim_infra)
2458 (void)set_tim_infra(p_ptr->tim_infra - 1, TRUE);
2462 if (p_ptr->tim_stealth)
2464 (void)set_tim_stealth(p_ptr->tim_stealth - 1, TRUE);
2467 /* Timed levitation */
2468 if (p_ptr->tim_ffall)
2470 (void)set_tim_ffall(p_ptr->tim_ffall - 1, TRUE);
2473 /* Timed sh_touki */
2474 if (p_ptr->tim_sh_touki)
2476 (void)set_tim_sh_touki(p_ptr->tim_sh_touki - 1, TRUE);
2480 if (p_ptr->tim_sh_fire)
2482 (void)set_tim_sh_fire(p_ptr->tim_sh_fire - 1, TRUE);
2485 /* Timed resist-magic */
2486 if (p_ptr->resist_magic)
2488 (void)set_resist_magic(p_ptr->resist_magic - 1, TRUE);
2491 /* Timed regeneration */
2492 if (p_ptr->tim_regen)
2494 (void)set_tim_regen(p_ptr->tim_regen - 1, TRUE);
2497 /* Timed resist nether */
2498 if (p_ptr->tim_res_nether)
2500 (void)set_tim_res_nether(p_ptr->tim_res_nether - 1, TRUE);
2503 /* Timed resist time */
2504 if (p_ptr->tim_res_time)
2506 (void)set_tim_res_time(p_ptr->tim_res_time - 1, TRUE);
2510 if (p_ptr->tim_reflect)
2512 (void)set_tim_reflect(p_ptr->tim_reflect - 1, TRUE);
2516 if (p_ptr->multishadow)
2518 (void)set_multishadow(p_ptr->multishadow - 1, TRUE);
2521 /* Timed Robe of dust */
2522 if (p_ptr->dustrobe)
2524 (void)set_dustrobe(p_ptr->dustrobe - 1, TRUE);
2527 /* Timed infra-vision */
2528 if (p_ptr->kabenuke)
2530 (void)set_kabenuke(p_ptr->kabenuke - 1, TRUE);
2534 if (p_ptr->paralyzed)
2536 (void)set_paralyzed(p_ptr->paralyzed - dec_count);
2540 if (p_ptr->confused)
2542 (void)set_confused(p_ptr->confused - dec_count);
2548 (void)set_afraid(p_ptr->afraid - dec_count);
2554 (void)set_fast(p_ptr->fast - 1, TRUE);
2560 (void)set_slow(p_ptr->slow - dec_count, TRUE);
2563 /* Protection from evil */
2564 if (p_ptr->protevil)
2566 (void)set_protevil(p_ptr->protevil - 1, TRUE);
2569 /* Invulnerability */
2572 (void)set_invuln(p_ptr->invuln - 1, TRUE);
2576 if (p_ptr->wraith_form)
2578 (void)set_wraith_form(p_ptr->wraith_form - 1, TRUE);
2584 (void)set_hero(p_ptr->hero - 1, TRUE);
2590 (void)set_shero(p_ptr->shero - 1, TRUE);
2596 (void)set_blessed(p_ptr->blessed - 1, TRUE);
2602 (void)set_shield(p_ptr->shield - 1, TRUE);
2606 if (p_ptr->tsubureru)
2608 (void)set_tsubureru(p_ptr->tsubureru - 1, TRUE);
2612 if (p_ptr->magicdef)
2614 (void)set_magicdef(p_ptr->magicdef - 1, TRUE);
2618 if (p_ptr->tsuyoshi)
2620 (void)set_tsuyoshi(p_ptr->tsuyoshi - 1, TRUE);
2624 if (p_ptr->oppose_acid)
2626 (void)set_oppose_acid(p_ptr->oppose_acid - 1, TRUE);
2629 /* Oppose Lightning */
2630 if (p_ptr->oppose_elec)
2632 (void)set_oppose_elec(p_ptr->oppose_elec - 1, TRUE);
2636 if (p_ptr->oppose_fire)
2638 (void)set_oppose_fire(p_ptr->oppose_fire - 1, TRUE);
2642 if (p_ptr->oppose_cold)
2644 (void)set_oppose_cold(p_ptr->oppose_cold - 1, TRUE);
2648 if (p_ptr->oppose_pois)
2650 (void)set_oppose_pois(p_ptr->oppose_pois - 1, TRUE);
2655 (void)set_ultimate_res(p_ptr->ult_res - 1, TRUE);
2658 /*** Poison and Stun and Cut ***/
2661 if (p_ptr->poisoned)
2663 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2665 /* Apply some healing */
2666 (void)set_poisoned(p_ptr->poisoned - adjust);
2672 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2674 /* Apply some healing */
2675 (void)set_stun(p_ptr->stun - adjust);
2681 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2683 /* Hack -- Truly "mortal" wound */
2684 if (p_ptr->cut > 1000) adjust = 0;
2686 /* Apply some healing */
2687 (void)set_cut(p_ptr->cut - adjust);
2692 /*** Process Light ***/
2694 /* Check for light being wielded */
2695 o_ptr = &inventory[INVEN_LITE];
2697 /* Burn some fuel in the current lite */
2698 if (o_ptr->tval == TV_LITE)
2700 /* Hack -- Use some fuel (except on artifacts) */
2701 if (!(artifact_p(o_ptr) || o_ptr->sval == SV_LITE_FEANOR) && (o_ptr->xtra4 > 0))
2703 /* Decrease life-span */
2704 if (o_ptr->name2 == EGO_LITE_LONG)
2706 if (turn % 40) o_ptr->xtra4--;
2708 else o_ptr->xtra4--;
2710 /* Notice interesting fuel steps */
2711 notice_lite_change(o_ptr);
2715 /* Calculate torch radius */
2716 p_ptr->update |= (PU_TORCH);
2719 /*** Process mutation effects ***/
2720 if (p_ptr->muta2 && !p_ptr->inside_battle && !p_ptr->wild_mode)
2722 if ((p_ptr->muta2 & MUT2_BERS_RAGE) && one_in_(3000))
2726 msg_print("¥¦¥¬¥¡¥¡¥¢¡ª");
2727 msg_print("·ãÅܤÎȯºî¤Ë½±¤ï¤ì¤¿¡ª");
2729 msg_print("RAAAAGHH!");
2730 msg_print("You feel a fit of rage coming over you!");
2733 (void)set_shero(10 + randint1(p_ptr->lev), FALSE);
2736 if ((p_ptr->muta2 & MUT2_COWARDICE) && (randint1(3000) == 13))
2738 if (!(p_ptr->resist_fear || p_ptr->hero || p_ptr->shero))
2742 msg_print("¤È¤Æ¤â°Å¤¤... ¤È¤Æ¤â¶²¤¤¡ª");
2744 msg_print("It's so dark... so scary!");
2747 set_afraid(p_ptr->afraid + 13 + randint1(26));
2751 if ((p_ptr->muta2 & MUT2_RTELEPORT) && (randint1(5000) == 88))
2753 if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) &&
2758 /* Teleport player */
2760 msg_print("¤¢¤Ê¤¿¤Î°ÌÃÖ¤ÏÆÍÁ³¤Ò¤¸¤ç¤¦¤ËÉÔ³ÎÄê¤Ë¤Ê¤Ã¤¿...");
2762 msg_print("Your position suddenly seems very uncertain...");
2766 teleport_player(40);
2770 if ((p_ptr->muta2 & MUT2_ALCOHOL) && (randint1(6400) == 321))
2772 if (!p_ptr->resist_conf && !p_ptr->resist_chaos)
2775 p_ptr->redraw |= PR_EXTRA;
2777 msg_print("¤¤¤Ò¤¤¬¤â¡¼¤í¡¼¤È¤Ò¤Æ¤¤¿¤¤¬¤Õ¤ë...¥Ò¥Ã¥¯¡ª");
2779 msg_print("You feel a SSSCHtupor cOmINg over yOu... *HIC*!");
2784 if (!p_ptr->resist_conf)
2786 (void)set_confused(p_ptr->confused + randint0(20) + 15);
2789 if (!p_ptr->resist_chaos)
2794 if (one_in_(3)) lose_all_info();
2796 teleport_player(100);
2799 msg_print("¤¢¤Ê¤¿¤Ï¸«ÃΤé¤Ì¾ì½ê¤ÇÌܤ¬Àä᤿...Ƭ¤¬Äˤ¤¡£");
2800 msg_print("²¿¤â³Ð¤¨¤Æ¤¤¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ËÍ褿¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
2802 msg_print("You wake up somewhere with a sore head...");
2803 msg_print("You can't remember a thing, or how you got here!");
2812 msg_print("¤¡Á¤ì¤¤¤Ê¤Á¤ç¤ª¤Á¤ç¤é¤È¤ó¤ì¤¤¤ë¡Á");
2814 msg_print("Thishcischs GooDSChtuff!");
2817 (void)set_image(p_ptr->image + randint0(150) + 150);
2823 if ((p_ptr->muta2 & MUT2_HALLU) && (randint1(6400) == 42))
2825 if (!p_ptr->resist_chaos)
2828 p_ptr->redraw |= PR_EXTRA;
2829 (void)set_image(p_ptr->image + randint0(50) + 20);
2833 if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint1(3000) == 13))
2838 msg_print("¥Ö¥¥¡¼¡¼¥Ã¡ª¤ª¤Ã¤È¡£");
2840 msg_print("BRRAAAP! Oops.");
2844 fire_ball(GF_POIS, 0, p_ptr->lev, 3);
2847 if ((p_ptr->muta2 & MUT2_PROD_MANA) &&
2848 !p_ptr->anti_magic && one_in_(9000))
2853 msg_print("ËâË¡¤Î¥¨¥Í¥ë¥®¡¼¤¬ÆÍÁ³¤¢¤Ê¤¿¤ÎÃæ¤Ëή¤ì¹þ¤ó¤Ç¤¤¿¡ª¥¨¥Í¥ë¥®¡¼¤ò²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡ª");
2855 msg_print("Magical energy flows through you! You must release it!");
2860 (void)get_hack_dir(&dire);
2861 fire_ball(GF_MANA, dire, p_ptr->lev * 2, 3);
2864 if ((p_ptr->muta2 & MUT2_ATT_DEMON) &&
2865 !p_ptr->anti_magic && (randint1(6666) == 666))
2867 bool pet = one_in_(6);
2868 bool not_pet = (bool)(!pet);
2870 if (summon_specific((pet ? -1 : 0), py, px,
2871 dun_level, SUMMON_DEMON, TRUE, FALSE, pet, not_pet, not_pet))
2874 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤ò°ú¤´ó¤»¤¿¡ª");
2876 msg_print("You have attracted a demon!");
2883 if ((p_ptr->muta2 & MUT2_SPEED_FLUX) && one_in_(6000))
2889 msg_print("ÀºÎÏŪ¤Ç¤Ê¤¯¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2891 msg_print("You feel less energetic.");
2894 if (p_ptr->fast > 0)
2900 set_slow(randint1(30) + 10, FALSE);
2906 msg_print("ÀºÎÏŪ¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2908 msg_print("You feel more energetic.");
2911 if (p_ptr->slow > 0)
2917 set_fast(randint1(30) + 10, FALSE);
2922 if ((p_ptr->muta2 & MUT2_BANISH_ALL) && one_in_(9000))
2926 msg_print("ÆÍÁ³¤Û¤È¤ó¤É¸ÉÆȤˤʤ俵¤¤¬¤¹¤ë¡£");
2928 msg_print("You suddenly feel almost lonely.");
2931 banish_monsters(100);
2932 if (!dun_level && p_ptr->town_num)
2935 msg_print("Ź¤Î¼ç¿Í¤¬µÖ¤Ë¸þ¤«¤Ã¤ÆÁö¤Ã¤Æ¤¤¤ë¡ª");
2937 msg_print("You see one of the shopkeepers running for the hills!");
2940 store_shuffle(randint0(MAX_STORES));
2945 if ((p_ptr->muta2 & MUT2_EAT_LIGHT) && one_in_(3000))
2950 msg_print("±Æ¤Ë¤Ä¤Ä¤Þ¤ì¤¿¡£");
2952 msg_print("A shadow passes over you.");
2957 /* Absorb light from the current possition */
2958 if (cave[py][px].info & CAVE_GLOW)
2963 o_ptr = &inventory[INVEN_LITE];
2965 /* Absorb some fuel in the current lite */
2966 if (o_ptr->tval == TV_LITE)
2968 /* Use some fuel (except on artifacts) */
2969 if (!artifact_p(o_ptr) && (o_ptr->xtra4 > 0))
2971 /* Heal the player a bit */
2972 hp_player(o_ptr->xtra4 / 20);
2974 /* Decrease life-span of lite */
2978 msg_print("¸÷¸»¤«¤é¥¨¥Í¥ë¥®¡¼¤òµÛ¼ý¤·¤¿¡ª");
2980 msg_print("You absorb energy from your light!");
2984 /* Notice interesting fuel steps */
2985 notice_lite_change(o_ptr);
2990 * Unlite the area (radius 10) around player and
2991 * do 50 points damage to every affected monster
2993 unlite_area(50, 10);
2996 if ((p_ptr->muta2 & MUT2_ATT_ANIMAL) &&
2997 !p_ptr->anti_magic && one_in_(7000))
2999 bool pet = one_in_(3);
3000 bool not_pet = (bool)(!pet);
3002 if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_ANIMAL,
3003 TRUE, FALSE, pet, not_pet, not_pet))
3006 msg_print("ưʪ¤ò°ú¤´ó¤»¤¿¡ª");
3008 msg_print("You have attracted an animal!");
3015 if ((p_ptr->muta2 & MUT2_RAW_CHAOS) &&
3016 !p_ptr->anti_magic && one_in_(8000))
3020 msg_print("¼þ¤ê¤Î¶õ´Ö¤¬ÏĤó¤Ç¤¤¤ëµ¤¤¬¤¹¤ë¡ª");
3022 msg_print("You feel the world warping around you!");
3026 fire_ball(GF_CHAOS, 0, p_ptr->lev, 8);
3028 if ((p_ptr->muta2 & MUT2_NORMALITY) && one_in_(5000))
3030 if (!lose_mutation(0))
3032 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
3034 msg_print("You feel oddly normal.");
3038 if ((p_ptr->muta2 & MUT2_WRAITH) && !p_ptr->anti_magic && one_in_(3000))
3042 msg_print("Èóʪ¼Á²½¤·¤¿¡ª");
3044 msg_print("You feel insubstantial!");
3048 set_wraith_form(randint1(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE);
3050 if ((p_ptr->muta2 & MUT2_POLY_WOUND) && one_in_(3000))
3054 if ((p_ptr->muta2 & MUT2_WASTING) && one_in_(3000))
3056 int which_stat = randint0(6);
3057 int sustained = FALSE;
3062 if (p_ptr->sustain_str) sustained = TRUE;
3065 if (p_ptr->sustain_int) sustained = TRUE;
3068 if (p_ptr->sustain_wis) sustained = TRUE;
3071 if (p_ptr->sustain_dex) sustained = TRUE;
3074 if (p_ptr->sustain_con) sustained = TRUE;
3077 if (p_ptr->sustain_chr) sustained = TRUE;
3081 msg_print("ÉÔÀµ¤Ê¾õÂÖ¡ª");
3083 msg_print("Invalid stat chosen!");
3093 msg_print("¼«Ê¬¤¬¿ê¼å¤·¤Æ¤¤¤¯¤Î¤¬Ê¬¤«¤ë¡ª");
3095 msg_print("You can feel yourself wasting away!");
3099 (void)dec_stat(which_stat, randint1(6) + 6, one_in_(3));
3102 if ((p_ptr->muta2 & MUT2_ATT_DRAGON) &&
3103 !p_ptr->anti_magic && one_in_(3000))
3105 bool pet = one_in_(5);
3106 bool not_pet = (bool)(!pet);
3108 if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_DRAGON,
3109 TRUE, FALSE, pet, not_pet, not_pet))
3112 msg_print("¥É¥é¥´¥ó¤ò°ú¤´ó¤»¤¿¡ª");
3114 msg_print("You have attracted a dragon!");
3120 if ((p_ptr->muta2 & MUT2_WEIRD_MIND) && !p_ptr->anti_magic &&
3123 if (p_ptr->tim_esp > 0)
3126 msg_print("Àº¿À¤Ë¤â¤ä¤¬¤«¤«¤Ã¤¿¡ª");
3128 msg_print("Your mind feels cloudy!");
3131 set_tim_esp(0, TRUE);
3136 msg_print("Àº¿À¤¬¹¤¬¤Ã¤¿¡ª");
3138 msg_print("Your mind expands!");
3141 set_tim_esp(p_ptr->lev, FALSE);
3144 if ((p_ptr->muta2 & MUT2_NAUSEA) && !p_ptr->slow_digest &&
3149 msg_print("°ß¤¬áÛÚ»¤·¡¢¿©»ö¤ò¼º¤Ã¤¿¡ª");
3151 msg_print("Your stomach roils, and you lose your lunch!");
3155 set_food(PY_FOOD_WEAK);
3158 if ((p_ptr->muta2 & MUT2_WALK_SHAD) &&
3159 !p_ptr->anti_magic && one_in_(12000) && !p_ptr->inside_arena)
3164 if ((p_ptr->muta2 & MUT2_WARNING) && one_in_(1000))
3166 int danger_amount = 0;
3169 for (monster = 0; monster < m_max; monster++)
3171 monster_type *m_ptr = &m_list[monster];
3172 monster_race *r_ptr = &r_info[m_ptr->r_idx];
3174 /* Paranoia -- Skip dead monsters */
3175 if (!m_ptr->r_idx) continue;
3177 if (r_ptr->level >= p_ptr->lev)
3179 danger_amount += r_ptr->level - p_ptr->lev + 1;
3183 if (danger_amount > 100)
3185 msg_print("Èó¾ï¤Ë¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
3187 msg_print("You feel utterly terrified!");
3190 else if (danger_amount > 50)
3192 msg_print("¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
3194 msg_print("You feel terrified!");
3197 else if (danger_amount > 20)
3199 msg_print("Èó¾ï¤Ë¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
3201 msg_print("You feel very worried!");
3204 else if (danger_amount > 10)
3206 msg_print("¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
3208 msg_print("You feel paranoid!");
3211 else if (danger_amount > 5)
3213 msg_print("¤Û¤È¤ó¤É°ÂÁ´¤Êµ¤¤¬¤¹¤ë¡£");
3215 msg_print("You feel almost safe.");
3220 msg_print("¼ä¤·¤¤µ¤¤¬¤¹¤ë¡£");
3222 msg_print("You feel lonely.");
3226 if ((p_ptr->muta2 & MUT2_INVULN) && !p_ptr->anti_magic &&
3231 msg_print("̵Ũ¤Êµ¤¤¬¤¹¤ë¡ª");
3233 msg_print("You feel invincible!");
3237 (void)set_invuln(randint1(8) + 8, FALSE);
3239 if ((p_ptr->muta2 & MUT2_SP_TO_HP) && one_in_(2000))
3241 int wounds = p_ptr->mhp - p_ptr->chp;
3245 int healing = p_ptr->csp;
3247 if (healing > wounds)
3253 p_ptr->csp -= healing;
3256 if ((p_ptr->muta2 & MUT2_HP_TO_SP) && !p_ptr->anti_magic &&
3259 int wounds = p_ptr->msp - p_ptr->csp;
3263 int healing = p_ptr->chp;
3265 if (healing > wounds)
3270 p_ptr->csp += healing;
3272 take_hit(DAMAGE_LOSELIFE, healing, "Ƭ¤Ë¾º¤Ã¤¿·ì", -1);
3274 take_hit(DAMAGE_LOSELIFE, healing, "blood rushing to the head", -1);
3279 if ((p_ptr->muta2 & MUT2_DISARM) && one_in_(10000))
3285 msg_print("¤¬¤â¤Ä¤ì¤Æž¤ó¤À¡ª");
3286 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), "žÅÝ", -1);
3288 msg_print("You trip over your own feet!");
3289 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), "tripping", -1);
3294 if (buki_motteruka(INVEN_RARM))
3296 int slot = INVEN_RARM;
3297 o_ptr = &inventory[INVEN_RARM];
3298 if (buki_motteruka(INVEN_LARM) && one_in_(2))
3300 o_ptr = &inventory[INVEN_LARM];
3303 if (!cursed_p(o_ptr))
3306 msg_print("Éð´ï¤òÍ¤Æ¤·¤Þ¤Ã¤¿¡ª");
3308 msg_print("You drop your weapon!");
3311 inven_drop(slot, 1);
3318 /*** Process Inventory ***/
3320 if ((p_ptr->cursed & TRC_P_FLAG_MASK) && !p_ptr->wild_mode)
3323 * Hack: Uncursed teleporting items (e.g. Trump Weapons)
3324 * can actually be useful!
3326 if ((p_ptr->cursed & TRC_TELEPORT_SELF) && one_in_(100))
3329 if (get_check_strict("¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©", CHECK_OKAY_CANCEL))
3331 if (get_check_strict("Teleport? ", CHECK_OKAY_CANCEL))
3335 teleport_player(50);
3338 /* Make a chainsword noise */
3339 if ((p_ptr->cursed & TRC_CHAINSWORD) && one_in_(CHAINSWORD_NOISE))
3343 if (!get_rnd_line("chainswd_j.txt", 0, noise))
3345 if (!get_rnd_line("chainswd.txt", 0, noise))
3348 disturb(FALSE, FALSE);
3351 if ((p_ptr->cursed & TRC_TY_CURSE) && one_in_(TY_CURSE_CHANCE))
3354 (void)activate_ty_curse(FALSE, &count);
3356 /* Handle experience draining */
3357 if ((p_ptr->cursed & TRC_DRAIN_EXP) && one_in_(4))
3359 p_ptr->exp -= (p_ptr->lev+1)/2;
3360 if (p_ptr->exp < 0) p_ptr->exp = 0;
3361 p_ptr->max_exp -= (p_ptr->lev+1)/2;
3362 if (p_ptr->max_exp < 0) p_ptr->max_exp = 0;
3365 /* Add light curse (Later) */
3366 if ((p_ptr->cursed & TRC_ADD_L_CURSE) && one_in_(2000))
3371 o_ptr = choose_cursed_obj_name(TRC_ADD_L_CURSE);
3373 new_curse = get_curse(0, o_ptr);
3374 if (!(o_ptr->curse_flags & new_curse))
3376 char o_name[MAX_NLEN];
3378 object_desc(o_name, o_ptr, FALSE, 0);
3380 o_ptr->curse_flags |= new_curse;
3382 msg_format("°°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬%s¤ò¤È¤ê¤Þ¤¤¤¿...", o_name);
3384 msg_format("There is a malignant black aura surrounding %s...", o_name);
3387 o_ptr->feeling = FEEL_NONE;
3389 p_ptr->update |= (PU_BONUS);
3392 /* Add heavy curse (Later) */
3393 if ((p_ptr->cursed & TRC_ADD_H_CURSE) && one_in_(2000))
3398 o_ptr = choose_cursed_obj_name(TRC_ADD_H_CURSE);
3400 new_curse = get_curse(1, o_ptr);
3401 if (!(o_ptr->curse_flags & new_curse))
3403 char o_name[MAX_NLEN];
3405 object_desc(o_name, o_ptr, FALSE, 0);
3407 o_ptr->curse_flags |= new_curse;
3409 msg_format("°°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬%s¤ò¤È¤ê¤Þ¤¤¤¿...", o_name);
3411 msg_format("There is a malignant black aura surrounding %s...", o_name);
3414 o_ptr->feeling = FEEL_NONE;
3416 p_ptr->update |= (PU_BONUS);
3420 if ((p_ptr->cursed & TRC_CALL_ANIMAL) && one_in_(1500))
3422 if (summon_specific(0, py, px, dun_level, SUMMON_ANIMAL,
3423 TRUE, FALSE, FALSE, TRUE, TRUE))
3425 char o_name[MAX_NLEN];
3427 object_desc(o_name, choose_cursed_obj_name(TRC_CALL_ANIMAL), FALSE, 0);
3429 msg_format("%s¤¬Æ°Êª¤ò°ú¤´ó¤»¤¿¡ª", o_name);
3431 msg_format("%s have attracted an animal!", o_name);
3438 if ((p_ptr->cursed & TRC_CALL_DEMON) && one_in_(666))
3440 if (summon_specific(0, py, px, dun_level, SUMMON_DEMON,
3441 TRUE, FALSE, FALSE, TRUE, TRUE))
3443 char o_name[MAX_NLEN];
3445 object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DEMON), FALSE, 0);
3447 msg_format("%s¤¬°Ëâ¤ò°ú¤´ó¤»¤¿¡ª", o_name);
3449 msg_format("%s have attracted a demon!", o_name);
3456 if ((p_ptr->cursed & TRC_CALL_DRAGON) && one_in_(400))
3458 if (summon_specific(0, py, px, dun_level, SUMMON_DRAGON,
3459 TRUE, FALSE, FALSE, TRUE, TRUE))
3461 char o_name[MAX_NLEN];
3463 object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DRAGON), FALSE, 0);
3465 msg_format("%s¤¬¥É¥é¥´¥ó¤ò°ú¤´ó¤»¤¿¡ª", o_name);
3467 msg_format("%s have attracted an animal!", o_name);
3473 if ((p_ptr->cursed & TRC_COWARDICE) && one_in_(1500))
3475 if (!(p_ptr->resist_fear || p_ptr->hero || p_ptr->shero))
3479 msg_print("¤È¤Æ¤â°Å¤¤... ¤È¤Æ¤â¶²¤¤¡ª");
3481 msg_print("It's so dark... so scary!");
3484 set_afraid(p_ptr->afraid + 13 + randint1(26));
3487 /* Teleport player */
3488 if ((p_ptr->cursed & TRC_TELEPORT) && one_in_(100) && !p_ptr->anti_tele)
3492 /* Teleport player */
3493 teleport_player(40);
3495 /* Handle HP draining */
3496 if ((p_ptr->cursed & TRC_DRAIN_HP) && one_in_(666))
3498 char o_name[MAX_NLEN];
3500 object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_HP), FALSE, 0);
3502 msg_format("%s¤Ï¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª", o_name);
3504 msg_format("%s drains HP from you!", o_name);
3506 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev*2, 100), o_name, -1);
3508 /* Handle mana draining */
3509 if ((p_ptr->cursed & TRC_DRAIN_MANA) && one_in_(666))
3511 char o_name[MAX_NLEN];
3513 object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_MANA), FALSE, 0);
3515 msg_format("%s¤Ï¤¢¤Ê¤¿¤ÎËâÎϤòµÛ¼ý¤·¤¿¡ª", o_name);
3517 msg_format("%s drains mana from you!", o_name);
3519 p_ptr->csp -= MIN(p_ptr->lev, 50);
3523 p_ptr->csp_frac = 0;
3525 p_ptr->redraw |= PR_MANA;
3529 /* Rarely, take damage from the Jewel of Judgement */
3530 if (one_in_(999) && !p_ptr->anti_magic)
3532 if ((inventory[INVEN_LITE].tval) &&
3533 (inventory[INVEN_LITE].sval == SV_LITE_THRAIN))
3536 msg_print("¡Ø¿³È½¤ÎÊõÀС٤Ϥ¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª");
3537 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "¿³È½¤ÎÊõÀÐ", -1);
3539 msg_print("The Jewel of Judgement drains life from you!");
3540 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "the Jewel of Judgement", -1);
3547 /* Process equipment */
3548 for (j = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
3550 /* Get the object */
3551 o_ptr = &inventory[i];
3553 /* Skip non-objects */
3554 if (!o_ptr->k_idx) continue;
3556 /* Recharge activatable objects */
3557 if (o_ptr->timeout > 0)
3562 /* Notice changes */
3563 if (!o_ptr->timeout)
3565 recharged_notice(o_ptr);
3571 /* Notice changes */
3575 p_ptr->window |= (PW_EQUIP);
3580 * Recharge rods. Rods now use timeout to control charging status,
3581 * and each charging rod in a stack decreases the stack's timeout by
3582 * one per turn. -LM-
3584 for (j = 0, i = 0; i < INVEN_PACK; i++)
3586 o_ptr = &inventory[i];
3587 k_ptr = &k_info[o_ptr->k_idx];
3589 /* Skip non-objects */
3590 if (!o_ptr->k_idx) continue;
3592 /* Examine all charging rods or stacks of charging rods. */
3593 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
3595 /* Determine how many rods are charging. */
3596 temp = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
3597 if (temp > o_ptr->number) temp = o_ptr->number;
3599 /* Decrease timeout by that number. */
3600 o_ptr->timeout -= temp;
3602 /* Boundary control. */
3603 if (o_ptr->timeout < 0) o_ptr->timeout = 0;
3605 /* Notice changes, provide message if object is inscribed. */
3606 if (!(o_ptr->timeout))
3608 recharged_notice(o_ptr);
3614 /* Notice changes */
3618 p_ptr->notice |= (PN_COMBINE);
3621 p_ptr->window |= (PW_INVEN);
3625 /* Feel the inventory */
3630 /*** Process Objects ***/
3632 /* Process objects */
3633 for (i = 1; i < o_max; i++)
3638 /* Skip dead objects */
3639 if (!o_ptr->k_idx) continue;
3641 /* Recharge rods on the ground. No messages. */
3642 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
3645 o_ptr->timeout -= o_ptr->number;
3647 /* Boundary control. */
3648 if (o_ptr->timeout < 0) o_ptr->timeout = 0;
3653 /*** Involuntary Movement ***/
3655 /* Delayed Word-of-Recall */
3656 if (p_ptr->word_recall)
3659 * HACK: Autosave BEFORE resetting the recall counter (rr9)
3660 * The player is yanked up/down as soon as
3661 * he loads the autosaved game.
3663 if (autosave_l && (p_ptr->word_recall == 1) && !p_ptr->inside_battle)
3664 do_cmd_save_game(TRUE);
3666 /* Count down towards recall */
3667 p_ptr->word_recall--;
3669 p_ptr->redraw |= (PR_STATUS);
3671 /* Activate the recall */
3672 if (!p_ptr->word_recall)
3677 /* Determine the level */
3678 if (dun_level || p_ptr->inside_quest)
3681 msg_print("¾å¤Ë°ú¤ÃÄ¥¤ê¤¢¤²¤é¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
3683 msg_print("You feel yourself yanked upwards!");
3686 p_ptr->recall_dungeon = dungeon_type;
3688 do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
3693 leave_quest_check();
3695 p_ptr->inside_quest = 0;
3696 p_ptr->leaving = TRUE;
3701 msg_print("²¼¤Ë°ú¤¤º¤ê¹ß¤í¤µ¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
3703 msg_print("You feel yourself yanked downwards!");
3706 dungeon_type = p_ptr->recall_dungeon;
3709 do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
3712 dun_level = max_dlv[dungeon_type];
3713 if (dun_level < 1) dun_level = 1;
3715 /* Nightmare mode makes recall more dangerous */
3716 if (ironman_nightmare && !randint0(666) && (dungeon_type == DUNGEON_ANGBAND))
3722 else if (dun_level < 99)
3724 dun_level = (dun_level + 99) / 2;
3726 else if (dun_level > 100)
3728 dun_level = d_info[dungeon_type].maxdepth - 1;
3732 if (p_ptr->wild_mode)
3734 p_ptr->wilderness_y = py;
3735 p_ptr->wilderness_x = px;
3739 /* Save player position */
3743 p_ptr->wild_mode = FALSE;
3746 p_ptr->leaving = TRUE;
3748 if (dungeon_type == DUNGEON_ANGBAND)
3750 for (i = MIN_RANDOM_QUEST; i < MAX_RANDOM_QUEST + 1; i++)
3752 if ((quest[i].type == QUEST_TYPE_RANDOM) &&
3753 (quest[i].status == QUEST_STATUS_TAKEN) &&
3754 (quest[i].level < dun_level))
3756 quest[i].status = QUEST_STATUS_FAILED;
3757 quest[i].complev = (byte)p_ptr->lev;
3758 r_info[quest[i].r_idx].flags1 &= ~(RF1_QUESTOR);
3765 sound(SOUND_TPLEVEL);
3773 * Verify use of "wizard" mode
3775 static bool enter_wizard_mode(void)
3777 /* Ask first time */
3780 /* Mention effects */
3782 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥â¡¼¥É¤Ç¤¹¡£ ");
3783 msg_print("°ìÅÙ¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ë¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3785 msg_print("Wizard mode is for debugging and experimenting.");
3786 msg_print("The game will not be scored if you enter wizard mode.");
3791 /* Verify request */
3793 if (!get_check("ËÜÅö¤Ë¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ê¤¿¤¤¤Î¤Ç¤¹¤«? "))
3795 if (!get_check("Are you sure you want to enter wizard mode? "))
3814 * Verify use of "debug" commands
3816 static bool enter_debug_mode(void)
3818 /* Ask first time */
3821 /* Mention effects */
3823 msg_print("¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ ");
3824 msg_print("¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3826 msg_print("The debug commands are for debugging and experimenting.");
3827 msg_print("The game will not be scored if you use debug commands.");
3832 /* Verify request */
3834 if (!get_check("ËÜÅö¤Ë¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? "))
3836 if (!get_check("Are you sure you want to use debug commands? "))
3844 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥Ç¥Ð¥Ã¥°¥â¡¼¥É¤ËÆÍÆþ¤·¤Æ¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
3846 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use debug commands.");
3857 * Hack -- Declare the Debug Routines
3859 extern void do_cmd_debug(void);
3861 #endif /* ALLOW_WIZARD */
3867 * Verify use of "borg" commands
3869 static bool enter_borg_mode(void)
3871 /* Ask first time */
3872 if (!(noscore & 0x0010))
3874 /* Mention effects */
3876 msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ ");
3877 msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3879 msg_print("The borg commands are for debugging and experimenting.");
3880 msg_print("The game will not be scored if you use borg commands.");
3885 /* Verify request */
3887 if (!get_check("ËÜÅö¤Ë¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? "))
3889 if (!get_check("Are you sure you want to use borg commands? "))
3905 * Hack -- Declare the Ben Borg
3907 extern void do_cmd_borg(void);
3909 #endif /* ALLOW_BORG */
3914 * Parse and execute the current command
3915 * Give "Warning" on illegal commands.
3917 * XXX XXX XXX Make some "blocks"
3919 static void process_command(void)
3921 int old_now_message = now_message;
3923 #ifdef ALLOW_REPEAT /* TNB */
3925 /* Handle repeating the last command */
3928 #endif /* ALLOW_REPEAT -- TNB */
3932 /* Parse the command */
3933 switch (command_cmd)
3949 /*** Wizard Commands ***/
3951 /* Toggle Wizard Mode */
3958 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É²ò½ü¡£");
3960 msg_print("Wizard mode off.");
3964 else if (enter_wizard_mode())
3968 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥ÉÆÍÆþ¡£");
3970 msg_print("Wizard mode on.");
3975 /* Update monsters */
3976 p_ptr->update |= (PU_MONSTERS);
3978 /* Redraw "title" */
3979 p_ptr->redraw |= (PR_TITLE);
3987 /* Special "debug" commands */
3990 /* Enter debug mode */
3991 if (enter_debug_mode())
3998 #endif /* ALLOW_WIZARD */
4003 /* Special "borg" commands */
4006 /* Enter borg mode */
4007 if (enter_borg_mode())
4009 if (!p_ptr->wild_mode) do_cmd_borg();
4015 #endif /* ALLOW_BORG */
4019 /*** Inventory Commands ***/
4021 /* Wear/wield equipment */
4024 if (!p_ptr->wild_mode) do_cmd_wield();
4028 /* Take off equipment */
4031 if (!p_ptr->wild_mode) do_cmd_takeoff();
4038 if (!p_ptr->wild_mode) do_cmd_drop();
4042 /* Destroy an item */
4049 /* Equipment list */
4056 /* Inventory list */
4064 /*** Various commands ***/
4066 /* Identify an object */
4073 /* Hack -- toggle windows */
4076 toggle_inven_equip();
4081 /*** Standard "Movement" Commands ***/
4086 if (!p_ptr->wild_mode) do_cmd_alter();
4093 if (!p_ptr->wild_mode) do_cmd_tunnel();
4097 /* Move (usually pick up things) */
4100 #ifdef ALLOW_EASY_DISARM /* TNB */
4104 #else /* ALLOW_EASY_DISARM -- TNB */
4106 do_cmd_walk(always_pickup);
4108 #endif /* ALLOW_EASY_DISARM -- TNB */
4113 /* Move (usually do not pick up) */
4116 #ifdef ALLOW_EASY_DISARM /* TNB */
4120 #else /* ALLOW_EASY_DISARM -- TNB */
4122 do_cmd_walk(!always_pickup);
4124 #endif /* ALLOW_EASY_DISARM -- TNB */
4130 /*** Running, Resting, Searching, Staying */
4132 /* Begin Running -- Arg is Max Distance */
4135 if (!p_ptr->wild_mode) do_cmd_run();
4139 /* Stay still (usually pick things up) */
4142 do_cmd_stay(always_pickup);
4146 /* Stay still (usually do not pick up) */
4149 do_cmd_stay(!always_pickup);
4153 /* Rest -- Arg is time */
4160 /* Search for traps/doors */
4167 /* Toggle search mode */
4170 if (p_ptr->action == ACTION_SEARCH) set_action(ACTION_NONE);
4171 else set_action(ACTION_SEARCH);
4176 /*** Stairs and Doors and Chests and Traps ***/
4181 if (!p_ptr->wild_mode) do_cmd_store();
4185 /* Enter building -KMW- */
4188 if (!p_ptr->wild_mode) do_cmd_bldg();
4192 /* Enter quest level -KMW- */
4195 if (!p_ptr->wild_mode) do_cmd_quest();
4199 /* Go up staircase */
4202 if(!p_ptr->wild_mode && !dun_level && !p_ptr->inside_arena && !p_ptr->inside_quest)
4209 msg_print("½±·â¤«¤éƨ¤²¤ë¤Ë¤Ï¥Þ¥Ã¥×¤Îü¤Þ¤Ç°ÜÆ°¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£");
4211 msg_print("To flee the ambush you have to reach the edge of the map.");
4214 else if (p_ptr->food < PY_FOOD_WEAK)
4217 msg_print("¤½¤ÎÁ°¤Ë¿©»ö¤ò¤È¤é¤Ê¤¤¤È¡£");
4219 msg_print("You must eat something here.");
4224 if (change_wild_mode())
4237 /* Go down staircase */
4240 if(!p_ptr->wild_mode) do_cmd_go_down();
4243 p_ptr->wilderness_x = px;
4244 p_ptr->wilderness_y = py;
4250 /* Open a door or chest */
4253 if (!p_ptr->wild_mode) do_cmd_open();
4260 if (!p_ptr->wild_mode) do_cmd_close();
4264 /* Jam a door with spikes */
4267 if (!p_ptr->wild_mode) do_cmd_spike();
4274 if (!p_ptr->wild_mode) do_cmd_bash();
4278 /* Disarm a trap or chest */
4281 if (!p_ptr->wild_mode) do_cmd_disarm();
4286 /*** Magic and Prayers ***/
4288 /* Gain new spells/prayers */
4291 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4293 msg_print("¼öʸ¤ò³Ø½¬¤¹¤ëɬÍפϤʤ¤¡ª");
4295 msg_print("You don't have to learn spells!");
4297 else if (p_ptr->pclass == CLASS_SAMURAI)
4298 do_cmd_gain_hissatsu();
4299 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4309 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
4310 (p_ptr->pclass == CLASS_BERSERKER) ||
4311 (p_ptr->pclass == CLASS_NINJA) ||
4312 (p_ptr->pclass == CLASS_MIRROR_MASTER)
4313 ) do_cmd_mind_browse();
4314 else if (p_ptr->pclass == CLASS_SMITH)
4316 else do_cmd_browse();
4324 if (!p_ptr->wild_mode)
4326 if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_ARCHER) || (p_ptr->pclass == CLASS_CAVALRY))
4329 msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4331 msg_print("You cannot cast spells!");
4334 else if (dun_level && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
4337 msg_print("¥À¥ó¥¸¥ç¥ó¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4339 msg_print("The arena absorbs all attempted magic!");
4343 else if (p_ptr->anti_magic && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
4347 cptr which_power = "ËâË¡";
4349 cptr which_power = "magic";
4351 if (p_ptr->pclass == CLASS_MINDCRAFTER)
4353 which_power = "ĶǽÎÏ";
4355 which_power = "psionic powers";
4357 else if (p_ptr->pclass == CLASS_IMITATOR)
4359 which_power = "¤â¤Î¤Þ¤Í";
4361 which_power = "imitation";
4363 else if (p_ptr->pclass == CLASS_SAMURAI)
4365 which_power = "ɬ»¦·õ";
4367 which_power = "hissatsu";
4369 else if (p_ptr->pclass == CLASS_MIRROR_MASTER)
4371 which_power = "¶ÀËâË¡";
4373 which_power = "mirror magic";
4375 else if (p_ptr->pclass == CLASS_NINJA)
4377 which_power = "Ǧ½Ñ";
4379 which_power = "ninjutsu";
4381 else if (mp_ptr->spell_book == TV_LIFE_BOOK)
4383 which_power = "µ§¤ê";
4385 which_power = "prayer";
4389 msg_format("È¿ËâË¡¥Ð¥ê¥¢¤¬%s¤ò¼ÙË⤷¤¿¡ª", which_power);
4391 msg_format("An anti-magic shell disrupts your %s!", which_power);
4395 else if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER))
4398 msg_format("¶¸Àï»Î²½¤·¤Æ¤¤¤ÆƬ¤¬²ó¤é¤Ê¤¤¡ª");
4400 msg_format("You cannot think directly!");
4406 if ((p_ptr->pclass == CLASS_MINDCRAFTER) ||
4407 (p_ptr->pclass == CLASS_BERSERKER) ||
4408 (p_ptr->pclass == CLASS_NINJA) ||
4409 (p_ptr->pclass == CLASS_MIRROR_MASTER)
4412 else if (p_ptr->pclass == CLASS_IMITATOR)
4414 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4415 do_cmd_magic_eater();
4416 else if (p_ptr->pclass == CLASS_SAMURAI)
4418 else if (p_ptr->pclass == CLASS_BLUE_MAGE)
4419 do_cmd_cast_learned();
4420 else if (p_ptr->pclass == CLASS_SMITH)
4429 /* Issue a pet command */
4432 if (!p_ptr->wild_mode) do_cmd_pet();
4436 /*** Use various objects ***/
4438 /* Inscribe an object */
4445 /* Uninscribe an object */
4448 do_cmd_uninscribe();
4452 /* Activate an artifact */
4455 if (!p_ptr->wild_mode)
4457 if (!p_ptr->inside_arena)
4462 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4464 msg_print("The arena absorbs all attempted magic!");
4480 /* Fuel your lantern/torch */
4490 if (!p_ptr->wild_mode) do_cmd_fire();
4497 if (!p_ptr->wild_mode)
4499 if (!p_ptr->inside_arena)
4504 msg_print("¥¢¥ê¡¼¥Ê¤Ç¤Ï¥¢¥¤¥Æ¥à¤ò»È¤¨¤Ê¤¤¡ª");
4506 msg_print("You're in the arena now. This is hand-to-hand!");
4518 if (!p_ptr->wild_mode)
4520 if (!p_ptr->inside_arena)
4525 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4527 msg_print("The arena absorbs all attempted magic!");
4539 if (!p_ptr->wild_mode)
4541 if (p_ptr->inside_arena)
4544 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4546 msg_print("The arena absorbs all attempted magic!");
4551 else if (use_command && rogue_like_commands)
4563 /* Quaff a potion */
4566 if (!p_ptr->wild_mode)
4568 if (!p_ptr->inside_arena)
4569 do_cmd_quaff_potion();
4573 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4575 msg_print("The arena absorbs all attempted magic!");
4587 if (!p_ptr->wild_mode)
4589 if (!p_ptr->inside_arena)
4590 do_cmd_read_scroll();
4594 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4596 msg_print("The arena absorbs all attempted magic!");
4608 if (!p_ptr->wild_mode)
4610 if (p_ptr->inside_arena)
4613 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4615 msg_print("The arena absorbs all attempted magic!");
4620 else if (use_command && !rogue_like_commands)
4630 /* Use racial power */
4633 if (!p_ptr->wild_mode) do_cmd_racial_power();
4638 /*** Looking at Things (nearby or on map) ***/
4640 /* Full dungeon map */
4647 /* Locate player on map */
4661 /* Target monster or location */
4664 if (!p_ptr->wild_mode) do_cmd_target();
4670 /*** Help and Such ***/
4679 /* Identify symbol */
4682 do_cmd_query_symbol();
4686 /* Character description */
4689 do_cmd_change_name();
4694 /*** System Commands ***/
4696 /* Hack -- User interface */
4703 /* Single line from a pref file */
4718 do_cmd_edit_autopick();
4722 /* Interact with macros */
4729 /* Interact with visuals */
4737 /* Interact with colors */
4745 /* Interact with options */
4753 /*** Misc Commands ***/
4769 /* Repeat level feeling */
4772 if (!p_ptr->wild_mode) do_cmd_feeling();
4776 /* Show previous message */
4779 do_cmd_message_one();
4783 /* Show previous messages */
4786 do_cmd_messages(old_now_message);
4790 /* Show quest status -KMW- */
4793 do_cmd_checkquest();
4797 /* Redraw the screen */
4800 now_message = old_now_message;
4805 #ifndef VERIFY_SAVEFILE
4807 /* Hack -- Save and don't quit */
4810 do_cmd_save_game(FALSE);
4814 #endif /* VERIFY_SAVEFILE */
4825 do_cmd_save_and_exit();
4829 /* Quit (commit suicide) */
4842 /* Check artifacts, uniques, objects */
4849 /* Load "screen dump" */
4852 do_cmd_load_screen();
4856 /* Save "screen dump" */
4859 do_cmd_save_screen();
4863 /* Make random artifact list */
4866 spoil_random_artifact("randifact.txt");
4870 /* Hack -- Unknown command */
4873 if (flush_failure) flush();
4877 sound(SOUND_ILLEGAL);
4879 if (!get_rnd_line("error_j.txt", 0, error_m))
4881 if (!get_rnd_line("error.txt", 0, error_m))
4888 prt(" '?' ¤Ç¥Ø¥ë¥×¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£", 0, 0);
4890 prt("Type '?' for help.", 0, 0);
4896 if (!energy_use && !now_message)
4897 now_message = old_now_message;
4903 bool monster_tsuri(int r_idx)
4905 monster_race *r_ptr = &r_info[r_idx];
4907 if ((r_ptr->flags7 & RF7_AQUATIC) && !(r_ptr->flags1 & RF1_UNIQUE) && strchr("Jjlw", r_ptr->d_char))
4915 * Process the player
4917 * Notice the annoying code to handle "pack overflow", which
4918 * must come first just in case somebody manages to corrupt
4919 * the savefiles by clever use of menu commands or something.
4921 static void process_player(void)
4925 /*** Apply energy ***/
4930 msg_print("²¿¤«ÊѤï¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
4932 msg_print("You feel different!");
4935 (void)gain_random_mutation(0);
4936 hack_mutation = FALSE;
4939 if (p_ptr->inside_battle)
4941 for(i = 1; i < m_max; i++)
4943 monster_type *m_ptr = &m_list[i];
4945 if (!m_ptr->r_idx) continue;
4947 /* Hack -- Detect monster */
4948 m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
4950 /* Update the monster */
4951 update_mon(i, FALSE);
4956 /* Give the player some energy */
4957 else if((randint0(60) < ((p_ptr->pspeed > 199) ? 49 : ((p_ptr->pspeed < 0) ? 1 : extract_energy[p_ptr->pspeed]))) && !(load && p_ptr->energy >= 100))
4958 p_ptr->energy += gain_energy();
4961 if (p_ptr->energy < 100) return;
4962 if (!command_rep) prt_time();
4964 /*** Check for interupts ***/
4966 /* Complete resting */
4973 if ((p_ptr->chp == p_ptr->mhp) &&
4974 (p_ptr->csp >= p_ptr->msp))
4976 set_action(ACTION_NONE);
4980 /* Complete resting */
4981 else if (resting == -2)
4984 if ((p_ptr->chp == p_ptr->mhp) &&
4985 (p_ptr->csp >= p_ptr->msp) &&
4986 !p_ptr->blind && !p_ptr->confused &&
4987 !p_ptr->poisoned && !p_ptr->afraid &&
4988 !p_ptr->stun && !p_ptr->cut &&
4989 !p_ptr->slow && !p_ptr->paralyzed &&
4990 !p_ptr->image && !p_ptr->word_recall)
4992 set_action(ACTION_NONE);
4997 if (p_ptr->action == ACTION_FISH)
5000 Term_xtra(TERM_XTRA_DELAY, 10);
5004 bool success = FALSE;
5005 get_mon_num_prep(monster_tsuri,NULL);
5006 r_idx = get_mon_num(dun_level ? dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level);
5008 if (r_idx && one_in_(2))
5011 y = py+ddy[tsuri_dir];
5012 x = px+ddx[tsuri_dir];
5013 if (place_monster_aux(y, x, r_idx, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE))
5016 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
5018 msg_format("%s¤¬Äà¤ì¤¿¡ª", m_name);
5020 msg_format("You have a good catch!", m_name);
5028 msg_print("±Â¤À¤±¿©¤ï¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª¤¯¤Ã¤½¡Á¡ª");
5030 msg_print("Damn! The fish took a bait away!");
5037 /* Handle "abort" */
5040 /* Check for "player abort" (semi-efficiently for resting) */
5041 if (running || command_rep || (p_ptr->action == ACTION_REST) || (p_ptr->action == ACTION_FISH))
5046 /* Check for a key */
5055 /* Hack -- Show a Message */
5057 msg_print("ÃæÃǤ·¤Þ¤·¤¿¡£");
5059 msg_print("Canceled.");
5066 if (p_ptr->riding && !p_ptr->confused && !p_ptr->blind)
5068 monster_type *m_ptr = &m_list[p_ptr->riding];
5077 /* Acquire the monster name */
5078 monster_desc(m_name, m_ptr, 0);
5080 msg_format("%^s¤òµ¯¤³¤·¤¿¡£", m_name);
5082 msg_format("You have waked %s up.", m_name);
5084 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5085 p_ptr->redraw |= (PR_UHEALTH);
5092 /* Make a "saving throw" against stun */
5093 if (randint0(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
5099 /* Hack -- Recover from stun */
5100 if (m_ptr->stunned > d)
5102 /* Recover somewhat */
5103 m_ptr->stunned -= d;
5114 /* Acquire the monster name */
5115 monster_desc(m_name, m_ptr, 0);
5117 /* Dump a message */
5119 msg_format("%^s¤òÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5121 msg_format("%^s is no longer stunned.", m_name);
5123 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5124 p_ptr->redraw |= (PR_UHEALTH);
5128 if (m_ptr->confused)
5132 /* Make a "saving throw" against stun */
5133 if (randint0(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
5136 d = m_ptr->confused;
5139 /* Hack -- Recover from stun */
5140 if (m_ptr->confused > d)
5142 /* Recover somewhat */
5143 m_ptr->confused -= d;
5152 m_ptr->confused = 0;
5154 /* Acquire the monster name */
5155 monster_desc(m_name, m_ptr, 0);
5157 /* Dump a message */
5159 msg_format("%^s¤òº®Íð¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5161 msg_format("%^s is no longer confused.", m_name);
5163 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5164 p_ptr->redraw |= (PR_UHEALTH);
5172 /* Make a "saving throw" against stun */
5173 if (randint0(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
5179 /* Hack -- Recover from stun */
5180 if (m_ptr->monfear > d)
5182 /* Recover somewhat */
5183 m_ptr->monfear -= d;
5194 /* Acquire the monster name */
5195 monster_desc(m_name, m_ptr, 0);
5197 /* Dump a message */
5199 msg_format("%^s¤ò¶²Éݤ«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5201 msg_format("%^s is no longer fear.", m_name);
5203 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5204 p_ptr->redraw |= (PR_UHEALTH);
5211 /* Handle the player song */
5212 if (!load) check_music();
5217 if (p_ptr->lightspeed)
5219 (void)set_lightspeed(p_ptr->lightspeed - 1, TRUE);
5221 if ((p_ptr->pclass == CLASS_FORCETRAINER) && (p_ptr->magic_num1[0]))
5223 if (p_ptr->magic_num1[0] < 40)
5225 p_ptr->magic_num1[0] = 0;
5227 else p_ptr->magic_num1[0] -= 40;
5228 p_ptr->update |= (PU_BONUS);
5230 if (p_ptr->action == ACTION_LEARN)
5232 int hoge = ((p_ptr->msp * 0x10000L) / 256L)+7680L;
5233 if ((p_ptr->csp * 0x10000L + p_ptr->csp_frac) < hoge)
5236 p_ptr->csp_frac = 0;
5237 set_action(ACTION_NONE);
5241 p_ptr->csp -= (s16b)(hoge >> 16);
5243 if (p_ptr->csp_frac < hoge)
5245 p_ptr->csp_frac += 0x10000L - hoge;
5249 p_ptr->csp_frac -= hoge;
5251 p_ptr->redraw |= PR_MANA;
5254 if (p_ptr->special_defense & KATA_MASK)
5256 if (p_ptr->special_defense & KATA_MUSOU)
5260 set_action(ACTION_NONE);
5265 p_ptr->redraw |= (PR_MANA);
5270 /*** Handle actual user input ***/
5272 /* Repeat until out of energy */
5273 while (p_ptr->energy >= 100)
5275 p_ptr->window |= PW_PLAYER;
5276 p_ptr->sutemi = FALSE;
5277 p_ptr->counter = FALSE;
5278 now_damaged = FALSE;
5280 /* Notice stuff (if needed) */
5281 if (p_ptr->notice) notice_stuff();
5283 /* Update stuff (if needed) */
5284 if (p_ptr->update) update_stuff();
5286 /* Redraw stuff (if needed) */
5287 if (p_ptr->redraw) redraw_stuff();
5289 /* Redraw stuff (if needed) */
5290 if (p_ptr->window) window_stuff();
5293 /* Place the cursor on the player */
5294 move_cursor_relative(py, px);
5296 /* Refresh (optional) */
5297 if (fresh_before) Term_fresh();
5300 /* Hack -- Pack Overflow */
5301 if (inventory[INVEN_PACK].k_idx)
5303 int item = INVEN_PACK;
5305 char o_name[MAX_NLEN];
5309 /* Access the slot to be dropped */
5310 o_ptr = &inventory[item];
5317 msg_print("¥¶¥Ã¥¯¤«¤é¥¢¥¤¥Æ¥à¤¬¤¢¤Õ¤ì¤¿¡ª");
5319 msg_print("Your pack overflows!");
5324 object_desc(o_name, o_ptr, TRUE, 3);
5328 msg_format("%s(%c)¤òÍî¤È¤·¤¿¡£", o_name, index_to_label(item));
5330 msg_format("You drop %s (%c).", o_name, index_to_label(item));
5334 /* Drop it (carefully) near the player */
5335 (void)drop_near(o_ptr, 0, py, px);
5337 /* Modify, Describe, Optimize */
5338 inven_item_increase(item, -255);
5339 inven_item_describe(item);
5340 inven_item_optimize(item);
5342 /* Notice stuff (if needed) */
5343 if (p_ptr->notice) notice_stuff();
5345 /* Update stuff (if needed) */
5346 if (p_ptr->update) update_stuff();
5348 /* Redraw stuff (if needed) */
5349 if (p_ptr->redraw) redraw_stuff();
5351 /* Redraw stuff (if needed) */
5352 if (p_ptr->window) window_stuff();
5356 /* Hack -- cancel "lurking browse mode" */
5357 if (!command_new) command_see = FALSE;
5360 /* Assume free turn */
5364 if (p_ptr->inside_battle)
5366 /* Place the cursor on the player */
5367 move_cursor_relative(py, px);
5371 /* Process the command */
5375 /* Paralyzed or Knocked Out */
5376 else if (p_ptr->paralyzed || (p_ptr->stun >= 100))
5383 else if (p_ptr->action == ACTION_REST)
5388 /* Reduce rest count */
5391 if (!resting) set_action(ACTION_NONE);
5393 /* Redraw the state */
5394 p_ptr->redraw |= (PR_STATE);
5402 else if (p_ptr->action == ACTION_FISH)
5415 /* Repeated command */
5416 else if (command_rep)
5418 /* Count this execution */
5421 /* Redraw the state */
5422 p_ptr->redraw |= (PR_STATE);
5427 /* Hack -- Assume messages were seen */
5430 /* Clear the top line */
5433 /* Process the command */
5437 /* Normal command */
5440 /* Place the cursor on the player */
5441 move_cursor_relative(py, px);
5444 /* Get a command (normal) */
5445 request_command(FALSE);
5448 /* Process the command */
5458 /* Use some energy */
5459 p_ptr->energy -= energy_use;
5462 /* Hack -- constant hallucination */
5463 if (p_ptr->image) p_ptr->redraw |= (PR_MAP);
5466 /* Shimmer monsters if needed */
5467 if (shimmer_monsters)
5469 /* Clear the flag */
5470 shimmer_monsters = FALSE;
5472 /* Shimmer multi-hued monsters */
5473 for (i = 1; i < m_max; i++)
5475 monster_type *m_ptr;
5476 monster_race *r_ptr;
5478 /* Access monster */
5481 /* Skip dead monsters */
5482 if (!m_ptr->r_idx) continue;
5484 /* Access the monster race */
5485 r_ptr = &r_info[m_ptr->r_idx];
5487 /* Skip non-multi-hued monsters */
5488 if (!(r_ptr->flags1 & RF1_ATTR_MULTI)) continue;
5490 /* Reset the flag */
5491 shimmer_monsters = TRUE;
5493 /* Redraw regardless */
5494 lite_spot(m_ptr->fy, m_ptr->fx);
5499 /* Handle monster detection */
5500 if (repair_monsters)
5502 /* Reset the flag */
5503 repair_monsters = FALSE;
5505 /* Rotate detection flags */
5506 for (i = 1; i < m_max; i++)
5508 monster_type *m_ptr;
5510 /* Access monster */
5513 /* Skip dead monsters */
5514 if (!m_ptr->r_idx) continue;
5516 /* Nice monsters get mean */
5517 if (m_ptr->mflag & MFLAG_NICE)
5519 /* Nice monsters get mean */
5520 m_ptr->mflag &= ~(MFLAG_NICE);
5523 /* Handle memorized monsters */
5524 if (m_ptr->mflag & MFLAG_MARK)
5526 /* Maintain detection */
5527 if (m_ptr->mflag & MFLAG_SHOW)
5530 m_ptr->mflag &= ~(MFLAG_SHOW);
5532 /* Still need repairs */
5533 repair_monsters = TRUE;
5536 /* Remove detection */
5540 m_ptr->mflag &= ~(MFLAG_MARK);
5542 /* Assume invisible */
5545 /* Update the monster */
5546 update_mon(i, FALSE);
5548 if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH);
5549 if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH);
5551 /* Redraw regardless */
5552 lite_spot(m_ptr->fy, m_ptr->fx);
5557 if (p_ptr->pclass == CLASS_IMITATOR)
5559 if (mane_num > (p_ptr->lev > 44 ? 3 : p_ptr->lev > 29 ? 2 : 1))
5562 for (i = 0; i < mane_num; i++)
5564 mane_spell[i] = mane_spell[i+1];
5565 mane_dam[i] = mane_dam[i+1];
5569 p_ptr->redraw |= (PR_MANE);
5571 if (p_ptr->action == ACTION_LEARN)
5574 p_ptr->redraw |= (PR_STATE);
5577 if (world_player && (p_ptr->energy < 1000))
5580 p_ptr->redraw |= (PR_MAP);
5582 /* Update monsters */
5583 p_ptr->update |= (PU_MONSTERS);
5586 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5589 msg_print("¡Ö»þ¤ÏÆ°¤¤À¤¹¡Ä¡×");
5591 msg_print("You feel time flowing around you once more.");
5594 world_player = FALSE;
5601 /* Hack -- notice death */
5602 if (!alive || death)
5604 world_player = FALSE;
5608 /* Handle "leaving" */
5609 if (p_ptr->leaving) break;
5612 /* Update scent trail */
5618 * Interact with the current dungeon level.
5620 * This function will not exit until the level is completed,
5621 * the user dies, or the game is terminated.
5623 static void dungeon(bool load_game)
5625 int quest_num = 0, i, num;
5627 /* Set the base level */
5628 base_level = dun_level;
5630 /* Reset various flags */
5634 p_ptr->leaving = FALSE;
5636 /* Reset the "command" vars */
5644 /* Cancel the target */
5648 ambush_flag = FALSE;
5650 /* Cancel the health bar */
5653 /* Check visual effects */
5654 shimmer_monsters = TRUE;
5655 shimmer_objects = TRUE;
5656 repair_monsters = TRUE;
5657 repair_objects = TRUE;
5663 /* Get index of current quest (if any) */
5664 quest_num = quest_number(dun_level);
5666 /* Inside a quest? */
5669 /* Mark the quest monster */
5670 r_info[quest[quest_num].r_idx].flags1 |= RF1_QUESTOR;
5673 /* Track maximum player level */
5674 if (p_ptr->max_plv < p_ptr->lev)
5676 p_ptr->max_plv = p_ptr->lev;
5680 /* Track maximum dungeon level (if not in quest -KMW-) */
5681 if ((max_dlv[dungeon_type] < dun_level) && !p_ptr->inside_quest)
5683 max_dlv[dungeon_type] = dun_level;
5684 if (record_maxdeapth) do_cmd_write_nikki(NIKKI_MAXDEAPTH, dun_level, NULL);
5687 /* No stairs down from Quest */
5688 if (quest_number(dun_level))
5690 create_down_stair = 0;
5693 /* Paranoia -- no stairs from town or wilderness */
5694 if (!dun_level) create_down_stair = create_up_stair = 0;
5696 /* Option -- no connected stairs */
5697 if (!dungeon_stair) create_down_stair = create_up_stair = 0;
5699 /* Option -- no up stairs */
5700 if (ironman_downward) create_down_stair = create_up_stair = 0;
5702 /* Make a stairway. */
5703 if (create_up_stair || create_down_stair)
5705 /* Place a stairway */
5706 if (cave_valid_bold(py, px))
5709 delete_object(py, px);
5712 if (create_down_stair)
5714 if (create_down_stair == 2) cave_set_feat(py, px, FEAT_MORE_MORE);
5715 else cave_set_feat(py, px, FEAT_MORE);
5719 if (create_up_stair == 2) cave_set_feat(py, px, FEAT_LESS_LESS);
5720 else cave_set_feat(py, px, FEAT_LESS);
5724 /* Cancel the stair request */
5725 create_down_stair = create_up_stair = 0;
5728 /* Validate the panel */
5729 panel_bounds_center();
5731 /* Verify the panel */
5734 /* Flush messages */
5738 /* Enter "xtra" mode */
5739 character_xtra = TRUE;
5742 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
5745 p_ptr->window |= (PW_MONSTER);
5747 /* Redraw dungeon */
5748 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY);
5751 p_ptr->redraw |= (PR_MAP);
5754 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5757 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
5759 /* Calculate torch radius */
5760 p_ptr->update |= (PU_TORCH);
5772 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_DISTANCE | PU_MON_LITE);
5773 p_ptr->update |= (PU_MONSTERS);/*¼«Ê¬¤Ç¸÷¤Ã¤Æ¤¤¤ë¥â¥ó¥¹¥¿¡¼¤Î°Ù */
5781 /* Leave "xtra" mode */
5782 character_xtra = FALSE;
5785 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
5787 /* Combine / Reorder the pack */
5788 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
5805 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();
5807 if (p_ptr->inside_battle)
5811 p_ptr->energy = 100;
5818 msg_print("»î¹ç³«»Ï¡ª");
5820 msg_format("Ready..Fight!");
5826 if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] > MUSIC_DETECT))
5827 p_ptr->magic_num1[0] = MUSIC_DETECT;
5829 /* Hack -- notice death or departure */
5830 if (!alive || death) return;
5832 /* Print quest message if appropriate */
5833 if (!p_ptr->inside_quest && (dungeon_type == DUNGEON_ANGBAND))
5835 quest_discovery(random_quest_number(dun_level));
5836 p_ptr->inside_quest = random_quest_number(dun_level);
5838 if ((dun_level == d_info[dungeon_type].maxdepth) && d_info[dungeon_type].final_guardian)
5840 if (r_info[d_info[dungeon_type].final_guardian].max_num)
5842 msg_format("¤³¤Î³¬¤Ë¤Ï%s¤Î¼ç¤Ç¤¢¤ë%s¤¬À³¤ó¤Ç¤¤¤ë¡£",
5843 d_name+d_info[dungeon_type].name,
5844 r_name+r_info[d_info[dungeon_type].final_guardian].name);
5846 msg_format("%^s lives in this level as the keeper of %s.",
5847 r_name+r_info[d_info[dungeon_type].final_guardian].name,
5848 d_name+d_info[dungeon_type].name);
5852 /*** Process this dungeon level ***/
5854 /* Reset the monster generation level */
5855 monster_level = base_level;
5857 /* Reset the object generation level */
5858 object_level = base_level;
5862 if (p_ptr->energy < 100 && !p_ptr->inside_battle && (dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena)) p_ptr->energy = 100;
5863 /* Not leaving dungeon */
5864 p_ptr->leaving_dungeon = FALSE;
5869 int i, correct_inven_cnt = 0;
5871 /* Hack -- Compact the monster list occasionally */
5872 if ((m_cnt + 32 > max_m_idx) && !p_ptr->inside_battle) compact_monsters(64);
5874 /* Hack -- Compress the monster list occasionally */
5875 if ((m_cnt + 32 < m_max) && !p_ptr->inside_battle) compact_monsters(0);
5878 /* Hack -- Compact the object list occasionally */
5879 if (o_cnt + 32 > max_o_idx) compact_objects(64);
5881 /* Hack -- Compress the object list occasionally */
5882 if (o_cnt + 32 < o_max) compact_objects(0);
5885 /* Process the player */
5889 if (p_ptr->notice) notice_stuff();
5892 for (i = 0; i < INVEN_PACK; i++)
5894 object_type *j_ptr = &inventory[i];
5896 /* Skip non-objects */
5897 if (!j_ptr->k_idx) continue;
5899 correct_inven_cnt++;
5903 if (p_ptr->update) update_stuff();
5906 if (p_ptr->redraw) redraw_stuff();
5909 if (p_ptr->window) window_stuff();
5911 /* Hack -- Hilite the player */
5912 move_cursor_relative(py, px);
5914 /* Optional fresh */
5915 if (fresh_after) Term_fresh();
5917 /* Hack -- Notice death or departure */
5918 if (!alive || death) break;
5920 /* Process all of the monsters */
5924 if (p_ptr->notice) notice_stuff();
5927 if (p_ptr->update) update_stuff();
5930 if (p_ptr->redraw) redraw_stuff();
5933 if (p_ptr->window) window_stuff();
5935 /* Hack -- Hilite the player */
5936 move_cursor_relative(py, px);
5938 /* Optional fresh */
5939 if (fresh_after) Term_fresh();
5941 /* Hack -- Notice death or departure */
5942 if (!alive || death) break;
5945 /* Process the world */
5949 if (p_ptr->notice) notice_stuff();
5952 if (p_ptr->update) update_stuff();
5955 if (p_ptr->redraw) redraw_stuff();
5958 if (p_ptr->window) window_stuff();
5960 /* Hack -- Hilite the player */
5961 move_cursor_relative(py, px);
5963 /* Optional fresh */
5964 if (fresh_after) Term_fresh();
5966 /* Hack -- Notice death or departure */
5967 if (!alive || death) break;
5969 /* Handle "leaving" */
5970 if (p_ptr->leaving) break;
5972 /* Count game turns */
5974 if (!p_ptr->wild_mode || wild_regen) dungeon_turn++;
5975 else if (p_ptr->wild_mode && !(turn % ((MAX_HGT + MAX_WID) / 2))) dungeon_turn++;
5976 if (wild_regen) wild_regen--;
5979 /* Inside a quest and non-unique questor? */
5980 if (quest_num && !(r_info[quest[quest_num].r_idx].flags1 & RF1_UNIQUE))
5982 /* Un-mark the quest monster */
5983 r_info[quest[quest_num].r_idx].flags1 &= ~RF1_QUESTOR;
5986 /* Not save-and-quit and not dead? */
5987 if (alive && !death)
5989 for(num = 0; num < 21; num++)
5991 party_mon[num].r_idx = 0;
5996 COPY(&party_mon[0], &m_list[p_ptr->riding], monster_type);
5999 for(i = m_max - 1, num = 1; (i >= 1 && num < 21); i--)
6001 monster_type *m_ptr = &m_list[i];
6003 if (!m_ptr->r_idx) continue;
6004 if (!is_pet(m_ptr)) continue;
6005 if (i == p_ptr->riding) continue;
6007 if (m_ptr->nickname && (player_has_los_bold(m_ptr->fy, m_ptr->fx) || los(m_ptr->fy, m_ptr->fx, py, px)))
6009 if (distance(py, px, m_ptr->fy, m_ptr->fx) > 3) continue;
6013 if (distance(py, px, m_ptr->fy, m_ptr->fx) > 1) continue;
6015 if (m_ptr->confused || m_ptr->stunned || m_ptr->csleep) continue;
6017 COPY(&party_mon[num], &m_list[i], monster_type);
6018 delete_monster_idx(i);
6021 if (record_named_pet)
6023 for (i = m_max - 1; i >=1; i--)
6025 monster_type *m_ptr = &m_list[i];
6028 if (!m_ptr->r_idx) continue;
6029 if (!is_pet(m_ptr)) continue;
6030 if (!m_ptr->nickname) continue;
6031 if (p_ptr->riding == i) continue;
6033 monster_desc(m_name, m_ptr, 0x88);
6034 do_cmd_write_nikki(NIKKI_NAMED_PET, 4, m_name);
6044 * Load some "user pref files"
6046 * Modified by Arcum Dagsson to support
6047 * separate macro files for different realms.
6049 static void load_all_pref_files(void)
6053 /* Access the "user" pref file */
6054 sprintf(buf, "user.prf");
6056 /* Process that file */
6057 process_pref_file(buf);
6059 /* Access the "user" system pref file */
6060 sprintf(buf, "user-%s.prf", ANGBAND_SYS);
6062 /* Process that file */
6063 process_pref_file(buf);
6065 /* Access the "race" pref file */
6066 sprintf(buf, "%s.prf", rp_ptr->title);
6068 /* Process that file */
6069 process_pref_file(buf);
6071 /* Access the "class" pref file */
6072 sprintf(buf, "%s.prf", cp_ptr->title);
6074 /* Process that file */
6075 process_pref_file(buf);
6077 /* Access the "character" pref file */
6078 sprintf(buf, "%s.prf", player_base);
6080 /* Process that file */
6081 process_pref_file(buf);
6084 sprintf(buf, "picktype-%s.prf", player_base);
6086 sprintf(buf, "pickpref-%s.prf", player_base);
6088 process_pickpref_file(buf);
6090 process_pickpref_file("picktype.prf");
6092 process_pickpref_file("pickpref.prf");
6095 /* Access the "realm 1" pref file */
6096 if (p_ptr->realm1 != REALM_NONE)
6098 sprintf(buf, "%s.prf", realm_names[p_ptr->realm1]);
6100 /* Process that file */
6101 process_pref_file(buf);
6104 /* Access the "realm 2" pref file */
6105 if (p_ptr->realm2 != REALM_NONE)
6107 sprintf(buf, "%s.prf", realm_names[p_ptr->realm2]);
6109 /* Process that file */
6110 process_pref_file(buf);
6116 * Actually play a game
6118 * If the "new_game" parameter is true, then, after loading the
6119 * savefile, we will commit suicide, if necessary, to allow the
6120 * player to start a new game.
6122 void play_game(bool new_game)
6125 bool load_game = TRUE;
6135 hack_mutation = FALSE;
6137 /* Hack -- Character is "icky" */
6138 character_icky = TRUE;
6140 /* Make sure main term is active */
6141 Term_activate(angband_term[0]);
6143 /* Initialise the resize hooks */
6144 angband_term[0]->resize_hook = resize_map;
6146 for (i = 1; i < 8; i++)
6148 /* Does the term exist? */
6149 if (angband_term[i])
6151 /* Add the redraw on resize hook */
6152 angband_term[i]->resize_hook = redraw_window;
6156 /* Hack -- turn off the cursor */
6157 (void)Term_set_cursor(0);
6160 /* Attempt to load */
6165 quit("¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤¬²õ¤ì¤Æ¤¤¤Þ¤¹");
6167 quit("broken savefile");
6172 /* Extract the options */
6173 for (i = 0; option_info[i].o_desc; i++)
6175 int os = option_info[i].o_set;
6176 int ob = option_info[i].o_bit;
6178 /* Set the "default" options */
6179 if (option_info[i].o_var)
6182 if (option_flag[os] & (1L << ob))
6185 (*option_info[i].o_var) = TRUE;
6192 (*option_info[i].o_var) = FALSE;
6197 /* Report waited score */
6198 if (wait_report_score)
6204 if (!get_check("ÂÔµ¡¤·¤Æ¤¤¤¿¥¹¥³¥¢ÅÐÏ¿¤òº£¹Ô¤Ê¤¤¤Þ¤¹¤«¡©"))
6206 if (!get_check("Do you register score now? "))
6211 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
6218 start_time = time(NULL);
6220 /* No suspending now */
6221 signals_ignore_tstp();
6223 /* Hack -- Character is now "icky" */
6224 character_icky = TRUE;
6226 /* Build the filename */
6227 path_build(buf, 1024, ANGBAND_DIR_APEX, "scores.raw");
6229 /* Open the high score file, for reading/writing */
6230 highscore_fd = fd_open(buf, O_RDWR);
6232 /* Handle score, show Top scores */
6233 success = send_world_score(TRUE);
6236 if (!success && !get_check("¥¹¥³¥¢ÅÐÏ¿¤òÄü¤á¤Þ¤¹¤«¡©"))
6238 if (!success && !get_check("Do you give up score registration? "))
6242 prt("°ú¤Â³¤ÂÔµ¡¤·¤Þ¤¹¡£", 0, 0);
6244 prt("standing by for future registration...", 0, 0);
6250 wait_report_score = FALSE;
6253 if (!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
6255 if (!save_player()) msg_print("death save failed!");
6258 /* Shut the high score file */
6259 (void)fd_close(highscore_fd);
6261 /* Forget the high score fd */
6264 /* Allow suspending now */
6265 signals_handle_tstp();
6270 /* Nothing loaded */
6271 if (!character_loaded)
6273 /* Make new player */
6276 /* The dungeon is not ready */
6277 character_dungeon = FALSE;
6279 /* Prepare to init the RNG */
6283 /* Process old character */
6286 /* Process the player name */
6287 process_player_name(FALSE);
6296 seed = (time(NULL));
6300 /* Mutate the seed on Unix machines */
6301 seed = ((seed >> 3) * (getpid() << 1));
6305 /* Use the complex RNG */
6308 /* Seed the "complex" RNG */
6309 Rand_state_init(seed);
6312 /* Roll new character */
6315 monster_race *r_ptr;
6317 /* The dungeon is not ready */
6318 character_dungeon = FALSE;
6322 p_ptr->inside_quest = 0;
6323 p_ptr->inside_arena = FALSE;
6324 p_ptr->inside_battle = FALSE;
6328 /* Hack -- seed for flavors */
6329 seed_flavor = randint0(0x10000000);
6331 /* Hack -- seed for town layout */
6332 seed_town = randint0(0x10000000);
6334 /* Roll up a new character */
6341 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "ÊÕ¶¤ÎÃϤ˹ߤêΩ¤Ã¤¿¡£");
6343 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "You are standing in the Outpost.");
6347 get_mon_num_prep(NULL, NULL);
6348 for (i = 0; i < MAX_KUBI; i++)
6354 kubi_r_idx[i] = get_mon_num(MAX_DEPTH - 1);
6355 r_ptr = &r_info[kubi_r_idx[i]];
6357 if(!(r_ptr->flags1 & RF1_UNIQUE)) continue;
6359 if(!(r_ptr->flags9 & RF9_DROP_CORPSE)) continue;
6360 if (r_ptr->rarity > 100) continue;
6362 if(r_ptr->flags6 & RF6_SPECIAL) continue;
6364 for (j = 0; j < i; j++)
6365 if (kubi_r_idx[i] == kubi_r_idx[j])break;
6370 for (i = 0; i < MAX_KUBI -1; i++)
6373 for (j = i; j < MAX_KUBI; j++)
6375 if (r_info[kubi_r_idx[i]].level > r_info[kubi_r_idx[j]].level)
6377 tmp = kubi_r_idx[i];
6378 kubi_r_idx[i] = kubi_r_idx[j];
6379 kubi_r_idx[j] = tmp;
6384 p_ptr->inside_battle = TRUE;
6387 today_mon = get_mon_num(3);
6388 r_ptr = &r_info[today_mon];
6390 if (r_ptr->flags1 & RF1_UNIQUE) continue;
6391 if (r_ptr->flags2 & (RF2_MULTIPLY)) continue;
6392 if (!(r_ptr->flags9 & RF9_DROP_CORPSE) || !(r_ptr->flags9 & RF9_DROP_SKELETON)) continue;
6393 if (r_ptr->rarity > 10) continue;
6394 if (r_ptr->level == 0) continue;
6397 p_ptr->inside_battle = FALSE;
6401 write_level = FALSE;
6404 do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ----¥²¡¼¥àºÆ³«----");
6406 do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ---- Restart Game ----");
6410 * 1.0.9 °ÊÁ°¤Ï¥»¡¼¥ÖÁ°¤Ë p_ptr->riding = -1 ¤È¤·¤Æ¤¤¤¿¤Î¤Ç¡¢ºÆÀßÄ꤬ɬÍפÀ¤Ã¤¿¡£
6411 * ¤â¤¦ÉÔÍפÀ¤¬¡¢°ÊÁ°¤Î¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤È¤Î¸ß´¹¤Î¤¿¤á¤Ë»Ä¤·¤Æ¤ª¤¯¡£
6413 if (p_ptr->riding == -1)
6416 for(i = m_max; i > 0; i--)
6418 if ((m_list[i].fy == py) && (m_list[i].fx == px))
6427 p_ptr->teleport_town = FALSE;
6428 p_ptr->sutemi = FALSE;
6429 world_monster = FALSE;
6430 now_damaged = FALSE;
6432 start_time = time(NULL) - 1;
6433 record_o_name[0] = '\0';
6435 /* Reset map panel */
6436 panel_row_min = cur_hgt;
6437 panel_col_min = cur_wid;
6439 /* Sexy gal gets bonus to maximum weapon skill of whip */
6440 if(p_ptr->pseikaku == SEIKAKU_SEXY)
6441 s_info[p_ptr->pclass].w_max[TV_HAFTED-TV_BOW][SV_WHIP] = 8000;
6443 /* Fill the arrays of floors and walls in the good proportions */
6444 for (i = 0; i < 100; i++)
6446 int lim1, lim2, lim3;
6448 lim1 = d_info[dungeon_type].floor_percent1;
6449 lim2 = lim1 + d_info[dungeon_type].floor_percent2;
6450 lim3 = lim2 + d_info[dungeon_type].floor_percent3;
6453 floor_type[i] = d_info[dungeon_type].floor1;
6455 floor_type[i] = d_info[dungeon_type].floor2;
6457 floor_type[i] = d_info[dungeon_type].floor3;
6459 lim1 = d_info[dungeon_type].fill_percent1;
6460 lim2 = lim1 + d_info[dungeon_type].fill_percent2;
6461 lim3 = lim2 + d_info[dungeon_type].fill_percent3;
6463 fill_type[i] = d_info[dungeon_type].fill_type1;
6465 fill_type[i] = d_info[dungeon_type].fill_type2;
6467 fill_type[i] = d_info[dungeon_type].fill_type3;
6470 /* Flavor the objects */
6478 /* Flash a message */
6480 prt("¤ªÂÔ¤Á²¼¤µ¤¤...", 0, 0);
6482 prt("Please wait...", 0, 0);
6486 /* Flush the message */
6490 /* Hack -- Enter wizard mode */
6491 if (arg_wizard && enter_wizard_mode()) wizard = TRUE;
6493 /* Initialize the town-buildings if necessary */
6494 if (!dun_level && !p_ptr->inside_quest)
6496 /* Init the wilderness */
6498 process_dungeon_file("w_info_j.txt", 0, 0, max_wild_y, max_wild_x);
6501 init_flags = INIT_ONLY_BUILDINGS;
6503 process_dungeon_file("t_info_j.txt", 0, 0, MAX_HGT, MAX_WID);
6508 /* Initialize vault info */
6510 if (init_v_info()) quit("·úÃÛʪ½é´ü²½ÉÔǽ");
6512 if (init_v_info()) quit("Cannot initialize vaults");
6515 /* Generate a dungeon level if needed */
6516 if (!character_dungeon) generate_cave();
6519 /* Character is now "complete" */
6520 character_generated = TRUE;
6523 /* Hack -- Character is no longer "icky" */
6524 character_icky = FALSE;
6530 /* Reset the visual mappings */
6533 /* Load the "pref" files */
6534 load_all_pref_files();
6536 /* React to changes */
6537 Term_xtra(TERM_XTRA_REACT, 0);
6540 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
6543 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
6549 /* Set or clear "rogue_like_commands" if requested */
6550 if (arg_force_original) rogue_like_commands = FALSE;
6551 if (arg_force_roguelike) rogue_like_commands = TRUE;
6553 /* Hack -- Enforce "delayed death" */
6554 if (p_ptr->chp < 0) death = TRUE;
6556 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
6558 if (new_game && ((p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BEASTMASTER)))
6560 monster_type *m_ptr;
6561 int pet_r_idx = ((p_ptr->pclass == CLASS_CAVALRY) ? MON_HORSE : MON_YASE_HORSE);
6562 monster_race *r_ptr = &r_info[pet_r_idx];
6563 place_monster_aux(py, px - 1, pet_r_idx,
6564 FALSE, FALSE, TRUE, TRUE, TRUE, FALSE);
6565 m_ptr = &m_list[hack_m_idx_ii];
6566 m_ptr->mspeed = r_ptr->speed;
6567 m_ptr->maxhp = r_ptr->hdice*(r_ptr->hside+1)/2;
6568 m_ptr->max_maxhp = m_ptr->maxhp;
6569 m_ptr->hp = r_ptr->hdice*(r_ptr->hside+1)/2;
6570 m_ptr->energy = -100;
6576 /* Process the level */
6580 if (p_ptr->notice) notice_stuff();
6583 if (p_ptr->update) update_stuff();
6586 if (p_ptr->redraw) redraw_stuff();
6589 if (p_ptr->window) window_stuff();
6592 /* Cancel the target */
6595 /* Cancel the health bar */
6599 /* Forget the lite */
6602 /* Forget the view */
6605 /* Forget the view */
6608 /* Handle "quit and save" */
6609 if (!alive && !death) break;
6611 /* Erase the old cave */
6613 if (!death) wipe_m_list();
6621 /* Accidental Death */
6624 if (p_ptr->inside_arena)
6626 p_ptr->inside_arena = FALSE;
6627 if(p_ptr->arena_number > MAX_ARENA_MONS)
6628 p_ptr->arena_number++;
6630 p_ptr->arena_number = 99;
6633 p_ptr->chp_frac = 0;
6634 p_ptr->exit_bldg = TRUE;
6639 /* Mega-Hack -- Allow player to cheat death */
6641 if ((wizard || cheat_live) && !get_check("»à¤Ë¤Þ¤¹¤«? "))
6643 if ((wizard || cheat_live) && !get_check("Die? "))
6647 /* Mark social class, reset age, if needed */
6648 if (p_ptr->sc) p_ptr->sc = p_ptr->age = 0;
6658 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÇ°¤òÁ÷¤ê¡¢»à¤òµ½¤¤¤¿¡£");
6660 msg_print("You invoke wizard mode and cheat death.");
6666 /* Restore hit points */
6667 p_ptr->chp = p_ptr->mhp;
6668 p_ptr->chp_frac = 0;
6670 if (p_ptr->pclass == CLASS_MAGIC_EATER)
6672 for (i = 0; i < EATER_EXT*2; i++)
6674 p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*EATER_CHARGE;
6676 for (; i < EATER_EXT*3; i++)
6678 p_ptr->magic_num1[i] = 0;
6681 /* Restore spell points */
6682 p_ptr->csp = p_ptr->msp;
6683 p_ptr->csp_frac = 0;
6685 /* Hack -- Healing */
6687 (void)set_confused(0);
6688 (void)set_poisoned(0);
6689 (void)set_afraid(0);
6690 (void)set_paralyzed(0);
6695 /* Hack -- Prevent starvation */
6696 (void)set_food(PY_FOOD_MAX - 1);
6698 /* Hack -- cancel recall */
6699 if (p_ptr->word_recall)
6703 msg_print("Ä¥¤ê¤Ä¤á¤¿Â絤¤¬Î®¤ìµî¤Ã¤¿...");
6705 msg_print("A tension leaves the air around you...");
6710 /* Hack -- Prevent recall */
6711 p_ptr->word_recall = 0;
6712 p_ptr->redraw |= (PR_STATUS);
6715 /* Note cause of death XXX XXX XXX */
6717 (void)strcpy(died_from, "»à¤Îµ½¤");
6719 (void)strcpy(died_from, "Cheating death");
6727 p_ptr->inside_arena = FALSE;
6728 p_ptr->inside_battle = FALSE;
6730 p_ptr->inside_quest = 0;
6731 p_ptr->recall_dungeon = dungeon_type;
6733 if (lite_town || vanilla_town)
6735 p_ptr->wilderness_y = 1;
6736 p_ptr->wilderness_x = 1;
6750 p_ptr->wilderness_y = 48;
6751 p_ptr->wilderness_x = 5;
6757 p_ptr->wild_mode = FALSE;
6758 p_ptr->leaving = TRUE;
6761 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " ¤·¤«¤·¡¢À¸¤Ê֤ä¿¡£");
6763 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " but revived.");
6769 /* Handle "death" */
6772 /* Make a new level */
6783 s32b turn_real(s32b hoge)
6785 if ((p_ptr->prace == RACE_VAMPIRE) ||
6786 (p_ptr->prace == RACE_SKELETON) ||
6787 (p_ptr->prace == RACE_ZOMBIE) ||
6788 (p_ptr->prace == RACE_SPECTRE))
6789 return hoge-(60L * TOWN_DAWN) / 4;