3 * @brief ¥×¥ì¥¤¥ä¡¼¤Î¥³¥Þ¥ó¥É½èÍý1 / Movement commands (part 1)
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research,
9 * and not for profit purposes provided that this copyright and statement
10 * are included in all such copies. Other copyrights may also apply.
13 * The running algorithm: -CJS-
15 * In the diagrams below, the player has just arrived in the
16 * grid marked as '@', and he has just come from a grid marked
17 * as 'o', and he is about to enter the grid marked as 'x'.
19 * Of course, if the "requested" move was impossible, then you
20 * will of course be blocked, and will stop.
22 * Overview: You keep moving until something interesting happens.
23 * If you are in an enclosed space, you follow corners. This is
24 * the usual corridor scheme. If you are in an open space, you go
25 * straight, but stop before entering enclosed space. This is
26 * analogous to reaching doorways. If you have enclosed space on
27 * one side only (that is, running along side a wall) stop if
28 * your wall opens out, or your open space closes in. Either case
29 * corresponds to a doorway.
31 * What happens depends on what you can really SEE. (i.e. if you
32 * have no light, then running along a dark corridor is JUST like
33 * running in a dark room.) The algorithm works equally well in
34 * corridors, rooms, mine tailings, earthquake rubble, etc, etc.
36 * These conditions are kept in static memory:
37 * find_openarea You are in the open on at least one
39 * find_breakleft You have a wall on the left, and will
41 * find_breakright You have a wall on the right, and will
44 * To initialize these conditions, we examine the grids adjacent
45 * to the grid marked 'x', two on each side (marked 'L' and 'R').
46 * If either one of the two grids on a given side is seen to be
47 * closed, then that side is considered to be closed. If both
48 * sides are closed, then it is an enclosed (corridor) run.
54 * Looking at more than just the immediate squares is
55 * significant. Consider the following case. A run along the
56 * corridor will stop just before entering the center point,
57 * because a choice is clearly established. Running in any of
58 * three available directions will be defined as a corridor run.
59 * Note that a minor hack is inserted to make the angled corridor
60 * entry (with one side blocked near and the other side blocked
61 * further away from the runner) work correctly. The runner moves
62 * diagonally, but then saves the previous direction as being
63 * straight into the gap. Otherwise, the tail end of the other
64 * entry would be perceived as an alternative on the next move.
72 * Likewise, a run along a wall, and then into a doorway (two
73 * runs) will work correctly. A single run rightwards from \@ will
74 * stop at 1. Another run right and down will enter the corridor
75 * and make the corner, stopping at the 2.
77 * \#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#
79 * \#\#\#\#\#\#\#\#\#\#\# \#\#\#\#\#\#
81 * \#\#\#\#\#\#\#\#\#\#\#\#\#
83 * After any move, the function area_affect is called to
84 * determine the new surroundings, and the direction of
85 * subsequent moves. It examines the current player location
86 * (at which the runner has just arrived) and the previous
87 * direction (from which the runner is considered to have come).
89 * Moving one square in some direction places you adjacent to
90 * three or five new squares (for straight and diagonal moves
91 * respectively) to which you were not previously adjacent,
92 * marked as '!' in the diagrams below.
95 * .o@@! (normal) .o.! (diagonal)
96 * ...! (east) ..@@! (south east)
99 * You STOP if any of the new squares are interesting in any way:
100 * for example, if they contain visible monsters or treasure.
102 * You STOP if any of the newly adjacent squares seem to be open,
103 * and you are also looking for a break on that side. (that is,
104 * find_openarea AND find_break).
106 * You STOP if any of the newly adjacent squares do NOT seem to be
107 * open and you are in an open area, and that side was previously
110 * Corners: If you are not in the open (i.e. you are in a corridor)
111 * and there is only one way to go in the new squares, then turn in
112 * that direction. If there are more than two new ways to go, STOP.
113 * If there are two ways to go, and those ways are separated by a
114 * square which does not seem to be open, then STOP.
116 * Otherwise, we have a potential corner. There are two new open
117 * squares, which are also adjacent. One of the new squares is
118 * diagonally located, the other is straight on (as in the diagram).
119 * We consider two more squares further out (marked below as ?).
121 * We assign "option" to the straight-on grid, and "option2" to the
122 * diagonal grid, and "check_dir" to the grid marked 's'.
128 * If they are both seen to be closed, then it is seen that no benefit
129 * is gained from moving straight. It is a known corner. To cut the
130 * corner, go diagonally, otherwise go straight, but pretend you
131 * stepped diagonally into that next location for a full view next
132 * time. Conversely, if one of the ? squares is not seen to be closed,
133 * then there is a potential choice. We check to see whether it is a
134 * potential corner or an intersection/room entrance. If the square
135 * two spaces straight ahead, and the space marked with 's' are both
136 * unknown space, then it is a potential corner and enter if
137 * find_examine is set, otherwise must stop because it is not a
138 * corner. (find_examine option is removed and always is TRUE.)
144 #define MAX_VAMPIRIC_DRAIN 50 /*!< µÛ·ì½èÍý¤ÎºÇÂç²óÉüHP */
148 * @brief ¥×¥ì¥¤¥ä¡¼¤«¤é¥â¥ó¥¹¥¿¡¼¤Ø¤Î¼Í·âÌ¿ÃæȽÄê /
149 * Determine if the player "hits" a monster (normal combat).
150 * @param chance ´ðËÜÌ¿ÃæÃÍ
151 * @param m_ptr ¥â¥ó¥¹¥¿¡¼¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
152 * @param vis ÌÜɸ¤ò»ë³¦¤ËÊá¤é¤¨¤Æ¤¤¤ë¤Ê¤é¤ÐTRUE¤ò»ØÄê
153 * @param o_name ¥á¥Ã¥»¡¼¥¸É½¼¨»þ¤Î¥â¥ó¥¹¥¿¡¼Ì¾
154 * @return Ì¿Ãæ¤ÈȽÄꤵ¤ì¤¿¾ì¹çTRUE¤òÊÖ¤¹
155 * @note Always miss 5%, always hit 5%, otherwise random.
157 bool test_hit_fire(int chance, monster_type *m_ptr, int vis, char* o_name)
160 monster_race *r_ptr = &r_info[m_ptr->r_idx];
163 if(m_ptr->r_idx == MON_GOEMON && !MON_CSLEEP(m_ptr)) ac *= 3;
165 /* Percentile dice */
168 /* Snipers with high-concentration reduce instant miss percentage.*/
171 /* Hack -- Instant miss or hit */
172 if (k < 10) return (k < 5);
174 if (p_ptr->pseikaku == SEIKAKU_NAMAKE)
175 if (one_in_(20)) return (FALSE);
178 if (chance <= 0) return (FALSE);
180 /* Invisible monsters are harder to hit */
181 if (!vis) chance = (chance + 1) / 2;
183 /* Power competes against armor */
184 if (randint0(chance) < (ac * 3 / 4))
186 if(m_ptr->r_idx == MON_GOEMON && !MON_CSLEEP(m_ptr))
190 /* Extract monster name */
191 monster_desc(m_name, m_ptr, 0);
192 msg_format(_("%s¤Ï%s¤ò»Â¤ê¼Î¤Æ¤¿¡ª", "%s cuts down %s!"), m_name, o_name);
204 * @brief ¥×¥ì¥¤¥ä¡¼¤«¤é¥â¥ó¥¹¥¿¡¼¤Ø¤ÎÂÇ·âÌ¿ÃæȽÄê /
205 * Determine if the player "hits" a monster (normal combat).
206 * @param chance ´ðËÜÌ¿ÃæÃÍ
207 * @param ac ¥â¥ó¥¹¥¿¡¼¤ÎAC
208 * @param vis ÌÜɸ¤ò»ë³¦¤ËÊá¤é¤¨¤Æ¤¤¤ë¤Ê¤é¤ÐTRUE¤ò»ØÄê
209 * @return Ì¿Ãæ¤ÈȽÄꤵ¤ì¤¿¾ì¹çTRUE¤òÊÖ¤¹
210 * @note Always miss 5%, always hit 5%, otherwise random.
212 bool test_hit_norm(int chance, int ac, int vis)
216 /* Percentile dice */
219 /* Hack -- Instant miss or hit */
220 if (k < 10) return (k < 5);
222 if (p_ptr->pseikaku == SEIKAKU_NAMAKE)
223 if (one_in_(20)) return (FALSE);
225 /* Wimpy attack never hits */
226 if (chance <= 0) return (FALSE);
228 /* Penalize invisible targets */
229 if (!vis) chance = (chance + 1) / 2;
231 /* Power must defeat armor */
232 if (randint0(chance) < (ac * 3 / 4)) return (FALSE);
241 * @brief ¥×¥ì¥¤¥ä¡¼¤«¤é¥â¥ó¥¹¥¿¡¼¤Ø¤Î¼Í·â¥¯¥ê¥Æ¥£¥«¥ëȽÄê /
242 * Critical hits (from objects thrown by player) Factor in item weight, total plusses, and player level.
243 * @param weight ÌðÃƤνÅÎÌ
244 * @param plus_ammo ÌðÃƤÎÌ¿Ã潤Àµ
245 * @param plus_bow µÝ¤ÎÌ¿Ã潤Àµ
246 * @param dam ¸½ºß»»½ÐÃæ¤Î¥À¥á¡¼¥¸ÃÍ
247 * @return ¥¯¥ê¥Æ¥£¥«¥ë½¤Àµ¤¬Æþ¤Ã¤¿¥À¥á¡¼¥¸ÃÍ
249 s16b critical_shot(int weight, int plus_ammo, int plus_bow, int dam)
252 object_type *j_ptr = &inventory[INVEN_BOW];
254 /* Extract "shot" power */
255 i = p_ptr->to_h_b + plus_ammo;
257 if (p_ptr->tval_ammo == TV_BOLT)
258 i = (p_ptr->skill_thb + (p_ptr->weapon_exp[0][j_ptr->sval] / 400 + i) * BTH_PLUS_ADJ);
260 i = (p_ptr->skill_thb + ((p_ptr->weapon_exp[0][j_ptr->sval] - (WEAPON_EXP_MASTER / 2)) / 200 + i) * BTH_PLUS_ADJ);
263 /* Snipers can shot more critically with crossbows */
264 if (p_ptr->concent) i += ((i * p_ptr->concent) / 5);
265 if ((p_ptr->pclass == CLASS_SNIPER) && (p_ptr->tval_ammo == TV_BOLT)) i *= 2;
267 /* Good bow makes more critical */
268 i += plus_bow * 8 * (p_ptr->concent ? p_ptr->concent + 5 : 5);
271 if (randint1(10000) <= i)
273 k = weight * randint1(500);
278 msg_print("¼ê¤´¤¿¤¨¤¬¤¢¤Ã¤¿¡ª");
280 msg_print("It was a good hit!");
288 msg_print("¤«¤Ê¤ê¤Î¼ê¤´¤¿¤¨¤¬¤¢¤Ã¤¿¡ª");
290 msg_print("It was a great hit!");
298 msg_print("²ñ¿´¤Î°ì·â¤À¡ª");
300 msg_print("It was a superb hit!");
313 * @brief ¥×¥ì¥¤¥ä¡¼¤«¤é¥â¥ó¥¹¥¿¡¼¤Ø¤ÎÂǷ⥯¥ê¥Æ¥£¥«¥ëȽÄê /
314 * Critical hits (by player) Factor in weapon weight, total plusses, player melee bonus
315 * @param weight ÌðÃƤνÅÎÌ
316 * @param plus Éð´ï¤ÎÌ¿Ã潤Àµ
317 * @param dam ¸½ºß»»½ÐÃæ¤Î¥À¥á¡¼¥¸ÃÍ
318 * @param meichuu ÂÇ·â¤Î´ðËÜÌ¿ÃæÎÏ
319 * @param mode ¥ª¥×¥·¥ç¥ó¥Õ¥é¥°
320 * @return ¥¯¥ê¥Æ¥£¥«¥ë½¤Àµ¤¬Æþ¤Ã¤¿¥À¥á¡¼¥¸ÃÍ
322 s16b critical_norm(int weight, int plus, int dam, s16b meichuu, int mode)
326 /* Extract "blow" power */
327 i = (weight + (meichuu * 3 + plus * 5) + p_ptr->skill_thn);
330 if ((randint1((p_ptr->pclass == CLASS_NINJA) ? 4444 : 5000) <= i) || (mode == HISSATSU_MAJIN) || (mode == HISSATSU_3DAN))
332 k = weight + randint1(650);
333 if ((mode == HISSATSU_MAJIN) || (mode == HISSATSU_3DAN)) k+= randint1(650);
338 msg_print("¼ê¤´¤¿¤¨¤¬¤¢¤Ã¤¿¡ª");
340 msg_print("It was a good hit!");
348 msg_print("¤«¤Ê¤ê¤Î¼ê¤´¤¿¤¨¤¬¤¢¤Ã¤¿¡ª");
350 msg_print("It was a great hit!");
358 msg_print("²ñ¿´¤Î°ì·â¤À¡ª");
360 msg_print("It was a superb hit!");
368 msg_print("ºÇ¹â¤Î²ñ¿´¤Î°ì·â¤À¡ª");
370 msg_print("It was a *GREAT* hit!");
378 msg_print("ÈæÎà¤Ê¤ºÇ¹â¤Î²ñ¿´¤Î°ì·â¤À¡ª");
380 msg_print("It was a *SUPERB* hit!");
383 dam = ((7 * dam) / 2) + 25;
393 * @brief ¥×¥ì¥¤¥ä¡¼¹¶·â¤Î¼ï²¥¹¥ì¥¤¥ó¥°ÇÜΨ·×»»
394 * @param mult »»½ÐÁ°¤Î´ðËÜÇÜΨ(/10ÇÜ)
395 * @param flgs ¥¹¥ì¥¤¥Õ¥é¥°ÇÛÎó
396 * @param m_ptr ÌÜɸ¥â¥ó¥¹¥¿¡¼¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
397 * @return ¥¹¥ì¥¤¥ó¥°²ÃÌ£¸å¤ÎÇÜΨ(/10ÇÜ)
399 static int mult_slaying(int mult, const u32b* flgs, const monster_type* m_ptr)
401 static const struct slay_table_t {
403 u32b affect_race_flag;
406 size_t r_flag_offset;
408 #define OFFSET(X) offsetof(monster_race, X)
409 {TR_SLAY_ANIMAL, RF3_ANIMAL, 25, OFFSET(flags3), OFFSET(r_flags3)},
410 {TR_KILL_ANIMAL, RF3_ANIMAL, 40, OFFSET(flags3), OFFSET(r_flags3)},
411 {TR_SLAY_EVIL, RF3_EVIL, 20, OFFSET(flags3), OFFSET(r_flags3)},
412 {TR_KILL_EVIL, RF3_EVIL, 35, OFFSET(flags3), OFFSET(r_flags3)},
413 {TR_SLAY_GOOD, RF3_GOOD, 20, OFFSET(flags3), OFFSET(r_flags3)},
414 {TR_KILL_GOOD, RF3_GOOD, 35, OFFSET(flags3), OFFSET(r_flags3)},
415 {TR_SLAY_HUMAN, RF2_HUMAN, 25, OFFSET(flags2), OFFSET(r_flags2)},
416 {TR_KILL_HUMAN, RF2_HUMAN, 40, OFFSET(flags2), OFFSET(r_flags2)},
417 {TR_SLAY_UNDEAD, RF3_UNDEAD, 30, OFFSET(flags3), OFFSET(r_flags3)},
418 {TR_KILL_UNDEAD, RF3_UNDEAD, 50, OFFSET(flags3), OFFSET(r_flags3)},
419 {TR_SLAY_DEMON, RF3_DEMON, 30, OFFSET(flags3), OFFSET(r_flags3)},
420 {TR_KILL_DEMON, RF3_DEMON, 50, OFFSET(flags3), OFFSET(r_flags3)},
421 {TR_SLAY_ORC, RF3_ORC, 30, OFFSET(flags3), OFFSET(r_flags3)},
422 {TR_KILL_ORC, RF3_ORC, 50, OFFSET(flags3), OFFSET(r_flags3)},
423 {TR_SLAY_TROLL, RF3_TROLL, 30, OFFSET(flags3), OFFSET(r_flags3)},
424 {TR_KILL_TROLL, RF3_TROLL, 50, OFFSET(flags3), OFFSET(r_flags3)},
425 {TR_SLAY_GIANT, RF3_GIANT, 30, OFFSET(flags3), OFFSET(r_flags3)},
426 {TR_KILL_GIANT, RF3_GIANT, 50, OFFSET(flags3), OFFSET(r_flags3)},
427 {TR_SLAY_DRAGON, RF3_DRAGON, 30, OFFSET(flags3), OFFSET(r_flags3)},
428 {TR_KILL_DRAGON, RF3_DRAGON, 50, OFFSET(flags3), OFFSET(r_flags3)},
432 monster_race* r_ptr = &r_info[m_ptr->r_idx];
434 for (i = 0; i < sizeof(slay_table) / sizeof(slay_table[0]); ++ i)
436 const struct slay_table_t* p = &slay_table[i];
438 if ((have_flag(flgs, p->slay_flag)) &&
439 (atoffset(u32b, r_ptr, p->flag_offset) & p->affect_race_flag))
441 if (is_original_ap_and_seen(m_ptr))
443 atoffset(u32b, r_ptr, p->r_flag_offset) |= p->affect_race_flag;
446 mult = MAX(mult, p->slay_mult);
454 * @brief ¥×¥ì¥¤¥ä¡¼¹¶·â¤Î°À¥¹¥ì¥¤¥ó¥°ÇÜΨ·×»»
455 * @param mult »»½ÐÁ°¤Î´ðËÜÇÜΨ(/10ÇÜ)
456 * @param flgs ¥¹¥ì¥¤¥Õ¥é¥°ÇÛÎó
457 * @param m_ptr ÌÜɸ¥â¥ó¥¹¥¿¡¼¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
458 * @return ¥¹¥ì¥¤¥ó¥°²ÃÌ£¸å¤ÎÇÜΨ(/10ÇÜ)
460 static int mult_brand(int mult, const u32b* flgs, const monster_type* m_ptr)
462 static const struct brand_table_t {
467 {TR_BRAND_ACID, RFR_EFF_IM_ACID_MASK, 0U },
468 {TR_BRAND_ELEC, RFR_EFF_IM_ELEC_MASK, 0U },
469 {TR_BRAND_FIRE, RFR_EFF_IM_FIRE_MASK, RF3_HURT_FIRE},
470 {TR_BRAND_COLD, RFR_EFF_IM_COLD_MASK, RF3_HURT_COLD},
471 {TR_BRAND_POIS, RFR_EFF_IM_POIS_MASK, 0U },
474 monster_race* r_ptr = &r_info[m_ptr->r_idx];
476 for (i = 0; i < sizeof(brand_table) / sizeof(brand_table[0]); ++ i)
478 const struct brand_table_t* p = &brand_table[i];
480 if (have_flag(flgs, p->brand_flag))
482 /* Notice immunity */
483 if (r_ptr->flagsr & p->resist_mask)
485 if (is_original_ap_and_seen(m_ptr))
487 r_ptr->r_flagsr |= (r_ptr->flagsr & p->resist_mask);
491 /* Otherwise, take the damage */
492 else if (r_ptr->flags3 & p->hurt_flag)
494 if (is_original_ap_and_seen(m_ptr))
496 r_ptr->r_flags3 |= p->hurt_flag;
499 mult = MAX(mult, 50);
503 mult = MAX(mult, 25);
512 * @brief ¥À¥á¡¼¥¸¤Ë¥¹¥ì¥¤Í×ÁǤò²Ã¤¨¤ëÁí¹ç½èÍý¥ë¡¼¥Á¥ó /
513 * Extract the "total damage" from a given object hitting a given monster.
514 * @param o_ptr »ÈÍÑÉð´ï¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
515 * @param tdam ¸½ºß»»½ÐÅÓÃæ¤Î¥À¥á¡¼¥¸ÃÍ
516 * @param m_ptr ÌÜɸ¥â¥ó¥¹¥¿¡¼¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
517 * @param mode ·õ½Ñ¤ÎID
518 * @param thrown ¼Í·â½èÍý¤Ê¤é¤ÐTRUE¤ò»ØÄꤹ¤ë
519 * @return Áí¹çŪ¤Ê¥¹¥ì¥¤¤ò²ÃÌ£¤·¤¿¥À¥á¡¼¥¸ÃÍ
521 * Note that "flasks of oil" do NOT do fire damage, although they\n
522 * certainly could be made to do so. XXX XXX\n
524 * Note that most brands and slays are x3, except Slay Animal (x2),\n
525 * Slay Evil (x2), and Kill dragon (x5).\n
527 s16b tot_dam_aux(object_type *o_ptr, int tdam, monster_type *m_ptr, int mode, bool thrown)
531 u32b flgs[TR_FLAG_SIZE];
533 /* Extract the flags */
534 object_flags(o_ptr, flgs);
535 torch_flags(o_ptr, flgs); /* torches has secret flags */
540 if (p_ptr->special_attack & (ATTACK_ACID)) add_flag(flgs, TR_BRAND_ACID);
541 if (p_ptr->special_attack & (ATTACK_COLD)) add_flag(flgs, TR_BRAND_COLD);
542 if (p_ptr->special_attack & (ATTACK_ELEC)) add_flag(flgs, TR_BRAND_ELEC);
543 if (p_ptr->special_attack & (ATTACK_FIRE)) add_flag(flgs, TR_BRAND_FIRE);
544 if (p_ptr->special_attack & (ATTACK_POIS)) add_flag(flgs, TR_BRAND_POIS);
547 /* Hex - Slay Good (Runesword) */
548 if (hex_spelling(HEX_RUNESWORD)) add_flag(flgs, TR_SLAY_GOOD);
550 /* Some "weapons" and "ammo" do extra damage */
563 mult = mult_slaying(mult, flgs, m_ptr);
565 /* Elemental Brand */
566 mult = mult_brand(mult, flgs, m_ptr);
569 if (p_ptr->pclass == CLASS_SAMURAI)
571 mult = mult_hissatsu(mult, flgs, m_ptr, mode);
575 if ((p_ptr->pclass != CLASS_SAMURAI) && (have_flag(flgs, TR_FORCE_WEAPON)) && (p_ptr->csp > (o_ptr->dd * o_ptr->ds / 5)))
577 p_ptr->csp -= (1+(o_ptr->dd * o_ptr->ds / 5));
578 p_ptr->redraw |= (PR_MANA);
579 mult = mult * 3 / 2 + 20;
582 /* Hack -- The Nothung cause special damage to Fafner */
583 if ((o_ptr->name1 == ART_NOTHUNG) && (m_ptr->r_idx == MON_FAFNER))
588 if (mult > 150) mult = 150;
590 /* Return the total damage */
591 return (tdam * mult / 10);
596 * @brief ÃÏ·Á¤ä¤½¤Î¾å¤Î¥¢¥¤¥Æ¥à¤Î±£¤µ¤ì¤¿Í×ÁǤòÌÀ¤«¤¹ /
597 * Search for hidden things
598 * @param y ÂоݤȤʤë¥Þ¥¹¤ÎYºÂɸ
599 * @param x ÂоݤȤʤë¥Þ¥¹¤ÎXºÂɸ
602 static void discover_hidden_things(int y, int x)
604 s16b this_o_idx, next_o_idx = 0;
608 /* Access the grid */
612 if (c_ptr->mimic && is_trap(c_ptr->feat))
618 msg_print(_("¥È¥é¥Ã¥×¤òȯ¸«¤·¤¿¡£", "You have found a trap."));
625 if (is_hidden_door(c_ptr))
628 msg_print(_("±£¤·¥É¥¢¤òȯ¸«¤·¤¿¡£", "You have found a secret door."));
637 /* Scan all objects in the grid */
638 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
643 o_ptr = &o_list[this_o_idx];
645 /* Acquire next object */
646 next_o_idx = o_ptr->next_o_idx;
648 /* Skip non-chests */
649 if (o_ptr->tval != TV_CHEST) continue;
651 /* Skip non-trapped chests */
652 if (!chest_traps[o_ptr->pval]) continue;
655 if (!object_is_known(o_ptr))
658 msg_print(_("È¢¤Ë»Å³Ý¤±¤é¤ì¤¿¥È¥é¥Ã¥×¤òȯ¸«¤·¤¿¡ª", "You have discovered a trap on the chest!"));
670 * @brief ¥×¥ì¥¤¥ä¡¼¤Îõº÷½èÍýȽÄê
677 /* Start with base search ability */
678 chance = p_ptr->skill_srh;
680 /* Penalize various conditions */
681 if (p_ptr->blind || no_lite()) chance = chance / 10;
682 if (p_ptr->confused || p_ptr->image) chance = chance / 10;
684 /* Search the nearby grids, which are always in bounds */
685 for (i = 0; i < 9; ++ i)
687 /* Sometimes, notice things */
688 if (randint0(100) < chance)
690 discover_hidden_things(py + ddy_ddd[i], px + ddx_ddd[i]);
697 * @brief ¥×¥ì¥¤¥ä¡¼¤¬¥ª¥Ö¥¸¥§¥¯¥È¤ò½¦¤Ã¤¿ºÝ¤Î¥á¥Ã¥»¡¼¥¸É½¼¨½èÍý /
698 * Helper routine for py_pickup() and py_pickup_floor().
699 * @param o_idx ¼èÆÀ¤·¤¿¥ª¥Ö¥¸¥§¥¯¥È¤Î»²¾ÈID
702 * ¥¢¥¤¥Æ¥à¤ò½¦¤Ã¤¿ºÝ¤Ë¡Ö£²¤Ä¤Î¥±¡¼¥¤ò»ý¤Ã¤Æ¤¤¤ë¡×\n
703 * "You have two cakes." ¤È¥¢¥¤¥Æ¥à¤ò½¦¤Ã¤¿¸å¤Î¹ç·×¤Î¤ß¤Îɽ¼¨¤¬¥ª¥ê¥¸¥Ê¥ë\n
705 * ¤¢¤ë¤È¤¤¤¦»ØŦ¤ò¤¦¤±¤¿¤Î¤Ç¡¢¡Ö¡Á¤ò½¦¤Ã¤¿¡¢¡Á¤ò»ý¤Ã¤Æ¤¤¤ë¡×¤È¤¤¤¦É½¼¨\n
706 * ¤Ë¤«¤¨¤Æ¤¢¤ë¡£¤½¤Î¤¿¤á¤ÎÇÛÎó¡£\n
707 * Add the given dungeon object to the character's inventory.\n
708 * Delete the object afterwards.\n
710 void py_pickup_aux(int o_idx)
715 char o_name[MAX_NLEN];
716 char old_name[MAX_NLEN];
720 char o_name[MAX_NLEN];
725 o_ptr = &o_list[o_idx];
728 /* Describe the object */
729 object_desc(old_name, o_ptr, OD_NAME_ONLY);
730 object_desc_kosuu(kazu_str, o_ptr);
731 hirottakazu = o_ptr->number;
733 /* Carry the object */
734 slot = inven_carry(o_ptr);
736 /* Get the object again */
737 o_ptr = &inventory[slot];
739 /* Delete the object */
740 delete_object_idx(o_idx);
742 if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)
744 bool old_known = identify_item(o_ptr);
746 /* Auto-inscription/destroy */
747 autopick_alter_item(slot, (bool)(destroy_identify && !old_known));
749 /* If it is destroyed, don't pick it up */
750 if (o_ptr->marked & OM_AUTODESTROY) return;
753 /* Describe the object */
754 object_desc(o_name, o_ptr, 0);
758 if ((o_ptr->name1 == ART_CRIMSON) && (p_ptr->pseikaku == SEIKAKU_COMBAT))
760 msg_format("¤³¤¦¤·¤Æ¡¢%s¤Ï¡Ø¥¯¥ê¥à¥¾¥ó¡Ù¤ò¼ê¤ËÆþ¤ì¤¿¡£", player_name);
761 msg_print("¤·¤«¤·º£¡¢¡Øº®Æ٤Υµ¡¼¥Ú¥ó¥È¡Ù¤ÎÊü¤Ã¤¿¥â¥ó¥¹¥¿¡¼¤¬¡¢");
762 msg_format("%s¤Ë½±¤¤¤«¤«¤ë¡¥¡¥¡¥", player_name);
768 msg_format("%s(%c)¤ò»ý¤Ã¤Æ¤¤¤ë¡£",o_name, index_to_label(slot));
772 if (o_ptr->number > hirottakazu) {
773 msg_format("%s½¦¤Ã¤Æ¡¢%s(%c)¤ò»ý¤Ã¤Æ¤¤¤ë¡£",
774 kazu_str, o_name, index_to_label(slot));
776 msg_format("%s(%c)¤ò½¦¤Ã¤¿¡£", o_name, index_to_label(slot));
780 strcpy(record_o_name, old_name);
782 msg_format("You have %s (%c).", o_name, index_to_label(slot));
783 strcpy(record_o_name, o_name);
788 check_find_art_quest_completion(o_ptr);
793 * @brief ¥×¥ì¥¤¥ä¡¼¤¬¥ª¥Ö¥¸¥§¥¯¥È¾å¤Ë¾è¤Ã¤¿ºÝ¤Îɽ¼¨½èÍý
794 * @param pickup ¼«Æ°½¦¤¤½èÍý¤ò¹Ô¤¦¤Ê¤é¤ÐTRUE¤È¤¹¤ë
797 * Player "wants" to pick up an object or gold.
798 * Note that we ONLY handle things that can be picked up.
799 * See "move_player()" for handling of other things.
801 void carry(bool pickup)
803 cave_type *c_ptr = &cave[py][px];
805 s16b this_o_idx, next_o_idx = 0;
807 char o_name[MAX_NLEN];
809 /* Recenter the map around the player */
813 p_ptr->update |= (PU_MONSTERS);
816 p_ptr->redraw |= (PR_MAP);
819 p_ptr->window |= (PW_OVERHEAD);
824 /* Automatically pickup/destroy/inscribe items */
825 autopick_pickup_items(c_ptr);
828 #ifdef ALLOW_EASY_FLOOR
832 py_pickup_floor(pickup);
836 #endif /* ALLOW_EASY_FLOOR */
838 /* Scan the pile of objects */
839 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
844 o_ptr = &o_list[this_o_idx];
846 #ifdef ALLOW_EASY_SENSE /* TNB */
848 /* Option: Make item sensing easy */
851 /* Sense the object */
852 (void)sense_object(o_ptr);
855 #endif /* ALLOW_EASY_SENSE -- TNB */
857 /* Describe the object */
858 object_desc(o_name, o_ptr, 0);
860 /* Acquire next object */
861 next_o_idx = o_ptr->next_o_idx;
863 /* Hack -- disturb */
867 if (o_ptr->tval == TV_GOLD)
869 int value = (long)o_ptr->pval;
871 /* Delete the gold */
872 delete_object_idx(this_o_idx);
876 msg_format(" $%ld ¤Î²ÁÃͤ¬¤¢¤ë%s¤ò¸«¤Ä¤±¤¿¡£",
877 (long)value, o_name);
879 msg_format("You collect %ld gold pieces worth of %s.",
880 (long)value, o_name);
886 /* Collect the gold */
890 p_ptr->redraw |= (PR_GOLD);
893 p_ptr->window |= (PW_PLAYER);
896 /* Pick up objects */
899 /* Hack - some objects were handled in autopick_pickup_items(). */
900 if (o_ptr->marked & OM_NOMSG)
902 /* Clear the flag. */
903 o_ptr->marked &= ~OM_NOMSG;
905 /* Describe the object */
909 msg_format("%s¤¬¤¢¤ë¡£", o_name);
911 msg_format("You see %s.", o_name);
916 /* Note that the pack is too full */
917 else if (!inven_carry_okay(o_ptr))
920 msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name);
922 msg_format("You have no room for %s.", o_name);
927 /* Pick up the item (if requested and allowed) */
932 /* Hack -- query every item */
933 if (carry_query_flag)
935 char out_val[MAX_NLEN+20];
937 sprintf(out_val, "%s¤ò½¦¤¤¤Þ¤¹¤«? ", o_name);
939 sprintf(out_val, "Pick up %s? ", o_name);
942 okay = get_check(out_val);
945 /* Attempt to pick up an object. */
948 /* Pick up the object */
949 py_pickup_aux(this_o_idx);
958 * @brief ¥×¥ì¥¤¥ä¡¼¤Ø¤Î¥È¥é¥Ã¥×Ì¿ÃæȽÄê /
959 * Determine if a trap affects the player.
960 * @param power ´ðËܲóÈòÆñÅÙ
961 * @return ¥È¥é¥Ã¥×¤¬Ì¿Ã椷¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
963 * Always miss 5% of the time, Always hit 5% of the time.
964 * Otherwise, match trap power against player armor.
966 static int check_hit(int power)
970 /* Percentile dice */
973 /* Hack -- 5% hit, 5% miss */
974 if (k < 10) return (k < 5);
976 if (p_ptr->pseikaku == SEIKAKU_NAMAKE)
977 if (one_in_(20)) return (TRUE);
979 /* Paranoia -- No power */
980 if (power <= 0) return (FALSE);
983 ac = p_ptr->ac + p_ptr->to_a;
985 /* Power competes against Armor */
986 if (randint1(power) > ((ac * 3) / 4)) return (TRUE);
994 * @brief Íî¤È¤··ê·Ï¥È¥é¥Ã¥×¤ÎȽÄê¤È¥×¥ì¥¤¥ä¡¼¤ÎÈï³²½èÍý
995 * @param trap_feat_type ¥È¥é¥Ã¥×¤Î¼ïÊÌID
998 static void hit_trap_pit(int trap_feat_type)
1001 cptr trap_name = "";
1002 cptr spike_name = "";
1004 switch (trap_feat_type)
1007 trap_name = _("Íî¤È¤··ê", "a pit trap");
1009 case TRAP_SPIKED_PIT:
1010 trap_name = _("¥¹¥Ñ¥¤¥¯¤¬Éߤ«¤ì¤¿Íî¤È¤··ê", "a spiked pit");
1011 spike_name = _("¥¹¥Ñ¥¤¥¯", "spikes");
1013 case TRAP_POISON_PIT:
1014 trap_name = _("¥¹¥Ñ¥¤¥¯¤¬Éߤ«¤ì¤¿Íî¤È¤··ê", "a spiked pit");
1015 spike_name = _("ÆǤòÅɤé¤ì¤¿¥¹¥Ñ¥¤¥¯", "poisonous spikes");
1021 if (p_ptr->levitation)
1023 msg_format(_("%s¤òÈô¤Ó±Û¤¨¤¿¡£", "You fly over %s."), trap_name);
1027 msg_format(_("%s¤ËÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", "You have fallen into %s!"), trap_name);
1030 dam = damroll(2, 6);
1032 /* Extra spike damage */
1033 if ((trap_feat_type == TRAP_SPIKED_PIT || trap_feat_type == TRAP_POISON_PIT) &&
1036 msg_format(_("%s¤¬»É¤µ¤Ã¤¿¡ª", "You are impaled on %s!"), spike_name);
1039 (void)set_cut(p_ptr->cut + randint1(dam));
1041 if (trap_feat_type == TRAP_POISON_PIT) {
1042 if (p_ptr->resist_pois || IS_OPPOSE_POIS())
1044 msg_print(_("¤·¤«¤·ÆǤαƶÁ¤Ï¤Ê¤«¤Ã¤¿¡ª", "The poison does not affect you!"));
1049 (void)set_poisoned(p_ptr->poisoned + randint1(dam));
1054 /* Take the damage */
1055 take_hit(DAMAGE_NOESCAPE, dam, trap_name, -1);
1059 * @brief ¥À¡¼¥Ä·Ï¥È¥é¥Ã¥×¡ÊÄ̾ï¥À¥á¡¼¥¸¡Ë¤ÎȽÄê¤È¥×¥ì¥¤¥ä¡¼¤ÎÈï³²½èÍý
1060 * @return ¥À¡¼¥Ä¤¬Ì¿Ã椷¤¿¾ì¹çTRUE¤òÊÖ¤¹
1062 static bool hit_trap_dart(void)
1068 msg_print(_("¾®¤µ¤Ê¥À¡¼¥Ä¤¬Èô¤ó¤Ç¤¤Æ»É¤µ¤Ã¤¿¡ª", "A small dart hits you!"));
1070 take_hit(DAMAGE_ATTACK, damroll(1, 4), _("¥À¡¼¥Ä¤Îæ«", "a dart trap"), -1);
1072 if (!CHECK_MULTISHADOW()) hit = TRUE;
1076 msg_print(_("¾®¤µ¤Ê¥À¡¼¥Ä¤¬Èô¤ó¤Ç¤¤¿¡ª¤¬¡¢±¿Îɤ¯Åö¤¿¤é¤Ê¤«¤Ã¤¿¡£", "A small dart barely misses you."));
1083 * @brief ¥À¡¼¥Ä·Ï¥È¥é¥Ã¥×¡ÊÄ̾ï¥À¥á¡¼¥¸¡ÜǽÎÏÃ͸º¾¯¡Ë¤ÎȽÄê¤È¥×¥ì¥¤¥ä¡¼¤ÎÈï³²½èÍý
1084 * @param stat Äã²¼¤¹¤ëǽÎÏÃÍID
1087 static void hit_trap_lose_stat(int stat)
1089 if (hit_trap_dart())
1096 * @brief ¥À¡¼¥Ä·Ï¥È¥é¥Ã¥×¡ÊÄ̾ï¥À¥á¡¼¥¸¡Ü¸ºÂ®¡Ë¤ÎȽÄê¤È¥×¥ì¥¤¥ä¡¼¤ÎÈï³²½èÍý
1099 static void hit_trap_slow(void)
1101 if (hit_trap_dart())
1103 set_slow(p_ptr->slow + randint0(20) + 20, FALSE);
1108 * @brief ¥À¡¼¥Ä·Ï¥È¥é¥Ã¥×¡ÊÄ̾ï¥À¥á¡¼¥¸¡Ü¾õÂÖ°Û¾ï¡Ë¤ÎȽÄê¤È¥×¥ì¥¤¥ä¡¼¤ÎÈï³²½èÍý
1109 * @param trap_message ¥á¥Ã¥»¡¼¥¸¤ÎÊ䴰ʸ»úÎó
1110 * @param resist ¾õÂÖ°Û¾ï¤ËÄñ¹³¤¹¤ëȽÄ꤬½Ð¤¿¤Ê¤éTRUE
1111 * @param set_status ¾õÂÖ°Û¾ï¤ò»ØÄꤹ¤ë´Ø¿ô¥Ý¥¤¥ó¥¿
1112 * @param turn ¾õÂÖ°Û¾ï¤ÎÄɲå¿¡¼¥óÎÌ
1115 static void hit_trap_set_abnormal_status(cptr trap_message, bool resist, bool (*set_status)(int turn), int turn)
1117 msg_print(trap_message);
1126 * @brief ¥×¥ì¥¤¥ä¡¼¤Ø¤Î¥È¥é¥Ã¥×ºîÆ°½èÍý¥á¥¤¥ó¥ë¡¼¥Á¥ó /
1127 * Handle player hitting a real trap
1128 * @param break_trap ºîÆ°¸å¤Î¥È¥é¥Ã¥×Ç˲õ¤¬³ÎÄꤷ¤Æ¤¤¤ë¤Ê¤é¤ÐTRUE
1131 static void hit_trap(bool break_trap)
1136 /* Get the cave grid */
1137 cave_type *c_ptr = &cave[y][x];
1138 feature_type *f_ptr = &f_info[c_ptr->feat];
1139 int trap_feat_type = have_flag(f_ptr->flags, FF_TRAP) ? f_ptr->subtype : NOT_TRAP;
1142 cptr name = "¥È¥é¥Ã¥×";
1144 cptr name = "a trap";
1147 /* Disturb the player */
1150 cave_alter_feat(y, x, FF_HIT_TRAP);
1152 /* Analyze XXX XXX XXX */
1153 switch (trap_feat_type)
1157 if (p_ptr->levitation)
1160 msg_print("Íî¤È¤·¸Í¤òÈô¤Ó±Û¤¨¤¿¡£");
1162 msg_print("You fly over a trap door.");
1169 msg_print("Íî¤È¤·¸Í¤ËÍî¤Á¤¿¡ª");
1170 if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
1171 msg_print("¤¯¤Ã¤½¡Á¡ª");
1173 msg_print("You have fallen through a trap door!");
1177 dam = damroll(2, 8);
1181 name = "a trap door";
1184 take_hit(DAMAGE_NOESCAPE, dam, name, -1);
1186 /* Still alive and autosave enabled */
1187 if (autosave_l && (p_ptr->chp >= 0))
1188 do_cmd_save_game(TRUE);
1191 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "Íî¤È¤·¸Í¤ËÍî¤Á¤¿");
1193 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "You have fallen through a trap door!");
1195 prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
1198 p_ptr->leaving = TRUE;
1204 case TRAP_SPIKED_PIT:
1205 case TRAP_POISON_PIT:
1207 hit_trap_pit(trap_feat_type);
1214 msg_print("²¿¤«¤¬¥Ô¥«¥Ã¤È¸÷¤Ã¤¿¡ª");
1216 msg_print("There is a flash of shimmering light!");
1219 num = 2 + randint1(3);
1220 for (i = 0; i < num; i++)
1222 (void)summon_specific(0, y, x, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
1225 if (dun_level > randint1(100)) /* No nasty effect for low levels */
1227 bool stop_ty = FALSE;
1232 stop_ty = activate_ty_curse(stop_ty, &count);
1242 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥È¥é¥Ã¥×¤Ë¤Ò¤Ã¤«¤«¤Ã¤¿¡ª");
1244 msg_print("You hit a teleport trap!");
1247 teleport_player(100, TELEPORT_PASSIVE);
1254 msg_print("±ê¤ËÊñ¤Þ¤ì¤¿¡ª");
1256 msg_print("You are enveloped in flames!");
1259 dam = damroll(4, 6);
1261 (void)fire_dam(dam, "±ê¤Î¥È¥é¥Ã¥×", -1, FALSE);
1263 (void)fire_dam(dam, "a fire trap", -1, FALSE);
1272 msg_print("»À¤¬¿á¤¤«¤±¤é¤ì¤¿¡ª");
1274 msg_print("You are splashed with acid!");
1277 dam = damroll(4, 6);
1279 (void)acid_dam(dam, "»À¤Î¥È¥é¥Ã¥×", -1, FALSE);
1281 (void)acid_dam(dam, "an acid trap", -1, FALSE);
1295 hit_trap_lose_stat(A_STR);
1301 hit_trap_lose_stat(A_DEX);
1307 hit_trap_lose_stat(A_CON);
1313 hit_trap_set_abnormal_status(
1314 _("¹õ¤¤¥¬¥¹¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡ª", "A black gas surrounds you!"),
1315 p_ptr->resist_blind,
1316 set_blind, p_ptr->blind + randint0(50) + 25);
1322 hit_trap_set_abnormal_status(
1323 _("¤¤é¤á¤¯¥¬¥¹¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡ª", "A gas of scintillating colors surrounds you!"),
1325 set_confused, p_ptr->confused + randint0(20) + 10);
1331 hit_trap_set_abnormal_status(
1332 _("»É·ãŪ¤ÊÎп§¤Î¥¬¥¹¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡ª", "A pungent green gas surrounds you!"),
1333 p_ptr->resist_pois || IS_OPPOSE_POIS(),
1334 set_poisoned, p_ptr->poisoned + randint0(20) + 10);
1341 msg_print("´ñ̯¤ÊÇò¤¤Ì¸¤ËÊñ¤Þ¤ì¤¿¡ª");
1343 msg_print("A strange white mist surrounds you!");
1346 if (!p_ptr->free_act)
1349 msg_print("¤¢¤Ê¤¿¤Ï̲¤ê¤Ë½¢¤¤¤¿¡£");
1351 msg_print("You fall asleep.");
1355 if (ironman_nightmare)
1358 msg_print("¿È¤ÎÌÓ¤â¤è¤À¤Ä¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤À¡£");
1360 msg_print("A horrible vision enters your mind.");
1364 /* Pick a nightmare */
1365 get_mon_num_prep(get_nightmare, NULL);
1367 /* Have some nightmares */
1368 have_nightmare(get_mon_num(MAX_DEPTH));
1370 /* Remove the monster restriction */
1371 get_mon_num_prep(NULL, NULL);
1373 (void)set_paralyzed(p_ptr->paralyzed + randint0(10) + 5);
1381 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
1383 msg_print("There is a bright flash of light!");
1386 /* Make some new traps */
1387 project(0, 1, y, x, 0, GF_MAKE_TRAP, PROJECT_HIDE | PROJECT_JUMP | PROJECT_GRID, -1);
1395 msg_print("¤±¤¿¤¿¤Þ¤·¤¤²»¤¬ÌĤê¶Á¤¤¤¿¡ª");
1397 msg_print("An alarm sounds!");
1400 aggravate_monsters(0);
1408 msg_print("Âç²»¶Á¤È¶¦¤Ë¤Þ¤ï¤ê¤ÎÊɤ¬Êø¤ì¤¿¡ª");
1410 msg_print("Suddenly, surrounding walls are opened!");
1412 (void)project(0, 3, y, x, 0, GF_DISINTEGRATE, PROJECT_GRID | PROJECT_HIDE, -1);
1413 (void)project(0, 3, y, x - 4, 0, GF_DISINTEGRATE, PROJECT_GRID | PROJECT_HIDE, -1);
1414 (void)project(0, 3, y, x + 4, 0, GF_DISINTEGRATE, PROJECT_GRID | PROJECT_HIDE, -1);
1415 aggravate_monsters(0);
1420 case TRAP_ARMAGEDDON:
1422 static int levs[10] = {0, 0, 20, 10, 5, 3, 2, 1, 1, 1};
1423 int evil_idx = 0, good_idx = 0;
1427 msg_print("ÆÍÁ³Å·³¦¤ÎÀïÁè¤Ë´¬¤¹þ¤Þ¤ì¤¿¡ª");
1429 msg_print("Suddenly, you are surrounded by immotal beings!");
1432 /* Summon Demons and Angels */
1433 for (lev = dun_level; lev >= 20; lev -= 1 + lev/16)
1435 num = levs[MIN(lev/10, 9)];
1436 for (i = 0; i < num; i++)
1438 int x1 = rand_spread(x, 7);
1439 int y1 = rand_spread(y, 5);
1441 /* Skip illegal grids */
1442 if (!in_bounds(y1, x1)) continue;
1444 /* Require line of projection */
1445 if (!projectable(py, px, y1, x1)) continue;
1447 if (summon_specific(0, y1, x1, lev, SUMMON_ARMAGE_EVIL, (PM_NO_PET)))
1448 evil_idx = hack_m_idx_ii;
1450 if (summon_specific(0, y1, x1, lev, SUMMON_ARMAGE_GOOD, (PM_NO_PET)))
1452 good_idx = hack_m_idx_ii;
1455 /* Let them fight each other */
1456 if (evil_idx && good_idx)
1458 monster_type *evil_ptr = &m_list[evil_idx];
1459 monster_type *good_ptr = &m_list[good_idx];
1460 evil_ptr->target_y = good_ptr->fy;
1461 evil_ptr->target_x = good_ptr->fx;
1462 good_ptr->target_y = evil_ptr->fy;
1463 good_ptr->target_x = evil_ptr->fx;
1473 msg_print("ÆÍÁ³Êɤ«¤é¿å¤¬°î¤ì½Ð¤·¤¿¡ª¥Ô¥é¥Ë¥¢¤¬¤¤¤ë¡ª");
1475 msg_print("Suddenly, the room is filled with water with piranhas!");
1478 /* Water fills room */
1479 fire_ball_hide(GF_WATER_FLOW, 0, 1, 10);
1481 /* Summon Piranhas */
1482 num = 1 + dun_level/20;
1483 for (i = 0; i < num; i++)
1485 (void)summon_specific(0, y, x, dun_level, SUMMON_PIRANHAS, (PM_ALLOW_GROUP | PM_NO_PET));
1491 if (break_trap && is_trap(c_ptr->feat))
1493 cave_alter_feat(y, x, FF_DISARM);
1495 msg_print("¥È¥é¥Ã¥×¤òÊ´ºÕ¤·¤¿¡£");
1497 msg_print("You destroyed the trap.");
1504 * @brief Ũ¥ª¡¼¥é¤Ë¤è¤ë¥×¥ì¥¤¥ä¡¼¤Î¥À¥á¡¼¥¸½èÍý¡ÊÊä½õ¡Ë
1505 * @param m_ptr ¥ª¡¼¥é¤ò»ý¤Ä¥â¥ó¥¹¥¿¡¼¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
1506 * @param immune ¥À¥á¡¼¥¸¤ò²óÈò¤Ç¤¤ëÌȱ֥ե饰
1507 * @param flags_offset ¥ª¡¼¥é¥Õ¥é¥°ÇÛÎó¤Î»²¾È¥ª¥Õ¥»¥Ã¥È
1508 * @param r_flags_offset ¥â¥ó¥¹¥¿¡¼¤ÎÂÑÀÇÛÎó¤Î»²¾È¥ª¥Õ¥»¥Ã¥È
1509 * @param aura_flag ¥ª¡¼¥é¥Õ¥é¥°ÇÛÎó
1510 * @param dam_func ¥À¥á¡¼¥¸½èÍý¤ò¹Ô¤¦´Ø¿ô¤Î»²¾È¥Ý¥¤¥ó¥¿
1511 * @param message ¥ª¡¼¥é¥À¥á¡¼¥¸¤ò¼õ¤±¤¿ºÝ¤Î¥á¥Ã¥»¡¼¥¸
1514 static void touch_zap_player_aux(monster_type *m_ptr, bool immune, int flags_offset, int r_flags_offset, u32b aura_flag,
1515 int (*dam_func)(int dam, cptr kb_str, int monspell, bool aura), cptr message)
1517 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1519 if ((atoffset(u32b, r_ptr, flags_offset) & aura_flag) && !immune)
1522 int aura_damage = damroll(1 + (r_ptr->level / 26), 1 + (r_ptr->level / 17));
1524 /* Hack -- Get the "died from" name */
1525 monster_desc(mon_name, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
1529 dam_func(aura_damage, mon_name, -1, TRUE);
1531 if (is_original_ap_and_seen(m_ptr))
1533 atoffset(u32b, r_ptr, r_flags_offset) |= aura_flag;
1541 * @brief Ũ¥ª¡¼¥é¤Ë¤è¤ë¥×¥ì¥¤¥ä¡¼¤Î¥À¥á¡¼¥¸½èÍý¡Ê¥á¥¤¥ó¡Ë
1542 * @param m_ptr ¥ª¡¼¥é¤ò»ý¤Ä¥â¥ó¥¹¥¿¡¼¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
1545 static void touch_zap_player(monster_type *m_ptr)
1547 touch_zap_player_aux(m_ptr, p_ptr->immune_fire, offsetof(monster_race, flags2), offsetof(monster_race, r_flags2), RF2_AURA_FIRE,
1548 fire_dam, _("ÆÍÁ³¤È¤Æ¤âÇ®¤¯¤Ê¤Ã¤¿¡ª", "You are suddenly very hot!"));
1549 touch_zap_player_aux(m_ptr, p_ptr->immune_cold, offsetof(monster_race, flags3), offsetof(monster_race, r_flags3), RF3_AURA_COLD,
1550 cold_dam, _("ÆÍÁ³¤È¤Æ¤â´¨¤¯¤Ê¤Ã¤¿¡ª", "You are suddenly very cold!"));
1551 touch_zap_player_aux(m_ptr, p_ptr->immune_elec, offsetof(monster_race, flags2), offsetof(monster_race, r_flags2), RF2_AURA_ELEC,
1552 elec_dam, _("ÅÅ·â¤ò¤¯¤é¤Ã¤¿¡ª", "You get zapped!"));
1557 * @brief ¥×¥ì¥¤¥ä¡¼¤ÎÊÑ°ÛÍ×ÁǤˤè¤ëÂÇ·â½èÍý
1558 * @param m_idx ¹¶·âÌÜɸ¤È¤Ê¤Ã¤¿¥â¥ó¥¹¥¿¡¼¤Î»²¾ÈID
1559 * @param attack ÊÑ°ÛÍ×ÁǤˤè¤ë¹¶·âÍ×ÁǤμïÎà
1560 * @param fear ¹¶·â¤ò¼õ¤±¤¿¥â¥ó¥¹¥¿¡¼¤¬¶²¹²¾õÂ֤˴٤俤«¤òÊÖ¤¹»²¾È¥Ý¥¤¥ó¥¿
1561 * @param mdeath ¹¶·â¤ò¼õ¤±¤¿¥â¥ó¥¹¥¿¡¼¤¬»àË´¤·¤¿¤«¤òÊÖ¤¹»²¾È¥Ý¥¤¥ó¥¿
1564 static void natural_attack(s16b m_idx, int attack, bool *fear, bool *mdeath)
1566 int k, bonus, chance;
1568 monster_type *m_ptr = &m_list[m_idx];
1569 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1578 case MUT2_SCOR_TAIL:
1605 atk_desc = "¥¯¥Á¥Ð¥·";
1616 atk_desc = "¾Ý¤ÎÉ¡";
1622 case MUT2_TENTACLES:
1629 atk_desc = "tentacles";
1634 dss = ddd = n_weight = 1;
1636 atk_desc = "̤ÄêµÁ¤ÎÉô°Ì";
1638 atk_desc = "undefined body part";
1643 /* Extract monster name (or "it") */
1644 monster_desc(m_name, m_ptr, 0);
1647 /* Calculate the "attack quality" */
1648 bonus = p_ptr->to_h_m;
1649 bonus += (p_ptr->lev * 6 / 5);
1650 chance = (p_ptr->skill_thn + (bonus * BTH_PLUS_ADJ));
1653 if ((!(r_ptr->flags2 & RF2_QUANTUM) || !randint0(2)) && test_hit_norm(chance, r_ptr->ac, m_ptr->ml))
1659 msg_format("%s¤ò%s¤Ç¹¶·â¤·¤¿¡£", m_name, atk_desc);
1661 msg_format("You hit %s with your %s.", m_name, atk_desc);
1665 k = damroll(ddd, dss);
1666 k = critical_norm(n_weight, bonus, k, (s16b)bonus, 0);
1668 /* Apply the player damage bonuses */
1671 /* No negative damage */
1674 /* Modify the damage */
1675 k = mon_damage_mod(m_ptr, k, FALSE);
1677 /* Complex message */
1681 msg_format("%d/%d ¤Î¥À¥á¡¼¥¸¤òÍ¿¤¨¤¿¡£", k, m_ptr->hp);
1683 msg_format("You do %d (out of %d) damage.", k, m_ptr->hp);
1688 /* Anger the monster */
1689 if (k > 0) anger_monster(m_ptr);
1691 /* Damage, check for fear and mdeath */
1694 case MUT2_SCOR_TAIL:
1695 project(0, 0, m_ptr->fy, m_ptr->fx, k, GF_POIS, PROJECT_KILL, -1);
1696 *mdeath = (m_ptr->r_idx == 0);
1699 *mdeath = mon_take_hit(m_idx, k, fear, NULL);
1702 *mdeath = mon_take_hit(m_idx, k, fear, NULL);
1705 *mdeath = mon_take_hit(m_idx, k, fear, NULL);
1707 case MUT2_TENTACLES:
1708 *mdeath = mon_take_hit(m_idx, k, fear, NULL);
1711 *mdeath = mon_take_hit(m_idx, k, fear, NULL);
1714 touch_zap_player(m_ptr);
1724 msg_format("¥ß¥¹¡ª %s¤Ë¤«¤ï¤µ¤ì¤¿¡£", m_name);
1726 msg_format("You miss %s.", m_name);
1734 * @brief ¥×¥ì¥¤¥ä¡¼¤ÎÂÇ·â½èÍý¥µ¥Ö¥ë¡¼¥Á¥ó /
1735 * Player attacks a (poor, defenseless) creature -RAK-
1736 * @param y ¹¶·âÌÜɸ¤ÎYºÂɸ
1737 * @param x ¹¶·âÌÜɸ¤ÎXºÂɸ
1738 * @param fear ¹¶·â¤ò¼õ¤±¤¿¥â¥ó¥¹¥¿¡¼¤¬¶²¹²¾õÂ֤˴٤俤«¤òÊÖ¤¹»²¾È¥Ý¥¤¥ó¥¿
1739 * @param mdeath ¹¶·â¤ò¼õ¤±¤¿¥â¥ó¥¹¥¿¡¼¤¬»àË´¤·¤¿¤«¤òÊÖ¤¹»²¾È¥Ý¥¤¥ó¥¿
1740 * @param hand ¹¶·â¤ò¹Ô¤¦¤¿¤á¤ÎÉð´ï¤ò»ý¤Ä¼ê
1741 * @param mode ȯưÃæ¤Î·õ½ÑID
1744 * If no "weapon" is available, then "punch" the monster one time.
1746 static void py_attack_aux(int y, int x, bool *fear, bool *mdeath, s16b hand, int mode)
1748 int num = 0, k, bonus, chance, vir;
1750 cave_type *c_ptr = &cave[y][x];
1752 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1753 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1755 /* Access the weapon */
1756 object_type *o_ptr = &inventory[INVEN_RARM + hand];
1760 bool success_hit = FALSE;
1761 bool backstab = FALSE;
1762 bool vorpal_cut = FALSE;
1763 int chaos_effect = 0;
1764 bool stab_fleeing = FALSE;
1765 bool fuiuchi = FALSE;
1766 bool monk_attack = FALSE;
1767 bool do_quake = FALSE;
1769 bool drain_msg = TRUE;
1770 int drain_result = 0, drain_heal = 0;
1771 bool can_drain = FALSE;
1773 int drain_left = MAX_VAMPIRIC_DRAIN;
1774 u32b flgs[TR_FLAG_SIZE]; /* A massive hack -- life-draining weapons */
1775 bool is_human = (r_ptr->d_char == 'p');
1776 bool is_lowlevel = (r_ptr->level < (p_ptr->lev - 15));
1777 bool zantetsu_mukou, e_j_mukou;
1779 switch (p_ptr->pclass)
1783 if (buki_motteruka(INVEN_RARM + hand) && !p_ptr->icky_wield[hand])
1785 int tmp = p_ptr->lev * 6 + (p_ptr->skill_stl + 10) * 4;
1786 if (p_ptr->monlite && (mode != HISSATSU_NYUSIN)) tmp /= 3;
1787 if (p_ptr->cursed & TRC_AGGRAVATE) tmp /= 2;
1788 if (r_ptr->level > (p_ptr->lev * p_ptr->lev / 20 + 10)) tmp /= 3;
1789 if (MON_CSLEEP(m_ptr) && m_ptr->ml)
1791 /* Can't backstab creatures that we can't see, right? */
1794 else if ((p_ptr->special_defense & NINJA_S_STEALTH) && (randint0(tmp) > (r_ptr->level+20)) && m_ptr->ml && !(r_ptr->flagsr & RFR_RES_ALL))
1798 else if (MON_MONFEAR(m_ptr) && m_ptr->ml)
1800 stab_fleeing = TRUE;
1806 case CLASS_FORCETRAINER:
1807 case CLASS_BERSERKER:
1808 if ((empty_hands(TRUE) & EMPTY_HAND_RARM) && !p_ptr->riding) monk_attack = TRUE;
1812 if (!o_ptr->k_idx) /* Empty hand */
1814 if ((r_ptr->level + 10) > p_ptr->lev)
1816 if (p_ptr->skill_exp[GINOU_SUDE] < s_info[p_ptr->pclass].s_max[GINOU_SUDE])
1818 if (p_ptr->skill_exp[GINOU_SUDE] < WEAPON_EXP_BEGINNER)
1819 p_ptr->skill_exp[GINOU_SUDE] += 40;
1820 else if ((p_ptr->skill_exp[GINOU_SUDE] < WEAPON_EXP_SKILLED))
1821 p_ptr->skill_exp[GINOU_SUDE] += 5;
1822 else if ((p_ptr->skill_exp[GINOU_SUDE] < WEAPON_EXP_EXPERT) && (p_ptr->lev > 19))
1823 p_ptr->skill_exp[GINOU_SUDE] += 1;
1824 else if ((p_ptr->lev > 34))
1825 if (one_in_(3)) p_ptr->skill_exp[GINOU_SUDE] += 1;
1826 p_ptr->update |= (PU_BONUS);
1830 else if (object_is_melee_weapon(o_ptr))
1832 if ((r_ptr->level + 10) > p_ptr->lev)
1834 int tval = inventory[INVEN_RARM+hand].tval - TV_WEAPON_BEGIN;
1835 int sval = inventory[INVEN_RARM+hand].sval;
1836 int now_exp = p_ptr->weapon_exp[tval][sval];
1837 if (now_exp < s_info[p_ptr->pclass].w_max[tval][sval])
1840 if (now_exp < WEAPON_EXP_BEGINNER) amount = 80;
1841 else if (now_exp < WEAPON_EXP_SKILLED) amount = 10;
1842 else if ((now_exp < WEAPON_EXP_EXPERT) && (p_ptr->lev > 19)) amount = 1;
1843 else if ((p_ptr->lev > 34) && one_in_(2)) amount = 1;
1844 p_ptr->weapon_exp[tval][sval] += amount;
1845 p_ptr->update |= (PU_BONUS);
1850 /* Disturb the monster */
1851 (void)set_monster_csleep(c_ptr->m_idx, 0);
1853 /* Extract monster name (or "it") */
1854 monster_desc(m_name, m_ptr, 0);
1856 /* Calculate the "attack quality" */
1857 bonus = p_ptr->to_h[hand] + o_ptr->to_h;
1858 chance = (p_ptr->skill_thn + (bonus * BTH_PLUS_ADJ));
1859 if (mode == HISSATSU_IAI) chance += 60;
1860 if (p_ptr->special_defense & KATA_KOUKIJIN) chance += 150;
1862 if (p_ptr->sutemi) chance = MAX(chance * 3 / 2, chance + 60);
1864 vir = virtue_number(V_VALOUR);
1867 chance += (p_ptr->virtues[vir - 1]/10);
1870 zantetsu_mukou = ((o_ptr->name1 == ART_ZANTETSU) && (r_ptr->d_char == 'j'));
1871 e_j_mukou = ((o_ptr->name1 == ART_EXCALIBUR_J) && (r_ptr->d_char == 'S'));
1873 if ((mode == HISSATSU_KYUSHO) || (mode == HISSATSU_MINEUCHI) || (mode == HISSATSU_3DAN) || (mode == HISSATSU_IAI)) num_blow = 1;
1874 else if (mode == HISSATSU_COLD) num_blow = p_ptr->num_blow[hand]+2;
1875 else num_blow = p_ptr->num_blow[hand];
1877 /* Hack -- DOKUBARI always hit once */
1878 if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI)) num_blow = 1;
1880 /* Attack once for each legal blow */
1881 while ((num++ < num_blow) && !p_ptr->is_dead)
1883 if (((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI)) || (mode == HISSATSU_KYUSHO))
1887 if (p_ptr->migite && p_ptr->hidarite)
1891 if (mode == HISSATSU_3DAN)
1896 success_hit = one_in_(n);
1898 else if ((p_ptr->pclass == CLASS_NINJA) && ((backstab || fuiuchi) && !(r_ptr->flagsr & RFR_RES_ALL))) success_hit = TRUE;
1899 else success_hit = test_hit_norm(chance, r_ptr->ac, m_ptr->ml);
1901 if (mode == HISSATSU_MAJIN)
1904 success_hit = FALSE;
1910 int vorpal_chance = ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD)) ? 2 : 4;
1917 if (backstab) msg_format("¤¢¤Ê¤¿¤ÏÎä¹ó¤Ë¤â̲¤Ã¤Æ¤¤¤ë̵ÎϤÊ%s¤òÆͤ»É¤·¤¿¡ª", m_name);
1918 else if (fuiuchi) msg_format("ÉÔ°Õ¤òÆͤ¤¤Æ%s¤Ë¶¯Îõ¤Ê°ì·â¤ò¶ô¤é¤ï¤»¤¿¡ª", m_name);
1919 else if (stab_fleeing) msg_format("ƨ¤²¤ë%s¤òÇØÃ椫¤éÆͤ»É¤·¤¿¡ª", m_name);
1920 else if (!monk_attack) msg_format("%s¤ò¹¶·â¤·¤¿¡£", m_name);
1922 if (backstab) msg_format("You cruelly stab the helpless, sleeping %s!", m_name);
1923 else if (fuiuchi) msg_format("You make surprise attack, and hit %s with a powerful blow!", m_name);
1924 else if (stab_fleeing) msg_format("You backstab the fleeing %s!", m_name);
1925 else if (!monk_attack) msg_format("You hit %s.", m_name);
1928 /* Hack -- bare hands do one damage */
1931 object_flags(o_ptr, flgs);
1933 /* Select a chaotic effect (50% chance) */
1934 if ((have_flag(flgs, TR_CHAOTIC)) && one_in_(2))
1937 chg_virtue(V_CHANCE, 1);
1939 if (randint1(5) < 3)
1941 /* Vampiric (20%) */
1944 else if (one_in_(250))
1949 else if (!one_in_(10))
1951 /* Confusion (26.892%) */
1954 else if (one_in_(2))
1956 /* Teleport away (1.494%) */
1961 /* Polymorph (1.494%) */
1966 /* Vampiric drain */
1967 if ((have_flag(flgs, TR_VAMPIRIC)) || (chaos_effect == 1) || (mode == HISSATSU_DRAIN) || hex_spelling(HEX_VAMP_BLADE))
1969 /* Only drain "living" monsters */
1970 if (monster_living(r_ptr))
1976 if ((have_flag(flgs, TR_VORPAL) || hex_spelling(HEX_RUNESWORD)) && (randint1(vorpal_chance*3/2) == 1) && !zantetsu_mukou)
1978 else vorpal_cut = FALSE;
1982 int special_effect = 0, stun_effect = 0, times = 0, max_times;
1984 const martial_arts *ma_ptr = &ma_blows[0], *old_ptr = &ma_blows[0];
1985 int resist_stun = 0;
1988 if (r_ptr->flags1 & RF1_UNIQUE) resist_stun += 88;
1989 if (r_ptr->flags3 & RF3_NO_STUN) resist_stun += 66;
1990 if (r_ptr->flags3 & RF3_NO_CONF) resist_stun += 33;
1991 if (r_ptr->flags3 & RF3_NO_SLEEP) resist_stun += 33;
1992 if ((r_ptr->flags3 & RF3_UNDEAD) || (r_ptr->flags3 & RF3_NONLIVING))
1995 if (p_ptr->special_defense & KAMAE_BYAKKO)
1996 max_times = (p_ptr->lev < 3 ? 1 : p_ptr->lev / 3);
1997 else if (p_ptr->special_defense & KAMAE_SUZAKU)
1999 else if (p_ptr->special_defense & KAMAE_GENBU)
2002 max_times = (p_ptr->lev < 7 ? 1 : p_ptr->lev / 7);
2003 /* Attempt 'times' */
2004 for (times = 0; times < max_times; times++)
2008 ma_ptr = &ma_blows[randint0(MAX_MA)];
2009 if ((p_ptr->pclass == CLASS_FORCETRAINER) && (ma_ptr->min_level > 1)) min_level = ma_ptr->min_level + 3;
2010 else min_level = ma_ptr->min_level;
2012 while ((min_level > p_ptr->lev) ||
2013 (randint1(p_ptr->lev) < ma_ptr->chance));
2015 /* keep the highest level attack available we found */
2016 if ((ma_ptr->min_level > old_ptr->min_level) &&
2017 !p_ptr->stun && !p_ptr->confused)
2021 if (p_ptr->wizard && cheat_xtra)
2024 msg_print("¹¶·â¤òºÆÁªÂò¤·¤Þ¤·¤¿¡£");
2026 msg_print("Attack re-selected.");
2036 if (p_ptr->pclass == CLASS_FORCETRAINER) min_level = MAX(1, ma_ptr->min_level - 3);
2037 else min_level = ma_ptr->min_level;
2038 k = damroll(ma_ptr->dd + p_ptr->to_dd[hand], ma_ptr->ds + p_ptr->to_ds[hand]);
2039 if (p_ptr->special_attack & ATTACK_SUIKEN) k *= 2;
2041 if (ma_ptr->effect == MA_KNEE)
2043 if (r_ptr->flags1 & RF1_MALE)
2046 msg_format("%s¤Ë¶âŪɨ½³¤ê¤ò¤¯¤é¤ï¤·¤¿¡ª", m_name);
2048 msg_format("You hit %s in the groin with your knee!", m_name);
2052 special_effect = MA_KNEE;
2055 msg_format(ma_ptr->desc, m_name);
2058 else if (ma_ptr->effect == MA_SLOW)
2060 if (!((r_ptr->flags1 & RF1_NEVER_MOVE) ||
2061 my_strchr("~#{}.UjmeEv$,DdsbBFIJQSXclnw!=?", r_ptr->d_char)))
2064 msg_format("%s¤Î¼ó¤Ë´ØÀá½³¤ê¤ò¤¯¤é¤ï¤·¤¿¡ª", m_name);
2066 msg_format("You kick %s in the ankle.", m_name);
2069 special_effect = MA_SLOW;
2071 else msg_format(ma_ptr->desc, m_name);
2077 stun_effect = (ma_ptr->effect / 2) + randint1(ma_ptr->effect / 2);
2080 msg_format(ma_ptr->desc, m_name);
2083 if (p_ptr->special_defense & KAMAE_SUZAKU) weight = 4;
2084 if ((p_ptr->pclass == CLASS_FORCETRAINER) && (p_ptr->magic_num1[0]))
2086 weight += (p_ptr->magic_num1[0]/30);
2087 if (weight > 20) weight = 20;
2090 k = critical_norm(p_ptr->lev * weight, min_level, k, p_ptr->to_h[0], 0);
2092 if ((special_effect == MA_KNEE) && ((k + p_ptr->to_d[hand]) < m_ptr->hp))
2095 msg_format("%^s¤Ï¶ìÄˤˤ¦¤á¤¤¤Æ¤¤¤ë¡ª", m_name);
2097 msg_format("%^s moans in agony!", m_name);
2100 stun_effect = 7 + randint1(13);
2104 else if ((special_effect == MA_SLOW) && ((k + p_ptr->to_d[hand]) < m_ptr->hp))
2106 if (!(r_ptr->flags1 & RF1_UNIQUE) &&
2107 (randint1(p_ptr->lev) > r_ptr->level) &&
2111 msg_format("%^s¤Ï¤ò¤Ò¤¤º¤ê»Ï¤á¤¿¡£", m_name);
2113 msg_format("%^s starts limping slower.", m_name);
2116 m_ptr->mspeed -= 10;
2120 if (stun_effect && ((k + p_ptr->to_d[hand]) < m_ptr->hp))
2122 if (p_ptr->lev > randint1(r_ptr->level + resist_stun + 10))
2124 if (set_monster_stunned(c_ptr->m_idx, stun_effect + MON_STUNNED(m_ptr)))
2127 msg_format("%^s¤Ï¥Õ¥é¥Õ¥é¤Ë¤Ê¤Ã¤¿¡£", m_name);
2129 msg_format("%^s is stunned.", m_name);
2135 msg_format("%^s¤Ï¤µ¤é¤Ë¥Õ¥é¥Õ¥é¤Ë¤Ê¤Ã¤¿¡£", m_name);
2137 msg_format("%^s is more stunned.", m_name);
2144 /* Handle normal weapon */
2145 else if (o_ptr->k_idx)
2147 k = damroll(o_ptr->dd + p_ptr->to_dd[hand], o_ptr->ds + p_ptr->to_ds[hand]);
2148 k = tot_dam_aux(o_ptr, k, m_ptr, mode, FALSE);
2152 k *= (3 + (p_ptr->lev / 20));
2156 k = k*(5+(p_ptr->lev*2/25))/2;
2158 else if (stab_fleeing)
2163 if ((p_ptr->impact[hand] && ((k > 50) || one_in_(7))) ||
2164 (chaos_effect == 2) || (mode == HISSATSU_QUAKE))
2169 if ((!(o_ptr->tval == TV_SWORD) || !(o_ptr->sval == SV_DOKUBARI)) && !(mode == HISSATSU_KYUSHO))
2170 k = critical_norm(o_ptr->weight, o_ptr->to_h, k, p_ptr->to_h[hand], mode);
2178 if ((o_ptr->name1 == ART_CHAINSWORD) && !one_in_(2))
2180 char chainsword_noise[1024];
2182 if (!get_rnd_line("chainswd_j.txt", 0, chainsword_noise))
2184 if (!get_rnd_line("chainswd.txt", 0, chainsword_noise))
2187 msg_print(chainsword_noise);
2191 if (o_ptr->name1 == ART_VORPAL_BLADE)
2194 msg_print("Ìܤˤâ»ß¤Þ¤é¤Ì¥ô¥©¡¼¥Ñ¥ë¥Ö¥ì¡¼¥É¡¢¼êÏ£¤ÎÁá¶È¡ª");
2196 msg_print("Your Vorpal Blade goes snicker-snack!");
2202 msg_format("%s¤ò¥°¥Ã¥µ¥êÀÚ¤êÎö¤¤¤¿¡ª", m_name);
2204 msg_format("Your weapon cuts deep into %s!", m_name);
2208 /* Try to increase the damage */
2209 while (one_in_(vorpal_chance))
2217 if (((r_ptr->flagsr & RFR_RES_ALL) ? k/100 : k) > m_ptr->hp)
2220 msg_format("%s¤ò¿¿¤ÃÆó¤Ä¤Ë¤·¤¿¡ª", m_name);
2222 msg_format("You cut %s in half!", m_name);
2230 case 2: msg_format("%s¤ò»Â¤Ã¤¿¡ª", m_name); break;
2231 case 3: msg_format("%s¤ò¤Ö¤Ã¤¿»Â¤Ã¤¿¡ª", m_name); break;
2232 case 4: msg_format("%s¤ò¥á¥Ã¥¿»Â¤ê¤Ë¤·¤¿¡ª", m_name); break;
2233 case 5: msg_format("%s¤ò¥á¥Ã¥¿¥á¥¿¤Ë»Â¤Ã¤¿¡ª", m_name); break;
2234 case 6: msg_format("%s¤ò»É¿È¤Ë¤·¤¿¡ª", m_name); break;
2235 case 7: msg_format("%s¤ò»Â¤Ã¤Æ»Â¤Ã¤Æ»Â¤ê¤Þ¤¯¤Ã¤¿¡ª", m_name); break;
2236 default: msg_format("%s¤òºÙÀÚ¤ì¤Ë¤·¤¿¡ª", m_name); break;
2238 case 2: msg_format("You gouge %s!", m_name); break;
2239 case 3: msg_format("You maim %s!", m_name); break;
2240 case 4: msg_format("You carve %s!", m_name); break;
2241 case 5: msg_format("You cleave %s!", m_name); break;
2242 case 6: msg_format("You smite %s!", m_name); break;
2243 case 7: msg_format("You eviscerate %s!", m_name); break;
2244 default: msg_format("You shred %s!", m_name); break;
2248 drain_result = drain_result * 3 / 2;
2252 drain_result += o_ptr->to_d;
2255 /* Apply the player damage bonuses */
2256 k += p_ptr->to_d[hand];
2257 drain_result += p_ptr->to_d[hand];
2259 if ((mode == HISSATSU_SUTEMI) || (mode == HISSATSU_3DAN)) k *= 2;
2260 if ((mode == HISSATSU_SEKIRYUKA) && !monster_living(r_ptr)) k = 0;
2261 if ((mode == HISSATSU_SEKIRYUKA) && !p_ptr->cut) k /= 2;
2263 /* No negative damage */
2266 if ((mode == HISSATSU_ZANMA) && !(!monster_living(r_ptr) && (r_ptr->flags3 & RF3_EVIL)))
2274 msg_print("¤³¤ó¤ÊÆð¤é¤«¤¤¤â¤Î¤ÏÀÚ¤ì¤ó¡ª");
2276 msg_print("You cannot cut such a elastic thing!");
2284 msg_print("ÃØéá¤Ï¶ì¼ê¤À¡ª");
2286 msg_print("Spiders are difficult for you to deal with!");
2291 if (mode == HISSATSU_MINEUCHI)
2293 int tmp = (10 + randint1(15) + p_ptr->lev / 5);
2296 anger_monster(m_ptr);
2298 if (!(r_ptr->flags3 & (RF3_NO_STUN)))
2301 if (MON_STUNNED(m_ptr))
2304 msg_format("%s¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£", m_name);
2306 msg_format("%s is more dazed.", m_name);
2314 msg_format("%s ¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£", m_name);
2316 msg_format("%s is dazed.", m_name);
2321 (void)set_monster_stunned(c_ptr->m_idx, MON_STUNNED(m_ptr) + tmp);
2326 msg_format("%s ¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
2328 msg_format("%s is not effected.", m_name);
2333 /* Modify the damage */
2334 k = mon_damage_mod(m_ptr, k, (bool)(((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE)) || ((p_ptr->pclass == CLASS_BERSERKER) && one_in_(2))));
2335 if (((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI)) || (mode == HISSATSU_KYUSHO))
2337 if ((randint1(randint1(r_ptr->level/7)+5) == 1) && !(r_ptr->flags1 & RF1_UNIQUE) && !(r_ptr->flags7 & RF7_UNIQUE2))
2341 msg_format("%s¤ÎµÞ½ê¤òÆͤ»É¤·¤¿¡ª", m_name);
2343 msg_format("You hit %s on a fatal spot!", m_name);
2348 else if ((p_ptr->pclass == CLASS_NINJA) && buki_motteruka(INVEN_RARM + hand) && !p_ptr->icky_wield[hand] && ((p_ptr->cur_lite <= 0) || one_in_(7)))
2350 int maxhp = maxroll(r_ptr->hdice, r_ptr->hside);
2351 if (one_in_(backstab ? 13 : (stab_fleeing || fuiuchi) ? 15 : 27))
2356 msg_format("¿Ï¤¬%s¤Ë¿¼¡¹¤ÈÆͤ»É¤µ¤Ã¤¿¡ª", m_name);
2358 msg_format("You critically injured %s!", m_name);
2361 else if (((m_ptr->hp < maxhp/2) && one_in_((p_ptr->num_blow[0]+p_ptr->num_blow[1]+1)*10)) || ((one_in_(666) || ((backstab || fuiuchi) && one_in_(11))) && !(r_ptr->flags1 & RF1_UNIQUE) && !(r_ptr->flags7 & RF7_UNIQUE2)))
2363 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE2) || (m_ptr->hp >= maxhp/2))
2365 k = MAX(k*5, m_ptr->hp/2);
2368 msg_format("%s¤ËÃ×Ì¿½ý¤òÉé¤ï¤»¤¿¡ª", m_name);
2370 msg_format("You fatally injured %s!", m_name);
2377 msg_format("¿Ï¤¬%s¤ÎµÞ½ê¤ò´Ó¤¤¤¿¡ª", m_name);
2379 msg_format("You hit %s on a fatal spot!", m_name);
2385 /* Complex message */
2386 if (p_ptr->wizard || cheat_xtra)
2389 msg_format("%d/%d ¤Î¥À¥á¡¼¥¸¤òÍ¿¤¨¤¿¡£", k, m_ptr->hp);
2391 msg_format("You do %d (out of %d) damage.", k, m_ptr->hp);
2395 if (k <= 0) can_drain = FALSE;
2397 if (drain_result > m_ptr->hp)
2398 drain_result = m_ptr->hp;
2400 /* Damage, check for fear and death */
2401 if (mon_take_hit(c_ptr->m_idx, k, fear, NULL))
2404 if ((p_ptr->pclass == CLASS_BERSERKER) && energy_use)
2406 if (p_ptr->migite && p_ptr->hidarite)
2408 if (hand) energy_use = energy_use*3/5+energy_use*num*2/(p_ptr->num_blow[hand]*5);
2409 else energy_use = energy_use*num*3/(p_ptr->num_blow[hand]*5);
2413 energy_use = energy_use*num/p_ptr->num_blow[hand];
2416 if ((o_ptr->name1 == ART_ZANTETSU) && is_lowlevel)
2418 msg_print("¤Þ¤¿¤Ä¤Þ¤é¤Ì¤â¤Î¤ò»Â¤Ã¤Æ¤·¤Þ¤Ã¤¿¡¥¡¥¡¥");
2420 msg_print("Sigh... Another trifling thing I've cut....");
2425 /* Anger the monster */
2426 if (k > 0) anger_monster(m_ptr);
2428 touch_zap_player(m_ptr);
2430 /* Are we draining it? A little note: If the monster is
2431 dead, the drain does not work... */
2433 if (can_drain && (drain_result > 0))
2435 if (o_ptr->name1 == ART_MURAMASA)
2439 int to_h = o_ptr->to_h;
2440 int to_d = o_ptr->to_d;
2444 for (i = 0; i < to_h + 3; i++) if (one_in_(4)) flag = 0;
2448 for (i = 0; i < to_d + 3; i++) if (one_in_(4)) flag = 0;
2451 if (o_ptr->to_h != to_h || o_ptr->to_d != to_d)
2454 msg_print("ÍÅÅá¤Ï·ì¤òµÛ¤Ã¤Æ¶¯¤¯¤Ê¤Ã¤¿¡ª");
2456 msg_print("Muramasa sucked blood, and became more powerful!");
2465 if (drain_result > 5) /* Did we really hurt it? */
2467 drain_heal = damroll(2, drain_result / 6);
2470 if (hex_spelling(HEX_VAMP_BLADE)) drain_heal *= 2;
2475 msg_format("Draining left: %d", drain_left);
2477 msg_format("Draining left: %d", drain_left);
2484 if (drain_heal < drain_left)
2486 drain_left -= drain_heal;
2490 drain_heal = drain_left;
2497 msg_format("¿Ï¤¬%s¤«¤éÀ¸Ì¿ÎϤòµÛ¤¤¼è¤Ã¤¿¡ª", m_name);
2499 msg_format("Your weapon drains life from %s!", m_name);
2505 drain_heal = (drain_heal * mutant_regenerate_mod) / 100;
2507 hp_player(drain_heal);
2508 /* We get to keep some of it! */
2512 m_ptr->maxhp -= (k+7)/8;
2513 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2514 if (m_ptr->maxhp < 1) m_ptr->maxhp = 1;
2520 /* Confusion attack */
2521 if ((p_ptr->special_attack & ATTACK_CONFUSE) || (chaos_effect == 3) || (mode == HISSATSU_CONF) || hex_spelling(HEX_CONFUSION))
2523 /* Cancel glowing hands */
2524 if (p_ptr->special_attack & ATTACK_CONFUSE)
2526 p_ptr->special_attack &= ~(ATTACK_CONFUSE);
2528 msg_print("¼ê¤Îµ±¤¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
2530 msg_print("Your hands stop glowing.");
2532 p_ptr->redraw |= (PR_STATUS);
2536 /* Confuse the monster */
2537 if (r_ptr->flags3 & RF3_NO_CONF)
2539 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_NO_CONF;
2542 msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
2544 msg_format("%^s is unaffected.", m_name);
2548 else if (randint0(100) < r_ptr->level)
2551 msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
2553 msg_format("%^s is unaffected.", m_name);
2560 msg_format("%^s¤Ïº®Í𤷤¿¤è¤¦¤À¡£", m_name);
2562 msg_format("%^s appears confused.", m_name);
2565 (void)set_monster_confused(c_ptr->m_idx, MON_CONFUSED(m_ptr) + 10 + randint0(p_ptr->lev) / 5);
2569 else if (chaos_effect == 4)
2571 bool resists_tele = FALSE;
2573 if (r_ptr->flagsr & RFR_RES_TELE)
2575 if (r_ptr->flags1 & RF1_UNIQUE)
2577 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2579 msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
2581 msg_format("%^s is unaffected!", m_name);
2584 resists_tele = TRUE;
2586 else if (r_ptr->level > randint1(100))
2588 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2590 msg_format("%^s¤ÏÄñ¹³ÎϤò»ý¤Ã¤Æ¤¤¤ë¡ª", m_name);
2592 msg_format("%^s resists!", m_name);
2595 resists_tele = TRUE;
2602 msg_format("%^s¤Ï¾Ã¤¨¤¿¡ª", m_name);
2604 msg_format("%^s disappears!", m_name);
2607 teleport_away(c_ptr->m_idx, 50, TELEPORT_PASSIVE);
2608 num = num_blow + 1; /* Can't hit it anymore! */
2613 else if ((chaos_effect == 5) && (randint1(90) > r_ptr->level))
2615 if (!(r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) &&
2616 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
2618 if (polymorph_monster(y, x))
2621 msg_format("%^s¤ÏÊѲ½¤·¤¿¡ª", m_name);
2623 msg_format("%^s changes!", m_name);
2632 msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
2634 msg_format("%^s is unaffected.", m_name);
2638 /* Hack -- Get new monster */
2639 m_ptr = &m_list[c_ptr->m_idx];
2641 /* Oops, we need a different name... */
2642 monster_desc(m_name, m_ptr, 0);
2644 /* Hack -- Get new race */
2645 r_ptr = &r_info[m_ptr->r_idx];
2648 else if (o_ptr->name1 == ART_G_HAMMER)
2650 monster_type *m_ptr = &m_list[c_ptr->m_idx];
2652 if (m_ptr->hold_o_idx)
2654 object_type *q_ptr = &o_list[m_ptr->hold_o_idx];
2655 char o_name[MAX_NLEN];
2657 object_desc(o_name, q_ptr, OD_NAME_ONLY);
2658 q_ptr->held_m_idx = 0;
2659 q_ptr->marked = OM_TOUCHED;
2660 m_ptr->hold_o_idx = q_ptr->next_o_idx;
2661 q_ptr->next_o_idx = 0;
2663 msg_format("%s¤òÃ¥¤Ã¤¿¡£", o_name);
2665 msg_format("You snatched %s.", o_name);
2675 backstab = FALSE; /* Clumsy! */
2676 fuiuchi = FALSE; /* Clumsy! */
2678 if ((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE) && one_in_(3))
2680 u32b flgs[TR_FLAG_SIZE];
2687 msg_format("¥ß¥¹¡ª %s¤Ë¤«¤ï¤µ¤ì¤¿¡£", m_name);
2689 msg_format("You miss %s.", m_name);
2693 msg_print("¿¶¤ê²ó¤·¤¿Âç³ù¤¬¼«Ê¬¼«¿È¤ËÊ֤äƤ¤¿¡ª");
2695 msg_print("Your scythe returns to you!");
2698 /* Extract the flags */
2699 object_flags(o_ptr, flgs);
2701 k = damroll(o_ptr->dd + p_ptr->to_dd[hand], o_ptr->ds + p_ptr->to_ds[hand]);
2704 switch (p_ptr->mimic_form)
2707 switch (p_ptr->prace)
2714 case RACE_BARBARIAN:
2718 case RACE_HALF_TROLL:
2719 case RACE_HALF_OGRE:
2720 case RACE_HALF_GIANT:
2721 case RACE_HALF_TITAN:
2729 case RACE_DRACONIAN:
2736 case MIMIC_DEMON_LORD:
2743 if (p_ptr->align < 0 && mult < 20)
2745 if (!(p_ptr->resist_acid || IS_OPPOSE_ACID() || p_ptr->immune_acid) && (mult < 25))
2747 if (!(p_ptr->resist_elec || IS_OPPOSE_ELEC() || p_ptr->immune_elec) && (mult < 25))
2749 if (!(p_ptr->resist_fire || IS_OPPOSE_FIRE() || p_ptr->immune_fire) && (mult < 25))
2751 if (!(p_ptr->resist_cold || IS_OPPOSE_COLD() || p_ptr->immune_cold) && (mult < 25))
2753 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()) && (mult < 25))
2756 if ((p_ptr->pclass != CLASS_SAMURAI) && (have_flag(flgs, TR_FORCE_WEAPON)) && (p_ptr->csp > (p_ptr->msp / 30)))
2758 p_ptr->csp -= (1+(p_ptr->msp / 30));
2759 p_ptr->redraw |= (PR_MANA);
2760 mult = mult * 3 / 2 + 20;
2766 k = critical_norm(o_ptr->weight, o_ptr->to_h, k, p_ptr->to_h[hand], mode);
2771 msg_format("¥°¥Ã¥µ¥êÀÚ¤êÎö¤«¤ì¤¿¡ª");
2773 msg_format("Your weapon cuts deep into yourself!");
2775 /* Try to increase the damage */
2783 k += (p_ptr->to_d[hand] + o_ptr->to_d);
2788 take_hit(DAMAGE_FORCE, k, "»à¤ÎÂç³ù", -1);
2790 take_hit(DAMAGE_FORCE, k, "Death scythe", -1);
2802 msg_format("¥ß¥¹¡ª %s¤Ë¤«¤ï¤µ¤ì¤¿¡£", m_name);
2804 msg_format("You miss %s.", m_name);
2813 if (weak && !(*mdeath))
2816 msg_format("%s¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£", m_name);
2818 msg_format("%^s seems weakened.", m_name);
2821 if (drain_left != MAX_VAMPIRIC_DRAIN)
2825 chg_virtue(V_UNLIFE, 1);
2828 /* Mega-Hack -- apply earthquake brand */
2831 earthquake(py, px, 10);
2832 if (!cave[y][x].m_idx) *mdeath = TRUE;
2837 * @brief ¥×¥ì¥¤¥ä¡¼¤ÎÂÇ·â½èÍý¥á¥¤¥ó¥ë¡¼¥Á¥ó
2838 * @param y ¹¶·âÌÜɸ¤ÎYºÂɸ
2839 * @param x ¹¶·âÌÜɸ¤ÎXºÂɸ
2840 * @param mode ȯưÃæ¤Î·õ½ÑID
2841 * @return ¼ÂºÝ¤Ë¹¶·â½èÍý¤¬¹Ô¤ï¤ì¤¿¾ì¹çTRUE¤òÊÖ¤¹¡£
2843 * If no "weapon" is available, then "punch" the monster one time.
2845 bool py_attack(int y, int x, int mode)
2848 bool mdeath = FALSE;
2849 bool stormbringer = FALSE;
2851 cave_type *c_ptr = &cave[y][x];
2852 monster_type *m_ptr = &m_list[c_ptr->m_idx];
2853 monster_race *r_ptr = &r_info[m_ptr->r_idx];
2856 /* Disturb the player */
2861 if (!p_ptr->migite && !p_ptr->hidarite &&
2862 !(p_ptr->muta2 & (MUT2_HORNS | MUT2_BEAK | MUT2_SCOR_TAIL | MUT2_TRUNK | MUT2_TENTACLES)))
2865 msg_format("%s¹¶·â¤Ç¤¤Ê¤¤¡£", (empty_hands(FALSE) == EMPTY_HAND_NONE) ? "ξ¼ê¤¬¤Õ¤µ¤¬¤Ã¤Æ" : "");
2867 msg_print("You cannot do attacking.");
2872 /* Extract monster name (or "it") */
2873 monster_desc(m_name, m_ptr, 0);
2877 /* Auto-Recall if possible and visible */
2878 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
2880 /* Track a new monster */
2881 health_track(c_ptr->m_idx);
2884 if ((r_ptr->flags1 & RF1_FEMALE) &&
2885 !(p_ptr->stun || p_ptr->confused || p_ptr->image || !m_ptr->ml))
2887 if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
2890 msg_print("ÀÛ¼Ô¡¢¤ª¤Ê¤´¤Ï»Â¤ì¤Ì¡ª");
2892 msg_print("I can not attack women!");
2898 if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
2901 msg_print("¤Ê¤¼¤«¹¶·â¤¹¤ë¤³¤È¤¬¤Ç¤¤Ê¤¤¡£");
2903 msg_print("Something prevent you from attacking.");
2908 /* Stop if friendly */
2909 if (!is_hostile(m_ptr) &&
2910 !(p_ptr->stun || p_ptr->confused || p_ptr->image ||
2911 p_ptr->shero || !m_ptr->ml))
2913 if (inventory[INVEN_RARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
2914 if (inventory[INVEN_LARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
2918 msg_format("¹õ¤¤¿Ï¤Ï¶¯ÍߤË%s¤ò¹¶·â¤·¤¿¡ª", m_name);
2920 msg_format("Your black blade greedily attacks %s!", m_name);
2922 chg_virtue(V_INDIVIDUALISM, 1);
2923 chg_virtue(V_HONOUR, -1);
2924 chg_virtue(V_JUSTICE, -1);
2925 chg_virtue(V_COMPASSION, -1);
2927 else if (p_ptr->pclass != CLASS_BERSERKER)
2930 if (get_check("ËÜÅö¤Ë¹¶·â¤·¤Þ¤¹¤«¡©"))
2932 if (get_check("Really hit it? "))
2935 chg_virtue(V_INDIVIDUALISM, 1);
2936 chg_virtue(V_HONOUR, -1);
2937 chg_virtue(V_JUSTICE, -1);
2938 chg_virtue(V_COMPASSION, -1);
2943 msg_format("%s¤ò¹¶·â¤¹¤ë¤Î¤ò»ß¤á¤¿¡£", m_name);
2945 msg_format("You stop to avoid hitting %s.", m_name);
2953 /* Handle player fear */
2959 msg_format("¶²¤¯¤Æ%s¤ò¹¶·â¤Ç¤¤Ê¤¤¡ª", m_name);
2961 msg_format("You are too afraid to attack %s!", m_name);
2966 msg_format ("¤½¤Ã¤Á¤Ë¤Ï²¿¤«¶²¤¤¤â¤Î¤¬¤¤¤ë¡ª");
2968 msg_format ("There is something scary in your way!");
2971 /* Disturb the monster */
2972 (void)set_monster_csleep(c_ptr->m_idx, 0);
2978 if (MON_CSLEEP(m_ptr)) /* It is not honorable etc to attack helpless victims */
2980 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
2981 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
2984 if (p_ptr->migite && p_ptr->hidarite)
2986 if ((p_ptr->skill_exp[GINOU_NITOURYU] < s_info[p_ptr->pclass].s_max[GINOU_NITOURYU]) && ((p_ptr->skill_exp[GINOU_NITOURYU] - 1000) / 200 < r_ptr->level))
2988 if (p_ptr->skill_exp[GINOU_NITOURYU] < WEAPON_EXP_BEGINNER)
2989 p_ptr->skill_exp[GINOU_NITOURYU] += 80;
2990 else if(p_ptr->skill_exp[GINOU_NITOURYU] < WEAPON_EXP_SKILLED)
2991 p_ptr->skill_exp[GINOU_NITOURYU] += 4;
2992 else if(p_ptr->skill_exp[GINOU_NITOURYU] < WEAPON_EXP_EXPERT)
2993 p_ptr->skill_exp[GINOU_NITOURYU] += 1;
2994 else if(p_ptr->skill_exp[GINOU_NITOURYU] < WEAPON_EXP_MASTER)
2995 if (one_in_(3)) p_ptr->skill_exp[GINOU_NITOURYU] += 1;
2996 p_ptr->update |= (PU_BONUS);
3000 /* Gain riding experience */
3003 int cur = p_ptr->skill_exp[GINOU_RIDING];
3004 int max = s_info[p_ptr->pclass].s_max[GINOU_RIDING];
3008 int ridinglevel = r_info[m_list[p_ptr->riding].r_idx].level;
3009 int targetlevel = r_ptr->level;
3012 if ((cur / 200 - 5) < targetlevel)
3015 /* Extra experience */
3016 if ((cur / 100) < ridinglevel)
3018 if ((cur / 100 + 15) < ridinglevel)
3019 inc += 1 + (ridinglevel - (cur / 100 + 15));
3024 p_ptr->skill_exp[GINOU_RIDING] = MIN(max, cur + inc);
3026 p_ptr->update |= (PU_BONUS);
3030 riding_t_m_idx = c_ptr->m_idx;
3031 if (p_ptr->migite) py_attack_aux(y, x, &fear, &mdeath, 0, mode);
3032 if (p_ptr->hidarite && !mdeath) py_attack_aux(y, x, &fear, &mdeath, 1, mode);
3034 /* Mutations which yield extra 'natural' attacks */
3037 if ((p_ptr->muta2 & MUT2_HORNS) && !mdeath)
3038 natural_attack(c_ptr->m_idx, MUT2_HORNS, &fear, &mdeath);
3039 if ((p_ptr->muta2 & MUT2_BEAK) && !mdeath)
3040 natural_attack(c_ptr->m_idx, MUT2_BEAK, &fear, &mdeath);
3041 if ((p_ptr->muta2 & MUT2_SCOR_TAIL) && !mdeath)
3042 natural_attack(c_ptr->m_idx, MUT2_SCOR_TAIL, &fear, &mdeath);
3043 if ((p_ptr->muta2 & MUT2_TRUNK) && !mdeath)
3044 natural_attack(c_ptr->m_idx, MUT2_TRUNK, &fear, &mdeath);
3045 if ((p_ptr->muta2 & MUT2_TENTACLES) && !mdeath)
3046 natural_attack(c_ptr->m_idx, MUT2_TENTACLES, &fear, &mdeath);
3049 /* Hack -- delay fear messages */
3050 if (fear && m_ptr->ml && !mdeath)
3057 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
3059 msg_format("%^s flees in terror!", m_name);
3064 if ((p_ptr->special_defense & KATA_IAI) && ((mode != HISSATSU_IAI) || mdeath))
3066 set_action(ACTION_NONE);
3074 * @brief ¥Ñ¥¿¡¼¥ó¤Ë¤è¤ë°ÜÆ°À©¸Â½èÍý
3075 * @param c_y ¥×¥ì¥¤¥ä¡¼¤Î°ÜÆ°¸µYºÂɸ
3076 * @param c_x ¥×¥ì¥¤¥ä¡¼¤Î°ÜÆ°¸µXºÂɸ
3077 * @param n_y ¥×¥ì¥¤¥ä¡¼¤Î°ÜÆ°ÀèYºÂɸ
3078 * @param n_x ¥×¥ì¥¤¥ä¡¼¤Î°ÜÆ°ÀèXºÂɸ
3079 * @return °ÜÆ°½èÍý¤¬²Äǽ¤Ç¤¢¤ë¾ì¹ç¡Ê²Äǽ¤Ê¾ì¹ç¤ËÁªÂò¤·¤¿¾ì¹ç¡ËTRUE¤òÊÖ¤¹¡£
3081 bool pattern_seq(int c_y, int c_x, int n_y, int n_x)
3083 feature_type *cur_f_ptr = &f_info[cave[c_y][c_x].feat];
3084 feature_type *new_f_ptr = &f_info[cave[n_y][n_x].feat];
3085 bool is_pattern_tile_cur = have_flag(cur_f_ptr->flags, FF_PATTERN);
3086 bool is_pattern_tile_new = have_flag(new_f_ptr->flags, FF_PATTERN);
3087 int pattern_type_cur, pattern_type_new;
3089 if (!is_pattern_tile_cur && !is_pattern_tile_new) return TRUE;
3091 pattern_type_cur = is_pattern_tile_cur ? cur_f_ptr->subtype : NOT_PATTERN_TILE;
3092 pattern_type_new = is_pattern_tile_new ? new_f_ptr->subtype : NOT_PATTERN_TILE;
3094 if (pattern_type_new == PATTERN_TILE_START)
3096 if (!is_pattern_tile_cur && !p_ptr->confused && !p_ptr->stun && !p_ptr->image)
3099 if (get_check("¥Ñ¥¿¡¼¥ó¤Î¾å¤òÊ⤻Ϥá¤ë¤È¡¢Á´¤Æ¤òÊ⤫¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¤¤¤¤¤Ç¤¹¤«¡©"))
3101 if (get_check("If you start walking the Pattern, you must walk the whole way. Ok? "))
3110 else if ((pattern_type_new == PATTERN_TILE_OLD) ||
3111 (pattern_type_new == PATTERN_TILE_END) ||
3112 (pattern_type_new == PATTERN_TILE_WRECKED))
3114 if (is_pattern_tile_cur)
3121 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤òÊ⤯¤Ë¤Ï¥¹¥¿¡¼¥ÈÃÏÅÀ¤«¤éÊ⤻Ϥá¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£");
3123 msg_print("You must start walking the Pattern from the startpoint.");
3129 else if ((pattern_type_new == PATTERN_TILE_TELEPORT) ||
3130 (pattern_type_cur == PATTERN_TILE_TELEPORT))
3134 else if (pattern_type_cur == PATTERN_TILE_START)
3136 if (is_pattern_tile_new)
3141 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤ÏÀµ¤·¤¤½ç½ø¤ÇÊ⤫¤Í¤Ð¤Ê¤ê¤Þ¤»¤ó¡£");
3143 msg_print("You must walk the Pattern in correct order.");
3149 else if ((pattern_type_cur == PATTERN_TILE_OLD) ||
3150 (pattern_type_cur == PATTERN_TILE_END) ||
3151 (pattern_type_cur == PATTERN_TILE_WRECKED))
3153 if (!is_pattern_tile_new)
3156 msg_print("¥Ñ¥¿¡¼¥ó¤òƧ¤ß³°¤·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£");
3158 msg_print("You may not step off from the Pattern.");
3170 if (!is_pattern_tile_cur)
3173 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤òÊ⤯¤Ë¤Ï¥¹¥¿¡¼¥ÈÃÏÅÀ¤«¤éÊ⤻Ϥá¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£");
3175 msg_print("You must start walking the Pattern from the startpoint.");
3182 byte ok_move = PATTERN_TILE_START;
3183 switch (pattern_type_cur)
3185 case PATTERN_TILE_1:
3186 ok_move = PATTERN_TILE_2;
3188 case PATTERN_TILE_2:
3189 ok_move = PATTERN_TILE_3;
3191 case PATTERN_TILE_3:
3192 ok_move = PATTERN_TILE_4;
3194 case PATTERN_TILE_4:
3195 ok_move = PATTERN_TILE_1;
3200 msg_format("¤ª¤«¤·¤Ê¥Ñ¥¿¡¼¥óÊâ¹Ô¡¢%d¡£", pattern_type_cur);
3202 msg_format("Funny Pattern walking, %d.", pattern_type_cur);
3205 return TRUE; /* Goof-up */
3208 if ((pattern_type_new == ok_move) ||
3209 (pattern_type_new == pattern_type_cur))
3213 if (!is_pattern_tile_new)
3215 msg_print("¥Ñ¥¿¡¼¥ó¤òƧ¤ß³°¤·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£");
3217 msg_print("You may not step off from the Pattern.");
3221 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤ÏÀµ¤·¤¤½ç½ø¤ÇÊ⤫¤Í¤Ð¤Ê¤ê¤Þ¤»¤ó¡£");
3223 msg_print("You must walk the Pattern in correct order.");
3234 * @brief ¥×¥ì¥¤¥ä¡¼¤¬ÃÏ·ÁƧÇ˲Äǽ¤«¤òÊÖ¤¹
3235 * @param feature ȽÄꤷ¤¿¤¤ÃÏ·ÁID
3236 * @param mode °ÜÆ°¤Ë´Ø¤¹¤ë¥ª¥×¥·¥ç¥ó¥Õ¥é¥°
3237 * @return °ÜÆ°²Äǽ¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
3239 bool player_can_enter(s16b feature, u16b mode)
3241 feature_type *f_ptr = &f_info[feature];
3243 if (p_ptr->riding) return monster_can_cross_terrain(feature, &r_info[m_list[p_ptr->riding].r_idx], mode | CEM_RIDING);
3246 if (have_flag(f_ptr->flags, FF_PATTERN))
3248 if (!(mode & CEM_P_CAN_ENTER_PATTERN)) return FALSE;
3252 if (have_flag(f_ptr->flags, FF_CAN_FLY) && p_ptr->levitation) return TRUE;
3253 if (have_flag(f_ptr->flags, FF_CAN_SWIM) && p_ptr->can_swim) return TRUE;
3254 if (have_flag(f_ptr->flags, FF_CAN_PASS) && p_ptr->pass_wall) return TRUE;
3256 if (!have_flag(f_ptr->flags, FF_MOVE)) return FALSE;
3263 * @brief °ÜÆ°¤Ëȼ¤¦¥×¥ì¥¤¥ä¡¼¤Î¥¹¥Æ¡¼¥¿¥¹ÊѲ½½èÍý
3264 * @param ny °ÜÆ°ÀèYºÂɸ
3265 * @param nx °ÜÆ°ÀèXºÂɸ
3266 * @param mpe_mode °ÜÆ°¥ª¥×¥·¥ç¥ó¥Õ¥é¥°
3267 * @return ¥×¥ì¥¤¥ä¡¼¤¬»àË´¤ä¥Õ¥í¥¢Î¥Ã¦¤ò¹Ô¤ï¤º¡¢¼ÂºÝ¤Ë°ÜÆ°¤¬²Äǽ¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
3269 bool move_player_effect(int ny, int nx, u32b mpe_mode)
3271 cave_type *c_ptr = &cave[ny][nx];
3272 feature_type *f_ptr = &f_info[c_ptr->feat];
3274 if (!(mpe_mode & MPE_STAYING))
3278 cave_type *oc_ptr = &cave[oy][ox];
3279 int om_idx = oc_ptr->m_idx;
3280 int nm_idx = c_ptr->m_idx;
3282 /* Move the player */
3286 /* Hack -- For moving monster or riding player's moving */
3287 if (!(mpe_mode & MPE_DONT_SWAP_MON))
3289 /* Swap two monsters */
3290 c_ptr->m_idx = om_idx;
3291 oc_ptr->m_idx = nm_idx;
3293 if (om_idx > 0) /* Monster on old spot (or p_ptr->riding) */
3295 monster_type *om_ptr = &m_list[om_idx];
3298 update_mon(om_idx, TRUE);
3301 if (nm_idx > 0) /* Monster on new spot */
3303 monster_type *nm_ptr = &m_list[nm_idx];
3306 update_mon(nm_idx, TRUE);
3310 /* Redraw old spot */
3313 /* Redraw new spot */
3316 /* Check for new panel (redraw map) */
3319 if (mpe_mode & MPE_FORGET_FLOW)
3323 /* Mega-Hack -- Forget the view */
3324 p_ptr->update |= (PU_UN_VIEW);
3327 p_ptr->redraw |= (PR_MAP);
3331 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_DISTANCE);
3334 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
3336 /* Remove "unsafe" flag */
3337 if ((!p_ptr->blind && !no_lite()) || !is_trap(c_ptr->feat)) c_ptr->info &= ~(CAVE_UNSAFE);
3339 /* For get everything when requested hehe I'm *NASTY* */
3340 if (dun_level && (d_info[dungeon_type].flags1 & DF1_FORGET)) wiz_dark();
3343 if (mpe_mode & MPE_HANDLE_STUFF) handle_stuff();
3345 if (p_ptr->pclass == CLASS_NINJA)
3347 if (c_ptr->info & (CAVE_GLOW)) set_superstealth(FALSE);
3348 else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
3351 if ((p_ptr->action == ACTION_HAYAGAKE) &&
3352 (!have_flag(f_ptr->flags, FF_PROJECT) ||
3353 (!p_ptr->levitation && have_flag(f_ptr->flags, FF_DEEP))))
3356 msg_print("¤³¤³¤Ç¤ÏÁÇÁ᤯ư¤±¤Ê¤¤¡£");
3358 msg_print("You cannot run in here.");
3360 set_action(ACTION_NONE);
3364 if (mpe_mode & MPE_ENERGY_USE)
3366 if (music_singing(MUSIC_WALL))
3368 (void)project(0, 0, py, px, (60 + p_ptr->lev), GF_DISINTEGRATE,
3369 PROJECT_KILL | PROJECT_ITEM, -1);
3371 if (!player_bold(ny, nx) || p_ptr->is_dead || p_ptr->leaving) return FALSE;
3374 /* Spontaneous Searching */
3375 if ((p_ptr->skill_fos >= 50) || (0 == randint0(50 - p_ptr->skill_fos)))
3380 /* Continuous Searching */
3381 if (p_ptr->action == ACTION_SEARCH)
3387 /* Handle "objects" */
3388 if (!(mpe_mode & MPE_DONT_PICKUP))
3390 carry((mpe_mode & MPE_DO_PICKUP) ? TRUE : FALSE);
3393 /* Handle "store doors" */
3394 if (have_flag(f_ptr->flags, FF_STORE))
3400 /* Hack -- Enter store */
3401 command_new = SPECIAL_KEY_STORE;
3404 /* Handle "building doors" -KMW- */
3405 else if (have_flag(f_ptr->flags, FF_BLDG))
3411 /* Hack -- Enter building */
3412 command_new = SPECIAL_KEY_BUILDING;
3415 /* Handle quest areas -KMW- */
3416 else if (have_flag(f_ptr->flags, FF_QUEST_ENTER))
3422 /* Hack -- Enter quest level */
3423 command_new = SPECIAL_KEY_QUEST;
3426 else if (have_flag(f_ptr->flags, FF_QUEST_EXIT))
3428 if (quest[p_ptr->inside_quest].type == QUEST_TYPE_FIND_EXIT)
3430 complete_quest(p_ptr->inside_quest);
3433 leave_quest_check();
3435 p_ptr->inside_quest = c_ptr->special;
3440 p_ptr->leaving = TRUE;
3443 /* Set off a trap */
3444 else if (have_flag(f_ptr->flags, FF_HIT_TRAP) && !(mpe_mode & MPE_STAYING))
3450 if (c_ptr->mimic || have_flag(f_ptr->flags, FF_SECRET))
3454 msg_print("¥È¥é¥Ã¥×¤À¡ª");
3456 msg_print("You found a trap!");
3460 disclose_grid(py, px);
3464 hit_trap((mpe_mode & MPE_BREAK_TRAP) ? TRUE : FALSE);
3466 if (!player_bold(ny, nx) || p_ptr->is_dead || p_ptr->leaving) return FALSE;
3469 /* Warn when leaving trap detected region */
3470 if (!(mpe_mode & MPE_STAYING) && (disturb_trap_detect || alert_trap_detect)
3471 && p_ptr->dtrap && !(c_ptr->info & CAVE_IN_DETECT))
3473 /* No duplicate warning */
3474 p_ptr->dtrap = FALSE;
3476 /* You are just on the edge */
3477 if (!(c_ptr->info & CAVE_UNSAFE))
3479 if (alert_trap_detect)
3482 msg_print("* Ãí°Õ:¤³¤ÎÀè¤Ï¥È¥é¥Ã¥×¤Î´¶ÃÎÈϰϳ°¤Ç¤¹¡ª *");
3484 msg_print("*Leaving trap detect region!*");
3488 if (disturb_trap_detect) disturb(0, 1);
3492 return player_bold(ny, nx) && !p_ptr->is_dead && !p_ptr->leaving;
3496 * @brief ³ºÅöÃÏ·Á¤Î¥È¥é¥Ã¥×¤¬¥×¥ì¥¤¥ä¡¼¤Ë¤È¤Ã¤Æ̵¸ú¤«¤É¤¦¤«¤òȽÄꤷ¤ÆÊÖ¤¹
3497 * @param feat ÃÏ·ÁID
3498 * @return ¥È¥é¥Ã¥×¤¬¼«Æ°Åª¤Ë̵¸ú¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
3500 bool trap_can_be_ignored(int feat)
3502 feature_type *f_ptr = &f_info[feat];
3504 if (!have_flag(f_ptr->flags, FF_TRAP)) return TRUE;
3506 switch (f_ptr->subtype)
3510 case TRAP_SPIKED_PIT:
3511 case TRAP_POISON_PIT:
3512 if (p_ptr->levitation) return TRUE;
3515 if (p_ptr->anti_tele) return TRUE;
3518 if (p_ptr->immune_fire) return TRUE;
3521 if (p_ptr->immune_acid) return TRUE;
3524 if (p_ptr->resist_blind) return TRUE;
3527 if (p_ptr->resist_conf) return TRUE;
3530 if (p_ptr->resist_pois) return TRUE;
3533 if (p_ptr->free_act) return TRUE;
3542 * Determine if a "boundary" grid is "floor mimic"
3544 #define boundary_floor(C, F, MF) \
3545 ((C)->mimic && permanent_wall(F) && \
3546 (have_flag((MF)->flags, FF_MOVE) || have_flag((MF)->flags, FF_CAN_FLY)) && \
3547 have_flag((MF)->flags, FF_PROJECT) && \
3548 !have_flag((MF)->flags, FF_OPEN))
3552 * @brief ³ºÅöÃÏ·Á¤Î¥È¥é¥Ã¥×¤¬¥×¥ì¥¤¥ä¡¼¤Ë¤È¤Ã¤Æ̵¸ú¤«¤É¤¦¤«¤òȽÄꤷ¤ÆÊÖ¤¹ /
3553 * Move player in the given direction, with the given "pickup" flag.
3554 * @param dir °ÜÆ°Êý¸þID
3555 * @param do_pickup 櫲ò½ü¤ò»î¤ß¤Ê¤¬¤é¤Î°ÜÆ°¤Ê¤é¤ÐTRUE
3556 * @param break_trap ¥È¥é¥Ã¥×Ê´ºÕ½èÍý¤ò¹Ô¤¦¤Ê¤é¤ÐTRUE
3557 * @return ¼ÂºÝ¤Ë°ÜÆ°¤¬¹Ô¤ï¤ì¤¿¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
3559 * This routine should (probably) always induce energy expenditure.\n
3561 * Note that moving will *always* take a turn, and will *always* hit\n
3562 * any monster which might be in the destination grid. Previously,\n
3563 * moving into walls was "free" and did NOT hit invisible monsters.\n
3565 void move_player(int dir, bool do_pickup, bool break_trap)
3567 /* Find the result of moving */
3568 int y = py + ddy[dir];
3569 int x = px + ddx[dir];
3571 /* Examine the destination */
3572 cave_type *c_ptr = &cave[y][x];
3574 feature_type *f_ptr = &f_info[c_ptr->feat];
3576 monster_type *m_ptr;
3578 monster_type *riding_m_ptr = &m_list[p_ptr->riding];
3579 monster_race *riding_r_ptr = &r_info[p_ptr->riding ? riding_m_ptr->r_idx : 0]; /* Paranoia */
3583 bool p_can_enter = player_can_enter(c_ptr->feat, CEM_P_CAN_ENTER_PATTERN);
3584 bool p_can_kill_walls = FALSE;
3585 bool stormbringer = FALSE;
3587 bool oktomove = TRUE;
3588 bool do_past = FALSE;
3591 if (!dun_level && !p_ptr->wild_mode &&
3592 ((x == 0) || (x == MAX_WID - 1) ||
3593 (y == 0) || (y == MAX_HGT - 1)))
3595 /* Can the player enter the grid? */
3596 if (c_ptr->mimic && player_can_enter(c_ptr->mimic, 0))
3598 /* Hack: move to new area */
3599 if ((y == 0) && (x == 0))
3601 p_ptr->wilderness_y--;
3602 p_ptr->wilderness_x--;
3603 p_ptr->oldpy = cur_hgt - 2;
3604 p_ptr->oldpx = cur_wid - 2;
3605 ambush_flag = FALSE;
3608 else if ((y == 0) && (x == MAX_WID - 1))
3610 p_ptr->wilderness_y--;
3611 p_ptr->wilderness_x++;
3612 p_ptr->oldpy = cur_hgt - 2;
3614 ambush_flag = FALSE;
3617 else if ((y == MAX_HGT - 1) && (x == 0))
3619 p_ptr->wilderness_y++;
3620 p_ptr->wilderness_x--;
3622 p_ptr->oldpx = cur_wid - 2;
3623 ambush_flag = FALSE;
3626 else if ((y == MAX_HGT - 1) && (x == MAX_WID - 1))
3628 p_ptr->wilderness_y++;
3629 p_ptr->wilderness_x++;
3632 ambush_flag = FALSE;
3637 p_ptr->wilderness_y--;
3638 p_ptr->oldpy = cur_hgt - 2;
3640 ambush_flag = FALSE;
3643 else if (y == MAX_HGT - 1)
3645 p_ptr->wilderness_y++;
3648 ambush_flag = FALSE;
3653 p_ptr->wilderness_x--;
3654 p_ptr->oldpx = cur_wid - 2;
3656 ambush_flag = FALSE;
3659 else if (x == MAX_WID - 1)
3661 p_ptr->wilderness_x++;
3664 ambush_flag = FALSE;
3667 p_ptr->leaving = TRUE;
3673 /* "Blocked" message appears later */
3674 /* oktomove = FALSE; */
3675 p_can_enter = FALSE;
3678 /* Get the monster */
3679 m_ptr = &m_list[c_ptr->m_idx];
3682 if (inventory[INVEN_RARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
3683 if (inventory[INVEN_LARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
3685 /* Player can not walk through "walls"... */
3686 /* unless in Shadow Form */
3687 p_can_kill_walls = p_ptr->kill_wall && have_flag(f_ptr->flags, FF_HURT_DISI) &&
3688 (!p_can_enter || !have_flag(f_ptr->flags, FF_LOS)) &&
3689 !have_flag(f_ptr->flags, FF_PERMANENT);
3691 /* Hack -- attack monsters */
3692 if (c_ptr->m_idx && (m_ptr->ml || p_can_enter || p_can_kill_walls))
3694 monster_race *r_ptr = &r_info[m_ptr->r_idx];
3696 /* Attack -- only if we can see it OR it is not in a wall */
3697 if (!is_hostile(m_ptr) &&
3698 !(p_ptr->confused || p_ptr->image || !m_ptr->ml || p_ptr->stun ||
3699 ((p_ptr->muta2 & MUT2_BERS_RAGE) && p_ptr->shero)) &&
3700 pattern_seq(py, px, y, x) && (p_can_enter || p_can_kill_walls))
3702 /* Disturb the monster */
3703 (void)set_monster_csleep(c_ptr->m_idx, 0);
3705 /* Extract monster name (or "it") */
3706 monster_desc(m_name, m_ptr, 0);
3710 /* Auto-Recall if possible and visible */
3711 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
3713 /* Track a new monster */
3714 health_track(c_ptr->m_idx);
3718 if ((stormbringer && (randint1(1000) > 666)) || (p_ptr->pclass == CLASS_BERSERKER))
3723 else if (monster_can_cross_terrain(cave[py][px].feat, r_ptr, 0))
3730 msg_format("%^s¤¬¼ÙËâ¤À¡ª", m_name);
3732 msg_format("%^s is in your way!", m_name);
3739 /* now continue on to 'movement' */
3748 if (oktomove && p_ptr->riding)
3750 if (riding_r_ptr->flags1 & RF1_NEVER_MOVE)
3753 msg_print("Æ°¤±¤Ê¤¤¡ª");
3755 msg_print("Can't move!");
3761 else if (MON_MONFEAR(riding_m_ptr))
3765 /* Acquire the monster name */
3766 monster_desc(m_name, riding_m_ptr, 0);
3768 /* Dump a message */
3770 msg_format("%s¤¬¶²Éݤ·¤Æ¤¤¤ÆÀ©¸æ¤Ç¤¤Ê¤¤¡£", m_name);
3772 msg_format("%^s is too scared to control.", m_name);
3777 else if (p_ptr->riding_ryoute)
3782 else if (have_flag(f_ptr->flags, FF_CAN_FLY) && (riding_r_ptr->flags7 & RF7_CAN_FLY))
3786 else if (have_flag(f_ptr->flags, FF_CAN_SWIM) && (riding_r_ptr->flags7 & RF7_CAN_SWIM))
3790 else if (have_flag(f_ptr->flags, FF_WATER) &&
3791 !(riding_r_ptr->flags7 & RF7_AQUATIC) &&
3792 (have_flag(f_ptr->flags, FF_DEEP) || (riding_r_ptr->flags2 & RF2_AURA_FIRE)))
3795 msg_format("%s¤Î¾å¤Ë¹Ô¤±¤Ê¤¤¡£", f_name + f_info[get_feat_mimic(c_ptr)].name);
3797 msg_print("Can't swim.");
3803 else if (!have_flag(f_ptr->flags, FF_WATER) && (riding_r_ptr->flags7 & RF7_AQUATIC))
3806 msg_format("%s¤«¤é¾å¤¬¤ì¤Ê¤¤¡£", f_name + f_info[get_feat_mimic(&cave[py][px])].name);
3808 msg_print("Can't land.");
3814 else if (have_flag(f_ptr->flags, FF_LAVA) && !(riding_r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK))
3817 msg_format("%s¤Î¾å¤Ë¹Ô¤±¤Ê¤¤¡£", f_name + f_info[get_feat_mimic(c_ptr)].name);
3819 msg_print("Too hot to go through.");
3826 if (oktomove && MON_STUNNED(riding_m_ptr) && one_in_(2))
3829 monster_desc(m_name, riding_m_ptr, 0);
3831 msg_format("%s¤¬Û¯Û°¤È¤·¤Æ¤¤¤Æ¤¦¤Þ¤¯Æ°¤±¤Ê¤¤¡ª",m_name);
3833 msg_format("You cannot control stunned %s!",m_name);
3844 else if (!have_flag(f_ptr->flags, FF_MOVE) && have_flag(f_ptr->flags, FF_CAN_FLY) && !p_ptr->levitation)
3847 msg_format("¶õ¤òÈô¤Ð¤Ê¤¤¤È%s¤Î¾å¤Ë¤Ï¹Ô¤±¤Ê¤¤¡£", f_name + f_info[get_feat_mimic(c_ptr)].name);
3849 msg_format("You need to fly to go through the %s.", f_name + f_info[get_feat_mimic(c_ptr)].name);
3858 * Player can move through trees and
3859 * has effective -10 speed
3860 * Rangers can move without penality
3862 else if (have_flag(f_ptr->flags, FF_TREE) && !p_can_kill_walls)
3864 if ((p_ptr->pclass != CLASS_RANGER) && !p_ptr->levitation && (!p_ptr->riding || !(riding_r_ptr->flags8 & RF8_WILD_WOOD))) energy_use *= 2;
3867 #ifdef ALLOW_EASY_DISARM /* TNB */
3869 /* Disarm a visible trap */
3870 else if ((do_pickup != easy_disarm) && have_flag(f_ptr->flags, FF_DISARM) && !c_ptr->mimic)
3872 if (!trap_can_be_ignored(c_ptr->feat))
3874 (void)do_cmd_disarm_aux(y, x, dir);
3879 #endif /* ALLOW_EASY_DISARM -- TNB */
3881 /* Player can not walk through "walls" unless in wraith form...*/
3882 else if (!p_can_enter && !p_can_kill_walls)
3884 /* Feature code (applying "mimic" field) */
3885 s16b feat = get_feat_mimic(c_ptr);
3886 feature_type *mimic_f_ptr = &f_info[feat];
3887 cptr name = f_name + mimic_f_ptr->name;
3891 /* Notice things in the dark */
3892 if (!(c_ptr->info & CAVE_MARK) && !player_can_see_bold(y, x))
3894 /* Boundary floor mimic */
3895 if (boundary_floor(c_ptr, f_ptr, mimic_f_ptr))
3898 msg_print("¤½¤ì°Ê¾åÀè¤Ë¤Ï¿Ê¤á¤Ê¤¤¤è¤¦¤À¡£");
3900 msg_print("You feel you cannot go any more.");
3904 /* Wall (or secret door) */
3908 msg_format("%s¤¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¤è¤¦¤À¡£", name);
3910 msg_format("You feel %s %s blocking your way.",
3911 is_a_vowel(name[0]) ? "an" : "a", name);
3914 c_ptr->info |= (CAVE_MARK);
3922 /* Boundary floor mimic */
3923 if (boundary_floor(c_ptr, f_ptr, mimic_f_ptr))
3926 msg_print("¤½¤ì°Ê¾åÀè¤Ë¤Ï¿Ê¤á¤Ê¤¤¡£");
3928 msg_print("You cannot go any more.");
3931 if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
3935 /* Wall (or secret door) */
3938 #ifdef ALLOW_EASY_OPEN
3940 if (easy_open && is_closed_door(feat) && easy_open_door(y, x)) return;
3941 #endif /* ALLOW_EASY_OPEN */
3944 msg_format("%s¤¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¡£", name);
3946 msg_format("There is %s %s blocking your way.",
3947 is_a_vowel(name[0]) ? "an" : "a", name);
3951 * Well, it makes sense that you lose time bumping into
3952 * a wall _if_ you are confused, stunned or blind; but
3953 * typing mistakes should not cost you a turn...
3955 if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
3960 /* Disturb the player */
3964 if (!boundary_floor(c_ptr, f_ptr, mimic_f_ptr)) sound(SOUND_HITWALL);
3967 /* Normal movement */
3968 if (oktomove && !pattern_seq(py, px, y, x))
3970 if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
3975 /* To avoid a loop with running */
3981 /* Normal movement */
3984 u32b mpe_mode = MPE_ENERGY_USE;
3988 if (!process_warning(x, y))
3998 msg_format("%s¤ò²¡¤·Âऱ¤¿¡£", m_name);
4000 msg_format("You push past %s.", m_name);
4004 /* Change oldpx and oldpy to place the player well when going back to big mode */
4005 if (p_ptr->wild_mode)
4007 if (ddy[dir] > 0) p_ptr->oldpy = 1;
4008 if (ddy[dir] < 0) p_ptr->oldpy = MAX_HGT - 2;
4009 if (ddy[dir] == 0) p_ptr->oldpy = MAX_HGT / 2;
4010 if (ddx[dir] > 0) p_ptr->oldpx = 1;
4011 if (ddx[dir] < 0) p_ptr->oldpx = MAX_WID - 2;
4012 if (ddx[dir] == 0) p_ptr->oldpx = MAX_WID / 2;
4015 if (p_can_kill_walls)
4017 cave_alter_feat(y, x, FF_HURT_DISI);
4019 /* Update some things -- similar to GF_KILL_WALL */
4020 p_ptr->update |= (PU_FLOW);
4024 /* sound(SOUND_WALK); */
4026 #ifdef ALLOW_EASY_DISARM /* TNB */
4028 if (do_pickup != always_pickup) mpe_mode |= MPE_DO_PICKUP;
4030 #else /* ALLOW_EASY_DISARM -- TNB */
4032 if (do_pickup) mpe_mode |= MPE_DO_PICKUP;
4034 #endif /* ALLOW_EASY_DISARM -- TNB */
4036 if (break_trap) mpe_mode |= MPE_BREAK_TRAP;
4038 /* Move the player */
4039 (void)move_player_effect(y, x, mpe_mode);
4044 static bool ignore_avoid_run;
4047 * @brief ¥À¥Ã¥·¥å°ÜÆ°½èÍýÃæ¡¢°ÜÆ°Àè¤Î¥Þ¥¹¤¬´ûÃΤÎÊɤ«¤É¤¦¤«¤òȽÄꤹ¤ë /
4048 * Hack -- Check for a "known wall" (see below)
4049 * @param dir ÁÛÄꤹ¤ë°ÜÆ°Êý¸þID
4050 * @param y °ÜÆ°¸µ¤ÎYºÂɸ
4051 * @param x °ÜÆ°¸µ¤ÎXºÂɸ
4052 * @return °ÜÆ°À褬´ûÃΤÎÊɤʤé¤ÐTRUE
4054 static int see_wall(int dir, int y, int x)
4058 /* Get the new location */
4062 /* Illegal grids are not known walls */
4063 if (!in_bounds2(y, x)) return (FALSE);
4066 c_ptr = &cave[y][x];
4068 /* Must be known to the player */
4069 if (c_ptr->info & (CAVE_MARK))
4071 /* Feature code (applying "mimic" field) */
4072 s16b feat = get_feat_mimic(c_ptr);
4073 feature_type *f_ptr = &f_info[feat];
4075 /* Wall grids are known walls */
4076 if (!player_can_enter(feat, 0)) return !have_flag(f_ptr->flags, FF_DOOR);
4078 /* Don't run on a tree unless explicitly requested */
4079 if (have_flag(f_ptr->flags, FF_AVOID_RUN) && !ignore_avoid_run)
4082 /* Don't run in a wall */
4083 if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY))
4084 return !have_flag(f_ptr->flags, FF_DOOR);
4092 * @brief ¥À¥Ã¥·¥å°ÜÆ°½èÍýÃæ¡¢°ÜÆ°Àè¤Î¥Þ¥¹¤«Ì¤ÃΤÎÃÏ·Á¤«¤É¤¦¤«¤òȽÄꤹ¤ë /
4093 * Hack -- Check for an "unknown corner" (see below)
4094 * @param dir ÁÛÄꤹ¤ë°ÜÆ°Êý¸þID
4095 * @param y °ÜÆ°¸µ¤ÎYºÂɸ
4096 * @param x °ÜÆ°¸µ¤ÎXºÂɸ
4097 * @return °ÜÆ°À褬̤ÃΤÎÃÏ·Á¤Ê¤é¤ÐTRUE
4099 static int see_nothing(int dir, int y, int x)
4101 /* Get the new location */
4105 /* Illegal grids are unknown */
4106 if (!in_bounds2(y, x)) return (TRUE);
4108 /* Memorized grids are always known */
4109 if (cave[y][x].info & (CAVE_MARK)) return (FALSE);
4111 /* Viewable door/wall grids are known */
4112 if (player_can_see_bold(y, x)) return (FALSE);
4124 * Hack -- allow quick "cycling" through the legal directions
4126 static byte cycle[] =
4127 { 1, 2, 3, 6, 9, 8, 7, 4, 1, 2, 3, 6, 9, 8, 7, 4, 1 };
4130 * Hack -- map each direction into the "middle" of the "cycle[]" array
4132 static byte chome[] =
4133 { 0, 8, 9, 10, 7, 0, 11, 6, 5, 4 };
4136 * The direction we are running
4138 static byte find_current;
4141 * The direction we came from
4143 static byte find_prevdir;
4146 * We are looking for open area
4148 static bool find_openarea;
4151 * We are looking for a break
4153 static bool find_breakright;
4154 static bool find_breakleft;
4159 * @brief ¥À¥Ã¥·¥å½èÍý¤ÎƳÆþ /
4160 * Initialize the running algorithm for a new direction.
4161 * @param dir ƳÆþ¤Î°ÜÆ°Àè
4163 * Diagonal Corridor -- allow diaginal entry into corridors.\n
4165 * Blunt Corridor -- If there is a wall two spaces ahead and\n
4166 * we seem to be in a corridor, then force a turn into the side\n
4167 * corridor, must be moving straight into a corridor here. ???\n
4169 * Diagonal Corridor Blunt Corridor (?)\n
4174 static void run_init(int dir)
4176 int row, col, deepleft, deepright;
4177 int i, shortleft, shortright;
4180 /* Save the direction */
4183 /* Assume running straight */
4186 /* Assume looking for open area */
4187 find_openarea = TRUE;
4189 /* Assume not looking for breaks */
4190 find_breakright = find_breakleft = FALSE;
4192 /* Assume no nearby walls */
4193 deepleft = deepright = FALSE;
4194 shortright = shortleft = FALSE;
4199 /* Find the destination grid */
4200 row = py + ddy[dir];
4201 col = px + ddx[dir];
4203 ignore_avoid_run = cave_have_flag_bold(row, col, FF_AVOID_RUN);
4205 /* Extract cycle index */
4208 /* Check for walls */
4209 if (see_wall(cycle[i+1], py, px))
4211 find_breakleft = TRUE;
4214 else if (see_wall(cycle[i+1], row, col))
4216 find_breakleft = TRUE;
4220 /* Check for walls */
4221 if (see_wall(cycle[i-1], py, px))
4223 find_breakright = TRUE;
4226 else if (see_wall(cycle[i-1], row, col))
4228 find_breakright = TRUE;
4232 /* Looking for a break */
4233 if (find_breakleft && find_breakright)
4235 /* Not looking for open area */
4236 find_openarea = FALSE;
4238 /* Hack -- allow angled corridor entry */
4241 if (deepleft && !deepright)
4243 find_prevdir = cycle[i - 1];
4245 else if (deepright && !deepleft)
4247 find_prevdir = cycle[i + 1];
4251 /* Hack -- allow blunt corridor entry */
4252 else if (see_wall(cycle[i], row, col))
4254 if (shortleft && !shortright)
4256 find_prevdir = cycle[i - 2];
4258 else if (shortright && !shortleft)
4260 find_prevdir = cycle[i + 2];
4268 * @brief ¥À¥Ã¥·¥å°ÜÆ°¤¬·Ñ³¤Ç¤¤ë¤«¤É¤¦¤«¤ÎȽÄê /
4269 * Update the current "run" path
4271 * ¥À¥Ã¥·¥å°ÜÆ°¤¬·Ñ³¤Ç¤¤ë¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
4272 * Return TRUE if the running should be stopped
4274 static bool run_test(void)
4276 int prev_dir, new_dir, check_dir = 0;
4279 int option = 0, option2 = 0;
4282 feature_type *f_ptr;
4284 /* Where we came from */
4285 prev_dir = find_prevdir;
4288 /* Range of newly adjacent grids */
4289 max = (prev_dir & 0x01) + 1;
4291 /* break run when leaving trap detected region */
4292 if ((disturb_trap_detect || alert_trap_detect)
4293 && p_ptr->dtrap && !(cave[py][px].info & CAVE_IN_DETECT))
4295 /* No duplicate warning */
4296 p_ptr->dtrap = FALSE;
4298 /* You are just on the edge */
4299 if (!(cave[py][px].info & CAVE_UNSAFE))
4301 if (alert_trap_detect)
4304 msg_print("* Ãí°Õ:¤³¤ÎÀè¤Ï¥È¥é¥Ã¥×¤Î´¶ÃÎÈϰϳ°¤Ç¤¹¡ª *");
4306 msg_print("*Leaving trap detect region!*");
4310 if (disturb_trap_detect)
4318 /* Look at every newly adjacent square. */
4319 for (i = -max; i <= max; i++)
4321 s16b this_o_idx, next_o_idx = 0;
4324 new_dir = cycle[chome[prev_dir] + i];
4327 row = py + ddy[new_dir];
4328 col = px + ddx[new_dir];
4331 c_ptr = &cave[row][col];
4333 /* Feature code (applying "mimic" field) */
4334 feat = get_feat_mimic(c_ptr);
4335 f_ptr = &f_info[feat];
4337 /* Visible monsters abort running */
4340 monster_type *m_ptr = &m_list[c_ptr->m_idx];
4342 /* Visible monster */
4343 if (m_ptr->ml) return (TRUE);
4346 /* Visible objects abort running */
4347 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
4351 /* Acquire object */
4352 o_ptr = &o_list[this_o_idx];
4354 /* Acquire next object */
4355 next_o_idx = o_ptr->next_o_idx;
4357 /* Visible object */
4358 if (o_ptr->marked & OM_FOUND) return (TRUE);
4361 /* Assume unknown */
4364 /* Check memorized grids */
4365 if (c_ptr->info & (CAVE_MARK))
4367 bool notice = have_flag(f_ptr->flags, FF_NOTICE);
4369 if (notice && have_flag(f_ptr->flags, FF_MOVE))
4372 if (find_ignore_doors && have_flag(f_ptr->flags, FF_DOOR) && have_flag(f_ptr->flags, FF_CLOSE))
4374 /* Option -- ignore */
4379 else if (find_ignore_stairs && have_flag(f_ptr->flags, FF_STAIRS))
4381 /* Option -- ignore */
4386 else if (have_flag(f_ptr->flags, FF_LAVA) && (p_ptr->immune_fire || IS_INVULN()))
4393 else if (have_flag(f_ptr->flags, FF_WATER) && have_flag(f_ptr->flags, FF_DEEP) &&
4394 (p_ptr->levitation || p_ptr->can_swim || (p_ptr->total_weight <= weight_limit())))
4401 /* Interesting feature */
4402 if (notice) return (TRUE);
4404 /* The grid is "visible" */
4408 /* Analyze unknown grids and floors considering mimic */
4409 if (inv || !see_wall(0, row, col))
4411 /* Looking for open area */
4417 /* The first new direction. */
4423 /* Three new directions. Stop running. */
4429 /* Two non-adjacent new directions. Stop running. */
4430 else if (option != cycle[chome[prev_dir] + i - 1])
4435 /* Two new (adjacent) directions (case 1) */
4436 else if (new_dir & 0x01)
4438 check_dir = cycle[chome[prev_dir] + i - 2];
4442 /* Two new (adjacent) directions (case 2) */
4445 check_dir = cycle[chome[prev_dir] + i + 1];
4451 /* Obstacle, while looking for open area */
4458 /* Break to the right */
4459 find_breakright = TRUE;
4464 /* Break to the left */
4465 find_breakleft = TRUE;
4471 /* Looking for open area */
4474 /* Hack -- look again */
4475 for (i = -max; i < 0; i++)
4477 /* Unknown grid or non-wall */
4478 if (!see_wall(cycle[chome[prev_dir] + i], py, px))
4480 /* Looking to break right */
4481 if (find_breakright)
4490 /* Looking to break left */
4498 /* Hack -- look again */
4499 for (i = max; i > 0; i--)
4501 /* Unknown grid or non-wall */
4502 if (!see_wall(cycle[chome[prev_dir] + i], py, px))
4504 /* Looking to break left */
4514 /* Looking to break right */
4515 if (find_breakright)
4523 /* Not looking for open area */
4535 /* Primary option */
4536 find_current = option;
4538 /* No other options */
4539 find_prevdir = option;
4542 /* Two options, examining corners */
4545 /* Primary option */
4546 find_current = option;
4548 /* Hack -- allow curving */
4549 find_prevdir = option2;
4552 /* Two options, pick one */
4555 /* Get next location */
4556 row = py + ddy[option];
4557 col = px + ddx[option];
4559 /* Don't see that it is closed off. */
4560 /* This could be a potential corner or an intersection. */
4561 if (!see_wall(option, row, col) ||
4562 !see_wall(check_dir, row, col))
4564 /* Can not see anything ahead and in the direction we */
4565 /* are turning, assume that it is a potential corner. */
4566 if (see_nothing(option, row, col) &&
4567 see_nothing(option2, row, col))
4569 find_current = option;
4570 find_prevdir = option2;
4573 /* STOP: we are next to an intersection or a room */
4580 /* This corner is seen to be enclosed; we cut the corner. */
4583 find_current = option2;
4584 find_prevdir = option2;
4587 /* This corner is seen to be enclosed, and we */
4588 /* deliberately go the long way. */
4591 find_current = option;
4592 find_prevdir = option2;
4597 /* About to hit a known wall, stop */
4598 if (see_wall(find_current, py, px))
4610 * @brief ·Ñ³Ū¤Ê¥À¥Ã¥·¥å½èÍý /
4611 * Take one step along the current "run" path
4612 * @param dir °ÜÆ°¤ò»î¤ß¤ëÊý¸þID
4615 void run_step(int dir)
4620 /* Ignore AVOID_RUN on a first step */
4621 ignore_avoid_run = TRUE;
4623 /* Hack -- do not start silly run */
4624 if (see_wall(dir, py, px))
4628 msg_print("¤½¤ÎÊý¸þ¤Ë¤ÏÁö¤ì¤Þ¤»¤ó¡£");
4630 msg_print("You cannot run in that direction.");
4658 /* Decrease the run counter */
4659 if (--running <= 0) return;
4664 /* Move the player, using the "pickup" flag */
4665 #ifdef ALLOW_EASY_DISARM /* TNB */
4667 move_player(find_current, FALSE, FALSE);
4669 #else /* ALLOW_EASY_DISARM -- TNB */
4671 move_player(find_current, always_pickup, FALSE);
4673 #endif /* ALLOW_EASY_DISARM -- TNB */
4675 if (player_bold(p_ptr->run_py, p_ptr->run_px))
4687 * @brief ¥È¥é¥Ù¥ëµ¡Ç½¤ÎȽÄê½èÍý /
4688 * Test for traveling
4689 * @param prev_dir Á°²ó°ÜÆ°¤ò¹Ô¤Ã¤¿¸µ¤ÎÊý³ÑID
4692 static int travel_test(int prev_dir)
4696 const cave_type *c_ptr;
4699 /* Cannot travel when blind */
4700 if (p_ptr->blind || no_lite())
4702 msg_print(_("Ìܤ¬¸«¤¨¤Ê¤¤¡ª", "You cannot see!"));
4706 /* break run when leaving trap detected region */
4707 if ((disturb_trap_detect || alert_trap_detect)
4708 && p_ptr->dtrap && !(cave[py][px].info & CAVE_IN_DETECT))
4710 /* No duplicate warning */
4711 p_ptr->dtrap = FALSE;
4713 /* You are just on the edge */
4714 if (!(cave[py][px].info & CAVE_UNSAFE))
4716 if (alert_trap_detect)
4719 msg_print("* Ãí°Õ:¤³¤ÎÀè¤Ï¥È¥é¥Ã¥×¤Î´¶ÃÎÈϰϳ°¤Ç¤¹¡ª *");
4721 msg_print("*Leaving trap detect region!*");
4725 if (disturb_trap_detect)
4733 /* Range of newly adjacent grids */
4734 max = (prev_dir & 0x01) + 1;
4736 /* Look at every newly adjacent square. */
4737 for (i = -max; i <= max; i++)
4740 int dir = cycle[chome[prev_dir] + i];
4743 int row = py + ddy[dir];
4744 int col = px + ddx[dir];
4747 c_ptr = &cave[row][col];
4749 /* Visible monsters abort running */
4752 monster_type *m_ptr = &m_list[c_ptr->m_idx];
4754 /* Visible monster */
4755 if (m_ptr->ml) return (0);
4760 /* Travel cost of current grid */
4761 cost = travel.cost[py][px];
4763 /* Determine travel direction */
4764 for (i = 0; i < 8; ++ i) {
4765 int dir_cost = travel.cost[py+ddy_ddd[i]][px+ddx_ddd[i]];
4767 if (dir_cost < cost)
4774 if (!new_dir) return (0);
4776 /* Access newly move grid */
4777 c_ptr = &cave[py+ddy[new_dir]][px+ddx[new_dir]];
4779 /* Close door abort traveling */
4780 if (!easy_open && is_closed_door(c_ptr->feat)) return (0);
4782 /* Visible and unignorable trap abort tarveling */
4783 if (!c_ptr->mimic && !trap_can_be_ignored(c_ptr->feat)) return (0);
4791 * @brief ¥È¥é¥Ù¥ëµ¡Ç½¤Î¼ÂÁõ /
4795 void travel_step(void)
4797 /* Get travel direction */
4798 travel.dir = travel_test(travel.dir);
4803 if (travel.run == 255)
4806 msg_print("Æ»¶Ú¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡ª");
4808 msg_print("No route is found!");
4810 travel.y = travel.x = 0;
4818 move_player(travel.dir, always_pickup, FALSE);
4820 if ((py == travel.y) && (px == travel.x))
4823 travel.y = travel.x = 0;
4825 else if (travel.run > 0)
4829 Term_xtra(TERM_XTRA_DELAY, delay_factor);