OSDN Git Service

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