3 /* Purpose: Angband game engine */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
15 #define TY_CURSE_CHANCE 200
16 #define CHAINSWORD_NOISE 100
18 static bool load = TRUE;
19 static int wild_regen = 20;
22 * Return a "feeling" (or NULL) about an item. Method 1 (Heavy).
24 static byte value_check_aux1(object_type *o_ptr)
27 if (artifact_p(o_ptr) || o_ptr->art_name)
30 if (cursed_p(o_ptr) || broken_p(o_ptr)) return FEEL_TERRIBLE;
37 if (ego_item_p(o_ptr))
40 if (cursed_p(o_ptr) || broken_p(o_ptr)) return FEEL_WORTHLESS;
43 return FEEL_EXCELLENT;
47 if (cursed_p(o_ptr)) return FEEL_CURSED;
50 if (broken_p(o_ptr)) return FEEL_BROKEN;
52 if ((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) return FEEL_AVERAGE;
54 /* Good "armor" bonus */
55 if (o_ptr->to_a > 0) return FEEL_GOOD;
57 /* Good "weapon" bonus */
58 if (o_ptr->to_h + o_ptr->to_d > 0) return FEEL_GOOD;
60 /* Default to "average" */
66 * Return a "feeling" (or NULL) about an item. Method 2 (Light).
68 static byte value_check_aux2(object_type *o_ptr)
70 /* Cursed items (all of them) */
71 if (cursed_p(o_ptr)) return FEEL_CURSED;
73 /* Broken items (all of them) */
74 if (broken_p(o_ptr)) return FEEL_BROKEN;
76 /* Artifacts -- except cursed/broken ones */
77 if (artifact_p(o_ptr) || o_ptr->art_name) return FEEL_GOOD;
79 /* Ego-Items -- except cursed/broken ones */
80 if (ego_item_p(o_ptr)) return FEEL_GOOD;
82 /* Good armor bonus */
83 if (o_ptr->to_a > 0) return FEEL_GOOD;
85 /* Good weapon bonuses */
86 if (o_ptr->to_h + o_ptr->to_d > 0) return FEEL_GOOD;
94 static void sense_inventory_aux(int slot, bool heavy)
97 object_type *o_ptr = &inventory[slot];
98 char o_name[MAX_NLEN];
101 /* We know about it already, do not tell us again */
102 if (o_ptr->ident & (IDENT_SENSE))return;
104 /* It is fully known, no information needed */
105 if (object_known_p(o_ptr)) return;
107 /* Check for a feeling */
108 feel = (heavy ? value_check_aux1(o_ptr) : value_check_aux2(o_ptr));
110 /* Skip non-feelings */
114 if ((p_ptr->muta3 & MUT3_BAD_LUCK) && !randint0(13))
125 feel = FEEL_EXCELLENT;
130 feel = randint0(3) ? FEEL_GOOD : FEEL_AVERAGE;
135 feel = randint0(2) ? FEEL_CURSED : FEEL_GOOD;
140 feel = randint0(3) ? FEEL_CURSED : FEEL_AVERAGE;
145 feel = FEEL_WORTHLESS;
150 feel = FEEL_TERRIBLE;
156 /* Stop everything */
157 if (disturb_minor) disturb(0, 0);
159 /* Get an object description */
160 object_desc(o_name, o_ptr, FALSE, 0);
162 /* Message (equipment) */
163 if (slot >= INVEN_RARM)
166 msg_format("%s%s(%c)¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
167 describe_use(slot),o_name, index_to_label(slot),game_inscriptions[feel]);
169 msg_format("You feel the %s (%c) you are %s %s %s...",
170 o_name, index_to_label(slot), describe_use(slot),
171 ((o_ptr->number == 1) ? "is" : "are"),
172 game_inscriptions[feel]);
177 /* Message (inventory) */
181 msg_format("¥¶¥Ã¥¯¤ÎÃæ¤Î%s(%c)¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
182 o_name, index_to_label(slot),game_inscriptions[feel]);
184 msg_format("You feel the %s (%c) in your pack %s %s...",
185 o_name, index_to_label(slot),
186 ((o_ptr->number == 1) ? "is" : "are"),
187 game_inscriptions[feel]);
192 /* We have "felt" it */
193 o_ptr->ident |= (IDENT_SENSE);
195 /* Set the "inscription" */
196 o_ptr->feeling = feel;
198 /* Auto-inscription/destroy */
199 idx = is_autopick(o_ptr);
200 auto_inscribe_item(slot, idx);
201 auto_destroy_item(slot, idx);
203 /* Combine / Reorder the pack (later) */
204 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
207 p_ptr->window |= (PW_INVEN | PW_EQUIP);
213 * Sense the inventory
215 * Class 0 = Warrior --> fast and heavy
216 * Class 1 = Mage --> slow and light
217 * Class 2 = Priest --> fast but light
218 * Class 3 = Rogue --> okay and heavy
219 * Class 4 = Ranger --> slow but heavy (changed!)
220 * Class 5 = Paladin --> slow but heavy
222 static void sense_inventory1(void)
225 int plev = p_ptr->lev;
230 /*** Check for "sensing" ***/
232 /* No sensing when confused */
233 if (p_ptr->confused) return;
235 /* Analyze the class */
236 switch (p_ptr->pclass)
244 if (0 != randint0(9000L / (plev * plev + 40))) return;
256 if (0 != randint0(6000L / (plev * plev + 50))) return;
266 case CLASS_HIGH_MAGE:
268 case CLASS_MAGIC_EATER:
270 /* Very bad (light) sensing */
271 if (0 != randint0(240000L / (plev + 5))) return;
280 /* Good (light) sensing */
281 if (0 != randint0(10000L / (plev * plev + 40))) return;
291 if (0 != randint0(20000L / (plev * plev + 40))) return;
303 if (0 != randint0(95000L / (plev * plev + 40))) return;
315 if (0 != randint0(77777L / (plev * plev + 40))) return;
324 case CLASS_WARRIOR_MAGE:
328 if (0 != randint0(75000L / (plev * plev + 40))) return;
334 case CLASS_MINDCRAFTER:
335 case CLASS_MIRROR_MASTER:
338 if (0 != randint0(55000L / (plev * plev + 40))) return;
344 case CLASS_CHAOS_WARRIOR:
347 if (0 != randint0(80000L / (plev * plev + 40))) return;
357 case CLASS_FORCETRAINER:
360 if (0 != randint0(20000L / (plev * plev + 40))) return;
369 if (0 != randint0(20000L / ((plev+50)*(plev+50)))) return;
379 case CLASS_BLUE_MAGE:
382 if (0 != randint0(55000L / (plev * plev + 40))) return;
388 case CLASS_BEASTMASTER:
391 if (0 != randint0(65000L / (plev * plev + 40))) return;
396 case CLASS_BERSERKER:
406 if (compare_virtue(V_KNOWLEDGE, 100, VIRTUE_LARGE)) heavy = TRUE;
408 /*** Sense everything ***/
410 /* Check everything */
411 for (i = 0; i < INVEN_TOTAL; i++)
415 o_ptr = &inventory[i];
417 /* Skip empty slots */
418 if (!o_ptr->k_idx) continue;
420 /* Valid "tval" codes */
446 /* Skip non-sense machines */
449 /* Occasional failure on inventory items */
450 if ((i < INVEN_RARM) && (0 != randint0(5))) continue;
453 if ((p_ptr->muta3 & MUT3_GOOD_LUCK) && !randint0(13))
458 sense_inventory_aux(i, heavy);
463 static void sense_inventory2(void)
466 int plev = p_ptr->lev;
470 /*** Check for "sensing" ***/
472 /* No sensing when confused */
473 if (p_ptr->confused) return;
475 /* Analyze the class */
476 switch (p_ptr->pclass)
482 case CLASS_BERSERKER:
489 case CLASS_CHAOS_WARRIOR:
491 case CLASS_BEASTMASTER:
494 /* Very bad (light) sensing */
495 if (0 != randint0(240000L / (plev + 5))) return;
502 case CLASS_WARRIOR_MAGE:
507 if (0 != randint0(95000L / (plev * plev + 40))) return;
516 case CLASS_FORCETRAINER:
517 case CLASS_MINDCRAFTER:
520 if (0 != randint0(20000L / (plev * plev + 40))) return;
527 case CLASS_HIGH_MAGE:
529 case CLASS_MAGIC_EATER:
530 case CLASS_MIRROR_MASTER:
531 case CLASS_BLUE_MAGE:
534 if (0 != randint0(9000L / (plev * plev + 40))) return;
543 if (0 != randint0(20000L / ((plev+50)*(plev+50)))) return;
550 /*** Sense everything ***/
552 /* Check everything */
553 for (i = 0; i < INVEN_TOTAL; i++)
557 o_ptr = &inventory[i];
559 /* Skip empty slots */
560 if (!o_ptr->k_idx) continue;
562 /* Valid "tval" codes */
575 /* Skip non-sense machines */
578 /* Occasional failure on inventory items */
579 if ((i < INVEN_RARM) && (0 != randint0(5))) continue;
581 sense_inventory_aux(i, TRUE);
588 * Go to any level (ripped off from wiz_jump)
590 static void pattern_teleport(void)
597 if (get_check("¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©"))
599 if (get_check("Teleport level? "))
606 /* Only downward in ironman mode */
607 if (ironman_downward)
608 min_level = dun_level;
611 if (dungeon_type == DUNGEON_ANGBAND)
614 max_level = MAX_DEPTH - 1;
615 else if (dun_level == 100)
618 else max_level = d_info[dungeon_type].maxdepth;
622 sprintf(ppp, "¥Æ¥ì¥Ý¡¼¥ÈÀè:(%d-%d)", min_level, max_level);
624 sprintf(ppp, "Teleport to level (%d-%d): ", min_level, max_level);
629 sprintf(tmp_val, "%d", dun_level);
631 /* Ask for a level */
632 if (!get_string(ppp, tmp_val, 10)) return;
634 /* Extract request */
635 command_arg = atoi(tmp_val);
638 else if (get_check("Ä̾ï¥Æ¥ì¥Ý¡¼¥È¡©"))
640 else if (get_check("Normal teleport? "))
644 teleport_player(200);
653 if (command_arg < min_level) command_arg = min_level;
656 if (command_arg > max_level) command_arg = max_level;
660 msg_format("%d ³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤·¤¿¡£", command_arg);
662 msg_format("You teleport to dungeon level %d.", command_arg);
666 if (autosave_l) do_cmd_save_game(TRUE);
669 dun_level = command_arg;
672 p_ptr->leaving = TRUE;
676 static void wreck_the_pattern(void)
678 int to_ruin = 0, r_y, r_x;
680 if (cave[py][px].feat == FEAT_PATTERN_XTRA2)
687 msg_print("¥Ñ¥¿¡¼¥ó¤ò·ì¤Ç±ø¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
688 msg_print("²¿¤«¶²¤í¤·¤¤»ö¤¬µ¯¤³¤Ã¤¿¡ª");
690 msg_print("You bleed on the Pattern!");
691 msg_print("Something terrible happens!");
697 take_hit(DAMAGE_NOESCAPE, damroll(10, 8), "¥Ñ¥¿¡¼¥ó»²õ", -1);
699 take_hit(DAMAGE_NOESCAPE, damroll(10, 8), "corrupting the Pattern", -1);
703 to_ruin = randint1(45) + 35;
707 scatter(&r_y, &r_x, py, px, 4, 0);
709 if ((cave[r_y][r_x].feat >= FEAT_PATTERN_START) &&
710 (cave[r_y][r_x].feat < FEAT_PATTERN_XTRA2))
712 cave_set_feat(r_y, r_x, FEAT_PATTERN_XTRA2);
716 cave_set_feat(py, px, FEAT_PATTERN_XTRA2);
720 /* Returns TRUE if we are on the Pattern... */
721 static bool pattern_effect(void)
723 if ((cave[py][px].feat < FEAT_PATTERN_START) ||
724 (cave[py][px].feat > FEAT_PATTERN_XTRA2))
727 if ((prace_is_(RACE_AMBERITE)) &&
728 (p_ptr->cut > 0) && one_in_(10))
733 if (cave[py][px].feat == FEAT_PATTERN_END)
735 (void)set_poisoned(0);
741 (void)do_res_stat(A_STR);
742 (void)do_res_stat(A_INT);
743 (void)do_res_stat(A_WIS);
744 (void)do_res_stat(A_DEX);
745 (void)do_res_stat(A_CON);
746 (void)do_res_stat(A_CHR);
747 (void)restore_level();
748 (void)hp_player(1000);
749 cave_set_feat(py, px, FEAT_PATTERN_OLD);
751 msg_print("¡Ö¥Ñ¥¿¡¼¥ó¡×¤Î¤³¤ÎÉôʬ¤Ï¾¤ÎÉôʬ¤è¤ê¶¯ÎϤǤʤ¤¤è¤¦¤À¡£");
753 msg_print("This section of the Pattern looks less powerful.");
760 * We could make the healing effect of the
761 * Pattern center one-time only to avoid various kinds
762 * of abuse, like luring the win monster into fighting you
763 * in the middle of the pattern...
766 else if (cave[py][px].feat == FEAT_PATTERN_OLD)
770 else if (cave[py][px].feat == FEAT_PATTERN_XTRA1)
774 else if (cave[py][px].feat == FEAT_PATTERN_XTRA2)
778 take_hit(DAMAGE_NOESCAPE, 200, "²õ¤ì¤¿¡Ö¥Ñ¥¿¡¼¥ó¡×¤òÊ⤤¤¿¥À¥á¡¼¥¸", -1);
780 take_hit(DAMAGE_NOESCAPE, 200, "walking the corrupted Pattern", -1);
786 if ((prace_is_(RACE_AMBERITE)) && !one_in_(2))
788 else if (!p_ptr->invuln)
790 take_hit(DAMAGE_NOESCAPE, damroll(1,3), "¡Ö¥Ñ¥¿¡¼¥ó¡×¤òÊ⤤¤¿¥À¥á¡¼¥¸", -1);
792 take_hit(DAMAGE_NOESCAPE, damroll(1, 3), "walking the Pattern", -1);
805 * Regenerate hit points -RAK-
807 static void regenhp(int percent)
809 s32b new_chp, new_chp_frac;
812 if (p_ptr->special_defense & KATA_KOUKIJIN) return;
813 if (p_ptr->action == ACTION_HAYAGAKE) return;
814 /* Save the old hitpoints */
815 old_chp = p_ptr->chp;
817 /* Extract the new hitpoints */
818 new_chp = ((long)p_ptr->mhp) * percent + PY_REGEN_HPBASE;
819 p_ptr->chp += (s16b)(new_chp >> 16); /* div 65536 */
821 /* check for overflow */
822 if ((p_ptr->chp < 0) && (old_chp > 0)) p_ptr->chp = MAX_SHORT;
823 new_chp_frac = (new_chp & 0xFFFF) + p_ptr->chp_frac; /* mod 65536 */
824 if (new_chp_frac >= 0x10000L)
826 p_ptr->chp_frac = (u16b)(new_chp_frac - 0x10000L);
831 p_ptr->chp_frac = (u16b)new_chp_frac;
835 if (p_ptr->chp >= p_ptr->mhp)
837 p_ptr->chp = p_ptr->mhp;
842 if (old_chp != p_ptr->chp)
845 p_ptr->redraw |= (PR_HP);
848 p_ptr->window |= (PW_PLAYER);
856 * Regenerate mana points -RAK-
858 static void regenmana(int percent)
860 s32b new_mana, new_mana_frac;
862 bool old_csp_msp = (p_ptr->csp > p_ptr->msp);
864 if (p_ptr->special_defense & KATA_KOUKIJIN) return;
865 if ((p_ptr->pclass == CLASS_SAMURAI) && (p_ptr->regenerate)) percent /= 2;
866 old_csp = p_ptr->csp;
867 new_mana = ((long)p_ptr->msp) * percent + PY_REGEN_MNBASE;
868 if (old_csp_msp && (new_mana > 0))
872 p_ptr->csp -= (s16b)(new_mana >> 16); /* div 65536 */
873 new_mana_frac = p_ptr->csp_frac + 0x10000L - (new_mana & 0xFFFF);
877 if (old_csp_msp) new_mana += ((((long)p_ptr->msp) * percent + PY_REGEN_MNBASE) * 32);
878 p_ptr->csp += (s16b)(new_mana >> 16); /* div 65536 */
880 new_mana_frac = (new_mana & 0xFFFF) + p_ptr->csp_frac; /* mod 65536 */
882 if (new_mana_frac >= 0x10000L)
884 p_ptr->csp_frac = (u16b)(new_mana_frac - 0x10000L);
889 p_ptr->csp_frac = (u16b)(new_mana_frac);
892 /* check for overflow */
899 /* Must set frac to zero even if equal */
900 if ((old_csp_msp && p_ptr->csp < p_ptr->msp) || (!old_csp_msp && p_ptr->csp >= p_ptr->msp))
902 p_ptr->csp = p_ptr->msp;
907 if (old_csp != p_ptr->csp)
910 p_ptr->redraw |= (PR_MANA);
913 p_ptr->window |= (PW_PLAYER);
914 p_ptr->window |= (PW_SPELL);
925 static void regenmagic(int percent)
930 for (i = 0; i < EATER_EXT*2; i++)
932 if (!p_ptr->magic_num2[i]) continue;
933 if (p_ptr->magic_num1[i] == ((long)p_ptr->magic_num2[i] << 16)) continue;
934 new_mana = ((long)p_ptr->magic_num2[i]+adj_mag_mana[A_INT]+13) * percent / 8;
935 p_ptr->magic_num1[i] += new_mana;
937 /* Must set frac to zero even if equal */
938 if (p_ptr->magic_num1[i] > (p_ptr->magic_num2[i] << 16))
940 p_ptr->magic_num1[i] = ((long)p_ptr->magic_num2[i] << 16);
944 for (i = EATER_EXT*2; i < EATER_EXT*3; i++)
946 if (!p_ptr->magic_num1[i]) continue;
947 if (!p_ptr->magic_num2[i]) continue;
948 p_ptr->magic_num1[i] -= (long)(p_ptr->magic_num2[i] * (adj_mag_mana[A_INT] + 10)) * EATER_ROD_CHARGE/16;
949 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
960 * Regenerate the monsters (once per 100 game turns)
962 * XXX XXX XXX Should probably be done during monster turns.
964 static void regen_monsters(void)
969 /* Regenerate everyone */
970 for (i = 1; i < m_max; i++)
972 /* Check the i'th monster */
973 monster_type *m_ptr = &m_list[i];
974 monster_race *r_ptr = &r_info[m_ptr->r_idx];
977 /* Skip dead monsters */
978 if (!m_ptr->r_idx) continue;
980 /* Allow regeneration (if needed) */
981 if (m_ptr->hp < m_ptr->maxhp)
983 /* Hack -- Base regeneration */
984 frac = m_ptr->maxhp / 100;
986 /* Hack -- Minimal regeneration rate */
987 if (!frac) if (one_in_(2)) frac = 1;
989 /* Hack -- Some monsters regenerate quickly */
990 if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2;
992 /* Hack -- Regenerate */
995 /* Do not over-regenerate */
996 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
998 /* Redraw (later) if needed */
999 if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH);
1000 if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH);
1007 * Regenerate the monsters (once per 100 game turns)
1009 * XXX XXX XXX Should probably be done during monster turns.
1011 static void regen_captured_monsters(void)
1016 /* Regenerate everyone */
1017 for (i = 0; i < INVEN_TOTAL; i++)
1019 monster_race *r_ptr;
1020 object_type *o_ptr = &inventory[i];
1022 if (!o_ptr->k_idx) continue;
1023 if (o_ptr->tval != TV_CAPTURE) continue;
1024 if (!o_ptr->pval) continue;
1028 r_ptr = &r_info[o_ptr->pval];
1030 /* Allow regeneration (if needed) */
1031 if (o_ptr->xtra4 < o_ptr->xtra5)
1033 /* Hack -- Base regeneration */
1034 frac = o_ptr->xtra5 / 100;
1036 /* Hack -- Minimal regeneration rate */
1037 if (!frac) if (one_in_(2)) frac = 1;
1039 /* Hack -- Some monsters regenerate quickly */
1040 if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2;
1042 /* Hack -- Regenerate */
1043 o_ptr->xtra4 += frac;
1045 /* Do not over-regenerate */
1046 if (o_ptr->xtra4 > o_ptr->xtra5) o_ptr->xtra4 = o_ptr->xtra5;
1053 p_ptr->notice |= (PN_COMBINE);
1056 p_ptr->window |= (PW_INVEN);
1057 p_ptr->window |= (PW_EQUIP);
1063 static void notice_lite_change(object_type *o_ptr)
1065 /* Hack -- notice interesting fuel steps */
1066 if ((o_ptr->xtra4 < 100) || (!(o_ptr->xtra4 % 100)))
1069 p_ptr->window |= (PW_EQUIP);
1072 /* Hack -- Special treatment when blind */
1075 /* Hack -- save some light for later */
1076 if (o_ptr->xtra4 == 0) o_ptr->xtra4++;
1079 /* The light is now out */
1080 else if (o_ptr->xtra4 == 0)
1084 msg_print("ÌÀ¤«¤ê¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1086 msg_print("Your light has gone out!");
1088 p_ptr->update |= (PU_BONUS);
1091 /* The light is getting dim */
1092 else if (o_ptr->name2 == EGO_LITE_LONG)
1094 if ((o_ptr->xtra4 < 50) && (!(o_ptr->xtra4 % 5))
1095 && (turn % (TURNS_PER_TICK*2)))
1097 if (disturb_minor) disturb(0, 0);
1099 msg_print("ÌÀ¤«¤ê¤¬Èù¤«¤Ë¤Ê¤Ã¤Æ¤¤Æ¤¤¤ë¡£");
1101 msg_print("Your light is growing faint.");
1107 /* The light is getting dim */
1108 else if ((o_ptr->xtra4 < 100) && (!(o_ptr->xtra4 % 10)))
1110 if (disturb_minor) disturb(0, 0);
1112 msg_print("ÌÀ¤«¤ê¤¬Èù¤«¤Ë¤Ê¤Ã¤Æ¤¤Æ¤¤¤ë¡£");
1114 msg_print("Your light is growing faint.");
1121 void leave_quest_check(void)
1123 /* Save quset number for dungeon pref file ($LEAVING_QUEST) */
1124 leaving_quest = p_ptr->inside_quest;
1126 /* Leaving an 'only once' quest marks it as failed */
1127 if (leaving_quest &&
1128 ((quest[leaving_quest].flags & QUEST_FLAG_ONCE) || (quest[leaving_quest].type == QUEST_TYPE_RANDOM)) &&
1129 (quest[leaving_quest].status == QUEST_STATUS_TAKEN))
1131 quest[leaving_quest].status = QUEST_STATUS_FAILED;
1132 quest[leaving_quest].complev = (byte)p_ptr->lev;
1133 if (quest[leaving_quest].type == QUEST_TYPE_RANDOM)
1135 r_info[quest[leaving_quest].r_idx].flags1 &= ~(RF1_QUESTOR);
1136 if (record_rand_quest)
1137 do_cmd_write_nikki(NIKKI_RAND_QUEST_F, leaving_quest, NULL);
1139 else if (record_fix_quest)
1140 do_cmd_write_nikki(NIKKI_FIX_QUEST_F, leaving_quest, NULL);
1146 * Forcibly pseudo-identify an object in the inventory
1149 * note: currently this function allows pseudo-id of any object,
1150 * including silly ones like potions & scrolls, which always
1151 * get '{average}'. This should be changed, either to stop such
1152 * items from being pseudo-id'd, or to allow psychometry to
1153 * detect whether the unidentified potion/scroll/etc is
1154 * good (Cure Light Wounds, Restore Strength, etc) or
1155 * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
1157 bool psychometry(void)
1161 char o_name[MAX_NLEN];
1166 item_tester_no_ryoute = TRUE;
1169 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«¡©";
1170 s = "Ä´¤Ù¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
1172 q = "Meditate on which item? ";
1173 s = "You have nothing appropriate.";
1176 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
1178 /* Get the item (in the pack) */
1181 o_ptr = &inventory[item];
1184 /* Get the item (on the floor) */
1187 o_ptr = &o_list[0 - item];
1190 /* It is fully known, no information needed */
1191 if (object_known_p(o_ptr))
1194 msg_print("²¿¤â¿·¤·¤¤¤³¤È¤ÏȽ¤é¤Ê¤«¤Ã¤¿¡£");
1196 msg_print("You cannot find out anything more about that.");
1202 /* Check for a feeling */
1203 feel = value_check_aux1(o_ptr);
1205 /* Get an object description */
1206 object_desc(o_name, o_ptr, FALSE, 0);
1208 /* Skip non-feelings */
1212 msg_format("%s¤«¤é¤ÏÆäËÊѤï¤Ã¤¿»ö¤Ï´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿¡£", o_name);
1214 msg_format("You do not perceive anything unusual about the %s.", o_name);
1221 msg_format("%s¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
1222 o_name, game_inscriptions[feel]);
1224 msg_format("You feel that the %s %s %s...",
1225 o_name, ((o_ptr->number == 1) ? "is" : "are"),
1226 game_inscriptions[feel]);
1230 /* We have "felt" it */
1231 o_ptr->ident |= (IDENT_SENSE);
1234 o_ptr->feeling = feel;
1236 /* Combine / Reorder the pack (later) */
1237 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1240 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1242 /* Something happened */
1247 static void gere_music(s32b music)
1255 stun_monsters(damroll(p_ptr->lev/10,2));
1258 hp_player(damroll(2,6));
1261 project_hack(GF_TURN_ALL, p_ptr->lev);
1264 project_hack(GF_PSI, randint1(p_ptr->lev * 3 / 2));
1267 project(0, 1, py, px, 0, GF_IDENTIFY, PROJECT_ITEM, -1);
1270 confuse_monsters(p_ptr->lev * 2);
1273 project_hack(GF_SOUND, damroll(10 + p_ptr->lev/5,7));
1276 charm_monsters(damroll(10 + p_ptr->lev/15,6));
1279 project(0, 0, py, px,
1280 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
1283 dispel_monsters(randint1(p_ptr->lev * 3));
1284 dispel_evil(randint1(p_ptr->lev * 3));
1291 earthquake(py, px, 10);
1294 stasis_monsters(p_ptr->lev * 4);
1297 dispel_monsters(randint1(p_ptr->lev * 3));
1300 hp_player(damroll(15,10));
1304 case MUSIC_DETECT+19:
1305 wiz_lite(FALSE, FALSE);
1306 case MUSIC_DETECT+11:
1307 case MUSIC_DETECT+12:
1308 case MUSIC_DETECT+13:
1309 case MUSIC_DETECT+14:
1310 case MUSIC_DETECT+15:
1311 case MUSIC_DETECT+16:
1312 case MUSIC_DETECT+17:
1313 case MUSIC_DETECT+18:
1314 map_area(DETECT_RAD_MAP);
1315 if ((p_ptr->lev > 39) && (music < MUSIC_DETECT+19)) p_ptr->magic_num1[0] = music+1;
1316 case MUSIC_DETECT+6:
1317 case MUSIC_DETECT+7:
1318 case MUSIC_DETECT+8:
1319 case MUSIC_DETECT+9:
1320 case MUSIC_DETECT+10:
1321 detect_treasure(DETECT_RAD_DEFAULT);
1322 detect_objects_gold(DETECT_RAD_DEFAULT);
1323 detect_objects_normal(DETECT_RAD_DEFAULT);
1324 if ((p_ptr->lev > 24) && (music < MUSIC_DETECT+11)) p_ptr->magic_num1[0] = music+1;
1325 case MUSIC_DETECT+3:
1326 case MUSIC_DETECT+4:
1327 case MUSIC_DETECT+5:
1328 detect_monsters_invis(DETECT_RAD_DEFAULT);
1329 detect_monsters_normal(DETECT_RAD_DEFAULT);
1330 if ((p_ptr->lev > 19) && (music < MUSIC_DETECT+6)) p_ptr->magic_num1[0] = music+1;
1332 case MUSIC_DETECT+1:
1333 case MUSIC_DETECT+2:
1334 detect_traps(DETECT_RAD_DEFAULT);
1335 detect_doors(DETECT_RAD_DEFAULT);
1336 detect_stairs(DETECT_RAD_DEFAULT);
1337 if ((p_ptr->lev > 14) && (music < MUSIC_DETECT+3)) p_ptr->magic_num1[0] = music+1;
1343 * If player has inscribed the object with "!!", let him know when it's
1346 static void recharged_notice(object_type *o_ptr)
1348 char o_name[MAX_NLEN];
1352 /* No inscription */
1353 if (!o_ptr->inscription) return;
1356 s = strchr(quark_str(o_ptr->inscription), '!');
1358 /* Process notification request. */
1361 /* Find another '!' */
1364 /* Describe (briefly) */
1365 object_desc(o_name, o_ptr, FALSE, 0);
1367 /* Notify the player */
1368 if (o_ptr->number > 1)
1370 msg_format("%s¤ÏºÆ½¼Å¶¤µ¤ì¤¿¡£", o_name);
1371 else msg_format("%s¤ÏºÆ½¼Å¶¤µ¤ì¤¿¡£", o_name);
1373 msg_format("Your %s are recharged.", o_name);
1374 else msg_format("Your %s is recharged.", o_name);
1382 /* Keep looking for '!'s */
1383 s = strchr(s + 1, '!');
1388 static void check_music(void)
1393 /* Music singed by player */
1394 if(p_ptr->pclass != CLASS_BARD) return;
1395 if(!p_ptr->magic_num1[0] && !p_ptr->magic_num1[1]) return;
1397 s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC - 1][p_ptr->magic_num2[0]];
1399 shouhimana = (s_ptr->smana*(3800-spell_exp[p_ptr->magic_num2[0]])+2399);
1402 else shouhimana *= 4;
1404 if(shouhimana < 1) shouhimana = 1;
1405 shouhimana *= 0x8000;
1406 if (((u16b)(p_ptr->csp) < (shouhimana / 0x10000)) || (p_ptr->anti_magic))
1413 p_ptr->csp -= (u16b) (shouhimana / 0x10000);
1414 shouhimana = (shouhimana & 0xffff);
1415 if (p_ptr->csp_frac < shouhimana)
1418 p_ptr->csp_frac += (u16b)(0x10000L - shouhimana);
1422 p_ptr->csp_frac -= (u16b)shouhimana;
1425 p_ptr->redraw |= PR_MANA;
1426 if (p_ptr->magic_num1[1])
1428 p_ptr->magic_num1[0] = p_ptr->magic_num1[1];
1429 p_ptr->magic_num1[1] = 0;
1431 msg_print("²Î¤òºÆ³«¤·¤¿¡£");
1433 msg_print("You restart singing.");
1435 p_ptr->action = ACTION_SING;
1437 /* Recalculate bonuses */
1438 p_ptr->update |= (PU_BONUS | PU_HP);
1440 /* Redraw status bar */
1441 p_ptr->redraw |= (PR_STATUS);
1444 if (spell_exp[p_ptr->magic_num2[0]] < 900)
1445 spell_exp[p_ptr->magic_num2[0]]+=5;
1446 else if(spell_exp[p_ptr->magic_num2[0]] < 1200)
1447 {if (one_in_(2) && (dun_level > 4) && ((dun_level + 10) > p_ptr->lev)) spell_exp[p_ptr->magic_num2[0]]+=1;}
1448 else if(spell_exp[p_ptr->magic_num2[0]] < 1400)
1449 {if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel)) spell_exp[p_ptr->magic_num2[0]]+=1;}
1450 else if(spell_exp[p_ptr->magic_num2[0]] < 1600)
1451 {if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel)) spell_exp[p_ptr->magic_num2[0]]+=1;}
1453 gere_music(p_ptr->magic_num1[0]);
1456 /* Choose one of items that have cursed flag */
1457 static object_type *choose_cursed_obj_name(u32b flag)
1460 int choices[INVEN_TOTAL-INVEN_RARM];
1463 /* Paranoia -- Player has no warning-item */
1464 if (!(p_ptr->cursed & flag)) return NULL;
1466 /* Search Inventry */
1467 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
1469 object_type *o_ptr = &inventory[i];
1471 if (o_ptr->curse_flags & flag)
1473 choices[number] = i;
1478 /* Choice one of them */
1479 return (&inventory[choices[randint0(number)]]);
1484 * Handle certain things once every 10 game turns
1486 static void process_world(void)
1490 bool cave_no_regen = FALSE;
1491 int upkeep_factor = 0;
1496 const int dec_count = (easy_band ? 2 : 1);
1498 int day, hour, min, prev_min;
1500 s32b len = TURNS_PER_TICK * TOWN_DAWN;
1501 s32b tick = turn % len + len / 4;
1503 extract_day_hour_min(&day, &hour, &min);
1504 prev_min = (1440 * (tick - 20) / len) % 60;
1506 if ((turn - old_turn == (150 - dun_level) * TURNS_PER_TICK)
1508 !(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)))) &&
1509 !(p_ptr->inside_battle))
1512 if (p_ptr->inside_battle && !p_ptr->leaving)
1519 /* Count all hostile monsters */
1520 for (i2 = 0; i2 < cur_wid; ++i2)
1521 for (j2 = 0; j2 < cur_hgt; j2++)
1522 if ((cave[j2][i2].m_idx > 0) && (cave[j2][i2].m_idx != p_ptr->riding))
1525 win_m_idx = cave[j2][i2].m_idx;
1528 if (number_mon == 0)
1531 msg_print("ÁêÂǤÁ¤Ë½ª¤ï¤ê¤Þ¤·¤¿¡£");
1533 msg_print("They have kill each other at the same time.");
1536 p_ptr->energy_need = 0;
1539 else if ((number_mon-1) == 0)
1542 monster_type *wm_ptr;
1544 wm_ptr = &m_list[win_m_idx];
1546 monster_desc(m_name, wm_ptr, 0);
1548 msg_format("%s¤¬¾¡Íø¤·¤¿¡ª", m_name);
1550 msg_format("%s is winner!", m_name);
1554 if (win_m_idx == (sel_monster+1))
1557 msg_print("¤ª¤á¤Ç¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£");
1559 msg_print("Congratulations.");
1562 msg_format("%d¡ð¤ò¼õ¤±¼è¤Ã¤¿¡£", battle_odds);
1564 msg_format("You received %d gold.", battle_odds);
1566 p_ptr->au += battle_odds;
1571 msg_print("»ÄÇ°¤Ç¤·¤¿¡£");
1573 msg_print("You lost gold.");
1577 p_ptr->energy_need = 0;
1580 else if(turn - old_turn == 150*TURNS_PER_TICK)
1583 msg_print("¿½¤·Ê¬¤±¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤³¤Î¾¡Éé¤Ï°ú¤Ê¬¤±¤È¤µ¤»¤Æ¤¤¤¿¤À¤¤Þ¤¹¡£");
1585 msg_format("This battle have ended in a draw.");
1587 p_ptr->au += kakekin;
1589 p_ptr->energy_need = 0;
1594 /* Every 20 game turns */
1595 if (turn % TURNS_PER_TICK) return;
1597 /*** Check the Time and Load ***/
1599 if (!(turn % (50*TURNS_PER_TICK)))
1601 /* Check time and load */
1602 if ((0 != check_time()) || (0 != check_load()))
1605 if (closing_flag <= 2)
1610 /* Count warnings */
1615 msg_print("¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¸¤«¤«¤Ã¤Æ¤¤¤Þ¤¹...");
1616 msg_print("¥²¡¼¥à¤ò½ªÎ»¤¹¤ë¤«¥»¡¼¥Ö¤¹¤ë¤«¤·¤Æ²¼¤µ¤¤¡£");
1618 msg_print("The gates to ANGBAND are closing...");
1619 msg_print("Please finish up and/or save your game.");
1629 msg_print("º£¡¢¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¶¤µ¤ì¤Þ¤·¤¿¡£");
1631 msg_print("The gates to ANGBAND are now closed.");
1639 p_ptr->leaving = TRUE;
1644 /*** Attempt timed autosave ***/
1645 if (autosave_t && autosave_freq && !p_ptr->inside_battle)
1647 if (!(turn % ((s32b)autosave_freq * TURNS_PER_TICK)))
1648 do_cmd_save_game(TRUE);
1654 msg_print("²¿¤«¤¬Ê¹¤³¤¨¤¿¡£");
1656 msg_print("You hear noise.");
1660 /*** Handle the wilderness/town (sunshine) ***/
1662 /* While in town/wilderness */
1663 if (!dun_level && !p_ptr->inside_quest && !p_ptr->inside_battle && !p_ptr->inside_arena && !p_ptr->wild_mode)
1665 /* Hack -- Daybreak/Nighfall in town */
1666 if (!(turn % ((TURNS_PER_TICK * TOWN_DAWN) / 2)))
1670 /* Check for dawn */
1671 dawn = (!(turn % (TURNS_PER_TICK * TOWN_DAWN)));
1678 msg_print("Ì뤬ÌÀ¤±¤¿¡£");
1680 msg_print("The sun has risen.");
1684 /* Hack -- Scan the town */
1685 for (y = 0; y < cur_hgt; y++)
1687 for (x = 0; x < cur_wid; x++)
1689 /* Get the cave grid */
1690 c_ptr = &cave[y][x];
1693 c_ptr->info |= (CAVE_GLOW);
1695 /* Hack -- Memorize lit grids if allowed */
1696 if (view_perma_grids) c_ptr->info |= (CAVE_MARK);
1698 /* Hack -- Notice spot */
1709 msg_print("Æü¤¬ÄÀ¤ó¤À¡£");
1711 msg_print("The sun has fallen.");
1715 /* Hack -- Scan the town */
1716 for (y = 0; y < cur_hgt; y++)
1718 for (x = 0; x < cur_wid; x++)
1720 /* Get the cave grid */
1721 c_ptr = &cave[y][x];
1723 /* Darken "boring" features */
1724 if ((c_ptr->feat <= FEAT_INVIS) ||
1725 ((c_ptr->feat >= FEAT_DEEP_WATER) &&
1726 (c_ptr->feat <= FEAT_MOUNTAIN) &&
1727 (c_ptr->feat != FEAT_MUSEUM)) ||
1728 (x == 0) || (x == cur_wid-1) ||
1729 (y == 0) || (y == cur_hgt-1))
1731 /* Forget the grid */
1732 c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK);
1734 /* Hack -- Notice spot */
1741 /* Update the monsters */
1742 p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
1745 p_ptr->redraw |= (PR_MAP);
1748 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1752 /* Set back the rewards once a day */
1753 if (!(turn % (TURNS_PER_TICK*10 * STORE_TURNS)))
1757 /* Reset the rewards */
1758 for (n = 0; n < MAX_BACT; n++)
1760 p_ptr->rewards[n] = FALSE;
1765 if (cheat_xtra) msg_print("Êó½·¤ò¥ê¥»¥Ã¥È");
1767 if (cheat_xtra) msg_print("Rewards reset.");
1773 /*** Process the monsters ***/
1775 /* Check for creature generation. */
1776 if (one_in_(d_info[dungeon_type].max_m_alloc_chance) &&
1777 !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->inside_battle)
1779 /* Make a new monster */
1780 (void)alloc_monster(MAX_SIGHT + 5, FALSE);
1783 /* Hack -- Check for creature regeneration */
1784 if (!(turn % (TURNS_PER_TICK*10)) && !p_ptr->inside_battle) regen_monsters();
1785 if (!(turn % (TURNS_PER_TICK*3))) regen_captured_monsters();
1788 /*** Damage over Time ***/
1790 /* Take damage from poison */
1791 if (p_ptr->poisoned && !p_ptr->invuln)
1795 take_hit(DAMAGE_NOESCAPE, 1, "ÆÇ", -1);
1797 take_hit(DAMAGE_NOESCAPE, 1, "poison", -1);
1803 /* (Vampires) Take damage from sunlight */
1804 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
1806 if (!dun_level && !p_ptr->resist_lite && !p_ptr->invuln && is_daytime())
1808 if (cave[py][px].info & CAVE_GLOW)
1812 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª");
1813 take_hit(DAMAGE_NOESCAPE, 1, "Æü¸÷", -1);
1815 msg_print("The sun's rays scorch your undead flesh!");
1816 take_hit(DAMAGE_NOESCAPE, 1, "sunlight", -1);
1819 cave_no_regen = TRUE;
1823 if (inventory[INVEN_LITE].tval && (inventory[INVEN_LITE].name2 != EGO_LITE_DARKNESS) &&
1824 !p_ptr->resist_lite)
1826 object_type * o_ptr = &inventory[INVEN_LITE];
1827 char o_name [MAX_NLEN];
1828 char ouch [MAX_NLEN+40];
1830 /* Get an object description */
1831 object_desc(o_name, o_ptr, FALSE, 0);
1834 msg_format("%s¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª", o_name);
1836 msg_format("The %s scorches your undead flesh!", o_name);
1840 cave_no_regen = TRUE;
1842 /* Get an object description */
1843 object_desc(o_name, o_ptr, TRUE, 0);
1846 sprintf(ouch, "%s¤òÁõÈ÷¤·¤¿¥À¥á¡¼¥¸", o_name);
1848 sprintf(ouch, "wielding %s", o_name);
1851 if (!p_ptr->invuln) take_hit(DAMAGE_NOESCAPE, 1, ouch, -1);
1855 if ((cave[py][px].feat == FEAT_SHAL_LAVA) &&
1856 !p_ptr->invuln && !p_ptr->immune_fire && !p_ptr->ffall)
1858 int damage = 3000 + randint0(2000);
1860 if (prace_is_(RACE_ENT)) damage += damage/3;
1862 if (p_ptr->resist_fire) damage = damage / 3;
1863 if (p_ptr->oppose_fire) damage = damage / 3;
1864 damage = damage / 100 + (randint0(100) < (damage % 100));
1870 msg_print("ÍÏ´ä¤Ç²Ð½ý¤·¤¿¡ª");
1871 take_hit(DAMAGE_NOESCAPE, damage, "Àõ¤¤ÍÏ´äή", -1);
1873 msg_print("The lava burns you!");
1874 take_hit(DAMAGE_NOESCAPE, damage, "shallow lava", -1);
1877 cave_no_regen = TRUE;
1881 else if ((cave[py][px].feat == FEAT_DEEP_LAVA) &&
1882 !p_ptr->invuln && !p_ptr->immune_fire)
1884 int damage = 6000 + randint0(4000);
1889 if (p_ptr->resist_fire) damage = damage / 3;
1890 if (p_ptr->oppose_fire) damage = damage / 3;
1894 damage = damage / 5;
1897 message = "Ç®¤Ç²Ð½ý¤·¤¿¡ª";
1898 hit_from = "¿¼¤¤ÍÏ´äή¤Î¾å¤ËÉâÍ·¤·¤¿¥À¥á¡¼¥¸";
1900 message = "The heat burns you!";
1901 hit_from = "flying over deep lava";
1908 message = "ÍÏ´ä¤Ç²Ð½ý¤·¤¿¡ª";
1909 hit_from = "¿¼¤¤ÍÏ´äή";
1911 message = "The lava burns you!";
1912 hit_from = "deep lava";
1917 damage = damage / 100 + (randint0(100) < (damage % 100));
1922 take_hit(DAMAGE_NOESCAPE, damage, hit_from, -1);
1924 cave_no_regen = TRUE;
1928 else if ((cave[py][px].feat == FEAT_DEEP_WATER) && !p_ptr->ffall && !p_ptr->can_swim)
1930 if (p_ptr->total_weight > (((u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2))
1934 msg_print("Å®¤ì¤Æ¤¤¤ë¡ª");
1935 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), "Å®¤ì", -1);
1937 msg_print("You are drowning!");
1938 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), "drowning", -1);
1941 cave_no_regen = TRUE;
1948 if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !p_ptr->immune_fire)
1950 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1951 if (prace_is_(RACE_ENT)) damage += damage/3;
1952 if (p_ptr->resist_fire) damage = damage / 3;
1953 if (p_ptr->oppose_fire) damage = damage / 3;
1955 msg_print("Ç®¤¤¡ª");
1956 take_hit(DAMAGE_NOESCAPE, damage, "±ê¤Î¥ª¡¼¥é", -1);
1958 msg_print("It's hot!");
1959 take_hit(DAMAGE_NOESCAPE, damage, "Fire aura", -1);
1962 if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !p_ptr->immune_elec)
1964 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1965 if (p_ptr->resist_elec) damage = damage / 3;
1966 if (p_ptr->oppose_elec) damage = damage / 3;
1968 msg_print("Äˤ¤¡ª");
1969 take_hit(DAMAGE_NOESCAPE, damage, "Åŵ¤¤Î¥ª¡¼¥é", -1);
1971 msg_print("It hurts!");
1972 take_hit(DAMAGE_NOESCAPE, damage, "Elec aura", -1);
1975 if ((r_info[m_list[p_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !p_ptr->immune_cold)
1977 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1978 if (p_ptr->resist_cold) damage = damage / 3;
1979 if (p_ptr->oppose_cold) damage = damage / 3;
1981 msg_print("Î䤿¤¤¡ª");
1982 take_hit(DAMAGE_NOESCAPE, damage, "Î䵤¤Î¥ª¡¼¥é", -1);
1984 msg_print("It's cold!");
1985 take_hit(DAMAGE_NOESCAPE, damage, "Cold aura", -1);
1990 /* Spectres -- take damage when moving through walls */
1992 * Added: ANYBODY takes damage if inside through walls
1993 * without wraith form -- NOTE: Spectres will never be
1994 * reduced below 0 hp by being inside a stone wall; others
1997 if (!cave_floor_bold(py, px))
1999 /* Player can walk through trees */
2000 if ((cave[py][px].feat == FEAT_TREES) || ((cave[py][px].feat == FEAT_MOUNTAIN) && !dun_level && p_ptr->ffall))
2004 else if (!p_ptr->invuln && !p_ptr->wraith_form && !p_ptr->kabenuke &&
2005 ((p_ptr->chp > (p_ptr->lev / 5)) || !p_ptr->pass_wall))
2009 cave_no_regen = TRUE;
2011 if (p_ptr->pass_wall)
2014 msg_print("ÂΤÎʬ»Ò¤¬Ê¬²ò¤·¤¿µ¤¤¬¤¹¤ë¡ª");
2017 msg_print("Your molecules feel disrupted!");
2018 dam_desc = "density";
2025 msg_print("Êø¤ì¤¿´ä¤Ë²¡¤·ÄÙ¤µ¤ì¤¿¡ª");
2026 dam_desc = "¹Å¤¤´ä";
2028 msg_print("You are being crushed!");
2029 dam_desc = "solid rock";
2034 take_hit(DAMAGE_NOESCAPE, 1 + (p_ptr->lev / 5), dam_desc, -1);
2040 monster_race *r_ptr;
2042 if (min != prev_min)
2045 bool old_inside_battle = p_ptr->inside_battle;
2047 do_cmd_write_nikki(NIKKI_HIGAWARI, 0, NULL);
2049 p_ptr->inside_battle = TRUE;
2050 get_mon_num_prep(NULL,NULL);
2052 for (i = 0; i < max_d_idx; i++)
2054 if (max_dlv[i] < d_info[i].mindepth) continue;
2055 if (max_dl < max_dlv[i]) max_dl = max_dlv[i];
2059 today_mon = get_mon_num(max_dl);
2060 r_ptr = &r_info[today_mon];
2062 if (r_ptr->flags1 & RF1_UNIQUE) continue;
2063 if (r_ptr->flags7 & (RF7_UNIQUE_7 | RF7_UNIQUE2)) continue;
2064 if (r_ptr->flags2 & (RF2_MULTIPLY)) continue;
2065 if (!(r_ptr->flags9 & RF9_DROP_CORPSE) || !(r_ptr->flags9 & RF9_DROP_SKELETON)) continue;
2066 if (r_ptr->level < MIN(max_dl/2, 40)) continue;
2067 if (r_ptr->rarity > 10) continue;
2068 if (r_ptr->level == 0) continue;
2071 p_ptr->today_mon = 0;
2072 p_ptr->inside_battle = old_inside_battle;
2076 /* Nightmare mode activates the TY_CURSE at midnight */
2077 if (ironman_nightmare)
2079 /* Require exact minute */
2080 if (min != prev_min)
2082 /* Every 15 minutes after 11:00 pm */
2083 if ((hour == 23) && !(min % 15))
2093 msg_print("±ó¤¯¤ÇÉÔµ¤Ì£¤Ê¾â¤Î²»¤¬ÌĤä¿¡£");
2095 msg_print("You hear a distant bell toll ominously.");
2103 msg_print("±ó¤¯¤Ç¾â¤¬Æó²óÌĤä¿¡£");
2105 msg_print("A distant bell sounds twice.");
2113 msg_print("±ó¤¯¤Ç¾â¤¬»°²óÌĤä¿¡£");
2115 msg_print("A distant bell sounds three times.");
2123 msg_print("±ó¤¯¤Ç¾â¤¬»Í²óÌĤä¿¡£");
2125 msg_print("A distant bell tolls four times.");
2133 /* TY_CURSE activates at mignight! */
2140 msg_print("±ó¤¯¤Ç¾â¤¬²¿²ó¤âÌĤꡢ»à¤ó¤À¤è¤¦¤ÊÀŤ±¤µ¤ÎÃæ¤Ø¾Ã¤¨¤Æ¤¤¤Ã¤¿¡£");
2142 msg_print("A distant bell tolls many times, fading into an deathly silence.");
2145 activate_ty_curse(FALSE, &count);
2150 /* Take damage from cuts */
2151 if (p_ptr->cut && !p_ptr->invuln)
2153 /* Mortal wound or Deep Gash */
2154 if (p_ptr->cut > 1000)
2159 else if (p_ptr->cut > 200)
2165 else if (p_ptr->cut > 100)
2170 else if (p_ptr->cut > 50)
2175 else if (p_ptr->cut > 25)
2180 else if (p_ptr->cut > 10)
2193 take_hit(DAMAGE_NOESCAPE, i, "Ã×Ì¿½ý", -1);
2195 take_hit(DAMAGE_NOESCAPE, i, "a fatal wound", -1);
2201 /*** Check the Food, and Regenerate ***/
2203 if (!p_ptr->inside_battle)
2205 /* Digest normally */
2206 if (p_ptr->food < PY_FOOD_MAX)
2208 /* Every 100 game turns */
2209 if (!(turn % (TURNS_PER_TICK*5)))
2211 /* Basic digestion rate based on speed */
2212 i = /* extract_energy[p_ptr->pspeed] * 2;*/
2213 ((p_ptr->pspeed > 199) ? 49 : ((p_ptr->pspeed < 0) ?
2214 1 : extract_energy[p_ptr->pspeed]));
2216 /* Regeneration takes more food */
2217 if (p_ptr->regenerate) i += 20;
2218 if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK)) i+= 20;
2219 if (p_ptr->cursed & TRC_FAST_DIGEST) i += 30;
2221 /* Slow digestion takes less food */
2222 if (p_ptr->slow_digest) i -= 5;
2224 /* Minimal digestion */
2226 /* Maximal digestion */
2227 if (i > 100) i = 100;
2229 /* Digest some food */
2230 (void)set_food(p_ptr->food - i);
2234 /* Digest quickly when gorged */
2237 /* Digest a lot of food */
2238 (void)set_food(p_ptr->food - 100);
2242 /* Starve to death (slowly) */
2243 if (p_ptr->food < PY_FOOD_STARVE)
2245 /* Calculate damage */
2246 i = (PY_FOOD_STARVE - p_ptr->food) / 10;
2250 if (!p_ptr->invuln) take_hit(DAMAGE_LOSELIFE, i, "¶õÊ¢", -1);
2252 if (!p_ptr->invuln) take_hit(DAMAGE_LOSELIFE, i, "starvation", -1);
2257 /* Default regeneration */
2258 regen_amount = PY_REGEN_NORMAL;
2261 if (p_ptr->food < PY_FOOD_WEAK)
2263 /* Lower regeneration */
2264 if (p_ptr->food < PY_FOOD_STARVE)
2268 else if (p_ptr->food < PY_FOOD_FAINT)
2270 regen_amount = PY_REGEN_FAINT;
2274 regen_amount = PY_REGEN_WEAK;
2278 if ((p_ptr->food < PY_FOOD_FAINT) && !p_ptr->inside_battle)
2280 /* Faint occasionally */
2281 if (!p_ptr->paralyzed && (randint0(100) < 10))
2285 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤À䤷¤Æ¤·¤Þ¤Ã¤¿¡£");
2287 msg_print("You faint from the lack of food.");
2292 /* Hack -- faint (bypass free action) */
2293 (void)set_paralyzed(p_ptr->paralyzed + 1 + randint0(5));
2299 /* Are we walking the pattern? */
2300 if (pattern_effect())
2302 cave_no_regen = TRUE;
2306 /* Regeneration ability */
2307 if (p_ptr->regenerate)
2309 regen_amount = regen_amount * 2;
2311 if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK))
2315 if (p_ptr->cursed & TRC_SLOW_REGEN)
2322 /* Searching or Resting */
2323 if ((p_ptr->action == ACTION_SEARCH) || (p_ptr->action == ACTION_REST))
2325 regen_amount = regen_amount * 2;
2328 upkeep_factor = calculate_upkeep();
2330 /* Regenerate the mana */
2331 /* if (p_ptr->csp < p_ptr->msp) */
2335 s32b upkeep_regen = ((100 - upkeep_factor) * regen_amount);
2336 if ((p_ptr->action == ACTION_LEARN) || (p_ptr->action == ACTION_HAYAGAKE)) upkeep_regen -= regen_amount;
2337 regenmana(upkeep_regen/100);
2339 #ifdef TRACK_FRIENDS
2343 msg_format("£Í£Ð²óÉü: %d/%d", upkeep_regen, regen_amount);
2345 msg_format("Regen: %d/%d", upkeep_regen, regen_amount);
2349 #endif /* TRACK_FRIENDS */
2352 else if (p_ptr->action != ACTION_LEARN)
2354 regenmana(regen_amount);
2357 if (p_ptr->pclass == CLASS_MAGIC_EATER)
2359 regenmagic(regen_amount);
2362 if ((p_ptr->csp == 0) && (p_ptr->csp_frac == 0))
2364 while (upkeep_factor > 100)
2367 msg_print("¤³¤ó¤Ê¤Ë¿¤¯¤Î¥Ú¥Ã¥È¤òÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
2369 msg_print("Such much pets cannot be controled at once!");
2372 do_cmd_pet_dismiss();
2374 upkeep_factor = calculate_upkeep();
2377 msg_format("°Ý»ý£Í£Ð¤Ï %d%%", upkeep_factor);
2379 msg_format("Upkeep: %d%% mana.", upkeep_factor);
2385 /* Poisoned or cut yields no healing */
2386 if (p_ptr->poisoned) regen_amount = 0;
2387 if (p_ptr->cut) regen_amount = 0;
2389 /* Special floor -- Pattern, in a wall -- yields no healing */
2390 if (cave_no_regen) regen_amount = 0;
2392 regen_amount = (regen_amount * mutant_regenerate_mod) / 100;
2394 /* Regenerate Hit Points if needed */
2395 if ((p_ptr->chp < p_ptr->mhp) && !cave_no_regen)
2397 if ((cave[py][px].feat < FEAT_PATTERN_END) &&
2398 (cave[py][px].feat >= FEAT_PATTERN_START))
2400 regenhp(regen_amount / 5); /* Hmmm. this should never happen? */
2404 regenhp(regen_amount);
2409 /*** Timeout Various Things ***/
2412 if (p_ptr->tim_mimic)
2414 (void)set_mimic(p_ptr->tim_mimic - 1, p_ptr->mimic_form, TRUE);
2417 /* Hack -- Hallucinating */
2420 (void)set_image(p_ptr->image - dec_count);
2426 (void)set_blind(p_ptr->blind - dec_count);
2429 /* Times see-invisible */
2430 if (p_ptr->tim_invis)
2432 (void)set_tim_invis(p_ptr->tim_invis - 1, TRUE);
2443 (void)set_tim_esp(p_ptr->tim_esp - 1, TRUE);
2446 /* Timed temporary elemental brands. -LM- */
2447 if (p_ptr->ele_attack)
2449 p_ptr->ele_attack--;
2451 /* Clear all temporary elemental brands. */
2452 if (!p_ptr->ele_attack) set_ele_attack(0, 0);
2455 /* Timed temporary elemental immune. -LM- */
2456 if (p_ptr->ele_immune)
2458 p_ptr->ele_immune--;
2460 /* Clear all temporary elemental brands. */
2461 if (!p_ptr->ele_immune) set_ele_immune(0, 0);
2464 /* Timed infra-vision */
2465 if (p_ptr->tim_infra)
2467 (void)set_tim_infra(p_ptr->tim_infra - 1, TRUE);
2471 if (p_ptr->tim_stealth)
2473 (void)set_tim_stealth(p_ptr->tim_stealth - 1, TRUE);
2476 /* Timed levitation */
2477 if (p_ptr->tim_ffall)
2479 (void)set_tim_ffall(p_ptr->tim_ffall - 1, TRUE);
2482 /* Timed sh_touki */
2483 if (p_ptr->tim_sh_touki)
2485 (void)set_tim_sh_touki(p_ptr->tim_sh_touki - 1, TRUE);
2489 if (p_ptr->tim_sh_fire)
2491 (void)set_tim_sh_fire(p_ptr->tim_sh_fire - 1, TRUE);
2495 if (p_ptr->tim_sh_holy)
2497 (void)set_tim_sh_holy(p_ptr->tim_sh_holy - 1, TRUE);
2501 if (p_ptr->tim_eyeeye)
2503 (void)set_tim_eyeeye(p_ptr->tim_eyeeye - 1, TRUE);
2506 /* Timed resist-magic */
2507 if (p_ptr->resist_magic)
2509 (void)set_resist_magic(p_ptr->resist_magic - 1, TRUE);
2512 /* Timed regeneration */
2513 if (p_ptr->tim_regen)
2515 (void)set_tim_regen(p_ptr->tim_regen - 1, TRUE);
2518 /* Timed resist nether */
2519 if (p_ptr->tim_res_nether)
2521 (void)set_tim_res_nether(p_ptr->tim_res_nether - 1, TRUE);
2524 /* Timed resist time */
2525 if (p_ptr->tim_res_time)
2527 (void)set_tim_res_time(p_ptr->tim_res_time - 1, TRUE);
2531 if (p_ptr->tim_reflect)
2533 (void)set_tim_reflect(p_ptr->tim_reflect - 1, TRUE);
2537 if (p_ptr->multishadow)
2539 (void)set_multishadow(p_ptr->multishadow - 1, TRUE);
2542 /* Timed Robe of dust */
2543 if (p_ptr->dustrobe)
2545 (void)set_dustrobe(p_ptr->dustrobe - 1, TRUE);
2548 /* Timed infra-vision */
2549 if (p_ptr->kabenuke)
2551 (void)set_kabenuke(p_ptr->kabenuke - 1, TRUE);
2555 if (p_ptr->paralyzed)
2557 (void)set_paralyzed(p_ptr->paralyzed - dec_count);
2561 if (p_ptr->confused)
2563 (void)set_confused(p_ptr->confused - dec_count);
2569 (void)set_afraid(p_ptr->afraid - dec_count);
2575 (void)set_fast(p_ptr->fast - 1, TRUE);
2581 (void)set_slow(p_ptr->slow - dec_count, TRUE);
2584 /* Protection from evil */
2585 if (p_ptr->protevil)
2587 (void)set_protevil(p_ptr->protevil - 1, TRUE);
2590 /* Invulnerability */
2593 (void)set_invuln(p_ptr->invuln - 1, TRUE);
2597 if (p_ptr->wraith_form)
2599 (void)set_wraith_form(p_ptr->wraith_form - 1, TRUE);
2605 (void)set_hero(p_ptr->hero - 1, TRUE);
2611 (void)set_shero(p_ptr->shero - 1, TRUE);
2617 (void)set_blessed(p_ptr->blessed - 1, TRUE);
2623 (void)set_shield(p_ptr->shield - 1, TRUE);
2627 if (p_ptr->tsubureru)
2629 (void)set_tsubureru(p_ptr->tsubureru - 1, TRUE);
2633 if (p_ptr->magicdef)
2635 (void)set_magicdef(p_ptr->magicdef - 1, TRUE);
2639 if (p_ptr->tsuyoshi)
2641 (void)set_tsuyoshi(p_ptr->tsuyoshi - 1, TRUE);
2645 if (p_ptr->oppose_acid)
2647 (void)set_oppose_acid(p_ptr->oppose_acid - 1, TRUE);
2650 /* Oppose Lightning */
2651 if (p_ptr->oppose_elec)
2653 (void)set_oppose_elec(p_ptr->oppose_elec - 1, TRUE);
2657 if (p_ptr->oppose_fire)
2659 (void)set_oppose_fire(p_ptr->oppose_fire - 1, TRUE);
2663 if (p_ptr->oppose_cold)
2665 (void)set_oppose_cold(p_ptr->oppose_cold - 1, TRUE);
2669 if (p_ptr->oppose_pois)
2671 (void)set_oppose_pois(p_ptr->oppose_pois - 1, TRUE);
2676 (void)set_ultimate_res(p_ptr->ult_res - 1, TRUE);
2679 /*** Poison and Stun and Cut ***/
2682 if (p_ptr->poisoned)
2684 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2686 /* Apply some healing */
2687 (void)set_poisoned(p_ptr->poisoned - adjust);
2693 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2695 /* Apply some healing */
2696 (void)set_stun(p_ptr->stun - adjust);
2702 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2704 /* Hack -- Truly "mortal" wound */
2705 if (p_ptr->cut > 1000) adjust = 0;
2707 /* Apply some healing */
2708 (void)set_cut(p_ptr->cut - adjust);
2713 /*** Process Light ***/
2715 /* Check for light being wielded */
2716 o_ptr = &inventory[INVEN_LITE];
2718 /* Burn some fuel in the current lite */
2719 if (o_ptr->tval == TV_LITE)
2721 /* Hack -- Use some fuel (except on artifacts) */
2722 if (!(artifact_p(o_ptr) || o_ptr->sval == SV_LITE_FEANOR) && (o_ptr->xtra4 > 0))
2724 /* Decrease life-span */
2725 if (o_ptr->name2 == EGO_LITE_LONG)
2727 if (turn % (TURNS_PER_TICK*2)) o_ptr->xtra4--;
2729 else o_ptr->xtra4--;
2731 /* Notice interesting fuel steps */
2732 notice_lite_change(o_ptr);
2736 /* Calculate torch radius */
2737 p_ptr->update |= (PU_TORCH);
2740 /*** Process mutation effects ***/
2741 if (p_ptr->muta2 && !p_ptr->inside_battle && !p_ptr->wild_mode)
2743 if ((p_ptr->muta2 & MUT2_BERS_RAGE) && one_in_(3000))
2747 msg_print("¥¦¥¬¥¡¥¡¥¢¡ª");
2748 msg_print("·ãÅܤÎȯºî¤Ë½±¤ï¤ì¤¿¡ª");
2750 msg_print("RAAAAGHH!");
2751 msg_print("You feel a fit of rage coming over you!");
2754 (void)set_shero(10 + randint1(p_ptr->lev), FALSE);
2757 if ((p_ptr->muta2 & MUT2_COWARDICE) && (randint1(3000) == 13))
2759 if (!(p_ptr->resist_fear || p_ptr->hero || p_ptr->shero))
2763 msg_print("¤È¤Æ¤â°Å¤¤... ¤È¤Æ¤â¶²¤¤¡ª");
2765 msg_print("It's so dark... so scary!");
2768 set_afraid(p_ptr->afraid + 13 + randint1(26));
2772 if ((p_ptr->muta2 & MUT2_RTELEPORT) && (randint1(5000) == 88))
2774 if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) &&
2779 /* Teleport player */
2781 msg_print("¤¢¤Ê¤¿¤Î°ÌÃÖ¤ÏÆÍÁ³¤Ò¤¸¤ç¤¦¤ËÉÔ³ÎÄê¤Ë¤Ê¤Ã¤¿...");
2783 msg_print("Your position suddenly seems very uncertain...");
2787 teleport_player(40);
2791 if ((p_ptr->muta2 & MUT2_ALCOHOL) && (randint1(6400) == 321))
2793 if (!p_ptr->resist_conf && !p_ptr->resist_chaos)
2796 p_ptr->redraw |= PR_EXTRA;
2798 msg_print("¤¤¤Ò¤¤¬¤â¡¼¤í¡¼¤È¤Ò¤Æ¤¤¿¤¤¬¤Õ¤ë...¥Ò¥Ã¥¯¡ª");
2800 msg_print("You feel a SSSCHtupor cOmINg over yOu... *HIC*!");
2805 if (!p_ptr->resist_conf)
2807 (void)set_confused(p_ptr->confused + randint0(20) + 15);
2810 if (!p_ptr->resist_chaos)
2815 if (one_in_(3)) lose_all_info();
2817 teleport_player(100);
2820 msg_print("¤¢¤Ê¤¿¤Ï¸«ÃΤé¤Ì¾ì½ê¤ÇÌܤ¬Àä᤿...Ƭ¤¬Äˤ¤¡£");
2821 msg_print("²¿¤â³Ð¤¨¤Æ¤¤¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ËÍ褿¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
2823 msg_print("You wake up somewhere with a sore head...");
2824 msg_print("You can't remember a thing, or how you got here!");
2833 msg_print("¤¡Á¤ì¤¤¤Ê¤Á¤ç¤ª¤Á¤ç¤é¤È¤ó¤ì¤¤¤ë¡Á");
2835 msg_print("Thishcischs GooDSChtuff!");
2838 (void)set_image(p_ptr->image + randint0(150) + 150);
2844 if ((p_ptr->muta2 & MUT2_HALLU) && (randint1(6400) == 42))
2846 if (!p_ptr->resist_chaos)
2849 p_ptr->redraw |= PR_EXTRA;
2850 (void)set_image(p_ptr->image + randint0(50) + 20);
2854 if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint1(3000) == 13))
2859 msg_print("¥Ö¥¥¡¼¡¼¥Ã¡ª¤ª¤Ã¤È¡£");
2861 msg_print("BRRAAAP! Oops.");
2865 fire_ball(GF_POIS, 0, p_ptr->lev, 3);
2868 if ((p_ptr->muta2 & MUT2_PROD_MANA) &&
2869 !p_ptr->anti_magic && one_in_(9000))
2874 msg_print("ËâË¡¤Î¥¨¥Í¥ë¥®¡¼¤¬ÆÍÁ³¤¢¤Ê¤¿¤ÎÃæ¤Ëή¤ì¹þ¤ó¤Ç¤¤¿¡ª¥¨¥Í¥ë¥®¡¼¤ò²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡ª");
2876 msg_print("Magical energy flows through you! You must release it!");
2881 (void)get_hack_dir(&dire);
2882 fire_ball(GF_MANA, dire, p_ptr->lev * 2, 3);
2885 if ((p_ptr->muta2 & MUT2_ATT_DEMON) &&
2886 !p_ptr->anti_magic && (randint1(6666) == 666))
2888 bool pet = one_in_(6);
2889 u32b mode = PM_ALLOW_GROUP;
2891 if (pet) mode |= PM_FORCE_PET;
2892 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
2894 if (summon_specific((pet ? -1 : 0), py, px,
2895 dun_level, SUMMON_DEMON, mode))
2898 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤ò°ú¤´ó¤»¤¿¡ª");
2900 msg_print("You have attracted a demon!");
2907 if ((p_ptr->muta2 & MUT2_SPEED_FLUX) && one_in_(6000))
2913 msg_print("ÀºÎÏŪ¤Ç¤Ê¤¯¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2915 msg_print("You feel less energetic.");
2918 if (p_ptr->fast > 0)
2924 set_slow(randint1(30) + 10, FALSE);
2930 msg_print("ÀºÎÏŪ¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2932 msg_print("You feel more energetic.");
2935 if (p_ptr->slow > 0)
2941 set_fast(randint1(30) + 10, FALSE);
2946 if ((p_ptr->muta2 & MUT2_BANISH_ALL) && one_in_(9000))
2950 msg_print("ÆÍÁ³¤Û¤È¤ó¤É¸ÉÆȤˤʤ俵¤¤¬¤¹¤ë¡£");
2952 msg_print("You suddenly feel almost lonely.");
2955 banish_monsters(100);
2956 if (!dun_level && p_ptr->town_num)
2959 msg_print("Ź¤Î¼ç¿Í¤¬µÖ¤Ë¸þ¤«¤Ã¤ÆÁö¤Ã¤Æ¤¤¤ë¡ª");
2961 msg_print("You see one of the shopkeepers running for the hills!");
2964 store_shuffle(randint0(MAX_STORES));
2969 if ((p_ptr->muta2 & MUT2_EAT_LIGHT) && one_in_(3000))
2974 msg_print("±Æ¤Ë¤Ä¤Ä¤Þ¤ì¤¿¡£");
2976 msg_print("A shadow passes over you.");
2981 /* Absorb light from the current possition */
2982 if (cave[py][px].info & CAVE_GLOW)
2987 o_ptr = &inventory[INVEN_LITE];
2989 /* Absorb some fuel in the current lite */
2990 if (o_ptr->tval == TV_LITE)
2992 /* Use some fuel (except on artifacts) */
2993 if (!artifact_p(o_ptr) && (o_ptr->xtra4 > 0))
2995 /* Heal the player a bit */
2996 hp_player(o_ptr->xtra4 / 20);
2998 /* Decrease life-span of lite */
3002 msg_print("¸÷¸»¤«¤é¥¨¥Í¥ë¥®¡¼¤òµÛ¼ý¤·¤¿¡ª");
3004 msg_print("You absorb energy from your light!");
3008 /* Notice interesting fuel steps */
3009 notice_lite_change(o_ptr);
3014 * Unlite the area (radius 10) around player and
3015 * do 50 points damage to every affected monster
3017 unlite_area(50, 10);
3020 if ((p_ptr->muta2 & MUT2_ATT_ANIMAL) &&
3021 !p_ptr->anti_magic && one_in_(7000))
3023 bool pet = one_in_(3);
3024 u32b mode = PM_ALLOW_GROUP;
3026 if (pet) mode |= PM_FORCE_PET;
3027 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
3029 if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_ANIMAL, mode))
3032 msg_print("ưʪ¤ò°ú¤´ó¤»¤¿¡ª");
3034 msg_print("You have attracted an animal!");
3041 if ((p_ptr->muta2 & MUT2_RAW_CHAOS) &&
3042 !p_ptr->anti_magic && one_in_(8000))
3046 msg_print("¼þ¤ê¤Î¶õ´Ö¤¬ÏĤó¤Ç¤¤¤ëµ¤¤¬¤¹¤ë¡ª");
3048 msg_print("You feel the world warping around you!");
3052 fire_ball(GF_CHAOS, 0, p_ptr->lev, 8);
3054 if ((p_ptr->muta2 & MUT2_NORMALITY) && one_in_(5000))
3056 if (!lose_mutation(0))
3058 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
3060 msg_print("You feel oddly normal.");
3064 if ((p_ptr->muta2 & MUT2_WRAITH) && !p_ptr->anti_magic && one_in_(3000))
3068 msg_print("Èóʪ¼Á²½¤·¤¿¡ª");
3070 msg_print("You feel insubstantial!");
3074 set_wraith_form(randint1(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE);
3076 if ((p_ptr->muta2 & MUT2_POLY_WOUND) && one_in_(3000))
3080 if ((p_ptr->muta2 & MUT2_WASTING) && one_in_(3000))
3082 int which_stat = randint0(6);
3083 int sustained = FALSE;
3088 if (p_ptr->sustain_str) sustained = TRUE;
3091 if (p_ptr->sustain_int) sustained = TRUE;
3094 if (p_ptr->sustain_wis) sustained = TRUE;
3097 if (p_ptr->sustain_dex) sustained = TRUE;
3100 if (p_ptr->sustain_con) sustained = TRUE;
3103 if (p_ptr->sustain_chr) sustained = TRUE;
3107 msg_print("ÉÔÀµ¤Ê¾õÂÖ¡ª");
3109 msg_print("Invalid stat chosen!");
3119 msg_print("¼«Ê¬¤¬¿ê¼å¤·¤Æ¤¤¤¯¤Î¤¬Ê¬¤«¤ë¡ª");
3121 msg_print("You can feel yourself wasting away!");
3125 (void)dec_stat(which_stat, randint1(6) + 6, one_in_(3));
3128 if ((p_ptr->muta2 & MUT2_ATT_DRAGON) &&
3129 !p_ptr->anti_magic && one_in_(3000))
3131 bool pet = one_in_(5);
3132 u32b mode = PM_ALLOW_GROUP;
3134 if (pet) mode |= PM_FORCE_PET;
3135 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
3137 if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_DRAGON, mode))
3140 msg_print("¥É¥é¥´¥ó¤ò°ú¤´ó¤»¤¿¡ª");
3142 msg_print("You have attracted a dragon!");
3148 if ((p_ptr->muta2 & MUT2_WEIRD_MIND) && !p_ptr->anti_magic &&
3151 if (p_ptr->tim_esp > 0)
3154 msg_print("Àº¿À¤Ë¤â¤ä¤¬¤«¤«¤Ã¤¿¡ª");
3156 msg_print("Your mind feels cloudy!");
3159 set_tim_esp(0, TRUE);
3164 msg_print("Àº¿À¤¬¹¤¬¤Ã¤¿¡ª");
3166 msg_print("Your mind expands!");
3169 set_tim_esp(p_ptr->lev, FALSE);
3172 if ((p_ptr->muta2 & MUT2_NAUSEA) && !p_ptr->slow_digest &&
3177 msg_print("°ß¤¬áÛÚ»¤·¡¢¿©»ö¤ò¼º¤Ã¤¿¡ª");
3179 msg_print("Your stomach roils, and you lose your lunch!");
3183 set_food(PY_FOOD_WEAK);
3186 if ((p_ptr->muta2 & MUT2_WALK_SHAD) &&
3187 !p_ptr->anti_magic && one_in_(12000) && !p_ptr->inside_arena)
3192 if ((p_ptr->muta2 & MUT2_WARNING) && one_in_(1000))
3194 int danger_amount = 0;
3197 for (monster = 0; monster < m_max; monster++)
3199 monster_type *m_ptr = &m_list[monster];
3200 monster_race *r_ptr = &r_info[m_ptr->r_idx];
3202 /* Paranoia -- Skip dead monsters */
3203 if (!m_ptr->r_idx) continue;
3205 if (r_ptr->level >= p_ptr->lev)
3207 danger_amount += r_ptr->level - p_ptr->lev + 1;
3211 if (danger_amount > 100)
3213 msg_print("Èó¾ï¤Ë¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
3215 msg_print("You feel utterly terrified!");
3218 else if (danger_amount > 50)
3220 msg_print("¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
3222 msg_print("You feel terrified!");
3225 else if (danger_amount > 20)
3227 msg_print("Èó¾ï¤Ë¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
3229 msg_print("You feel very worried!");
3232 else if (danger_amount > 10)
3234 msg_print("¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
3236 msg_print("You feel paranoid!");
3239 else if (danger_amount > 5)
3241 msg_print("¤Û¤È¤ó¤É°ÂÁ´¤Êµ¤¤¬¤¹¤ë¡£");
3243 msg_print("You feel almost safe.");
3248 msg_print("¼ä¤·¤¤µ¤¤¬¤¹¤ë¡£");
3250 msg_print("You feel lonely.");
3254 if ((p_ptr->muta2 & MUT2_INVULN) && !p_ptr->anti_magic &&
3259 msg_print("̵Ũ¤Êµ¤¤¬¤¹¤ë¡ª");
3261 msg_print("You feel invincible!");
3265 (void)set_invuln(randint1(8) + 8, FALSE);
3267 if ((p_ptr->muta2 & MUT2_SP_TO_HP) && one_in_(2000))
3269 int wounds = p_ptr->mhp - p_ptr->chp;
3273 int healing = p_ptr->csp;
3275 if (healing > wounds)
3281 p_ptr->csp -= healing;
3284 if ((p_ptr->muta2 & MUT2_HP_TO_SP) && !p_ptr->anti_magic &&
3287 int wounds = p_ptr->msp - p_ptr->csp;
3291 int healing = p_ptr->chp;
3293 if (healing > wounds)
3298 p_ptr->csp += healing;
3300 take_hit(DAMAGE_LOSELIFE, healing, "Ƭ¤Ë¾º¤Ã¤¿·ì", -1);
3302 take_hit(DAMAGE_LOSELIFE, healing, "blood rushing to the head", -1);
3307 if ((p_ptr->muta2 & MUT2_DISARM) && one_in_(10000))
3313 msg_print("¤¬¤â¤Ä¤ì¤Æž¤ó¤À¡ª");
3314 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), "žÅÝ", -1);
3316 msg_print("You trip over your own feet!");
3317 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), "tripping", -1);
3322 if (buki_motteruka(INVEN_RARM))
3324 int slot = INVEN_RARM;
3325 o_ptr = &inventory[INVEN_RARM];
3326 if (buki_motteruka(INVEN_LARM) && one_in_(2))
3328 o_ptr = &inventory[INVEN_LARM];
3331 if (!cursed_p(o_ptr))
3334 msg_print("Éð´ï¤òÍ¤Æ¤·¤Þ¤Ã¤¿¡ª");
3336 msg_print("You drop your weapon!");
3339 inven_drop(slot, 1);
3346 /*** Process Inventory ***/
3348 if ((p_ptr->cursed & TRC_P_FLAG_MASK) && !p_ptr->wild_mode)
3351 * Hack: Uncursed teleporting items (e.g. Trump Weapons)
3352 * can actually be useful!
3354 if ((p_ptr->cursed & TRC_TELEPORT_SELF) && one_in_(200))
3357 if (get_check_strict("¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©", CHECK_OKAY_CANCEL))
3359 if (get_check_strict("Teleport? ", CHECK_OKAY_CANCEL))
3363 teleport_player(50);
3366 /* Make a chainsword noise */
3367 if ((p_ptr->cursed & TRC_CHAINSWORD) && one_in_(CHAINSWORD_NOISE))
3371 if (!get_rnd_line("chainswd_j.txt", 0, noise))
3373 if (!get_rnd_line("chainswd.txt", 0, noise))
3376 disturb(FALSE, FALSE);
3379 if ((p_ptr->cursed & TRC_TY_CURSE) && one_in_(TY_CURSE_CHANCE))
3382 (void)activate_ty_curse(FALSE, &count);
3384 /* Handle experience draining */
3385 if ((p_ptr->cursed & TRC_DRAIN_EXP) && one_in_(4))
3387 p_ptr->exp -= (p_ptr->lev+1)/2;
3388 if (p_ptr->exp < 0) p_ptr->exp = 0;
3389 p_ptr->max_exp -= (p_ptr->lev+1)/2;
3390 if (p_ptr->max_exp < 0) p_ptr->max_exp = 0;
3393 /* Add light curse (Later) */
3394 if ((p_ptr->cursed & TRC_ADD_L_CURSE) && one_in_(2000))
3399 o_ptr = choose_cursed_obj_name(TRC_ADD_L_CURSE);
3401 new_curse = get_curse(0, o_ptr);
3402 if (!(o_ptr->curse_flags & new_curse))
3404 char o_name[MAX_NLEN];
3406 object_desc(o_name, o_ptr, FALSE, 0);
3408 o_ptr->curse_flags |= new_curse;
3410 msg_format("°°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬%s¤ò¤È¤ê¤Þ¤¤¤¿...", o_name);
3412 msg_format("There is a malignant black aura surrounding %s...", o_name);
3415 o_ptr->feeling = FEEL_NONE;
3417 p_ptr->update |= (PU_BONUS);
3420 /* Add heavy curse (Later) */
3421 if ((p_ptr->cursed & TRC_ADD_H_CURSE) && one_in_(2000))
3426 o_ptr = choose_cursed_obj_name(TRC_ADD_H_CURSE);
3428 new_curse = get_curse(1, o_ptr);
3429 if (!(o_ptr->curse_flags & new_curse))
3431 char o_name[MAX_NLEN];
3433 object_desc(o_name, o_ptr, FALSE, 0);
3435 o_ptr->curse_flags |= new_curse;
3437 msg_format("°°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬%s¤ò¤È¤ê¤Þ¤¤¤¿...", o_name);
3439 msg_format("There is a malignant black aura surrounding %s...", o_name);
3442 o_ptr->feeling = FEEL_NONE;
3444 p_ptr->update |= (PU_BONUS);
3448 if ((p_ptr->cursed & TRC_CALL_ANIMAL) && one_in_(2500))
3450 if (summon_specific(0, py, px, dun_level, SUMMON_ANIMAL,
3451 (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
3453 char o_name[MAX_NLEN];
3455 object_desc(o_name, choose_cursed_obj_name(TRC_CALL_ANIMAL), FALSE, 0);
3457 msg_format("%s¤¬Æ°Êª¤ò°ú¤´ó¤»¤¿¡ª", o_name);
3459 msg_format("%s have attracted an animal!", o_name);
3466 if ((p_ptr->cursed & TRC_CALL_DEMON) && one_in_(1111))
3468 if (summon_specific(0, py, px, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
3470 char o_name[MAX_NLEN];
3472 object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DEMON), FALSE, 0);
3474 msg_format("%s¤¬°Ëâ¤ò°ú¤´ó¤»¤¿¡ª", o_name);
3476 msg_format("%s have attracted a demon!", o_name);
3483 if ((p_ptr->cursed & TRC_CALL_DRAGON) && one_in_(800))
3485 if (summon_specific(0, py, px, dun_level, SUMMON_DRAGON,
3486 (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
3488 char o_name[MAX_NLEN];
3490 object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DRAGON), FALSE, 0);
3492 msg_format("%s¤¬¥É¥é¥´¥ó¤ò°ú¤´ó¤»¤¿¡ª", o_name);
3494 msg_format("%s have attracted an animal!", o_name);
3500 if ((p_ptr->cursed & TRC_COWARDICE) && one_in_(1500))
3502 if (!(p_ptr->resist_fear || p_ptr->hero || p_ptr->shero))
3506 msg_print("¤È¤Æ¤â°Å¤¤... ¤È¤Æ¤â¶²¤¤¡ª");
3508 msg_print("It's so dark... so scary!");
3511 set_afraid(p_ptr->afraid + 13 + randint1(26));
3514 /* Teleport player */
3515 if ((p_ptr->cursed & TRC_TELEPORT) && one_in_(200) && !p_ptr->anti_tele)
3519 /* Teleport player */
3520 teleport_player(40);
3522 /* Handle HP draining */
3523 if ((p_ptr->cursed & TRC_DRAIN_HP) && one_in_(666))
3525 char o_name[MAX_NLEN];
3527 object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_HP), FALSE, 0);
3529 msg_format("%s¤Ï¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª", o_name);
3531 msg_format("%s drains HP from you!", o_name);
3533 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev*2, 100), o_name, -1);
3535 /* Handle mana draining */
3536 if ((p_ptr->cursed & TRC_DRAIN_MANA) && one_in_(666))
3538 char o_name[MAX_NLEN];
3540 object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_MANA), FALSE, 0);
3542 msg_format("%s¤Ï¤¢¤Ê¤¿¤ÎËâÎϤòµÛ¼ý¤·¤¿¡ª", o_name);
3544 msg_format("%s drains mana from you!", o_name);
3546 p_ptr->csp -= MIN(p_ptr->lev, 50);
3550 p_ptr->csp_frac = 0;
3552 p_ptr->redraw |= PR_MANA;
3556 /* Rarely, take damage from the Jewel of Judgement */
3557 if (one_in_(999) && !p_ptr->anti_magic)
3559 if ((inventory[INVEN_LITE].tval) &&
3560 (inventory[INVEN_LITE].sval == SV_LITE_THRAIN))
3563 msg_print("¡Ø¿³È½¤ÎÊõÀС٤Ϥ¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª");
3564 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "¿³È½¤ÎÊõÀÐ", -1);
3566 msg_print("The Jewel of Judgement drains life from you!");
3567 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "the Jewel of Judgement", -1);
3574 /* Process equipment */
3575 for (j = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
3577 /* Get the object */
3578 o_ptr = &inventory[i];
3580 /* Skip non-objects */
3581 if (!o_ptr->k_idx) continue;
3583 /* Recharge activatable objects */
3584 if (o_ptr->timeout > 0)
3589 /* Notice changes */
3590 if (!o_ptr->timeout)
3592 recharged_notice(o_ptr);
3598 /* Notice changes */
3602 p_ptr->window |= (PW_EQUIP);
3607 * Recharge rods. Rods now use timeout to control charging status,
3608 * and each charging rod in a stack decreases the stack's timeout by
3609 * one per turn. -LM-
3611 for (j = 0, i = 0; i < INVEN_PACK; i++)
3613 o_ptr = &inventory[i];
3614 k_ptr = &k_info[o_ptr->k_idx];
3616 /* Skip non-objects */
3617 if (!o_ptr->k_idx) continue;
3619 /* Examine all charging rods or stacks of charging rods. */
3620 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
3622 /* Determine how many rods are charging. */
3623 temp = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
3624 if (temp > o_ptr->number) temp = o_ptr->number;
3626 /* Decrease timeout by that number. */
3627 o_ptr->timeout -= temp;
3629 /* Boundary control. */
3630 if (o_ptr->timeout < 0) o_ptr->timeout = 0;
3632 /* Notice changes, provide message if object is inscribed. */
3633 if (!(o_ptr->timeout))
3635 recharged_notice(o_ptr);
3641 /* Notice changes */
3645 p_ptr->notice |= (PN_COMBINE);
3648 p_ptr->window |= (PW_INVEN);
3652 /* Feel the inventory */
3657 /*** Process Objects ***/
3659 /* Process objects */
3660 for (i = 1; i < o_max; i++)
3665 /* Skip dead objects */
3666 if (!o_ptr->k_idx) continue;
3668 /* Recharge rods on the ground. No messages. */
3669 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
3672 o_ptr->timeout -= o_ptr->number;
3674 /* Boundary control. */
3675 if (o_ptr->timeout < 0) o_ptr->timeout = 0;
3680 /*** Involuntary Movement ***/
3682 /* Delayed Word-of-Recall */
3683 if (p_ptr->word_recall)
3686 * HACK: Autosave BEFORE resetting the recall counter (rr9)
3687 * The player is yanked up/down as soon as
3688 * he loads the autosaved game.
3690 if (autosave_l && (p_ptr->word_recall == 1) && !p_ptr->inside_battle)
3691 do_cmd_save_game(TRUE);
3693 /* Count down towards recall */
3694 p_ptr->word_recall--;
3696 p_ptr->redraw |= (PR_STATUS);
3698 /* Activate the recall */
3699 if (!p_ptr->word_recall)
3704 /* Determine the level */
3705 if (dun_level || p_ptr->inside_quest)
3708 msg_print("¾å¤Ë°ú¤ÃÄ¥¤ê¤¢¤²¤é¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
3710 msg_print("You feel yourself yanked upwards!");
3713 p_ptr->recall_dungeon = dungeon_type;
3715 do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
3720 leave_quest_check();
3722 p_ptr->inside_quest = 0;
3723 p_ptr->leaving = TRUE;
3728 msg_print("²¼¤Ë°ú¤¤º¤ê¹ß¤í¤µ¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
3730 msg_print("You feel yourself yanked downwards!");
3733 dungeon_type = p_ptr->recall_dungeon;
3736 do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
3739 dun_level = max_dlv[dungeon_type];
3740 if (dun_level < 1) dun_level = 1;
3742 /* Nightmare mode makes recall more dangerous */
3743 if (ironman_nightmare && !randint0(666) && (dungeon_type == DUNGEON_ANGBAND))
3749 else if (dun_level < 99)
3751 dun_level = (dun_level + 99) / 2;
3753 else if (dun_level > 100)
3755 dun_level = d_info[dungeon_type].maxdepth - 1;
3759 if (p_ptr->wild_mode)
3761 p_ptr->wilderness_y = py;
3762 p_ptr->wilderness_x = px;
3766 /* Save player position */
3770 p_ptr->wild_mode = FALSE;
3773 p_ptr->leaving = TRUE;
3775 if (dungeon_type == DUNGEON_ANGBAND)
3777 for (i = MIN_RANDOM_QUEST; i < MAX_RANDOM_QUEST + 1; i++)
3779 if ((quest[i].type == QUEST_TYPE_RANDOM) &&
3780 (quest[i].status == QUEST_STATUS_TAKEN) &&
3781 (quest[i].level < dun_level))
3783 quest[i].status = QUEST_STATUS_FAILED;
3784 quest[i].complev = (byte)p_ptr->lev;
3785 r_info[quest[i].r_idx].flags1 &= ~(RF1_QUESTOR);
3792 sound(SOUND_TPLEVEL);
3800 * Verify use of "wizard" mode
3802 static bool enter_wizard_mode(void)
3804 /* Ask first time */
3807 /* Mention effects */
3809 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥â¡¼¥É¤Ç¤¹¡£ ");
3810 msg_print("°ìÅÙ¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ë¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3812 msg_print("Wizard mode is for debugging and experimenting.");
3813 msg_print("The game will not be scored if you enter wizard mode.");
3818 /* Verify request */
3820 if (!get_check("ËÜÅö¤Ë¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ê¤¿¤¤¤Î¤Ç¤¹¤«? "))
3822 if (!get_check("Are you sure you want to enter wizard mode? "))
3841 * Verify use of "debug" commands
3843 static bool enter_debug_mode(void)
3845 /* Ask first time */
3848 /* Mention effects */
3850 msg_print("¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ ");
3851 msg_print("¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3853 msg_print("The debug commands are for debugging and experimenting.");
3854 msg_print("The game will not be scored if you use debug commands.");
3859 /* Verify request */
3861 if (!get_check("ËÜÅö¤Ë¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? "))
3863 if (!get_check("Are you sure you want to use debug commands? "))
3871 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥Ç¥Ð¥Ã¥°¥â¡¼¥É¤ËÆÍÆþ¤·¤Æ¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
3873 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use debug commands.");
3884 * Hack -- Declare the Debug Routines
3886 extern void do_cmd_debug(void);
3888 #endif /* ALLOW_WIZARD */
3894 * Verify use of "borg" commands
3896 static bool enter_borg_mode(void)
3898 /* Ask first time */
3899 if (!(noscore & 0x0010))
3901 /* Mention effects */
3903 msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ ");
3904 msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3906 msg_print("The borg commands are for debugging and experimenting.");
3907 msg_print("The game will not be scored if you use borg commands.");
3912 /* Verify request */
3914 if (!get_check("ËÜÅö¤Ë¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? "))
3916 if (!get_check("Are you sure you want to use borg commands? "))
3932 * Hack -- Declare the Ben Borg
3934 extern void do_cmd_borg(void);
3936 #endif /* ALLOW_BORG */
3941 * Parse and execute the current command
3942 * Give "Warning" on illegal commands.
3944 * XXX XXX XXX Make some "blocks"
3946 static void process_command(void)
3948 int old_now_message = now_message;
3950 #ifdef ALLOW_REPEAT /* TNB */
3952 /* Handle repeating the last command */
3955 #endif /* ALLOW_REPEAT -- TNB */
3959 /* Parse the command */
3960 switch (command_cmd)
3976 /*** Wizard Commands ***/
3978 /* Toggle Wizard Mode */
3985 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É²ò½ü¡£");
3987 msg_print("Wizard mode off.");
3991 else if (enter_wizard_mode())
3995 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥ÉÆÍÆþ¡£");
3997 msg_print("Wizard mode on.");
4002 /* Update monsters */
4003 p_ptr->update |= (PU_MONSTERS);
4005 /* Redraw "title" */
4006 p_ptr->redraw |= (PR_TITLE);
4014 /* Special "debug" commands */
4017 /* Enter debug mode */
4018 if (enter_debug_mode())
4025 #endif /* ALLOW_WIZARD */
4030 /* Special "borg" commands */
4033 /* Enter borg mode */
4034 if (enter_borg_mode())
4036 if (!p_ptr->wild_mode) do_cmd_borg();
4042 #endif /* ALLOW_BORG */
4046 /*** Inventory Commands ***/
4048 /* Wear/wield equipment */
4051 if (!p_ptr->wild_mode) do_cmd_wield();
4055 /* Take off equipment */
4058 if (!p_ptr->wild_mode) do_cmd_takeoff();
4065 if (!p_ptr->wild_mode) do_cmd_drop();
4069 /* Destroy an item */
4076 /* Equipment list */
4083 /* Inventory list */
4091 /*** Various commands ***/
4093 /* Identify an object */
4100 /* Hack -- toggle windows */
4103 toggle_inven_equip();
4108 /*** Standard "Movement" Commands ***/
4113 if (!p_ptr->wild_mode) do_cmd_alter();
4120 if (!p_ptr->wild_mode) do_cmd_tunnel();
4124 /* Move (usually pick up things) */
4127 #ifdef ALLOW_EASY_DISARM /* TNB */
4131 #else /* ALLOW_EASY_DISARM -- TNB */
4133 do_cmd_walk(always_pickup);
4135 #endif /* ALLOW_EASY_DISARM -- TNB */
4140 /* Move (usually do not pick up) */
4143 #ifdef ALLOW_EASY_DISARM /* TNB */
4147 #else /* ALLOW_EASY_DISARM -- TNB */
4149 do_cmd_walk(!always_pickup);
4151 #endif /* ALLOW_EASY_DISARM -- TNB */
4157 /*** Running, Resting, Searching, Staying */
4159 /* Begin Running -- Arg is Max Distance */
4162 if (!p_ptr->wild_mode) do_cmd_run();
4166 /* Stay still (usually pick things up) */
4169 do_cmd_stay(always_pickup);
4173 /* Stay still (usually do not pick up) */
4176 do_cmd_stay(!always_pickup);
4180 /* Rest -- Arg is time */
4187 /* Search for traps/doors */
4194 /* Toggle search mode */
4197 if (p_ptr->action == ACTION_SEARCH) set_action(ACTION_NONE);
4198 else set_action(ACTION_SEARCH);
4203 /*** Stairs and Doors and Chests and Traps ***/
4208 if (!p_ptr->wild_mode) do_cmd_store();
4212 /* Enter building -KMW- */
4215 if (!p_ptr->wild_mode) do_cmd_bldg();
4219 /* Enter quest level -KMW- */
4222 if (!p_ptr->wild_mode) do_cmd_quest();
4226 /* Go up staircase */
4229 if(!p_ptr->wild_mode && !dun_level && !p_ptr->inside_arena && !p_ptr->inside_quest)
4236 msg_print("½±·â¤«¤éƨ¤²¤ë¤Ë¤Ï¥Þ¥Ã¥×¤Îü¤Þ¤Ç°ÜÆ°¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£");
4238 msg_print("To flee the ambush you have to reach the edge of the map.");
4241 else if (p_ptr->food < PY_FOOD_WEAK)
4244 msg_print("¤½¤ÎÁ°¤Ë¿©»ö¤ò¤È¤é¤Ê¤¤¤È¡£");
4246 msg_print("You must eat something here.");
4251 if (change_wild_mode())
4264 /* Go down staircase */
4267 if(!p_ptr->wild_mode) do_cmd_go_down();
4270 p_ptr->wilderness_x = px;
4271 p_ptr->wilderness_y = py;
4277 /* Open a door or chest */
4280 if (!p_ptr->wild_mode) do_cmd_open();
4287 if (!p_ptr->wild_mode) do_cmd_close();
4291 /* Jam a door with spikes */
4294 if (!p_ptr->wild_mode) do_cmd_spike();
4301 if (!p_ptr->wild_mode) do_cmd_bash();
4305 /* Disarm a trap or chest */
4308 if (!p_ptr->wild_mode) do_cmd_disarm();
4313 /*** Magic and Prayers ***/
4315 /* Gain new spells/prayers */
4318 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4320 msg_print("¼öʸ¤ò³Ø½¬¤¹¤ëɬÍפϤʤ¤¡ª");
4322 msg_print("You don't have to learn spells!");
4324 else if (p_ptr->pclass == CLASS_SAMURAI)
4325 do_cmd_gain_hissatsu();
4326 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4336 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
4337 (p_ptr->pclass == CLASS_BERSERKER) ||
4338 (p_ptr->pclass == CLASS_NINJA) ||
4339 (p_ptr->pclass == CLASS_MIRROR_MASTER)
4340 ) do_cmd_mind_browse();
4341 else if (p_ptr->pclass == CLASS_SMITH)
4343 else do_cmd_browse();
4351 if (!p_ptr->wild_mode)
4353 if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_ARCHER) || (p_ptr->pclass == CLASS_CAVALRY))
4356 msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4358 msg_print("You cannot cast spells!");
4361 else if (dun_level && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
4364 msg_print("¥À¥ó¥¸¥ç¥ó¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4366 msg_print("The arena absorbs all attempted magic!");
4370 else if (p_ptr->anti_magic && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
4374 cptr which_power = "ËâË¡";
4376 cptr which_power = "magic";
4378 if (p_ptr->pclass == CLASS_MINDCRAFTER)
4380 which_power = "ĶǽÎÏ";
4382 which_power = "psionic powers";
4384 else if (p_ptr->pclass == CLASS_IMITATOR)
4386 which_power = "¤â¤Î¤Þ¤Í";
4388 which_power = "imitation";
4390 else if (p_ptr->pclass == CLASS_SAMURAI)
4392 which_power = "ɬ»¦·õ";
4394 which_power = "hissatsu";
4396 else if (p_ptr->pclass == CLASS_MIRROR_MASTER)
4398 which_power = "¶ÀËâË¡";
4400 which_power = "mirror magic";
4402 else if (p_ptr->pclass == CLASS_NINJA)
4404 which_power = "Ǧ½Ñ";
4406 which_power = "ninjutsu";
4408 else if (mp_ptr->spell_book == TV_LIFE_BOOK)
4410 which_power = "µ§¤ê";
4412 which_power = "prayer";
4416 msg_format("È¿ËâË¡¥Ð¥ê¥¢¤¬%s¤ò¼ÙË⤷¤¿¡ª", which_power);
4418 msg_format("An anti-magic shell disrupts your %s!", which_power);
4422 else if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER))
4425 msg_format("¶¸Àï»Î²½¤·¤Æ¤¤¤ÆƬ¤¬²ó¤é¤Ê¤¤¡ª");
4427 msg_format("You cannot think directly!");
4433 if ((p_ptr->pclass == CLASS_MINDCRAFTER) ||
4434 (p_ptr->pclass == CLASS_BERSERKER) ||
4435 (p_ptr->pclass == CLASS_NINJA) ||
4436 (p_ptr->pclass == CLASS_MIRROR_MASTER)
4439 else if (p_ptr->pclass == CLASS_IMITATOR)
4441 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4442 do_cmd_magic_eater();
4443 else if (p_ptr->pclass == CLASS_SAMURAI)
4445 else if (p_ptr->pclass == CLASS_BLUE_MAGE)
4446 do_cmd_cast_learned();
4447 else if (p_ptr->pclass == CLASS_SMITH)
4456 /* Issue a pet command */
4459 if (!p_ptr->wild_mode) do_cmd_pet();
4463 /*** Use various objects ***/
4465 /* Inscribe an object */
4472 /* Uninscribe an object */
4475 do_cmd_uninscribe();
4479 /* Activate an artifact */
4482 if (!p_ptr->wild_mode)
4484 if (!p_ptr->inside_arena)
4489 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4491 msg_print("The arena absorbs all attempted magic!");
4507 /* Fuel your lantern/torch */
4517 if (!p_ptr->wild_mode) do_cmd_fire();
4524 if (!p_ptr->wild_mode)
4534 if (!p_ptr->wild_mode)
4536 if (!p_ptr->inside_arena)
4541 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4543 msg_print("The arena absorbs all attempted magic!");
4555 if (!p_ptr->wild_mode)
4557 if (p_ptr->inside_arena)
4560 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4562 msg_print("The arena absorbs all attempted magic!");
4567 else if (use_command && rogue_like_commands)
4579 /* Quaff a potion */
4582 if (!p_ptr->wild_mode)
4584 if (!p_ptr->inside_arena)
4585 do_cmd_quaff_potion();
4589 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4591 msg_print("The arena absorbs all attempted magic!");
4603 if (!p_ptr->wild_mode)
4605 if (!p_ptr->inside_arena)
4606 do_cmd_read_scroll();
4610 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4612 msg_print("The arena absorbs all attempted magic!");
4624 if (!p_ptr->wild_mode)
4626 if (p_ptr->inside_arena)
4629 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4631 msg_print("The arena absorbs all attempted magic!");
4636 else if (use_command && !rogue_like_commands)
4646 /* Use racial power */
4649 if (!p_ptr->wild_mode) do_cmd_racial_power();
4654 /*** Looking at Things (nearby or on map) ***/
4656 /* Full dungeon map */
4663 /* Locate player on map */
4677 /* Target monster or location */
4680 if (!p_ptr->wild_mode) do_cmd_target();
4686 /*** Help and Such ***/
4695 /* Identify symbol */
4698 do_cmd_query_symbol();
4702 /* Character description */
4705 do_cmd_change_name();
4710 /*** System Commands ***/
4712 /* Hack -- User interface */
4719 /* Single line from a pref file */
4734 do_cmd_edit_autopick();
4738 /* Interact with macros */
4745 /* Interact with visuals */
4753 /* Interact with colors */
4761 /* Interact with options */
4769 /*** Misc Commands ***/
4785 /* Repeat level feeling */
4788 if (!p_ptr->wild_mode) do_cmd_feeling();
4792 /* Show previous message */
4795 do_cmd_message_one();
4799 /* Show previous messages */
4802 do_cmd_messages(old_now_message);
4806 /* Show quest status -KMW- */
4809 do_cmd_checkquest();
4813 /* Redraw the screen */
4816 now_message = old_now_message;
4821 #ifndef VERIFY_SAVEFILE
4823 /* Hack -- Save and don't quit */
4826 do_cmd_save_game(FALSE);
4830 #endif /* VERIFY_SAVEFILE */
4841 do_cmd_save_and_exit();
4845 /* Quit (commit suicide) */
4858 /* Check artifacts, uniques, objects */
4865 /* Load "screen dump" */
4868 do_cmd_load_screen();
4872 /* Save "screen dump" */
4875 do_cmd_save_screen();
4879 /* Make random artifact list */
4882 spoil_random_artifact("randifact.txt");
4886 /* Hack -- Unknown command */
4889 if (flush_failure) flush();
4893 sound(SOUND_ILLEGAL);
4895 if (!get_rnd_line("error_j.txt", 0, error_m))
4897 if (!get_rnd_line("error.txt", 0, error_m))
4904 prt(" '?' ¤Ç¥Ø¥ë¥×¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£", 0, 0);
4906 prt("Type '?' for help.", 0, 0);
4912 if (!energy_use && !now_message)
4913 now_message = old_now_message;
4919 static bool monster_tsuri(int r_idx)
4921 monster_race *r_ptr = &r_info[r_idx];
4923 if ((r_ptr->flags7 & RF7_AQUATIC) && !(r_ptr->flags1 & RF1_UNIQUE) && strchr("Jjlw", r_ptr->d_char))
4931 * Process the player
4933 * Notice the annoying code to handle "pack overflow", which
4934 * must come first just in case somebody manages to corrupt
4935 * the savefiles by clever use of menu commands or something.
4937 static void process_player(void)
4941 /*** Apply energy ***/
4946 msg_print("²¿¤«ÊѤï¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
4948 msg_print("You feel different!");
4951 (void)gain_random_mutation(0);
4952 hack_mutation = FALSE;
4955 if (p_ptr->inside_battle)
4957 for(i = 1; i < m_max; i++)
4959 monster_type *m_ptr = &m_list[i];
4961 if (!m_ptr->r_idx) continue;
4963 /* Hack -- Detect monster */
4964 m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
4966 /* Update the monster */
4967 update_mon(i, FALSE);
4972 /* Give the player some energy */
4973 else if (!(load && p_ptr->energy_need <= 0))
4975 p_ptr->energy_need -= (p_ptr->pspeed > 199 ? 49 : (p_ptr->pspeed < 0 ? 1 : extract_energy[p_ptr->pspeed]));
4979 if (p_ptr->energy_need > 0) return;
4980 if (!command_rep) prt_time();
4982 /*** Check for interupts ***/
4984 /* Complete resting */
4991 if ((p_ptr->chp == p_ptr->mhp) &&
4992 (p_ptr->csp >= p_ptr->msp))
4994 set_action(ACTION_NONE);
4998 /* Complete resting */
4999 else if (resting == -2)
5002 if ((p_ptr->chp == p_ptr->mhp) &&
5003 (p_ptr->csp >= p_ptr->msp) &&
5004 !p_ptr->blind && !p_ptr->confused &&
5005 !p_ptr->poisoned && !p_ptr->afraid &&
5006 !p_ptr->stun && !p_ptr->cut &&
5007 !p_ptr->slow && !p_ptr->paralyzed &&
5008 !p_ptr->image && !p_ptr->word_recall)
5010 set_action(ACTION_NONE);
5015 if (p_ptr->action == ACTION_FISH)
5018 Term_xtra(TERM_XTRA_DELAY, 10);
5022 bool success = FALSE;
5023 get_mon_num_prep(monster_tsuri,NULL);
5024 r_idx = get_mon_num(dun_level ? dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level);
5026 if (r_idx && one_in_(2))
5029 y = py+ddy[tsuri_dir];
5030 x = px+ddx[tsuri_dir];
5031 if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE))
5034 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
5036 msg_format("%s¤¬Äà¤ì¤¿¡ª", m_name);
5038 msg_format("You have a good catch!", m_name);
5046 msg_print("±Â¤À¤±¿©¤ï¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª¤¯¤Ã¤½¡Á¡ª");
5048 msg_print("Damn! The fish took a bait away!");
5055 /* Handle "abort" */
5058 /* Check for "player abort" (semi-efficiently for resting) */
5059 if (running || command_rep || (p_ptr->action == ACTION_REST) || (p_ptr->action == ACTION_FISH))
5064 /* Check for a key */
5073 /* Hack -- Show a Message */
5075 msg_print("ÃæÃǤ·¤Þ¤·¤¿¡£");
5077 msg_print("Canceled.");
5084 if (p_ptr->riding && !p_ptr->confused && !p_ptr->blind)
5086 monster_type *m_ptr = &m_list[p_ptr->riding];
5095 /* Acquire the monster name */
5096 monster_desc(m_name, m_ptr, 0);
5098 msg_format("%^s¤òµ¯¤³¤·¤¿¡£", m_name);
5100 msg_format("You have waked %s up.", m_name);
5102 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5103 p_ptr->redraw |= (PR_UHEALTH);
5110 /* Make a "saving throw" against stun */
5111 if (randint0(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
5117 /* Hack -- Recover from stun */
5118 if (m_ptr->stunned > d)
5120 /* Recover somewhat */
5121 m_ptr->stunned -= d;
5132 /* Acquire the monster name */
5133 monster_desc(m_name, m_ptr, 0);
5135 /* Dump a message */
5137 msg_format("%^s¤òÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5139 msg_format("%^s is no longer stunned.", m_name);
5141 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5142 p_ptr->redraw |= (PR_UHEALTH);
5146 if (m_ptr->confused)
5150 /* Make a "saving throw" against stun */
5151 if (randint0(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
5154 d = m_ptr->confused;
5157 /* Hack -- Recover from stun */
5158 if (m_ptr->confused > d)
5160 /* Recover somewhat */
5161 m_ptr->confused -= d;
5170 m_ptr->confused = 0;
5172 /* Acquire the monster name */
5173 monster_desc(m_name, m_ptr, 0);
5175 /* Dump a message */
5177 msg_format("%^s¤òº®Íð¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5179 msg_format("%^s is no longer confused.", m_name);
5181 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5182 p_ptr->redraw |= (PR_UHEALTH);
5190 /* Make a "saving throw" against stun */
5191 if (randint0(r_info[m_ptr->r_idx].level) < skill_exp[GINOU_RIDING])
5197 /* Hack -- Recover from stun */
5198 if (m_ptr->monfear > d)
5200 /* Recover somewhat */
5201 m_ptr->monfear -= d;
5212 /* Acquire the monster name */
5213 monster_desc(m_name, m_ptr, 0);
5215 /* Dump a message */
5217 msg_format("%^s¤ò¶²Éݤ«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5219 msg_format("%^s is no longer fear.", m_name);
5221 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5222 p_ptr->redraw |= (PR_UHEALTH);
5229 /* Handle the player song */
5230 if (!load) check_music();
5235 if (p_ptr->lightspeed)
5237 (void)set_lightspeed(p_ptr->lightspeed - 1, TRUE);
5239 if ((p_ptr->pclass == CLASS_FORCETRAINER) && (p_ptr->magic_num1[0]))
5241 if (p_ptr->magic_num1[0] < 40)
5243 p_ptr->magic_num1[0] = 0;
5245 else p_ptr->magic_num1[0] -= 40;
5246 p_ptr->update |= (PU_BONUS);
5248 if (p_ptr->action == ACTION_LEARN)
5250 int hoge = ((p_ptr->msp * 0x10000L) / 256L)+7680L;
5251 if ((p_ptr->csp * 0x10000L + p_ptr->csp_frac) < hoge)
5254 p_ptr->csp_frac = 0;
5255 set_action(ACTION_NONE);
5259 p_ptr->csp -= (s16b)(hoge >> 16);
5261 if (p_ptr->csp_frac < hoge)
5263 p_ptr->csp_frac += 0x10000L - hoge;
5267 p_ptr->csp_frac -= hoge;
5269 p_ptr->redraw |= PR_MANA;
5272 if (p_ptr->special_defense & KATA_MASK)
5274 if (p_ptr->special_defense & KATA_MUSOU)
5278 set_action(ACTION_NONE);
5283 p_ptr->redraw |= (PR_MANA);
5288 /*** Handle actual user input ***/
5290 /* Repeat until out of energy */
5291 while (p_ptr->energy_need <= 0)
5293 p_ptr->window |= PW_PLAYER;
5294 p_ptr->sutemi = FALSE;
5295 p_ptr->counter = FALSE;
5296 now_damaged = FALSE;
5298 /* Notice stuff (if needed) */
5299 if (p_ptr->notice) notice_stuff();
5301 /* Update stuff (if needed) */
5302 if (p_ptr->update) update_stuff();
5304 /* Redraw stuff (if needed) */
5305 if (p_ptr->redraw) redraw_stuff();
5307 /* Redraw stuff (if needed) */
5308 if (p_ptr->window) window_stuff();
5311 /* Place the cursor on the player */
5312 move_cursor_relative(py, px);
5314 /* Refresh (optional) */
5315 if (fresh_before) Term_fresh();
5318 /* Hack -- Pack Overflow */
5319 if (inventory[INVEN_PACK].k_idx)
5321 int item = INVEN_PACK;
5323 char o_name[MAX_NLEN];
5327 /* Access the slot to be dropped */
5328 o_ptr = &inventory[item];
5335 msg_print("¥¶¥Ã¥¯¤«¤é¥¢¥¤¥Æ¥à¤¬¤¢¤Õ¤ì¤¿¡ª");
5337 msg_print("Your pack overflows!");
5342 object_desc(o_name, o_ptr, TRUE, 3);
5346 msg_format("%s(%c)¤òÍî¤È¤·¤¿¡£", o_name, index_to_label(item));
5348 msg_format("You drop %s (%c).", o_name, index_to_label(item));
5352 /* Drop it (carefully) near the player */
5353 (void)drop_near(o_ptr, 0, py, px);
5355 /* Modify, Describe, Optimize */
5356 inven_item_increase(item, -255);
5357 inven_item_describe(item);
5358 inven_item_optimize(item);
5360 /* Notice stuff (if needed) */
5361 if (p_ptr->notice) notice_stuff();
5363 /* Update stuff (if needed) */
5364 if (p_ptr->update) update_stuff();
5366 /* Redraw stuff (if needed) */
5367 if (p_ptr->redraw) redraw_stuff();
5369 /* Redraw stuff (if needed) */
5370 if (p_ptr->window) window_stuff();
5374 /* Hack -- cancel "lurking browse mode" */
5375 if (!command_new) command_see = FALSE;
5378 /* Assume free turn */
5382 if (p_ptr->inside_battle)
5384 /* Place the cursor on the player */
5385 move_cursor_relative(py, px);
5389 /* Process the command */
5393 /* Paralyzed or Knocked Out */
5394 else if (p_ptr->paralyzed || (p_ptr->stun >= 100))
5401 else if (p_ptr->action == ACTION_REST)
5406 /* Reduce rest count */
5409 if (!resting) set_action(ACTION_NONE);
5411 /* Redraw the state */
5412 p_ptr->redraw |= (PR_STATE);
5420 else if (p_ptr->action == ACTION_FISH)
5433 /* Repeated command */
5434 else if (command_rep)
5436 /* Count this execution */
5439 /* Redraw the state */
5440 p_ptr->redraw |= (PR_STATE);
5445 /* Hack -- Assume messages were seen */
5448 /* Clear the top line */
5451 /* Process the command */
5455 /* Normal command */
5458 /* Place the cursor on the player */
5459 move_cursor_relative(py, px);
5462 /* Get a command (normal) */
5463 request_command(FALSE);
5466 /* Process the command */
5476 /* Use some energy */
5478 p_ptr->energy_need += (s16b)((s32b)energy_use * ENERGY_NEED() / 100L);
5480 p_ptr->energy_need += energy_use * TURNS_PER_TICK / 10;
5482 /* Hack -- constant hallucination */
5483 if (p_ptr->image) p_ptr->redraw |= (PR_MAP);
5486 /* Shimmer monsters if needed */
5487 if (shimmer_monsters)
5489 /* Clear the flag */
5490 shimmer_monsters = FALSE;
5492 /* Shimmer multi-hued monsters */
5493 for (i = 1; i < m_max; i++)
5495 monster_type *m_ptr;
5496 monster_race *r_ptr;
5498 /* Access monster */
5501 /* Skip dead monsters */
5502 if (!m_ptr->r_idx) continue;
5504 /* Access the monster race */
5505 r_ptr = &r_info[m_ptr->r_idx];
5507 /* Skip non-multi-hued monsters */
5508 if (!(r_ptr->flags1 & RF1_ATTR_MULTI)) continue;
5510 /* Reset the flag */
5511 shimmer_monsters = TRUE;
5513 /* Redraw regardless */
5514 lite_spot(m_ptr->fy, m_ptr->fx);
5519 /* Handle monster detection */
5520 if (repair_monsters)
5522 /* Reset the flag */
5523 repair_monsters = FALSE;
5525 /* Rotate detection flags */
5526 for (i = 1; i < m_max; i++)
5528 monster_type *m_ptr;
5530 /* Access monster */
5533 /* Skip dead monsters */
5534 if (!m_ptr->r_idx) continue;
5536 /* Nice monsters get mean */
5537 if (m_ptr->mflag & MFLAG_NICE)
5539 /* Nice monsters get mean */
5540 m_ptr->mflag &= ~(MFLAG_NICE);
5543 /* Handle memorized monsters */
5544 if (m_ptr->mflag & MFLAG_MARK)
5546 /* Maintain detection */
5547 if (m_ptr->mflag & MFLAG_SHOW)
5550 m_ptr->mflag &= ~(MFLAG_SHOW);
5552 /* Still need repairs */
5553 repair_monsters = TRUE;
5556 /* Remove detection */
5560 m_ptr->mflag &= ~(MFLAG_MARK);
5562 /* Assume invisible */
5565 /* Update the monster */
5566 update_mon(i, FALSE);
5568 if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH);
5569 if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH);
5571 /* Redraw regardless */
5572 lite_spot(m_ptr->fy, m_ptr->fx);
5577 if (p_ptr->pclass == CLASS_IMITATOR)
5579 if (mane_num > (p_ptr->lev > 44 ? 3 : p_ptr->lev > 29 ? 2 : 1))
5582 for (i = 0; i < mane_num; i++)
5584 mane_spell[i] = mane_spell[i+1];
5585 mane_dam[i] = mane_dam[i+1];
5589 p_ptr->redraw |= (PR_MANE);
5591 if (p_ptr->action == ACTION_LEARN)
5594 p_ptr->redraw |= (PR_STATE);
5597 if (world_player && (p_ptr->energy_need > - 1000))
5600 p_ptr->redraw |= (PR_MAP);
5602 /* Update monsters */
5603 p_ptr->update |= (PU_MONSTERS);
5606 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5609 msg_print("¡Ö»þ¤ÏÆ°¤¤À¤¹¡Ä¡×");
5611 msg_print("You feel time flowing around you once more.");
5614 world_player = FALSE;
5615 p_ptr->energy_need = ENERGY_NEED();
5621 /* Hack -- notice death */
5622 if (!alive || death)
5624 world_player = FALSE;
5628 /* Handle "leaving" */
5629 if (p_ptr->leaving) break;
5632 /* Update scent trail */
5638 * Interact with the current dungeon level.
5640 * This function will not exit until the level is completed,
5641 * the user dies, or the game is terminated.
5643 static void dungeon(bool load_game)
5645 int quest_num = 0, i, num;
5647 /* Set the base level */
5648 base_level = dun_level;
5650 /* Reset various flags */
5654 p_ptr->leaving = FALSE;
5656 /* Reset the "command" vars */
5664 /* Cancel the target */
5668 ambush_flag = FALSE;
5670 /* Cancel the health bar */
5673 /* Check visual effects */
5674 shimmer_monsters = TRUE;
5675 shimmer_objects = TRUE;
5676 repair_monsters = TRUE;
5677 repair_objects = TRUE;
5683 /* Get index of current quest (if any) */
5684 quest_num = quest_number(dun_level);
5686 /* Inside a quest? */
5689 /* Mark the quest monster */
5690 r_info[quest[quest_num].r_idx].flags1 |= RF1_QUESTOR;
5693 /* Track maximum player level */
5694 if (p_ptr->max_plv < p_ptr->lev)
5696 p_ptr->max_plv = p_ptr->lev;
5700 /* Track maximum dungeon level (if not in quest -KMW-) */
5701 if ((max_dlv[dungeon_type] < dun_level) && !p_ptr->inside_quest)
5703 max_dlv[dungeon_type] = dun_level;
5704 if (record_maxdeapth) do_cmd_write_nikki(NIKKI_MAXDEAPTH, dun_level, NULL);
5707 /* No stairs down from Quest */
5708 if (quest_number(dun_level))
5710 create_down_stair = 0;
5713 /* Paranoia -- no stairs from town or wilderness */
5714 if (!dun_level) create_down_stair = create_up_stair = 0;
5716 /* Option -- no connected stairs */
5717 if (!dungeon_stair) create_down_stair = create_up_stair = 0;
5719 /* Option -- no up stairs */
5720 if (ironman_downward) create_down_stair = create_up_stair = 0;
5722 /* Make a stairway. */
5723 if (create_up_stair || create_down_stair)
5725 /* Place a stairway */
5726 if (cave_valid_bold(py, px))
5729 delete_object(py, px);
5732 if (create_down_stair)
5734 if (create_down_stair == 2) cave_set_feat(py, px, FEAT_MORE_MORE);
5735 else cave_set_feat(py, px, FEAT_MORE);
5739 if (create_up_stair == 2) cave_set_feat(py, px, FEAT_LESS_LESS);
5740 else cave_set_feat(py, px, FEAT_LESS);
5744 /* Cancel the stair request */
5745 create_down_stair = create_up_stair = 0;
5748 /* Validate the panel */
5749 panel_bounds_center();
5751 /* Verify the panel */
5754 /* Flush messages */
5758 /* Enter "xtra" mode */
5759 character_xtra = TRUE;
5762 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
5765 p_ptr->window |= (PW_MONSTER);
5767 /* Redraw dungeon */
5768 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY);
5771 p_ptr->redraw |= (PR_MAP);
5774 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5777 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
5779 /* Calculate torch radius */
5780 p_ptr->update |= (PU_TORCH);
5792 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_DISTANCE | PU_MON_LITE);
5793 p_ptr->update |= (PU_MONSTERS);/*¼«Ê¬¤Ç¸÷¤Ã¤Æ¤¤¤ë¥â¥ó¥¹¥¿¡¼¤Î°Ù */
5801 /* Leave "xtra" mode */
5802 character_xtra = FALSE;
5805 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
5807 /* Combine / Reorder the pack */
5808 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
5825 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();
5827 if (p_ptr->inside_battle)
5831 p_ptr->energy_need = 0;
5838 msg_print("»î¹ç³«»Ï¡ª");
5840 msg_format("Ready..Fight!");
5846 if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] > MUSIC_DETECT))
5847 p_ptr->magic_num1[0] = MUSIC_DETECT;
5849 /* Hack -- notice death or departure */
5850 if (!alive || death) return;
5852 /* Print quest message if appropriate */
5853 if (!p_ptr->inside_quest && (dungeon_type == DUNGEON_ANGBAND))
5855 quest_discovery(random_quest_number(dun_level));
5856 p_ptr->inside_quest = random_quest_number(dun_level);
5858 if ((dun_level == d_info[dungeon_type].maxdepth) && d_info[dungeon_type].final_guardian)
5860 if (r_info[d_info[dungeon_type].final_guardian].max_num)
5862 msg_format("¤³¤Î³¬¤Ë¤Ï%s¤Î¼ç¤Ç¤¢¤ë%s¤¬À³¤ó¤Ç¤¤¤ë¡£",
5863 d_name+d_info[dungeon_type].name,
5864 r_name+r_info[d_info[dungeon_type].final_guardian].name);
5866 msg_format("%^s lives in this level as the keeper of %s.",
5867 r_name+r_info[d_info[dungeon_type].final_guardian].name,
5868 d_name+d_info[dungeon_type].name);
5872 /*** Process this dungeon level ***/
5874 /* Reset the monster generation level */
5875 monster_level = base_level;
5877 /* Reset the object generation level */
5878 object_level = base_level;
5882 if (p_ptr->energy_need > 0 && !p_ptr->inside_battle &&
5883 (dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena))
5884 p_ptr->energy_need = 0;
5886 /* Not leaving dungeon */
5887 p_ptr->leaving_dungeon = FALSE;
5892 int i, correct_inven_cnt = 0;
5894 /* Hack -- Compact the monster list occasionally */
5895 if ((m_cnt + 32 > max_m_idx) && !p_ptr->inside_battle) compact_monsters(64);
5897 /* Hack -- Compress the monster list occasionally */
5898 if ((m_cnt + 32 < m_max) && !p_ptr->inside_battle) compact_monsters(0);
5901 /* Hack -- Compact the object list occasionally */
5902 if (o_cnt + 32 > max_o_idx) compact_objects(64);
5904 /* Hack -- Compress the object list occasionally */
5905 if (o_cnt + 32 < o_max) compact_objects(0);
5908 /* Process the player */
5912 if (p_ptr->notice) notice_stuff();
5915 for (i = 0; i < INVEN_PACK; i++)
5917 object_type *j_ptr = &inventory[i];
5919 /* Skip non-objects */
5920 if (!j_ptr->k_idx) continue;
5922 correct_inven_cnt++;
5926 if (p_ptr->update) update_stuff();
5929 if (p_ptr->redraw) redraw_stuff();
5932 if (p_ptr->window) window_stuff();
5934 /* Hack -- Hilite the player */
5935 move_cursor_relative(py, px);
5937 /* Optional fresh */
5938 if (fresh_after) Term_fresh();
5940 /* Hack -- Notice death or departure */
5941 if (!alive || death) break;
5943 /* Process all of the monsters */
5947 if (p_ptr->notice) notice_stuff();
5950 if (p_ptr->update) update_stuff();
5953 if (p_ptr->redraw) redraw_stuff();
5956 if (p_ptr->window) window_stuff();
5958 /* Hack -- Hilite the player */
5959 move_cursor_relative(py, px);
5961 /* Optional fresh */
5962 if (fresh_after) Term_fresh();
5964 /* Hack -- Notice death or departure */
5965 if (!alive || death) break;
5968 /* Process the world */
5972 if (p_ptr->notice) notice_stuff();
5975 if (p_ptr->update) update_stuff();
5978 if (p_ptr->redraw) redraw_stuff();
5981 if (p_ptr->window) window_stuff();
5983 /* Hack -- Hilite the player */
5984 move_cursor_relative(py, px);
5986 /* Optional fresh */
5987 if (fresh_after) Term_fresh();
5989 /* Hack -- Notice death or departure */
5990 if (!alive || death) break;
5992 /* Handle "leaving" */
5993 if (p_ptr->leaving) break;
5995 /* Count game turns */
5997 if (!p_ptr->wild_mode || wild_regen) dungeon_turn++;
5998 else if (p_ptr->wild_mode && !(turn % ((MAX_HGT + MAX_WID) / 2))) dungeon_turn++;
5999 if (wild_regen) wild_regen--;
6002 /* Inside a quest and non-unique questor? */
6003 if (quest_num && !(r_info[quest[quest_num].r_idx].flags1 & RF1_UNIQUE))
6005 /* Un-mark the quest monster */
6006 r_info[quest[quest_num].r_idx].flags1 &= ~RF1_QUESTOR;
6009 /* Not save-and-quit and not dead? */
6010 if (alive && !death)
6012 for(num = 0; num < 21; num++)
6014 party_mon[num].r_idx = 0;
6019 COPY(&party_mon[0], &m_list[p_ptr->riding], monster_type);
6022 for(i = m_max - 1, num = 1; (i >= 1 && num < 21); i--)
6024 monster_type *m_ptr = &m_list[i];
6026 if (!m_ptr->r_idx) continue;
6027 if (!is_pet(m_ptr)) continue;
6028 if (i == p_ptr->riding) continue;
6030 if (m_ptr->nickname && (player_has_los_bold(m_ptr->fy, m_ptr->fx) || los(m_ptr->fy, m_ptr->fx, py, px)))
6032 if (distance(py, px, m_ptr->fy, m_ptr->fx) > 3) continue;
6036 if (distance(py, px, m_ptr->fy, m_ptr->fx) > 1) continue;
6038 if (m_ptr->confused || m_ptr->stunned || m_ptr->csleep) continue;
6040 COPY(&party_mon[num], &m_list[i], monster_type);
6041 delete_monster_idx(i);
6044 if (record_named_pet)
6046 for (i = m_max - 1; i >=1; i--)
6048 monster_type *m_ptr = &m_list[i];
6051 if (!m_ptr->r_idx) continue;
6052 if (!is_pet(m_ptr)) continue;
6053 if (!m_ptr->nickname) continue;
6054 if (p_ptr->riding == i) continue;
6056 monster_desc(m_name, m_ptr, 0x88);
6057 do_cmd_write_nikki(NIKKI_NAMED_PET, 4, m_name);
6067 * Load some "user pref files"
6069 * Modified by Arcum Dagsson to support
6070 * separate macro files for different realms.
6072 static void load_all_pref_files(void)
6077 /* Access the "user" pref file */
6078 sprintf(buf, "user.prf");
6080 /* Process that file */
6081 process_pref_file(buf);
6083 /* Access the "user" system pref file */
6084 sprintf(buf, "user-%s.prf", ANGBAND_SYS);
6086 /* Process that file */
6087 process_pref_file(buf);
6089 /* Access the "race" pref file */
6090 sprintf(buf, "%s.prf", rp_ptr->title);
6092 /* Process that file */
6093 process_pref_file(buf);
6095 /* Access the "class" pref file */
6096 sprintf(buf, "%s.prf", cp_ptr->title);
6098 /* Process that file */
6099 process_pref_file(buf);
6101 /* Access the "character" pref file */
6102 sprintf(buf, "%s.prf", player_base);
6104 /* Process that file */
6105 process_pref_file(buf);
6107 /* Free old entries */
6111 sprintf(buf, "picktype-%s.prf", player_base);
6113 sprintf(buf, "pickpref-%s.prf", player_base);
6116 err = process_pickpref_file(buf);
6118 /* Process 'pick????.prf' if 'pick????-<name>.prf' doesn't exist */
6122 process_pickpref_file("picktype.prf");
6124 process_pickpref_file("pickpref.prf");
6128 /* Access the "realm 1" pref file */
6129 if (p_ptr->realm1 != REALM_NONE)
6131 sprintf(buf, "%s.prf", realm_names[p_ptr->realm1]);
6133 /* Process that file */
6134 process_pref_file(buf);
6137 /* Access the "realm 2" pref file */
6138 if (p_ptr->realm2 != REALM_NONE)
6140 sprintf(buf, "%s.prf", realm_names[p_ptr->realm2]);
6142 /* Process that file */
6143 process_pref_file(buf);
6149 * Actually play a game
6151 * If the "new_game" parameter is true, then, after loading the
6152 * savefile, we will commit suicide, if necessary, to allow the
6153 * player to start a new game.
6155 void play_game(bool new_game)
6158 bool load_game = TRUE;
6168 hack_mutation = FALSE;
6170 /* Hack -- Character is "icky" */
6171 character_icky = TRUE;
6173 /* Make sure main term is active */
6174 Term_activate(angband_term[0]);
6176 /* Initialise the resize hooks */
6177 angband_term[0]->resize_hook = resize_map;
6179 for (i = 1; i < 8; i++)
6181 /* Does the term exist? */
6182 if (angband_term[i])
6184 /* Add the redraw on resize hook */
6185 angband_term[i]->resize_hook = redraw_window;
6189 /* Hack -- turn off the cursor */
6190 (void)Term_set_cursor(0);
6193 /* Attempt to load */
6198 quit("¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤¬²õ¤ì¤Æ¤¤¤Þ¤¹");
6200 quit("broken savefile");
6205 /* Extract the options */
6206 for (i = 0; option_info[i].o_desc; i++)
6208 int os = option_info[i].o_set;
6209 int ob = option_info[i].o_bit;
6211 /* Set the "default" options */
6212 if (option_info[i].o_var)
6215 if (option_flag[os] & (1L << ob))
6218 (*option_info[i].o_var) = TRUE;
6225 (*option_info[i].o_var) = FALSE;
6230 /* Report waited score */
6231 if (wait_report_score)
6237 if (!get_check_strict("ÂÔµ¡¤·¤Æ¤¤¤¿¥¹¥³¥¢ÅÐÏ¿¤òº£¹Ô¤Ê¤¤¤Þ¤¹¤«¡©", CHECK_NO_HISTORY))
6239 if (!get_check_strict("Do you register score now? ", CHECK_NO_HISTORY))
6244 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
6251 start_time = time(NULL);
6253 /* No suspending now */
6254 signals_ignore_tstp();
6256 /* Hack -- Character is now "icky" */
6257 character_icky = TRUE;
6259 /* Build the filename */
6260 path_build(buf, 1024, ANGBAND_DIR_APEX, "scores.raw");
6262 /* Open the high score file, for reading/writing */
6263 highscore_fd = fd_open(buf, O_RDWR);
6265 /* Handle score, show Top scores */
6266 success = send_world_score(TRUE);
6269 if (!success && !get_check_strict("¥¹¥³¥¢ÅÐÏ¿¤òÄü¤á¤Þ¤¹¤«¡©", CHECK_NO_HISTORY))
6271 if (!success && !get_check_strict("Do you give up score registration? ", CHECK_NO_HISTORY))
6275 prt("°ú¤Â³¤ÂÔµ¡¤·¤Þ¤¹¡£", 0, 0);
6277 prt("standing by for future registration...", 0, 0);
6283 wait_report_score = FALSE;
6286 if (!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
6288 if (!save_player()) msg_print("death save failed!");
6291 /* Shut the high score file */
6292 (void)fd_close(highscore_fd);
6294 /* Forget the high score fd */
6297 /* Allow suspending now */
6298 signals_handle_tstp();
6303 /* Nothing loaded */
6304 if (!character_loaded)
6306 /* Make new player */
6309 /* The dungeon is not ready */
6310 character_dungeon = FALSE;
6312 /* Prepare to init the RNG */
6316 /* Process old character */
6319 /* Process the player name */
6320 process_player_name(FALSE);
6329 seed = (time(NULL));
6333 /* Mutate the seed on Unix machines */
6334 seed = ((seed >> 3) * (getpid() << 1));
6338 /* Use the complex RNG */
6341 /* Seed the "complex" RNG */
6342 Rand_state_init(seed);
6345 /* Roll new character */
6348 monster_race *r_ptr;
6350 /* The dungeon is not ready */
6351 character_dungeon = FALSE;
6355 p_ptr->inside_quest = 0;
6356 p_ptr->inside_arena = FALSE;
6357 p_ptr->inside_battle = FALSE;
6361 /* Hack -- seed for flavors */
6362 seed_flavor = randint0(0x10000000);
6364 /* Hack -- seed for town layout */
6365 seed_town = randint0(0x10000000);
6367 /* Roll up a new character */
6374 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "ÊÕ¶¤ÎÃϤ˹ߤêΩ¤Ã¤¿¡£");
6376 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "You are standing in the Outpost.");
6380 get_mon_num_prep(NULL, NULL);
6381 for (i = 0; i < MAX_KUBI; i++)
6387 kubi_r_idx[i] = get_mon_num(MAX_DEPTH - 1);
6388 r_ptr = &r_info[kubi_r_idx[i]];
6390 if(!(r_ptr->flags1 & RF1_UNIQUE)) continue;
6392 if(!(r_ptr->flags9 & RF9_DROP_CORPSE)) continue;
6393 if (r_ptr->rarity > 100) continue;
6395 if(r_ptr->flags6 & RF6_SPECIAL) continue;
6397 for (j = 0; j < i; j++)
6398 if (kubi_r_idx[i] == kubi_r_idx[j])break;
6403 for (i = 0; i < MAX_KUBI -1; i++)
6406 for (j = i; j < MAX_KUBI; j++)
6408 if (r_info[kubi_r_idx[i]].level > r_info[kubi_r_idx[j]].level)
6410 tmp = kubi_r_idx[i];
6411 kubi_r_idx[i] = kubi_r_idx[j];
6412 kubi_r_idx[j] = tmp;
6417 p_ptr->inside_battle = TRUE;
6420 today_mon = get_mon_num(3);
6421 r_ptr = &r_info[today_mon];
6423 if (r_ptr->flags1 & RF1_UNIQUE) continue;
6424 if (r_ptr->flags2 & (RF2_MULTIPLY)) continue;
6425 if (!(r_ptr->flags9 & RF9_DROP_CORPSE) || !(r_ptr->flags9 & RF9_DROP_SKELETON)) continue;
6426 if (r_ptr->rarity > 10) continue;
6427 if (r_ptr->level == 0) continue;
6430 p_ptr->inside_battle = FALSE;
6434 write_level = FALSE;
6437 do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ----¥²¡¼¥àºÆ³«----");
6439 do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ---- Restart Game ----");
6443 * 1.0.9 °ÊÁ°¤Ï¥»¡¼¥ÖÁ°¤Ë p_ptr->riding = -1 ¤È¤·¤Æ¤¤¤¿¤Î¤Ç¡¢ºÆÀßÄ꤬ɬÍפÀ¤Ã¤¿¡£
6444 * ¤â¤¦ÉÔÍפÀ¤¬¡¢°ÊÁ°¤Î¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤È¤Î¸ß´¹¤Î¤¿¤á¤Ë»Ä¤·¤Æ¤ª¤¯¡£
6446 if (p_ptr->riding == -1)
6449 for(i = m_max; i > 0; i--)
6451 if ((m_list[i].fy == py) && (m_list[i].fx == px))
6460 p_ptr->teleport_town = FALSE;
6461 p_ptr->sutemi = FALSE;
6462 world_monster = FALSE;
6463 now_damaged = FALSE;
6465 start_time = time(NULL) - 1;
6466 record_o_name[0] = '\0';
6468 /* Reset map panel */
6469 panel_row_min = cur_hgt;
6470 panel_col_min = cur_wid;
6472 /* Sexy gal gets bonus to maximum weapon skill of whip */
6473 if(p_ptr->pseikaku == SEIKAKU_SEXY)
6474 s_info[p_ptr->pclass].w_max[TV_HAFTED-TV_BOW][SV_WHIP] = 8000;
6476 /* Fill the arrays of floors and walls in the good proportions */
6477 for (i = 0; i < 100; i++)
6479 int lim1, lim2, lim3;
6481 lim1 = d_info[dungeon_type].floor_percent1;
6482 lim2 = lim1 + d_info[dungeon_type].floor_percent2;
6483 lim3 = lim2 + d_info[dungeon_type].floor_percent3;
6486 floor_type[i] = d_info[dungeon_type].floor1;
6488 floor_type[i] = d_info[dungeon_type].floor2;
6490 floor_type[i] = d_info[dungeon_type].floor3;
6492 lim1 = d_info[dungeon_type].fill_percent1;
6493 lim2 = lim1 + d_info[dungeon_type].fill_percent2;
6494 lim3 = lim2 + d_info[dungeon_type].fill_percent3;
6496 fill_type[i] = d_info[dungeon_type].fill_type1;
6498 fill_type[i] = d_info[dungeon_type].fill_type2;
6500 fill_type[i] = d_info[dungeon_type].fill_type3;
6503 /* Flavor the objects */
6511 /* Flash a message */
6513 prt("¤ªÂÔ¤Á²¼¤µ¤¤...", 0, 0);
6515 prt("Please wait...", 0, 0);
6519 /* Flush the message */
6523 /* Hack -- Enter wizard mode */
6524 if (arg_wizard && enter_wizard_mode()) wizard = TRUE;
6526 /* Initialize the town-buildings if necessary */
6527 if (!dun_level && !p_ptr->inside_quest)
6529 /* Init the wilderness */
6531 process_dungeon_file("w_info_j.txt", 0, 0, max_wild_y, max_wild_x);
6534 init_flags = INIT_ONLY_BUILDINGS;
6536 process_dungeon_file("t_info_j.txt", 0, 0, MAX_HGT, MAX_WID);
6541 /* Initialize vault info */
6543 if (init_v_info()) quit("·úÃÛʪ½é´ü²½ÉÔǽ");
6545 if (init_v_info()) quit("Cannot initialize vaults");
6548 /* Generate a dungeon level if needed */
6549 if (!character_dungeon) generate_cave();
6552 /* Character is now "complete" */
6553 character_generated = TRUE;
6556 /* Hack -- Character is no longer "icky" */
6557 character_icky = FALSE;
6563 /* Reset the visual mappings */
6566 /* Load the "pref" files */
6567 load_all_pref_files();
6569 /* React to changes */
6570 Term_xtra(TERM_XTRA_REACT, 0);
6573 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
6576 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
6582 /* Set or clear "rogue_like_commands" if requested */
6583 if (arg_force_original) rogue_like_commands = FALSE;
6584 if (arg_force_roguelike) rogue_like_commands = TRUE;
6586 /* Hack -- Enforce "delayed death" */
6587 if (p_ptr->chp < 0) death = TRUE;
6589 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
6591 if (new_game && ((p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BEASTMASTER)))
6593 monster_type *m_ptr;
6594 int pet_r_idx = ((p_ptr->pclass == CLASS_CAVALRY) ? MON_HORSE : MON_YASE_HORSE);
6595 monster_race *r_ptr = &r_info[pet_r_idx];
6596 place_monster_aux(0, py, px - 1, pet_r_idx,
6597 (PM_FORCE_PET | PM_NO_KAGE));
6598 m_ptr = &m_list[hack_m_idx_ii];
6599 m_ptr->mspeed = r_ptr->speed;
6600 m_ptr->maxhp = r_ptr->hdice*(r_ptr->hside+1)/2;
6601 m_ptr->max_maxhp = m_ptr->maxhp;
6602 m_ptr->hp = r_ptr->hdice*(r_ptr->hside+1)/2;
6603 m_ptr->energy_need = ENERGY_NEED() + ENERGY_NEED();
6609 /* Process the level */
6613 if (p_ptr->notice) notice_stuff();
6616 if (p_ptr->update) update_stuff();
6619 if (p_ptr->redraw) redraw_stuff();
6622 if (p_ptr->window) window_stuff();
6625 /* Cancel the target */
6628 /* Cancel the health bar */
6632 /* Forget the lite */
6635 /* Forget the view */
6638 /* Forget the view */
6641 /* Handle "quit and save" */
6642 if (!alive && !death) break;
6644 /* Erase the old cave */
6646 if (!death) wipe_m_list();
6654 /* Accidental Death */
6657 if (p_ptr->inside_arena)
6659 p_ptr->inside_arena = FALSE;
6660 if(p_ptr->arena_number > MAX_ARENA_MONS)
6661 p_ptr->arena_number++;
6663 p_ptr->arena_number = 99;
6666 p_ptr->chp_frac = 0;
6667 p_ptr->exit_bldg = TRUE;
6672 /* Mega-Hack -- Allow player to cheat death */
6674 if ((wizard || cheat_live) && !get_check("»à¤Ë¤Þ¤¹¤«? "))
6676 if ((wizard || cheat_live) && !get_check("Die? "))
6680 /* Mark social class, reset age, if needed */
6681 if (p_ptr->sc) p_ptr->sc = p_ptr->age = 0;
6691 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÇ°¤òÁ÷¤ê¡¢»à¤òµ½¤¤¤¿¡£");
6693 msg_print("You invoke wizard mode and cheat death.");
6699 /* Restore hit points */
6700 p_ptr->chp = p_ptr->mhp;
6701 p_ptr->chp_frac = 0;
6703 if (p_ptr->pclass == CLASS_MAGIC_EATER)
6705 for (i = 0; i < EATER_EXT*2; i++)
6707 p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*EATER_CHARGE;
6709 for (; i < EATER_EXT*3; i++)
6711 p_ptr->magic_num1[i] = 0;
6714 /* Restore spell points */
6715 p_ptr->csp = p_ptr->msp;
6716 p_ptr->csp_frac = 0;
6718 /* Hack -- Healing */
6720 (void)set_confused(0);
6721 (void)set_poisoned(0);
6722 (void)set_afraid(0);
6723 (void)set_paralyzed(0);
6728 /* Hack -- Prevent starvation */
6729 (void)set_food(PY_FOOD_MAX - 1);
6731 /* Hack -- cancel recall */
6732 if (p_ptr->word_recall)
6736 msg_print("Ä¥¤ê¤Ä¤á¤¿Â絤¤¬Î®¤ìµî¤Ã¤¿...");
6738 msg_print("A tension leaves the air around you...");
6743 /* Hack -- Prevent recall */
6744 p_ptr->word_recall = 0;
6745 p_ptr->redraw |= (PR_STATUS);
6748 /* Note cause of death XXX XXX XXX */
6750 (void)strcpy(died_from, "»à¤Îµ½¤");
6752 (void)strcpy(died_from, "Cheating death");
6760 p_ptr->inside_arena = FALSE;
6761 p_ptr->inside_battle = FALSE;
6763 p_ptr->inside_quest = 0;
6764 p_ptr->recall_dungeon = dungeon_type;
6766 if (lite_town || vanilla_town)
6768 p_ptr->wilderness_y = 1;
6769 p_ptr->wilderness_x = 1;
6783 p_ptr->wilderness_y = 48;
6784 p_ptr->wilderness_x = 5;
6790 p_ptr->wild_mode = FALSE;
6791 p_ptr->leaving = TRUE;
6794 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " ¤·¤«¤·¡¢À¸¤Ê֤ä¿¡£");
6796 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " but revived.");
6802 /* Handle "death" */
6805 /* Make a new level */
6816 s32b turn_real(s32b hoge)
6818 if ((p_ptr->prace == RACE_VAMPIRE) ||
6819 (p_ptr->prace == RACE_SKELETON) ||
6820 (p_ptr->prace == RACE_ZOMBIE) ||
6821 (p_ptr->prace == RACE_SPECTRE))
6822 return hoge-(TURNS_PER_TICK * TOWN_DAWN *3/ 4);