OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[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;
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)
1643                                     msg_format("撃退した。");
1644                                 else
1645                                     msg_format("%^sは撃退された。", m_name);
1646                                 abbreviate = 1;/*2回目以降は省略 */
1647 #else
1648                                 msg_format("%^s is repelled.", m_name);
1649 #endif
1650
1651
1652                                 /* Hack -- Next attack */
1653                                 continue;
1654                         }
1655
1656
1657                         /* Assume no cut or stun */
1658                         do_cut = do_stun = 0;
1659
1660                         /* Describe the attack method */
1661                         switch (method)
1662                         {
1663                                 case RBM_HIT:
1664                                 {
1665                                         act = _("殴られた。", "hits you.");
1666                                         do_cut = do_stun = 1;
1667                                         touched = TRUE;
1668                                         sound(SOUND_HIT);
1669                                         break;
1670                                 }
1671
1672                                 case RBM_TOUCH:
1673                                 {
1674                                         act = _("触られた。", "touches you.");
1675                                         touched = TRUE;
1676                                         sound(SOUND_TOUCH);
1677                                         break;
1678                                 }
1679
1680                                 case RBM_PUNCH:
1681                                 {
1682                                         act = _("パンチされた。", "punches you.");
1683                                         touched = TRUE;
1684                                         do_stun = 1;
1685                                         sound(SOUND_HIT);
1686                                         break;
1687                                 }
1688
1689                                 case RBM_KICK:
1690                                 {
1691                                         act = _("蹴られた。", "kicks you.");
1692                                         touched = TRUE;
1693                                         do_stun = 1;
1694                                         sound(SOUND_HIT);
1695                                         break;
1696                                 }
1697
1698                                 case RBM_CLAW:
1699                                 {
1700                                         act = _("ひっかかれた。", "claws you.");
1701                                         touched = TRUE;
1702                                         do_cut = 1;
1703                                         sound(SOUND_CLAW);
1704                                         break;
1705                                 }
1706
1707                                 case RBM_BITE:
1708                                 {
1709                                         act = _("噛まれた。", "bites you.");
1710                                         do_cut = 1;
1711                                         touched = TRUE;
1712                                         sound(SOUND_BITE);
1713                                         break;
1714                                 }
1715
1716                                 case RBM_STING:
1717                                 {
1718                                         act = _("刺された。", "stings you.");
1719                                         touched = TRUE;
1720                                         sound(SOUND_STING);
1721                                         break;
1722                                 }
1723
1724                                 case RBM_SLASH:
1725                                 {
1726                                         act = _("斬られた。", "slashes you.");
1727                                         touched = TRUE;
1728                                         do_cut = 1;
1729                                         sound(SOUND_CLAW);
1730                                         break;
1731                                 }
1732
1733                                 case RBM_BUTT:
1734                                 {
1735                                         act = _("角で突かれた。", "butts you.");
1736                                         do_stun = 1;
1737                                         touched = TRUE;
1738                                         sound(SOUND_HIT);
1739                                         break;
1740                                 }
1741
1742                                 case RBM_CRUSH:
1743                                 {
1744                                         act = _("体当たりされた。", "crushes you.");
1745                                         do_stun = 1;
1746                                         touched = TRUE;
1747                                         sound(SOUND_CRUSH);
1748                                         break;
1749                                 }
1750
1751                                 case RBM_ENGULF:
1752                                 {
1753                                         act = _("飲み込まれた。", "engulfs you.");
1754                                         touched = TRUE;
1755                                         sound(SOUND_CRUSH);
1756                                         break;
1757                                 }
1758
1759                                 case RBM_CHARGE:
1760                                 {
1761                                         abbreviate = -1;
1762                                         act = _("は請求書をよこした。", "charges you.");
1763                                         touched = TRUE;
1764                                         sound(SOUND_BUY); /* Note! This is "charges", not "charges at". */
1765                                         break;
1766                                 }
1767
1768                                 case RBM_CRAWL:
1769                                 {
1770                                         abbreviate = -1;
1771                                         act = _("が体の上を這い回った。", "crawls on you.");
1772                                         touched = TRUE;
1773                                         sound(SOUND_SLIME);
1774                                         break;
1775                                 }
1776
1777                                 case RBM_DROOL:
1778                                 {
1779                                         act = _("よだれをたらされた。", "drools on you.");
1780                                         sound(SOUND_SLIME);
1781                                         break;
1782                                 }
1783
1784                                 case RBM_SPIT:
1785                                 {
1786                                         act = _("唾を吐かれた。", "spits on you.");
1787                                         sound(SOUND_SLIME);
1788                                         break;
1789                                 }
1790
1791                                 case RBM_EXPLODE:
1792                                 {
1793                                         abbreviate = -1;
1794                                         act = _("は爆発した。", "explodes.");
1795                                         explode = TRUE;
1796                                         break;
1797                                 }
1798
1799                                 case RBM_GAZE:
1800                                 {
1801                                         act = _("にらまれた。", "gazes at you.");
1802                                         break;
1803                                 }
1804
1805                                 case RBM_WAIL:
1806                                 {
1807                                         act = _("泣き叫ばれた。", "wails at you.");
1808                                         sound(SOUND_WAIL);
1809                                         break;
1810                                 }
1811
1812                                 case RBM_SPORE:
1813                                 {
1814                                         act = _("胞子を飛ばされた。", "releases spores at you.");
1815                                         sound(SOUND_SLIME);
1816                                         break;
1817                                 }
1818
1819                                 case RBM_XXX4:
1820                                 {
1821                                         abbreviate = -1;
1822                                         act = _("が XXX4 を発射した。", "projects XXX4's at you.");
1823                                         break;
1824                                 }
1825
1826                                 case RBM_BEG:
1827                                 {
1828                                         act = _("金をせがまれた。", "begs you for money.");
1829                                         sound(SOUND_MOAN);
1830                                         break;
1831                                 }
1832
1833                                 case RBM_INSULT:
1834                                 {
1835 #ifdef JP
1836                                         abbreviate = -1;
1837 #endif
1838                                         act = desc_insult[randint0(m_ptr->r_idx == MON_DEBBY ? 10 : 8)];
1839                                         sound(SOUND_MOAN);
1840                                         break;
1841                                 }
1842
1843                                 case RBM_MOAN:
1844                                 {
1845 #ifdef JP
1846                                         abbreviate = -1;
1847 #endif
1848                                         act = desc_moan[randint0(4)];
1849                                         sound(SOUND_MOAN);
1850                                         break;
1851                                 }
1852
1853                                 case RBM_SHOW:
1854                                 {
1855 #ifdef JP
1856                                         abbreviate = -1;
1857 #endif
1858                                         if (m_ptr->r_idx == MON_JAIAN)
1859                                         {
1860 #ifdef JP
1861                                                 switch(randint1(15))
1862                                                 {
1863                                                   case 1:
1864                                                   case 6:
1865                                                   case 11:
1866                                                         act = "「♪お~れはジャイアン~~ガ~キだいしょう~」";
1867                                                         break;
1868                                                   case 2:
1869                                                         act = "「♪て~んかむ~てきのお~とこだぜ~~」";
1870                                                         break;
1871                                                   case 3:
1872                                                         act = "「♪の~び太スネ夫はメじゃないよ~~」";
1873                                                         break;
1874                                                   case 4:
1875                                                         act = "「♪け~んかスポ~ツ~どんとこい~」";
1876                                                         break;
1877                                                   case 5:
1878                                                         act = "「♪うた~も~~う~まいぜ~まかしとけ~」";
1879                                                         break;
1880                                                   case 7:
1881                                                         act = "「♪ま~ちいちば~んのに~んきもの~~」";
1882                                                         break;
1883                                                   case 8:
1884                                                         act = "「♪べんきょうしゅくだいメじゃないよ~~」";
1885                                                         break;
1886                                                   case 9:
1887                                                         act = "「♪きはやさし~くて~ち~からもち~」";
1888                                                         break;
1889                                                   case 10:
1890                                                         act = "「♪かお~も~~スタイルも~バツグンさ~」";
1891                                                         break;
1892                                                   case 12:
1893                                                         act = "「♪がっこうい~ちの~あ~ばれんぼう~~」";
1894                                                         break;
1895                                                   case 13:
1896                                                         act = "「♪ド~ラもドラミもメじゃないよ~~」";
1897                                                         break;
1898                                                   case 14:
1899                                                         act = "「♪よじげんぽけっと~な~くたって~」";
1900                                                         break;
1901                                                   case 15:
1902                                                         act = "「♪あし~の~~ながさ~は~まけないぜ~」";
1903                                                         break;
1904                                                 }
1905 #else
1906                                                 act = "horribly sings 'I AM GIAAAAAN. THE BOOOSS OF THE KIIIIDS.'";
1907 #endif
1908                                         }
1909                                         else
1910                                         {
1911                                                 if (one_in_(3))
1912 #ifdef JP
1913                                                         act = "は♪僕らは楽しい家族♪と歌っている。";
1914                                                 else
1915                                                         act = "は♪アイ ラブ ユー、ユー ラブ ミー♪と歌っている。";
1916 #else
1917                                                         act = "sings 'We are a happy family.'";
1918                                                 else
1919                                                         act = "sings 'I love you, you love me.'";
1920 #endif
1921                                         }
1922
1923                                         sound(SOUND_SHOW);
1924                                         break;
1925                                 }
1926                         }
1927
1928                         if (act)
1929                         {
1930                                 if (do_silly_attack)
1931                                 {
1932 #ifdef JP
1933                                         abbreviate = -1;
1934 #endif
1935                                         act = silly_attacks[randint0(MAX_SILLY_ATTACK)];
1936                                 }
1937 #ifdef JP
1938                                 if (abbreviate == 0)
1939                                     msg_format("%^sに%s", m_name, act);
1940                                 else if (abbreviate == 1)
1941                                     msg_format("%s", act);
1942                                 else /* if (abbreviate == -1) */
1943                                     msg_format("%^s%s", m_name, act);
1944                                 abbreviate = 1;/*2回目以降は省略 */
1945 #else
1946                                 msg_format("%^s %s%s", m_name, act, do_silly_attack ? " you." : "");
1947 #endif
1948                         }
1949
1950                         /* Hack -- assume all attacks are obvious */
1951                         obvious = TRUE;
1952
1953                         /* Roll out the damage */
1954                         damage = damroll(d_dice, d_side);
1955
1956                         /*
1957                          * Skip the effect when exploding, since the explosion
1958                          * already causes the effect.
1959                          */
1960                         if (explode)
1961                                 damage = 0;
1962                         /* Apply appropriate damage */
1963                         switch (effect)
1964                         {
1965                                 case 0:
1966                                 {
1967                                         /* Hack -- Assume obvious */
1968                                         obvious = TRUE;
1969
1970                                         /* Hack -- No damage */
1971                                         damage = 0;
1972
1973                                         break;
1974                                 }
1975
1976                                 case RBE_SUPERHURT:
1977                                 {
1978                                         if (((randint1(rlev*2+300) > (ac+200)) || one_in_(13)) && !CHECK_MULTISHADOW())
1979                                         {
1980                                                 int tmp_damage = damage - (damage * ((ac < 150) ? ac : 150) / 250);
1981                                                 msg_print(_("痛恨の一撃!", "It was a critical hit!"));
1982                                                 tmp_damage = MAX(damage, tmp_damage*2);
1983
1984                                                 get_damage += take_hit(DAMAGE_ATTACK, tmp_damage, ddesc, -1);
1985                                                 break;
1986                                         }
1987                                 }
1988                                 case RBE_HURT:
1989                                 {
1990                                         obvious = TRUE;
1991
1992                                         /* Hack -- Player armor reduces total damage */
1993                                         damage -= (damage * ((ac < 150) ? ac : 150) / 250);
1994
1995                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1996
1997                                         break;
1998                                 }
1999
2000                                 case RBE_POISON:
2001                                 {
2002                                         if (explode) break;
2003
2004                                         /* Take "poison" effect */
2005                                         if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()) && !CHECK_MULTISHADOW())
2006                                         {
2007                                                 if (set_poisoned(p_ptr->poisoned + randint1(rlev) + 5))
2008                                                 {
2009                                                         obvious = TRUE;
2010                                                 }
2011                                         }
2012
2013                                         /* Take some damage */
2014                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2015
2016                                         /* Learn about the player */
2017                                         update_smart_learn(m_idx, DRS_POIS);
2018
2019                                         break;
2020                                 }
2021
2022                                 case RBE_UN_BONUS:
2023                                 {
2024                                         if (explode) break;
2025
2026                                         /* Allow complete resist */
2027                                         if (!p_ptr->resist_disen && !CHECK_MULTISHADOW())
2028                                         {
2029                                                 /* Apply disenchantment */
2030                                                 if (apply_disenchant(0))
2031                                                 {
2032                                                         /* Hack -- Update AC */
2033                                                         update_stuff();
2034                                                         obvious = TRUE;
2035                                                 }
2036                                         }
2037
2038                                         /* Take some damage */
2039                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2040
2041                                         /* Learn about the player */
2042                                         update_smart_learn(m_idx, DRS_DISEN);
2043
2044                                         break;
2045                                 }
2046
2047                                 case RBE_UN_POWER:
2048                                 {
2049                                         /* Take some damage */
2050                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2051
2052                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2053
2054                                         /* Find an item */
2055                                         for (k = 0; k < 10; k++)
2056                                         {
2057                                                 /* Pick an item */
2058                                                 i = (INVENTORY_IDX)randint0(INVEN_PACK);
2059
2060                                                 /* Obtain the item */
2061                                                 o_ptr = &inventory[i];
2062
2063                                                 /* Skip non-objects */
2064                                                 if (!o_ptr->k_idx) continue;
2065
2066                                                 /* Drain charged wands/staffs */
2067                                                 if (((o_ptr->tval == TV_STAFF) ||
2068                                                      (o_ptr->tval == TV_WAND)) &&
2069                                                     (o_ptr->pval))
2070                                                 {
2071                                                         /* Calculate healed hitpoints */
2072                                                         int heal=rlev * o_ptr->pval;
2073                                                         if( o_ptr->tval == TV_STAFF)
2074                                                             heal *=  o_ptr->number;
2075
2076                                                         /* Don't heal more than max hp */
2077                                                         heal = MIN(heal, m_ptr->maxhp - m_ptr->hp);
2078
2079                                                         msg_print(_("ザックからエネルギーが吸い取られた!", "Energy drains from your pack!"));
2080
2081                                                         obvious = TRUE;
2082
2083                                                         /* Heal the monster */
2084                                                         m_ptr->hp += (HIT_POINT)heal;
2085
2086                                                         /* Redraw (later) if needed */
2087                                                         if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
2088                                                         if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
2089
2090                                                         /* Uncharge */
2091                                                         o_ptr->pval = 0;
2092
2093                                                         /* Combine / Reorder the pack */
2094                                                         p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2095
2096                                                         p_ptr->window |= (PW_INVEN);
2097
2098                                                         break;
2099                                                 }
2100                                         }
2101
2102                                         break;
2103                                 }
2104
2105                                 case RBE_EAT_GOLD:
2106                                 {
2107                                         /* Take some damage */
2108                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2109
2110                                         /* Confused monsters cannot steal successfully. -LM-*/
2111                                         if (MON_CONFUSED(m_ptr)) break;
2112
2113                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2114
2115                                         obvious = TRUE;
2116
2117                                         /* Saving throw (unless paralyzed) based on dex and level */
2118                                         if (!p_ptr->paralyzed &&
2119                                             (randint0(100) < (adj_dex_safe[p_ptr->stat_ind[A_DEX]] +
2120                                                               p_ptr->lev)))
2121                                         {
2122                                                 /* Saving throw message */
2123                                                 msg_print(_("しかし素早く財布を守った!", "You quickly protect your money pouch!"));
2124
2125                                                 /* Occasional blink anyway */
2126                                                 if (randint0(3)) blinked = TRUE;
2127                                         }
2128
2129                                         /* Eat gold */
2130                                         else
2131                                         {
2132                                                 gold = (p_ptr->au / 10) + randint1(25);
2133                                                 if (gold < 2) gold = 2;
2134                                                 if (gold > 5000) gold = (p_ptr->au / 20) + randint1(3000);
2135                                                 if (gold > p_ptr->au) gold = p_ptr->au;
2136                                                 p_ptr->au -= gold;
2137                                                 if (gold <= 0)
2138                                                 {
2139                                                         msg_print(_("しかし何も盗まれなかった。", "Nothing was stolen."));
2140                                                 }
2141                                                 else if (p_ptr->au)
2142                                                 {
2143                                                         msg_print(_("財布が軽くなった気がする。", "Your purse feels lighter."));
2144                                                         msg_format(_("$%ld のお金が盗まれた!", "%ld coins were stolen!"), (long)gold);
2145                                                         chg_virtue(V_SACRIFICE, 1);
2146                                                 }
2147                                                 else
2148                                                 {
2149                                                         msg_print(_("財布が軽くなった気がする。", "Your purse feels lighter."));
2150                                                         msg_print(_("お金が全部盗まれた!", "All of your coins were stolen!"));
2151                                                         chg_virtue(V_SACRIFICE, 2);
2152                                                 }
2153
2154                                                 /* Redraw gold */
2155                                                 p_ptr->redraw |= (PR_GOLD);
2156
2157                                                 p_ptr->window |= (PW_PLAYER);
2158
2159                                                 /* Blink away */
2160                                                 blinked = TRUE;
2161                                         }
2162
2163                                         break;
2164                                 }
2165
2166                                 case RBE_EAT_ITEM:
2167                                 {
2168                                         /* Take some damage */
2169                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2170
2171                                         /* Confused monsters cannot steal successfully. -LM-*/
2172                                         if (MON_CONFUSED(m_ptr)) break;
2173
2174                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2175
2176                                         /* Saving throw (unless paralyzed) based on dex and level */
2177                                         if (!p_ptr->paralyzed &&
2178                                             (randint0(100) < (adj_dex_safe[p_ptr->stat_ind[A_DEX]] +
2179                                                               p_ptr->lev)))
2180                                         {
2181                                                 /* Saving throw message */
2182                                                 msg_print(_("しかしあわててザックを取り返した!", "You grab hold of your backpack!"));
2183
2184                                                 /* Occasional "blink" anyway */
2185                                                 blinked = TRUE;
2186
2187                                                 obvious = TRUE;
2188
2189                                                 break;
2190                                         }
2191
2192                                         /* Find an item */
2193                                         for (k = 0; k < 10; k++)
2194                                         {
2195                                                 s16b o_idx;
2196
2197                                                 /* Pick an item */
2198                                                 i = (INVENTORY_IDX)randint0(INVEN_PACK);
2199
2200                                                 /* Obtain the item */
2201                                                 o_ptr = &inventory[i];
2202
2203                                                 /* Skip non-objects */
2204                                                 if (!o_ptr->k_idx) continue;
2205
2206                                                 /* Skip artifacts */
2207                                                 if (object_is_artifact(o_ptr)) continue;
2208
2209                                                 /* Get a description */
2210                                                 object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
2211
2212 #ifdef JP
2213                                                 msg_format("%s(%c)を%s盗まれた!",
2214                                                            o_name, index_to_label(i),
2215                                                            ((o_ptr->number > 1) ? "一つ" : ""));
2216 #else
2217                                                 msg_format("%sour %s (%c) was stolen!",
2218                                                            ((o_ptr->number > 1) ? "One of y" : "Y"),
2219                                                            o_name, index_to_label(i));
2220 #endif
2221
2222                                                 chg_virtue(V_SACRIFICE, 1);
2223
2224
2225                                                 /* Make an object */
2226                                                 o_idx = o_pop();
2227
2228                                                 /* Success */
2229                                                 if (o_idx)
2230                                                 {
2231                                                         object_type *j_ptr;
2232
2233                                                         /* Get new object */
2234                                                         j_ptr = &o_list[o_idx];
2235
2236                                                         /* Copy object */
2237                                                         object_copy(j_ptr, o_ptr);
2238
2239                                                         /* Modify number */
2240                                                         j_ptr->number = 1;
2241
2242                                                         /* Hack -- If a rod or wand, allocate total
2243                                                          * maximum timeouts or charges between those
2244                                                          * stolen and those missed. -LM-
2245                                                          */
2246                                                         if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
2247                                                         {
2248                                                                 j_ptr->pval = o_ptr->pval / o_ptr->number;
2249                                                                 o_ptr->pval -= j_ptr->pval;
2250                                                         }
2251
2252                                                         /* Forget mark */
2253                                                         j_ptr->marked = OM_TOUCHED;
2254
2255                                                         /* Memorize monster */
2256                                                         j_ptr->held_m_idx = m_idx;
2257
2258                                                         /* Build stack */
2259                                                         j_ptr->next_o_idx = m_ptr->hold_o_idx;
2260
2261                                                         /* Build stack */
2262                                                         m_ptr->hold_o_idx = o_idx;
2263                                                 }
2264
2265                                                 /* Steal the items */
2266                                                 inven_item_increase(i, -1);
2267                                                 inven_item_optimize(i);
2268
2269                                                 obvious = TRUE;
2270
2271                                                 /* Blink away */
2272                                                 blinked = TRUE;
2273
2274                                                 break;
2275                                         }
2276
2277                                         break;
2278                                 }
2279
2280                                 case RBE_EAT_FOOD:
2281                                 {
2282                                         /* Take some damage */
2283                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2284
2285                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2286
2287                                         /* Steal some food */
2288                                         for (k = 0; k < 10; k++)
2289                                         {
2290                                                 /* Pick an item from the pack */
2291                                                 i = (INVENTORY_IDX)randint0(INVEN_PACK);
2292
2293                                                 o_ptr = &inventory[i];
2294
2295                                                 /* Skip non-objects */
2296                                                 if (!o_ptr->k_idx) continue;
2297
2298                                                 /* Skip non-food objects */
2299                                                 if ((o_ptr->tval != TV_FOOD) && !((o_ptr->tval == TV_CORPSE) && (o_ptr->sval))) continue;
2300
2301                                                 /* Get a description */
2302                                                 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
2303
2304 #ifdef JP
2305                                                 msg_format("%s(%c)を%s食べられてしまった!", o_name, index_to_label(i), ((o_ptr->number > 1) ? "一つ" : ""));
2306 #else
2307                                                 msg_format("%sour %s (%c) was eaten!", ((o_ptr->number > 1) ? "One of y" : "Y"), o_name, index_to_label(i));
2308 #endif
2309
2310                                                 /* Steal the items */
2311                                                 inven_item_increase(i, -1);
2312                                                 inven_item_optimize(i);
2313
2314                                                 obvious = TRUE;
2315
2316                                                 break;
2317                                         }
2318
2319                                         break;
2320                                 }
2321
2322                                 case RBE_EAT_LITE:
2323                                 {
2324                                         /* Access the lite */
2325                                         o_ptr = &inventory[INVEN_LITE];
2326
2327                                         /* Take some damage */
2328                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2329
2330                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2331
2332                                         /* Drain fuel */
2333                                         if ((o_ptr->xtra4 > 0) && (!object_is_fixed_artifact(o_ptr)))
2334                                         {
2335                                                 /* Reduce fuel */
2336                                                 o_ptr->xtra4 -= (s16b)(250 + randint1(250));
2337                                                 if (o_ptr->xtra4 < 1) o_ptr->xtra4 = 1;
2338
2339                                                 if (!p_ptr->blind)
2340                                                 {
2341                                                         msg_print(_("明かりが暗くなってしまった。", "Your light dims."));
2342                                                         obvious = TRUE;
2343                                                 }
2344
2345                                                 p_ptr->window |= (PW_EQUIP);
2346                                         }
2347
2348                                         break;
2349                                 }
2350
2351                                 case RBE_ACID:
2352                                 {
2353                                         if (explode) break;
2354                                         obvious = TRUE;
2355
2356                                         msg_print(_("酸を浴びせられた!", "You are covered in acid!"));
2357
2358                                         /* Special damage */
2359                                         get_damage += acid_dam(damage, ddesc, -1, FALSE);
2360
2361                                         /* Hack -- Update AC */
2362                                         update_stuff();
2363
2364                                         /* Learn about the player */
2365                                         update_smart_learn(m_idx, DRS_ACID);
2366
2367                                         break;
2368                                 }
2369
2370                                 case RBE_ELEC:
2371                                 {
2372                                         if (explode) break;
2373                                         obvious = TRUE;
2374
2375                                         msg_print(_("電撃を浴びせられた!", "You are struck by electricity!"));
2376
2377                                         /* Special damage */
2378                                         get_damage += elec_dam(damage, ddesc, -1, FALSE);
2379
2380                                         /* Learn about the player */
2381                                         update_smart_learn(m_idx, DRS_ELEC);
2382
2383                                         break;
2384                                 }
2385
2386                                 case RBE_FIRE:
2387                                 {
2388                                         if (explode) break;
2389                                         obvious = TRUE;
2390
2391                                         msg_print(_("全身が炎に包まれた!", "You are enveloped in flames!"));
2392
2393                                         /* Special damage */
2394                                         get_damage += fire_dam(damage, ddesc, -1, FALSE);
2395
2396                                         /* Learn about the player */
2397                                         update_smart_learn(m_idx, DRS_FIRE);
2398
2399                                         break;
2400                                 }
2401
2402                                 case RBE_COLD:
2403                                 {
2404                                         if (explode) break;
2405                                         obvious = TRUE;
2406
2407                                         msg_print(_("全身が冷気で覆われた!", "You are covered with frost!"));
2408
2409                                         /* Special damage */
2410                                         get_damage += cold_dam(damage, ddesc, -1, FALSE);
2411
2412                                         /* Learn about the player */
2413                                         update_smart_learn(m_idx, DRS_COLD);
2414
2415                                         break;
2416                                 }
2417
2418                                 case RBE_BLIND:
2419                                 {
2420                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2421
2422                                         if (p_ptr->is_dead) break;
2423
2424                                         /* Increase "blind" */
2425                                         if (!p_ptr->resist_blind && !CHECK_MULTISHADOW())
2426                                         {
2427                                                 if (set_blind(p_ptr->blind + 10 + randint1(rlev)))
2428                                                 {
2429 #ifdef JP
2430                                                         if (m_ptr->r_idx == MON_DIO) msg_print("どうだッ!この血の目潰しはッ!");
2431 #else
2432                                                         /* nanka */
2433 #endif
2434                                                         obvious = TRUE;
2435                                                 }
2436                                         }
2437
2438                                         /* Learn about the player */
2439                                         update_smart_learn(m_idx, DRS_BLIND);
2440
2441                                         break;
2442                                 }
2443
2444                                 case RBE_CONFUSE:
2445                                 {
2446                                         if (explode) break;
2447                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2448
2449                                         if (p_ptr->is_dead) break;
2450
2451                                         /* Increase "confused" */
2452                                         if (!p_ptr->resist_conf && !CHECK_MULTISHADOW())
2453                                         {
2454                                                 if (set_confused(p_ptr->confused + 3 + randint1(rlev)))
2455                                                 {
2456                                                         obvious = TRUE;
2457                                                 }
2458                                         }
2459
2460                                         /* Learn about the player */
2461                                         update_smart_learn(m_idx, DRS_CONF);
2462
2463                                         break;
2464                                 }
2465
2466                                 case RBE_TERRIFY:
2467                                 {
2468                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2469
2470                                         if (p_ptr->is_dead) break;
2471
2472                                         /* Increase "afraid" */
2473                                         if (CHECK_MULTISHADOW())
2474                                         {
2475                                                 /* Do nothing */
2476                                         }
2477                                         else if (p_ptr->resist_fear)
2478                                         {
2479                                                 msg_print(_("しかし恐怖に侵されなかった!", "You stand your ground!"));
2480                                                 obvious = TRUE;
2481                                         }
2482                                         else if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2483                                         {
2484                                                 msg_print(_("しかし恐怖に侵されなかった!", "You stand your ground!"));
2485                                                 obvious = TRUE;
2486                                         }
2487                                         else
2488                                         {
2489                                                 if (set_afraid(p_ptr->afraid + 3 + randint1(rlev)))
2490                                                 {
2491                                                         obvious = TRUE;
2492                                                 }
2493                                         }
2494
2495                                         /* Learn about the player */
2496                                         update_smart_learn(m_idx, DRS_FEAR);
2497
2498                                         break;
2499                                 }
2500
2501                                 case RBE_PARALYZE:
2502                                 {
2503                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2504
2505                                         if (p_ptr->is_dead) break;
2506
2507                                         /* Increase "paralyzed" */
2508                                         if (CHECK_MULTISHADOW())
2509                                         {
2510                                                 /* Do nothing */
2511                                         }
2512                                         else if (p_ptr->free_act)
2513                                         {
2514                                                 msg_print(_("しかし効果がなかった!", "You are unaffected!"));
2515                                                 obvious = TRUE;
2516                                         }
2517                                         else if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2518                                         {
2519                                                 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
2520                                                 obvious = TRUE;
2521                                         }
2522                                         else
2523                                         {
2524                                                 if (!p_ptr->paralyzed)
2525                                                 {
2526                                                         if (set_paralyzed(3 + randint1(rlev)))
2527                                                         {
2528                                                                 obvious = TRUE;
2529                                                         }
2530                                                 }
2531                                         }
2532
2533                                         /* Learn about the player */
2534                                         update_smart_learn(m_idx, DRS_FREE);
2535
2536                                         break;
2537                                 }
2538
2539                                 case RBE_LOSE_STR:
2540                                 {
2541                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2542
2543                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2544                                         if (do_dec_stat(A_STR)) obvious = TRUE;
2545
2546                                         break;
2547                                 }
2548
2549                                 case RBE_LOSE_INT:
2550                                 {
2551                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2552
2553                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2554                                         if (do_dec_stat(A_INT)) obvious = TRUE;
2555
2556                                         break;
2557                                 }
2558
2559                                 case RBE_LOSE_WIS:
2560                                 {
2561                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2562
2563                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2564                                         if (do_dec_stat(A_WIS)) obvious = TRUE;
2565
2566                                         break;
2567                                 }
2568
2569                                 case RBE_LOSE_DEX:
2570                                 {
2571                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2572
2573                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2574                                         if (do_dec_stat(A_DEX)) obvious = TRUE;
2575
2576                                         break;
2577                                 }
2578
2579                                 case RBE_LOSE_CON:
2580                                 {
2581                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2582
2583                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2584                                         if (do_dec_stat(A_CON)) obvious = TRUE;
2585
2586                                         break;
2587                                 }
2588
2589                                 case RBE_LOSE_CHR:
2590                                 {
2591                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2592
2593                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2594                                         if (do_dec_stat(A_CHR)) obvious = TRUE;
2595
2596                                         break;
2597                                 }
2598
2599                                 case RBE_LOSE_ALL:
2600                                 {
2601                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2602
2603                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2604
2605                                         /* Damage (stats) */
2606                                         if (do_dec_stat(A_STR)) obvious = TRUE;
2607                                         if (do_dec_stat(A_DEX)) obvious = TRUE;
2608                                         if (do_dec_stat(A_CON)) obvious = TRUE;
2609                                         if (do_dec_stat(A_INT)) obvious = TRUE;
2610                                         if (do_dec_stat(A_WIS)) obvious = TRUE;
2611                                         if (do_dec_stat(A_CHR)) obvious = TRUE;
2612
2613                                         break;
2614                                 }
2615
2616                                 case RBE_SHATTER:
2617                                 {
2618                                         obvious = TRUE;
2619
2620                                         /* Hack -- Reduce damage based on the player armor class */
2621                                         damage -= (damage * ((ac < 150) ? ac : 150) / 250);
2622
2623                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2624
2625                                         /* Radius 8 earthquake centered at the monster */
2626                                         if (damage > 23 || explode)
2627                                         {
2628                                                 earthquake_aux(m_ptr->fy, m_ptr->fx, 8, m_idx);
2629                                         }
2630
2631                                         break;
2632                                 }
2633
2634                                 case RBE_EXP_10:
2635                                 {
2636                                         s32b d = damroll(10, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
2637
2638                                         obvious = TRUE;
2639
2640                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2641
2642                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2643
2644                                         (void)drain_exp(d, d / 10, 95);
2645                                         break;
2646                                 }
2647
2648                                 case RBE_EXP_20:
2649                                 {
2650                                         s32b d = damroll(20, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
2651
2652                                         obvious = TRUE;
2653
2654                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2655
2656                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2657
2658                                         (void)drain_exp(d, d / 10, 90);
2659                                         break;
2660                                 }
2661
2662                                 case RBE_EXP_40:
2663                                 {
2664                                         s32b d = damroll(40, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
2665
2666                                         obvious = TRUE;
2667
2668                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2669
2670                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2671
2672                                         (void)drain_exp(d, d / 10, 75);
2673                                         break;
2674                                 }
2675
2676                                 case RBE_EXP_80:
2677                                 {
2678                                         s32b d = damroll(80, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
2679
2680                                         obvious = TRUE;
2681
2682                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2683
2684                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2685
2686                                         (void)drain_exp(d, d / 10, 50);
2687                                         break;
2688                                 }
2689
2690                                 case RBE_DISEASE:
2691                                 {
2692                                         /* Take some damage */
2693                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2694
2695                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2696
2697                                         /* Take "poison" effect */
2698                                         if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
2699                                         {
2700                                                 if (set_poisoned(p_ptr->poisoned + randint1(rlev) + 5))
2701                                                 {
2702                                                         obvious = TRUE;
2703                                                 }
2704                                         }
2705
2706                                         /* Damage CON (10% chance)*/
2707                                         if ((randint1(100) < 11) && (p_ptr->prace != RACE_ANDROID))
2708                                         {
2709                                                 /* 1% chance for perm. damage */
2710                                                 bool perm = one_in_(10);
2711                                                 if (dec_stat(A_CON, randint1(10), perm))
2712                                                 {
2713                                                         msg_print(_("病があなたを蝕んでいる気がする。", "You feel strange sickness."));
2714                                                         obvious = TRUE;
2715                                                 }
2716                                         }
2717
2718                                         break;
2719                                 }
2720                                 case RBE_TIME:
2721                                 {
2722                                         if (explode) break;
2723                                         if (!p_ptr->resist_time && !CHECK_MULTISHADOW())
2724                                         {
2725                                                 switch (randint1(10))
2726                                                 {
2727                                                         case 1: case 2: case 3: case 4: case 5:
2728                                                         {
2729                                                                 if (p_ptr->prace == RACE_ANDROID) break;
2730                                                                 msg_print(_("人生が逆戻りした気がする。", "You feel life has clocked back."));
2731                                                                 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
2732                                                                 break;
2733                                                         }
2734
2735                                                         case 6: case 7: case 8: case 9:
2736                                                         {
2737                                                                 int stat = randint0(6);
2738
2739                                                                 switch (stat)
2740                                                                 {
2741 #ifdef JP
2742                                                                         case A_STR: act = "強く"; break;
2743                                                                         case A_INT: act = "聡明で"; break;
2744                                                                         case A_WIS: act = "賢明で"; break;
2745                                                                         case A_DEX: act = "器用で"; break;
2746                                                                         case A_CON: act = "健康で"; break;
2747                                                                         case A_CHR: act = "美しく"; break;
2748 #else
2749                                                                         case A_STR: act = "strong"; break;
2750                                                                         case A_INT: act = "bright"; break;
2751                                                                         case A_WIS: act = "wise"; break;
2752                                                                         case A_DEX: act = "agile"; break;
2753                                                                         case A_CON: act = "hale"; break;
2754                                                                         case A_CHR: act = "beautiful"; break;
2755 #endif
2756
2757                                                                 }
2758
2759                                                                 msg_format(_("あなたは以前ほど%sなくなってしまった...。", "You're not as %s as you used to be..."), act);
2760                                                                 p_ptr->stat_cur[stat] = (p_ptr->stat_cur[stat] * 3) / 4;
2761                                                                 if (p_ptr->stat_cur[stat] < 3) p_ptr->stat_cur[stat] = 3;
2762                                                                 p_ptr->update |= (PU_BONUS);
2763                                                                 break;
2764                                                         }
2765
2766                                                         case 10:
2767                                                         {
2768                                                                 msg_print(_("あなたは以前ほど力強くなくなってしまった...。", "You're not as powerful as you used to be..."));
2769
2770                                                                 for (k = 0; k < 6; k++)
2771                                                                 {
2772                                                                         p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
2773                                                                         if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
2774                                                                 }
2775                                                                 p_ptr->update |= (PU_BONUS);
2776                                                                 break;
2777                                                         }
2778                                                 }
2779                                         }
2780                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2781
2782                                         break;
2783                                 }
2784                                 case RBE_DR_LIFE:
2785                                 {
2786                                         s32b d = damroll(60, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
2787                                         bool resist_drain;
2788
2789                                         obvious = TRUE;
2790
2791                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2792
2793                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2794
2795                                         resist_drain = !drain_exp(d, d / 10, 50);
2796
2797                                         /* Heal the attacker? */
2798                                         if (p_ptr->mimic_form)
2799                                         {
2800                                                 if (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING)
2801                                                         resist_drain = TRUE;
2802                                         }
2803                                         else
2804                                         {
2805                                                 switch (p_ptr->prace)
2806                                                 {
2807                                                 case RACE_ZOMBIE:
2808                                                 case RACE_VAMPIRE:
2809                                                 case RACE_SPECTRE:
2810                                                 case RACE_SKELETON:
2811                                                 case RACE_DEMON:
2812                                                 case RACE_GOLEM:
2813                                                 case RACE_ANDROID:
2814                                                         resist_drain = TRUE;
2815                                                         break;
2816                                                 }
2817                                         }
2818
2819                                         if ((damage > 5) && !resist_drain)
2820                                         {
2821                                                 bool did_heal = FALSE;
2822
2823                                                 if (m_ptr->hp < m_ptr->maxhp) did_heal = TRUE;
2824
2825                                                 /* Heal */
2826                                                 m_ptr->hp += damroll(4, damage / 6);
2827                                                 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2828
2829                                                 /* Redraw (later) if needed */
2830                                                 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
2831                                                 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
2832
2833                                                 /* Special message */
2834                                                 if (m_ptr->ml && did_heal)
2835                                                 {
2836                                                         msg_format(_("%sは体力を回復したようだ。", "%^s appears healthier."), m_name);
2837                                                 }
2838                                         }
2839
2840                                         break;
2841                                 }
2842                                 case RBE_DR_MANA:
2843                                 {
2844                                         obvious = TRUE;
2845
2846                                         if (CHECK_MULTISHADOW())
2847                                         {
2848                                                 msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, you are unharmed!"));
2849                                         }
2850                                         else
2851                                         {
2852                                                 do_cut = 0;
2853
2854                                                 p_ptr->csp -= damage;
2855                                                 if (p_ptr->csp < 0)
2856                                                 {
2857                                                         p_ptr->csp = 0;
2858                                                         p_ptr->csp_frac = 0;
2859                                                 }
2860
2861                                                 p_ptr->redraw |= (PR_MANA);
2862                                         }
2863
2864                                         /* Learn about the player */
2865                                         update_smart_learn(m_idx, DRS_MANA);
2866
2867                                         break;
2868                                 }
2869                                 case RBE_INERTIA:
2870                                 {
2871                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2872
2873                                         if (p_ptr->is_dead) break;
2874
2875                                         /* Decrease speed */
2876                                         if (CHECK_MULTISHADOW())
2877                                         {
2878                                                 /* Do nothing */
2879                                         }
2880                                         else
2881                                         {
2882                                                 if (set_slow((p_ptr->slow + 4 + randint0(rlev / 10)), FALSE))
2883                                                 {
2884                                                         obvious = TRUE;
2885                                                 }
2886                                         }
2887
2888                                         break;
2889                                 }
2890                                 case RBE_STUN:
2891                                 {
2892                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2893
2894                                         if (p_ptr->is_dead) break;
2895
2896                                         /* Decrease speed */
2897                                         if (p_ptr->resist_sound || CHECK_MULTISHADOW())
2898                                         {
2899                                                 /* Do nothing */
2900                                         }
2901                                         else
2902                                         {
2903                                                 if (set_stun(p_ptr->stun + 10 + randint1(r_ptr->level / 4)))
2904                                                 {
2905                                                         obvious = TRUE;
2906                                                 }
2907                                         }
2908
2909                                         break;
2910                                 }
2911                         }
2912
2913                         /* Hack -- only one of cut or stun */
2914                         if (do_cut && do_stun)
2915                         {
2916                                 /* Cancel cut */
2917                                 if (randint0(100) < 50)
2918                                 {
2919                                         do_cut = 0;
2920                                 }
2921
2922                                 /* Cancel stun */
2923                                 else
2924                                 {
2925                                         do_stun = 0;
2926                                 }
2927                         }
2928
2929                         /* Handle cut */
2930                         if (do_cut)
2931                         {
2932                                 int cut_plus = 0;
2933
2934                                 /* Critical hit (zero if non-critical) */
2935                                 tmp = monster_critical(d_dice, d_side, damage);
2936
2937                                 /* Roll for damage */
2938                                 switch (tmp)
2939                                 {
2940                                         case 0: cut_plus = 0; break;
2941                                         case 1: cut_plus = randint1(5); break;
2942                                         case 2: cut_plus = randint1(5) + 5; break;
2943                                         case 3: cut_plus = randint1(20) + 20; break;
2944                                         case 4: cut_plus = randint1(50) + 50; break;
2945                                         case 5: cut_plus = randint1(100) + 100; break;
2946                                         case 6: cut_plus = 300; break;
2947                                         default: cut_plus = 500; break;
2948                                 }
2949
2950                                 /* Apply the cut */
2951                                 if (cut_plus) (void)set_cut(p_ptr->cut + cut_plus);
2952                         }
2953
2954                         /* Handle stun */
2955                         if (do_stun)
2956                         {
2957                                 int stun_plus = 0;
2958
2959                                 /* Critical hit (zero if non-critical) */
2960                                 tmp = monster_critical(d_dice, d_side, damage);
2961
2962                                 /* Roll for damage */
2963                                 switch (tmp)
2964                                 {
2965                                         case 0: stun_plus = 0; break;
2966                                         case 1: stun_plus = randint1(5); break;
2967                                         case 2: stun_plus = randint1(5) + 10; break;
2968                                         case 3: stun_plus = randint1(10) + 20; break;
2969                                         case 4: stun_plus = randint1(15) + 30; break;
2970                                         case 5: stun_plus = randint1(20) + 40; break;
2971                                         case 6: stun_plus = 80; break;
2972                                         default: stun_plus = 150; break;
2973                                 }
2974
2975                                 /* Apply the stun */
2976                                 if (stun_plus) (void)set_stun(p_ptr->stun + stun_plus);
2977                         }
2978
2979                         if (explode)
2980                         {
2981                                 sound(SOUND_EXPLODE);
2982
2983                                 if (mon_take_hit(m_idx, m_ptr->hp + 1, &fear, NULL))
2984                                 {
2985                                         blinked = FALSE;
2986                                         alive = FALSE;
2987                                 }
2988                         }
2989
2990                         if (touched)
2991                         {
2992                                 if (p_ptr->sh_fire && alive && !p_ptr->is_dead)
2993                                 {
2994                                         if (!(r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK))
2995                                         {
2996                                                 HIT_POINT dam = damroll(2, 6);
2997
2998                                                 /* Modify the damage */
2999                                                 dam = mon_damage_mod(m_ptr, dam, FALSE);
3000
3001 #ifdef JP
3002                                                 msg_format("%^sは突然熱くなった!", m_name);
3003                                                 if (mon_take_hit(m_idx, dam, &fear,
3004                                                     "は灰の山になった。"))
3005 #else
3006                                                 msg_format("%^s is suddenly very hot!", m_name);
3007
3008                                                 if (mon_take_hit(m_idx, dam, &fear,
3009                                                     " turns into a pile of ash."))
3010 #endif
3011
3012                                                 {
3013                                                         blinked = FALSE;
3014                                                         alive = FALSE;
3015                                                 }
3016                                         }
3017                                         else
3018                                         {
3019                                                 if (is_original_ap_and_seen(m_ptr))
3020                                                         r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK);
3021                                         }
3022                                 }
3023
3024                                 if (p_ptr->sh_elec && alive && !p_ptr->is_dead)
3025                                 {
3026                                         if (!(r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK))
3027                                         {
3028                                                 HIT_POINT dam = damroll(2, 6);
3029
3030                                                 /* Modify the damage */
3031                                                 dam = mon_damage_mod(m_ptr, dam, FALSE);
3032
3033 #ifdef JP
3034                                                 msg_format("%^sは電撃をくらった!", m_name);
3035                                                 if (mon_take_hit(m_idx, dam, &fear,
3036                                                     "は燃え殻の山になった。"))
3037 #else
3038                                                 msg_format("%^s gets zapped!", m_name);
3039
3040                                                 if (mon_take_hit(m_idx, dam, &fear,
3041                                                     " turns into a pile of cinder."))
3042 #endif
3043
3044                                                 {
3045                                                         blinked = FALSE;
3046                                                         alive = FALSE;
3047                                                 }
3048                                         }
3049                                         else
3050                                         {
3051                                                 if (is_original_ap_and_seen(m_ptr))
3052                                                         r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK);
3053                                         }
3054                                 }
3055
3056                                 if (p_ptr->sh_cold && alive && !p_ptr->is_dead)
3057                                 {
3058                                         if (!(r_ptr->flagsr & RFR_EFF_IM_COLD_MASK))
3059                                         {
3060                                                 HIT_POINT dam = damroll(2, 6);
3061
3062                                                 /* Modify the damage */
3063                                                 dam = mon_damage_mod(m_ptr, dam, FALSE);
3064
3065 #ifdef JP
3066                                                 msg_format("%^sは冷気をくらった!", m_name);
3067                                                 if (mon_take_hit(m_idx, dam, &fear,
3068                                                     "は凍りついた。"))
3069 #else
3070                                                 msg_format("%^s is very cold!", m_name);
3071
3072                                                 if (mon_take_hit(m_idx, dam, &fear,
3073                                                     " was frozen."))
3074 #endif
3075
3076                                                 {
3077                                                         blinked = FALSE;
3078                                                         alive = FALSE;
3079                                                 }
3080                                         }
3081                                         else
3082                                         {
3083                                                 if (is_original_ap_and_seen(m_ptr))
3084                                                         r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK);
3085                                         }
3086                                 }
3087
3088                                 /* by henkma */
3089                                 if (p_ptr->dustrobe && alive && !p_ptr->is_dead)
3090                                 {
3091                                         if (!(r_ptr->flagsr & RFR_EFF_RES_SHAR_MASK))
3092                                         {
3093                                                 HIT_POINT dam = damroll(2, 6);
3094
3095                                                 /* Modify the damage */
3096                                                 dam = mon_damage_mod(m_ptr, dam, FALSE);
3097
3098 #ifdef JP
3099                                                 msg_format("%^sは鏡の破片をくらった!", m_name);
3100                                                 if (mon_take_hit(m_idx, dam, &fear,
3101                                                     "はズタズタになった。"))
3102 #else
3103                                                 msg_format("%^s gets zapped!", m_name);
3104
3105                                                 if (mon_take_hit(m_idx, dam, &fear,
3106                                                     " had torn to pieces."))
3107 #endif
3108                                                 {
3109                                                         blinked = FALSE;
3110                                                         alive = FALSE;
3111                                                 }
3112                                         }
3113                                         else
3114                                         {
3115                                                 if (is_original_ap_and_seen(m_ptr))
3116                                                         r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_RES_SHAR_MASK);
3117                                         }
3118
3119                                         if (is_mirror_grid(&cave[p_ptr->y][p_ptr->x]))
3120                                         {
3121                                                 teleport_player(10, 0L);
3122                                         }
3123                                 }
3124
3125                                 if (p_ptr->tim_sh_holy && alive && !p_ptr->is_dead)
3126                                 {
3127                                         if (r_ptr->flags3 & RF3_EVIL)
3128                                         {
3129                                                 if (!(r_ptr->flagsr & RFR_RES_ALL))
3130                                                 {
3131                                                         HIT_POINT dam = damroll(2, 6);
3132
3133                                                         /* Modify the damage */
3134                                                         dam = mon_damage_mod(m_ptr, dam, FALSE);
3135
3136 #ifdef JP
3137                                                         msg_format("%^sは聖なるオーラで傷ついた!", m_name);
3138                                                         if (mon_take_hit(m_idx, dam, &fear,
3139                                                             "は倒れた。"))
3140 #else
3141                                                         msg_format("%^s is injured by holy power!", m_name);
3142
3143                                                         if (mon_take_hit(m_idx, dam, &fear,
3144                                                             " is destroyed."))
3145 #endif
3146                                                         {
3147                                                                 blinked = FALSE;
3148                                                                 alive = FALSE;
3149                                                         }
3150                                                         if (is_original_ap_and_seen(m_ptr))
3151                                                                 r_ptr->r_flags3 |= RF3_EVIL;
3152                                                 }
3153                                                 else
3154                                                 {
3155                                                         if (is_original_ap_and_seen(m_ptr))
3156                                                                 r_ptr->r_flagsr |= RFR_RES_ALL;
3157                                                 }
3158                                         }
3159                                 }
3160
3161                                 if (p_ptr->tim_sh_touki && alive && !p_ptr->is_dead)
3162                                 {
3163                                         if (!(r_ptr->flagsr & RFR_RES_ALL))
3164                                         {
3165                                                 HIT_POINT dam = damroll(2, 6);
3166
3167                                                 /* Modify the damage */
3168                                                 dam = mon_damage_mod(m_ptr, dam, FALSE);
3169
3170 #ifdef JP
3171                                                 msg_format("%^sが鋭い闘気のオーラで傷ついた!", m_name);
3172                                                 if (mon_take_hit(m_idx, dam, &fear,
3173                                                     "は倒れた。"))
3174 #else
3175                                                 msg_format("%^s is injured by the Force", m_name);
3176
3177                                                 if (mon_take_hit(m_idx, dam, &fear,
3178                                                     " is destroyed."))
3179 #endif
3180
3181                                                 {
3182                                                         blinked = FALSE;
3183                                                         alive = FALSE;
3184                                                 }
3185                                         }
3186                                         else
3187                                         {
3188                                                 if (is_original_ap_and_seen(m_ptr))
3189                                                         r_ptr->r_flagsr |= RFR_RES_ALL;
3190                                         }
3191                                 }
3192
3193                                 if (hex_spelling(HEX_SHADOW_CLOAK) && alive && !p_ptr->is_dead)
3194                                 {
3195                                         HIT_POINT dam = 1;
3196                                         object_type *o_armed_ptr = &inventory[INVEN_RARM];
3197
3198                                         if (!(r_ptr->flagsr & RFR_RES_ALL || r_ptr->flagsr & RFR_RES_DARK))
3199                                         {
3200                                                 if (o_armed_ptr->k_idx)
3201                                                 {
3202                                                         int basedam = ((o_armed_ptr->dd + p_ptr->to_dd[0]) * (o_armed_ptr->ds + p_ptr->to_ds[0] + 1));
3203                                                         dam = basedam / 2 + o_armed_ptr->to_d + p_ptr->to_d[0];
3204                                                 }
3205
3206                                                 /* Cursed armor makes damages doubled */
3207                                                 o_armed_ptr = &inventory[INVEN_BODY];
3208                                                 if ((o_armed_ptr->k_idx) && object_is_cursed(o_armed_ptr)) dam *= 2;
3209
3210                                                 /* Modify the damage */
3211                                                 dam = mon_damage_mod(m_ptr, dam, FALSE);
3212
3213 #ifdef JP
3214                                                 msg_format("影のオーラが%^sに反撃した!", m_name);
3215                                                 if (mon_take_hit(m_idx, dam, &fear, "は倒れた。"))
3216 #else
3217                                                 msg_format("Enveloped shadows attack %^s.", m_name);
3218
3219                                                 if (mon_take_hit(m_idx, dam, &fear, " is destroyed."))
3220 #endif
3221                                                 {
3222                                                         blinked = FALSE;
3223                                                         alive = FALSE;
3224                                                 }
3225                                                 else /* monster does not dead */
3226                                                 {
3227                                                         int j;
3228                                                         BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
3229                                                         EFFECT_ID typ[4][2] = {
3230                                                                 { INVEN_HEAD, GF_OLD_CONF },
3231                                                                 { INVEN_LARM,  GF_OLD_SLEEP },
3232                                                                 { INVEN_HANDS, GF_TURN_ALL },
3233                                                                 { INVEN_FEET, GF_OLD_SLOW }
3234                                                         };
3235
3236                                                         /* Some cursed armours gives an extra effect */
3237                                                         for (j = 0; j < 4; j++)
3238                                                         {
3239                                                                 o_armed_ptr = &inventory[typ[j][0]];
3240                                                                 if ((o_armed_ptr->k_idx) && object_is_cursed(o_armed_ptr) && object_is_armour(o_armed_ptr))
3241                                                                         project(0, 0, m_ptr->fy, m_ptr->fx, (p_ptr->lev * 2), typ[j][1], flg, -1);
3242                                                         }
3243                                                 }
3244                                         }
3245                                         else
3246                                         {
3247                                                 if (is_original_ap_and_seen(m_ptr))
3248                                                         r_ptr->r_flagsr |= (RFR_RES_ALL | RFR_RES_DARK);
3249                                         }
3250                                 }
3251                         }
3252                 }
3253
3254                 /* Monster missed player */
3255                 else
3256                 {
3257                         /* Analyze failed attacks */
3258                         switch (method)
3259                         {
3260                                 case RBM_HIT:
3261                                 case RBM_TOUCH:
3262                                 case RBM_PUNCH:
3263                                 case RBM_KICK:
3264                                 case RBM_CLAW:
3265                                 case RBM_BITE:
3266                                 case RBM_STING:
3267                                 case RBM_SLASH:
3268                                 case RBM_BUTT:
3269                                 case RBM_CRUSH:
3270                                 case RBM_ENGULF:
3271                                 case RBM_CHARGE:
3272
3273                                 /* Visible monsters */
3274                                 if (m_ptr->ml)
3275                                 {
3276                                         /* Disturbing */
3277                                         disturb(TRUE, TRUE);
3278
3279 #ifdef JP
3280                                         if (abbreviate)
3281                                             msg_format("%sかわした。", (p_ptr->special_attack & ATTACK_SUIKEN) ? "奇妙な動きで" : "");
3282                                         else
3283                                             msg_format("%s%^sの攻撃をかわした。", (p_ptr->special_attack & ATTACK_SUIKEN) ? "奇妙な動きで" : "", m_name);
3284                                         abbreviate = 1;/*2回目以降は省略 */
3285 #else
3286                                         msg_format("%^s misses you.", m_name);
3287 #endif
3288
3289                                 }
3290                                 damage = 0;
3291
3292                                 break;
3293                         }
3294                 }
3295
3296
3297                 /* Analyze "visible" monsters only */
3298                 if (is_original_ap_and_seen(m_ptr) && !do_silly_attack)
3299                 {
3300                         /* Count "obvious" attacks (and ones that cause damage) */
3301                         if (obvious || damage || (r_ptr->r_blows[ap_cnt] > 10))
3302                         {
3303                                 /* Count attacks of this type */
3304                                 if (r_ptr->r_blows[ap_cnt] < MAX_UCHAR)
3305                                 {
3306                                         r_ptr->r_blows[ap_cnt]++;
3307                                 }
3308                         }
3309                 }
3310
3311                 if (p_ptr->riding && damage)
3312                 {
3313                         char m_steed_name[80];
3314                         monster_desc(m_steed_name, &m_list[p_ptr->riding], 0);
3315                         if (rakuba((damage > 200) ? 200 : damage, FALSE))
3316                         {
3317                                 msg_format(_("%^sから落ちてしまった!", "You have fallen from %s."), m_steed_name);
3318                         }
3319                 }
3320
3321                 if (p_ptr->special_defense & NINJA_KAWARIMI)
3322                 {
3323                         if (kawarimi(FALSE)) return TRUE;
3324                 }
3325         }
3326
3327         /* Hex - revenge damage stored */
3328         revenge_store(get_damage);
3329
3330         if ((p_ptr->tim_eyeeye || hex_spelling(HEX_EYE_FOR_EYE))
3331                 && get_damage > 0 && !p_ptr->is_dead)
3332         {
3333 #ifdef JP
3334                 msg_format("攻撃が%s自身を傷つけた!", m_name);
3335 #else
3336                 char m_name_self[80];
3337
3338                 /* hisself */
3339                 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
3340
3341                 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
3342 #endif
3343                 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
3344                 if (p_ptr->tim_eyeeye) set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
3345         }
3346
3347         if ((p_ptr->counter || (p_ptr->special_defense & KATA_MUSOU)) && alive && !p_ptr->is_dead && m_ptr->ml && (p_ptr->csp > 7))
3348         {
3349                 char m_target_name[80];
3350                 monster_desc(m_target_name, m_ptr, 0);
3351
3352                 p_ptr->csp -= 7;
3353                 msg_format(_("%^sに反撃した!", "Your counterattack to %s!"), m_target_name);
3354                 py_attack(m_ptr->fy, m_ptr->fx, HISSATSU_COUNTER);
3355                 fear = FALSE;
3356
3357                 /* Redraw mana */
3358                 p_ptr->redraw |= (PR_MANA);
3359         }
3360
3361         /* Blink away */
3362         if (blinked && alive && !p_ptr->is_dead)
3363         {
3364                 if (teleport_barrier(m_idx))
3365                 {
3366                         msg_print(_("泥棒は笑って逃げ...ようとしたがバリアに防がれた。", "The thief flees laughing...? But magic barrier obstructs it."));
3367                 }
3368                 else
3369                 {
3370                         msg_print(_("泥棒は笑って逃げた!", "The thief flees laughing!"));
3371                         teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
3372                 }
3373         }
3374
3375
3376         /* Always notice cause of death */
3377         if (p_ptr->is_dead && (r_ptr->r_deaths < MAX_SHORT) && !p_ptr->inside_arena)
3378         {
3379                 r_ptr->r_deaths++;
3380         }
3381
3382         if (m_ptr->ml && fear && alive && !p_ptr->is_dead)
3383         {
3384                 sound(SOUND_FLEE);
3385                 msg_format(_("%^sは恐怖で逃げ出した!", "%^s flees in terror!"), m_name);
3386         }
3387
3388         if (p_ptr->special_defense & KATA_IAI)
3389         {
3390                 set_action(ACTION_NONE);
3391         }
3392
3393         /* Assume we attacked */
3394         return (TRUE);
3395 }