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;
158 char o_name[MAX_NLEN];
165 bool touched = FALSE, fear = FALSE, alive = TRUE;
166 bool explode = FALSE;
167 bool do_silly_attack = (one_in_(2) && p_ptr->image);
173 /* Not allowed to attack */
174 if (r_ptr->flags1 & (RF1_NEVER_BLOW)) return (FALSE);
176 if (d_info[dungeon_type].flags1 & DF1_NO_MELEE) return (FALSE);
178 /* ...nor if friendly */
179 if (!is_hostile(m_ptr)) return FALSE;
181 /* Extract the effective monster level */
182 rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
185 /* Get the monster name (or "it") */
186 monster_desc(m_name, m_ptr, 0);
188 /* Get the "died from" information (i.e. "a kobold") */
189 monster_desc(ddesc, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
191 if (p_ptr->special_defense & KATA_IAI)
194 msg_print("Áê¼ê¤¬½±¤¤¤«¤«¤ëÁ°¤ËÁÇÁ᤯Éð´ï¤ò¿¶¤ë¤Ã¤¿¡£");
196 msg_format("You took sen, draw and cut in one motion before %s move.", m_name);
198 if (py_attack(m_ptr->fy, m_ptr->fx, HISSATSU_IAI)) return TRUE;
201 if ((p_ptr->special_defense & NINJA_KAWARIMI) && (randint0(55) < (p_ptr->lev*3/5+20)))
207 /* Assume no blink */
210 /* Scan through all four blows */
211 for (ap_cnt = 0; ap_cnt < 4; ap_cnt++)
213 bool obvious = FALSE;
220 /* Extract the attack infomation */
221 int effect = r_ptr->blow[ap_cnt].effect;
222 int method = r_ptr->blow[ap_cnt].method;
223 int d_dice = r_ptr->blow[ap_cnt].d_dice;
224 int d_side = r_ptr->blow[ap_cnt].d_side;
227 if (!m_ptr->r_idx) break;
229 /* Hack -- no more attacks */
232 if (is_pet(m_ptr) && (r_ptr->flags1 & RF1_UNIQUE) && (method == RBM_EXPLODE))
238 /* Stop if player is dead or gone */
239 if (!p_ptr->playing || p_ptr->is_dead) break;
240 if (distance(py, px, m_ptr->fy, m_ptr->fx) > 1) break;
242 /* Handle "leaving" */
243 if (p_ptr->leaving) break;
245 if (method == RBM_SHOOT) continue;
247 /* Extract the attack "power" */
248 power = mbe_info[effect].power;
251 ac = p_ptr->ac + p_ptr->to_a;
253 /* Monster hits player */
254 if (!effect || check_hit(power, rlev, MON_STUNNED(m_ptr)))
256 /* Always disturbing */
260 /* Hack -- Apply "protection from evil" */
261 if ((p_ptr->protevil > 0) &&
262 (r_ptr->flags3 & RF3_EVIL) &&
263 (p_ptr->lev >= rlev) &&
264 ((randint0(100) + p_ptr->lev) > 50))
266 /* Remember the Evil-ness */
267 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
272 msg_format("·âÂष¤¿¡£");
274 msg_format("%^s¤Ï·âÂव¤ì¤¿¡£", m_name);
275 abbreviate = 1;/*£²²óÌܰʹߤϾÊά */
277 msg_format("%^s is repelled.", m_name);
281 /* Hack -- Next attack */
286 /* Assume no cut or stun */
287 do_cut = do_stun = 0;
289 /* Describe the attack method */
300 do_cut = do_stun = 1;
311 act = "touches you.";
322 act = "¥Ñ¥ó¥Á¤µ¤ì¤¿¡£";
324 act = "punches you.";
350 act = "¤Ò¤Ã¤«¤«¤ì¤¿¡£";
393 act = "slashes you.";
405 act = "³Ñ¤ÇÆͤ«¤ì¤¿¡£";
419 act = "ÂÎÅö¤¿¤ê¤µ¤ì¤¿¡£";
421 act = "crushes you.";
433 act = "°û¤ß¹þ¤Þ¤ì¤¿¡£";
435 act = "engulfs you.";
447 act = "¤ÏÀÁµá½ñ¤ò¤è¤³¤·¤¿¡£";
449 act = "charges you.";
453 sound(SOUND_BUY); /* Note! This is "charges", not "charges at". */
461 act = "¤¬ÂΤξå¤òÇ礤²ó¤Ã¤¿¡£";
463 act = "crawls on you.";
474 act = "¤è¤À¤ì¤ò¤¿¤é¤µ¤ì¤¿¡£";
476 act = "drools on you.";
486 act = "ÂäòÅǤ«¤ì¤¿¡£";
488 act = "spits on you.";
499 act = "¤ÏÇúȯ¤·¤¿¡£";
511 act = "¤Ë¤é¤Þ¤ì¤¿¡£";
513 act = "gazes at you.";
522 act = "µã¤¶«¤Ð¤ì¤¿¡£";
524 act = "wails at you.";
534 act = "˦»Ò¤òÈô¤Ð¤µ¤ì¤¿¡£";
536 act = "releases spores at you.";
547 act = "¤¬ XXX4 ¤òȯ¼Í¤·¤¿¡£";
549 act = "projects XXX4's at you.";
558 act = "¶â¤ò¤»¤¬¤Þ¤ì¤¿¡£";
560 act = "begs you for money.";
572 act = desc_insult[randint0(m_ptr->r_idx == MON_DEBBY ? 10 : 8)];
582 act = desc_moan[randint0(4)];
592 if (m_ptr->r_idx == MON_JAIAN)
600 act = "¡Ö¢ö¤ª¡Á¤ì¤Ï¥¸¥ã¥¤¥¢¥ó¡Á¡Á¥¬¡Á¥¤À¤¤¤·¤ç¤¦¡Á¡×";
603 act = "¡Ö¢ö¤Æ¡Á¤ó¤«¤à¡Á¤Æ¤¤Î¤ª¡Á¤È¤³¤À¤¼¡Á¡Á¡×";
606 act = "¡Ö¢ö¤Î¡Á¤ÓÂÀ¥¹¥ÍÉפϥᤸ¤ã¤Ê¤¤¤è¡Á¡Á¡×";
609 act = "¡Ö¢ö¤±¡Á¤ó¤«¥¹¥Ý¡Á¥Ä¡Á¤É¤ó¤È¤³¤¤¡Á¡×";
612 act = "¡Ö¢ö¤¦¤¿¡Á¤â¡Á¡Á¤¦¡Á¤Þ¤¤¤¼¡Á¤Þ¤«¤·¤È¤±¡Á¡×";
615 act = "¡Ö¢ö¤Þ¡Á¤Á¤¤¤Á¤Ð¡Á¤ó¤Î¤Ë¡Á¤ó¤¤â¤Î¡Á¡Á¡×";
618 act = "¡Ö¢ö¤Ù¤ó¤¤ç¤¦¤·¤å¤¯¤À¤¤¥á¤¸¤ã¤Ê¤¤¤è¡Á¡Á¡×";
621 act = "¡Ö¢ö¤¤Ï¤ä¤µ¤·¡Á¤¯¤Æ¡Á¤Á¡Á¤«¤é¤â¤Á¡Á¡×";
624 act = "¡Ö¢ö¤«¤ª¡Á¤â¡Á¡Á¥¹¥¿¥¤¥ë¤â¡Á¥Ð¥Ä¥°¥ó¤µ¡Á¡×";
627 act = "¡Ö¢ö¤¬¤Ã¤³¤¦¤¤¡Á¤Á¤Î¡Á¤¢¡Á¤Ð¤ì¤ó¤Ü¤¦¡Á¡Á¡×";
630 act = "¡Ö¢ö¥É¡Á¥é¤â¥É¥é¥ß¤â¥á¤¸¤ã¤Ê¤¤¤è¡Á¡Á¡×";
633 act = "¡Ö¢ö¤è¤¸¤²¤ó¤Ý¤±¤Ã¤È¡Á¤Ê¡Á¤¯¤¿¤Ã¤Æ¡Á¡×";
636 act = "¡Ö¢ö¤¢¤·¡Á¤Î¡Á¡Á¤Ê¤¬¤µ¡Á¤Ï¡Á¤Þ¤±¤Ê¤¤¤¼¡Á¡×";
640 act = "horribly sings 'I AM GIAAAAAN. THE BOOOSS OF THE KIIIIDS.'";
647 act = "¤Ï¢öËͤé¤Ï³Ú¤·¤¤²È²¢ö¤È²Î¤Ã¤Æ¤¤¤ë¡£";
649 act = "¤Ï¢ö¥¢¥¤ ¥é¥Ö ¥æ¡¼¡¢¥æ¡¼ ¥é¥Ö ¥ß¡¼¢ö¤È²Î¤Ã¤Æ¤¤¤ë¡£";
651 act = "sings 'We are a happy family.'";
653 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 (abbreviate == 1)
676 msg_format("%s", act);
677 else /* if (abbreviate == -1) */
678 msg_format("%^s%s", m_name, act);
679 abbreviate = 1;/*£²²óÌܰʹߤϾÊά */
681 msg_format("%^s %s%s", m_name, act, do_silly_attack ? " you." : "");
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 || IS_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 (MON_CONFUSED(m_ptr)) 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 (MON_CONFUSED(m_ptr)) 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 (object_is_artifact(o_ptr)) continue;
990 /* Get a description */
991 object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
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 j_ptr->pval = o_ptr->pval / o_ptr->number;
1031 o_ptr->pval -= j_ptr->pval;
1037 /* Memorize monster */
1038 j_ptr->held_m_idx = m_idx;
1041 j_ptr->next_o_idx = m_ptr->hold_o_idx;
1044 m_ptr->hold_o_idx = o_idx;
1047 /* Steal the items */
1048 inven_item_increase(i, -1);
1049 inven_item_optimize(i);
1066 /* Take some damage */
1067 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1069 if (p_ptr->is_dead) break;
1071 /* Steal some food */
1072 for (k = 0; k < 10; k++)
1074 /* Pick an item from the pack */
1075 i = randint0(INVEN_PACK);
1078 o_ptr = &inventory[i];
1080 /* Skip non-objects */
1081 if (!o_ptr->k_idx) continue;
1083 /* Skip non-food objects */
1084 if ((o_ptr->tval != TV_FOOD) && !((o_ptr->tval == TV_CORPSE) && (o_ptr->sval))) continue;
1086 /* Get a description */
1087 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1091 msg_format("%s(%c)¤ò%s¿©¤Ù¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª",
1092 o_name, index_to_label(i),
1093 ((o_ptr->number > 1) ? "°ì¤Ä" : ""));
1095 msg_format("%sour %s (%c) was eaten!",
1096 ((o_ptr->number > 1) ? "One of y" : "Y"),
1097 o_name, index_to_label(i));
1101 /* Steal the items */
1102 inven_item_increase(i, -1);
1103 inven_item_optimize(i);
1117 /* Access the lite */
1118 o_ptr = &inventory[INVEN_LITE];
1120 /* Take some damage */
1121 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1123 if (p_ptr->is_dead) break;
1126 if ((o_ptr->xtra4 > 0) && (!object_is_fixed_artifact(o_ptr)))
1129 o_ptr->xtra4 -= (250 + randint1(250));
1130 if (o_ptr->xtra4 < 1) o_ptr->xtra4 = 1;
1136 msg_print("ÌÀ¤«¤ê¤¬°Å¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
1138 msg_print("Your light dims.");
1145 p_ptr->window |= (PW_EQUIP);
1159 msg_print("»À¤òÍá¤Ó¤»¤é¤ì¤¿¡ª");
1161 msg_print("You are covered in acid!");
1165 /* Special damage */
1166 get_damage += acid_dam(damage, ddesc, -1);
1168 /* Hack -- Update AC */
1171 /* Learn about the player */
1172 update_smart_learn(m_idx, DRS_ACID);
1185 msg_print("ÅÅ·â¤òÍá¤Ó¤»¤é¤ì¤¿¡ª");
1187 msg_print("You are struck by electricity!");
1191 /* Special damage */
1192 get_damage += elec_dam(damage, ddesc, -1);
1194 /* Learn about the player */
1195 update_smart_learn(m_idx, DRS_ELEC);
1208 msg_print("Á´¿È¤¬±ê¤ËÊñ¤Þ¤ì¤¿¡ª");
1210 msg_print("You are enveloped in flames!");
1214 /* Special damage */
1215 get_damage += fire_dam(damage, ddesc, -1);
1217 /* Learn about the player */
1218 update_smart_learn(m_idx, DRS_FIRE);
1231 msg_print("Á´¿È¤¬Î䵤¤Çʤ¤ï¤ì¤¿¡ª");
1233 msg_print("You are covered with frost!");
1237 /* Special damage */
1238 get_damage += cold_dam(damage, ddesc, -1);
1240 /* Learn about the player */
1241 update_smart_learn(m_idx, DRS_COLD);
1249 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1251 if (p_ptr->is_dead) break;
1253 /* Increase "blind" */
1254 if (!p_ptr->resist_blind)
1256 if (set_blind(p_ptr->blind + 10 + randint1(rlev)))
1259 if(m_ptr->r_idx == MON_DIO) msg_print("¤É¤¦¤À¥Ã¡ª¤³¤Î·ì¤ÎÌÜÄÙ¤·¤Ï¥Ã¡ª");
1267 /* Learn about the player */
1268 update_smart_learn(m_idx, DRS_BLIND);
1277 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1279 if (p_ptr->is_dead) break;
1281 /* Increase "confused" */
1282 if (!p_ptr->resist_conf)
1284 if (set_confused(p_ptr->confused + 3 + randint1(rlev)))
1290 /* Learn about the player */
1291 update_smart_learn(m_idx, DRS_CONF);
1299 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1301 if (p_ptr->is_dead) break;
1303 /* Increase "afraid" */
1304 if (p_ptr->resist_fear)
1307 msg_print("¤·¤«¤·¶²Éݤ˿¯¤µ¤ì¤Ê¤«¤Ã¤¿¡ª");
1309 msg_print("You stand your ground!");
1314 else if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
1317 msg_print("¤·¤«¤·¶²Éݤ˿¯¤µ¤ì¤Ê¤«¤Ã¤¿¡ª");
1319 msg_print("You stand your ground!");
1326 if (set_afraid(p_ptr->afraid + 3 + randint1(rlev)))
1332 /* Learn about the player */
1333 update_smart_learn(m_idx, DRS_FEAR);
1341 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1343 if (p_ptr->is_dead) break;
1345 /* Increase "paralyzed" */
1346 if (p_ptr->free_act)
1349 msg_print("¤·¤«¤·¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª");
1351 msg_print("You are unaffected!");
1356 else if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
1359 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
1361 msg_print("You resist the effects!");
1368 if (!p_ptr->paralyzed)
1370 if (set_paralyzed(3 + randint1(rlev)))
1377 /* Learn about the player */
1378 update_smart_learn(m_idx, DRS_FREE);
1385 /* Damage (physical) */
1386 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1388 if (p_ptr->is_dead) break;
1391 if (do_dec_stat(A_STR)) obvious = TRUE;
1398 /* Damage (physical) */
1399 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1401 if (p_ptr->is_dead) break;
1404 if (do_dec_stat(A_INT)) obvious = TRUE;
1411 /* Damage (physical) */
1412 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1414 if (p_ptr->is_dead) break;
1417 if (do_dec_stat(A_WIS)) obvious = TRUE;
1424 /* Damage (physical) */
1425 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1427 if (p_ptr->is_dead) break;
1430 if (do_dec_stat(A_DEX)) obvious = TRUE;
1437 /* Damage (physical) */
1438 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1440 if (p_ptr->is_dead) break;
1443 if (do_dec_stat(A_CON)) obvious = TRUE;
1450 /* Damage (physical) */
1451 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1453 if (p_ptr->is_dead) break;
1456 if (do_dec_stat(A_CHR)) obvious = TRUE;
1463 /* Damage (physical) */
1464 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1466 if (p_ptr->is_dead) break;
1468 /* Damage (stats) */
1469 if (do_dec_stat(A_STR)) obvious = TRUE;
1470 if (do_dec_stat(A_DEX)) obvious = TRUE;
1471 if (do_dec_stat(A_CON)) obvious = TRUE;
1472 if (do_dec_stat(A_INT)) obvious = TRUE;
1473 if (do_dec_stat(A_WIS)) obvious = TRUE;
1474 if (do_dec_stat(A_CHR)) obvious = TRUE;
1484 /* Hack -- Reduce damage based on the player armor class */
1485 damage -= (damage * ((ac < 150) ? ac : 150) / 250);
1488 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1490 /* Radius 8 earthquake centered at the monster */
1491 if (damage > 23 || explode)
1493 earthquake_aux(m_ptr->fy, m_ptr->fx, 8, m_idx);
1501 s32b d = damroll(10, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
1507 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1509 if (p_ptr->is_dead) break;
1511 (void)drain_exp(d, d / 10, 95);
1517 s32b d = damroll(20, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
1523 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1525 if (p_ptr->is_dead) break;
1527 (void)drain_exp(d, d / 10, 90);
1533 s32b d = damroll(40, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
1539 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1541 if (p_ptr->is_dead) break;
1543 (void)drain_exp(d, d / 10, 75);
1549 s32b d = damroll(80, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
1555 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1557 if (p_ptr->is_dead) break;
1559 (void)drain_exp(d, d / 10, 50);
1565 /* Take some damage */
1566 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1568 if (p_ptr->is_dead) break;
1570 /* Take "poison" effect */
1571 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
1573 if (set_poisoned(p_ptr->poisoned + randint1(rlev) + 5))
1579 /* Damage CON (10% chance)*/
1580 if ((randint1(100) < 11) && (p_ptr->prace != RACE_ANDROID))
1582 /* 1% chance for perm. damage */
1583 bool perm = one_in_(10);
1584 if (dec_stat(A_CON, randint1(10), perm))
1587 msg_print("ɤ¬¤¢¤Ê¤¿¤ò¿ª¤ó¤Ç¤¤¤ëµ¤¤¬¤¹¤ë¡£");
1589 msg_print("You feel strange sickness.");
1601 if (!p_ptr->resist_time)
1603 switch (randint1(10))
1605 case 1: case 2: case 3: case 4: case 5:
1607 if (p_ptr->prace == RACE_ANDROID) break;
1609 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
1611 msg_print("You feel life has clocked back.");
1614 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
1618 case 6: case 7: case 8: case 9:
1620 int stat = randint0(6);
1625 case A_STR: act = "¶¯¤¯"; break;
1626 case A_INT: act = "ÁïÌÀ¤Ç"; break;
1627 case A_WIS: act = "¸ÌÀ¤Ç"; break;
1628 case A_DEX: act = "´ïÍѤÇ"; break;
1629 case A_CON: act = "·ò¹¯¤Ç"; break;
1630 case A_CHR: act = "Èþ¤·¤¯"; break;
1632 case A_STR: act = "strong"; break;
1633 case A_INT: act = "bright"; break;
1634 case A_WIS: act = "wise"; break;
1635 case A_DEX: act = "agile"; break;
1636 case A_CON: act = "hale"; break;
1637 case A_CHR: act = "beautiful"; break;
1643 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
1645 msg_format("You're not as %s as you used to be...", act);
1649 p_ptr->stat_cur[stat] = (p_ptr->stat_cur[stat] * 3) / 4;
1650 if (p_ptr->stat_cur[stat] < 3) p_ptr->stat_cur[stat] = 3;
1651 p_ptr->update |= (PU_BONUS);
1658 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
1660 msg_print("You're not as powerful as you used to be...");
1664 for (k = 0; k < 6; k++)
1666 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
1667 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
1669 p_ptr->update |= (PU_BONUS);
1674 get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1680 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);
1751 p_ptr->csp -= damage;
1755 p_ptr->csp_frac = 0;
1758 p_ptr->redraw |= (PR_MANA);
1764 /* Hack -- only one of cut or stun */
1765 if (do_cut && do_stun)
1768 if (randint0(100) < 50)
1785 /* Critical hit (zero if non-critical) */
1786 tmp = monster_critical(d_dice, d_side, damage);
1788 /* Roll for damage */
1791 case 0: k = 0; break;
1792 case 1: k = randint1(5); break;
1793 case 2: k = randint1(5) + 5; break;
1794 case 3: k = randint1(20) + 20; break;
1795 case 4: k = randint1(50) + 50; break;
1796 case 5: k = randint1(100) + 100; break;
1797 case 6: k = 300; break;
1798 default: k = 500; break;
1802 if (k) (void)set_cut(p_ptr->cut + k);
1810 /* Critical hit (zero if non-critical) */
1811 tmp = monster_critical(d_dice, d_side, damage);
1813 /* Roll for damage */
1816 case 0: k = 0; break;
1817 case 1: k = randint1(5); break;
1818 case 2: k = randint1(5) + 10; break;
1819 case 3: k = randint1(10) + 20; break;
1820 case 4: k = randint1(15) + 30; break;
1821 case 5: k = randint1(20) + 40; break;
1822 case 6: k = 80; break;
1823 default: k = 150; break;
1826 /* Apply the stun */
1827 if (k) (void)set_stun(p_ptr->stun + k);
1832 sound(SOUND_EXPLODE);
1834 if (mon_take_hit(m_idx, m_ptr->hp + 1, &fear, NULL))
1843 if (p_ptr->sh_fire && alive && !p_ptr->is_dead)
1845 if (!(r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK))
1847 int dam = damroll(2, 6);
1849 /* Modify the damage */
1850 dam = mon_damage_mod(m_ptr, dam, FALSE);
1853 msg_format("%^s¤ÏÆÍÁ³Ç®¤¯¤Ê¤Ã¤¿¡ª", m_name);
1854 if (mon_take_hit(m_idx, dam, &fear,
1855 "¤Ï³¥¤Î»³¤Ë¤Ê¤Ã¤¿¡£"))
1857 msg_format("%^s is suddenly very hot!", m_name);
1859 if (mon_take_hit(m_idx, dam, &fear,
1860 " turns into a pile of ash."))
1870 if (is_original_ap_and_seen(m_ptr))
1871 r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK);
1875 if (p_ptr->sh_elec && alive && !p_ptr->is_dead)
1877 if (!(r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK))
1879 int dam = damroll(2, 6);
1881 /* Modify the damage */
1882 dam = mon_damage_mod(m_ptr, dam, FALSE);
1885 msg_format("%^s¤ÏÅÅ·â¤ò¤¯¤é¤Ã¤¿¡ª", m_name);
1886 if (mon_take_hit(m_idx, dam, &fear,
1887 "¤Ïdz¤¨³Ì¤Î»³¤Ë¤Ê¤Ã¤¿¡£"))
1889 msg_format("%^s gets zapped!", m_name);
1891 if (mon_take_hit(m_idx, dam, &fear,
1892 " turns into a pile of cinder."))
1902 if (is_original_ap_and_seen(m_ptr))
1903 r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK);
1907 if (p_ptr->sh_cold && alive && !p_ptr->is_dead)
1909 if (!(r_ptr->flagsr & RFR_EFF_IM_COLD_MASK))
1911 int dam = damroll(2, 6);
1913 /* Modify the damage */
1914 dam = mon_damage_mod(m_ptr, dam, FALSE);
1917 msg_format("%^s¤ÏÎ䵤¤ò¤¯¤é¤Ã¤¿¡ª", m_name);
1918 if (mon_take_hit(m_idx, dam, &fear,
1921 msg_format("%^s is very cold!", m_name);
1923 if (mon_take_hit(m_idx, dam, &fear,
1934 if (is_original_ap_and_seen(m_ptr))
1935 r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK);
1940 if (p_ptr->dustrobe && alive && !p_ptr->is_dead)
1942 if (!(r_ptr->flagsr & RFR_EFF_RES_SHAR_MASK))
1944 int dam = damroll(2, 6);
1946 /* Modify the damage */
1947 dam = mon_damage_mod(m_ptr, dam, FALSE);
1950 msg_format("%^s¤Ï¶À¤ÎÇËÊÒ¤ò¤¯¤é¤Ã¤¿¡ª", m_name);
1951 if (mon_take_hit(m_idx, dam, &fear,
1952 "¤Ï¥º¥¿¥º¥¿¤Ë¤Ê¤Ã¤¿¡£"))
1954 msg_format("%^s gets zapped!", m_name);
1956 if (mon_take_hit(m_idx, dam, &fear,
1957 " had torn to pieces."))
1966 if (is_original_ap_and_seen(m_ptr))
1967 r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_RES_SHAR_MASK);
1970 if (is_mirror_grid(&cave[py][px]))
1972 teleport_player(10, 0L);
1976 if (p_ptr->tim_sh_holy && alive && !p_ptr->is_dead)
1978 if (r_ptr->flags3 & RF3_EVIL)
1980 if (!(r_ptr->flagsr & RFR_RES_ALL))
1982 int dam = damroll(2, 6);
1984 /* Modify the damage */
1985 dam = mon_damage_mod(m_ptr, dam, FALSE);
1988 msg_format("%^s¤ÏÀ»¤Ê¤ë¥ª¡¼¥é¤Ç½ý¤Ä¤¤¤¿¡ª", m_name);
1989 if (mon_take_hit(m_idx, dam, &fear,
1992 msg_format("%^s is injured by holy power!", m_name);
1994 if (mon_take_hit(m_idx, dam, &fear,
2001 if (is_original_ap_and_seen(m_ptr))
2002 r_ptr->r_flags3 |= RF3_EVIL;
2006 if (is_original_ap_and_seen(m_ptr))
2007 r_ptr->r_flagsr |= RFR_RES_ALL;
2012 if (p_ptr->tim_sh_touki && alive && !p_ptr->is_dead)
2014 if (!(r_ptr->flagsr & RFR_RES_ALL))
2016 int dam = damroll(2, 6);
2018 /* Modify the damage */
2019 dam = mon_damage_mod(m_ptr, dam, FALSE);
2022 msg_format("%^s¤¬±Ô¤¤Æ®µ¤¤Î¥ª¡¼¥é¤Ç½ý¤Ä¤¤¤¿¡ª", m_name);
2023 if (mon_take_hit(m_idx, dam, &fear,
2026 msg_format("%^s is injured by the Force", m_name);
2028 if (mon_take_hit(m_idx, dam, &fear,
2039 if (is_original_ap_and_seen(m_ptr))
2040 r_ptr->r_flagsr |= RFR_RES_ALL;
2046 /* Monster missed player */
2049 /* Analyze failed attacks */
2065 /* Visible monsters */
2074 msg_format("%s¤«¤ï¤·¤¿¡£", (p_ptr->special_attack & ATTACK_SUIKEN) ? "´ñ̯¤ÊÆ°¤¤Ç" : "");
2076 msg_format("%s%^s¤Î¹¶·â¤ò¤«¤ï¤·¤¿¡£", (p_ptr->special_attack & ATTACK_SUIKEN) ? "´ñ̯¤ÊÆ°¤¤Ç" : "", m_name);
2077 abbreviate = 1;/*£²²óÌܰʹߤϾÊά */
2079 msg_format("%^s misses you.", m_name);
2090 /* Analyze "visible" monsters only */
2091 if (is_original_ap_and_seen(m_ptr) && !do_silly_attack)
2093 /* Count "obvious" attacks (and ones that cause damage) */
2094 if (obvious || damage || (r_ptr->r_blows[ap_cnt] > 10))
2096 /* Count attacks of this type */
2097 if (r_ptr->r_blows[ap_cnt] < MAX_UCHAR)
2099 r_ptr->r_blows[ap_cnt]++;
2104 if (p_ptr->riding && damage)
2107 monster_desc(m_name, &m_list[p_ptr->riding], 0);
2108 if (rakuba((damage > 200) ? 200 : damage, FALSE))
2111 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
2113 msg_format("You have fallen from %s.", m_name);
2117 if (p_ptr->special_defense & NINJA_KAWARIMI)
2124 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
2127 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
2129 char m_name_self[80];
2132 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
2134 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
2136 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
2137 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
2141 if ((p_ptr->counter || (p_ptr->special_defense & KATA_MUSOU)) && alive && !p_ptr->is_dead && m_ptr->ml && (p_ptr->csp > 7))
2144 monster_desc(m_name, m_ptr, 0);
2148 msg_format("%^s¤ËÈ¿·â¤·¤¿¡ª", m_name);
2150 msg_format("Your counterattack to %s!", m_name);
2152 py_attack(m_ptr->fy, m_ptr->fx, HISSATSU_COUNTER);
2156 p_ptr->redraw |= (PR_MANA);
2160 if (blinked && alive && !p_ptr->is_dead)
2163 msg_print("Å¥ËÀ¤Ï¾Ð¤Ã¤Æƨ¤²¤¿¡ª");
2165 msg_print("The thief flees laughing!");
2168 teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
2172 /* Always notice cause of death */
2173 if (p_ptr->is_dead && (r_ptr->r_deaths < MAX_SHORT) && !p_ptr->inside_arena)
2178 if (m_ptr->ml && fear && alive && !p_ptr->is_dead)
2182 msg_format("%^s¤Ï¶²ÉݤÇƨ¤²½Ð¤·¤¿¡ª", m_name);
2184 msg_format("%^s flees in terror!", m_name);
2189 if (p_ptr->special_defense & KATA_IAI)
2191 set_action(ACTION_NONE);
2194 /* Assume we attacked */