3 /* Purpose: Monster attacks */
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research,
9 * and not for profit purposes provided that this copyright and statement
10 * are included in all such copies. Other copyrights may also apply.
17 * Critical blow. All hits that do 95% of total possible damage,
18 * and which also do at least 20 damage, or, sometimes, N damage.
19 * This is used only to determine "cuts" and "stuns".
21 static int monster_critical(int dice, int sides, int dam)
24 int total = dice * sides;
26 /* Must do at least 95% of perfect */
27 if (dam < total * 19 / 20) return (0);
29 /* Weak blows rarely work */
30 if ((dam < 20) && (randint0(100) >= dam)) return (0);
33 if (dam == total && dam >= 40) max++;
38 while (randint0(100) < 2) max++;
42 if (dam > 45) return (6 + max);
43 if (dam > 33) return (5 + max);
44 if (dam > 25) return (4 + max);
45 if (dam > 18) return (3 + max);
46 if (dam > 11) return (2 + max);
55 * Determine if a monster attack against the player succeeds.
56 * Always miss 5% of the time, Always hit 5% of the time.
57 * Otherwise, match monster power against player armor.
59 static int check_hit(int power, int level, int stun)
66 if (stun && one_in_(2)) return FALSE;
68 /* Hack -- Always miss or hit */
69 if (k < 10) return (k < 5);
71 /* Calculate the "attack quality" */
72 i = (power + (level * 3));
75 ac = p_ptr->ac + p_ptr->to_a;
76 if (p_ptr->special_attack & ATTACK_SUIKEN) ac += (p_ptr->lev * 2);
78 /* Power and Level compete against Armor */
79 if ((i > 0) && (randint1(i) > ((ac * 3) / 4))) return (TRUE);
88 * Hack -- possible "insult" messages
90 static cptr desc_insult[] =
93 "¤¬¤¢¤Ê¤¿¤òÉî¿«¤·¤¿¡ª",
94 "¤¬¤¢¤Ê¤¿¤ÎÊì¤òÉî¿«¤·¤¿¡ª",
95 "¤¬¤¢¤Ê¤¿¤ò·ÚÊΤ·¤¿¡ª",
98 "¤¬¤¢¤Ê¤¿¤Î²ó¤ê¤ÇÍ٤ä¿¡ª",
99 "¤¬àÐêø¤Ê¿È¤Ö¤ê¤ò¤·¤¿¡ª",
100 "¤¬¤¢¤Ê¤¿¤ò¤Ü¤ó¤ä¤ê¤È¸«¤¿¡ª¡ª¡ª",
101 "¤¬¤¢¤Ê¤¿¤ò¥Ñ¥é¥µ¥¤¥È¸Æ¤Ð¤ï¤ê¤·¤¿¡ª",
102 "¤¬¤¢¤Ê¤¿¤ò¥µ¥¤¥Ü¡¼¥°°·¤¤¤·¤¿¡ª"
105 "insults your mother!",
106 "gives you the finger!",
109 "dances around you!",
110 "makes obscene gestures!",
112 "calls you a parasite!",
113 "calls you a cyborg!"
121 * Hack -- possible "insult" messages
123 static cptr desc_moan[] =
126 "¤Ï²¿¤«¤òÈᤷ¤ó¤Ç¤¤¤ë¤è¤¦¤À¡£",
127 "¤¬Èà¤Î»ô¤¤¸¤¤ò¸«¤Ê¤«¤Ã¤¿¤«¤È¿Ò¤Í¤Æ¤¤¤ë¡£",
128 "¤¬ÆìÄ¥¤ê¤«¤é½Ð¤Æ¹Ô¤±¤È¸À¤Ã¤Æ¤¤¤ë¡£",
129 "¤Ï¥¥Î¥³¤¬¤É¤¦¤È¤«Ò줤¤Æ¤¤¤ë¡£"
131 "seems sad about something.",
132 "asks if you have seen his dogs.",
133 "tells you to get off his land.",
134 "mumbles something about mushrooms."
141 * Attack the player via physical attacks.
143 bool make_attack_normal(int m_idx)
145 monster_type *m_ptr = &m_list[m_idx];
147 monster_race *r_ptr = &r_info[m_ptr->r_idx];
151 int i, k, tmp, ac, rlev;
160 char o_name[MAX_NLEN];
167 bool touched = FALSE, fear = FALSE, alive = TRUE;
168 bool explode = FALSE;
169 bool resist_drain = FALSE;
170 bool do_silly_attack = (one_in_(2) && p_ptr->image);
174 /* Not allowed to attack */
175 if (r_ptr->flags1 & (RF1_NEVER_BLOW)) return (FALSE);
177 if (d_info[dungeon_type].flags1 & DF1_NO_MELEE) return (FALSE);
179 /* ...nor if friendly */
180 if (!is_hostile(m_ptr)) return FALSE;
182 /* Extract the effective monster level */
183 rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
186 /* Get the monster name (or "it") */
187 monster_desc(m_name, m_ptr, 0);
189 /* Get the "died from" information (i.e. "a kobold") */
190 monster_desc(ddesc, m_ptr, 0x288);
192 if (p_ptr->special_defense & KATA_IAI)
195 msg_print("Áê¼ê¤¬½±¤¤¤«¤«¤ëÁ°¤ËÁÇÁ᤯Éð´ï¤ò¿¶¤ë¤Ã¤¿¡£");
197 msg_format("You took sen, draw and cut in one motion before %s move.", m_name);
199 if (py_attack(m_ptr->fy, m_ptr->fx, HISSATSU_IAI)) return TRUE;
202 if ((p_ptr->special_defense & NINJA_KAWARIMI) && (randint0(55) < (p_ptr->lev*3/5+20)))
208 /* Assume no blink */
211 /* Scan through all four blows */
212 for (ap_cnt = 0; ap_cnt < 4; ap_cnt++)
214 bool visible = FALSE;
215 bool obvious = FALSE;
222 /* Extract the attack infomation */
223 int effect = r_ptr->blow[ap_cnt].effect;
224 int method = r_ptr->blow[ap_cnt].method;
225 int d_dice = r_ptr->blow[ap_cnt].d_dice;
226 int d_side = r_ptr->blow[ap_cnt].d_side;
229 if (!m_ptr->r_idx) break;
231 /* Hack -- no more attacks */
234 if (is_pet(m_ptr) && (r_ptr->flags1 & RF1_UNIQUE) && (method == RBM_EXPLODE))
240 /* Stop if player is dead or gone */
241 if (!p_ptr->playing || p_ptr->is_dead) break;
242 if (distance(py, px, m_ptr->fy, m_ptr->fx) > 1) break;
244 /* Handle "leaving" */
245 if (p_ptr->leaving) break;
247 if (method == RBM_SHOOT) continue;
249 /* Extract visibility (before blink) */
250 if (m_ptr->ml) visible = TRUE;
252 /* Extract the attack "power" */
253 power = mbe_info[effect].power;
256 ac = p_ptr->ac + p_ptr->to_a;
258 /* Monster hits player */
259 if (!effect || check_hit(power, rlev, m_ptr->stunned))
261 /* Always disturbing */
265 /* Hack -- Apply "protection from evil" */
266 if ((p_ptr->protevil > 0) &&
267 (r_ptr->flags3 & RF3_EVIL) &&
268 (p_ptr->lev >= rlev) &&
269 ((randint0(100) + p_ptr->lev) > 50))
271 /* Remember the Evil-ness */
274 r_ptr->r_flags3 |= RF3_EVIL;
280 msg_format("·âÂष¤¿¡£");
282 msg_format("%^s¤Ï·âÂव¤ì¤¿¡£", m_name);
283 syouryaku = 1;/*£²²óÌܰʹߤϾÊά */
285 msg_format("%^s is repelled.", m_name);
289 /* Hack -- Next attack */
294 /* Assume no cut or stun */
295 do_cut = do_stun = 0;
297 /* Describe the attack method */
308 do_cut = do_stun = 1;
319 act = "touches you.";
330 act = "¥Ñ¥ó¥Á¤µ¤ì¤¿¡£";
332 act = "punches you.";
358 act = "¤Ò¤Ã¤«¤«¤ì¤¿¡£";
401 act = "slashes you.";
413 act = "³Ñ¤ÇÆͤ«¤ì¤¿¡£";
427 act = "ÂÎÅö¤¿¤ê¤µ¤ì¤¿¡£";
429 act = "crushes you.";
441 act = "°û¤ß¹þ¤Þ¤ì¤¿¡£";
443 act = "engulfs you.";
455 act = "¤ÏÀÁµá½ñ¤ò¤è¤³¤·¤¿¡£";
457 act = "charges you.";
461 sound(SOUND_BUY); /* Note! This is "charges", not "charges at". */
469 act = "¤¬ÂΤξå¤òÇ礤²ó¤Ã¤¿¡£";
471 act = "crawls on you.";
482 act = "¤è¤À¤ì¤ò¤¿¤é¤µ¤ì¤¿¡£";
484 act = "drools on you.";
494 act = "ÂäòÅǤ«¤ì¤¿¡£";
496 act = "spits on you.";
507 act = "¤ÏÇúȯ¤·¤¿¡£";
519 act = "¤Ë¤é¤Þ¤ì¤¿¡£";
521 act = "gazes at you.";
530 act = "µã¤¶«¤Ð¤ì¤¿¡£";
532 act = "wails at you.";
542 act = "˦»Ò¤òÈô¤Ð¤µ¤ì¤¿¡£";
544 act = "releases spores at you.";
555 act = "¤¬ XXX4 ¤òȯ¼Í¤·¤¿¡£";
557 act = "projects XXX4's at you.";
566 act = "¶â¤ò¤»¤¬¤Þ¤ì¤¿¡£";
568 act = "begs you for money.";
578 act = desc_insult[randint0(m_ptr->r_idx == MON_DEBBY ? 10 : 8)];
586 act = desc_moan[randint0(4)];
594 if (m_ptr->r_idx == MON_JAIAN)
602 act = "¡Ö¢ö¤ª¡Á¤ì¤Ï¥¸¥ã¥¤¥¢¥ó¡Á¡Á¥¬¡Á¥¤À¤¤¤·¤ç¤¦¡Á¡×";
605 act = "¡Ö¢ö¤Æ¡Á¤ó¤«¤à¡Á¤Æ¤¤Î¤ª¡Á¤È¤³¤À¤¼¡Á¡Á¡×";
608 act = "¡Ö¢ö¤Î¡Á¤ÓÂÀ¥¹¥ÍÉפϥᤸ¤ã¤Ê¤¤¤è¡Á¡Á¡×";
611 act = "¡Ö¢ö¤±¡Á¤ó¤«¥¹¥Ý¡Á¥Ä¡Á¤É¤ó¤È¤³¤¤¡Á¡×";
614 act = "¡Ö¢ö¤¦¤¿¡Á¤â¡Á¡Á¤¦¡Á¤Þ¤¤¤¼¡Á¤Þ¤«¤·¤È¤±¡Á¡×";
617 act = "¡Ö¢ö¤Þ¡Á¤Á¤¤¤Á¤Ð¡Á¤ó¤Î¤Ë¡Á¤ó¤¤â¤Î¡Á¡Á¡×";
620 act = "¡Ö¢ö¤Ù¤ó¤¤ç¤¦¤·¤å¤¯¤À¤¤¥á¤¸¤ã¤Ê¤¤¤è¡Á¡Á¡×";
623 act = "¡Ö¢ö¤¤Ï¤ä¤µ¤·¡Á¤¯¤Æ¡Á¤Á¡Á¤«¤é¤â¤Á¡Á¡×";
626 act = "¡Ö¢ö¤«¤ª¡Á¤â¡Á¡Á¥¹¥¿¥¤¥ë¤â¡Á¥Ð¥Ä¥°¥ó¤µ¡Á¡×";
629 act = "¡Ö¢ö¤¬¤Ã¤³¤¦¤¤¡Á¤Á¤Î¡Á¤¢¡Á¤Ð¤ì¤ó¤Ü¤¦¡Á¡Á¡×";
632 act = "¡Ö¢ö¥É¡Á¥é¤â¥É¥é¥ß¤â¥á¤¸¤ã¤Ê¤¤¤è¡Á¡Á¡×";
635 act = "¡Ö¢ö¤è¤¸¤²¤ó¤Ý¤±¤Ã¤È¡Á¤Ê¡Á¤¯¤¿¤Ã¤Æ¡Á¡×";
638 act = "¡Ö¢ö¤¢¤·¡Á¤Î¡Á¡Á¤Ê¤¬¤µ¡Á¤Ï¡Á¤Þ¤±¤Ê¤¤¤¼¡Á¡×";
642 act = "horribly sings 'I AM GIAAAAAN. THE BOOOSS OF THE KIIIIDS.'";
649 act = "¤Ï¢öËͤé¤Ï³Ú¤·¤¤²È²¢ö¤È²Î¤Ã¤Æ¤¤¤ë¡£";
651 act = "¤Ï¢ö¥¢¥¤ ¥é¥Ö ¥æ¡¼¡¢¥æ¡¼ ¥é¥Ö ¥ß¡¼¢ö¤È²Î¤Ã¤Æ¤¤¤ë¡£";
653 act = "sings 'We are a happy family.'";
655 act = "sings 'I love you, you love me.'";
670 act = silly_attacks[randint0(MAX_SILLY_ATTACK)];
674 msg_format("%^s¤Ë%s", m_name, act);
675 else if(syouryaku==1)
676 msg_format("%s", act);
677 else /*if(syouryaku==-1)*/
678 msg_format("%^s%s", m_name, act);
679 syouryaku = 1;/*£²²óÌܰʹߤϾÊά */
681 msg_format("%^s %s", m_name, act);
685 /* Hack -- assume all attacks are obvious */
688 /* Roll out the damage */
689 damage = damroll(d_dice, d_side);
692 * Skip the effect when exploding, since the explosion
693 * already causes the effect.
697 /* Apply appropriate damage */
702 /* Hack -- Assume obvious */
705 /* Hack -- No damage */
713 if ((randint1(rlev*2+300) > (ac+200)) || one_in_(13)) {
714 int tmp_damage = damage-(damage*((ac < 150) ? ac : 150)/250);
716 msg_print("Ä˺¨¤Î°ì·â¡ª");
718 msg_print("It was a critical hit!");
721 tmp_damage = MAX(damage, tmp_damage*2);
724 get_damage += take_hit(DAMAGE_ATTACK, tmp_damage, ddesc, -1);
733 /* Hack -- Player armor reduces total damage */
734 damage -= (damage * ((ac < 150) ? ac : 150) / 250);
737 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
746 /* Take "poison" effect */
747 if (!(p_ptr->resist_pois || p_ptr->oppose_pois))
749 if (set_poisoned(p_ptr->poisoned + randint1(rlev) + 5))
755 /* Take some damage */
756 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
758 /* Learn about the player */
759 update_smart_learn(m_idx, DRS_POIS);
768 /* Allow complete resist */
769 if (!p_ptr->resist_disen)
771 /* Apply disenchantment */
772 if (apply_disenchant(0))
774 /* Hack -- Update AC */
780 /* Take some damage */
781 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
783 /* Learn about the player */
784 update_smart_learn(m_idx, DRS_DISEN);
791 /* Take some damage */
792 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
794 if (p_ptr->is_dead) break;
797 for (k = 0; k < 10; k++)
800 i = randint0(INVEN_PACK);
802 /* Obtain the item */
803 o_ptr = &inventory[i];
805 /* Skip non-objects */
806 if (!o_ptr->k_idx) continue;
808 /* Drain charged wands/staffs */
809 if (((o_ptr->tval == TV_STAFF) ||
810 (o_ptr->tval == TV_WAND)) &&
813 /* Calculate healed hitpoints */
814 int heal=rlev * o_ptr->pval;
815 if( o_ptr->tval == TV_STAFF)
816 heal *= o_ptr->number;
818 /* Don't heal more than max hp */
819 heal = MIN(heal, m_ptr->maxhp - m_ptr->hp);
823 msg_print("¥¶¥Ã¥¯¤«¤é¥¨¥Í¥ë¥®¡¼¤¬µÛ¤¤¼è¤é¤ì¤¿¡ª");
825 msg_print("Energy drains from your pack!");
832 /* Heal the monster */
835 /* Redraw (later) if needed */
836 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
837 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
842 /* Combine / Reorder the pack */
843 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
846 p_ptr->window |= (PW_INVEN);
858 /* Take some damage */
859 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
861 /* Confused monsters cannot steal successfully. -LM-*/
862 if (m_ptr->confused) break;
864 if (p_ptr->is_dead) break;
869 /* Saving throw (unless paralyzed) based on dex and level */
870 if (!p_ptr->paralyzed &&
871 (randint0(100) < (adj_dex_safe[p_ptr->stat_ind[A_DEX]] +
874 /* Saving throw message */
876 msg_print("¤·¤«¤·ÁÇÁ᤯ºâÉÛ¤ò¼é¤Ã¤¿¡ª");
878 msg_print("You quickly protect your money pouch!");
882 /* Occasional blink anyway */
883 if (randint0(3)) blinked = TRUE;
889 gold = (p_ptr->au / 10) + randint1(25);
890 if (gold < 2) gold = 2;
891 if (gold > 5000) gold = (p_ptr->au / 20) + randint1(3000);
892 if (gold > p_ptr->au) gold = p_ptr->au;
897 msg_print("¤·¤«¤·²¿¤âÅð¤Þ¤ì¤Ê¤«¤Ã¤¿¡£");
899 msg_print("Nothing was stolen.");
906 msg_print("ºâÉÛ¤¬·Ú¤¯¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
907 msg_format("$%ld ¤Î¤ª¶â¤¬Åð¤Þ¤ì¤¿¡ª", (long)gold);
909 msg_print("Your purse feels lighter.");
910 msg_format("%ld coins were stolen!", (long)gold);
912 chg_virtue(V_SACRIFICE, 1);
917 msg_print("ºâÉÛ¤¬·Ú¤¯¤Ê¤Ã¤¿µ¤¤¬¤¹¤ë¡£");
918 msg_print("¤ª¶â¤¬Á´ÉôÅð¤Þ¤ì¤¿¡ª");
920 msg_print("Your purse feels lighter.");
921 msg_print("All of your coins were stolen!");
924 chg_virtue(V_SACRIFICE, 2);
928 p_ptr->redraw |= (PR_GOLD);
931 p_ptr->window |= (PW_PLAYER);
942 /* Take some damage */
943 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
945 /* Confused monsters cannot steal successfully. -LM-*/
946 if (m_ptr->confused) break;
948 if (p_ptr->is_dead) break;
950 /* Saving throw (unless paralyzed) based on dex and level */
951 if (!p_ptr->paralyzed &&
952 (randint0(100) < (adj_dex_safe[p_ptr->stat_ind[A_DEX]] +
955 /* Saving throw message */
957 msg_print("¤·¤«¤·¤¢¤ï¤Æ¤Æ¥¶¥Ã¥¯¤ò¼è¤êÊÖ¤·¤¿¡ª");
959 msg_print("You grab hold of your backpack!");
963 /* Occasional "blink" anyway */
974 for (k = 0; k < 10; k++)
979 i = randint0(INVEN_PACK);
981 /* Obtain the item */
982 o_ptr = &inventory[i];
984 /* Skip non-objects */
985 if (!o_ptr->k_idx) continue;
988 if (artifact_p(o_ptr) || o_ptr->art_name) continue;
990 /* Get a description */
991 object_desc(o_name, o_ptr, FALSE, 3);
995 msg_format("%s(%c)¤ò%sÅð¤Þ¤ì¤¿¡ª",
996 o_name, index_to_label(i),
997 ((o_ptr->number > 1) ? "°ì¤Ä" : ""));
999 msg_format("%sour %s (%c) was stolen!",
1000 ((o_ptr->number > 1) ? "One of y" : "Y"),
1001 o_name, index_to_label(i));
1004 chg_virtue(V_SACRIFICE, 1);
1007 /* Make an object */
1015 /* Get new object */
1016 j_ptr = &o_list[o_idx];
1019 object_copy(j_ptr, o_ptr);
1024 /* Hack -- If a rod or wand, allocate total
1025 * maximum timeouts or charges between those
1026 * stolen and those missed. -LM-
1028 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
1030 k_ptr = &k_info[o_ptr->k_idx];
1031 j_ptr->pval = o_ptr->pval / o_ptr->number;
1032 o_ptr->pval -= j_ptr->pval;
1038 /* Memorize monster */
1039 j_ptr->held_m_idx = m_idx;
1042 j_ptr->next_o_idx = m_ptr->hold_o_idx;
1045 m_ptr->hold_o_idx = o_idx;
1048 /* Steal the items */
1049 inven_item_increase(i, -1);
1050 inven_item_optimize(i);
1067 /* Take some damage */
1068 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1070 if (p_ptr->is_dead) break;
1072 /* Steal some food */
1073 for (k = 0; k < 10; k++)
1075 /* Pick an item from the pack */
1076 i = randint0(INVEN_PACK);
1079 o_ptr = &inventory[i];
1081 /* Skip non-objects */
1082 if (!o_ptr->k_idx) continue;
1084 /* Skip non-food objects */
1085 if ((o_ptr->tval != TV_FOOD) && !((o_ptr->tval == TV_CORPSE) && (o_ptr->sval))) continue;
1087 /* Get a description */
1088 object_desc(o_name, o_ptr, FALSE, 0);
1092 msg_format("%s(%c)¤ò%s¿©¤Ù¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª",
1093 o_name, index_to_label(i),
1094 ((o_ptr->number > 1) ? "°ì¤Ä" : ""));
1096 msg_format("%sour %s (%c) was eaten!",
1097 ((o_ptr->number > 1) ? "One of y" : "Y"),
1098 o_name, index_to_label(i));
1102 /* Steal the items */
1103 inven_item_increase(i, -1);
1104 inven_item_optimize(i);
1118 /* Access the lite */
1119 o_ptr = &inventory[INVEN_LITE];
1121 /* Take some damage */
1122 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1124 if (p_ptr->is_dead) break;
1127 if ((o_ptr->xtra4 > 0) && (!artifact_p(o_ptr)))
1130 o_ptr->xtra4 -= (250 + randint1(250));
1131 if (o_ptr->xtra4 < 1) o_ptr->xtra4 = 1;
1137 msg_print("ÌÀ¤«¤ê¤¬°Å¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
1139 msg_print("Your light dims.");
1146 p_ptr->window |= (PW_EQUIP);
1160 msg_print("»À¤òÍá¤Ó¤»¤é¤ì¤¿¡ª");
1162 msg_print("You are covered in acid!");
1166 /* Special damage */
1167 get_damage += acid_dam(damage, ddesc, -1);
1169 /* Hack -- Update AC */
1172 /* Learn about the player */
1173 update_smart_learn(m_idx, DRS_ACID);
1186 msg_print("ÅÅ·â¤òÍá¤Ó¤»¤é¤ì¤¿¡ª");
1188 msg_print("You are struck by electricity!");
1192 /* Special damage */
1193 get_damage += elec_dam(damage, ddesc, -1);
1195 /* Learn about the player */
1196 update_smart_learn(m_idx, DRS_ELEC);
1209 msg_print("Á´¿È¤¬±ê¤ËÊñ¤Þ¤ì¤¿¡ª");
1211 msg_print("You are enveloped in flames!");
1215 /* Special damage */
1216 get_damage += fire_dam(damage, ddesc, -1);
1218 /* Learn about the player */
1219 update_smart_learn(m_idx, DRS_FIRE);
1232 msg_print("Á´¿È¤¬Î䵤¤Çʤ¤ï¤ì¤¿¡ª");
1234 msg_print("You are covered with frost!");
1238 /* Special damage */
1239 get_damage += cold_dam(damage, ddesc, -1);
1241 /* Learn about the player */
1242 update_smart_learn(m_idx, DRS_COLD);
1250 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1252 if (p_ptr->is_dead) break;
1254 /* Increase "blind" */
1255 if (!p_ptr->resist_blind)
1257 if (set_blind(p_ptr->blind + 10 + randint1(rlev)))
1260 if(m_ptr->r_idx == MON_DIO) msg_print("¤É¤¦¤À¥Ã¡ª¤³¤Î·ì¤ÎÌÜÄÙ¤·¤Ï¥Ã¡ª");
1268 /* Learn about the player */
1269 update_smart_learn(m_idx, DRS_BLIND);
1278 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1280 if (p_ptr->is_dead) break;
1282 /* Increase "confused" */
1283 if (!p_ptr->resist_conf)
1285 if (set_confused(p_ptr->confused + 3 + randint1(rlev)))
1291 /* Learn about the player */
1292 update_smart_learn(m_idx, DRS_CONF);
1300 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1302 if (p_ptr->is_dead) break;
1304 /* Increase "afraid" */
1305 if (p_ptr->resist_fear)
1308 msg_print("¤·¤«¤·¶²Éݤ˿¯¤µ¤ì¤Ê¤«¤Ã¤¿¡ª");
1310 msg_print("You stand your ground!");
1315 else if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
1318 msg_print("¤·¤«¤·¶²Éݤ˿¯¤µ¤ì¤Ê¤«¤Ã¤¿¡ª");
1320 msg_print("You stand your ground!");
1327 if (set_afraid(p_ptr->afraid + 3 + randint1(rlev)))
1333 /* Learn about the player */
1334 update_smart_learn(m_idx, DRS_FEAR);
1342 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1344 if (p_ptr->is_dead) break;
1346 /* Increase "paralyzed" */
1347 if (p_ptr->free_act)
1350 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
1352 msg_print("You are unaffected!");
1357 else if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
1360 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
1362 msg_print("You resist the effects!");
1369 if (!p_ptr->paralyzed)
1371 if (set_paralyzed(3 + randint1(rlev)))
1378 /* Learn about the player */
1379 update_smart_learn(m_idx, DRS_FREE);
1386 /* Damage (physical) */
1387 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1389 if (p_ptr->is_dead) break;
1392 if (do_dec_stat(A_STR)) obvious = TRUE;
1399 /* Damage (physical) */
1400 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1402 if (p_ptr->is_dead) break;
1405 if (do_dec_stat(A_INT)) obvious = TRUE;
1412 /* Damage (physical) */
1413 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1415 if (p_ptr->is_dead) break;
1418 if (do_dec_stat(A_WIS)) obvious = TRUE;
1425 /* Damage (physical) */
1426 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1428 if (p_ptr->is_dead) break;
1431 if (do_dec_stat(A_DEX)) obvious = TRUE;
1438 /* Damage (physical) */
1439 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1441 if (p_ptr->is_dead) break;
1444 if (do_dec_stat(A_CON)) obvious = TRUE;
1451 /* Damage (physical) */
1452 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1454 if (p_ptr->is_dead) break;
1457 if (do_dec_stat(A_CHR)) obvious = TRUE;
1464 /* Damage (physical) */
1465 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1467 if (p_ptr->is_dead) break;
1469 /* Damage (stats) */
1470 if (do_dec_stat(A_STR)) obvious = TRUE;
1471 if (do_dec_stat(A_DEX)) obvious = TRUE;
1472 if (do_dec_stat(A_CON)) obvious = TRUE;
1473 if (do_dec_stat(A_INT)) obvious = TRUE;
1474 if (do_dec_stat(A_WIS)) obvious = TRUE;
1475 if (do_dec_stat(A_CHR)) obvious = TRUE;
1485 /* Hack -- Reduce damage based on the player armor class */
1486 damage -= (damage * ((ac < 150) ? ac : 150) / 250);
1489 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1491 /* Radius 8 earthquake centered at the monster */
1492 if (damage > 23 || explode)
1494 earthquake(m_ptr->fy, m_ptr->fx, 8);
1502 s32b d = damroll(10, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
1508 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1510 if (p_ptr->is_dead) break;
1512 (void)drain_exp(d, d / 10, 95);
1518 s32b d = damroll(20, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
1524 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1526 if (p_ptr->is_dead) break;
1528 (void)drain_exp(d, d / 10, 90);
1534 s32b d = damroll(40, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
1540 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1542 if (p_ptr->is_dead) break;
1544 (void)drain_exp(d, d / 10, 75);
1550 s32b d = damroll(80, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
1556 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1558 if (p_ptr->is_dead) break;
1560 (void)drain_exp(d, d / 10, 50);
1566 /* Take some damage */
1567 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1569 if (p_ptr->is_dead) break;
1571 /* Take "poison" effect */
1572 if (!(p_ptr->resist_pois || p_ptr->oppose_pois))
1574 if (set_poisoned(p_ptr->poisoned + randint1(rlev) + 5))
1580 /* Damage CON (10% chance)*/
1581 if ((randint1(100) < 11) && (p_ptr->prace != RACE_ANDROID))
1583 /* 1% chance for perm. damage */
1584 bool perm = one_in_(10);
1585 if (dec_stat(A_CON, randint1(10), perm))
1588 msg_print("ɤ¬¤¢¤Ê¤¿¤ò¿ª¤ó¤Ç¤¤¤ëµ¤¤¬¤¹¤ë¡£");
1590 msg_print("You feel strange sickness.");
1602 if (!p_ptr->resist_time)
1604 switch (randint1(10))
1606 case 1: case 2: case 3: case 4: case 5:
1608 if (p_ptr->prace == RACE_ANDROID) break;
1610 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
1612 msg_print("You feel life has clocked back.");
1615 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
1619 case 6: case 7: case 8: case 9:
1621 int stat = randint0(6);
1626 case A_STR: act = "¶¯¤¯"; break;
1627 case A_INT: act = "ÁïÌÀ¤Ç"; break;
1628 case A_WIS: act = "¸ÌÀ¤Ç"; break;
1629 case A_DEX: act = "´ïÍѤÇ"; break;
1630 case A_CON: act = "·ò¹¯¤Ç"; break;
1631 case A_CHR: act = "Èþ¤·¤¯"; break;
1633 case A_STR: act = "strong"; break;
1634 case A_INT: act = "bright"; break;
1635 case A_WIS: act = "wise"; break;
1636 case A_DEX: act = "agile"; break;
1637 case A_CON: act = "hale"; break;
1638 case A_CHR: act = "beautiful"; break;
1644 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
1646 msg_format("You're not as %s as you used to be...", act);
1650 p_ptr->stat_cur[stat] = (p_ptr->stat_cur[stat] * 3) / 4;
1651 if (p_ptr->stat_cur[stat] < 3) p_ptr->stat_cur[stat] = 3;
1652 p_ptr->update |= (PU_BONUS);
1659 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
1661 msg_print("You're not as powerful as you used to be...");
1665 for (k = 0; k < 6; k++)
1667 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
1668 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
1670 p_ptr->update |= (PU_BONUS);
1675 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1681 s32b d = damroll(60, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
1687 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1689 if (p_ptr->is_dead) break;
1691 resist_drain = !drain_exp(d, d / 10, 50);
1693 /* Heal the attacker? */
1694 if (p_ptr->mimic_form)
1696 if (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING)
1697 resist_drain = TRUE;
1701 switch (p_ptr->prace)
1710 resist_drain = TRUE;
1715 if ((damage > 5) && !resist_drain)
1717 bool did_heal = FALSE;
1719 if (m_ptr->hp < m_ptr->maxhp) did_heal = TRUE;
1722 m_ptr->hp += damroll(4, damage / 6);
1723 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
1725 /* Redraw (later) if needed */
1726 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
1727 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
1729 /* Special message */
1730 if ((m_ptr->ml) && (did_heal))
1733 msg_format("%s¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£", m_name);
1735 msg_format("%^s appears healthier.", m_name);
1745 bool did_heal = FALSE;
1753 p_ptr->csp -= damage;
1757 p_ptr->csp_frac = 0;
1760 if (m_ptr->hp < m_ptr->maxhp) did_heal = TRUE;
1762 p_ptr->redraw |= (PR_MANA);
1768 /* Hack -- only one of cut or stun */
1769 if (do_cut && do_stun)
1772 if (randint0(100) < 50)
1789 /* Critical hit (zero if non-critical) */
1790 tmp = monster_critical(d_dice, d_side, damage);
1792 /* Roll for damage */
1795 case 0: k = 0; break;
1796 case 1: k = randint1(5); break;
1797 case 2: k = randint1(5) + 5; break;
1798 case 3: k = randint1(20) + 20; break;
1799 case 4: k = randint1(50) + 50; break;
1800 case 5: k = randint1(100) + 100; break;
1801 case 6: k = 300; break;
1802 default: k = 500; break;
1806 if (k) (void)set_cut(p_ptr->cut + k);
1814 /* Critical hit (zero if non-critical) */
1815 tmp = monster_critical(d_dice, d_side, damage);
1817 /* Roll for damage */
1820 case 0: k = 0; break;
1821 case 1: k = randint1(5); break;
1822 case 2: k = randint1(5) + 10; break;
1823 case 3: k = randint1(10) + 20; break;
1824 case 4: k = randint1(15) + 30; break;
1825 case 5: k = randint1(20) + 40; break;
1826 case 6: k = 80; break;
1827 default: k = 150; break;
1830 /* Apply the stun */
1831 if (k) (void)set_stun(p_ptr->stun + k);
1836 sound(SOUND_EXPLODE);
1838 if (mon_take_hit(m_idx, m_ptr->hp + 1, &fear, NULL))
1847 if (p_ptr->sh_fire && alive && !p_ptr->is_dead)
1849 if (!(r_ptr->flags3 & RF3_IM_FIRE))
1851 int dam = damroll(2, 6);
1853 /* Modify the damage */
1854 dam = mon_damage_mod(m_ptr, dam, FALSE);
1857 msg_format("%^s¤ÏÆÍÁ³Ç®¤¯¤Ê¤Ã¤¿¡ª", m_name);
1858 if (mon_take_hit(m_idx, dam, &fear,
1859 "¤Ï³¥¤Î»³¤Ë¤Ê¤Ã¤¿¡£"))
1861 msg_format("%^s is suddenly very hot!", m_name);
1863 if (mon_take_hit(m_idx, dam, &fear,
1864 " turns into a pile of ash."))
1875 r_ptr->r_flags3 |= RF3_IM_FIRE;
1879 if (p_ptr->sh_elec && alive && !p_ptr->is_dead)
1881 if (!(r_ptr->flags3 & RF3_IM_ELEC))
1883 int dam = damroll(2, 6);
1885 /* Modify the damage */
1886 dam = mon_damage_mod(m_ptr, dam, FALSE);
1889 msg_format("%^s¤ÏÅÅ·â¤ò¤¯¤é¤Ã¤¿¡ª", m_name);
1890 if (mon_take_hit(m_idx, dam, &fear,
1891 "¤Ïdz¤¨³Ì¤Î»³¤Ë¤Ê¤Ã¤¿¡£"))
1893 msg_format("%^s gets zapped!", m_name);
1895 if (mon_take_hit(m_idx, dam, &fear,
1896 " turns into a pile of cinder."))
1907 r_ptr->r_flags3 |= RF3_IM_ELEC;
1911 if (p_ptr->sh_cold && alive && !p_ptr->is_dead)
1913 if (!(r_ptr->flags3 & RF3_IM_COLD))
1915 int dam = damroll(2, 6);
1917 /* Modify the damage */
1918 dam = mon_damage_mod(m_ptr, dam, FALSE);
1921 msg_format("%^s¤ÏÎ䵤¤ò¤¯¤é¤Ã¤¿¡ª", m_name);
1922 if (mon_take_hit(m_idx, dam, &fear,
1925 msg_format("%^s is very cold!", m_name);
1927 if (mon_take_hit(m_idx, dam, &fear,
1939 r_ptr->r_flags3 |= RF3_IM_COLD;
1944 if (p_ptr->dustrobe && alive && !p_ptr->is_dead)
1946 if (!(r_ptr->flags4 & RF4_BR_SHAR))
1948 int dam = damroll(2, 6);
1950 /* Modify the damage */
1951 dam = mon_damage_mod(m_ptr, dam, FALSE);
1954 msg_format("%^s¤Ï¶À¤ÎÇËÊÒ¤ò¤¯¤é¤Ã¤¿¡ª", m_name);
1955 if (mon_take_hit(m_idx, dam, &fear,
1956 "¤Ï¥º¥¿¥º¥¿¤Ë¤Ê¤Ã¤¿¡£"))
1958 msg_format("%^s gets zapped!", m_name);
1960 if (mon_take_hit(m_idx, dam, &fear,
1961 " had torn to pieces."))
1969 if (is_mirror_grid(&cave[py][px])) {
1970 teleport_player(10);
1974 if (p_ptr->tim_sh_holy && alive && !p_ptr->is_dead)
1976 if (r_ptr->flags3 & RF3_EVIL)
1978 int dam = damroll(2, 6);
1980 /* Modify the damage */
1981 dam = mon_damage_mod(m_ptr, dam, FALSE);
1984 msg_format("%^s¤ÏÀ»¤Ê¤ë¥ª¡¼¥é¤Ç½ý¤Ä¤¤¤¿¡ª", m_name);
1985 if (mon_take_hit(m_idx, dam, &fear,
1988 msg_format("%^s is injured by holy power!", m_name);
1990 if (mon_take_hit(m_idx, dam, &fear,
1999 r_ptr->r_flags3 |= RF3_EVIL;
2003 if (p_ptr->tim_sh_touki && alive && !p_ptr->is_dead)
2005 int dam = damroll(2, 6);
2007 /* Modify the damage */
2008 dam = mon_damage_mod(m_ptr, dam, FALSE);
2011 msg_format("%^s¤¬±Ô¤¤Æ®µ¤¤Î¥ª¡¼¥é¤Ç½ý¤Ä¤¤¤¿¡ª", m_name);
2012 if (mon_take_hit(m_idx, dam, &fear,
2015 msg_format("%^s is injured by the Force", m_name);
2017 if (mon_take_hit(m_idx, dam, &fear,
2029 /* Monster missed player */
2032 /* Analyze failed attacks */
2048 /* Visible monsters */
2057 msg_format("%s¤«¤ï¤·¤¿¡£", (p_ptr->special_attack & ATTACK_SUIKEN) ? "´ñ̯¤ÊÆ°¤¤Ç" : "");
2059 msg_format("%s%^s¤Î¹¶·â¤ò¤«¤ï¤·¤¿¡£", (p_ptr->special_attack & ATTACK_SUIKEN) ? "´ñ̯¤ÊÆ°¤¤Ç" : "", m_name);
2060 syouryaku = 1;/*£²²óÌܰʹߤϾÊά */
2062 msg_format("%^s misses you.", m_name);
2073 /* Analyze "visible" monsters only */
2074 if (visible && !do_silly_attack)
2076 /* Count "obvious" attacks (and ones that cause damage) */
2077 if (obvious || damage || (r_ptr->r_blows[ap_cnt] > 10))
2079 /* Count attacks of this type */
2080 if (r_ptr->r_blows[ap_cnt] < MAX_UCHAR)
2082 r_ptr->r_blows[ap_cnt]++;
2087 if (p_ptr->riding && damage)
2090 monster_desc(m_name, &m_list[p_ptr->riding], 0);
2091 if (rakuba((damage > 200) ? 200 : damage, FALSE))
2094 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
2096 msg_format("You have fallen from %s.", m_name);
2100 if (p_ptr->special_defense & NINJA_KAWARIMI)
2107 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
2110 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
2112 char m_name_self[80];
2115 monster_desc(m_name_self, m_ptr, 0x23);
2117 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
2119 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
2120 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
2124 if ((p_ptr->counter || (p_ptr->special_defense & KATA_MUSOU)) && alive && !p_ptr->is_dead && m_ptr->ml && (p_ptr->csp > 7))
2127 monster_desc(m_name, m_ptr, 0);
2131 msg_format("%^s¤ËÈ¿·â¤·¤¿¡ª", m_name);
2133 msg_format("Your counterattack to %s!", m_name);
2135 py_attack(m_ptr->fy, m_ptr->fx, HISSATSU_COUNTER);
2140 if (blinked && alive && !p_ptr->is_dead)
2143 msg_print("Å¥ËÀ¤Ï¾Ð¤Ã¤Æƨ¤²¤¿¡ª");
2145 msg_print("The thief flees laughing!");
2148 teleport_away(m_idx, MAX_SIGHT * 2 + 5, FALSE);
2152 /* Always notice cause of death */
2153 if (p_ptr->is_dead && (r_ptr->r_deaths < MAX_SHORT) && !p_ptr->inside_arena)
2158 if (m_ptr->ml && fear && alive && !p_ptr->is_dead)
2162 msg_format("%^s¤Ï¶²ÉݤÇƨ¤²½Ð¤·¤¿¡ª", m_name);
2164 msg_format("%^s flees in terror!", m_name);
2169 if (p_ptr->special_defense & KATA_IAI)
2171 set_action(ACTION_NONE);
2174 /* Assume we attacked */