4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: Angband game engine */
15 #define TY_CURSE_CHANCE 200
16 #define CHAINSWORD_NOISE 100
18 static bool load = TRUE;
19 static int wild_regen = 20;
22 * Return a "feeling" (or NULL) about an item. Method 1 (Heavy).
24 static byte value_check_aux1(object_type *o_ptr)
27 if (object_is_artifact(o_ptr))
30 if (object_is_cursed(o_ptr) || object_is_broken(o_ptr)) return FEEL_TERRIBLE;
37 if (object_is_ego(o_ptr))
40 if (object_is_cursed(o_ptr) || object_is_broken(o_ptr)) return FEEL_WORTHLESS;
43 return FEEL_EXCELLENT;
47 if (object_is_cursed(o_ptr)) return FEEL_CURSED;
50 if (object_is_broken(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 (object_is_cursed(o_ptr)) return FEEL_CURSED;
73 /* Broken items (all of them) */
74 if (object_is_broken(o_ptr)) return FEEL_BROKEN;
76 /* Artifacts -- except cursed/broken ones */
77 if (object_is_artifact(o_ptr)) return FEEL_UNCURSED;
79 /* Ego-Items -- except cursed/broken ones */
80 if (object_is_ego(o_ptr)) return FEEL_UNCURSED;
82 /* Good armor bonus */
83 if (o_ptr->to_a > 0) return FEEL_UNCURSED;
85 /* Good weapon bonuses */
86 if (o_ptr->to_h + o_ptr->to_d > 0) return FEEL_UNCURSED;
94 static void sense_inventory_aux(int slot, bool heavy)
97 object_type *o_ptr = &inventory[slot];
98 char o_name[MAX_NLEN];
100 /* We know about it already, do not tell us again */
101 if (o_ptr->ident & (IDENT_SENSE))return;
103 /* It is fully known, no information needed */
104 if (object_is_known(o_ptr)) return;
106 /* Check for a feeling */
107 feel = (heavy ? value_check_aux1(o_ptr) : value_check_aux2(o_ptr));
109 /* Skip non-feelings */
113 if ((p_ptr->muta3 & MUT3_BAD_LUCK) && !randint0(13))
124 feel = FEEL_EXCELLENT;
130 feel = randint0(3) ? FEEL_GOOD : FEEL_AVERAGE;
132 feel = FEEL_UNCURSED;
137 feel = randint0(2) ? FEEL_CURSED : FEEL_GOOD;
143 feel = randint0(3) ? FEEL_CURSED : FEEL_AVERAGE;
150 feel = FEEL_WORTHLESS;
155 feel = FEEL_TERRIBLE;
161 /* Stop everything */
162 if (disturb_minor) disturb(0, 0);
164 /* Get an object description */
165 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
167 /* Message (equipment) */
168 if (slot >= INVEN_RARM)
171 msg_format("%s%s(%c)¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
172 describe_use(slot),o_name, index_to_label(slot),game_inscriptions[feel]);
174 msg_format("You feel the %s (%c) you are %s %s %s...",
175 o_name, index_to_label(slot), describe_use(slot),
176 ((o_ptr->number == 1) ? "is" : "are"),
177 game_inscriptions[feel]);
182 /* Message (inventory) */
186 msg_format("¥¶¥Ã¥¯¤ÎÃæ¤Î%s(%c)¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
187 o_name, index_to_label(slot),game_inscriptions[feel]);
189 msg_format("You feel the %s (%c) in your pack %s %s...",
190 o_name, index_to_label(slot),
191 ((o_ptr->number == 1) ? "is" : "are"),
192 game_inscriptions[feel]);
197 /* We have "felt" it */
198 o_ptr->ident |= (IDENT_SENSE);
200 /* Set the "inscription" */
201 o_ptr->feeling = feel;
203 /* Auto-inscription/destroy */
204 autopick_alter_item(slot, destroy_feeling);
206 /* Combine / Reorder the pack (later) */
207 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
210 p_ptr->window |= (PW_INVEN | PW_EQUIP);
216 * Sense the inventory
218 * Class 0 = Warrior --> fast and heavy
219 * Class 1 = Mage --> slow and light
220 * Class 2 = Priest --> fast but light
221 * Class 3 = Rogue --> okay and heavy
222 * Class 4 = Ranger --> slow but heavy (changed!)
223 * Class 5 = Paladin --> slow but heavy
225 static void sense_inventory1(void)
228 int plev = p_ptr->lev;
233 /*** Check for "sensing" ***/
235 /* No sensing when confused */
236 if (p_ptr->confused) return;
238 /* Analyze the class */
239 switch (p_ptr->pclass)
247 if (0 != randint0(9000L / (plev * plev + 40))) return;
259 if (0 != randint0(6000L / (plev * plev + 50))) return;
269 case CLASS_HIGH_MAGE:
271 case CLASS_MAGIC_EATER:
273 /* Very bad (light) sensing */
274 if (0 != randint0(240000L / (plev + 5))) return;
283 /* Good (light) sensing */
284 if (0 != randint0(10000L / (plev * plev + 40))) return;
294 if (0 != randint0(20000L / (plev * plev + 40))) return;
306 if (0 != randint0(95000L / (plev * plev + 40))) return;
318 if (0 != randint0(77777L / (plev * plev + 40))) return;
327 case CLASS_WARRIOR_MAGE:
331 if (0 != randint0(75000L / (plev * plev + 40))) return;
337 case CLASS_MINDCRAFTER:
339 case CLASS_BLUE_MAGE:
340 case CLASS_MIRROR_MASTER:
343 if (0 != randint0(55000L / (plev * plev + 40))) return;
349 case CLASS_CHAOS_WARRIOR:
352 if (0 != randint0(80000L / (plev * plev + 40))) return;
362 case CLASS_FORCETRAINER:
365 if (0 != randint0(20000L / (plev * plev + 40))) return;
374 if (0 != randint0(20000L / ((plev+50)*(plev+50)))) return;
383 case CLASS_BEASTMASTER:
386 if (0 != randint0(65000L / (plev * plev + 40))) return;
391 case CLASS_BERSERKER:
401 if (compare_virtue(V_KNOWLEDGE, 100, VIRTUE_LARGE)) heavy = TRUE;
403 /*** Sense everything ***/
405 /* Check everything */
406 for (i = 0; i < INVEN_TOTAL; i++)
410 o_ptr = &inventory[i];
412 /* Skip empty slots */
413 if (!o_ptr->k_idx) continue;
415 /* Valid "tval" codes */
442 /* Skip non-sense machines */
445 /* Occasional failure on inventory items */
446 if ((i < INVEN_RARM) && (0 != randint0(5))) continue;
449 if ((p_ptr->muta3 & MUT3_GOOD_LUCK) && !randint0(13))
454 sense_inventory_aux(i, heavy);
459 static void sense_inventory2(void)
462 int plev = p_ptr->lev;
466 /*** Check for "sensing" ***/
468 /* No sensing when confused */
469 if (p_ptr->confused) return;
471 /* Analyze the class */
472 switch (p_ptr->pclass)
478 case CLASS_BERSERKER:
485 case CLASS_CHAOS_WARRIOR:
487 case CLASS_BEASTMASTER:
490 /* Very bad (light) sensing */
491 if (0 != randint0(240000L / (plev + 5))) return;
498 case CLASS_WARRIOR_MAGE:
503 if (0 != randint0(95000L / (plev * plev + 40))) return;
512 case CLASS_FORCETRAINER:
513 case CLASS_MINDCRAFTER:
516 if (0 != randint0(20000L / (plev * plev + 40))) return;
523 case CLASS_HIGH_MAGE:
525 case CLASS_MAGIC_EATER:
526 case CLASS_MIRROR_MASTER:
527 case CLASS_BLUE_MAGE:
530 if (0 != randint0(9000L / (plev * plev + 40))) return;
539 if (0 != randint0(20000L / ((plev+50)*(plev+50)))) return;
546 /*** Sense everything ***/
548 /* Check everything */
549 for (i = 0; i < INVEN_TOTAL; i++)
553 o_ptr = &inventory[i];
555 /* Skip empty slots */
556 if (!o_ptr->k_idx) continue;
558 /* Valid "tval" codes */
571 /* Skip non-sense machines */
574 /* Occasional failure on inventory items */
575 if ((i < INVEN_RARM) && (0 != randint0(5))) continue;
577 sense_inventory_aux(i, TRUE);
584 * Go to any level (ripped off from wiz_jump)
586 static void pattern_teleport(void)
593 if (get_check("¾¤Î³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©"))
595 if (get_check("Teleport level? "))
602 /* Only downward in ironman mode */
603 if (ironman_downward)
604 min_level = dun_level;
607 if (dungeon_type == DUNGEON_ANGBAND)
610 max_level = MAX_DEPTH - 1;
611 else if (dun_level == 100)
616 max_level = d_info[dungeon_type].maxdepth;
617 min_level = d_info[dungeon_type].mindepth;
622 sprintf(ppp, "¥Æ¥ì¥Ý¡¼¥ÈÀè:(%d-%d)", min_level, max_level);
624 sprintf(ppp, "Teleport to level (%d-%d): ", min_level, max_level);
629 sprintf(tmp_val, "%d", dun_level);
631 /* Ask for a level */
632 if (!get_string(ppp, tmp_val, 10)) return;
634 /* Extract request */
635 command_arg = atoi(tmp_val);
638 else if (get_check("Ä̾ï¥Æ¥ì¥Ý¡¼¥È¡©"))
640 else if (get_check("Normal teleport? "))
644 teleport_player(200, FALSE);
653 if (command_arg < min_level) command_arg = min_level;
656 if (command_arg > max_level) command_arg = max_level;
660 msg_format("%d ³¬¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤·¤¿¡£", command_arg);
662 msg_format("You teleport to dungeon level %d.", command_arg);
666 if (autosave_l) do_cmd_save_game(TRUE);
669 dun_level = command_arg;
673 if (record_stair) do_cmd_write_nikki(NIKKI_PAT_TELE,0,NULL);
675 p_ptr->inside_quest = 0;
679 * Clear all saved floors
680 * and create a first saved floor
682 prepare_change_floor_mode(CFM_FIRST_FLOOR);
685 p_ptr->leaving = TRUE;
689 static void wreck_the_pattern(void)
691 int to_ruin = 0, r_y, r_x;
692 int pattern_type = f_info[cave[py][px].feat].power;
694 if (pattern_type == PATTERN_TILE_WRECKED)
701 msg_print("¥Ñ¥¿¡¼¥ó¤ò·ì¤Ç±ø¤·¤Æ¤·¤Þ¤Ã¤¿¡ª");
702 msg_print("²¿¤«¶²¤í¤·¤¤»ö¤¬µ¯¤³¤Ã¤¿¡ª");
704 msg_print("You bleed on the Pattern!");
705 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);
715 to_ruin = randint1(45) + 35;
719 scatter(&r_y, &r_x, py, px, 4, 0);
721 if (pattern_tile(r_y, r_x) &&
722 (f_info[cave[r_y][r_x].feat].power != PATTERN_TILE_WRECKED))
724 cave_set_feat(r_y, r_x, FEAT_PATTERN_XTRA2);
728 cave_set_feat(py, px, FEAT_PATTERN_XTRA2);
732 /* Returns TRUE if we are on the Pattern... */
733 static bool pattern_effect(void)
737 if (!pattern_tile(py, px)) return FALSE;
739 if ((prace_is_(RACE_AMBERITE)) &&
740 (p_ptr->cut > 0) && one_in_(10))
745 pattern_type = f_info[cave[py][px].feat].power;
747 switch (pattern_type)
749 case PATTERN_TILE_END:
750 (void)set_poisoned(0);
756 (void)do_res_stat(A_STR);
757 (void)do_res_stat(A_INT);
758 (void)do_res_stat(A_WIS);
759 (void)do_res_stat(A_DEX);
760 (void)do_res_stat(A_CON);
761 (void)do_res_stat(A_CHR);
762 (void)restore_level();
763 (void)hp_player(1000);
765 cave_set_feat(py, px, FEAT_PATTERN_OLD);
768 msg_print("¡Ö¥Ñ¥¿¡¼¥ó¡×¤Î¤³¤ÎÉôʬ¤Ï¾¤ÎÉôʬ¤è¤ê¶¯ÎϤǤʤ¤¤è¤¦¤À¡£");
770 msg_print("This section of the Pattern looks less powerful.");
774 * We could make the healing effect of the
775 * Pattern center one-time only to avoid various kinds
776 * of abuse, like luring the win monster into fighting you
777 * in the middle of the pattern...
781 case PATTERN_TILE_OLD:
785 case PATTERN_TILE_TELEPORT:
789 case PATTERN_TILE_WRECKED:
792 take_hit(DAMAGE_NOESCAPE, 200, "²õ¤ì¤¿¡Ö¥Ñ¥¿¡¼¥ó¡×¤òÊ⤤¤¿¥À¥á¡¼¥¸", -1);
794 take_hit(DAMAGE_NOESCAPE, 200, "walking the corrupted Pattern", -1);
799 if (prace_is_(RACE_AMBERITE) && !one_in_(2))
801 else if (!IS_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)
826 if (p_ptr->special_defense & KATA_KOUKIJIN) return;
827 if (p_ptr->action == ACTION_HAYAGAKE) return;
829 /* Save the old hitpoints */
830 old_chp = p_ptr->chp;
833 * Extract the new hitpoints
835 * 'percent' is the Regen factor in unit (1/2^16)
838 new_chp_frac = (p_ptr->mhp * percent + PY_REGEN_HPBASE);
840 /* Convert the unit (1/2^16) to (1/2^32) */
841 s64b_LSHIFT(new_chp, new_chp_frac, 16);
844 s64b_add(&(p_ptr->chp), &(p_ptr->chp_frac), new_chp, new_chp_frac);
848 if (0 < s64b_cmp(p_ptr->chp, p_ptr->chp_frac, p_ptr->mhp, 0))
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
871 static void regenmana(int percent)
873 s32b old_csp = p_ptr->csp;
876 * Excess mana will decay 32 times faster than normal
879 if (p_ptr->csp > p_ptr->msp)
881 /* PY_REGEN_NORMAL is the Regen factor in unit (1/2^16) */
883 u32b decay_frac = (p_ptr->msp * 32 * PY_REGEN_NORMAL + PY_REGEN_MNBASE);
885 /* Convert the unit (1/2^16) to (1/2^32) */
886 s64b_LSHIFT(decay, decay_frac, 16);
889 s64b_sub(&(p_ptr->csp), &(p_ptr->csp_frac), decay, decay_frac);
892 if (p_ptr->csp < p_ptr->msp)
894 p_ptr->csp = p_ptr->msp;
899 /* Regenerating mana (unless the player has excess mana) */
900 else if (percent > 0)
902 /* (percent/100) is the Regen factor in unit (1/2^16) */
904 u32b new_mana_frac = (p_ptr->msp * percent / 100 + PY_REGEN_MNBASE);
906 /* Convert the unit (1/2^16) to (1/2^32) */
907 s64b_LSHIFT(new_mana, new_mana_frac, 16);
910 s64b_add(&(p_ptr->csp), &(p_ptr->csp_frac), new_mana, new_mana_frac);
912 /* Must set frac to zero even if equal */
913 if (p_ptr->csp >= p_ptr->msp)
915 p_ptr->csp = p_ptr->msp;
921 /* Reduce mana (even when the player has excess mana) */
924 /* PY_REGEN_NORMAL is the Regen factor in unit (1/2^16) */
925 s32b reduce_mana = 0;
926 u32b reduce_mana_frac = (p_ptr->msp * PY_REGEN_NORMAL + PY_REGEN_MNBASE);
928 /* Convert the unit (1/2^16) to (1/2^32) */
929 s64b_LSHIFT(reduce_mana, reduce_mana_frac, 16);
932 s64b_sub(&(p_ptr->csp), &(p_ptr->csp_frac), reduce_mana, reduce_mana_frac);
944 if (old_csp != p_ptr->csp)
947 p_ptr->redraw |= (PR_MANA);
950 p_ptr->window |= (PW_PLAYER);
951 p_ptr->window |= (PW_SPELL);
962 static void regenmagic(int percent)
967 for (i = 0; i < EATER_EXT*2; i++)
969 if (!p_ptr->magic_num2[i]) continue;
970 if (p_ptr->magic_num1[i] == ((long)p_ptr->magic_num2[i] << 16)) continue;
971 new_mana = ((long)p_ptr->magic_num2[i]+adj_mag_mana[A_INT]+13) * percent / 8;
972 p_ptr->magic_num1[i] += new_mana;
974 /* Check maximum charge */
975 if (p_ptr->magic_num1[i] > (p_ptr->magic_num2[i] << 16))
977 p_ptr->magic_num1[i] = ((long)p_ptr->magic_num2[i] << 16);
981 for (i = EATER_EXT*2; i < EATER_EXT*3; i++)
983 if (!p_ptr->magic_num1[i]) continue;
984 if (!p_ptr->magic_num2[i]) continue;
985 p_ptr->magic_num1[i] -= (long)(p_ptr->magic_num2[i] * (adj_mag_mana[A_INT] + 10)) * EATER_ROD_CHARGE/16;
986 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
997 * Regenerate the monsters (once per 100 game turns)
999 * XXX XXX XXX Should probably be done during monster turns.
1001 static void regen_monsters(void)
1006 /* Regenerate everyone */
1007 for (i = 1; i < m_max; i++)
1009 /* Check the i'th monster */
1010 monster_type *m_ptr = &m_list[i];
1011 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1014 /* Skip dead monsters */
1015 if (!m_ptr->r_idx) continue;
1017 /* Allow regeneration (if needed) */
1018 if (m_ptr->hp < m_ptr->maxhp)
1020 /* Hack -- Base regeneration */
1021 frac = m_ptr->maxhp / 100;
1023 /* Hack -- Minimal regeneration rate */
1024 if (!frac) if (one_in_(2)) frac = 1;
1026 /* Hack -- Some monsters regenerate quickly */
1027 if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2;
1029 /* Hack -- Regenerate */
1032 /* Do not over-regenerate */
1033 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
1035 /* Redraw (later) if needed */
1036 if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH);
1037 if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH);
1044 * Regenerate the captured monsters (once per 30 game turns)
1046 * XXX XXX XXX Should probably be done during monster turns.
1048 static void regen_captured_monsters(void)
1053 /* Regenerate everyone */
1054 for (i = 0; i < INVEN_TOTAL; i++)
1056 monster_race *r_ptr;
1057 object_type *o_ptr = &inventory[i];
1059 if (!o_ptr->k_idx) continue;
1060 if (o_ptr->tval != TV_CAPTURE) continue;
1061 if (!o_ptr->pval) continue;
1065 r_ptr = &r_info[o_ptr->pval];
1067 /* Allow regeneration (if needed) */
1068 if (o_ptr->xtra4 < o_ptr->xtra5)
1070 /* Hack -- Base regeneration */
1071 frac = o_ptr->xtra5 / 100;
1073 /* Hack -- Minimal regeneration rate */
1074 if (!frac) if (one_in_(2)) frac = 1;
1076 /* Hack -- Some monsters regenerate quickly */
1077 if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2;
1079 /* Hack -- Regenerate */
1080 o_ptr->xtra4 += frac;
1082 /* Do not over-regenerate */
1083 if (o_ptr->xtra4 > o_ptr->xtra5) o_ptr->xtra4 = o_ptr->xtra5;
1090 p_ptr->notice |= (PN_COMBINE);
1093 p_ptr->window |= (PW_INVEN);
1094 p_ptr->window |= (PW_EQUIP);
1101 * Process the counters of monsters (once per 10 game turns)
1103 * This function is to process monsters' counters same as player's.
1105 static void process_monsters_counters(void)
1108 monster_type *m_ptr;
1109 monster_race *r_ptr;
1112 u32b noise; /* Hack -- local "player stealth" value */
1114 /* Handle "leaving" */
1115 if (p_ptr->leaving) return;
1117 /* Hack -- calculate the "player noise" */
1118 noise = (1L << (30 - p_ptr->skill_stl));
1120 /* Process the monsters (backwards) */
1121 for (m_idx = m_max - 1; m_idx >= 1; m_idx--)
1123 /* Access the monster */
1124 m_ptr = &m_list[m_idx];
1125 r_ptr = &r_info[m_ptr->r_idx];
1127 /* Ignore "dead" monsters */
1128 if (!m_ptr->r_idx) continue;
1130 see_m = is_seen(m_ptr);
1132 /* Handle Invulnerability */
1133 if (m_ptr->invulner)
1135 /* Reduce by one, note if expires */
1138 if (!m_ptr->invulner)
1144 /* Acquire the monster name */
1145 monster_desc(m_name, m_ptr, 0);
1147 /* Dump a message */
1149 msg_format("%^s¤Ï¤â¤¦ÌµÅ¨¤Ç¤Ê¤¤¡£", m_name);
1151 msg_format("%^s is no longer invulnerable.", m_name);
1156 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
1157 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
1159 if (!p_ptr->wild_mode) m_ptr->energy_need += ENERGY_NEED();
1166 /* Reduce by one, note if expires */
1175 /* Acquire the monster name */
1176 monster_desc(m_name, m_ptr, 0);
1178 /* Dump a message */
1180 msg_format("%^s¤Ï¤â¤¦²Ã®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£", m_name);
1182 msg_format("%^s is no longer fast.", m_name);
1185 if (p_ptr->riding == m_idx) p_ptr->update |= (PU_BONUS);
1192 /* Reduce by one, note if expires */
1201 /* Acquire the monster name */
1202 monster_desc(m_name, m_ptr, 0);
1204 /* Dump a message */
1206 msg_format("%^s¤Ï¤â¤¦¸ºÂ®¤µ¤ì¤Æ¤¤¤Ê¤¤¡£", m_name);
1208 msg_format("%^s is no longer slow.", m_name);
1211 if (p_ptr->riding == m_idx) p_ptr->update |= (PU_BONUS);
1215 /* Handle "sleep" */
1218 /* Assume does not wake up */
1221 /* Hack -- Require proximity */
1222 if (m_ptr->cdis < AAF_LIMIT)
1224 /* Handle "sensing radius" */
1225 if (m_ptr->cdis <= (is_pet(m_ptr) ? ((r_ptr->aaf > MAX_SIGHT) ? MAX_SIGHT : r_ptr->aaf) : r_ptr->aaf))
1227 /* We may wake up */
1231 /* Handle "sight" and "aggravation" */
1232 else if ((m_ptr->cdis <= MAX_SIGHT) && (player_has_los_bold(m_ptr->fy, m_ptr->fx)))
1234 /* We may wake up */
1241 u32b notice = randint0(1024);
1243 /* Nightmare monsters are more alert */
1244 if (ironman_nightmare) notice /= 2;
1246 /* Hack -- See if monster "notices" player */
1247 if ((notice * notice * notice) <= noise)
1249 /* Hack -- amount of "waking" */
1250 /* Wake up faster near the player */
1251 int d = (m_ptr->cdis < AAF_LIMIT / 2) ? (AAF_LIMIT / m_ptr->cdis) : 1;
1253 /* Hack -- amount of "waking" is affected by speed of player */
1254 d = (d * SPEED_TO_ENERGY(p_ptr->pspeed)) / 10;
1258 if (m_ptr->csleep > d)
1260 /* Monster wakes up "a little bit" */
1263 /* Notice the "not waking up" */
1266 /* Hack -- Count the ignores */
1267 if (r_ptr->r_ignore < MAX_UCHAR)
1277 /* Reset sleep counter */
1280 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
1282 /* Notice the "waking up" */
1287 /* Acquire the monster name */
1288 monster_desc(m_name, m_ptr, 0);
1290 /* Dump a message */
1292 msg_format("%^s¤¬Ìܤò³Ð¤Þ¤·¤¿¡£", m_name);
1294 msg_format("%^s wakes up.", m_name);
1300 /* Redraw the health bar */
1301 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
1302 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
1304 /* Hack -- Count the wakings */
1305 if (r_ptr->r_wake < MAX_UCHAR)
1320 /* Make a "saving throw" against stun */
1321 if (randint0(10000) <= r_ptr->level * r_ptr->level)
1327 /* Hack -- Recover from stun */
1328 if (m_ptr->stunned > d)
1330 /* Recover somewhat */
1331 m_ptr->stunned -= d;
1340 /* Message if visible */
1345 /* Acquire the monster name */
1346 monster_desc(m_name, m_ptr, 0);
1348 /* Dump a message */
1350 msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
1352 msg_format("%^s is no longer stunned.", m_name);
1358 /* Handle confusion */
1359 if (m_ptr->confused)
1361 /* Amount of "boldness" */
1362 int d = randint1(r_ptr->level / 20 + 1);
1364 /* Still confused */
1365 if (m_ptr->confused > d)
1367 /* Reduce the confusion */
1368 m_ptr->confused -= d;
1374 /* No longer confused */
1375 m_ptr->confused = 0;
1377 /* Message if visible */
1382 /* Acquire the monster name */
1383 monster_desc(m_name, m_ptr, 0);
1385 /* Dump a message */
1387 msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
1389 msg_format("%^s is no longer confused.", m_name);
1398 /* Amount of "boldness" */
1399 int d = randint1(r_ptr->level / 20 + 1);
1402 if (m_ptr->monfear > d)
1404 /* Reduce the fear */
1405 m_ptr->monfear -= d;
1408 /* Recover from fear, take note if seen */
1411 /* No longer afraid */
1421 /* Acquire the monster possessive */
1422 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1425 /* Acquire the monster name */
1426 monster_desc(m_name, m_ptr, 0);
1428 /* Dump a message */
1430 msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
1432 msg_format("%^s recovers %s courage.", m_name, m_poss);
1437 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
1438 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
1446 static void notice_lite_change(object_type *o_ptr)
1448 /* Hack -- notice interesting fuel steps */
1449 if ((o_ptr->xtra4 < 100) || (!(o_ptr->xtra4 % 100)))
1452 p_ptr->window |= (PW_EQUIP);
1455 /* Hack -- Special treatment when blind */
1458 /* Hack -- save some light for later */
1459 if (o_ptr->xtra4 == 0) o_ptr->xtra4++;
1462 /* The light is now out */
1463 else if (o_ptr->xtra4 == 0)
1467 msg_print("ÌÀ¤«¤ê¤¬¾Ã¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª");
1469 msg_print("Your light has gone out!");
1472 /* Recalculate torch radius */
1473 p_ptr->update |= (PU_TORCH);
1475 /* Some ego light lose its effects without fuel */
1476 p_ptr->update |= (PU_BONUS);
1479 /* The light is getting dim */
1480 else if (o_ptr->name2 == EGO_LITE_LONG)
1482 if ((o_ptr->xtra4 < 50) && (!(o_ptr->xtra4 % 5))
1483 && (turn % (TURNS_PER_TICK*2)))
1485 if (disturb_minor) disturb(0, 0);
1487 msg_print("ÌÀ¤«¤ê¤¬Èù¤«¤Ë¤Ê¤Ã¤Æ¤¤Æ¤¤¤ë¡£");
1489 msg_print("Your light is growing faint.");
1495 /* The light is getting dim */
1496 else if ((o_ptr->xtra4 < 100) && (!(o_ptr->xtra4 % 10)))
1498 if (disturb_minor) disturb(0, 0);
1500 msg_print("ÌÀ¤«¤ê¤¬Èù¤«¤Ë¤Ê¤Ã¤Æ¤¤Æ¤¤¤ë¡£");
1502 msg_print("Your light is growing faint.");
1509 void leave_quest_check(void)
1511 /* Save quest number for dungeon pref file ($LEAVING_QUEST) */
1512 leaving_quest = p_ptr->inside_quest;
1514 /* Leaving an 'only once' quest marks it as failed */
1515 if (leaving_quest &&
1516 ((quest[leaving_quest].flags & QUEST_FLAG_ONCE) || (quest[leaving_quest].type == QUEST_TYPE_RANDOM)) &&
1517 (quest[leaving_quest].status == QUEST_STATUS_TAKEN))
1519 quest[leaving_quest].status = QUEST_STATUS_FAILED;
1520 quest[leaving_quest].complev = (byte)p_ptr->lev;
1521 if (quest[leaving_quest].type == QUEST_TYPE_RANDOM)
1523 r_info[quest[leaving_quest].r_idx].flags1 &= ~(RF1_QUESTOR);
1524 if (record_rand_quest)
1525 do_cmd_write_nikki(NIKKI_RAND_QUEST_F, leaving_quest, NULL);
1527 /* Floor of random quest will be blocked */
1528 prepare_change_floor_mode(CFM_NO_RETURN);
1530 else if (record_fix_quest)
1531 do_cmd_write_nikki(NIKKI_FIX_QUEST_F, leaving_quest, NULL);
1537 * Forcibly pseudo-identify an object in the inventory
1540 * note: currently this function allows pseudo-id of any object,
1541 * including silly ones like potions & scrolls, which always
1542 * get '{average}'. This should be changed, either to stop such
1543 * items from being pseudo-id'd, or to allow psychometry to
1544 * detect whether the unidentified potion/scroll/etc is
1545 * good (Cure Light Wounds, Restore Strength, etc) or
1546 * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
1548 bool psychometry(void)
1552 char o_name[MAX_NLEN];
1557 item_tester_no_ryoute = TRUE;
1560 q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤Þ¤¹¤«¡©";
1561 s = "Ä´¤Ù¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
1563 q = "Meditate on which item? ";
1564 s = "You have nothing appropriate.";
1567 if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
1569 /* Get the item (in the pack) */
1572 o_ptr = &inventory[item];
1575 /* Get the item (on the floor) */
1578 o_ptr = &o_list[0 - item];
1581 /* It is fully known, no information needed */
1582 if (object_is_known(o_ptr))
1585 msg_print("²¿¤â¿·¤·¤¤¤³¤È¤ÏȽ¤é¤Ê¤«¤Ã¤¿¡£");
1587 msg_print("You cannot find out anything more about that.");
1593 /* Check for a feeling */
1594 feel = value_check_aux1(o_ptr);
1596 /* Get an object description */
1597 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1599 /* Skip non-feelings */
1603 msg_format("%s¤«¤é¤ÏÆäËÊѤï¤Ã¤¿»ö¤Ï´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿¡£", o_name);
1605 msg_format("You do not perceive anything unusual about the %s.", o_name);
1612 msg_format("%s¤Ï%s¤È¤¤¤¦´¶¤¸¤¬¤¹¤ë...",
1613 o_name, game_inscriptions[feel]);
1615 msg_format("You feel that the %s %s %s...",
1616 o_name, ((o_ptr->number == 1) ? "is" : "are"),
1617 game_inscriptions[feel]);
1621 /* We have "felt" it */
1622 o_ptr->ident |= (IDENT_SENSE);
1625 o_ptr->feeling = feel;
1627 /* Combine / Reorder the pack (later) */
1628 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1631 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1633 /* Valid "tval" codes */
1634 switch (o_ptr->tval)
1662 /* Auto-inscription/destroy */
1663 autopick_alter_item(item, (bool)(okay && destroy_feeling));
1665 /* Something happened */
1670 static void gere_music(s32b music)
1678 stun_monsters(damroll(p_ptr->lev/10,2));
1681 hp_player(damroll(2,6));
1684 project_hack(GF_TURN_ALL, p_ptr->lev);
1687 project_hack(GF_PSI, randint1(p_ptr->lev * 3 / 2));
1690 project(0, 1, py, px, 0, GF_IDENTIFY, PROJECT_ITEM, -1);
1693 confuse_monsters(p_ptr->lev * 2);
1696 project_hack(GF_SOUND, damroll(10 + p_ptr->lev/5,7));
1699 charm_monsters(damroll(10 + p_ptr->lev/15,6));
1702 project(0, 0, py, px,
1703 0, GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE, -1);
1706 dispel_monsters(randint1(p_ptr->lev * 3));
1707 dispel_evil(randint1(p_ptr->lev * 3));
1714 earthquake(py, px, 10);
1717 stasis_monsters(p_ptr->lev * 4);
1720 dispel_monsters(randint1(p_ptr->lev * 3));
1723 hp_player(damroll(15,10));
1727 case MUSIC_DETECT+19:
1729 case MUSIC_DETECT+11:
1730 case MUSIC_DETECT+12:
1731 case MUSIC_DETECT+13:
1732 case MUSIC_DETECT+14:
1733 case MUSIC_DETECT+15:
1734 case MUSIC_DETECT+16:
1735 case MUSIC_DETECT+17:
1736 case MUSIC_DETECT+18:
1737 map_area(DETECT_RAD_MAP);
1738 if ((p_ptr->lev > 39) && (music < MUSIC_DETECT+19)) p_ptr->magic_num1[0] = music+1;
1739 case MUSIC_DETECT+6:
1740 case MUSIC_DETECT+7:
1741 case MUSIC_DETECT+8:
1742 case MUSIC_DETECT+9:
1743 case MUSIC_DETECT+10:
1744 /* There are too many hidden treasure. So... */
1745 /* detect_treasure(DETECT_RAD_DEFAULT); */
1746 detect_objects_gold(DETECT_RAD_DEFAULT);
1747 detect_objects_normal(DETECT_RAD_DEFAULT);
1748 if ((p_ptr->lev > 24) && (music < MUSIC_DETECT+11)) p_ptr->magic_num1[0] = music+1;
1749 case MUSIC_DETECT+3:
1750 case MUSIC_DETECT+4:
1751 case MUSIC_DETECT+5:
1752 detect_monsters_invis(DETECT_RAD_DEFAULT);
1753 detect_monsters_normal(DETECT_RAD_DEFAULT);
1754 if ((p_ptr->lev > 19) && (music < MUSIC_DETECT+6)) p_ptr->magic_num1[0] = music+1;
1756 case MUSIC_DETECT+1:
1757 case MUSIC_DETECT+2:
1758 detect_traps(DETECT_RAD_DEFAULT, TRUE);
1759 detect_doors(DETECT_RAD_DEFAULT);
1760 detect_stairs(DETECT_RAD_DEFAULT);
1761 if ((p_ptr->lev > 14) && (music < MUSIC_DETECT+3)) p_ptr->magic_num1[0] = music+1;
1767 * If player has inscribed the object with "!!", let him know when it's
1770 static void recharged_notice(object_type *o_ptr)
1772 char o_name[MAX_NLEN];
1776 /* No inscription */
1777 if (!o_ptr->inscription) return;
1780 s = my_strchr(quark_str(o_ptr->inscription), '!');
1782 /* Process notification request. */
1785 /* Find another '!' */
1788 /* Describe (briefly) */
1789 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1791 /* Notify the player */
1793 msg_format("%s¤ÏºÆ½¼Å¶¤µ¤ì¤¿¡£", o_name);
1795 if (o_ptr->number > 1)
1796 msg_format("Your %s are recharged.", o_name);
1798 msg_format("Your %s is recharged.", o_name);
1807 /* Keep looking for '!'s */
1808 s = my_strchr(s + 1, '!');
1813 static void check_music(void)
1818 u32b need_mana_frac;
1820 /* Music singed by player */
1821 if (p_ptr->pclass != CLASS_BARD) return;
1822 if (!p_ptr->magic_num1[0] && !p_ptr->magic_num1[1]) return;
1824 if (p_ptr->anti_magic)
1830 spell = p_ptr->magic_num2[0];
1831 s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC][spell];
1833 need_mana = mod_need_mana(s_ptr->smana, spell, REALM_MUSIC);
1837 s64b_RSHIFT(need_mana, need_mana_frac, 1);
1839 if (s64b_cmp(p_ptr->csp, p_ptr->csp_frac, need_mana, need_mana_frac) < 0)
1846 s64b_sub(&(p_ptr->csp), &(p_ptr->csp_frac), need_mana, need_mana_frac);
1848 p_ptr->redraw |= PR_MANA;
1849 if (p_ptr->magic_num1[1])
1851 p_ptr->magic_num1[0] = p_ptr->magic_num1[1];
1852 p_ptr->magic_num1[1] = 0;
1854 msg_print("²Î¤òºÆ³«¤·¤¿¡£");
1856 msg_print("You restart singing.");
1858 p_ptr->action = ACTION_SING;
1860 /* Recalculate bonuses */
1861 p_ptr->update |= (PU_BONUS | PU_HP);
1863 /* Redraw map and status bar */
1864 p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
1866 /* Update monsters */
1867 p_ptr->update |= (PU_MONSTERS);
1870 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1873 if (p_ptr->spell_exp[spell] < SPELL_EXP_BEGINNER)
1874 p_ptr->spell_exp[spell] += 5;
1875 else if(p_ptr->spell_exp[spell] < SPELL_EXP_SKILLED)
1876 { if (one_in_(2) && (dun_level > 4) && ((dun_level + 10) > p_ptr->lev)) p_ptr->spell_exp[spell] += 1; }
1877 else if(p_ptr->spell_exp[spell] < SPELL_EXP_EXPERT)
1878 { if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && ((dun_level + 5) > s_ptr->slevel)) p_ptr->spell_exp[spell] += 1; }
1879 else if(p_ptr->spell_exp[spell] < SPELL_EXP_MASTER)
1880 { if (one_in_(5) && ((dun_level + 5) > p_ptr->lev) && (dun_level > s_ptr->slevel)) p_ptr->spell_exp[spell] += 1; }
1882 gere_music(p_ptr->magic_num1[0]);
1886 /* Choose one of items that have cursed flag */
1887 static object_type *choose_cursed_obj_name(u32b flag)
1890 int choices[INVEN_TOTAL-INVEN_RARM];
1893 /* Paranoia -- Player has no warning-item */
1894 if (!(p_ptr->cursed & flag)) return NULL;
1896 /* Search Inventry */
1897 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
1899 object_type *o_ptr = &inventory[i];
1901 if (o_ptr->curse_flags & flag)
1903 choices[number] = i;
1908 /* Choice one of them */
1909 return (&inventory[choices[randint0(number)]]);
1914 * Handle timed damage and regeneration every 10 game turns
1916 static void process_world_aux_hp_and_sp(void)
1918 feature_type *f_ptr = &f_info[cave[py][px].feat];
1919 bool cave_no_regen = FALSE;
1920 int upkeep_factor = 0;
1923 /* Default regeneration */
1924 int regen_amount = PY_REGEN_NORMAL;
1927 /*** Damage over Time ***/
1929 /* Take damage from poison */
1930 if (p_ptr->poisoned && !IS_INVULN())
1934 take_hit(DAMAGE_NOESCAPE, 1, "ÆÇ", -1);
1936 take_hit(DAMAGE_NOESCAPE, 1, "poison", -1);
1941 /* Take damage from cuts */
1942 if (p_ptr->cut && !IS_INVULN())
1946 /* Mortal wound or Deep Gash */
1947 if (p_ptr->cut > 1000)
1952 else if (p_ptr->cut > 200)
1958 else if (p_ptr->cut > 100)
1963 else if (p_ptr->cut > 50)
1968 else if (p_ptr->cut > 25)
1973 else if (p_ptr->cut > 10)
1986 take_hit(DAMAGE_NOESCAPE, dam, "Ã×Ì¿½ý", -1);
1988 take_hit(DAMAGE_NOESCAPE, dam, "a fatal wound", -1);
1994 /* (Vampires) Take damage from sunlight */
1995 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
1997 if (!dun_level && !p_ptr->resist_lite && !IS_INVULN() && is_daytime())
1999 if ((cave[py][px].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
2003 msg_print("Æü¸÷¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª");
2004 take_hit(DAMAGE_NOESCAPE, 1, "Æü¸÷", -1);
2006 msg_print("The sun's rays scorch your undead flesh!");
2007 take_hit(DAMAGE_NOESCAPE, 1, "sunlight", -1);
2010 cave_no_regen = TRUE;
2014 if (inventory[INVEN_LITE].tval && (inventory[INVEN_LITE].name2 != EGO_LITE_DARKNESS) &&
2015 !p_ptr->resist_lite)
2017 object_type * o_ptr = &inventory[INVEN_LITE];
2018 char o_name [MAX_NLEN];
2019 char ouch [MAX_NLEN+40];
2021 /* Get an object description */
2022 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
2025 msg_format("%s¤¬¤¢¤Ê¤¿¤Î¥¢¥ó¥Ç¥Ã¥É¤ÎÆùÂΤò¾Æ¤¾Ç¤¬¤·¤¿¡ª", o_name);
2027 msg_format("The %s scorches your undead flesh!", o_name);
2031 cave_no_regen = TRUE;
2033 /* Get an object description */
2034 object_desc(o_name, o_ptr, OD_NAME_ONLY);
2037 sprintf(ouch, "%s¤òÁõÈ÷¤·¤¿¥À¥á¡¼¥¸", o_name);
2039 sprintf(ouch, "wielding %s", o_name);
2042 if (!IS_INVULN()) take_hit(DAMAGE_NOESCAPE, 1, ouch, -1);
2046 if (have_flag(f_ptr->flags, FF_LAVA) && !IS_INVULN() && !p_ptr->immune_fire)
2050 if (have_flag(f_ptr->flags, FF_DEEP))
2052 damage = 6000 + randint0(4000);
2054 else if (!p_ptr->levitation)
2056 damage = 3000 + randint0(2000);
2061 if (prace_is_(RACE_ENT)) damage += damage / 3;
2062 if (p_ptr->resist_fire) damage = damage / 3;
2063 if (IS_OPPOSE_FIRE()) damage = damage / 3;
2065 if (p_ptr->levitation) damage = damage / 5;
2067 damage = damage / 100 + (randint0(100) < (damage % 100));
2069 if (p_ptr->levitation)
2072 msg_print("Ç®¤Ç²Ð½ý¤·¤¿¡ª");
2073 take_hit(DAMAGE_NOESCAPE, damage, format("%s¤Î¾å¤ËÉâÍ·¤·¤¿¥À¥á¡¼¥¸", f_name + f_info[get_feat_mimic(&cave[py][px])].name), -1);
2075 msg_print("The heat burns you!");
2076 take_hit(DAMAGE_NOESCAPE, damage, format("flying over %s", f_name + f_info[get_feat_mimic(&cave[py][px])].name), -1);
2081 cptr name = f_name + f_info[get_feat_mimic(&cave[py][px])].name;
2083 msg_format("%s¤Ç²Ð½ý¤·¤¿¡ª", name);
2085 msg_format("The %s burns you!", name);
2087 take_hit(DAMAGE_NOESCAPE, damage, name, -1);
2090 cave_no_regen = TRUE;
2094 if (have_flag(f_ptr->flags, FF_WATER) && have_flag(f_ptr->flags, FF_DEEP) &&
2095 !p_ptr->levitation && !p_ptr->can_swim)
2097 if (p_ptr->total_weight > (((u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2))
2101 msg_print("Å®¤ì¤Æ¤¤¤ë¡ª");
2102 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), "Å®¤ì", -1);
2104 msg_print("You are drowning!");
2105 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->lev), "drowning", -1);
2108 cave_no_regen = TRUE;
2115 if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !p_ptr->immune_fire)
2117 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
2118 if (prace_is_(RACE_ENT)) damage += damage / 3;
2119 if (p_ptr->resist_fire) damage = damage / 3;
2120 if (IS_OPPOSE_FIRE()) damage = damage / 3;
2122 msg_print("Ç®¤¤¡ª");
2123 take_hit(DAMAGE_NOESCAPE, damage, "±ê¤Î¥ª¡¼¥é", -1);
2125 msg_print("It's hot!");
2126 take_hit(DAMAGE_NOESCAPE, damage, "Fire aura", -1);
2129 if ((r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !p_ptr->immune_elec)
2131 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
2132 if (prace_is_(RACE_ANDROID)) damage += damage / 3;
2133 if (p_ptr->resist_elec) damage = damage / 3;
2134 if (IS_OPPOSE_ELEC()) damage = damage / 3;
2136 msg_print("Äˤ¤¡ª");
2137 take_hit(DAMAGE_NOESCAPE, damage, "Åŵ¤¤Î¥ª¡¼¥é", -1);
2139 msg_print("It hurts!");
2140 take_hit(DAMAGE_NOESCAPE, damage, "Elec aura", -1);
2143 if ((r_info[m_list[p_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !p_ptr->immune_cold)
2145 damage = r_info[m_list[p_ptr->riding].r_idx].level / 2;
2146 if (p_ptr->resist_cold) damage = damage / 3;
2147 if (IS_OPPOSE_COLD()) damage = damage / 3;
2149 msg_print("Î䤿¤¤¡ª");
2150 take_hit(DAMAGE_NOESCAPE, damage, "Î䵤¤Î¥ª¡¼¥é", -1);
2152 msg_print("It's cold!");
2153 take_hit(DAMAGE_NOESCAPE, damage, "Cold aura", -1);
2158 /* Spectres -- take damage when moving through walls */
2160 * Added: ANYBODY takes damage if inside through walls
2161 * without wraith form -- NOTE: Spectres will never be
2162 * reduced below 0 hp by being inside a stone wall; others
2165 if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY))
2167 if (!IS_INVULN() && !p_ptr->wraith_form && !p_ptr->kabenuke &&
2168 ((p_ptr->chp > (p_ptr->lev / 5)) || !p_ptr->pass_wall))
2172 cave_no_regen = TRUE;
2174 if (p_ptr->pass_wall)
2177 msg_print("ÂΤÎʬ»Ò¤¬Ê¬²ò¤·¤¿µ¤¤¬¤¹¤ë¡ª");
2180 msg_print("Your molecules feel disrupted!");
2181 dam_desc = "density";
2187 msg_print("Êø¤ì¤¿´ä¤Ë²¡¤·ÄÙ¤µ¤ì¤¿¡ª");
2188 dam_desc = "¹Å¤¤´ä";
2190 msg_print("You are being crushed!");
2191 dam_desc = "solid rock";
2195 take_hit(DAMAGE_NOESCAPE, 1 + (p_ptr->lev / 5), dam_desc, -1);
2200 /*** handle regeneration ***/
2203 if (p_ptr->food < PY_FOOD_WEAK)
2205 /* Lower regeneration */
2206 if (p_ptr->food < PY_FOOD_STARVE)
2210 else if (p_ptr->food < PY_FOOD_FAINT)
2212 regen_amount = PY_REGEN_FAINT;
2216 regen_amount = PY_REGEN_WEAK;
2220 /* Are we walking the pattern? */
2221 if (pattern_effect())
2223 cave_no_regen = TRUE;
2227 /* Regeneration ability */
2228 if (p_ptr->regenerate)
2230 regen_amount = regen_amount * 2;
2232 if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK))
2236 if (p_ptr->cursed & TRC_SLOW_REGEN)
2243 /* Searching or Resting */
2244 if ((p_ptr->action == ACTION_SEARCH) || (p_ptr->action == ACTION_REST))
2246 regen_amount = regen_amount * 2;
2249 upkeep_factor = calculate_upkeep();
2251 /* No regeneration while special action */
2252 if ((p_ptr->action == ACTION_LEARN) ||
2253 (p_ptr->action == ACTION_HAYAGAKE) ||
2254 (p_ptr->special_defense & KATA_KOUKIJIN))
2256 upkeep_factor += 100;
2259 /* Regenerate the mana */
2260 upkeep_regen = (100 - upkeep_factor) * regen_amount;
2261 regenmana(upkeep_regen);
2264 /* Recharge magic eater's power */
2265 if (p_ptr->pclass == CLASS_MAGIC_EATER)
2267 regenmagic(regen_amount);
2270 if ((p_ptr->csp == 0) && (p_ptr->csp_frac == 0))
2272 while (upkeep_factor > 100)
2275 msg_print("¤³¤ó¤Ê¤Ë¿¤¯¤Î¥Ú¥Ã¥È¤òÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
2277 msg_print("Too many pets to control at once!");
2280 do_cmd_pet_dismiss();
2282 upkeep_factor = calculate_upkeep();
2285 msg_format("°Ý»ý£Í£Ð¤Ï %d%%", upkeep_factor);
2287 msg_format("Upkeep: %d%% mana.", upkeep_factor);
2293 /* Poisoned or cut yields no healing */
2294 if (p_ptr->poisoned) regen_amount = 0;
2295 if (p_ptr->cut) regen_amount = 0;
2297 /* Special floor -- Pattern, in a wall -- yields no healing */
2298 if (cave_no_regen) regen_amount = 0;
2300 regen_amount = (regen_amount * mutant_regenerate_mod) / 100;
2302 /* Regenerate Hit Points if needed */
2303 if ((p_ptr->chp < p_ptr->mhp) && !cave_no_regen)
2305 regenhp(regen_amount);
2311 * Handle timeout every 10 game turns
2313 static void process_world_aux_timeout(void)
2315 const int dec_count = (easy_band ? 2 : 1);
2317 /*** Timeout Various Things ***/
2320 if (p_ptr->tim_mimic)
2322 (void)set_mimic(p_ptr->tim_mimic - 1, p_ptr->mimic_form, TRUE);
2325 /* Hack -- Hallucinating */
2328 (void)set_image(p_ptr->image - dec_count);
2334 (void)set_blind(p_ptr->blind - dec_count);
2337 /* Times see-invisible */
2338 if (p_ptr->tim_invis)
2340 (void)set_tim_invis(p_ptr->tim_invis - 1, TRUE);
2351 (void)set_tim_esp(p_ptr->tim_esp - 1, TRUE);
2354 /* Timed temporary elemental brands. -LM- */
2355 if (p_ptr->ele_attack)
2357 p_ptr->ele_attack--;
2359 /* Clear all temporary elemental brands. */
2360 if (!p_ptr->ele_attack) set_ele_attack(0, 0);
2363 /* Timed temporary elemental immune. -LM- */
2364 if (p_ptr->ele_immune)
2366 p_ptr->ele_immune--;
2368 /* Clear all temporary elemental brands. */
2369 if (!p_ptr->ele_immune) set_ele_immune(0, 0);
2372 /* Timed infra-vision */
2373 if (p_ptr->tim_infra)
2375 (void)set_tim_infra(p_ptr->tim_infra - 1, TRUE);
2379 if (p_ptr->tim_stealth)
2381 (void)set_tim_stealth(p_ptr->tim_stealth - 1, TRUE);
2384 /* Timed levitation */
2385 if (p_ptr->tim_levitation)
2387 (void)set_tim_levitation(p_ptr->tim_levitation - 1, TRUE);
2390 /* Timed sh_touki */
2391 if (p_ptr->tim_sh_touki)
2393 (void)set_tim_sh_touki(p_ptr->tim_sh_touki - 1, TRUE);
2397 if (p_ptr->tim_sh_fire)
2399 (void)set_tim_sh_fire(p_ptr->tim_sh_fire - 1, TRUE);
2403 if (p_ptr->tim_sh_holy)
2405 (void)set_tim_sh_holy(p_ptr->tim_sh_holy - 1, TRUE);
2409 if (p_ptr->tim_eyeeye)
2411 (void)set_tim_eyeeye(p_ptr->tim_eyeeye - 1, TRUE);
2414 /* Timed resist-magic */
2415 if (p_ptr->resist_magic)
2417 (void)set_resist_magic(p_ptr->resist_magic - 1, TRUE);
2420 /* Timed regeneration */
2421 if (p_ptr->tim_regen)
2423 (void)set_tim_regen(p_ptr->tim_regen - 1, TRUE);
2426 /* Timed resist nether */
2427 if (p_ptr->tim_res_nether)
2429 (void)set_tim_res_nether(p_ptr->tim_res_nether - 1, TRUE);
2432 /* Timed resist time */
2433 if (p_ptr->tim_res_time)
2435 (void)set_tim_res_time(p_ptr->tim_res_time - 1, TRUE);
2439 if (p_ptr->tim_reflect)
2441 (void)set_tim_reflect(p_ptr->tim_reflect - 1, TRUE);
2445 if (p_ptr->multishadow)
2447 (void)set_multishadow(p_ptr->multishadow - 1, TRUE);
2450 /* Timed Robe of dust */
2451 if (p_ptr->dustrobe)
2453 (void)set_dustrobe(p_ptr->dustrobe - 1, TRUE);
2456 /* Timed infra-vision */
2457 if (p_ptr->kabenuke)
2459 (void)set_kabenuke(p_ptr->kabenuke - 1, TRUE);
2463 if (p_ptr->paralyzed)
2465 (void)set_paralyzed(p_ptr->paralyzed - dec_count);
2469 if (p_ptr->confused)
2471 (void)set_confused(p_ptr->confused - dec_count);
2477 (void)set_afraid(p_ptr->afraid - dec_count);
2483 (void)set_fast(p_ptr->fast - 1, TRUE);
2489 (void)set_slow(p_ptr->slow - dec_count, TRUE);
2492 /* Protection from evil */
2493 if (p_ptr->protevil)
2495 (void)set_protevil(p_ptr->protevil - 1, TRUE);
2498 /* Invulnerability */
2501 (void)set_invuln(p_ptr->invuln - 1, TRUE);
2505 if (p_ptr->wraith_form)
2507 (void)set_wraith_form(p_ptr->wraith_form - 1, TRUE);
2513 (void)set_hero(p_ptr->hero - 1, TRUE);
2519 (void)set_shero(p_ptr->shero - 1, TRUE);
2525 (void)set_blessed(p_ptr->blessed - 1, TRUE);
2531 (void)set_shield(p_ptr->shield - 1, TRUE);
2535 if (p_ptr->tsubureru)
2537 (void)set_tsubureru(p_ptr->tsubureru - 1, TRUE);
2541 if (p_ptr->magicdef)
2543 (void)set_magicdef(p_ptr->magicdef - 1, TRUE);
2547 if (p_ptr->tsuyoshi)
2549 (void)set_tsuyoshi(p_ptr->tsuyoshi - 1, TRUE);
2553 if (p_ptr->oppose_acid)
2555 (void)set_oppose_acid(p_ptr->oppose_acid - 1, TRUE);
2558 /* Oppose Lightning */
2559 if (p_ptr->oppose_elec)
2561 (void)set_oppose_elec(p_ptr->oppose_elec - 1, TRUE);
2565 if (p_ptr->oppose_fire)
2567 (void)set_oppose_fire(p_ptr->oppose_fire - 1, TRUE);
2571 if (p_ptr->oppose_cold)
2573 (void)set_oppose_cold(p_ptr->oppose_cold - 1, TRUE);
2577 if (p_ptr->oppose_pois)
2579 (void)set_oppose_pois(p_ptr->oppose_pois - 1, TRUE);
2584 (void)set_ultimate_res(p_ptr->ult_res - 1, TRUE);
2587 /*** Poison and Stun and Cut ***/
2590 if (p_ptr->poisoned)
2592 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2594 /* Apply some healing */
2595 (void)set_poisoned(p_ptr->poisoned - adjust);
2601 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2603 /* Apply some healing */
2604 (void)set_stun(p_ptr->stun - adjust);
2610 int adjust = adj_con_fix[p_ptr->stat_ind[A_CON]] + 1;
2612 /* Hack -- Truly "mortal" wound */
2613 if (p_ptr->cut > 1000) adjust = 0;
2615 /* Apply some healing */
2616 (void)set_cut(p_ptr->cut - adjust);
2622 * Handle burning fuel every 10 game turns
2624 static void process_world_aux_light(void)
2626 /* Check for light being wielded */
2627 object_type *o_ptr = &inventory[INVEN_LITE];
2629 /* Burn some fuel in the current lite */
2630 if (o_ptr->tval == TV_LITE)
2632 /* Hack -- Use some fuel (except on artifacts) */
2633 if (!(object_is_fixed_artifact(o_ptr) || o_ptr->sval == SV_LITE_FEANOR) && (o_ptr->xtra4 > 0))
2635 /* Decrease life-span */
2636 if (o_ptr->name2 == EGO_LITE_LONG)
2638 if (turn % (TURNS_PER_TICK*2)) o_ptr->xtra4--;
2640 else o_ptr->xtra4--;
2642 /* Notice interesting fuel steps */
2643 notice_lite_change(o_ptr);
2650 * Handle mutation effects once every 10 game turns
2652 static void process_world_aux_mutation(void)
2654 /* No mutation with effects */
2655 if (!p_ptr->muta2) return;
2657 /* No effect on monster arena */
2658 if (p_ptr->inside_battle) return;
2660 /* No effect on the global map */
2661 if (p_ptr->wild_mode) return;
2664 if ((p_ptr->muta2 & MUT2_BERS_RAGE) && one_in_(3000))
2668 msg_print("¥¦¥¬¥¡¥¡¥¢¡ª");
2669 msg_print("·ãÅܤÎȯºî¤Ë½±¤ï¤ì¤¿¡ª");
2671 msg_print("RAAAAGHH!");
2672 msg_print("You feel a fit of rage coming over you!");
2675 (void)set_shero(10 + randint1(p_ptr->lev), FALSE);
2678 if ((p_ptr->muta2 & MUT2_COWARDICE) && (randint1(3000) == 13))
2680 if (!p_ptr->resist_fear)
2684 msg_print("¤È¤Æ¤â°Å¤¤... ¤È¤Æ¤â¶²¤¤¡ª");
2686 msg_print("It's so dark... so scary!");
2689 set_afraid(p_ptr->afraid + 13 + randint1(26));
2693 if ((p_ptr->muta2 & MUT2_RTELEPORT) && (randint1(5000) == 88))
2695 if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) &&
2700 /* Teleport player */
2702 msg_print("¤¢¤Ê¤¿¤Î°ÌÃÖ¤ÏÆÍÁ³¤Ò¤¸¤ç¤¦¤ËÉÔ³ÎÄê¤Ë¤Ê¤Ã¤¿...");
2704 msg_print("Your position suddenly seems very uncertain...");
2708 teleport_player(40, TRUE);
2712 if ((p_ptr->muta2 & MUT2_ALCOHOL) && (randint1(6400) == 321))
2714 if (!p_ptr->resist_conf && !p_ptr->resist_chaos)
2717 p_ptr->redraw |= PR_EXTRA;
2719 msg_print("¤¤¤Ò¤¤¬¤â¡¼¤í¡¼¤È¤Ò¤Æ¤¤¿¤¤¬¤Õ¤ë...¥Ò¥Ã¥¯¡ª");
2721 msg_print("You feel a SSSCHtupor cOmINg over yOu... *HIC*!");
2726 if (!p_ptr->resist_conf)
2728 (void)set_confused(p_ptr->confused + randint0(20) + 15);
2731 if (!p_ptr->resist_chaos)
2736 if (one_in_(3)) lose_all_info();
2738 teleport_player(100, TRUE);
2741 msg_print("¤¢¤Ê¤¿¤Ï¸«ÃΤé¤Ì¾ì½ê¤ÇÌܤ¬Àä᤿...Ƭ¤¬Äˤ¤¡£");
2742 msg_print("²¿¤â³Ð¤¨¤Æ¤¤¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ËÍ褿¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
2744 msg_print("You wake up somewhere with a sore head...");
2745 msg_print("You can't remember a thing, or how you got here!");
2754 msg_print("¤¡Á¤ì¤¤¤Ê¤Á¤ç¤ª¤Á¤ç¤é¤È¤ó¤ì¤¤¤ë¡Á");
2756 msg_print("Thishcischs GooDSChtuff!");
2759 (void)set_image(p_ptr->image + randint0(150) + 150);
2765 if ((p_ptr->muta2 & MUT2_HALLU) && (randint1(6400) == 42))
2767 if (!p_ptr->resist_chaos)
2770 p_ptr->redraw |= PR_EXTRA;
2771 (void)set_image(p_ptr->image + randint0(50) + 20);
2775 if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint1(3000) == 13))
2780 msg_print("¥Ö¥¥¡¼¡¼¥Ã¡ª¤ª¤Ã¤È¡£");
2782 msg_print("BRRAAAP! Oops.");
2786 fire_ball(GF_POIS, 0, p_ptr->lev, 3);
2789 if ((p_ptr->muta2 & MUT2_PROD_MANA) &&
2790 !p_ptr->anti_magic && one_in_(9000))
2795 msg_print("ËâË¡¤Î¥¨¥Í¥ë¥®¡¼¤¬ÆÍÁ³¤¢¤Ê¤¿¤ÎÃæ¤Ëή¤ì¹þ¤ó¤Ç¤¤¿¡ª¥¨¥Í¥ë¥®¡¼¤ò²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡ª");
2797 msg_print("Magical energy flows through you! You must release it!");
2802 (void)get_hack_dir(&dire);
2803 fire_ball(GF_MANA, dire, p_ptr->lev * 2, 3);
2806 if ((p_ptr->muta2 & MUT2_ATT_DEMON) &&
2807 !p_ptr->anti_magic && (randint1(6666) == 666))
2809 bool pet = one_in_(6);
2810 u32b mode = PM_ALLOW_GROUP;
2812 if (pet) mode |= PM_FORCE_PET;
2813 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
2815 if (summon_specific((pet ? -1 : 0), py, px,
2816 dun_level, SUMMON_DEMON, mode))
2819 msg_print("¤¢¤Ê¤¿¤Ï¥Ç¡¼¥â¥ó¤ò°ú¤´ó¤»¤¿¡ª");
2821 msg_print("You have attracted a demon!");
2828 if ((p_ptr->muta2 & MUT2_SPEED_FLUX) && one_in_(6000))
2834 msg_print("ÀºÎÏŪ¤Ç¤Ê¤¯¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2836 msg_print("You feel less energetic.");
2839 if (p_ptr->fast > 0)
2845 set_slow(randint1(30) + 10, FALSE);
2851 msg_print("ÀºÎÏŪ¤Ë¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
2853 msg_print("You feel more energetic.");
2856 if (p_ptr->slow > 0)
2862 set_fast(randint1(30) + 10, FALSE);
2867 if ((p_ptr->muta2 & MUT2_BANISH_ALL) && one_in_(9000))
2871 msg_print("ÆÍÁ³¤Û¤È¤ó¤É¸ÉÆȤˤʤ俵¤¤¬¤¹¤ë¡£");
2873 msg_print("You suddenly feel almost lonely.");
2876 banish_monsters(100);
2877 if (!dun_level && p_ptr->town_num)
2881 /* Pick a random shop (except home) */
2884 n = randint0(MAX_STORES);
2886 while ((n == STORE_HOME) || (n == STORE_MUSEUM));
2889 msg_print("Ź¤Î¼ç¿Í¤¬µÖ¤Ë¸þ¤«¤Ã¤ÆÁö¤Ã¤Æ¤¤¤ë¡ª");
2891 msg_print("You see one of the shopkeepers running for the hills!");
2899 if ((p_ptr->muta2 & MUT2_EAT_LIGHT) && one_in_(3000))
2904 msg_print("±Æ¤Ë¤Ä¤Ä¤Þ¤ì¤¿¡£");
2906 msg_print("A shadow passes over you.");
2911 /* Absorb light from the current possition */
2912 if ((cave[py][px].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
2917 o_ptr = &inventory[INVEN_LITE];
2919 /* Absorb some fuel in the current lite */
2920 if (o_ptr->tval == TV_LITE)
2922 /* Use some fuel (except on artifacts) */
2923 if (!object_is_fixed_artifact(o_ptr) && (o_ptr->xtra4 > 0))
2925 /* Heal the player a bit */
2926 hp_player(o_ptr->xtra4 / 20);
2928 /* Decrease life-span of lite */
2932 msg_print("¸÷¸»¤«¤é¥¨¥Í¥ë¥®¡¼¤òµÛ¼ý¤·¤¿¡ª");
2934 msg_print("You absorb energy from your light!");
2938 /* Notice interesting fuel steps */
2939 notice_lite_change(o_ptr);
2944 * Unlite the area (radius 10) around player and
2945 * do 50 points damage to every affected monster
2947 unlite_area(50, 10);
2950 if ((p_ptr->muta2 & MUT2_ATT_ANIMAL) &&
2951 !p_ptr->anti_magic && one_in_(7000))
2953 bool pet = one_in_(3);
2954 u32b mode = PM_ALLOW_GROUP;
2956 if (pet) mode |= PM_FORCE_PET;
2957 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
2959 if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_ANIMAL, mode))
2962 msg_print("ưʪ¤ò°ú¤´ó¤»¤¿¡ª");
2964 msg_print("You have attracted an animal!");
2971 if ((p_ptr->muta2 & MUT2_RAW_CHAOS) &&
2972 !p_ptr->anti_magic && one_in_(8000))
2976 msg_print("¼þ¤ê¤Î¶õ´Ö¤¬ÏĤó¤Ç¤¤¤ëµ¤¤¬¤¹¤ë¡ª");
2978 msg_print("You feel the world warping around you!");
2982 fire_ball(GF_CHAOS, 0, p_ptr->lev, 8);
2984 if ((p_ptr->muta2 & MUT2_NORMALITY) && one_in_(5000))
2986 if (!lose_mutation(0))
2988 msg_print("´ñ̯¤Ê¤¯¤é¤¤ÉáÄ̤ˤʤ俵¤¤¬¤¹¤ë¡£");
2990 msg_print("You feel oddly normal.");
2994 if ((p_ptr->muta2 & MUT2_WRAITH) && !p_ptr->anti_magic && one_in_(3000))
2998 msg_print("Èóʪ¼Á²½¤·¤¿¡ª");
3000 msg_print("You feel insubstantial!");
3004 set_wraith_form(randint1(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE);
3006 if ((p_ptr->muta2 & MUT2_POLY_WOUND) && one_in_(3000))
3010 if ((p_ptr->muta2 & MUT2_WASTING) && one_in_(3000))
3012 int which_stat = randint0(6);
3013 int sustained = FALSE;
3018 if (p_ptr->sustain_str) sustained = TRUE;
3021 if (p_ptr->sustain_int) sustained = TRUE;
3024 if (p_ptr->sustain_wis) sustained = TRUE;
3027 if (p_ptr->sustain_dex) sustained = TRUE;
3030 if (p_ptr->sustain_con) sustained = TRUE;
3033 if (p_ptr->sustain_chr) sustained = TRUE;
3037 msg_print("ÉÔÀµ¤Ê¾õÂÖ¡ª");
3039 msg_print("Invalid stat chosen!");
3049 msg_print("¼«Ê¬¤¬¿ê¼å¤·¤Æ¤¤¤¯¤Î¤¬Ê¬¤«¤ë¡ª");
3051 msg_print("You can feel yourself wasting away!");
3055 (void)dec_stat(which_stat, randint1(6) + 6, one_in_(3));
3058 if ((p_ptr->muta2 & MUT2_ATT_DRAGON) &&
3059 !p_ptr->anti_magic && one_in_(3000))
3061 bool pet = one_in_(5);
3062 u32b mode = PM_ALLOW_GROUP;
3064 if (pet) mode |= PM_FORCE_PET;
3065 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
3067 if (summon_specific((pet ? -1 : 0), py, px, dun_level, SUMMON_DRAGON, mode))
3070 msg_print("¥É¥é¥´¥ó¤ò°ú¤´ó¤»¤¿¡ª");
3072 msg_print("You have attracted a dragon!");
3078 if ((p_ptr->muta2 & MUT2_WEIRD_MIND) && !p_ptr->anti_magic &&
3081 if (p_ptr->tim_esp > 0)
3084 msg_print("Àº¿À¤Ë¤â¤ä¤¬¤«¤«¤Ã¤¿¡ª");
3086 msg_print("Your mind feels cloudy!");
3089 set_tim_esp(0, TRUE);
3094 msg_print("Àº¿À¤¬¹¤¬¤Ã¤¿¡ª");
3096 msg_print("Your mind expands!");
3099 set_tim_esp(p_ptr->lev, FALSE);
3102 if ((p_ptr->muta2 & MUT2_NAUSEA) && !p_ptr->slow_digest &&
3107 msg_print("°ß¤¬áÛÚ»¤·¡¢¿©»ö¤ò¼º¤Ã¤¿¡ª");
3109 msg_print("Your stomach roils, and you lose your lunch!");
3113 set_food(PY_FOOD_WEAK);
3116 if ((p_ptr->muta2 & MUT2_WALK_SHAD) &&
3117 !p_ptr->anti_magic && one_in_(12000) && !p_ptr->inside_arena)
3122 if ((p_ptr->muta2 & MUT2_WARNING) && one_in_(1000))
3124 int danger_amount = 0;
3127 for (monster = 0; monster < m_max; monster++)
3129 monster_type *m_ptr = &m_list[monster];
3130 monster_race *r_ptr = &r_info[m_ptr->r_idx];
3132 /* Paranoia -- Skip dead monsters */
3133 if (!m_ptr->r_idx) continue;
3135 if (r_ptr->level >= p_ptr->lev)
3137 danger_amount += r_ptr->level - p_ptr->lev + 1;
3141 if (danger_amount > 100)
3143 msg_print("Èó¾ï¤Ë¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
3145 msg_print("You feel utterly terrified!");
3148 else if (danger_amount > 50)
3150 msg_print("¶²¤í¤·¤¤µ¤¤¬¤¹¤ë¡ª");
3152 msg_print("You feel terrified!");
3155 else if (danger_amount > 20)
3157 msg_print("Èó¾ï¤Ë¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
3159 msg_print("You feel very worried!");
3162 else if (danger_amount > 10)
3164 msg_print("¿´Çۤʵ¤¤¬¤¹¤ë¡ª");
3166 msg_print("You feel paranoid!");
3169 else if (danger_amount > 5)
3171 msg_print("¤Û¤È¤ó¤É°ÂÁ´¤Êµ¤¤¬¤¹¤ë¡£");
3173 msg_print("You feel almost safe.");
3178 msg_print("¼ä¤·¤¤µ¤¤¬¤¹¤ë¡£");
3180 msg_print("You feel lonely.");
3184 if ((p_ptr->muta2 & MUT2_INVULN) && !p_ptr->anti_magic &&
3189 msg_print("̵Ũ¤Êµ¤¤¬¤¹¤ë¡ª");
3191 msg_print("You feel invincible!");
3195 (void)set_invuln(randint1(8) + 8, FALSE);
3197 if ((p_ptr->muta2 & MUT2_SP_TO_HP) && one_in_(2000))
3199 int wounds = p_ptr->mhp - p_ptr->chp;
3203 int healing = p_ptr->csp;
3205 if (healing > wounds)
3211 p_ptr->csp -= healing;
3214 p_ptr->redraw |= (PR_MANA);
3217 if ((p_ptr->muta2 & MUT2_HP_TO_SP) && !p_ptr->anti_magic &&
3220 int wounds = p_ptr->msp - p_ptr->csp;
3224 int healing = p_ptr->chp;
3226 if (healing > wounds)
3231 p_ptr->csp += healing;
3234 p_ptr->redraw |= (PR_MANA);
3236 take_hit(DAMAGE_LOSELIFE, healing, "Ƭ¤Ë¾º¤Ã¤¿·ì", -1);
3238 take_hit(DAMAGE_LOSELIFE, healing, "blood rushing to the head", -1);
3243 if ((p_ptr->muta2 & MUT2_DISARM) && one_in_(10000))
3250 msg_print("¤¬¤â¤Ä¤ì¤Æž¤ó¤À¡ª");
3251 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), "žÅÝ", -1);
3253 msg_print("You trip over your own feet!");
3254 take_hit(DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), "tripping", -1);
3258 if (buki_motteruka(INVEN_RARM))
3261 o_ptr = &inventory[INVEN_RARM];
3263 if (buki_motteruka(INVEN_LARM) && one_in_(2))
3265 o_ptr = &inventory[INVEN_LARM];
3269 else if (buki_motteruka(INVEN_LARM))
3271 o_ptr = &inventory[INVEN_LARM];
3275 if (slot && !object_is_cursed(o_ptr))
3278 msg_print("Éð´ï¤òÍ¤Æ¤·¤Þ¤Ã¤¿¡ª");
3280 msg_print("You drop your weapon!");
3282 inven_drop(slot, 1);
3289 * Handle curse effects once every 10 game turns
3291 static void process_world_aux_curse(void)
3293 if ((p_ptr->cursed & TRC_P_FLAG_MASK) && !p_ptr->inside_battle && !p_ptr->wild_mode)
3296 * Hack: Uncursed teleporting items (e.g. Trump Weapons)
3297 * can actually be useful!
3299 if ((p_ptr->cursed & TRC_TELEPORT_SELF) && one_in_(200))
3301 char o_name[MAX_NLEN];
3305 /* Scan the equipment with random teleport ability */
3306 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
3308 u32b flgs[TR_FLAG_SIZE];
3309 o_ptr = &inventory[i];
3311 /* Skip non-objects */
3312 if (!o_ptr->k_idx) continue;
3314 /* Extract the item flags */
3315 object_flags(o_ptr, flgs);
3317 if (have_flag(flgs, TR_TELEPORT)) break;
3320 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
3323 msg_format("%s¤¬¥Æ¥ì¥Ý¡¼¥È¤ÎǽÎϤòȯư¤µ¤»¤è¤¦¤È¤·¤Æ¤¤¤ë¡£", o_name);
3325 msg_format("Your %s is activating teleportation.", o_name);
3329 if (get_check_strict("¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«¡©", CHECK_OKAY_CANCEL))
3331 if (get_check_strict("Teleport? ", CHECK_OKAY_CANCEL))
3335 teleport_player(50, FALSE);
3340 msg_format("%s¤Ë{.}(¥Ô¥ê¥ª¥É)¤ÈÌäò¹ï¤à¤Èȯư¤òÍÞÀ©¤Ç¤¤Þ¤¹¡£", o_name);
3342 msg_format("You can inscribe {.} on your %s to disable random teleportation. ", o_name);
3347 /* Make a chainsword noise */
3348 if ((p_ptr->cursed & TRC_CHAINSWORD) && one_in_(CHAINSWORD_NOISE))
3352 if (!get_rnd_line("chainswd_j.txt", 0, noise))
3354 if (!get_rnd_line("chainswd.txt", 0, noise))
3357 disturb(FALSE, FALSE);
3360 if ((p_ptr->cursed & TRC_TY_CURSE) && one_in_(TY_CURSE_CHANCE))
3363 (void)activate_ty_curse(FALSE, &count);
3365 /* Handle experience draining */
3366 if (p_ptr->prace != RACE_ANDROID &&
3367 ((p_ptr->cursed & TRC_DRAIN_EXP) && one_in_(4)))
3369 p_ptr->exp -= (p_ptr->lev+1)/2;
3370 if (p_ptr->exp < 0) p_ptr->exp = 0;
3371 p_ptr->max_exp -= (p_ptr->lev+1)/2;
3372 if (p_ptr->max_exp < 0) p_ptr->max_exp = 0;
3375 /* Add light curse (Later) */
3376 if ((p_ptr->cursed & TRC_ADD_L_CURSE) && one_in_(2000))
3381 o_ptr = choose_cursed_obj_name(TRC_ADD_L_CURSE);
3383 new_curse = get_curse(0, o_ptr);
3384 if (!(o_ptr->curse_flags & new_curse))
3386 char o_name[MAX_NLEN];
3388 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
3390 o_ptr->curse_flags |= new_curse;
3392 msg_format("°°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬%s¤ò¤È¤ê¤Þ¤¤¤¿...", o_name);
3394 msg_format("There is a malignant black aura surrounding your %s...", o_name);
3397 o_ptr->feeling = FEEL_NONE;
3399 p_ptr->update |= (PU_BONUS);
3402 /* Add heavy curse (Later) */
3403 if ((p_ptr->cursed & TRC_ADD_H_CURSE) && one_in_(2000))
3408 o_ptr = choose_cursed_obj_name(TRC_ADD_H_CURSE);
3410 new_curse = get_curse(1, o_ptr);
3411 if (!(o_ptr->curse_flags & new_curse))
3413 char o_name[MAX_NLEN];
3415 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
3417 o_ptr->curse_flags |= new_curse;
3419 msg_format("°°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬%s¤ò¤È¤ê¤Þ¤¤¤¿...", o_name);
3421 msg_format("There is a malignant black aura surrounding your %s...", o_name);
3424 o_ptr->feeling = FEEL_NONE;
3426 p_ptr->update |= (PU_BONUS);
3430 if ((p_ptr->cursed & TRC_CALL_ANIMAL) && one_in_(2500))
3432 if (summon_specific(0, py, px, dun_level, SUMMON_ANIMAL,
3433 (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
3435 char o_name[MAX_NLEN];
3437 object_desc(o_name, choose_cursed_obj_name(TRC_CALL_ANIMAL), (OD_OMIT_PREFIX | OD_NAME_ONLY));
3439 msg_format("%s¤¬Æ°Êª¤ò°ú¤´ó¤»¤¿¡ª", o_name);
3441 msg_format("Your %s have attracted an animal!", o_name);
3448 if ((p_ptr->cursed & TRC_CALL_DEMON) && one_in_(1111))
3450 if (summon_specific(0, py, px, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
3452 char o_name[MAX_NLEN];
3454 object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DEMON), (OD_OMIT_PREFIX | OD_NAME_ONLY));
3456 msg_format("%s¤¬°Ëâ¤ò°ú¤´ó¤»¤¿¡ª", o_name);
3458 msg_format("Your %s have attracted a demon!", o_name);
3465 if ((p_ptr->cursed & TRC_CALL_DRAGON) && one_in_(800))
3467 if (summon_specific(0, py, px, dun_level, SUMMON_DRAGON,
3468 (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
3470 char o_name[MAX_NLEN];
3472 object_desc(o_name, choose_cursed_obj_name(TRC_CALL_DRAGON), (OD_OMIT_PREFIX | OD_NAME_ONLY));
3474 msg_format("%s¤¬¥É¥é¥´¥ó¤ò°ú¤´ó¤»¤¿¡ª", o_name);
3476 msg_format("Your %s have attracted an animal!", o_name);
3482 if ((p_ptr->cursed & TRC_COWARDICE) && one_in_(1500))
3484 if (!p_ptr->resist_fear)
3488 msg_print("¤È¤Æ¤â°Å¤¤... ¤È¤Æ¤â¶²¤¤¡ª");
3490 msg_print("It's so dark... so scary!");
3493 set_afraid(p_ptr->afraid + 13 + randint1(26));
3496 /* Teleport player */
3497 if ((p_ptr->cursed & TRC_TELEPORT) && one_in_(200) && !p_ptr->anti_tele)
3501 /* Teleport player */
3502 teleport_player(40, TRUE);
3504 /* Handle HP draining */
3505 if ((p_ptr->cursed & TRC_DRAIN_HP) && one_in_(666))
3507 char o_name[MAX_NLEN];
3509 object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_HP), (OD_OMIT_PREFIX | OD_NAME_ONLY));
3511 msg_format("%s¤Ï¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª", o_name);
3513 msg_format("Your %s drains HP from you!", o_name);
3515 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev*2, 100), o_name, -1);
3517 /* Handle mana draining */
3518 if ((p_ptr->cursed & TRC_DRAIN_MANA) && one_in_(666))
3520 char o_name[MAX_NLEN];
3522 object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_MANA), (OD_OMIT_PREFIX | OD_NAME_ONLY));
3524 msg_format("%s¤Ï¤¢¤Ê¤¿¤ÎËâÎϤòµÛ¼ý¤·¤¿¡ª", o_name);
3526 msg_format("Your %s drains mana from you!", o_name);
3528 p_ptr->csp -= MIN(p_ptr->lev, 50);
3532 p_ptr->csp_frac = 0;
3534 p_ptr->redraw |= PR_MANA;
3538 /* Rarely, take damage from the Jewel of Judgement */
3539 if (one_in_(999) && !p_ptr->anti_magic)
3541 object_type *o_ptr = &inventory[INVEN_LITE];
3543 if (o_ptr->name1 == ART_JUDGE)
3546 if (object_is_known(o_ptr))
3547 msg_print("¡Ø¿³È½¤ÎÊõÀС٤Ϥ¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª");
3549 msg_print("¤Ê¤Ë¤«¤¬¤¢¤Ê¤¿¤ÎÂÎÎϤòµÛ¼ý¤·¤¿¡ª");
3550 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "¿³È½¤ÎÊõÀÐ", -1);
3552 if (object_is_known(o_ptr))
3553 msg_print("The Jewel of Judgement drains life from you!");
3555 msg_print("Something drains life from you!");
3556 take_hit(DAMAGE_LOSELIFE, MIN(p_ptr->lev, 50), "the Jewel of Judgement", -1);
3564 * Handle recharging objects once every 10 game turns
3566 static void process_world_aux_recharge(void)
3571 /* Process equipment */
3572 for (changed = FALSE, i = INVEN_RARM; i < INVEN_TOTAL; i++)
3574 /* Get the object */
3575 object_type *o_ptr = &inventory[i];
3577 /* Skip non-objects */
3578 if (!o_ptr->k_idx) continue;
3580 /* Recharge activatable objects */
3581 if (o_ptr->timeout > 0)
3586 /* Notice changes */
3587 if (!o_ptr->timeout)
3589 recharged_notice(o_ptr);
3595 /* Notice changes */
3599 p_ptr->window |= (PW_EQUIP);
3604 * Recharge rods. Rods now use timeout to control charging status,
3605 * and each charging rod in a stack decreases the stack's timeout by
3606 * one per turn. -LM-
3608 for (changed = FALSE, i = 0; i < INVEN_PACK; i++)
3610 object_type *o_ptr = &inventory[i];
3611 object_kind *k_ptr = &k_info[o_ptr->k_idx];
3613 /* Skip non-objects */
3614 if (!o_ptr->k_idx) continue;
3616 /* Examine all charging rods or stacks of charging rods. */
3617 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
3619 /* Determine how many rods are charging. */
3620 int temp = (o_ptr->timeout + (k_ptr->pval - 1)) / k_ptr->pval;
3621 if (temp > o_ptr->number) temp = o_ptr->number;
3623 /* Decrease timeout by that number. */
3624 o_ptr->timeout -= temp;
3626 /* Boundary control. */
3627 if (o_ptr->timeout < 0) o_ptr->timeout = 0;
3629 /* Notice changes, provide message if object is inscribed. */
3630 if (!(o_ptr->timeout))
3632 recharged_notice(o_ptr);
3636 /* One of the stack of rod is charged */
3637 else if (o_ptr->timeout % k_ptr->pval)
3644 /* Notice changes */
3648 p_ptr->window |= (PW_INVEN);
3652 /* Process objects on floor */
3653 for (i = 1; i < o_max; i++)
3656 object_type *o_ptr = &o_list[i];
3658 /* Skip dead objects */
3659 if (!o_ptr->k_idx) continue;
3661 /* Recharge rods on the ground. No messages. */
3662 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout))
3665 o_ptr->timeout -= o_ptr->number;
3667 /* Boundary control. */
3668 if (o_ptr->timeout < 0) o_ptr->timeout = 0;
3675 * Handle involuntary movement once every 10 game turns
3677 static void process_world_aux_movement(void)
3679 /* Delayed Word-of-Recall */
3680 if (p_ptr->word_recall)
3683 * HACK: Autosave BEFORE resetting the recall counter (rr9)
3684 * The player is yanked up/down as soon as
3685 * he loads the autosaved game.
3687 if (autosave_l && (p_ptr->word_recall == 1) && !p_ptr->inside_battle)
3688 do_cmd_save_game(TRUE);
3690 /* Count down towards recall */
3691 p_ptr->word_recall--;
3693 p_ptr->redraw |= (PR_STATUS);
3695 /* Activate the recall */
3696 if (!p_ptr->word_recall)
3701 /* Determine the level */
3702 if (dun_level || p_ptr->inside_quest)
3705 msg_print("¾å¤Ë°ú¤ÃÄ¥¤ê¤¢¤²¤é¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
3707 msg_print("You feel yourself yanked upwards!");
3710 p_ptr->recall_dungeon = dungeon_type;
3712 do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
3717 leave_quest_check();
3719 p_ptr->inside_quest = 0;
3721 p_ptr->leaving = TRUE;
3726 msg_print("²¼¤Ë°ú¤¤º¤ê¹ß¤í¤µ¤ì¤ë´¶¤¸¤¬¤¹¤ë¡ª");
3728 msg_print("You feel yourself yanked downwards!");
3731 dungeon_type = p_ptr->recall_dungeon;
3734 do_cmd_write_nikki(NIKKI_RECALL, dun_level, NULL);
3737 dun_level = max_dlv[dungeon_type];
3738 if (dun_level < 1) dun_level = 1;
3740 /* Nightmare mode makes recall more dangerous */
3741 if (ironman_nightmare && !randint0(666) && (dungeon_type == DUNGEON_ANGBAND))
3747 else if (dun_level < 99)
3749 dun_level = (dun_level + 99) / 2;
3751 else if (dun_level > 100)
3753 dun_level = d_info[dungeon_type].maxdepth - 1;
3757 if (p_ptr->wild_mode)
3759 p_ptr->wilderness_y = py;
3760 p_ptr->wilderness_x = px;
3764 /* Save player position */
3768 p_ptr->wild_mode = FALSE;
3771 * Clear all saved floors
3772 * and create a first saved floor
3774 prepare_change_floor_mode(CFM_FIRST_FLOOR);
3777 p_ptr->leaving = TRUE;
3779 if (dungeon_type == DUNGEON_ANGBAND)
3783 for (i = MIN_RANDOM_QUEST; i < MAX_RANDOM_QUEST + 1; i++)
3785 if ((quest[i].type == QUEST_TYPE_RANDOM) &&
3786 (quest[i].status == QUEST_STATUS_TAKEN) &&
3787 (quest[i].level < dun_level))
3789 quest[i].status = QUEST_STATUS_FAILED;
3790 quest[i].complev = (byte)p_ptr->lev;
3791 r_info[quest[i].r_idx].flags1 &= ~(RF1_QUESTOR);
3798 sound(SOUND_TPLEVEL);
3803 /* Delayed Alter reality */
3804 if (p_ptr->alter_reality)
3806 if (autosave_l && (p_ptr->alter_reality == 1) && !p_ptr->inside_battle)
3807 do_cmd_save_game(TRUE);
3809 /* Count down towards alter */
3810 p_ptr->alter_reality--;
3812 p_ptr->redraw |= (PR_STATUS);
3814 /* Activate the alter reality */
3815 if (!p_ptr->alter_reality)
3820 /* Determine the level */
3821 if (!quest_number(dun_level) && dun_level)
3824 msg_print("À¤³¦¤¬ÊѤï¤Ã¤¿¡ª");
3826 msg_print("The world changes!");
3830 p_ptr->leaving = TRUE;
3835 msg_print("À¤³¦¤¬¾¯¤·¤Î´ÖÊѲ½¤·¤¿¤è¤¦¤À¡£");
3837 msg_print("The world seems to change for a moment!");
3842 sound(SOUND_TPLEVEL);
3849 * Handle certain things once every 10 game turns
3851 static void process_world(void)
3855 const s32b A_DAY = TURNS_PER_TICK * TOWN_DAWN;
3856 s32b prev_turn_in_today = ((turn - TURNS_PER_TICK) % A_DAY + A_DAY / 4) % A_DAY;
3857 int prev_min = (1440 * prev_turn_in_today / A_DAY) % 60;
3859 extract_day_hour_min(&day, &hour, &min);
3862 if ((turn - old_turn == (150 - dun_level) * TURNS_PER_TICK)
3863 && dun_level && !p_ptr->inside_battle)
3865 int quest_num = quest_number(dun_level);
3867 /* Get dungeon level feeling */
3869 (is_fixed_quest_idx(quest_num) &&
3870 !((quest_num == QUEST_OBERON) || (quest_num == QUEST_SERPENT) ||
3871 !(quest[quest_num].flags & QUEST_FLAG_PRESET)))))
3873 /* Announce feeling */
3876 /* Update the level indicator */
3877 p_ptr->redraw |= (PR_DEPTH);
3880 if (disturb_minor) disturb(0, 0);
3884 /*** Check monster arena ***/
3885 if (p_ptr->inside_battle && !p_ptr->leaving)
3891 /* Count all hostile monsters */
3892 for (i2 = 0; i2 < cur_wid; ++i2)
3893 for (j2 = 0; j2 < cur_hgt; j2++)
3895 cave_type *c_ptr = &cave[j2][i2];
3897 if ((c_ptr->m_idx > 0) && (c_ptr->m_idx != p_ptr->riding))
3900 win_m_idx = c_ptr->m_idx;
3904 if (number_mon == 0)
3907 msg_print("ÁêÂǤÁ¤Ë½ª¤ï¤ê¤Þ¤·¤¿¡£");
3909 msg_print("They have kill each other at the same time.");
3912 p_ptr->energy_need = 0;
3915 else if ((number_mon-1) == 0)
3918 monster_type *wm_ptr;
3920 wm_ptr = &m_list[win_m_idx];
3922 monster_desc(m_name, wm_ptr, 0);
3924 msg_format("%s¤¬¾¡Íø¤·¤¿¡ª", m_name);
3926 msg_format("%s is winner!", m_name);
3930 if (win_m_idx == (sel_monster+1))
3933 msg_print("¤ª¤á¤Ç¤È¤¦¤´¤¶¤¤¤Þ¤¹¡£");
3935 msg_print("Congratulations.");
3938 msg_format("%d¡ð¤ò¼õ¤±¼è¤Ã¤¿¡£", battle_odds);
3940 msg_format("You received %d gold.", battle_odds);
3942 p_ptr->au += battle_odds;
3947 msg_print("»ÄÇ°¤Ç¤·¤¿¡£");
3949 msg_print("You lost gold.");
3953 p_ptr->energy_need = 0;
3956 else if(turn - old_turn == 150*TURNS_PER_TICK)
3959 msg_print("¿½¤·Ê¬¤±¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤³¤Î¾¡Éé¤Ï°ú¤Ê¬¤±¤È¤µ¤»¤Æ¤¤¤¿¤À¤¤Þ¤¹¡£");
3961 msg_format("This battle have ended in a draw.");
3963 p_ptr->au += kakekin;
3965 p_ptr->energy_need = 0;
3970 /* Every 10 game turns */
3971 if (turn % TURNS_PER_TICK) return;
3973 /*** Check the Time and Load ***/
3975 if (!(turn % (50*TURNS_PER_TICK)))
3977 /* Check time and load */
3978 if ((0 != check_time()) || (0 != check_load()))
3981 if (closing_flag <= 2)
3986 /* Count warnings */
3991 msg_print("¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¸¤«¤«¤Ã¤Æ¤¤¤Þ¤¹...");
3992 msg_print("¥²¡¼¥à¤ò½ªÎ»¤¹¤ë¤«¥»¡¼¥Ö¤¹¤ë¤«¤·¤Æ²¼¤µ¤¤¡£");
3994 msg_print("The gates to ANGBAND are closing...");
3995 msg_print("Please finish up and/or save your game.");
4005 msg_print("º£¡¢¥¢¥ó¥°¥Ð¥ó¥É¤Ø¤ÎÌ礬ÊĤ¶¤µ¤ì¤Þ¤·¤¿¡£");
4007 msg_print("The gates to ANGBAND are now closed.");
4012 p_ptr->playing = FALSE;
4015 p_ptr->leaving = TRUE;
4020 /*** Attempt timed autosave ***/
4021 if (autosave_t && autosave_freq && !p_ptr->inside_battle)
4023 if (!(turn % ((s32b)autosave_freq * TURNS_PER_TICK)))
4024 do_cmd_save_game(TRUE);
4030 msg_print("²¿¤«¤¬Ê¹¤³¤¨¤¿¡£");
4032 msg_print("You hear noise.");
4036 /*** Handle the wilderness/town (sunshine) ***/
4038 /* While in town/wilderness */
4039 if (!dun_level && !p_ptr->inside_quest && !p_ptr->inside_battle && !p_ptr->inside_arena)
4041 /* Hack -- Daybreak/Nighfall in town */
4042 if (!(turn % ((TURNS_PER_TICK * TOWN_DAWN) / 2)))
4046 /* Check for dawn */
4047 dawn = (!(turn % (TURNS_PER_TICK * TOWN_DAWN)));
4056 msg_print("Ì뤬ÌÀ¤±¤¿¡£");
4058 msg_print("The sun has risen.");
4061 if (!p_ptr->wild_mode)
4063 /* Hack -- Scan the town */
4064 for (y = 0; y < cur_hgt; y++)
4066 for (x = 0; x < cur_wid; x++)
4068 /* Get the cave grid */
4069 cave_type *c_ptr = &cave[y][x];
4072 c_ptr->info |= (CAVE_GLOW);
4074 /* Hack -- Memorize lit grids if allowed */
4075 if (view_perma_grids) c_ptr->info |= (CAVE_MARK);
4077 /* Hack -- Notice spot */
4091 msg_print("Æü¤¬ÄÀ¤ó¤À¡£");
4093 msg_print("The sun has fallen.");
4096 if (!p_ptr->wild_mode)
4098 /* Hack -- Scan the town */
4099 for (y = 0; y < cur_hgt; y++)
4101 for (x = 0; x < cur_wid; x++)
4103 /* Get the cave grid */
4104 cave_type *c_ptr = &cave[y][x];
4106 /* Feature code (applying "mimic" field) */
4107 feature_type *f_ptr = &f_info[get_feat_mimic(c_ptr)];
4109 if (!is_mirror_grid(c_ptr) && !have_flag(f_ptr->flags, FF_QUEST_ENTER) &&
4110 !have_flag(f_ptr->flags, FF_ENTRANCE))
4113 c_ptr->info &= ~(CAVE_GLOW);
4115 if (!have_flag(f_ptr->flags, FF_REMEMBER))
4117 /* Forget the normal floor grid */
4118 c_ptr->info &= ~(CAVE_MARK);
4120 /* Hack -- Notice spot */
4126 /* Glow deep lava and building entrances */
4127 glow_deep_lava_and_bldg();
4132 /* Update the monsters */
4133 p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
4136 p_ptr->redraw |= (PR_MAP);
4139 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4143 /* While in the dungeon (vanilla_town or lite_town mode only) */
4144 else if ((vanilla_town || (lite_town && !p_ptr->inside_quest && !p_ptr->inside_battle && !p_ptr->inside_arena)) && dun_level)
4146 /*** Shuffle the Storekeepers ***/
4148 /* Chance is only once a day (while in dungeon) */
4149 if (!(turn % (TURNS_PER_TICK * STORE_TICKS)))
4151 /* Sometimes, shuffle the shop-keepers */
4152 if (one_in_(STORE_SHUFFLE))
4156 /* Pick a random shop (except home and museum) */
4159 n = randint0(MAX_STORES);
4161 while ((n == STORE_HOME) || (n == STORE_MUSEUM));
4163 /* Check every feature */
4164 for (i = 1; i < max_f_idx; i++)
4166 /* Access the index */
4167 feature_type *f_ptr = &f_info[i];
4169 /* Skip empty index */
4170 if (!f_ptr->name) continue;
4172 /* Skip non-store features */
4173 if (!have_flag(f_ptr->flags, FF_STORE)) continue;
4175 /* Verify store type */
4176 if (f_ptr->power == n)
4180 if (cheat_xtra) msg_format("%s¤ÎŹ¼ç¤ò¥·¥ã¥Ã¥Õ¥ë¤·¤Þ¤¹¡£", f_name + f_ptr->name);
4182 if (cheat_xtra) msg_format("Shuffle a Shopkeeper of %s.", f_name + f_ptr->name);
4196 /*** Process the monsters ***/
4198 /* Check for creature generation. */
4199 if (one_in_(d_info[dungeon_type].max_m_alloc_chance) &&
4200 !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->inside_battle)
4202 /* Make a new monster */
4203 (void)alloc_monster(MAX_SIGHT + 5, 0);
4206 /* Hack -- Check for creature regeneration */
4207 if (!(turn % (TURNS_PER_TICK*10)) && !p_ptr->inside_battle) regen_monsters();
4208 if (!(turn % (TURNS_PER_TICK*3))) regen_captured_monsters();
4210 /* Hack -- Process the counters of all monsters */
4211 process_monsters_counters();
4217 if (min != prev_min)
4219 do_cmd_write_nikki(NIKKI_HIGAWARI, 0, NULL);
4220 determine_today_mon(FALSE);
4225 * Nightmare mode activates the TY_CURSE at midnight
4227 * Require exact minute -- Don't activate multiple times in a minute
4229 if (ironman_nightmare && (min != prev_min))
4231 /* Every 15 minutes after 11:00 pm */
4232 if ((hour == 23) && !(min % 15))
4241 msg_print("±ó¤¯¤ÇÉÔµ¤Ì£¤Ê¾â¤Î²»¤¬ÌĤä¿¡£");
4243 msg_print("You hear a distant bell toll ominously.");
4249 msg_print("±ó¤¯¤Ç¾â¤¬Æó²óÌĤä¿¡£");
4251 msg_print("A distant bell sounds twice.");
4257 msg_print("±ó¤¯¤Ç¾â¤¬»°²óÌĤä¿¡£");
4259 msg_print("A distant bell sounds three times.");
4265 msg_print("±ó¤¯¤Ç¾â¤¬»Í²óÌĤä¿¡£");
4267 msg_print("A distant bell tolls four times.");
4273 /* TY_CURSE activates at mignight! */
4280 msg_print("±ó¤¯¤Ç¾â¤¬²¿²ó¤âÌĤꡢ»à¤ó¤À¤è¤¦¤ÊÀŤ±¤µ¤ÎÃæ¤Ø¾Ã¤¨¤Æ¤¤¤Ã¤¿¡£");
4282 msg_print("A distant bell tolls many times, fading into an deathly silence.");
4285 activate_ty_curse(FALSE, &count);
4290 /*** Check the Food, and Regenerate ***/
4292 if (!p_ptr->inside_battle)
4294 /* Digest quickly when gorged */
4295 if (p_ptr->food >= PY_FOOD_MAX)
4297 /* Digest a lot of food */
4298 (void)set_food(p_ptr->food - 100);
4301 /* Digest normally -- Every 50 game turns */
4302 else if (!(turn % (TURNS_PER_TICK*5)))
4304 /* Basic digestion rate based on speed */
4305 int digestion = SPEED_TO_ENERGY(p_ptr->pspeed);
4307 /* Regeneration takes more food */
4308 if (p_ptr->regenerate)
4310 if (p_ptr->special_defense & (KAMAE_MASK | KATA_MASK))
4312 if (p_ptr->cursed & TRC_FAST_DIGEST)
4315 /* Slow digestion takes less food */
4316 if (p_ptr->slow_digest)
4319 /* Minimal digestion */
4320 if (digestion < 1) digestion = 1;
4321 /* Maximal digestion */
4322 if (digestion > 100) digestion = 100;
4324 /* Digest some food */
4325 (void)set_food(p_ptr->food - digestion);
4330 if ((p_ptr->food < PY_FOOD_FAINT))
4332 /* Faint occasionally */
4333 if (!p_ptr->paralyzed && (randint0(100) < 10))
4337 msg_print("¤¢¤Þ¤ê¤Ë¤â¶õÊ¢¤Çµ¤À䤷¤Æ¤·¤Þ¤Ã¤¿¡£");
4339 msg_print("You faint from the lack of food.");
4344 /* Hack -- faint (bypass free action) */
4345 (void)set_paralyzed(p_ptr->paralyzed + 1 + randint0(5));
4348 /* Starve to death (slowly) */
4349 if (p_ptr->food < PY_FOOD_STARVE)
4351 /* Calculate damage */
4352 int dam = (PY_FOOD_STARVE - p_ptr->food) / 10;
4356 if (!IS_INVULN()) take_hit(DAMAGE_LOSELIFE, dam, "¶õÊ¢", -1);
4358 if (!IS_INVULN()) take_hit(DAMAGE_LOSELIFE, dam, "starvation", -1);
4366 /* Process timed damage and regeneration */
4367 process_world_aux_hp_and_sp();
4369 /* Process timeout */
4370 process_world_aux_timeout();
4373 process_world_aux_light();
4375 /* Process mutation effects */
4376 process_world_aux_mutation();
4378 /* Process curse effects */
4379 process_world_aux_curse();
4381 /* Process recharging */
4382 process_world_aux_recharge();
4384 /* Feel the inventory */
4388 /* Involuntary Movement */
4389 process_world_aux_movement();
4395 * Verify use of "wizard" mode
4397 static bool enter_wizard_mode(void)
4399 /* Ask first time */
4400 if (!p_ptr->noscore)
4402 /* Wizard mode is not permitted */
4403 if (!allow_debug_opts || arg_wizard)
4406 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ ");
4408 msg_print("Wizard mode is not permitted.");
4413 /* Mention effects */
4415 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤Ï¥Ç¥Ð¥Ã¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥â¡¼¥É¤Ç¤¹¡£ ");
4416 msg_print("°ìÅÙ¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ë¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
4418 msg_print("Wizard mode is for debugging and experimenting.");
4419 msg_print("The game will not be scored if you enter wizard mode.");
4424 /* Verify request */
4426 if (!get_check("ËÜÅö¤Ë¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆþ¤ê¤¿¤¤¤Î¤Ç¤¹¤«? "))
4428 if (!get_check("Are you sure you want to enter wizard mode? "))
4435 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÆÍÆþ¤·¤Æ¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
4437 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up recording score to enter wizard mode.");
4440 p_ptr->noscore |= 0x0002;
4451 * Verify use of "debug" commands
4453 static bool enter_debug_mode(void)
4455 /* Ask first time */
4456 if (!p_ptr->noscore)
4458 /* Debug mode is not permitted */
4459 if (!allow_debug_opts)
4462 msg_print("¥Ç¥Ð¥Ã¥°¥³¥Þ¥ó¥É¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ ");
4464 msg_print("Use of debug command is not permitted.");
4469 /* Mention effects */
4471 msg_print("¥Ç¥Ð¥Ã¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥Ã¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ ");
4472 msg_print("¥Ç¥Ð¥Ã¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
4474 msg_print("The debug commands are for debugging and experimenting.");
4475 msg_print("The game will not be scored if you use debug commands.");
4480 /* Verify request */
4482 if (!get_check("ËÜÅö¤Ë¥Ç¥Ð¥Ã¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? "))
4484 if (!get_check("Are you sure you want to use debug commands? "))
4491 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥Ç¥Ð¥Ã¥°¥â¡¼¥É¤ËÆÍÆþ¤·¤Æ¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
4493 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use debug commands.");
4496 p_ptr->noscore |= 0x0008;
4504 * Hack -- Declare the Debug Routines
4506 extern void do_cmd_debug(void);
4508 #endif /* ALLOW_WIZARD */
4514 * Verify use of "borg" commands
4516 static bool enter_borg_mode(void)
4518 /* Ask first time */
4519 if (!(p_ptr->noscore & 0x0010))
4521 /* Mention effects */
4523 msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤Ï¥Ç¥Ð¥Ã¥°¤È¼Â¸³¤Î¤¿¤á¤Î¥³¥Þ¥ó¥É¤Ç¤¹¡£ ");
4524 msg_print("¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¦¤È¥¹¥³¥¢¤ÏµÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
4526 msg_print("The borg commands are for debugging and experimenting.");
4527 msg_print("The game will not be scored if you use borg commands.");
4532 /* Verify request */
4534 if (!get_check("ËÜÅö¤Ë¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»È¤¤¤Þ¤¹¤«? "))
4536 if (!get_check("Are you sure you want to use borg commands? "))
4543 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥Ü¡¼¥°¡¦¥³¥Þ¥ó¥É¤ò»ÈÍѤ·¤Æ¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£");
4545 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up recording score to use borg commands.");
4548 p_ptr->noscore |= 0x0010;
4556 * Hack -- Declare the Ben Borg
4558 extern void do_cmd_borg(void);
4560 #endif /* ALLOW_BORG */
4565 * Parse and execute the current command
4566 * Give "Warning" on illegal commands.
4568 * XXX XXX XXX Make some "blocks"
4570 static void process_command(void)
4572 int old_now_message = now_message;
4574 #ifdef ALLOW_REPEAT /* TNB */
4576 /* Handle repeating the last command */
4579 #endif /* ALLOW_REPEAT -- TNB */
4583 /* Parse the command */
4584 switch (command_cmd)
4600 /*** Wizard Commands ***/
4602 /* Toggle Wizard Mode */
4607 p_ptr->wizard = FALSE;
4609 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É²ò½ü¡£");
4611 msg_print("Wizard mode off.");
4615 else if (enter_wizard_mode())
4617 p_ptr->wizard = TRUE;
4619 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥ÉÆÍÆþ¡£");
4621 msg_print("Wizard mode on.");
4626 /* Update monsters */
4627 p_ptr->update |= (PU_MONSTERS);
4629 /* Redraw "title" */
4630 p_ptr->redraw |= (PR_TITLE);
4638 /* Special "debug" commands */
4641 /* Enter debug mode */
4642 if (enter_debug_mode())
4649 #endif /* ALLOW_WIZARD */
4654 /* Special "borg" commands */
4657 /* Enter borg mode */
4658 if (enter_borg_mode())
4660 if (!p_ptr->wild_mode) do_cmd_borg();
4666 #endif /* ALLOW_BORG */
4670 /*** Inventory Commands ***/
4672 /* Wear/wield equipment */
4675 if (!p_ptr->wild_mode) do_cmd_wield();
4679 /* Take off equipment */
4682 if (!p_ptr->wild_mode) do_cmd_takeoff();
4689 if (!p_ptr->wild_mode) do_cmd_drop();
4693 /* Destroy an item */
4700 /* Equipment list */
4707 /* Inventory list */
4715 /*** Various commands ***/
4717 /* Identify an object */
4724 /* Hack -- toggle windows */
4727 toggle_inven_equip();
4732 /*** Standard "Movement" Commands ***/
4737 if (!p_ptr->wild_mode) do_cmd_alter();
4744 if (!p_ptr->wild_mode) do_cmd_tunnel();
4748 /* Move (usually pick up things) */
4751 #ifdef ALLOW_EASY_DISARM /* TNB */
4755 #else /* ALLOW_EASY_DISARM -- TNB */
4757 do_cmd_walk(always_pickup);
4759 #endif /* ALLOW_EASY_DISARM -- TNB */
4764 /* Move (usually do not pick up) */
4767 #ifdef ALLOW_EASY_DISARM /* TNB */
4771 #else /* ALLOW_EASY_DISARM -- TNB */
4773 do_cmd_walk(!always_pickup);
4775 #endif /* ALLOW_EASY_DISARM -- TNB */
4781 /*** Running, Resting, Searching, Staying */
4783 /* Begin Running -- Arg is Max Distance */
4786 if (!p_ptr->wild_mode) do_cmd_run();
4790 /* Stay still (usually pick things up) */
4793 do_cmd_stay(always_pickup);
4797 /* Stay still (usually do not pick up) */
4800 do_cmd_stay(!always_pickup);
4804 /* Rest -- Arg is time */
4811 /* Search for traps/doors */
4818 /* Toggle search mode */
4821 if (p_ptr->action == ACTION_SEARCH) set_action(ACTION_NONE);
4822 else set_action(ACTION_SEARCH);
4827 /*** Stairs and Doors and Chests and Traps ***/
4830 case SPECIAL_KEY_STORE:
4832 if (!p_ptr->wild_mode) do_cmd_store();
4836 /* Enter building -KMW- */
4837 case SPECIAL_KEY_BUILDING:
4839 if (!p_ptr->wild_mode) do_cmd_bldg();
4843 /* Enter quest level -KMW- */
4844 case SPECIAL_KEY_QUEST:
4846 if (!p_ptr->wild_mode) do_cmd_quest();
4850 /* Go up staircase */
4853 if (!p_ptr->wild_mode && !dun_level && !p_ptr->inside_arena && !p_ptr->inside_quest)
4855 if (vanilla_town) break;
4860 msg_print("½±·â¤«¤éƨ¤²¤ë¤Ë¤Ï¥Þ¥Ã¥×¤Îü¤Þ¤Ç°ÜÆ°¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£");
4862 msg_print("To flee the ambush you have to reach the edge of the map.");
4867 if (p_ptr->food < PY_FOOD_WEAK)
4870 msg_print("¤½¤ÎÁ°¤Ë¿©»ö¤ò¤È¤é¤Ê¤¤¤È¡£");
4872 msg_print("You must eat something here.");
4884 /* Go down staircase */
4887 if (p_ptr->wild_mode)
4895 /* Open a door or chest */
4898 if (!p_ptr->wild_mode) do_cmd_open();
4905 if (!p_ptr->wild_mode) do_cmd_close();
4909 /* Jam a door with spikes */
4912 if (!p_ptr->wild_mode) do_cmd_spike();
4919 if (!p_ptr->wild_mode) do_cmd_bash();
4923 /* Disarm a trap or chest */
4926 if (!p_ptr->wild_mode) do_cmd_disarm();
4931 /*** Magic and Prayers ***/
4933 /* Gain new spells/prayers */
4936 if ((p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
4938 msg_print("¼öʸ¤ò³Ø½¬¤¹¤ëɬÍפϤʤ¤¡ª");
4940 msg_print("You don't have to learn spells!");
4942 else if (p_ptr->pclass == CLASS_SAMURAI)
4943 do_cmd_gain_hissatsu();
4944 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4954 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
4955 (p_ptr->pclass == CLASS_BERSERKER) ||
4956 (p_ptr->pclass == CLASS_NINJA) ||
4957 (p_ptr->pclass == CLASS_MIRROR_MASTER)
4958 ) do_cmd_mind_browse();
4959 else if (p_ptr->pclass == CLASS_SMITH)
4961 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
4962 do_cmd_magic_eater(TRUE);
4963 else do_cmd_browse();
4971 if (!p_ptr->wild_mode)
4973 if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_ARCHER) || (p_ptr->pclass == CLASS_CAVALRY))
4976 msg_print("¼öʸ¤ò¾§¤¨¤é¤ì¤Ê¤¤¡ª");
4978 msg_print("You cannot cast spells!");
4981 else if (dun_level && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
4984 msg_print("¥À¥ó¥¸¥ç¥ó¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
4986 msg_print("The dungeon absorbs all attempted magic!");
4990 else if (p_ptr->anti_magic && (p_ptr->pclass != CLASS_BERSERKER) && (p_ptr->pclass != CLASS_SMITH))
4994 cptr which_power = "ËâË¡";
4996 cptr which_power = "magic";
4998 if (p_ptr->pclass == CLASS_MINDCRAFTER)
5000 which_power = "ĶǽÎÏ";
5002 which_power = "psionic powers";
5004 else if (p_ptr->pclass == CLASS_IMITATOR)
5006 which_power = "¤â¤Î¤Þ¤Í";
5008 which_power = "imitation";
5010 else if (p_ptr->pclass == CLASS_SAMURAI)
5012 which_power = "ɬ»¦·õ";
5014 which_power = "hissatsu";
5016 else if (p_ptr->pclass == CLASS_MIRROR_MASTER)
5018 which_power = "¶ÀËâË¡";
5020 which_power = "mirror magic";
5022 else if (p_ptr->pclass == CLASS_NINJA)
5024 which_power = "Ǧ½Ñ";
5026 which_power = "ninjutsu";
5028 else if (mp_ptr->spell_book == TV_LIFE_BOOK)
5030 which_power = "µ§¤ê";
5032 which_power = "prayer";
5036 msg_format("È¿ËâË¡¥Ð¥ê¥¢¤¬%s¤ò¼ÙË⤷¤¿¡ª", which_power);
5038 msg_format("An anti-magic shell disrupts your %s!", which_power);
5042 else if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER))
5045 msg_format("¶¸Àï»Î²½¤·¤Æ¤¤¤ÆƬ¤¬²ó¤é¤Ê¤¤¡ª");
5047 msg_format("You cannot think directly!");
5053 if ((p_ptr->pclass == CLASS_MINDCRAFTER) ||
5054 (p_ptr->pclass == CLASS_BERSERKER) ||
5055 (p_ptr->pclass == CLASS_NINJA) ||
5056 (p_ptr->pclass == CLASS_MIRROR_MASTER)
5059 else if (p_ptr->pclass == CLASS_IMITATOR)
5061 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
5062 do_cmd_magic_eater(FALSE);
5063 else if (p_ptr->pclass == CLASS_SAMURAI)
5065 else if (p_ptr->pclass == CLASS_BLUE_MAGE)
5066 do_cmd_cast_learned();
5067 else if (p_ptr->pclass == CLASS_SMITH)
5076 /* Issue a pet command */
5079 if (!p_ptr->wild_mode) do_cmd_pet();
5083 /*** Use various objects ***/
5085 /* Inscribe an object */
5092 /* Uninscribe an object */
5095 do_cmd_uninscribe();
5099 /* Activate an artifact */
5102 if (!p_ptr->wild_mode)
5104 if (!p_ptr->inside_arena)
5109 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
5111 msg_print("The arena absorbs all attempted magic!");
5127 /* Fuel your lantern/torch */
5137 if (!p_ptr->wild_mode) do_cmd_fire();
5144 if (!p_ptr->wild_mode)
5154 if (!p_ptr->wild_mode)
5156 if (!p_ptr->inside_arena)
5161 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
5163 msg_print("The arena absorbs all attempted magic!");
5175 if (!p_ptr->wild_mode)
5177 if (p_ptr->inside_arena)
5180 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
5182 msg_print("The arena absorbs all attempted magic!");
5187 else if (use_command && rogue_like_commands)
5199 /* Quaff a potion */
5202 if (!p_ptr->wild_mode)
5204 if (!p_ptr->inside_arena)
5205 do_cmd_quaff_potion();
5209 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
5211 msg_print("The arena absorbs all attempted magic!");
5223 if (!p_ptr->wild_mode)
5225 if (!p_ptr->inside_arena)
5226 do_cmd_read_scroll();
5230 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
5232 msg_print("The arena absorbs all attempted magic!");
5244 if (!p_ptr->wild_mode)
5246 if (p_ptr->inside_arena)
5249 msg_print("¥¢¥ê¡¼¥Ê¤¬ËâË¡¤òµÛ¼ý¤·¤¿¡ª");
5251 msg_print("The arena absorbs all attempted magic!");
5256 else if (use_command && !rogue_like_commands)
5266 /* Use racial power */
5269 if (!p_ptr->wild_mode) do_cmd_racial_power();
5274 /*** Looking at Things (nearby or on map) ***/
5276 /* Full dungeon map */
5283 /* Locate player on map */
5297 /* Target monster or location */
5300 if (!p_ptr->wild_mode) do_cmd_target();
5306 /*** Help and Such ***/
5315 /* Identify symbol */
5318 do_cmd_query_symbol();
5322 /* Character description */
5325 do_cmd_change_name();
5330 /*** System Commands ***/
5332 /* Hack -- User interface */
5339 /* Single line from a pref file */
5348 do_cmd_reload_autopick();
5354 do_cmd_edit_autopick();
5358 /* Interact with macros */
5365 /* Interact with visuals */
5373 /* Interact with colors */
5381 /* Interact with options */
5389 /*** Misc Commands ***/
5405 /* Repeat level feeling */
5408 if (!p_ptr->wild_mode) do_cmd_feeling();
5412 /* Show previous message */
5415 do_cmd_message_one();
5419 /* Show previous messages */
5422 do_cmd_messages(old_now_message);
5426 /* Show quest status -KMW- */
5429 do_cmd_checkquest();
5433 /* Redraw the screen */
5436 now_message = old_now_message;
5441 #ifndef VERIFY_SAVEFILE
5443 /* Hack -- Save and don't quit */
5446 do_cmd_save_game(FALSE);
5450 #endif /* VERIFY_SAVEFILE */
5460 case SPECIAL_KEY_QUIT:
5462 do_cmd_save_and_exit();
5466 /* Quit (commit suicide) */
5479 /* Check artifacts, uniques, objects */
5486 /* Load "screen dump" */
5489 do_cmd_load_screen();
5493 /* Save "screen dump" */
5496 do_cmd_save_screen();
5500 /* Make random artifact list */
5503 spoil_random_artifact("randifact.txt");
5507 /* Hack -- Unknown command */
5510 if (flush_failure) flush();
5514 sound(SOUND_ILLEGAL);
5516 if (!get_rnd_line("error_j.txt", 0, error_m))
5518 if (!get_rnd_line("error.txt", 0, error_m))
5525 prt(" '?' ¤Ç¥Ø¥ë¥×¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£", 0, 0);
5527 prt("Type '?' for help.", 0, 0);
5533 if (!energy_use && !now_message)
5534 now_message = old_now_message;
5540 static bool monster_tsuri(int r_idx)
5542 monster_race *r_ptr = &r_info[r_idx];
5544 if ((r_ptr->flags7 & RF7_AQUATIC) && !(r_ptr->flags1 & RF1_UNIQUE) && my_strchr("Jjlw", r_ptr->d_char))
5552 * Process the player
5554 * Notice the annoying code to handle "pack overflow", which
5555 * must come first just in case somebody manages to corrupt
5556 * the savefiles by clever use of menu commands or something.
5558 static void process_player(void)
5562 /*** Apply energy ***/
5567 msg_print("²¿¤«ÊѤï¤Ã¤¿µ¤¤¬¤¹¤ë¡ª");
5569 msg_print("You feel different!");
5572 (void)gain_random_mutation(0);
5573 hack_mutation = FALSE;
5576 if (p_ptr->inside_battle)
5578 for(i = 1; i < m_max; i++)
5580 monster_type *m_ptr = &m_list[i];
5582 if (!m_ptr->r_idx) continue;
5584 /* Hack -- Detect monster */
5585 m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
5587 /* Update the monster */
5588 update_mon(i, FALSE);
5593 /* Give the player some energy */
5594 else if (!(load && p_ptr->energy_need <= 0))
5596 p_ptr->energy_need -= SPEED_TO_ENERGY(p_ptr->pspeed);
5600 if (p_ptr->energy_need > 0) return;
5601 if (!command_rep) prt_time();
5603 /*** Check for interupts ***/
5605 /* Complete resting */
5612 if ((p_ptr->chp == p_ptr->mhp) &&
5613 (p_ptr->csp >= p_ptr->msp))
5615 set_action(ACTION_NONE);
5619 /* Complete resting */
5620 else if (resting == -2)
5623 if ((p_ptr->chp == p_ptr->mhp) &&
5624 (p_ptr->csp >= p_ptr->msp) &&
5625 !p_ptr->blind && !p_ptr->confused &&
5626 !p_ptr->poisoned && !p_ptr->afraid &&
5627 !p_ptr->stun && !p_ptr->cut &&
5628 !p_ptr->slow && !p_ptr->paralyzed &&
5629 !p_ptr->image && !p_ptr->word_recall &&
5630 !p_ptr->alter_reality)
5632 set_action(ACTION_NONE);
5637 if (p_ptr->action == ACTION_FISH)
5640 Term_xtra(TERM_XTRA_DELAY, 10);
5644 bool success = FALSE;
5645 get_mon_num_prep(monster_tsuri,NULL);
5646 r_idx = get_mon_num(dun_level ? dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level);
5648 if (r_idx && one_in_(2))
5651 y = py+ddy[tsuri_dir];
5652 x = px+ddx[tsuri_dir];
5653 if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE))
5656 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
5658 msg_format("%s¤¬Äà¤ì¤¿¡ª", m_name);
5660 msg_format("You have a good catch!", m_name);
5668 msg_print("±Â¤À¤±¿©¤ï¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª¤¯¤Ã¤½¡Á¡ª");
5670 msg_print("Damn! The fish stole your bait!");
5677 /* Handle "abort" */
5680 /* Check for "player abort" (semi-efficiently for resting) */
5681 if (running || command_rep || (p_ptr->action == ACTION_REST) || (p_ptr->action == ACTION_FISH))
5686 /* Check for a key */
5695 /* Hack -- Show a Message */
5697 msg_print("ÃæÃǤ·¤Þ¤·¤¿¡£");
5699 msg_print("Canceled.");
5706 if (p_ptr->riding && !p_ptr->confused && !p_ptr->blind)
5708 monster_type *m_ptr = &m_list[p_ptr->riding];
5709 monster_race *r_ptr = &r_info[m_ptr->r_idx];
5718 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
5720 /* Acquire the monster name */
5721 monster_desc(m_name, m_ptr, 0);
5723 msg_format("%^s¤òµ¯¤³¤·¤¿¡£", m_name);
5725 msg_format("You have waked %s up.", m_name);
5727 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5728 p_ptr->redraw |= (PR_UHEALTH);
5735 /* Make a "saving throw" against stun */
5736 if (randint0(r_ptr->level) < p_ptr->skill_exp[GINOU_RIDING])
5742 /* Hack -- Recover from stun */
5743 if (m_ptr->stunned > d)
5745 /* Recover somewhat */
5746 m_ptr->stunned -= d;
5757 /* Acquire the monster name */
5758 monster_desc(m_name, m_ptr, 0);
5760 /* Dump a message */
5762 msg_format("%^s¤òÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5764 msg_format("%^s is no longer stunned.", m_name);
5766 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5767 p_ptr->redraw |= (PR_UHEALTH);
5771 if (m_ptr->confused)
5775 /* Make a "saving throw" against stun */
5776 if (randint0(r_ptr->level) < p_ptr->skill_exp[GINOU_RIDING])
5779 d = m_ptr->confused;
5782 /* Hack -- Recover from stun */
5783 if (m_ptr->confused > d)
5785 /* Recover somewhat */
5786 m_ptr->confused -= d;
5795 m_ptr->confused = 0;
5797 /* Acquire the monster name */
5798 monster_desc(m_name, m_ptr, 0);
5800 /* Dump a message */
5802 msg_format("%^s¤òº®Íð¾õÂÖ¤«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5804 msg_format("%^s is no longer confused.", m_name);
5806 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5807 p_ptr->redraw |= (PR_UHEALTH);
5815 /* Make a "saving throw" against stun */
5816 if (randint0(r_ptr->level) < p_ptr->skill_exp[GINOU_RIDING])
5822 /* Hack -- Recover from stun */
5823 if (m_ptr->monfear > d)
5825 /* Recover somewhat */
5826 m_ptr->monfear -= d;
5837 /* Acquire the monster name */
5838 monster_desc(m_name, m_ptr, 0);
5840 /* Dump a message */
5842 msg_format("%^s¤ò¶²Éݤ«¤éΩ¤Áľ¤é¤»¤¿¡£", m_name);
5844 msg_format("%^s is no longer fear.", m_name);
5846 if (p_ptr->health_who == p_ptr->riding) p_ptr->redraw |= (PR_HEALTH);
5847 p_ptr->redraw |= (PR_UHEALTH);
5851 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
5855 /* Handle the player song */
5856 if (!load) check_music();
5861 if (p_ptr->lightspeed)
5863 (void)set_lightspeed(p_ptr->lightspeed - 1, TRUE);
5865 if ((p_ptr->pclass == CLASS_FORCETRAINER) && (p_ptr->magic_num1[0]))
5867 if (p_ptr->magic_num1[0] < 40)
5869 p_ptr->magic_num1[0] = 0;
5871 else p_ptr->magic_num1[0] -= 40;
5872 p_ptr->update |= (PU_BONUS);
5874 if (p_ptr->action == ACTION_LEARN)
5877 u32b cost_frac = (p_ptr->msp + 30L) * 256L;
5879 /* Convert the unit (1/2^16) to (1/2^32) */
5880 s64b_LSHIFT(cost, cost_frac, 16);
5883 if (s64b_cmp(p_ptr->csp, p_ptr->csp_frac, cost, cost_frac) < 0)
5887 p_ptr->csp_frac = 0;
5888 set_action(ACTION_NONE);
5893 s64b_sub(&(p_ptr->csp), &(p_ptr->csp_frac), cost, cost_frac);
5895 p_ptr->redraw |= PR_MANA;
5898 if (p_ptr->special_defense & KATA_MASK)
5900 if (p_ptr->special_defense & KATA_MUSOU)
5904 set_action(ACTION_NONE);
5909 p_ptr->redraw |= (PR_MANA);
5914 /*** Handle actual user input ***/
5916 /* Repeat until out of energy */
5917 while (p_ptr->energy_need <= 0)
5919 p_ptr->window |= PW_PLAYER;
5920 p_ptr->sutemi = FALSE;
5921 p_ptr->counter = FALSE;
5922 now_damaged = FALSE;
5924 /* Handle "p_ptr->notice" */
5927 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
5930 /* Place the cursor on the player */
5931 move_cursor_relative(py, px);
5933 /* Refresh (optional) */
5934 if (fresh_before) Term_fresh();
5937 /* Hack -- Pack Overflow */
5938 if (inventory[INVEN_PACK].k_idx)
5940 int item = INVEN_PACK;
5942 char o_name[MAX_NLEN];
5946 /* Access the slot to be dropped */
5947 o_ptr = &inventory[item];
5954 msg_print("¥¶¥Ã¥¯¤«¤é¥¢¥¤¥Æ¥à¤¬¤¢¤Õ¤ì¤¿¡ª");
5956 msg_print("Your pack overflows!");
5961 object_desc(o_name, o_ptr, 0);
5965 msg_format("%s(%c)¤òÍî¤È¤·¤¿¡£", o_name, index_to_label(item));
5967 msg_format("You drop %s (%c).", o_name, index_to_label(item));
5971 /* Drop it (carefully) near the player */
5972 (void)drop_near(o_ptr, 0, py, px);
5974 /* Modify, Describe, Optimize */
5975 inven_item_increase(item, -255);
5976 inven_item_describe(item);
5977 inven_item_optimize(item);
5979 /* Handle "p_ptr->notice" */
5982 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
5987 /* Hack -- cancel "lurking browse mode" */
5988 if (!command_new) command_see = FALSE;
5991 /* Assume free turn */
5995 if (p_ptr->inside_battle)
5997 /* Place the cursor on the player */
5998 move_cursor_relative(py, px);
6000 command_cmd = SPECIAL_KEY_BUILDING;
6002 /* Process the command */
6006 /* Paralyzed or Knocked Out */
6007 else if (p_ptr->paralyzed || (p_ptr->stun >= 100))
6014 else if (p_ptr->action == ACTION_REST)
6019 /* Reduce rest count */
6022 if (!resting) set_action(ACTION_NONE);
6024 /* Redraw the state */
6025 p_ptr->redraw |= (PR_STATE);
6033 else if (p_ptr->action == ACTION_FISH)
6046 /* Repeated command */
6047 else if (command_rep)
6049 /* Count this execution */
6052 /* Redraw the state */
6053 p_ptr->redraw |= (PR_STATE);
6058 /* Hack -- Assume messages were seen */
6061 /* Clear the top line */
6064 /* Process the command */
6068 /* Normal command */
6071 /* Place the cursor on the player */
6072 move_cursor_relative(py, px);
6075 /* Get a command (normal) */
6076 request_command(FALSE);
6079 /* Process the command */
6089 /* Use some energy */
6090 if (world_player || energy_use > 400)
6092 /* The Randomness is irrelevant */
6093 p_ptr->energy_need += energy_use * TURNS_PER_TICK / 10;
6097 /* There is some randomness of needed energy */
6098 p_ptr->energy_need += (s16b)((s32b)energy_use * ENERGY_NEED() / 100L);
6101 /* Hack -- constant hallucination */
6102 if (p_ptr->image) p_ptr->redraw |= (PR_MAP);
6105 /* Shimmer monsters if needed */
6106 if (shimmer_monsters)
6108 /* Clear the flag */
6109 shimmer_monsters = FALSE;
6111 /* Shimmer multi-hued monsters */
6112 for (i = 1; i < m_max; i++)
6114 monster_type *m_ptr;
6115 monster_race *r_ptr;
6117 /* Access monster */
6120 /* Skip dead monsters */
6121 if (!m_ptr->r_idx) continue;
6123 /* Skip unseen monsters */
6124 if (!m_ptr->ml) continue;
6126 /* Access the monster race */
6127 r_ptr = &r_info[m_ptr->ap_r_idx];
6129 /* Skip non-multi-hued monsters */
6130 if (!(r_ptr->flags1 & (RF1_ATTR_MULTI | RF1_SHAPECHANGER)))
6133 /* Reset the flag */
6134 shimmer_monsters = TRUE;
6136 /* Redraw regardless */
6137 lite_spot(m_ptr->fy, m_ptr->fx);
6142 /* Handle monster detection */
6143 if (repair_monsters)
6145 /* Reset the flag */
6146 repair_monsters = FALSE;
6148 /* Rotate detection flags */
6149 for (i = 1; i < m_max; i++)
6151 monster_type *m_ptr;
6153 /* Access monster */
6156 /* Skip dead monsters */
6157 if (!m_ptr->r_idx) continue;
6159 /* Nice monsters get mean */
6160 if (m_ptr->mflag & MFLAG_NICE)
6162 /* Nice monsters get mean */
6163 m_ptr->mflag &= ~(MFLAG_NICE);
6166 /* Handle memorized monsters */
6167 if (m_ptr->mflag2 & MFLAG2_MARK)
6169 /* Maintain detection */
6170 if (m_ptr->mflag2 & MFLAG2_SHOW)
6173 m_ptr->mflag2 &= ~(MFLAG2_SHOW);
6175 /* Still need repairs */
6176 repair_monsters = TRUE;
6179 /* Remove detection */
6183 m_ptr->mflag2 &= ~(MFLAG2_MARK);
6185 /* Assume invisible */
6188 /* Update the monster */
6189 update_mon(i, FALSE);
6191 if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH);
6192 if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH);
6194 /* Redraw regardless */
6195 lite_spot(m_ptr->fy, m_ptr->fx);
6200 if (p_ptr->pclass == CLASS_IMITATOR)
6202 if (p_ptr->mane_num > (p_ptr->lev > 44 ? 3 : p_ptr->lev > 29 ? 2 : 1))
6205 for (i = 0; i < p_ptr->mane_num; i++)
6207 p_ptr->mane_spell[i] = p_ptr->mane_spell[i+1];
6208 p_ptr->mane_dam[i] = p_ptr->mane_dam[i+1];
6212 p_ptr->redraw |= (PR_MANE);
6214 if (p_ptr->action == ACTION_LEARN)
6217 p_ptr->redraw |= (PR_STATE);
6220 if (world_player && (p_ptr->energy_need > - 1000))
6223 p_ptr->redraw |= (PR_MAP);
6225 /* Update monsters */
6226 p_ptr->update |= (PU_MONSTERS);
6229 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
6232 msg_print("¡Ö»þ¤ÏÆ°¤¤À¤¹¡Ä¡×");
6234 msg_print("You feel time flowing around you once more.");
6237 world_player = FALSE;
6238 p_ptr->energy_need = ENERGY_NEED();
6240 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
6245 /* Hack -- notice death */
6246 if (!p_ptr->playing || p_ptr->is_dead)
6248 world_player = FALSE;
6252 /* Handle "leaving" */
6253 if (p_ptr->leaving) break;
6256 /* Update scent trail */
6262 * Interact with the current dungeon level.
6264 * This function will not exit until the level is completed,
6265 * the user dies, or the game is terminated.
6267 static void dungeon(bool load_game)
6271 /* Set the base level */
6272 base_level = dun_level;
6274 /* Reset various flags */
6278 p_ptr->leaving = FALSE;
6280 /* Reset the "command" vars */
6283 #if 0 /* Don't reset here --- It's used for Arena */
6292 /* Cancel the target */
6296 ambush_flag = FALSE;
6298 /* Cancel the health bar */
6301 /* Check visual effects */
6302 shimmer_monsters = TRUE;
6303 shimmer_objects = TRUE;
6304 repair_monsters = TRUE;
6305 repair_objects = TRUE;
6311 /* Get index of current quest (if any) */
6312 quest_num = quest_number(dun_level);
6314 /* Inside a quest? */
6317 /* Mark the quest monster */
6318 r_info[quest[quest_num].r_idx].flags1 |= RF1_QUESTOR;
6321 /* Track maximum player level */
6322 if (p_ptr->max_plv < p_ptr->lev)
6324 p_ptr->max_plv = p_ptr->lev;
6328 /* Track maximum dungeon level (if not in quest -KMW-) */
6329 if ((max_dlv[dungeon_type] < dun_level) && !p_ptr->inside_quest)
6331 max_dlv[dungeon_type] = dun_level;
6332 if (record_maxdepth) do_cmd_write_nikki(NIKKI_MAXDEAPTH, dun_level, NULL);
6335 /* Validate the panel */
6336 panel_bounds_center();
6338 /* Verify the panel */
6341 /* Flush messages */
6345 /* Enter "xtra" mode */
6346 character_xtra = TRUE;
6349 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER | PW_MONSTER | PW_OVERHEAD | PW_DUNGEON);
6351 /* Redraw dungeon */
6352 p_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_EQUIPPY);
6355 p_ptr->redraw |= (PR_MAP);
6358 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
6360 /* Update lite/view */
6361 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE | PU_TORCH);
6363 /* Update monsters */
6364 p_ptr->update |= (PU_MONSTERS | PU_DISTANCE | PU_FLOW);
6366 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
6369 /* Leave "xtra" mode */
6370 character_xtra = FALSE;
6373 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
6375 /* Combine / Reorder the pack */
6376 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
6378 /* Handle "p_ptr->notice" */
6381 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
6387 if (quest_num && (is_fixed_quest_idx(quest_num) &&
6388 !((quest_num == QUEST_OBERON) || (quest_num == QUEST_SERPENT) ||
6389 !(quest[quest_num].flags & QUEST_FLAG_PRESET)))) do_cmd_feeling();
6391 if (p_ptr->inside_battle)
6395 p_ptr->energy_need = 0;
6401 msg_print("»î¹ç³«»Ï¡ª");
6403 msg_format("Ready..Fight!");
6409 if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] > MUSIC_DETECT))
6410 p_ptr->magic_num1[0] = MUSIC_DETECT;
6412 /* Hack -- notice death or departure */
6413 if (!p_ptr->playing || p_ptr->is_dead) return;
6415 /* Print quest message if appropriate */
6416 if (!p_ptr->inside_quest && (dungeon_type == DUNGEON_ANGBAND))
6418 quest_discovery(random_quest_number(dun_level));
6419 p_ptr->inside_quest = random_quest_number(dun_level);
6421 if ((dun_level == d_info[dungeon_type].maxdepth) && d_info[dungeon_type].final_guardian)
6423 if (r_info[d_info[dungeon_type].final_guardian].max_num)
6425 msg_format("¤³¤Î³¬¤Ë¤Ï%s¤Î¼ç¤Ç¤¢¤ë%s¤¬À³¤ó¤Ç¤¤¤ë¡£",
6426 d_name+d_info[dungeon_type].name,
6427 r_name+r_info[d_info[dungeon_type].final_guardian].name);
6429 msg_format("%^s lives in this level as the keeper of %s.",
6430 r_name+r_info[d_info[dungeon_type].final_guardian].name,
6431 d_name+d_info[dungeon_type].name);
6435 /*** Process this dungeon level ***/
6437 /* Reset the monster generation level */
6438 monster_level = base_level;
6440 /* Reset the object generation level */
6441 object_level = base_level;
6445 if (p_ptr->energy_need > 0 && !p_ptr->inside_battle &&
6446 (dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena))
6447 p_ptr->energy_need = 0;
6449 /* Not leaving dungeon */
6450 p_ptr->leaving_dungeon = FALSE;
6455 /* Hack -- Compact the monster list occasionally */
6456 if ((m_cnt + 32 > max_m_idx) && !p_ptr->inside_battle) compact_monsters(64);
6458 /* Hack -- Compress the monster list occasionally */
6459 if ((m_cnt + 32 < m_max) && !p_ptr->inside_battle) compact_monsters(0);
6462 /* Hack -- Compact the object list occasionally */
6463 if (o_cnt + 32 > max_o_idx) compact_objects(64);
6465 /* Hack -- Compress the object list occasionally */
6466 if (o_cnt + 32 < o_max) compact_objects(0);
6469 /* Process the player */
6472 /* Handle "p_ptr->notice" */
6475 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
6478 /* Hack -- Hilite the player */
6479 move_cursor_relative(py, px);
6481 /* Optional fresh */
6482 if (fresh_after) Term_fresh();
6484 /* Hack -- Notice death or departure */
6485 if (!p_ptr->playing || p_ptr->is_dead) break;
6487 /* Process all of the monsters */
6490 /* Handle "p_ptr->notice" */
6493 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
6496 /* Hack -- Hilite the player */
6497 move_cursor_relative(py, px);
6499 /* Optional fresh */
6500 if (fresh_after) Term_fresh();
6502 /* Hack -- Notice death or departure */
6503 if (!p_ptr->playing || p_ptr->is_dead) break;
6506 /* Process the world */
6509 /* Handle "p_ptr->notice" */
6512 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
6515 /* Hack -- Hilite the player */
6516 move_cursor_relative(py, px);
6518 /* Optional fresh */
6519 if (fresh_after) Term_fresh();
6521 /* Hack -- Notice death or departure */
6522 if (!p_ptr->playing || p_ptr->is_dead) break;
6524 /* Handle "leaving" */
6525 if (p_ptr->leaving) break;
6527 /* Count game turns */
6529 if (!p_ptr->wild_mode || wild_regen) dungeon_turn++;
6530 else if (p_ptr->wild_mode && !(turn % ((MAX_HGT + MAX_WID) / 2))) dungeon_turn++;
6531 if (wild_regen) wild_regen--;
6534 /* Inside a quest and non-unique questor? */
6535 if (quest_num && !(r_info[quest[quest_num].r_idx].flags1 & RF1_UNIQUE))
6537 /* Un-mark the quest monster */
6538 r_info[quest[quest_num].r_idx].flags1 &= ~RF1_QUESTOR;
6541 /* Not save-and-quit and not dead? */
6542 if (p_ptr->playing && !p_ptr->is_dead)
6545 * Maintain Unique monsters and artifact, save current
6546 * floor, then prepare next floor
6550 /* Forget the flag */
6551 reinit_wilderness = FALSE;
6554 /* Write about current level on the play record once per level */
6560 * Load some "user pref files"
6562 * Modified by Arcum Dagsson to support
6563 * separate macro files for different realms.
6565 static void load_all_pref_files(void)
6569 /* Access the "user" pref file */
6570 sprintf(buf, "user.prf");
6572 /* Process that file */
6573 process_pref_file(buf);
6575 /* Access the "user" system pref file */
6576 sprintf(buf, "user-%s.prf", ANGBAND_SYS);
6578 /* Process that file */
6579 process_pref_file(buf);
6581 /* Access the "race" pref file */
6582 sprintf(buf, "%s.prf", rp_ptr->title);
6584 /* Process that file */
6585 process_pref_file(buf);
6587 /* Access the "class" pref file */
6588 sprintf(buf, "%s.prf", cp_ptr->title);
6590 /* Process that file */
6591 process_pref_file(buf);
6593 /* Access the "character" pref file */
6594 sprintf(buf, "%s.prf", player_base);
6596 /* Process that file */
6597 process_pref_file(buf);
6599 /* Access the "realm 1" pref file */
6600 if (p_ptr->realm1 != REALM_NONE)
6602 sprintf(buf, "%s.prf", realm_names[p_ptr->realm1]);
6604 /* Process that file */
6605 process_pref_file(buf);
6608 /* Access the "realm 2" pref file */
6609 if (p_ptr->realm2 != REALM_NONE)
6611 sprintf(buf, "%s.prf", realm_names[p_ptr->realm2]);
6613 /* Process that file */
6614 process_pref_file(buf);
6618 /* Load an autopick preference file */
6619 autopick_load_pref(FALSE);
6624 * Extract option variables from bit sets
6626 void extract_option_vars(void)
6630 for (i = 0; option_info[i].o_desc; i++)
6632 int os = option_info[i].o_set;
6633 int ob = option_info[i].o_bit;
6635 /* Set the "default" options */
6636 if (option_info[i].o_var)
6639 if (option_flag[os] & (1L << ob))
6642 (*option_info[i].o_var) = TRUE;
6649 (*option_info[i].o_var) = FALSE;
6657 * Determine bounty uniques
6659 void determine_bounty_uniques(void)
6662 monster_race *r_ptr;
6664 get_mon_num_prep(NULL, NULL);
6665 for (i = 0; i < MAX_KUBI; i++)
6669 kubi_r_idx[i] = get_mon_num(MAX_DEPTH - 1);
6670 r_ptr = &r_info[kubi_r_idx[i]];
6672 if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
6674 if (!(r_ptr->flags9 & (RF9_DROP_CORPSE | RF9_DROP_SKELETON))) continue;
6676 if (r_ptr->rarity > 100) continue;
6678 if (no_questor_or_bounty_uniques(kubi_r_idx[i])) continue;
6680 for (j = 0; j < i; j++)
6681 if (kubi_r_idx[i] == kubi_r_idx[j]) break;
6688 for (i = 0; i < MAX_KUBI - 1; i++)
6690 for (j = i; j < MAX_KUBI; j++)
6692 if (r_info[kubi_r_idx[i]].level > r_info[kubi_r_idx[j]].level)
6694 tmp = kubi_r_idx[i];
6695 kubi_r_idx[i] = kubi_r_idx[j];
6696 kubi_r_idx[j] = tmp;
6704 * Determine today's bounty monster
6705 * Note: conv_old is used if loaded 0.0.3 or older save file
6707 void determine_today_mon(bool conv_old)
6710 bool old_inside_battle = p_ptr->inside_battle;
6711 monster_race *r_ptr;
6715 for (i = 0; i < max_d_idx; i++)
6717 if (max_dlv[i] < d_info[i].mindepth) continue;
6718 if (max_dl < max_dlv[i]) max_dl = max_dlv[i];
6721 else max_dl = MAX(max_dlv[DUNGEON_ANGBAND], 3);
6723 p_ptr->inside_battle = TRUE;
6724 get_mon_num_prep(NULL, NULL);
6728 today_mon = get_mon_num(max_dl);
6729 r_ptr = &r_info[today_mon];
6731 if (r_ptr->flags1 & RF1_UNIQUE) continue;
6732 if (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)) continue;
6733 if (r_ptr->flags2 & RF2_MULTIPLY) continue;
6734 if ((r_ptr->flags9 & (RF9_DROP_CORPSE | RF9_DROP_SKELETON)) != (RF9_DROP_CORPSE | RF9_DROP_SKELETON)) continue;
6735 if (r_ptr->level < MIN(max_dl / 2, 40)) continue;
6736 if (r_ptr->rarity > 10) continue;
6740 p_ptr->today_mon = 0;
6741 p_ptr->inside_battle = old_inside_battle;
6746 * Actually play a game
6748 * If the "new_game" parameter is true, then, after loading the
6749 * savefile, we will commit suicide, if necessary, to allow the
6750 * player to start a new game.
6752 void play_game(bool new_game)
6755 bool load_game = TRUE;
6765 else if (chuukei_server)
6767 prepare_chuukei_hooks();
6771 hack_mutation = FALSE;
6773 /* Hack -- Character is "icky" */
6774 character_icky = TRUE;
6776 /* Make sure main term is active */
6777 Term_activate(angband_term[0]);
6779 /* Initialise the resize hooks */
6780 angband_term[0]->resize_hook = resize_map;
6782 for (i = 1; i < 8; i++)
6784 /* Does the term exist? */
6785 if (angband_term[i])
6787 /* Add the redraw on resize hook */
6788 angband_term[i]->resize_hook = redraw_window;
6792 /* Hack -- turn off the cursor */
6793 (void)Term_set_cursor(0);
6796 /* Attempt to load */
6801 quit("¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤¬²õ¤ì¤Æ¤¤¤Þ¤¹");
6803 quit("broken savefile");
6808 /* Extract the options */
6809 extract_option_vars();
6811 /* Report waited score */
6812 if (p_ptr->wait_report_score)
6818 if (!get_check_strict("ÂÔµ¡¤·¤Æ¤¤¤¿¥¹¥³¥¢ÅÐÏ¿¤òº£¹Ô¤Ê¤¤¤Þ¤¹¤«¡©", CHECK_NO_HISTORY))
6820 if (!get_check_strict("Do you register score now? ", CHECK_NO_HISTORY))
6825 p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
6830 p_ptr->is_dead = TRUE;
6832 start_time = time(NULL);
6834 /* No suspending now */
6835 signals_ignore_tstp();
6837 /* Hack -- Character is now "icky" */
6838 character_icky = TRUE;
6840 /* Build the filename */
6841 path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
6843 /* Open the high score file, for reading/writing */
6844 highscore_fd = fd_open(buf, O_RDWR);
6846 /* Handle score, show Top scores */
6847 success = send_world_score(TRUE);
6850 if (!success && !get_check_strict("¥¹¥³¥¢ÅÐÏ¿¤òÄü¤á¤Þ¤¹¤«¡©", CHECK_NO_HISTORY))
6852 if (!success && !get_check_strict("Do you give up score registration? ", CHECK_NO_HISTORY))
6856 prt("°ú¤Â³¤ÂÔµ¡¤·¤Þ¤¹¡£", 0, 0);
6858 prt("standing by for future registration...", 0, 0);
6864 p_ptr->wait_report_score = FALSE;
6867 if (!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
6869 if (!save_player()) msg_print("death save failed!");
6872 /* Shut the high score file */
6873 (void)fd_close(highscore_fd);
6875 /* Forget the high score fd */
6878 /* Allow suspending now */
6879 signals_handle_tstp();
6884 /* Nothing loaded */
6885 if (!character_loaded)
6887 /* Make new player */
6890 /* The dungeon is not ready */
6891 character_dungeon = FALSE;
6893 /* Prepare to init the RNG */
6896 /* Initialize the saved floors data */
6897 init_saved_floors(FALSE);
6900 /* Old game is loaded. But new game is requested. */
6903 /* Initialize the saved floors data */
6904 init_saved_floors(TRUE);
6907 /* Process old character */
6910 /* Process the player name */
6911 process_player_name(FALSE);
6920 seed = (time(NULL));
6924 /* Mutate the seed on Unix machines */
6925 seed = ((seed >> 3) * (getpid() << 1));
6929 /* Use the complex RNG */
6932 /* Seed the "complex" RNG */
6933 Rand_state_init(seed);
6936 /* Roll new character */
6939 /* The dungeon is not ready */
6940 character_dungeon = FALSE;
6944 p_ptr->inside_quest = 0;
6945 p_ptr->inside_arena = FALSE;
6946 p_ptr->inside_battle = FALSE;
6950 /* Hack -- seed for flavors */
6951 seed_flavor = randint0(0x10000000);
6953 /* Hack -- seed for town layout */
6954 seed_town = randint0(0x10000000);
6956 /* Roll up a new character */
6964 determine_bounty_uniques();
6965 determine_today_mon(FALSE);
6969 write_level = FALSE;
6972 do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ----¥²¡¼¥àºÆ³«----");
6974 do_cmd_write_nikki(NIKKI_GAMESTART, 1, " ---- Restart Game ----");
6978 * 1.0.9 °ÊÁ°¤Ï¥»¡¼¥ÖÁ°¤Ë p_ptr->riding = -1 ¤È¤·¤Æ¤¤¤¿¤Î¤Ç¡¢ºÆÀßÄ꤬ɬÍפÀ¤Ã¤¿¡£
6979 * ¤â¤¦ÉÔÍפÀ¤¬¡¢°ÊÁ°¤Î¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤È¤Î¸ß´¹¤Î¤¿¤á¤Ë»Ä¤·¤Æ¤ª¤¯¡£
6981 if (p_ptr->riding == -1)
6984 for (i = m_max; i > 0; i--)
6986 if (player_bold(m_list[i].fy, m_list[i].fx))
6995 p_ptr->teleport_town = FALSE;
6996 p_ptr->sutemi = FALSE;
6997 world_monster = FALSE;
6998 now_damaged = FALSE;
7000 start_time = time(NULL) - 1;
7001 record_o_name[0] = '\0';
7003 /* Reset map panel */
7004 panel_row_min = cur_hgt;
7005 panel_col_min = cur_wid;
7007 /* Sexy gal gets bonus to maximum weapon skill of whip */
7008 if (p_ptr->pseikaku == SEIKAKU_SEXY)
7009 s_info[p_ptr->pclass].w_max[TV_HAFTED-TV_WEAPON_BEGIN][SV_WHIP] = WEAPON_EXP_MASTER;
7011 /* Fill the arrays of floors and walls in the good proportions */
7012 set_floor_and_wall(dungeon_type);
7014 /* Flavor the objects */
7022 /* Flash a message */
7024 prt("¤ªÂÔ¤Á²¼¤µ¤¤...", 0, 0);
7026 prt("Please wait...", 0, 0);
7030 /* Flush the message */
7034 /* Hack -- Enter wizard mode */
7037 if (enter_wizard_mode())
7039 p_ptr->wizard = TRUE;
7041 if (p_ptr->is_dead || !py || !px)
7043 /* Initialize the saved floors data */
7044 init_saved_floors(TRUE);
7047 p_ptr->inside_quest = 0;
7049 /* Avoid crash in update_view() */
7053 else if (p_ptr->is_dead)
7055 quit("Already dead.");
7059 /* Initialize the town-buildings if necessary */
7060 if (!dun_level && !p_ptr->inside_quest)
7062 /* Init the wilderness */
7064 process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x);
7067 init_flags = INIT_ONLY_BUILDINGS;
7069 process_dungeon_file("t_info.txt", 0, 0, MAX_HGT, MAX_WID);
7074 /* Generate a dungeon level if needed */
7075 if (!character_dungeon)
7082 /* HACK -- Restore from panic-save */
7083 if (p_ptr->panic_save)
7085 /* No player? -- Try to regenerate floor */
7089 msg_print("¥×¥ì¥¤¥ä¡¼¤Î°ÌÃÖ¤¬¤ª¤«¤·¤¤¡£¥Õ¥í¥¢¤òºÆÀ¸À®¤·¤Þ¤¹¡£");
7091 msg_print("What a strange player location. Regenerate the dungeon floor.");
7096 /* Still no player? -- Try to locate random place */
7097 if (!py || !px) py = px = 10;
7099 /* No longer in panic */
7100 p_ptr->panic_save = 0;
7104 /* Character is now "complete" */
7105 character_generated = TRUE;
7108 /* Hack -- Character is no longer "icky" */
7109 character_icky = FALSE;
7117 sprintf(buf, "%s¤Ë¹ß¤êΩ¤Ã¤¿¡£", map_name());
7119 sprintf(buf, "You are standing in the %s.", map_name());
7121 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf);
7126 p_ptr->playing = TRUE;
7128 /* Reset the visual mappings */
7131 /* Load the "pref" files */
7132 load_all_pref_files();
7134 /* React to changes */
7135 Term_xtra(TERM_XTRA_REACT, 0);
7138 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
7141 p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
7147 /* Set or clear "rogue_like_commands" if requested */
7148 if (arg_force_original) rogue_like_commands = FALSE;
7149 if (arg_force_roguelike) rogue_like_commands = TRUE;
7151 /* Hack -- Enforce "delayed death" */
7152 if (p_ptr->chp < 0) p_ptr->is_dead = TRUE;
7154 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
7156 if (new_game && ((p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BEASTMASTER)))
7158 monster_type *m_ptr;
7159 int pet_r_idx = ((p_ptr->pclass == CLASS_CAVALRY) ? MON_HORSE : MON_YASE_HORSE);
7160 monster_race *r_ptr = &r_info[pet_r_idx];
7161 place_monster_aux(0, py, px - 1, pet_r_idx,
7162 (PM_FORCE_PET | PM_NO_KAGE));
7163 m_ptr = &m_list[hack_m_idx_ii];
7164 m_ptr->mspeed = r_ptr->speed;
7165 m_ptr->maxhp = r_ptr->hdice*(r_ptr->hside+1)/2;
7166 m_ptr->max_maxhp = m_ptr->maxhp;
7167 m_ptr->hp = r_ptr->hdice*(r_ptr->hside+1)/2;
7168 m_ptr->energy_need = ENERGY_NEED() + ENERGY_NEED();
7174 /* Process the level */
7177 /* Handle "p_ptr->notice" */
7180 /* Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" */
7183 /* Cancel the target */
7186 /* Cancel the health bar */
7190 /* Forget the lite */
7193 /* Forget the view */
7196 /* Forget the view */
7199 /* Handle "quit and save" */
7200 if (!p_ptr->playing && !p_ptr->is_dead) break;
7202 /* Erase the old cave */
7204 if (!p_ptr->is_dead) wipe_m_list();
7212 /* Accidental Death */
7213 if (p_ptr->playing && p_ptr->is_dead)
7215 if (p_ptr->inside_arena)
7217 p_ptr->inside_arena = FALSE;
7218 if (p_ptr->arena_number > MAX_ARENA_MONS)
7219 p_ptr->arena_number++;
7221 p_ptr->arena_number = -1 - p_ptr->arena_number;
7222 p_ptr->is_dead = FALSE;
7224 p_ptr->chp_frac = 0;
7225 p_ptr->exit_bldg = TRUE;
7228 /* Leave through the exit */
7229 prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_RAND_CONNECT);
7231 /* prepare next floor */
7236 /* Mega-Hack -- Allow player to cheat death */
7238 if ((p_ptr->wizard || cheat_live) && !get_check("»à¤Ë¤Þ¤¹¤«? "))
7240 if ((p_ptr->wizard || cheat_live) && !get_check("Die? "))
7244 /* Mark social class, reset age, if needed */
7245 if (p_ptr->sc) p_ptr->sc = p_ptr->age = 0;
7251 p_ptr->noscore |= 0x0001;
7255 msg_print("¥¦¥£¥¶¡¼¥É¥â¡¼¥É¤ËÇ°¤òÁ÷¤ê¡¢»à¤òµ½¤¤¤¿¡£");
7257 msg_print("You invoke wizard mode and cheat death.");
7263 /* Restore hit points */
7264 p_ptr->chp = p_ptr->mhp;
7265 p_ptr->chp_frac = 0;
7267 if (p_ptr->pclass == CLASS_MAGIC_EATER)
7269 for (i = 0; i < EATER_EXT*2; i++)
7271 p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*EATER_CHARGE;
7273 for (; i < EATER_EXT*3; i++)
7275 p_ptr->magic_num1[i] = 0;
7278 /* Restore spell points */
7279 p_ptr->csp = p_ptr->msp;
7280 p_ptr->csp_frac = 0;
7282 /* Hack -- cancel recall */
7283 if (p_ptr->word_recall)
7287 msg_print("Ä¥¤ê¤Ä¤á¤¿Â絤¤¬Î®¤ìµî¤Ã¤¿...");
7289 msg_print("A tension leaves the air around you...");
7294 /* Hack -- Prevent recall */
7295 p_ptr->word_recall = 0;
7296 p_ptr->redraw |= (PR_STATUS);
7299 /* Hack -- cancel alter */
7300 if (p_ptr->alter_reality)
7302 /* Hack -- Prevent alter */
7303 p_ptr->alter_reality = 0;
7304 p_ptr->redraw |= (PR_STATUS);
7307 /* Note cause of death XXX XXX XXX */
7309 (void)strcpy(p_ptr->died_from, "»à¤Îµ½¤");
7311 (void)strcpy(p_ptr->died_from, "Cheating death");
7315 p_ptr->is_dead = FALSE;
7317 /* Hack -- Healing */
7319 (void)set_confused(0);
7320 (void)set_poisoned(0);
7321 (void)set_afraid(0);
7322 (void)set_paralyzed(0);
7327 /* Hack -- Prevent starvation */
7328 (void)set_food(PY_FOOD_MAX - 1);
7331 p_ptr->inside_arena = FALSE;
7332 p_ptr->inside_battle = FALSE;
7334 p_ptr->inside_quest = 0;
7335 p_ptr->recall_dungeon = dungeon_type;
7337 if (lite_town || vanilla_town)
7339 p_ptr->wilderness_y = 1;
7340 p_ptr->wilderness_x = 1;
7354 p_ptr->wilderness_y = 48;
7355 p_ptr->wilderness_x = 5;
7361 p_ptr->wild_mode = FALSE;
7363 p_ptr->leaving = TRUE;
7366 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " ¤·¤«¤·¡¢À¸¤Ê֤ä¿¡£");
7368 do_cmd_write_nikki(NIKKI_BUNSHOU, 1, " but revived.");
7374 /* Handle "death" */
7375 if (p_ptr->is_dead) break;
7377 /* Make a new level */
7388 s32b turn_real(s32b hoge)
7390 switch (p_ptr->start_race)
7396 return hoge - (TURNS_PER_TICK * TOWN_DAWN * 3 / 4);