OSDN Git Service

[Refactor] #40014 Separated monster-describer.c/h from monster2.c/h
[hengband/hengband.git] / src / player-attack / player-attack.c
1 /*!
2  * @brief プレーヤーからモンスターへの打撃処理
3  * @date 2020/05/22
4  * @author Hourier
5  */
6
7 #include "player-attack/player-attack.h"
8 #include "art-definition/art-sword-types.h"
9 #include "combat/attack-accuracy.h"
10 #include "combat/attack-criticality.h"
11 #include "combat/martial-arts-table.h"
12 #include "combat/slaying.h"
13 #include "floor/floor.h"
14 #include "main/sound-definitions-table.h"
15 #include "mind/mind-ninja.h"
16 #include "mind/mind-samurai.h"
17 #include "mind/monk-attack.h"
18 #include "monster-race/race-flags3.h"
19 #include "monster-race/monster-race-hook.h"
20 #include "monster/monster-describer.h"
21 #include "monster/monster-status.h"
22 #include "monster/monster-info.h"
23 #include "object-enchant/tr-types.h"
24 #include "object-enchant/vorpal-weapon.h"
25 #include "object/object-flags.h"
26 #include "object/object-flavor.h"
27 #include "object/object-hook.h"
28 #include "player-attack/attack-chaos-effect.h"
29 #include "player-attack/blood-sucking-processor.h"
30 #include "player-attack/player-attack-util.h"
31 #include "player/avatar.h"
32 #include "player/player-damage.h"
33 #include "player/player-skill.h"
34 #include "realm/realm-hex-numbers.h"
35 #include "spell-kind/earthquake.h"
36 #include "spell-realm/spells-hex.h"
37 #include "sv-definition/sv-weapon-types.h"
38 #include "world/world.h"
39
40 static player_attack_type *initialize_player_attack_type(
41     player_attack_type *pa_ptr, s16b hand, combat_options mode, monster_type *m_ptr, grid_type *g_ptr, bool *fear, bool *mdeath)
42 {
43     pa_ptr->hand = hand;
44     pa_ptr->mode = mode;
45     pa_ptr->m_ptr = m_ptr;
46     pa_ptr->backstab = FALSE;
47     pa_ptr->surprise_attack = FALSE;
48     pa_ptr->stab_fleeing = FALSE;
49     pa_ptr->monk_attack = FALSE;
50     pa_ptr->num_blow = 0;
51     pa_ptr->attack_damage = 0;
52     pa_ptr->can_drain = FALSE;
53     pa_ptr->ma_ptr = &ma_blows[0];
54     pa_ptr->drain_result = 0;
55     pa_ptr->g_ptr = g_ptr;
56     pa_ptr->fear = fear;
57     pa_ptr->mdeath = mdeath;
58     pa_ptr->drain_left = MAX_VAMPIRIC_DRAIN;
59     pa_ptr->weak = FALSE;
60     return pa_ptr;
61 }
62
63 /*!
64  * @brief 一部職業で攻撃に倍率がかかったりすることの処理
65  * @param attacker_ptr プレーヤーへの参照ポインタ
66  * @param pa_ptr 直接攻撃構造体への参照ポインタ
67  * @return なし
68  */
69 static void attack_classify(player_type *attacker_ptr, player_attack_type *pa_ptr)
70 {
71     switch (attacker_ptr->pclass) {
72     case CLASS_ROGUE:
73     case CLASS_NINJA:
74         process_surprise_attack(attacker_ptr, pa_ptr);
75         return;
76     case CLASS_MONK:
77     case CLASS_FORCETRAINER:
78     case CLASS_BERSERKER:
79         if ((empty_hands(attacker_ptr, TRUE) & EMPTY_HAND_RARM) && !attacker_ptr->riding)
80             pa_ptr->monk_attack = TRUE;
81         return;
82     default:
83         return;
84     }
85 }
86
87 /*!
88  * @brief マーシャルアーツの技能値を増加させる
89  * @param attacker_ptr プレーヤーへの参照ポインタ
90  * @param pa_ptr 直接攻撃構造体への参照ポインタ
91  * @return なし
92  */
93 static void get_bare_knuckle_exp(player_type *attacker_ptr, player_attack_type *pa_ptr)
94 {
95     monster_race *r_ptr = &r_info[pa_ptr->m_ptr->r_idx];
96     if ((r_ptr->level + 10) <= attacker_ptr->lev || (attacker_ptr->skill_exp[GINOU_SUDE] >= s_info[attacker_ptr->pclass].s_max[GINOU_SUDE]))
97         return;
98
99     if (attacker_ptr->skill_exp[GINOU_SUDE] < WEAPON_EXP_BEGINNER)
100         attacker_ptr->skill_exp[GINOU_SUDE] += 40;
101     else if ((attacker_ptr->skill_exp[GINOU_SUDE] < WEAPON_EXP_SKILLED))
102         attacker_ptr->skill_exp[GINOU_SUDE] += 5;
103     else if ((attacker_ptr->skill_exp[GINOU_SUDE] < WEAPON_EXP_EXPERT) && (attacker_ptr->lev > 19))
104         attacker_ptr->skill_exp[GINOU_SUDE] += 1;
105     else if ((attacker_ptr->lev > 34))
106         if (one_in_(3))
107             attacker_ptr->skill_exp[GINOU_SUDE] += 1;
108
109     attacker_ptr->update |= (PU_BONUS);
110 }
111
112 /*!
113  * @brief 装備している武器の技能値を増加させる
114  * @param attacker_ptr プレーヤーへの参照ポインタ
115  * @param pa_ptr 直接攻撃構造体への参照ポインタ
116  * @return なし
117  */
118 static void get_weapon_exp(player_type *attacker_ptr, player_attack_type *pa_ptr)
119 {
120     tval_type tval = attacker_ptr->inventory_list[INVEN_RARM + pa_ptr->hand].tval - TV_WEAPON_BEGIN;
121     OBJECT_SUBTYPE_VALUE sval = attacker_ptr->inventory_list[INVEN_RARM + pa_ptr->hand].sval;
122     int now_exp = attacker_ptr->weapon_exp[tval][sval];
123     if (now_exp >= s_info[attacker_ptr->pclass].w_max[tval][sval])
124         return;
125
126     SUB_EXP amount = 0;
127     if (now_exp < WEAPON_EXP_BEGINNER)
128         amount = 80;
129     else if (now_exp < WEAPON_EXP_SKILLED)
130         amount = 10;
131     else if ((now_exp < WEAPON_EXP_EXPERT) && (attacker_ptr->lev > 19))
132         amount = 1;
133     else if ((attacker_ptr->lev > 34) && one_in_(2))
134         amount = 1;
135
136     attacker_ptr->weapon_exp[tval][sval] += amount;
137     attacker_ptr->update |= (PU_BONUS);
138 }
139
140 /*!
141  * @brief 直接攻撃に伴う技能値の上昇処理
142  * @param attacker_ptr プレーヤーへの参照ポインタ
143  * @param pa_ptr 直接攻撃構造体への参照ポインタ
144  * @return なし
145  */
146 static void get_attack_exp(player_type *attacker_ptr, player_attack_type *pa_ptr)
147 {
148     monster_race *r_ptr = &r_info[pa_ptr->m_ptr->r_idx];
149     object_type *o_ptr = &attacker_ptr->inventory_list[INVEN_RARM + pa_ptr->hand];
150     if (o_ptr->k_idx == 0) {
151         get_bare_knuckle_exp(attacker_ptr, pa_ptr);
152         return;
153     }
154
155     if (!object_is_melee_weapon(o_ptr) || ((r_ptr->level + 10) <= attacker_ptr->lev))
156         return;
157
158     get_weapon_exp(attacker_ptr, pa_ptr);
159 }
160
161 /*!
162  * @brief 攻撃回数を決定する
163  * @param attacker_ptr プレーヤーへの参照ポインタ
164  * @param pa_ptr 直接攻撃構造体への参照ポインタ
165  * @return なし
166  * @details 毒針は確定で1回
167  */
168 static void calc_num_blow(player_type *attacker_ptr, player_attack_type *pa_ptr)
169 {
170     if ((pa_ptr->mode == HISSATSU_KYUSHO) || (pa_ptr->mode == HISSATSU_MINEUCHI) || (pa_ptr->mode == HISSATSU_3DAN) || (pa_ptr->mode == HISSATSU_IAI))
171         pa_ptr->num_blow = 1;
172     else if (pa_ptr->mode == HISSATSU_COLD)
173         pa_ptr->num_blow = attacker_ptr->num_blow[pa_ptr->hand] + 2;
174     else
175         pa_ptr->num_blow = attacker_ptr->num_blow[pa_ptr->hand];
176
177     object_type *o_ptr = &attacker_ptr->inventory_list[INVEN_RARM + pa_ptr->hand];
178     if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_POISON_NEEDLE))
179         pa_ptr->num_blow = 1;
180 }
181
182 /*!
183  * @brief 混沌属性の武器におけるカオス効果を決定する
184  * @param attacker_ptr プレーヤーへの参照ポインタ
185  * @param pa_ptr 直接攻撃構造体への参照ポインタ
186  * @return カオス効果
187  * @details
188  * 吸血20%、地震0.12%、混乱26.892%、テレポート・アウェイ1.494%、変身1.494% /
189  * Vampiric 20%, Quake 0.12%, Confusion 26.892%, Teleport away 1.494% and Polymorph 1.494%
190  */
191 static chaotic_effect select_chaotic_effect(player_type *attacker_ptr, player_attack_type *pa_ptr)
192 {
193     if (!(have_flag(pa_ptr->flags, TR_CHAOTIC)) || one_in_(2))
194         return CE_NONE;
195
196     if (one_in_(10))
197         chg_virtue(attacker_ptr, V_CHANCE, 1);
198
199     if (randint1(5) < 3)
200         return CE_VAMPIRIC;
201
202     if (one_in_(250))
203         return CE_CONFUSION;
204
205     if (!one_in_(10))
206         return CE_QUAKE;
207
208     return one_in_(2) ? CE_TELE_AWAY : CE_POLYMORPH;
209 }
210
211 /*!
212  * @brief 武器による直接攻撃メインルーチン
213  * @param attacker_ptr プレーヤーへの参照ポインタ
214  * @param pa_ptr 直接攻撃構造体への参照ポインタ
215  * @param vorpal_cut メッタ斬りにできるかどうか
216  * @param vorpal_chance ヴォーパル倍率上昇の機会値
217  * @return 攻撃の結果、地震を起こすことになったらTRUE、それ以外はFALSE
218  */
219 static void process_weapon_attack(player_type *attacker_ptr, player_attack_type *pa_ptr, bool *do_quake, const bool vorpal_cut, const int vorpal_chance)
220 {
221     object_type *o_ptr = &attacker_ptr->inventory_list[INVEN_RARM + pa_ptr->hand];
222     pa_ptr->attack_damage = damroll(o_ptr->dd + attacker_ptr->to_dd[pa_ptr->hand], o_ptr->ds + attacker_ptr->to_ds[pa_ptr->hand]);
223     pa_ptr->attack_damage = calc_attack_damage_with_slay(attacker_ptr, o_ptr, pa_ptr->attack_damage, pa_ptr->m_ptr, pa_ptr->mode, FALSE);
224     calc_surprise_attack_damage(attacker_ptr, pa_ptr);
225
226     if ((attacker_ptr->impact[pa_ptr->hand] && ((pa_ptr->attack_damage > 50) || one_in_(7))) || (pa_ptr->chaos_effect == CE_QUAKE)
227         || (pa_ptr->mode == HISSATSU_QUAKE))
228         *do_quake = TRUE;
229
230     if ((!(o_ptr->tval == TV_SWORD) || !(o_ptr->sval == SV_POISON_NEEDLE)) && !(pa_ptr->mode == HISSATSU_KYUSHO))
231         pa_ptr->attack_damage = critical_norm(attacker_ptr, o_ptr->weight, o_ptr->to_h, pa_ptr->attack_damage, attacker_ptr->to_h[pa_ptr->hand], pa_ptr->mode);
232
233     pa_ptr->drain_result = pa_ptr->attack_damage;
234     process_vorpal_attack(attacker_ptr, pa_ptr, vorpal_cut, vorpal_chance);
235     pa_ptr->attack_damage += o_ptr->to_d;
236     pa_ptr->drain_result += o_ptr->to_d;
237 }
238
239 /*!
240  * @brief 武器または素手による攻撃ダメージを計算する
241  * @param attacker_ptr プレーヤーへの参照ポインタ
242  * @param pa_ptr 直接攻撃構造体への参照ポインタ
243  * @param do_quake 攻撃の結果、地震を起こすことになったらTRUE、それ以外はFALSE
244  * @param vorpal_cut メッタ斬りにできるかどうか
245  * @param vorpal_change ヴォーパル倍率上昇の機会値
246  * @return なし
247  * @details 取り敢えず素手と仮定し1とする.
248  */
249 static void calc_attack_damage(player_type *attacker_ptr, player_attack_type *pa_ptr, bool *do_quake, const bool vorpal_cut, const int vorpal_chance)
250 {
251     object_type *o_ptr = &attacker_ptr->inventory_list[INVEN_RARM + pa_ptr->hand];
252     pa_ptr->attack_damage = 1;
253     if (pa_ptr->monk_attack) {
254         process_monk_attack(attacker_ptr, pa_ptr);
255         return;
256     }
257
258     if (o_ptr->k_idx) {
259         process_weapon_attack(attacker_ptr, pa_ptr, do_quake, vorpal_cut, vorpal_chance);
260     }
261 }
262
263 /*!
264  * @brief 武器のダメージボーナスや剣術家の技によってダメージにボーナスを与える
265  * @param attacker_ptr プレーヤーへの参照ポインタ
266  * @param pa_ptr 直接攻撃構造体への参照ポインタ
267  * @return なし
268  */
269 static void apply_damage_bonus(player_type *attacker_ptr, player_attack_type *pa_ptr)
270 {
271     pa_ptr->attack_damage += attacker_ptr->to_d[pa_ptr->hand];
272     pa_ptr->drain_result += attacker_ptr->to_d[pa_ptr->hand];
273
274     if ((pa_ptr->mode == HISSATSU_SUTEMI) || (pa_ptr->mode == HISSATSU_3DAN))
275         pa_ptr->attack_damage *= 2;
276
277     if ((pa_ptr->mode == HISSATSU_SEKIRYUKA) && !monster_living(pa_ptr->m_ptr->r_idx))
278         pa_ptr->attack_damage = 0;
279
280     if ((pa_ptr->mode == HISSATSU_SEKIRYUKA) && !attacker_ptr->cut)
281         pa_ptr->attack_damage /= 2;
282 }
283
284 /*!
285  * todo かなりのレアケースだが、右手に混沌属性の武器を持ち、左手にエクスカリバー・ジュニアを持ち、
286  * 右手の最終打撃で蜘蛛に変身したとしても、左手の攻撃でダメージが減らない気がする
287  * モンスターへの参照ポインタは変身時に変わるのにis_ej_nullifiedはその前に代入されて参照されるだけであるため
288  * @brief 特殊な条件でダメージが減ったり0になったりする処理
289  * @param attacker_ptr プレーヤーへの参照ポインタ
290  * @param pa_ptr 直接攻撃構造体への参照ポインタ
291  * @param is_zantetsu_nullified 斬鉄剣で切れないならばTRUE
292  * @param is_ej_nullified 蜘蛛相手ならばTRUE
293  * @details ダメージが0未満なら0に補正する
294  */
295 static void apply_damage_negative_effect(player_attack_type *pa_ptr, bool is_zantetsu_nullified, bool is_ej_nullified)
296 {
297     if (pa_ptr->attack_damage < 0)
298         pa_ptr->attack_damage = 0;
299
300     monster_race *r_ptr = &r_info[pa_ptr->m_ptr->r_idx];
301     if ((pa_ptr->mode == HISSATSU_ZANMA) && !(!monster_living(pa_ptr->m_ptr->r_idx) && (r_ptr->flags3 & RF3_EVIL))) {
302         pa_ptr->attack_damage = 0;
303     }
304
305     if (is_zantetsu_nullified) {
306         msg_print(_("こんな軟らかいものは切れん!", "You cannot cut such a elastic thing!"));
307         pa_ptr->attack_damage = 0;
308     }
309
310     if (is_ej_nullified) {
311         msg_print(_("蜘蛛は苦手だ!", "Spiders are difficult for you to deal with!"));
312         pa_ptr->attack_damage /= 2;
313     }
314 }
315
316 /*!
317  * @brief モンスターのHPを減らした後、恐怖させるか死なす (フロアから消滅させる)
318  * @param attacker_ptr プレーヤーへの参照ポインタ
319  * @param pa_ptr 直接攻撃構造体への参照ポインタ
320  * @return 死んだらTRUE、生きていたらFALSE
321  */
322 static bool check_fear_death(player_type *attacker_ptr, player_attack_type *pa_ptr, const int num, const bool is_lowlevel)
323 {
324     if (!mon_take_hit(attacker_ptr, pa_ptr->g_ptr->m_idx, pa_ptr->attack_damage, pa_ptr->fear, NULL))
325         return FALSE;
326
327     *(pa_ptr->mdeath) = TRUE;
328     if ((attacker_ptr->pclass == CLASS_BERSERKER) && attacker_ptr->energy_use) {
329         if (attacker_ptr->migite && attacker_ptr->hidarite) {
330             if (pa_ptr->hand)
331                 attacker_ptr->energy_use = attacker_ptr->energy_use * 3 / 5 + attacker_ptr->energy_use * num * 2 / (attacker_ptr->num_blow[pa_ptr->hand] * 5);
332             else
333                 attacker_ptr->energy_use = attacker_ptr->energy_use * num * 3 / (attacker_ptr->num_blow[pa_ptr->hand] * 5);
334         } else {
335             attacker_ptr->energy_use = attacker_ptr->energy_use * num / attacker_ptr->num_blow[pa_ptr->hand];
336         }
337     }
338
339     object_type *o_ptr = &attacker_ptr->inventory_list[INVEN_RARM + pa_ptr->hand];
340     if ((o_ptr->name1 == ART_ZANTETSU) && is_lowlevel)
341         msg_print(_("またつまらぬものを斬ってしまった...", "Sigh... Another trifling thing I've cut...."));
342
343     return TRUE;
344 }
345
346 /*!
347  * @brief 直接攻撃が当たった時の処理
348  * @param attacker_ptr プレーヤーへの参照ポインタ
349  * @param pa_ptr 直接攻撃構造体への参照ポインタ
350  * @param do_quake 攻撃後に地震を起こすかどうか
351  * @param is_zantetsu_nullified 斬鉄剣で切れないならばTRUE
352  * @param is_ej_nullified 蜘蛛相手ならばTRUE
353  * @return なし
354  */
355 static void apply_actual_attack(
356     player_type *attacker_ptr, player_attack_type *pa_ptr, bool *do_quake, const bool is_zantetsu_nullified, const bool is_ej_nullified)
357 {
358     object_type *o_ptr = &attacker_ptr->inventory_list[INVEN_RARM + pa_ptr->hand];
359     int vorpal_chance = ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD)) ? 2 : 4;
360
361     sound(SOUND_HIT);
362     print_surprise_attack(pa_ptr);
363
364     object_flags(o_ptr, pa_ptr->flags);
365     pa_ptr->chaos_effect = select_chaotic_effect(attacker_ptr, pa_ptr);
366     decide_blood_sucking(attacker_ptr, pa_ptr);
367
368     // process_monk_attackの中でplayer_type->magic_num1[0] を書き換えているので、ここでhex_spelling() の判定をしないとダメ.
369     bool vorpal_cut = (have_flag(pa_ptr->flags, TR_VORPAL) || hex_spelling(attacker_ptr, HEX_RUNESWORD)) && (randint1(vorpal_chance * 3 / 2) == 1)
370         && !is_zantetsu_nullified;
371
372     calc_attack_damage(attacker_ptr, pa_ptr, do_quake, vorpal_cut, vorpal_chance);
373     apply_damage_bonus(attacker_ptr, pa_ptr);
374     apply_damage_negative_effect(pa_ptr, is_zantetsu_nullified, is_ej_nullified);
375     mineuchi(attacker_ptr, pa_ptr);
376     pa_ptr->attack_damage = mon_damage_mod(attacker_ptr, pa_ptr->m_ptr, pa_ptr->attack_damage,
377         (bool)(((o_ptr->tval == TV_POLEARM) && (o_ptr->sval == SV_DEATH_SCYTHE)) || ((attacker_ptr->pclass == CLASS_BERSERKER) && one_in_(2))));
378     critical_attack(attacker_ptr, pa_ptr);
379     msg_format_wizard(CHEAT_MONSTER, _("%dのダメージを与えた。(残りHP %d/%d(%d))", "You do %d damage. (left HP %d/%d(%d))"), pa_ptr->attack_damage,
380         pa_ptr->m_ptr->hp - pa_ptr->attack_damage, pa_ptr->m_ptr->maxhp, pa_ptr->m_ptr->max_maxhp);
381 }
382
383 /*!
384  * @brief 地震を起こす
385  * @param attacker_ptr プレーヤーへの参照ポインタ
386  * @param pa_ptr 直接攻撃構造体への参照ポインタ
387  * @param do_quake 攻撃後に地震を起こすかどうか
388  * @param y モンスターのY座標
389  * @param x モンスターのX座標
390  * @return なし
391  */
392 static void cause_earthquake(player_type *attacker_ptr, player_attack_type *pa_ptr, const bool do_quake, const POSITION y, const POSITION x)
393 {
394     if (!do_quake)
395         return;
396
397     earthquake(attacker_ptr, attacker_ptr->y, attacker_ptr->x, 10, 0);
398     if (attacker_ptr->current_floor_ptr->grid_array[y][x].m_idx == 0)
399         *(pa_ptr->mdeath) = TRUE;
400 }
401
402 /*!
403  * @brief プレイヤーの打撃処理サブルーチン /
404  * Player attacks a (poor, defenseless) creature        -RAK-
405  * @param y 攻撃目標のY座標
406  * @param x 攻撃目標のX座標
407  * @param fear 攻撃を受けたモンスターが恐慌状態に陥ったかを返す参照ポインタ
408  * @param mdeath 攻撃を受けたモンスターが死亡したかを返す参照ポインタ
409  * @param hand 攻撃を行うための武器を持つ手
410  * @param mode 発動中の剣術ID
411  * @return なし
412  * @details
413  * If no "weapon" is available, then "punch" the monster one time.
414  */
415 void exe_player_attack_to_monster(player_type *attacker_ptr, POSITION y, POSITION x, bool *fear, bool *mdeath, s16b hand, combat_options mode)
416 {
417     bool do_quake = FALSE;
418     bool drain_msg = TRUE;
419
420     floor_type *floor_ptr = attacker_ptr->current_floor_ptr;
421     grid_type *g_ptr = &floor_ptr->grid_array[y][x];
422     monster_type *m_ptr = &floor_ptr->m_list[g_ptr->m_idx];
423     player_attack_type tmp_attack;
424     player_attack_type *pa_ptr = initialize_player_attack_type(&tmp_attack, hand, mode, m_ptr, g_ptr, fear, mdeath);
425     monster_race *r_ptr = &r_info[pa_ptr->m_ptr->r_idx];
426     bool is_human = (r_ptr->d_char == 'p');
427     bool is_lowlevel = (r_ptr->level < (attacker_ptr->lev - 15));
428
429     attack_classify(attacker_ptr, pa_ptr);
430     get_attack_exp(attacker_ptr, pa_ptr);
431
432     /* Disturb the monster */
433     (void)set_monster_csleep(attacker_ptr, g_ptr->m_idx, 0);
434     monster_desc(attacker_ptr, pa_ptr->m_name, m_ptr, 0);
435
436     int chance = calc_attack_quality(attacker_ptr, pa_ptr);
437     object_type *o_ptr = &attacker_ptr->inventory_list[INVEN_RARM + pa_ptr->hand];
438     bool is_zantetsu_nullified = ((o_ptr->name1 == ART_ZANTETSU) && (r_ptr->d_char == 'j'));
439     bool is_ej_nullified = ((o_ptr->name1 == ART_EXCALIBUR_J) && (r_ptr->d_char == 'S'));
440     calc_num_blow(attacker_ptr, pa_ptr);
441
442     /* Attack once for each legal blow */
443     int num = 0;
444     while ((num++ < pa_ptr->num_blow) && !attacker_ptr->is_dead) {
445         if (!process_attack_hit(attacker_ptr, pa_ptr, chance))
446             continue;
447
448         apply_actual_attack(attacker_ptr, pa_ptr, &do_quake, is_zantetsu_nullified, is_ej_nullified);
449         calc_drain(pa_ptr);
450         if (check_fear_death(attacker_ptr, pa_ptr, num, is_lowlevel))
451             break;
452
453         /* Anger the monster */
454         if (pa_ptr->attack_damage > 0)
455             anger_monster(attacker_ptr, m_ptr);
456
457         touch_zap_player(m_ptr, attacker_ptr);
458         process_drain(attacker_ptr, pa_ptr, is_human, &drain_msg);
459         pa_ptr->can_drain = FALSE;
460         pa_ptr->drain_result = 0;
461         change_monster_stat(attacker_ptr, pa_ptr, y, x, &num);
462         pa_ptr->backstab = FALSE;
463         pa_ptr->surprise_attack = FALSE;
464     }
465
466     if (pa_ptr->weak && !(*mdeath))
467         msg_format(_("%sは弱くなったようだ。", "%^s seems weakened."), pa_ptr->m_name);
468
469     if ((pa_ptr->drain_left != MAX_VAMPIRIC_DRAIN) && one_in_(4))
470         chg_virtue(attacker_ptr, V_UNLIFE, 1);
471
472     cause_earthquake(attacker_ptr, pa_ptr, do_quake, y, x);
473 }