OSDN Git Service

fe869445252bad5a5037207f6fe7ed4891e35876
[hengband/hengband.git] / src / melee1.c
1 /*!
2  * @file melee1.c
3  * @brief モンスターの打撃処理 / Monster attacks
4  * @date 2014/01/17
5  * @author
6  * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
7  * This software may be copied and distributed for educational, research,\n
8  * and not for profit purposes provided that this copyright and statement\n
9  * are included in all such copies.  Other copyrights may also apply.\n
10  * 2014 Deskull rearranged comment for Doxygen.\n
11  * @details
12  */
13
14 #include "angband.h"
15 #include "cmd-pet.h"
16 #include "player-damage.h"
17
18
19
20  /*!
21  * @brief プレイヤーからモンスターへの打撃命中判定 /
22  * Determine if the player "hits" a monster (normal combat).
23  * @param chance 基本命中値
24  * @param ac モンスターのAC
25  * @param vis 目標を視界に捕らえているならばTRUEを指定
26  * @return 命中と判定された場合TRUEを返す
27  * @note Always miss 5%, always hit 5%, otherwise random.
28  */
29 bool test_hit_norm(int chance, ARMOUR_CLASS ac, int vis)
30 {
31         int k;
32
33         /* Percentile dice */
34         k = randint0(100);
35
36         /* Hack -- Instant miss or hit */
37         if (k < 10) return (k < 5);
38
39         if (p_ptr->pseikaku == SEIKAKU_NAMAKE)
40                 if (one_in_(20)) return (FALSE);
41
42         /* Wimpy attack never hits */
43         if (chance <= 0) return (FALSE);
44
45         /* Penalize invisible targets */
46         if (!vis) chance = (chance + 1) / 2;
47
48         /* Power must defeat armor */
49         if (randint0(chance) < (ac * 3 / 4)) return (FALSE);
50
51         /* Assume hit */
52         return (TRUE);
53 }
54
55
56 /*!
57 * @brief プレイヤーからモンスターへの打撃クリティカル判定 /
58 * Critical hits (by player) Factor in weapon weight, total plusses, player melee bonus
59 * @param weight 矢弾の重量
60 * @param plus 武器の命中修正
61 * @param dam 現在算出中のダメージ値
62 * @param meichuu 打撃の基本命中力
63 * @param mode オプションフラグ
64 * @return クリティカル修正が入ったダメージ値
65 */
66 HIT_POINT critical_norm(WEIGHT weight, int plus, HIT_POINT dam, s16b meichuu, BIT_FLAGS mode)
67 {
68         int i, k;
69
70         /* Extract "blow" power */
71         i = (weight + (meichuu * 3 + plus * 5) + p_ptr->skill_thn);
72
73         /* Chance */
74         if ((randint1((p_ptr->pclass == CLASS_NINJA) ? 4444 : 5000) <= i) || (mode == HISSATSU_MAJIN) || (mode == HISSATSU_3DAN))
75         {
76                 k = weight + randint1(650);
77                 if ((mode == HISSATSU_MAJIN) || (mode == HISSATSU_3DAN)) k += randint1(650);
78
79                 if (k < 400)
80                 {
81                         msg_print(_("手ごたえがあった!", "It was a good hit!"));
82
83                         dam = 2 * dam + 5;
84                 }
85                 else if (k < 700)
86                 {
87                         msg_print(_("かなりの手ごたえがあった!", "It was a great hit!"));
88                         dam = 2 * dam + 10;
89                 }
90                 else if (k < 900)
91                 {
92                         msg_print(_("会心の一撃だ!", "It was a superb hit!"));
93                         dam = 3 * dam + 15;
94                 }
95                 else if (k < 1300)
96                 {
97                         msg_print(_("最高の会心の一撃だ!", "It was a *GREAT* hit!"));
98                         dam = 3 * dam + 20;
99                 }
100                 else
101                 {
102                         msg_print(_("比類なき最高の会心の一撃だ!", "It was a *SUPERB* hit!"));
103                         dam = ((7 * dam) / 2) + 25;
104                 }
105         }
106
107         return (dam);
108 }
109
110 /*!
111  * @brief モンスター打撃のクリティカルランクを返す /
112  * Critical blow. All hits that do 95% of total possible damage,
113  * @param dice モンスター打撃のダイス数
114  * @param sides モンスター打撃の最大ダイス目
115  * @param dam プレイヤーに与えたダメージ
116  * @details
117  * and which also do at least 20 damage, or, sometimes, N damage.
118  * This is used only to determine "cuts" and "stuns".
119  */
120 static int monster_critical(DICE_NUMBER dice, DICE_SID sides, HIT_POINT dam)
121 {
122         int max = 0;
123         int total = dice * sides;
124
125         /* Must do at least 95% of perfect */
126         if (dam < total * 19 / 20) return (0);
127
128         /* Weak blows rarely work */
129         if ((dam < 20) && (randint0(100) >= dam)) return (0);
130
131         /* Perfect damage */
132         if ((dam >= total) && (dam >= 40)) max++;
133
134         /* Super-charge */
135         if (dam >= 20)
136         {
137                 while (randint0(100) < 2) max++;
138         }
139
140         /* Critical damage */
141         if (dam > 45) return (6 + max);
142         if (dam > 33) return (5 + max);
143         if (dam > 25) return (4 + max);
144         if (dam > 18) return (3 + max);
145         if (dam > 11) return (2 + max);
146         return (1 + max);
147 }
148
149 /*!
150  * @brief モンスター打撃の命中を判定する /
151  * Determine if a monster attack against the player succeeds.
152  * @param power 打撃属性毎の基本命中値
153  * @param level モンスターのレベル
154  * @param stun モンスターの朦朧値
155  * @return TRUEならば命中判定
156  * @details
157  * Always miss 5% of the time, Always hit 5% of the time.
158  * Otherwise, match monster power against player armor.
159  */
160 static int check_hit(int power, DEPTH level, int stun)
161 {
162         int i, k, ac;
163
164         /* Percentile dice */
165         k = randint0(100);
166
167         if (stun && one_in_(2)) return FALSE;
168
169         /* Hack -- Always miss or hit */
170         if (k < 10) return (k < 5);
171
172         /* Calculate the "attack quality" */
173         i = (power + (level * 3));
174
175         /* Total armor */
176         ac = p_ptr->ac + p_ptr->to_a;
177         if (p_ptr->special_attack & ATTACK_SUIKEN) ac += (p_ptr->lev * 2);
178
179         /* Power and Level compete against Armor */
180         if ((i > 0) && (randint1(i) > ((ac * 3) / 4))) return (TRUE);
181
182         /* Assume miss */
183         return (FALSE);
184 }
185
186
187
188 /*! モンスターの侮辱行為メッセージテーブル / Hack -- possible "insult" messages */
189 static cptr desc_insult[] =
190 {
191 #ifdef JP
192         "があなたを侮辱した!",
193         "があなたの母を侮辱した!",
194         "があなたを軽蔑した!",
195         "があなたを辱めた!",
196         "があなたを汚した!",
197         "があなたの回りで踊った!",
198         "が猥褻な身ぶりをした!",
199         "があなたをぼんやりと見た!!!",
200         "があなたをパラサイト呼ばわりした!",
201         "があなたをサイボーグ扱いした!"
202 #else
203         "insults you!",
204         "insults your mother!",
205         "gives you the finger!",
206         "humiliates you!",
207         "defiles you!",
208         "dances around you!",
209         "makes obscene gestures!",
210         "moons you!!!"
211         "calls you a parasite!",
212         "calls you a cyborg!"
213 #endif
214
215 };
216
217
218 /*! マゴットのぼやきメッセージテーブル / Hack -- possible "insult" messages */
219 static cptr desc_moan[] =
220 {
221 #ifdef JP
222         "は何かを悲しんでいるようだ。",
223         "が彼の飼い犬を見なかったかと尋ねている。",
224         "が縄張りから出て行けと言っている。",
225         "はキノコがどうとか呟いている。"
226 #else
227         "seems sad about something.",
228         "asks if you have seen his dogs.",
229         "tells you to get off his land.",
230         "mumbles something about mushrooms."
231 #endif
232
233 };
234
235
236 /*!
237 * @brief 敵オーラによるプレイヤーのダメージ処理(補助)
238 * @param m_ptr オーラを持つモンスターの構造体参照ポインタ
239 * @param immune ダメージを回避できる免疫フラグ
240 * @param flags_offset オーラフラグ配列の参照オフセット
241 * @param r_flags_offset モンスターの耐性配列の参照オフセット
242 * @param aura_flag オーラフラグ配列
243 * @param dam_func ダメージ処理を行う関数の参照ポインタ
244 * @param message オーラダメージを受けた際のメッセージ
245 * @return なし
246 */
247 static void touch_zap_player_aux(monster_type *m_ptr, bool immune, int flags_offset, int r_flags_offset, u32b aura_flag,
248         HIT_POINT(*dam_func)(HIT_POINT dam, cptr kb_str, int monspell, bool aura), cptr message)
249 {
250         monster_race *r_ptr = &r_info[m_ptr->r_idx];
251
252         if ((atoffset(u32b, r_ptr, flags_offset) & aura_flag) && !immune)
253         {
254                 char mon_name[80];
255                 int aura_damage = damroll(1 + (r_ptr->level / 26), 1 + (r_ptr->level / 17));
256
257                 /* Hack -- Get the "died from" name */
258                 monster_desc(mon_name, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
259
260                 msg_print(message);
261
262                 dam_func(aura_damage, mon_name, -1, TRUE);
263
264                 if (is_original_ap_and_seen(m_ptr))
265                 {
266                         atoffset(u32b, r_ptr, r_flags_offset) |= aura_flag;
267                 }
268
269                 handle_stuff();
270         }
271 }
272
273
274
275
276 /*!
277 * @brief 敵オーラによるプレイヤーのダメージ処理(メイン)
278 * @param m_ptr オーラを持つモンスターの構造体参照ポインタ
279 * @return なし
280 */
281 static void touch_zap_player(monster_type *m_ptr)
282 {
283         touch_zap_player_aux(m_ptr, p_ptr->immune_fire, offsetof(monster_race, flags2), offsetof(monster_race, r_flags2), RF2_AURA_FIRE,
284                 fire_dam, _("突然とても熱くなった!", "You are suddenly very hot!"));
285         touch_zap_player_aux(m_ptr, p_ptr->immune_cold, offsetof(monster_race, flags3), offsetof(monster_race, r_flags3), RF3_AURA_COLD,
286                 cold_dam, _("突然とても寒くなった!", "You are suddenly very cold!"));
287         touch_zap_player_aux(m_ptr, p_ptr->immune_elec, offsetof(monster_race, flags2), offsetof(monster_race, r_flags2), RF2_AURA_ELEC,
288                 elec_dam, _("電撃をくらった!", "You get zapped!"));
289 }
290
291 /*!
292 * @brief プレイヤーの変異要素による打撃処理
293 * @param m_idx 攻撃目標となったモンスターの参照ID
294 * @param attack 変異要素による攻撃要素の種類
295 * @param fear 攻撃を受けたモンスターが恐慌状態に陥ったかを返す参照ポインタ
296 * @param mdeath 攻撃を受けたモンスターが死亡したかを返す参照ポインタ
297 * @return なし
298 */
299 static void natural_attack(s16b m_idx, int attack, bool *fear, bool *mdeath)
300 {
301         HIT_POINT k;
302         int bonus, chance;
303         int             n_weight = 0;
304         monster_type    *m_ptr = &m_list[m_idx];
305         monster_race    *r_ptr = &r_info[m_ptr->r_idx];
306         char            m_name[80];
307
308         int             dice_num, dice_side;
309
310         cptr            atk_desc;
311
312         switch (attack)
313         {
314         case MUT2_SCOR_TAIL:
315                 dice_num = 3;
316                 dice_side = 7;
317                 n_weight = 5;
318                 atk_desc = _("尻尾", "tail");
319
320                 break;
321         case MUT2_HORNS:
322                 dice_num = 2;
323                 dice_side = 6;
324                 n_weight = 15;
325                 atk_desc = _("角", "horns");
326
327                 break;
328         case MUT2_BEAK:
329                 dice_num = 2;
330                 dice_side = 4;
331                 n_weight = 5;
332                 atk_desc = _("クチバシ", "beak");
333
334                 break;
335         case MUT2_TRUNK:
336                 dice_num = 1;
337                 dice_side = 4;
338                 n_weight = 35;
339                 atk_desc = _("象の鼻", "trunk");
340
341                 break;
342         case MUT2_TENTACLES:
343                 dice_num = 2;
344                 dice_side = 5;
345                 n_weight = 5;
346                 atk_desc = _("触手", "tentacles");
347
348                 break;
349         default:
350                 dice_num = dice_side = n_weight = 1;
351                 atk_desc = _("未定義の部位", "undefined body part");
352
353         }
354
355         /* Extract monster name (or "it") */
356         monster_desc(m_name, m_ptr, 0);
357
358
359         /* Calculate the "attack quality" */
360         bonus = p_ptr->to_h_m;
361         bonus += (p_ptr->lev * 6 / 5);
362         chance = (p_ptr->skill_thn + (bonus * BTH_PLUS_ADJ));
363
364         /* Test for hit */
365         if ((!(r_ptr->flags2 & RF2_QUANTUM) || !randint0(2)) && test_hit_norm(chance, r_ptr->ac, m_ptr->ml))
366         {
367                 sound(SOUND_HIT);
368                 msg_format(_("%sを%sで攻撃した。", "You hit %s with your %s."), m_name, atk_desc);
369
370                 k = damroll(dice_num, dice_side);
371                 k = critical_norm(n_weight, bonus, k, (s16b)bonus, 0);
372
373                 /* Apply the player damage bonuses */
374                 k += p_ptr->to_d_m;
375
376                 /* No negative damage */
377                 if (k < 0) k = 0;
378
379                 /* Modify the damage */
380                 k = mon_damage_mod(m_ptr, k, FALSE);
381
382                 /* Complex message */
383                 msg_format_wizard(CHEAT_MONSTER,
384                         _("%dのダメージを与えた。(残りHP %d/%d(%d))", "You do %d damage. (left HP %d/%d(%d))"),
385                         k, m_ptr->hp - k, m_ptr->maxhp, m_ptr->max_maxhp);
386
387                 /* Anger the monster */
388                 if (k > 0) anger_monster(m_ptr);
389
390                 /* Damage, check for fear and mdeath */
391                 switch (attack)
392                 {
393                 case MUT2_SCOR_TAIL:
394                         project(0, 0, m_ptr->fy, m_ptr->fx, k, GF_POIS, PROJECT_KILL, -1);
395                         *mdeath = (m_ptr->r_idx == 0);
396                         break;
397                 case MUT2_HORNS:
398                         *mdeath = mon_take_hit(m_idx, k, fear, NULL);
399                         break;
400                 case MUT2_BEAK:
401                         *mdeath = mon_take_hit(m_idx, k, fear, NULL);
402                         break;
403                 case MUT2_TRUNK:
404                         *mdeath = mon_take_hit(m_idx, k, fear, NULL);
405                         break;
406                 case MUT2_TENTACLES:
407                         *mdeath = mon_take_hit(m_idx, k, fear, NULL);
408                         break;
409                 default:
410                         *mdeath = mon_take_hit(m_idx, k, fear, NULL);
411                 }
412
413                 touch_zap_player(m_ptr);
414         }
415         /* Player misses */
416         else
417         {
418                 sound(SOUND_MISS);
419
420                 msg_format(_("ミス! %sにかわされた。", "You miss %s."), m_name);
421         }
422 }
423
424 /*!
425 * @brief プレイヤーの打撃処理サブルーチン /
426 * Player attacks a (poor, defenseless) creature        -RAK-
427 * @param y 攻撃目標のY座標
428 * @param x 攻撃目標のX座標
429 * @param fear 攻撃を受けたモンスターが恐慌状態に陥ったかを返す参照ポインタ
430 * @param mdeath 攻撃を受けたモンスターが死亡したかを返す参照ポインタ
431 * @param hand 攻撃を行うための武器を持つ手
432 * @param mode 発動中の剣術ID
433 * @return なし
434 * @details
435 * If no "weapon" is available, then "punch" the monster one time.
436 */
437 static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b hand, BIT_FLAGS mode)
438 {
439         int num = 0, bonus, chance, vir;
440         HIT_POINT k;
441
442         cave_type       *c_ptr = &cave[y][x];
443
444         monster_type    *m_ptr = &m_list[c_ptr->m_idx];
445         monster_race    *r_ptr = &r_info[m_ptr->r_idx];
446
447         /* Access the weapon */
448         object_type     *o_ptr = &inventory[INVEN_RARM + hand];
449
450         char            m_name[80];
451
452         bool            success_hit = FALSE;
453         bool            backstab = FALSE;
454         bool            vorpal_cut = FALSE;
455         int             chaos_effect = 0;
456         bool            stab_fleeing = FALSE;
457         bool            fuiuchi = FALSE;
458         bool            monk_attack = FALSE;
459         bool            do_quake = FALSE;
460         bool            weak = FALSE;
461         bool            drain_msg = TRUE;
462         int             drain_result = 0, drain_heal = 0;
463         bool            can_drain = FALSE;
464         int             num_blow;
465         int             drain_left = MAX_VAMPIRIC_DRAIN;
466         BIT_FLAGS flgs[TR_FLAG_SIZE]; /* A massive hack -- life-draining weapons */
467         bool            is_human = (r_ptr->d_char == 'p');
468         bool            is_lowlevel = (r_ptr->level < (p_ptr->lev - 15));
469         bool            zantetsu_mukou, e_j_mukou;
470
471         switch (p_ptr->pclass)
472         {
473         case CLASS_ROGUE:
474         case CLASS_NINJA:
475                 if (buki_motteruka(INVEN_RARM + hand) && !p_ptr->icky_wield[hand])
476                 {
477                         int tmp = p_ptr->lev * 6 + (p_ptr->skill_stl + 10) * 4;
478                         if (p_ptr->monlite && (mode != HISSATSU_NYUSIN)) tmp /= 3;
479                         if (p_ptr->cursed & TRC_AGGRAVATE) tmp /= 2;
480                         if (r_ptr->level > (p_ptr->lev * p_ptr->lev / 20 + 10)) tmp /= 3;
481                         if (MON_CSLEEP(m_ptr) && m_ptr->ml)
482                         {
483                                 /* Can't backstab creatures that we can't see, right? */
484                                 backstab = TRUE;
485                         }
486                         else if ((p_ptr->special_defense & NINJA_S_STEALTH) && (randint0(tmp) > (r_ptr->level + 20)) && m_ptr->ml && !(r_ptr->flagsr & RFR_RES_ALL))
487                         {
488                                 fuiuchi = TRUE;
489                         }
490                         else if (MON_MONFEAR(m_ptr) && m_ptr->ml)
491                         {
492                                 stab_fleeing = TRUE;
493                         }
494                 }
495                 break;
496
497         case CLASS_MONK:
498         case CLASS_FORCETRAINER:
499         case CLASS_BERSERKER:
500                 if ((empty_hands(TRUE) & EMPTY_HAND_RARM) && !p_ptr->riding) monk_attack = TRUE;
501                 break;
502         }
503
504         if (!o_ptr->k_idx) /* Empty hand */
505         {
506                 if ((r_ptr->level + 10) > p_ptr->lev)
507                 {
508                         if (p_ptr->skill_exp[GINOU_SUDE] < s_info[p_ptr->pclass].s_max[GINOU_SUDE])
509                         {
510                                 if (p_ptr->skill_exp[GINOU_SUDE] < WEAPON_EXP_BEGINNER)
511                                         p_ptr->skill_exp[GINOU_SUDE] += 40;
512                                 else if ((p_ptr->skill_exp[GINOU_SUDE] < WEAPON_EXP_SKILLED))
513                                         p_ptr->skill_exp[GINOU_SUDE] += 5;
514                                 else if ((p_ptr->skill_exp[GINOU_SUDE] < WEAPON_EXP_EXPERT) && (p_ptr->lev > 19))
515                                         p_ptr->skill_exp[GINOU_SUDE] += 1;
516                                 else if ((p_ptr->lev > 34))
517                                         if (one_in_(3)) p_ptr->skill_exp[GINOU_SUDE] += 1;
518                                 p_ptr->update |= (PU_BONUS);
519                         }
520                 }
521         }
522         else if (object_is_melee_weapon(o_ptr))
523         {
524                 if ((r_ptr->level + 10) > p_ptr->lev)
525                 {
526                         OBJECT_TYPE_VALUE tval = inventory[INVEN_RARM + hand].tval - TV_WEAPON_BEGIN;
527                         OBJECT_SUBTYPE_VALUE sval = inventory[INVEN_RARM + hand].sval;
528                         int now_exp = p_ptr->weapon_exp[tval][sval];
529                         if (now_exp < s_info[p_ptr->pclass].w_max[tval][sval])
530                         {
531                                 SUB_EXP amount = 0;
532                                 if (now_exp < WEAPON_EXP_BEGINNER) amount = 80;
533                                 else if (now_exp < WEAPON_EXP_SKILLED) amount = 10;
534                                 else if ((now_exp < WEAPON_EXP_EXPERT) && (p_ptr->lev > 19)) amount = 1;
535                                 else if ((p_ptr->lev > 34) && one_in_(2)) amount = 1;
536                                 p_ptr->weapon_exp[tval][sval] += amount;
537                                 p_ptr->update |= (PU_BONUS);
538                         }
539                 }
540         }
541
542         /* Disturb the monster */
543         (void)set_monster_csleep(c_ptr->m_idx, 0);
544
545         /* Extract monster name (or "it") */
546         monster_desc(m_name, m_ptr, 0);
547
548         /* Calculate the "attack quality" */
549         bonus = p_ptr->to_h[hand] + o_ptr->to_h;
550         chance = (p_ptr->skill_thn + (bonus * BTH_PLUS_ADJ));
551         if (mode == HISSATSU_IAI) chance += 60;
552         if (p_ptr->special_defense & KATA_KOUKIJIN) chance += 150;
553
554         if (p_ptr->sutemi) chance = MAX(chance * 3 / 2, chance + 60);
555
556         vir = virtue_number(V_VALOUR);
557         if (vir)
558         {
559                 chance += (p_ptr->virtues[vir - 1] / 10);
560         }
561
562         zantetsu_mukou = ((o_ptr->name1 == ART_ZANTETSU) && (r_ptr->d_char == 'j'));
563         e_j_mukou = ((o_ptr->name1 == ART_EXCALIBUR_J) && (r_ptr->d_char == 'S'));
564
565         if ((mode == HISSATSU_KYUSHO) || (mode == HISSATSU_MINEUCHI) || (mode == HISSATSU_3DAN) || (mode == HISSATSU_IAI)) num_blow = 1;
566         else if (mode == HISSATSU_COLD) num_blow = p_ptr->num_blow[hand] + 2;
567         else num_blow = p_ptr->num_blow[hand];
568
569         /* Hack -- DOKUBARI always hit once */
570         if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI)) num_blow = 1;
571
572         /* Attack once for each legal blow */
573         while ((num++ < num_blow) && !p_ptr->is_dead)
574         {
575                 if (((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI)) || (mode == HISSATSU_KYUSHO))
576                 {
577                         int n = 1;
578
579                         if (p_ptr->migite && p_ptr->hidarite)
580                         {
581                                 n *= 2;
582                         }
583                         if (mode == HISSATSU_3DAN)
584                         {
585                                 n *= 2;
586                         }
587
588                         success_hit = one_in_(n);
589                 }
590                 else if ((p_ptr->pclass == CLASS_NINJA) && ((backstab || fuiuchi) && !(r_ptr->flagsr & RFR_RES_ALL))) success_hit = TRUE;
591                 else success_hit = test_hit_norm(chance, r_ptr->ac, m_ptr->ml);
592
593                 if (mode == HISSATSU_MAJIN)
594                 {
595                         if (one_in_(2))
596                                 success_hit = FALSE;
597                 }
598
599                 /* Test for hit */
600                 if (success_hit)
601                 {
602                         int vorpal_chance = ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD)) ? 2 : 4;
603
604                         sound(SOUND_HIT);
605
606                         if (backstab) msg_format(_("あなたは冷酷にも眠っている無力な%sを突き刺した!", "You cruelly stab the helpless, sleeping %s!"), m_name);
607                         else if (fuiuchi) msg_format(_("不意を突いて%sに強烈な一撃を喰らわせた!", "You make surprise attack, and hit %s with a powerful blow!"), m_name);
608                         else if (stab_fleeing) msg_format(_("逃げる%sを背中から突き刺した!", "You backstab the fleeing %s!"), m_name);
609                         else if (!monk_attack) msg_format(_("%sを攻撃した。", "You hit %s."), m_name);
610
611                         /* Hack -- bare hands do one damage */
612                         k = 1;
613
614                         object_flags(o_ptr, flgs);
615
616                         /* Select a chaotic effect (50% chance) */
617                         if ((have_flag(flgs, TR_CHAOTIC)) && one_in_(2))
618                         {
619                                 if (one_in_(10))
620                                         chg_virtue(V_CHANCE, 1);
621
622                                 if (randint1(5) < 3)
623                                 {
624                                         /* Vampiric (20%) */
625                                         chaos_effect = 1;
626                                 }
627                                 else if (one_in_(250))
628                                 {
629                                         /* Quake (0.12%) */
630                                         chaos_effect = 2;
631                                 }
632                                 else if (!one_in_(10))
633                                 {
634                                         /* Confusion (26.892%) */
635                                         chaos_effect = 3;
636                                 }
637                                 else if (one_in_(2))
638                                 {
639                                         /* Teleport away (1.494%) */
640                                         chaos_effect = 4;
641                                 }
642                                 else
643                                 {
644                                         /* Polymorph (1.494%) */
645                                         chaos_effect = 5;
646                                 }
647                         }
648
649                         /* Vampiric drain */
650                         if ((have_flag(flgs, TR_VAMPIRIC)) || (chaos_effect == 1) || (mode == HISSATSU_DRAIN) || hex_spelling(HEX_VAMP_BLADE))
651                         {
652                                 /* Only drain "living" monsters */
653                                 if (monster_living(r_ptr))
654                                         can_drain = TRUE;
655                                 else
656                                         can_drain = FALSE;
657                         }
658
659                         if ((have_flag(flgs, TR_VORPAL) || hex_spelling(HEX_RUNESWORD)) && (randint1(vorpal_chance * 3 / 2) == 1) && !zantetsu_mukou)
660                                 vorpal_cut = TRUE;
661                         else vorpal_cut = FALSE;
662
663                         if (monk_attack)
664                         {
665                                 int special_effect = 0, stun_effect = 0, times = 0, max_times;
666                                 int min_level = 1;
667                                 const martial_arts *ma_ptr = &ma_blows[0], *old_ptr = &ma_blows[0];
668                                 int resist_stun = 0;
669                                 WEIGHT weight = 8;
670
671                                 if (r_ptr->flags1 & RF1_UNIQUE) resist_stun += 88;
672                                 if (r_ptr->flags3 & RF3_NO_STUN) resist_stun += 66;
673                                 if (r_ptr->flags3 & RF3_NO_CONF) resist_stun += 33;
674                                 if (r_ptr->flags3 & RF3_NO_SLEEP) resist_stun += 33;
675                                 if ((r_ptr->flags3 & RF3_UNDEAD) || (r_ptr->flags3 & RF3_NONLIVING))
676                                         resist_stun += 66;
677
678                                 if (p_ptr->special_defense & KAMAE_BYAKKO)
679                                         max_times = (p_ptr->lev < 3 ? 1 : p_ptr->lev / 3);
680                                 else if (p_ptr->special_defense & KAMAE_SUZAKU)
681                                         max_times = 1;
682                                 else if (p_ptr->special_defense & KAMAE_GENBU)
683                                         max_times = 1;
684                                 else
685                                         max_times = (p_ptr->lev < 7 ? 1 : p_ptr->lev / 7);
686                                 /* Attempt 'times' */
687                                 for (times = 0; times < max_times; times++)
688                                 {
689                                         do
690                                         {
691                                                 ma_ptr = &ma_blows[randint0(MAX_MA)];
692                                                 if ((p_ptr->pclass == CLASS_FORCETRAINER) && (ma_ptr->min_level > 1)) min_level = ma_ptr->min_level + 3;
693                                                 else min_level = ma_ptr->min_level;
694                                         } while ((min_level > p_ptr->lev) ||
695                                                 (randint1(p_ptr->lev) < ma_ptr->chance));
696
697                                         /* keep the highest level attack available we found */
698                                         if ((ma_ptr->min_level > old_ptr->min_level) &&
699                                                 !p_ptr->stun && !p_ptr->confused)
700                                         {
701                                                 old_ptr = ma_ptr;
702
703                                                 if (p_ptr->wizard && cheat_xtra)
704                                                 {
705                                                         msg_print(_("攻撃を再選択しました。", "Attack re-selected."));
706                                                 }
707                                         }
708                                         else
709                                         {
710                                                 ma_ptr = old_ptr;
711                                         }
712                                 }
713
714                                 if (p_ptr->pclass == CLASS_FORCETRAINER) min_level = MAX(1, ma_ptr->min_level - 3);
715                                 else min_level = ma_ptr->min_level;
716                                 k = damroll(ma_ptr->dd + p_ptr->to_dd[hand], ma_ptr->ds + p_ptr->to_ds[hand]);
717                                 if (p_ptr->special_attack & ATTACK_SUIKEN) k *= 2;
718
719                                 if (ma_ptr->effect == MA_KNEE)
720                                 {
721                                         if (r_ptr->flags1 & RF1_MALE)
722                                         {
723                                                 msg_format(_("%sに金的膝蹴りをくらわした!", "You hit %s in the groin with your knee!"), m_name);
724                                                 sound(SOUND_PAIN);
725                                                 special_effect = MA_KNEE;
726                                         }
727                                         else
728                                                 msg_format(ma_ptr->desc, m_name);
729                                 }
730
731                                 else if (ma_ptr->effect == MA_SLOW)
732                                 {
733                                         if (!((r_ptr->flags1 & RF1_NEVER_MOVE) ||
734                                                 my_strchr("~#{}.UjmeEv$,DdsbBFIJQSXclnw!=?", r_ptr->d_char)))
735                                         {
736                                                 msg_format(_("%sの足首に関節蹴りをくらわした!", "You kick %s in the ankle."), m_name);
737                                                 special_effect = MA_SLOW;
738                                         }
739                                         else msg_format(ma_ptr->desc, m_name);
740                                 }
741                                 else
742                                 {
743                                         if (ma_ptr->effect)
744                                         {
745                                                 stun_effect = (ma_ptr->effect / 2) + randint1(ma_ptr->effect / 2);
746                                         }
747
748                                         msg_format(ma_ptr->desc, m_name);
749                                 }
750
751                                 if (p_ptr->special_defense & KAMAE_SUZAKU) weight = 4;
752                                 if ((p_ptr->pclass == CLASS_FORCETRAINER) && P_PTR_KI)
753                                 {
754                                         weight += (P_PTR_KI / 30);
755                                         if (weight > 20) weight = 20;
756                                 }
757
758                                 k = critical_norm(p_ptr->lev * weight, min_level, k, p_ptr->to_h[0], 0);
759
760                                 if ((special_effect == MA_KNEE) && ((k + p_ptr->to_d[hand]) < m_ptr->hp))
761                                 {
762                                         msg_format(_("%^sは苦痛にうめいている!", "%^s moans in agony!"), m_name);
763                                         stun_effect = 7 + randint1(13);
764                                         resist_stun /= 3;
765                                 }
766
767                                 else if ((special_effect == MA_SLOW) && ((k + p_ptr->to_d[hand]) < m_ptr->hp))
768                                 {
769                                         if (!(r_ptr->flags1 & RF1_UNIQUE) &&
770                                                 (randint1(p_ptr->lev) > r_ptr->level) &&
771                                                 m_ptr->mspeed > 60)
772                                         {
773                                                 msg_format(_("%^sは足をひきずり始めた。", "%^s starts limping slower."), m_name);
774                                                 m_ptr->mspeed -= 10;
775                                         }
776                                 }
777
778                                 if (stun_effect && ((k + p_ptr->to_d[hand]) < m_ptr->hp))
779                                 {
780                                         if (p_ptr->lev > randint1(r_ptr->level + resist_stun + 10))
781                                         {
782                                                 if (set_monster_stunned(c_ptr->m_idx, stun_effect + MON_STUNNED(m_ptr)))
783                                                 {
784                                                         msg_format(_("%^sはフラフラになった。", "%^s is stunned."), m_name);
785                                                 }
786                                                 else
787                                                 {
788                                                         msg_format(_("%^sはさらにフラフラになった。", "%^s is more stunned."), m_name);
789                                                 }
790                                         }
791                                 }
792                         }
793
794                         /* Handle normal weapon */
795                         else if (o_ptr->k_idx)
796                         {
797                                 k = damroll(o_ptr->dd + p_ptr->to_dd[hand], o_ptr->ds + p_ptr->to_ds[hand]);
798                                 k = tot_dam_aux(o_ptr, k, m_ptr, mode, FALSE);
799
800                                 if (backstab)
801                                 {
802                                         k *= (3 + (p_ptr->lev / 20));
803                                 }
804                                 else if (fuiuchi)
805                                 {
806                                         k = k*(5 + (p_ptr->lev * 2 / 25)) / 2;
807                                 }
808                                 else if (stab_fleeing)
809                                 {
810                                         k = (3 * k) / 2;
811                                 }
812
813                                 if ((p_ptr->impact[hand] && ((k > 50) || one_in_(7))) ||
814                                         (chaos_effect == 2) || (mode == HISSATSU_QUAKE))
815                                 {
816                                         do_quake = TRUE;
817                                 }
818
819                                 if ((!(o_ptr->tval == TV_SWORD) || !(o_ptr->sval == SV_DOKUBARI)) && !(mode == HISSATSU_KYUSHO))
820                                         k = critical_norm(o_ptr->weight, o_ptr->to_h, k, p_ptr->to_h[hand], mode);
821
822                                 drain_result = k;
823
824                                 if (vorpal_cut)
825                                 {
826                                         int mult = 2;
827
828                                         if ((o_ptr->name1 == ART_CHAINSWORD) && !one_in_(2))
829                                         {
830                                                 char chainsword_noise[1024];
831                                                 if (!get_rnd_line(_("chainswd_j.txt", "chainswd.txt"), 0, chainsword_noise))
832                                                 {
833                                                         msg_print(chainsword_noise);
834                                                 }
835                                         }
836
837                                         if (o_ptr->name1 == ART_VORPAL_BLADE)
838                                         {
839                                                 msg_print(_("目にも止まらぬヴォーパルブレード、手錬の早業!", "Your Vorpal Blade goes snicker-snack!"));
840                                         }
841                                         else
842                                         {
843                                                 msg_format(_("%sをグッサリ切り裂いた!", "Your weapon cuts deep into %s!"), m_name);
844                                         }
845
846                                         /* Try to increase the damage */
847                                         while (one_in_(vorpal_chance))
848                                         {
849                                                 mult++;
850                                         }
851
852                                         k *= (HIT_POINT)mult;
853
854                                         /* Ouch! */
855                                         if (((r_ptr->flagsr & RFR_RES_ALL) ? k / 100 : k) > m_ptr->hp)
856                                         {
857                                                 msg_format(_("%sを真っ二つにした!", "You cut %s in half!"), m_name);
858                                         }
859                                         else
860                                         {
861                                                 switch (mult)
862                                                 {
863                                                 case 2: msg_format(_("%sを斬った!", "You gouge %s!"), m_name); break;
864                                                 case 3: msg_format(_("%sをぶった斬った!", "You maim %s!"), m_name); break;
865                                                 case 4: msg_format(_("%sをメッタ斬りにした!", "You carve %s!"), m_name); break;
866                                                 case 5: msg_format(_("%sをメッタメタに斬った!", "You cleave %s!"), m_name); break;
867                                                 case 6: msg_format(_("%sを刺身にした!", "You smite %s!"), m_name); break;
868                                                 case 7: msg_format(_("%sを斬って斬って斬りまくった!", "You eviscerate %s!"), m_name); break;
869                                                 default: msg_format(_("%sを細切れにした!", "You shred %s!"), m_name); break;
870                                                 }
871                                         }
872                                         drain_result = drain_result * 3 / 2;
873                                 }
874
875                                 k += o_ptr->to_d;
876                                 drain_result += o_ptr->to_d;
877                         }
878
879                         /* Apply the player damage bonuses */
880                         k += p_ptr->to_d[hand];
881                         drain_result += p_ptr->to_d[hand];
882
883                         if ((mode == HISSATSU_SUTEMI) || (mode == HISSATSU_3DAN)) k *= 2;
884                         if ((mode == HISSATSU_SEKIRYUKA) && !monster_living(r_ptr)) k = 0;
885                         if ((mode == HISSATSU_SEKIRYUKA) && !p_ptr->cut) k /= 2;
886
887                         /* No negative damage */
888                         if (k < 0) k = 0;
889
890                         if ((mode == HISSATSU_ZANMA) && !(!monster_living(r_ptr) && (r_ptr->flags3 & RF3_EVIL)))
891                         {
892                                 k = 0;
893                         }
894
895                         if (zantetsu_mukou)
896                         {
897                                 msg_print(_("こんな軟らかいものは切れん!", "You cannot cut such a elastic thing!"));
898                                 k = 0;
899                         }
900
901                         if (e_j_mukou)
902                         {
903                                 msg_print(_("蜘蛛は苦手だ!", "Spiders are difficult for you to deal with!"));
904                                 k /= 2;
905                         }
906
907                         if (mode == HISSATSU_MINEUCHI)
908                         {
909                                 int tmp = (10 + randint1(15) + p_ptr->lev / 5);
910
911                                 k = 0;
912                                 anger_monster(m_ptr);
913
914                                 if (!(r_ptr->flags3 & (RF3_NO_STUN)))
915                                 {
916                                         /* Get stunned */
917                                         if (MON_STUNNED(m_ptr))
918                                         {
919                                                 msg_format(_("%sはひどくもうろうとした。", "%s is more dazed."), m_name);
920                                                 tmp /= 2;
921                                         }
922                                         else
923                                         {
924                                                 msg_format(_("%s はもうろうとした。", "%s is dazed."), m_name);
925                                         }
926
927                                         /* Apply stun */
928                                         (void)set_monster_stunned(c_ptr->m_idx, MON_STUNNED(m_ptr) + tmp);
929                                 }
930                                 else
931                                 {
932                                         msg_format(_("%s には効果がなかった。", "%s is not effected."), m_name);
933                                 }
934                         }
935
936                         /* Modify the damage */
937                         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))));
938                         if (((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI)) || (mode == HISSATSU_KYUSHO))
939                         {
940                                 if ((randint1(randint1(r_ptr->level / 7) + 5) == 1) && !(r_ptr->flags1 & RF1_UNIQUE) && !(r_ptr->flags7 & RF7_UNIQUE2))
941                                 {
942                                         k = m_ptr->hp + 1;
943                                         msg_format(_("%sの急所を突き刺した!", "You hit %s on a fatal spot!"), m_name);
944                                 }
945                                 else k = 1;
946                         }
947                         else if ((p_ptr->pclass == CLASS_NINJA) && buki_motteruka(INVEN_RARM + hand) && !p_ptr->icky_wield[hand] && ((p_ptr->cur_lite <= 0) || one_in_(7)))
948                         {
949                                 int maxhp = maxroll(r_ptr->hdice, r_ptr->hside);
950                                 if (one_in_(backstab ? 13 : (stab_fleeing || fuiuchi) ? 15 : 27))
951                                 {
952                                         k *= 5;
953                                         drain_result *= 2;
954                                         msg_format(_("刃が%sに深々と突き刺さった!", "You critically injured %s!"), m_name);
955                                 }
956                                 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)))
957                                 {
958                                         if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE2) || (m_ptr->hp >= maxhp / 2))
959                                         {
960                                                 k = MAX(k * 5, m_ptr->hp / 2);
961                                                 drain_result *= 2;
962                                                 msg_format(_("%sに致命傷を負わせた!", "You fatally injured %s!"), m_name);
963                                         }
964                                         else
965                                         {
966                                                 k = m_ptr->hp + 1;
967                                                 msg_format(_("刃が%sの急所を貫いた!", "You hit %s on a fatal spot!"), m_name);
968                                         }
969                                 }
970                         }
971
972                         msg_format_wizard(CHEAT_MONSTER,
973                                 _("%dのダメージを与えた。(残りHP %d/%d(%d))", "You do %d damage. (left HP %d/%d(%d))"), k,
974                                 m_ptr->hp - k, m_ptr->maxhp, m_ptr->max_maxhp);
975
976                         if (k <= 0) can_drain = FALSE;
977
978                         if (drain_result > m_ptr->hp)
979                                 drain_result = m_ptr->hp;
980
981                         /* Damage, check for fear and death */
982                         if (mon_take_hit(c_ptr->m_idx, k, fear, NULL))
983                         {
984                                 *mdeath = TRUE;
985                                 if ((p_ptr->pclass == CLASS_BERSERKER) && p_ptr->energy_use)
986                                 {
987                                         if (p_ptr->migite && p_ptr->hidarite)
988                                         {
989                                                 if (hand) p_ptr->energy_use = p_ptr->energy_use * 3 / 5 + p_ptr->energy_use*num * 2 / (p_ptr->num_blow[hand] * 5);
990                                                 else p_ptr->energy_use = p_ptr->energy_use*num * 3 / (p_ptr->num_blow[hand] * 5);
991                                         }
992                                         else
993                                         {
994                                                 p_ptr->energy_use = p_ptr->energy_use*num / p_ptr->num_blow[hand];
995                                         }
996                                 }
997                                 if ((o_ptr->name1 == ART_ZANTETSU) && is_lowlevel)
998                                         msg_print(_("またつまらぬものを斬ってしまった...", "Sigh... Another trifling thing I've cut...."));
999                                 break;
1000                         }
1001
1002                         /* Anger the monster */
1003                         if (k > 0) anger_monster(m_ptr);
1004
1005                         touch_zap_player(m_ptr);
1006
1007                         /* Are we draining it?  A little note: If the monster is
1008                         dead, the drain does not work... */
1009
1010                         if (can_drain && (drain_result > 0))
1011                         {
1012                                 if (o_ptr->name1 == ART_MURAMASA)
1013                                 {
1014                                         if (is_human)
1015                                         {
1016                                                 HIT_PROB to_h = o_ptr->to_h;
1017                                                 HIT_POINT to_d = o_ptr->to_d;
1018                                                 int i, flag;
1019
1020                                                 flag = 1;
1021                                                 for (i = 0; i < to_h + 3; i++) if (one_in_(4)) flag = 0;
1022                                                 if (flag) to_h++;
1023
1024                                                 flag = 1;
1025                                                 for (i = 0; i < to_d + 3; i++) if (one_in_(4)) flag = 0;
1026                                                 if (flag) to_d++;
1027
1028                                                 if (o_ptr->to_h != to_h || o_ptr->to_d != to_d)
1029                                                 {
1030                                                         msg_print(_("妖刀は血を吸って強くなった!", "Muramasa sucked blood, and became more powerful!"));
1031                                                         o_ptr->to_h = to_h;
1032                                                         o_ptr->to_d = to_d;
1033                                                 }
1034                                         }
1035                                 }
1036                                 else
1037                                 {
1038                                         if (drain_result > 5) /* Did we really hurt it? */
1039                                         {
1040                                                 drain_heal = damroll(2, drain_result / 6);
1041
1042                                                 /* Hex */
1043                                                 if (hex_spelling(HEX_VAMP_BLADE)) drain_heal *= 2;
1044
1045                                                 if (cheat_xtra)
1046                                                 {
1047                                                         msg_format(_("Draining left: %d", "Draining left: %d"), drain_left);
1048                                                 }
1049
1050                                                 if (drain_left)
1051                                                 {
1052                                                         if (drain_heal < drain_left)
1053                                                         {
1054                                                                 drain_left -= drain_heal;
1055                                                         }
1056                                                         else
1057                                                         {
1058                                                                 drain_heal = drain_left;
1059                                                                 drain_left = 0;
1060                                                         }
1061
1062                                                         if (drain_msg)
1063                                                         {
1064                                                                 msg_format(_("刃が%sから生命力を吸い取った!", "Your weapon drains life from %s!"), m_name);
1065                                                                 drain_msg = FALSE;
1066                                                         }
1067
1068                                                         drain_heal = (drain_heal * mutant_regenerate_mod) / 100;
1069
1070                                                         hp_player(drain_heal);
1071                                                         /* We get to keep some of it! */
1072                                                 }
1073                                         }
1074                                 }
1075                                 m_ptr->maxhp -= (k + 7) / 8;
1076                                 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
1077                                 if (m_ptr->maxhp < 1) m_ptr->maxhp = 1;
1078                                 weak = TRUE;
1079                         }
1080                         can_drain = FALSE;
1081                         drain_result = 0;
1082
1083                         /* Confusion attack */
1084                         if ((p_ptr->special_attack & ATTACK_CONFUSE) || (chaos_effect == 3) || (mode == HISSATSU_CONF) || hex_spelling(HEX_CONFUSION))
1085                         {
1086                                 /* Cancel glowing hands */
1087                                 if (p_ptr->special_attack & ATTACK_CONFUSE)
1088                                 {
1089                                         p_ptr->special_attack &= ~(ATTACK_CONFUSE);
1090                                         msg_print(_("手の輝きがなくなった。", "Your hands stop glowing."));
1091                                         p_ptr->redraw |= (PR_STATUS);
1092
1093                                 }
1094
1095                                 /* Confuse the monster */
1096                                 if (r_ptr->flags3 & RF3_NO_CONF)
1097                                 {
1098                                         if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_NO_CONF;
1099                                         msg_format(_("%^sには効果がなかった。", "%^s is unaffected."), m_name);
1100
1101                                 }
1102                                 else if (randint0(100) < r_ptr->level)
1103                                 {
1104                                         msg_format(_("%^sには効果がなかった。", "%^s is unaffected."), m_name);
1105                                 }
1106                                 else
1107                                 {
1108                                         msg_format(_("%^sは混乱したようだ。", "%^s appears confused."), m_name);
1109                                         (void)set_monster_confused(c_ptr->m_idx, MON_CONFUSED(m_ptr) + 10 + randint0(p_ptr->lev) / 5);
1110                                 }
1111                         }
1112
1113                         else if (chaos_effect == 4)
1114                         {
1115                                 bool resists_tele = FALSE;
1116
1117                                 if (r_ptr->flagsr & RFR_RES_TELE)
1118                                 {
1119                                         if (r_ptr->flags1 & RF1_UNIQUE)
1120                                         {
1121                                                 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1122                                                 msg_format(_("%^sには効果がなかった。", "%^s is unaffected!"), m_name);
1123                                                 resists_tele = TRUE;
1124                                         }
1125                                         else if (r_ptr->level > randint1(100))
1126                                         {
1127                                                 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1128                                                 msg_format(_("%^sは抵抗力を持っている!", "%^s resists!"), m_name);
1129                                                 resists_tele = TRUE;
1130                                         }
1131                                 }
1132
1133                                 if (!resists_tele)
1134                                 {
1135                                         msg_format(_("%^sは消えた!", "%^s disappears!"), m_name);
1136                                         teleport_away(c_ptr->m_idx, 50, TELEPORT_PASSIVE);
1137                                         num = num_blow + 1; /* Can't hit it anymore! */
1138                                         *mdeath = TRUE;
1139                                 }
1140                         }
1141
1142                         else if ((chaos_effect == 5) && (randint1(90) > r_ptr->level))
1143                         {
1144                                 if (!(r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) &&
1145                                         !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
1146                                 {
1147                                         if (polymorph_monster(y, x))
1148                                         {
1149                                                 msg_format(_("%^sは変化した!", "%^s changes!"), m_name);
1150                                                 *fear = FALSE;
1151                                                 weak = FALSE;
1152                                         }
1153                                         else
1154                                         {
1155                                                 msg_format(_("%^sには効果がなかった。", "%^s is unaffected."), m_name);
1156                                         }
1157
1158                                         /* Hack -- Get new monster */
1159                                         m_ptr = &m_list[c_ptr->m_idx];
1160
1161                                         /* Oops, we need a different name... */
1162                                         monster_desc(m_name, m_ptr, 0);
1163
1164                                         /* Hack -- Get new race */
1165                                         r_ptr = &r_info[m_ptr->r_idx];
1166                                 }
1167                         }
1168                         else if (o_ptr->name1 == ART_G_HAMMER)
1169                         {
1170                                 monster_type *target_ptr = &m_list[c_ptr->m_idx];
1171
1172                                 if (target_ptr->hold_o_idx)
1173                                 {
1174                                         object_type *q_ptr = &o_list[target_ptr->hold_o_idx];
1175                                         char o_name[MAX_NLEN];
1176
1177                                         object_desc(o_name, q_ptr, OD_NAME_ONLY);
1178                                         q_ptr->held_m_idx = 0;
1179                                         q_ptr->marked = OM_TOUCHED;
1180                                         target_ptr->hold_o_idx = q_ptr->next_o_idx;
1181                                         q_ptr->next_o_idx = 0;
1182                                         msg_format(_("%sを奪った。", "You snatched %s."), o_name);
1183                                         inven_carry(q_ptr);
1184                                 }
1185                         }
1186                 }
1187
1188                 /* Player misses */
1189                 else
1190                 {
1191                         backstab = FALSE; /* Clumsy! */
1192                         fuiuchi = FALSE; /* Clumsy! */
1193
1194                         if ((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE) && one_in_(3))
1195                         {
1196                                 u32b flgs_aux[TR_FLAG_SIZE];
1197
1198                                 sound(SOUND_HIT);
1199
1200                                 msg_format(_("ミス! %sにかわされた。", "You miss %s."), m_name);
1201                                 msg_print(_("振り回した大鎌が自分自身に返ってきた!", "Your scythe returns to you!"));
1202
1203                                 /* Extract the flags */
1204                                 object_flags(o_ptr, flgs_aux);
1205
1206                                 k = damroll(o_ptr->dd + p_ptr->to_dd[hand], o_ptr->ds + p_ptr->to_ds[hand]);
1207                                 {
1208                                         int mult;
1209                                         switch (p_ptr->mimic_form)
1210                                         {
1211                                         case MIMIC_NONE:
1212                                                 switch (p_ptr->prace)
1213                                                 {
1214                                                 case RACE_YEEK:
1215                                                 case RACE_KLACKON:
1216                                                 case RACE_HUMAN:
1217                                                 case RACE_AMBERITE:
1218                                                 case RACE_DUNADAN:
1219                                                 case RACE_BARBARIAN:
1220                                                 case RACE_BEASTMAN:
1221                                                         mult = 25; break;
1222                                                 case RACE_HALF_ORC:
1223                                                 case RACE_HALF_TROLL:
1224                                                 case RACE_HALF_OGRE:
1225                                                 case RACE_HALF_GIANT:
1226                                                 case RACE_HALF_TITAN:
1227                                                 case RACE_CYCLOPS:
1228                                                 case RACE_IMP:
1229                                                 case RACE_SKELETON:
1230                                                 case RACE_ZOMBIE:
1231                                                 case RACE_VAMPIRE:
1232                                                 case RACE_SPECTRE:
1233                                                 case RACE_DEMON:
1234                                                 case RACE_DRACONIAN:
1235                                                         mult = 30; break;
1236                                                 default:
1237                                                         mult = 10; break;
1238                                                 }
1239                                                 break;
1240                                         case MIMIC_DEMON:
1241                                         case MIMIC_DEMON_LORD:
1242                                         case MIMIC_VAMPIRE:
1243                                                 mult = 30; break;
1244                                         default:
1245                                                 mult = 10; break;
1246                                         }
1247
1248                                         if (p_ptr->align < 0 && mult < 20)
1249                                                 mult = 20;
1250                                         if (!(p_ptr->resist_acid || IS_OPPOSE_ACID() || p_ptr->immune_acid) && (mult < 25))
1251                                                 mult = 25;
1252                                         if (!(p_ptr->resist_elec || IS_OPPOSE_ELEC() || p_ptr->immune_elec) && (mult < 25))
1253                                                 mult = 25;
1254                                         if (!(p_ptr->resist_fire || IS_OPPOSE_FIRE() || p_ptr->immune_fire) && (mult < 25))
1255                                                 mult = 25;
1256                                         if (!(p_ptr->resist_cold || IS_OPPOSE_COLD() || p_ptr->immune_cold) && (mult < 25))
1257                                                 mult = 25;
1258                                         if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()) && (mult < 25))
1259                                                 mult = 25;
1260
1261                                         if ((p_ptr->pclass != CLASS_SAMURAI) && (have_flag(flgs_aux, TR_FORCE_WEAPON)) && (p_ptr->csp >(p_ptr->msp / 30)))
1262                                         {
1263                                                 p_ptr->csp -= (1 + (p_ptr->msp / 30));
1264                                                 p_ptr->redraw |= (PR_MANA);
1265                                                 mult = mult * 3 / 2 + 20;
1266                                         }
1267                                         k *= (HIT_POINT)mult;
1268                                         k /= 10;
1269                                 }
1270
1271                                 k = critical_norm(o_ptr->weight, o_ptr->to_h, k, p_ptr->to_h[hand], mode);
1272                                 if (one_in_(6))
1273                                 {
1274                                         int mult = 2;
1275                                         msg_format(_("グッサリ切り裂かれた!", "Your weapon cuts deep into yourself!"));
1276                                         /* Try to increase the damage */
1277                                         while (one_in_(4))
1278                                         {
1279                                                 mult++;
1280                                         }
1281
1282                                         k *= (HIT_POINT)mult;
1283                                 }
1284                                 k += (p_ptr->to_d[hand] + o_ptr->to_d);
1285                                 if (k < 0) k = 0;
1286
1287                                 take_hit(DAMAGE_FORCE, k, _("死の大鎌", "Death scythe"), -1);
1288                                 redraw_stuff();
1289                         }
1290                         else
1291                         {
1292                                 sound(SOUND_MISS);
1293
1294                                 msg_format(_("ミス! %sにかわされた。", "You miss %s."), m_name);
1295                         }
1296                 }
1297                 backstab = FALSE;
1298                 fuiuchi = FALSE;
1299         }
1300
1301
1302         if (weak && !(*mdeath))
1303         {
1304                 msg_format(_("%sは弱くなったようだ。", "%^s seems weakened."), m_name);
1305         }
1306         if (drain_left != MAX_VAMPIRIC_DRAIN)
1307         {
1308                 if (one_in_(4))
1309                 {
1310                         chg_virtue(V_UNLIFE, 1);
1311                 }
1312         }
1313         /* Mega-Hack -- apply earthquake brand */
1314         if (do_quake)
1315         {
1316                 earthquake(p_ptr->y, p_ptr->x, 10);
1317                 if (!cave[y][x].m_idx) *mdeath = TRUE;
1318         }
1319 }
1320
1321
1322 /*!
1323 * @brief プレイヤーの打撃処理メインルーチン
1324 * @param y 攻撃目標のY座標
1325 * @param x 攻撃目標のX座標
1326 * @param mode 発動中の剣術ID
1327 * @return 実際に攻撃処理が行われた場合TRUEを返す。
1328 * @details
1329 * If no "weapon" is available, then "punch" the monster one time.
1330 */
1331 bool py_attack(POSITION y, POSITION x, BIT_FLAGS mode)
1332 {
1333         bool            fear = FALSE;
1334         bool            mdeath = FALSE;
1335         bool            stormbringer = FALSE;
1336
1337         cave_type       *c_ptr = &cave[y][x];
1338         monster_type    *m_ptr = &m_list[c_ptr->m_idx];
1339         monster_race    *r_ptr = &r_info[m_ptr->r_idx];
1340         char            m_name[80];
1341
1342         disturb(FALSE, TRUE);
1343
1344         p_ptr->energy_use = 100;
1345
1346         if (!p_ptr->migite && !p_ptr->hidarite &&
1347                 !(p_ptr->muta2 & (MUT2_HORNS | MUT2_BEAK | MUT2_SCOR_TAIL | MUT2_TRUNK | MUT2_TENTACLES)))
1348         {
1349                 msg_format(_("%s攻撃できない。", "You cannot do attacking."),
1350                         (empty_hands(FALSE) == EMPTY_HAND_NONE) ? _("両手がふさがって", "") : "");
1351                 return FALSE;
1352         }
1353
1354         /* Extract monster name (or "it") */
1355         monster_desc(m_name, m_ptr, 0);
1356
1357         if (m_ptr->ml)
1358         {
1359                 /* Auto-Recall if possible and visible */
1360                 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
1361
1362                 /* Track a new monster */
1363                 health_track(c_ptr->m_idx);
1364         }
1365
1366         if ((r_ptr->flags1 & RF1_FEMALE) &&
1367                 !(p_ptr->stun || p_ptr->confused || p_ptr->image || !m_ptr->ml))
1368         {
1369                 if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
1370                 {
1371                         msg_print(_("拙者、おなごは斬れぬ!", "I can not attack women!"));
1372                         return FALSE;
1373                 }
1374         }
1375
1376         if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
1377         {
1378                 msg_print(_("なぜか攻撃することができない。", "Something prevent you from attacking."));
1379                 return FALSE;
1380         }
1381
1382         /* Stop if friendly */
1383         if (!is_hostile(m_ptr) &&
1384                 !(p_ptr->stun || p_ptr->confused || p_ptr->image ||
1385                         p_ptr->shero || !m_ptr->ml))
1386         {
1387                 if (inventory[INVEN_RARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
1388                 if (inventory[INVEN_LARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
1389                 if (stormbringer)
1390                 {
1391                         msg_format(_("黒い刃は強欲に%sを攻撃した!", "Your black blade greedily attacks %s!"), m_name);
1392                         chg_virtue(V_INDIVIDUALISM, 1);
1393                         chg_virtue(V_HONOUR, -1);
1394                         chg_virtue(V_JUSTICE, -1);
1395                         chg_virtue(V_COMPASSION, -1);
1396                 }
1397                 else if (p_ptr->pclass != CLASS_BERSERKER)
1398                 {
1399                         if (get_check(_("本当に攻撃しますか?", "Really hit it? ")))
1400                         {
1401                                 chg_virtue(V_INDIVIDUALISM, 1);
1402                                 chg_virtue(V_HONOUR, -1);
1403                                 chg_virtue(V_JUSTICE, -1);
1404                                 chg_virtue(V_COMPASSION, -1);
1405                         }
1406                         else
1407                         {
1408                                 msg_format(_("%sを攻撃するのを止めた。", "You stop to avoid hitting %s."), m_name);
1409                                 return FALSE;
1410                         }
1411                 }
1412         }
1413
1414
1415         /* Handle player fear */
1416         if (p_ptr->afraid)
1417         {
1418                 if (m_ptr->ml)
1419                         msg_format(_("恐くて%sを攻撃できない!", "You are too afraid to attack %s!"), m_name);
1420                 else
1421                         msg_format(_("そっちには何か恐いものがいる!", "There is something scary in your way!"));
1422
1423                 /* Disturb the monster */
1424                 (void)set_monster_csleep(c_ptr->m_idx, 0);
1425
1426                 return FALSE;
1427         }
1428
1429         if (MON_CSLEEP(m_ptr)) /* It is not honorable etc to attack helpless victims */
1430         {
1431                 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
1432                 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
1433         }
1434
1435         if (p_ptr->migite && p_ptr->hidarite)
1436         {
1437                 if ((p_ptr->skill_exp[GINOU_NITOURYU] < s_info[p_ptr->pclass].s_max[GINOU_NITOURYU]) && ((p_ptr->skill_exp[GINOU_NITOURYU] - 1000) / 200 < r_ptr->level))
1438                 {
1439                         if (p_ptr->skill_exp[GINOU_NITOURYU] < WEAPON_EXP_BEGINNER)
1440                                 p_ptr->skill_exp[GINOU_NITOURYU] += 80;
1441                         else if (p_ptr->skill_exp[GINOU_NITOURYU] < WEAPON_EXP_SKILLED)
1442                                 p_ptr->skill_exp[GINOU_NITOURYU] += 4;
1443                         else if (p_ptr->skill_exp[GINOU_NITOURYU] < WEAPON_EXP_EXPERT)
1444                                 p_ptr->skill_exp[GINOU_NITOURYU] += 1;
1445                         else if (p_ptr->skill_exp[GINOU_NITOURYU] < WEAPON_EXP_MASTER)
1446                                 if (one_in_(3)) p_ptr->skill_exp[GINOU_NITOURYU] += 1;
1447                         p_ptr->update |= (PU_BONUS);
1448                 }
1449         }
1450
1451         /* Gain riding experience */
1452         if (p_ptr->riding)
1453         {
1454                 int cur = p_ptr->skill_exp[GINOU_RIDING];
1455                 int max = s_info[p_ptr->pclass].s_max[GINOU_RIDING];
1456
1457                 if (cur < max)
1458                 {
1459                         int ridinglevel = r_info[m_list[p_ptr->riding].r_idx].level;
1460                         int targetlevel = r_ptr->level;
1461                         int inc = 0;
1462
1463                         if ((cur / 200 - 5) < targetlevel)
1464                                 inc += 1;
1465
1466                         /* Extra experience */
1467                         if ((cur / 100) < ridinglevel)
1468                         {
1469                                 if ((cur / 100 + 15) < ridinglevel)
1470                                         inc += 1 + (ridinglevel - (cur / 100 + 15));
1471                                 else
1472                                         inc += 1;
1473                         }
1474
1475                         p_ptr->skill_exp[GINOU_RIDING] = MIN(max, cur + inc);
1476
1477                         p_ptr->update |= (PU_BONUS);
1478                 }
1479         }
1480
1481         riding_t_m_idx = c_ptr->m_idx;
1482         if (p_ptr->migite) py_attack_aux(y, x, &fear, &mdeath, 0, mode);
1483         if (p_ptr->hidarite && !mdeath) py_attack_aux(y, x, &fear, &mdeath, 1, mode);
1484
1485         /* Mutations which yield extra 'natural' attacks */
1486         if (!mdeath)
1487         {
1488                 if ((p_ptr->muta2 & MUT2_HORNS) && !mdeath)
1489                         natural_attack(c_ptr->m_idx, MUT2_HORNS, &fear, &mdeath);
1490                 if ((p_ptr->muta2 & MUT2_BEAK) && !mdeath)
1491                         natural_attack(c_ptr->m_idx, MUT2_BEAK, &fear, &mdeath);
1492                 if ((p_ptr->muta2 & MUT2_SCOR_TAIL) && !mdeath)
1493                         natural_attack(c_ptr->m_idx, MUT2_SCOR_TAIL, &fear, &mdeath);
1494                 if ((p_ptr->muta2 & MUT2_TRUNK) && !mdeath)
1495                         natural_attack(c_ptr->m_idx, MUT2_TRUNK, &fear, &mdeath);
1496                 if ((p_ptr->muta2 & MUT2_TENTACLES) && !mdeath)
1497                         natural_attack(c_ptr->m_idx, MUT2_TENTACLES, &fear, &mdeath);
1498         }
1499
1500         /* Hack -- delay fear messages */
1501         if (fear && m_ptr->ml && !mdeath)
1502         {
1503                 sound(SOUND_FLEE);
1504
1505                 msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), m_name);
1506         }
1507
1508         if ((p_ptr->special_defense & KATA_IAI) && ((mode != HISSATSU_IAI) || mdeath))
1509         {
1510                 set_action(ACTION_NONE);
1511         }
1512
1513         return mdeath;
1514 }
1515
1516
1517 /*!
1518  * @brief モンスターからプレイヤーへの打撃処理 / Attack the player via physical attacks.
1519  * @param m_idx 打撃を行うモンスターのID
1520  * @return 実際に攻撃処理を行った場合TRUEを返す
1521  */
1522 bool make_attack_normal(MONSTER_IDX m_idx)
1523 {
1524         monster_type *m_ptr = &m_list[m_idx];
1525         monster_race *r_ptr = &r_info[m_ptr->r_idx];
1526
1527         int ap_cnt;
1528
1529         INVENTORY_IDX i;
1530         int k, tmp, ac, rlev;
1531         int do_cut, do_stun;
1532
1533         s32b gold;
1534
1535         object_type *o_ptr;
1536
1537         char o_name[MAX_NLEN];
1538
1539         char m_name[80];
1540
1541         char ddesc[80];
1542
1543         bool blinked;
1544         bool touched = FALSE, fear = FALSE, alive = TRUE;
1545         bool explode = FALSE;
1546         bool do_silly_attack = (one_in_(2) && p_ptr->image);
1547         HIT_POINT get_damage = 0;
1548         int abbreviate = 0;     // 2回目以降の省略表現フラグ
1549
1550         /* Not allowed to attack */
1551         if (r_ptr->flags1 & (RF1_NEVER_BLOW)) return (FALSE);
1552
1553         if (d_info[dungeon_type].flags1 & DF1_NO_MELEE) return (FALSE);
1554
1555         /* ...nor if friendly */
1556         if (!is_hostile(m_ptr)) return FALSE;
1557
1558         /* Extract the effective monster level */
1559         rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
1560
1561
1562         /* Get the monster name (or "it") */
1563         monster_desc(m_name, m_ptr, 0);
1564
1565         /* Get the "died from" information (i.e. "a kobold") */
1566         monster_desc(ddesc, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
1567
1568         if (p_ptr->special_defense & KATA_IAI)
1569         {
1570                 msg_format(_("相手が襲いかかる前に素早く武器を振るった。", "You took sen, draw and cut in one motion before %s move."), m_name);
1571                 if (py_attack(m_ptr->fy, m_ptr->fx, HISSATSU_IAI)) return TRUE;
1572         }
1573
1574         if ((p_ptr->special_defense & NINJA_KAWARIMI) && (randint0(55) < (p_ptr->lev*3/5+20)))
1575         {
1576                 if (kawarimi(TRUE)) return TRUE;
1577         }
1578
1579         /* Assume no blink */
1580         blinked = FALSE;
1581
1582         /* Scan through all four blows */
1583         for (ap_cnt = 0; ap_cnt < 4; ap_cnt++)
1584         {
1585                 bool obvious = FALSE;
1586
1587                 HIT_POINT power = 0;
1588                 HIT_POINT damage = 0;
1589
1590                 cptr act = NULL;
1591
1592                 /* Extract the attack infomation */
1593                 int effect = r_ptr->blow[ap_cnt].effect;
1594                 int method = r_ptr->blow[ap_cnt].method;
1595                 int d_dice = r_ptr->blow[ap_cnt].d_dice;
1596                 int d_side = r_ptr->blow[ap_cnt].d_side;
1597
1598
1599                 if (!m_ptr->r_idx) break;
1600
1601                 /* Hack -- no more attacks */
1602                 if (!method) break;
1603
1604                 if (is_pet(m_ptr) && (r_ptr->flags1 & RF1_UNIQUE) && (method == RBM_EXPLODE))
1605                 {
1606                         method = RBM_HIT;
1607                         d_dice /= 10;
1608                 }
1609
1610                 /* Stop if player is dead or gone */
1611                 if (!p_ptr->playing || p_ptr->is_dead) break;
1612                 if (distance(p_ptr->y, p_ptr->x, m_ptr->fy, m_ptr->fx) > 1) break;
1613
1614                 /* Handle "leaving" */
1615                 if (p_ptr->leaving) break;
1616
1617                 if (method == RBM_SHOOT) continue;
1618
1619                 /* Extract the attack "power" */
1620                 power = mbe_info[effect].power;
1621
1622                 /* Total armor */
1623                 ac = p_ptr->ac + p_ptr->to_a;
1624
1625                 /* Monster hits player */
1626                 if (!effect || check_hit(power, rlev, MON_STUNNED(m_ptr)))
1627                 {
1628                         /* Always disturbing */
1629                         disturb(TRUE, TRUE);
1630
1631
1632                         /* Hack -- Apply "protection from evil" */
1633                         if ((p_ptr->protevil > 0) &&
1634                             (r_ptr->flags3 & RF3_EVIL) &&
1635                             (p_ptr->lev >= rlev) &&
1636                             ((randint0(100) + p_ptr->lev) > 50))
1637                         {
1638                                 /* Remember the Evil-ness */
1639                                 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
1640
1641 #ifdef JP
1642                                 if (abbreviate) msg_format("撃退した。");
1643                                 else msg_format("%^sは撃退された。", m_name);
1644                                 abbreviate = 1; /*2回目以降は省略 */
1645 #else
1646                                 msg_format("%^s is repelled.", m_name);
1647 #endif
1648
1649
1650                                 /* Hack -- Next attack */
1651                                 continue;
1652                         }
1653
1654
1655                         /* Assume no cut or stun */
1656                         do_cut = do_stun = 0;
1657
1658                         /* Describe the attack method */
1659                         switch (method)
1660                         {
1661                                 case RBM_HIT:
1662                                 {
1663                                         act = _("殴られた。", "hits you.");
1664                                         do_cut = do_stun = 1;
1665                                         touched = TRUE;
1666                                         sound(SOUND_HIT);
1667                                         break;
1668                                 }
1669
1670                                 case RBM_TOUCH:
1671                                 {
1672                                         act = _("触られた。", "touches you.");
1673                                         touched = TRUE;
1674                                         sound(SOUND_TOUCH);
1675                                         break;
1676                                 }
1677
1678                                 case RBM_PUNCH:
1679                                 {
1680                                         act = _("パンチされた。", "punches you.");
1681                                         touched = TRUE;
1682                                         do_stun = 1;
1683                                         sound(SOUND_HIT);
1684                                         break;
1685                                 }
1686
1687                                 case RBM_KICK:
1688                                 {
1689                                         act = _("蹴られた。", "kicks you.");
1690                                         touched = TRUE;
1691                                         do_stun = 1;
1692                                         sound(SOUND_HIT);
1693                                         break;
1694                                 }
1695
1696                                 case RBM_CLAW:
1697                                 {
1698                                         act = _("ひっかかれた。", "claws you.");
1699                                         touched = TRUE;
1700                                         do_cut = 1;
1701                                         sound(SOUND_CLAW);
1702                                         break;
1703                                 }
1704
1705                                 case RBM_BITE:
1706                                 {
1707                                         act = _("噛まれた。", "bites you.");
1708                                         do_cut = 1;
1709                                         touched = TRUE;
1710                                         sound(SOUND_BITE);
1711                                         break;
1712                                 }
1713
1714                                 case RBM_STING:
1715                                 {
1716                                         act = _("刺された。", "stings you.");
1717                                         touched = TRUE;
1718                                         sound(SOUND_STING);
1719                                         break;
1720                                 }
1721
1722                                 case RBM_SLASH:
1723                                 {
1724                                         act = _("斬られた。", "slashes you.");
1725                                         touched = TRUE;
1726                                         do_cut = 1;
1727                                         sound(SOUND_CLAW);
1728                                         break;
1729                                 }
1730
1731                                 case RBM_BUTT:
1732                                 {
1733                                         act = _("角で突かれた。", "butts you.");
1734                                         do_stun = 1;
1735                                         touched = TRUE;
1736                                         sound(SOUND_HIT);
1737                                         break;
1738                                 }
1739
1740                                 case RBM_CRUSH:
1741                                 {
1742                                         act = _("体当たりされた。", "crushes you.");
1743                                         do_stun = 1;
1744                                         touched = TRUE;
1745                                         sound(SOUND_CRUSH);
1746                                         break;
1747                                 }
1748
1749                                 case RBM_ENGULF:
1750                                 {
1751                                         act = _("飲み込まれた。", "engulfs you.");
1752                                         touched = TRUE;
1753                                         sound(SOUND_CRUSH);
1754                                         break;
1755                                 }
1756
1757                                 case RBM_CHARGE:
1758                                 {
1759                                         abbreviate = -1;
1760                                         act = _("は請求書をよこした。", "charges you.");
1761                                         touched = TRUE;
1762                                         sound(SOUND_BUY); /* Note! This is "charges", not "charges at". */
1763                                         break;
1764                                 }
1765
1766                                 case RBM_CRAWL:
1767                                 {
1768                                         abbreviate = -1;
1769                                         act = _("が体の上を這い回った。", "crawls on you.");
1770                                         touched = TRUE;
1771                                         sound(SOUND_SLIME);
1772                                         break;
1773                                 }
1774
1775                                 case RBM_DROOL:
1776                                 {
1777                                         act = _("よだれをたらされた。", "drools on you.");
1778                                         sound(SOUND_SLIME);
1779                                         break;
1780                                 }
1781
1782                                 case RBM_SPIT:
1783                                 {
1784                                         act = _("唾を吐かれた。", "spits on you.");
1785                                         sound(SOUND_SLIME);
1786                                         break;
1787                                 }
1788
1789                                 case RBM_EXPLODE:
1790                                 {
1791                                         abbreviate = -1;
1792                                         act = _("は爆発した。", "explodes.");
1793                                         explode = TRUE;
1794                                         break;
1795                                 }
1796
1797                                 case RBM_GAZE:
1798                                 {
1799                                         act = _("にらまれた。", "gazes at you.");
1800                                         break;
1801                                 }
1802
1803                                 case RBM_WAIL:
1804                                 {
1805                                         act = _("泣き叫ばれた。", "wails at you.");
1806                                         sound(SOUND_WAIL);
1807                                         break;
1808                                 }
1809
1810                                 case RBM_SPORE:
1811                                 {
1812                                         act = _("胞子を飛ばされた。", "releases spores at you.");
1813                                         sound(SOUND_SLIME);
1814                                         break;
1815                                 }
1816
1817                                 case RBM_XXX4:
1818                                 {
1819                                         abbreviate = -1;
1820                                         act = _("が XXX4 を発射した。", "projects XXX4's at you.");
1821                                         break;
1822                                 }
1823
1824                                 case RBM_BEG:
1825                                 {
1826                                         act = _("金をせがまれた。", "begs you for money.");
1827                                         sound(SOUND_MOAN);
1828                                         break;
1829                                 }
1830
1831                                 case RBM_INSULT:
1832                                 {
1833 #ifdef JP
1834                                         abbreviate = -1;
1835 #endif
1836                                         act = desc_insult[randint0(m_ptr->r_idx == MON_DEBBY ? 10 : 8)];
1837                                         sound(SOUND_MOAN);
1838                                         break;
1839                                 }
1840
1841                                 case RBM_MOAN:
1842                                 {
1843 #ifdef JP
1844                                         abbreviate = -1;
1845 #endif
1846                                         act = desc_moan[randint0(4)];
1847                                         sound(SOUND_MOAN);
1848                                         break;
1849                                 }
1850
1851                                 case RBM_SHOW:
1852                                 {
1853 #ifdef JP
1854                                         abbreviate = -1;
1855 #endif
1856                                         if (m_ptr->r_idx == MON_JAIAN)
1857                                         {
1858 #ifdef JP
1859                                                 switch(randint1(15))
1860                                                 {
1861                                                   case 1:
1862                                                   case 6:
1863                                                   case 11:
1864                                                         act = "「♪お~れはジャイアン~~ガ~キだいしょう~」";
1865                                                         break;
1866                                                   case 2:
1867                                                         act = "「♪て~んかむ~てきのお~とこだぜ~~」";
1868                                                         break;
1869                                                   case 3:
1870                                                         act = "「♪の~び太スネ夫はメじゃないよ~~」";
1871                                                         break;
1872                                                   case 4:
1873                                                         act = "「♪け~んかスポ~ツ~どんとこい~」";
1874                                                         break;
1875                                                   case 5:
1876                                                         act = "「♪うた~も~~う~まいぜ~まかしとけ~」";
1877                                                         break;
1878                                                   case 7:
1879                                                         act = "「♪ま~ちいちば~んのに~んきもの~~」";
1880                                                         break;
1881                                                   case 8:
1882                                                         act = "「♪べんきょうしゅくだいメじゃないよ~~」";
1883                                                         break;
1884                                                   case 9:
1885                                                         act = "「♪きはやさし~くて~ち~からもち~」";
1886                                                         break;
1887                                                   case 10:
1888                                                         act = "「♪かお~も~~スタイルも~バツグンさ~」";
1889                                                         break;
1890                                                   case 12:
1891                                                         act = "「♪がっこうい~ちの~あ~ばれんぼう~~」";
1892                                                         break;
1893                                                   case 13:
1894                                                         act = "「♪ド~ラもドラミもメじゃないよ~~」";
1895                                                         break;
1896                                                   case 14:
1897                                                         act = "「♪よじげんぽけっと~な~くたって~」";
1898                                                         break;
1899                                                   case 15:
1900                                                         act = "「♪あし~の~~ながさ~は~まけないぜ~」";
1901                                                         break;
1902                                                 }
1903 #else
1904                                                 act = "horribly sings 'I AM GIAAAAAN. THE BOOOSS OF THE KIIIIDS.'";
1905 #endif
1906                                         }
1907                                         else
1908                                         {
1909                                                 if (one_in_(3))
1910                                                         act = _("は♪僕らは楽しい家族♪と歌っている。", "sings 'We are a happy family.'");
1911                                                 else
1912                                                         act = _("は♪アイ ラブ ユー、ユー ラブ ミー♪と歌っている。", "sings 'I love you, you love me.'");
1913                                         }
1914
1915                                         sound(SOUND_SHOW);
1916                                         break;
1917                                 }
1918                         }
1919
1920                         if (act)
1921                         {
1922                                 if (do_silly_attack)
1923                                 {
1924 #ifdef JP
1925                                         abbreviate = -1;
1926 #endif
1927                                         act = silly_attacks[randint0(MAX_SILLY_ATTACK)];
1928                                 }
1929 #ifdef JP
1930                                 if (abbreviate == 0)
1931                                         msg_format("%^sに%s", m_name, act);
1932                                 else if (abbreviate == 1)
1933                                         msg_format("%s", act);
1934                                 else /* if (abbreviate == -1) */
1935                                         msg_format("%^s%s", m_name, act);
1936                                 abbreviate = 1;/*2回目以降は省略 */
1937 #else
1938                                 msg_format("%^s %s%s", m_name, act, do_silly_attack ? " you." : "");
1939 #endif
1940                         }
1941
1942                         /* Hack -- assume all attacks are obvious */
1943                         obvious = TRUE;
1944
1945                         /* Roll out the damage */
1946                         damage = damroll(d_dice, d_side);
1947
1948                         /*
1949                          * Skip the effect when exploding, since the explosion
1950                          * already causes the effect.
1951                          */
1952                         if(explode) damage = 0;
1953                         /* Apply appropriate damage */
1954                         switch (effect)
1955                         {
1956                                 case 0:
1957                                 {
1958                                         obvious = TRUE;
1959                                         damage = 0;
1960                                         break;
1961                                 }
1962
1963                                 case RBE_SUPERHURT:     /* AC軽減あり / Player armor reduces total damage */
1964                                 {
1965                                         if (((randint1(rlev*2+300) > (ac+200)) || one_in_(13)) && !CHECK_MULTISHADOW())
1966                                         {
1967                                                 int tmp_damage = damage - (damage * ((ac < 150) ? ac : 150) / 250);
1968                                                 msg_print(_("痛恨の一撃!", "It was a critical hit!"));
1969                                                 tmp_damage = MAX(damage, tmp_damage*2);
1970
1971                                                 get_damage += take_hit(DAMAGE_ATTACK, tmp_damage, ddesc, -1);
1972                                                 break;
1973                                         }
1974                                 }
1975                                 case RBE_HURT: /* AC軽減あり / Player armor reduces total damage */
1976                                 {
1977                                         obvious = TRUE;
1978                                         damage -= (damage * ((ac < 150) ? ac : 150) / 250);
1979                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1980                                         break;
1981                                 }
1982
1983                                 case RBE_POISON:
1984                                 {
1985                                         if (explode) break;
1986
1987                                         /* Take "poison" effect */
1988                                         if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()) && !CHECK_MULTISHADOW())
1989                                         {
1990                                                 if (set_poisoned(p_ptr->poisoned + randint1(rlev) + 5))
1991                                                 {
1992                                                         obvious = TRUE;
1993                                                 }
1994                                         }
1995
1996                                         /* Take some damage */
1997                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1998
1999                                         /* Learn about the player */
2000                                         update_smart_learn(m_idx, DRS_POIS);
2001
2002                                         break;
2003                                 }
2004
2005                                 case RBE_UN_BONUS:
2006                                 {
2007                                         if (explode) break;
2008
2009                                         /* Allow complete resist */
2010                                         if (!p_ptr->resist_disen && !CHECK_MULTISHADOW())
2011                                         {
2012                                                 /* Apply disenchantment */
2013                                                 if (apply_disenchant(0))
2014                                                 {
2015                                                         /* Hack -- Update AC */
2016                                                         update_stuff();
2017                                                         obvious = TRUE;
2018                                                 }
2019                                         }
2020
2021                                         /* Take some damage */
2022                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2023
2024                                         /* Learn about the player */
2025                                         update_smart_learn(m_idx, DRS_DISEN);
2026
2027                                         break;
2028                                 }
2029
2030                                 case RBE_UN_POWER:
2031                                 {
2032                                         /* Take some damage */
2033                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2034
2035                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2036
2037                                         /* Find an item */
2038                                         for (k = 0; k < 10; k++)
2039                                         {
2040                                                 /* Pick an item */
2041                                                 i = (INVENTORY_IDX)randint0(INVEN_PACK);
2042
2043                                                 /* Obtain the item */
2044                                                 o_ptr = &inventory[i];
2045
2046                                                 /* Skip non-objects */
2047                                                 if (!o_ptr->k_idx) continue;
2048
2049                                                 /* Drain charged wands/staffs */
2050                                                 if (((o_ptr->tval == TV_STAFF) ||
2051                                                      (o_ptr->tval == TV_WAND)) &&
2052                                                     (o_ptr->pval))
2053                                                 {
2054                                                         /* Calculate healed hitpoints */
2055                                                         int heal=rlev * o_ptr->pval;
2056                                                         if( o_ptr->tval == TV_STAFF)
2057                                                             heal *=  o_ptr->number;
2058
2059                                                         /* Don't heal more than max hp */
2060                                                         heal = MIN(heal, m_ptr->maxhp - m_ptr->hp);
2061
2062                                                         msg_print(_("ザックからエネルギーが吸い取られた!", "Energy drains from your pack!"));
2063
2064                                                         obvious = TRUE;
2065
2066                                                         /* Heal the monster */
2067                                                         m_ptr->hp += (HIT_POINT)heal;
2068
2069                                                         /* Redraw (later) if needed */
2070                                                         if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
2071                                                         if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
2072
2073                                                         /* Uncharge */
2074                                                         o_ptr->pval = 0;
2075
2076                                                         /* Combine / Reorder the pack */
2077                                                         p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2078
2079                                                         p_ptr->window |= (PW_INVEN);
2080
2081                                                         break;
2082                                                 }
2083                                         }
2084
2085                                         break;
2086                                 }
2087
2088                                 case RBE_EAT_GOLD:
2089                                 {
2090                                         /* Take some damage */
2091                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2092
2093                                         /* Confused monsters cannot steal successfully. -LM-*/
2094                                         if (MON_CONFUSED(m_ptr)) break;
2095
2096                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2097
2098                                         obvious = TRUE;
2099
2100                                         /* Saving throw (unless paralyzed) based on dex and level */
2101                                         if (!p_ptr->paralyzed &&
2102                                             (randint0(100) < (adj_dex_safe[p_ptr->stat_ind[A_DEX]] +
2103                                                               p_ptr->lev)))
2104                                         {
2105                                                 /* Saving throw message */
2106                                                 msg_print(_("しかし素早く財布を守った!", "You quickly protect your money pouch!"));
2107
2108                                                 /* Occasional blink anyway */
2109                                                 if (randint0(3)) blinked = TRUE;
2110                                         }
2111
2112                                         /* Eat gold */
2113                                         else
2114                                         {
2115                                                 gold = (p_ptr->au / 10) + randint1(25);
2116                                                 if (gold < 2) gold = 2;
2117                                                 if (gold > 5000) gold = (p_ptr->au / 20) + randint1(3000);
2118                                                 if (gold > p_ptr->au) gold = p_ptr->au;
2119                                                 p_ptr->au -= gold;
2120                                                 if (gold <= 0)
2121                                                 {
2122                                                         msg_print(_("しかし何も盗まれなかった。", "Nothing was stolen."));
2123                                                 }
2124                                                 else if (p_ptr->au)
2125                                                 {
2126                                                         msg_print(_("財布が軽くなった気がする。", "Your purse feels lighter."));
2127                                                         msg_format(_("$%ld のお金が盗まれた!", "%ld coins were stolen!"), (long)gold);
2128                                                         chg_virtue(V_SACRIFICE, 1);
2129                                                 }
2130                                                 else
2131                                                 {
2132                                                         msg_print(_("財布が軽くなった気がする。", "Your purse feels lighter."));
2133                                                         msg_print(_("お金が全部盗まれた!", "All of your coins were stolen!"));
2134                                                         chg_virtue(V_SACRIFICE, 2);
2135                                                 }
2136
2137                                                 /* Redraw gold */
2138                                                 p_ptr->redraw |= (PR_GOLD);
2139
2140                                                 p_ptr->window |= (PW_PLAYER);
2141
2142                                                 /* Blink away */
2143                                                 blinked = TRUE;
2144                                         }
2145
2146                                         break;
2147                                 }
2148
2149                                 case RBE_EAT_ITEM:
2150                                 {
2151                                         /* Take some damage */
2152                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2153
2154                                         /* Confused monsters cannot steal successfully. -LM-*/
2155                                         if (MON_CONFUSED(m_ptr)) break;
2156
2157                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2158
2159                                         /* Saving throw (unless paralyzed) based on dex and level */
2160                                         if (!p_ptr->paralyzed &&
2161                                             (randint0(100) < (adj_dex_safe[p_ptr->stat_ind[A_DEX]] +
2162                                                               p_ptr->lev)))
2163                                         {
2164                                                 /* Saving throw message */
2165                                                 msg_print(_("しかしあわててザックを取り返した!", "You grab hold of your backpack!"));
2166
2167                                                 /* Occasional "blink" anyway */
2168                                                 blinked = TRUE;
2169
2170                                                 obvious = TRUE;
2171
2172                                                 break;
2173                                         }
2174
2175                                         /* Find an item */
2176                                         for (k = 0; k < 10; k++)
2177                                         {
2178                                                 s16b o_idx;
2179
2180                                                 /* Pick an item */
2181                                                 i = (INVENTORY_IDX)randint0(INVEN_PACK);
2182
2183                                                 /* Obtain the item */
2184                                                 o_ptr = &inventory[i];
2185
2186                                                 /* Skip non-objects */
2187                                                 if (!o_ptr->k_idx) continue;
2188
2189                                                 /* Skip artifacts */
2190                                                 if (object_is_artifact(o_ptr)) continue;
2191
2192                                                 /* Get a description */
2193                                                 object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
2194
2195 #ifdef JP
2196                                                 msg_format("%s(%c)を%s盗まれた!",
2197                                                            o_name, index_to_label(i),
2198                                                            ((o_ptr->number > 1) ? "一つ" : ""));
2199 #else
2200                                                 msg_format("%sour %s (%c) was stolen!",
2201                                                            ((o_ptr->number > 1) ? "One of y" : "Y"),
2202                                                            o_name, index_to_label(i));
2203 #endif
2204
2205                                                 chg_virtue(V_SACRIFICE, 1);
2206
2207
2208                                                 /* Make an object */
2209                                                 o_idx = o_pop();
2210
2211                                                 /* Success */
2212                                                 if (o_idx)
2213                                                 {
2214                                                         object_type *j_ptr;
2215
2216                                                         /* Get new object */
2217                                                         j_ptr = &o_list[o_idx];
2218
2219                                                         /* Copy object */
2220                                                         object_copy(j_ptr, o_ptr);
2221
2222                                                         /* Modify number */
2223                                                         j_ptr->number = 1;
2224
2225                                                         /* Hack -- If a rod or wand, allocate total
2226                                                          * maximum timeouts or charges between those
2227                                                          * stolen and those missed. -LM-
2228                                                          */
2229                                                         if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
2230                                                         {
2231                                                                 j_ptr->pval = o_ptr->pval / o_ptr->number;
2232                                                                 o_ptr->pval -= j_ptr->pval;
2233                                                         }
2234
2235                                                         /* Forget mark */
2236                                                         j_ptr->marked = OM_TOUCHED;
2237
2238                                                         /* Memorize monster */
2239                                                         j_ptr->held_m_idx = m_idx;
2240
2241                                                         /* Build stack */
2242                                                         j_ptr->next_o_idx = m_ptr->hold_o_idx;
2243
2244                                                         /* Build stack */
2245                                                         m_ptr->hold_o_idx = o_idx;
2246                                                 }
2247
2248                                                 /* Steal the items */
2249                                                 inven_item_increase(i, -1);
2250                                                 inven_item_optimize(i);
2251
2252                                                 obvious = TRUE;
2253
2254                                                 /* Blink away */
2255                                                 blinked = TRUE;
2256
2257                                                 break;
2258                                         }
2259
2260                                         break;
2261                                 }
2262
2263                                 case RBE_EAT_FOOD:
2264                                 {
2265                                         /* Take some damage */
2266                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2267
2268                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2269
2270                                         /* Steal some food */
2271                                         for (k = 0; k < 10; k++)
2272                                         {
2273                                                 /* Pick an item from the pack */
2274                                                 i = (INVENTORY_IDX)randint0(INVEN_PACK);
2275
2276                                                 o_ptr = &inventory[i];
2277
2278                                                 /* Skip non-objects */
2279                                                 if (!o_ptr->k_idx) continue;
2280
2281                                                 /* Skip non-food objects */
2282                                                 if ((o_ptr->tval != TV_FOOD) && !((o_ptr->tval == TV_CORPSE) && (o_ptr->sval))) continue;
2283
2284                                                 /* Get a description */
2285                                                 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
2286
2287 #ifdef JP
2288                                                 msg_format("%s(%c)を%s食べられてしまった!", o_name, index_to_label(i), ((o_ptr->number > 1) ? "一つ" : ""));
2289 #else
2290                                                 msg_format("%sour %s (%c) was eaten!", ((o_ptr->number > 1) ? "One of y" : "Y"), o_name, index_to_label(i));
2291 #endif
2292
2293                                                 /* Steal the items */
2294                                                 inven_item_increase(i, -1);
2295                                                 inven_item_optimize(i);
2296
2297                                                 obvious = TRUE;
2298
2299                                                 break;
2300                                         }
2301
2302                                         break;
2303                                 }
2304
2305                                 case RBE_EAT_LITE:
2306                                 {
2307                                         /* Access the lite */
2308                                         o_ptr = &inventory[INVEN_LITE];
2309
2310                                         /* Take some damage */
2311                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2312
2313                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2314
2315                                         /* Drain fuel */
2316                                         if ((o_ptr->xtra4 > 0) && (!object_is_fixed_artifact(o_ptr)))
2317                                         {
2318                                                 /* Reduce fuel */
2319                                                 o_ptr->xtra4 -= (s16b)(250 + randint1(250));
2320                                                 if (o_ptr->xtra4 < 1) o_ptr->xtra4 = 1;
2321
2322                                                 if (!p_ptr->blind)
2323                                                 {
2324                                                         msg_print(_("明かりが暗くなってしまった。", "Your light dims."));
2325                                                         obvious = TRUE;
2326                                                 }
2327
2328                                                 p_ptr->window |= (PW_EQUIP);
2329                                         }
2330
2331                                         break;
2332                                 }
2333
2334                                 case RBE_ACID:
2335                                 {
2336                                         if (explode) break;
2337                                         obvious = TRUE;
2338
2339                                         msg_print(_("酸を浴びせられた!", "You are covered in acid!"));
2340
2341                                         /* Special damage */
2342                                         get_damage += acid_dam(damage, ddesc, -1, FALSE);
2343
2344                                         /* Hack -- Update AC */
2345                                         update_stuff();
2346
2347                                         /* Learn about the player */
2348                                         update_smart_learn(m_idx, DRS_ACID);
2349
2350                                         break;
2351                                 }
2352
2353                                 case RBE_ELEC:
2354                                 {
2355                                         if (explode) break;
2356                                         obvious = TRUE;
2357
2358                                         msg_print(_("電撃を浴びせられた!", "You are struck by electricity!"));
2359
2360                                         /* Special damage */
2361                                         get_damage += elec_dam(damage, ddesc, -1, FALSE);
2362
2363                                         /* Learn about the player */
2364                                         update_smart_learn(m_idx, DRS_ELEC);
2365
2366                                         break;
2367                                 }
2368
2369                                 case RBE_FIRE:
2370                                 {
2371                                         if (explode) break;
2372                                         obvious = TRUE;
2373
2374                                         msg_print(_("全身が炎に包まれた!", "You are enveloped in flames!"));
2375
2376                                         /* Special damage */
2377                                         get_damage += fire_dam(damage, ddesc, -1, FALSE);
2378
2379                                         /* Learn about the player */
2380                                         update_smart_learn(m_idx, DRS_FIRE);
2381
2382                                         break;
2383                                 }
2384
2385                                 case RBE_COLD:
2386                                 {
2387                                         if (explode) break;
2388                                         obvious = TRUE;
2389
2390                                         msg_print(_("全身が冷気で覆われた!", "You are covered with frost!"));
2391
2392                                         /* Special damage */
2393                                         get_damage += cold_dam(damage, ddesc, -1, FALSE);
2394
2395                                         /* Learn about the player */
2396                                         update_smart_learn(m_idx, DRS_COLD);
2397
2398                                         break;
2399                                 }
2400
2401                                 case RBE_BLIND:
2402                                 {
2403                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2404
2405                                         if (p_ptr->is_dead) break;
2406
2407                                         /* Increase "blind" */
2408                                         if (!p_ptr->resist_blind && !CHECK_MULTISHADOW())
2409                                         {
2410                                                 if (set_blind(p_ptr->blind + 10 + randint1(rlev)))
2411                                                 {
2412 #ifdef JP
2413                                                         if (m_ptr->r_idx == MON_DIO) msg_print("どうだッ!この血の目潰しはッ!");
2414 #else
2415                                                         /* nanka */
2416 #endif
2417                                                         obvious = TRUE;
2418                                                 }
2419                                         }
2420
2421                                         /* Learn about the player */
2422                                         update_smart_learn(m_idx, DRS_BLIND);
2423
2424                                         break;
2425                                 }
2426
2427                                 case RBE_CONFUSE:
2428                                 {
2429                                         if (explode) break;
2430                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2431
2432                                         if (p_ptr->is_dead) break;
2433
2434                                         /* Increase "confused" */
2435                                         if (!p_ptr->resist_conf && !CHECK_MULTISHADOW())
2436                                         {
2437                                                 if (set_confused(p_ptr->confused + 3 + randint1(rlev)))
2438                                                 {
2439                                                         obvious = TRUE;
2440                                                 }
2441                                         }
2442
2443                                         /* Learn about the player */
2444                                         update_smart_learn(m_idx, DRS_CONF);
2445
2446                                         break;
2447                                 }
2448
2449                                 case RBE_TERRIFY:
2450                                 {
2451                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2452
2453                                         if (p_ptr->is_dead) break;
2454
2455                                         /* Increase "afraid" */
2456                                         if (CHECK_MULTISHADOW())
2457                                         {
2458                                                 /* Do nothing */
2459                                         }
2460                                         else if (p_ptr->resist_fear)
2461                                         {
2462                                                 msg_print(_("しかし恐怖に侵されなかった!", "You stand your ground!"));
2463                                                 obvious = TRUE;
2464                                         }
2465                                         else if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2466                                         {
2467                                                 msg_print(_("しかし恐怖に侵されなかった!", "You stand your ground!"));
2468                                                 obvious = TRUE;
2469                                         }
2470                                         else
2471                                         {
2472                                                 if (set_afraid(p_ptr->afraid + 3 + randint1(rlev)))
2473                                                 {
2474                                                         obvious = TRUE;
2475                                                 }
2476                                         }
2477
2478                                         /* Learn about the player */
2479                                         update_smart_learn(m_idx, DRS_FEAR);
2480
2481                                         break;
2482                                 }
2483
2484                                 case RBE_PARALYZE:
2485                                 {
2486                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2487
2488                                         if (p_ptr->is_dead) break;
2489
2490                                         /* Increase "paralyzed" */
2491                                         if (CHECK_MULTISHADOW())
2492                                         {
2493                                                 /* Do nothing */
2494                                         }
2495                                         else if (p_ptr->free_act)
2496                                         {
2497                                                 msg_print(_("しかし効果がなかった!", "You are unaffected!"));
2498                                                 obvious = TRUE;
2499                                         }
2500                                         else if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2501                                         {
2502                                                 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
2503                                                 obvious = TRUE;
2504                                         }
2505                                         else
2506                                         {
2507                                                 if (!p_ptr->paralyzed)
2508                                                 {
2509                                                         if (set_paralyzed(3 + randint1(rlev)))
2510                                                         {
2511                                                                 obvious = TRUE;
2512                                                         }
2513                                                 }
2514                                         }
2515
2516                                         /* Learn about the player */
2517                                         update_smart_learn(m_idx, DRS_FREE);
2518
2519                                         break;
2520                                 }
2521
2522                                 case RBE_LOSE_STR:
2523                                 {
2524                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2525
2526                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2527                                         if (do_dec_stat(A_STR)) obvious = TRUE;
2528
2529                                         break;
2530                                 }
2531
2532                                 case RBE_LOSE_INT:
2533                                 {
2534                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2535
2536                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2537                                         if (do_dec_stat(A_INT)) obvious = TRUE;
2538
2539                                         break;
2540                                 }
2541
2542                                 case RBE_LOSE_WIS:
2543                                 {
2544                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2545
2546                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2547                                         if (do_dec_stat(A_WIS)) obvious = TRUE;
2548
2549                                         break;
2550                                 }
2551
2552                                 case RBE_LOSE_DEX:
2553                                 {
2554                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2555
2556                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2557                                         if (do_dec_stat(A_DEX)) obvious = TRUE;
2558
2559                                         break;
2560                                 }
2561
2562                                 case RBE_LOSE_CON:
2563                                 {
2564                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2565
2566                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2567                                         if (do_dec_stat(A_CON)) obvious = TRUE;
2568
2569                                         break;
2570                                 }
2571
2572                                 case RBE_LOSE_CHR:
2573                                 {
2574                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2575
2576                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2577                                         if (do_dec_stat(A_CHR)) obvious = TRUE;
2578
2579                                         break;
2580                                 }
2581
2582                                 case RBE_LOSE_ALL:
2583                                 {
2584                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2585
2586                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2587
2588                                         /* Damage (stats) */
2589                                         if (do_dec_stat(A_STR)) obvious = TRUE;
2590                                         if (do_dec_stat(A_DEX)) obvious = TRUE;
2591                                         if (do_dec_stat(A_CON)) obvious = TRUE;
2592                                         if (do_dec_stat(A_INT)) obvious = TRUE;
2593                                         if (do_dec_stat(A_WIS)) obvious = TRUE;
2594                                         if (do_dec_stat(A_CHR)) obvious = TRUE;
2595
2596                                         break;
2597                                 }
2598
2599                                 case RBE_SHATTER:
2600                                 {
2601                                         obvious = TRUE;
2602
2603                                         /* Hack -- Reduce damage based on the player armor class */
2604                                         damage -= (damage * ((ac < 150) ? ac : 150) / 250);
2605
2606                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2607
2608                                         /* Radius 8 earthquake centered at the monster */
2609                                         if (damage > 23 || explode)
2610                                         {
2611                                                 earthquake_aux(m_ptr->fy, m_ptr->fx, 8, m_idx);
2612                                         }
2613
2614                                         break;
2615                                 }
2616
2617                                 case RBE_EXP_10:
2618                                 {
2619                                         s32b d = damroll(10, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
2620
2621                                         obvious = TRUE;
2622
2623                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2624
2625                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2626
2627                                         (void)drain_exp(d, d / 10, 95);
2628                                         break;
2629                                 }
2630
2631                                 case RBE_EXP_20:
2632                                 {
2633                                         s32b d = damroll(20, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
2634
2635                                         obvious = TRUE;
2636
2637                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2638
2639                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2640
2641                                         (void)drain_exp(d, d / 10, 90);
2642                                         break;
2643                                 }
2644
2645                                 case RBE_EXP_40:
2646                                 {
2647                                         s32b d = damroll(40, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
2648
2649                                         obvious = TRUE;
2650
2651                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2652
2653                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2654
2655                                         (void)drain_exp(d, d / 10, 75);
2656                                         break;
2657                                 }
2658
2659                                 case RBE_EXP_80:
2660                                 {
2661                                         s32b d = damroll(80, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
2662
2663                                         obvious = TRUE;
2664
2665                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2666
2667                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2668
2669                                         (void)drain_exp(d, d / 10, 50);
2670                                         break;
2671                                 }
2672
2673                                 case RBE_DISEASE:
2674                                 {
2675                                         /* Take some damage */
2676                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2677
2678                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2679
2680                                         /* Take "poison" effect */
2681                                         if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
2682                                         {
2683                                                 if (set_poisoned(p_ptr->poisoned + randint1(rlev) + 5))
2684                                                 {
2685                                                         obvious = TRUE;
2686                                                 }
2687                                         }
2688
2689                                         /* Damage CON (10% chance)*/
2690                                         if ((randint1(100) < 11) && (p_ptr->prace != RACE_ANDROID))
2691                                         {
2692                                                 /* 1% chance for perm. damage */
2693                                                 bool perm = one_in_(10);
2694                                                 if (dec_stat(A_CON, randint1(10), perm))
2695                                                 {
2696                                                         msg_print(_("病があなたを蝕んでいる気がする。", "You feel strange sickness."));
2697                                                         obvious = TRUE;
2698                                                 }
2699                                         }
2700
2701                                         break;
2702                                 }
2703                                 case RBE_TIME:
2704                                 {
2705                                         if (explode) break;
2706                                         if (!p_ptr->resist_time && !CHECK_MULTISHADOW())
2707                                         {
2708                                                 switch (randint1(10))
2709                                                 {
2710                                                         case 1: case 2: case 3: case 4: case 5:
2711                                                         {
2712                                                                 if (p_ptr->prace == RACE_ANDROID) break;
2713                                                                 msg_print(_("人生が逆戻りした気がする。", "You feel life has clocked back."));
2714                                                                 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
2715                                                                 break;
2716                                                         }
2717
2718                                                         case 6: case 7: case 8: case 9:
2719                                                         {
2720                                                                 int stat = randint0(6);
2721
2722                                                                 switch (stat)
2723                                                                 {
2724 #ifdef JP
2725                                                                         case A_STR: act = "強く"; break;
2726                                                                         case A_INT: act = "聡明で"; break;
2727                                                                         case A_WIS: act = "賢明で"; break;
2728                                                                         case A_DEX: act = "器用で"; break;
2729                                                                         case A_CON: act = "健康で"; break;
2730                                                                         case A_CHR: act = "美しく"; break;
2731 #else
2732                                                                         case A_STR: act = "strong"; break;
2733                                                                         case A_INT: act = "bright"; break;
2734                                                                         case A_WIS: act = "wise"; break;
2735                                                                         case A_DEX: act = "agile"; break;
2736                                                                         case A_CON: act = "hale"; break;
2737                                                                         case A_CHR: act = "beautiful"; break;
2738 #endif
2739
2740                                                                 }
2741
2742                                                                 msg_format(_("あなたは以前ほど%sなくなってしまった...。", "You're not as %s as you used to be..."), act);
2743                                                                 p_ptr->stat_cur[stat] = (p_ptr->stat_cur[stat] * 3) / 4;
2744                                                                 if (p_ptr->stat_cur[stat] < 3) p_ptr->stat_cur[stat] = 3;
2745                                                                 p_ptr->update |= (PU_BONUS);
2746                                                                 break;
2747                                                         }
2748
2749                                                         case 10:
2750                                                         {
2751                                                                 msg_print(_("あなたは以前ほど力強くなくなってしまった...。", "You're not as powerful as you used to be..."));
2752
2753                                                                 for (k = 0; k < 6; k++)
2754                                                                 {
2755                                                                         p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
2756                                                                         if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
2757                                                                 }
2758                                                                 p_ptr->update |= (PU_BONUS);
2759                                                                 break;
2760                                                         }
2761                                                 }
2762                                         }
2763                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2764
2765                                         break;
2766                                 }
2767                                 case RBE_DR_LIFE:
2768                                 {
2769                                         s32b d = damroll(60, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
2770                                         bool resist_drain;
2771
2772                                         obvious = TRUE;
2773
2774                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2775
2776                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2777
2778                                         resist_drain = !drain_exp(d, d / 10, 50);
2779
2780                                         /* Heal the attacker? */
2781                                         if (p_ptr->mimic_form)
2782                                         {
2783                                                 if (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING)
2784                                                         resist_drain = TRUE;
2785                                         }
2786                                         else
2787                                         {
2788                                                 switch (p_ptr->prace)
2789                                                 {
2790                                                 case RACE_ZOMBIE:
2791                                                 case RACE_VAMPIRE:
2792                                                 case RACE_SPECTRE:
2793                                                 case RACE_SKELETON:
2794                                                 case RACE_DEMON:
2795                                                 case RACE_GOLEM:
2796                                                 case RACE_ANDROID:
2797                                                         resist_drain = TRUE;
2798                                                         break;
2799                                                 }
2800                                         }
2801
2802                                         if ((damage > 5) && !resist_drain)
2803                                         {
2804                                                 bool did_heal = FALSE;
2805
2806                                                 if (m_ptr->hp < m_ptr->maxhp) did_heal = TRUE;
2807
2808                                                 /* Heal */
2809                                                 m_ptr->hp += damroll(4, damage / 6);
2810                                                 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2811
2812                                                 /* Redraw (later) if needed */
2813                                                 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
2814                                                 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
2815
2816                                                 /* Special message */
2817                                                 if (m_ptr->ml && did_heal)
2818                                                 {
2819                                                         msg_format(_("%sは体力を回復したようだ。", "%^s appears healthier."), m_name);
2820                                                 }
2821                                         }
2822
2823                                         break;
2824                                 }
2825                                 case RBE_DR_MANA:
2826                                 {
2827                                         obvious = TRUE;
2828
2829                                         if (CHECK_MULTISHADOW())
2830                                         {
2831                                                 msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, you are unharmed!"));
2832                                         }
2833                                         else
2834                                         {
2835                                                 do_cut = 0;
2836
2837                                                 p_ptr->csp -= damage;
2838                                                 if (p_ptr->csp < 0)
2839                                                 {
2840                                                         p_ptr->csp = 0;
2841                                                         p_ptr->csp_frac = 0;
2842                                                 }
2843
2844                                                 p_ptr->redraw |= (PR_MANA);
2845                                         }
2846
2847                                         /* Learn about the player */
2848                                         update_smart_learn(m_idx, DRS_MANA);
2849
2850                                         break;
2851                                 }
2852                                 case RBE_INERTIA:
2853                                 {
2854                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2855
2856                                         if (p_ptr->is_dead) break;
2857
2858                                         /* Decrease speed */
2859                                         if (CHECK_MULTISHADOW())
2860                                         {
2861                                                 /* Do nothing */
2862                                         }
2863                                         else
2864                                         {
2865                                                 if (set_slow((p_ptr->slow + 4 + randint0(rlev / 10)), FALSE))
2866                                                 {
2867                                                         obvious = TRUE;
2868                                                 }
2869                                         }
2870
2871                                         break;
2872                                 }
2873                                 case RBE_STUN:
2874                                 {
2875                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2876
2877                                         if (p_ptr->is_dead) break;
2878
2879                                         /* Decrease speed */
2880                                         if (p_ptr->resist_sound || CHECK_MULTISHADOW())
2881                                         {
2882                                                 /* Do nothing */
2883                                         }
2884                                         else
2885                                         {
2886                                                 if (set_stun(p_ptr->stun + 10 + randint1(r_ptr->level / 4)))
2887                                                 {
2888                                                         obvious = TRUE;
2889                                                 }
2890                                         }
2891
2892                                         break;
2893                                 }
2894                         }
2895
2896                         /* Hack -- only one of cut or stun */
2897                         if (do_cut && do_stun)
2898                         {
2899                                 /* Cancel cut */
2900                                 if (randint0(100) < 50)
2901                                 {
2902                                         do_cut = 0;
2903                                 }
2904
2905                                 /* Cancel stun */
2906                                 else
2907                                 {
2908                                         do_stun = 0;
2909                                 }
2910                         }
2911
2912                         /* Handle cut */
2913                         if (do_cut)
2914                         {
2915                                 int cut_plus = 0;
2916
2917                                 /* Critical hit (zero if non-critical) */
2918                                 tmp = monster_critical(d_dice, d_side, damage);
2919
2920                                 /* Roll for damage */
2921                                 switch (tmp)
2922                                 {
2923                                         case 0: cut_plus = 0; break;
2924                                         case 1: cut_plus = randint1(5); break;
2925                                         case 2: cut_plus = randint1(5) + 5; break;
2926                                         case 3: cut_plus = randint1(20) + 20; break;
2927                                         case 4: cut_plus = randint1(50) + 50; break;
2928                                         case 5: cut_plus = randint1(100) + 100; break;
2929                                         case 6: cut_plus = 300; break;
2930                                         default: cut_plus = 500; break;
2931                                 }
2932
2933                                 /* Apply the cut */
2934                                 if (cut_plus) (void)set_cut(p_ptr->cut + cut_plus);
2935                         }
2936
2937                         /* Handle stun */
2938                         if (do_stun)
2939                         {
2940                                 int stun_plus = 0;
2941
2942                                 /* Critical hit (zero if non-critical) */
2943                                 tmp = monster_critical(d_dice, d_side, damage);
2944
2945                                 /* Roll for damage */
2946                                 switch (tmp)
2947                                 {
2948                                         case 0: stun_plus = 0; break;
2949                                         case 1: stun_plus = randint1(5); break;
2950                                         case 2: stun_plus = randint1(5) + 10; break;
2951                                         case 3: stun_plus = randint1(10) + 20; break;
2952                                         case 4: stun_plus = randint1(15) + 30; break;
2953                                         case 5: stun_plus = randint1(20) + 40; break;
2954                                         case 6: stun_plus = 80; break;
2955                                         default: stun_plus = 150; break;
2956                                 }
2957
2958                                 /* Apply the stun */
2959                                 if (stun_plus) (void)set_stun(p_ptr->stun + stun_plus);
2960                         }
2961
2962                         if (explode)
2963                         {
2964                                 sound(SOUND_EXPLODE);
2965
2966                                 if (mon_take_hit(m_idx, m_ptr->hp + 1, &fear, NULL))
2967                                 {
2968                                         blinked = FALSE;
2969                                         alive = FALSE;
2970                                 }
2971                         }
2972
2973                         if (touched)
2974                         {
2975                                 if (p_ptr->sh_fire && alive && !p_ptr->is_dead)
2976                                 {
2977                                         if (!(r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK))
2978                                         {
2979                                                 HIT_POINT dam = damroll(2, 6);
2980
2981                                                 /* Modify the damage */
2982                                                 dam = mon_damage_mod(m_ptr, dam, FALSE);
2983
2984 #ifdef JP
2985                                                 msg_format("%^sは突然熱くなった!", m_name);
2986                                                 if (mon_take_hit(m_idx, dam, &fear,
2987                                                     "は灰の山になった。"))
2988 #else
2989                                                 msg_format("%^s is suddenly very hot!", m_name);
2990
2991                                                 if (mon_take_hit(m_idx, dam, &fear,
2992                                                     " turns into a pile of ash."))
2993 #endif
2994
2995                                                 {
2996                                                         blinked = FALSE;
2997                                                         alive = FALSE;
2998                                                 }
2999                                         }
3000                                         else
3001                                         {
3002                                                 if (is_original_ap_and_seen(m_ptr))
3003                                                         r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK);
3004                                         }
3005                                 }
3006
3007                                 if (p_ptr->sh_elec && alive && !p_ptr->is_dead)
3008                                 {
3009                                         if (!(r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK))
3010                                         {
3011                                                 HIT_POINT dam = damroll(2, 6);
3012
3013                                                 /* Modify the damage */
3014                                                 dam = mon_damage_mod(m_ptr, dam, FALSE);
3015
3016 #ifdef JP
3017                                                 msg_format("%^sは電撃をくらった!", m_name);
3018                                                 if (mon_take_hit(m_idx, dam, &fear,
3019                                                     "は燃え殻の山になった。"))
3020 #else
3021                                                 msg_format("%^s gets zapped!", m_name);
3022
3023                                                 if (mon_take_hit(m_idx, dam, &fear,
3024                                                     " turns into a pile of cinder."))
3025 #endif
3026
3027                                                 {
3028                                                         blinked = FALSE;
3029                                                         alive = FALSE;
3030                                                 }
3031                                         }
3032                                         else
3033                                         {
3034                                                 if (is_original_ap_and_seen(m_ptr))
3035                                                         r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK);
3036                                         }
3037                                 }
3038
3039                                 if (p_ptr->sh_cold && alive && !p_ptr->is_dead)
3040                                 {
3041                                         if (!(r_ptr->flagsr & RFR_EFF_IM_COLD_MASK))
3042                                         {
3043                                                 HIT_POINT dam = damroll(2, 6);
3044
3045                                                 /* Modify the damage */
3046                                                 dam = mon_damage_mod(m_ptr, dam, FALSE);
3047
3048 #ifdef JP
3049                                                 msg_format("%^sは冷気をくらった!", m_name);
3050                                                 if (mon_take_hit(m_idx, dam, &fear,
3051                                                     "は凍りついた。"))
3052 #else
3053                                                 msg_format("%^s is very cold!", m_name);
3054
3055                                                 if (mon_take_hit(m_idx, dam, &fear,
3056                                                     " was frozen."))
3057 #endif
3058
3059                                                 {
3060                                                         blinked = FALSE;
3061                                                         alive = FALSE;
3062                                                 }
3063                                         }
3064                                         else
3065                                         {
3066                                                 if (is_original_ap_and_seen(m_ptr))
3067                                                         r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK);
3068                                         }
3069                                 }
3070
3071                                 /* by henkma */
3072                                 if (p_ptr->dustrobe && alive && !p_ptr->is_dead)
3073                                 {
3074                                         if (!(r_ptr->flagsr & RFR_EFF_RES_SHAR_MASK))
3075                                         {
3076                                                 HIT_POINT dam = damroll(2, 6);
3077
3078                                                 /* Modify the damage */
3079                                                 dam = mon_damage_mod(m_ptr, dam, FALSE);
3080
3081 #ifdef JP
3082                                                 msg_format("%^sは鏡の破片をくらった!", m_name);
3083                                                 if (mon_take_hit(m_idx, dam, &fear,
3084                                                     "はズタズタになった。"))
3085 #else
3086                                                 msg_format("%^s gets zapped!", m_name);
3087
3088                                                 if (mon_take_hit(m_idx, dam, &fear,
3089                                                     " had torn to pieces."))
3090 #endif
3091                                                 {
3092                                                         blinked = FALSE;
3093                                                         alive = FALSE;
3094                                                 }
3095                                         }
3096                                         else
3097                                         {
3098                                                 if (is_original_ap_and_seen(m_ptr))
3099                                                         r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_RES_SHAR_MASK);
3100                                         }
3101
3102                                         if (is_mirror_grid(&cave[p_ptr->y][p_ptr->x]))
3103                                         {
3104                                                 teleport_player(10, 0L);
3105                                         }
3106                                 }
3107
3108                                 if (p_ptr->tim_sh_holy && alive && !p_ptr->is_dead)
3109                                 {
3110                                         if (r_ptr->flags3 & RF3_EVIL)
3111                                         {
3112                                                 if (!(r_ptr->flagsr & RFR_RES_ALL))
3113                                                 {
3114                                                         HIT_POINT dam = damroll(2, 6);
3115
3116                                                         /* Modify the damage */
3117                                                         dam = mon_damage_mod(m_ptr, dam, FALSE);
3118
3119 #ifdef JP
3120                                                         msg_format("%^sは聖なるオーラで傷ついた!", m_name);
3121                                                         if (mon_take_hit(m_idx, dam, &fear,
3122                                                             "は倒れた。"))
3123 #else
3124                                                         msg_format("%^s is injured by holy power!", m_name);
3125
3126                                                         if (mon_take_hit(m_idx, dam, &fear,
3127                                                             " is destroyed."))
3128 #endif
3129                                                         {
3130                                                                 blinked = FALSE;
3131                                                                 alive = FALSE;
3132                                                         }
3133                                                         if (is_original_ap_and_seen(m_ptr))
3134                                                                 r_ptr->r_flags3 |= RF3_EVIL;
3135                                                 }
3136                                                 else
3137                                                 {
3138                                                         if (is_original_ap_and_seen(m_ptr))
3139                                                                 r_ptr->r_flagsr |= RFR_RES_ALL;
3140                                                 }
3141                                         }
3142                                 }
3143
3144                                 if (p_ptr->tim_sh_touki && alive && !p_ptr->is_dead)
3145                                 {
3146                                         if (!(r_ptr->flagsr & RFR_RES_ALL))
3147                                         {
3148                                                 HIT_POINT dam = damroll(2, 6);
3149
3150                                                 /* Modify the damage */
3151                                                 dam = mon_damage_mod(m_ptr, dam, FALSE);
3152
3153 #ifdef JP
3154                                                 msg_format("%^sが鋭い闘気のオーラで傷ついた!", m_name);
3155                                                 if (mon_take_hit(m_idx, dam, &fear,
3156                                                     "は倒れた。"))
3157 #else
3158                                                 msg_format("%^s is injured by the Force", m_name);
3159
3160                                                 if (mon_take_hit(m_idx, dam, &fear,
3161                                                     " is destroyed."))
3162 #endif
3163
3164                                                 {
3165                                                         blinked = FALSE;
3166                                                         alive = FALSE;
3167                                                 }
3168                                         }
3169                                         else
3170                                         {
3171                                                 if (is_original_ap_and_seen(m_ptr))
3172                                                         r_ptr->r_flagsr |= RFR_RES_ALL;
3173                                         }
3174                                 }
3175
3176                                 if (hex_spelling(HEX_SHADOW_CLOAK) && alive && !p_ptr->is_dead)
3177                                 {
3178                                         HIT_POINT dam = 1;
3179                                         object_type *o_armed_ptr = &inventory[INVEN_RARM];
3180
3181                                         if (!(r_ptr->flagsr & RFR_RES_ALL || r_ptr->flagsr & RFR_RES_DARK))
3182                                         {
3183                                                 if (o_armed_ptr->k_idx)
3184                                                 {
3185                                                         int basedam = ((o_armed_ptr->dd + p_ptr->to_dd[0]) * (o_armed_ptr->ds + p_ptr->to_ds[0] + 1));
3186                                                         dam = basedam / 2 + o_armed_ptr->to_d + p_ptr->to_d[0];
3187                                                 }
3188
3189                                                 /* Cursed armor makes damages doubled */
3190                                                 o_armed_ptr = &inventory[INVEN_BODY];
3191                                                 if ((o_armed_ptr->k_idx) && object_is_cursed(o_armed_ptr)) dam *= 2;
3192
3193                                                 /* Modify the damage */
3194                                                 dam = mon_damage_mod(m_ptr, dam, FALSE);
3195
3196 #ifdef JP
3197                                                 msg_format("影のオーラが%^sに反撃した!", m_name);
3198                                                 if (mon_take_hit(m_idx, dam, &fear, "は倒れた。"))
3199 #else
3200                                                 msg_format("Enveloped shadows attack %^s.", m_name);
3201
3202                                                 if (mon_take_hit(m_idx, dam, &fear, " is destroyed."))
3203 #endif
3204                                                 {
3205                                                         blinked = FALSE;
3206                                                         alive = FALSE;
3207                                                 }
3208                                                 else /* monster does not dead */
3209                                                 {
3210                                                         int j;
3211                                                         BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
3212                                                         EFFECT_ID typ[4][2] = {
3213                                                                 { INVEN_HEAD, GF_OLD_CONF },
3214                                                                 { INVEN_LARM,  GF_OLD_SLEEP },
3215                                                                 { INVEN_HANDS, GF_TURN_ALL },
3216                                                                 { INVEN_FEET, GF_OLD_SLOW }
3217                                                         };
3218
3219                                                         /* Some cursed armours gives an extra effect */
3220                                                         for (j = 0; j < 4; j++)
3221                                                         {
3222                                                                 o_armed_ptr = &inventory[typ[j][0]];
3223                                                                 if ((o_armed_ptr->k_idx) && object_is_cursed(o_armed_ptr) && object_is_armour(o_armed_ptr))
3224                                                                         project(0, 0, m_ptr->fy, m_ptr->fx, (p_ptr->lev * 2), typ[j][1], flg, -1);
3225                                                         }
3226                                                 }
3227                                         }
3228                                         else
3229                                         {
3230                                                 if (is_original_ap_and_seen(m_ptr))
3231                                                         r_ptr->r_flagsr |= (RFR_RES_ALL | RFR_RES_DARK);
3232                                         }
3233                                 }
3234                         }
3235                 }
3236
3237                 /* Monster missed player */
3238                 else
3239                 {
3240                         /* Analyze failed attacks */
3241                         switch (method)
3242                         {
3243                                 case RBM_HIT:
3244                                 case RBM_TOUCH:
3245                                 case RBM_PUNCH:
3246                                 case RBM_KICK:
3247                                 case RBM_CLAW:
3248                                 case RBM_BITE:
3249                                 case RBM_STING:
3250                                 case RBM_SLASH:
3251                                 case RBM_BUTT:
3252                                 case RBM_CRUSH:
3253                                 case RBM_ENGULF:
3254                                 case RBM_CHARGE:
3255
3256                                 /* Visible monsters */
3257                                 if (m_ptr->ml)
3258                                 {
3259                                         /* Disturbing */
3260                                         disturb(TRUE, TRUE);
3261
3262 #ifdef JP
3263                                         if (abbreviate)
3264                                             msg_format("%sかわした。", (p_ptr->special_attack & ATTACK_SUIKEN) ? "奇妙な動きで" : "");
3265                                         else
3266                                             msg_format("%s%^sの攻撃をかわした。", (p_ptr->special_attack & ATTACK_SUIKEN) ? "奇妙な動きで" : "", m_name);
3267                                         abbreviate = 1;/*2回目以降は省略 */
3268 #else
3269                                         msg_format("%^s misses you.", m_name);
3270 #endif
3271
3272                                 }
3273                                 damage = 0;
3274
3275                                 break;
3276                         }
3277                 }
3278
3279
3280                 /* Analyze "visible" monsters only */
3281                 if (is_original_ap_and_seen(m_ptr) && !do_silly_attack)
3282                 {
3283                         /* Count "obvious" attacks (and ones that cause damage) */
3284                         if (obvious || damage || (r_ptr->r_blows[ap_cnt] > 10))
3285                         {
3286                                 /* Count attacks of this type */
3287                                 if (r_ptr->r_blows[ap_cnt] < MAX_UCHAR)
3288                                 {
3289                                         r_ptr->r_blows[ap_cnt]++;
3290                                 }
3291                         }
3292                 }
3293
3294                 if (p_ptr->riding && damage)
3295                 {
3296                         char m_steed_name[80];
3297                         monster_desc(m_steed_name, &m_list[p_ptr->riding], 0);
3298                         if (rakuba((damage > 200) ? 200 : damage, FALSE))
3299                         {
3300                                 msg_format(_("%^sから落ちてしまった!", "You have fallen from %s."), m_steed_name);
3301                         }
3302                 }
3303
3304                 if (p_ptr->special_defense & NINJA_KAWARIMI)
3305                 {
3306                         if (kawarimi(FALSE)) return TRUE;
3307                 }
3308         }
3309
3310         /* Hex - revenge damage stored */
3311         revenge_store(get_damage);
3312
3313         if ((p_ptr->tim_eyeeye || hex_spelling(HEX_EYE_FOR_EYE))
3314                 && get_damage > 0 && !p_ptr->is_dead)
3315         {
3316 #ifdef JP
3317                 msg_format("攻撃が%s自身を傷つけた!", m_name);
3318 #else
3319                 char m_name_self[80];
3320
3321                 /* hisself */
3322                 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
3323
3324                 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
3325 #endif
3326                 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
3327                 if (p_ptr->tim_eyeeye) set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
3328         }
3329
3330         if ((p_ptr->counter || (p_ptr->special_defense & KATA_MUSOU)) && alive && !p_ptr->is_dead && m_ptr->ml && (p_ptr->csp > 7))
3331         {
3332                 char m_target_name[80];
3333                 monster_desc(m_target_name, m_ptr, 0);
3334
3335                 p_ptr->csp -= 7;
3336                 msg_format(_("%^sに反撃した!", "Your counterattack to %s!"), m_target_name);
3337                 py_attack(m_ptr->fy, m_ptr->fx, HISSATSU_COUNTER);
3338                 fear = FALSE;
3339
3340                 /* Redraw mana */
3341                 p_ptr->redraw |= (PR_MANA);
3342         }
3343
3344         /* Blink away */
3345         if (blinked && alive && !p_ptr->is_dead)
3346         {
3347                 if (teleport_barrier(m_idx))
3348                 {
3349                         msg_print(_("泥棒は笑って逃げ...ようとしたがバリアに防がれた。", "The thief flees laughing...? But magic barrier obstructs it."));
3350                 }
3351                 else
3352                 {
3353                         msg_print(_("泥棒は笑って逃げた!", "The thief flees laughing!"));
3354                         teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
3355                 }
3356         }
3357
3358
3359         /* Always notice cause of death */
3360         if (p_ptr->is_dead && (r_ptr->r_deaths < MAX_SHORT) && !p_ptr->inside_arena)
3361         {
3362                 r_ptr->r_deaths++;
3363         }
3364
3365         if (m_ptr->ml && fear && alive && !p_ptr->is_dead)
3366         {
3367                 sound(SOUND_FLEE);
3368                 msg_format(_("%^sは恐怖で逃げ出した!", "%^s flees in terror!"), m_name);
3369         }
3370
3371         if (p_ptr->special_defense & KATA_IAI)
3372         {
3373                 set_action(ACTION_NONE);
3374         }
3375
3376         /* Assume we attacked */
3377         return (TRUE);
3378 }