OSDN Git Service

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