OSDN Git Service

Merge pull request #716 from sikabane-works/release/3.0.0Alpha16
[hengbandforosx/hengbandosx.git] / src / player / player-damage.cpp
1 #include "player/player-damage.h"
2 #include "autopick/autopick-pref-processor.h"
3 #include "blue-magic/blue-magic-checker.h"
4 #include "cmd-io/cmd-process-screen.h"
5 #include "core/asking-player.h"
6 #include "core/disturbance.h"
7 #include "core/player-redraw-types.h"
8 #include "core/player-update-types.h"
9 #include "core/stuff-handler.h"
10 #include "core/window-redrawer.h"
11 #include "dungeon/quest.h"
12 #include "flavor/flavor-describer.h"
13 #include "flavor/object-flavor-types.h"
14 #include "floor/wild.h"
15 #include "game-option/birth-options.h"
16 #include "game-option/cheat-options.h"
17 #include "game-option/game-play-options.h"
18 #include "game-option/input-options.h"
19 #include "game-option/play-record-options.h"
20 #include "game-option/special-options.h"
21 #include "inventory/inventory-damage.h"
22 #include "inventory/inventory-slot-types.h"
23 #include "io/files-util.h"
24 #include "io/input-key-acceptor.h"
25 #include "io/report.h"
26 #include "io/write-diary.h"
27 #include "main/music-definitions-table.h"
28 #include "main/sound-definitions-table.h"
29 #include "main/sound-of-music.h"
30 #include "market/arena-info-table.h"
31 #include "mind/mind-mirror-master.h"
32 #include "monster-race/monster-race.h"
33 #include "monster-race/race-flags2.h"
34 #include "monster-race/race-flags3.h"
35 #include "monster/monster-describer.h"
36 #include "monster/monster-description-types.h"
37 #include "monster/monster-info.h"
38 #include "mutation/mutation-flag-types.h"
39 #include "object-enchant/tr-types.h"
40 #include "object-hook/hook-armor.h"
41 #include "object/item-tester-hooker.h"
42 #include "object/object-broken.h"
43 #include "object/object-flags.h"
44 #include "player-info/avatar.h"
45 #include "player/player-class.h"
46 #include "player/player-personalities-types.h"
47 #include "player/player-race-types.h"
48 #include "player/player-status-flags.h"
49 #include "player/player-status-resist.h"
50 #include "player/race-info-table.h"
51 #include "player/special-defense-types.h"
52 #include "racial/racial-android.h"
53 #include "save/save.h"
54 #include "status/base-status.h"
55 #include "status/element-resistance.h"
56 #include "system/building-type-definition.h"
57 #include "system/floor-type-definition.h"
58 #include "term/screen-processor.h"
59 #include "term/term-color-types.h"
60 #include "util/bit-flags-calculator.h"
61 #include "util/string-processor.h"
62 #include "view/display-messages.h"
63 #include "world/world.h"
64
65 /*!
66  * @brief 酸攻撃による装備のAC劣化処理 /
67  * Acid has hit the player, attempt to affect some armor.
68  * @param 酸を浴びたキャラクタへの参照ポインタ
69  * @return 装備による軽減があったならTRUEを返す
70  * @details
71  * 免疫があったらそもそもこの関数は実行されない (確実に錆びない).
72  * Note that the "base armor" of an object never changes.
73  * If any armor is damaged (or resists), the player takes less damage.
74  */
75 static bool acid_minus_ac(player_type *creature_ptr)
76 {
77     object_type *o_ptr = NULL;
78     switch (randint1(7)) {
79     case 1:
80         o_ptr = &creature_ptr->inventory_list[INVEN_MAIN_HAND];
81         break;
82     case 2:
83         o_ptr = &creature_ptr->inventory_list[INVEN_SUB_HAND];
84         break;
85     case 3:
86         o_ptr = &creature_ptr->inventory_list[INVEN_BODY];
87         break;
88     case 4:
89         o_ptr = &creature_ptr->inventory_list[INVEN_OUTER];
90         break;
91     case 5:
92         o_ptr = &creature_ptr->inventory_list[INVEN_ARMS];
93         break;
94     case 6:
95         o_ptr = &creature_ptr->inventory_list[INVEN_HEAD];
96         break;
97     case 7:
98         o_ptr = &creature_ptr->inventory_list[INVEN_FEET];
99         break;
100     }
101
102     if ((o_ptr == NULL) || (o_ptr->k_idx == 0) || !object_is_armour(creature_ptr, o_ptr))
103         return FALSE;
104
105     GAME_TEXT o_name[MAX_NLEN];
106     describe_flavor(creature_ptr, o_name, o_ptr, OD_OMIT_PREFIX | OD_NAME_ONLY);
107     BIT_FLAGS flgs[TR_FLAG_SIZE];
108     object_flags(creature_ptr, o_ptr, flgs);
109     if (o_ptr->ac + o_ptr->to_a <= 0) {
110         msg_format(_("%sは既にボロボロだ!", "Your %s is already fully corroded!"), o_name);
111         return FALSE;
112     }
113
114     if (has_flag(flgs, TR_IGNORE_ACID)) {
115         msg_format(_("しかし%sには効果がなかった!", "Your %s is unaffected!"), o_name);
116         return TRUE;
117     }
118
119     msg_format(_("%sが酸で腐食した!", "Your %s is corroded!"), o_name);
120     o_ptr->to_a--;
121     creature_ptr->update |= PU_BONUS;
122     creature_ptr->window_flags |= PW_EQUIP | PW_PLAYER;
123     calc_android_exp(creature_ptr);
124     return TRUE;
125 }
126
127 /*!
128  * @brief 酸属性によるプレイヤー損害処理 /
129  * Hurt the player with Acid
130  * @param creature_ptr 酸を浴びたキャラクタへの参照ポインタ
131  * @param dam 基本ダメージ量
132  * @param kb_str ダメージ原因記述
133  * @param monspell 原因となったモンスター特殊攻撃ID
134  * @param aura オーラよるダメージが原因ならばTRUE
135  * @return 修正HPダメージ量
136  * @details 酸オーラは存在しないが関数ポインタのために引数だけは用意している
137  */
138 HIT_POINT acid_dam(player_type *creature_ptr, HIT_POINT dam, concptr kb_str, int monspell, bool aura)
139 {
140     int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
141     bool double_resist = is_oppose_acid(creature_ptr);
142     dam = dam * calc_acid_damage_rate(creature_ptr) / 100;
143     if (dam <= 0)
144         return 0;
145
146     if (aura || !check_multishadow(creature_ptr)) {
147         if ((!(double_resist || has_resist_acid(creature_ptr))) && one_in_(HURT_CHANCE))
148             (void)do_dec_stat(creature_ptr, A_CHR);
149
150         if (acid_minus_ac(creature_ptr))
151             dam = (dam + 1) / 2;
152     }
153
154     HIT_POINT get_damage = take_hit(creature_ptr, aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
155     if (!aura && !(double_resist && has_resist_acid(creature_ptr)))
156         inventory_damage(creature_ptr, set_acid_destroy, inv);
157
158     return get_damage;
159 }
160
161 /*!
162  * @brief 電撃属性によるプレイヤー損害処理 /
163  * Hurt the player with electricity
164  * @param creature_ptr 電撃を浴びたキャラクタへの参照ポインタ
165  * @param dam 基本ダメージ量
166  * @param kb_str ダメージ原因記述
167  * @param monspell 原因となったモンスター特殊攻撃ID
168  * @param aura オーラよるダメージが原因ならばTRUE
169  * @return 修正HPダメージ量
170  */
171 HIT_POINT elec_dam(player_type *creature_ptr, HIT_POINT dam, concptr kb_str, int monspell, bool aura)
172 {
173     int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
174     bool double_resist = is_oppose_elec(creature_ptr);
175
176     dam = dam * calc_elec_damage_rate(creature_ptr) / 100;
177
178     if (dam <= 0)
179         return 0;
180
181     if (aura || !check_multishadow(creature_ptr)) {
182         if ((!(double_resist || has_resist_elec(creature_ptr))) && one_in_(HURT_CHANCE))
183             (void)do_dec_stat(creature_ptr, A_DEX);
184     }
185
186     HIT_POINT get_damage = take_hit(creature_ptr, aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
187     if (!aura && !(double_resist && has_resist_elec(creature_ptr)))
188         inventory_damage(creature_ptr, set_elec_destroy, inv);
189
190     return get_damage;
191 }
192
193 /*!
194  * @brief 火炎属性によるプレイヤー損害処理 /
195  * Hurt the player with Fire
196  * @param creature_ptr 火炎を浴びたキャラクタへの参照ポインタ
197  * @param dam 基本ダメージ量
198  * @param kb_str ダメージ原因記述
199  * @param monspell 原因となったモンスター特殊攻撃ID
200  * @param aura オーラよるダメージが原因ならばTRUE
201  * @return 修正HPダメージ量
202  */
203 HIT_POINT fire_dam(player_type *creature_ptr, HIT_POINT dam, concptr kb_str, int monspell, bool aura)
204 {
205     int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
206     bool double_resist = is_oppose_fire(creature_ptr);
207
208     /* Totally immune */
209     if (has_immune_fire(creature_ptr) || (dam <= 0))
210         return 0;
211
212     dam = dam * calc_fire_damage_rate(creature_ptr) / 100;
213     if (aura || !check_multishadow(creature_ptr)) {
214         if ((!(double_resist || has_resist_fire(creature_ptr))) && one_in_(HURT_CHANCE))
215             (void)do_dec_stat(creature_ptr, A_STR);
216     }
217
218     HIT_POINT get_damage = take_hit(creature_ptr, aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
219     if (!aura && !(double_resist && has_resist_fire(creature_ptr)))
220         inventory_damage(creature_ptr, set_fire_destroy, inv);
221
222     return get_damage;
223 }
224
225 /*!
226  * @brief 冷気属性によるプレイヤー損害処理 /
227  * Hurt the player with Cold
228  * @param creature_ptr 冷気を浴びたキャラクタへの参照ポインタ
229  * @param dam 基本ダメージ量
230  * @param kb_str ダメージ原因記述
231  * @param monspell 原因となったモンスター特殊攻撃ID
232  * @param aura オーラよるダメージが原因ならばTRUE
233  * @return 修正HPダメージ量
234  */
235 HIT_POINT cold_dam(player_type *creature_ptr, HIT_POINT dam, concptr kb_str, int monspell, bool aura)
236 {
237     int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
238     bool double_resist = is_oppose_cold(creature_ptr);
239     if (has_immune_cold(creature_ptr) || (dam <= 0))
240         return 0;
241
242     dam = dam * calc_cold_damage_rate(creature_ptr) / 100;
243     if (aura || !check_multishadow(creature_ptr)) {
244         if ((!(double_resist || has_resist_cold(creature_ptr))) && one_in_(HURT_CHANCE))
245             (void)do_dec_stat(creature_ptr, A_STR);
246     }
247
248     HIT_POINT get_damage = take_hit(creature_ptr, aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
249     if (!aura && !(double_resist && has_resist_cold(creature_ptr)))
250         inventory_damage(creature_ptr, set_cold_destroy, inv);
251
252     return get_damage;
253 }
254
255 /*
256  * Decreases players hit points and sets death flag if necessary
257  *
258  * Invulnerability needs to be changed into a "shield"
259  *
260  * Hack -- this function allows the user to save (or quit)
261  * the game when he dies, since the "You die." message is shown before
262  * setting the player to "dead".
263  */
264 int take_hit(player_type *creature_ptr, int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
265 {
266     (void)monspell; // unused
267
268     int old_chp = creature_ptr->chp;
269
270     char death_message[1024];
271     char tmp[1024];
272
273     int warning = (creature_ptr->mhp * hitpoint_warn / 10);
274     if (creature_ptr->is_dead)
275         return 0;
276
277     if (creature_ptr->sutemi)
278         damage *= 2;
279     if (creature_ptr->special_defense & KATA_IAI)
280         damage += (damage + 4) / 5;
281
282     if (easy_band)
283         damage = (damage + 1) / 2;
284
285     if (damage_type != DAMAGE_USELIFE) {
286         disturb(creature_ptr, TRUE, TRUE);
287         if (auto_more) {
288             creature_ptr->now_damaged = TRUE;
289         }
290     }
291
292     if ((damage_type != DAMAGE_USELIFE) && (damage_type != DAMAGE_LOSELIFE)) {
293         if (is_invuln(creature_ptr) && (damage < 9000)) {
294             if (damage_type == DAMAGE_FORCE) {
295                 msg_print(_("バリアが切り裂かれた!", "The attack cuts your shield of invulnerability open!"));
296             } else if (one_in_(PENETRATE_INVULNERABILITY)) {
297                 msg_print(_("無敵のバリアを破って攻撃された!", "The attack penetrates your shield of invulnerability!"));
298             } else {
299                 return 0;
300             }
301         }
302
303         if (check_multishadow(creature_ptr)) {
304             if (damage_type == DAMAGE_FORCE) {
305                 msg_print(_("幻影もろとも体が切り裂かれた!", "The attack hits Shadow together with you!"));
306             } else if (damage_type == DAMAGE_ATTACK) {
307                 msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, but you are unharmed!"));
308                 return 0;
309             }
310         }
311
312         if (creature_ptr->wraith_form) {
313             if (damage_type == DAMAGE_FORCE) {
314                 msg_print(_("半物質の体が切り裂かれた!", "The attack cuts through your ethereal body!"));
315             } else {
316                 damage /= 2;
317                 if ((damage == 0) && one_in_(2))
318                     damage = 1;
319             }
320         }
321
322         if (creature_ptr->special_defense & KATA_MUSOU) {
323             damage /= 2;
324             if ((damage == 0) && one_in_(2))
325                 damage = 1;
326         }
327     }
328
329     creature_ptr->chp -= damage;
330     if (damage_type == DAMAGE_GENO && creature_ptr->chp < 0) {
331         damage += creature_ptr->chp;
332         creature_ptr->chp = 0;
333     }
334
335     creature_ptr->redraw |= PR_HP;
336     creature_ptr->window_flags |= PW_PLAYER;
337
338     if (damage_type != DAMAGE_GENO && creature_ptr->chp == 0) {
339         chg_virtue(creature_ptr, V_SACRIFICE, 1);
340         chg_virtue(creature_ptr, V_CHANCE, 2);
341     }
342
343     if (creature_ptr->chp < 0) {
344         bool android = (creature_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
345
346 #ifdef JP
347         /* 死んだ時に強制終了して死を回避できなくしてみた by Habu */
348         if (!cheat_save && !save_player(creature_ptr, SAVE_TYPE_CLOSE_GAME))
349             msg_print("セーブ失敗!");
350 #endif
351
352         sound(SOUND_DEATH);
353         chg_virtue(creature_ptr, V_SACRIFICE, 10);
354         handle_stuff(creature_ptr);
355         creature_ptr->leaving = TRUE;
356         creature_ptr->is_dead = TRUE;
357         if (creature_ptr->current_floor_ptr->inside_arena) {
358             concptr m_name = r_info[arena_info[creature_ptr->arena_number].r_idx].name.c_str();
359             msg_format(_("あなたは%sの前に敗れ去った。", "You are beaten by %s."), m_name);
360             msg_print(NULL);
361             if (record_arena)
362                 exe_write_diary(creature_ptr, DIARY_ARENA, -1 - creature_ptr->arena_number, m_name);
363         } else {
364             QUEST_IDX q_idx = quest_number(creature_ptr, creature_ptr->current_floor_ptr->dun_level);
365             bool seppuku = streq(hit_from, "Seppuku");
366             bool winning_seppuku = current_world_ptr->total_winner && seppuku;
367
368             play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_GAMEOVER);
369
370 #ifdef WORLD_SCORE
371             screen_dump = make_screen_dump(creature_ptr, process_autopick_file_command);
372 #endif
373             if (seppuku) {
374                 strcpy(creature_ptr->died_from, hit_from);
375 #ifdef JP
376                 if (!winning_seppuku)
377                     strcpy(creature_ptr->died_from, "切腹");
378 #endif
379             } else {
380                 char dummy[1024];
381 #ifdef JP
382                 sprintf(dummy, "%s%s%s", !creature_ptr->paralyzed ? "" : creature_ptr->free_act ? "彫像状態で" : "麻痺状態で",
383                     creature_ptr->image ? "幻覚に歪んだ" : "", hit_from);
384 #else
385                 sprintf(dummy, "%s%s", hit_from, !creature_ptr->paralyzed ? "" : " while helpless");
386 #endif
387                 angband_strcpy(creature_ptr->died_from, dummy, sizeof creature_ptr->died_from);
388             }
389
390             current_world_ptr->total_winner = FALSE;
391             if (winning_seppuku) {
392                 exe_write_diary(creature_ptr, DIARY_DESCRIPTION, 0, _("勝利の後切腹した。", "committed seppuku after the winning."));
393             } else {
394                 char buf[20];
395
396                 if (creature_ptr->current_floor_ptr->inside_arena)
397                     strcpy(buf, _("アリーナ", "in the Arena"));
398                 else if (!is_in_dungeon(creature_ptr))
399                     strcpy(buf, _("地上", "on the surface"));
400                 else if (q_idx && (is_fixed_quest_idx(q_idx) && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
401                     strcpy(buf, _("クエスト", "in a quest"));
402                 else
403                     sprintf(buf, _("%d階", "level %d"), (int)creature_ptr->current_floor_ptr->dun_level);
404
405                 sprintf(tmp, _("%sで%sに殺された。", "killed by %s %s."), buf, creature_ptr->died_from);
406                 exe_write_diary(creature_ptr, DIARY_DESCRIPTION, 0, tmp);
407             }
408
409             exe_write_diary(creature_ptr, DIARY_GAMESTART, 1, _("-------- ゲームオーバー --------", "--------   Game  Over   --------"));
410             exe_write_diary(creature_ptr, DIARY_DESCRIPTION, 1, "\n\n\n\n");
411             flush();
412             if (get_check_strict(creature_ptr, _("画面を保存しますか?", "Dump the screen? "), CHECK_NO_HISTORY))
413                 do_cmd_save_screen(creature_ptr, process_autopick_file_command);
414
415             flush();
416             if (creature_ptr->last_message)
417                 string_free(creature_ptr->last_message);
418
419             creature_ptr->last_message = NULL;
420             if (!last_words) {
421 #ifdef JP
422                 msg_format("あなたは%sました。", android ? "壊れ" : "死に");
423 #else
424                 msg_print(android ? "You are broken." : "You die.");
425 #endif
426
427                 msg_print(NULL);
428             } else {
429                 if (winning_seppuku) {
430                     get_rnd_line(_("seppuku_j.txt", "seppuku.txt"), 0, death_message);
431                 } else {
432                     get_rnd_line(_("death_j.txt", "death.txt"), 0, death_message);
433                 }
434
435                 do {
436 #ifdef JP
437                     while (!get_string(winning_seppuku ? "辞世の句: " : "断末魔の叫び: ", death_message, sizeof(death_message)))
438                         ;
439 #else
440                     while (!get_string("Last words: ", death_message, 1024))
441                         ;
442 #endif
443                 } while (winning_seppuku && !get_check_strict(creature_ptr, _("よろしいですか?", "Are you sure? "), CHECK_NO_HISTORY));
444
445                 if (death_message[0] == '\0') {
446 #ifdef JP
447                     strcpy(death_message, format("あなたは%sました。", android ? "壊れ" : "死に"));
448 #else
449                     strcpy(death_message, android ? "You are broken." : "You die.");
450 #endif
451                 } else
452                     creature_ptr->last_message = string_make(death_message);
453
454 #ifdef JP
455                 if (winning_seppuku) {
456                     int i, len;
457                     int w = Term->wid;
458                     int h = Term->hgt;
459                     int msg_pos_x[9] = { 5, 7, 9, 12, 14, 17, 19, 21, 23 };
460                     int msg_pos_y[9] = { 3, 4, 5, 4, 5, 4, 5, 6, 4 };
461                     concptr str;
462                     char *str2;
463
464                     term_clear();
465
466                     /* 桜散る */
467                     for (i = 0; i < 40; i++)
468                         term_putstr(randint0(w / 2) * 2, randint0(h), 2, TERM_VIOLET, "υ");
469
470                     str = death_message;
471                     if (strncmp(str, "「", 2) == 0)
472                         str += 2;
473
474                     str2 = angband_strstr(str, "」");
475                     if (str2 != NULL)
476                         *str2 = '\0';
477
478                     i = 0;
479                     while (i < 9) {
480                         str2 = angband_strstr(str, " ");
481                         if (str2 == NULL)
482                             len = strlen(str);
483                         else
484                             len = str2 - str;
485
486                         if (len != 0) {
487                             term_putstr_v(w * 3 / 4 - 2 - msg_pos_x[i] * 2, msg_pos_y[i], len, TERM_WHITE, str);
488                             if (str2 == NULL)
489                                 break;
490                             i++;
491                         }
492                         str = str2 + 1;
493                         if (*str == 0)
494                             break;
495                     }
496
497                     term_putstr(w - 1, h - 1, 1, TERM_WHITE, " ");
498                     flush();
499 #ifdef WORLD_SCORE
500                     screen_dump = make_screen_dump(creature_ptr, process_autopick_file_command);
501 #endif
502                     (void)inkey();
503                 } else
504 #endif
505                     msg_print(death_message);
506             }
507         }
508
509         return damage;
510     }
511
512     handle_stuff(creature_ptr);
513     if (creature_ptr->chp < warning) {
514         if (old_chp > warning)
515             bell();
516
517         sound(SOUND_WARN);
518         if (record_danger && (old_chp > warning)) {
519             if (creature_ptr->image && damage_type == DAMAGE_ATTACK)
520                 hit_from = _("何か", "something");
521
522             sprintf(tmp, _("%sによってピンチに陥った。", "was in a critical situation because of %s."), hit_from);
523             exe_write_diary(creature_ptr, DIARY_DESCRIPTION, 0, tmp);
524         }
525
526         if (auto_more)
527             creature_ptr->now_damaged = TRUE;
528
529         msg_print(_("*** 警告:低ヒット・ポイント! ***", "*** LOW HITPOINT WARNING! ***"));
530         msg_print(NULL);
531         flush();
532     }
533
534     if (creature_ptr->wild_mode && !creature_ptr->leaving && (creature_ptr->chp < MAX(warning, creature_ptr->mhp / 5)))
535         change_wild_mode(creature_ptr, FALSE);
536
537     return damage;
538 }
539
540 /*!
541  * @brief 属性に応じた敵オーラによるプレイヤーのダメージ処理
542  * @param m_ptr オーラを持つモンスターの構造体参照ポインタ
543  * @param immune ダメージを回避できる免疫フラグ
544  * @param flags_offset オーラフラグ配列の参照オフセット
545  * @param r_flags_offset モンスターの耐性配列の参照オフセット
546  * @param aura_flag オーラフラグ配列
547  * @param dam_func ダメージ処理を行う関数の参照ポインタ
548  * @param message オーラダメージを受けた際のメッセージ
549  * @return なし
550  */
551 static void process_aura_damage(monster_type *m_ptr, player_type *touched_ptr, bool immune, int flags_offset, int r_flags_offset, u32b aura_flag,
552     HIT_POINT (*dam_func)(player_type *creature_type, HIT_POINT dam, concptr kb_str, int monspell, bool aura), concptr message)
553 {
554     monster_race *r_ptr = &r_info[m_ptr->r_idx];
555     if (!(atoffset(BIT_FLAGS, r_ptr, flags_offset) & aura_flag) || immune)
556         return;
557
558     GAME_TEXT mon_name[MAX_NLEN];
559     int aura_damage = damroll(1 + (r_ptr->level / 26), 1 + (r_ptr->level / 17));
560
561     monster_desc(touched_ptr, mon_name, m_ptr, MD_WRONGDOER_NAME);
562     msg_print(message);
563     dam_func(touched_ptr, aura_damage, mon_name, -1, TRUE);
564
565     if (is_original_ap_and_seen(touched_ptr, m_ptr))
566         atoffset(BIT_FLAGS, r_ptr, r_flags_offset) |= aura_flag;
567
568     handle_stuff(touched_ptr);
569 }
570
571 /*!
572  * @brief 敵オーラによるプレイヤーのダメージ処理
573  * @param m_ptr オーラを持つモンスターの構造体参照ポインタ
574  * @param touched_ptr オーラを持つ相手に振れたクリーチャーの参照ポインタ
575  * @return なし
576  */
577 void touch_zap_player(monster_type *m_ptr, player_type *touched_ptr)
578 {
579     process_aura_damage(m_ptr, touched_ptr, (bool)has_immune_fire(touched_ptr), offsetof(monster_race, flags2), offsetof(monster_race, r_flags2), RF2_AURA_FIRE,
580         fire_dam, _("突然とても熱くなった!", "You are suddenly very hot!"));
581     process_aura_damage(m_ptr, touched_ptr, (bool)has_immune_cold(touched_ptr), offsetof(monster_race, flags3), offsetof(monster_race, r_flags3), RF3_AURA_COLD,
582         cold_dam, _("突然とても寒くなった!", "You are suddenly very cold!"));
583     process_aura_damage(m_ptr, touched_ptr, (bool)has_immune_elec(touched_ptr), offsetof(monster_race, flags2), offsetof(monster_race, r_flags2), RF2_AURA_ELEC,
584         elec_dam, _("電撃をくらった!", "You get zapped!"));
585 }