4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: Angband game engine */
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_UNCURSED;
79 /* Ego-Items -- except cursed/broken ones */
80 if (ego_item_p(o_ptr)) return FEEL_UNCURSED;
82 /* Good armor bonus */
83 if (o_ptr->to_a > 0) return FEEL_UNCURSED;
85 /* Good weapon bonuses */
86 if (o_ptr->to_h + o_ptr->to_d > 0) return FEEL_UNCURSED;
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;
131 feel = randint0(3) ? FEEL_GOOD : FEEL_AVERAGE;
133 feel = FEEL_UNCURSED;
138 feel = randint0(2) ? FEEL_CURSED : FEEL_GOOD;
144 feel = randint0(3) ? FEEL_CURSED : FEEL_AVERAGE;
151 feel = FEEL_WORTHLESS;
156 feel = FEEL_TERRIBLE;
162 /* Stop everything */
163 if (disturb_minor) disturb(0, 0);
165 /* Get an object description */
166 object_desc(o_name, o_ptr, FALSE, 0);
168 /* Message (equipment) */
169 if (slot >= INVEN_RARM)
172 msg_format("%s%s(%c)¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
173 describe_use(slot),o_name, index_to_label(slot),game_inscriptions[feel]);
175 msg_format("You feel the %s (%c) you are %s %s %s...",
176 o_name, index_to_label(slot), describe_use(slot),
177 ((o_ptr->number == 1) ? "is" : "are"),
178 game_inscriptions[feel]);
183 /* Message (inventory) */
187 msg_format("¥¶¥Ã¥¯¤ÎÃæ¤Î%s(%c)¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
188 o_name, index_to_label(slot),game_inscriptions[feel]);
190 msg_format("You feel the %s (%c) in your pack %s %s...",
191 o_name, index_to_label(slot),
192 ((o_ptr->number == 1) ? "is" : "are"),
193 game_inscriptions[feel]);
198 /* We have "felt" it */
199 o_ptr->ident |= (IDENT_SENSE);
201 /* Set the "inscription" */
202 o_ptr->feeling = feel;
204 /* Auto-inscription/destroy */
205 idx = is_autopick(o_ptr);
206 auto_inscribe_item(slot, idx);
208 auto_destroy_item(slot, idx);
210 /* Combine / Reorder the pack (later) */
211 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
214 p_ptr->window |= (PW_INVEN | PW_EQUIP);
220 * Sense the inventory
222 * Class 0 = Warrior --> fast and heavy
223 * Class 1 = Mage --> slow and light
224 * Class 2 = Priest --> fast but light
225 * Class 3 = Rogue --> okay and heavy
226 * Class 4 = Ranger --> slow but heavy (changed!)
227 * Class 5 = Paladin --> slow but heavy
229 static void sense_inventory1(void)
232 int plev = p_ptr->lev;
237 /*** Check for "sensing" ***/
239 /* No sensing when confused */
240 if (p_ptr->confused) return;
242 /* Analyze the class */
243 switch (p_ptr->pclass)
251 if (0 != randint0(9000L / (plev * plev + 40))) return;
263 if (0 != randint0(6000L / (plev * plev + 50))) return;
273 case CLASS_HIGH_MAGE:
275 case CLASS_MAGIC_EATER:
277 /* Very bad (light) sensing */
278 if (0 != randint0(240000L / (plev + 5))) return;
287 /* Good (light) sensing */
288 if (0 != randint0(10000L / (plev * plev + 40))) return;
298 if (0 != randint0(20000L / (plev * plev + 40))) return;
310 if (0 != randint0(95000L / (plev * plev + 40))) return;
322 if (0 != randint0(77777L / (plev * plev + 40))) return;
331 case CLASS_WARRIOR_MAGE:
335 if (0 != randint0(75000L / (plev * plev + 40))) return;
341 case CLASS_MINDCRAFTER:
343 case CLASS_BLUE_MAGE:
344 case CLASS_MIRROR_MASTER:
347 if (0 != randint0(55000L / (plev * plev + 40))) return;
353 case CLASS_CHAOS_WARRIOR:
356 if (0 != randint0(80000L / (plev * plev + 40))) return;
366 case CLASS_FORCETRAINER:
369 if (0 != randint0(20000L / (plev * plev + 40))) return;
378 if (0 != randint0(20000L / ((plev+50)*(plev+50)))) return;
387 case CLASS_BEASTMASTER:
390 if (0 != randint0(65000L / (plev * plev + 40))) return;
395 case CLASS_BERSERKER:
405 if (compare_virtue(V_KNOWLEDGE, 100, VIRTUE_LARGE)) heavy = TRUE;
407 /*** Sense everything ***/
409 /* Check everything */
410 for (i = 0; i < INVEN_TOTAL; i++)
414 o_ptr = &inventory[i];
416 /* Skip empty slots */
417 if (!o_ptr->k_idx) continue;
419 /* 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)
620 max_level = d_info[dungeon_type].maxdepth;
621 min_level = d_info[dungeon_type].mindepth;
626 sprintf(ppp, "¥Æ¥ì¥Ý¡¼¥ÈÀè:(%d-%d)", min_level, max_level);
628 sprintf(ppp, "Teleport to level (%d-%d): ", min_level, max_level);
633 sprintf(tmp_val, "%d", dun_level);
635 /* Ask for a level */
636 if (!get_string(ppp, tmp_val, 10)) return;
638 /* Extract request */
639 command_arg = atoi(tmp_val);
642 else if (get_check("Ä̾ï¥Æ¥ì¥Ý¡¼¥È¡©"))
644 else if (get_check("Normal teleport? "))
648 teleport_player(200);
657 if (command_arg < min_level) command_arg = min_level;
660 if (command_arg > max_level) command_arg = max_level;
664 msg_format("%d ³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤·¤¿¡£", command_arg);
666 msg_format("You teleport to dungeon level %d.", command_arg);
670 if (autosave_l) do_cmd_save_game(TRUE);
673 dun_level = command_arg;
674 prepare_change_floor_mode(CFM_CLEAR_ALL);
678 if (record_stair) do_cmd_write_nikki(NIKKI_PAT_TELE,0,NULL);
680 p_ptr->inside_quest = 0;
681 p_ptr->leftbldg = FALSE;
685 p_ptr->leaving = TRUE;
689 static void wreck_the_pattern(void)
691 int to_ruin = 0, r_y, r_x;
693 if (cave[py][px].feat == FEAT_PATTERN_XTRA2)
700 msg_print("¥Ñ¥¿¡¼¥ó¤ò·ì¤Ç±ø¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
701 msg_print("²¿¤«¶²¤í¤·¤¤»ö¤¬µ¯¤³¤Ã¤¿¡ª");
703 msg_print("You bleed on the Pattern!");
704 msg_print("Something terrible happens!");
710 take_hit(DAMAGE_NOESCAPE, damroll(10, 8), "¥Ñ¥¿¡¼¥ó»²õ", -1);
712 take_hit(DAMAGE_NOESCAPE, damroll(10, 8), "corrupting the Pattern", -1);
716 to_ruin = randint1(45) + 35;
720 scatter(&r_y, &r_x, py, px, 4, 0);
722 if ((cave[r_y][r_x].feat >= FEAT_PATTERN_START) &&
723 (cave[r_y][r_x].feat < FEAT_PATTERN_XTRA2))
725 cave_set_feat(r_y, r_x, FEAT_PATTERN_XTRA2);
729 cave_set_feat(py, px, FEAT_PATTERN_XTRA2);
733 /* Returns TRUE if we are on the Pattern... */
734 static bool pattern_effect(void)
736 if ((cave[py][px].feat < FEAT_PATTERN_START) ||
737 (cave[py][px].feat > FEAT_PATTERN_XTRA2))
740 if ((prace_is_(RACE_AMBERITE)) &&
741 (p_ptr->cut > 0) && one_in_(10))
746 if (cave[py][px].feat == FEAT_PATTERN_END)
748 (void)set_poisoned(0);
754 (void)do_res_stat(A_STR);
755 (void)do_res_stat(A_INT);
756 (void)do_res_stat(A_WIS);
757 (void)do_res_stat(A_DEX);
758 (void)do_res_stat(A_CON);
759 (void)do_res_stat(A_CHR);
760 (void)restore_level();
761 (void)hp_player(1000);
762 cave_set_feat(py, px, FEAT_PATTERN_OLD);
764 msg_print("¡Ö¥Ñ¥¿¡¼¥ó¡×¤Î¤³¤ÎÉôʬ¤Ï¾¤ÎÉôʬ¤è¤ê¶¯ÎϤǤʤ¤¤è¤¦¤À¡£");
766 msg_print("This section of the Pattern looks less powerful.");
773 * We could make the healing effect of the
774 * Pattern center one-time only to avoid various kinds
775 * of abuse, like luring the win monster into fighting you
776 * in the middle of the pattern...
779 else if (cave[py][px].feat == FEAT_PATTERN_OLD)
783 else if (cave[py][px].feat == FEAT_PATTERN_XTRA1)
787 else if (cave[py][px].feat == FEAT_PATTERN_XTRA2)
791 take_hit(DAMAGE_NOESCAPE, 200, "²õ¤ì¤¿¡Ö¥Ñ¥¿¡¼¥ó¡×¤òÊ⤤¤¿¥À¥á¡¼¥¸", -1);
793 take_hit(DAMAGE_NOESCAPE, 200, "walking the corrupted Pattern", -1);
799 if ((prace_is_(RACE_AMBERITE)) && !one_in_(2))
801 else if (!p_ptr->invuln)
803 take_hit(DAMAGE_NOESCAPE, damroll(1,3), "¡Ö¥Ñ¥¿¡¼¥ó¡×¤òÊ⤤¤¿¥À¥á¡¼¥¸", -1);
805 take_hit(DAMAGE_NOESCAPE, damroll(1, 3), "walking the Pattern", -1);
818 * Regenerate hit points -RAK-
820 static void regenhp(int percent)
822 s32b new_chp, new_chp_frac;
825 if (p_ptr->special_defense & KATA_KOUKIJIN) return;
826 if (p_ptr->action == ACTION_HAYAGAKE) return;
827 /* Save the old hitpoints */
828 old_chp = p_ptr->chp;
830 /* Extract the new hitpoints */
831 new_chp = ((long)p_ptr->mhp) * percent + PY_REGEN_HPBASE;
832 p_ptr->chp += (s16b)(new_chp >> 16); /* div 65536 */
834 /* check for overflow */
835 if ((p_ptr->chp < 0) && (old_chp > 0)) p_ptr->chp = MAX_SHORT;
836 new_chp_frac = (new_chp & 0xFFFF) + p_ptr->chp_frac; /* mod 65536 */
837 if (new_chp_frac >= 0x10000L)
839 p_ptr->chp_frac = (u16b)(new_chp_frac - 0x10000L);
844 p_ptr->chp_frac = (u16b)new_chp_frac;
848 if (p_ptr->chp >= p_ptr->mhp)
850 p_ptr->chp = p_ptr->mhp;
855 if (old_chp != p_ptr->chp)
858 p_ptr->redraw |= (PR_HP);
861 p_ptr->window |= (PW_PLAYER);
869 * Regenerate mana points -RAK-
871 static void regenmana(int percent)
873 s32b new_mana, new_mana_frac;
875 bool old_csp_msp = (p_ptr->csp > p_ptr->msp);
877 if (p_ptr->special_defense & KATA_KOUKIJIN) return;
878 if ((p_ptr->pclass == CLASS_SAMURAI) && (p_ptr->regenerate)) percent /= 2;
879 old_csp = p_ptr->csp;
880 new_mana = ((long)p_ptr->msp) * percent + PY_REGEN_MNBASE;
881 if (old_csp_msp && (new_mana > 0))
885 p_ptr->csp -= (s16b)(new_mana >> 16); /* div 65536 */
886 new_mana_frac = p_ptr->csp_frac + 0x10000L - (new_mana & 0xFFFF);
890 if (old_csp_msp) new_mana += ((((long)p_ptr->msp) * percent + PY_REGEN_MNBASE) * 32);
891 p_ptr->csp += (s16b)(new_mana >> 16); /* div 65536 */
893 new_mana_frac = (new_mana & 0xFFFF) + p_ptr->csp_frac; /* mod 65536 */
895 if (new_mana_frac >= 0x10000L)
897 p_ptr->csp_frac = (u16b)(new_mana_frac - 0x10000L);
902 p_ptr->csp_frac = (u16b)(new_mana_frac);
905 /* check for overflow */
912 /* Must set frac to zero even if equal */
913 if ((old_csp_msp && p_ptr->csp < p_ptr->msp) || (!old_csp_msp && p_ptr->csp >= p_ptr->msp))
915 p_ptr->csp = p_ptr->msp;
920 if (old_csp != p_ptr->csp)
923 p_ptr->redraw |= (PR_MANA);
926 p_ptr->window |= (PW_PLAYER);
927 p_ptr->window |= (PW_SPELL);
938 static void regenmagic(int percent)
943 for (i = 0; i < EATER_EXT*2; i++)
945 if (!p_ptr->magic_num2[i]) continue;
946 if (p_ptr->magic_num1[i] == ((long)p_ptr->magic_num2[i] << 16)) continue;
947 new_mana = ((long)p_ptr->magic_num2[i]+adj_mag_mana[A_INT]+13) * percent / 8;
948 p_ptr->magic_num1[i] += new_mana;
950 /* Must set frac to zero even if equal */
951 if (p_ptr->magic_num1[i] > (p_ptr->magic_num2[i] << 16))
953 p_ptr->magic_num1[i] = ((long)p_ptr->magic_num2[i] << 16);
957 for (i = EATER_EXT*2; i < EATER_EXT*3; i++)
959 if (!p_ptr->magic_num1[i]) continue;
960 if (!p_ptr->magic_num2[i]) continue;
961 p_ptr->magic_num1[i] -= (long)(p_ptr->magic_num2[i] * (adj_mag_mana[A_INT] + 10)) * EATER_ROD_CHARGE/16;
962 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
973 * Regenerate the monsters (once per 100 game turns)
975 * XXX XXX XXX Should probably be done during monster turns.
977 static void regen_monsters(void)
982 /* Regenerate everyone */
983 for (i = 1; i < m_max; i++)
985 /* Check the i'th monster */
986 monster_type *m_ptr = &m_list[i];
987 monster_race *r_ptr = &r_info[m_ptr->r_idx];
990 /* Skip dead monsters */
991 if (!m_ptr->r_idx) continue;
993 /* Allow regeneration (if needed) */
994 if (m_ptr->hp < m_ptr->maxhp)
996 /* Hack -- Base regeneration */
997 frac = m_ptr->maxhp / 100;
999 /* Hack -- Minimal regeneration rate */
1000 if (!frac) if (one_in_(2)) frac = 1;
1002 /* Hack -- Some monsters regenerate quickly */
1003 if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2;
1005 /* Hack -- Regenerate */
1008 /* Do not over-regenerate */
1009 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
1011 /* Redraw (later) if needed */
1012 if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH);
1013 if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH);
1020 * Regenerate the monsters (once per 100 game turns)
1022 * XXX XXX XXX Should probably be done during monster turns.
1024 static void regen_captured_monsters(void)
1029 /* Regenerate everyone */
1030 for (i = 0; i < INVEN_TOTAL; i++)
1032 monster_race *r_ptr;
1033 object_type *o_ptr = &inventory[i];
1035 if (!o_ptr->k_idx) continue;
1036 if (o_ptr->tval != TV_CAPTURE) continue;
1037 if (!o_ptr->pval) continue;
1041 r_ptr = &r_info[o_ptr->pval];
1043 /* Allow regeneration (if needed) */
1044 if (o_ptr->xtra4 < o_ptr->xtra5)
1046 /* Hack -- Base regeneration */
1047 frac = o_ptr->xtra5 / 100;
1049 /* Hack -- Minimal regeneration rate */
1050 if (!frac) if (one_in_(2)) frac = 1;
1052 /* Hack -- Some monsters regenerate quickly */
1053 if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2;
1055 /* Hack -- Regenerate */
1056 o_ptr->xtra4 += frac;
1058 /* Do not over-regenerate */
1059 if (o_ptr->xtra4 > o_ptr->xtra5) o_ptr->xtra4 = o_ptr->xtra5;
1066 p_ptr->notice |= (PN_COMBINE);
1069 p_ptr->window |= (PW_INVEN);
1070 p_ptr->window |= (PW_EQUIP);
1076 static void notice_lite_change(object_type *o_ptr)
1078 /* Hack -- notice interesting fuel steps */
1079 if ((o_ptr->xtra4 < 100) || (!(o_ptr->xtra4 % 100)))
1082 p_ptr->window |= (PW_EQUIP);
1085 /* Hack -- Special treatment when blind */
1088 /* Hack -- save some light for later */
1089 if (o_ptr->xtra4 == 0) o_ptr->xtra4++;
1092 /* The light is now out */
1093 else if (o_ptr->xtra4 == 0)
1097 msg_print("ÌÀ¤«¤ê¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1099 msg_print("Your light has gone out!");
1101 p_ptr->update |= (PU_BONUS);
1104 /* The light is getting dim */
1105 else if (o_ptr->name2 == EGO_LITE_LONG)
1107 if ((o_ptr->xtra4 < 50) && (!(o_ptr->xtra4 % 5))
1108 && (turn % (TURNS_PER_TICK*2)))
1110 if (disturb_minor) disturb(0, 0);
1112 msg_print("ÌÀ¤«¤ê¤¬Èù¤«¤Ë¤Ê¤Ã¤Æ¤¤Æ¤¤¤ë¡£");
1114 msg_print("Your light is growing faint.");
1120 /* The light is getting dim */
1121 else if ((o_ptr->xtra4 < 100) && (!(o_ptr->xtra4 % 10)))
1123 if (disturb_minor) disturb(0, 0);
1125 msg_print("ÌÀ¤«¤ê¤¬Èù¤«¤Ë¤Ê¤Ã¤Æ¤¤Æ¤¤¤ë¡£");
1127 msg_print("Your light is growing faint.");
1134 void leave_quest_check(void)
1136 /* Save quset number for dungeon pref file ($LEAVING_QUEST) */
1137 leaving_quest = p_ptr->inside_quest;
1139 /* Leaving an 'only once' quest marks it as failed */
1140 if (leaving_quest &&
1141 ((quest[leaving_quest].flags & QUEST_FLAG_ONCE) || (quest[leaving_quest].type == QUEST_TYPE_RANDOM)) &&
1142 (quest[leaving_quest].status == QUEST_STATUS_TAKEN))
1144 quest[leaving_quest].status = QUEST_STATUS_FAILED;
1145 quest[leaving_quest].complev = (byte)p_ptr->lev;
1146 if (quest[leaving_quest].type == QUEST_TYPE_RANDOM)
1148 r_info[quest[leaving_quest].r_idx].flags1 &= ~(RF1_QUESTOR);
1149 if (record_rand_quest)
1150 do_cmd_write_nikki(NIKKI_RAND_QUEST_F, leaving_quest, NULL);
1152 /* Floor of random quest will be blocked */
1153 prepare_change_floor_mode(CFM_NO_RETURN);
1155 else if (record_fix_quest)
1156 do_cmd_write_nikki(NIKKI_FIX_QUEST_F, leaving_quest, NULL);
1162 * Forcibly pseudo-identify an object in the inventory
1165 * note: currently this function allows pseudo-id of any object,
1166 * including silly ones like potions & scrolls, which always
1167 * get '{average}'. This should be changed, either to stop such
1168 * items from being pseudo-id'd, or to allow psychometry to
1169 * detect whether the unidentified potion/scroll/etc is
1170 * good (Cure Light Wounds, Restore Strength, etc) or
1171 * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
1173 bool psychometry(void)
1177 char o_name[MAX_NLEN];
1183 item_tester_no_ryoute = TRUE;
1186 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«¡©";
1187 s = "Ä´¤Ù¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
1189 q = "Meditate on which item? ";
1190 s = "You have nothing appropriate.";
1193 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
1195 /* Get the item (in the pack) */
1198 o_ptr = &inventory[item];
1201 /* Get the item (on the floor) */
1204 o_ptr = &o_list[0 - item];
1207 /* It is fully known, no information needed */
1208 if (object_known_p(o_ptr))
1211 msg_print("²¿¤â¿·¤·¤¤¤³¤È¤ÏȽ¤é¤Ê¤«¤Ã¤¿¡£");
1213 msg_print("You cannot find out anything more about that.");
1219 /* Check for a feeling */
1220 feel = value_check_aux1(o_ptr);
1222 /* Get an object description */
1223 object_desc(o_name, o_ptr, FALSE, 0);
1225 /* Skip non-feelings */
1229 msg_format("%s¤«¤é¤ÏÆäËÊѤï¤Ã¤¿»ö¤Ï´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿¡£", o_name);
1231 msg_format("You do not perceive anything unusual about the %s.", o_name);
1238 msg_format("%s¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
1239 o_name, game_inscriptions[feel]);
1241 msg_format("You feel that the %s %s %s...",
1242 o_name, ((o_ptr->number == 1) ? "is" : "are"),
1243 game_inscriptions[feel]);
1247 /* We have "felt" it */
1248 o_ptr->ident |= (IDENT_SENSE);
1251 o_ptr->feeling = feel;
1253 /* Combine / Reorder the pack (later) */
1254 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1257 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1259 /* Valid "tval" codes */
1260 switch (o_ptr->tval)
1288 /* Auto-inscription/destroy */
1289 idx = is_autopick(o_ptr);
1290 auto_inscribe_item(item, idx);
1291 if (okay && destroy_feeling)
1292 auto_destroy_item(item, idx);
1294 /* Something happened */
1299 static void gere_music(s32b music)
1307 stun_monsters(damroll(p_ptr->lev/10,2));
1310 hp_player(damroll(2,6));
1313 project_hack(GF_TURN_ALL, p_ptr->lev);
1316 project_hack(GF_PSI, randint1(p_ptr->lev * 3 / 2));
1319 project(0, 1, py, px, 0, GF_IDENTIFY, PROJECT_ITEM, -1);
1322 confuse_monsters(p_ptr->lev * 2);
1325 project_hack(GF_SOUND, damroll(10 + p_ptr->lev/5,7));
1328 charm_monsters(damroll(10 + p_ptr->lev/15,6));
1331 project(0, 0, py, px,
1332 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
1335 dispel_monsters(randint1(p_ptr->lev * 3));
1336 dispel_evil(randint1(p_ptr->lev * 3));
1343 earthquake(py, px, 10);
1346 stasis_monsters(p_ptr->lev * 4);
1349 dispel_monsters(randint1(p_ptr->lev * 3));
1352 hp_player(damroll(15,10));
1356 case MUSIC_DETECT+19:
1358 case MUSIC_DETECT+11:
1359 case MUSIC_DETECT+12:
1360 case MUSIC_DETECT+13:
1361 case MUSIC_DETECT+14:
1362 case MUSIC_DETECT+15:
1363 case MUSIC_DETECT+16:
1364 case MUSIC_DETECT+17:
1365 case MUSIC_DETECT+18:
1366 map_area(DETECT_RAD_MAP);
1367 if ((p_ptr->lev > 39) && (music < MUSIC_DETECT+19)) p_ptr->magic_num1[0] = music+1;
1368 case MUSIC_DETECT+6:
1369 case MUSIC_DETECT+7:
1370 case MUSIC_DETECT+8:
1371 case MUSIC_DETECT+9:
1372 case MUSIC_DETECT+10:
1373 /* There are too many hidden treasure. So... */
1374 /* detect_treasure(DETECT_RAD_DEFAULT); */
1375 detect_objects_gold(DETECT_RAD_DEFAULT);
1376 detect_objects_normal(DETECT_RAD_DEFAULT);
1377 if ((p_ptr->lev > 24) && (music < MUSIC_DETECT+11)) p_ptr->magic_num1[0] = music+1;
1378 case MUSIC_DETECT+3:
1379 case MUSIC_DETECT+4:
1380 case MUSIC_DETECT+5:
1381 detect_monsters_invis(DETECT_RAD_DEFAULT);
1382 detect_monsters_normal(DETECT_RAD_DEFAULT);
1383 if ((p_ptr->lev > 19) && (music < MUSIC_DETECT+6)) p_ptr->magic_num1[0] = music+1;
1385 case MUSIC_DETECT+1:
1386 case MUSIC_DETECT+2:
1387 detect_traps(DETECT_RAD_DEFAULT, TRUE);
1388 detect_doors(DETECT_RAD_DEFAULT);
1389 detect_stairs(DETECT_RAD_DEFAULT);
1390 if ((p_ptr->lev > 14) && (music < MUSIC_DETECT+3)) p_ptr->magic_num1[0] = music+1;
1396 * If player has inscribed the object with "!!", let him know when it's
1399 static void recharged_notice(object_type *o_ptr)
1401 char o_name[MAX_NLEN];
1405 /* No inscription */
1406 if (!o_ptr->inscription) return;
1409 s = strchr(quark_str(o_ptr->inscription), '!');
1411 /* Process notification request. */
1414 /* Find another '!' */
1417 /* Describe (briefly) */
1418 object_desc(o_name, o_ptr, FALSE, 0);
1420 /* Notify the player */
1422 msg_format("%s¤ÏºÆ½¼Å¶¤µ¤ì¤¿¡£", o_name);
1424 if (o_ptr->number > 1)
1425 msg_format("Your %s are recharged.", o_name);
1427 msg_format("Your %s is recharged.", o_name);
1436 /* Keep looking for '!'s */
1437 s = strchr(s + 1, '!');
1442 static void check_music(void)
1448 /* Music singed by player */
1449 if (p_ptr->pclass != CLASS_BARD) return;
1450 if (!p_ptr->magic_num1[0] && !p_ptr->magic_num1[1]) return;
1452 spell = p_ptr->magic_num2[0];
1453 s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC][spell];
1455 need_mana = mod_need_mana(s_ptr->smana, spell, REALM_MUSIC);
1456 need_mana *= 0x8000;
1457 if (((u32b)p_ptr->csp < (need_mana / 0x10000)) || (p_ptr->anti_magic))
1464 p_ptr->csp -= (u16b) (need_mana / 0x10000);
1465 need_mana = (need_mana & 0xffff);
1466 if ((u32b)p_ptr->csp_frac < need_mana)
1469 p_ptr->csp_frac += (u16b)(0x10000L - need_mana);
1473 p_ptr->csp_frac -= (u16b)need_mana;
1476 p_ptr->redraw |= PR_MANA;
1477 if (p_ptr->magic_num1[1])
1479 p_ptr->magic_num1[0] = p_ptr->magic_num1[1];
1480 p_ptr->magic_num1[1] = 0;
1482 msg_print("²Î¤òºÆ³«¤·¤¿¡£");
1484 msg_print("You restart singing.");
1486 p_ptr->action = ACTION_SING;
1488 /* Recalculate bonuses */
1489 p_ptr->update |= (PU_BONUS | PU_HP);
1491 /* Redraw status bar */
1492 p_ptr->redraw |= (PR_STATUS);
1495 if (p_ptr->spell_exp[spell] < SPELL_EXP_BEGINNER)
1496 p_ptr->spell_exp[spell] += 5;
1497 else if(p_ptr->spell_exp[spell] < SPELL_EXP_SKILLED)
1498 { if (one_in_(2) && (dun_level > 4) && ((dun_level + 10) > p_ptr->lev)) p_ptr->spell_exp[spell] += 1; }
1499 else if(p_ptr->spell_exp[spell] < SPELL_EXP_EXPERT)
1500 { if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel)) p_ptr->spell_exp[spell] += 1; }
1501 else if(p_ptr->spell_exp[spell] < SPELL_EXP_MASTER)
1502 { if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel)) p_ptr->spell_exp[spell] += 1; }
1504 gere_music(p_ptr->magic_num1[0]);
1507 /* Choose one of items that have cursed flag */
1508 static object_type *choose_cursed_obj_name(u32b flag)
1511 int choices[INVEN_TOTAL-INVEN_RARM];
1514 /* Paranoia -- Player has no warning-item */
1515 if (!(p_ptr->cursed & flag)) return NULL;
1517 /* Search Inventry */
1518 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
1520 object_type *o_ptr = &inventory[i];
1522 if (o_ptr->curse_flags & flag)
1524 choices[number] = i;
1529 /* Choice one of them */
1530 return (&inventory[choices[randint0(number)]]);
1535 * Handle certain things once every 10 game turns
1537 static void process_world(void)
1541 bool cave_no_regen = FALSE;
1542 int upkeep_factor = 0;
1547 const int dec_count = (easy_band ? 2 : 1);
1549 int day, hour, min, prev_min;
1551 s32b len = TURNS_PER_TICK * TOWN_DAWN;
1552 s32b tick = turn % len + len / 4;
1554 extract_day_hour_min(&day, &hour, &min);
1555 prev_min = (1440 * (tick - TURNS_PER_TICK) / len) % 60;
1557 if ((turn - old_turn == (150 - dun_level) * TURNS_PER_TICK)
1559 !(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)))) &&
1560 !(p_ptr->inside_battle))
1563 if (p_ptr->inside_battle && !p_ptr->leaving)
1570 /* Count all hostile monsters */
1571 for (i2 = 0; i2 < cur_wid; ++i2)
1572 for (j2 = 0; j2 < cur_hgt; j2++)
1573 if ((cave[j2][i2].m_idx > 0) && (cave[j2][i2].m_idx != p_ptr->riding))
1576 win_m_idx = cave[j2][i2].m_idx;
1579 if (number_mon == 0)
1582 msg_print("ÁêÂǤÁ¤Ë½ª¤ï¤ê¤Þ¤·¤¿¡£");
1584 msg_print("They have kill each other at the same time.");
1587 p_ptr->energy_need = 0;
1590 else if ((number_mon-1) == 0)
1593 monster_type *wm_ptr;
1595 wm_ptr = &m_list[win_m_idx];
1597 monster_desc(m_name, wm_ptr, 0);
1599 msg_format("%s¤¬¾¡Íø¤·¤¿¡ª", m_name);
1601 msg_format("%s is winner!", m_name);
1605 if (win_m_idx == (sel_monster+1))
1608 msg_print("¤ª¤á¤Ç¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£");
1610 msg_print("Congratulations.");
1613 msg_format("%d¡ð¤ò¼õ¤±¼è¤Ã¤¿¡£", battle_odds);
1615 msg_format("You received %d gold.", battle_odds);
1617 p_ptr->au += battle_odds;
1622 msg_print("»ÄÇ°¤Ç¤·¤¿¡£");
1624 msg_print("You lost gold.");
1628 p_ptr->energy_need = 0;
1631 else if(turn - old_turn == 150*TURNS_PER_TICK)
1634 msg_print("¿½¤·Ê¬¤±¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤³¤Î¾¡Éé¤Ï°ú¤Ê¬¤±¤È¤µ¤»¤Æ¤¤¤¿¤À¤¤Þ¤¹¡£");
1636 msg_format("This battle have ended in a draw.");
1638 p_ptr->au += kakekin;
1640 p_ptr->energy_need = 0;
1645 /* Every 20 game turns */
1646 if (turn % TURNS_PER_TICK) return;
1648 /*** Check the Time and Load ***/
1650 if (!(turn % (50*TURNS_PER_TICK)))
1652 /* Check time and load */
1653 if ((0 != check_time()) || (0 != check_load()))
1656 if (closing_flag <= 2)
1661 /* Count warnings */
1666 msg_print("¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¸¤«¤«¤Ã¤Æ¤¤¤Þ¤¹...");
1667 msg_print("¥²¡¼¥à¤ò½ªÎ»¤¹¤ë¤«¥»¡¼¥Ö¤¹¤ë¤«¤·¤Æ²¼¤µ¤¤¡£");
1669 msg_print("The gates to ANGBAND are closing...");
1670 msg_print("Please finish up and/or save your game.");
1680 msg_print("º£¡¢¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¶¤µ¤ì¤Þ¤·¤¿¡£");
1682 msg_print("The gates to ANGBAND are now closed.");
1687 p_ptr->playing = FALSE;
1690 p_ptr->leaving = TRUE;
1695 /*** Attempt timed autosave ***/
1696 if (autosave_t && autosave_freq && !p_ptr->inside_battle)
1698 if (!(turn % ((s32b)autosave_freq * TURNS_PER_TICK)))
1699 do_cmd_save_game(TRUE);
1705 msg_print("²¿¤«¤¬Ê¹¤³¤¨¤¿¡£");
1707 msg_print("You hear noise.");
1711 /*** Handle the wilderness/town (sunshine) ***/
1713 /* While in town/wilderness */
1714 if (!dun_level && !p_ptr->inside_quest && !p_ptr->inside_battle && !p_ptr->inside_arena && !p_ptr->wild_mode)
1716 /* Hack -- Daybreak/Nighfall in town */
1717 if (!(turn % ((TURNS_PER_TICK * TOWN_DAWN) / 2)))
1721 /* Check for dawn */
1722 dawn = (!(turn % (TURNS_PER_TICK * TOWN_DAWN)));
1729 msg_print("Ì뤬ÌÀ¤±¤¿¡£");
1731 msg_print("The sun has risen.");
1735 /* Hack -- Scan the town */
1736 for (y = 0; y < cur_hgt; y++)
1738 for (x = 0; x < cur_wid; x++)
1740 /* Get the cave grid */
1741 c_ptr = &cave[y][x];
1744 c_ptr->info |= (CAVE_GLOW);
1746 /* Hack -- Memorize lit grids if allowed */
1747 if (view_perma_grids) c_ptr->info |= (CAVE_MARK);
1749 /* Hack -- Notice spot */
1760 msg_print("Æü¤¬ÄÀ¤ó¤À¡£");
1762 msg_print("The sun has fallen.");
1766 /* Hack -- Scan the town */
1767 for (y = 0; y < cur_hgt; y++)
1769 for (x = 0; x < cur_wid; x++)
1771 /* Get the cave grid */
1772 c_ptr = &cave[y][x];
1774 /* Darken "boring" features */
1775 if ((c_ptr->feat <= FEAT_INVIS) ||
1776 ((c_ptr->feat >= FEAT_DEEP_WATER) &&
1777 (c_ptr->feat <= FEAT_MOUNTAIN) &&
1778 (c_ptr->feat != FEAT_MUSEUM)) ||
1779 (x == 0) || (x == cur_wid-1) ||
1780 (y == 0) || (y == cur_hgt-1))
1782 /* Forget the grid */
1783 if (!is_mirror_grid(c_ptr)) c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK);
1785 /* Hack -- Notice spot */
1790 /* Glow deep lava */
1795 /* Update the monsters */
1796 p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
1799 p_ptr->redraw |= (PR_MAP);
1802 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1806 /* Set back the rewards once a day */
1807 if (!(turn % (TURNS_PER_TICK*10 * STORE_TURNS)))
1811 /* Reset the rewards */
1812 for (n = 0; n < MAX_BACT; n++)
1814 p_ptr->rewards[n] = FALSE;
1819 if (cheat_xtra) msg_print("Êó½·¤ò¥ê¥»¥Ã¥È");
1821 if (cheat_xtra) msg_print("Rewards reset.");
1827 /*** Process the monsters ***/
1829 /* Check for creature generation. */
1830 if (one_in_(d_info[dungeon_type].max_m_alloc_chance) &&
1831 !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->inside_battle)
1833 /* Make a new monster */
1834 (void)alloc_monster(MAX_SIGHT + 5, 0);
1837 /* Hack -- Check for creature regeneration */
1838 if (!(turn % (TURNS_PER_TICK*10)) && !p_ptr->inside_battle) regen_monsters();
1839 if (!(turn % (TURNS_PER_TICK*3))) regen_captured_monsters();
1842 /*** Damage over Time ***/
1844 /* Take damage from poison */
1845 if (p_ptr->poisoned && !p_ptr->invuln)
1849 take_hit(DAMAGE_NOESCAPE, 1, "ÆÇ", -1);
1851 take_hit(DAMAGE_NOESCAPE, 1, "poison", -1);
1857 /* (Vampires) Take damage from sunlight */
1858 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
1860 if (!dun_level && !p_ptr->resist_lite && !p_ptr->invuln && is_daytime())
1862 if (cave[py][px].info & CAVE_GLOW)
1866 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª");
1867 take_hit(DAMAGE_NOESCAPE, 1, "Æü¸÷", -1);
1869 msg_print("The sun's rays scorch your undead flesh!");
1870 take_hit(DAMAGE_NOESCAPE, 1, "sunlight", -1);
1873 cave_no_regen = TRUE;
1877 if (inventory[INVEN_LITE].tval && (inventory[INVEN_LITE].name2 != EGO_LITE_DARKNESS) &&
1878 !p_ptr->resist_lite)
1880 object_type * o_ptr = &inventory[INVEN_LITE];
1881 char o_name [MAX_NLEN];
1882 char ouch [MAX_NLEN+40];
1884 /* Get an object description */
1885 object_desc(o_name, o_ptr, FALSE, 0);
1888 msg_format("%s¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª", o_name);
1890 msg_format("The %s scorches your undead flesh!", o_name);
1894 cave_no_regen = TRUE;
1896 /* Get an object description */
1897 object_desc(o_name, o_ptr, TRUE, 0);
1900 sprintf(ouch, "%s¤òÁõÈ÷¤·¤¿¥À¥á¡¼¥¸", o_name);
1902 sprintf(ouch, "wielding %s", o_name);
1905 if (!p_ptr->invuln) take_hit(DAMAGE_NOESCAPE, 1, ouch, -1);
1909 if ((cave[py][px].feat == FEAT_SHAL_LAVA) &&
1910 !p_ptr->invuln && !p_ptr->immune_fire && !p_ptr->ffall)
1912 int damage = 3000 + randint0(2000);
1914 if (prace_is_(RACE_ENT)) damage += damage/3;
1916 if (p_ptr->resist_fire) damage = damage / 3;
1917 if (p_ptr->oppose_fire) damage = damage / 3;
1918 damage = damage / 100 + (randint0(100) < (damage % 100));
1924 msg_print("ÍÏ´ä¤Ç²Ð½ý¤·¤¿¡ª");
1925 take_hit(DAMAGE_NOESCAPE, damage, "Àõ¤¤ÍÏ´äή", -1);
1927 msg_print("The lava burns you!");
1928 take_hit(DAMAGE_NOESCAPE, damage, "shallow lava", -1);
1931 cave_no_regen = TRUE;
1935 else if ((cave[py][px].feat == FEAT_DEEP_LAVA) &&
1936 !p_ptr->invuln && !p_ptr->immune_fire)
1938 int damage = 6000 + randint0(4000);
1943 if (p_ptr->resist_fire) damage = damage / 3;
1944 if (p_ptr->oppose_fire) damage = damage / 3;
1948 damage = damage / 5;
1951 message = "Ç®¤Ç²Ð½ý¤·¤¿¡ª";
1952 hit_from = "¿¼¤¤ÍÏ´äή¤Î¾å¤ËÉâÍ·¤·¤¿¥À¥á¡¼¥¸";
1954 message = "The heat burns you!";
1955 hit_from = "flying over deep lava";
1962 message = "ÍÏ´ä¤Ç²Ð½ý¤·¤¿¡ª";
1963 hit_from = "¿¼¤¤ÍÏ´äή";
1965 message = "The lava burns you!";
1966 hit_from = "deep lava";
1971 damage = damage / 100 + (randint0(100) < (damage % 100));
1976 take_hit(DAMAGE_NOESCAPE, damage, hit_from, -1);
1978 cave_no_regen = TRUE;
1982 else if ((cave[py][px].feat == FEAT_DEEP_WATER) && !p_ptr->ffall && !p_ptr->can_swim)
1984 if (p_ptr->total_weight > (((u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2))
1988 msg_print("Å®¤ì¤Æ¤¤¤ë¡ª");
1989 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), "Å®¤ì", -1);
1991 msg_print("You are drowning!");
1992 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), "drowning", -1);
1995 cave_no_regen = TRUE;
2002 if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !p_ptr->immune_fire)
2004 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
2005 if (prace_is_(RACE_ENT)) damage += damage/3;
2006 if (p_ptr->resist_fire) damage = damage / 3;
2007 if (p_ptr->oppose_fire) damage = damage / 3;
2009 msg_print("Ç®¤¤¡ª");
2010 take_hit(DAMAGE_NOESCAPE, damage, "±ê¤Î¥ª¡¼¥é", -1);
2012 msg_print("It's hot!");
2013 take_hit(DAMAGE_NOESCAPE, damage, "Fire aura", -1);
2016 if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !p_ptr->immune_elec)
2018 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
2019 if (p_ptr->resist_elec) damage = damage / 3;
2020 if (p_ptr->oppose_elec) damage = damage / 3;
2022 msg_print("Äˤ¤¡ª");
2023 take_hit(DAMAGE_NOESCAPE, damage, "Åŵ¤¤Î¥ª¡¼¥é", -1);
2025 msg_print("It hurts!");
2026 take_hit(DAMAGE_NOESCAPE, damage, "Elec aura", -1);
2029 if ((r_info[m_list[p_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !p_ptr->immune_cold)
2031 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
2032 if (p_ptr->resist_cold) damage = damage / 3;
2033 if (p_ptr->oppose_cold) damage = damage / 3;
2035 msg_print("Î䤿¤¤¡ª");
2036 take_hit(DAMAGE_NOESCAPE, damage, "Î䵤¤Î¥ª¡¼¥é", -1);
2038 msg_print("It's cold!");
2039 take_hit(DAMAGE_NOESCAPE, damage, "Cold aura", -1);
2044 /* Spectres -- take damage when moving through walls */
2046 * Added: ANYBODY takes damage if inside through walls
2047 * without wraith form -- NOTE: Spectres will never be
2048 * reduced below 0 hp by being inside a stone wall; others
2051 if (!cave_floor_bold(py, px))
2053 /* Player can walk through trees */
2054 if ((cave[py][px].feat == FEAT_TREES) || ((cave[py][px].feat == FEAT_MOUNTAIN) && !dun_level && p_ptr->ffall))
2058 else if (!p_ptr->invuln && !p_ptr->wraith_form && !p_ptr->kabenuke &&
2059 ((p_ptr->chp > (p_ptr->lev / 5)) || !p_ptr->pass_wall))
2063 cave_no_regen = TRUE;
2065 if (p_ptr->pass_wall)
2068 msg_print("ÂΤÎʬ»Ò¤¬Ê¬²ò¤·¤¿µ¤¤¬¤¹¤ë¡ª");
2071 msg_print("Your molecules feel disrupted!");
2072 dam_desc = "density";
2079 msg_print("Êø¤ì¤¿´ä¤Ë²¡¤·ÄÙ¤µ¤ì¤¿¡ª");
2080 dam_desc = "¹Å¤¤´ä";
2082 msg_print("You are being crushed!");
2083 dam_desc = "solid rock";
2088 take_hit(DAMAGE_NOESCAPE, 1 + (p_ptr->lev / 5), dam_desc, -1);
2094 monster_race *r_ptr;
2096 if (min != prev_min)
2099 bool old_inside_battle = p_ptr->inside_battle;
2101 do_cmd_write_nikki(NIKKI_HIGAWARI, 0, NULL);
2103 p_ptr->inside_battle = TRUE;
2104 get_mon_num_prep(NULL,NULL);
2106 for (i = 0; i < max_d_idx; i++)
2108 if (max_dlv[i] < d_info[i].mindepth) continue;
2109 if (max_dl < max_dlv[i]) max_dl = max_dlv[i];
2113 today_mon = get_mon_num(max_dl);
2114 r_ptr = &r_info[today_mon];
2116 if (r_ptr->flags1 & RF1_UNIQUE) continue;
2117 if (r_ptr->flags7 & (RF7_UNIQUE_7 | RF7_UNIQUE2)) continue;
2118 if (r_ptr->flags2 & (RF2_MULTIPLY)) continue;
2119 if (!(r_ptr->flags9 & RF9_DROP_CORPSE) || !(r_ptr->flags9 & RF9_DROP_SKELETON)) continue;
2120 if (r_ptr->level < MIN(max_dl/2, 40)) continue;
2121 if (r_ptr->rarity > 10) continue;
2122 if (r_ptr->level == 0) continue;
2125 p_ptr->today_mon = 0;
2126 p_ptr->inside_battle = old_inside_battle;
2130 /* Nightmare mode activates the TY_CURSE at midnight */
2131 if (ironman_nightmare)
2133 /* Require exact minute */
2134 if (min != prev_min)
2136 /* Every 15 minutes after 11:00 pm */
2137 if ((hour == 23) && !(min % 15))
2147 msg_print("±ó¤¯¤ÇÉÔµ¤Ì£¤Ê¾â¤Î²»¤¬ÌĤä¿¡£");
2149 msg_print("You hear a distant bell toll ominously.");
2157 msg_print("±ó¤¯¤Ç¾â¤¬Æó²óÌĤä¿¡£");
2159 msg_print("A distant bell sounds twice.");
2167 msg_print("±ó¤¯¤Ç¾â¤¬»°²óÌĤä¿¡£");
2169 msg_print("A distant bell sounds three times.");
2177 msg_print("±ó¤¯¤Ç¾â¤¬»Í²óÌĤä¿¡£");
2179 msg_print("A distant bell tolls four times.");
2187 /* TY_CURSE activates at mignight! */
2194 msg_print("±ó¤¯¤Ç¾â¤¬²¿²ó¤âÌĤꡢ»à¤ó¤À¤è¤¦¤ÊÀŤ±¤µ¤ÎÃæ¤Ø¾Ã¤¨¤Æ¤¤¤Ã¤¿¡£");
2196 msg_print("A distant bell tolls many times, fading into an deathly silence.");
2199 activate_ty_curse(FALSE, &count);
2204 /* Take damage from cuts */
2205 if (p_ptr->cut && !p_ptr->invuln)
2207 /* Mortal wound or Deep Gash */
2208 if (p_ptr->cut > 1000)
2213 else if (p_ptr->cut > 200)
2219 else if (p_ptr->cut > 100)
2224 else if (p_ptr->cut > 50)
2229 else if (p_ptr->cut > 25)
2234 else if (p_ptr->cut > 10)
2247 take_hit(DAMAGE_NOESCAPE, i, "Ã×Ì¿½ý", -1);
2249 take_hit(DAMAGE_NOESCAPE, i, "a fatal wound", -1);
2255 /*** Check the Food, and Regenerate ***/
2257 if (!p_ptr->inside_battle)
2259 /* Digest normally */
2260 if (p_ptr->food < PY_FOOD_MAX)
2262 /* Every 100 game turns */
2263 if (!(turn % (TURNS_PER_TICK*5)))
2265 /* Basic digestion rate based on speed */
2266 i = /* extract_energy[p_ptr->pspeed] * 2;*/
2267 ((p_ptr->pspeed > 199) ? 49 : ((p_ptr->pspeed < 0) ?
2268 1 : extract_energy[p_ptr->pspeed]));
2270 /* Regeneration takes more food */
2271 if (p_ptr->regenerate) i += 20;
2272 if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK)) i+= 20;
2273 if (p_ptr->cursed & TRC_FAST_DIGEST) i += 30;
2275 /* Slow digestion takes less food */
2276 if (p_ptr->slow_digest) i -= 5;
2278 /* Minimal digestion */
2280 /* Maximal digestion */
2281 if (i > 100) i = 100;
2283 /* Digest some food */
2284 (void)set_food(p_ptr->food - i);
2288 /* Digest quickly when gorged */
2291 /* Digest a lot of food */
2292 (void)set_food(p_ptr->food - 100);
2296 /* Starve to death (slowly) */
2297 if (p_ptr->food < PY_FOOD_STARVE)
2299 /* Calculate damage */
2300 i = (PY_FOOD_STARVE - p_ptr->food) / 10;
2304 if (!p_ptr->invuln) take_hit(DAMAGE_LOSELIFE, i, "¶õÊ¢", -1);
2306 if (!p_ptr->invuln) take_hit(DAMAGE_LOSELIFE, i, "starvation", -1);
2311 /* Default regeneration */
2312 regen_amount = PY_REGEN_NORMAL;
2315 if (p_ptr->food < PY_FOOD_WEAK)
2317 /* Lower regeneration */
2318 if (p_ptr->food < PY_FOOD_STARVE)
2322 else if (p_ptr->food < PY_FOOD_FAINT)
2324 regen_amount = PY_REGEN_FAINT;
2328 regen_amount = PY_REGEN_WEAK;
2332 if ((p_ptr->food < PY_FOOD_FAINT) && !p_ptr->inside_battle)
2334 /* Faint occasionally */
2335 if (!p_ptr->paralyzed && (randint0(100) < 10))
2339 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤À䤷¤Æ¤·¤Þ¤Ã¤¿¡£");
2341 msg_print("You faint from the lack of food.");
2346 /* Hack -- faint (bypass free action) */
2347 (void)set_paralyzed(p_ptr->paralyzed + 1 + randint0(5));
2353 /* Are we walking the pattern? */
2354 if (pattern_effect())
2356 cave_no_regen = TRUE;
2360 /* Regeneration ability */
2361 if (p_ptr->regenerate)
2363 regen_amount = regen_amount * 2;
2365 if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK))
2369 if (p_ptr->cursed & TRC_SLOW_REGEN)
2376 /* Searching or Resting */
2377 if ((p_ptr->action == ACTION_SEARCH) || (p_ptr->action == ACTION_REST))
2379 regen_amount = regen_amount * 2;
2382 upkeep_factor = calculate_upkeep();
2384 /* Regenerate the mana */
2385 /* if (p_ptr->csp < p_ptr->msp) */
2389 s32b upkeep_regen = ((100 - upkeep_factor) * regen_amount);
2390 if ((p_ptr->action == ACTION_LEARN) || (p_ptr->action == ACTION_HAYAGAKE)) upkeep_regen -= regen_amount;
2391 regenmana(upkeep_regen/100);
2393 #ifdef TRACK_FRIENDS
2397 msg_format("£Í£Ð²óÉü: %d/%d", upkeep_regen, regen_amount);
2399 msg_format("Regen: %d/%d", upkeep_regen, regen_amount);
2403 #endif /* TRACK_FRIENDS */
2406 else if (p_ptr->action != ACTION_LEARN)
2408 regenmana(regen_amount);
2411 if (p_ptr->pclass == CLASS_MAGIC_EATER)
2413 regenmagic(regen_amount);
2416 if ((p_ptr->csp == 0) && (p_ptr->csp_frac == 0))
2418 while (upkeep_factor > 100)
2421 msg_print("¤³¤ó¤Ê¤Ë¿¤¯¤Î¥Ú¥Ã¥È¤òÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
2423 msg_print("Such much pets cannot be controled at once!");
2426 do_cmd_pet_dismiss();
2428 upkeep_factor = calculate_upkeep();
2431 msg_format("°Ý»ý£Í£Ð¤Ï %d%%", upkeep_factor);
2433 msg_format("Upkeep: %d%% mana.", upkeep_factor);
2439 /* Poisoned or cut yields no healing */
2440 if (p_ptr->poisoned) regen_amount = 0;
2441 if (p_ptr->cut) regen_amount = 0;
2443 /* Special floor -- Pattern, in a wall -- yields no healing */
2444 if (cave_no_regen) regen_amount = 0;
2446 regen_amount = (regen_amount * mutant_regenerate_mod) / 100;
2448 /* Regenerate Hit Points if needed */
2449 if ((p_ptr->chp < p_ptr->mhp) && !cave_no_regen)
2451 if ((cave[py][px].feat < FEAT_PATTERN_END) &&
2452 (cave[py][px].feat >= FEAT_PATTERN_START))
2454 regenhp(regen_amount / 5); /* Hmmm. this should never happen? */
2458 regenhp(regen_amount);
2463 /*** Timeout Various Things ***/
2466 if (p_ptr->tim_mimic)
2468 (void)set_mimic(p_ptr->tim_mimic - 1, p_ptr->mimic_form, TRUE);
2471 /* Hack -- Hallucinating */
2474 (void)set_image(p_ptr->image - dec_count);
2480 (void)set_blind(p_ptr->blind - dec_count);
2483 /* Times see-invisible */
2484 if (p_ptr->tim_invis)
2486 (void)set_tim_invis(p_ptr->tim_invis - 1, TRUE);
2497 (void)set_tim_esp(p_ptr->tim_esp - 1, TRUE);
2500 /* Timed temporary elemental brands. -LM- */
2501 if (p_ptr->ele_attack)
2503 p_ptr->ele_attack--;
2505 /* Clear all temporary elemental brands. */
2506 if (!p_ptr->ele_attack) set_ele_attack(0, 0);
2509 /* Timed temporary elemental immune. -LM- */
2510 if (p_ptr->ele_immune)
2512 p_ptr->ele_immune--;
2514 /* Clear all temporary elemental brands. */
2515 if (!p_ptr->ele_immune) set_ele_immune(0, 0);
2518 /* Timed infra-vision */
2519 if (p_ptr->tim_infra)
2521 (void)set_tim_infra(p_ptr->tim_infra - 1, TRUE);
2525 if (p_ptr->tim_stealth)
2527 (void)set_tim_stealth(p_ptr->tim_stealth - 1, TRUE);
2530 /* Timed levitation */
2531 if (p_ptr->tim_ffall)
2533 (void)set_tim_ffall(p_ptr->tim_ffall - 1, TRUE);
2536 /* Timed sh_touki */
2537 if (p_ptr->tim_sh_touki)
2539 (void)set_tim_sh_touki(p_ptr->tim_sh_touki - 1, TRUE);
2543 if (p_ptr->tim_sh_fire)
2545 (void)set_tim_sh_fire(p_ptr->tim_sh_fire - 1, TRUE);
2549 if (p_ptr->tim_sh_holy)
2551 (void)set_tim_sh_holy(p_ptr->tim_sh_holy - 1, TRUE);
2555 if (p_ptr->tim_eyeeye)
2557 (void)set_tim_eyeeye(p_ptr->tim_eyeeye - 1, TRUE);
2560 /* Timed resist-magic */
2561 if (p_ptr->resist_magic)
2563 (void)set_resist_magic(p_ptr->resist_magic - 1, TRUE);
2566 /* Timed regeneration */
2567 if (p_ptr->tim_regen)
2569 (void)set_tim_regen(p_ptr->tim_regen - 1, TRUE);
2572 /* Timed resist nether */
2573 if (p_ptr->tim_res_nether)
2575 (void)set_tim_res_nether(p_ptr->tim_res_nether - 1, TRUE);
2578 /* Timed resist time */
2579 if (p_ptr->tim_res_time)
2581 (void)set_tim_res_time(p_ptr->tim_res_time - 1, TRUE);
2585 if (p_ptr->tim_reflect)
2587 (void)set_tim_reflect(p_ptr->tim_reflect - 1, TRUE);
2591 if (p_ptr->multishadow)
2593 (void)set_multishadow(p_ptr->multishadow - 1, TRUE);
2596 /* Timed Robe of dust */
2597 if (p_ptr->dustrobe)
2599 (void)set_dustrobe(p_ptr->dustrobe - 1, TRUE);
2602 /* Timed infra-vision */
2603 if (p_ptr->kabenuke)
2605 (void)set_kabenuke(p_ptr->kabenuke - 1, TRUE);
2609 if (p_ptr->paralyzed)
2611 (void)set_paralyzed(p_ptr->paralyzed - dec_count);
2615 if (p_ptr->confused)
2617 (void)set_confused(p_ptr->confused - dec_count);
2623 (void)set_afraid(p_ptr->afraid - dec_count);
2629 (void)set_fast(p_ptr->fast - 1, TRUE);
2635 (void)set_slow(p_ptr->slow - dec_count, TRUE);
2638 /* Protection from evil */
2639 if (p_ptr->protevil)
2641 (void)set_protevil(p_ptr->protevil - 1, TRUE);
2644 /* Invulnerability */
2647 (void)set_invuln(p_ptr->invuln - 1, TRUE);
2651 if (p_ptr->wraith_form)
2653 (void)set_wraith_form(p_ptr->wraith_form - 1, TRUE);
2659 (void)set_hero(p_ptr->hero - 1, TRUE);
2665 (void)set_shero(p_ptr->shero - 1, TRUE);
2671 (void)set_blessed(p_ptr->blessed - 1, TRUE);
2677 (void)set_shield(p_ptr->shield - 1, TRUE);
2681 if (p_ptr->tsubureru)
2683 (void)set_tsubureru(p_ptr->tsubureru - 1, TRUE);
2687 if (p_ptr->magicdef)
2689 (void)set_magicdef(p_ptr->magicdef - 1, TRUE);
2693 if (p_ptr->tsuyoshi)
2695 (void)set_tsuyoshi(p_ptr->tsuyoshi - 1, TRUE);
2699 if (p_ptr->oppose_acid)
2701 (void)set_oppose_acid(p_ptr->oppose_acid - 1, TRUE);
2704 /* Oppose Lightning */
2705 if (p_ptr->oppose_elec)
2707 (void)set_oppose_elec(p_ptr->oppose_elec - 1, TRUE);
2711 if (p_ptr->oppose_fire)
2713 (void)set_oppose_fire(p_ptr->oppose_fire - 1, TRUE);
2717 if (p_ptr->oppose_cold)
2719 (void)set_oppose_cold(p_ptr->oppose_cold - 1, TRUE);
2723 if (p_ptr->oppose_pois)
2725 (void)set_oppose_pois(p_ptr->oppose_pois - 1, TRUE);
2730 (void)set_ultimate_res(p_ptr->ult_res - 1, TRUE);
2733 /*** Poison and Stun and Cut ***/
2736 if (p_ptr->poisoned)
2738 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2740 /* Apply some healing */
2741 (void)set_poisoned(p_ptr->poisoned - adjust);
2747 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2749 /* Apply some healing */
2750 (void)set_stun(p_ptr->stun - adjust);
2756 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2758 /* Hack -- Truly "mortal" wound */
2759 if (p_ptr->cut > 1000) adjust = 0;
2761 /* Apply some healing */
2762 (void)set_cut(p_ptr->cut - adjust);
2767 /*** Process Light ***/
2769 /* Check for light being wielded */
2770 o_ptr = &inventory[INVEN_LITE];
2772 /* Burn some fuel in the current lite */
2773 if (o_ptr->tval == TV_LITE)
2775 /* Hack -- Use some fuel (except on artifacts) */
2776 if (!(artifact_p(o_ptr) || o_ptr->sval == SV_LITE_FEANOR) && (o_ptr->xtra4 > 0))
2778 /* Decrease life-span */
2779 if (o_ptr->name2 == EGO_LITE_LONG)
2781 if (turn % (TURNS_PER_TICK*2)) o_ptr->xtra4--;
2783 else o_ptr->xtra4--;
2785 /* Notice interesting fuel steps */
2786 notice_lite_change(o_ptr);
2790 /* Calculate torch radius */
2791 p_ptr->update |= (PU_TORCH);
2794 /*** Process mutation effects ***/
2795 if (p_ptr->muta2 && !p_ptr->inside_battle && !p_ptr->wild_mode)
2797 if ((p_ptr->muta2 & MUT2_BERS_RAGE) && one_in_(3000))
2801 msg_print("¥¦¥¬¥¡¥¡¥¢¡ª");
2802 msg_print("·ãÅܤÎȯºî¤Ë½±¤ï¤ì¤¿¡ª");
2804 msg_print("RAAAAGHH!");
2805 msg_print("You feel a fit of rage coming over you!");
2808 (void)set_shero(10 + randint1(p_ptr->lev), FALSE);
2811 if ((p_ptr->muta2 & MUT2_COWARDICE) && (randint1(3000) == 13))
2813 if (!(p_ptr->resist_fear || p_ptr->hero || p_ptr->shero))
2817 msg_print("¤È¤Æ¤â°Å¤¤... ¤È¤Æ¤â¶²¤¤¡ª");
2819 msg_print("It's so dark... so scary!");
2822 set_afraid(p_ptr->afraid + 13 + randint1(26));
2826 if ((p_ptr->muta2 & MUT2_RTELEPORT) && (randint1(5000) == 88))
2828 if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) &&
2833 /* Teleport player */
2835 msg_print("¤¢¤Ê¤¿¤Î°ÌÃÖ¤ÏÆÍÁ³¤Ò¤¸¤ç¤¦¤ËÉÔ³ÎÄê¤Ë¤Ê¤Ã¤¿...");
2837 msg_print("Your position suddenly seems very uncertain...");
2841 teleport_player(40);
2845 if ((p_ptr->muta2 & MUT2_ALCOHOL) && (randint1(6400) == 321))
2847 if (!p_ptr->resist_conf && !p_ptr->resist_chaos)
2850 p_ptr->redraw |= PR_EXTRA;
2852 msg_print("¤¤¤Ò¤¤¬¤â¡¼¤í¡¼¤È¤Ò¤Æ¤¤¿¤¤¬¤Õ¤ë...¥Ò¥Ã¥¯¡ª");
2854 msg_print("You feel a SSSCHtupor cOmINg over yOu... *HIC*!");
2859 if (!p_ptr->resist_conf)
2861 (void)set_confused(p_ptr->confused + randint0(20) + 15);
2864 if (!p_ptr->resist_chaos)
2869 if (one_in_(3)) lose_all_info();
2871 teleport_player(100);
2874 msg_print("¤¢¤Ê¤¿¤Ï¸«ÃΤé¤Ì¾ì½ê¤ÇÌܤ¬Àä᤿...Ƭ¤¬Äˤ¤¡£");
2875 msg_print("²¿¤â³Ð¤¨¤Æ¤¤¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ËÍ褿¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
2877 msg_print("You wake up somewhere with a sore head...");
2878 msg_print("You can't remember a thing, or how you got here!");
2887 msg_print("¤¡Á¤ì¤¤¤Ê¤Á¤ç¤ª¤Á¤ç¤é¤È¤ó¤ì¤¤¤ë¡Á");
2889 msg_print("Thishcischs GooDSChtuff!");
2892 (void)set_image(p_ptr->image + randint0(150) + 150);
2898 if ((p_ptr->muta2 & MUT2_HALLU) && (randint1(6400) == 42))
2900 if (!p_ptr->resist_chaos)
2903 p_ptr->redraw |= PR_EXTRA;
2904 (void)set_image(p_ptr->image + randint0(50) + 20);
2908 if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint1(3000) == 13))
2913 msg_print("¥Ö¥¥¡¼¡¼¥Ã¡ª¤ª¤Ã¤È¡£");
2915 msg_print("BRRAAAP! Oops.");
2919 fire_ball(GF_POIS, 0, p_ptr->lev, 3);
2922 if ((p_ptr->muta2 & MUT2_PROD_MANA) &&
2923 !p_ptr->anti_magic && one_in_(9000))
2928 msg_print("ËâË¡¤Î¥¨¥Í¥ë¥®¡¼¤¬ÆÍÁ³¤¢¤Ê¤¿¤ÎÃæ¤Ëή¤ì¹þ¤ó¤Ç¤¤¿¡ª¥¨¥Í¥ë¥®¡¼¤ò²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡ª");
2930 msg_print("Magical energy flows through you! You must release it!");
2935 (void)get_hack_dir(&dire);
2936 fire_ball(GF_MANA, dire, p_ptr->lev * 2, 3);
2939 if ((p_ptr->muta2 & MUT2_ATT_DEMON) &&
2940 !p_ptr->anti_magic && (randint1(6666) == 666))
2942 bool pet = one_in_(6);
2943 u32b mode = PM_ALLOW_GROUP;
2945 if (pet) mode |= PM_FORCE_PET;
2946 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
2948 if (summon_specific((pet ? -1 : 0), py, px,
2949 dun_level, SUMMON_DEMON, mode))
2952 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤ò°ú¤´ó¤»¤¿¡ª");
2954 msg_print("You have attracted a demon!");
2961 if ((p_ptr->muta2 & MUT2_SPEED_FLUX) && one_in_(6000))
2967 msg_print("ÀºÎÏŪ¤Ç¤Ê¤¯¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2969 msg_print("You feel less energetic.");
2972 if (p_ptr->fast > 0)
2978 set_slow(randint1(30) + 10, FALSE);
2984 msg_print("ÀºÎÏŪ¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2986 msg_print("You feel more energetic.");
2989 if (p_ptr->slow > 0)
2995 set_fast(randint1(30) + 10, FALSE);
3000 if ((p_ptr->muta2 & MUT2_BANISH_ALL) && one_in_(9000))
3004 msg_print("ÆÍÁ³¤Û¤È¤ó¤É¸ÉÆȤˤʤ俵¤¤¬¤¹¤ë¡£");
3006 msg_print("You suddenly feel almost lonely.");
3009 banish_monsters(100);
3010 if (!dun_level && p_ptr->town_num)
3013 msg_print("Ź¤Î¼ç¿Í¤¬µÖ¤Ë¸þ¤«¤Ã¤ÆÁö¤Ã¤Æ¤¤¤ë¡ª");
3015 msg_print("You see one of the shopkeepers running for the hills!");
3018 store_shuffle(randint0(MAX_STORES));
3023 if ((p_ptr->muta2 & MUT2_EAT_LIGHT) && one_in_(3000))
3028 msg_print("±Æ¤Ë¤Ä¤Ä¤Þ¤ì¤¿¡£");
3030 msg_print("A shadow passes over you.");
3035 /* Absorb light from the current possition */
3036 if (cave[py][px].info & CAVE_GLOW)
3041 o_ptr = &inventory[INVEN_LITE];
3043 /* Absorb some fuel in the current lite */
3044 if (o_ptr->tval == TV_LITE)
3046 /* Use some fuel (except on artifacts) */
3047 if (!artifact_p(o_ptr) && (o_ptr->xtra4 > 0))
3049 /* Heal the player a bit */
3050 hp_player(o_ptr->xtra4 / 20);
3052 /* Decrease life-span of lite */
3056 msg_print("¸÷¸»¤«¤é¥¨¥Í¥ë¥®¡¼¤òµÛ¼ý¤·¤¿¡ª");
3058 msg_print("You absorb energy from your light!");
3062 /* Notice interesting fuel steps */
3063 notice_lite_change(o_ptr);
3068 * Unlite the area (radius 10) around player and
3069 * do 50 points damage to every affected monster
3071 unlite_area(50, 10);
3074 if ((p_ptr->muta2 & MUT2_ATT_ANIMAL) &&
3075 !p_ptr->anti_magic && one_in_(7000))
3077 bool pet = one_in_(3);
3078 u32b mode = PM_ALLOW_GROUP;
3080 if (pet) mode |= PM_FORCE_PET;
3081 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
3083 if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_ANIMAL, mode))
3086 msg_print("ưʪ¤ò°ú¤´ó¤»¤¿¡ª");
3088 msg_print("You have attracted an animal!");
3095 if ((p_ptr->muta2 & MUT2_RAW_CHAOS) &&
3096 !p_ptr->anti_magic && one_in_(8000))
3100 msg_print("¼þ¤ê¤Î¶õ´Ö¤¬ÏĤó¤Ç¤¤¤ëµ¤¤¬¤¹¤ë¡ª");
3102 msg_print("You feel the world warping around you!");
3106 fire_ball(GF_CHAOS, 0, p_ptr->lev, 8);
3108 if ((p_ptr->muta2 & MUT2_NORMALITY) && one_in_(5000))
3110 if (!lose_mutation(0))
3112 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
3114 msg_print("You feel oddly normal.");
3118 if ((p_ptr->muta2 & MUT2_WRAITH) && !p_ptr->anti_magic && one_in_(3000))
3122 msg_print("Èóʪ¼Á²½¤·¤¿¡ª");
3124 msg_print("You feel insubstantial!");
3128 set_wraith_form(randint1(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE);
3130 if ((p_ptr->muta2 & MUT2_POLY_WOUND) && one_in_(3000))
3134 if ((p_ptr->muta2 & MUT2_WASTING) && one_in_(3000))
3136 int which_stat = randint0(6);
3137 int sustained = FALSE;
3142 if (p_ptr->sustain_str) sustained = TRUE;
3145 if (p_ptr->sustain_int) sustained = TRUE;
3148 if (p_ptr->sustain_wis) sustained = TRUE;
3151 if (p_ptr->sustain_dex) sustained = TRUE;
3154 if (p_ptr->sustain_con) sustained = TRUE;
3157 if (p_ptr->sustain_chr) sustained = TRUE;
3161 msg_print("ÉÔÀµ¤Ê¾õÂÖ¡ª");
3163 msg_print("Invalid stat chosen!");
3173 msg_print("¼«Ê¬¤¬¿ê¼å¤·¤Æ¤¤¤¯¤Î¤¬Ê¬¤«¤ë¡ª");
3175 msg_print("You can feel yourself wasting away!");
3179 (void)dec_stat(which_stat, randint1(6) + 6, one_in_(3));
3182 if ((p_ptr->muta2 & MUT2_ATT_DRAGON) &&
3183 !p_ptr->anti_magic && one_in_(3000))
3185 bool pet = one_in_(5);
3186 u32b mode = PM_ALLOW_GROUP;
3188 if (pet) mode |= PM_FORCE_PET;
3189 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
3191 if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_DRAGON, mode))
3194 msg_print("¥É¥é¥´¥ó¤ò°ú¤´ó¤»¤¿¡ª");
3196 msg_print("You have attracted a dragon!");
3202 if ((p_ptr->muta2 & MUT2_WEIRD_MIND) && !p_ptr->anti_magic &&
3205 if (p_ptr->tim_esp > 0)
3208 msg_print("Àº¿À¤Ë¤â¤ä¤¬¤«¤«¤Ã¤¿¡ª");
3210 msg_print("Your mind feels cloudy!");
3213 set_tim_esp(0, TRUE);
3218 msg_print("Àº¿À¤¬¹¤¬¤Ã¤¿¡ª");
3220 msg_print("Your mind expands!");
3223 set_tim_esp(p_ptr->lev, FALSE);
3226 if ((p_ptr->muta2 & MUT2_NAUSEA) && !p_ptr->slow_digest &&
3231 msg_print("°ß¤¬áÛÚ»¤·¡¢¿©»ö¤ò¼º¤Ã¤¿¡ª");
3233 msg_print("Your stomach roils, and you lose your lunch!");
3237 set_food(PY_FOOD_WEAK);
3240 if ((p_ptr->muta2 & MUT2_WALK_SHAD) &&
3241 !p_ptr->anti_magic && one_in_(12000) && !p_ptr->inside_arena)
3246 if ((p_ptr->muta2 & MUT2_WARNING) && one_in_(1000))
3248 int danger_amount = 0;
3251 for (monster = 0; monster < m_max; monster++)
3253 monster_type *m_ptr = &m_list[monster];
3254 monster_race *r_ptr = &r_info[m_ptr->r_idx];
3256 /* Paranoia -- Skip dead monsters */
3257 if (!m_ptr->r_idx) continue;
3259 if (r_ptr->level >= p_ptr->lev)
3261 danger_amount += r_ptr->level - p_ptr->lev + 1;
3265 if (danger_amount > 100)
3267 msg_print("Èó¾ï¤Ë¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
3269 msg_print("You feel utterly terrified!");
3272 else if (danger_amount > 50)
3274 msg_print("¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
3276 msg_print("You feel terrified!");
3279 else if (danger_amount > 20)
3281 msg_print("Èó¾ï¤Ë¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
3283 msg_print("You feel very worried!");
3286 else if (danger_amount > 10)
3288 msg_print("¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
3290 msg_print("You feel paranoid!");
3293 else if (danger_amount > 5)
3295 msg_print("¤Û¤È¤ó¤É°ÂÁ´¤Êµ¤¤¬¤¹¤ë¡£");
3297 msg_print("You feel almost safe.");
3302 msg_print("¼ä¤·¤¤µ¤¤¬¤¹¤ë¡£");
3304 msg_print("You feel lonely.");
3308 if ((p_ptr->muta2 & MUT2_INVULN) && !p_ptr->anti_magic &&
3313 msg_print("̵Ũ¤Êµ¤¤¬¤¹¤ë¡ª");
3315 msg_print("You feel invincible!");
3319 (void)set_invuln(randint1(8) + 8, FALSE);
3321 if ((p_ptr->muta2 & MUT2_SP_TO_HP) && one_in_(2000))
3323 int wounds = p_ptr->mhp - p_ptr->chp;
3327 int healing = p_ptr->csp;
3329 if (healing > wounds)
3335 p_ptr->csp -= healing;
3338 if ((p_ptr->muta2 & MUT2_HP_TO_SP) && !p_ptr->anti_magic &&
3341 int wounds = p_ptr->msp - p_ptr->csp;
3345 int healing = p_ptr->chp;
3347 if (healing > wounds)
3352 p_ptr->csp += healing;
3354 take_hit(DAMAGE_LOSELIFE, healing, "Ƭ¤Ë¾º¤Ã¤¿·ì", -1);
3356 take_hit(DAMAGE_LOSELIFE, healing, "blood rushing to the head", -1);
3361 if ((p_ptr->muta2 & MUT2_DISARM) && one_in_(10000))
3367 msg_print("¤¬¤â¤Ä¤ì¤Æž¤ó¤À¡ª");
3368 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), "žÅÝ", -1);
3370 msg_print("You trip over your own feet!");
3371 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), "tripping", -1);
3376 if (buki_motteruka(INVEN_RARM))
3378 int slot = INVEN_RARM;
3379 o_ptr = &inventory[INVEN_RARM];
3380 if (buki_motteruka(INVEN_LARM) && one_in_(2))
3382 o_ptr = &inventory[INVEN_LARM];
3385 if (!cursed_p(o_ptr))
3388 msg_print("Éð´ï¤òÍ¤Æ¤·¤Þ¤Ã¤¿¡ª");
3390 msg_print("You drop your weapon!");
3393 inven_drop(slot, 1);
3400 /*** Process Inventory ***/
3402 if ((p_ptr->cursed & TRC_P_FLAG_MASK) && !p_ptr->inside_battle && !p_ptr->wild_mode)
3405 * Hack: Uncursed teleporting items (e.g. Trump Weapons)
3406 * can actually be useful!
3408 if ((p_ptr->cursed & TRC_TELEPORT_SELF) && one_in_(200))
3411 if (get_check_strict("¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©", CHECK_OKAY_CANCEL))
3413 if (get_check_strict("Teleport? ", CHECK_OKAY_CANCEL))
3417 teleport_player(50);
3420 /* Make a chainsword noise */
3421 if ((p_ptr->cursed & TRC_CHAINSWORD) && one_in_(CHAINSWORD_NOISE))
3425 if (!get_rnd_line("chainswd_j.txt", 0, noise))
3427 if (!get_rnd_line("chainswd.txt", 0, noise))
3430 disturb(FALSE, FALSE);
3433 if ((p_ptr->cursed & TRC_TY_CURSE) && one_in_(TY_CURSE_CHANCE))
3436 (void)activate_ty_curse(FALSE, &count);
3438 /* Handle experience draining */
3439 if (p_ptr->prace != RACE_ANDROID &&
3440 ((p_ptr->cursed & TRC_DRAIN_EXP) && one_in_(4)))
3442 p_ptr->exp -= (p_ptr->lev+1)/2;
3443 if (p_ptr->exp < 0) p_ptr->exp = 0;
3444 p_ptr->max_exp -= (p_ptr->lev+1)/2;
3445 if (p_ptr->max_exp < 0) p_ptr->max_exp = 0;
3448 /* Add light curse (Later) */
3449 if ((p_ptr->cursed & TRC_ADD_L_CURSE) && one_in_(2000))
3454 o_ptr = choose_cursed_obj_name(TRC_ADD_L_CURSE);
3456 new_curse = get_curse(0, o_ptr);
3457 if (!(o_ptr->curse_flags & new_curse))
3459 char o_name[MAX_NLEN];
3461 object_desc(o_name, o_ptr, FALSE, 0);
3463 o_ptr->curse_flags |= new_curse;
3465 msg_format("°°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬%s¤ò¤È¤ê¤Þ¤¤¤¿...", o_name);
3467 msg_format("There is a malignant black aura surrounding %s...", o_name);
3470 o_ptr->feeling = FEEL_NONE;
3472 p_ptr->update |= (PU_BONUS);
3475 /* Add heavy curse (Later) */
3476 if ((p_ptr->cursed & TRC_ADD_H_CURSE) && one_in_(2000))
3481 o_ptr = choose_cursed_obj_name(TRC_ADD_H_CURSE);
3483 new_curse = get_curse(1, o_ptr);
3484 if (!(o_ptr->curse_flags & new_curse))
3486 char o_name[MAX_NLEN];
3488 object_desc(o_name, o_ptr, FALSE, 0);
3490 o_ptr->curse_flags |= new_curse;
3492 msg_format("°°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬%s¤ò¤È¤ê¤Þ¤¤¤¿...", o_name);
3494 msg_format("There is a malignant black aura surrounding %s...", o_name);
3497 o_ptr->feeling = FEEL_NONE;
3499 p_ptr->update |= (PU_BONUS);
3503 if ((p_ptr->cursed & TRC_CALL_ANIMAL) && one_in_(2500))
3505 if (summon_specific(0, py, px, dun_level, SUMMON_ANIMAL,
3506 (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
3508 char o_name[MAX_NLEN];
3510 object_desc(o_name, choose_cursed_obj_name(TRC_CALL_ANIMAL), FALSE, 0);
3512 msg_format("%s¤¬Æ°Êª¤ò°ú¤´ó¤»¤¿¡ª", o_name);
3514 msg_format("%s have attracted an animal!", o_name);
3521 if ((p_ptr->cursed & TRC_CALL_DEMON) && one_in_(1111))
3523 if (summon_specific(0, py, px, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
3525 char o_name[MAX_NLEN];
3527 object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DEMON), FALSE, 0);
3529 msg_format("%s¤¬°Ëâ¤ò°ú¤´ó¤»¤¿¡ª", o_name);
3531 msg_format("%s have attracted a demon!", o_name);
3538 if ((p_ptr->cursed & TRC_CALL_DRAGON) && one_in_(800))
3540 if (summon_specific(0, py, px, dun_level, SUMMON_DRAGON,
3541 (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
3543 char o_name[MAX_NLEN];
3545 object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DRAGON), FALSE, 0);
3547 msg_format("%s¤¬¥É¥é¥´¥ó¤ò°ú¤´ó¤»¤¿¡ª", o_name);
3549 msg_format("%s have attracted an animal!", o_name);
3555 if ((p_ptr->cursed & TRC_COWARDICE) && one_in_(1500))
3557 if (!(p_ptr->resist_fear || p_ptr->hero || p_ptr->shero))
3561 msg_print("¤È¤Æ¤â°Å¤¤... ¤È¤Æ¤â¶²¤¤¡ª");
3563 msg_print("It's so dark... so scary!");
3566 set_afraid(p_ptr->afraid + 13 + randint1(26));
3569 /* Teleport player */
3570 if ((p_ptr->cursed & TRC_TELEPORT) && one_in_(200) && !p_ptr->anti_tele)
3574 /* Teleport player */
3575 teleport_player(40);
3577 /* Handle HP draining */
3578 if ((p_ptr->cursed & TRC_DRAIN_HP) && one_in_(666))
3580 char o_name[MAX_NLEN];
3582 object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_HP), FALSE, 0);
3584 msg_format("%s¤Ï¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª", o_name);
3586 msg_format("%s drains HP from you!", o_name);
3588 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev*2, 100), o_name, -1);
3590 /* Handle mana draining */
3591 if ((p_ptr->cursed & TRC_DRAIN_MANA) && one_in_(666))
3593 char o_name[MAX_NLEN];
3595 object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_MANA), FALSE, 0);
3597 msg_format("%s¤Ï¤¢¤Ê¤¿¤ÎËâÎϤòµÛ¼ý¤·¤¿¡ª", o_name);
3599 msg_format("%s drains mana from you!", o_name);
3601 p_ptr->csp -= MIN(p_ptr->lev, 50);
3605 p_ptr->csp_frac = 0;
3607 p_ptr->redraw |= PR_MANA;
3611 /* Rarely, take damage from the Jewel of Judgement */
3612 if (one_in_(999) && !p_ptr->anti_magic)
3614 if ((inventory[INVEN_LITE].tval) &&
3615 (inventory[INVEN_LITE].sval == SV_LITE_JUDGE))
3618 msg_print("¡Ø¿³È½¤ÎÊõÀС٤Ϥ¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª");
3619 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "¿³È½¤ÎÊõÀÐ", -1);
3621 msg_print("The Jewel of Judgement drains life from you!");
3622 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "the Jewel of Judgement", -1);
3629 /* Process equipment */
3630 for (j = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
3632 /* Get the object */
3633 o_ptr = &inventory[i];
3635 /* Skip non-objects */
3636 if (!o_ptr->k_idx) continue;
3638 /* Recharge activatable objects */
3639 if (o_ptr->timeout > 0)
3644 /* Notice changes */
3645 if (!o_ptr->timeout)
3647 recharged_notice(o_ptr);
3653 /* Notice changes */
3657 p_ptr->window |= (PW_EQUIP);
3662 * Recharge rods. Rods now use timeout to control charging status,
3663 * and each charging rod in a stack decreases the stack's timeout by
3664 * one per turn. -LM-
3666 for (j = 0, i = 0; i < INVEN_PACK; i++)
3668 o_ptr = &inventory[i];
3669 k_ptr = &k_info[o_ptr->k_idx];
3671 /* Skip non-objects */
3672 if (!o_ptr->k_idx) continue;
3674 /* Examine all charging rods or stacks of charging rods. */
3675 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
3677 /* Determine how many rods are charging. */
3678 temp = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
3679 if (temp > o_ptr->number) temp = o_ptr->number;
3681 /* Decrease timeout by that number. */
3682 o_ptr->timeout -= temp;
3684 /* Boundary control. */
3685 if (o_ptr->timeout < 0) o_ptr->timeout = 0;
3687 /* Notice changes, provide message if object is inscribed. */
3688 if (!(o_ptr->timeout))
3690 recharged_notice(o_ptr);
3696 /* Notice changes */
3700 p_ptr->notice |= (PN_COMBINE);
3703 p_ptr->window |= (PW_INVEN);
3707 /* Feel the inventory */
3712 /*** Process Objects ***/
3714 /* Process objects */
3715 for (i = 1; i < o_max; i++)
3720 /* Skip dead objects */
3721 if (!o_ptr->k_idx) continue;
3723 /* Recharge rods on the ground. No messages. */
3724 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
3727 o_ptr->timeout -= o_ptr->number;
3729 /* Boundary control. */
3730 if (o_ptr->timeout < 0) o_ptr->timeout = 0;
3735 /*** Involuntary Movement ***/
3737 /* Delayed Word-of-Recall */
3738 if (p_ptr->word_recall)
3741 * HACK: Autosave BEFORE resetting the recall counter (rr9)
3742 * The player is yanked up/down as soon as
3743 * he loads the autosaved game.
3745 if (autosave_l && (p_ptr->word_recall == 1) && !p_ptr->inside_battle)
3746 do_cmd_save_game(TRUE);
3748 /* Count down towards recall */
3749 p_ptr->word_recall--;
3751 p_ptr->redraw |= (PR_STATUS);
3753 /* Activate the recall */
3754 if (!p_ptr->word_recall)
3759 /* Determine the level */
3760 if (dun_level || p_ptr->inside_quest)
3763 msg_print("¾å¤Ë°ú¤ÃÄ¥¤ê¤¢¤²¤é¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
3765 msg_print("You feel yourself yanked upwards!");
3768 p_ptr->recall_dungeon = dungeon_type;
3770 do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
3774 prepare_change_floor_mode(CFM_CLEAR_ALL);
3776 leave_quest_check();
3778 p_ptr->inside_quest = 0;
3779 p_ptr->leaving = TRUE;
3784 msg_print("²¼¤Ë°ú¤¤º¤ê¹ß¤í¤µ¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
3786 msg_print("You feel yourself yanked downwards!");
3789 dungeon_type = p_ptr->recall_dungeon;
3792 do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
3795 dun_level = max_dlv[dungeon_type];
3796 if (dun_level < 1) dun_level = 1;
3798 /* Nightmare mode makes recall more dangerous */
3799 if (ironman_nightmare && !randint0(666) && (dungeon_type == DUNGEON_ANGBAND))
3805 else if (dun_level < 99)
3807 dun_level = (dun_level + 99) / 2;
3809 else if (dun_level > 100)
3811 dun_level = d_info[dungeon_type].maxdepth - 1;
3815 if (p_ptr->wild_mode)
3817 p_ptr->wilderness_y = py;
3818 p_ptr->wilderness_x = px;
3822 /* Save player position */
3826 p_ptr->wild_mode = FALSE;
3828 prepare_change_floor_mode(CFM_CLEAR_ALL);
3831 p_ptr->leaving = TRUE;
3833 if (dungeon_type == DUNGEON_ANGBAND)
3835 for (i = MIN_RANDOM_QUEST; i < MAX_RANDOM_QUEST + 1; i++)
3837 if ((quest[i].type == QUEST_TYPE_RANDOM) &&
3838 (quest[i].status == QUEST_STATUS_TAKEN) &&
3839 (quest[i].level < dun_level))
3841 quest[i].status = QUEST_STATUS_FAILED;
3842 quest[i].complev = (byte)p_ptr->lev;
3843 r_info[quest[i].r_idx].flags1 &= ~(RF1_QUESTOR);
3850 sound(SOUND_TPLEVEL);
3855 /* Delayed Alter reality */
3856 if (p_ptr->alter_reality)
3858 if (autosave_l && (p_ptr->alter_reality == 1) && !p_ptr->inside_battle)
3859 do_cmd_save_game(TRUE);
3861 /* Count down towards alter */
3862 p_ptr->alter_reality--;
3864 p_ptr->redraw |= (PR_STATUS);
3866 /* Activate the alter reality */
3867 if (!p_ptr->alter_reality)
3872 /* Determine the level */
3873 if (!quest_number(dun_level) && dun_level)
3876 msg_print("À¤³¦¤¬ÊѤï¤Ã¤¿¡ª");
3878 msg_print("The world changes!");
3881 prepare_change_floor_mode(CFM_CLEAR_ALL);
3884 p_ptr->leaving = TRUE;
3889 msg_print("À¤³¦¤¬¾¯¤·¤Î´ÖÊѲ½¤·¤¿¤è¤¦¤À¡£");
3891 msg_print("The world seems to change for a moment!");
3896 sound(SOUND_TPLEVEL);
3904 * Verify use of "wizard" mode
3906 static bool enter_wizard_mode(void)
3908 /* Ask first time */
3909 if (!p_ptr->noscore)
3911 /* Wizard mode is not permitted */
3912 if (!allow_debug_opts)
3915 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ ");
3917 msg_print("Wizard mode is not permitted.");
3922 /* Mention effects */
3924 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥â¡¼¥É¤Ç¤¹¡£ ");
3925 msg_print("°ìÅÙ¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ë¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3927 msg_print("Wizard mode is for debugging and experimenting.");
3928 msg_print("The game will not be scored if you enter wizard mode.");
3933 /* Verify request */
3935 if (!get_check("ËÜÅö¤Ë¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ê¤¿¤¤¤Î¤Ç¤¹¤«? "))
3937 if (!get_check("Are you sure you want to enter wizard mode? "))
3944 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆÍÆþ¤·¤Æ¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
3946 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up recording score to enter wizard mode.");
3949 p_ptr->noscore |= 0x0002;
3960 * Verify use of "debug" commands
3962 static bool enter_debug_mode(void)
3964 /* Ask first time */
3965 if (!p_ptr->noscore)
3967 /* Debug mode is not permitted */
3968 if (!allow_debug_opts)
3971 msg_print("¥Ç¥Ð¥Ã¥°¥³¥Þ¥ó¥É¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ ");
3973 msg_print("Use of debug command is not permitted.");
3978 /* Mention effects */
3980 msg_print("¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ ");
3981 msg_print("¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3983 msg_print("The debug commands are for debugging and experimenting.");
3984 msg_print("The game will not be scored if you use debug commands.");
3989 /* Verify request */
3991 if (!get_check("ËÜÅö¤Ë¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? "))
3993 if (!get_check("Are you sure you want to use debug commands? "))
4000 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥Ç¥Ð¥Ã¥°¥â¡¼¥É¤ËÆÍÆþ¤·¤Æ¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
4002 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use debug commands.");
4005 p_ptr->noscore |= 0x0008;
4013 * Hack -- Declare the Debug Routines
4015 extern void do_cmd_debug(void);
4017 #endif /* ALLOW_WIZARD */
4023 * Verify use of "borg" commands
4025 static bool enter_borg_mode(void)
4027 /* Ask first time */
4028 if (!(p_ptr->noscore & 0x0010))
4030 /* Mention effects */
4032 msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ ");
4033 msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
4035 msg_print("The borg commands are for debugging and experimenting.");
4036 msg_print("The game will not be scored if you use borg commands.");
4041 /* Verify request */
4043 if (!get_check("ËÜÅö¤Ë¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? "))
4045 if (!get_check("Are you sure you want to use borg commands? "))
4052 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»ÈÍѤ·¤Æ¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
4054 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up recording score to use borg commands.");
4057 p_ptr->noscore |= 0x0010;
4065 * Hack -- Declare the Ben Borg
4067 extern void do_cmd_borg(void);
4069 #endif /* ALLOW_BORG */
4074 * Parse and execute the current command
4075 * Give "Warning" on illegal commands.
4077 * XXX XXX XXX Make some "blocks"
4079 static void process_command(void)
4081 int old_now_message = now_message;
4083 #ifdef ALLOW_REPEAT /* TNB */
4085 /* Handle repeating the last command */
4088 #endif /* ALLOW_REPEAT -- TNB */
4092 /* Parse the command */
4093 switch (command_cmd)
4109 /*** Wizard Commands ***/
4111 /* Toggle Wizard Mode */
4116 p_ptr->wizard = FALSE;
4118 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É²ò½ü¡£");
4120 msg_print("Wizard mode off.");
4124 else if (enter_wizard_mode())
4126 p_ptr->wizard = TRUE;
4128 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥ÉÆÍÆþ¡£");
4130 msg_print("Wizard mode on.");
4135 /* Update monsters */
4136 p_ptr->update |= (PU_MONSTERS);
4138 /* Redraw "title" */
4139 p_ptr->redraw |= (PR_TITLE);
4147 /* Special "debug" commands */
4150 /* Enter debug mode */
4151 if (enter_debug_mode())
4158 #endif /* ALLOW_WIZARD */
4163 /* Special "borg" commands */
4166 /* Enter borg mode */
4167 if (enter_borg_mode())
4169 if (!p_ptr->wild_mode) do_cmd_borg();
4175 #endif /* ALLOW_BORG */
4179 /*** Inventory Commands ***/
4181 /* Wear/wield equipment */
4184 if (!p_ptr->wild_mode) do_cmd_wield();
4188 /* Take off equipment */
4191 if (!p_ptr->wild_mode) do_cmd_takeoff();
4198 if (!p_ptr->wild_mode) do_cmd_drop();
4202 /* Destroy an item */
4209 /* Equipment list */
4216 /* Inventory list */
4224 /*** Various commands ***/
4226 /* Identify an object */
4233 /* Hack -- toggle windows */
4236 toggle_inven_equip();
4241 /*** Standard "Movement" Commands ***/
4246 if (!p_ptr->wild_mode) do_cmd_alter();
4253 if (!p_ptr->wild_mode) do_cmd_tunnel();
4257 /* Move (usually pick up things) */
4260 #ifdef ALLOW_EASY_DISARM /* TNB */
4264 #else /* ALLOW_EASY_DISARM -- TNB */
4266 do_cmd_walk(always_pickup);
4268 #endif /* ALLOW_EASY_DISARM -- TNB */
4273 /* Move (usually do not pick up) */
4276 #ifdef ALLOW_EASY_DISARM /* TNB */
4280 #else /* ALLOW_EASY_DISARM -- TNB */
4282 do_cmd_walk(!always_pickup);
4284 #endif /* ALLOW_EASY_DISARM -- TNB */
4290 /*** Running, Resting, Searching, Staying */
4292 /* Begin Running -- Arg is Max Distance */
4295 if (!p_ptr->wild_mode) do_cmd_run();
4299 /* Stay still (usually pick things up) */
4302 do_cmd_stay(always_pickup);
4306 /* Stay still (usually do not pick up) */
4309 do_cmd_stay(!always_pickup);
4313 /* Rest -- Arg is time */
4320 /* Search for traps/doors */
4327 /* Toggle search mode */
4330 if (p_ptr->action == ACTION_SEARCH) set_action(ACTION_NONE);
4331 else set_action(ACTION_SEARCH);
4336 /*** Stairs and Doors and Chests and Traps ***/
4339 case SPECIAL_KEY_STORE:
4341 if (!p_ptr->wild_mode) do_cmd_store();
4345 /* Enter building -KMW- */
4346 case SPECIAL_KEY_BUILDING:
4348 if (!p_ptr->wild_mode) do_cmd_bldg();
4352 /* Enter quest level -KMW- */
4353 case SPECIAL_KEY_QUEST:
4355 if (!p_ptr->wild_mode) do_cmd_quest();
4359 /* Go up staircase */
4362 if(!p_ptr->wild_mode && !dun_level && !p_ptr->inside_arena && !p_ptr->inside_quest)
4369 msg_print("½±·â¤«¤éƨ¤²¤ë¤Ë¤Ï¥Þ¥Ã¥×¤Îü¤Þ¤Ç°ÜÆ°¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£");
4371 msg_print("To flee the ambush you have to reach the edge of the map.");
4374 else if (p_ptr->food < PY_FOOD_WEAK)
4377 msg_print("¤½¤ÎÁ°¤Ë¿©»ö¤ò¤È¤é¤Ê¤¤¤È¡£");
4379 msg_print("You must eat something here.");
4384 if (change_wild_mode())
4397 /* Go down staircase */
4400 if(!p_ptr->wild_mode) do_cmd_go_down();
4403 p_ptr->wilderness_x = px;
4404 p_ptr->wilderness_y = py;
4410 /* Open a door or chest */
4413 if (!p_ptr->wild_mode) do_cmd_open();
4420 if (!p_ptr->wild_mode) do_cmd_close();
4424 /* Jam a door with spikes */
4427 if (!p_ptr->wild_mode) do_cmd_spike();
4434 if (!p_ptr->wild_mode) do_cmd_bash();
4438 /* Disarm a trap or chest */
4441 if (!p_ptr->wild_mode) do_cmd_disarm();
4446 /*** Magic and Prayers ***/
4448 /* Gain new spells/prayers */
4451 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4453 msg_print("¼öʸ¤ò³Ø½¬¤¹¤ëɬÍפϤʤ¤¡ª");
4455 msg_print("You don't have to learn spells!");
4457 else if (p_ptr->pclass == CLASS_SAMURAI)
4458 do_cmd_gain_hissatsu();
4459 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4469 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
4470 (p_ptr->pclass == CLASS_BERSERKER) ||
4471 (p_ptr->pclass == CLASS_NINJA) ||
4472 (p_ptr->pclass == CLASS_MIRROR_MASTER)
4473 ) do_cmd_mind_browse();
4474 else if (p_ptr->pclass == CLASS_SMITH)
4476 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4477 do_cmd_magic_eater(TRUE);
4478 else do_cmd_browse();
4486 if (!p_ptr->wild_mode)
4488 if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_ARCHER) || (p_ptr->pclass == CLASS_CAVALRY))
4491 msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4493 msg_print("You cannot cast spells!");
4496 else if (dun_level && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
4499 msg_print("¥À¥ó¥¸¥ç¥ó¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4501 msg_print("The dungeon absorbs all attempted magic!");
4505 else if (p_ptr->anti_magic && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
4509 cptr which_power = "ËâË¡";
4511 cptr which_power = "magic";
4513 if (p_ptr->pclass == CLASS_MINDCRAFTER)
4515 which_power = "ĶǽÎÏ";
4517 which_power = "psionic powers";
4519 else if (p_ptr->pclass == CLASS_IMITATOR)
4521 which_power = "¤â¤Î¤Þ¤Í";
4523 which_power = "imitation";
4525 else if (p_ptr->pclass == CLASS_SAMURAI)
4527 which_power = "ɬ»¦·õ";
4529 which_power = "hissatsu";
4531 else if (p_ptr->pclass == CLASS_MIRROR_MASTER)
4533 which_power = "¶ÀËâË¡";
4535 which_power = "mirror magic";
4537 else if (p_ptr->pclass == CLASS_NINJA)
4539 which_power = "Ǧ½Ñ";
4541 which_power = "ninjutsu";
4543 else if (mp_ptr->spell_book == TV_LIFE_BOOK)
4545 which_power = "µ§¤ê";
4547 which_power = "prayer";
4551 msg_format("È¿ËâË¡¥Ð¥ê¥¢¤¬%s¤ò¼ÙË⤷¤¿¡ª", which_power);
4553 msg_format("An anti-magic shell disrupts your %s!", which_power);
4557 else if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER))
4560 msg_format("¶¸Àï»Î²½¤·¤Æ¤¤¤ÆƬ¤¬²ó¤é¤Ê¤¤¡ª");
4562 msg_format("You cannot think directly!");
4568 if ((p_ptr->pclass == CLASS_MINDCRAFTER) ||
4569 (p_ptr->pclass == CLASS_BERSERKER) ||
4570 (p_ptr->pclass == CLASS_NINJA) ||
4571 (p_ptr->pclass == CLASS_MIRROR_MASTER)
4574 else if (p_ptr->pclass == CLASS_IMITATOR)
4576 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4577 do_cmd_magic_eater(FALSE);
4578 else if (p_ptr->pclass == CLASS_SAMURAI)
4580 else if (p_ptr->pclass == CLASS_BLUE_MAGE)
4581 do_cmd_cast_learned();
4582 else if (p_ptr->pclass == CLASS_SMITH)
4591 /* Issue a pet command */
4594 if (!p_ptr->wild_mode) do_cmd_pet();
4598 /*** Use various objects ***/
4600 /* Inscribe an object */
4607 /* Uninscribe an object */
4610 do_cmd_uninscribe();
4614 /* Activate an artifact */
4617 if (!p_ptr->wild_mode)
4619 if (!p_ptr->inside_arena)
4624 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4626 msg_print("The arena absorbs all attempted magic!");
4642 /* Fuel your lantern/torch */
4652 if (!p_ptr->wild_mode) do_cmd_fire();
4659 if (!p_ptr->wild_mode)
4669 if (!p_ptr->wild_mode)
4671 if (!p_ptr->inside_arena)
4676 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4678 msg_print("The arena absorbs all attempted magic!");
4690 if (!p_ptr->wild_mode)
4692 if (p_ptr->inside_arena)
4695 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4697 msg_print("The arena absorbs all attempted magic!");
4702 else if (use_command && rogue_like_commands)
4714 /* Quaff a potion */
4717 if (!p_ptr->wild_mode)
4719 if (!p_ptr->inside_arena)
4720 do_cmd_quaff_potion();
4724 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4726 msg_print("The arena absorbs all attempted magic!");
4738 if (!p_ptr->wild_mode)
4740 if (!p_ptr->inside_arena)
4741 do_cmd_read_scroll();
4745 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4747 msg_print("The arena absorbs all attempted magic!");
4759 if (!p_ptr->wild_mode)
4761 if (p_ptr->inside_arena)
4764 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4766 msg_print("The arena absorbs all attempted magic!");
4771 else if (use_command && !rogue_like_commands)
4781 /* Use racial power */
4784 if (!p_ptr->wild_mode) do_cmd_racial_power();
4789 /*** Looking at Things (nearby or on map) ***/
4791 /* Full dungeon map */
4798 /* Locate player on map */
4812 /* Target monster or location */
4815 if (!p_ptr->wild_mode) do_cmd_target();
4821 /*** Help and Such ***/
4830 /* Identify symbol */
4833 do_cmd_query_symbol();
4837 /* Character description */
4840 do_cmd_change_name();
4845 /*** System Commands ***/
4847 /* Hack -- User interface */
4854 /* Single line from a pref file */
4869 do_cmd_edit_autopick();
4873 /* Interact with macros */
4880 /* Interact with visuals */
4888 /* Interact with colors */
4896 /* Interact with options */
4904 /*** Misc Commands ***/
4920 /* Repeat level feeling */
4923 if (!p_ptr->wild_mode) do_cmd_feeling();
4927 /* Show previous message */
4930 do_cmd_message_one();
4934 /* Show previous messages */
4937 do_cmd_messages(old_now_message);
4941 /* Show quest status -KMW- */
4944 do_cmd_checkquest();
4948 /* Redraw the screen */
4951 now_message = old_now_message;
4956 #ifndef VERIFY_SAVEFILE
4958 /* Hack -- Save and don't quit */
4961 do_cmd_save_game(FALSE);
4965 #endif /* VERIFY_SAVEFILE */
4975 case SPECIAL_KEY_QUIT:
4977 do_cmd_save_and_exit();
4981 /* Quit (commit suicide) */
4994 /* Check artifacts, uniques, objects */
5001 /* Load "screen dump" */
5004 do_cmd_load_screen();
5008 /* Save "screen dump" */
5011 do_cmd_save_screen();
5015 /* Make random artifact list */
5018 spoil_random_artifact("randifact.txt");
5022 /* Hack -- Unknown command */
5025 if (flush_failure) flush();
5029 sound(SOUND_ILLEGAL);
5031 if (!get_rnd_line("error_j.txt", 0, error_m))
5033 if (!get_rnd_line("error.txt", 0, error_m))
5040 prt(" '?' ¤Ç¥Ø¥ë¥×¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£", 0, 0);
5042 prt("Type '?' for help.", 0, 0);
5048 if (!energy_use && !now_message)
5049 now_message = old_now_message;
5055 static bool monster_tsuri(int r_idx)
5057 monster_race *r_ptr = &r_info[r_idx];
5059 if ((r_ptr->flags7 & RF7_AQUATIC) && !(r_ptr->flags1 & RF1_UNIQUE) && strchr("Jjlw", r_ptr->d_char))
5067 * Process the player
5069 * Notice the annoying code to handle "pack overflow", which
5070 * must come first just in case somebody manages to corrupt
5071 * the savefiles by clever use of menu commands or something.
5073 static void process_player(void)
5077 /*** Apply energy ***/
5082 msg_print("²¿¤«ÊѤï¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
5084 msg_print("You feel different!");
5087 (void)gain_random_mutation(0);
5088 hack_mutation = FALSE;
5091 if (p_ptr->inside_battle)
5093 for(i = 1; i < m_max; i++)
5095 monster_type *m_ptr = &m_list[i];
5097 if (!m_ptr->r_idx) continue;
5099 /* Hack -- Detect monster */
5100 m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
5102 /* Update the monster */
5103 update_mon(i, FALSE);
5108 /* Give the player some energy */
5109 else if (!(load && p_ptr->energy_need <= 0))
5111 p_ptr->energy_need -= (p_ptr->pspeed > 199 ? 49 : (p_ptr->pspeed < 0 ? 1 : extract_energy[p_ptr->pspeed]));
5115 if (p_ptr->energy_need > 0) return;
5116 if (!command_rep) prt_time();
5118 /*** Check for interupts ***/
5120 /* Complete resting */
5127 if ((p_ptr->chp == p_ptr->mhp) &&
5128 (p_ptr->csp >= p_ptr->msp))
5130 set_action(ACTION_NONE);
5134 /* Complete resting */
5135 else if (resting == -2)
5138 if ((p_ptr->chp == p_ptr->mhp) &&
5139 (p_ptr->csp >= p_ptr->msp) &&
5140 !p_ptr->blind && !p_ptr->confused &&
5141 !p_ptr->poisoned && !p_ptr->afraid &&
5142 !p_ptr->stun && !p_ptr->cut &&
5143 !p_ptr->slow && !p_ptr->paralyzed &&
5144 !p_ptr->image && !p_ptr->word_recall &&
5145 !p_ptr->alter_reality)
5147 set_action(ACTION_NONE);
5152 if (p_ptr->action == ACTION_FISH)
5155 Term_xtra(TERM_XTRA_DELAY, 10);
5159 bool success = FALSE;
5160 get_mon_num_prep(monster_tsuri,NULL);
5161 r_idx = get_mon_num(dun_level ? dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level);
5163 if (r_idx && one_in_(2))
5166 y = py+ddy[tsuri_dir];
5167 x = px+ddx[tsuri_dir];
5168 if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE))
5171 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
5173 msg_format("%s¤¬Äà¤ì¤¿¡ª", m_name);
5175 msg_format("You have a good catch!", m_name);
5183 msg_print("±Â¤À¤±¿©¤ï¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª¤¯¤Ã¤½¡Á¡ª");
5185 msg_print("Damn! The fish stole your bait!");
5192 /* Handle "abort" */
5195 /* Check for "player abort" (semi-efficiently for resting) */
5196 if (running || command_rep || (p_ptr->action == ACTION_REST) || (p_ptr->action == ACTION_FISH))
5201 /* Check for a key */
5210 /* Hack -- Show a Message */
5212 msg_print("ÃæÃǤ·¤Þ¤·¤¿¡£");
5214 msg_print("Canceled.");
5221 if (p_ptr->riding && !p_ptr->confused && !p_ptr->blind)
5223 monster_type *m_ptr = &m_list[p_ptr->riding];
5232 /* Acquire the monster name */
5233 monster_desc(m_name, m_ptr, 0);
5235 msg_format("%^s¤òµ¯¤³¤·¤¿¡£", m_name);
5237 msg_format("You have waked %s up.", m_name);
5239 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5240 p_ptr->redraw |= (PR_UHEALTH);
5247 /* Make a "saving throw" against stun */
5248 if (randint0(r_info[m_ptr->r_idx].level) < p_ptr->skill_exp[GINOU_RIDING])
5254 /* Hack -- Recover from stun */
5255 if (m_ptr->stunned > d)
5257 /* Recover somewhat */
5258 m_ptr->stunned -= d;
5269 /* Acquire the monster name */
5270 monster_desc(m_name, m_ptr, 0);
5272 /* Dump a message */
5274 msg_format("%^s¤òÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5276 msg_format("%^s is no longer stunned.", m_name);
5278 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5279 p_ptr->redraw |= (PR_UHEALTH);
5283 if (m_ptr->confused)
5287 /* Make a "saving throw" against stun */
5288 if (randint0(r_info[m_ptr->r_idx].level) < p_ptr->skill_exp[GINOU_RIDING])
5291 d = m_ptr->confused;
5294 /* Hack -- Recover from stun */
5295 if (m_ptr->confused > d)
5297 /* Recover somewhat */
5298 m_ptr->confused -= d;
5307 m_ptr->confused = 0;
5309 /* Acquire the monster name */
5310 monster_desc(m_name, m_ptr, 0);
5312 /* Dump a message */
5314 msg_format("%^s¤òº®Íð¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5316 msg_format("%^s is no longer confused.", m_name);
5318 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5319 p_ptr->redraw |= (PR_UHEALTH);
5327 /* Make a "saving throw" against stun */
5328 if (randint0(r_info[m_ptr->r_idx].level) < p_ptr->skill_exp[GINOU_RIDING])
5334 /* Hack -- Recover from stun */
5335 if (m_ptr->monfear > d)
5337 /* Recover somewhat */
5338 m_ptr->monfear -= d;
5349 /* Acquire the monster name */
5350 monster_desc(m_name, m_ptr, 0);
5352 /* Dump a message */
5354 msg_format("%^s¤ò¶²Éݤ«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5356 msg_format("%^s is no longer fear.", m_name);
5358 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5359 p_ptr->redraw |= (PR_UHEALTH);
5363 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
5367 /* Handle the player song */
5368 if (!load) check_music();
5373 if (p_ptr->lightspeed)
5375 (void)set_lightspeed(p_ptr->lightspeed - 1, TRUE);
5377 if ((p_ptr->pclass == CLASS_FORCETRAINER) && (p_ptr->magic_num1[0]))
5379 if (p_ptr->magic_num1[0] < 40)
5381 p_ptr->magic_num1[0] = 0;
5383 else p_ptr->magic_num1[0] -= 40;
5384 p_ptr->update |= (PU_BONUS);
5386 if (p_ptr->action == ACTION_LEARN)
5388 int hoge = ((p_ptr->msp * 0x10000L) / 256L)+7680L;
5389 if ((p_ptr->csp * 0x10000L + p_ptr->csp_frac) < hoge)
5392 p_ptr->csp_frac = 0;
5393 set_action(ACTION_NONE);
5397 p_ptr->csp -= (s16b)(hoge >> 16);
5399 if (p_ptr->csp_frac < hoge)
5401 p_ptr->csp_frac += 0x10000L - hoge;
5405 p_ptr->csp_frac -= hoge;
5407 p_ptr->redraw |= PR_MANA;
5410 if (p_ptr->special_defense & KATA_MASK)
5412 if (p_ptr->special_defense & KATA_MUSOU)
5416 set_action(ACTION_NONE);
5421 p_ptr->redraw |= (PR_MANA);
5426 /*** Handle actual user input ***/
5428 /* Repeat until out of energy */
5429 while (p_ptr->energy_need <= 0)
5431 p_ptr->window |= PW_PLAYER;
5432 p_ptr->sutemi = FALSE;
5433 p_ptr->counter = FALSE;
5434 now_damaged = FALSE;
5436 /* Handle "p_ptr->notice" */
5439 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
5442 /* Place the cursor on the player */
5443 move_cursor_relative(py, px);
5445 /* Refresh (optional) */
5446 if (fresh_before) Term_fresh();
5449 /* Hack -- Pack Overflow */
5450 if (inventory[INVEN_PACK].k_idx)
5452 int item = INVEN_PACK;
5454 char o_name[MAX_NLEN];
5458 /* Access the slot to be dropped */
5459 o_ptr = &inventory[item];
5466 msg_print("¥¶¥Ã¥¯¤«¤é¥¢¥¤¥Æ¥à¤¬¤¢¤Õ¤ì¤¿¡ª");
5468 msg_print("Your pack overflows!");
5473 object_desc(o_name, o_ptr, TRUE, 3);
5477 msg_format("%s(%c)¤òÍî¤È¤·¤¿¡£", o_name, index_to_label(item));
5479 msg_format("You drop %s (%c).", o_name, index_to_label(item));
5483 /* Drop it (carefully) near the player */
5484 (void)drop_near(o_ptr, 0, py, px);
5486 /* Modify, Describe, Optimize */
5487 inven_item_increase(item, -255);
5488 inven_item_describe(item);
5489 inven_item_optimize(item);
5491 /* Handle "p_ptr->notice" */
5494 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
5499 /* Hack -- cancel "lurking browse mode" */
5500 if (!command_new) command_see = FALSE;
5503 /* Assume free turn */
5507 if (p_ptr->inside_battle)
5509 /* Place the cursor on the player */
5510 move_cursor_relative(py, px);
5512 command_cmd = SPECIAL_KEY_BUILDING;
5514 /* Process the command */
5518 /* Paralyzed or Knocked Out */
5519 else if (p_ptr->paralyzed || (p_ptr->stun >= 100))
5526 else if (p_ptr->action == ACTION_REST)
5531 /* Reduce rest count */
5534 if (!resting) set_action(ACTION_NONE);
5536 /* Redraw the state */
5537 p_ptr->redraw |= (PR_STATE);
5545 else if (p_ptr->action == ACTION_FISH)
5558 /* Repeated command */
5559 else if (command_rep)
5561 /* Count this execution */
5564 /* Redraw the state */
5565 p_ptr->redraw |= (PR_STATE);
5570 /* Hack -- Assume messages were seen */
5573 /* Clear the top line */
5576 /* Process the command */
5580 /* Normal command */
5583 /* Place the cursor on the player */
5584 move_cursor_relative(py, px);
5587 /* Get a command (normal) */
5588 request_command(FALSE);
5591 /* Process the command */
5601 /* Use some energy */
5602 if (world_player || energy_use > 400)
5604 /* The Randomness is irrelevant */
5605 p_ptr->energy_need += energy_use * TURNS_PER_TICK / 10;
5609 /* There is some randomness of needed energy */
5610 p_ptr->energy_need += (s16b)((s32b)energy_use * ENERGY_NEED() / 100L);
5613 /* Hack -- constant hallucination */
5614 if (p_ptr->image) p_ptr->redraw |= (PR_MAP);
5617 /* Shimmer monsters if needed */
5618 if (shimmer_monsters)
5620 /* Clear the flag */
5621 shimmer_monsters = FALSE;
5623 /* Shimmer multi-hued monsters */
5624 for (i = 1; i < m_max; i++)
5626 monster_type *m_ptr;
5627 monster_race *r_ptr;
5629 /* Access monster */
5632 /* Skip dead monsters */
5633 if (!m_ptr->r_idx) continue;
5635 /* Access the monster race */
5636 r_ptr = &r_info[m_ptr->r_idx];
5638 /* Skip non-multi-hued monsters */
5639 if (!(r_ptr->flags1 & RF1_ATTR_MULTI)) continue;
5641 /* Reset the flag */
5642 shimmer_monsters = TRUE;
5644 /* Redraw regardless */
5645 lite_spot(m_ptr->fy, m_ptr->fx);
5650 /* Handle monster detection */
5651 if (repair_monsters)
5653 /* Reset the flag */
5654 repair_monsters = FALSE;
5656 /* Rotate detection flags */
5657 for (i = 1; i < m_max; i++)
5659 monster_type *m_ptr;
5661 /* Access monster */
5664 /* Skip dead monsters */
5665 if (!m_ptr->r_idx) continue;
5667 /* Nice monsters get mean */
5668 if (m_ptr->mflag & MFLAG_NICE)
5670 /* Nice monsters get mean */
5671 m_ptr->mflag &= ~(MFLAG_NICE);
5674 /* Handle memorized monsters */
5675 if (m_ptr->mflag & MFLAG_MARK)
5677 /* Maintain detection */
5678 if (m_ptr->mflag & MFLAG_SHOW)
5681 m_ptr->mflag &= ~(MFLAG_SHOW);
5683 /* Still need repairs */
5684 repair_monsters = TRUE;
5687 /* Remove detection */
5691 m_ptr->mflag &= ~(MFLAG_MARK);
5693 /* Assume invisible */
5696 /* Update the monster */
5697 update_mon(i, FALSE);
5699 if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH);
5700 if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH);
5702 /* Redraw regardless */
5703 lite_spot(m_ptr->fy, m_ptr->fx);
5708 if (p_ptr->pclass == CLASS_IMITATOR)
5710 if (p_ptr->mane_num > (p_ptr->lev > 44 ? 3 : p_ptr->lev > 29 ? 2 : 1))
5713 for (i = 0; i < p_ptr->mane_num; i++)
5715 p_ptr->mane_spell[i] = p_ptr->mane_spell[i+1];
5716 p_ptr->mane_dam[i] = p_ptr->mane_dam[i+1];
5720 p_ptr->redraw |= (PR_MANE);
5722 if (p_ptr->action == ACTION_LEARN)
5725 p_ptr->redraw |= (PR_STATE);
5728 if (world_player && (p_ptr->energy_need > - 1000))
5731 p_ptr->redraw |= (PR_MAP);
5733 /* Update monsters */
5734 p_ptr->update |= (PU_MONSTERS);
5737 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5740 msg_print("¡Ö»þ¤ÏÆ°¤¤À¤¹¡Ä¡×");
5742 msg_print("You feel time flowing around you once more.");
5745 world_player = FALSE;
5746 p_ptr->energy_need = ENERGY_NEED();
5748 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
5753 /* Hack -- notice death */
5754 if (!p_ptr->playing || p_ptr->is_dead)
5756 world_player = FALSE;
5760 /* Handle "leaving" */
5761 if (p_ptr->leaving) break;
5764 /* Update scent trail */
5770 * Interact with the current dungeon level.
5772 * This function will not exit until the level is completed,
5773 * the user dies, or the game is terminated.
5775 static void dungeon(bool load_game)
5779 /* Set the base level */
5780 base_level = dun_level;
5782 /* Reset various flags */
5786 p_ptr->leaving = FALSE;
5788 /* Reset the "command" vars */
5796 /* Cancel the target */
5800 ambush_flag = FALSE;
5802 /* Cancel the health bar */
5805 /* Check visual effects */
5806 shimmer_monsters = TRUE;
5807 shimmer_objects = TRUE;
5808 repair_monsters = TRUE;
5809 repair_objects = TRUE;
5815 /* Get index of current quest (if any) */
5816 quest_num = quest_number(dun_level);
5818 /* Inside a quest? */
5821 /* Mark the quest monster */
5822 r_info[quest[quest_num].r_idx].flags1 |= RF1_QUESTOR;
5825 /* Track maximum player level */
5826 if (p_ptr->max_plv < p_ptr->lev)
5828 p_ptr->max_plv = p_ptr->lev;
5832 /* Track maximum dungeon level (if not in quest -KMW-) */
5833 if ((max_dlv[dungeon_type] < dun_level) && !p_ptr->inside_quest)
5835 max_dlv[dungeon_type] = dun_level;
5836 if (record_maxdeapth) do_cmd_write_nikki(NIKKI_MAXDEAPTH, dun_level, NULL);
5839 /* Validate the panel */
5840 panel_bounds_center();
5842 /* Verify the panel */
5845 /* Flush messages */
5849 /* Enter "xtra" mode */
5850 character_xtra = TRUE;
5853 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER | PW_MONSTER | PW_OVERHEAD | PW_DUNGEON);
5855 /* Redraw dungeon */
5856 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY);
5859 p_ptr->redraw |= (PR_MAP);
5862 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
5864 /* Update lite/view */
5865 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE | PU_TORCH);
5867 /* Update monsters */
5868 p_ptr->update |= (PU_MONSTERS | PU_DISTANCE | PU_FLOW);
5870 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
5873 /* Leave "xtra" mode */
5874 character_xtra = FALSE;
5877 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
5879 /* Combine / Reorder the pack */
5880 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
5882 /* Handle "p_ptr->notice" */
5885 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
5891 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();
5893 if (p_ptr->inside_battle)
5897 p_ptr->energy_need = 0;
5904 msg_print("»î¹ç³«»Ï¡ª");
5906 msg_format("Ready..Fight!");
5912 if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] > MUSIC_DETECT))
5913 p_ptr->magic_num1[0] = MUSIC_DETECT;
5915 /* Hack -- notice death or departure */
5916 if (!p_ptr->playing || p_ptr->is_dead) return;
5918 /* Print quest message if appropriate */
5919 if (!p_ptr->inside_quest && (dungeon_type == DUNGEON_ANGBAND))
5921 quest_discovery(random_quest_number(dun_level));
5922 p_ptr->inside_quest = random_quest_number(dun_level);
5924 if ((dun_level == d_info[dungeon_type].maxdepth) && d_info[dungeon_type].final_guardian)
5926 if (r_info[d_info[dungeon_type].final_guardian].max_num)
5928 msg_format("¤³¤Î³¬¤Ë¤Ï%s¤Î¼ç¤Ç¤¢¤ë%s¤¬À³¤ó¤Ç¤¤¤ë¡£",
5929 d_name+d_info[dungeon_type].name,
5930 r_name+r_info[d_info[dungeon_type].final_guardian].name);
5932 msg_format("%^s lives in this level as the keeper of %s.",
5933 r_name+r_info[d_info[dungeon_type].final_guardian].name,
5934 d_name+d_info[dungeon_type].name);
5938 /*** Process this dungeon level ***/
5940 /* Reset the monster generation level */
5941 monster_level = base_level;
5943 /* Reset the object generation level */
5944 object_level = base_level;
5948 if (p_ptr->energy_need > 0 && !p_ptr->inside_battle &&
5949 (dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena))
5950 p_ptr->energy_need = 0;
5952 /* Not leaving dungeon */
5953 p_ptr->leaving_dungeon = FALSE;
5958 /* Hack -- Compact the monster list occasionally */
5959 if ((m_cnt + 32 > max_m_idx) && !p_ptr->inside_battle) compact_monsters(64);
5961 /* Hack -- Compress the monster list occasionally */
5962 if ((m_cnt + 32 < m_max) && !p_ptr->inside_battle) compact_monsters(0);
5965 /* Hack -- Compact the object list occasionally */
5966 if (o_cnt + 32 > max_o_idx) compact_objects(64);
5968 /* Hack -- Compress the object list occasionally */
5969 if (o_cnt + 32 < o_max) compact_objects(0);
5972 /* Process the player */
5975 /* Handle "p_ptr->notice" */
5978 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
5981 /* Hack -- Hilite the player */
5982 move_cursor_relative(py, px);
5984 /* Optional fresh */
5985 if (fresh_after) Term_fresh();
5987 /* Hack -- Notice death or departure */
5988 if (!p_ptr->playing || p_ptr->is_dead) break;
5990 /* Process all of the monsters */
5993 /* Handle "p_ptr->notice" */
5996 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
5999 /* Hack -- Hilite the player */
6000 move_cursor_relative(py, px);
6002 /* Optional fresh */
6003 if (fresh_after) Term_fresh();
6005 /* Hack -- Notice death or departure */
6006 if (!p_ptr->playing || p_ptr->is_dead) break;
6009 /* Process the world */
6012 /* Handle "p_ptr->notice" */
6015 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
6018 /* Hack -- Hilite the player */
6019 move_cursor_relative(py, px);
6021 /* Optional fresh */
6022 if (fresh_after) Term_fresh();
6024 /* Hack -- Notice death or departure */
6025 if (!p_ptr->playing || p_ptr->is_dead) break;
6027 /* Handle "leaving" */
6028 if (p_ptr->leaving) break;
6030 /* Count game turns */
6032 if (!p_ptr->wild_mode || wild_regen) dungeon_turn++;
6033 else if (p_ptr->wild_mode && !(turn % ((MAX_HGT + MAX_WID) / 2))) dungeon_turn++;
6034 if (wild_regen) wild_regen--;
6037 /* Inside a quest and non-unique questor? */
6038 if (quest_num && !(r_info[quest[quest_num].r_idx].flags1 & RF1_UNIQUE))
6040 /* Un-mark the quest monster */
6041 r_info[quest[quest_num].r_idx].flags1 &= ~RF1_QUESTOR;
6044 /* Not save-and-quit and not dead? */
6045 if (p_ptr->playing && !p_ptr->is_dead)
6048 * Maintain Unique monsters and artifact, save current
6049 * floor, then prepare next floor
6053 /* Forget the flag */
6054 reinit_wilderness = FALSE;
6057 /* Write about current level on the play record once per level */
6063 * Load some "user pref files"
6065 * Modified by Arcum Dagsson to support
6066 * separate macro files for different realms.
6068 static void load_all_pref_files(void)
6073 /* Access the "user" pref file */
6074 sprintf(buf, "user.prf");
6076 /* Process that file */
6077 process_pref_file(buf);
6079 /* Access the "user" system pref file */
6080 sprintf(buf, "user-%s.prf", ANGBAND_SYS);
6082 /* Process that file */
6083 process_pref_file(buf);
6085 /* Access the "race" pref file */
6086 sprintf(buf, "%s.prf", rp_ptr->title);
6088 /* Process that file */
6089 process_pref_file(buf);
6091 /* Access the "class" pref file */
6092 sprintf(buf, "%s.prf", cp_ptr->title);
6094 /* Process that file */
6095 process_pref_file(buf);
6097 /* Access the "character" pref file */
6098 sprintf(buf, "%s.prf", player_base);
6100 /* Process that file */
6101 process_pref_file(buf);
6103 /* Free old entries */
6107 sprintf(buf, "picktype-%s.prf", player_base);
6109 sprintf(buf, "pickpref-%s.prf", player_base);
6112 err = process_pickpref_file(buf);
6114 /* Process 'pick????.prf' if 'pick????-<name>.prf' doesn't exist */
6118 process_pickpref_file("picktype.prf");
6120 process_pickpref_file("pickpref.prf");
6124 /* Access the "realm 1" pref file */
6125 if (p_ptr->realm1 != REALM_NONE)
6127 sprintf(buf, "%s.prf", realm_names[p_ptr->realm1]);
6129 /* Process that file */
6130 process_pref_file(buf);
6133 /* Access the "realm 2" pref file */
6134 if (p_ptr->realm2 != REALM_NONE)
6136 sprintf(buf, "%s.prf", realm_names[p_ptr->realm2]);
6138 /* Process that file */
6139 process_pref_file(buf);
6145 * Actually play a game
6147 * If the "new_game" parameter is true, then, after loading the
6148 * savefile, we will commit suicide, if necessary, to allow the
6149 * player to start a new game.
6151 void play_game(bool new_game)
6154 bool load_game = TRUE;
6164 hack_mutation = FALSE;
6166 /* Hack -- Character is "icky" */
6167 character_icky = TRUE;
6169 /* Make sure main term is active */
6170 Term_activate(angband_term[0]);
6172 /* Initialise the resize hooks */
6173 angband_term[0]->resize_hook = resize_map;
6175 for (i = 1; i < 8; i++)
6177 /* Does the term exist? */
6178 if (angband_term[i])
6180 /* Add the redraw on resize hook */
6181 angband_term[i]->resize_hook = redraw_window;
6185 /* Hack -- turn off the cursor */
6186 (void)Term_set_cursor(0);
6189 /* Attempt to load */
6194 quit("¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤¬²õ¤ì¤Æ¤¤¤Þ¤¹");
6196 quit("broken savefile");
6201 /* Extract the options */
6202 for (i = 0; option_info[i].o_desc; i++)
6204 int os = option_info[i].o_set;
6205 int ob = option_info[i].o_bit;
6207 /* Set the "default" options */
6208 if (option_info[i].o_var)
6211 if (option_flag[os] & (1L << ob))
6214 (*option_info[i].o_var) = TRUE;
6221 (*option_info[i].o_var) = FALSE;
6226 /* Report waited score */
6227 if (p_ptr->wait_report_score)
6233 if (!get_check_strict("ÂÔµ¡¤·¤Æ¤¤¤¿¥¹¥³¥¢ÅÐÏ¿¤òº£¹Ô¤Ê¤¤¤Þ¤¹¤«¡©", CHECK_NO_HISTORY))
6235 if (!get_check_strict("Do you register score now? ", CHECK_NO_HISTORY))
6240 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
6245 p_ptr->is_dead = TRUE;
6247 start_time = time(NULL);
6249 /* No suspending now */
6250 signals_ignore_tstp();
6252 /* Hack -- Character is now "icky" */
6253 character_icky = TRUE;
6255 /* Build the filename */
6256 path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
6258 /* Open the high score file, for reading/writing */
6259 highscore_fd = fd_open(buf, O_RDWR);
6261 /* Handle score, show Top scores */
6262 success = send_world_score(TRUE);
6265 if (!success && !get_check_strict("¥¹¥³¥¢ÅÐÏ¿¤òÄü¤á¤Þ¤¹¤«¡©", CHECK_NO_HISTORY))
6267 if (!success && !get_check_strict("Do you give up score registration? ", CHECK_NO_HISTORY))
6271 prt("°ú¤Â³¤ÂÔµ¡¤·¤Þ¤¹¡£", 0, 0);
6273 prt("standing by for future registration...", 0, 0);
6279 p_ptr->wait_report_score = FALSE;
6282 if (!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
6284 if (!save_player()) msg_print("death save failed!");
6287 /* Shut the high score file */
6288 (void)fd_close(highscore_fd);
6290 /* Forget the high score fd */
6293 /* Allow suspending now */
6294 signals_handle_tstp();
6299 /* Nothing loaded */
6300 if (!character_loaded)
6302 /* Make new player */
6305 /* The dungeon is not ready */
6306 character_dungeon = FALSE;
6308 /* Prepare to init the RNG */
6311 /* Initialize the saved floors data */
6312 init_saved_floors();
6315 /* Old game is loaded. But new game is requested. */
6318 /* Delete expanded temporal files */
6319 clear_saved_floor_files();
6322 /* Process old character */
6325 /* Process the player name */
6326 process_player_name(FALSE);
6335 seed = (time(NULL));
6339 /* Mutate the seed on Unix machines */
6340 seed = ((seed >> 3) * (getpid() << 1));
6344 /* Use the complex RNG */
6347 /* Seed the "complex" RNG */
6348 Rand_state_init(seed);
6351 /* Roll new character */
6354 monster_race *r_ptr;
6356 /* The dungeon is not ready */
6357 character_dungeon = FALSE;
6361 p_ptr->inside_quest = 0;
6362 p_ptr->inside_arena = FALSE;
6363 p_ptr->inside_battle = FALSE;
6367 /* Hack -- seed for flavors */
6368 seed_flavor = randint0(0x10000000);
6370 /* Hack -- seed for town layout */
6371 seed_town = randint0(0x10000000);
6373 /* Roll up a new character */
6380 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "ÊÕ¶¤ÎÃϤ˹ߤêΩ¤Ã¤¿¡£");
6382 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "You are standing in the Outpost.");
6386 get_mon_num_prep(NULL, NULL);
6387 for (i = 0; i < MAX_KUBI; i++)
6393 kubi_r_idx[i] = get_mon_num(MAX_DEPTH - 1);
6394 r_ptr = &r_info[kubi_r_idx[i]];
6396 if(!(r_ptr->flags1 & RF1_UNIQUE)) continue;
6398 if(!(r_ptr->flags9 & RF9_DROP_CORPSE)) continue;
6399 if (r_ptr->rarity > 100) continue;
6401 if(r_ptr->flags6 & RF6_SPECIAL) continue;
6403 for (j = 0; j < i; j++)
6404 if (kubi_r_idx[i] == kubi_r_idx[j])break;
6409 for (i = 0; i < MAX_KUBI -1; i++)
6412 for (j = i; j < MAX_KUBI; j++)
6414 if (r_info[kubi_r_idx[i]].level > r_info[kubi_r_idx[j]].level)
6416 tmp = kubi_r_idx[i];
6417 kubi_r_idx[i] = kubi_r_idx[j];
6418 kubi_r_idx[j] = tmp;
6423 p_ptr->inside_battle = TRUE;
6426 today_mon = get_mon_num(3);
6427 r_ptr = &r_info[today_mon];
6429 if (r_ptr->flags1 & RF1_UNIQUE) continue;
6430 if (r_ptr->flags2 & (RF2_MULTIPLY)) continue;
6431 if (!(r_ptr->flags9 & RF9_DROP_CORPSE) || !(r_ptr->flags9 & RF9_DROP_SKELETON)) continue;
6432 if (r_ptr->rarity > 10) continue;
6433 if (r_ptr->level == 0) continue;
6436 p_ptr->inside_battle = FALSE;
6440 write_level = FALSE;
6443 do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ----¥²¡¼¥àºÆ³«----");
6445 do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ---- Restart Game ----");
6449 * 1.0.9 °ÊÁ°¤Ï¥»¡¼¥ÖÁ°¤Ë p_ptr->riding = -1 ¤È¤·¤Æ¤¤¤¿¤Î¤Ç¡¢ºÆÀßÄ꤬ɬÍפÀ¤Ã¤¿¡£
6450 * ¤â¤¦ÉÔÍפÀ¤¬¡¢°ÊÁ°¤Î¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤È¤Î¸ß´¹¤Î¤¿¤á¤Ë»Ä¤·¤Æ¤ª¤¯¡£
6452 if (p_ptr->riding == -1)
6455 for(i = m_max; i > 0; i--)
6457 if ((m_list[i].fy == py) && (m_list[i].fx == px))
6466 p_ptr->teleport_town = FALSE;
6467 p_ptr->sutemi = FALSE;
6468 world_monster = FALSE;
6469 now_damaged = FALSE;
6471 start_time = time(NULL) - 1;
6472 record_o_name[0] = '\0';
6474 /* Reset map panel */
6475 panel_row_min = cur_hgt;
6476 panel_col_min = cur_wid;
6478 /* Sexy gal gets bonus to maximum weapon skill of whip */
6479 if (p_ptr->pseikaku == SEIKAKU_SEXY)
6480 s_info[p_ptr->pclass].w_max[TV_HAFTED-TV_BOW][SV_WHIP] = WEAPON_EXP_MASTER;
6482 /* Fill the arrays of floors and walls in the good proportions */
6483 set_floor_and_wall(dungeon_type);
6485 /* Flavor the objects */
6493 /* Flash a message */
6495 prt("¤ªÂÔ¤Á²¼¤µ¤¤...", 0, 0);
6497 prt("Please wait...", 0, 0);
6501 /* Flush the message */
6505 /* Hack -- Enter wizard mode */
6508 if (enter_wizard_mode()) p_ptr->wizard = TRUE;
6509 else if (p_ptr->is_dead) quit("Already dead.");
6512 /* Initialize the town-buildings if necessary */
6513 if (!dun_level && !p_ptr->inside_quest)
6515 /* Init the wilderness */
6517 process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x);
6520 init_flags = INIT_ONLY_BUILDINGS;
6522 process_dungeon_file("t_info.txt", 0, 0, MAX_HGT, MAX_WID);
6527 /* Initialize vault info */
6529 if (init_v_info()) quit("·úÃÛʪ½é´ü²½ÉÔǽ");
6531 if (init_v_info()) quit("Cannot initialize vaults");
6534 /* Generate a dungeon level if needed */
6535 if (!character_dungeon) change_floor();
6538 /* Character is now "complete" */
6539 character_generated = TRUE;
6542 /* Hack -- Character is no longer "icky" */
6543 character_icky = FALSE;
6547 p_ptr->playing = TRUE;
6549 /* Reset the visual mappings */
6552 /* Load the "pref" files */
6553 load_all_pref_files();
6555 /* React to changes */
6556 Term_xtra(TERM_XTRA_REACT, 0);
6559 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
6562 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
6568 /* Set or clear "rogue_like_commands" if requested */
6569 if (arg_force_original) rogue_like_commands = FALSE;
6570 if (arg_force_roguelike) rogue_like_commands = TRUE;
6572 /* Hack -- Enforce "delayed death" */
6573 if (p_ptr->chp < 0) p_ptr->is_dead = TRUE;
6575 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
6577 if (new_game && ((p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BEASTMASTER)))
6579 monster_type *m_ptr;
6580 int pet_r_idx = ((p_ptr->pclass == CLASS_CAVALRY) ? MON_HORSE : MON_YASE_HORSE);
6581 monster_race *r_ptr = &r_info[pet_r_idx];
6582 place_monster_aux(0, py, px - 1, pet_r_idx,
6583 (PM_FORCE_PET | PM_NO_KAGE));
6584 m_ptr = &m_list[hack_m_idx_ii];
6585 m_ptr->mspeed = r_ptr->speed;
6586 m_ptr->maxhp = r_ptr->hdice*(r_ptr->hside+1)/2;
6587 m_ptr->max_maxhp = m_ptr->maxhp;
6588 m_ptr->hp = r_ptr->hdice*(r_ptr->hside+1)/2;
6589 m_ptr->energy_need = ENERGY_NEED() + ENERGY_NEED();
6595 /* Process the level */
6598 /* Handle "p_ptr->notice" */
6601 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
6604 /* Cancel the target */
6607 /* Cancel the health bar */
6611 /* Forget the lite */
6614 /* Forget the view */
6617 /* Forget the view */
6620 /* Handle "quit and save" */
6621 if (!p_ptr->playing && !p_ptr->is_dead) break;
6623 /* Erase the old cave */
6625 if (!p_ptr->is_dead) wipe_m_list();
6633 /* Accidental Death */
6634 if (p_ptr->playing && p_ptr->is_dead)
6636 if (p_ptr->inside_arena)
6638 p_ptr->inside_arena = FALSE;
6639 if(p_ptr->arena_number > MAX_ARENA_MONS)
6640 p_ptr->arena_number++;
6642 p_ptr->arena_number = 99;
6643 p_ptr->is_dead = FALSE;
6645 p_ptr->chp_frac = 0;
6646 p_ptr->exit_bldg = TRUE;
6651 /* Mega-Hack -- Allow player to cheat death */
6653 if ((p_ptr->wizard || cheat_live) && !get_check("»à¤Ë¤Þ¤¹¤«? "))
6655 if ((p_ptr->wizard || cheat_live) && !get_check("Die? "))
6659 /* Mark social class, reset age, if needed */
6660 if (p_ptr->sc) p_ptr->sc = p_ptr->age = 0;
6666 p_ptr->noscore |= 0x0001;
6670 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÇ°¤òÁ÷¤ê¡¢»à¤òµ½¤¤¤¿¡£");
6672 msg_print("You invoke wizard mode and cheat death.");
6678 /* Restore hit points */
6679 p_ptr->chp = p_ptr->mhp;
6680 p_ptr->chp_frac = 0;
6682 if (p_ptr->pclass == CLASS_MAGIC_EATER)
6684 for (i = 0; i < EATER_EXT*2; i++)
6686 p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*EATER_CHARGE;
6688 for (; i < EATER_EXT*3; i++)
6690 p_ptr->magic_num1[i] = 0;
6693 /* Restore spell points */
6694 p_ptr->csp = p_ptr->msp;
6695 p_ptr->csp_frac = 0;
6697 /* Hack -- Healing */
6699 (void)set_confused(0);
6700 (void)set_poisoned(0);
6701 (void)set_afraid(0);
6702 (void)set_paralyzed(0);
6707 /* Hack -- Prevent starvation */
6708 (void)set_food(PY_FOOD_MAX - 1);
6710 /* Hack -- cancel recall */
6711 if (p_ptr->word_recall)
6715 msg_print("Ä¥¤ê¤Ä¤á¤¿Â絤¤¬Î®¤ìµî¤Ã¤¿...");
6717 msg_print("A tension leaves the air around you...");
6722 /* Hack -- Prevent recall */
6723 p_ptr->word_recall = 0;
6724 p_ptr->redraw |= (PR_STATUS);
6727 /* Hack -- cancel alter */
6728 if (p_ptr->alter_reality)
6730 /* Hack -- Prevent alter */
6731 p_ptr->alter_reality = 0;
6732 p_ptr->redraw |= (PR_STATUS);
6735 /* Note cause of death XXX XXX XXX */
6737 (void)strcpy(p_ptr->died_from, "»à¤Îµ½¤");
6739 (void)strcpy(p_ptr->died_from, "Cheating death");
6744 p_ptr->is_dead = FALSE;
6747 p_ptr->inside_arena = FALSE;
6748 p_ptr->inside_battle = FALSE;
6750 p_ptr->inside_quest = 0;
6751 p_ptr->recall_dungeon = dungeon_type;
6753 if (lite_town || vanilla_town)
6755 p_ptr->wilderness_y = 1;
6756 p_ptr->wilderness_x = 1;
6770 p_ptr->wilderness_y = 48;
6771 p_ptr->wilderness_x = 5;
6777 p_ptr->wild_mode = FALSE;
6778 p_ptr->leaving = TRUE;
6781 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " ¤·¤«¤·¡¢À¸¤Ê֤ä¿¡£");
6783 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " but revived.");
6789 /* Handle "death" */
6790 if (p_ptr->is_dead) break;
6792 /* Make a new level */
6803 s32b turn_real(s32b hoge)
6805 switch (p_ptr->start_race)
6811 return hoge - (TURNS_PER_TICK * TOWN_DAWN * 3 / 4);