OSDN Git Service

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