OSDN Git Service

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