OSDN Git Service

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