3 /* Purpose: Movement commands (part 1) */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
14 #define MAX_VAMPIRIC_DRAIN 50
18 * Determine if the player "hits" a monster (normal combat).
19 * Note -- Always miss 5%, always hit 5%, otherwise random.
21 bool test_hit_fire(int chance, int ac, int vis)
28 /* Hack -- Instant miss or hit */
29 if (k < 10) return (k < 5);
31 if (p_ptr->pseikaku == SEIKAKU_NAMAKE)
32 if (one_in_(20)) return (FALSE);
35 if (chance <= 0) return (FALSE);
37 /* Invisible monsters are harder to hit */
38 if (!vis) chance = (chance + 1) / 2;
40 /* Power competes against armor */
41 if (randint0(chance) < (ac * 3 / 4)) return (FALSE);
50 * Determine if the player "hits" a monster (normal combat).
52 * Note -- Always miss 5%, always hit 5%, otherwise random.
54 bool test_hit_norm(int chance, int ac, int vis)
61 /* Hack -- Instant miss or hit */
62 if (k < 10) return (k < 5);
64 if (p_ptr->pseikaku == SEIKAKU_NAMAKE)
65 if (one_in_(20)) return (FALSE);
67 /* Wimpy attack never hits */
68 if (chance <= 0) return (FALSE);
70 /* Penalize invisible targets */
71 if (!vis) chance = (chance + 1) / 2;
73 /* Power must defeat armor */
74 if (randint0(chance) < (ac * 3 / 4)) return (FALSE);
83 * Critical hits (from objects thrown by player)
84 * Factor in item weight, total plusses, and player level.
86 s16b critical_shot(int weight, int plus, int dam)
90 /* Extract "shot" power */
91 i = (weight + ((p_ptr->to_h_b + plus) * 4) + (p_ptr->lev * 2));
94 if (randint1(5000) <= i)
96 k = weight + randint1(500);
101 msg_print("¼ê¤´¤¿¤¨¤¬¤¢¤Ã¤¿¡ª");
103 msg_print("It was a good hit!");
111 msg_print("¤«¤Ê¤ê¤Î¼ê¤´¤¿¤¨¤¬¤¢¤Ã¤¿¡ª");
113 msg_print("It was a great hit!");
121 msg_print("²ñ¿´¤Î°ì·â¤À¡ª");
123 msg_print("It was a superb hit!");
136 * Critical hits (by player)
138 * Factor in weapon weight, total plusses, player level.
140 s16b critical_norm(int weight, int plus, int dam, s16b meichuu, int mode)
144 /* Extract "blow" power */
145 i = (weight + (meichuu * 3 + plus * 5) + (p_ptr->lev * 3));
148 if ((randint1((p_ptr->pclass == CLASS_NINJA) ? 4444 : 5000) <= i) || (mode == HISSATSU_MAJIN) || (mode == HISSATSU_3DAN))
150 k = weight + randint1(650);
151 if ((mode == HISSATSU_MAJIN) || (mode == HISSATSU_3DAN)) k+= randint1(650);
156 msg_print("¼ê¤´¤¿¤¨¤¬¤¢¤Ã¤¿¡ª");
158 msg_print("It was a good hit!");
166 msg_print("¤«¤Ê¤ê¤Î¼ê¤´¤¿¤¨¤¬¤¢¤Ã¤¿¡ª");
168 msg_print("It was a great hit!");
176 msg_print("²ñ¿´¤Î°ì·â¤À¡ª");
178 msg_print("It was a superb hit!");
186 msg_print("ºÇ¹â¤Î²ñ¿´¤Î°ì·â¤À¡ª");
188 msg_print("It was a *GREAT* hit!");
196 msg_print("ÈæÎà¤Ê¤ºÇ¹â¤Î²ñ¿´¤Î°ì·â¤À¡ª");
198 msg_print("It was a *SUPERB* hit!");
201 dam = ((7 * dam) / 2) + 25;
211 * Extract the "total damage" from a given object hitting a given monster.
213 * Note that "flasks of oil" do NOT do fire damage, although they
214 * certainly could be made to do so. XXX XXX
216 * Note that most brands and slays are x3, except Slay Animal (x2),
217 * Slay Evil (x2), and Kill dragon (x5).
219 s16b tot_dam_aux(object_type *o_ptr, int tdam, monster_type *m_ptr, int mode)
223 monster_race *r_ptr = &r_info[m_ptr->r_idx];
227 /* Extract the flags */
228 object_flags(o_ptr, &f1, &f2, &f3);
230 /* Some "weapons" and "ammo" do extra damage */
242 if ((f1 & TR1_SLAY_ANIMAL) &&
243 (r_ptr->flags3 & RF3_ANIMAL))
247 r_ptr->r_flags3 |= RF3_ANIMAL;
250 if (mult < 25) mult = 25;
254 if ((f1 & TR1_SLAY_EVIL) &&
255 (r_ptr->flags3 & RF3_EVIL))
259 r_ptr->r_flags3 |= RF3_EVIL;
262 if (mult < 20) mult = 20;
266 if ((f3 & TR3_SLAY_HUMAN) &&
267 (r_ptr->flags2 & RF2_HUMAN))
271 r_ptr->r_flags2 |= RF2_HUMAN;
274 if (mult < 25) mult = 25;
278 if ((f1 & TR1_SLAY_UNDEAD) &&
279 (r_ptr->flags3 & RF3_UNDEAD))
283 r_ptr->r_flags3 |= RF3_UNDEAD;
286 if (mult < 30) mult = 30;
290 if ((f1 & TR1_SLAY_DEMON) &&
291 (r_ptr->flags3 & RF3_DEMON))
295 r_ptr->r_flags3 |= RF3_DEMON;
298 if (mult < 30) mult = 30;
302 if ((f1 & TR1_SLAY_ORC) &&
303 (r_ptr->flags3 & RF3_ORC))
307 r_ptr->r_flags3 |= RF3_ORC;
310 if (mult < 30) mult = 30;
314 if ((f1 & TR1_SLAY_TROLL) &&
315 (r_ptr->flags3 & RF3_TROLL))
319 r_ptr->r_flags3 |= RF3_TROLL;
322 if (mult < 30) mult = 30;
326 if ((f1 & TR1_SLAY_GIANT) &&
327 (r_ptr->flags3 & RF3_GIANT))
331 r_ptr->r_flags3 |= RF3_GIANT;
334 if (mult < 30) mult = 30;
335 if (o_ptr->name1 == ART_HRUNTING)
340 if ((f1 & TR1_SLAY_DRAGON) &&
341 (r_ptr->flags3 & RF3_DRAGON))
345 r_ptr->r_flags3 |= RF3_DRAGON;
348 if (mult < 30) mult = 30;
352 if ((f1 & TR1_KILL_DRAGON) &&
353 (r_ptr->flags3 & RF3_DRAGON))
357 r_ptr->r_flags3 |= RF3_DRAGON;
360 if (mult < 50) mult = 50;
362 if ((o_ptr->name1 == ART_NOTHUNG) && (m_ptr->r_idx == MON_FAFNER))
367 if ((f1 & TR1_BRAND_ACID) || (p_ptr->special_attack & (ATTACK_ACID)))
369 /* Notice immunity */
370 if (r_ptr->flags3 & RF3_IM_ACID)
374 r_ptr->r_flags3 |= RF3_IM_ACID;
378 /* Otherwise, take the damage */
381 if (mult < 25) mult = 25;
386 if ((f1 & TR1_BRAND_ELEC) || (p_ptr->special_attack & (ATTACK_ELEC)) || (mode == HISSATSU_ELEC))
388 /* Notice immunity */
389 if (r_ptr->flags3 & RF3_IM_ELEC)
393 r_ptr->r_flags3 |= RF3_IM_ELEC;
397 /* Otherwise, take the damage */
398 else if (((f1 & TR1_BRAND_ELEC) || (p_ptr->special_attack & (ATTACK_ELEC))) && (mode == HISSATSU_ELEC))
400 if (mult < 70) mult = 70;
402 else if (mode == HISSATSU_ELEC)
404 if (mult < 50) mult = 50;
409 if (mult < 25) mult = 25;
414 if ((f1 & TR1_BRAND_FIRE) || (p_ptr->special_attack & (ATTACK_FIRE)) || (mode == HISSATSU_FIRE))
416 /* Notice immunity */
417 if (r_ptr->flags3 & RF3_IM_FIRE)
421 r_ptr->r_flags3 |= RF3_IM_FIRE;
425 /* Otherwise, take the damage */
426 else if (((f1 & TR1_BRAND_FIRE) || (p_ptr->special_attack & (ATTACK_FIRE))) && (mode == HISSATSU_FIRE))
428 if (r_ptr->flags3 & RF3_HURT_FIRE)
430 if (mult < 70) mult = 70;
433 r_ptr->r_flags3 |= RF3_HURT_FIRE;
436 else if (mult < 35) mult = 35;
440 if (r_ptr->flags3 & RF3_HURT_FIRE)
442 if (mult < 50) mult = 50;
445 r_ptr->r_flags3 |= RF3_HURT_FIRE;
448 else if (mult < 25) mult = 25;
453 if ((f1 & TR1_BRAND_COLD) || (p_ptr->special_attack & (ATTACK_COLD)) || (mode == HISSATSU_COLD))
455 /* Notice immunity */
456 if (r_ptr->flags3 & RF3_IM_COLD)
460 r_ptr->r_flags3 |= RF3_IM_COLD;
463 /* Otherwise, take the damage */
464 else if (((f1 & TR1_BRAND_COLD) || (p_ptr->special_attack & (ATTACK_COLD))) && (mode == HISSATSU_COLD))
466 if (r_ptr->flags3 & RF3_HURT_COLD)
468 if (mult < 70) mult = 70;
471 r_ptr->r_flags3 |= RF3_HURT_COLD;
474 else if (mult < 35) mult = 35;
478 if (r_ptr->flags3 & RF3_HURT_COLD)
480 if (mult < 50) mult = 50;
483 r_ptr->r_flags3 |= RF3_HURT_COLD;
486 else if (mult < 25) mult = 25;
491 if ((f1 & TR1_BRAND_POIS) || (p_ptr->special_attack & (ATTACK_POIS)) || (mode == HISSATSU_POISON))
493 /* Notice immunity */
494 if (r_ptr->flags3 & RF3_IM_POIS)
498 r_ptr->r_flags3 |= RF3_IM_POIS;
502 /* Otherwise, take the damage */
503 else if (((f1 & TR1_BRAND_POIS) || (p_ptr->special_attack & (ATTACK_POIS))) && (mode == HISSATSU_POISON))
505 if (mult < 35) mult = 35;
509 if (mult < 25) mult = 25;
512 if ((mode == HISSATSU_ZANMA) && (r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) && (r_ptr->flags3 & RF3_EVIL))
514 if (mult < 15) mult = 25;
515 else if (mult < 50) mult = MIN(50, mult+20);
517 if (mode == HISSATSU_UNDEAD)
519 if (r_ptr->flags3 & RF3_UNDEAD)
523 r_ptr->r_flags3 |= RF3_UNDEAD;
525 if (mult == 10) mult = 70;
526 else if (mult < 140) mult = MIN(140, mult+60);
528 if (mult == 10) mult = 40;
529 else if (mult < 60) mult = MIN(60, mult+30);
531 if ((mode == HISSATSU_SEKIRYUKA) && p_ptr->cut && !(r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)))
533 int tmp = MIN(100, MAX(10, p_ptr->cut / 10));
534 if (mult < tmp) mult = tmp;
536 if ((mode == HISSATSU_HAGAN) && (r_ptr->flags3 & RF3_HURT_ROCK))
540 r_ptr->r_flags3 |= RF3_HURT_ROCK;
542 if (mult == 10) mult = 40;
543 else if (mult < 60) mult = 60;
545 if ((p_ptr->pclass != CLASS_SAMURAI) && (f1 & TR1_FORCE_WEAPON) && (p_ptr->csp > (o_ptr->dd * o_ptr->ds / 5)))
547 p_ptr->csp -= (1+(o_ptr->dd * o_ptr->ds / 5));
548 p_ptr->redraw |= (PR_MANA);
549 mult = MIN(60, mult * 7 / 2);
554 if (mult > 150) mult = 150;
556 /* Return the total damage */
557 return (tdam * mult / 10);
562 * Search for hidden things
568 s16b this_o_idx, next_o_idx = 0;
573 /* Start with base search ability */
574 chance = p_ptr->skill_srh;
576 /* Penalize various conditions */
577 if (p_ptr->blind || no_lite()) chance = chance / 10;
578 if (p_ptr->confused || p_ptr->image) chance = chance / 10;
580 /* Search the nearby grids, which are always in bounds */
581 for (y = (py - 1); y <= (py + 1); y++)
583 for (x = (px - 1); x <= (px + 1); x++)
585 /* Sometimes, notice things */
586 if (randint0(100) < chance)
588 /* Access the grid */
592 if (c_ptr->info & CAVE_TRAP)
599 msg_print("¥È¥é¥Ã¥×¤òȯ¸«¤·¤¿¡£");
601 msg_print("You have found a trap.");
610 if (c_ptr->feat == FEAT_SECRET)
614 msg_print("±£¤·¥É¥¢¤òȯ¸«¤·¤¿¡£");
616 msg_print("You have found a secret door.");
621 place_closed_door(y, x);
627 /* Scan all objects in the grid */
628 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
633 o_ptr = &o_list[this_o_idx];
635 /* Acquire next object */
636 next_o_idx = o_ptr->next_o_idx;
638 /* Skip non-chests */
639 if (o_ptr->tval != TV_CHEST) continue;
641 /* Skip non-trapped chests */
642 if (!chest_traps[o_ptr->pval]) continue;
645 if (!object_known_p(o_ptr))
649 msg_print("È¢¤Ë»Å³Ý¤±¤é¤ì¤¿¥È¥é¥Ã¥×¤òȯ¸«¤·¤¿¡ª");
651 msg_print("You have discovered a trap on the chest!");
669 * Helper routine for py_pickup() and py_pickup_floor().
671 * Add the given dungeon object to the character's inventory.
673 * Delete the object afterwards.
675 void py_pickup_aux(int o_idx)
681 * ¥¢¥¤¥Æ¥à¤ò½¦¤Ã¤¿ºÝ¤Ë¡Ö£²¤Ä¤Î¥±¡¼¥¤ò»ý¤Ã¤Æ¤¤¤ë¡×
682 * "You have two cakes." ¤È¥¢¥¤¥Æ¥à¤ò½¦¤Ã¤¿¸å¤Î¹ç·×¤Î¤ß¤Îɽ¼¨¤¬¥ª¥ê¥¸¥Ê¥ë
684 * ¤¢¤ë¤È¤¤¤¦»ØŦ¤ò¤¦¤±¤¿¤Î¤Ç¡¢¡Ö¡Á¤ò½¦¤Ã¤¿¡¢¡Á¤ò»ý¤Ã¤Æ¤¤¤ë¡×¤È¤¤¤¦É½¼¨
685 * ¤Ë¤«¤¨¤Æ¤¢¤ë¡£¤½¤Î¤¿¤á¤ÎÇÛÎó¡£
687 char o_name[MAX_NLEN];
688 char old_name[MAX_NLEN];
691 extern char *object_desc_kosuu(char *t, object_type *o_ptr);
693 char o_name[MAX_NLEN];
698 o_ptr = &o_list[o_idx];
701 /* Describe the object */
702 object_desc(old_name, o_ptr, TRUE, 0);
703 object_desc_kosuu(kazu_str, o_ptr);
704 hirottakazu = o_ptr->number;
706 /* Carry the object */
707 slot = inven_carry(o_ptr);
709 /* Get the object again */
710 o_ptr = &inventory[slot];
712 /* Delete the object */
713 delete_object_idx(o_idx);
715 if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN) identify_item(o_ptr);
717 /* Describe the object */
718 object_desc(o_name, o_ptr, TRUE, 3);
722 if ((o_ptr->name1 == ART_CRIMSON) && (p_ptr->pseikaku == SEIKAKU_COMBAT))
724 msg_format("¤³¤¦¤·¤Æ¡¢%s¤Ï¡Ø¥¯¥ê¥à¥¾¥ó¡Ù¤ò¼ê¤ËÆþ¤ì¤¿¡£", player_name);
725 msg_print("¤·¤«¤·º£¡¢¡Øº®Æ٤Υµ¡¼¥Ú¥ó¥È¡Ù¤ÎÊü¤Ã¤¿¥â¥ó¥¹¥¿¡¼¤¬¡¢");
726 msg_format("%s¤Ë½±¤¤¤«¤«¤ë¡¥¡¥¡¥", player_name);
732 msg_format("%s(%c)¤ò»ý¤Ã¤Æ¤¤¤ë¡£",o_name, index_to_label(slot));
736 if (o_ptr->number > hirottakazu) {
737 msg_format("%s½¦¤Ã¤Æ¡¢%s(%c)¤ò»ý¤Ã¤Æ¤¤¤ë¡£",
738 kazu_str, o_name, index_to_label(slot));
740 msg_format("%s(%c)¤ò½¦¤Ã¤¿¡£", o_name, index_to_label(slot));
744 strcpy(record_o_name, old_name);
746 msg_format("You have %s (%c).", o_name, index_to_label(slot));
747 strcpy(record_o_name, o_name);
752 /* Check if completed a quest */
753 for (i = 0; i < max_quests; i++)
755 if ((quest[i].type == QUEST_TYPE_FIND_ARTIFACT) &&
756 (quest[i].status == QUEST_STATUS_TAKEN) &&
757 (quest[i].k_idx == o_ptr->name1))
759 if (record_fix_quest) do_cmd_write_nikki(NIKKI_FIX_QUEST_C, i, NULL);
760 quest[i].status = QUEST_STATUS_COMPLETED;
761 quest[i].complev = (byte)p_ptr->lev;
763 msg_print("¥¯¥¨¥¹¥È¤òãÀ®¤·¤¿¡ª");
765 msg_print("You completed your quest!");
774 bool can_player_destroy_object(object_type *o_ptr)
776 /* Artifacts cannot be destroyed */
777 if (artifact_p(o_ptr) || o_ptr->art_name)
779 byte feel = FEEL_SPECIAL;
781 /* Hack -- Handle icky artifacts */
782 if (cursed_p(o_ptr) || broken_p(o_ptr)) feel = FEEL_TERRIBLE;
784 /* Hack -- inscribe the artifact */
785 o_ptr->feeling = feel;
787 /* We have "felt" it (again) */
788 o_ptr->ident |= (IDENT_SENSE);
790 /* Combine the pack */
791 p_ptr->notice |= (PN_COMBINE);
793 /* Redraw equippy chars */
794 p_ptr->redraw |= (PR_EQUIPPY);
797 p_ptr->window |= (PW_INVEN | PW_EQUIP);
808 * Player "wants" to pick up an object or gold.
809 * Note that we ONLY handle things that can be picked up.
810 * See "move_player()" for handling of other things.
812 void carry(int pickup)
814 cave_type *c_ptr = &cave[py][px];
816 s16b this_o_idx, next_o_idx = 0;
818 char o_name[MAX_NLEN];
820 /* Recenter the map around the player */
824 p_ptr->update |= (PU_MONSTERS);
827 p_ptr->redraw |= (PR_MAP);
830 p_ptr->window |= (PW_OVERHEAD);
835 /* Automatically pickup/destroy/inscribe items */
836 auto_pickup_items(c_ptr);
839 #ifdef ALLOW_EASY_FLOOR
843 py_pickup_floor(pickup);
847 #endif /* ALLOW_EASY_FLOOR */
849 /* Scan the pile of objects */
850 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
855 o_ptr = &o_list[this_o_idx];
857 #ifdef ALLOW_EASY_SENSE /* TNB */
859 /* Option: Make item sensing easy */
862 /* Sense the object */
863 (void)sense_object(o_ptr);
866 #endif /* ALLOW_EASY_SENSE -- TNB */
868 /* Describe the object */
869 object_desc(o_name, o_ptr, TRUE, 3);
871 /* Acquire next object */
872 next_o_idx = o_ptr->next_o_idx;
874 /* Hack -- disturb */
878 if (o_ptr->tval == TV_GOLD)
880 int value = (long)o_ptr->pval;
882 /* Delete the gold */
883 delete_object_idx(this_o_idx);
887 msg_format(" $%ld ¤Î²ÁÃͤ¬¤¢¤ë%s¤ò¸«¤Ä¤±¤¿¡£",
888 (long)value, o_name);
890 msg_format("You collect %ld gold pieces worth of %s.",
891 (long)value, o_name);
897 /* Collect the gold */
901 p_ptr->redraw |= (PR_GOLD);
904 p_ptr->window |= (PW_PLAYER);
907 /* Pick up objects */
910 /* Describe the object */
915 msg_format("%s¤¬¤¢¤ë¡£", o_name);
917 msg_format("You see %s.", o_name);
922 /* Note that the pack is too full */
923 else if (!inven_carry_okay(o_ptr))
926 msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name);
928 msg_format("You have no room for %s.", o_name);
933 /* Pick up the item (if requested and allowed) */
938 /* Hack -- query every item */
939 if (carry_query_flag)
941 char out_val[MAX_NLEN+20];
943 sprintf(out_val, "%s¤ò½¦¤¤¤Þ¤¹¤«? ", o_name);
945 sprintf(out_val, "Pick up %s? ", o_name);
948 okay = get_check(out_val);
951 /* Attempt to pick up an object. */
954 /* Pick up the object */
955 py_pickup_aux(this_o_idx);
964 * Determine if a trap affects the player.
965 * Always miss 5% of the time, Always hit 5% of the time.
966 * Otherwise, match trap power against player armor.
968 static int check_hit(int power)
972 /* Percentile dice */
975 /* Hack -- 5% hit, 5% miss */
976 if (k < 10) return (k < 5);
978 if (p_ptr->pseikaku == SEIKAKU_NAMAKE)
979 if (one_in_(20)) return (TRUE);
981 /* Paranoia -- No power */
982 if (power <= 0) return (FALSE);
985 ac = p_ptr->ac + p_ptr->to_a;
987 /* Power competes against Armor */
988 if (randint1(power) > ((ac * 3) / 4)) return (TRUE);
997 * Handle player hitting a real trap
999 static void hit_trap(bool break_trap)
1007 cptr name = "¥È¥é¥Ã¥×";
1009 cptr name = "a trap";
1014 /* Disturb the player */
1017 /* Get the cave grid */
1018 c_ptr = &cave[y][x];
1020 /* Analyze XXX XXX XXX */
1021 switch (c_ptr->feat)
1023 case FEAT_TRAP_TRAPDOOR:
1028 msg_print("Í¸Í¤òÈô¤Ó±Û¤¨¤¿¡£");
1030 msg_print("You fly over a trap door.");
1037 msg_print("Í¸Í¤ËÍî¤Á¤¿¡ª");
1038 if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
1039 msg_print("¤¯¤Ã¤½¡Á¡ª");
1041 msg_print("You have fallen through a trap door!");
1045 dam = damroll(2, 8);
1049 name = "a trap door";
1052 take_hit(DAMAGE_NOESCAPE, dam, name, -1);
1054 /* Still alive and autosave enabled */
1055 if (autosave_l && (p_ptr->chp >= 0))
1056 do_cmd_save_game(TRUE);
1059 do_cmd_write_nikki(NIKKI_STAIR, 1, "Í¸Í¤ËÍî¤Á¤¿");
1061 do_cmd_write_nikki(NIKKI_STAIR, 1, "You have fallen through a trap door!");
1066 p_ptr->leaving = TRUE;
1076 msg_print("Í·ê¤òÈô¤Ó±Û¤¨¤¿¡£");
1078 msg_print("You fly over a pit trap.");
1085 msg_print("Í·ê¤ËÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª");
1087 msg_print("You have fallen into a pit!");
1090 dam = damroll(2, 6);
1094 name = "a pit trap";
1097 take_hit(DAMAGE_NOESCAPE, dam, name, -1);
1102 case FEAT_TRAP_SPIKED_PIT:
1107 msg_print("¥È¥²¤Î¤¢¤ëÍ·ê¤òÈô¤Ó±Û¤¨¤¿¡£");
1109 msg_print("You fly over a spiked pit.");
1116 msg_print("¥¹¥Ñ¥¤¥¯¤¬Éߤ«¤ì¤¿Í·ê¤ËÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª");
1118 msg_print("You fall into a spiked pit!");
1126 name = "a pit trap";
1129 dam = damroll(2, 6);
1131 /* Extra spike damage */
1132 if (randint0(100) < 50)
1135 msg_print("¥¹¥Ñ¥¤¥¯¤¬»É¤µ¤Ã¤¿¡ª");
1137 msg_print("You are impaled!");
1142 name = "¥È¥²¤Î¤¢¤ëÍ·ê";
1144 name = "a spiked pit";
1148 (void)set_cut(p_ptr->cut + randint1(dam));
1151 /* Take the damage */
1152 take_hit(DAMAGE_NOESCAPE, dam, name, -1);
1157 case FEAT_TRAP_POISON_PIT:
1162 msg_print("¥È¥²¤Î¤¢¤ëÍ·ê¤òÈô¤Ó±Û¤¨¤¿¡£");
1164 msg_print("You fly over a spiked pit.");
1171 msg_print("¥¹¥Ñ¥¤¥¯¤¬Éߤ«¤ì¤¿Í·ê¤ËÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª");
1173 msg_print("You fall into a spiked pit!");
1178 dam = damroll(2, 6);
1183 name = "a pit trap";
1187 /* Extra spike damage */
1188 if (randint0(100) < 50)
1191 msg_print("ÆǤòÅɤé¤ì¤¿¥¹¥Ñ¥¤¥¯¤¬»É¤µ¤Ã¤¿¡ª");
1193 msg_print("You are impaled on poisonous spikes!");
1198 name = "¥È¥²¤Î¤¢¤ëÍ·ê";
1200 name = "a spiked pit";
1205 (void)set_cut(p_ptr->cut + randint1(dam));
1207 if (p_ptr->resist_pois || p_ptr->oppose_pois)
1210 msg_print("¤·¤«¤·ÆǤαƶÁ¤Ï¤Ê¤«¤Ã¤¿¡ª");
1212 msg_print("The poison does not affect you!");
1220 (void)set_poisoned(p_ptr->poisoned + randint1(dam));
1224 /* Take the damage */
1225 take_hit(DAMAGE_NOESCAPE, dam, name, -1);
1231 case FEAT_TRAP_TY_CURSE:
1234 msg_print("²¿¤«¤¬¥Ô¥«¥Ã¤È¸÷¤Ã¤¿¡ª");
1236 msg_print("There is a flash of shimmering light!");
1239 c_ptr->info &= ~(CAVE_MARK);
1240 cave_set_feat(y, x, floor_type[randint0(100)]);
1241 num = 2 + randint1(3);
1242 for (i = 0; i < num; i++)
1244 (void)summon_specific(0, y, x, dun_level, 0, TRUE, FALSE, FALSE, TRUE, TRUE);
1247 if (dun_level > randint1(100)) /* No nasty effect for low levels */
1249 bool stop_ty = FALSE;
1254 stop_ty = activate_ty_curse(stop_ty, &count);
1261 case FEAT_TRAP_TELEPORT:
1264 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥È¥é¥Ã¥×¤Ë¤Ò¤Ã¤«¤«¤Ã¤¿¡ª");
1266 msg_print("You hit a teleport trap!");
1269 teleport_player(100);
1273 case FEAT_TRAP_FIRE:
1276 msg_print("±ê¤ËÊñ¤Þ¤ì¤¿¡ª");
1278 msg_print("You are enveloped in flames!");
1281 dam = damroll(4, 6);
1283 fire_dam(dam, "±ê¤Î¥È¥é¥Ã¥×", -1);
1285 fire_dam(dam, "a fire trap", -1);
1291 case FEAT_TRAP_ACID:
1294 msg_print("»À¤¬¿á¤¤«¤±¤é¤ì¤¿¡ª");
1296 msg_print("You are splashed with acid!");
1299 dam = damroll(4, 6);
1301 acid_dam(dam, "»À¤Î¥È¥é¥Ã¥×", -1);
1303 acid_dam(dam, "an acid trap", -1);
1309 case FEAT_TRAP_SLOW:
1314 msg_print("¾®¤µ¤Ê¥À¡¼¥Ä¤¬Èô¤ó¤Ç¤¤Æ»É¤µ¤Ã¤¿¡ª");
1316 msg_print("A small dart hits you!");
1319 dam = damroll(1, 4);
1320 take_hit(DAMAGE_ATTACK, dam, name, -1);
1321 (void)set_slow(p_ptr->slow + randint0(20) + 20, FALSE);
1326 msg_print("¾®¤µ¤Ê¥À¡¼¥Ä¤¬Èô¤ó¤Ç¤¤¿¡ª¤¬¡¢±¿Îɤ¯Åö¤¿¤é¤Ê¤«¤Ã¤¿¡£");
1328 msg_print("A small dart barely misses you.");
1335 case FEAT_TRAP_LOSE_STR:
1340 msg_print("¾®¤µ¤Ê¥À¡¼¥Ä¤¬Èô¤ó¤Ç¤¤Æ»É¤µ¤Ã¤¿¡ª");
1342 msg_print("A small dart hits you!");
1345 dam = damroll(1, 4);
1347 take_hit(DAMAGE_ATTACK, dam, "¥À¡¼¥Ä¤Îæ«", -1);
1349 take_hit(DAMAGE_ATTACK, dam, "a dart trap", -1);
1352 (void)do_dec_stat(A_STR);
1357 msg_print("¾®¤µ¤Ê¥À¡¼¥Ä¤¬Èô¤ó¤Ç¤¤¿¡ª¤¬¡¢±¿Îɤ¯Åö¤¿¤é¤Ê¤«¤Ã¤¿¡£");
1359 msg_print("A small dart barely misses you.");
1366 case FEAT_TRAP_LOSE_DEX:
1371 msg_print("¾®¤µ¤Ê¥À¡¼¥Ä¤¬Èô¤ó¤Ç¤¤Æ»É¤µ¤Ã¤¿¡ª");
1373 msg_print("A small dart hits you!");
1376 dam = damroll(1, 4);
1378 take_hit(DAMAGE_ATTACK, dam, "¥À¡¼¥Ä¤Îæ«", -1);
1380 take_hit(DAMAGE_ATTACK, dam, "a dart trap", -1);
1383 (void)do_dec_stat(A_DEX);
1388 msg_print("¾®¤µ¤Ê¥À¡¼¥Ä¤¬Èô¤ó¤Ç¤¤¿¡ª¤¬¡¢±¿Îɤ¯Åö¤¿¤é¤Ê¤«¤Ã¤¿¡£");
1390 msg_print("A small dart barely misses you.");
1397 case FEAT_TRAP_LOSE_CON:
1402 msg_print("¾®¤µ¤Ê¥À¡¼¥Ä¤¬Èô¤ó¤Ç¤¤Æ»É¤µ¤Ã¤¿¡ª");
1404 msg_print("A small dart hits you!");
1407 dam = damroll(1, 4);
1409 take_hit(DAMAGE_ATTACK, dam, "¥À¡¼¥Ä¤Îæ«", -1);
1411 take_hit(DAMAGE_ATTACK, dam, "a dart trap", -1);
1414 (void)do_dec_stat(A_CON);
1419 msg_print("¾®¤µ¤Ê¥À¡¼¥Ä¤¬Èô¤ó¤Ç¤¤¿¡ª¤¬¡¢±¿Îɤ¯Åö¤¿¤é¤Ê¤«¤Ã¤¿¡£");
1421 msg_print("A small dart barely misses you.");
1428 case FEAT_TRAP_BLIND:
1431 msg_print("¹õ¤¤¥¬¥¹¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡ª");
1433 msg_print("A black gas surrounds you!");
1436 if (!p_ptr->resist_blind)
1438 (void)set_blind(p_ptr->blind + randint0(50) + 25);
1443 case FEAT_TRAP_CONFUSE:
1446 msg_print("¤¤é¤á¤¯¥¬¥¹¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡ª");
1448 msg_print("A gas of scintillating colors surrounds you!");
1451 if (!p_ptr->resist_conf)
1453 (void)set_confused(p_ptr->confused + randint0(20) + 10);
1458 case FEAT_TRAP_POISON:
1461 msg_print("»É·ãŪ¤ÊÎп§¤Î¥¬¥¹¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡ª");
1463 msg_print("A pungent green gas surrounds you!");
1466 if (!p_ptr->resist_pois && !p_ptr->oppose_pois)
1468 (void)set_poisoned(p_ptr->poisoned + randint0(20) + 10);
1473 case FEAT_TRAP_SLEEP:
1476 msg_print("´ñ̯¤ÊÇò¤¤Ì¸¤ËÊñ¤Þ¤ì¤¿¡ª");
1478 msg_print("A strange white mist surrounds you!");
1481 if (!p_ptr->free_act)
1484 msg_print("¤¢¤Ê¤¿¤Ï̲¤ê¤Ë½¢¤¤¤¿¡£");
1486 msg_print("You fall asleep.");
1490 if (ironman_nightmare)
1493 msg_print("¿È¤ÎÌÓ¤â¤è¤À¤Ä¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤À¡£");
1495 msg_print("A horrible vision enters your mind.");
1499 /* Pick a nightmare */
1500 get_mon_num_prep(get_nightmare, NULL);
1502 /* Have some nightmares */
1503 have_nightmare(get_mon_num(MAX_DEPTH));
1505 /* Remove the monster restriction */
1506 get_mon_num_prep(NULL, NULL);
1508 (void)set_paralyzed(p_ptr->paralyzed + randint0(10) + 5);
1513 case FEAT_TRAP_TRAPS:
1516 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
1518 msg_print("There is a bright flash of light!");
1522 /* Destroy this trap */
1523 cave_set_feat(y, x, floor_type[randint0(100)]);
1525 /* Make some new traps */
1526 project(0, 1, y, x, 0, GF_MAKE_TRAP, PROJECT_HIDE | PROJECT_JUMP | PROJECT_GRID, -1);
1531 case FEAT_TRAP_ALARM:
1534 msg_print("¤±¤¿¤¿¤Þ¤·¤¤²»¤¬ÌĤê¶Á¤¤¤¿¡ª");
1536 msg_print("An alarm sounds!");
1539 aggravate_monsters(0);
1544 if (break_trap && is_trap(c_ptr->feat))
1546 cave_set_feat(y, x, floor_type[randint0(100)]);
1548 msg_print("¥È¥é¥Ã¥×¤òÊ´ºÕ¤·¤¿¡£");
1550 msg_print("You destroyed the trap.");
1556 void touch_zap_player(monster_type *m_ptr)
1558 int aura_damage = 0;
1559 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1561 if (r_ptr->flags2 & RF2_AURA_FIRE)
1563 if (!p_ptr->immune_fire)
1567 aura_damage = damroll(1 + (r_ptr->level / 26), 1 + (r_ptr->level / 17));
1569 /* Hack -- Get the "died from" name */
1570 monster_desc(aura_dam, m_ptr, 0x288);
1573 msg_print("ÆÍÁ³¤È¤Æ¤âÇ®¤¯¤Ê¤Ã¤¿¡ª");
1575 msg_print("You are suddenly very hot!");
1579 if (p_ptr->oppose_fire) aura_damage = (aura_damage + 2) / 3;
1580 if (p_ptr->resist_fire) aura_damage = (aura_damage + 2) / 3;
1582 take_hit(DAMAGE_NOESCAPE, aura_damage, aura_dam, -1);
1583 r_ptr->r_flags2 |= RF2_AURA_FIRE;
1588 if (r_ptr->flags3 & RF3_AURA_COLD)
1590 if (!p_ptr->immune_cold)
1594 aura_damage = damroll(1 + (r_ptr->level / 26), 1 + (r_ptr->level / 17));
1596 /* Hack -- Get the "died from" name */
1597 monster_desc(aura_dam, m_ptr, 0x288);
1600 msg_print("ÆÍÁ³¤È¤Æ¤â´¨¤¯¤Ê¤Ã¤¿¡ª");
1602 msg_print("You are suddenly very cold!");
1606 if (p_ptr->oppose_cold) aura_damage = (aura_damage + 2) / 3;
1607 if (p_ptr->resist_cold) aura_damage = (aura_damage + 2) / 3;
1609 take_hit(DAMAGE_NOESCAPE, aura_damage, aura_dam, -1);
1610 r_ptr->r_flags3 |= RF3_AURA_COLD;
1615 if (r_ptr->flags2 & RF2_AURA_ELEC)
1617 if (!p_ptr->immune_elec)
1621 aura_damage = damroll(1 + (r_ptr->level / 26), 1 + (r_ptr->level / 17));
1623 /* Hack -- Get the "died from" name */
1624 monster_desc(aura_dam, m_ptr, 0x288);
1626 if (p_ptr->oppose_elec) aura_damage = (aura_damage + 2) / 3;
1627 if (p_ptr->resist_elec) aura_damage = (aura_damage + 2) / 3;
1630 msg_print("ÅÅ·â¤ò¤¯¤é¤Ã¤¿¡ª");
1632 msg_print("You get zapped!");
1635 take_hit(DAMAGE_NOESCAPE, aura_damage, aura_dam, -1);
1636 r_ptr->r_flags2 |= RF2_AURA_ELEC;
1643 static void natural_attack(s16b m_idx, int attack, bool *fear, bool *mdeath)
1645 int k, bonus, chance;
1647 monster_type *m_ptr = &m_list[m_idx];
1648 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1657 case MUT2_SCOR_TAIL:
1684 atk_desc = "¥¯¥Á¥Ð¥·";
1695 atk_desc = "¾Ý¤ÎÉ¡";
1701 case MUT2_TENTACLES:
1708 atk_desc = "tentacles";
1713 dss = ddd = n_weight = 1;
1715 atk_desc = "̤ÄêµÁ¤ÎÉô°Ì";
1717 atk_desc = "undefined body part";
1722 /* Extract monster name (or "it") */
1723 monster_desc(m_name, m_ptr, 0);
1726 /* Calculate the "attack quality" */
1727 bonus = p_ptr->to_h_m;
1728 bonus += (p_ptr->lev * 6 / 5);
1729 chance = (p_ptr->skill_thn + (bonus * BTH_PLUS_ADJ));
1732 if ((!(r_ptr->flags2 & RF2_QUANTUM) || !randint0(2)) && test_hit_norm(chance, r_ptr->ac, m_ptr->ml))
1738 msg_format("%s¤ò%s¤Ç¹¶·â¤·¤¿¡£", m_name, atk_desc);
1740 msg_format("You hit %s with your %s.", m_name, atk_desc);
1744 k = damroll(ddd, dss);
1745 k = critical_norm(n_weight, bonus, k, (s16b)bonus, 0);
1747 /* Apply the player damage bonuses */
1750 /* No negative damage */
1753 /* Modify the damage */
1754 k = mon_damage_mod(m_ptr, k, FALSE);
1756 /* Complex message */
1760 msg_format("%d/%d ¤Î¥À¥á¡¼¥¸¤òÍ¿¤¨¤¿¡£", k, m_ptr->hp);
1762 msg_format("You do %d (out of %d) damage.", k, m_ptr->hp);
1767 /* Anger the monster */
1768 if (k > 0) anger_monster(m_ptr);
1770 /* Damage, check for fear and mdeath */
1773 case MUT2_SCOR_TAIL:
1774 project(0, 0, m_ptr->fy, m_ptr->fx, k, GF_POIS, PROJECT_KILL | PROJECT_NO_REF, -1);
1775 *mdeath = (m_ptr->r_idx == 0);
1778 *mdeath = mon_take_hit(m_idx, k, fear, NULL);
1781 *mdeath = mon_take_hit(m_idx, k, fear, NULL);
1784 *mdeath = mon_take_hit(m_idx, k, fear, NULL);
1786 case MUT2_TENTACLES:
1787 *mdeath = mon_take_hit(m_idx, k, fear, NULL);
1790 *mdeath = mon_take_hit(m_idx, k, fear, NULL);
1793 touch_zap_player(m_ptr);
1803 msg_format("¥ß¥¹¡ª %s¤Ë¤«¤ï¤µ¤ì¤¿¡£", m_name);
1805 msg_format("You miss %s.", m_name);
1814 * Player attacks a (poor, defenseless) creature -RAK-
1816 * If no "weapon" is available, then "punch" the monster one time.
1818 static void py_attack_aux(int y, int x, bool *fear, bool *mdeath, s16b hand, int mode)
1820 int num = 0, k, bonus, chance, vir;
1822 cave_type *c_ptr = &cave[y][x];
1824 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1825 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1831 bool success_hit = FALSE;
1832 bool old_success_hit = FALSE;
1833 bool backstab = FALSE;
1834 bool vorpal_cut = FALSE;
1835 int chaos_effect = 0;
1836 bool stab_fleeing = FALSE;
1837 bool fuiuchi = FALSE;
1838 bool do_quake = FALSE;
1840 bool drain_msg = TRUE;
1841 int drain_result = 0, drain_heal = 0;
1842 bool can_drain = FALSE;
1844 int drain_left = MAX_VAMPIRIC_DRAIN;
1845 u32b f1, f2, f3; /* A massive hack -- life-draining weapons */
1846 bool is_human = (r_ptr->d_char == 'p');
1847 bool is_lowlevel = (r_ptr->level < (p_ptr->lev - 15));
1848 bool zantetsu_mukou, e_j_mukou;
1852 if (((p_ptr->pclass == CLASS_ROGUE) || (p_ptr->pclass == CLASS_NINJA)) && inventory[INVEN_RARM+hand].tval)
1854 int tmp = p_ptr->lev*6+(p_ptr->skill_stl+10)*4;
1855 if (p_ptr->monlite && (mode != HISSATSU_NYUSIN)) tmp /= 3;
1856 if (p_ptr->cursed & TRC_AGGRAVATE) tmp /= 2;
1857 if (r_ptr->level > (p_ptr->lev*p_ptr->lev/20+10)) tmp /= 3;
1858 if (m_ptr->csleep && m_ptr->ml)
1860 /* Can't backstab creatures that we can't see, right? */
1863 else if ((p_ptr->special_defense & NINJA_S_STEALTH) && (randint0(tmp) > (r_ptr->level+20)) && m_ptr->ml && !(r_ptr->flags3 & RF3_RES_ALL))
1867 else if (m_ptr->monfear && m_ptr->ml)
1869 stab_fleeing = TRUE;
1873 if(!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
1875 if ((r_ptr->level + 10) > p_ptr->lev)
1877 if (skill_exp[GINOU_SUDE] < s_info[p_ptr->pclass].s_max[GINOU_SUDE])
1879 if (skill_exp[GINOU_SUDE] < 4000)
1880 skill_exp[GINOU_SUDE]+=40;
1881 else if((skill_exp[GINOU_SUDE] < 6000))
1882 skill_exp[GINOU_SUDE]+=5;
1883 else if((skill_exp[GINOU_SUDE] < 7000) && (p_ptr->lev > 19))
1884 skill_exp[GINOU_SUDE]+=1;
1885 else if((skill_exp[GINOU_SUDE] < 8000) && (p_ptr->lev > 34))
1886 if (one_in_(3)) skill_exp[GINOU_SUDE]+=1;
1887 p_ptr->update |= (PU_BONUS);
1893 if ((r_ptr->level + 10) > p_ptr->lev)
1895 int tval = inventory[INVEN_RARM+hand].tval - TV_BOW;
1896 int sval = inventory[INVEN_RARM+hand].sval;
1897 int now_exp = weapon_exp[tval][sval];
1898 if (now_exp < s_info[p_ptr->pclass].w_max[tval][sval])
1901 if (now_exp < 4000) amount = 80;
1902 else if(now_exp < 6000) amount = 10;
1903 else if((now_exp < 7000) && (p_ptr->lev > 19)) amount = 1;
1904 else if((p_ptr->lev > 34) && one_in_(2)) amount = 1;
1905 weapon_exp[tval][sval] += amount;
1906 p_ptr->update |= (PU_BONUS);
1911 /* Disturb the monster */
1913 if (r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2))
1914 p_ptr->update |= (PU_MON_LITE);
1916 /* Extract monster name (or "it") */
1917 monster_desc(m_name, m_ptr, 0);
1919 /* Access the weapon */
1920 o_ptr = &inventory[INVEN_RARM+hand];
1922 /* Calculate the "attack quality" */
1923 bonus = p_ptr->to_h[hand] + o_ptr->to_h;
1924 chance = (p_ptr->skill_thn + (bonus * BTH_PLUS_ADJ));
1925 if (mode == HISSATSU_IAI) chance += 60;
1926 if (p_ptr->special_defense & KATA_KOUKIJIN) chance += 150;
1928 if (p_ptr->sutemi) chance = MAX(chance * 3 / 2, chance + 60);
1930 vir = virtue_number(V_VALOUR);
1933 chance += (p_ptr->virtues[vir - 1]/10);
1936 zantetsu_mukou = ((o_ptr->name1 == ART_ZANTETSU) && (r_ptr->d_char == 'j'));
1937 e_j_mukou = ((o_ptr->name1 == ART_EXCALIBUR_J) && (r_ptr->d_char == 'S'));
1939 if ((mode == HISSATSU_KYUSHO) || (mode == HISSATSU_MINEUCHI) || (mode == HISSATSU_3DAN) || (mode == HISSATSU_IAI)) num_blow = 1;
1940 else if (mode == HISSATSU_COLD) num_blow = p_ptr->num_blow[hand]+2;
1941 else num_blow = p_ptr->num_blow[hand];
1943 /* Attack once for each legal blow */
1944 while ((num++ < num_blow) && !death)
1946 if (((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI)) || (mode == HISSATSU_KYUSHO))
1948 if (p_ptr->migite && p_ptr->hidarite)
1950 success_hit = one_in_(2);
1952 else success_hit = TRUE;
1954 else if (mode == HISSATSU_MAJIN)
1959 success_hit = FALSE;
1960 old_success_hit = success_hit;
1962 else success_hit = old_success_hit;
1964 else if ((p_ptr->pclass == CLASS_NINJA) && ((backstab || fuiuchi) && !(r_ptr->flags3 & RF3_RES_ALL))) success_hit = TRUE;
1965 else success_hit = test_hit_norm(chance, r_ptr->ac, m_ptr->ml);
1970 int vorpal_chance = ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD)) ? 2 : 4;
1978 msg_format("¤¢¤Ê¤¿¤ÏÎä¹ó¤Ë¤â̲¤Ã¤Æ¤¤¤ë̵ÎϤÊ%s¤òÆͤ»É¤·¤¿¡ª",
1980 msg_format("You cruelly stab the helpless, sleeping %s!",
1986 msg_format("ÉÔ°Õ¤òÆͤ¤¤Æ%s¤Ë¶¯Îõ¤Ê°ì·â¤ò¶ô¤é¤ï¤»¤¿¡ª",
1988 msg_format("You make surprise attack, and hit %s with a powerful blow!",
1992 else if (stab_fleeing)
1994 msg_format("ƨ¤²¤ë%s¤òÇØÃ椫¤éÆͤ»É¤·¤¿¡ª",
1996 msg_format("You backstab the fleeing %s!",
2002 if (!(((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(TRUE) > 1)))
2004 msg_format("%s¤ò¹¶·â¤·¤¿¡£", m_name);
2006 msg_format("You hit %s.", m_name);
2011 /* Hack -- bare hands do one damage */
2014 object_flags(o_ptr, &f1, &f2, &f3);
2016 /* Select a chaotic effect (50% chance) */
2017 if ((f1 & TR1_CHAOTIC) && one_in_(2))
2020 chg_virtue(V_CHANCE, 1);
2022 if (randint1(5) < 3)
2024 /* Vampiric (20%) */
2027 else if (one_in_(250))
2032 else if (!one_in_(10))
2034 /* Confusion (26.892%) */
2037 else if (one_in_(2))
2039 /* Teleport away (1.494%) */
2044 /* Polymorph (1.494%) */
2049 /* Vampiric drain */
2050 if ((f1 & TR1_VAMPIRIC) || (chaos_effect == 1) || (mode == HISSATSU_DRAIN))
2052 /* Only drain "living" monsters */
2053 if (monster_living(r_ptr))
2059 if ((f1 & TR1_VORPAL) && (randint1(vorpal_chance*3/2) == 1) && !zantetsu_mukou)
2061 else vorpal_cut = FALSE;
2063 if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(TRUE) > 1))
2065 int special_effect = 0, stun_effect = 0, times = 0, max_times;
2067 martial_arts *ma_ptr = &ma_blows[0], *old_ptr = &ma_blows[0];
2068 int resist_stun = 0;
2071 if (r_ptr->flags1 & RF1_UNIQUE) resist_stun += 88;
2072 if (r_ptr->flags3 & RF3_NO_STUN) resist_stun += 66;
2073 if (r_ptr->flags3 & RF3_NO_CONF) resist_stun += 33;
2074 if (r_ptr->flags3 & RF3_NO_SLEEP) resist_stun += 33;
2075 if ((r_ptr->flags3 & RF3_UNDEAD) || (r_ptr->flags3 & RF3_NONLIVING))
2078 if (p_ptr->special_defense & KAMAE_BYAKKO)
2079 max_times = (p_ptr->lev < 3 ? 1 : p_ptr->lev / 3);
2080 else if (p_ptr->special_defense & KAMAE_SUZAKU)
2082 else if (p_ptr->special_defense & KAMAE_GENBU)
2085 max_times = (p_ptr->lev < 7 ? 1 : p_ptr->lev / 7);
2086 /* Attempt 'times' */
2087 for (times = 0; times < max_times; times++)
2091 ma_ptr = &ma_blows[randint0(MAX_MA)];
2092 if ((p_ptr->pclass == CLASS_FORCETRAINER) && (ma_ptr->min_level > 1)) min_level = ma_ptr->min_level + 3;
2093 else min_level = ma_ptr->min_level;
2095 while ((min_level > p_ptr->lev) ||
2096 (randint1(p_ptr->lev) < ma_ptr->chance));
2098 /* keep the highest level attack available we found */
2099 if ((ma_ptr->min_level > old_ptr->min_level) &&
2100 !p_ptr->stun && !p_ptr->confused)
2104 if (wizard && cheat_xtra)
2107 msg_print("¹¶·â¤òºÆÁªÂò¤·¤Þ¤·¤¿¡£");
2109 msg_print("Attack re-selected.");
2120 if (p_ptr->pclass == CLASS_FORCETRAINER) min_level = MAX(1, ma_ptr->min_level - 3);
2121 else min_level = ma_ptr->min_level;
2122 k = damroll(ma_ptr->dd, ma_ptr->ds);
2123 if (p_ptr->special_attack & ATTACK_SUIKEN) k *= 2;
2125 if (ma_ptr->effect == MA_KNEE)
2127 if (r_ptr->flags1 & RF1_MALE)
2130 msg_format("%s¤Ë¶âŪɨ½³¤ê¤ò¤¯¤é¤ï¤·¤¿¡ª", m_name);
2132 msg_format("You hit %s in the groin with your knee!", m_name);
2136 special_effect = MA_KNEE;
2139 msg_format(ma_ptr->desc, m_name);
2142 else if (ma_ptr->effect == MA_SLOW)
2144 if (!((r_ptr->flags1 & RF1_NEVER_MOVE) ||
2145 strchr("~#{}.UjmeEv$,DdsbBFIJQSXclnw!=?", r_ptr->d_char)))
2148 msg_format("%s¤Î¼ó¤Ë´ØÀá½³¤ê¤ò¤¯¤é¤ï¤·¤¿¡ª", m_name);
2150 msg_format("You kick %s in the ankle.", m_name);
2153 special_effect = MA_SLOW;
2155 else msg_format(ma_ptr->desc, m_name);
2161 stun_effect = (ma_ptr->effect / 2) + randint1(ma_ptr->effect / 2);
2164 msg_format(ma_ptr->desc, m_name);
2167 if (p_ptr->special_defense & KAMAE_SUZAKU) weight = 4;
2168 if ((p_ptr->pclass == CLASS_FORCETRAINER) && (p_ptr->magic_num1[0]))
2170 weight += (p_ptr->magic_num1[0]/30);
2171 if (weight > 20) weight = 20;
2174 k = critical_norm(p_ptr->lev * weight, min_level, k, p_ptr->to_h[0], 0);
2176 if ((special_effect == MA_KNEE) && ((k + p_ptr->to_d[hand]) < m_ptr->hp))
2179 msg_format("%^s¤Ï¶ìÄˤˤ¦¤á¤¤¤Æ¤¤¤ë¡ª", m_name);
2181 msg_format("%^s moans in agony!", m_name);
2184 stun_effect = 7 + randint1(13);
2188 else if ((special_effect == MA_SLOW) && ((k + p_ptr->to_d[hand]) < m_ptr->hp))
2190 if (!(r_ptr->flags1 & RF1_UNIQUE) &&
2191 (randint1(p_ptr->lev) > r_ptr->level) &&
2195 msg_format("%^s¤Ï¤ò¤Ò¤¤º¤ê»Ï¤á¤¿¡£", m_name);
2197 msg_format("%^s starts limping slower.", m_name);
2200 m_ptr->mspeed -= 10;
2204 if (stun_effect && ((k + p_ptr->to_d[hand]) < m_ptr->hp))
2206 if (p_ptr->lev > randint1(r_ptr->level + resist_stun + 10))
2210 msg_format("%^s¤Ï¤µ¤é¤Ë¥Õ¥é¥Õ¥é¤Ë¤Ê¤Ã¤¿¡£", m_name);
2212 msg_format("%^s is more stunned.", m_name);
2217 msg_format("%^s¤Ï¥Õ¥é¥Õ¥é¤Ë¤Ê¤Ã¤¿¡£", m_name);
2219 msg_format("%^s is stunned.", m_name);
2223 m_ptr->stunned += stun_effect;
2228 /* Handle normal weapon */
2229 else if (o_ptr->k_idx)
2231 k = damroll(o_ptr->dd, o_ptr->ds);
2234 if((o_ptr->tval == TV_POLEARM) && ((o_ptr->sval == SV_LANCE) || (o_ptr->sval == SV_HEAVY_LANCE)))
2236 k += damroll(2, o_ptr->ds);
2240 k = tot_dam_aux(o_ptr, k, m_ptr, mode);
2244 k *= (3 + (p_ptr->lev / 20));
2248 k = k*(5+(p_ptr->lev*2/25))/2;
2250 else if (stab_fleeing)
2255 if ((p_ptr->impact[hand] && ((k > 50) || one_in_(7))) ||
2256 (chaos_effect == 2) || (mode == HISSATSU_QUAKE))
2261 if ((!(o_ptr->tval == TV_SWORD) || !(o_ptr->sval == SV_DOKUBARI)) && !(mode == HISSATSU_KYUSHO))
2262 k = critical_norm(o_ptr->weight, o_ptr->to_h, k, p_ptr->to_h[hand], mode);
2270 if ((o_ptr->name1 == ART_CHAINSWORD) && !one_in_(2))
2272 char chainsword_noise[1024];
2274 if (!get_rnd_line("chainswd_j.txt", 0, chainsword_noise))
2276 if (!get_rnd_line("chainswd.txt", 0, chainsword_noise))
2280 msg_print(chainsword_noise);
2284 if (o_ptr->name1 == ART_VORPAL_BLADE)
2287 msg_print("Ìܤˤâ»ß¤Þ¤é¤Ì¥Ü¡¼¥Ñ¥ë¡¦¥Ö¥ì¡¼¥É¡¢¼êÏ£¤ÎÁá¶È¡ª");
2289 msg_print("Your Vorpal Blade goes snicker-snack!");
2296 msg_format("%s¤ò¥°¥Ã¥µ¥êÀÚ¤êÎö¤¤¤¿¡ª", m_name);
2298 msg_format("Your weapon cuts deep into %s!", m_name);
2303 /* Try to increase the damage */
2304 while (one_in_(vorpal_chance))
2312 if (((r_ptr->flags3 & RF3_RES_ALL) ? k/100 : k) > m_ptr->hp)
2315 msg_format("%s¤ò¿¿¤ÃÆó¤Ä¤Ë¤·¤¿¡ª", m_name);
2317 msg_format("You cut %s in half!", m_name);
2326 case 2: msg_format("%s¤ò»Â¤Ã¤¿¡ª", m_name); break;
2328 case 2: msg_format("You gouge %s!", m_name); break;
2332 case 3: msg_format("%s¤ò¤Ö¤Ã¤¿»Â¤Ã¤¿¡ª", m_name); break;
2334 case 3: msg_format("You maim %s!", m_name); break;
2338 case 4: msg_format("%s¤ò¥á¥Ã¥¿»Â¤ê¤Ë¤·¤¿¡ª", m_name); break;
2340 case 4: msg_format("You carve %s!", m_name); break;
2344 case 5: msg_format("%s¤ò¥á¥Ã¥¿¥á¥¿¤Ë»Â¤Ã¤¿¡ª", m_name); break;
2346 case 5: msg_format("You cleave %s!", m_name); break;
2350 case 6: msg_format("%s¤ò»É¿È¤Ë¤·¤¿¡ª", m_name); break;
2352 case 6: msg_format("You smite %s!", m_name); break;
2356 case 7: msg_format("%s¤ò»Â¤Ã¤Æ»Â¤Ã¤Æ»Â¤ê¤Þ¤¯¤Ã¤¿¡ª", m_name); break;
2358 case 7: msg_format("You eviscerate %s!", m_name); break;
2362 default: msg_format("%s¤òºÙÀÚ¤ì¤Ë¤·¤¿¡ª", m_name); break;
2364 default: msg_format("You shred %s!", m_name); break;
2369 drain_result = drain_result * 3 / 2;
2373 drain_result += o_ptr->to_d;
2376 /* Apply the player damage bonuses */
2377 k += p_ptr->to_d[hand];
2378 drain_result += p_ptr->to_d[hand];
2380 if ((mode == HISSATSU_SUTEMI) || (mode == HISSATSU_3DAN)) k *= 2;
2381 if ((mode == HISSATSU_SEKIRYUKA) && (r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON | RF3_NONLIVING))) k = 0;
2382 if ((mode == HISSATSU_SEKIRYUKA) && !p_ptr->cut) k /= 2;
2384 /* No negative damage */
2387 if ((mode == HISSATSU_ZANMA) && !((r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) && (r_ptr->flags3 & RF3_EVIL)))
2395 msg_print("¤³¤ó¤ÊÆð¤é¤«¤¤¤â¤Î¤ÏÀÚ¤ì¤ó¡ª");
2397 msg_print("You cannot cut such a elastic thing!");
2405 msg_print("ÃØéá¤Ï¶ì¼ê¤À¡ª");
2407 msg_print("Spiders are difficult for you to deal with!");
2412 if (mode == HISSATSU_MINEUCHI)
2414 int tmp = (10 + randint1(15) + p_ptr->lev / 5);
2417 anger_monster(m_ptr);
2419 if (!(r_ptr->flags3 & (RF3_NO_STUN)))
2425 msg_format("%s¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£", m_name);
2427 msg_format("%s is more dazed.", m_name);
2435 msg_format("%s ¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£", m_name);
2437 msg_format("%s is dazed.", m_name);
2442 m_ptr->stunned = (tmp < 200) ? tmp : 200;
2447 msg_format("%s ¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
2449 msg_format("%s is not effected.", m_name);
2454 /* Modify the damage */
2455 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))));
2456 if (((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI)) || (mode == HISSATSU_KYUSHO))
2458 if ((randint1(randint1(r_ptr->level/7)+5) == 1) && !(r_ptr->flags1 & RF1_UNIQUE) && !(r_ptr->flags7 & RF7_UNIQUE2))
2462 msg_format("%s¤ÎµÞ½ê¤òÆͤ»É¤·¤¿¡ª", m_name);
2464 msg_format("You hit %s on a fatal spot!", m_name);
2469 else if ((p_ptr->pclass == CLASS_NINJA) && (!p_ptr->icky_wield[hand]) && ((p_ptr->cur_lite <= 0) || one_in_(7)))
2471 int maxhp = maxroll(r_ptr->hdice, r_ptr->hside);
2472 if (one_in_(backstab ? 13 : (stab_fleeing || fuiuchi) ? 15 : 27))
2477 msg_format("¿Ï¤¬%s¤Ë¿¼¡¹¤ÈÆͤ»É¤µ¤Ã¤¿¡ª", m_name);
2479 msg_format("You critically injured %s!", m_name);
2482 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)))
2484 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE2) || (m_ptr->hp >= maxhp/2))
2486 k = MAX(k*5, m_ptr->hp/2);
2489 msg_format("%s¤ËÃ×Ì¿½ý¤òÉé¤ï¤»¤¿¡ª", m_name);
2491 msg_format("You fatally injured %s!", m_name);
2498 msg_format("¿Ï¤¬%s¤ÎµÞ½ê¤ò´Ó¤¤¤¿¡ª", m_name);
2500 msg_format("You hit %s on a fatal spot!", m_name);
2506 /* Complex message */
2507 if (wizard || cheat_xtra)
2510 msg_format("%d/%d ¤Î¥À¥á¡¼¥¸¤òÍ¿¤¨¤¿¡£", k, m_ptr->hp);
2512 msg_format("You do %d (out of %d) damage.", k, m_ptr->hp);
2517 if (k <= 0) can_drain = FALSE;
2519 if (drain_result > m_ptr->hp)
2520 drain_result = m_ptr->hp;
2522 /* Damage, check for fear and death */
2523 if (mon_take_hit(c_ptr->m_idx, k, fear, NULL))
2526 if ((p_ptr->pclass == CLASS_BERSERKER) && energy_use)
2528 if (p_ptr->migite && p_ptr->hidarite)
2530 if (hand) energy_use = energy_use*3/5+energy_use*num*2/(p_ptr->num_blow[hand]*5);
2531 else energy_use = energy_use*num*3/(p_ptr->num_blow[hand]*5);
2535 energy_use = energy_use*num/p_ptr->num_blow[hand];
2538 if ((o_ptr->name1 == ART_ZANTETSU) && is_lowlevel)
2540 msg_print("¤Þ¤¿¤Ä¤Þ¤é¤Ì¤â¤Î¤ò»Â¤Ã¤Æ¤·¤Þ¤Ã¤¿¡¥¡¥¡¥");
2542 msg_print("Sign..Another trifling thing I've cut....");
2547 /* Anger the monster */
2548 if (k > 0) anger_monster(m_ptr);
2550 touch_zap_player(m_ptr);
2552 /* Are we draining it? A little note: If the monster is
2553 dead, the drain does not work... */
2555 if (can_drain && (drain_result > 0))
2557 if (o_ptr->name1 == ART_MURAMASA)
2561 int to_h = o_ptr->to_h;
2562 int to_d = o_ptr->to_d;
2566 for (i = 0; i < to_h + 3; i++) if (one_in_(4)) flag = 0;
2570 for (i = 0; i < to_d + 3; i++) if (one_in_(4)) flag = 0;
2573 if (o_ptr->to_h != to_h || o_ptr->to_d != to_d)
2576 msg_print("ÍÅÅá¤Ï·ì¤òµÛ¤Ã¤Æ¶¯¤¯¤Ê¤Ã¤¿¡ª");
2578 msg_print("Muramasa sucked blood, and became more powerful!");
2587 if (drain_result > 5) /* Did we really hurt it? */
2589 drain_heal = damroll(2, drain_result / 6);
2594 msg_format("Draining left: %d", drain_left);
2596 msg_format("Draining left: %d", drain_left);
2603 if (drain_heal < drain_left)
2605 drain_left -= drain_heal;
2609 drain_heal = drain_left;
2616 msg_format("¿Ï¤¬%s¤«¤éÀ¸Ì¿ÎϤòµÛ¤¤¼è¤Ã¤¿¡ª", m_name);
2618 msg_format("Your weapon drains life from %s!", m_name);
2624 drain_heal = (drain_heal * mutant_regenerate_mod) / 100;
2626 hp_player(drain_heal);
2627 /* We get to keep some of it! */
2631 m_ptr->maxhp -= (k+7)/8;
2632 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2638 /* Confusion attack */
2639 if ((p_ptr->special_attack & ATTACK_CONFUSE) || (chaos_effect == 3) || (mode == HISSATSU_CONF))
2641 /* Cancel glowing hands */
2642 if (p_ptr->special_attack & ATTACK_CONFUSE)
2644 p_ptr->special_attack &= ~(ATTACK_CONFUSE);
2646 msg_print("¼ê¤Îµ±¤¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
2648 msg_print("Your hands stop glowing.");
2650 p_ptr->redraw |= (PR_STATUS);
2654 /* Confuse the monster */
2655 if (r_ptr->flags3 & RF3_NO_CONF)
2659 r_ptr->r_flags3 |= RF3_NO_CONF;
2663 msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
2665 msg_format("%^s is unaffected.", m_name);
2669 else if (randint0(100) < r_ptr->level)
2672 msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
2674 msg_format("%^s is unaffected.", m_name);
2681 msg_format("%^s¤Ïº®Í𤷤¿¤è¤¦¤À¡£", m_name);
2683 msg_format("%^s appears confused.", m_name);
2686 m_ptr->confused += 10 + randint0(p_ptr->lev) / 5;
2690 else if (chaos_effect == 4)
2692 bool resists_tele = FALSE;
2694 if (r_ptr->flags3 & RF3_RES_TELE)
2696 if (r_ptr->flags1 & RF1_UNIQUE)
2698 if (m_ptr->ml) r_ptr->r_flags3 |= RF3_RES_TELE;
2700 msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
2702 msg_format("%^s is unaffected!", m_name);
2705 resists_tele = TRUE;
2707 else if (r_ptr->level > randint1(100))
2709 if (m_ptr->ml) r_ptr->r_flags3 |= RF3_RES_TELE;
2711 msg_format("%^s¤ÏÄñ¹³ÎϤò»ý¤Ã¤Æ¤¤¤ë¡ª", m_name);
2713 msg_format("%^s resists!", m_name);
2716 resists_tele = TRUE;
2723 msg_format("%^s¤Ï¾Ã¤¨¤¿¡ª", m_name);
2725 msg_format("%^s disappears!", m_name);
2728 teleport_away(c_ptr->m_idx, 50, FALSE);
2729 num = p_ptr->num_blow[hand] + 1; /* Can't hit it anymore! */
2734 else if ((chaos_effect == 5) && cave_floor_bold(y, x) &&
2735 (randint1(90) > r_ptr->level))
2737 if (!(r_ptr->flags1 & RF1_UNIQUE) &&
2738 !(r_ptr->flags4 & RF4_BR_CHAO) &&
2739 !(r_ptr->flags1 & RF1_QUESTOR))
2741 if (polymorph_monster(y, x))
2744 msg_format("%^s¤ÏÊѲ½¤·¤¿¡ª", m_name);
2746 msg_format("%^s changes!", m_name);
2750 /* Hack -- Get new monster */
2751 m_ptr = &m_list[c_ptr->m_idx];
2753 /* Oops, we need a different name... */
2754 monster_desc(m_name, m_ptr, 0);
2756 /* Hack -- Get new race */
2757 r_ptr = &r_info[m_ptr->r_idx];
2765 msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
2767 msg_format("%^s is unaffected.", m_name);
2773 else if (o_ptr->name1 == ART_G_HAMMER)
2775 monster_type *m_ptr = &m_list[c_ptr->m_idx];
2777 if (m_ptr->hold_o_idx)
2779 object_type *q_ptr = &o_list[m_ptr->hold_o_idx];
2780 char o_name[MAX_NLEN];
2782 object_desc(o_name, q_ptr, TRUE, 0);
2783 q_ptr->held_m_idx = 0;
2784 q_ptr->marked = FALSE;
2785 m_ptr->hold_o_idx = q_ptr->next_o_idx;
2786 q_ptr->next_o_idx = 0;
2788 msg_format("%s¤òÃ¥¤Ã¤¿¡£", o_name);
2790 msg_format("You snatched %s.", o_name);
2800 backstab = FALSE; /* Clumsy! */
2801 fuiuchi = FALSE; /* Clumsy! */
2803 if ((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE) && one_in_(3))
2812 msg_format("¥ß¥¹¡ª %s¤Ë¤«¤ï¤µ¤ì¤¿¡£", m_name);
2814 msg_format("You miss %s.", m_name);
2818 msg_print("¿¶¤ê²ó¤·¤¿Âç³ù¤¬¼«Ê¬¼«¿È¤ËÊ֤äƤ¤¿¡ª");
2820 msg_print("Your scythe returns to you!");
2823 /* Extract the flags */
2824 object_flags(o_ptr, &f1, &f2, &f3);
2826 k = damroll(o_ptr->dd, o_ptr->ds);
2829 switch (p_ptr->mimic_form)
2832 switch (p_ptr->prace)
2838 case RACE_HALF_TROLL:
2839 case RACE_HALF_OGRE:
2840 case RACE_HALF_GIANT:
2841 case RACE_HALF_TITAN:
2851 case RACE_DRACONIAN:
2858 case MIMIC_DEMON_LORD:
2865 if (p_ptr->align < 0 && mult < 2)
2867 if (!(p_ptr->resist_acid || p_ptr->oppose_acid) && (mult < 3))
2868 mult = mult * 5 / 2;
2869 if (!(p_ptr->resist_elec || p_ptr->oppose_elec) && (mult < 3))
2870 mult = mult * 5 / 2;
2871 if (!(p_ptr->resist_fire || p_ptr->oppose_fire) && (mult < 3))
2872 mult = mult * 5 / 2;
2873 if (!(p_ptr->resist_cold || p_ptr->oppose_cold) && (mult < 3))
2874 mult = mult * 5 / 2;
2875 if (!(p_ptr->resist_pois || p_ptr->oppose_pois) && (mult < 3))
2876 mult = mult * 5 / 2;
2878 if ((p_ptr->pclass != CLASS_SAMURAI) && (f1 & TR1_FORCE_WEAPON) && (p_ptr->csp > (p_ptr->msp / 30)))
2880 p_ptr->csp -= (1+(p_ptr->msp / 30));
2881 p_ptr->redraw |= (PR_MANA);
2882 mult = mult * 7 / 2;
2887 k = critical_norm(o_ptr->weight, o_ptr->to_h, k, p_ptr->to_h[hand], mode);
2892 msg_format("¥°¥Ã¥µ¥êÀÚ¤êÎö¤«¤ì¤¿¡ª");
2894 msg_format("Your weapon cuts deep into yourself!");
2896 /* Try to increase the damage */
2904 k += (p_ptr->to_d[hand] + o_ptr->to_d);
2907 take_hit(DAMAGE_FORCE, k, "»à¤ÎÂç³ù", -1);
2909 take_hit(DAMAGE_FORCE, k, "Death scythe", -1);
2921 msg_format("¥ß¥¹¡ª %s¤Ë¤«¤ï¤µ¤ì¤¿¡£", m_name);
2923 msg_format("You miss %s.", m_name);
2932 if (weak && !(*mdeath))
2935 msg_format("%s¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£", m_name);
2937 msg_format("%^s seems weakened.", m_name);
2940 if (drain_left != MAX_VAMPIRIC_DRAIN)
2944 chg_virtue(V_UNLIFE, 1);
2947 /* Mega-Hack -- apply earthquake brand */
2950 earthquake(py, px, 10);
2951 if (!cave[y][x].m_idx) *mdeath = TRUE;
2955 bool py_attack(int y, int x, int mode)
2958 bool mdeath = FALSE;
2959 bool stormbringer = FALSE;
2961 cave_type *c_ptr = &cave[y][x];
2962 monster_type *m_ptr = &m_list[c_ptr->m_idx];
2965 /* Disturb the player */
2970 if (m_ptr->csleep) /* It is not honorable etc to attack helpless victims */
2972 if (!(r_info[m_ptr->r_idx].flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
2973 if (!(r_info[m_ptr->r_idx].flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
2976 /* Extract monster name (or "it") */
2977 monster_desc(m_name, m_ptr, 0);
2979 /* Auto-Recall if possible and visible */
2980 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
2982 /* Track a new monster */
2983 if (m_ptr->ml) health_track(c_ptr->m_idx);
2985 if ((r_info[m_ptr->r_idx].flags1 & RF1_FEMALE) &&
2986 !(p_ptr->stun || p_ptr->confused || p_ptr->image || !m_ptr->ml))
2988 if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
2991 msg_print("ÀÛ¼Ô¡¢¤ª¤Ê¤´¤Ï»Â¤ì¤Ì¡ª");
2993 msg_print("I can not attack women!");
2999 if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
3002 msg_print("¤Ê¤¼¤«¹¶·â¤¹¤ë¤³¤È¤¬¤Ç¤¤Ê¤¤¡£");
3004 msg_print("Something prevent you from attacking.");
3009 /* Stop if friendly */
3010 if (!is_hostile(m_ptr) &&
3011 !(p_ptr->stun || p_ptr->confused || p_ptr->image ||
3012 p_ptr->shero || !m_ptr->ml))
3014 if (inventory[INVEN_RARM].art_name)
3016 if (inventory[INVEN_RARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
3018 if (inventory[INVEN_LARM].art_name)
3020 if (inventory[INVEN_LARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
3025 msg_format("¹õ¤¤¿Ï¤Ï¶¯ÍߤË%s¤ò¹¶·â¤·¤¿¡ª", m_name);
3027 msg_format("Your black blade greedily attacks %s!", m_name);
3029 chg_virtue(V_INDIVIDUALISM, 1);
3030 chg_virtue(V_HONOUR, -1);
3031 chg_virtue(V_JUSTICE, -1);
3032 chg_virtue(V_COMPASSION, -1);
3034 else if (p_ptr->pclass != CLASS_BERSERKER)
3037 if (get_check("ËÜÅö¤Ë¹¶·â¤·¤Þ¤¹¤«¡©"))
3039 if (get_check("Really hit it? "))
3042 chg_virtue(V_INDIVIDUALISM, 1);
3043 chg_virtue(V_HONOUR, -1);
3044 chg_virtue(V_JUSTICE, -1);
3045 chg_virtue(V_COMPASSION, -1);
3050 msg_format("%s¤ò¹¶·â¤¹¤ë¤Î¤ò»ß¤á¤¿¡£", m_name);
3052 msg_format("You stop to avoid hitting %s.", m_name);
3060 /* Handle player fear */
3066 msg_format("¶²¤¯¤Æ%s¤ò¹¶·â¤Ç¤¤Ê¤¤¡ª", m_name);
3068 msg_format("You are too afraid to attack %s!", m_name);
3073 msg_format ("¤½¤Ã¤Á¤Ë¤Ï²¿¤«¶²¤¤¤â¤Î¤¬¤¤¤ë¡ª");
3075 msg_format ("There is something scary in your way!");
3078 /* Disturb the monster */
3080 p_ptr->update |= (PU_MON_LITE);
3086 if (p_ptr->migite && p_ptr->hidarite)
3088 if ((skill_exp[GINOU_NITOURYU] < s_info[p_ptr->pclass].s_max[GINOU_NITOURYU]) && ((skill_exp[GINOU_NITOURYU] - 1000) / 200 < r_info[m_ptr->r_idx].level))
3090 if (skill_exp[GINOU_NITOURYU] < 4000)
3091 skill_exp[GINOU_NITOURYU]+=80;
3092 else if(skill_exp[GINOU_NITOURYU] < 6000)
3093 skill_exp[GINOU_NITOURYU]+=4;
3094 else if(skill_exp[GINOU_NITOURYU] < 7000)
3095 skill_exp[GINOU_NITOURYU]+=1;
3096 else if(skill_exp[GINOU_NITOURYU] < 8000)
3097 if (one_in_(3)) skill_exp[GINOU_NITOURYU]+=1;
3098 p_ptr->update |= (PU_BONUS);
3104 int ridinglevel = r_info[m_list[p_ptr->riding].r_idx].level;
3105 if ((skill_exp[GINOU_RIDING] < s_info[p_ptr->pclass].s_max[GINOU_RIDING]) && ((skill_exp[GINOU_RIDING] - 1000) / 200 < r_info[m_ptr->r_idx].level) && (skill_exp[GINOU_RIDING]/100 - 2000 < ridinglevel))
3106 skill_exp[GINOU_RIDING]++;
3107 if ((skill_exp[GINOU_RIDING] < s_info[p_ptr->pclass].s_max[GINOU_RIDING]) && (skill_exp[GINOU_RIDING]/100 < ridinglevel))
3109 if (ridinglevel*100 > (skill_exp[GINOU_RIDING] + 1500))
3110 skill_exp[GINOU_RIDING] += (1+(ridinglevel - skill_exp[GINOU_RIDING]/100 - 15));
3111 else skill_exp[GINOU_RIDING]++;
3113 p_ptr->update |= (PU_BONUS);
3116 riding_t_m_idx = c_ptr->m_idx;
3117 if (p_ptr->migite) py_attack_aux(y, x, &fear, &mdeath, 0, mode);
3118 if (p_ptr->hidarite && !mdeath) py_attack_aux(y, x, &fear, &mdeath, 1, mode);
3120 /* Mutations which yield extra 'natural' attacks */
3123 if ((p_ptr->muta2 & MUT2_HORNS) && !mdeath)
3124 natural_attack(c_ptr->m_idx, MUT2_HORNS, &fear, &mdeath);
3125 if ((p_ptr->muta2 & MUT2_BEAK) && !mdeath)
3126 natural_attack(c_ptr->m_idx, MUT2_BEAK, &fear, &mdeath);
3127 if ((p_ptr->muta2 & MUT2_SCOR_TAIL) && !mdeath)
3128 natural_attack(c_ptr->m_idx, MUT2_SCOR_TAIL, &fear, &mdeath);
3129 if ((p_ptr->muta2 & MUT2_TRUNK) && !mdeath)
3130 natural_attack(c_ptr->m_idx, MUT2_TRUNK, &fear, &mdeath);
3131 if ((p_ptr->muta2 & MUT2_TENTACLES) && !mdeath)
3132 natural_attack(c_ptr->m_idx, MUT2_TENTACLES, &fear, &mdeath);
3135 /* Hack -- delay fear messages */
3136 if (fear && m_ptr->ml && !mdeath)
3143 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
3145 msg_format("%^s flees in terror!", m_name);
3150 if ((p_ptr->special_defense & KATA_IAI) && ((mode != HISSATSU_IAI) || mdeath))
3152 set_action(ACTION_NONE);
3159 static bool pattern_seq(int c_y, int c_x, int n_y, int n_x)
3161 if (!pattern_tile(c_y, c_x) && !pattern_tile(n_y, n_x))
3164 if (cave[n_y][n_x].feat == FEAT_PATTERN_START)
3166 if (!pattern_tile(c_y, c_x) &&
3167 !p_ptr->confused && !p_ptr->stun && !p_ptr->image)
3170 if (get_check("¥Ñ¥¿¡¼¥ó¤Î¾å¤òÊ⤻Ϥá¤ë¤È¡¢Á´¤Æ¤òÊ⤫¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¤¤¤¤¤Ç¤¹¤«¡©"))
3172 if (get_check("If you start walking the Pattern, you must walk the whole way. Ok? "))
3182 else if ((cave[n_y][n_x].feat == FEAT_PATTERN_OLD) ||
3183 (cave[n_y][n_x].feat == FEAT_PATTERN_END) ||
3184 (cave[n_y][n_x].feat == FEAT_PATTERN_XTRA2))
3186 if (pattern_tile(c_y, c_x))
3193 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤òÊ⤯¤Ë¤Ï¥¹¥¿¡¼¥ÈÃÏÅÀ¤«¤éÊ⤻Ϥá¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£");
3195 msg_print("You must start walking the Pattern from the startpoint.");
3201 else if ((cave[n_y][n_x].feat == FEAT_PATTERN_XTRA1) ||
3202 (cave[c_y][c_x].feat == FEAT_PATTERN_XTRA1))
3206 else if (cave[c_y][c_x].feat == FEAT_PATTERN_START)
3208 if (pattern_tile(n_y, n_x))
3213 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤ÏÀµ¤·¤¤½ç½ø¤ÇÊ⤫¤Í¤Ð¤Ê¤ê¤Þ¤»¤ó¡£");
3215 msg_print("You must walk the Pattern in correct order.");
3221 else if ((cave[c_y][c_x].feat == FEAT_PATTERN_OLD) ||
3222 (cave[c_y][c_x].feat == FEAT_PATTERN_END) ||
3223 (cave[c_y][c_x].feat == FEAT_PATTERN_XTRA2))
3225 if (!pattern_tile(n_y, n_x))
3228 msg_print("¥Ñ¥¿¡¼¥ó¤òƧ¤ß³°¤·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£");
3230 msg_print("You may not step off from the Pattern.");
3242 if (!pattern_tile(c_y, c_x))
3245 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤òÊ⤯¤Ë¤Ï¥¹¥¿¡¼¥ÈÃÏÅÀ¤«¤éÊ⤻Ϥá¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£");
3247 msg_print("You must start walking the Pattern from the startpoint.");
3254 byte ok_move = FEAT_PATTERN_START;
3255 switch (cave[c_y][c_x].feat)
3257 case FEAT_PATTERN_1:
3258 ok_move = FEAT_PATTERN_2;
3260 case FEAT_PATTERN_2:
3261 ok_move = FEAT_PATTERN_3;
3263 case FEAT_PATTERN_3:
3264 ok_move = FEAT_PATTERN_4;
3266 case FEAT_PATTERN_4:
3267 ok_move = FEAT_PATTERN_1;
3272 msg_format("¤ª¤«¤·¤Ê¥Ñ¥¿¡¼¥óÊâ¹Ô¡¢%d¡£", cave[c_y][c_x]);
3274 msg_format("Funny Pattern walking, %d.", cave[c_y][c_x]);
3277 return TRUE; /* Goof-up */
3280 if ((cave[n_y][n_x].feat == ok_move) ||
3281 (cave[n_y][n_x].feat == cave[c_y][c_x].feat))
3285 if (!pattern_tile(n_y, n_x))
3287 msg_print("¥Ñ¥¿¡¼¥ó¤òƧ¤ß³°¤·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£");
3289 msg_print("You may not step off from the Pattern.");
3294 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤ÏÀµ¤·¤¤½ç½ø¤ÇÊ⤫¤Í¤Ð¤Ê¤ê¤Þ¤»¤ó¡£");
3296 msg_print("You must walk the Pattern in correct order.");
3308 bool player_can_enter(byte feature)
3312 /* Player can not walk through "walls" unless in Shadow Form */
3313 if (p_ptr->wraith_form || p_ptr->pass_wall || p_ptr->kabenuke)
3320 case FEAT_DEEP_WATER:
3321 case FEAT_SHAL_LAVA:
3322 case FEAT_DEEP_LAVA:
3345 case FEAT_WALL_EXTRA:
3346 case FEAT_WALL_INNER:
3347 case FEAT_WALL_OUTER:
3348 case FEAT_WALL_SOLID:
3355 return (!dun_level && p_ptr->ffall);
3357 case FEAT_PERM_EXTRA:
3358 case FEAT_PERM_INNER:
3359 case FEAT_PERM_OUTER:
3360 case FEAT_PERM_SOLID:
3371 * Move player in the given direction, with the given "pickup" flag.
3373 * This routine should (probably) always induce energy expenditure.
3375 * Note that moving will *always* take a turn, and will *always* hit
3376 * any monster which might be in the destination grid. Previously,
3377 * moving into walls was "free" and did NOT hit invisible monsters.
3379 void move_player(int dir, int do_pickup, bool break_trap)
3384 monster_type *m_ptr;
3388 bool p_can_pass_walls = FALSE;
3389 bool stormbringer = FALSE;
3391 bool oktomove = TRUE;
3392 bool do_past = FALSE;
3394 /* Find the result of moving */
3398 /* Examine the destination */
3399 c_ptr = &cave[y][x];
3403 if (!dun_level && !p_ptr->wild_mode &&
3404 ((x == 0) || (x == MAX_WID - 1) ||
3405 (y == 0) || (y == MAX_HGT - 1)))
3407 /* Can the player enter the grid? */
3408 if (c_ptr->mimic && player_can_enter(c_ptr->mimic))
3410 /* Hack: move to new area */
3411 if ((y == 0) && (x == 0))
3413 p_ptr->wilderness_y--;
3414 p_ptr->wilderness_x--;
3415 p_ptr->oldpy = cur_hgt - 2;
3416 p_ptr->oldpx = cur_wid - 2;
3417 ambush_flag = FALSE;
3420 else if ((y == 0) && (x == MAX_WID - 1))
3422 p_ptr->wilderness_y--;
3423 p_ptr->wilderness_x++;
3424 p_ptr->oldpy = cur_hgt - 2;
3426 ambush_flag = FALSE;
3429 else if ((y == MAX_HGT - 1) && (x == 0))
3431 p_ptr->wilderness_y++;
3432 p_ptr->wilderness_x--;
3434 p_ptr->oldpx = cur_wid - 2;
3435 ambush_flag = FALSE;
3438 else if ((y == MAX_HGT - 1) && (x == MAX_WID - 1))
3440 p_ptr->wilderness_y++;
3441 p_ptr->wilderness_x++;
3444 ambush_flag = FALSE;
3449 p_ptr->wilderness_y--;
3450 p_ptr->oldpy = cur_hgt - 2;
3452 ambush_flag = FALSE;
3455 else if (y == MAX_HGT - 1)
3457 p_ptr->wilderness_y++;
3460 ambush_flag = FALSE;
3465 p_ptr->wilderness_x--;
3466 p_ptr->oldpx = cur_wid - 2;
3468 ambush_flag = FALSE;
3471 else if (x == MAX_WID - 1)
3473 p_ptr->wilderness_x++;
3476 ambush_flag = FALSE;
3479 p_ptr->leftbldg = TRUE;
3480 p_ptr->leaving = TRUE;
3489 /* Get the monster */
3490 m_ptr = &m_list[c_ptr->m_idx];
3493 if (inventory[INVEN_RARM].art_name)
3495 if (inventory[INVEN_RARM].name1 == ART_STORMBRINGER)
3496 stormbringer = TRUE;
3498 else if (inventory[INVEN_LARM].art_name)
3500 if (inventory[INVEN_LARM].name1 == ART_STORMBRINGER)
3501 stormbringer = TRUE;
3504 /* Player can not walk through "walls"... */
3505 /* unless in Shadow Form */
3506 if (p_ptr->wraith_form || p_ptr->pass_wall || p_ptr->kabenuke)
3507 p_can_pass_walls = TRUE;
3508 if ((cave[y][x].feat >= FEAT_PERM_EXTRA) &&
3509 (cave[y][x].feat <= FEAT_PERM_SOLID))
3511 p_can_pass_walls = FALSE;
3516 cave[py][px].m_idx = 0;
3519 /* Hack -- attack monsters */
3520 if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x) || p_can_pass_walls))
3523 /* Attack -- only if we can see it OR it is not in a wall */
3524 if (!is_hostile(m_ptr) &&
3525 !(p_ptr->confused || p_ptr->image || !m_ptr->ml || p_ptr->stun ||
3526 ((p_ptr->muta2 & MUT2_BERS_RAGE) && p_ptr->shero)) &&
3527 (pattern_seq(py, px, y, x)) &&
3528 ((cave_floor_bold(y, x)) || (c_ptr->feat == FEAT_TREES) || (p_can_pass_walls)))
3531 p_ptr->update |= (PU_MON_LITE);
3533 /* Extract monster name (or "it") */
3534 monster_desc(m_name, m_ptr, 0);
3536 /* Auto-Recall if possible and visible */
3537 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
3539 /* Track a new monster */
3540 if (m_ptr->ml) health_track(c_ptr->m_idx);
3543 if ((stormbringer && (randint1(1000) > 666)) || (p_ptr->pclass == CLASS_BERSERKER))
3548 else if (monster_can_cross_terrain(cave[py][px].feat, &r_info[m_ptr->r_idx]) &&
3549 (cave_floor_bold(py, px) || cave[py][px].feat == FEAT_TREES ||
3550 (r_info[m_ptr->r_idx].flags2 & RF2_PASS_WALL)))
3557 msg_format("%^s¤¬¼ÙËâ¤À¡ª", m_name);
3559 msg_format("%^s is in your way!", m_name);
3566 /* now continue on to 'movement' */
3579 else if ((c_ptr->feat == FEAT_DARK_PIT) && !p_ptr->ffall)
3582 msg_print("Îö¤±Ìܤò²£Àڤ뤳¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£");
3584 msg_print("You can't cross the chasm.");
3592 else if (c_ptr->feat == FEAT_MOUNTAIN)
3594 if (dun_level || !p_ptr->ffall)
3597 msg_print("»³¤Ë¤ÏÅФì¤Þ¤»¤ó¡ª");
3599 msg_print("You can't climb the mountains!");
3608 * Player can move through trees and
3609 * has effective -10 speed
3610 * Rangers can move without penality
3612 else if (c_ptr->feat == FEAT_TREES)
3615 if ((p_ptr->pclass != CLASS_RANGER) && !p_ptr->ffall) energy_use *= 2;
3618 else if ((c_ptr->feat >= FEAT_QUEST_ENTER) &&
3619 (c_ptr->feat <= FEAT_QUEST_EXIT))
3624 #ifdef ALLOW_EASY_DISARM /* TNB */
3626 /* Disarm a visible trap */
3627 else if ((do_pickup != easy_disarm) && is_trap(c_ptr->feat))
3629 bool ignore = FALSE;
3630 switch (c_ptr->feat)
3632 case FEAT_TRAP_TRAPDOOR:
3634 case FEAT_TRAP_SPIKED_PIT:
3635 case FEAT_TRAP_POISON_PIT:
3636 if (p_ptr->ffall) ignore = TRUE;
3638 case FEAT_TRAP_TELEPORT:
3639 if (p_ptr->anti_tele) ignore = TRUE;
3641 case FEAT_TRAP_FIRE:
3642 if (p_ptr->immune_fire) ignore = TRUE;
3644 case FEAT_TRAP_ACID:
3645 if (p_ptr->immune_acid) ignore = TRUE;
3647 case FEAT_TRAP_BLIND:
3648 if (p_ptr->resist_blind) ignore = TRUE;
3650 case FEAT_TRAP_CONFUSE:
3651 if (p_ptr->resist_conf) ignore = TRUE;
3653 case FEAT_TRAP_POISON:
3654 if (p_ptr->resist_pois) ignore = TRUE;
3656 case FEAT_TRAP_SLEEP:
3657 if (p_ptr->free_act) ignore = TRUE;
3663 (void)do_cmd_disarm_aux(y, x, dir);
3668 #endif /* ALLOW_EASY_DISARM -- TNB */
3669 else if (p_ptr->riding && (r_info[m_list[p_ptr->riding].r_idx].flags1 & RF1_NEVER_MOVE))
3672 msg_print("Æ°¤±¤Ê¤¤¡ª");
3674 msg_print("Can't move!");
3681 else if (p_ptr->riding && m_list[p_ptr->riding].monfear)
3685 /* Acquire the monster name */
3686 monster_desc(m_name, &m_list[p_ptr->riding], 0);
3688 /* Dump a message */
3690 msg_format("%s¤¬¶²Éݤ·¤Æ¤¤¤ÆÀ©¸æ¤Ç¤¤Ê¤¤¡£", m_name);
3692 msg_format("%^s is too scared to control.", m_name);
3698 else if (p_ptr->riding && p_ptr->riding_ryoute)
3704 else if ((p_ptr->riding && (r_info[m_list[p_ptr->riding].r_idx].flags7 & RF7_AQUATIC)) && (c_ptr->feat != FEAT_SHAL_WATER) && (c_ptr->feat != FEAT_DEEP_WATER))
3707 msg_print("Φ¾å¤Ë¾å¤¬¤ì¤Ê¤¤¡£");
3709 msg_print("Can't land.");
3716 else if ((p_ptr->riding && !(r_info[m_list[p_ptr->riding].r_idx].flags7 & (RF7_AQUATIC | RF7_CAN_SWIM | RF7_CAN_FLY))) && (c_ptr->feat == FEAT_DEEP_WATER))
3719 msg_print("¿å¾å¤Ë¹Ô¤±¤Ê¤¤¡£");
3721 msg_print("Can't swim.");
3728 else if ((p_ptr->riding && (r_info[m_list[p_ptr->riding].r_idx].flags2 & (RF2_AURA_FIRE)) && !(r_info[m_list[p_ptr->riding].r_idx].flags7 & (RF7_CAN_FLY))) && (c_ptr->feat == FEAT_SHAL_WATER))
3731 msg_print("¿å¾å¤Ë¹Ô¤±¤Ê¤¤¡£");
3733 msg_print("Can't swim.");
3740 else if ((p_ptr->riding && !(r_info[m_list[p_ptr->riding].r_idx].flags7 & (RF7_CAN_FLY)) && !(r_info[m_list[p_ptr->riding].r_idx].flags3 & (RF3_IM_FIRE))) && ((c_ptr->feat == FEAT_SHAL_LAVA) || (c_ptr->feat == FEAT_DEEP_LAVA)))
3743 msg_print("ÍÏ´ä¤Î¾å¤Ë¹Ô¤±¤Ê¤¤¡£");
3745 msg_print("Too hot to go through.");
3752 else if (p_ptr->riding && m_list[p_ptr->riding].stunned && one_in_(2))
3755 monster_desc(m_name, &m_list[p_ptr->riding], 0);
3757 msg_format("%s¤¬Û¯Û°¤È¤·¤Æ¤¤¤Æ¤¦¤Þ¤¯Æ°¤±¤Ê¤¤¡ª",m_name);
3759 msg_format("You cannot control stunned %s!",m_name);
3765 /* Player can not walk through "walls" unless in wraith form...*/
3766 else if ((!cave_floor_bold(y, x)) &&
3767 (!p_can_pass_walls))
3771 /* Disturb the player */
3774 /* Notice things in the dark */
3775 if ((!(c_ptr->info & (CAVE_MARK))) &&
3776 (p_ptr->blind || !(c_ptr->info & (CAVE_LITE))))
3779 if (c_ptr->feat == FEAT_RUBBLE)
3782 msg_print("´äÀФ¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¤è¤¦¤À¡£");
3784 msg_print("You feel some rubble blocking your way.");
3787 c_ptr->info |= (CAVE_MARK);
3792 else if (c_ptr->feat < FEAT_SECRET)
3795 msg_print("¥É¥¢¤¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¤è¤¦¤À¡£");
3797 msg_print("You feel a closed door blocking your way.");
3800 c_ptr->info |= (CAVE_MARK);
3804 /* Wall (or secret door) */
3808 msg_print("Êɤ¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¤è¤¦¤À¡£");
3810 msg_print("You feel a wall blocking your way.");
3813 c_ptr->info |= (CAVE_MARK);
3822 if (c_ptr->feat == FEAT_RUBBLE)
3825 msg_print("´äÀФ¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¡£");
3827 msg_print("There is rubble blocking your way.");
3831 if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
3835 * Well, it makes sense that you lose time bumping into
3836 * a wall _if_ you are confused, stunned or blind; but
3837 * typing mistakes should not cost you a turn...
3841 else if (c_ptr->feat < FEAT_SECRET)
3843 #ifdef ALLOW_EASY_OPEN
3845 if (easy_open && easy_open_door(y, x)) return;
3847 #endif /* ALLOW_EASY_OPEN */
3850 msg_print("¥É¥¢¤¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¡£");
3852 msg_print("There is a closed door blocking your way.");
3856 if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
3860 /* Wall (or secret door) */
3864 msg_print("Êɤ¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¡£");
3866 msg_print("There is a wall blocking your way.");
3870 if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
3876 sound(SOUND_HITWALL);
3879 /* Normal movement */
3880 if (!pattern_seq(py, px, y, x))
3882 if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
3887 /* To avoid a loop with running */
3893 /* Normal movement */
3900 if(!process_frakir(x,y))
3910 msg_format("%s¤ò²¡¤·Âऱ¤¿¡£", m_name);
3912 msg_format("You push past %s.", m_name);
3917 cave[py][px].m_idx = c_ptr->m_idx;
3919 update_mon(cave[py][px].m_idx, TRUE);
3922 /* Change oldpx and oldpy to place the player well when going back to big mode */
3923 if (p_ptr->wild_mode)
3925 if(ddy[dir] > 0) p_ptr->oldpy = 1;
3926 if(ddy[dir] < 0) p_ptr->oldpy = MAX_HGT - 2;
3927 if(ddy[dir] == 0) p_ptr->oldpy = MAX_HGT / 2;
3928 if(ddx[dir] > 0) p_ptr->oldpx = 1;
3929 if(ddx[dir] < 0) p_ptr->oldpx = MAX_WID - 2;
3930 if(ddx[dir] == 0) p_ptr->oldpx = MAX_WID / 2;
3933 /* Save old location */
3937 /* Move the player */
3941 if (p_ptr->riding && (r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_KILL_WALL))
3943 if (cave[py][px].feat > FEAT_SECRET && cave[py][px].feat < FEAT_PERM_SOLID)
3945 /* Forget the wall */
3946 cave[py][px].info &= ~(CAVE_MARK);
3949 cave_set_feat(py, px, floor_type[randint0(100)]);
3952 if (music_singing(MUSIC_WALL))
3954 project(0, 0, py, px,
3955 (60 + p_ptr->lev), GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM, -1);
3957 else if (p_ptr->kill_wall)
3959 if (cave_valid_bold(py, px) &&
3960 (cave[py][px].feat < FEAT_PATTERN_START ||
3961 cave[py][px].feat > FEAT_PATTERN_XTRA2) &&
3962 (cave[py][px].feat < FEAT_DEEP_WATER ||
3963 cave[py][px].feat > FEAT_GRASS))
3965 if (cave[py][px].feat == FEAT_TREES)
3966 cave_set_feat(py, px, FEAT_GRASS);
3969 cave[py][px].feat = floor_type[randint0(100)];
3972 /* Update some things -- similar to GF_KILL_WALL */
3973 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
3976 /* Redraw new spot */
3979 /* Redraw old spot */
3983 /* sound(SOUND_WALK); */
3985 /* Check for new panel (redraw map) */
3988 /* For get everything when requested hehe I'm *NASTY* */
3989 if (dun_level && (d_info[dungeon_type].flags1 & DF1_FORGET))
3994 if ((p_ptr->pclass == CLASS_NINJA))
3996 if (c_ptr->info & (CAVE_GLOW)) set_superstealth(FALSE);
3997 else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
3999 if ((p_ptr->action == ACTION_HAYAGAKE) && !cave_floor_bold(py, px))
4002 msg_print("¤³¤³¤Ç¤ÏÁÇÁ᤯ư¤±¤Ê¤¤¡£");
4004 msg_print("You cannot run in wall.");
4006 set_action(ACTION_NONE);
4010 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
4012 /* Update the monsters */
4013 p_ptr->update |= (PU_DISTANCE);
4016 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4018 /* Spontaneous Searching */
4019 if ((p_ptr->skill_fos >= 50) ||
4020 (0 == randint0(50 - p_ptr->skill_fos)))
4025 /* Continuous Searching */
4026 if (p_ptr->action == ACTION_SEARCH)
4031 /* Handle "objects" */
4033 #ifdef ALLOW_EASY_DISARM /* TNB */
4035 carry(do_pickup != always_pickup);
4037 #else /* ALLOW_EASY_DISARM -- TNB */
4041 #endif /* ALLOW_EASY_DISARM -- TNB */
4043 /* Handle "store doors" */
4044 if (((c_ptr->feat >= FEAT_SHOP_HEAD) &&
4045 (c_ptr->feat <= FEAT_SHOP_TAIL)) ||
4046 (c_ptr->feat == FEAT_MUSEUM))
4052 /* Hack -- Enter store */
4056 /* Handle "building doors" -KMW- */
4057 else if ((c_ptr->feat >= FEAT_BLDG_HEAD) &&
4058 (c_ptr->feat <= FEAT_BLDG_TAIL))
4064 /* Hack -- Enter building */
4068 /* Handle quest areas -KMW- */
4069 else if (cave[y][x].feat == FEAT_QUEST_ENTER)
4075 /* Hack -- Enter quest level */
4079 else if (cave[y][x].feat == FEAT_QUEST_EXIT)
4081 if (quest[p_ptr->inside_quest].type == QUEST_TYPE_FIND_EXIT)
4083 if (record_fix_quest) do_cmd_write_nikki(NIKKI_FIX_QUEST_C, p_ptr->inside_quest, NULL);
4084 quest[p_ptr->inside_quest].status = QUEST_STATUS_COMPLETED;
4085 quest[p_ptr->inside_quest].complev = (byte)p_ptr->lev;
4087 msg_print("¥¯¥¨¥¹¥È¤òãÀ®¤·¤¿¡ª");
4089 msg_print("You accomplished your quest!");
4095 leave_quest_check();
4097 p_ptr->inside_quest = cave[y][x].special;
4101 p_ptr->leaving = TRUE;
4104 /* Discover invisible traps */
4105 else if (c_ptr->info & CAVE_TRAP)
4112 msg_print("¥È¥é¥Ã¥×¤À¡ª");
4114 msg_print("You found a trap!");
4122 hit_trap(break_trap);
4125 /* Set off an visible trap */
4126 else if (is_trap(c_ptr->feat))
4132 hit_trap(break_trap);
4135 /* Warn when leaving trap detected region */
4136 if ((disturb_trap_detect || alert_trap_detect)
4137 && p_ptr->dtrap && !(cave[py][px].info & CAVE_DETECT))
4139 /* No duplicate warning */
4140 p_ptr->dtrap = FALSE;
4142 if (alert_trap_detect)
4145 msg_print("* Ãí°Õ:¤³¤ÎÀè¤Ï¥È¥é¥Ã¥×¤Î´¶ÃÎÈϰϳ°¤Ç¤¹¡ª *");
4147 msg_print("*Leaving trap detect region!*");
4151 if (disturb_trap_detect)
4160 m_list[p_ptr->riding].fy = py;
4161 m_list[p_ptr->riding].fx = px;
4162 cave[py][px].m_idx = p_ptr->riding;
4163 update_mon(cave[py][px].m_idx, TRUE);
4164 p_ptr->update |= (PU_MON_LITE);
4170 * Hack -- Check for a "known wall" (see below)
4172 static int see_wall(int dir, int y, int x)
4174 /* Get the new location */
4178 /* Illegal grids are not known walls */
4179 if (!in_bounds2(y, x)) return (FALSE);
4181 /* Non-wall grids are not known walls */
4182 if (cave[y][x].feat < FEAT_SECRET) return (FALSE);
4184 if ((cave[y][x].feat >= FEAT_DEEP_WATER) &&
4185 (cave[y][x].feat <= FEAT_GRASS)) return (FALSE);
4187 if ((cave[y][x].feat >= FEAT_SHOP_HEAD) &&
4188 (cave[y][x].feat <= FEAT_SHOP_TAIL)) return (FALSE);
4190 if (cave[y][x].feat == FEAT_DEEP_GRASS) return (FALSE);
4191 if (cave[y][x].feat == FEAT_FLOWER) return (FALSE);
4193 if (cave[y][x].feat == FEAT_MUSEUM) return (FALSE);
4195 if ((cave[y][x].feat >= FEAT_BLDG_HEAD) &&
4196 (cave[y][x].feat <= FEAT_BLDG_TAIL)) return (FALSE);
4198 /* if (cave[y][x].feat == FEAT_TREES) return (FALSE); */
4200 /* Must be known to the player */
4201 if (!(cave[y][x].info & (CAVE_MARK))) return (FALSE);
4203 if (cave[y][x].feat >= FEAT_TOWN) return (FALSE);
4211 * Hack -- Check for an "unknown corner" (see below)
4213 static int see_nothing(int dir, int y, int x)
4215 /* Get the new location */
4219 /* Illegal grids are unknown */
4220 if (!in_bounds2(y, x)) return (TRUE);
4222 /* Memorized grids are always known */
4223 if (cave[y][x].info & (CAVE_MARK)) return (FALSE);
4225 /* Non-floor grids are unknown */
4226 if (!cave_floor_bold(y, x)) return (TRUE);
4228 /* Viewable door/wall grids are known */
4229 if (player_can_see_bold(y, x)) return (FALSE);
4240 * The running algorithm: -CJS-
4242 * In the diagrams below, the player has just arrived in the
4243 * grid marked as '@', and he has just come from a grid marked
4244 * as 'o', and he is about to enter the grid marked as 'x'.
4246 * Of course, if the "requested" move was impossible, then you
4247 * will of course be blocked, and will stop.
4249 * Overview: You keep moving until something interesting happens.
4250 * If you are in an enclosed space, you follow corners. This is
4251 * the usual corridor scheme. If you are in an open space, you go
4252 * straight, but stop before entering enclosed space. This is
4253 * analogous to reaching doorways. If you have enclosed space on
4254 * one side only (that is, running along side a wall) stop if
4255 * your wall opens out, or your open space closes in. Either case
4256 * corresponds to a doorway.
4258 * What happens depends on what you can really SEE. (i.e. if you
4259 * have no light, then running along a dark corridor is JUST like
4260 * running in a dark room.) The algorithm works equally well in
4261 * corridors, rooms, mine tailings, earthquake rubble, etc, etc.
4263 * These conditions are kept in static memory:
4264 * find_openarea You are in the open on at least one
4266 * find_breakleft You have a wall on the left, and will
4268 * find_breakright You have a wall on the right, and will
4271 * To initialize these conditions, we examine the grids adjacent
4272 * to the grid marked 'x', two on each side (marked 'L' and 'R').
4273 * If either one of the two grids on a given side is seen to be
4274 * closed, then that side is considered to be closed. If both
4275 * sides are closed, then it is an enclosed (corridor) run.
4281 * Looking at more than just the immediate squares is
4282 * significant. Consider the following case. A run along the
4283 * corridor will stop just before entering the center point,
4284 * because a choice is clearly established. Running in any of
4285 * three available directions will be defined as a corridor run.
4286 * Note that a minor hack is inserted to make the angled corridor
4287 * entry (with one side blocked near and the other side blocked
4288 * further away from the runner) work correctly. The runner moves
4289 * diagonally, but then saves the previous direction as being
4290 * straight into the gap. Otherwise, the tail end of the other
4291 * entry would be perceived as an alternative on the next move.
4299 * Likewise, a run along a wall, and then into a doorway (two
4300 * runs) will work correctly. A single run rightwards from @ will
4301 * stop at 1. Another run right and down will enter the corridor
4302 * and make the corner, stopping at the 2.
4304 * ##################
4306 * ########### ######
4310 * After any move, the function area_affect is called to
4311 * determine the new surroundings, and the direction of
4312 * subsequent moves. It examines the current player location
4313 * (at which the runner has just arrived) and the previous
4314 * direction (from which the runner is considered to have come).
4316 * Moving one square in some direction places you adjacent to
4317 * three or five new squares (for straight and diagonal moves
4318 * respectively) to which you were not previously adjacent,
4319 * marked as '!' in the diagrams below.
4322 * .o@! (normal) .o.! (diagonal)
4323 * ...! (east) ..@! (south east)
4326 * You STOP if any of the new squares are interesting in any way:
4327 * for example, if they contain visible monsters or treasure.
4329 * You STOP if any of the newly adjacent squares seem to be open,
4330 * and you are also looking for a break on that side. (that is,
4331 * find_openarea AND find_break).
4333 * You STOP if any of the newly adjacent squares do NOT seem to be
4334 * open and you are in an open area, and that side was previously
4337 * Corners: If you are not in the open (i.e. you are in a corridor)
4338 * and there is only one way to go in the new squares, then turn in
4339 * that direction. If there are more than two new ways to go, STOP.
4340 * If there are two ways to go, and those ways are separated by a
4341 * square which does not seem to be open, then STOP.
4343 * Otherwise, we have a potential corner. There are two new open
4344 * squares, which are also adjacent. One of the new squares is
4345 * diagonally located, the other is straight on (as in the diagram).
4346 * We consider two more squares further out (marked below as ?).
4348 * We assign "option" to the straight-on grid, and "option2" to the
4349 * diagonal grid, and "check_dir" to the grid marked 's'.
4355 * If they are both seen to be closed, then it is seen that no benefit
4356 * is gained from moving straight. It is a known corner. To cut the
4357 * corner, go diagonally, otherwise go straight, but pretend you
4358 * stepped diagonally into that next location for a full view next
4359 * time. Conversely, if one of the ? squares is not seen to be closed,
4360 * then there is a potential choice. We check to see whether it is a
4361 * potential corner or an intersection/room entrance. If the square
4362 * two spaces straight ahead, and the space marked with 's' are both
4363 * unknown space, then it is a potential corner and enter if
4364 * find_examine is set, otherwise must stop because it is not a
4372 * Hack -- allow quick "cycling" through the legal directions
4374 static byte cycle[] =
4375 { 1, 2, 3, 6, 9, 8, 7, 4, 1, 2, 3, 6, 9, 8, 7, 4, 1 };
4378 * Hack -- map each direction into the "middle" of the "cycle[]" array
4380 static byte chome[] =
4381 { 0, 8, 9, 10, 7, 0, 11, 6, 5, 4 };
4384 * The direction we are running
4386 static byte find_current;
4389 * The direction we came from
4391 static byte find_prevdir;
4394 * We are looking for open area
4396 static bool find_openarea;
4399 * We are looking for a break
4401 static bool find_breakright;
4402 static bool find_breakleft;
4407 * Initialize the running algorithm for a new direction.
4409 * Diagonal Corridor -- allow diaginal entry into corridors.
4411 * Blunt Corridor -- If there is a wall two spaces ahead and
4412 * we seem to be in a corridor, then force a turn into the side
4413 * corridor, must be moving straight into a corridor here. ???
4415 * Diagonal Corridor Blunt Corridor (?)
4420 static void run_init(int dir)
4422 int row, col, deepleft, deepright;
4423 int i, shortleft, shortright;
4426 /* Save the direction */
4429 /* Assume running straight */
4432 /* Assume looking for open area */
4433 find_openarea = TRUE;
4435 /* Assume not looking for breaks */
4436 find_breakright = find_breakleft = FALSE;
4438 /* Assume no nearby walls */
4439 deepleft = deepright = FALSE;
4440 shortright = shortleft = FALSE;
4445 /* Find the destination grid */
4446 row = py + ddy[dir];
4447 col = px + ddx[dir];
4449 /* Extract cycle index */
4452 /* Check for walls */
4453 if (see_wall(cycle[i+1], py, px))
4455 find_breakleft = TRUE;
4458 else if (see_wall(cycle[i+1], row, col))
4460 find_breakleft = TRUE;
4464 /* Check for walls */
4465 if (see_wall(cycle[i-1], py, px))
4467 find_breakright = TRUE;
4470 else if (see_wall(cycle[i-1], row, col))
4472 find_breakright = TRUE;
4476 /* Looking for a break */
4477 if (find_breakleft && find_breakright)
4479 /* Not looking for open area */
4480 find_openarea = FALSE;
4482 /* Hack -- allow angled corridor entry */
4485 if (deepleft && !deepright)
4487 find_prevdir = cycle[i - 1];
4489 else if (deepright && !deepleft)
4491 find_prevdir = cycle[i + 1];
4495 /* Hack -- allow blunt corridor entry */
4496 else if (see_wall(cycle[i], row, col))
4498 if (shortleft && !shortright)
4500 find_prevdir = cycle[i - 2];
4502 else if (shortright && !shortleft)
4504 find_prevdir = cycle[i + 2];
4512 * Update the current "run" path
4514 * Return TRUE if the running should be stopped
4516 static bool run_test(void)
4518 int prev_dir, new_dir, check_dir = 0;
4521 int option = 0, option2 = 0;
4524 /* Where we came from */
4525 prev_dir = find_prevdir;
4528 /* Range of newly adjacent grids */
4529 max = (prev_dir & 0x01) + 1;
4531 /* break run when leaving trap detected region */
4532 if ((disturb_trap_detect || alert_trap_detect)
4533 && p_ptr->dtrap && !(cave[py][px].info & CAVE_DETECT))
4535 /* No duplicate warning */
4536 p_ptr->dtrap = FALSE;
4538 if (alert_trap_detect)
4541 msg_print("* Ãí°Õ:¤³¤ÎÀè¤Ï¥È¥é¥Ã¥×¤Î´¶ÃÎÈϰϳ°¤Ç¤¹¡ª *");
4543 msg_print("*Leaving trap detect region!*");
4547 if (disturb_trap_detect)
4554 /* Look at every newly adjacent square. */
4555 for (i = -max; i <= max; i++)
4557 s16b this_o_idx, next_o_idx = 0;
4561 new_dir = cycle[chome[prev_dir] + i];
4564 row = py + ddy[new_dir];
4565 col = px + ddx[new_dir];
4568 c_ptr = &cave[row][col];
4571 /* Visible monsters abort running */
4574 monster_type *m_ptr = &m_list[c_ptr->m_idx];
4576 /* Visible monster */
4577 if (m_ptr->ml) return (TRUE);
4580 /* Visible objects abort running */
4581 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
4585 /* Acquire object */
4586 o_ptr = &o_list[this_o_idx];
4588 /* Acquire next object */
4589 next_o_idx = o_ptr->next_o_idx;
4591 /* Visible object */
4592 if (o_ptr->marked) return (TRUE);
4596 /* Assume unknown */
4599 /* Check memorized grids */
4600 if (c_ptr->info & (CAVE_MARK))
4604 /* Examine the terrain */
4605 switch (c_ptr->feat)
4620 /* Hidden treasure */
4624 /* Known treasure (almost uninteresting) */
4630 case FEAT_WALL_EXTRA:
4631 case FEAT_WALL_INNER:
4632 case FEAT_WALL_OUTER:
4633 case FEAT_WALL_SOLID:
4634 case FEAT_PERM_EXTRA:
4635 case FEAT_PERM_INNER:
4636 case FEAT_PERM_OUTER:
4637 case FEAT_PERM_SOLID:
4638 /* dirt, grass, trees, ... */
4639 case FEAT_SHAL_WATER:
4642 case FEAT_DEEP_GRASS:
4655 /* quest features */
4656 case FEAT_QUEST_ENTER:
4657 case FEAT_QUEST_EXIT:
4666 case FEAT_DEEP_LAVA:
4667 case FEAT_SHAL_LAVA:
4670 if (p_ptr->invuln || p_ptr->immune_fire) notice = FALSE;
4676 case FEAT_DEEP_WATER:
4679 if (p_ptr->ffall || p_ptr->total_weight<= (((u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]]*(p_ptr->pclass == CLASS_BERSERKER ? 150 : 100))/2)) notice = FALSE;
4689 /* Option -- ignore */
4690 if (find_ignore_doors) notice = FALSE;
4699 case FEAT_LESS_LESS:
4700 case FEAT_MORE_MORE:
4703 /* Option -- ignore */
4704 if (find_ignore_stairs) notice = FALSE;
4711 /* Interesting feature */
4712 if (notice) return (TRUE);
4714 /* The grid is "visible" */
4718 /* Analyze unknown grids and floors */
4719 /* if (inv || cave_floor_bold(row, col) || */
4720 /* (cave[row][col].feat == FEAT_TREES)) */
4721 if (inv || cave_floor_bold(row, col))
4723 /* Looking for open area */
4729 /* The first new direction. */
4735 /* Three new directions. Stop running. */
4741 /* Two non-adjacent new directions. Stop running. */
4742 else if (option != cycle[chome[prev_dir] + i - 1])
4747 /* Two new (adjacent) directions (case 1) */
4748 else if (new_dir & 0x01)
4750 check_dir = cycle[chome[prev_dir] + i - 2];
4754 /* Two new (adjacent) directions (case 2) */
4757 check_dir = cycle[chome[prev_dir] + i + 1];
4763 /* Obstacle, while looking for open area */
4770 /* Break to the right */
4771 find_breakright = TRUE;
4776 /* Break to the left */
4777 find_breakleft = TRUE;
4784 /* Looking for open area */
4787 /* Hack -- look again */
4788 for (i = -max; i < 0; i++)
4790 new_dir = cycle[chome[prev_dir] + i];
4792 row = py + ddy[new_dir];
4793 col = px + ddx[new_dir];
4796 c_ptr = &cave[row][col];
4798 /* Unknown grid or non-wall XXX XXX XXX cave_floor_grid(c_ptr)) */
4799 if (!(c_ptr->info & (CAVE_MARK)) ||
4800 ((c_ptr->feat < FEAT_SECRET) ||
4801 (c_ptr->feat == FEAT_FLOWER) ||
4802 (c_ptr->feat == FEAT_DEEP_GRASS) ||
4803 ((c_ptr->feat >= FEAT_DEEP_WATER) &&
4804 (c_ptr->feat <= FEAT_GRASS))))
4807 /* Looking to break right */
4808 if (find_breakright)
4817 /* Looking to break left */
4825 /* Hack -- look again */
4826 for (i = max; i > 0; i--)
4828 new_dir = cycle[chome[prev_dir] + i];
4830 row = py + ddy[new_dir];
4831 col = px + ddx[new_dir];
4834 c_ptr = &cave[row][col];
4836 /* Unknown grid or non-wall XXX XXX XXX cave_floor_grid(c_ptr)) */
4837 if (!(c_ptr->info & (CAVE_MARK)) ||
4838 ((c_ptr->feat < FEAT_SECRET) ||
4839 (c_ptr->feat == FEAT_FLOWER) ||
4840 (c_ptr->feat == FEAT_DEEP_GRASS) ||
4841 ((c_ptr->feat >= FEAT_DEEP_WATER) &&
4842 (c_ptr->feat <= FEAT_GRASS))))
4845 /* Looking to break left */
4855 /* Looking to break right */
4856 if (find_breakright)
4865 /* Not looking for open area */
4877 /* Primary option */
4878 find_current = option;
4880 /* No other options */
4881 find_prevdir = option;
4884 /* Two options, examining corners */
4885 else if (find_examine && !find_cut)
4887 /* Primary option */
4888 find_current = option;
4890 /* Hack -- allow curving */
4891 find_prevdir = option2;
4894 /* Two options, pick one */
4897 /* Get next location */
4898 row = py + ddy[option];
4899 col = px + ddx[option];
4901 /* Don't see that it is closed off. */
4902 /* This could be a potential corner or an intersection. */
4903 if (!see_wall(option, row, col) ||
4904 !see_wall(check_dir, row, col))
4906 /* Can not see anything ahead and in the direction we */
4907 /* are turning, assume that it is a potential corner. */
4909 see_nothing(option, row, col) &&
4910 see_nothing(option2, row, col))
4912 find_current = option;
4913 find_prevdir = option2;
4916 /* STOP: we are next to an intersection or a room */
4923 /* This corner is seen to be enclosed; we cut the corner. */
4926 find_current = option2;
4927 find_prevdir = option2;
4930 /* This corner is seen to be enclosed, and we */
4931 /* deliberately go the long way. */
4934 find_current = option;
4935 find_prevdir = option2;
4941 /* About to hit a known wall, stop */
4942 if (see_wall(find_current, py, px))
4955 * Take one step along the current "run" path
4957 void run_step(int dir)
4962 /* Hack -- do not start silly run */
4963 if (see_wall(dir, py, px) &&
4964 (cave[py+ddy[dir]][px+ddx[dir]].feat != FEAT_TREES))
4968 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¹Ô¤±¤Þ¤»¤ó¡£");
4970 msg_print("You cannot run in that direction.");
4981 /* Calculate torch radius */
4982 p_ptr->update |= (PU_TORCH);
5002 /* Decrease the run counter */
5003 if (--running <= 0) return;
5008 /* Move the player, using the "pickup" flag */
5009 #ifdef ALLOW_EASY_DISARM /* TNB */
5011 move_player(find_current, FALSE, FALSE);
5013 #else /* ALLOW_EASY_DISARM -- TNB */
5015 move_player(find_current, always_pickup, FALSE);
5017 #endif /* ALLOW_EASY_DISARM -- TNB */
5019 if ((py == p_ptr->run_py) && (px == p_ptr->run_px))