OSDN Git Service

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