OSDN Git Service

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