3 /* Purpose: Angband game engine */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
15 #define TY_CURSE_CHANCE 200
16 #define CHAINSWORD_NOISE 100
18 static bool load = TRUE;
19 static int wild_regen = 20;
22 * Return a "feeling" (or NULL) about an item. Method 1 (Heavy).
24 static byte value_check_aux1(object_type *o_ptr)
27 if (artifact_p(o_ptr) || o_ptr->art_name)
30 if (cursed_p(o_ptr) || broken_p(o_ptr)) return FEEL_TERRIBLE;
37 if (ego_item_p(o_ptr))
40 if (cursed_p(o_ptr) || broken_p(o_ptr)) return FEEL_WORTHLESS;
43 return FEEL_EXCELLENT;
47 if (cursed_p(o_ptr)) return FEEL_CURSED;
50 if (broken_p(o_ptr)) return FEEL_BROKEN;
52 if ((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) return FEEL_AVERAGE;
54 /* Good "armor" bonus */
55 if (o_ptr->to_a > 0) return FEEL_GOOD;
57 /* Good "weapon" bonus */
58 if (o_ptr->to_h + o_ptr->to_d > 0) return FEEL_GOOD;
60 /* Default to "average" */
66 * Return a "feeling" (or NULL) about an item. Method 2 (Light).
68 static byte value_check_aux2(object_type *o_ptr)
70 /* Cursed items (all of them) */
71 if (cursed_p(o_ptr)) return FEEL_CURSED;
73 /* Broken items (all of them) */
74 if (broken_p(o_ptr)) return FEEL_BROKEN;
76 /* Artifacts -- except cursed/broken ones */
77 if (artifact_p(o_ptr) || o_ptr->art_name) return FEEL_GOOD;
79 /* Ego-Items -- except cursed/broken ones */
80 if (ego_item_p(o_ptr)) return FEEL_GOOD;
82 /* Good armor bonus */
83 if (o_ptr->to_a > 0) return FEEL_GOOD;
85 /* Good weapon bonuses */
86 if (o_ptr->to_h + o_ptr->to_d > 0) return FEEL_GOOD;
94 static void sense_inventory_aux(int slot, bool heavy)
97 object_type *o_ptr = &inventory[slot];
98 char o_name[MAX_NLEN];
101 /* We know about it already, do not tell us again */
102 if (o_ptr->ident & (IDENT_SENSE))return;
104 /* It is fully known, no information needed */
105 if (object_known_p(o_ptr)) return;
107 /* Check for a feeling */
108 feel = (heavy ? value_check_aux1(o_ptr) : value_check_aux2(o_ptr));
110 /* Skip non-feelings */
114 if ((p_ptr->muta3 & MUT3_BAD_LUCK) && !randint0(13))
125 feel = FEEL_EXCELLENT;
130 feel = randint0(3) ? FEEL_GOOD : FEEL_AVERAGE;
135 feel = randint0(2) ? FEEL_CURSED : FEEL_GOOD;
140 feel = randint0(3) ? FEEL_CURSED : FEEL_AVERAGE;
145 feel = FEEL_WORTHLESS;
150 feel = FEEL_TERRIBLE;
156 /* Stop everything */
157 if (disturb_minor) disturb(0, 0);
159 /* Get an object description */
160 object_desc(o_name, o_ptr, FALSE, 0);
162 /* Message (equipment) */
163 if (slot >= INVEN_RARM)
166 msg_format("%s%s(%c)¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
167 describe_use(slot),o_name, index_to_label(slot),game_inscriptions[feel]);
169 msg_format("You feel the %s (%c) you are %s %s %s...",
170 o_name, index_to_label(slot), describe_use(slot),
171 ((o_ptr->number == 1) ? "is" : "are"),
172 game_inscriptions[feel]);
177 /* Message (inventory) */
181 msg_format("¥¶¥Ã¥¯¤ÎÃæ¤Î%s(%c)¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
182 o_name, index_to_label(slot),game_inscriptions[feel]);
184 msg_format("You feel the %s (%c) in your pack %s %s...",
185 o_name, index_to_label(slot),
186 ((o_ptr->number == 1) ? "is" : "are"),
187 game_inscriptions[feel]);
192 /* We have "felt" it */
193 o_ptr->ident |= (IDENT_SENSE);
195 /* Set the "inscription" */
196 o_ptr->feeling = feel;
198 /* Auto-inscription/destroy */
199 idx = is_autopick(o_ptr);
200 auto_inscribe_item(slot, idx);
202 auto_destroy_item(slot, idx, FALSE);
204 /* Combine / Reorder the pack (later) */
205 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
208 p_ptr->window |= (PW_INVEN | PW_EQUIP);
214 * Sense the inventory
216 * Class 0 = Warrior --> fast and heavy
217 * Class 1 = Mage --> slow and light
218 * Class 2 = Priest --> fast but light
219 * Class 3 = Rogue --> okay and heavy
220 * Class 4 = Ranger --> slow but heavy (changed!)
221 * Class 5 = Paladin --> slow but heavy
223 static void sense_inventory1(void)
226 int plev = p_ptr->lev;
231 /*** Check for "sensing" ***/
233 /* No sensing when confused */
234 if (p_ptr->confused) return;
236 /* Analyze the class */
237 switch (p_ptr->pclass)
245 if (0 != randint0(9000L / (plev * plev + 40))) return;
257 if (0 != randint0(6000L / (plev * plev + 50))) return;
267 case CLASS_HIGH_MAGE:
269 case CLASS_MAGIC_EATER:
271 /* Very bad (light) sensing */
272 if (0 != randint0(240000L / (plev + 5))) return;
281 /* Good (light) sensing */
282 if (0 != randint0(10000L / (plev * plev + 40))) return;
292 if (0 != randint0(20000L / (plev * plev + 40))) return;
304 if (0 != randint0(95000L / (plev * plev + 40))) return;
316 if (0 != randint0(77777L / (plev * plev + 40))) return;
325 case CLASS_WARRIOR_MAGE:
329 if (0 != randint0(75000L / (plev * plev + 40))) return;
335 case CLASS_MINDCRAFTER:
336 case CLASS_MIRROR_MASTER:
339 if (0 != randint0(55000L / (plev * plev + 40))) return;
345 case CLASS_CHAOS_WARRIOR:
348 if (0 != randint0(80000L / (plev * plev + 40))) return;
358 case CLASS_FORCETRAINER:
361 if (0 != randint0(20000L / (plev * plev + 40))) return;
370 if (0 != randint0(20000L / ((plev+50)*(plev+50)))) return;
380 case CLASS_BLUE_MAGE:
383 if (0 != randint0(55000L / (plev * plev + 40))) return;
389 case CLASS_BEASTMASTER:
392 if (0 != randint0(65000L / (plev * plev + 40))) return;
397 case CLASS_BERSERKER:
407 if (compare_virtue(V_KNOWLEDGE, 100, VIRTUE_LARGE)) heavy = TRUE;
409 /*** Sense everything ***/
411 /* Check everything */
412 for (i = 0; i < INVEN_TOTAL; i++)
416 o_ptr = &inventory[i];
418 /* Skip empty slots */
419 if (!o_ptr->k_idx) continue;
421 /* Valid "tval" codes */
447 /* Skip non-sense machines */
450 /* Occasional failure on inventory items */
451 if ((i < INVEN_RARM) && (0 != randint0(5))) continue;
454 if ((p_ptr->muta3 & MUT3_GOOD_LUCK) && !randint0(13))
459 sense_inventory_aux(i, heavy);
464 static void sense_inventory2(void)
467 int plev = p_ptr->lev;
471 /*** Check for "sensing" ***/
473 /* No sensing when confused */
474 if (p_ptr->confused) return;
476 /* Analyze the class */
477 switch (p_ptr->pclass)
483 case CLASS_BERSERKER:
490 case CLASS_CHAOS_WARRIOR:
492 case CLASS_BEASTMASTER:
495 /* Very bad (light) sensing */
496 if (0 != randint0(240000L / (plev + 5))) return;
503 case CLASS_WARRIOR_MAGE:
508 if (0 != randint0(95000L / (plev * plev + 40))) return;
517 case CLASS_FORCETRAINER:
518 case CLASS_MINDCRAFTER:
521 if (0 != randint0(20000L / (plev * plev + 40))) return;
528 case CLASS_HIGH_MAGE:
530 case CLASS_MAGIC_EATER:
531 case CLASS_MIRROR_MASTER:
532 case CLASS_BLUE_MAGE:
535 if (0 != randint0(9000L / (plev * plev + 40))) return;
544 if (0 != randint0(20000L / ((plev+50)*(plev+50)))) return;
551 /*** Sense everything ***/
553 /* Check everything */
554 for (i = 0; i < INVEN_TOTAL; i++)
558 o_ptr = &inventory[i];
560 /* Skip empty slots */
561 if (!o_ptr->k_idx) continue;
563 /* Valid "tval" codes */
576 /* Skip non-sense machines */
579 /* Occasional failure on inventory items */
580 if ((i < INVEN_RARM) && (0 != randint0(5))) continue;
582 sense_inventory_aux(i, TRUE);
589 * Go to any level (ripped off from wiz_jump)
591 static void pattern_teleport(void)
598 if (get_check("¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©"))
600 if (get_check("Teleport level? "))
607 /* Only downward in ironman mode */
608 if (ironman_downward)
609 min_level = dun_level;
612 if (dungeon_type == DUNGEON_ANGBAND)
615 max_level = MAX_DEPTH - 1;
616 else if (dun_level == 100)
621 max_level = d_info[dungeon_type].maxdepth;
622 min_level = d_info[dungeon_type].mindepth;
627 sprintf(ppp, "¥Æ¥ì¥Ý¡¼¥ÈÀè:(%d-%d)", min_level, max_level);
629 sprintf(ppp, "Teleport to level (%d-%d): ", min_level, max_level);
634 sprintf(tmp_val, "%d", dun_level);
636 /* Ask for a level */
637 if (!get_string(ppp, tmp_val, 10)) return;
639 /* Extract request */
640 command_arg = atoi(tmp_val);
643 else if (get_check("Ä̾ï¥Æ¥ì¥Ý¡¼¥È¡©"))
645 else if (get_check("Normal teleport? "))
649 teleport_player(200);
658 if (command_arg < min_level) command_arg = min_level;
661 if (command_arg > max_level) command_arg = max_level;
665 msg_format("%d ³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤·¤¿¡£", command_arg);
667 msg_format("You teleport to dungeon level %d.", command_arg);
671 if (autosave_l) do_cmd_save_game(TRUE);
674 dun_level = command_arg;
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 else if (record_fix_quest)
1153 do_cmd_write_nikki(NIKKI_FIX_QUEST_F, leaving_quest, NULL);
1159 * Forcibly pseudo-identify an object in the inventory
1162 * note: currently this function allows pseudo-id of any object,
1163 * including silly ones like potions & scrolls, which always
1164 * get '{average}'. This should be changed, either to stop such
1165 * items from being pseudo-id'd, or to allow psychometry to
1166 * detect whether the unidentified potion/scroll/etc is
1167 * good (Cure Light Wounds, Restore Strength, etc) or
1168 * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
1170 bool psychometry(void)
1174 char o_name[MAX_NLEN];
1179 item_tester_no_ryoute = TRUE;
1182 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«¡©";
1183 s = "Ä´¤Ù¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
1185 q = "Meditate on which item? ";
1186 s = "You have nothing appropriate.";
1189 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
1191 /* Get the item (in the pack) */
1194 o_ptr = &inventory[item];
1197 /* Get the item (on the floor) */
1200 o_ptr = &o_list[0 - item];
1203 /* It is fully known, no information needed */
1204 if (object_known_p(o_ptr))
1207 msg_print("²¿¤â¿·¤·¤¤¤³¤È¤ÏȽ¤é¤Ê¤«¤Ã¤¿¡£");
1209 msg_print("You cannot find out anything more about that.");
1215 /* Check for a feeling */
1216 feel = value_check_aux1(o_ptr);
1218 /* Get an object description */
1219 object_desc(o_name, o_ptr, FALSE, 0);
1221 /* Skip non-feelings */
1225 msg_format("%s¤«¤é¤ÏÆäËÊѤï¤Ã¤¿»ö¤Ï´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿¡£", o_name);
1227 msg_format("You do not perceive anything unusual about the %s.", o_name);
1234 msg_format("%s¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
1235 o_name, game_inscriptions[feel]);
1237 msg_format("You feel that the %s %s %s...",
1238 o_name, ((o_ptr->number == 1) ? "is" : "are"),
1239 game_inscriptions[feel]);
1243 /* We have "felt" it */
1244 o_ptr->ident |= (IDENT_SENSE);
1247 o_ptr->feeling = feel;
1249 /* Combine / Reorder the pack (later) */
1250 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1253 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1255 /* Something happened */
1260 static void gere_music(s32b music)
1268 stun_monsters(damroll(p_ptr->lev/10,2));
1271 hp_player(damroll(2,6));
1274 project_hack(GF_TURN_ALL, p_ptr->lev);
1277 project_hack(GF_PSI, randint1(p_ptr->lev * 3 / 2));
1280 project(0, 1, py, px, 0, GF_IDENTIFY, PROJECT_ITEM, -1);
1283 confuse_monsters(p_ptr->lev * 2);
1286 project_hack(GF_SOUND, damroll(10 + p_ptr->lev/5,7));
1289 charm_monsters(damroll(10 + p_ptr->lev/15,6));
1292 project(0, 0, py, px,
1293 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
1296 dispel_monsters(randint1(p_ptr->lev * 3));
1297 dispel_evil(randint1(p_ptr->lev * 3));
1304 earthquake(py, px, 10);
1307 stasis_monsters(p_ptr->lev * 4);
1310 dispel_monsters(randint1(p_ptr->lev * 3));
1313 hp_player(damroll(15,10));
1317 case MUSIC_DETECT+19:
1318 wiz_lite(FALSE, FALSE);
1319 case MUSIC_DETECT+11:
1320 case MUSIC_DETECT+12:
1321 case MUSIC_DETECT+13:
1322 case MUSIC_DETECT+14:
1323 case MUSIC_DETECT+15:
1324 case MUSIC_DETECT+16:
1325 case MUSIC_DETECT+17:
1326 case MUSIC_DETECT+18:
1327 map_area(DETECT_RAD_MAP);
1328 if ((p_ptr->lev > 39) && (music < MUSIC_DETECT+19)) p_ptr->magic_num1[0] = music+1;
1329 case MUSIC_DETECT+6:
1330 case MUSIC_DETECT+7:
1331 case MUSIC_DETECT+8:
1332 case MUSIC_DETECT+9:
1333 case MUSIC_DETECT+10:
1334 detect_treasure(DETECT_RAD_DEFAULT);
1335 detect_objects_gold(DETECT_RAD_DEFAULT);
1336 detect_objects_normal(DETECT_RAD_DEFAULT);
1337 if ((p_ptr->lev > 24) && (music < MUSIC_DETECT+11)) p_ptr->magic_num1[0] = music+1;
1338 case MUSIC_DETECT+3:
1339 case MUSIC_DETECT+4:
1340 case MUSIC_DETECT+5:
1341 detect_monsters_invis(DETECT_RAD_DEFAULT);
1342 detect_monsters_normal(DETECT_RAD_DEFAULT);
1343 if ((p_ptr->lev > 19) && (music < MUSIC_DETECT+6)) p_ptr->magic_num1[0] = music+1;
1345 case MUSIC_DETECT+1:
1346 case MUSIC_DETECT+2:
1347 detect_traps(DETECT_RAD_DEFAULT);
1348 detect_doors(DETECT_RAD_DEFAULT);
1349 detect_stairs(DETECT_RAD_DEFAULT);
1350 if ((p_ptr->lev > 14) && (music < MUSIC_DETECT+3)) p_ptr->magic_num1[0] = music+1;
1356 * If player has inscribed the object with "!!", let him know when it's
1359 static void recharged_notice(object_type *o_ptr)
1361 char o_name[MAX_NLEN];
1365 /* No inscription */
1366 if (!o_ptr->inscription) return;
1369 s = strchr(quark_str(o_ptr->inscription), '!');
1371 /* Process notification request. */
1374 /* Find another '!' */
1377 /* Describe (briefly) */
1378 object_desc(o_name, o_ptr, FALSE, 0);
1380 /* Notify the player */
1381 if (o_ptr->number > 1)
1383 msg_format("%s¤ÏºÆ½¼Å¶¤µ¤ì¤¿¡£", o_name);
1384 else msg_format("%s¤ÏºÆ½¼Å¶¤µ¤ì¤¿¡£", o_name);
1386 msg_format("Your %s are recharged.", o_name);
1387 else msg_format("Your %s is recharged.", o_name);
1395 /* Keep looking for '!'s */
1396 s = strchr(s + 1, '!');
1401 static void check_music(void)
1406 /* Music singed by player */
1407 if(p_ptr->pclass != CLASS_BARD) return;
1408 if(!p_ptr->magic_num1[0] && !p_ptr->magic_num1[1]) return;
1410 s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC][p_ptr->magic_num2[0]];
1412 shouhimana = (s_ptr->smana*(3800-p_ptr->spell_exp[p_ptr->magic_num2[0]])+2399);
1415 else shouhimana *= 4;
1417 if(shouhimana < 1) shouhimana = 1;
1418 shouhimana *= 0x8000;
1419 if (((u16b)(p_ptr->csp) < (shouhimana / 0x10000)) || (p_ptr->anti_magic))
1426 p_ptr->csp -= (u16b) (shouhimana / 0x10000);
1427 shouhimana = (shouhimana & 0xffff);
1428 if (p_ptr->csp_frac < shouhimana)
1431 p_ptr->csp_frac += (u16b)(0x10000L - shouhimana);
1435 p_ptr->csp_frac -= (u16b)shouhimana;
1438 p_ptr->redraw |= PR_MANA;
1439 if (p_ptr->magic_num1[1])
1441 p_ptr->magic_num1[0] = p_ptr->magic_num1[1];
1442 p_ptr->magic_num1[1] = 0;
1444 msg_print("²Î¤òºÆ³«¤·¤¿¡£");
1446 msg_print("You restart singing.");
1448 p_ptr->action = ACTION_SING;
1450 /* Recalculate bonuses */
1451 p_ptr->update |= (PU_BONUS | PU_HP);
1453 /* Redraw status bar */
1454 p_ptr->redraw |= (PR_STATUS);
1457 if (p_ptr->spell_exp[p_ptr->magic_num2[0]] < 900)
1458 p_ptr->spell_exp[p_ptr->magic_num2[0]]+=5;
1459 else if(p_ptr->spell_exp[p_ptr->magic_num2[0]] < 1200)
1460 {if (one_in_(2) && (dun_level > 4) && ((dun_level + 10) > p_ptr->lev)) p_ptr->spell_exp[p_ptr->magic_num2[0]]+=1;}
1461 else if(p_ptr->spell_exp[p_ptr->magic_num2[0]] < 1400)
1462 {if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel)) p_ptr->spell_exp[p_ptr->magic_num2[0]]+=1;}
1463 else if(p_ptr->spell_exp[p_ptr->magic_num2[0]] < 1600)
1464 {if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel)) p_ptr->spell_exp[p_ptr->magic_num2[0]]+=1;}
1466 gere_music(p_ptr->magic_num1[0]);
1469 /* Choose one of items that have cursed flag */
1470 static object_type *choose_cursed_obj_name(u32b flag)
1473 int choices[INVEN_TOTAL-INVEN_RARM];
1476 /* Paranoia -- Player has no warning-item */
1477 if (!(p_ptr->cursed & flag)) return NULL;
1479 /* Search Inventry */
1480 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
1482 object_type *o_ptr = &inventory[i];
1484 if (o_ptr->curse_flags & flag)
1486 choices[number] = i;
1491 /* Choice one of them */
1492 return (&inventory[choices[randint0(number)]]);
1497 * Handle certain things once every 10 game turns
1499 static void process_world(void)
1503 bool cave_no_regen = FALSE;
1504 int upkeep_factor = 0;
1509 const int dec_count = (easy_band ? 2 : 1);
1511 int day, hour, min, prev_min;
1513 s32b len = TURNS_PER_TICK * TOWN_DAWN;
1514 s32b tick = turn % len + len / 4;
1516 extract_day_hour_min(&day, &hour, &min);
1517 prev_min = (1440 * (tick - TURNS_PER_TICK) / len) % 60;
1519 if ((turn - old_turn == (150 - dun_level) * TURNS_PER_TICK)
1521 !(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)))) &&
1522 !(p_ptr->inside_battle))
1525 if (p_ptr->inside_battle && !p_ptr->leaving)
1532 /* Count all hostile monsters */
1533 for (i2 = 0; i2 < cur_wid; ++i2)
1534 for (j2 = 0; j2 < cur_hgt; j2++)
1535 if ((cave[j2][i2].m_idx > 0) && (cave[j2][i2].m_idx != p_ptr->riding))
1538 win_m_idx = cave[j2][i2].m_idx;
1541 if (number_mon == 0)
1544 msg_print("ÁêÂǤÁ¤Ë½ª¤ï¤ê¤Þ¤·¤¿¡£");
1546 msg_print("They have kill each other at the same time.");
1549 p_ptr->energy_need = 0;
1552 else if ((number_mon-1) == 0)
1555 monster_type *wm_ptr;
1557 wm_ptr = &m_list[win_m_idx];
1559 monster_desc(m_name, wm_ptr, 0);
1561 msg_format("%s¤¬¾¡Íø¤·¤¿¡ª", m_name);
1563 msg_format("%s is winner!", m_name);
1567 if (win_m_idx == (sel_monster+1))
1570 msg_print("¤ª¤á¤Ç¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£");
1572 msg_print("Congratulations.");
1575 msg_format("%d¡ð¤ò¼õ¤±¼è¤Ã¤¿¡£", battle_odds);
1577 msg_format("You received %d gold.", battle_odds);
1579 p_ptr->au += battle_odds;
1584 msg_print("»ÄÇ°¤Ç¤·¤¿¡£");
1586 msg_print("You lost gold.");
1590 p_ptr->energy_need = 0;
1593 else if(turn - old_turn == 150*TURNS_PER_TICK)
1596 msg_print("¿½¤·Ê¬¤±¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤³¤Î¾¡Éé¤Ï°ú¤Ê¬¤±¤È¤µ¤»¤Æ¤¤¤¿¤À¤¤Þ¤¹¡£");
1598 msg_format("This battle have ended in a draw.");
1600 p_ptr->au += kakekin;
1602 p_ptr->energy_need = 0;
1607 /* Every 20 game turns */
1608 if (turn % TURNS_PER_TICK) return;
1610 /*** Check the Time and Load ***/
1612 if (!(turn % (50*TURNS_PER_TICK)))
1614 /* Check time and load */
1615 if ((0 != check_time()) || (0 != check_load()))
1618 if (closing_flag <= 2)
1623 /* Count warnings */
1628 msg_print("¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¸¤«¤«¤Ã¤Æ¤¤¤Þ¤¹...");
1629 msg_print("¥²¡¼¥à¤ò½ªÎ»¤¹¤ë¤«¥»¡¼¥Ö¤¹¤ë¤«¤·¤Æ²¼¤µ¤¤¡£");
1631 msg_print("The gates to ANGBAND are closing...");
1632 msg_print("Please finish up and/or save your game.");
1642 msg_print("º£¡¢¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¶¤µ¤ì¤Þ¤·¤¿¡£");
1644 msg_print("The gates to ANGBAND are now closed.");
1649 p_ptr->playing = FALSE;
1652 p_ptr->leaving = TRUE;
1657 /*** Attempt timed autosave ***/
1658 if (autosave_t && autosave_freq && !p_ptr->inside_battle)
1660 if (!(turn % ((s32b)autosave_freq * TURNS_PER_TICK)))
1661 do_cmd_save_game(TRUE);
1667 msg_print("²¿¤«¤¬Ê¹¤³¤¨¤¿¡£");
1669 msg_print("You hear noise.");
1673 /*** Handle the wilderness/town (sunshine) ***/
1675 /* While in town/wilderness */
1676 if (!dun_level && !p_ptr->inside_quest && !p_ptr->inside_battle && !p_ptr->inside_arena && !p_ptr->wild_mode)
1678 /* Hack -- Daybreak/Nighfall in town */
1679 if (!(turn % ((TURNS_PER_TICK * TOWN_DAWN) / 2)))
1683 /* Check for dawn */
1684 dawn = (!(turn % (TURNS_PER_TICK * TOWN_DAWN)));
1691 msg_print("Ì뤬ÌÀ¤±¤¿¡£");
1693 msg_print("The sun has risen.");
1697 /* Hack -- Scan the town */
1698 for (y = 0; y < cur_hgt; y++)
1700 for (x = 0; x < cur_wid; x++)
1702 /* Get the cave grid */
1703 c_ptr = &cave[y][x];
1706 c_ptr->info |= (CAVE_GLOW);
1708 /* Hack -- Memorize lit grids if allowed */
1709 if (view_perma_grids) c_ptr->info |= (CAVE_MARK);
1711 /* Hack -- Notice spot */
1722 msg_print("Æü¤¬ÄÀ¤ó¤À¡£");
1724 msg_print("The sun has fallen.");
1728 /* Hack -- Scan the town */
1729 for (y = 0; y < cur_hgt; y++)
1731 for (x = 0; x < cur_wid; x++)
1733 /* Get the cave grid */
1734 c_ptr = &cave[y][x];
1736 /* Darken "boring" features */
1737 if ((c_ptr->feat <= FEAT_INVIS) ||
1738 ((c_ptr->feat >= FEAT_DEEP_WATER) &&
1739 (c_ptr->feat <= FEAT_MOUNTAIN) &&
1740 (c_ptr->feat != FEAT_MUSEUM)) ||
1741 (x == 0) || (x == cur_wid-1) ||
1742 (y == 0) || (y == cur_hgt-1))
1744 /* Forget the grid */
1745 if (!(c_ptr->info & CAVE_IN_MIRROR)) c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK);
1747 /* Hack -- Notice spot */
1754 /* Update the monsters */
1755 p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
1758 p_ptr->redraw |= (PR_MAP);
1761 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1765 /* Set back the rewards once a day */
1766 if (!(turn % (TURNS_PER_TICK*10 * STORE_TURNS)))
1770 /* Reset the rewards */
1771 for (n = 0; n < MAX_BACT; n++)
1773 p_ptr->rewards[n] = FALSE;
1778 if (cheat_xtra) msg_print("Êó½·¤ò¥ê¥»¥Ã¥È");
1780 if (cheat_xtra) msg_print("Rewards reset.");
1786 /*** Process the monsters ***/
1788 /* Check for creature generation. */
1789 if (one_in_(d_info[dungeon_type].max_m_alloc_chance) &&
1790 !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->inside_battle)
1792 /* Make a new monster */
1793 (void)alloc_monster(MAX_SIGHT + 5, FALSE);
1796 /* Hack -- Check for creature regeneration */
1797 if (!(turn % (TURNS_PER_TICK*10)) && !p_ptr->inside_battle) regen_monsters();
1798 if (!(turn % (TURNS_PER_TICK*3))) regen_captured_monsters();
1801 /*** Damage over Time ***/
1803 /* Take damage from poison */
1804 if (p_ptr->poisoned && !p_ptr->invuln)
1808 take_hit(DAMAGE_NOESCAPE, 1, "ÆÇ", -1);
1810 take_hit(DAMAGE_NOESCAPE, 1, "poison", -1);
1816 /* (Vampires) Take damage from sunlight */
1817 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
1819 if (!dun_level && !p_ptr->resist_lite && !p_ptr->invuln && is_daytime())
1821 if (cave[py][px].info & CAVE_GLOW)
1825 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª");
1826 take_hit(DAMAGE_NOESCAPE, 1, "Æü¸÷", -1);
1828 msg_print("The sun's rays scorch your undead flesh!");
1829 take_hit(DAMAGE_NOESCAPE, 1, "sunlight", -1);
1832 cave_no_regen = TRUE;
1836 if (inventory[INVEN_LITE].tval && (inventory[INVEN_LITE].name2 != EGO_LITE_DARKNESS) &&
1837 !p_ptr->resist_lite)
1839 object_type * o_ptr = &inventory[INVEN_LITE];
1840 char o_name [MAX_NLEN];
1841 char ouch [MAX_NLEN+40];
1843 /* Get an object description */
1844 object_desc(o_name, o_ptr, FALSE, 0);
1847 msg_format("%s¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª", o_name);
1849 msg_format("The %s scorches your undead flesh!", o_name);
1853 cave_no_regen = TRUE;
1855 /* Get an object description */
1856 object_desc(o_name, o_ptr, TRUE, 0);
1859 sprintf(ouch, "%s¤òÁõÈ÷¤·¤¿¥À¥á¡¼¥¸", o_name);
1861 sprintf(ouch, "wielding %s", o_name);
1864 if (!p_ptr->invuln) take_hit(DAMAGE_NOESCAPE, 1, ouch, -1);
1868 if ((cave[py][px].feat == FEAT_SHAL_LAVA) &&
1869 !p_ptr->invuln && !p_ptr->immune_fire && !p_ptr->ffall)
1871 int damage = 3000 + randint0(2000);
1873 if (prace_is_(RACE_ENT)) damage += damage/3;
1875 if (p_ptr->resist_fire) damage = damage / 3;
1876 if (p_ptr->oppose_fire) damage = damage / 3;
1877 damage = damage / 100 + (randint0(100) < (damage % 100));
1883 msg_print("ÍÏ´ä¤Ç²Ð½ý¤·¤¿¡ª");
1884 take_hit(DAMAGE_NOESCAPE, damage, "Àõ¤¤ÍÏ´äή", -1);
1886 msg_print("The lava burns you!");
1887 take_hit(DAMAGE_NOESCAPE, damage, "shallow lava", -1);
1890 cave_no_regen = TRUE;
1894 else if ((cave[py][px].feat == FEAT_DEEP_LAVA) &&
1895 !p_ptr->invuln && !p_ptr->immune_fire)
1897 int damage = 6000 + randint0(4000);
1902 if (p_ptr->resist_fire) damage = damage / 3;
1903 if (p_ptr->oppose_fire) damage = damage / 3;
1907 damage = damage / 5;
1910 message = "Ç®¤Ç²Ð½ý¤·¤¿¡ª";
1911 hit_from = "¿¼¤¤ÍÏ´äή¤Î¾å¤ËÉâÍ·¤·¤¿¥À¥á¡¼¥¸";
1913 message = "The heat burns you!";
1914 hit_from = "flying over deep lava";
1921 message = "ÍÏ´ä¤Ç²Ð½ý¤·¤¿¡ª";
1922 hit_from = "¿¼¤¤ÍÏ´äή";
1924 message = "The lava burns you!";
1925 hit_from = "deep lava";
1930 damage = damage / 100 + (randint0(100) < (damage % 100));
1935 take_hit(DAMAGE_NOESCAPE, damage, hit_from, -1);
1937 cave_no_regen = TRUE;
1941 else if ((cave[py][px].feat == FEAT_DEEP_WATER) && !p_ptr->ffall && !p_ptr->can_swim)
1943 if (p_ptr->total_weight > (((u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2))
1947 msg_print("Å®¤ì¤Æ¤¤¤ë¡ª");
1948 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), "Å®¤ì", -1);
1950 msg_print("You are drowning!");
1951 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), "drowning", -1);
1954 cave_no_regen = TRUE;
1961 if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !p_ptr->immune_fire)
1963 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1964 if (prace_is_(RACE_ENT)) damage += damage/3;
1965 if (p_ptr->resist_fire) damage = damage / 3;
1966 if (p_ptr->oppose_fire) damage = damage / 3;
1968 msg_print("Ç®¤¤¡ª");
1969 take_hit(DAMAGE_NOESCAPE, damage, "±ê¤Î¥ª¡¼¥é", -1);
1971 msg_print("It's hot!");
1972 take_hit(DAMAGE_NOESCAPE, damage, "Fire aura", -1);
1975 if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !p_ptr->immune_elec)
1977 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1978 if (p_ptr->resist_elec) damage = damage / 3;
1979 if (p_ptr->oppose_elec) damage = damage / 3;
1981 msg_print("Äˤ¤¡ª");
1982 take_hit(DAMAGE_NOESCAPE, damage, "Åŵ¤¤Î¥ª¡¼¥é", -1);
1984 msg_print("It hurts!");
1985 take_hit(DAMAGE_NOESCAPE, damage, "Elec aura", -1);
1988 if ((r_info[m_list[p_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !p_ptr->immune_cold)
1990 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
1991 if (p_ptr->resist_cold) damage = damage / 3;
1992 if (p_ptr->oppose_cold) damage = damage / 3;
1994 msg_print("Î䤿¤¤¡ª");
1995 take_hit(DAMAGE_NOESCAPE, damage, "Î䵤¤Î¥ª¡¼¥é", -1);
1997 msg_print("It's cold!");
1998 take_hit(DAMAGE_NOESCAPE, damage, "Cold aura", -1);
2003 /* Spectres -- take damage when moving through walls */
2005 * Added: ANYBODY takes damage if inside through walls
2006 * without wraith form -- NOTE: Spectres will never be
2007 * reduced below 0 hp by being inside a stone wall; others
2010 if (!cave_floor_bold(py, px))
2012 /* Player can walk through trees */
2013 if ((cave[py][px].feat == FEAT_TREES) || ((cave[py][px].feat == FEAT_MOUNTAIN) && !dun_level && p_ptr->ffall))
2017 else if (!p_ptr->invuln && !p_ptr->wraith_form && !p_ptr->kabenuke &&
2018 ((p_ptr->chp > (p_ptr->lev / 5)) || !p_ptr->pass_wall))
2022 cave_no_regen = TRUE;
2024 if (p_ptr->pass_wall)
2027 msg_print("ÂΤÎʬ»Ò¤¬Ê¬²ò¤·¤¿µ¤¤¬¤¹¤ë¡ª");
2030 msg_print("Your molecules feel disrupted!");
2031 dam_desc = "density";
2038 msg_print("Êø¤ì¤¿´ä¤Ë²¡¤·ÄÙ¤µ¤ì¤¿¡ª");
2039 dam_desc = "¹Å¤¤´ä";
2041 msg_print("You are being crushed!");
2042 dam_desc = "solid rock";
2047 take_hit(DAMAGE_NOESCAPE, 1 + (p_ptr->lev / 5), dam_desc, -1);
2053 monster_race *r_ptr;
2055 if (min != prev_min)
2058 bool old_inside_battle = p_ptr->inside_battle;
2060 do_cmd_write_nikki(NIKKI_HIGAWARI, 0, NULL);
2062 p_ptr->inside_battle = TRUE;
2063 get_mon_num_prep(NULL,NULL);
2065 for (i = 0; i < max_d_idx; i++)
2067 if (max_dlv[i] < d_info[i].mindepth) continue;
2068 if (max_dl < max_dlv[i]) max_dl = max_dlv[i];
2072 today_mon = get_mon_num(max_dl);
2073 r_ptr = &r_info[today_mon];
2075 if (r_ptr->flags1 & RF1_UNIQUE) continue;
2076 if (r_ptr->flags7 & (RF7_UNIQUE_7 | RF7_UNIQUE2)) continue;
2077 if (r_ptr->flags2 & (RF2_MULTIPLY)) continue;
2078 if (!(r_ptr->flags9 & RF9_DROP_CORPSE) || !(r_ptr->flags9 & RF9_DROP_SKELETON)) continue;
2079 if (r_ptr->level < MIN(max_dl/2, 40)) continue;
2080 if (r_ptr->rarity > 10) continue;
2081 if (r_ptr->level == 0) continue;
2084 p_ptr->today_mon = 0;
2085 p_ptr->inside_battle = old_inside_battle;
2089 /* Nightmare mode activates the TY_CURSE at midnight */
2090 if (ironman_nightmare)
2092 /* Require exact minute */
2093 if (min != prev_min)
2095 /* Every 15 minutes after 11:00 pm */
2096 if ((hour == 23) && !(min % 15))
2106 msg_print("±ó¤¯¤ÇÉÔµ¤Ì£¤Ê¾â¤Î²»¤¬ÌĤä¿¡£");
2108 msg_print("You hear a distant bell toll ominously.");
2116 msg_print("±ó¤¯¤Ç¾â¤¬Æó²óÌĤä¿¡£");
2118 msg_print("A distant bell sounds twice.");
2126 msg_print("±ó¤¯¤Ç¾â¤¬»°²óÌĤä¿¡£");
2128 msg_print("A distant bell sounds three times.");
2136 msg_print("±ó¤¯¤Ç¾â¤¬»Í²óÌĤä¿¡£");
2138 msg_print("A distant bell tolls four times.");
2146 /* TY_CURSE activates at mignight! */
2153 msg_print("±ó¤¯¤Ç¾â¤¬²¿²ó¤âÌĤꡢ»à¤ó¤À¤è¤¦¤ÊÀŤ±¤µ¤ÎÃæ¤Ø¾Ã¤¨¤Æ¤¤¤Ã¤¿¡£");
2155 msg_print("A distant bell tolls many times, fading into an deathly silence.");
2158 activate_ty_curse(FALSE, &count);
2163 /* Take damage from cuts */
2164 if (p_ptr->cut && !p_ptr->invuln)
2166 /* Mortal wound or Deep Gash */
2167 if (p_ptr->cut > 1000)
2172 else if (p_ptr->cut > 200)
2178 else if (p_ptr->cut > 100)
2183 else if (p_ptr->cut > 50)
2188 else if (p_ptr->cut > 25)
2193 else if (p_ptr->cut > 10)
2206 take_hit(DAMAGE_NOESCAPE, i, "Ã×Ì¿½ý", -1);
2208 take_hit(DAMAGE_NOESCAPE, i, "a fatal wound", -1);
2214 /*** Check the Food, and Regenerate ***/
2216 if (!p_ptr->inside_battle)
2218 /* Digest normally */
2219 if (p_ptr->food < PY_FOOD_MAX)
2221 /* Every 100 game turns */
2222 if (!(turn % (TURNS_PER_TICK*5)))
2224 /* Basic digestion rate based on speed */
2225 i = /* extract_energy[p_ptr->pspeed] * 2;*/
2226 ((p_ptr->pspeed > 199) ? 49 : ((p_ptr->pspeed < 0) ?
2227 1 : extract_energy[p_ptr->pspeed]));
2229 /* Regeneration takes more food */
2230 if (p_ptr->regenerate) i += 20;
2231 if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK)) i+= 20;
2232 if (p_ptr->cursed & TRC_FAST_DIGEST) i += 30;
2234 /* Slow digestion takes less food */
2235 if (p_ptr->slow_digest) i -= 5;
2237 /* Minimal digestion */
2239 /* Maximal digestion */
2240 if (i > 100) i = 100;
2242 /* Digest some food */
2243 (void)set_food(p_ptr->food - i);
2247 /* Digest quickly when gorged */
2250 /* Digest a lot of food */
2251 (void)set_food(p_ptr->food - 100);
2255 /* Starve to death (slowly) */
2256 if (p_ptr->food < PY_FOOD_STARVE)
2258 /* Calculate damage */
2259 i = (PY_FOOD_STARVE - p_ptr->food) / 10;
2263 if (!p_ptr->invuln) take_hit(DAMAGE_LOSELIFE, i, "¶õÊ¢", -1);
2265 if (!p_ptr->invuln) take_hit(DAMAGE_LOSELIFE, i, "starvation", -1);
2270 /* Default regeneration */
2271 regen_amount = PY_REGEN_NORMAL;
2274 if (p_ptr->food < PY_FOOD_WEAK)
2276 /* Lower regeneration */
2277 if (p_ptr->food < PY_FOOD_STARVE)
2281 else if (p_ptr->food < PY_FOOD_FAINT)
2283 regen_amount = PY_REGEN_FAINT;
2287 regen_amount = PY_REGEN_WEAK;
2291 if ((p_ptr->food < PY_FOOD_FAINT) && !p_ptr->inside_battle)
2293 /* Faint occasionally */
2294 if (!p_ptr->paralyzed && (randint0(100) < 10))
2298 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤À䤷¤Æ¤·¤Þ¤Ã¤¿¡£");
2300 msg_print("You faint from the lack of food.");
2305 /* Hack -- faint (bypass free action) */
2306 (void)set_paralyzed(p_ptr->paralyzed + 1 + randint0(5));
2312 /* Are we walking the pattern? */
2313 if (pattern_effect())
2315 cave_no_regen = TRUE;
2319 /* Regeneration ability */
2320 if (p_ptr->regenerate)
2322 regen_amount = regen_amount * 2;
2324 if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK))
2328 if (p_ptr->cursed & TRC_SLOW_REGEN)
2335 /* Searching or Resting */
2336 if ((p_ptr->action == ACTION_SEARCH) || (p_ptr->action == ACTION_REST))
2338 regen_amount = regen_amount * 2;
2341 upkeep_factor = calculate_upkeep();
2343 /* Regenerate the mana */
2344 /* if (p_ptr->csp < p_ptr->msp) */
2348 s32b upkeep_regen = ((100 - upkeep_factor) * regen_amount);
2349 if ((p_ptr->action == ACTION_LEARN) || (p_ptr->action == ACTION_HAYAGAKE)) upkeep_regen -= regen_amount;
2350 regenmana(upkeep_regen/100);
2352 #ifdef TRACK_FRIENDS
2356 msg_format("£Í£Ð²óÉü: %d/%d", upkeep_regen, regen_amount);
2358 msg_format("Regen: %d/%d", upkeep_regen, regen_amount);
2362 #endif /* TRACK_FRIENDS */
2365 else if (p_ptr->action != ACTION_LEARN)
2367 regenmana(regen_amount);
2370 if (p_ptr->pclass == CLASS_MAGIC_EATER)
2372 regenmagic(regen_amount);
2375 if ((p_ptr->csp == 0) && (p_ptr->csp_frac == 0))
2377 while (upkeep_factor > 100)
2380 msg_print("¤³¤ó¤Ê¤Ë¿¤¯¤Î¥Ú¥Ã¥È¤òÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
2382 msg_print("Such much pets cannot be controled at once!");
2385 do_cmd_pet_dismiss();
2387 upkeep_factor = calculate_upkeep();
2390 msg_format("°Ý»ý£Í£Ð¤Ï %d%%", upkeep_factor);
2392 msg_format("Upkeep: %d%% mana.", upkeep_factor);
2398 /* Poisoned or cut yields no healing */
2399 if (p_ptr->poisoned) regen_amount = 0;
2400 if (p_ptr->cut) regen_amount = 0;
2402 /* Special floor -- Pattern, in a wall -- yields no healing */
2403 if (cave_no_regen) regen_amount = 0;
2405 regen_amount = (regen_amount * mutant_regenerate_mod) / 100;
2407 /* Regenerate Hit Points if needed */
2408 if ((p_ptr->chp < p_ptr->mhp) && !cave_no_regen)
2410 if ((cave[py][px].feat < FEAT_PATTERN_END) &&
2411 (cave[py][px].feat >= FEAT_PATTERN_START))
2413 regenhp(regen_amount / 5); /* Hmmm. this should never happen? */
2417 regenhp(regen_amount);
2422 /*** Timeout Various Things ***/
2425 if (p_ptr->tim_mimic)
2427 (void)set_mimic(p_ptr->tim_mimic - 1, p_ptr->mimic_form, TRUE);
2430 /* Hack -- Hallucinating */
2433 (void)set_image(p_ptr->image - dec_count);
2439 (void)set_blind(p_ptr->blind - dec_count);
2442 /* Times see-invisible */
2443 if (p_ptr->tim_invis)
2445 (void)set_tim_invis(p_ptr->tim_invis - 1, TRUE);
2456 (void)set_tim_esp(p_ptr->tim_esp - 1, TRUE);
2459 /* Timed temporary elemental brands. -LM- */
2460 if (p_ptr->ele_attack)
2462 p_ptr->ele_attack--;
2464 /* Clear all temporary elemental brands. */
2465 if (!p_ptr->ele_attack) set_ele_attack(0, 0);
2468 /* Timed temporary elemental immune. -LM- */
2469 if (p_ptr->ele_immune)
2471 p_ptr->ele_immune--;
2473 /* Clear all temporary elemental brands. */
2474 if (!p_ptr->ele_immune) set_ele_immune(0, 0);
2477 /* Timed infra-vision */
2478 if (p_ptr->tim_infra)
2480 (void)set_tim_infra(p_ptr->tim_infra - 1, TRUE);
2484 if (p_ptr->tim_stealth)
2486 (void)set_tim_stealth(p_ptr->tim_stealth - 1, TRUE);
2489 /* Timed levitation */
2490 if (p_ptr->tim_ffall)
2492 (void)set_tim_ffall(p_ptr->tim_ffall - 1, TRUE);
2495 /* Timed sh_touki */
2496 if (p_ptr->tim_sh_touki)
2498 (void)set_tim_sh_touki(p_ptr->tim_sh_touki - 1, TRUE);
2502 if (p_ptr->tim_sh_fire)
2504 (void)set_tim_sh_fire(p_ptr->tim_sh_fire - 1, TRUE);
2508 if (p_ptr->tim_sh_holy)
2510 (void)set_tim_sh_holy(p_ptr->tim_sh_holy - 1, TRUE);
2514 if (p_ptr->tim_eyeeye)
2516 (void)set_tim_eyeeye(p_ptr->tim_eyeeye - 1, TRUE);
2519 /* Timed resist-magic */
2520 if (p_ptr->resist_magic)
2522 (void)set_resist_magic(p_ptr->resist_magic - 1, TRUE);
2525 /* Timed regeneration */
2526 if (p_ptr->tim_regen)
2528 (void)set_tim_regen(p_ptr->tim_regen - 1, TRUE);
2531 /* Timed resist nether */
2532 if (p_ptr->tim_res_nether)
2534 (void)set_tim_res_nether(p_ptr->tim_res_nether - 1, TRUE);
2537 /* Timed resist time */
2538 if (p_ptr->tim_res_time)
2540 (void)set_tim_res_time(p_ptr->tim_res_time - 1, TRUE);
2544 if (p_ptr->tim_reflect)
2546 (void)set_tim_reflect(p_ptr->tim_reflect - 1, TRUE);
2550 if (p_ptr->multishadow)
2552 (void)set_multishadow(p_ptr->multishadow - 1, TRUE);
2555 /* Timed Robe of dust */
2556 if (p_ptr->dustrobe)
2558 (void)set_dustrobe(p_ptr->dustrobe - 1, TRUE);
2561 /* Timed infra-vision */
2562 if (p_ptr->kabenuke)
2564 (void)set_kabenuke(p_ptr->kabenuke - 1, TRUE);
2568 if (p_ptr->paralyzed)
2570 (void)set_paralyzed(p_ptr->paralyzed - dec_count);
2574 if (p_ptr->confused)
2576 (void)set_confused(p_ptr->confused - dec_count);
2582 (void)set_afraid(p_ptr->afraid - dec_count);
2588 (void)set_fast(p_ptr->fast - 1, TRUE);
2594 (void)set_slow(p_ptr->slow - dec_count, TRUE);
2597 /* Protection from evil */
2598 if (p_ptr->protevil)
2600 (void)set_protevil(p_ptr->protevil - 1, TRUE);
2603 /* Invulnerability */
2606 (void)set_invuln(p_ptr->invuln - 1, TRUE);
2610 if (p_ptr->wraith_form)
2612 (void)set_wraith_form(p_ptr->wraith_form - 1, TRUE);
2618 (void)set_hero(p_ptr->hero - 1, TRUE);
2624 (void)set_shero(p_ptr->shero - 1, TRUE);
2630 (void)set_blessed(p_ptr->blessed - 1, TRUE);
2636 (void)set_shield(p_ptr->shield - 1, TRUE);
2640 if (p_ptr->tsubureru)
2642 (void)set_tsubureru(p_ptr->tsubureru - 1, TRUE);
2646 if (p_ptr->magicdef)
2648 (void)set_magicdef(p_ptr->magicdef - 1, TRUE);
2652 if (p_ptr->tsuyoshi)
2654 (void)set_tsuyoshi(p_ptr->tsuyoshi - 1, TRUE);
2658 if (p_ptr->oppose_acid)
2660 (void)set_oppose_acid(p_ptr->oppose_acid - 1, TRUE);
2663 /* Oppose Lightning */
2664 if (p_ptr->oppose_elec)
2666 (void)set_oppose_elec(p_ptr->oppose_elec - 1, TRUE);
2670 if (p_ptr->oppose_fire)
2672 (void)set_oppose_fire(p_ptr->oppose_fire - 1, TRUE);
2676 if (p_ptr->oppose_cold)
2678 (void)set_oppose_cold(p_ptr->oppose_cold - 1, TRUE);
2682 if (p_ptr->oppose_pois)
2684 (void)set_oppose_pois(p_ptr->oppose_pois - 1, TRUE);
2689 (void)set_ultimate_res(p_ptr->ult_res - 1, TRUE);
2692 /*** Poison and Stun and Cut ***/
2695 if (p_ptr->poisoned)
2697 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2699 /* Apply some healing */
2700 (void)set_poisoned(p_ptr->poisoned - adjust);
2706 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2708 /* Apply some healing */
2709 (void)set_stun(p_ptr->stun - adjust);
2715 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2717 /* Hack -- Truly "mortal" wound */
2718 if (p_ptr->cut > 1000) adjust = 0;
2720 /* Apply some healing */
2721 (void)set_cut(p_ptr->cut - adjust);
2726 /*** Process Light ***/
2728 /* Check for light being wielded */
2729 o_ptr = &inventory[INVEN_LITE];
2731 /* Burn some fuel in the current lite */
2732 if (o_ptr->tval == TV_LITE)
2734 /* Hack -- Use some fuel (except on artifacts) */
2735 if (!(artifact_p(o_ptr) || o_ptr->sval == SV_LITE_FEANOR) && (o_ptr->xtra4 > 0))
2737 /* Decrease life-span */
2738 if (o_ptr->name2 == EGO_LITE_LONG)
2740 if (turn % (TURNS_PER_TICK*2)) o_ptr->xtra4--;
2742 else o_ptr->xtra4--;
2744 /* Notice interesting fuel steps */
2745 notice_lite_change(o_ptr);
2749 /* Calculate torch radius */
2750 p_ptr->update |= (PU_TORCH);
2753 /*** Process mutation effects ***/
2754 if (p_ptr->muta2 && !p_ptr->inside_battle && !p_ptr->wild_mode)
2756 if ((p_ptr->muta2 & MUT2_BERS_RAGE) && one_in_(3000))
2760 msg_print("¥¦¥¬¥¡¥¡¥¢¡ª");
2761 msg_print("·ãÅܤÎȯºî¤Ë½±¤ï¤ì¤¿¡ª");
2763 msg_print("RAAAAGHH!");
2764 msg_print("You feel a fit of rage coming over you!");
2767 (void)set_shero(10 + randint1(p_ptr->lev), FALSE);
2770 if ((p_ptr->muta2 & MUT2_COWARDICE) && (randint1(3000) == 13))
2772 if (!(p_ptr->resist_fear || p_ptr->hero || p_ptr->shero))
2776 msg_print("¤È¤Æ¤â°Å¤¤... ¤È¤Æ¤â¶²¤¤¡ª");
2778 msg_print("It's so dark... so scary!");
2781 set_afraid(p_ptr->afraid + 13 + randint1(26));
2785 if ((p_ptr->muta2 & MUT2_RTELEPORT) && (randint1(5000) == 88))
2787 if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) &&
2792 /* Teleport player */
2794 msg_print("¤¢¤Ê¤¿¤Î°ÌÃÖ¤ÏÆÍÁ³¤Ò¤¸¤ç¤¦¤ËÉÔ³ÎÄê¤Ë¤Ê¤Ã¤¿...");
2796 msg_print("Your position suddenly seems very uncertain...");
2800 teleport_player(40);
2804 if ((p_ptr->muta2 & MUT2_ALCOHOL) && (randint1(6400) == 321))
2806 if (!p_ptr->resist_conf && !p_ptr->resist_chaos)
2809 p_ptr->redraw |= PR_EXTRA;
2811 msg_print("¤¤¤Ò¤¤¬¤â¡¼¤í¡¼¤È¤Ò¤Æ¤¤¿¤¤¬¤Õ¤ë...¥Ò¥Ã¥¯¡ª");
2813 msg_print("You feel a SSSCHtupor cOmINg over yOu... *HIC*!");
2818 if (!p_ptr->resist_conf)
2820 (void)set_confused(p_ptr->confused + randint0(20) + 15);
2823 if (!p_ptr->resist_chaos)
2828 if (one_in_(3)) lose_all_info();
2830 teleport_player(100);
2833 msg_print("¤¢¤Ê¤¿¤Ï¸«ÃΤé¤Ì¾ì½ê¤ÇÌܤ¬Àä᤿...Ƭ¤¬Äˤ¤¡£");
2834 msg_print("²¿¤â³Ð¤¨¤Æ¤¤¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ËÍ褿¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
2836 msg_print("You wake up somewhere with a sore head...");
2837 msg_print("You can't remember a thing, or how you got here!");
2846 msg_print("¤¡Á¤ì¤¤¤Ê¤Á¤ç¤ª¤Á¤ç¤é¤È¤ó¤ì¤¤¤ë¡Á");
2848 msg_print("Thishcischs GooDSChtuff!");
2851 (void)set_image(p_ptr->image + randint0(150) + 150);
2857 if ((p_ptr->muta2 & MUT2_HALLU) && (randint1(6400) == 42))
2859 if (!p_ptr->resist_chaos)
2862 p_ptr->redraw |= PR_EXTRA;
2863 (void)set_image(p_ptr->image + randint0(50) + 20);
2867 if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint1(3000) == 13))
2872 msg_print("¥Ö¥¥¡¼¡¼¥Ã¡ª¤ª¤Ã¤È¡£");
2874 msg_print("BRRAAAP! Oops.");
2878 fire_ball(GF_POIS, 0, p_ptr->lev, 3);
2881 if ((p_ptr->muta2 & MUT2_PROD_MANA) &&
2882 !p_ptr->anti_magic && one_in_(9000))
2887 msg_print("ËâË¡¤Î¥¨¥Í¥ë¥®¡¼¤¬ÆÍÁ³¤¢¤Ê¤¿¤ÎÃæ¤Ëή¤ì¹þ¤ó¤Ç¤¤¿¡ª¥¨¥Í¥ë¥®¡¼¤ò²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡ª");
2889 msg_print("Magical energy flows through you! You must release it!");
2894 (void)get_hack_dir(&dire);
2895 fire_ball(GF_MANA, dire, p_ptr->lev * 2, 3);
2898 if ((p_ptr->muta2 & MUT2_ATT_DEMON) &&
2899 !p_ptr->anti_magic && (randint1(6666) == 666))
2901 bool pet = one_in_(6);
2902 u32b mode = PM_ALLOW_GROUP;
2904 if (pet) mode |= PM_FORCE_PET;
2905 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
2907 if (summon_specific((pet ? -1 : 0), py, px,
2908 dun_level, SUMMON_DEMON, mode))
2911 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤ò°ú¤´ó¤»¤¿¡ª");
2913 msg_print("You have attracted a demon!");
2920 if ((p_ptr->muta2 & MUT2_SPEED_FLUX) && one_in_(6000))
2926 msg_print("ÀºÎÏŪ¤Ç¤Ê¤¯¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2928 msg_print("You feel less energetic.");
2931 if (p_ptr->fast > 0)
2937 set_slow(randint1(30) + 10, FALSE);
2943 msg_print("ÀºÎÏŪ¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2945 msg_print("You feel more energetic.");
2948 if (p_ptr->slow > 0)
2954 set_fast(randint1(30) + 10, FALSE);
2959 if ((p_ptr->muta2 & MUT2_BANISH_ALL) && one_in_(9000))
2963 msg_print("ÆÍÁ³¤Û¤È¤ó¤É¸ÉÆȤˤʤ俵¤¤¬¤¹¤ë¡£");
2965 msg_print("You suddenly feel almost lonely.");
2968 banish_monsters(100);
2969 if (!dun_level && p_ptr->town_num)
2972 msg_print("Ź¤Î¼ç¿Í¤¬µÖ¤Ë¸þ¤«¤Ã¤ÆÁö¤Ã¤Æ¤¤¤ë¡ª");
2974 msg_print("You see one of the shopkeepers running for the hills!");
2977 store_shuffle(randint0(MAX_STORES));
2982 if ((p_ptr->muta2 & MUT2_EAT_LIGHT) && one_in_(3000))
2987 msg_print("±Æ¤Ë¤Ä¤Ä¤Þ¤ì¤¿¡£");
2989 msg_print("A shadow passes over you.");
2994 /* Absorb light from the current possition */
2995 if (cave[py][px].info & CAVE_GLOW)
3000 o_ptr = &inventory[INVEN_LITE];
3002 /* Absorb some fuel in the current lite */
3003 if (o_ptr->tval == TV_LITE)
3005 /* Use some fuel (except on artifacts) */
3006 if (!artifact_p(o_ptr) && (o_ptr->xtra4 > 0))
3008 /* Heal the player a bit */
3009 hp_player(o_ptr->xtra4 / 20);
3011 /* Decrease life-span of lite */
3015 msg_print("¸÷¸»¤«¤é¥¨¥Í¥ë¥®¡¼¤òµÛ¼ý¤·¤¿¡ª");
3017 msg_print("You absorb energy from your light!");
3021 /* Notice interesting fuel steps */
3022 notice_lite_change(o_ptr);
3027 * Unlite the area (radius 10) around player and
3028 * do 50 points damage to every affected monster
3030 unlite_area(50, 10);
3033 if ((p_ptr->muta2 & MUT2_ATT_ANIMAL) &&
3034 !p_ptr->anti_magic && one_in_(7000))
3036 bool pet = one_in_(3);
3037 u32b mode = PM_ALLOW_GROUP;
3039 if (pet) mode |= PM_FORCE_PET;
3040 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
3042 if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_ANIMAL, mode))
3045 msg_print("ưʪ¤ò°ú¤´ó¤»¤¿¡ª");
3047 msg_print("You have attracted an animal!");
3054 if ((p_ptr->muta2 & MUT2_RAW_CHAOS) &&
3055 !p_ptr->anti_magic && one_in_(8000))
3059 msg_print("¼þ¤ê¤Î¶õ´Ö¤¬ÏĤó¤Ç¤¤¤ëµ¤¤¬¤¹¤ë¡ª");
3061 msg_print("You feel the world warping around you!");
3065 fire_ball(GF_CHAOS, 0, p_ptr->lev, 8);
3067 if ((p_ptr->muta2 & MUT2_NORMALITY) && one_in_(5000))
3069 if (!lose_mutation(0))
3071 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
3073 msg_print("You feel oddly normal.");
3077 if ((p_ptr->muta2 & MUT2_WRAITH) && !p_ptr->anti_magic && one_in_(3000))
3081 msg_print("Èóʪ¼Á²½¤·¤¿¡ª");
3083 msg_print("You feel insubstantial!");
3087 set_wraith_form(randint1(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE);
3089 if ((p_ptr->muta2 & MUT2_POLY_WOUND) && one_in_(3000))
3093 if ((p_ptr->muta2 & MUT2_WASTING) && one_in_(3000))
3095 int which_stat = randint0(6);
3096 int sustained = FALSE;
3101 if (p_ptr->sustain_str) sustained = TRUE;
3104 if (p_ptr->sustain_int) sustained = TRUE;
3107 if (p_ptr->sustain_wis) sustained = TRUE;
3110 if (p_ptr->sustain_dex) sustained = TRUE;
3113 if (p_ptr->sustain_con) sustained = TRUE;
3116 if (p_ptr->sustain_chr) sustained = TRUE;
3120 msg_print("ÉÔÀµ¤Ê¾õÂÖ¡ª");
3122 msg_print("Invalid stat chosen!");
3132 msg_print("¼«Ê¬¤¬¿ê¼å¤·¤Æ¤¤¤¯¤Î¤¬Ê¬¤«¤ë¡ª");
3134 msg_print("You can feel yourself wasting away!");
3138 (void)dec_stat(which_stat, randint1(6) + 6, one_in_(3));
3141 if ((p_ptr->muta2 & MUT2_ATT_DRAGON) &&
3142 !p_ptr->anti_magic && one_in_(3000))
3144 bool pet = one_in_(5);
3145 u32b mode = PM_ALLOW_GROUP;
3147 if (pet) mode |= PM_FORCE_PET;
3148 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
3150 if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_DRAGON, mode))
3153 msg_print("¥É¥é¥´¥ó¤ò°ú¤´ó¤»¤¿¡ª");
3155 msg_print("You have attracted a dragon!");
3161 if ((p_ptr->muta2 & MUT2_WEIRD_MIND) && !p_ptr->anti_magic &&
3164 if (p_ptr->tim_esp > 0)
3167 msg_print("Àº¿À¤Ë¤â¤ä¤¬¤«¤«¤Ã¤¿¡ª");
3169 msg_print("Your mind feels cloudy!");
3172 set_tim_esp(0, TRUE);
3177 msg_print("Àº¿À¤¬¹¤¬¤Ã¤¿¡ª");
3179 msg_print("Your mind expands!");
3182 set_tim_esp(p_ptr->lev, FALSE);
3185 if ((p_ptr->muta2 & MUT2_NAUSEA) && !p_ptr->slow_digest &&
3190 msg_print("°ß¤¬áÛÚ»¤·¡¢¿©»ö¤ò¼º¤Ã¤¿¡ª");
3192 msg_print("Your stomach roils, and you lose your lunch!");
3196 set_food(PY_FOOD_WEAK);
3199 if ((p_ptr->muta2 & MUT2_WALK_SHAD) &&
3200 !p_ptr->anti_magic && one_in_(12000) && !p_ptr->inside_arena)
3205 if ((p_ptr->muta2 & MUT2_WARNING) && one_in_(1000))
3207 int danger_amount = 0;
3210 for (monster = 0; monster < m_max; monster++)
3212 monster_type *m_ptr = &m_list[monster];
3213 monster_race *r_ptr = &r_info[m_ptr->r_idx];
3215 /* Paranoia -- Skip dead monsters */
3216 if (!m_ptr->r_idx) continue;
3218 if (r_ptr->level >= p_ptr->lev)
3220 danger_amount += r_ptr->level - p_ptr->lev + 1;
3224 if (danger_amount > 100)
3226 msg_print("Èó¾ï¤Ë¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
3228 msg_print("You feel utterly terrified!");
3231 else if (danger_amount > 50)
3233 msg_print("¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
3235 msg_print("You feel terrified!");
3238 else if (danger_amount > 20)
3240 msg_print("Èó¾ï¤Ë¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
3242 msg_print("You feel very worried!");
3245 else if (danger_amount > 10)
3247 msg_print("¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
3249 msg_print("You feel paranoid!");
3252 else if (danger_amount > 5)
3254 msg_print("¤Û¤È¤ó¤É°ÂÁ´¤Êµ¤¤¬¤¹¤ë¡£");
3256 msg_print("You feel almost safe.");
3261 msg_print("¼ä¤·¤¤µ¤¤¬¤¹¤ë¡£");
3263 msg_print("You feel lonely.");
3267 if ((p_ptr->muta2 & MUT2_INVULN) && !p_ptr->anti_magic &&
3272 msg_print("̵Ũ¤Êµ¤¤¬¤¹¤ë¡ª");
3274 msg_print("You feel invincible!");
3278 (void)set_invuln(randint1(8) + 8, FALSE);
3280 if ((p_ptr->muta2 & MUT2_SP_TO_HP) && one_in_(2000))
3282 int wounds = p_ptr->mhp - p_ptr->chp;
3286 int healing = p_ptr->csp;
3288 if (healing > wounds)
3294 p_ptr->csp -= healing;
3297 if ((p_ptr->muta2 & MUT2_HP_TO_SP) && !p_ptr->anti_magic &&
3300 int wounds = p_ptr->msp - p_ptr->csp;
3304 int healing = p_ptr->chp;
3306 if (healing > wounds)
3311 p_ptr->csp += healing;
3313 take_hit(DAMAGE_LOSELIFE, healing, "Ƭ¤Ë¾º¤Ã¤¿·ì", -1);
3315 take_hit(DAMAGE_LOSELIFE, healing, "blood rushing to the head", -1);
3320 if ((p_ptr->muta2 & MUT2_DISARM) && one_in_(10000))
3326 msg_print("¤¬¤â¤Ä¤ì¤Æž¤ó¤À¡ª");
3327 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), "žÅÝ", -1);
3329 msg_print("You trip over your own feet!");
3330 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), "tripping", -1);
3335 if (buki_motteruka(INVEN_RARM))
3337 int slot = INVEN_RARM;
3338 o_ptr = &inventory[INVEN_RARM];
3339 if (buki_motteruka(INVEN_LARM) && one_in_(2))
3341 o_ptr = &inventory[INVEN_LARM];
3344 if (!cursed_p(o_ptr))
3347 msg_print("Éð´ï¤òÍ¤Æ¤·¤Þ¤Ã¤¿¡ª");
3349 msg_print("You drop your weapon!");
3352 inven_drop(slot, 1);
3359 /*** Process Inventory ***/
3361 if ((p_ptr->cursed & TRC_P_FLAG_MASK) && !p_ptr->wild_mode)
3364 * Hack: Uncursed teleporting items (e.g. Trump Weapons)
3365 * can actually be useful!
3367 if ((p_ptr->cursed & TRC_TELEPORT_SELF) && one_in_(200))
3370 if (get_check_strict("¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©", CHECK_OKAY_CANCEL))
3372 if (get_check_strict("Teleport? ", CHECK_OKAY_CANCEL))
3376 teleport_player(50);
3379 /* Make a chainsword noise */
3380 if ((p_ptr->cursed & TRC_CHAINSWORD) && one_in_(CHAINSWORD_NOISE))
3384 if (!get_rnd_line("chainswd_j.txt", 0, noise))
3386 if (!get_rnd_line("chainswd.txt", 0, noise))
3389 disturb(FALSE, FALSE);
3392 if ((p_ptr->cursed & TRC_TY_CURSE) && one_in_(TY_CURSE_CHANCE))
3395 (void)activate_ty_curse(FALSE, &count);
3397 /* Handle experience draining */
3398 if ((p_ptr->cursed & TRC_DRAIN_EXP) && one_in_(4))
3400 p_ptr->exp -= (p_ptr->lev+1)/2;
3401 if (p_ptr->exp < 0) p_ptr->exp = 0;
3402 p_ptr->max_exp -= (p_ptr->lev+1)/2;
3403 if (p_ptr->max_exp < 0) p_ptr->max_exp = 0;
3406 /* Add light curse (Later) */
3407 if ((p_ptr->cursed & TRC_ADD_L_CURSE) && one_in_(2000))
3412 o_ptr = choose_cursed_obj_name(TRC_ADD_L_CURSE);
3414 new_curse = get_curse(0, o_ptr);
3415 if (!(o_ptr->curse_flags & new_curse))
3417 char o_name[MAX_NLEN];
3419 object_desc(o_name, o_ptr, FALSE, 0);
3421 o_ptr->curse_flags |= new_curse;
3423 msg_format("°°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬%s¤ò¤È¤ê¤Þ¤¤¤¿...", o_name);
3425 msg_format("There is a malignant black aura surrounding %s...", o_name);
3428 o_ptr->feeling = FEEL_NONE;
3430 p_ptr->update |= (PU_BONUS);
3433 /* Add heavy curse (Later) */
3434 if ((p_ptr->cursed & TRC_ADD_H_CURSE) && one_in_(2000))
3439 o_ptr = choose_cursed_obj_name(TRC_ADD_H_CURSE);
3441 new_curse = get_curse(1, o_ptr);
3442 if (!(o_ptr->curse_flags & new_curse))
3444 char o_name[MAX_NLEN];
3446 object_desc(o_name, o_ptr, FALSE, 0);
3448 o_ptr->curse_flags |= new_curse;
3450 msg_format("°°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬%s¤ò¤È¤ê¤Þ¤¤¤¿...", o_name);
3452 msg_format("There is a malignant black aura surrounding %s...", o_name);
3455 o_ptr->feeling = FEEL_NONE;
3457 p_ptr->update |= (PU_BONUS);
3461 if ((p_ptr->cursed & TRC_CALL_ANIMAL) && one_in_(2500))
3463 if (summon_specific(0, py, px, dun_level, SUMMON_ANIMAL,
3464 (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
3466 char o_name[MAX_NLEN];
3468 object_desc(o_name, choose_cursed_obj_name(TRC_CALL_ANIMAL), FALSE, 0);
3470 msg_format("%s¤¬Æ°Êª¤ò°ú¤´ó¤»¤¿¡ª", o_name);
3472 msg_format("%s have attracted an animal!", o_name);
3479 if ((p_ptr->cursed & TRC_CALL_DEMON) && one_in_(1111))
3481 if (summon_specific(0, py, px, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
3483 char o_name[MAX_NLEN];
3485 object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DEMON), FALSE, 0);
3487 msg_format("%s¤¬°Ëâ¤ò°ú¤´ó¤»¤¿¡ª", o_name);
3489 msg_format("%s have attracted a demon!", o_name);
3496 if ((p_ptr->cursed & TRC_CALL_DRAGON) && one_in_(800))
3498 if (summon_specific(0, py, px, dun_level, SUMMON_DRAGON,
3499 (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
3501 char o_name[MAX_NLEN];
3503 object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DRAGON), FALSE, 0);
3505 msg_format("%s¤¬¥É¥é¥´¥ó¤ò°ú¤´ó¤»¤¿¡ª", o_name);
3507 msg_format("%s have attracted an animal!", o_name);
3513 if ((p_ptr->cursed & TRC_COWARDICE) && one_in_(1500))
3515 if (!(p_ptr->resist_fear || p_ptr->hero || p_ptr->shero))
3519 msg_print("¤È¤Æ¤â°Å¤¤... ¤È¤Æ¤â¶²¤¤¡ª");
3521 msg_print("It's so dark... so scary!");
3524 set_afraid(p_ptr->afraid + 13 + randint1(26));
3527 /* Teleport player */
3528 if ((p_ptr->cursed & TRC_TELEPORT) && one_in_(200) && !p_ptr->anti_tele)
3532 /* Teleport player */
3533 teleport_player(40);
3535 /* Handle HP draining */
3536 if ((p_ptr->cursed & TRC_DRAIN_HP) && one_in_(666))
3538 char o_name[MAX_NLEN];
3540 object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_HP), FALSE, 0);
3542 msg_format("%s¤Ï¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª", o_name);
3544 msg_format("%s drains HP from you!", o_name);
3546 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev*2, 100), o_name, -1);
3548 /* Handle mana draining */
3549 if ((p_ptr->cursed & TRC_DRAIN_MANA) && one_in_(666))
3551 char o_name[MAX_NLEN];
3553 object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_MANA), FALSE, 0);
3555 msg_format("%s¤Ï¤¢¤Ê¤¿¤ÎËâÎϤòµÛ¼ý¤·¤¿¡ª", o_name);
3557 msg_format("%s drains mana from you!", o_name);
3559 p_ptr->csp -= MIN(p_ptr->lev, 50);
3563 p_ptr->csp_frac = 0;
3565 p_ptr->redraw |= PR_MANA;
3569 /* Rarely, take damage from the Jewel of Judgement */
3570 if (one_in_(999) && !p_ptr->anti_magic)
3572 if ((inventory[INVEN_LITE].tval) &&
3573 (inventory[INVEN_LITE].sval == SV_LITE_THRAIN))
3576 msg_print("¡Ø¿³È½¤ÎÊõÀС٤Ϥ¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª");
3577 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "¿³È½¤ÎÊõÀÐ", -1);
3579 msg_print("The Jewel of Judgement drains life from you!");
3580 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "the Jewel of Judgement", -1);
3587 /* Process equipment */
3588 for (j = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
3590 /* Get the object */
3591 o_ptr = &inventory[i];
3593 /* Skip non-objects */
3594 if (!o_ptr->k_idx) continue;
3596 /* Recharge activatable objects */
3597 if (o_ptr->timeout > 0)
3602 /* Notice changes */
3603 if (!o_ptr->timeout)
3605 recharged_notice(o_ptr);
3611 /* Notice changes */
3615 p_ptr->window |= (PW_EQUIP);
3620 * Recharge rods. Rods now use timeout to control charging status,
3621 * and each charging rod in a stack decreases the stack's timeout by
3622 * one per turn. -LM-
3624 for (j = 0, i = 0; i < INVEN_PACK; i++)
3626 o_ptr = &inventory[i];
3627 k_ptr = &k_info[o_ptr->k_idx];
3629 /* Skip non-objects */
3630 if (!o_ptr->k_idx) continue;
3632 /* Examine all charging rods or stacks of charging rods. */
3633 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
3635 /* Determine how many rods are charging. */
3636 temp = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
3637 if (temp > o_ptr->number) temp = o_ptr->number;
3639 /* Decrease timeout by that number. */
3640 o_ptr->timeout -= temp;
3642 /* Boundary control. */
3643 if (o_ptr->timeout < 0) o_ptr->timeout = 0;
3645 /* Notice changes, provide message if object is inscribed. */
3646 if (!(o_ptr->timeout))
3648 recharged_notice(o_ptr);
3654 /* Notice changes */
3658 p_ptr->notice |= (PN_COMBINE);
3661 p_ptr->window |= (PW_INVEN);
3665 /* Feel the inventory */
3670 /*** Process Objects ***/
3672 /* Process objects */
3673 for (i = 1; i < o_max; i++)
3678 /* Skip dead objects */
3679 if (!o_ptr->k_idx) continue;
3681 /* Recharge rods on the ground. No messages. */
3682 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
3685 o_ptr->timeout -= o_ptr->number;
3687 /* Boundary control. */
3688 if (o_ptr->timeout < 0) o_ptr->timeout = 0;
3693 /*** Involuntary Movement ***/
3695 /* Delayed Word-of-Recall */
3696 if (p_ptr->word_recall)
3699 * HACK: Autosave BEFORE resetting the recall counter (rr9)
3700 * The player is yanked up/down as soon as
3701 * he loads the autosaved game.
3703 if (autosave_l && (p_ptr->word_recall == 1) && !p_ptr->inside_battle)
3704 do_cmd_save_game(TRUE);
3706 /* Count down towards recall */
3707 p_ptr->word_recall--;
3709 p_ptr->redraw |= (PR_STATUS);
3711 /* Activate the recall */
3712 if (!p_ptr->word_recall)
3717 /* Determine the level */
3718 if (dun_level || p_ptr->inside_quest)
3721 msg_print("¾å¤Ë°ú¤ÃÄ¥¤ê¤¢¤²¤é¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
3723 msg_print("You feel yourself yanked upwards!");
3726 p_ptr->recall_dungeon = dungeon_type;
3728 do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
3733 leave_quest_check();
3735 p_ptr->inside_quest = 0;
3736 p_ptr->leaving = TRUE;
3741 msg_print("²¼¤Ë°ú¤¤º¤ê¹ß¤í¤µ¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
3743 msg_print("You feel yourself yanked downwards!");
3746 dungeon_type = p_ptr->recall_dungeon;
3749 do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
3752 dun_level = max_dlv[dungeon_type];
3753 if (dun_level < 1) dun_level = 1;
3755 /* Nightmare mode makes recall more dangerous */
3756 if (ironman_nightmare && !randint0(666) && (dungeon_type == DUNGEON_ANGBAND))
3762 else if (dun_level < 99)
3764 dun_level = (dun_level + 99) / 2;
3766 else if (dun_level > 100)
3768 dun_level = d_info[dungeon_type].maxdepth - 1;
3772 if (p_ptr->wild_mode)
3774 p_ptr->wilderness_y = py;
3775 p_ptr->wilderness_x = px;
3779 /* Save player position */
3783 p_ptr->wild_mode = FALSE;
3786 p_ptr->leaving = TRUE;
3788 if (dungeon_type == DUNGEON_ANGBAND)
3790 for (i = MIN_RANDOM_QUEST; i < MAX_RANDOM_QUEST + 1; i++)
3792 if ((quest[i].type == QUEST_TYPE_RANDOM) &&
3793 (quest[i].status == QUEST_STATUS_TAKEN) &&
3794 (quest[i].level < dun_level))
3796 quest[i].status = QUEST_STATUS_FAILED;
3797 quest[i].complev = (byte)p_ptr->lev;
3798 r_info[quest[i].r_idx].flags1 &= ~(RF1_QUESTOR);
3805 sound(SOUND_TPLEVEL);
3813 * Verify use of "wizard" mode
3815 static bool enter_wizard_mode(void)
3817 /* Ask first time */
3818 if (!p_ptr->noscore)
3820 /* Mention effects */
3822 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥â¡¼¥É¤Ç¤¹¡£ ");
3823 msg_print("°ìÅÙ¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ë¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3825 msg_print("Wizard mode is for debugging and experimenting.");
3826 msg_print("The game will not be scored if you enter wizard mode.");
3831 /* Verify request */
3833 if (!get_check("ËÜÅö¤Ë¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ê¤¿¤¤¤Î¤Ç¤¹¤«? "))
3835 if (!get_check("Are you sure you want to enter wizard mode? "))
3843 p_ptr->noscore |= 0x0002;
3854 * Verify use of "debug" commands
3856 static bool enter_debug_mode(void)
3858 /* Ask first time */
3859 if (!p_ptr->noscore)
3861 /* Mention effects */
3863 msg_print("¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ ");
3864 msg_print("¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3866 msg_print("The debug commands are for debugging and experimenting.");
3867 msg_print("The game will not be scored if you use debug commands.");
3872 /* Verify request */
3874 if (!get_check("ËÜÅö¤Ë¥Ç¥Ð¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? "))
3876 if (!get_check("Are you sure you want to use debug commands? "))
3884 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥Ç¥Ð¥Ã¥°¥â¡¼¥É¤ËÆÍÆþ¤·¤Æ¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
3886 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use debug commands.");
3889 p_ptr->noscore |= 0x0008;
3897 * Hack -- Declare the Debug Routines
3899 extern void do_cmd_debug(void);
3901 #endif /* ALLOW_WIZARD */
3907 * Verify use of "borg" commands
3909 static bool enter_borg_mode(void)
3911 /* Ask first time */
3912 if (!(p_ptr->noscore & 0x0010))
3914 /* Mention effects */
3916 msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ ");
3917 msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
3919 msg_print("The borg commands are for debugging and experimenting.");
3920 msg_print("The game will not be scored if you use borg commands.");
3925 /* Verify request */
3927 if (!get_check("ËÜÅö¤Ë¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? "))
3929 if (!get_check("Are you sure you want to use borg commands? "))
3937 p_ptr->noscore |= 0x0010;
3945 * Hack -- Declare the Ben Borg
3947 extern void do_cmd_borg(void);
3949 #endif /* ALLOW_BORG */
3954 * Parse and execute the current command
3955 * Give "Warning" on illegal commands.
3957 * XXX XXX XXX Make some "blocks"
3959 static void process_command(void)
3961 int old_now_message = now_message;
3963 #ifdef ALLOW_REPEAT /* TNB */
3965 /* Handle repeating the last command */
3968 #endif /* ALLOW_REPEAT -- TNB */
3972 /* Parse the command */
3973 switch (command_cmd)
3989 /*** Wizard Commands ***/
3991 /* Toggle Wizard Mode */
3996 p_ptr->wizard = FALSE;
3998 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É²ò½ü¡£");
4000 msg_print("Wizard mode off.");
4004 else if (enter_wizard_mode())
4006 p_ptr->wizard = TRUE;
4008 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥ÉÆÍÆþ¡£");
4010 msg_print("Wizard mode on.");
4015 /* Update monsters */
4016 p_ptr->update |= (PU_MONSTERS);
4018 /* Redraw "title" */
4019 p_ptr->redraw |= (PR_TITLE);
4027 /* Special "debug" commands */
4030 /* Enter debug mode */
4031 if (enter_debug_mode())
4038 #endif /* ALLOW_WIZARD */
4043 /* Special "borg" commands */
4046 /* Enter borg mode */
4047 if (enter_borg_mode())
4049 if (!p_ptr->wild_mode) do_cmd_borg();
4055 #endif /* ALLOW_BORG */
4059 /*** Inventory Commands ***/
4061 /* Wear/wield equipment */
4064 if (!p_ptr->wild_mode) do_cmd_wield();
4068 /* Take off equipment */
4071 if (!p_ptr->wild_mode) do_cmd_takeoff();
4078 if (!p_ptr->wild_mode) do_cmd_drop();
4082 /* Destroy an item */
4089 /* Equipment list */
4096 /* Inventory list */
4104 /*** Various commands ***/
4106 /* Identify an object */
4113 /* Hack -- toggle windows */
4116 toggle_inven_equip();
4121 /*** Standard "Movement" Commands ***/
4126 if (!p_ptr->wild_mode) do_cmd_alter();
4133 if (!p_ptr->wild_mode) do_cmd_tunnel();
4137 /* Move (usually pick up things) */
4140 #ifdef ALLOW_EASY_DISARM /* TNB */
4144 #else /* ALLOW_EASY_DISARM -- TNB */
4146 do_cmd_walk(always_pickup);
4148 #endif /* ALLOW_EASY_DISARM -- TNB */
4153 /* Move (usually do not pick up) */
4156 #ifdef ALLOW_EASY_DISARM /* TNB */
4160 #else /* ALLOW_EASY_DISARM -- TNB */
4162 do_cmd_walk(!always_pickup);
4164 #endif /* ALLOW_EASY_DISARM -- TNB */
4170 /*** Running, Resting, Searching, Staying */
4172 /* Begin Running -- Arg is Max Distance */
4175 if (!p_ptr->wild_mode) do_cmd_run();
4179 /* Stay still (usually pick things up) */
4182 do_cmd_stay(always_pickup);
4186 /* Stay still (usually do not pick up) */
4189 do_cmd_stay(!always_pickup);
4193 /* Rest -- Arg is time */
4200 /* Search for traps/doors */
4207 /* Toggle search mode */
4210 if (p_ptr->action == ACTION_SEARCH) set_action(ACTION_NONE);
4211 else set_action(ACTION_SEARCH);
4216 /*** Stairs and Doors and Chests and Traps ***/
4219 case SPECIAL_KEY_STORE:
4221 if (!p_ptr->wild_mode) do_cmd_store();
4225 /* Enter building -KMW- */
4226 case SPECIAL_KEY_BUILDING:
4228 if (!p_ptr->wild_mode) do_cmd_bldg();
4232 /* Enter quest level -KMW- */
4233 case SPECIAL_KEY_QUEST:
4235 if (!p_ptr->wild_mode) do_cmd_quest();
4239 /* Go up staircase */
4242 if(!p_ptr->wild_mode && !dun_level && !p_ptr->inside_arena && !p_ptr->inside_quest)
4249 msg_print("½±·â¤«¤éƨ¤²¤ë¤Ë¤Ï¥Þ¥Ã¥×¤Îü¤Þ¤Ç°ÜÆ°¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£");
4251 msg_print("To flee the ambush you have to reach the edge of the map.");
4254 else if (p_ptr->food < PY_FOOD_WEAK)
4257 msg_print("¤½¤ÎÁ°¤Ë¿©»ö¤ò¤È¤é¤Ê¤¤¤È¡£");
4259 msg_print("You must eat something here.");
4264 if (change_wild_mode())
4277 /* Go down staircase */
4280 if(!p_ptr->wild_mode) do_cmd_go_down();
4283 p_ptr->wilderness_x = px;
4284 p_ptr->wilderness_y = py;
4290 /* Open a door or chest */
4293 if (!p_ptr->wild_mode) do_cmd_open();
4300 if (!p_ptr->wild_mode) do_cmd_close();
4304 /* Jam a door with spikes */
4307 if (!p_ptr->wild_mode) do_cmd_spike();
4314 if (!p_ptr->wild_mode) do_cmd_bash();
4318 /* Disarm a trap or chest */
4321 if (!p_ptr->wild_mode) do_cmd_disarm();
4326 /*** Magic and Prayers ***/
4328 /* Gain new spells/prayers */
4331 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4333 msg_print("¼öʸ¤ò³Ø½¬¤¹¤ëɬÍפϤʤ¤¡ª");
4335 msg_print("You don't have to learn spells!");
4337 else if (p_ptr->pclass == CLASS_SAMURAI)
4338 do_cmd_gain_hissatsu();
4339 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4349 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
4350 (p_ptr->pclass == CLASS_BERSERKER) ||
4351 (p_ptr->pclass == CLASS_NINJA) ||
4352 (p_ptr->pclass == CLASS_MIRROR_MASTER)
4353 ) do_cmd_mind_browse();
4354 else if (p_ptr->pclass == CLASS_SMITH)
4356 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4357 do_cmd_magic_eater(TRUE);
4358 else do_cmd_browse();
4366 if (!p_ptr->wild_mode)
4368 if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_ARCHER) || (p_ptr->pclass == CLASS_CAVALRY))
4371 msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4373 msg_print("You cannot cast spells!");
4376 else if (dun_level && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
4379 msg_print("¥À¥ó¥¸¥ç¥ó¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4381 msg_print("The dungeon absorbs all attempted magic!");
4385 else if (p_ptr->anti_magic && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
4389 cptr which_power = "ËâË¡";
4391 cptr which_power = "magic";
4393 if (p_ptr->pclass == CLASS_MINDCRAFTER)
4395 which_power = "ĶǽÎÏ";
4397 which_power = "psionic powers";
4399 else if (p_ptr->pclass == CLASS_IMITATOR)
4401 which_power = "¤â¤Î¤Þ¤Í";
4403 which_power = "imitation";
4405 else if (p_ptr->pclass == CLASS_SAMURAI)
4407 which_power = "ɬ»¦·õ";
4409 which_power = "hissatsu";
4411 else if (p_ptr->pclass == CLASS_MIRROR_MASTER)
4413 which_power = "¶ÀËâË¡";
4415 which_power = "mirror magic";
4417 else if (p_ptr->pclass == CLASS_NINJA)
4419 which_power = "Ǧ½Ñ";
4421 which_power = "ninjutsu";
4423 else if (mp_ptr->spell_book == TV_LIFE_BOOK)
4425 which_power = "µ§¤ê";
4427 which_power = "prayer";
4431 msg_format("È¿ËâË¡¥Ð¥ê¥¢¤¬%s¤ò¼ÙË⤷¤¿¡ª", which_power);
4433 msg_format("An anti-magic shell disrupts your %s!", which_power);
4437 else if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER))
4440 msg_format("¶¸Àï»Î²½¤·¤Æ¤¤¤ÆƬ¤¬²ó¤é¤Ê¤¤¡ª");
4442 msg_format("You cannot think directly!");
4448 if ((p_ptr->pclass == CLASS_MINDCRAFTER) ||
4449 (p_ptr->pclass == CLASS_BERSERKER) ||
4450 (p_ptr->pclass == CLASS_NINJA) ||
4451 (p_ptr->pclass == CLASS_MIRROR_MASTER)
4454 else if (p_ptr->pclass == CLASS_IMITATOR)
4456 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4457 do_cmd_magic_eater(FALSE);
4458 else if (p_ptr->pclass == CLASS_SAMURAI)
4460 else if (p_ptr->pclass == CLASS_BLUE_MAGE)
4461 do_cmd_cast_learned();
4462 else if (p_ptr->pclass == CLASS_SMITH)
4471 /* Issue a pet command */
4474 if (!p_ptr->wild_mode) do_cmd_pet();
4478 /*** Use various objects ***/
4480 /* Inscribe an object */
4487 /* Uninscribe an object */
4490 do_cmd_uninscribe();
4494 /* Activate an artifact */
4497 if (!p_ptr->wild_mode)
4499 if (!p_ptr->inside_arena)
4504 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4506 msg_print("The arena absorbs all attempted magic!");
4522 /* Fuel your lantern/torch */
4532 if (!p_ptr->wild_mode) do_cmd_fire();
4539 if (!p_ptr->wild_mode)
4549 if (!p_ptr->wild_mode)
4551 if (!p_ptr->inside_arena)
4556 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4558 msg_print("The arena absorbs all attempted magic!");
4570 if (!p_ptr->wild_mode)
4572 if (p_ptr->inside_arena)
4575 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4577 msg_print("The arena absorbs all attempted magic!");
4582 else if (use_command && rogue_like_commands)
4594 /* Quaff a potion */
4597 if (!p_ptr->wild_mode)
4599 if (!p_ptr->inside_arena)
4600 do_cmd_quaff_potion();
4604 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4606 msg_print("The arena absorbs all attempted magic!");
4618 if (!p_ptr->wild_mode)
4620 if (!p_ptr->inside_arena)
4621 do_cmd_read_scroll();
4625 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4627 msg_print("The arena absorbs all attempted magic!");
4639 if (!p_ptr->wild_mode)
4641 if (p_ptr->inside_arena)
4644 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4646 msg_print("The arena absorbs all attempted magic!");
4651 else if (use_command && !rogue_like_commands)
4661 /* Use racial power */
4664 if (!p_ptr->wild_mode) do_cmd_racial_power();
4669 /*** Looking at Things (nearby or on map) ***/
4671 /* Full dungeon map */
4678 /* Locate player on map */
4692 /* Target monster or location */
4695 if (!p_ptr->wild_mode) do_cmd_target();
4701 /*** Help and Such ***/
4710 /* Identify symbol */
4713 do_cmd_query_symbol();
4717 /* Character description */
4720 do_cmd_change_name();
4725 /*** System Commands ***/
4727 /* Hack -- User interface */
4734 /* Single line from a pref file */
4749 do_cmd_edit_autopick();
4753 /* Interact with macros */
4760 /* Interact with visuals */
4768 /* Interact with colors */
4776 /* Interact with options */
4784 /*** Misc Commands ***/
4800 /* Repeat level feeling */
4803 if (!p_ptr->wild_mode) do_cmd_feeling();
4807 /* Show previous message */
4810 do_cmd_message_one();
4814 /* Show previous messages */
4817 do_cmd_messages(old_now_message);
4821 /* Show quest status -KMW- */
4824 do_cmd_checkquest();
4828 /* Redraw the screen */
4831 now_message = old_now_message;
4836 #ifndef VERIFY_SAVEFILE
4838 /* Hack -- Save and don't quit */
4841 do_cmd_save_game(FALSE);
4845 #endif /* VERIFY_SAVEFILE */
4855 case SPECIAL_KEY_QUIT:
4857 do_cmd_save_and_exit();
4861 /* Quit (commit suicide) */
4874 /* Check artifacts, uniques, objects */
4881 /* Load "screen dump" */
4884 do_cmd_load_screen();
4888 /* Save "screen dump" */
4891 do_cmd_save_screen();
4895 /* Make random artifact list */
4898 spoil_random_artifact("randifact.txt");
4902 /* Hack -- Unknown command */
4905 if (flush_failure) flush();
4909 sound(SOUND_ILLEGAL);
4911 if (!get_rnd_line("error_j.txt", 0, error_m))
4913 if (!get_rnd_line("error.txt", 0, error_m))
4920 prt(" '?' ¤Ç¥Ø¥ë¥×¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£", 0, 0);
4922 prt("Type '?' for help.", 0, 0);
4928 if (!energy_use && !now_message)
4929 now_message = old_now_message;
4935 static bool monster_tsuri(int r_idx)
4937 monster_race *r_ptr = &r_info[r_idx];
4939 if ((r_ptr->flags7 & RF7_AQUATIC) && !(r_ptr->flags1 & RF1_UNIQUE) && strchr("Jjlw", r_ptr->d_char))
4947 * Process the player
4949 * Notice the annoying code to handle "pack overflow", which
4950 * must come first just in case somebody manages to corrupt
4951 * the savefiles by clever use of menu commands or something.
4953 static void process_player(void)
4957 /*** Apply energy ***/
4962 msg_print("²¿¤«ÊѤï¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
4964 msg_print("You feel different!");
4967 (void)gain_random_mutation(0);
4968 hack_mutation = FALSE;
4971 if (p_ptr->inside_battle)
4973 for(i = 1; i < m_max; i++)
4975 monster_type *m_ptr = &m_list[i];
4977 if (!m_ptr->r_idx) continue;
4979 /* Hack -- Detect monster */
4980 m_ptr->mflag |= (MFLAG_MARK | MFLAG_SHOW);
4982 /* Update the monster */
4983 update_mon(i, FALSE);
4988 /* Give the player some energy */
4989 else if (!(load && p_ptr->energy_need <= 0))
4991 p_ptr->energy_need -= (p_ptr->pspeed > 199 ? 49 : (p_ptr->pspeed < 0 ? 1 : extract_energy[p_ptr->pspeed]));
4995 if (p_ptr->energy_need > 0) return;
4996 if (!command_rep) prt_time();
4998 /*** Check for interupts ***/
5000 /* Complete resting */
5007 if ((p_ptr->chp == p_ptr->mhp) &&
5008 (p_ptr->csp >= p_ptr->msp))
5010 set_action(ACTION_NONE);
5014 /* Complete resting */
5015 else if (resting == -2)
5018 if ((p_ptr->chp == p_ptr->mhp) &&
5019 (p_ptr->csp >= p_ptr->msp) &&
5020 !p_ptr->blind && !p_ptr->confused &&
5021 !p_ptr->poisoned && !p_ptr->afraid &&
5022 !p_ptr->stun && !p_ptr->cut &&
5023 !p_ptr->slow && !p_ptr->paralyzed &&
5024 !p_ptr->image && !p_ptr->word_recall)
5026 set_action(ACTION_NONE);
5031 if (p_ptr->action == ACTION_FISH)
5034 Term_xtra(TERM_XTRA_DELAY, 10);
5038 bool success = FALSE;
5039 get_mon_num_prep(monster_tsuri,NULL);
5040 r_idx = get_mon_num(dun_level ? dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level);
5042 if (r_idx && one_in_(2))
5045 y = py+ddy[tsuri_dir];
5046 x = px+ddx[tsuri_dir];
5047 if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE))
5050 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
5052 msg_format("%s¤¬Äà¤ì¤¿¡ª", m_name);
5054 msg_format("You have a good catch!", m_name);
5062 msg_print("±Â¤À¤±¿©¤ï¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª¤¯¤Ã¤½¡Á¡ª");
5064 msg_print("Damn! The fish stole your bait!");
5071 /* Handle "abort" */
5074 /* Check for "player abort" (semi-efficiently for resting) */
5075 if (running || command_rep || (p_ptr->action == ACTION_REST) || (p_ptr->action == ACTION_FISH))
5080 /* Check for a key */
5089 /* Hack -- Show a Message */
5091 msg_print("ÃæÃǤ·¤Þ¤·¤¿¡£");
5093 msg_print("Canceled.");
5100 if (p_ptr->riding && !p_ptr->confused && !p_ptr->blind)
5102 monster_type *m_ptr = &m_list[p_ptr->riding];
5111 /* Acquire the monster name */
5112 monster_desc(m_name, m_ptr, 0);
5114 msg_format("%^s¤òµ¯¤³¤·¤¿¡£", m_name);
5116 msg_format("You have waked %s up.", m_name);
5118 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5119 p_ptr->redraw |= (PR_UHEALTH);
5126 /* Make a "saving throw" against stun */
5127 if (randint0(r_info[m_ptr->r_idx].level) < p_ptr->skill_exp[GINOU_RIDING])
5133 /* Hack -- Recover from stun */
5134 if (m_ptr->stunned > d)
5136 /* Recover somewhat */
5137 m_ptr->stunned -= d;
5148 /* Acquire the monster name */
5149 monster_desc(m_name, m_ptr, 0);
5151 /* Dump a message */
5153 msg_format("%^s¤òÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5155 msg_format("%^s is no longer stunned.", m_name);
5157 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5158 p_ptr->redraw |= (PR_UHEALTH);
5162 if (m_ptr->confused)
5166 /* Make a "saving throw" against stun */
5167 if (randint0(r_info[m_ptr->r_idx].level) < p_ptr->skill_exp[GINOU_RIDING])
5170 d = m_ptr->confused;
5173 /* Hack -- Recover from stun */
5174 if (m_ptr->confused > d)
5176 /* Recover somewhat */
5177 m_ptr->confused -= d;
5186 m_ptr->confused = 0;
5188 /* Acquire the monster name */
5189 monster_desc(m_name, m_ptr, 0);
5191 /* Dump a message */
5193 msg_format("%^s¤òº®Íð¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5195 msg_format("%^s is no longer confused.", m_name);
5197 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5198 p_ptr->redraw |= (PR_UHEALTH);
5206 /* Make a "saving throw" against stun */
5207 if (randint0(r_info[m_ptr->r_idx].level) < p_ptr->skill_exp[GINOU_RIDING])
5213 /* Hack -- Recover from stun */
5214 if (m_ptr->monfear > d)
5216 /* Recover somewhat */
5217 m_ptr->monfear -= d;
5228 /* Acquire the monster name */
5229 monster_desc(m_name, m_ptr, 0);
5231 /* Dump a message */
5233 msg_format("%^s¤ò¶²Éݤ«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5235 msg_format("%^s is no longer fear.", m_name);
5237 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5238 p_ptr->redraw |= (PR_UHEALTH);
5245 /* Handle the player song */
5246 if (!load) check_music();
5251 if (p_ptr->lightspeed)
5253 (void)set_lightspeed(p_ptr->lightspeed - 1, TRUE);
5255 if ((p_ptr->pclass == CLASS_FORCETRAINER) && (p_ptr->magic_num1[0]))
5257 if (p_ptr->magic_num1[0] < 40)
5259 p_ptr->magic_num1[0] = 0;
5261 else p_ptr->magic_num1[0] -= 40;
5262 p_ptr->update |= (PU_BONUS);
5264 if (p_ptr->action == ACTION_LEARN)
5266 int hoge = ((p_ptr->msp * 0x10000L) / 256L)+7680L;
5267 if ((p_ptr->csp * 0x10000L + p_ptr->csp_frac) < hoge)
5270 p_ptr->csp_frac = 0;
5271 set_action(ACTION_NONE);
5275 p_ptr->csp -= (s16b)(hoge >> 16);
5277 if (p_ptr->csp_frac < hoge)
5279 p_ptr->csp_frac += 0x10000L - hoge;
5283 p_ptr->csp_frac -= hoge;
5285 p_ptr->redraw |= PR_MANA;
5288 if (p_ptr->special_defense & KATA_MASK)
5290 if (p_ptr->special_defense & KATA_MUSOU)
5294 set_action(ACTION_NONE);
5299 p_ptr->redraw |= (PR_MANA);
5304 /*** Handle actual user input ***/
5306 /* Repeat until out of energy */
5307 while (p_ptr->energy_need <= 0)
5309 p_ptr->window |= PW_PLAYER;
5310 p_ptr->sutemi = FALSE;
5311 p_ptr->counter = FALSE;
5312 now_damaged = FALSE;
5314 /* Notice stuff (if needed) */
5315 if (p_ptr->notice) notice_stuff();
5317 /* Update stuff (if needed) */
5318 if (p_ptr->update) update_stuff();
5320 /* Redraw stuff (if needed) */
5321 if (p_ptr->redraw) redraw_stuff();
5323 /* Redraw stuff (if needed) */
5324 if (p_ptr->window) window_stuff();
5327 /* Place the cursor on the player */
5328 move_cursor_relative(py, px);
5330 /* Refresh (optional) */
5331 if (fresh_before) Term_fresh();
5334 /* Hack -- Pack Overflow */
5335 if (inventory[INVEN_PACK].k_idx)
5337 int item = INVEN_PACK;
5339 char o_name[MAX_NLEN];
5343 /* Access the slot to be dropped */
5344 o_ptr = &inventory[item];
5351 msg_print("¥¶¥Ã¥¯¤«¤é¥¢¥¤¥Æ¥à¤¬¤¢¤Õ¤ì¤¿¡ª");
5353 msg_print("Your pack overflows!");
5358 object_desc(o_name, o_ptr, TRUE, 3);
5362 msg_format("%s(%c)¤òÍî¤È¤·¤¿¡£", o_name, index_to_label(item));
5364 msg_format("You drop %s (%c).", o_name, index_to_label(item));
5368 /* Drop it (carefully) near the player */
5369 (void)drop_near(o_ptr, 0, py, px);
5371 /* Modify, Describe, Optimize */
5372 inven_item_increase(item, -255);
5373 inven_item_describe(item);
5374 inven_item_optimize(item);
5376 /* Notice stuff (if needed) */
5377 if (p_ptr->notice) notice_stuff();
5379 /* Update stuff (if needed) */
5380 if (p_ptr->update) update_stuff();
5382 /* Redraw stuff (if needed) */
5383 if (p_ptr->redraw) redraw_stuff();
5385 /* Redraw stuff (if needed) */
5386 if (p_ptr->window) window_stuff();
5390 /* Hack -- cancel "lurking browse mode" */
5391 if (!command_new) command_see = FALSE;
5394 /* Assume free turn */
5398 if (p_ptr->inside_battle)
5400 /* Place the cursor on the player */
5401 move_cursor_relative(py, px);
5405 /* Process the command */
5409 /* Paralyzed or Knocked Out */
5410 else if (p_ptr->paralyzed || (p_ptr->stun >= 100))
5417 else if (p_ptr->action == ACTION_REST)
5422 /* Reduce rest count */
5425 if (!resting) set_action(ACTION_NONE);
5427 /* Redraw the state */
5428 p_ptr->redraw |= (PR_STATE);
5436 else if (p_ptr->action == ACTION_FISH)
5449 /* Repeated command */
5450 else if (command_rep)
5452 /* Count this execution */
5455 /* Redraw the state */
5456 p_ptr->redraw |= (PR_STATE);
5461 /* Hack -- Assume messages were seen */
5464 /* Clear the top line */
5467 /* Process the command */
5471 /* Normal command */
5474 /* Place the cursor on the player */
5475 move_cursor_relative(py, px);
5478 /* Get a command (normal) */
5479 request_command(FALSE);
5482 /* Process the command */
5492 /* Use some energy */
5494 p_ptr->energy_need += (s16b)((s32b)energy_use * ENERGY_NEED() / 100L);
5496 p_ptr->energy_need += energy_use * TURNS_PER_TICK / 10;
5498 /* Hack -- constant hallucination */
5499 if (p_ptr->image) p_ptr->redraw |= (PR_MAP);
5502 /* Shimmer monsters if needed */
5503 if (shimmer_monsters)
5505 /* Clear the flag */
5506 shimmer_monsters = FALSE;
5508 /* Shimmer multi-hued monsters */
5509 for (i = 1; i < m_max; i++)
5511 monster_type *m_ptr;
5512 monster_race *r_ptr;
5514 /* Access monster */
5517 /* Skip dead monsters */
5518 if (!m_ptr->r_idx) continue;
5520 /* Access the monster race */
5521 r_ptr = &r_info[m_ptr->r_idx];
5523 /* Skip non-multi-hued monsters */
5524 if (!(r_ptr->flags1 & RF1_ATTR_MULTI)) continue;
5526 /* Reset the flag */
5527 shimmer_monsters = TRUE;
5529 /* Redraw regardless */
5530 lite_spot(m_ptr->fy, m_ptr->fx);
5535 /* Handle monster detection */
5536 if (repair_monsters)
5538 /* Reset the flag */
5539 repair_monsters = FALSE;
5541 /* Rotate detection flags */
5542 for (i = 1; i < m_max; i++)
5544 monster_type *m_ptr;
5546 /* Access monster */
5549 /* Skip dead monsters */
5550 if (!m_ptr->r_idx) continue;
5552 /* Nice monsters get mean */
5553 if (m_ptr->mflag & MFLAG_NICE)
5555 /* Nice monsters get mean */
5556 m_ptr->mflag &= ~(MFLAG_NICE);
5559 /* Handle memorized monsters */
5560 if (m_ptr->mflag & MFLAG_MARK)
5562 /* Maintain detection */
5563 if (m_ptr->mflag & MFLAG_SHOW)
5566 m_ptr->mflag &= ~(MFLAG_SHOW);
5568 /* Still need repairs */
5569 repair_monsters = TRUE;
5572 /* Remove detection */
5576 m_ptr->mflag &= ~(MFLAG_MARK);
5578 /* Assume invisible */
5581 /* Update the monster */
5582 update_mon(i, FALSE);
5584 if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH);
5585 if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH);
5587 /* Redraw regardless */
5588 lite_spot(m_ptr->fy, m_ptr->fx);
5593 if (p_ptr->pclass == CLASS_IMITATOR)
5595 if (p_ptr->mane_num > (p_ptr->lev > 44 ? 3 : p_ptr->lev > 29 ? 2 : 1))
5598 for (i = 0; i < p_ptr->mane_num; i++)
5600 p_ptr->mane_spell[i] = p_ptr->mane_spell[i+1];
5601 p_ptr->mane_dam[i] = p_ptr->mane_dam[i+1];
5605 p_ptr->redraw |= (PR_MANE);
5607 if (p_ptr->action == ACTION_LEARN)
5610 p_ptr->redraw |= (PR_STATE);
5613 if (world_player && (p_ptr->energy_need > - 1000))
5616 p_ptr->redraw |= (PR_MAP);
5618 /* Update monsters */
5619 p_ptr->update |= (PU_MONSTERS);
5622 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5625 msg_print("¡Ö»þ¤ÏÆ°¤¤À¤¹¡Ä¡×");
5627 msg_print("You feel time flowing around you once more.");
5630 world_player = FALSE;
5631 p_ptr->energy_need = ENERGY_NEED();
5637 /* Hack -- notice death */
5638 if (!p_ptr->playing || p_ptr->is_dead)
5640 world_player = FALSE;
5644 /* Handle "leaving" */
5645 if (p_ptr->leaving) break;
5648 /* Update scent trail */
5654 * Interact with the current dungeon level.
5656 * This function will not exit until the level is completed,
5657 * the user dies, or the game is terminated.
5659 static void dungeon(bool load_game)
5661 int quest_num = 0, i, num;
5663 /* Set the base level */
5664 base_level = dun_level;
5666 /* Reset various flags */
5670 p_ptr->leaving = FALSE;
5672 /* Reset the "command" vars */
5680 /* Cancel the target */
5684 ambush_flag = FALSE;
5686 /* Cancel the health bar */
5689 /* Check visual effects */
5690 shimmer_monsters = TRUE;
5691 shimmer_objects = TRUE;
5692 repair_monsters = TRUE;
5693 repair_objects = TRUE;
5699 /* Get index of current quest (if any) */
5700 quest_num = quest_number(dun_level);
5702 /* Inside a quest? */
5705 /* Mark the quest monster */
5706 r_info[quest[quest_num].r_idx].flags1 |= RF1_QUESTOR;
5709 /* Track maximum player level */
5710 if (p_ptr->max_plv < p_ptr->lev)
5712 p_ptr->max_plv = p_ptr->lev;
5716 /* Track maximum dungeon level (if not in quest -KMW-) */
5717 if ((max_dlv[dungeon_type] < dun_level) && !p_ptr->inside_quest)
5719 max_dlv[dungeon_type] = dun_level;
5720 if (record_maxdeapth) do_cmd_write_nikki(NIKKI_MAXDEAPTH, dun_level, NULL);
5723 /* No stairs down from Quest */
5724 if (quest_number(dun_level))
5726 create_down_stair = 0;
5729 /* Paranoia -- no stairs from town or wilderness */
5730 if (!dun_level) create_down_stair = create_up_stair = 0;
5732 /* Option -- no connected stairs */
5733 if (!dungeon_stair) create_down_stair = create_up_stair = 0;
5735 /* Option -- no up stairs */
5736 if (ironman_downward) create_down_stair = create_up_stair = 0;
5738 /* Make a stairway. */
5739 if (create_up_stair || create_down_stair)
5741 /* Place a stairway */
5742 if (cave_valid_bold(py, px))
5745 delete_object(py, px);
5748 if (create_down_stair)
5750 if (create_down_stair == 2) cave_set_feat(py, px, FEAT_MORE_MORE);
5751 else cave_set_feat(py, px, FEAT_MORE);
5755 if (create_up_stair == 2) cave_set_feat(py, px, FEAT_LESS_LESS);
5756 else cave_set_feat(py, px, FEAT_LESS);
5760 /* Cancel the stair request */
5761 create_down_stair = create_up_stair = 0;
5764 /* Validate the panel */
5765 panel_bounds_center();
5767 /* Verify the panel */
5770 /* Flush messages */
5774 /* Enter "xtra" mode */
5775 character_xtra = TRUE;
5778 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
5781 p_ptr->window |= (PW_MONSTER);
5783 /* Redraw dungeon */
5784 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY);
5787 p_ptr->redraw |= (PR_MAP);
5790 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5793 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
5795 /* Calculate torch radius */
5796 p_ptr->update |= (PU_TORCH);
5808 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_DISTANCE | PU_MON_LITE);
5809 p_ptr->update |= (PU_MONSTERS);/*¼«Ê¬¤Ç¸÷¤Ã¤Æ¤¤¤ë¥â¥ó¥¹¥¿¡¼¤Î°Ù */
5817 /* Leave "xtra" mode */
5818 character_xtra = FALSE;
5821 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
5823 /* Combine / Reorder the pack */
5824 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
5841 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();
5843 if (p_ptr->inside_battle)
5847 p_ptr->energy_need = 0;
5854 msg_print("»î¹ç³«»Ï¡ª");
5856 msg_format("Ready..Fight!");
5862 if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] > MUSIC_DETECT))
5863 p_ptr->magic_num1[0] = MUSIC_DETECT;
5865 /* Hack -- notice death or departure */
5866 if (!p_ptr->playing || p_ptr->is_dead) return;
5868 /* Print quest message if appropriate */
5869 if (!p_ptr->inside_quest && (dungeon_type == DUNGEON_ANGBAND))
5871 quest_discovery(random_quest_number(dun_level));
5872 p_ptr->inside_quest = random_quest_number(dun_level);
5874 if ((dun_level == d_info[dungeon_type].maxdepth) && d_info[dungeon_type].final_guardian)
5876 if (r_info[d_info[dungeon_type].final_guardian].max_num)
5878 msg_format("¤³¤Î³¬¤Ë¤Ï%s¤Î¼ç¤Ç¤¢¤ë%s¤¬À³¤ó¤Ç¤¤¤ë¡£",
5879 d_name+d_info[dungeon_type].name,
5880 r_name+r_info[d_info[dungeon_type].final_guardian].name);
5882 msg_format("%^s lives in this level as the keeper of %s.",
5883 r_name+r_info[d_info[dungeon_type].final_guardian].name,
5884 d_name+d_info[dungeon_type].name);
5888 /*** Process this dungeon level ***/
5890 /* Reset the monster generation level */
5891 monster_level = base_level;
5893 /* Reset the object generation level */
5894 object_level = base_level;
5898 if (p_ptr->energy_need > 0 && !p_ptr->inside_battle &&
5899 (dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena))
5900 p_ptr->energy_need = 0;
5902 /* Not leaving dungeon */
5903 p_ptr->leaving_dungeon = FALSE;
5908 int i, correct_inven_cnt = 0;
5910 /* Hack -- Compact the monster list occasionally */
5911 if ((m_cnt + 32 > max_m_idx) && !p_ptr->inside_battle) compact_monsters(64);
5913 /* Hack -- Compress the monster list occasionally */
5914 if ((m_cnt + 32 < m_max) && !p_ptr->inside_battle) compact_monsters(0);
5917 /* Hack -- Compact the object list occasionally */
5918 if (o_cnt + 32 > max_o_idx) compact_objects(64);
5920 /* Hack -- Compress the object list occasionally */
5921 if (o_cnt + 32 < o_max) compact_objects(0);
5924 /* Process the player */
5928 if (p_ptr->notice) notice_stuff();
5931 for (i = 0; i < INVEN_PACK; i++)
5933 object_type *j_ptr = &inventory[i];
5935 /* Skip non-objects */
5936 if (!j_ptr->k_idx) continue;
5938 correct_inven_cnt++;
5942 if (p_ptr->update) update_stuff();
5945 if (p_ptr->redraw) redraw_stuff();
5948 if (p_ptr->window) window_stuff();
5950 /* Hack -- Hilite the player */
5951 move_cursor_relative(py, px);
5953 /* Optional fresh */
5954 if (fresh_after) Term_fresh();
5956 /* Hack -- Notice death or departure */
5957 if (!p_ptr->playing || p_ptr->is_dead) break;
5959 /* Process all of the monsters */
5963 if (p_ptr->notice) notice_stuff();
5966 if (p_ptr->update) update_stuff();
5969 if (p_ptr->redraw) redraw_stuff();
5972 if (p_ptr->window) window_stuff();
5974 /* Hack -- Hilite the player */
5975 move_cursor_relative(py, px);
5977 /* Optional fresh */
5978 if (fresh_after) Term_fresh();
5980 /* Hack -- Notice death or departure */
5981 if (!p_ptr->playing || p_ptr->is_dead) break;
5984 /* Process the world */
5988 if (p_ptr->notice) notice_stuff();
5991 if (p_ptr->update) update_stuff();
5994 if (p_ptr->redraw) redraw_stuff();
5997 if (p_ptr->window) window_stuff();
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;
6008 /* Handle "leaving" */
6009 if (p_ptr->leaving) break;
6011 /* Count game turns */
6013 if (!p_ptr->wild_mode || wild_regen) dungeon_turn++;
6014 else if (p_ptr->wild_mode && !(turn % ((MAX_HGT + MAX_WID) / 2))) dungeon_turn++;
6015 if (wild_regen) wild_regen--;
6018 /* Inside a quest and non-unique questor? */
6019 if (quest_num && !(r_info[quest[quest_num].r_idx].flags1 & RF1_UNIQUE))
6021 /* Un-mark the quest monster */
6022 r_info[quest[quest_num].r_idx].flags1 &= ~RF1_QUESTOR;
6025 /* Not save-and-quit and not dead? */
6026 if (p_ptr->playing && !p_ptr->is_dead)
6028 for(num = 0; num < 21; num++)
6030 party_mon[num].r_idx = 0;
6035 COPY(&party_mon[0], &m_list[p_ptr->riding], monster_type);
6038 for(i = m_max - 1, num = 1; (i >= 1 && num < 21); i--)
6040 monster_type *m_ptr = &m_list[i];
6042 if (!m_ptr->r_idx) continue;
6043 if (!is_pet(m_ptr)) continue;
6044 if (i == p_ptr->riding) continue;
6046 if (m_ptr->nickname && (player_has_los_bold(m_ptr->fy, m_ptr->fx) || los(m_ptr->fy, m_ptr->fx, py, px)))
6048 if (distance(py, px, m_ptr->fy, m_ptr->fx) > 3) continue;
6052 if (distance(py, px, m_ptr->fy, m_ptr->fx) > 1) continue;
6054 if (m_ptr->confused || m_ptr->stunned || m_ptr->csleep) continue;
6056 COPY(&party_mon[num], &m_list[i], monster_type);
6057 delete_monster_idx(i);
6060 if (record_named_pet)
6062 for (i = m_max - 1; i >=1; i--)
6064 monster_type *m_ptr = &m_list[i];
6067 if (!m_ptr->r_idx) continue;
6068 if (!is_pet(m_ptr)) continue;
6069 if (!m_ptr->nickname) continue;
6070 if (p_ptr->riding == i) continue;
6072 monster_desc(m_name, m_ptr, 0x88);
6073 do_cmd_write_nikki(NIKKI_NAMED_PET, 4, m_name);
6083 * Load some "user pref files"
6085 * Modified by Arcum Dagsson to support
6086 * separate macro files for different realms.
6088 static void load_all_pref_files(void)
6093 /* Access the "user" pref file */
6094 sprintf(buf, "user.prf");
6096 /* Process that file */
6097 process_pref_file(buf);
6099 /* Access the "user" system pref file */
6100 sprintf(buf, "user-%s.prf", ANGBAND_SYS);
6102 /* Process that file */
6103 process_pref_file(buf);
6105 /* Access the "race" pref file */
6106 sprintf(buf, "%s.prf", rp_ptr->title);
6108 /* Process that file */
6109 process_pref_file(buf);
6111 /* Access the "class" pref file */
6112 sprintf(buf, "%s.prf", cp_ptr->title);
6114 /* Process that file */
6115 process_pref_file(buf);
6117 /* Access the "character" pref file */
6118 sprintf(buf, "%s.prf", player_base);
6120 /* Process that file */
6121 process_pref_file(buf);
6123 /* Free old entries */
6127 sprintf(buf, "picktype-%s.prf", player_base);
6129 sprintf(buf, "pickpref-%s.prf", player_base);
6132 err = process_pickpref_file(buf);
6134 /* Process 'pick????.prf' if 'pick????-<name>.prf' doesn't exist */
6138 process_pickpref_file("picktype.prf");
6140 process_pickpref_file("pickpref.prf");
6144 /* Access the "realm 1" pref file */
6145 if (p_ptr->realm1 != REALM_NONE)
6147 sprintf(buf, "%s.prf", realm_names[p_ptr->realm1]);
6149 /* Process that file */
6150 process_pref_file(buf);
6153 /* Access the "realm 2" pref file */
6154 if (p_ptr->realm2 != REALM_NONE)
6156 sprintf(buf, "%s.prf", realm_names[p_ptr->realm2]);
6158 /* Process that file */
6159 process_pref_file(buf);
6165 * Actually play a game
6167 * If the "new_game" parameter is true, then, after loading the
6168 * savefile, we will commit suicide, if necessary, to allow the
6169 * player to start a new game.
6171 void play_game(bool new_game)
6174 bool load_game = TRUE;
6184 hack_mutation = FALSE;
6186 /* Hack -- Character is "icky" */
6187 character_icky = TRUE;
6189 /* Make sure main term is active */
6190 Term_activate(angband_term[0]);
6192 /* Initialise the resize hooks */
6193 angband_term[0]->resize_hook = resize_map;
6195 for (i = 1; i < 8; i++)
6197 /* Does the term exist? */
6198 if (angband_term[i])
6200 /* Add the redraw on resize hook */
6201 angband_term[i]->resize_hook = redraw_window;
6205 /* Hack -- turn off the cursor */
6206 (void)Term_set_cursor(0);
6209 /* Attempt to load */
6214 quit("¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤¬²õ¤ì¤Æ¤¤¤Þ¤¹");
6216 quit("broken savefile");
6221 /* Extract the options */
6222 for (i = 0; option_info[i].o_desc; i++)
6224 int os = option_info[i].o_set;
6225 int ob = option_info[i].o_bit;
6227 /* Set the "default" options */
6228 if (option_info[i].o_var)
6231 if (option_flag[os] & (1L << ob))
6234 (*option_info[i].o_var) = TRUE;
6241 (*option_info[i].o_var) = FALSE;
6246 /* Report waited score */
6247 if (p_ptr->wait_report_score)
6253 if (!get_check_strict("ÂÔµ¡¤·¤Æ¤¤¤¿¥¹¥³¥¢ÅÐÏ¿¤òº£¹Ô¤Ê¤¤¤Þ¤¹¤«¡©", CHECK_NO_HISTORY))
6255 if (!get_check_strict("Do you register score now? ", CHECK_NO_HISTORY))
6260 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
6265 p_ptr->is_dead = TRUE;
6267 start_time = time(NULL);
6269 /* No suspending now */
6270 signals_ignore_tstp();
6272 /* Hack -- Character is now "icky" */
6273 character_icky = TRUE;
6275 /* Build the filename */
6276 path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
6278 /* Open the high score file, for reading/writing */
6279 highscore_fd = fd_open(buf, O_RDWR);
6281 /* Handle score, show Top scores */
6282 success = send_world_score(TRUE);
6285 if (!success && !get_check_strict("¥¹¥³¥¢ÅÐÏ¿¤òÄü¤á¤Þ¤¹¤«¡©", CHECK_NO_HISTORY))
6287 if (!success && !get_check_strict("Do you give up score registration? ", CHECK_NO_HISTORY))
6291 prt("°ú¤Â³¤ÂÔµ¡¤·¤Þ¤¹¡£", 0, 0);
6293 prt("standing by for future registration...", 0, 0);
6299 p_ptr->wait_report_score = FALSE;
6302 if (!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
6304 if (!save_player()) msg_print("death save failed!");
6307 /* Shut the high score file */
6308 (void)fd_close(highscore_fd);
6310 /* Forget the high score fd */
6313 /* Allow suspending now */
6314 signals_handle_tstp();
6319 /* Nothing loaded */
6320 if (!character_loaded)
6322 /* Make new player */
6325 /* The dungeon is not ready */
6326 character_dungeon = FALSE;
6328 /* Prepare to init the RNG */
6332 /* Process old character */
6335 /* Process the player name */
6336 process_player_name(FALSE);
6345 seed = (time(NULL));
6349 /* Mutate the seed on Unix machines */
6350 seed = ((seed >> 3) * (getpid() << 1));
6354 /* Use the complex RNG */
6357 /* Seed the "complex" RNG */
6358 Rand_state_init(seed);
6361 /* Roll new character */
6364 monster_race *r_ptr;
6366 /* The dungeon is not ready */
6367 character_dungeon = FALSE;
6371 p_ptr->inside_quest = 0;
6372 p_ptr->inside_arena = FALSE;
6373 p_ptr->inside_battle = FALSE;
6377 /* Hack -- seed for flavors */
6378 seed_flavor = randint0(0x10000000);
6380 /* Hack -- seed for town layout */
6381 seed_town = randint0(0x10000000);
6383 /* Roll up a new character */
6390 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "ÊÕ¶¤ÎÃϤ˹ߤêΩ¤Ã¤¿¡£");
6392 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "You are standing in the Outpost.");
6396 get_mon_num_prep(NULL, NULL);
6397 for (i = 0; i < MAX_KUBI; i++)
6403 kubi_r_idx[i] = get_mon_num(MAX_DEPTH - 1);
6404 r_ptr = &r_info[kubi_r_idx[i]];
6406 if(!(r_ptr->flags1 & RF1_UNIQUE)) continue;
6408 if(!(r_ptr->flags9 & RF9_DROP_CORPSE)) continue;
6409 if (r_ptr->rarity > 100) continue;
6411 if(r_ptr->flags6 & RF6_SPECIAL) continue;
6413 for (j = 0; j < i; j++)
6414 if (kubi_r_idx[i] == kubi_r_idx[j])break;
6419 for (i = 0; i < MAX_KUBI -1; i++)
6422 for (j = i; j < MAX_KUBI; j++)
6424 if (r_info[kubi_r_idx[i]].level > r_info[kubi_r_idx[j]].level)
6426 tmp = kubi_r_idx[i];
6427 kubi_r_idx[i] = kubi_r_idx[j];
6428 kubi_r_idx[j] = tmp;
6433 p_ptr->inside_battle = TRUE;
6436 today_mon = get_mon_num(3);
6437 r_ptr = &r_info[today_mon];
6439 if (r_ptr->flags1 & RF1_UNIQUE) continue;
6440 if (r_ptr->flags2 & (RF2_MULTIPLY)) continue;
6441 if (!(r_ptr->flags9 & RF9_DROP_CORPSE) || !(r_ptr->flags9 & RF9_DROP_SKELETON)) continue;
6442 if (r_ptr->rarity > 10) continue;
6443 if (r_ptr->level == 0) continue;
6446 p_ptr->inside_battle = FALSE;
6450 write_level = FALSE;
6453 do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ----¥²¡¼¥àºÆ³«----");
6455 do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ---- Restart Game ----");
6459 * 1.0.9 °ÊÁ°¤Ï¥»¡¼¥ÖÁ°¤Ë p_ptr->riding = -1 ¤È¤·¤Æ¤¤¤¿¤Î¤Ç¡¢ºÆÀßÄ꤬ɬÍפÀ¤Ã¤¿¡£
6460 * ¤â¤¦ÉÔÍפÀ¤¬¡¢°ÊÁ°¤Î¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤È¤Î¸ß´¹¤Î¤¿¤á¤Ë»Ä¤·¤Æ¤ª¤¯¡£
6462 if (p_ptr->riding == -1)
6465 for(i = m_max; i > 0; i--)
6467 if ((m_list[i].fy == py) && (m_list[i].fx == px))
6476 p_ptr->teleport_town = FALSE;
6477 p_ptr->sutemi = FALSE;
6478 world_monster = FALSE;
6479 now_damaged = FALSE;
6481 start_time = time(NULL) - 1;
6482 record_o_name[0] = '\0';
6484 /* Reset map panel */
6485 panel_row_min = cur_hgt;
6486 panel_col_min = cur_wid;
6488 /* Sexy gal gets bonus to maximum weapon skill of whip */
6489 if(p_ptr->pseikaku == SEIKAKU_SEXY)
6490 s_info[p_ptr->pclass].w_max[TV_HAFTED-TV_BOW][SV_WHIP] = 8000;
6492 /* Fill the arrays of floors and walls in the good proportions */
6493 for (i = 0; i < 100; i++)
6495 int lim1, lim2, lim3;
6497 lim1 = d_info[dungeon_type].floor_percent1;
6498 lim2 = lim1 + d_info[dungeon_type].floor_percent2;
6499 lim3 = lim2 + d_info[dungeon_type].floor_percent3;
6502 floor_type[i] = d_info[dungeon_type].floor1;
6504 floor_type[i] = d_info[dungeon_type].floor2;
6506 floor_type[i] = d_info[dungeon_type].floor3;
6508 lim1 = d_info[dungeon_type].fill_percent1;
6509 lim2 = lim1 + d_info[dungeon_type].fill_percent2;
6510 lim3 = lim2 + d_info[dungeon_type].fill_percent3;
6512 fill_type[i] = d_info[dungeon_type].fill_type1;
6514 fill_type[i] = d_info[dungeon_type].fill_type2;
6516 fill_type[i] = d_info[dungeon_type].fill_type3;
6519 /* Flavor the objects */
6527 /* Flash a message */
6529 prt("¤ªÂÔ¤Á²¼¤µ¤¤...", 0, 0);
6531 prt("Please wait...", 0, 0);
6535 /* Flush the message */
6539 /* Hack -- Enter wizard mode */
6542 if (enter_wizard_mode()) p_ptr->wizard = TRUE;
6543 else if (p_ptr->is_dead) quit("Already dead.");
6546 /* Initialize the town-buildings if necessary */
6547 if (!dun_level && !p_ptr->inside_quest)
6549 /* Init the wilderness */
6551 process_dungeon_file("w_info_j.txt", 0, 0, max_wild_y, max_wild_x);
6554 init_flags = INIT_ONLY_BUILDINGS;
6556 process_dungeon_file("t_info_j.txt", 0, 0, MAX_HGT, MAX_WID);
6561 /* Initialize vault info */
6563 if (init_v_info()) quit("·úÃÛʪ½é´ü²½ÉÔǽ");
6565 if (init_v_info()) quit("Cannot initialize vaults");
6568 /* Generate a dungeon level if needed */
6569 if (!character_dungeon) generate_cave();
6572 /* Character is now "complete" */
6573 character_generated = TRUE;
6576 /* Hack -- Character is no longer "icky" */
6577 character_icky = FALSE;
6581 p_ptr->playing = TRUE;
6583 /* Reset the visual mappings */
6586 /* Load the "pref" files */
6587 load_all_pref_files();
6589 /* React to changes */
6590 Term_xtra(TERM_XTRA_REACT, 0);
6593 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
6596 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
6602 /* Set or clear "rogue_like_commands" if requested */
6603 if (arg_force_original) rogue_like_commands = FALSE;
6604 if (arg_force_roguelike) rogue_like_commands = TRUE;
6606 /* Hack -- Enforce "delayed death" */
6607 if (p_ptr->chp < 0) p_ptr->is_dead = TRUE;
6609 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
6611 if (new_game && ((p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BEASTMASTER)))
6613 monster_type *m_ptr;
6614 int pet_r_idx = ((p_ptr->pclass == CLASS_CAVALRY) ? MON_HORSE : MON_YASE_HORSE);
6615 monster_race *r_ptr = &r_info[pet_r_idx];
6616 place_monster_aux(0, py, px - 1, pet_r_idx,
6617 (PM_FORCE_PET | PM_NO_KAGE));
6618 m_ptr = &m_list[hack_m_idx_ii];
6619 m_ptr->mspeed = r_ptr->speed;
6620 m_ptr->maxhp = r_ptr->hdice*(r_ptr->hside+1)/2;
6621 m_ptr->max_maxhp = m_ptr->maxhp;
6622 m_ptr->hp = r_ptr->hdice*(r_ptr->hside+1)/2;
6623 m_ptr->energy_need = ENERGY_NEED() + ENERGY_NEED();
6629 /* Process the level */
6633 if (p_ptr->notice) notice_stuff();
6636 if (p_ptr->update) update_stuff();
6639 if (p_ptr->redraw) redraw_stuff();
6642 if (p_ptr->window) window_stuff();
6645 /* Cancel the target */
6648 /* Cancel the health bar */
6652 /* Forget the lite */
6655 /* Forget the view */
6658 /* Forget the view */
6661 /* Handle "quit and save" */
6662 if (!p_ptr->playing && !p_ptr->is_dead) break;
6664 /* Erase the old cave */
6666 if (!p_ptr->is_dead) wipe_m_list();
6674 /* Accidental Death */
6675 if (p_ptr->playing && p_ptr->is_dead)
6677 if (p_ptr->inside_arena)
6679 p_ptr->inside_arena = FALSE;
6680 if(p_ptr->arena_number > MAX_ARENA_MONS)
6681 p_ptr->arena_number++;
6683 p_ptr->arena_number = 99;
6684 p_ptr->is_dead = FALSE;
6686 p_ptr->chp_frac = 0;
6687 p_ptr->exit_bldg = TRUE;
6692 /* Mega-Hack -- Allow player to cheat death */
6694 if ((p_ptr->wizard || cheat_live) && !get_check("»à¤Ë¤Þ¤¹¤«? "))
6696 if ((p_ptr->wizard || cheat_live) && !get_check("Die? "))
6700 /* Mark social class, reset age, if needed */
6701 if (p_ptr->sc) p_ptr->sc = p_ptr->age = 0;
6707 p_ptr->noscore |= 0x0001;
6711 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÇ°¤òÁ÷¤ê¡¢»à¤òµ½¤¤¤¿¡£");
6713 msg_print("You invoke wizard mode and cheat death.");
6719 /* Restore hit points */
6720 p_ptr->chp = p_ptr->mhp;
6721 p_ptr->chp_frac = 0;
6723 if (p_ptr->pclass == CLASS_MAGIC_EATER)
6725 for (i = 0; i < EATER_EXT*2; i++)
6727 p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*EATER_CHARGE;
6729 for (; i < EATER_EXT*3; i++)
6731 p_ptr->magic_num1[i] = 0;
6734 /* Restore spell points */
6735 p_ptr->csp = p_ptr->msp;
6736 p_ptr->csp_frac = 0;
6738 /* Hack -- Healing */
6740 (void)set_confused(0);
6741 (void)set_poisoned(0);
6742 (void)set_afraid(0);
6743 (void)set_paralyzed(0);
6748 /* Hack -- Prevent starvation */
6749 (void)set_food(PY_FOOD_MAX - 1);
6751 /* Hack -- cancel recall */
6752 if (p_ptr->word_recall)
6756 msg_print("Ä¥¤ê¤Ä¤á¤¿Â絤¤¬Î®¤ìµî¤Ã¤¿...");
6758 msg_print("A tension leaves the air around you...");
6763 /* Hack -- Prevent recall */
6764 p_ptr->word_recall = 0;
6765 p_ptr->redraw |= (PR_STATUS);
6768 /* Note cause of death XXX XXX XXX */
6770 (void)strcpy(p_ptr->died_from, "»à¤Îµ½¤");
6772 (void)strcpy(p_ptr->died_from, "Cheating death");
6777 p_ptr->is_dead = FALSE;
6780 p_ptr->inside_arena = FALSE;
6781 p_ptr->inside_battle = FALSE;
6783 p_ptr->inside_quest = 0;
6784 p_ptr->recall_dungeon = dungeon_type;
6786 if (lite_town || vanilla_town)
6788 p_ptr->wilderness_y = 1;
6789 p_ptr->wilderness_x = 1;
6803 p_ptr->wilderness_y = 48;
6804 p_ptr->wilderness_x = 5;
6810 p_ptr->wild_mode = FALSE;
6811 p_ptr->leaving = TRUE;
6814 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " ¤·¤«¤·¡¢À¸¤Ê֤ä¿¡£");
6816 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " but revived.");
6822 /* Handle "death" */
6823 if (p_ptr->is_dead) break;
6825 /* Make a new level */
6836 s32b turn_real(s32b hoge)
6838 if ((p_ptr->prace == RACE_VAMPIRE) ||
6839 (p_ptr->prace == RACE_SKELETON) ||
6840 (p_ptr->prace == RACE_ZOMBIE) ||
6841 (p_ptr->prace == RACE_SPECTRE))
6842 return hoge-(TURNS_PER_TICK * TOWN_DAWN *3/ 4);