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 < 20) mult = 20;
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 ((f1 & TR1_SLAY_UNDEAD) &&
267 (r_ptr->flags3 & RF3_UNDEAD))
271 r_ptr->r_flags3 |= RF3_UNDEAD;
274 if (mult < 30) mult = 30;
278 if ((f1 & TR1_SLAY_DEMON) &&
279 (r_ptr->flags3 & RF3_DEMON))
283 r_ptr->r_flags3 |= RF3_DEMON;
286 if (mult < 30) mult = 30;
290 if ((f1 & TR1_SLAY_ORC) &&
291 (r_ptr->flags3 & RF3_ORC))
295 r_ptr->r_flags3 |= RF3_ORC;
298 if (mult < 30) mult = 30;
302 if ((f1 & TR1_SLAY_TROLL) &&
303 (r_ptr->flags3 & RF3_TROLL))
307 r_ptr->r_flags3 |= RF3_TROLL;
310 if (mult < 30) mult = 30;
314 if ((f1 & TR1_SLAY_GIANT) &&
315 (r_ptr->flags3 & RF3_GIANT))
319 r_ptr->r_flags3 |= RF3_GIANT;
322 if (mult < 30) mult = 30;
323 if (o_ptr->name1 == ART_HRUNTING)
328 if ((f1 & TR1_SLAY_DRAGON) &&
329 (r_ptr->flags3 & RF3_DRAGON))
333 r_ptr->r_flags3 |= RF3_DRAGON;
336 if (mult < 30) mult = 30;
340 if ((f1 & TR1_KILL_DRAGON) &&
341 (r_ptr->flags3 & RF3_DRAGON))
345 r_ptr->r_flags3 |= RF3_DRAGON;
348 if (mult < 50) mult = 50;
350 if ((o_ptr->name1 == ART_NOTHUNG) && (m_ptr->r_idx == MON_FAFNER))
355 if ((f1 & TR1_BRAND_ACID) || (p_ptr->special_attack & (ATTACK_ACID)))
357 /* Notice immunity */
358 if (r_ptr->flags3 & RF3_IM_ACID)
362 r_ptr->r_flags3 |= RF3_IM_ACID;
366 /* Otherwise, take the damage */
369 if (mult < 25) mult = 25;
374 if ((f1 & TR1_BRAND_ELEC) || (p_ptr->special_attack & (ATTACK_ELEC)) || (mode == HISSATSU_ELEC))
376 /* Notice immunity */
377 if (r_ptr->flags3 & RF3_IM_ELEC)
381 r_ptr->r_flags3 |= RF3_IM_ELEC;
385 /* Otherwise, take the damage */
386 else if (((f1 & TR1_BRAND_ELEC) || (p_ptr->special_attack & (ATTACK_ELEC))) && (mode == HISSATSU_ELEC))
388 if (mult < 70) mult = 70;
390 else if (mode == HISSATSU_ELEC)
392 if (mult < 50) mult = 50;
397 if (mult < 25) mult = 25;
402 if ((f1 & TR1_BRAND_FIRE) || (p_ptr->special_attack & (ATTACK_FIRE)) || (mode == HISSATSU_FIRE))
404 /* Notice immunity */
405 if (r_ptr->flags3 & RF3_IM_FIRE)
409 r_ptr->r_flags3 |= RF3_IM_FIRE;
413 /* Otherwise, take the damage */
414 else if (((f1 & TR1_BRAND_FIRE) || (p_ptr->special_attack & (ATTACK_FIRE))) && (mode == HISSATSU_FIRE))
416 if (r_ptr->flags3 & RF3_HURT_FIRE)
418 if (mult < 70) mult = 70;
421 r_ptr->r_flags3 |= RF3_HURT_FIRE;
424 else if (mult < 35) mult = 35;
428 if (r_ptr->flags3 & RF3_HURT_FIRE)
430 if (mult < 50) mult = 50;
433 r_ptr->r_flags3 |= RF3_HURT_FIRE;
436 else if (mult < 25) mult = 25;
441 if ((f1 & TR1_BRAND_COLD) || (p_ptr->special_attack & (ATTACK_COLD)) || (mode == HISSATSU_COLD))
443 /* Notice immunity */
444 if (r_ptr->flags3 & RF3_IM_COLD)
448 r_ptr->r_flags3 |= RF3_IM_COLD;
451 /* Otherwise, take the damage */
452 else if (((f1 & TR1_BRAND_COLD) || (p_ptr->special_attack & (ATTACK_COLD))) && (mode == HISSATSU_COLD))
454 if (r_ptr->flags3 & RF3_HURT_COLD)
456 if (mult < 70) mult = 70;
459 r_ptr->r_flags3 |= RF3_HURT_COLD;
462 else if (mult < 35) mult = 35;
466 if (r_ptr->flags3 & RF3_HURT_COLD)
468 if (mult < 50) mult = 50;
471 r_ptr->r_flags3 |= RF3_HURT_COLD;
474 else if (mult < 25) mult = 25;
479 if ((f1 & TR1_BRAND_POIS) || (p_ptr->special_attack & (ATTACK_POIS)) || (mode == HISSATSU_POISON))
481 /* Notice immunity */
482 if (r_ptr->flags3 & RF3_IM_POIS)
486 r_ptr->r_flags3 |= RF3_IM_POIS;
490 /* Otherwise, take the damage */
491 else if (((f1 & TR1_BRAND_POIS) || (p_ptr->special_attack & (ATTACK_POIS))) && (mode == HISSATSU_POISON))
493 if (mult < 35) mult = 35;
497 if (mult < 25) mult = 25;
500 if ((mode == HISSATSU_ZANMA) && (r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) && (r_ptr->flags3 & RF3_EVIL))
502 if (mult < 15) mult = 25;
503 else if (mult < 50) mult = MIN(50, mult+20);
505 if (mode == HISSATSU_UNDEAD)
507 if (r_ptr->flags3 & RF3_UNDEAD)
511 r_ptr->r_flags3 |= RF3_UNDEAD;
513 if (mult == 10) mult = 70;
514 else if (mult < 140) mult = MIN(140, mult+60);
516 if (mult == 10) mult = 40;
517 else if (mult < 60) mult = MIN(60, mult+30);
519 if ((mode == HISSATSU_SEKIRYUKA) && p_ptr->cut && !(r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)))
521 int tmp = MIN(100, MAX(10, p_ptr->cut / 10));
522 if (mult < tmp) mult = tmp;
524 if ((mode == HISSATSU_HAGAN) && (r_ptr->flags3 & RF3_HURT_ROCK))
528 r_ptr->r_flags3 |= RF3_HURT_ROCK;
530 if (mult == 10) mult = 40;
531 else if (mult < 60) mult = 60;
533 if ((p_ptr->pclass != CLASS_SAMURAI) && (f1 & TR1_FORCE_WEAPON) && (p_ptr->csp > (o_ptr->dd * o_ptr->ds / 5)))
535 p_ptr->csp -= (1+(o_ptr->dd * o_ptr->ds / 5));
536 p_ptr->redraw |= (PR_MANA);
537 mult = MIN(60, mult * 7 / 2);
542 if (mult > 150) mult = 150;
544 /* Return the total damage */
545 return (tdam * mult / 10);
550 * Search for hidden things
556 s16b this_o_idx, next_o_idx = 0;
561 /* Start with base search ability */
562 chance = p_ptr->skill_srh;
564 /* Penalize various conditions */
565 if (p_ptr->blind || no_lite()) chance = chance / 10;
566 if (p_ptr->confused || p_ptr->image) chance = chance / 10;
568 /* Search the nearby grids, which are always in bounds */
569 for (y = (py - 1); y <= (py + 1); y++)
571 for (x = (px - 1); x <= (px + 1); x++)
573 /* Sometimes, notice things */
574 if (randint0(100) < chance)
576 /* Access the grid */
580 if (c_ptr->info & CAVE_TRAP)
587 msg_print("¥È¥é¥Ã¥×¤òȯ¸«¤·¤¿¡£");
589 msg_print("You have found a trap.");
598 if (c_ptr->feat == FEAT_SECRET)
602 msg_print("±£¤·¥É¥¢¤òȯ¸«¤·¤¿¡£");
604 msg_print("You have found a secret door.");
609 place_closed_door(y, x);
615 /* Scan all objects in the grid */
616 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
621 o_ptr = &o_list[this_o_idx];
623 /* Acquire next object */
624 next_o_idx = o_ptr->next_o_idx;
626 /* Skip non-chests */
627 if (o_ptr->tval != TV_CHEST) continue;
629 /* Skip non-trapped chests */
630 if (!chest_traps[o_ptr->pval]) continue;
633 if (!object_known_p(o_ptr))
637 msg_print("È¢¤Ë»Å³Ý¤±¤é¤ì¤¿¥È¥é¥Ã¥×¤òȯ¸«¤·¤¿¡ª");
639 msg_print("You have discovered a trap on the chest!");
657 * Helper routine for py_pickup() and py_pickup_floor().
659 * Add the given dungeon object to the character's inventory.
661 * Delete the object afterwards.
663 void py_pickup_aux(int o_idx)
669 * ¥¢¥¤¥Æ¥à¤ò½¦¤Ã¤¿ºÝ¤Ë¡Ö£²¤Ä¤Î¥±¡¼¥¤ò»ý¤Ã¤Æ¤¤¤ë¡×
670 * "You have two cakes." ¤È¥¢¥¤¥Æ¥à¤ò½¦¤Ã¤¿¸å¤Î¹ç·×¤Î¤ß¤Îɽ¼¨¤¬¥ª¥ê¥¸¥Ê¥ë
672 * ¤¢¤ë¤È¤¤¤¦»ØŦ¤ò¤¦¤±¤¿¤Î¤Ç¡¢¡Ö¡Á¤ò½¦¤Ã¤¿¡¢¡Á¤ò»ý¤Ã¤Æ¤¤¤ë¡×¤È¤¤¤¦É½¼¨
673 * ¤Ë¤«¤¨¤Æ¤¢¤ë¡£¤½¤Î¤¿¤á¤ÎÇÛÎó¡£
675 char o_name[MAX_NLEN];
676 char old_name[MAX_NLEN];
679 extern char *object_desc_kosuu(char *t, object_type *o_ptr);
681 char o_name[MAX_NLEN];
686 o_ptr = &o_list[o_idx];
689 /* Describe the object */
690 object_desc(old_name, o_ptr, TRUE, 0);
691 object_desc_kosuu(kazu_str, o_ptr);
692 hirottakazu = o_ptr->number;
694 /* Carry the object */
695 slot = inven_carry(o_ptr);
697 /* Get the object again */
698 o_ptr = &inventory[slot];
700 /* Delete the object */
701 delete_object_idx(o_idx);
703 if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN) identify_item(o_ptr);
705 /* Describe the object */
706 object_desc(o_name, o_ptr, TRUE, 3);
710 if ((o_ptr->name1 == ART_CRIMSON) && (p_ptr->pseikaku == SEIKAKU_COMBAT))
712 msg_format("¤³¤¦¤·¤Æ¡¢%s¤Ï¡Ø¥¯¥ê¥à¥¾¥ó¡Ù¤ò¼ê¤ËÆþ¤ì¤¿¡£", player_name);
713 msg_print("¤·¤«¤·º£¡¢¡Øº®Æ٤Υµ¡¼¥Ú¥ó¥È¡Ù¤ÎÊü¤Ã¤¿¥â¥ó¥¹¥¿¡¼¤¬¡¢");
714 msg_format("%s¤Ë½±¤¤¤«¤«¤ë¡¥¡¥¡¥", player_name);
720 msg_format("%s(%c)¤ò»ý¤Ã¤Æ¤¤¤ë¡£",o_name, index_to_label(slot));
724 if (o_ptr->number > hirottakazu) {
725 msg_format("%s½¦¤Ã¤Æ¡¢%s(%c)¤ò»ý¤Ã¤Æ¤¤¤ë¡£",
726 kazu_str, o_name, index_to_label(slot));
728 msg_format("%s(%c)¤ò½¦¤Ã¤¿¡£", o_name, index_to_label(slot));
732 strcpy(record_o_name, old_name);
734 msg_format("You have %s (%c).", o_name, index_to_label(slot));
735 strcpy(record_o_name, o_name);
740 /* Check if completed a quest */
741 for (i = 0; i < max_quests; i++)
743 if ((quest[i].type == QUEST_TYPE_FIND_ARTIFACT) &&
744 (quest[i].status == QUEST_STATUS_TAKEN) &&
745 (quest[i].k_idx == o_ptr->name1))
747 if (record_fix_quest) do_cmd_write_nikki(NIKKI_FIX_QUEST_C, i, NULL);
748 quest[i].status = QUEST_STATUS_COMPLETED;
749 quest[i].complev = (byte)p_ptr->lev;
751 msg_print("¥¯¥¨¥¹¥È¤òãÀ®¤·¤¿¡ª");
753 msg_print("You completed your quest!");
762 bool can_player_destroy_object(object_type *o_ptr)
764 /* Artifacts cannot be destroyed */
765 if (artifact_p(o_ptr) || o_ptr->art_name)
767 byte feel = FEEL_SPECIAL;
769 /* Hack -- Handle icky artifacts */
770 if (cursed_p(o_ptr) || broken_p(o_ptr)) feel = FEEL_TERRIBLE;
772 /* Hack -- inscribe the artifact */
773 o_ptr->feeling = feel;
775 /* We have "felt" it (again) */
776 o_ptr->ident |= (IDENT_SENSE);
778 /* Combine the pack */
779 p_ptr->notice |= (PN_COMBINE);
781 /* Redraw equippy chars */
782 p_ptr->redraw |= (PR_EQUIPPY);
785 p_ptr->window |= (PW_INVEN | PW_EQUIP);
796 int is_autopick(object_type *o_ptr)
799 char o_name[MAX_NLEN];
802 static char kanji_colon[] = "¡§";
805 if (o_ptr->tval == TV_GOLD) return -1;
807 object_desc(o_name, o_ptr, FALSE, 3);
808 for (i = 0; o_name[i]; i++)
811 if (iskanji(o_name[i]))
815 if (isupper(o_name[i]))
816 o_name[i] = tolower(o_name[i]);
819 for (i=0; i<max_autopick; i++)
822 bool collectable = FALSE;
825 str = autopick_name[i];
828 /*** ¤¹¤Ù¤Æ¤Î... ***/
829 if (!strncmp(str, "¤¹¤Ù¤Æ¤Î", 8)) str+= 8;
831 /*** ´û¤Ë»ý¤Ã¤Æ¤¤¤ë¥¢¥¤¥Æ¥à ***/
832 if (!strncmp(str, "¼ý½¸Ãæ¤Î", 8))
838 /*** ̤´ÕÄê¤Î... ***/
839 if (!strncmp(str, "̤´ÕÄê¤Î",8) &&
840 !object_known_p(o_ptr) && !( (o_ptr->ident)&IDENT_SENSE)) str+= 8;
842 /*** ´ÕÄêºÑ¤ß¤Î... ***/
843 if (!strncmp(str, "´ÕÄêºÑ¤ß¤Î",10) &&
844 object_known_p(o_ptr) ) str+= 10;
846 /*** *´ÕÄê*ºÑ¤ß¤Î... ***/
847 if (!strncmp(str, "*´ÕÄê*ºÑ¤ß¤Î",12) &&
848 object_known_p(o_ptr) && (o_ptr->ident & IDENT_MENTAL) ) str+= 12;
851 if (!strncmp(str, "̵ÌäÎ", 6)
852 && (object_known_p(o_ptr)) && !o_ptr->inscription
853 && (!o_ptr->name1 && !o_ptr->name2 && !o_ptr->art_name))
857 case TV_SHOT: case TV_ARROW: case TV_BOLT: case TV_BOW:
858 case TV_DIGGING: case TV_HAFTED: case TV_POLEARM: case TV_SWORD:
859 case TV_BOOTS: case TV_GLOVES: case TV_HELM: case TV_CROWN:
860 case TV_SHIELD: case TV_CLOAK:
861 case TV_SOFT_ARMOR: case TV_HARD_ARMOR: case TV_DRAG_ARMOR:
862 case TV_LITE: case TV_AMULET: case TV_RING: case TV_CARD:
867 /*** ̤ȽÌÀ¤Î... ***/
868 if (!strncmp(str, "̤ȽÌÀ¤Î",8) &&
869 !object_aware_p(o_ptr)) str+= 8;
871 /*** ̵²ÁÃͤÎ... ***/
872 if (!strncmp(str, "̵²ÁÃͤÎ", 8)
873 && object_value(o_ptr) <= 0) str+= 8;
876 if (o_ptr->tval != TV_BOW && !strncmp(str, "¥À¥¤¥¹Ìܤΰ㤦", 14))
878 object_kind *k_ptr = &k_info[o_ptr->k_idx];
880 if ((o_ptr->dd != k_ptr->dd) || (o_ptr->ds != k_ptr->ds))
887 if (!strncmp(str, "¥À¥¤¥¹ÌÜ", 8) && isdigit(*(str + 8)) && isdigit(*(str + 9))){
888 if ( (o_ptr->dd) * (o_ptr->ds) >= (*(str+8)-'0') * 10 + (*(str + 9)-'0')) str+= 10;
889 if (!strncmp(str, "°Ê¾å¤Î", 6)) str+= 6;
892 /*** ¾Þ¶â¼ó¤Î»àÂÎ/¹ü ***/
893 if (!strncmp(str, "¾Þ¶â¼ó¤Î", 8) &&
894 (o_ptr->tval == TV_CORPSE) &&
895 object_is_shoukinkubi(o_ptr)) str+= 8;
897 /*** ¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î»àÂÎ/¹ü ***/
898 if (!strncmp(str, "¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î", 22) &&
899 ((o_ptr->tval == TV_CORPSE) || (o_ptr->tval == TV_STATUE)) &&
900 (r_info[o_ptr->pval].flags1 & RF1_UNIQUE)) str+= 22;
902 /*** ¿Í´Ö¤Î»àÂÎ/¹ü (for Daemon) ***/
903 if (!strncmp(str, "¿Í´Ö¤Î", 6) &&
904 (o_ptr->tval == TV_CORPSE) &&
905 (strchr("pht", r_info[o_ptr->pval].d_char))) str+= 6;
907 /*** º£¤Î¿¦¶È¤Ç»È¤¨¤Ê¤¤ËâË¡½ñ ***/
908 if (!strncmp(str, "Æɤá¤Ê¤¤", 8) &&
909 (o_ptr->tval >= TV_LIFE_BOOK) &&
910 !check_book_realm(o_ptr->tval, o_ptr->sval)) str += 8;
912 /*** Âè°ìÎΰè¤ÎËâË¡½ñ ***/
913 if (!strncmp(str, "Âè°ìÎΰè¤Î", 10) &&
914 !(p_ptr->pclass == CLASS_SORCERER) &&
915 !(p_ptr->pclass == CLASS_RED_MAGE) &&
916 (o_ptr->tval >= TV_LIFE_BOOK) &&
917 (REALM1_BOOK == o_ptr->tval) ) str += 10;
919 /*** ÂèÆóÎΰè¤ÎËâË¡½ñ ***/
920 if (!strncmp(str, "ÂèÆóÎΰè¤Î", 10) &&
921 !(p_ptr->pclass == CLASS_SORCERER) &&
922 !(p_ptr->pclass == CLASS_RED_MAGE) &&
923 (o_ptr->tval >= TV_LIFE_BOOK) &&
924 (REALM2_BOOK == o_ptr->tval) ) str += 10;
926 /*** nºýÌܤÎËâË¡½ñ ***/
927 if (!strncmp(str + 1, "ºýÌܤÎ", 6) &&
928 (o_ptr->tval >= TV_LIFE_BOOK) &&
929 (*str == '1' + o_ptr->sval) ) str += 6 + 1;
932 /*** ¥¢¥¤¥Æ¥à¤Î¥«¥Æ¥´¥ê»ØÄêͽÌó¸ì ***/
933 if (!strncmp(str, "¥¢¥¤¥Æ¥à",8)) len = 8;
935 else if (!strncmp(str, "¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È", 16)){
936 if (object_known_p(o_ptr)
937 && (artifact_p(o_ptr) || o_ptr->art_name))
941 else if (!strncmp(str, "Éð´ï", 4)){
942 switch( o_ptr->tval ){
952 else if (!strncmp(str, "Ëɶñ", 4)){
953 switch( o_ptr->tval ){
967 else if (!strncmp(str, "Ìð", 2)){
968 switch( o_ptr->tval ){
976 else if (!strncmp(str, "ËâË¡¥¢¥¤¥Æ¥à", 12)){
977 switch( o_ptr->tval ){
986 else if (!strncmp(str, "¸÷¸»", 4)){
987 switch( o_ptr->tval ){
993 else if (!strncmp(str, "¤¬¤é¤¯¤¿", 8)){
994 switch( o_ptr->tval ){
1002 else if (!strncmp(str, "ËâË¡½ñ", 6) &&
1003 o_ptr->tval >= TV_LIFE_BOOK) len = 6;
1004 else if (!strncmp(str, "Æß´ï", 4) &&
1005 o_ptr->tval == TV_HAFTED) len = 4;
1006 else if (!strncmp(str, "½â", 2) &&
1007 o_ptr->tval == TV_SHIELD) len = 2;
1008 else if (!strncmp(str, "µÝ", 2) &&
1009 o_ptr->tval == TV_BOW) len = 2;
1010 else if (!strncmp(str, "»ØÎØ", 4) &&
1011 o_ptr->tval == TV_RING) len = 4;
1012 else if (!strncmp(str, "¥¢¥ß¥å¥ì¥Ã¥È", 12) &&
1013 o_ptr->tval == TV_AMULET) len = 12;
1014 else if (!strncmp(str, "³»", 2) &&
1015 (o_ptr->tval == TV_DRAG_ARMOR || o_ptr->tval == TV_HARD_ARMOR ||
1016 o_ptr->tval == TV_SOFT_ARMOR)) len = 2;
1017 else if (!strncmp(str, "¥¯¥í¡¼¥¯", 8) &&
1018 o_ptr->tval == TV_CLOAK) len = 8;
1019 else if (!strncmp(str, "³õ", 2) &&
1020 (o_ptr->tval == TV_CROWN || o_ptr->tval == TV_HELM)) len = 2;
1021 else if (!strncmp(str, "äƼê", 4) &&
1022 o_ptr->tval == TV_GLOVES) len = 4;
1023 else if (!strncmp(str, "·¤", 2) &&
1024 o_ptr->tval == TV_BOOTS) len = 2;
1029 else if (*str == ':')
1031 else if (*str == kanji_colon[0] && *(str+1) == kanji_colon[1])
1036 #define NEXT_WORD(len) (void)(str += len, str += (' '==*str)?1:0)
1038 /*** ¤¹¤Ù¤Æ¤Î... ***/
1039 if (!strncmp(str, "all", 3)) NEXT_WORD(3);
1041 /*** ´û¤Ë»ý¤Ã¤Æ¤¤¤ë¥¢¥¤¥Æ¥à ***/
1042 if (!strncmp(str, "collecting", 10))
1048 /*** ̤´ÕÄê¤Î... ***/
1049 if (!strncmp(str, "unidentified",12) &&
1050 !object_known_p(o_ptr) && !( (o_ptr->ident)&IDENT_SENSE)) NEXT_WORD(12);
1052 /*** ´ÕÄêºÑ¤ß¤Î... ***/
1053 if (!strncmp(str, "identified",10) &&
1054 object_known_p(o_ptr) ) NEXT_WORD(10);
1056 /*** *´ÕÄê*ºÑ¤ß¤Î... ***/
1057 if (!strncmp(str, "*identified*",12) &&
1058 object_known_p(o_ptr) && (o_ptr->ident & IDENT_MENTAL) ) NEXT_WORD(12);
1061 if (!strncmp(str, "nameless", 8)
1062 && (object_known_p(o_ptr)) && !o_ptr->inscription
1063 && (!o_ptr->name1 && !o_ptr->name2 && !o_ptr->art_name))
1065 switch (o_ptr->tval)
1067 case TV_SHOT: case TV_ARROW: case TV_BOLT: case TV_BOW:
1068 case TV_DIGGING: case TV_HAFTED: case TV_POLEARM: case TV_SWORD:
1069 case TV_BOOTS: case TV_GLOVES: case TV_HELM: case TV_CROWN:
1070 case TV_SHIELD: case TV_CLOAK:
1071 case TV_SOFT_ARMOR: case TV_HARD_ARMOR: case TV_DRAG_ARMOR:
1072 case TV_LITE: case TV_AMULET: case TV_RING: case TV_CARD:
1077 /*** ̤ȽÌÀ¤Î... ***/
1078 if (!strncmp(str, "unaware",7) &&
1079 !object_aware_p(o_ptr)) NEXT_WORD(7);
1081 /*** ̵²ÁÃͤÎ... ***/
1082 if (!strncmp(str, "worthless", 9)
1083 && object_value(o_ptr) <= 0) NEXT_WORD(9);
1086 if (o_ptr->tval != TV_BOW && !strncmp(str, "dice boosted", 12))
1088 object_kind *k_ptr = &k_info[o_ptr->k_idx];
1089 if ((o_ptr->dd != k_ptr->dd) || (o_ptr->ds != k_ptr->ds))
1094 if (!strncmp(str, "more than ", 10) &&
1095 !strncmp(str+2+10, " dice ", 6) &&
1096 isdigit(str[10]) && isdigit(str[11]) &&
1097 o_ptr->dd * o_ptr->ds >= (str[10]-'0') * 10 + (str[11]-'0'))
1100 /*** ¾Þ¶â¼ó¤Î»àÂÎ/¹ü ***/
1101 if (!strncmp(str, "wanted", 6) &&
1102 (o_ptr->tval == TV_CORPSE) &&
1103 object_is_shoukinkubi(o_ptr)) NEXT_WORD(6);
1105 /*** ¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î»àÂÎ/¹ü ***/
1106 if (!strncmp(str, "unique monster's", 16) &&
1107 ((o_ptr->tval == TV_CORPSE) || (o_ptr->tval == TV_STATUE)) &&
1108 (r_info[o_ptr->pval].flags1 & RF1_UNIQUE)) NEXT_WORD(16);
1110 /*** ¿Í´Ö¤Î»àÂÎ/¹ü (for Daemon) ***/
1111 if (!strncmp(str, "human", 5) &&
1112 (o_ptr->tval == TV_CORPSE) &&
1113 (strchr("pht", r_info[o_ptr->pval].d_char))) NEXT_WORD(5);
1115 /*** º£¤Î¿¦¶È¤Ç»È¤¨¤Ê¤¤ËâË¡½ñ ***/
1116 if (!strncmp(str, "unreadable", 10) &&
1117 (o_ptr->tval >= TV_LIFE_BOOK) &&
1118 !check_book_realm(o_ptr->tval, o_ptr->sval)) NEXT_WORD(10);
1120 /*** Âè°ìÎΰè¤ÎËâË¡½ñ ***/
1121 if (!strncmp(str, "first realm's", 13) &&
1122 !(p_ptr->pclass == CLASS_SORCERER) &&
1123 !(p_ptr->pclass == CLASS_RED_MAGE) &&
1124 (o_ptr->tval >= TV_LIFE_BOOK) &&
1125 (REALM1_BOOK == o_ptr->tval) ) NEXT_WORD(13);
1127 /*** ÂèÆóÎΰè¤ÎËâË¡½ñ ***/
1128 if (!strncmp(str, "second realm's", 14) &&
1129 !(p_ptr->pclass == CLASS_SORCERER) &&
1130 !(p_ptr->pclass == CLASS_RED_MAGE) &&
1131 (o_ptr->tval >= TV_LIFE_BOOK) &&
1132 (REALM2_BOOK == o_ptr->tval) ) NEXT_WORD(14);
1134 /*** nºýÌܤÎËâË¡½ñ ***/
1135 if (!strncmp(str, "first", 5) &&
1136 (o_ptr->tval >= TV_LIFE_BOOK) &&
1137 (0 == o_ptr->sval) ) NEXT_WORD(5);
1138 if (!strncmp(str, "second", 6) &&
1139 (o_ptr->tval >= TV_LIFE_BOOK) &&
1140 (1 == o_ptr->sval) ) NEXT_WORD(6);
1141 if (!strncmp(str, "third", 5) &&
1142 (o_ptr->tval >= TV_LIFE_BOOK) &&
1143 (2 == o_ptr->sval) ) NEXT_WORD(5);
1144 if (!strncmp(str, "fourth", 6) &&
1145 (o_ptr->tval >= TV_LIFE_BOOK) &&
1146 (3 == o_ptr->sval) ) NEXT_WORD(6);
1148 /*** ¥¢¥¤¥Æ¥à¤Î¥«¥Æ¥´¥ê»ØÄêͽÌó¸ì ***/
1149 if (!strncmp(str, "items",5)) len = 5;
1151 else if (!strncmp(str, "artifacts", 9)){
1152 if (object_known_p(o_ptr)
1153 && (artifact_p(o_ptr) || o_ptr->art_name))
1157 else if (!strncmp(str, "weapons", 7)){
1158 switch( o_ptr->tval ){
1168 else if (!strncmp(str, "armors", 6)){
1169 switch( o_ptr->tval ){
1183 else if (!strncmp(str, "missiles", 8)){
1184 switch( o_ptr->tval ){
1192 else if (!strncmp(str, "magical devices", 15)){
1193 switch( o_ptr->tval ){
1202 else if (!strncmp(str, "lights", 6)){
1203 switch( o_ptr->tval ){
1209 else if (!strncmp(str, "junks", 5)){
1210 switch( o_ptr->tval ){
1218 else if (!strncmp(str, "spellbooks", 10) &&
1219 o_ptr->tval >= TV_LIFE_BOOK) len = 10;
1220 else if (!strncmp(str, "hafted weapons", 14) &&
1221 o_ptr->tval == TV_HAFTED) len = 14;
1222 else if (!strncmp(str, "shields", 7) &&
1223 o_ptr->tval == TV_SHIELD) len = 7;
1224 else if (!strncmp(str, "bows", 4) &&
1225 o_ptr->tval == TV_BOW) len = 4;
1226 else if (!strncmp(str, "rings", 5) &&
1227 o_ptr->tval == TV_RING) len = 5;
1228 else if (!strncmp(str, "amulets", 7) &&
1229 o_ptr->tval == TV_AMULET) len = 7;
1230 else if (!strncmp(str, "suits", 5) &&
1231 (o_ptr->tval == TV_DRAG_ARMOR || o_ptr->tval == TV_HARD_ARMOR ||
1232 o_ptr->tval == TV_SOFT_ARMOR)) len = 5;
1233 else if (!strncmp(str, "cloaks", 6) &&
1234 o_ptr->tval == TV_CLOAK) len = 6;
1235 else if (!strncmp(str, "helms", 5) &&
1236 (o_ptr->tval == TV_CROWN || o_ptr->tval == TV_HELM)) len = 5;
1237 else if (!strncmp(str, "gloves", 6) &&
1238 o_ptr->tval == TV_GLOVES) len = 6;
1239 else if (!strncmp(str, "boots", 5) &&
1240 o_ptr->tval == TV_BOOTS) len = 5;
1245 else if (*str == ':')
1254 if (!strncmp(o_name, str, strlen(str)))
1259 if (strstr_j(o_name, str))
1261 if (strstr(o_name, str))
1272 /* Check if there is a same item */
1273 for (j = 0; j < INVEN_PACK; j++)
1275 if (object_similar(&inventory[j], o_ptr))
1285 static bool is_autopick2( object_type *o_ptr) {
1288 /* No inscription */
1289 if (!o_ptr->inscription) return (FALSE);
1292 s = strchr(quark_str(o_ptr->inscription), '=');
1294 /* Process inscription */
1297 /* Auto-pickup on "=g" */
1298 if (s[1] == 'g') return (TRUE);
1300 /* Find another '=' */
1301 s = strchr(s + 1, '=');
1304 /* Don't auto pickup */
1309 * Automatically destroy items in this grid.
1311 static bool is_opt_confirm_destroy(object_type *o_ptr)
1313 if (!destroy_items) return FALSE;
1315 /* Known to be worthless? */
1317 if (object_value(o_ptr) > 0) return FALSE;
1320 if ((o_ptr->tval >= TV_SHOT) && (o_ptr->tval <= TV_DRAG_ARMOR)) return FALSE;
1323 if ((o_ptr->tval == TV_CHEST) && o_ptr->pval) return FALSE;
1327 if (o_ptr->tval == TV_CORPSE
1328 && object_is_shoukinkubi(o_ptr)) return FALSE;
1332 if (o_ptr->tval == TV_CORPSE) return FALSE;
1335 if ((o_ptr->tval == TV_SKELETON) || (o_ptr->tval == TV_BOTTLE) || (o_ptr->tval == TV_JUNK) || (o_ptr->tval == TV_STATUE)) return FALSE;
1337 if (o_ptr->tval == TV_GOLD) return FALSE;
1343 * Automatically pickup/destroy items in this grid.
1345 static void auto_pickup_items(cave_type *c_ptr)
1347 s16b this_o_idx, next_o_idx = 0;
1348 s16b inscribe_flags(object_type *o_ptr, cptr out_val);
1350 char o_name[MAX_NLEN];
1353 /* Scan the pile of objects */
1354 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1356 /* Acquire object */
1357 object_type *o_ptr = &o_list[this_o_idx];
1359 /* Acquire next object */
1360 next_o_idx = o_ptr->next_o_idx;
1361 idx = is_autopick(o_ptr);
1363 if (idx >= 0 && autopick_insc[idx] && !o_ptr->inscription)
1364 o_ptr->inscription = inscribe_flags(o_ptr, autopick_insc[idx]);
1366 if (is_autopick2(o_ptr) ||
1367 (idx >= 0 && (autopick_action[idx] & DO_AUTOPICK)))
1371 if (!inven_carry_okay(o_ptr)){
1372 /* Describe the object */
1373 object_desc(o_name, o_ptr, TRUE, 3);
1376 msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name);
1378 msg_format("You have no room for %s.", o_name);
1382 py_pickup_aux(this_o_idx);
1387 else if ((idx == -1 && is_opt_confirm_destroy(o_ptr)) ||
1388 (!always_pickup && (idx != -1 && (autopick_action[idx] & DO_AUTODESTROY))))
1391 /* Describe the object (with {terrible/special}) */
1392 object_desc(o_name, o_ptr, TRUE, 3);
1394 if (!can_player_destroy_object(o_ptr))
1398 msg_format("%s¤ÏÇ˲õÉÔǽ¤À¡£", o_name);
1400 msg_format("You cannot auto-destroy %s.", o_name);
1406 /* Destroy the item */
1407 delete_object_idx(this_o_idx);
1409 /* Print a message */
1411 msg_format("%s¤ò¼«Æ°Ç˲õ¤·¤Þ¤¹¡£", o_name);
1413 msg_format("Auto-destroying %s.", o_name);
1423 * Player "wants" to pick up an object or gold.
1424 * Note that we ONLY handle things that can be picked up.
1425 * See "move_player()" for handling of other things.
1427 void carry(int pickup)
1429 cave_type *c_ptr = &cave[py][px];
1431 s16b this_o_idx, next_o_idx = 0;
1433 char o_name[MAX_NLEN];
1435 /* Recenter the map around the player */
1439 p_ptr->update |= (PU_MONSTERS);
1442 p_ptr->redraw |= (PR_MAP);
1445 p_ptr->window |= (PW_OVERHEAD);
1450 /* Automatically pickup/destroy/inscribe items */
1451 auto_pickup_items(c_ptr);
1454 #ifdef ALLOW_EASY_FLOOR
1458 py_pickup_floor(pickup);
1462 #endif /* ALLOW_EASY_FLOOR */
1464 /* Scan the pile of objects */
1465 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1469 /* Acquire object */
1470 o_ptr = &o_list[this_o_idx];
1472 #ifdef ALLOW_EASY_SENSE /* TNB */
1474 /* Option: Make item sensing easy */
1477 /* Sense the object */
1478 (void)sense_object(o_ptr);
1481 #endif /* ALLOW_EASY_SENSE -- TNB */
1483 /* Describe the object */
1484 object_desc(o_name, o_ptr, TRUE, 3);
1486 /* Acquire next object */
1487 next_o_idx = o_ptr->next_o_idx;
1489 /* Hack -- disturb */
1493 if (o_ptr->tval == TV_GOLD)
1495 int value = (long)o_ptr->pval;
1497 /* Delete the gold */
1498 delete_object_idx(this_o_idx);
1502 msg_format(" $%ld ¤Î²ÁÃͤ¬¤¢¤ë%s¤ò¸«¤Ä¤±¤¿¡£",
1503 (long)value, o_name);
1505 msg_format("You collect %ld gold pieces worth of %s.",
1506 (long)value, o_name);
1512 /* Collect the gold */
1516 p_ptr->redraw |= (PR_GOLD);
1519 p_ptr->window |= (PW_PLAYER);
1522 /* Pick up objects */
1525 /* Describe the object */
1530 msg_format("%s¤¬¤¢¤ë¡£", o_name);
1532 msg_format("You see %s.", o_name);
1537 /* Note that the pack is too full */
1538 else if (!inven_carry_okay(o_ptr))
1541 msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name);
1543 msg_format("You have no room for %s.", o_name);
1548 /* Pick up the item (if requested and allowed) */
1553 /* Hack -- query every item */
1554 if (carry_query_flag)
1556 char out_val[MAX_NLEN+20];
1558 sprintf(out_val, "%s¤ò½¦¤¤¤Þ¤¹¤«? ", o_name);
1560 sprintf(out_val, "Pick up %s? ", o_name);
1563 okay = get_check(out_val);
1566 /* Attempt to pick up an object. */
1569 /* Pick up the object */
1570 py_pickup_aux(this_o_idx);
1579 * Determine if a trap affects the player.
1580 * Always miss 5% of the time, Always hit 5% of the time.
1581 * Otherwise, match trap power against player armor.
1583 static int check_hit(int power)
1587 /* Percentile dice */
1590 /* Hack -- 5% hit, 5% miss */
1591 if (k < 10) return (k < 5);
1593 if (p_ptr->pseikaku == SEIKAKU_NAMAKE)
1594 if (one_in_(20)) return (TRUE);
1596 /* Paranoia -- No power */
1597 if (power <= 0) return (FALSE);
1600 ac = p_ptr->ac + p_ptr->to_a;
1602 /* Power competes against Armor */
1603 if (randint1(power) > ((ac * 3) / 4)) return (TRUE);
1612 * Handle player hitting a real trap
1614 static void hit_trap(bool break_trap)
1622 cptr name = "¥È¥é¥Ã¥×";
1624 cptr name = "a trap";
1629 /* Disturb the player */
1632 /* Get the cave grid */
1633 c_ptr = &cave[y][x];
1635 /* Analyze XXX XXX XXX */
1636 switch (c_ptr->feat)
1638 case FEAT_TRAP_TRAPDOOR:
1643 msg_print("Í¸Í¤òÈô¤Ó±Û¤¨¤¿¡£");
1645 msg_print("You fly over a trap door.");
1652 msg_print("Í¸Í¤ËÍî¤Á¤¿¡ª");
1653 if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
1654 msg_print("¤¯¤Ã¤½¡Á¡ª");
1656 msg_print("You have fallen through a trap door!");
1660 dam = damroll(2, 8);
1664 name = "a trap door";
1667 take_hit(DAMAGE_NOESCAPE, dam, name, -1);
1669 /* Still alive and autosave enabled */
1670 if (autosave_l && (p_ptr->chp >= 0))
1671 do_cmd_save_game(TRUE);
1674 do_cmd_write_nikki(NIKKI_STAIR, 1, "Í¸Í¤ËÍî¤Á¤¿");
1676 do_cmd_write_nikki(NIKKI_STAIR, 1, "You have fallen through a trap door!");
1681 p_ptr->leaving = TRUE;
1691 msg_print("Í·ê¤òÈô¤Ó±Û¤¨¤¿¡£");
1693 msg_print("You fly over a pit trap.");
1700 msg_print("Í·ê¤ËÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª");
1702 msg_print("You have fallen into a pit!");
1705 dam = damroll(2, 6);
1709 name = "a pit trap";
1712 take_hit(DAMAGE_NOESCAPE, dam, name, -1);
1717 case FEAT_TRAP_SPIKED_PIT:
1722 msg_print("¥È¥²¤Î¤¢¤ëÍ·ê¤òÈô¤Ó±Û¤¨¤¿¡£");
1724 msg_print("You fly over a spiked pit.");
1731 msg_print("¥¹¥Ñ¥¤¥¯¤¬Éߤ«¤ì¤¿Í·ê¤ËÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª");
1733 msg_print("You fall into a spiked pit!");
1741 name = "a pit trap";
1744 dam = damroll(2, 6);
1746 /* Extra spike damage */
1747 if (randint0(100) < 50)
1750 msg_print("¥¹¥Ñ¥¤¥¯¤¬»É¤µ¤Ã¤¿¡ª");
1752 msg_print("You are impaled!");
1757 name = "¥È¥²¤Î¤¢¤ëÍ·ê";
1759 name = "a spiked pit";
1763 (void)set_cut(p_ptr->cut + randint1(dam));
1766 /* Take the damage */
1767 take_hit(DAMAGE_NOESCAPE, dam, name, -1);
1772 case FEAT_TRAP_POISON_PIT:
1777 msg_print("¥È¥²¤Î¤¢¤ëÍ·ê¤òÈô¤Ó±Û¤¨¤¿¡£");
1779 msg_print("You fly over a spiked pit.");
1786 msg_print("¥¹¥Ñ¥¤¥¯¤¬Éߤ«¤ì¤¿Í·ê¤ËÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª");
1788 msg_print("You fall into a spiked pit!");
1793 dam = damroll(2, 6);
1798 name = "a pit trap";
1802 /* Extra spike damage */
1803 if (randint0(100) < 50)
1806 msg_print("ÆǤòÅɤé¤ì¤¿¥¹¥Ñ¥¤¥¯¤¬»É¤µ¤Ã¤¿¡ª");
1808 msg_print("You are impaled on poisonous spikes!");
1813 name = "¥È¥²¤Î¤¢¤ëÍ·ê";
1815 name = "a spiked pit";
1820 (void)set_cut(p_ptr->cut + randint1(dam));
1822 if (p_ptr->resist_pois || p_ptr->oppose_pois)
1825 msg_print("¤·¤«¤·ÆǤαƶÁ¤Ï¤Ê¤«¤Ã¤¿¡ª");
1827 msg_print("The poison does not affect you!");
1835 (void)set_poisoned(p_ptr->poisoned + randint1(dam));
1839 /* Take the damage */
1840 take_hit(DAMAGE_NOESCAPE, dam, name, -1);
1846 case FEAT_TRAP_TY_CURSE:
1849 msg_print("²¿¤«¤¬¥Ô¥«¥Ã¤È¸÷¤Ã¤¿¡ª");
1851 msg_print("There is a flash of shimmering light!");
1854 c_ptr->info &= ~(CAVE_MARK);
1855 cave_set_feat(y, x, floor_type[randint0(100)]);
1856 num = 2 + randint1(3);
1857 for (i = 0; i < num; i++)
1859 (void)summon_specific(0, y, x, dun_level, 0, TRUE, FALSE, FALSE, TRUE, TRUE);
1862 if (dun_level > randint1(100)) /* No nasty effect for low levels */
1864 bool stop_ty = FALSE;
1869 stop_ty = activate_ty_curse(stop_ty, &count);
1876 case FEAT_TRAP_TELEPORT:
1879 msg_print("¥Æ¥ì¥Ý¡¼¥È¡¦¥È¥é¥Ã¥×¤Ë¤Ò¤Ã¤«¤«¤Ã¤¿¡ª");
1881 msg_print("You hit a teleport trap!");
1884 teleport_player(100);
1888 case FEAT_TRAP_FIRE:
1891 msg_print("±ê¤ËÊñ¤Þ¤ì¤¿¡ª");
1893 msg_print("You are enveloped in flames!");
1896 dam = damroll(4, 6);
1898 fire_dam(dam, "±ê¤Î¥È¥é¥Ã¥×", -1);
1900 fire_dam(dam, "a fire trap", -1);
1906 case FEAT_TRAP_ACID:
1909 msg_print("»À¤¬¿á¤¤«¤±¤é¤ì¤¿¡ª");
1911 msg_print("You are splashed with acid!");
1914 dam = damroll(4, 6);
1916 acid_dam(dam, "»À¤Î¥È¥é¥Ã¥×", -1);
1918 acid_dam(dam, "an acid trap", -1);
1924 case FEAT_TRAP_SLOW:
1929 msg_print("¾®¤µ¤Ê¥À¡¼¥Ä¤¬Èô¤ó¤Ç¤¤Æ»É¤µ¤Ã¤¿¡ª");
1931 msg_print("A small dart hits you!");
1934 dam = damroll(1, 4);
1935 take_hit(DAMAGE_ATTACK, dam, name, -1);
1936 (void)set_slow(p_ptr->slow + randint0(20) + 20, FALSE);
1941 msg_print("¾®¤µ¤Ê¥À¡¼¥Ä¤¬Èô¤ó¤Ç¤¤¿¡ª¤¬¡¢±¿Îɤ¯Åö¤¿¤é¤Ê¤«¤Ã¤¿¡£");
1943 msg_print("A small dart barely misses you.");
1950 case FEAT_TRAP_LOSE_STR:
1955 msg_print("¾®¤µ¤Ê¥À¡¼¥Ä¤¬Èô¤ó¤Ç¤¤Æ»É¤µ¤Ã¤¿¡ª");
1957 msg_print("A small dart hits you!");
1960 dam = damroll(1, 4);
1962 take_hit(DAMAGE_ATTACK, dam, "¥À¡¼¥Ä¤Îæ«", -1);
1964 take_hit(DAMAGE_ATTACK, dam, "a dart trap", -1);
1967 (void)do_dec_stat(A_STR);
1972 msg_print("¾®¤µ¤Ê¥À¡¼¥Ä¤¬Èô¤ó¤Ç¤¤¿¡ª¤¬¡¢±¿Îɤ¯Åö¤¿¤é¤Ê¤«¤Ã¤¿¡£");
1974 msg_print("A small dart barely misses you.");
1981 case FEAT_TRAP_LOSE_DEX:
1986 msg_print("¾®¤µ¤Ê¥À¡¼¥Ä¤¬Èô¤ó¤Ç¤¤Æ»É¤µ¤Ã¤¿¡ª");
1988 msg_print("A small dart hits you!");
1991 dam = damroll(1, 4);
1993 take_hit(DAMAGE_ATTACK, dam, "¥À¡¼¥Ä¤Îæ«", -1);
1995 take_hit(DAMAGE_ATTACK, dam, "a dart trap", -1);
1998 (void)do_dec_stat(A_DEX);
2003 msg_print("¾®¤µ¤Ê¥À¡¼¥Ä¤¬Èô¤ó¤Ç¤¤¿¡ª¤¬¡¢±¿Îɤ¯Åö¤¿¤é¤Ê¤«¤Ã¤¿¡£");
2005 msg_print("A small dart barely misses you.");
2012 case FEAT_TRAP_LOSE_CON:
2017 msg_print("¾®¤µ¤Ê¥À¡¼¥Ä¤¬Èô¤ó¤Ç¤¤Æ»É¤µ¤Ã¤¿¡ª");
2019 msg_print("A small dart hits you!");
2022 dam = damroll(1, 4);
2024 take_hit(DAMAGE_ATTACK, dam, "¥À¡¼¥Ä¤Îæ«", -1);
2026 take_hit(DAMAGE_ATTACK, dam, "a dart trap", -1);
2029 (void)do_dec_stat(A_CON);
2034 msg_print("¾®¤µ¤Ê¥À¡¼¥Ä¤¬Èô¤ó¤Ç¤¤¿¡ª¤¬¡¢±¿Îɤ¯Åö¤¿¤é¤Ê¤«¤Ã¤¿¡£");
2036 msg_print("A small dart barely misses you.");
2043 case FEAT_TRAP_BLIND:
2046 msg_print("¹õ¤¤¥¬¥¹¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡ª");
2048 msg_print("A black gas surrounds you!");
2051 if (!p_ptr->resist_blind)
2053 (void)set_blind(p_ptr->blind + randint0(50) + 25);
2058 case FEAT_TRAP_CONFUSE:
2061 msg_print("¤¤é¤á¤¯¥¬¥¹¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡ª");
2063 msg_print("A gas of scintillating colors surrounds you!");
2066 if (!p_ptr->resist_conf)
2068 (void)set_confused(p_ptr->confused + randint0(20) + 10);
2073 case FEAT_TRAP_POISON:
2076 msg_print("»É·ãŪ¤ÊÎп§¤Î¥¬¥¹¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡ª");
2078 msg_print("A pungent green gas surrounds you!");
2081 if (!p_ptr->resist_pois && !p_ptr->oppose_pois)
2083 (void)set_poisoned(p_ptr->poisoned + randint0(20) + 10);
2088 case FEAT_TRAP_SLEEP:
2091 msg_print("´ñ̯¤ÊÇò¤¤Ì¸¤ËÊñ¤Þ¤ì¤¿¡ª");
2093 msg_print("A strange white mist surrounds you!");
2096 if (!p_ptr->free_act)
2099 msg_print("¤¢¤Ê¤¿¤Ï̲¤ê¤Ë½¢¤¤¤¿¡£");
2101 msg_print("You fall asleep.");
2105 if (ironman_nightmare)
2108 msg_print("¿È¤ÎÌÓ¤â¤è¤À¤Ä¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤À¡£");
2110 msg_print("A horrible vision enters your mind.");
2114 /* Pick a nightmare */
2115 get_mon_num_prep(get_nightmare, NULL);
2117 /* Have some nightmares */
2118 have_nightmare(get_mon_num(MAX_DEPTH));
2120 /* Remove the monster restriction */
2121 get_mon_num_prep(NULL, NULL);
2123 (void)set_paralyzed(p_ptr->paralyzed + randint0(10) + 5);
2128 case FEAT_TRAP_TRAPS:
2131 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
2133 msg_print("There is a bright flash of light!");
2137 /* Destroy this trap */
2138 cave_set_feat(y, x, floor_type[randint0(100)]);
2140 /* Make some new traps */
2141 project(0, 1, y, x, 0, GF_MAKE_TRAP, PROJECT_HIDE | PROJECT_JUMP | PROJECT_GRID, -1);
2146 case FEAT_TRAP_ALARM:
2149 msg_print("¤±¤¿¤¿¤Þ¤·¤¤²»¤¬ÌĤê¶Á¤¤¤¿¡ª");
2151 msg_print("An alarm sounds!");
2154 aggravate_monsters(0);
2159 if (break_trap && is_trap(c_ptr->feat))
2161 cave_set_feat(y, x, floor_type[randint0(100)]);
2163 msg_print("¥È¥é¥Ã¥×¤òÊ´ºÕ¤·¤¿¡£");
2165 msg_print("You destroyed the trap.");
2171 void touch_zap_player(monster_type *m_ptr)
2173 int aura_damage = 0;
2174 monster_race *r_ptr = &r_info[m_ptr->r_idx];
2176 if (r_ptr->flags2 & RF2_AURA_FIRE)
2178 if (!p_ptr->immune_fire)
2182 aura_damage = damroll(1 + (r_ptr->level / 26), 1 + (r_ptr->level / 17));
2184 /* Hack -- Get the "died from" name */
2185 monster_desc(aura_dam, m_ptr, 0x288);
2188 msg_print("ÆÍÁ³¤È¤Æ¤âÇ®¤¯¤Ê¤Ã¤¿¡ª");
2190 msg_print("You are suddenly very hot!");
2194 if (p_ptr->oppose_fire) aura_damage = (aura_damage + 2) / 3;
2195 if (p_ptr->resist_fire) aura_damage = (aura_damage + 2) / 3;
2197 take_hit(DAMAGE_NOESCAPE, aura_damage, aura_dam, -1);
2198 r_ptr->r_flags2 |= RF2_AURA_FIRE;
2203 if (r_ptr->flags3 & RF3_AURA_COLD)
2205 if (!p_ptr->immune_cold)
2209 aura_damage = damroll(1 + (r_ptr->level / 26), 1 + (r_ptr->level / 17));
2211 /* Hack -- Get the "died from" name */
2212 monster_desc(aura_dam, m_ptr, 0x288);
2215 msg_print("ÆÍÁ³¤È¤Æ¤â´¨¤¯¤Ê¤Ã¤¿¡ª");
2217 msg_print("You are suddenly very cold!");
2221 if (p_ptr->oppose_cold) aura_damage = (aura_damage + 2) / 3;
2222 if (p_ptr->resist_cold) aura_damage = (aura_damage + 2) / 3;
2224 take_hit(DAMAGE_NOESCAPE, aura_damage, aura_dam, -1);
2225 r_ptr->r_flags3 |= RF3_AURA_COLD;
2230 if (r_ptr->flags2 & RF2_AURA_ELEC)
2232 if (!p_ptr->immune_elec)
2236 aura_damage = damroll(1 + (r_ptr->level / 26), 1 + (r_ptr->level / 17));
2238 /* Hack -- Get the "died from" name */
2239 monster_desc(aura_dam, m_ptr, 0x288);
2241 if (p_ptr->oppose_elec) aura_damage = (aura_damage + 2) / 3;
2242 if (p_ptr->resist_elec) aura_damage = (aura_damage + 2) / 3;
2245 msg_print("ÅÅ·â¤ò¤¯¤é¤Ã¤¿¡ª");
2247 msg_print("You get zapped!");
2250 take_hit(DAMAGE_NOESCAPE, aura_damage, aura_dam, -1);
2251 r_ptr->r_flags2 |= RF2_AURA_ELEC;
2258 static void natural_attack(s16b m_idx, int attack, bool *fear, bool *mdeath)
2260 int k, bonus, chance;
2262 monster_type *m_ptr = &m_list[m_idx];
2263 monster_race *r_ptr = &r_info[m_ptr->r_idx];
2272 case MUT2_SCOR_TAIL:
2299 atk_desc = "¥¯¥Á¥Ð¥·";
2310 atk_desc = "¾Ý¤ÎÉ¡";
2316 case MUT2_TENTACLES:
2323 atk_desc = "tentacles";
2328 dss = ddd = n_weight = 1;
2330 atk_desc = "̤ÄêµÁ¤ÎÉô°Ì";
2332 atk_desc = "undefined body part";
2337 /* Extract monster name (or "it") */
2338 monster_desc(m_name, m_ptr, 0);
2341 /* Calculate the "attack quality" */
2342 bonus = p_ptr->to_h_m;
2343 bonus += (p_ptr->lev * 6 / 5);
2344 chance = (p_ptr->skill_thn + (bonus * BTH_PLUS_ADJ));
2347 if ((!(r_ptr->flags2 & RF2_QUANTUM) || !randint0(2)) && test_hit_norm(chance, r_ptr->ac, m_ptr->ml))
2353 msg_format("%s¤ò%s¤Ç¹¶·â¤·¤¿¡£", m_name, atk_desc);
2355 msg_format("You hit %s with your %s.", m_name, atk_desc);
2359 k = damroll(ddd, dss);
2360 k = critical_norm(n_weight, bonus, k, (s16b)bonus, 0);
2362 /* Apply the player damage bonuses */
2365 /* No negative damage */
2368 /* Modify the damage */
2369 k = mon_damage_mod(m_ptr, k, FALSE);
2371 /* Complex message */
2375 msg_format("%d/%d ¤Î¥À¥á¡¼¥¸¤òÍ¿¤¨¤¿¡£", k, m_ptr->hp);
2377 msg_format("You do %d (out of %d) damage.", k, m_ptr->hp);
2382 /* Anger the monster */
2383 if (k > 0) anger_monster(m_ptr);
2385 /* Damage, check for fear and mdeath */
2388 case MUT2_SCOR_TAIL:
2389 project(0, 0, m_ptr->fy, m_ptr->fx, k, GF_POIS, PROJECT_KILL | PROJECT_NO_REF, -1);
2390 *mdeath = (m_ptr->r_idx == 0);
2393 *mdeath = mon_take_hit(m_idx, k, fear, NULL);
2396 *mdeath = mon_take_hit(m_idx, k, fear, NULL);
2399 *mdeath = mon_take_hit(m_idx, k, fear, NULL);
2401 case MUT2_TENTACLES:
2402 *mdeath = mon_take_hit(m_idx, k, fear, NULL);
2405 *mdeath = mon_take_hit(m_idx, k, fear, NULL);
2408 touch_zap_player(m_ptr);
2418 msg_format("¥ß¥¹¡ª %s¤Ë¤«¤ï¤µ¤ì¤¿¡£", m_name);
2420 msg_format("You miss %s.", m_name);
2429 * Player attacks a (poor, defenseless) creature -RAK-
2431 * If no "weapon" is available, then "punch" the monster one time.
2433 static void py_attack_aux(int y, int x, bool *fear, bool *mdeath, s16b hand, int mode)
2435 int num = 0, k, bonus, chance, vir;
2437 cave_type *c_ptr = &cave[y][x];
2439 monster_type *m_ptr = &m_list[c_ptr->m_idx];
2440 monster_race *r_ptr = &r_info[m_ptr->r_idx];
2446 bool success_hit = FALSE;
2447 bool old_success_hit = FALSE;
2448 bool backstab = FALSE;
2449 bool vorpal_cut = FALSE;
2450 int chaos_effect = 0;
2451 bool stab_fleeing = FALSE;
2452 bool fuiuchi = FALSE;
2453 bool do_quake = FALSE;
2455 bool drain_msg = TRUE;
2456 int drain_result = 0, drain_heal = 0;
2457 bool can_drain = FALSE;
2459 int drain_left = MAX_VAMPIRIC_DRAIN;
2460 u32b f1, f2, f3; /* A massive hack -- life-draining weapons */
2461 bool is_human = (r_ptr->d_char == 'p');
2462 bool is_lowlevel = (r_ptr->level < (p_ptr->lev - 15));
2463 bool zantetsu_mukou, e_j_mukou;
2467 if (((p_ptr->pclass == CLASS_ROGUE) || (p_ptr->pclass == CLASS_NINJA)) && inventory[INVEN_RARM+hand].tval)
2469 int tmp = p_ptr->lev*6+(p_ptr->skill_stl+10)*4;
2470 if (p_ptr->monlite && (mode != HISSATSU_NYUSIN)) tmp /= 3;
2471 if (p_ptr->cursed & TRC_AGGRAVATE) tmp /= 2;
2472 if (r_ptr->level > (p_ptr->lev*p_ptr->lev/20+10)) tmp /= 3;
2473 if (m_ptr->csleep && m_ptr->ml)
2475 /* Can't backstab creatures that we can't see, right? */
2478 else if ((p_ptr->special_defense & NINJA_S_STEALTH) && (randint0(tmp) > (r_ptr->level+20)) && m_ptr->ml && !(r_ptr->flags3 & RF3_RES_ALL))
2482 else if (m_ptr->monfear && m_ptr->ml)
2484 stab_fleeing = TRUE;
2488 if(!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
2490 if ((r_ptr->level + 10) > p_ptr->lev)
2492 if (skill_exp[GINOU_SUDE] < s_info[p_ptr->pclass].s_max[GINOU_SUDE])
2494 if (skill_exp[GINOU_SUDE] < 4000)
2495 skill_exp[GINOU_SUDE]+=40;
2496 else if((skill_exp[GINOU_SUDE] < 6000))
2497 skill_exp[GINOU_SUDE]+=5;
2498 else if((skill_exp[GINOU_SUDE] < 7000) && (p_ptr->lev > 19))
2499 skill_exp[GINOU_SUDE]+=1;
2500 else if((skill_exp[GINOU_SUDE] < 8000) && (p_ptr->lev > 34))
2501 if (one_in_(3)) skill_exp[GINOU_SUDE]+=1;
2502 p_ptr->update |= (PU_BONUS);
2508 if ((r_ptr->level + 10) > p_ptr->lev)
2510 int tval = inventory[INVEN_RARM+hand].tval - TV_BOW;
2511 int sval = inventory[INVEN_RARM+hand].sval;
2512 int now_exp = weapon_exp[tval][sval];
2513 if (now_exp < s_info[p_ptr->pclass].w_max[tval][sval])
2516 if (now_exp < 4000) amount = 80;
2517 else if(now_exp < 6000) amount = 10;
2518 else if((now_exp < 7000) && (p_ptr->lev > 19)) amount = 1;
2519 else if((p_ptr->lev > 34) && one_in_(2)) amount = 1;
2520 weapon_exp[tval][sval] += amount;
2521 p_ptr->update |= (PU_BONUS);
2526 /* Disturb the monster */
2528 if (r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2))
2529 p_ptr->update |= (PU_MON_LITE);
2531 /* Extract monster name (or "it") */
2532 monster_desc(m_name, m_ptr, 0);
2534 /* Access the weapon */
2535 o_ptr = &inventory[INVEN_RARM+hand];
2537 /* Calculate the "attack quality" */
2538 bonus = p_ptr->to_h[hand] + o_ptr->to_h;
2539 chance = (p_ptr->skill_thn + (bonus * BTH_PLUS_ADJ));
2540 if (mode == HISSATSU_IAI) chance += 60;
2541 if (p_ptr->special_defense & KATA_KOUKIJIN) chance += 150;
2543 if (p_ptr->sutemi) chance = MAX(chance * 3 / 2, chance + 60);
2545 vir = virtue_number(V_VALOUR);
2548 chance += (p_ptr->virtues[vir - 1]/10);
2551 zantetsu_mukou = ((o_ptr->name1 == ART_ZANTETSU) && (r_ptr->d_char == 'j'));
2552 e_j_mukou = ((o_ptr->name1 == ART_EXCALIBUR_J) && (r_ptr->d_char == 'S'));
2554 if ((mode == HISSATSU_KYUSHO) || (mode == HISSATSU_MINEUCHI) || (mode == HISSATSU_3DAN) || (mode == HISSATSU_IAI)) num_blow = 1;
2555 else if (mode == HISSATSU_COLD) num_blow = p_ptr->num_blow[hand]+2;
2556 else num_blow = p_ptr->num_blow[hand];
2558 /* Attack once for each legal blow */
2559 while ((num++ < num_blow) && !death)
2561 if (((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI)) || (mode == HISSATSU_KYUSHO))
2563 if (p_ptr->migite && p_ptr->hidarite)
2565 success_hit = one_in_(2);
2567 else success_hit = TRUE;
2569 else if (mode == HISSATSU_MAJIN)
2574 success_hit = FALSE;
2575 old_success_hit = success_hit;
2577 else success_hit = old_success_hit;
2579 else if ((p_ptr->pclass == CLASS_NINJA) && ((backstab || fuiuchi) && !(r_ptr->flags3 & RF3_RES_ALL))) success_hit = TRUE;
2580 else success_hit = test_hit_norm(chance, r_ptr->ac, m_ptr->ml);
2591 msg_format("¤¢¤Ê¤¿¤ÏÎä¹ó¤Ë¤â̲¤Ã¤Æ¤¤¤ë̵ÎϤÊ%s¤òÆͤ»É¤·¤¿¡ª",
2593 msg_format("You cruelly stab the helpless, sleeping %s!",
2599 msg_format("ÉÔ°Õ¤òÆͤ¤¤Æ%s¤Ë¶¯Îõ¤Ê°ì·â¤ò¶ô¤é¤ï¤»¤¿¡ª",
2601 msg_format("You make surprise attack, and hit %s with a powerful blow!",
2605 else if (stab_fleeing)
2607 msg_format("ƨ¤²¤ë%s¤òÇØÃ椫¤éÆͤ»É¤·¤¿¡ª",
2609 msg_format("You backstab the fleeing %s!",
2615 if (!(((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(TRUE) > 1)))
2617 msg_format("%s¤ò¹¶·â¤·¤¿¡£", m_name);
2619 msg_format("You hit %s.", m_name);
2624 /* Hack -- bare hands do one damage */
2627 object_flags(o_ptr, &f1, &f2, &f3);
2629 /* Select a chaotic effect (50% chance) */
2630 if ((f1 & TR1_CHAOTIC) && one_in_(2))
2633 chg_virtue(V_CHANCE, 1);
2635 if (randint1(5) < 3)
2637 /* Vampiric (20%) */
2640 else if (one_in_(250))
2645 else if (!one_in_(10))
2647 /* Confusion (26.892%) */
2650 else if (one_in_(2))
2652 /* Teleport away (1.494%) */
2657 /* Polymorph (1.494%) */
2662 /* Vampiric drain */
2663 if ((f1 & TR1_VAMPIRIC) || (chaos_effect == 1) || (mode == HISSATSU_DRAIN))
2665 /* Only drain "living" monsters */
2666 if (monster_living(r_ptr))
2672 if ((f1 & TR1_VORPAL) && (randint1((o_ptr->name1 == ART_VORPAL_BLADE) ? 3 : 6) == 1) && !zantetsu_mukou)
2674 else vorpal_cut = FALSE;
2676 if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_BERSERKER)) && (empty_hands(TRUE) > 1))
2678 int special_effect = 0, stun_effect = 0, times = 0, max_times;
2680 martial_arts *ma_ptr = &ma_blows[0], *old_ptr = &ma_blows[0];
2681 int resist_stun = 0;
2684 if (r_ptr->flags1 & RF1_UNIQUE) resist_stun += 88;
2685 if (r_ptr->flags3 & RF3_NO_STUN) resist_stun += 66;
2686 if (r_ptr->flags3 & RF3_NO_CONF) resist_stun += 33;
2687 if (r_ptr->flags3 & RF3_NO_SLEEP) resist_stun += 33;
2688 if ((r_ptr->flags3 & RF3_UNDEAD) || (r_ptr->flags3 & RF3_NONLIVING))
2691 if (p_ptr->special_defense & KAMAE_BYAKKO)
2692 max_times = (p_ptr->lev < 3 ? 1 : p_ptr->lev / 3);
2693 else if (p_ptr->special_defense & KAMAE_SUZAKU)
2695 else if (p_ptr->special_defense & KAMAE_GENBU)
2698 max_times = (p_ptr->lev < 7 ? 1 : p_ptr->lev / 7);
2699 /* Attempt 'times' */
2700 for (times = 0; times < max_times; times++)
2704 ma_ptr = &ma_blows[randint0(MAX_MA)];
2705 if ((p_ptr->pclass == CLASS_FORCETRAINER) && (ma_ptr->min_level > 1)) min_level = ma_ptr->min_level + 3;
2706 else min_level = ma_ptr->min_level;
2708 while ((min_level > p_ptr->lev) ||
2709 (randint1(p_ptr->lev) < ma_ptr->chance));
2711 /* keep the highest level attack available we found */
2712 if ((ma_ptr->min_level > old_ptr->min_level) &&
2713 !p_ptr->stun && !p_ptr->confused)
2717 if (wizard && cheat_xtra)
2720 msg_print("¹¶·â¤òºÆÁªÂò¤·¤Þ¤·¤¿¡£");
2722 msg_print("Attack re-selected.");
2733 if (p_ptr->pclass == CLASS_FORCETRAINER) min_level = MAX(1, ma_ptr->min_level - 3);
2734 else min_level = ma_ptr->min_level;
2735 k = damroll(ma_ptr->dd, ma_ptr->ds);
2736 if (p_ptr->special_attack & ATTACK_SUIKEN) k *= 2;
2738 if (ma_ptr->effect == MA_KNEE)
2740 if (r_ptr->flags1 & RF1_MALE)
2743 msg_format("%s¤Ë¶âŪɨ½³¤ê¤ò¤¯¤é¤ï¤·¤¿¡ª", m_name);
2745 msg_format("You hit %s in the groin with your knee!", m_name);
2749 special_effect = MA_KNEE;
2752 msg_format(ma_ptr->desc, m_name);
2755 else if (ma_ptr->effect == MA_SLOW)
2757 if (!((r_ptr->flags1 & RF1_NEVER_MOVE) ||
2758 strchr("~#{}.UjmeEv$,DdsbBFIJQSXclnw!=?", r_ptr->d_char)))
2761 msg_format("%s¤Î¼ó¤Ë´ØÀá½³¤ê¤ò¤¯¤é¤ï¤·¤¿¡ª", m_name);
2763 msg_format("You kick %s in the ankle.", m_name);
2766 special_effect = MA_SLOW;
2768 else msg_format(ma_ptr->desc, m_name);
2774 stun_effect = (ma_ptr->effect / 2) + randint1(ma_ptr->effect / 2);
2777 msg_format(ma_ptr->desc, m_name);
2780 if (p_ptr->special_defense & KAMAE_SUZAKU) weight = 4;
2781 if ((p_ptr->pclass == CLASS_FORCETRAINER) && (p_ptr->magic_num1[0]))
2783 weight += (p_ptr->magic_num1[0]/30);
2784 if (weight > 20) weight = 20;
2787 k = critical_norm(p_ptr->lev * weight, min_level, k, p_ptr->to_h[0], 0);
2789 if ((special_effect == MA_KNEE) && ((k + p_ptr->to_d[hand]) < m_ptr->hp))
2792 msg_format("%^s¤Ï¶ìÄˤˤ¦¤á¤¤¤Æ¤¤¤ë¡ª", m_name);
2794 msg_format("%^s moans in agony!", m_name);
2797 stun_effect = 7 + randint1(13);
2801 else if ((special_effect == MA_SLOW) && ((k + p_ptr->to_d[hand]) < m_ptr->hp))
2803 if (!(r_ptr->flags1 & RF1_UNIQUE) &&
2804 (randint1(p_ptr->lev) > r_ptr->level) &&
2808 msg_format("%^s¤Ï¤ò¤Ò¤¤º¤ê»Ï¤á¤¿¡£", m_name);
2810 msg_format("%^s starts limping slower.", m_name);
2813 m_ptr->mspeed -= 10;
2817 if (stun_effect && ((k + p_ptr->to_d[hand]) < m_ptr->hp))
2819 if (p_ptr->lev > randint1(r_ptr->level + resist_stun + 10))
2823 msg_format("%^s¤Ï¤µ¤é¤Ë¥Õ¥é¥Õ¥é¤Ë¤Ê¤Ã¤¿¡£", m_name);
2825 msg_format("%^s is more stunned.", m_name);
2830 msg_format("%^s¤Ï¥Õ¥é¥Õ¥é¤Ë¤Ê¤Ã¤¿¡£", m_name);
2832 msg_format("%^s is stunned.", m_name);
2836 m_ptr->stunned += stun_effect;
2841 /* Handle normal weapon */
2842 else if (o_ptr->k_idx)
2844 k = damroll(o_ptr->dd, o_ptr->ds);
2847 if((o_ptr->tval == TV_POLEARM) && ((o_ptr->sval == SV_LANCE) || (o_ptr->sval == SV_HEAVY_LANCE)))
2849 k += damroll(2, o_ptr->ds);
2853 k = tot_dam_aux(o_ptr, k, m_ptr, mode);
2857 k *= (3 + (p_ptr->lev / 20));
2861 k = k*(5+(p_ptr->lev*2/25))/2;
2863 else if (stab_fleeing)
2868 if ((p_ptr->impact[hand] && ((k > 50) || one_in_(7))) ||
2869 (chaos_effect == 2) || (mode == HISSATSU_QUAKE))
2874 if ((!(o_ptr->tval == TV_SWORD) || !(o_ptr->sval == SV_DOKUBARI)) && !(mode == HISSATSU_KYUSHO))
2875 k = critical_norm(o_ptr->weight, o_ptr->to_h, k, p_ptr->to_h[hand], mode);
2883 int inc_chance = (o_ptr->name1 == ART_VORPAL_BLADE) ? 2 : 4;
2885 if ((o_ptr->name1 == ART_CHAINSWORD) && !one_in_(2))
2887 char chainsword_noise[1024];
2889 if (!get_rnd_line("chainswd_j.txt", 0, chainsword_noise))
2891 if (!get_rnd_line("chainswd.txt", 0, chainsword_noise))
2895 msg_print(chainsword_noise);
2899 if (o_ptr->name1 == ART_VORPAL_BLADE)
2902 msg_print("Ìܤˤâ»ß¤Þ¤é¤Ì¥Ü¡¼¥Ñ¥ë¡¦¥Ö¥ì¡¼¥É¡¢¼êÏ£¤ÎÁá¶È¡ª");
2904 msg_print("Your Vorpal Blade goes snicker-snack!");
2911 msg_format("%s¤ò¥°¥Ã¥µ¥êÀÚ¤êÎö¤¤¤¿¡ª", m_name);
2913 msg_format("Your weapon cuts deep into %s!", m_name);
2918 /* Try to increase the damage */
2919 while (one_in_(inc_chance))
2927 if (((r_ptr->flags3 & RF3_RES_ALL) ? k/100 : k) > m_ptr->hp)
2930 msg_format("%s¤ò¿¿¤ÃÆó¤Ä¤Ë¤·¤¿¡ª", m_name);
2932 msg_format("You cut %s in half!", m_name);
2941 case 2: msg_format("%s¤ò»Â¤Ã¤¿¡ª", m_name); break;
2943 case 2: msg_format("You gouge %s!", m_name); break;
2947 case 3: msg_format("%s¤ò¤Ö¤Ã¤¿»Â¤Ã¤¿¡ª", m_name); break;
2949 case 3: msg_format("You maim %s!", m_name); break;
2953 case 4: msg_format("%s¤ò¥á¥Ã¥¿»Â¤ê¤Ë¤·¤¿¡ª", m_name); break;
2955 case 4: msg_format("You carve %s!", m_name); break;
2959 case 5: msg_format("%s¤ò¥á¥Ã¥¿¥á¥¿¤Ë»Â¤Ã¤¿¡ª", m_name); break;
2961 case 5: msg_format("You cleave %s!", m_name); break;
2965 case 6: msg_format("%s¤ò»É¿È¤Ë¤·¤¿¡ª", m_name); break;
2967 case 6: msg_format("You smite %s!", m_name); break;
2971 case 7: msg_format("%s¤ò»Â¤Ã¤Æ»Â¤Ã¤Æ»Â¤ê¤Þ¤¯¤Ã¤¿¡ª", m_name); break;
2973 case 7: msg_format("You eviscerate %s!", m_name); break;
2977 default: msg_format("%s¤òºÙÀÚ¤ì¤Ë¤·¤¿¡ª", m_name); break;
2979 default: msg_format("You shred %s!", m_name); break;
2984 drain_result = drain_result * 3 / 2;
2988 drain_result += o_ptr->to_d;
2991 /* Apply the player damage bonuses */
2992 k += p_ptr->to_d[hand];
2993 drain_result += p_ptr->to_d[hand];
2995 if ((mode == HISSATSU_SUTEMI) || (mode == HISSATSU_3DAN)) k *= 2;
2996 if ((mode == HISSATSU_SEKIRYUKA) && (r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON | RF3_NONLIVING))) k = 0;
2997 if ((mode == HISSATSU_SEKIRYUKA) && !p_ptr->cut) k /= 2;
2999 /* No negative damage */
3002 if ((mode == HISSATSU_ZANMA) && !((r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) && (r_ptr->flags3 & RF3_EVIL)))
3010 msg_print("¤³¤ó¤ÊÆð¤é¤«¤¤¤â¤Î¤ÏÀÚ¤ì¤ó¡ª");
3012 msg_print("You cannot cut such a elastic thing!");
3020 msg_print("ÃØéá¤Ï¶ì¼ê¤À¡ª");
3022 msg_print("Spiders are difficult for you to deal with!");
3027 if (mode == HISSATSU_MINEUCHI)
3029 int tmp = (10 + randint1(15) + p_ptr->lev / 5);
3032 anger_monster(m_ptr);
3034 if (!(r_ptr->flags3 & (RF3_NO_STUN)))
3040 msg_format("%s¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£", m_name);
3042 msg_format("%s is more dazed.", m_name);
3050 msg_format("%s ¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£", m_name);
3052 msg_format("%s is dazed.", m_name);
3057 m_ptr->stunned = (tmp < 200) ? tmp : 200;
3062 msg_format("%s ¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
3064 msg_format("%s is not effected.", m_name);
3069 /* Modify the damage */
3070 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))));
3071 if (((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI)) || (mode == HISSATSU_KYUSHO))
3073 if ((randint1(randint1(r_ptr->level/7)+5) == 1) && !(r_ptr->flags1 & RF1_UNIQUE) && !(r_ptr->flags7 & RF7_UNIQUE2))
3077 msg_format("%s¤ÎµÞ½ê¤òÆͤ»É¤·¤¿¡ª", m_name);
3079 msg_format("You hit %s on a fatal spot!", m_name);
3084 else if ((p_ptr->pclass == CLASS_NINJA) && (!p_ptr->icky_wield[hand]) && ((p_ptr->cur_lite <= 0) || one_in_(7)))
3086 int maxhp = maxroll(r_ptr->hdice, r_ptr->hside);
3087 if (one_in_(backstab ? 13 : (stab_fleeing || fuiuchi) ? 15 : 27))
3092 msg_format("¿Ï¤¬%s¤Ë¿¼¡¹¤ÈÆͤ»É¤µ¤Ã¤¿¡ª", m_name);
3094 msg_format("You critically injured %s!", m_name);
3097 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)))
3099 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE2) || (m_ptr->hp >= maxhp/2))
3101 k = MAX(k*5, m_ptr->hp/2);
3104 msg_format("%s¤ËÃ×Ì¿½ý¤òÉé¤ï¤»¤¿¡ª", m_name);
3106 msg_format("You fatally injured %s!", m_name);
3113 msg_format("¿Ï¤¬%s¤ÎµÞ½ê¤ò´Ó¤¤¤¿¡ª", m_name);
3115 msg_format("You hit %s on a fatal spot!", m_name);
3121 /* Complex message */
3122 if (wizard || cheat_xtra)
3125 msg_format("%d/%d ¤Î¥À¥á¡¼¥¸¤òÍ¿¤¨¤¿¡£", k, m_ptr->hp);
3127 msg_format("You do %d (out of %d) damage.", k, m_ptr->hp);
3132 if (k <= 0) can_drain = FALSE;
3134 if (drain_result > m_ptr->hp)
3135 drain_result = m_ptr->hp;
3137 /* Damage, check for fear and death */
3138 if (mon_take_hit(c_ptr->m_idx, k, fear, NULL))
3141 if ((p_ptr->pclass == CLASS_BERSERKER) && energy_use)
3143 if (p_ptr->migite && p_ptr->hidarite)
3145 if (hand) energy_use = energy_use*3/5+energy_use*num*2/(p_ptr->num_blow[hand]*5);
3146 else energy_use = energy_use*num*3/(p_ptr->num_blow[hand]*5);
3150 energy_use = energy_use*num/p_ptr->num_blow[hand];
3153 if ((o_ptr->name1 == ART_ZANTETSU) && is_lowlevel)
3155 msg_print("¤Þ¤¿¤Ä¤Þ¤é¤Ì¤â¤Î¤ò»Â¤Ã¤Æ¤·¤Þ¤Ã¤¿¡¥¡¥¡¥");
3157 msg_print("Sign..Another trifling thing I've cut....");
3162 /* Anger the monster */
3163 if (k > 0) anger_monster(m_ptr);
3165 touch_zap_player(m_ptr);
3167 /* Are we draining it? A little note: If the monster is
3168 dead, the drain does not work... */
3170 if (can_drain && (drain_result > 0))
3172 if (o_ptr->name1 == ART_MURAMASA)
3176 int to_h = o_ptr->to_h;
3177 int to_d = o_ptr->to_d;
3181 for (i = 0; i < to_h + 3; i++) if (one_in_(4)) flag = 0;
3185 for (i = 0; i < to_d + 3; i++) if (one_in_(4)) flag = 0;
3188 if (o_ptr->to_h != to_h || o_ptr->to_d != to_d)
3191 msg_print("ÍÅÅá¤Ï·ì¤òµÛ¤Ã¤Æ¶¯¤¯¤Ê¤Ã¤¿¡ª");
3193 msg_print("Muramasa sucked blood, and became more powerful!");
3202 if (drain_result > 5) /* Did we really hurt it? */
3204 drain_heal = damroll(2, drain_result / 6);
3209 msg_format("Draining left: %d", drain_left);
3211 msg_format("Draining left: %d", drain_left);
3218 if (drain_heal < drain_left)
3220 drain_left -= drain_heal;
3224 drain_heal = drain_left;
3231 msg_format("¿Ï¤¬%s¤«¤éÀ¸Ì¿ÎϤòµÛ¤¤¼è¤Ã¤¿¡ª", m_name);
3233 msg_format("Your weapon drains life from %s!", m_name);
3239 drain_heal = (drain_heal * mutant_regenerate_mod) / 100;
3241 hp_player(drain_heal);
3242 /* We get to keep some of it! */
3246 m_ptr->maxhp -= (k+7)/8;
3247 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3253 /* Confusion attack */
3254 if ((p_ptr->special_attack & ATTACK_CONFUSE) || (chaos_effect == 3) || (mode == HISSATSU_CONF))
3256 /* Cancel glowing hands */
3257 if (p_ptr->special_attack & ATTACK_CONFUSE)
3259 p_ptr->special_attack &= ~(ATTACK_CONFUSE);
3261 msg_print("¼ê¤Îµ±¤¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
3263 msg_print("Your hands stop glowing.");
3265 p_ptr->redraw |= (PR_STATUS);
3269 /* Confuse the monster */
3270 if (r_ptr->flags3 & RF3_NO_CONF)
3274 r_ptr->r_flags3 |= RF3_NO_CONF;
3278 msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
3280 msg_format("%^s is unaffected.", m_name);
3284 else if (randint0(100) < r_ptr->level)
3287 msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
3289 msg_format("%^s is unaffected.", m_name);
3296 msg_format("%^s¤Ïº®Í𤷤¿¤è¤¦¤À¡£", m_name);
3298 msg_format("%^s appears confused.", m_name);
3301 m_ptr->confused += 10 + randint0(p_ptr->lev) / 5;
3305 else if (chaos_effect == 4)
3307 bool resists_tele = FALSE;
3309 if (r_ptr->flags3 & RF3_RES_TELE)
3311 if (r_ptr->flags1 & RF1_UNIQUE)
3313 if (m_ptr->ml) r_ptr->r_flags3 |= RF3_RES_TELE;
3315 msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
3317 msg_format("%^s is unaffected!", m_name);
3320 resists_tele = TRUE;
3322 else if (r_ptr->level > randint1(100))
3324 if (m_ptr->ml) r_ptr->r_flags3 |= RF3_RES_TELE;
3326 msg_format("%^s¤ÏÄñ¹³ÎϤò»ý¤Ã¤Æ¤¤¤ë¡ª", m_name);
3328 msg_format("%^s resists!", m_name);
3331 resists_tele = TRUE;
3338 msg_format("%^s¤Ï¾Ã¤¨¤¿¡ª", m_name);
3340 msg_format("%^s disappears!", m_name);
3343 teleport_away(c_ptr->m_idx, 50, FALSE);
3344 num = p_ptr->num_blow[hand] + 1; /* Can't hit it anymore! */
3349 else if ((chaos_effect == 5) && cave_floor_bold(y, x) &&
3350 (randint1(90) > r_ptr->level))
3352 if (!(r_ptr->flags1 & RF1_UNIQUE) &&
3353 !(r_ptr->flags4 & RF4_BR_CHAO) &&
3354 !(r_ptr->flags1 & RF1_QUESTOR))
3356 if (polymorph_monster(y, x))
3359 msg_format("%^s¤ÏÊѲ½¤·¤¿¡ª", m_name);
3361 msg_format("%^s changes!", m_name);
3365 /* Hack -- Get new monster */
3366 m_ptr = &m_list[c_ptr->m_idx];
3368 /* Oops, we need a different name... */
3369 monster_desc(m_name, m_ptr, 0);
3371 /* Hack -- Get new race */
3372 r_ptr = &r_info[m_ptr->r_idx];
3380 msg_format("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
3382 msg_format("%^s is unaffected.", m_name);
3388 else if (o_ptr->name1 == ART_G_HAMMER)
3390 monster_type *m_ptr = &m_list[c_ptr->m_idx];
3392 if (m_ptr->hold_o_idx)
3394 object_type *q_ptr = &o_list[m_ptr->hold_o_idx];
3395 char o_name[MAX_NLEN];
3397 object_desc(o_name, q_ptr, TRUE, 0);
3398 q_ptr->held_m_idx = 0;
3399 q_ptr->marked = FALSE;
3400 m_ptr->hold_o_idx = q_ptr->next_o_idx;
3401 q_ptr->next_o_idx = 0;
3403 msg_format("%s¤òÃ¥¤Ã¤¿¡£", o_name);
3405 msg_format("You snatched %s.", o_name);
3415 backstab = FALSE; /* Clumsy! */
3416 fuiuchi = FALSE; /* Clumsy! */
3418 if ((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE) && one_in_(3))
3427 msg_format("¥ß¥¹¡ª %s¤Ë¤«¤ï¤µ¤ì¤¿¡£", m_name);
3429 msg_format("You miss %s.", m_name);
3433 msg_print("¿¶¤ê²ó¤·¤¿Âç³ù¤¬¼«Ê¬¼«¿È¤ËÊ֤äƤ¤¿¡ª");
3435 msg_print("Your scythe returns to you!");
3438 /* Extract the flags */
3439 object_flags(o_ptr, &f1, &f2, &f3);
3441 k = damroll(o_ptr->dd, o_ptr->ds);
3444 switch (p_ptr->mimic_form)
3447 switch (p_ptr->prace)
3453 case RACE_HALF_TROLL:
3454 case RACE_HALF_OGRE:
3455 case RACE_HALF_GIANT:
3456 case RACE_HALF_TITAN:
3466 case RACE_DRACONIAN:
3473 case MIMIC_DEMON_LORD:
3480 if (p_ptr->align < 0 && mult < 2)
3482 if (!(p_ptr->resist_acid || p_ptr->oppose_acid) && (mult < 3))
3483 mult = mult * 5 / 2;
3484 if (!(p_ptr->resist_elec || p_ptr->oppose_elec) && (mult < 3))
3485 mult = mult * 5 / 2;
3486 if (!(p_ptr->resist_fire || p_ptr->oppose_fire) && (mult < 3))
3487 mult = mult * 5 / 2;
3488 if (!(p_ptr->resist_cold || p_ptr->oppose_cold) && (mult < 3))
3489 mult = mult * 5 / 2;
3490 if (!(p_ptr->resist_pois || p_ptr->oppose_pois) && (mult < 3))
3491 mult = mult * 5 / 2;
3493 if ((p_ptr->pclass != CLASS_SAMURAI) && (f1 & TR1_FORCE_WEAPON) && (p_ptr->csp > (p_ptr->msp / 30)))
3495 p_ptr->csp -= (1+(p_ptr->msp / 30));
3496 p_ptr->redraw |= (PR_MANA);
3497 mult = mult * 7 / 2;
3502 k = critical_norm(o_ptr->weight, o_ptr->to_h, k, p_ptr->to_h[hand], mode);
3507 msg_format("¥°¥Ã¥µ¥êÀÚ¤êÎö¤«¤ì¤¿¡ª");
3509 msg_format("Your weapon cuts deep into yourself!");
3511 /* Try to increase the damage */
3519 k += (p_ptr->to_d[hand] + o_ptr->to_d);
3522 take_hit(DAMAGE_FORCE, k, "»à¤ÎÂç³ù", -1);
3524 take_hit(DAMAGE_FORCE, k, "Death scythe", -1);
3536 msg_format("¥ß¥¹¡ª %s¤Ë¤«¤ï¤µ¤ì¤¿¡£", m_name);
3538 msg_format("You miss %s.", m_name);
3547 if (weak && !(*mdeath))
3550 msg_format("%s¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£", m_name);
3552 msg_format("%^s seems weakened.", m_name);
3555 if (drain_left != MAX_VAMPIRIC_DRAIN)
3559 chg_virtue(V_UNLIFE, 1);
3562 /* Mega-Hack -- apply earthquake brand */
3565 earthquake(py, px, 10);
3566 if (!cave[y][x].m_idx) *mdeath = TRUE;
3570 bool py_attack(int y, int x, int mode)
3573 bool mdeath = FALSE;
3574 bool stormbringer = FALSE;
3576 cave_type *c_ptr = &cave[y][x];
3577 monster_type *m_ptr = &m_list[c_ptr->m_idx];
3580 /* Disturb the player */
3585 if (m_ptr->csleep) /* It is not honorable etc to attack helpless victims */
3587 if (!(r_info[m_ptr->r_idx].flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
3588 if (!(r_info[m_ptr->r_idx].flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
3591 /* Extract monster name (or "it") */
3592 monster_desc(m_name, m_ptr, 0);
3594 /* Auto-Recall if possible and visible */
3595 if (m_ptr->ml) monster_race_track((bool)(m_ptr->mflag2 & MFLAG_KAGE), m_ptr->r_idx);
3597 /* Track a new monster */
3598 if (m_ptr->ml) health_track(c_ptr->m_idx);
3600 if ((r_info[m_ptr->r_idx].flags1 & RF1_FEMALE) &&
3601 !(p_ptr->stun || p_ptr->confused || p_ptr->image || !m_ptr->ml))
3603 if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
3606 msg_print("ÀÛ¼Ô¡¢¤ª¤Ê¤´¤Ï»Â¤ì¤Ì¡ª");
3608 msg_print("I can not attack women!");
3614 if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
3617 msg_print("¤Ê¤¼¤«¹¶·â¤¹¤ë¤³¤È¤¬¤Ç¤¤Ê¤¤¡£");
3619 msg_print("Something prevent you from attacking.");
3624 /* Stop if friendly */
3625 if (!is_hostile(m_ptr) &&
3626 !(p_ptr->stun || p_ptr->confused || p_ptr->image ||
3627 p_ptr->shero || !m_ptr->ml))
3629 if (inventory[INVEN_RARM].art_name)
3631 if (inventory[INVEN_RARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
3633 if (inventory[INVEN_LARM].art_name)
3635 if (inventory[INVEN_LARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
3640 msg_format("¹õ¤¤¿Ï¤Ï¶¯ÍߤË%s¤ò¹¶·â¤·¤¿¡ª", m_name);
3642 msg_format("Your black blade greedily attacks %s!", m_name);
3644 chg_virtue(V_INDIVIDUALISM, 1);
3645 chg_virtue(V_HONOUR, -1);
3646 chg_virtue(V_JUSTICE, -1);
3647 chg_virtue(V_COMPASSION, -1);
3649 else if (p_ptr->pclass != CLASS_BERSERKER)
3652 if (get_check("ËÜÅö¤Ë¹¶·â¤·¤Þ¤¹¤«¡©"))
3654 if (get_check("Really hit it? "))
3657 chg_virtue(V_INDIVIDUALISM, 1);
3658 chg_virtue(V_HONOUR, -1);
3659 chg_virtue(V_JUSTICE, -1);
3660 chg_virtue(V_COMPASSION, -1);
3665 msg_format("%s¤ò¹¶·â¤¹¤ë¤Î¤ò»ß¤á¤¿¡£", m_name);
3667 msg_format("You stop to avoid hitting %s.", m_name);
3675 /* Handle player fear */
3681 msg_format("¶²¤¯¤Æ%s¤ò¹¶·â¤Ç¤¤Ê¤¤¡ª", m_name);
3683 msg_format("You are too afraid to attack %s!", m_name);
3688 msg_format ("¤½¤Ã¤Á¤Ë¤Ï²¿¤«¶²¤¤¤â¤Î¤¬¤¤¤ë¡ª");
3690 msg_format ("There is something scary in your way!");
3693 /* Disturb the monster */
3695 p_ptr->update |= (PU_MON_LITE);
3701 if (p_ptr->migite && p_ptr->hidarite)
3703 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))
3705 if (skill_exp[GINOU_NITOURYU] < 4000)
3706 skill_exp[GINOU_NITOURYU]+=80;
3707 else if(skill_exp[GINOU_NITOURYU] < 6000)
3708 skill_exp[GINOU_NITOURYU]+=4;
3709 else if(skill_exp[GINOU_NITOURYU] < 7000)
3710 skill_exp[GINOU_NITOURYU]+=1;
3711 else if(skill_exp[GINOU_NITOURYU] < 8000)
3712 if (one_in_(3)) skill_exp[GINOU_NITOURYU]+=1;
3713 p_ptr->update |= (PU_BONUS);
3719 int ridinglevel = r_info[m_list[p_ptr->riding].r_idx].level;
3720 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))
3721 skill_exp[GINOU_RIDING]++;
3722 if ((skill_exp[GINOU_RIDING] < s_info[p_ptr->pclass].s_max[GINOU_RIDING]) && (skill_exp[GINOU_RIDING]/100 < ridinglevel))
3724 if (ridinglevel*100 > (skill_exp[GINOU_RIDING] + 1500))
3725 skill_exp[GINOU_RIDING] += (1+(ridinglevel - skill_exp[GINOU_RIDING]/100 - 15));
3726 else skill_exp[GINOU_RIDING]++;
3728 p_ptr->update |= (PU_BONUS);
3731 riding_t_m_idx = c_ptr->m_idx;
3732 if (p_ptr->migite) py_attack_aux(y, x, &fear, &mdeath, 0, mode);
3733 if (p_ptr->hidarite && !mdeath) py_attack_aux(y, x, &fear, &mdeath, 1, mode);
3735 /* Mutations which yield extra 'natural' attacks */
3738 if ((p_ptr->muta2 & MUT2_HORNS) && !mdeath)
3739 natural_attack(c_ptr->m_idx, MUT2_HORNS, &fear, &mdeath);
3740 if ((p_ptr->muta2 & MUT2_BEAK) && !mdeath)
3741 natural_attack(c_ptr->m_idx, MUT2_BEAK, &fear, &mdeath);
3742 if ((p_ptr->muta2 & MUT2_SCOR_TAIL) && !mdeath)
3743 natural_attack(c_ptr->m_idx, MUT2_SCOR_TAIL, &fear, &mdeath);
3744 if ((p_ptr->muta2 & MUT2_TRUNK) && !mdeath)
3745 natural_attack(c_ptr->m_idx, MUT2_TRUNK, &fear, &mdeath);
3746 if ((p_ptr->muta2 & MUT2_TENTACLES) && !mdeath)
3747 natural_attack(c_ptr->m_idx, MUT2_TENTACLES, &fear, &mdeath);
3750 /* Hack -- delay fear messages */
3751 if (fear && m_ptr->ml && !mdeath)
3758 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
3760 msg_format("%^s flees in terror!", m_name);
3765 if ((p_ptr->special_defense & KATA_IAI) && ((mode != HISSATSU_IAI) || mdeath))
3767 set_action(ACTION_NONE);
3774 static bool pattern_seq(int c_y, int c_x, int n_y, int n_x)
3776 if (!pattern_tile(c_y, c_x) && !pattern_tile(n_y, n_x))
3779 if (cave[n_y][n_x].feat == FEAT_PATTERN_START)
3781 if (!pattern_tile(c_y, c_x) &&
3782 !p_ptr->confused && !p_ptr->stun && !p_ptr->image)
3785 if (get_check("¥Ñ¥¿¡¼¥ó¤Î¾å¤òÊ⤻Ϥá¤ë¤È¡¢Á´¤Æ¤òÊ⤫¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¤¤¤¤¤Ç¤¹¤«¡©"))
3787 if (get_check("If you start walking the Pattern, you must walk the whole way. Ok? "))
3797 else if ((cave[n_y][n_x].feat == FEAT_PATTERN_OLD) ||
3798 (cave[n_y][n_x].feat == FEAT_PATTERN_END) ||
3799 (cave[n_y][n_x].feat == FEAT_PATTERN_XTRA2))
3801 if (pattern_tile(c_y, c_x))
3808 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤òÊ⤯¤Ë¤Ï¥¹¥¿¡¼¥ÈÃÏÅÀ¤«¤éÊ⤻Ϥá¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£");
3810 msg_print("You must start walking the Pattern from the startpoint.");
3816 else if ((cave[n_y][n_x].feat == FEAT_PATTERN_XTRA1) ||
3817 (cave[c_y][c_x].feat == FEAT_PATTERN_XTRA1))
3821 else if (cave[c_y][c_x].feat == FEAT_PATTERN_START)
3823 if (pattern_tile(n_y, n_x))
3828 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤ÏÀµ¤·¤¤½ç½ø¤ÇÊ⤫¤Í¤Ð¤Ê¤ê¤Þ¤»¤ó¡£");
3830 msg_print("You must walk the Pattern in correct order.");
3836 else if ((cave[c_y][c_x].feat == FEAT_PATTERN_OLD) ||
3837 (cave[c_y][c_x].feat == FEAT_PATTERN_END) ||
3838 (cave[c_y][c_x].feat == FEAT_PATTERN_XTRA2))
3840 if (!pattern_tile(n_y, n_x))
3843 msg_print("¥Ñ¥¿¡¼¥ó¤òƧ¤ß³°¤·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£");
3845 msg_print("You may not step off from the Pattern.");
3857 if (!pattern_tile(c_y, c_x))
3860 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤òÊ⤯¤Ë¤Ï¥¹¥¿¡¼¥ÈÃÏÅÀ¤«¤éÊ⤻Ϥá¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£");
3862 msg_print("You must start walking the Pattern from the startpoint.");
3869 byte ok_move = FEAT_PATTERN_START;
3870 switch (cave[c_y][c_x].feat)
3872 case FEAT_PATTERN_1:
3873 ok_move = FEAT_PATTERN_2;
3875 case FEAT_PATTERN_2:
3876 ok_move = FEAT_PATTERN_3;
3878 case FEAT_PATTERN_3:
3879 ok_move = FEAT_PATTERN_4;
3881 case FEAT_PATTERN_4:
3882 ok_move = FEAT_PATTERN_1;
3887 msg_format("¤ª¤«¤·¤Ê¥Ñ¥¿¡¼¥óÊâ¹Ô¡¢%d¡£", cave[c_y][c_x]);
3889 msg_format("Funny Pattern walking, %d.", cave[c_y][c_x]);
3892 return TRUE; /* Goof-up */
3895 if ((cave[n_y][n_x].feat == ok_move) ||
3896 (cave[n_y][n_x].feat == cave[c_y][c_x].feat))
3900 if (!pattern_tile(n_y, n_x))
3902 msg_print("¥Ñ¥¿¡¼¥ó¤òƧ¤ß³°¤·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£");
3904 msg_print("You may not step off from the Pattern.");
3909 msg_print("¥Ñ¥¿¡¼¥ó¤Î¾å¤ÏÀµ¤·¤¤½ç½ø¤ÇÊ⤫¤Í¤Ð¤Ê¤ê¤Þ¤»¤ó¡£");
3911 msg_print("You must walk the Pattern in correct order.");
3923 bool player_can_enter(byte feature)
3927 /* Player can not walk through "walls" unless in Shadow Form */
3928 if (p_ptr->wraith_form || p_ptr->pass_wall || p_ptr->kabenuke)
3935 case FEAT_DEEP_WATER:
3936 case FEAT_SHAL_LAVA:
3937 case FEAT_DEEP_LAVA:
3960 case FEAT_WALL_EXTRA:
3961 case FEAT_WALL_INNER:
3962 case FEAT_WALL_OUTER:
3963 case FEAT_WALL_SOLID:
3970 return (!dun_level && p_ptr->ffall);
3972 case FEAT_PERM_EXTRA:
3973 case FEAT_PERM_INNER:
3974 case FEAT_PERM_OUTER:
3975 case FEAT_PERM_SOLID:
3986 * Move player in the given direction, with the given "pickup" flag.
3988 * This routine should (probably) always induce energy expenditure.
3990 * Note that moving will *always* take a turn, and will *always* hit
3991 * any monster which might be in the destination grid. Previously,
3992 * moving into walls was "free" and did NOT hit invisible monsters.
3994 void move_player(int dir, int do_pickup, bool break_trap)
3999 monster_type *m_ptr;
4003 bool p_can_pass_walls = FALSE;
4004 bool stormbringer = FALSE;
4006 bool oktomove = TRUE;
4007 bool do_past = FALSE;
4009 /* Find the result of moving */
4013 /* Examine the destination */
4014 c_ptr = &cave[y][x];
4018 if (!dun_level && !p_ptr->wild_mode &&
4019 ((x == 0) || (x == MAX_WID - 1) ||
4020 (y == 0) || (y == MAX_HGT - 1)))
4022 /* Can the player enter the grid? */
4023 if (c_ptr->mimic && player_can_enter(c_ptr->mimic))
4025 /* Hack: move to new area */
4026 if ((y == 0) && (x == 0))
4028 p_ptr->wilderness_y--;
4029 p_ptr->wilderness_x--;
4030 p_ptr->oldpy = cur_hgt - 2;
4031 p_ptr->oldpx = cur_wid - 2;
4032 ambush_flag = FALSE;
4035 else if ((y == 0) && (x == MAX_WID - 1))
4037 p_ptr->wilderness_y--;
4038 p_ptr->wilderness_x++;
4039 p_ptr->oldpy = cur_hgt - 2;
4041 ambush_flag = FALSE;
4044 else if ((y == MAX_HGT - 1) && (x == 0))
4046 p_ptr->wilderness_y++;
4047 p_ptr->wilderness_x--;
4049 p_ptr->oldpx = cur_wid - 2;
4050 ambush_flag = FALSE;
4053 else if ((y == MAX_HGT - 1) && (x == MAX_WID - 1))
4055 p_ptr->wilderness_y++;
4056 p_ptr->wilderness_x++;
4059 ambush_flag = FALSE;
4064 p_ptr->wilderness_y--;
4065 p_ptr->oldpy = cur_hgt - 2;
4067 ambush_flag = FALSE;
4070 else if (y == MAX_HGT - 1)
4072 p_ptr->wilderness_y++;
4075 ambush_flag = FALSE;
4080 p_ptr->wilderness_x--;
4081 p_ptr->oldpx = cur_wid - 2;
4083 ambush_flag = FALSE;
4086 else if (x == MAX_WID - 1)
4088 p_ptr->wilderness_x++;
4091 ambush_flag = FALSE;
4094 p_ptr->leftbldg = TRUE;
4095 p_ptr->leaving = TRUE;
4104 /* Get the monster */
4105 m_ptr = &m_list[c_ptr->m_idx];
4108 if (inventory[INVEN_RARM].art_name)
4110 if (inventory[INVEN_RARM].name1 == ART_STORMBRINGER)
4111 stormbringer = TRUE;
4113 else if (inventory[INVEN_LARM].art_name)
4115 if (inventory[INVEN_LARM].name1 == ART_STORMBRINGER)
4116 stormbringer = TRUE;
4119 /* Player can not walk through "walls"... */
4120 /* unless in Shadow Form */
4121 if (p_ptr->wraith_form || p_ptr->pass_wall || p_ptr->kabenuke)
4122 p_can_pass_walls = TRUE;
4123 if ((cave[y][x].feat >= FEAT_PERM_EXTRA) &&
4124 (cave[y][x].feat <= FEAT_PERM_SOLID))
4126 p_can_pass_walls = FALSE;
4131 cave[py][px].m_idx = 0;
4134 /* Hack -- attack monsters */
4135 if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x) || p_can_pass_walls))
4138 /* Attack -- only if we can see it OR it is not in a wall */
4139 if (!is_hostile(m_ptr) &&
4140 !(p_ptr->confused || p_ptr->image || !m_ptr->ml || p_ptr->stun ||
4141 ((p_ptr->muta2 & MUT2_BERS_RAGE) && p_ptr->shero)) &&
4142 (pattern_seq(py, px, y, x)) &&
4143 ((cave_floor_bold(y, x)) || (c_ptr->feat == FEAT_TREES) || (p_can_pass_walls)))
4146 p_ptr->update |= (PU_MON_LITE);
4148 /* Extract monster name (or "it") */
4149 monster_desc(m_name, m_ptr, 0);
4151 /* Auto-Recall if possible and visible */
4152 if (m_ptr->ml) monster_race_track((bool)(m_ptr->mflag2 & MFLAG_KAGE), m_ptr->r_idx);
4154 /* Track a new monster */
4155 if (m_ptr->ml) health_track(c_ptr->m_idx);
4158 if ((stormbringer && (randint1(1000) > 666)) || (p_ptr->pclass == CLASS_BERSERKER))
4163 else if (monster_can_cross_terrain(cave[py][px].feat, &r_info[m_ptr->r_idx]) &&
4164 (cave_floor_bold(py, px) || cave[py][px].feat == FEAT_TREES ||
4165 (r_info[m_ptr->r_idx].flags2 & RF2_PASS_WALL)))
4172 msg_format("%^s¤¬¼ÙËâ¤À¡ª", m_name);
4174 msg_format("%^s is in your way!", m_name);
4181 /* now continue on to 'movement' */
4194 else if ((c_ptr->feat == FEAT_DARK_PIT) && !p_ptr->ffall)
4197 msg_print("Îö¤±Ìܤò²£Àڤ뤳¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£");
4199 msg_print("You can't cross the chasm.");
4207 else if (c_ptr->feat == FEAT_MOUNTAIN)
4209 if (dun_level || !p_ptr->ffall)
4212 msg_print("»³¤Ë¤ÏÅФì¤Þ¤»¤ó¡ª");
4214 msg_print("You can't climb the mountains!");
4223 * Player can move through trees and
4224 * has effective -10 speed
4225 * Rangers can move without penality
4227 else if (c_ptr->feat == FEAT_TREES)
4230 if ((p_ptr->pclass != CLASS_RANGER) && !p_ptr->ffall) energy_use *= 2;
4233 else if ((c_ptr->feat >= FEAT_QUEST_ENTER) &&
4234 (c_ptr->feat <= FEAT_QUEST_EXIT))
4239 #ifdef ALLOW_EASY_DISARM /* TNB */
4241 /* Disarm a visible trap */
4242 else if ((do_pickup != easy_disarm) && is_trap(c_ptr->feat))
4244 bool ignore = FALSE;
4245 switch (c_ptr->feat)
4247 case FEAT_TRAP_TRAPDOOR:
4249 case FEAT_TRAP_SPIKED_PIT:
4250 case FEAT_TRAP_POISON_PIT:
4251 if (p_ptr->ffall) ignore = TRUE;
4253 case FEAT_TRAP_TELEPORT:
4254 if (p_ptr->anti_tele) ignore = TRUE;
4256 case FEAT_TRAP_FIRE:
4257 if (p_ptr->immune_fire) ignore = TRUE;
4259 case FEAT_TRAP_ACID:
4260 if (p_ptr->immune_acid) ignore = TRUE;
4262 case FEAT_TRAP_BLIND:
4263 if (p_ptr->resist_blind) ignore = TRUE;
4265 case FEAT_TRAP_CONFUSE:
4266 if (p_ptr->resist_conf) ignore = TRUE;
4268 case FEAT_TRAP_POISON:
4269 if (p_ptr->resist_pois) ignore = TRUE;
4271 case FEAT_TRAP_SLEEP:
4272 if (p_ptr->free_act) ignore = TRUE;
4278 (void)do_cmd_disarm_aux(y, x, dir);
4283 #endif /* ALLOW_EASY_DISARM -- TNB */
4284 else if (p_ptr->riding && (r_info[m_list[p_ptr->riding].r_idx].flags1 & RF1_NEVER_MOVE))
4287 msg_print("Æ°¤±¤Ê¤¤¡ª");
4289 msg_print("Can't move!");
4296 else if (p_ptr->riding && m_list[p_ptr->riding].monfear)
4300 /* Acquire the monster name */
4301 monster_desc(m_name, &m_list[p_ptr->riding], 0);
4303 /* Dump a message */
4305 msg_format("%s¤¬¶²Éݤ·¤Æ¤¤¤ÆÀ©¸æ¤Ç¤¤Ê¤¤¡£", m_name);
4307 msg_format("%^s is too scared to control.", m_name);
4313 else if (p_ptr->riding && p_ptr->riding_ryoute)
4319 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))
4322 msg_print("Φ¾å¤Ë¾å¤¬¤ì¤Ê¤¤¡£");
4324 msg_print("Can't land.");
4331 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))
4334 msg_print("¿å¾å¤Ë¹Ô¤±¤Ê¤¤¡£");
4336 msg_print("Can't swim.");
4343 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))
4346 msg_print("¿å¾å¤Ë¹Ô¤±¤Ê¤¤¡£");
4348 msg_print("Can't swim.");
4355 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)))
4358 msg_print("ÍÏ´ä¤Î¾å¤Ë¹Ô¤±¤Ê¤¤¡£");
4360 msg_print("Too hot to go through.");
4367 else if (p_ptr->riding && m_list[p_ptr->riding].stunned && one_in_(2))
4370 monster_desc(m_name, &m_list[p_ptr->riding], 0);
4372 msg_format("%s¤¬Û¯Û°¤È¤·¤Æ¤¤¤Æ¤¦¤Þ¤¯Æ°¤±¤Ê¤¤¡ª",m_name);
4374 msg_format("You cannot control stunned %s!",m_name);
4380 /* Player can not walk through "walls" unless in wraith form...*/
4381 else if ((!cave_floor_bold(y, x)) &&
4382 (!p_can_pass_walls))
4386 /* Disturb the player */
4389 /* Notice things in the dark */
4390 if ((!(c_ptr->info & (CAVE_MARK))) &&
4391 (p_ptr->blind || !(c_ptr->info & (CAVE_LITE))))
4394 if (c_ptr->feat == FEAT_RUBBLE)
4397 msg_print("´äÀФ¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¤è¤¦¤À¡£");
4399 msg_print("You feel some rubble blocking your way.");
4402 c_ptr->info |= (CAVE_MARK);
4407 else if (c_ptr->feat < FEAT_SECRET)
4410 msg_print("¥É¥¢¤¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¤è¤¦¤À¡£");
4412 msg_print("You feel a closed door blocking your way.");
4415 c_ptr->info |= (CAVE_MARK);
4419 /* Wall (or secret door) */
4423 msg_print("Êɤ¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¤è¤¦¤À¡£");
4425 msg_print("You feel a wall blocking your way.");
4428 c_ptr->info |= (CAVE_MARK);
4437 if (c_ptr->feat == FEAT_RUBBLE)
4440 msg_print("´äÀФ¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¡£");
4442 msg_print("There is rubble blocking your way.");
4446 if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
4450 * Well, it makes sense that you lose time bumping into
4451 * a wall _if_ you are confused, stunned or blind; but
4452 * typing mistakes should not cost you a turn...
4456 else if (c_ptr->feat < FEAT_SECRET)
4458 #ifdef ALLOW_EASY_OPEN
4460 if (easy_open && easy_open_door(y, x)) return;
4462 #endif /* ALLOW_EASY_OPEN */
4465 msg_print("¥É¥¢¤¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¡£");
4467 msg_print("There is a closed door blocking your way.");
4471 if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
4475 /* Wall (or secret door) */
4479 msg_print("Êɤ¬¹Ô¤¯¼ê¤ò¤Ï¤Ð¤ó¤Ç¤¤¤ë¡£");
4481 msg_print("There is a wall blocking your way.");
4485 if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
4491 sound(SOUND_HITWALL);
4494 /* Normal movement */
4495 if (!pattern_seq(py, px, y, x))
4497 if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
4502 /* To avoid a loop with running */
4508 /* Normal movement */
4515 if(!process_frakir(x,y))
4525 msg_format("%s¤ò²¡¤·Âऱ¤¿¡£", m_name);
4527 msg_format("You push past %s.", m_name);
4532 cave[py][px].m_idx = c_ptr->m_idx;
4534 update_mon(cave[py][px].m_idx, TRUE);
4537 /* Change oldpx and oldpy to place the player well when going back to big mode */
4538 if (p_ptr->wild_mode)
4540 if(ddy[dir] > 0) p_ptr->oldpy = 1;
4541 if(ddy[dir] < 0) p_ptr->oldpy = MAX_HGT - 2;
4542 if(ddy[dir] == 0) p_ptr->oldpy = MAX_HGT / 2;
4543 if(ddx[dir] > 0) p_ptr->oldpx = 1;
4544 if(ddx[dir] < 0) p_ptr->oldpx = MAX_WID - 2;
4545 if(ddx[dir] == 0) p_ptr->oldpx = MAX_WID / 2;
4548 /* Save old location */
4552 /* Move the player */
4556 if (p_ptr->riding && (r_info[m_list[p_ptr->riding].r_idx].flags2 & RF2_KILL_WALL))
4558 if (cave[py][px].feat > FEAT_SECRET && cave[py][px].feat < FEAT_PERM_SOLID)
4560 /* Forget the wall */
4561 cave[py][px].info &= ~(CAVE_MARK);
4564 cave_set_feat(py, px, floor_type[randint0(100)]);
4567 if (music_singing(MUSIC_WALL))
4569 project(0, 0, py, px,
4570 (60 + p_ptr->lev), GF_DISINTEGRATE, PROJECT_KILL | PROJECT_ITEM, -1);
4572 else if (p_ptr->kill_wall)
4574 if (cave_valid_bold(py, px) &&
4575 (cave[py][px].feat < FEAT_PATTERN_START ||
4576 cave[py][px].feat > FEAT_PATTERN_XTRA2) &&
4577 (cave[py][px].feat < FEAT_DEEP_WATER ||
4578 cave[py][px].feat > FEAT_GRASS))
4580 if (cave[py][px].feat == FEAT_TREES)
4581 cave_set_feat(py, px, FEAT_GRASS);
4584 cave[py][px].feat = floor_type[randint0(100)];
4585 cave[py][px].info &= ~(CAVE_MASK);
4586 cave[py][px].info |= CAVE_FLOOR;
4589 /* Update some things -- similar to GF_KILL_WALL */
4590 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
4593 /* Redraw new spot */
4596 /* Redraw old spot */
4600 /* sound(SOUND_WALK); */
4602 /* Check for new panel (redraw map) */
4605 /* For get everything when requested hehe I'm *NASTY* */
4606 if (dun_level && (d_info[dungeon_type].flags1 & DF1_FORGET))
4611 if ((p_ptr->pclass == CLASS_NINJA))
4613 if (c_ptr->info & (CAVE_GLOW)) set_superstealth(FALSE);
4614 else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
4616 if ((p_ptr->action == ACTION_HAYAGAKE) && !cave_floor_bold(py, px))
4619 msg_print("¤³¤³¤Ç¤ÏÁÇÁ᤯ư¤±¤Ê¤¤¡£");
4621 msg_print("You cannot run in wall.");
4623 set_action(ACTION_NONE);
4627 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
4629 /* Update the monsters */
4630 p_ptr->update |= (PU_DISTANCE);
4633 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4635 /* Spontaneous Searching */
4636 if ((p_ptr->skill_fos >= 50) ||
4637 (0 == randint0(50 - p_ptr->skill_fos)))
4642 /* Continuous Searching */
4643 if (p_ptr->action == ACTION_SEARCH)
4648 /* Handle "objects" */
4650 #ifdef ALLOW_EASY_DISARM /* TNB */
4652 carry(do_pickup != always_pickup);
4654 #else /* ALLOW_EASY_DISARM -- TNB */
4658 #endif /* ALLOW_EASY_DISARM -- TNB */
4660 /* Handle "store doors" */
4661 if (((c_ptr->feat >= FEAT_SHOP_HEAD) &&
4662 (c_ptr->feat <= FEAT_SHOP_TAIL)) ||
4663 (c_ptr->feat == FEAT_MUSEUM))
4669 /* Hack -- Enter store */
4673 /* Handle "building doors" -KMW- */
4674 else if ((c_ptr->feat >= FEAT_BLDG_HEAD) &&
4675 (c_ptr->feat <= FEAT_BLDG_TAIL))
4681 /* Hack -- Enter building */
4685 /* Handle quest areas -KMW- */
4686 else if (cave[y][x].feat == FEAT_QUEST_ENTER)
4692 /* Hack -- Enter quest level */
4696 else if (cave[y][x].feat == FEAT_QUEST_EXIT)
4698 if (quest[p_ptr->inside_quest].type == QUEST_TYPE_FIND_EXIT)
4700 if (record_fix_quest) do_cmd_write_nikki(NIKKI_FIX_QUEST_C, p_ptr->inside_quest, NULL);
4701 quest[p_ptr->inside_quest].status = QUEST_STATUS_COMPLETED;
4702 quest[p_ptr->inside_quest].complev = (byte)p_ptr->lev;
4704 msg_print("¥¯¥¨¥¹¥È¤òãÀ®¤·¤¿¡ª");
4706 msg_print("You accomplished your quest!");
4712 leave_quest_check();
4714 p_ptr->inside_quest = cave[y][x].special;
4718 p_ptr->leaving = TRUE;
4721 /* Discover invisible traps */
4722 else if (c_ptr->info & CAVE_TRAP)
4729 msg_print("¥È¥é¥Ã¥×¤À¡ª");
4731 msg_print("You found a trap!");
4739 hit_trap(break_trap);
4742 /* Set off an visible trap */
4743 else if (is_trap(c_ptr->feat))
4749 hit_trap(break_trap);
4754 m_list[p_ptr->riding].fy = py;
4755 m_list[p_ptr->riding].fx = px;
4756 cave[py][px].m_idx = p_ptr->riding;
4757 update_mon(cave[py][px].m_idx, TRUE);
4758 p_ptr->update |= (PU_MON_LITE);
4764 * Hack -- Check for a "known wall" (see below)
4766 static int see_wall(int dir, int y, int x)
4768 /* Get the new location */
4772 /* Illegal grids are not known walls */
4773 if (!in_bounds2(y, x)) return (FALSE);
4775 /* Non-wall grids are not known walls */
4776 if (cave[y][x].feat < FEAT_SECRET) return (FALSE);
4778 if ((cave[y][x].feat >= FEAT_DEEP_WATER) &&
4779 (cave[y][x].feat <= FEAT_GRASS)) return (FALSE);
4781 if ((cave[y][x].feat >= FEAT_SHOP_HEAD) &&
4782 (cave[y][x].feat <= FEAT_SHOP_TAIL)) return (FALSE);
4784 if (cave[y][x].feat == FEAT_DEEP_GRASS) return (FALSE);
4785 if (cave[y][x].feat == FEAT_FLOWER) return (FALSE);
4787 if (cave[y][x].feat == FEAT_MUSEUM) return (FALSE);
4789 if ((cave[y][x].feat >= FEAT_BLDG_HEAD) &&
4790 (cave[y][x].feat <= FEAT_BLDG_TAIL)) return (FALSE);
4792 /* if (cave[y][x].feat == FEAT_TREES) return (FALSE); */
4794 /* Must be known to the player */
4795 if (!(cave[y][x].info & (CAVE_MARK))) return (FALSE);
4797 if (cave[y][x].feat >= FEAT_TOWN) return (FALSE);
4805 * Hack -- Check for an "unknown corner" (see below)
4807 static int see_nothing(int dir, int y, int x)
4809 /* Get the new location */
4813 /* Illegal grids are unknown */
4814 if (!in_bounds2(y, x)) return (TRUE);
4816 /* Memorized grids are always known */
4817 if (cave[y][x].info & (CAVE_MARK)) return (FALSE);
4819 /* Non-floor grids are unknown */
4820 if (!cave_floor_bold(y, x)) return (TRUE);
4822 /* Viewable door/wall grids are known */
4823 if (player_can_see_bold(y, x)) return (FALSE);
4834 * The running algorithm: -CJS-
4836 * In the diagrams below, the player has just arrived in the
4837 * grid marked as '@', and he has just come from a grid marked
4838 * as 'o', and he is about to enter the grid marked as 'x'.
4840 * Of course, if the "requested" move was impossible, then you
4841 * will of course be blocked, and will stop.
4843 * Overview: You keep moving until something interesting happens.
4844 * If you are in an enclosed space, you follow corners. This is
4845 * the usual corridor scheme. If you are in an open space, you go
4846 * straight, but stop before entering enclosed space. This is
4847 * analogous to reaching doorways. If you have enclosed space on
4848 * one side only (that is, running along side a wall) stop if
4849 * your wall opens out, or your open space closes in. Either case
4850 * corresponds to a doorway.
4852 * What happens depends on what you can really SEE. (i.e. if you
4853 * have no light, then running along a dark corridor is JUST like
4854 * running in a dark room.) The algorithm works equally well in
4855 * corridors, rooms, mine tailings, earthquake rubble, etc, etc.
4857 * These conditions are kept in static memory:
4858 * find_openarea You are in the open on at least one
4860 * find_breakleft You have a wall on the left, and will
4862 * find_breakright You have a wall on the right, and will
4865 * To initialize these conditions, we examine the grids adjacent
4866 * to the grid marked 'x', two on each side (marked 'L' and 'R').
4867 * If either one of the two grids on a given side is seen to be
4868 * closed, then that side is considered to be closed. If both
4869 * sides are closed, then it is an enclosed (corridor) run.
4875 * Looking at more than just the immediate squares is
4876 * significant. Consider the following case. A run along the
4877 * corridor will stop just before entering the center point,
4878 * because a choice is clearly established. Running in any of
4879 * three available directions will be defined as a corridor run.
4880 * Note that a minor hack is inserted to make the angled corridor
4881 * entry (with one side blocked near and the other side blocked
4882 * further away from the runner) work correctly. The runner moves
4883 * diagonally, but then saves the previous direction as being
4884 * straight into the gap. Otherwise, the tail end of the other
4885 * entry would be perceived as an alternative on the next move.
4893 * Likewise, a run along a wall, and then into a doorway (two
4894 * runs) will work correctly. A single run rightwards from @ will
4895 * stop at 1. Another run right and down will enter the corridor
4896 * and make the corner, stopping at the 2.
4899 * ########### ######
4904 * After any move, the function area_affect is called to
4905 * determine the new surroundings, and the direction of
4906 * subsequent moves. It examines the current player location
4907 * (at which the runner has just arrived) and the previous
4908 * direction (from which the runner is considered to have come).
4910 * Moving one square in some direction places you adjacent to
4911 * three or five new squares (for straight and diagonal moves
4912 * respectively) to which you were not previously adjacent,
4913 * marked as '!' in the diagrams below.
4920 * You STOP if any of the new squares are interesting in any way:
4921 * for example, if they contain visible monsters or treasure.
4923 * You STOP if any of the newly adjacent squares seem to be open,
4924 * and you are also looking for a break on that side. (that is,
4925 * find_openarea AND find_break).
4927 * You STOP if any of the newly adjacent squares do NOT seem to be
4928 * open and you are in an open area, and that side was previously
4931 * Corners: If you are not in the open (i.e. you are in a corridor)
4932 * and there is only one way to go in the new squares, then turn in
4933 * that direction. If there are more than two new ways to go, STOP.
4934 * If there are two ways to go, and those ways are separated by a
4935 * square which does not seem to be open, then STOP.
4937 * Otherwise, we have a potential corner. There are two new open
4938 * squares, which are also adjacent. One of the new squares is
4939 * diagonally located, the other is straight on (as in the diagram).
4940 * We consider two more squares further out (marked below as ?).
4942 * We assign "option" to the straight-on grid, and "option2" to the
4943 * diagonal grid, and "check_dir" to the grid marked 's'.
4949 * If they are both seen to be closed, then it is seen that no
4950 * benefit is gained from moving straight. It is a known corner.
4951 * To cut the corner, go diagonally, otherwise go straight, but
4952 * pretend you stepped diagonally into that next location for a
4953 * full view next time. Conversely, if one of the ? squares is
4954 * not seen to be closed, then there is a potential choice. We check
4955 * to see whether it is a potential corner or an intersection/room entrance.
4956 * If the square two spaces straight ahead, and the space marked with 's'
4957 * are both blank, then it is a potential corner and enter if find_examine
4958 * is set, otherwise must stop because it is not a corner.
4965 * Hack -- allow quick "cycling" through the legal directions
4967 static byte cycle[] =
4968 { 1, 2, 3, 6, 9, 8, 7, 4, 1, 2, 3, 6, 9, 8, 7, 4, 1 };
4971 * Hack -- map each direction into the "middle" of the "cycle[]" array
4973 static byte chome[] =
4974 { 0, 8, 9, 10, 7, 0, 11, 6, 5, 4 };
4977 * The direction we are running
4979 static byte find_current;
4982 * The direction we came from
4984 static byte find_prevdir;
4987 * We are looking for open area
4989 static bool find_openarea;
4992 * We are looking for a break
4994 static bool find_breakright;
4995 static bool find_breakleft;
5000 * Initialize the running algorithm for a new direction.
5002 * Diagonal Corridor -- allow diaginal entry into corridors.
5004 * Blunt Corridor -- If there is a wall two spaces ahead and
5005 * we seem to be in a corridor, then force a turn into the side
5006 * corridor, must be moving straight into a corridor here. ???
5008 * Diagonal Corridor Blunt Corridor (?)
5013 static void run_init(int dir)
5015 int row, col, deepleft, deepright;
5016 int i, shortleft, shortright;
5019 /* Save the direction */
5022 /* Assume running straight */
5025 /* Assume looking for open area */
5026 find_openarea = TRUE;
5028 /* Assume not looking for breaks */
5029 find_breakright = find_breakleft = FALSE;
5031 /* Assume no nearby walls */
5032 deepleft = deepright = FALSE;
5033 shortright = shortleft = FALSE;
5038 /* Find the destination grid */
5039 row = py + ddy[dir];
5040 col = px + ddx[dir];
5042 /* Extract cycle index */
5045 /* Check for walls */
5046 if (see_wall(cycle[i+1], py, px))
5048 find_breakleft = TRUE;
5051 else if (see_wall(cycle[i+1], row, col))
5053 find_breakleft = TRUE;
5057 /* Check for walls */
5058 if (see_wall(cycle[i-1], py, px))
5060 find_breakright = TRUE;
5063 else if (see_wall(cycle[i-1], row, col))
5065 find_breakright = TRUE;
5069 /* Looking for a break */
5070 if (find_breakleft && find_breakright)
5072 /* Not looking for open area */
5073 find_openarea = FALSE;
5075 /* Hack -- allow angled corridor entry */
5078 if (deepleft && !deepright)
5080 find_prevdir = cycle[i - 1];
5082 else if (deepright && !deepleft)
5084 find_prevdir = cycle[i + 1];
5088 /* Hack -- allow blunt corridor entry */
5089 else if (see_wall(cycle[i], row, col))
5091 if (shortleft && !shortright)
5093 find_prevdir = cycle[i - 2];
5095 else if (shortright && !shortleft)
5097 find_prevdir = cycle[i + 2];
5105 * Update the current "run" path
5107 * Return TRUE if the running should be stopped
5109 static bool run_test(void)
5111 int prev_dir, new_dir, check_dir = 0;
5114 int option = 0, option2 = 0;
5117 /* Where we came from */
5118 prev_dir = find_prevdir;
5121 /* Range of newly adjacent grids */
5122 max = (prev_dir & 0x01) + 1;
5125 /* Look at every newly adjacent square. */
5126 for (i = -max; i <= max; i++)
5128 s16b this_o_idx, next_o_idx = 0;
5132 new_dir = cycle[chome[prev_dir] + i];
5135 row = py + ddy[new_dir];
5136 col = px + ddx[new_dir];
5139 c_ptr = &cave[row][col];
5142 /* Visible monsters abort running */
5145 monster_type *m_ptr = &m_list[c_ptr->m_idx];
5147 /* Visible monster */
5148 if (m_ptr->ml) return (TRUE);
5151 /* Visible objects abort running */
5152 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
5156 /* Acquire object */
5157 o_ptr = &o_list[this_o_idx];
5159 /* Acquire next object */
5160 next_o_idx = o_ptr->next_o_idx;
5162 /* Visible object */
5163 if (o_ptr->marked) return (TRUE);
5167 /* Assume unknown */
5170 /* Check memorized grids */
5171 if (c_ptr->info & (CAVE_MARK))
5175 /* Examine the terrain */
5176 switch (c_ptr->feat)
5191 /* Hidden treasure */
5196 case FEAT_WALL_EXTRA:
5197 case FEAT_WALL_INNER:
5198 case FEAT_WALL_OUTER:
5199 case FEAT_WALL_SOLID:
5200 case FEAT_PERM_EXTRA:
5201 case FEAT_PERM_INNER:
5202 case FEAT_PERM_OUTER:
5203 case FEAT_PERM_SOLID:
5204 /* dirt, grass, trees, ... */
5205 case FEAT_SHAL_WATER:
5208 case FEAT_DEEP_GRASS:
5221 /* quest features */
5222 case FEAT_QUEST_ENTER:
5223 case FEAT_QUEST_EXIT:
5232 case FEAT_DEEP_LAVA:
5233 case FEAT_SHAL_LAVA:
5236 if (p_ptr->invuln || p_ptr->immune_fire) notice = FALSE;
5242 case FEAT_DEEP_WATER:
5245 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;
5255 /* Option -- ignore */
5256 if (find_ignore_doors) notice = FALSE;
5265 case FEAT_LESS_LESS:
5266 case FEAT_MORE_MORE:
5269 /* Option -- ignore */
5270 if (find_ignore_stairs) notice = FALSE;
5277 /* Interesting feature */
5278 if (notice) return (TRUE);
5280 /* The grid is "visible" */
5284 /* Analyze unknown grids and floors */
5285 /* if (inv || cave_floor_bold(row, col) || */
5286 /* (cave[row][col].feat == FEAT_TREES)) */
5287 if (inv || cave_floor_bold(row, col))
5289 /* Looking for open area */
5295 /* The first new direction. */
5301 /* Three new directions. Stop running. */
5307 /* Two non-adjacent new directions. Stop running. */
5308 else if (option != cycle[chome[prev_dir] + i - 1])
5313 /* Two new (adjacent) directions (case 1) */
5314 else if (new_dir & 0x01)
5316 check_dir = cycle[chome[prev_dir] + i - 2];
5320 /* Two new (adjacent) directions (case 2) */
5323 check_dir = cycle[chome[prev_dir] + i + 1];
5329 /* Obstacle, while looking for open area */
5336 /* Break to the right */
5337 find_breakright = TRUE;
5342 /* Break to the left */
5343 find_breakleft = TRUE;
5350 /* Looking for open area */
5353 /* Hack -- look again */
5354 for (i = -max; i < 0; i++)
5356 new_dir = cycle[chome[prev_dir] + i];
5358 row = py + ddy[new_dir];
5359 col = px + ddx[new_dir];
5362 c_ptr = &cave[row][col];
5364 /* Unknown grid or non-wall XXX XXX XXX cave_floor_grid(c_ptr)) */
5365 if (!(c_ptr->info & (CAVE_MARK)) ||
5366 ((c_ptr->feat < FEAT_SECRET) ||
5367 (c_ptr->feat == FEAT_FLOWER) ||
5368 (c_ptr->feat == FEAT_DEEP_GRASS) ||
5369 ((c_ptr->feat >= FEAT_DEEP_WATER) &&
5370 (c_ptr->feat <= FEAT_GRASS))))
5373 /* Looking to break right */
5374 if (find_breakright)
5383 /* Looking to break left */
5391 /* Hack -- look again */
5392 for (i = max; i > 0; i--)
5394 new_dir = cycle[chome[prev_dir] + i];
5396 row = py + ddy[new_dir];
5397 col = px + ddx[new_dir];
5400 c_ptr = &cave[row][col];
5402 /* Unknown grid or non-wall XXX XXX XXX cave_floor_grid(c_ptr)) */
5403 if (!(c_ptr->info & (CAVE_MARK)) ||
5404 ((c_ptr->feat < FEAT_SECRET) ||
5405 (c_ptr->feat == FEAT_FLOWER) ||
5406 (c_ptr->feat == FEAT_DEEP_GRASS) ||
5407 ((c_ptr->feat >= FEAT_DEEP_WATER) &&
5408 (c_ptr->feat <= FEAT_GRASS))))
5411 /* Looking to break left */
5421 /* Looking to break right */
5422 if (find_breakright)
5431 /* Not looking for open area */
5443 /* Primary option */
5444 find_current = option;
5446 /* No other options */
5447 find_prevdir = option;
5450 /* Two options, examining corners */
5451 else if (find_examine && !find_cut)
5453 /* Primary option */
5454 find_current = option;
5456 /* Hack -- allow curving */
5457 find_prevdir = option2;
5460 /* Two options, pick one */
5463 /* Get next location */
5464 row = py + ddy[option];
5465 col = px + ddx[option];
5467 /* Don't see that it is closed off. */
5468 /* This could be a potential corner or an intersection. */
5469 if (!see_wall(option, row, col) ||
5470 !see_wall(check_dir, row, col))
5472 /* Can not see anything ahead and in the direction we */
5473 /* are turning, assume that it is a potential corner. */
5475 see_nothing(option, row, col) &&
5476 see_nothing(option2, row, col))
5478 find_current = option;
5479 find_prevdir = option2;
5482 /* STOP: we are next to an intersection or a room */
5489 /* This corner is seen to be enclosed; we cut the corner. */
5492 find_current = option2;
5493 find_prevdir = option2;
5496 /* This corner is seen to be enclosed, and we */
5497 /* deliberately go the long way. */
5500 find_current = option;
5501 find_prevdir = option2;
5507 /* About to hit a known wall, stop */
5508 if (see_wall(find_current, py, px))
5521 * Take one step along the current "run" path
5523 void run_step(int dir)
5528 /* Hack -- do not start silly run */
5529 if (see_wall(dir, py, px) &&
5530 (cave[py+ddy[dir]][px+ddx[dir]].feat != FEAT_TREES))
5534 msg_print("¤½¤ÎÊý¸þ¤Ë¤Ï¹Ô¤±¤Þ¤»¤ó¡£");
5536 msg_print("You cannot run in that direction.");
5547 /* Calculate torch radius */
5548 p_ptr->update |= (PU_TORCH);
5568 /* Decrease the run counter */
5569 if (--running <= 0) return;
5574 /* Move the player, using the "pickup" flag */
5575 #ifdef ALLOW_EASY_DISARM /* TNB */
5577 move_player(find_current, FALSE, FALSE);
5579 #else /* ALLOW_EASY_DISARM -- TNB */
5581 move_player(find_current, always_pickup, FALSE);
5583 #endif /* ALLOW_EASY_DISARM -- TNB */
5585 if ((py == p_ptr->run_py) && (px == p_ptr->run_px))