OSDN Git Service

a6b87dfe9ddf0bd569f8bd1512ebcf8a890ceab9
[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                                                 /* Take damage */
1985                                                 get_damage += take_hit(DAMAGE_ATTACK, tmp_damage, ddesc, -1);
1986                                                 break;
1987                                         }
1988                                 }
1989                                 case RBE_HURT:
1990                                 {
1991                                         /* Obvious */
1992                                         obvious = TRUE;
1993
1994                                         /* Hack -- Player armor reduces total damage */
1995                                         damage -= (damage * ((ac < 150) ? ac : 150) / 250);
1996
1997                                         /* Take damage */
1998                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
1999
2000                                         break;
2001                                 }
2002
2003                                 case RBE_POISON:
2004                                 {
2005                                         if (explode) break;
2006
2007                                         /* Take "poison" effect */
2008                                         if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()) && !CHECK_MULTISHADOW())
2009                                         {
2010                                                 if (set_poisoned(p_ptr->poisoned + randint1(rlev) + 5))
2011                                                 {
2012                                                         obvious = TRUE;
2013                                                 }
2014                                         }
2015
2016                                         /* Take some damage */
2017                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2018
2019                                         /* Learn about the player */
2020                                         update_smart_learn(m_idx, DRS_POIS);
2021
2022                                         break;
2023                                 }
2024
2025                                 case RBE_UN_BONUS:
2026                                 {
2027                                         if (explode) break;
2028
2029                                         /* Allow complete resist */
2030                                         if (!p_ptr->resist_disen && !CHECK_MULTISHADOW())
2031                                         {
2032                                                 /* Apply disenchantment */
2033                                                 if (apply_disenchant(0))
2034                                                 {
2035                                                         /* Hack -- Update AC */
2036                                                         update_stuff();
2037                                                         obvious = TRUE;
2038                                                 }
2039                                         }
2040
2041                                         /* Take some damage */
2042                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2043
2044                                         /* Learn about the player */
2045                                         update_smart_learn(m_idx, DRS_DISEN);
2046
2047                                         break;
2048                                 }
2049
2050                                 case RBE_UN_POWER:
2051                                 {
2052                                         /* Take some damage */
2053                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2054
2055                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2056
2057                                         /* Find an item */
2058                                         for (k = 0; k < 10; k++)
2059                                         {
2060                                                 /* Pick an item */
2061                                                 i = (INVENTORY_IDX)randint0(INVEN_PACK);
2062
2063                                                 /* Obtain the item */
2064                                                 o_ptr = &inventory[i];
2065
2066                                                 /* Skip non-objects */
2067                                                 if (!o_ptr->k_idx) continue;
2068
2069                                                 /* Drain charged wands/staffs */
2070                                                 if (((o_ptr->tval == TV_STAFF) ||
2071                                                      (o_ptr->tval == TV_WAND)) &&
2072                                                     (o_ptr->pval))
2073                                                 {
2074                                                         /* Calculate healed hitpoints */
2075                                                         int heal=rlev * o_ptr->pval;
2076                                                         if( o_ptr->tval == TV_STAFF)
2077                                                             heal *=  o_ptr->number;
2078
2079                                                         /* Don't heal more than max hp */
2080                                                         heal = MIN(heal, m_ptr->maxhp - m_ptr->hp);
2081
2082                                                         msg_print(_("ザックからエネルギーが吸い取られた!", "Energy drains from your pack!"));
2083
2084                                                         /* Obvious */
2085                                                         obvious = TRUE;
2086
2087                                                         /* Heal the monster */
2088                                                         m_ptr->hp += (HIT_POINT)heal;
2089
2090                                                         /* Redraw (later) if needed */
2091                                                         if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
2092                                                         if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
2093
2094                                                         /* Uncharge */
2095                                                         o_ptr->pval = 0;
2096
2097                                                         /* Combine / Reorder the pack */
2098                                                         p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2099
2100                                                         p_ptr->window |= (PW_INVEN);
2101
2102                                                         break;
2103                                                 }
2104                                         }
2105
2106                                         break;
2107                                 }
2108
2109                                 case RBE_EAT_GOLD:
2110                                 {
2111                                         /* Take some damage */
2112                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2113
2114                                         /* Confused monsters cannot steal successfully. -LM-*/
2115                                         if (MON_CONFUSED(m_ptr)) break;
2116
2117                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2118
2119                                         /* Obvious */
2120                                         obvious = TRUE;
2121
2122                                         /* Saving throw (unless paralyzed) based on dex and level */
2123                                         if (!p_ptr->paralyzed &&
2124                                             (randint0(100) < (adj_dex_safe[p_ptr->stat_ind[A_DEX]] +
2125                                                               p_ptr->lev)))
2126                                         {
2127                                                 /* Saving throw message */
2128                                                 msg_print(_("しかし素早く財布を守った!", "You quickly protect your money pouch!"));
2129
2130                                                 /* Occasional blink anyway */
2131                                                 if (randint0(3)) blinked = TRUE;
2132                                         }
2133
2134                                         /* Eat gold */
2135                                         else
2136                                         {
2137                                                 gold = (p_ptr->au / 10) + randint1(25);
2138                                                 if (gold < 2) gold = 2;
2139                                                 if (gold > 5000) gold = (p_ptr->au / 20) + randint1(3000);
2140                                                 if (gold > p_ptr->au) gold = p_ptr->au;
2141                                                 p_ptr->au -= gold;
2142                                                 if (gold <= 0)
2143                                                 {
2144                                                         msg_print(_("しかし何も盗まれなかった。", "Nothing was stolen."));
2145                                                 }
2146                                                 else if (p_ptr->au)
2147                                                 {
2148                                                         msg_print(_("財布が軽くなった気がする。", "Your purse feels lighter."));
2149                                                         msg_format(_("$%ld のお金が盗まれた!", "%ld coins were stolen!"), (long)gold);
2150                                                         chg_virtue(V_SACRIFICE, 1);
2151                                                 }
2152                                                 else
2153                                                 {
2154                                                         msg_print(_("財布が軽くなった気がする。", "Your purse feels lighter."));
2155                                                         msg_print(_("お金が全部盗まれた!", "All of your coins were stolen!"));
2156                                                         chg_virtue(V_SACRIFICE, 2);
2157                                                 }
2158
2159                                                 /* Redraw gold */
2160                                                 p_ptr->redraw |= (PR_GOLD);
2161
2162                                                 p_ptr->window |= (PW_PLAYER);
2163
2164                                                 /* Blink away */
2165                                                 blinked = TRUE;
2166                                         }
2167
2168                                         break;
2169                                 }
2170
2171                                 case RBE_EAT_ITEM:
2172                                 {
2173                                         /* Take some damage */
2174                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2175
2176                                         /* Confused monsters cannot steal successfully. -LM-*/
2177                                         if (MON_CONFUSED(m_ptr)) break;
2178
2179                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2180
2181                                         /* Saving throw (unless paralyzed) based on dex and level */
2182                                         if (!p_ptr->paralyzed &&
2183                                             (randint0(100) < (adj_dex_safe[p_ptr->stat_ind[A_DEX]] +
2184                                                               p_ptr->lev)))
2185                                         {
2186                                                 /* Saving throw message */
2187                                                 msg_print(_("しかしあわててザックを取り返した!", "You grab hold of your backpack!"));
2188
2189                                                 /* Occasional "blink" anyway */
2190                                                 blinked = TRUE;
2191
2192                                                 /* Obvious */
2193                                                 obvious = TRUE;
2194
2195                                                 break;
2196                                         }
2197
2198                                         /* Find an item */
2199                                         for (k = 0; k < 10; k++)
2200                                         {
2201                                                 s16b o_idx;
2202
2203                                                 /* Pick an item */
2204                                                 i = (INVENTORY_IDX)randint0(INVEN_PACK);
2205
2206                                                 /* Obtain the item */
2207                                                 o_ptr = &inventory[i];
2208
2209                                                 /* Skip non-objects */
2210                                                 if (!o_ptr->k_idx) continue;
2211
2212                                                 /* Skip artifacts */
2213                                                 if (object_is_artifact(o_ptr)) continue;
2214
2215                                                 /* Get a description */
2216                                                 object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
2217
2218 #ifdef JP
2219                                                 msg_format("%s(%c)を%s盗まれた!",
2220                                                            o_name, index_to_label(i),
2221                                                            ((o_ptr->number > 1) ? "一つ" : ""));
2222 #else
2223                                                 msg_format("%sour %s (%c) was stolen!",
2224                                                            ((o_ptr->number > 1) ? "One of y" : "Y"),
2225                                                            o_name, index_to_label(i));
2226 #endif
2227
2228                                                 chg_virtue(V_SACRIFICE, 1);
2229
2230
2231                                                 /* Make an object */
2232                                                 o_idx = o_pop();
2233
2234                                                 /* Success */
2235                                                 if (o_idx)
2236                                                 {
2237                                                         object_type *j_ptr;
2238
2239                                                         /* Get new object */
2240                                                         j_ptr = &o_list[o_idx];
2241
2242                                                         /* Copy object */
2243                                                         object_copy(j_ptr, o_ptr);
2244
2245                                                         /* Modify number */
2246                                                         j_ptr->number = 1;
2247
2248                                                         /* Hack -- If a rod or wand, allocate total
2249                                                          * maximum timeouts or charges between those
2250                                                          * stolen and those missed. -LM-
2251                                                          */
2252                                                         if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
2253                                                         {
2254                                                                 j_ptr->pval = o_ptr->pval / o_ptr->number;
2255                                                                 o_ptr->pval -= j_ptr->pval;
2256                                                         }
2257
2258                                                         /* Forget mark */
2259                                                         j_ptr->marked = OM_TOUCHED;
2260
2261                                                         /* Memorize monster */
2262                                                         j_ptr->held_m_idx = m_idx;
2263
2264                                                         /* Build stack */
2265                                                         j_ptr->next_o_idx = m_ptr->hold_o_idx;
2266
2267                                                         /* Build stack */
2268                                                         m_ptr->hold_o_idx = o_idx;
2269                                                 }
2270
2271                                                 /* Steal the items */
2272                                                 inven_item_increase(i, -1);
2273                                                 inven_item_optimize(i);
2274
2275                                                 /* Obvious */
2276                                                 obvious = TRUE;
2277
2278                                                 /* Blink away */
2279                                                 blinked = TRUE;
2280
2281                                                 break;
2282                                         }
2283
2284                                         break;
2285                                 }
2286
2287                                 case RBE_EAT_FOOD:
2288                                 {
2289                                         /* Take some damage */
2290                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2291
2292                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2293
2294                                         /* Steal some food */
2295                                         for (k = 0; k < 10; k++)
2296                                         {
2297                                                 /* Pick an item from the pack */
2298                                                 i = (INVENTORY_IDX)randint0(INVEN_PACK);
2299
2300                                                 /* Get the item */
2301                                                 o_ptr = &inventory[i];
2302
2303                                                 /* Skip non-objects */
2304                                                 if (!o_ptr->k_idx) continue;
2305
2306                                                 /* Skip non-food objects */
2307                                                 if ((o_ptr->tval != TV_FOOD) && !((o_ptr->tval == TV_CORPSE) && (o_ptr->sval))) continue;
2308
2309                                                 /* Get a description */
2310                                                 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
2311
2312 #ifdef JP
2313                                                 msg_format("%s(%c)を%s食べられてしまった!",
2314                                                           o_name, index_to_label(i),
2315                                                           ((o_ptr->number > 1) ? "一つ" : ""));
2316 #else
2317                                                 msg_format("%sour %s (%c) was eaten!",
2318                                                            ((o_ptr->number > 1) ? "One of y" : "Y"),
2319                                                            o_name, index_to_label(i));
2320 #endif
2321
2322
2323                                                 /* Steal the items */
2324                                                 inven_item_increase(i, -1);
2325                                                 inven_item_optimize(i);
2326
2327                                                 /* Obvious */
2328                                                 obvious = TRUE;
2329
2330                                                 break;
2331                                         }
2332
2333                                         break;
2334                                 }
2335
2336                                 case RBE_EAT_LITE:
2337                                 {
2338                                         /* Access the lite */
2339                                         o_ptr = &inventory[INVEN_LITE];
2340
2341                                         /* Take some damage */
2342                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2343
2344                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2345
2346                                         /* Drain fuel */
2347                                         if ((o_ptr->xtra4 > 0) && (!object_is_fixed_artifact(o_ptr)))
2348                                         {
2349                                                 /* Reduce fuel */
2350                                                 o_ptr->xtra4 -= (s16b)(250 + randint1(250));
2351                                                 if (o_ptr->xtra4 < 1) o_ptr->xtra4 = 1;
2352
2353                                                 if (!p_ptr->blind)
2354                                                 {
2355                                                         msg_print(_("明かりが暗くなってしまった。", "Your light dims."));
2356                                                         obvious = TRUE;
2357                                                 }
2358
2359                                                 p_ptr->window |= (PW_EQUIP);
2360                                         }
2361
2362                                         break;
2363                                 }
2364
2365                                 case RBE_ACID:
2366                                 {
2367                                         if (explode) break;
2368                                         /* Obvious */
2369                                         obvious = TRUE;
2370
2371                                         msg_print(_("酸を浴びせられた!", "You are covered in acid!"));
2372
2373                                         /* Special damage */
2374                                         get_damage += acid_dam(damage, ddesc, -1, FALSE);
2375
2376                                         /* Hack -- Update AC */
2377                                         update_stuff();
2378
2379                                         /* Learn about the player */
2380                                         update_smart_learn(m_idx, DRS_ACID);
2381
2382                                         break;
2383                                 }
2384
2385                                 case RBE_ELEC:
2386                                 {
2387                                         if (explode) break;
2388                                         /* Obvious */
2389                                         obvious = TRUE;
2390
2391                                         msg_print(_("電撃を浴びせられた!", "You are struck by electricity!"));
2392
2393                                         /* Special damage */
2394                                         get_damage += elec_dam(damage, ddesc, -1, FALSE);
2395
2396                                         /* Learn about the player */
2397                                         update_smart_learn(m_idx, DRS_ELEC);
2398
2399                                         break;
2400                                 }
2401
2402                                 case RBE_FIRE:
2403                                 {
2404                                         if (explode) break;
2405                                         /* Obvious */
2406                                         obvious = TRUE;
2407
2408                                         msg_print(_("全身が炎に包まれた!", "You are enveloped in flames!"));
2409
2410                                         /* Special damage */
2411                                         get_damage += fire_dam(damage, ddesc, -1, FALSE);
2412
2413                                         /* Learn about the player */
2414                                         update_smart_learn(m_idx, DRS_FIRE);
2415
2416                                         break;
2417                                 }
2418
2419                                 case RBE_COLD:
2420                                 {
2421                                         if (explode) break;
2422                                         /* Obvious */
2423                                         obvious = TRUE;
2424
2425                                         msg_print(_("全身が冷気で覆われた!", "You are covered with frost!"));
2426
2427                                         /* Special damage */
2428                                         get_damage += cold_dam(damage, ddesc, -1, FALSE);
2429
2430                                         /* Learn about the player */
2431                                         update_smart_learn(m_idx, DRS_COLD);
2432
2433                                         break;
2434                                 }
2435
2436                                 case RBE_BLIND:
2437                                 {
2438                                         /* Take damage */
2439                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2440
2441                                         if (p_ptr->is_dead) break;
2442
2443                                         /* Increase "blind" */
2444                                         if (!p_ptr->resist_blind && !CHECK_MULTISHADOW())
2445                                         {
2446                                                 if (set_blind(p_ptr->blind + 10 + randint1(rlev)))
2447                                                 {
2448 #ifdef JP
2449                                                         if (m_ptr->r_idx == MON_DIO) msg_print("どうだッ!この血の目潰しはッ!");
2450 #else
2451                                                         /* nanka */
2452 #endif
2453                                                         obvious = TRUE;
2454                                                 }
2455                                         }
2456
2457                                         /* Learn about the player */
2458                                         update_smart_learn(m_idx, DRS_BLIND);
2459
2460                                         break;
2461                                 }
2462
2463                                 case RBE_CONFUSE:
2464                                 {
2465                                         if (explode) break;
2466                                         /* Take damage */
2467                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2468
2469                                         if (p_ptr->is_dead) break;
2470
2471                                         /* Increase "confused" */
2472                                         if (!p_ptr->resist_conf && !CHECK_MULTISHADOW())
2473                                         {
2474                                                 if (set_confused(p_ptr->confused + 3 + randint1(rlev)))
2475                                                 {
2476                                                         obvious = TRUE;
2477                                                 }
2478                                         }
2479
2480                                         /* Learn about the player */
2481                                         update_smart_learn(m_idx, DRS_CONF);
2482
2483                                         break;
2484                                 }
2485
2486                                 case RBE_TERRIFY:
2487                                 {
2488                                         /* Take damage */
2489                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2490
2491                                         if (p_ptr->is_dead) break;
2492
2493                                         /* Increase "afraid" */
2494                                         if (CHECK_MULTISHADOW())
2495                                         {
2496                                                 /* Do nothing */
2497                                         }
2498                                         else if (p_ptr->resist_fear)
2499                                         {
2500                                                 msg_print(_("しかし恐怖に侵されなかった!", "You stand your ground!"));
2501                                                 obvious = TRUE;
2502                                         }
2503                                         else if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2504                                         {
2505                                                 msg_print(_("しかし恐怖に侵されなかった!", "You stand your ground!"));
2506                                                 obvious = TRUE;
2507                                         }
2508                                         else
2509                                         {
2510                                                 if (set_afraid(p_ptr->afraid + 3 + randint1(rlev)))
2511                                                 {
2512                                                         obvious = TRUE;
2513                                                 }
2514                                         }
2515
2516                                         /* Learn about the player */
2517                                         update_smart_learn(m_idx, DRS_FEAR);
2518
2519                                         break;
2520                                 }
2521
2522                                 case RBE_PARALYZE:
2523                                 {
2524                                         /* Take damage */
2525                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2526
2527                                         if (p_ptr->is_dead) break;
2528
2529                                         /* Increase "paralyzed" */
2530                                         if (CHECK_MULTISHADOW())
2531                                         {
2532                                                 /* Do nothing */
2533                                         }
2534                                         else if (p_ptr->free_act)
2535                                         {
2536                                                 msg_print(_("しかし効果がなかった!", "You are unaffected!"));
2537                                                 obvious = TRUE;
2538                                         }
2539                                         else if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2540                                         {
2541                                                 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
2542                                                 obvious = TRUE;
2543                                         }
2544                                         else
2545                                         {
2546                                                 if (!p_ptr->paralyzed)
2547                                                 {
2548                                                         if (set_paralyzed(3 + randint1(rlev)))
2549                                                         {
2550                                                                 obvious = TRUE;
2551                                                         }
2552                                                 }
2553                                         }
2554
2555                                         /* Learn about the player */
2556                                         update_smart_learn(m_idx, DRS_FREE);
2557
2558                                         break;
2559                                 }
2560
2561                                 case RBE_LOSE_STR:
2562                                 {
2563                                         /* Damage (physical) */
2564                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2565
2566                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2567
2568                                         /* Damage (stat) */
2569                                         if (do_dec_stat(A_STR)) obvious = TRUE;
2570
2571                                         break;
2572                                 }
2573
2574                                 case RBE_LOSE_INT:
2575                                 {
2576                                         /* Damage (physical) */
2577                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2578
2579                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2580
2581                                         /* Damage (stat) */
2582                                         if (do_dec_stat(A_INT)) obvious = TRUE;
2583
2584                                         break;
2585                                 }
2586
2587                                 case RBE_LOSE_WIS:
2588                                 {
2589                                         /* Damage (physical) */
2590                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2591
2592                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2593
2594                                         /* Damage (stat) */
2595                                         if (do_dec_stat(A_WIS)) obvious = TRUE;
2596
2597                                         break;
2598                                 }
2599
2600                                 case RBE_LOSE_DEX:
2601                                 {
2602                                         /* Damage (physical) */
2603                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2604
2605                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2606
2607                                         /* Damage (stat) */
2608                                         if (do_dec_stat(A_DEX)) obvious = TRUE;
2609
2610                                         break;
2611                                 }
2612
2613                                 case RBE_LOSE_CON:
2614                                 {
2615                                         /* Damage (physical) */
2616                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2617
2618                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2619
2620                                         /* Damage (stat) */
2621                                         if (do_dec_stat(A_CON)) obvious = TRUE;
2622
2623                                         break;
2624                                 }
2625
2626                                 case RBE_LOSE_CHR:
2627                                 {
2628                                         /* Damage (physical) */
2629                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2630
2631                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2632
2633                                         /* Damage (stat) */
2634                                         if (do_dec_stat(A_CHR)) obvious = TRUE;
2635
2636                                         break;
2637                                 }
2638
2639                                 case RBE_LOSE_ALL:
2640                                 {
2641                                         /* Damage (physical) */
2642                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2643
2644                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2645
2646                                         /* Damage (stats) */
2647                                         if (do_dec_stat(A_STR)) obvious = TRUE;
2648                                         if (do_dec_stat(A_DEX)) obvious = TRUE;
2649                                         if (do_dec_stat(A_CON)) obvious = TRUE;
2650                                         if (do_dec_stat(A_INT)) obvious = TRUE;
2651                                         if (do_dec_stat(A_WIS)) obvious = TRUE;
2652                                         if (do_dec_stat(A_CHR)) obvious = TRUE;
2653
2654                                         break;
2655                                 }
2656
2657                                 case RBE_SHATTER:
2658                                 {
2659                                         /* Obvious */
2660                                         obvious = TRUE;
2661
2662                                         /* Hack -- Reduce damage based on the player armor class */
2663                                         damage -= (damage * ((ac < 150) ? ac : 150) / 250);
2664
2665                                         /* Take damage */
2666                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2667
2668                                         /* Radius 8 earthquake centered at the monster */
2669                                         if (damage > 23 || explode)
2670                                         {
2671                                                 earthquake_aux(m_ptr->fy, m_ptr->fx, 8, m_idx);
2672                                         }
2673
2674                                         break;
2675                                 }
2676
2677                                 case RBE_EXP_10:
2678                                 {
2679                                         s32b d = damroll(10, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
2680
2681                                         /* Obvious */
2682                                         obvious = TRUE;
2683
2684                                         /* Take damage */
2685                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2686
2687                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2688
2689                                         (void)drain_exp(d, d / 10, 95);
2690                                         break;
2691                                 }
2692
2693                                 case RBE_EXP_20:
2694                                 {
2695                                         s32b d = damroll(20, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
2696
2697                                         /* Obvious */
2698                                         obvious = TRUE;
2699
2700                                         /* Take damage */
2701                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2702
2703                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2704
2705                                         (void)drain_exp(d, d / 10, 90);
2706                                         break;
2707                                 }
2708
2709                                 case RBE_EXP_40:
2710                                 {
2711                                         s32b d = damroll(40, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
2712
2713                                         /* Obvious */
2714                                         obvious = TRUE;
2715
2716                                         /* Take damage */
2717                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2718
2719                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2720
2721                                         (void)drain_exp(d, d / 10, 75);
2722                                         break;
2723                                 }
2724
2725                                 case RBE_EXP_80:
2726                                 {
2727                                         s32b d = damroll(80, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
2728
2729                                         /* Obvious */
2730                                         obvious = TRUE;
2731
2732                                         /* Take damage */
2733                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2734
2735                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2736
2737                                         (void)drain_exp(d, d / 10, 50);
2738                                         break;
2739                                 }
2740
2741                                 case RBE_DISEASE:
2742                                 {
2743                                         /* Take some damage */
2744                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2745
2746                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2747
2748                                         /* Take "poison" effect */
2749                                         if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
2750                                         {
2751                                                 if (set_poisoned(p_ptr->poisoned + randint1(rlev) + 5))
2752                                                 {
2753                                                         obvious = TRUE;
2754                                                 }
2755                                         }
2756
2757                                         /* Damage CON (10% chance)*/
2758                                         if ((randint1(100) < 11) && (p_ptr->prace != RACE_ANDROID))
2759                                         {
2760                                                 /* 1% chance for perm. damage */
2761                                                 bool perm = one_in_(10);
2762                                                 if (dec_stat(A_CON, randint1(10), perm))
2763                                                 {
2764                                                         msg_print(_("病があなたを蝕んでいる気がする。", "You feel strange sickness."));
2765                                                         obvious = TRUE;
2766                                                 }
2767                                         }
2768
2769                                         break;
2770                                 }
2771                                 case RBE_TIME:
2772                                 {
2773                                         if (explode) break;
2774                                         if (!p_ptr->resist_time && !CHECK_MULTISHADOW())
2775                                         {
2776                                                 switch (randint1(10))
2777                                                 {
2778                                                         case 1: case 2: case 3: case 4: case 5:
2779                                                         {
2780                                                                 if (p_ptr->prace == RACE_ANDROID) break;
2781                                                                 msg_print(_("人生が逆戻りした気がする。", "You feel life has clocked back."));
2782                                                                 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
2783                                                                 break;
2784                                                         }
2785
2786                                                         case 6: case 7: case 8: case 9:
2787                                                         {
2788                                                                 int stat = randint0(6);
2789
2790                                                                 switch (stat)
2791                                                                 {
2792 #ifdef JP
2793                                                                         case A_STR: act = "強く"; break;
2794                                                                         case A_INT: act = "聡明で"; break;
2795                                                                         case A_WIS: act = "賢明で"; break;
2796                                                                         case A_DEX: act = "器用で"; break;
2797                                                                         case A_CON: act = "健康で"; break;
2798                                                                         case A_CHR: act = "美しく"; break;
2799 #else
2800                                                                         case A_STR: act = "strong"; break;
2801                                                                         case A_INT: act = "bright"; break;
2802                                                                         case A_WIS: act = "wise"; break;
2803                                                                         case A_DEX: act = "agile"; break;
2804                                                                         case A_CON: act = "hale"; break;
2805                                                                         case A_CHR: act = "beautiful"; break;
2806 #endif
2807
2808                                                                 }
2809
2810                                                                 msg_format(_("あなたは以前ほど%sなくなってしまった...。", "You're not as %s as you used to be..."), act);
2811                                                                 p_ptr->stat_cur[stat] = (p_ptr->stat_cur[stat] * 3) / 4;
2812                                                                 if (p_ptr->stat_cur[stat] < 3) p_ptr->stat_cur[stat] = 3;
2813                                                                 p_ptr->update |= (PU_BONUS);
2814                                                                 break;
2815                                                         }
2816
2817                                                         case 10:
2818                                                         {
2819                                                                 msg_print(_("あなたは以前ほど力強くなくなってしまった...。", "You're not as powerful as you used to be..."));
2820
2821                                                                 for (k = 0; k < 6; k++)
2822                                                                 {
2823                                                                         p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
2824                                                                         if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
2825                                                                 }
2826                                                                 p_ptr->update |= (PU_BONUS);
2827                                                                 break;
2828                                                         }
2829                                                 }
2830                                         }
2831                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2832
2833                                         break;
2834                                 }
2835                                 case RBE_DR_LIFE:
2836                                 {
2837                                         s32b d = damroll(60, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
2838                                         bool resist_drain;
2839
2840                                         /* Obvious */
2841                                         obvious = TRUE;
2842
2843                                         /* Take damage */
2844                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2845
2846                                         if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
2847
2848                                         resist_drain = !drain_exp(d, d / 10, 50);
2849
2850                                         /* Heal the attacker? */
2851                                         if (p_ptr->mimic_form)
2852                                         {
2853                                                 if (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING)
2854                                                         resist_drain = TRUE;
2855                                         }
2856                                         else
2857                                         {
2858                                                 switch (p_ptr->prace)
2859                                                 {
2860                                                 case RACE_ZOMBIE:
2861                                                 case RACE_VAMPIRE:
2862                                                 case RACE_SPECTRE:
2863                                                 case RACE_SKELETON:
2864                                                 case RACE_DEMON:
2865                                                 case RACE_GOLEM:
2866                                                 case RACE_ANDROID:
2867                                                         resist_drain = TRUE;
2868                                                         break;
2869                                                 }
2870                                         }
2871
2872                                         if ((damage > 5) && !resist_drain)
2873                                         {
2874                                                 bool did_heal = FALSE;
2875
2876                                                 if (m_ptr->hp < m_ptr->maxhp) did_heal = TRUE;
2877
2878                                                 /* Heal */
2879                                                 m_ptr->hp += damroll(4, damage / 6);
2880                                                 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2881
2882                                                 /* Redraw (later) if needed */
2883                                                 if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
2884                                                 if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
2885
2886                                                 /* Special message */
2887                                                 if (m_ptr->ml && did_heal)
2888                                                 {
2889                                                         msg_format(_("%sは体力を回復したようだ。", "%^s appears healthier."), m_name);
2890                                                 }
2891                                         }
2892
2893                                         break;
2894                                 }
2895                                 case RBE_DR_MANA:
2896                                 {
2897                                         /* Obvious */
2898                                         obvious = TRUE;
2899
2900                                         if (CHECK_MULTISHADOW())
2901                                         {
2902                                                 msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, you are unharmed!"));
2903                                         }
2904                                         else
2905                                         {
2906                                                 do_cut = 0;
2907
2908                                                 /* Take damage */
2909                                                 p_ptr->csp -= damage;
2910                                                 if (p_ptr->csp < 0)
2911                                                 {
2912                                                         p_ptr->csp = 0;
2913                                                         p_ptr->csp_frac = 0;
2914                                                 }
2915
2916                                                 p_ptr->redraw |= (PR_MANA);
2917                                         }
2918
2919                                         /* Learn about the player */
2920                                         update_smart_learn(m_idx, DRS_MANA);
2921
2922                                         break;
2923                                 }
2924                                 case RBE_INERTIA:
2925                                 {
2926                                         /* Take damage */
2927                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2928
2929                                         if (p_ptr->is_dead) break;
2930
2931                                         /* Decrease speed */
2932                                         if (CHECK_MULTISHADOW())
2933                                         {
2934                                                 /* Do nothing */
2935                                         }
2936                                         else
2937                                         {
2938                                                 if (set_slow((p_ptr->slow + 4 + randint0(rlev / 10)), FALSE))
2939                                                 {
2940                                                         obvious = TRUE;
2941                                                 }
2942                                         }
2943
2944                                         break;
2945                                 }
2946                                 case RBE_STUN:
2947                                 {
2948                                         /* Take damage */
2949                                         get_damage += take_hit(DAMAGE_ATTACK, damage, ddesc, -1);
2950
2951                                         if (p_ptr->is_dead) break;
2952
2953                                         /* Decrease speed */
2954                                         if (p_ptr->resist_sound || CHECK_MULTISHADOW())
2955                                         {
2956                                                 /* Do nothing */
2957                                         }
2958                                         else
2959                                         {
2960                                                 if (set_stun(p_ptr->stun + 10 + randint1(r_ptr->level / 4)))
2961                                                 {
2962                                                         obvious = TRUE;
2963                                                 }
2964                                         }
2965
2966                                         break;
2967                                 }
2968                         }
2969
2970                         /* Hack -- only one of cut or stun */
2971                         if (do_cut && do_stun)
2972                         {
2973                                 /* Cancel cut */
2974                                 if (randint0(100) < 50)
2975                                 {
2976                                         do_cut = 0;
2977                                 }
2978
2979                                 /* Cancel stun */
2980                                 else
2981                                 {
2982                                         do_stun = 0;
2983                                 }
2984                         }
2985
2986                         /* Handle cut */
2987                         if (do_cut)
2988                         {
2989                                 int cut_plus = 0;
2990
2991                                 /* Critical hit (zero if non-critical) */
2992                                 tmp = monster_critical(d_dice, d_side, damage);
2993
2994                                 /* Roll for damage */
2995                                 switch (tmp)
2996                                 {
2997                                         case 0: cut_plus = 0; break;
2998                                         case 1: cut_plus = randint1(5); break;
2999                                         case 2: cut_plus = randint1(5) + 5; break;
3000                                         case 3: cut_plus = randint1(20) + 20; break;
3001                                         case 4: cut_plus = randint1(50) + 50; break;
3002                                         case 5: cut_plus = randint1(100) + 100; break;
3003                                         case 6: cut_plus = 300; break;
3004                                         default: cut_plus = 500; break;
3005                                 }
3006
3007                                 /* Apply the cut */
3008                                 if (cut_plus) (void)set_cut(p_ptr->cut + cut_plus);
3009                         }
3010
3011                         /* Handle stun */
3012                         if (do_stun)
3013                         {
3014                                 int stun_plus = 0;
3015
3016                                 /* Critical hit (zero if non-critical) */
3017                                 tmp = monster_critical(d_dice, d_side, damage);
3018
3019                                 /* Roll for damage */
3020                                 switch (tmp)
3021                                 {
3022                                         case 0: stun_plus = 0; break;
3023                                         case 1: stun_plus = randint1(5); break;
3024                                         case 2: stun_plus = randint1(5) + 10; break;
3025                                         case 3: stun_plus = randint1(10) + 20; break;
3026                                         case 4: stun_plus = randint1(15) + 30; break;
3027                                         case 5: stun_plus = randint1(20) + 40; break;
3028                                         case 6: stun_plus = 80; break;
3029                                         default: stun_plus = 150; break;
3030                                 }
3031
3032                                 /* Apply the stun */
3033                                 if (stun_plus) (void)set_stun(p_ptr->stun + stun_plus);
3034                         }
3035
3036                         if (explode)
3037                         {
3038                                 sound(SOUND_EXPLODE);
3039
3040                                 if (mon_take_hit(m_idx, m_ptr->hp + 1, &fear, NULL))
3041                                 {
3042                                         blinked = FALSE;
3043                                         alive = FALSE;
3044                                 }
3045                         }
3046
3047                         if (touched)
3048                         {
3049                                 if (p_ptr->sh_fire && alive && !p_ptr->is_dead)
3050                                 {
3051                                         if (!(r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK))
3052                                         {
3053                                                 HIT_POINT dam = damroll(2, 6);
3054
3055                                                 /* Modify the damage */
3056                                                 dam = mon_damage_mod(m_ptr, dam, FALSE);
3057
3058 #ifdef JP
3059                                                 msg_format("%^sは突然熱くなった!", m_name);
3060                                                 if (mon_take_hit(m_idx, dam, &fear,
3061                                                     "は灰の山になった。"))
3062 #else
3063                                                 msg_format("%^s is suddenly very hot!", m_name);
3064
3065                                                 if (mon_take_hit(m_idx, dam, &fear,
3066                                                     " turns into a pile of ash."))
3067 #endif
3068
3069                                                 {
3070                                                         blinked = FALSE;
3071                                                         alive = FALSE;
3072                                                 }
3073                                         }
3074                                         else
3075                                         {
3076                                                 if (is_original_ap_and_seen(m_ptr))
3077                                                         r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK);
3078                                         }
3079                                 }
3080
3081                                 if (p_ptr->sh_elec && alive && !p_ptr->is_dead)
3082                                 {
3083                                         if (!(r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK))
3084                                         {
3085                                                 HIT_POINT dam = damroll(2, 6);
3086
3087                                                 /* Modify the damage */
3088                                                 dam = mon_damage_mod(m_ptr, dam, FALSE);
3089
3090 #ifdef JP
3091                                                 msg_format("%^sは電撃をくらった!", m_name);
3092                                                 if (mon_take_hit(m_idx, dam, &fear,
3093                                                     "は燃え殻の山になった。"))
3094 #else
3095                                                 msg_format("%^s gets zapped!", m_name);
3096
3097                                                 if (mon_take_hit(m_idx, dam, &fear,
3098                                                     " turns into a pile of cinder."))
3099 #endif
3100
3101                                                 {
3102                                                         blinked = FALSE;
3103                                                         alive = FALSE;
3104                                                 }
3105                                         }
3106                                         else
3107                                         {
3108                                                 if (is_original_ap_and_seen(m_ptr))
3109                                                         r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK);
3110                                         }
3111                                 }
3112
3113                                 if (p_ptr->sh_cold && alive && !p_ptr->is_dead)
3114                                 {
3115                                         if (!(r_ptr->flagsr & RFR_EFF_IM_COLD_MASK))
3116                                         {
3117                                                 HIT_POINT dam = damroll(2, 6);
3118
3119                                                 /* Modify the damage */
3120                                                 dam = mon_damage_mod(m_ptr, dam, FALSE);
3121
3122 #ifdef JP
3123                                                 msg_format("%^sは冷気をくらった!", m_name);
3124                                                 if (mon_take_hit(m_idx, dam, &fear,
3125                                                     "は凍りついた。"))
3126 #else
3127                                                 msg_format("%^s is very cold!", m_name);
3128
3129                                                 if (mon_take_hit(m_idx, dam, &fear,
3130                                                     " was frozen."))
3131 #endif
3132
3133                                                 {
3134                                                         blinked = FALSE;
3135                                                         alive = FALSE;
3136                                                 }
3137                                         }
3138                                         else
3139                                         {
3140                                                 if (is_original_ap_and_seen(m_ptr))
3141                                                         r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK);
3142                                         }
3143                                 }
3144
3145                                 /* by henkma */
3146                                 if (p_ptr->dustrobe && alive && !p_ptr->is_dead)
3147                                 {
3148                                         if (!(r_ptr->flagsr & RFR_EFF_RES_SHAR_MASK))
3149                                         {
3150                                                 HIT_POINT dam = damroll(2, 6);
3151
3152                                                 /* Modify the damage */
3153                                                 dam = mon_damage_mod(m_ptr, dam, FALSE);
3154
3155 #ifdef JP
3156                                                 msg_format("%^sは鏡の破片をくらった!", m_name);
3157                                                 if (mon_take_hit(m_idx, dam, &fear,
3158                                                     "はズタズタになった。"))
3159 #else
3160                                                 msg_format("%^s gets zapped!", m_name);
3161
3162                                                 if (mon_take_hit(m_idx, dam, &fear,
3163                                                     " had torn to pieces."))
3164 #endif
3165                                                 {
3166                                                         blinked = FALSE;
3167                                                         alive = FALSE;
3168                                                 }
3169                                         }
3170                                         else
3171                                         {
3172                                                 if (is_original_ap_and_seen(m_ptr))
3173                                                         r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_RES_SHAR_MASK);
3174                                         }
3175
3176                                         if (is_mirror_grid(&cave[p_ptr->y][p_ptr->x]))
3177                                         {
3178                                                 teleport_player(10, 0L);
3179                                         }
3180                                 }
3181
3182                                 if (p_ptr->tim_sh_holy && alive && !p_ptr->is_dead)
3183                                 {
3184                                         if (r_ptr->flags3 & RF3_EVIL)
3185                                         {
3186                                                 if (!(r_ptr->flagsr & RFR_RES_ALL))
3187                                                 {
3188                                                         HIT_POINT dam = damroll(2, 6);
3189
3190                                                         /* Modify the damage */
3191                                                         dam = mon_damage_mod(m_ptr, dam, FALSE);
3192
3193 #ifdef JP
3194                                                         msg_format("%^sは聖なるオーラで傷ついた!", m_name);
3195                                                         if (mon_take_hit(m_idx, dam, &fear,
3196                                                             "は倒れた。"))
3197 #else
3198                                                         msg_format("%^s is injured by holy power!", m_name);
3199
3200                                                         if (mon_take_hit(m_idx, dam, &fear,
3201                                                             " is destroyed."))
3202 #endif
3203                                                         {
3204                                                                 blinked = FALSE;
3205                                                                 alive = FALSE;
3206                                                         }
3207                                                         if (is_original_ap_and_seen(m_ptr))
3208                                                                 r_ptr->r_flags3 |= RF3_EVIL;
3209                                                 }
3210                                                 else
3211                                                 {
3212                                                         if (is_original_ap_and_seen(m_ptr))
3213                                                                 r_ptr->r_flagsr |= RFR_RES_ALL;
3214                                                 }
3215                                         }
3216                                 }
3217
3218                                 if (p_ptr->tim_sh_touki && alive && !p_ptr->is_dead)
3219                                 {
3220                                         if (!(r_ptr->flagsr & RFR_RES_ALL))
3221                                         {
3222                                                 HIT_POINT dam = damroll(2, 6);
3223
3224                                                 /* Modify the damage */
3225                                                 dam = mon_damage_mod(m_ptr, dam, FALSE);
3226
3227 #ifdef JP
3228                                                 msg_format("%^sが鋭い闘気のオーラで傷ついた!", m_name);
3229                                                 if (mon_take_hit(m_idx, dam, &fear,
3230                                                     "は倒れた。"))
3231 #else
3232                                                 msg_format("%^s is injured by the Force", m_name);
3233
3234                                                 if (mon_take_hit(m_idx, dam, &fear,
3235                                                     " is destroyed."))
3236 #endif
3237
3238                                                 {
3239                                                         blinked = FALSE;
3240                                                         alive = FALSE;
3241                                                 }
3242                                         }
3243                                         else
3244                                         {
3245                                                 if (is_original_ap_and_seen(m_ptr))
3246                                                         r_ptr->r_flagsr |= RFR_RES_ALL;
3247                                         }
3248                                 }
3249
3250                                 if (hex_spelling(HEX_SHADOW_CLOAK) && alive && !p_ptr->is_dead)
3251                                 {
3252                                         HIT_POINT dam = 1;
3253                                         object_type *o_armed_ptr = &inventory[INVEN_RARM];
3254
3255                                         if (!(r_ptr->flagsr & RFR_RES_ALL || r_ptr->flagsr & RFR_RES_DARK))
3256                                         {
3257                                                 if (o_armed_ptr->k_idx)
3258                                                 {
3259                                                         int basedam = ((o_armed_ptr->dd + p_ptr->to_dd[0]) * (o_armed_ptr->ds + p_ptr->to_ds[0] + 1));
3260                                                         dam = basedam / 2 + o_armed_ptr->to_d + p_ptr->to_d[0];
3261                                                 }
3262
3263                                                 /* Cursed armor makes damages doubled */
3264                                                 o_armed_ptr = &inventory[INVEN_BODY];
3265                                                 if ((o_armed_ptr->k_idx) && object_is_cursed(o_armed_ptr)) dam *= 2;
3266
3267                                                 /* Modify the damage */
3268                                                 dam = mon_damage_mod(m_ptr, dam, FALSE);
3269
3270 #ifdef JP
3271                                                 msg_format("影のオーラが%^sに反撃した!", m_name);
3272                                                 if (mon_take_hit(m_idx, dam, &fear, "は倒れた。"))
3273 #else
3274                                                 msg_format("Enveloped shadows attack %^s.", m_name);
3275
3276                                                 if (mon_take_hit(m_idx, dam, &fear, " is destroyed."))
3277 #endif
3278                                                 {
3279                                                         blinked = FALSE;
3280                                                         alive = FALSE;
3281                                                 }
3282                                                 else /* monster does not dead */
3283                                                 {
3284                                                         int j;
3285                                                         BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
3286                                                         EFFECT_ID typ[4][2] = {
3287                                                                 { INVEN_HEAD, GF_OLD_CONF },
3288                                                                 { INVEN_LARM,  GF_OLD_SLEEP },
3289                                                                 { INVEN_HANDS, GF_TURN_ALL },
3290                                                                 { INVEN_FEET, GF_OLD_SLOW }
3291                                                         };
3292
3293                                                         /* Some cursed armours gives an extra effect */
3294                                                         for (j = 0; j < 4; j++)
3295                                                         {
3296                                                                 o_armed_ptr = &inventory[typ[j][0]];
3297                                                                 if ((o_armed_ptr->k_idx) && object_is_cursed(o_armed_ptr) && object_is_armour(o_armed_ptr))
3298                                                                         project(0, 0, m_ptr->fy, m_ptr->fx, (p_ptr->lev * 2), typ[j][1], flg, -1);
3299                                                         }
3300                                                 }
3301                                         }
3302                                         else
3303                                         {
3304                                                 if (is_original_ap_and_seen(m_ptr))
3305                                                         r_ptr->r_flagsr |= (RFR_RES_ALL | RFR_RES_DARK);
3306                                         }
3307                                 }
3308                         }
3309                 }
3310
3311                 /* Monster missed player */
3312                 else
3313                 {
3314                         /* Analyze failed attacks */
3315                         switch (method)
3316                         {
3317                                 case RBM_HIT:
3318                                 case RBM_TOUCH:
3319                                 case RBM_PUNCH:
3320                                 case RBM_KICK:
3321                                 case RBM_CLAW:
3322                                 case RBM_BITE:
3323                                 case RBM_STING:
3324                                 case RBM_SLASH:
3325                                 case RBM_BUTT:
3326                                 case RBM_CRUSH:
3327                                 case RBM_ENGULF:
3328                                 case RBM_CHARGE:
3329
3330                                 /* Visible monsters */
3331                                 if (m_ptr->ml)
3332                                 {
3333                                         /* Disturbing */
3334                                         disturb(TRUE, TRUE);
3335
3336 #ifdef JP
3337                                         if (abbreviate)
3338                                             msg_format("%sかわした。", (p_ptr->special_attack & ATTACK_SUIKEN) ? "奇妙な動きで" : "");
3339                                         else
3340                                             msg_format("%s%^sの攻撃をかわした。", (p_ptr->special_attack & ATTACK_SUIKEN) ? "奇妙な動きで" : "", m_name);
3341                                         abbreviate = 1;/*2回目以降は省略 */
3342 #else
3343                                         msg_format("%^s misses you.", m_name);
3344 #endif
3345
3346                                 }
3347                                 damage = 0;
3348
3349                                 break;
3350                         }
3351                 }
3352
3353
3354                 /* Analyze "visible" monsters only */
3355                 if (is_original_ap_and_seen(m_ptr) && !do_silly_attack)
3356                 {
3357                         /* Count "obvious" attacks (and ones that cause damage) */
3358                         if (obvious || damage || (r_ptr->r_blows[ap_cnt] > 10))
3359                         {
3360                                 /* Count attacks of this type */
3361                                 if (r_ptr->r_blows[ap_cnt] < MAX_UCHAR)
3362                                 {
3363                                         r_ptr->r_blows[ap_cnt]++;
3364                                 }
3365                         }
3366                 }
3367
3368                 if (p_ptr->riding && damage)
3369                 {
3370                         char m_steed_name[80];
3371                         monster_desc(m_steed_name, &m_list[p_ptr->riding], 0);
3372                         if (rakuba((damage > 200) ? 200 : damage, FALSE))
3373                         {
3374                                 msg_format(_("%^sから落ちてしまった!", "You have fallen from %s."), m_steed_name);
3375                         }
3376                 }
3377
3378                 if (p_ptr->special_defense & NINJA_KAWARIMI)
3379                 {
3380                         if (kawarimi(FALSE)) return TRUE;
3381                 }
3382         }
3383
3384         /* Hex - revenge damage stored */
3385         revenge_store(get_damage);
3386
3387         if ((p_ptr->tim_eyeeye || hex_spelling(HEX_EYE_FOR_EYE))
3388                 && get_damage > 0 && !p_ptr->is_dead)
3389         {
3390 #ifdef JP
3391                 msg_format("攻撃が%s自身を傷つけた!", m_name);
3392 #else
3393                 char m_name_self[80];
3394
3395                 /* hisself */
3396                 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
3397
3398                 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
3399 #endif
3400                 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
3401                 if (p_ptr->tim_eyeeye) set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
3402         }
3403
3404         if ((p_ptr->counter || (p_ptr->special_defense & KATA_MUSOU)) && alive && !p_ptr->is_dead && m_ptr->ml && (p_ptr->csp > 7))
3405         {
3406                 char m_target_name[80];
3407                 monster_desc(m_target_name, m_ptr, 0);
3408
3409                 p_ptr->csp -= 7;
3410                 msg_format(_("%^sに反撃した!", "Your counterattack to %s!"), m_target_name);
3411                 py_attack(m_ptr->fy, m_ptr->fx, HISSATSU_COUNTER);
3412                 fear = FALSE;
3413
3414                 /* Redraw mana */
3415                 p_ptr->redraw |= (PR_MANA);
3416         }
3417
3418         /* Blink away */
3419         if (blinked && alive && !p_ptr->is_dead)
3420         {
3421                 if (teleport_barrier(m_idx))
3422                 {
3423                         msg_print(_("泥棒は笑って逃げ...ようとしたがバリアに防がれた。", "The thief flees laughing...? But magic barrier obstructs it."));
3424                 }
3425                 else
3426                 {
3427                         msg_print(_("泥棒は笑って逃げた!", "The thief flees laughing!"));
3428                         teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
3429                 }
3430         }
3431
3432
3433         /* Always notice cause of death */
3434         if (p_ptr->is_dead && (r_ptr->r_deaths < MAX_SHORT) && !p_ptr->inside_arena)
3435         {
3436                 r_ptr->r_deaths++;
3437         }
3438
3439         if (m_ptr->ml && fear && alive && !p_ptr->is_dead)
3440         {
3441                 sound(SOUND_FLEE);
3442                 msg_format(_("%^sは恐怖で逃げ出した!", "%^s flees in terror!"), m_name);
3443         }
3444
3445         if (p_ptr->special_defense & KATA_IAI)
3446         {
3447                 set_action(ACTION_NONE);
3448         }
3449
3450         /* Assume we attacked */
3451         return (TRUE);
3452 }