OSDN Git Service

[Fix] term_putstr_v() を z-term.c に移動. / Move term_putstr_v() to z-term.c.
[hengband/hengband.git] / src / object / warning.c
1 #include "object/warning.h"
2 #include "art-definition/art-sword-types.h"
3 #include "core/asking-player.h"
4 #include "core/disturbance.h"
5 #include "dungeon/dungeon-flag-types.h"
6 #include "dungeon/dungeon.h"
7 #include "flavor/flavor-describer.h"
8 #include "flavor/object-flavor-types.h"
9 #include "floor/cave.h"
10 #include "game-option/input-options.h"
11 #include "grid/feature.h"
12 #include "grid/grid.h"
13 #include "inventory/inventory-slot-types.h"
14 #include "monster-attack/monster-attack-effect.h"
15 #include "monster-attack/monster-attack-types.h"
16 #include "monster-race/monster-race.h"
17 #include "monster-race/race-flags-ability1.h"
18 #include "monster-race/race-flags-ability2.h"
19 #include "monster-race/race-flags1.h"
20 #include "monster-race/race-flags4.h"
21 #include "monster-race/race-indice-types.h"
22 #include "monster/monster-info.h"
23 #include "monster/monster-status.h"
24 #include "mspell/mspell-damage-calculator.h"
25 #include "mspell/mspell-type.h"
26 #include "mutation/mutation-flag-types.h"
27 #include "object-enchant/tr-types.h"
28 #include "object/object-flags.h"
29 #include "player/mimic-info-table.h"
30 #include "player/player-class.h"
31 #include "player/player-race-types.h"
32 #include "player/special-defense-types.h"
33 #include "player/player-status-flags.h"
34 #include "spell/spell-types.h"
35 #include "status/element-resistance.h"
36 #include "system/floor-type-definition.h"
37 #include "target/projection-path-calculator.h"
38 #include "util/bit-flags-calculator.h"
39 #include "view/display-messages.h"
40
41 /*!
42  * @brief 警告を放つアイテムを選択する /
43  * Choose one of items that have warning flag
44  * Calculate spell damages
45  * @return 警告を行う
46  */
47 object_type *choose_warning_item(player_type *creature_ptr)
48 {
49     int choices[INVEN_TOTAL - INVEN_RARM];
50
51     /* Paranoia -- Player has no warning ability */
52     if (!creature_ptr->warning)
53         return NULL;
54
55     /* Search Inventory */
56     int number = 0;
57     for (inventory_slot_type i = INVEN_RARM; i < INVEN_TOTAL; i++) {
58         BIT_FLAGS flgs[TR_FLAG_SIZE];
59         object_type *o_ptr = &creature_ptr->inventory_list[i];
60
61         object_flags(creature_ptr, o_ptr, flgs);
62         if (has_flag(flgs, TR_WARNING)) {
63             choices[number] = i;
64             number++;
65         }
66     }
67
68     /* Choice one of them */
69     return number ? &creature_ptr->inventory_list[choices[randint0(number)]] : NULL;
70 }
71
72 /*!
73  * @brief 警告基準を定めるために魔法の効果属性に基づいて最大魔法ダメージを計算する /
74  * Calculate spell damages
75  * @param m_ptr 魔法を行使するモンスターの構造体参照ポインタ
76  * @param typ 効果属性のID
77  * @param dam 基本ダメージ
78  * @param max 算出した最大ダメージを返すポインタ
79  * @return なし
80  */
81 static void spell_damcalc(player_type *target_ptr, monster_type *m_ptr, EFFECT_ID typ, HIT_POINT dam, int *max)
82 {
83     monster_race *r_ptr = &r_info[m_ptr->r_idx];
84     int rlev = r_ptr->level;
85     bool ignore_wraith_form = FALSE;
86
87     /* Vulnerability, resistance and immunity */
88     switch (typ) {
89     case GF_ELEC:
90         if (is_immune_elec(target_ptr)) {
91             dam = 0;
92             ignore_wraith_form = TRUE;
93             break;
94         }
95         dam = dam * calc_vuln_elec_rate(target_ptr) / 100;
96         if (target_ptr->resist_elec)
97             dam = (dam + 2) / 3;
98         if (is_oppose_elec(target_ptr))
99             dam = (dam + 2) / 3;
100         break;
101
102     case GF_POIS:
103         if (target_ptr->resist_pois)
104             dam = (dam + 2) / 3;
105         if (is_oppose_pois(target_ptr))
106             dam = (dam + 2) / 3;
107         break;
108
109     case GF_ACID:
110         if (is_immune_acid(target_ptr)) {
111             dam = 0;
112             ignore_wraith_form = TRUE;
113             break;
114         }
115
116         dam = dam * calc_vuln_acid_rate(target_ptr) / 100;
117         if (target_ptr->resist_acid)
118             dam = (dam + 2) / 3;
119         if (is_oppose_acid(target_ptr))
120             dam = (dam + 2) / 3;
121         break;
122
123     case GF_COLD:
124     case GF_ICE:
125         if (is_immune_cold(target_ptr)) {
126             dam = 0;
127             ignore_wraith_form = TRUE;
128             break;
129         }
130         dam = dam * calc_vuln_cold_rate(target_ptr) / 100;
131         if (target_ptr->resist_cold)
132             dam = (dam + 2) / 3;
133         if (is_oppose_cold(target_ptr))
134             dam = (dam + 2) / 3;
135         break;
136
137     case GF_FIRE:
138         if (is_immune_fire(target_ptr)) {
139             dam = 0;
140             ignore_wraith_form = TRUE;
141             break;
142         }
143         dam = dam * calc_vuln_fire_rate(target_ptr) / 100;
144         if (target_ptr->resist_fire)
145             dam = (dam + 2) / 3;
146         if (is_oppose_fire(target_ptr))
147             dam = (dam + 2) / 3;
148         break;
149
150     case GF_PSY_SPEAR:
151         ignore_wraith_form = TRUE;
152         break;
153
154     case GF_ARROW:
155         if (!target_ptr->blind
156             && ((target_ptr->inventory_list[INVEN_RARM].k_idx && (target_ptr->inventory_list[INVEN_RARM].name1 == ART_ZANTETSU))
157                 || (target_ptr->inventory_list[INVEN_LARM].k_idx && (target_ptr->inventory_list[INVEN_LARM].name1 == ART_ZANTETSU)))) {
158             dam = 0;
159             ignore_wraith_form = TRUE;
160         }
161
162         break;
163
164     case GF_LITE:
165         if (target_ptr->resist_lite)
166             dam /= 2; /* Worst case of 4 / (d4 + 7) */
167         dam = dam * calc_vuln_lite_rate(target_ptr) / 100;
168         break;
169
170     case GF_DARK:
171         if (is_specific_player_race(target_ptr, RACE_VAMPIRE) || (target_ptr->mimic_form == MIMIC_VAMPIRE) || target_ptr->wraith_form) {
172             dam = 0;
173             ignore_wraith_form = TRUE;
174         } else if (target_ptr->resist_dark)
175             dam /= 2; /* Worst case of 4 / (d4 + 7) */
176         break;
177
178     case GF_SHARDS:
179         if (target_ptr->resist_shard)
180             dam = dam * 3 / 4; /* Worst case of 6 / (d4 + 7) */
181         break;
182
183     case GF_SOUND:
184         if (target_ptr->resist_sound)
185             dam = dam * 5 / 8; /* Worst case of 5 / (d4 + 7) */
186         break;
187
188     case GF_CONFUSION:
189         if (target_ptr->resist_conf)
190             dam = dam * 5 / 8; /* Worst case of 5 / (d4 + 7) */
191         break;
192
193     case GF_CHAOS:
194         if (target_ptr->resist_chaos)
195             dam = dam * 3 / 4; /* Worst case of 6 / (d4 + 7) */
196         break;
197
198     case GF_NETHER:
199         if (is_specific_player_race(target_ptr, RACE_SPECTRE)) {
200             dam = 0;
201             ignore_wraith_form = TRUE;
202         } else if (target_ptr->resist_neth)
203             dam = dam * 3 / 4; /* Worst case of 6 / (d4 + 7) */
204         break;
205
206     case GF_DISENCHANT:
207         if (target_ptr->resist_disen)
208             dam = dam * 3 / 4; /* Worst case of 6 / (d4 + 7) */
209         break;
210
211     case GF_NEXUS:
212         if (target_ptr->resist_nexus)
213             dam = dam * 3 / 4; /* Worst case of 6 / (d4 + 7) */
214         break;
215
216     case GF_TIME:
217         if (target_ptr->resist_time)
218             dam /= 2; /* Worst case of 4 / (d4 + 7) */
219         break;
220
221     case GF_GRAVITY:
222         if (target_ptr->levitation)
223             dam = (dam * 2) / 3;
224         break;
225
226     case GF_ROCKET:
227         if (target_ptr->resist_shard)
228             dam /= 2;
229         break;
230
231     case GF_NUKE:
232         if (target_ptr->resist_pois)
233             dam = (2 * dam + 2) / 5;
234         if (is_oppose_pois(target_ptr))
235             dam = (2 * dam + 2) / 5;
236         break;
237
238     case GF_DEATH_RAY:
239         if (target_ptr->mimic_form) {
240             if (mimic_info[target_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING) {
241                 dam = 0;
242                 ignore_wraith_form = TRUE;
243             }
244
245             break;
246         }
247
248         switch (target_ptr->prace) {
249         case RACE_GOLEM:
250         case RACE_SKELETON:
251         case RACE_ZOMBIE:
252         case RACE_VAMPIRE:
253         case RACE_BALROG:
254         case RACE_SPECTRE:
255             dam = 0;
256             ignore_wraith_form = TRUE;
257             break;
258         }
259
260         break;
261
262     case GF_HOLY_FIRE:
263         if (target_ptr->align > 10)
264             dam /= 2;
265         else if (target_ptr->align < -10)
266             dam *= 2;
267         break;
268
269     case GF_HELL_FIRE:
270         if (target_ptr->align > 10)
271             dam *= 2;
272         break;
273
274     case GF_MIND_BLAST:
275     case GF_BRAIN_SMASH:
276         if (100 + rlev / 2 <= MAX(5, target_ptr->skill_sav)) {
277             dam = 0;
278             ignore_wraith_form = TRUE;
279         }
280
281         break;
282
283     case GF_CAUSE_1:
284     case GF_CAUSE_2:
285     case GF_CAUSE_3:
286     case GF_HAND_DOOM:
287         if (100 + rlev / 2 <= target_ptr->skill_sav) {
288             dam = 0;
289             ignore_wraith_form = TRUE;
290         }
291
292         break;
293
294     case GF_CAUSE_4:
295         if ((100 + rlev / 2 <= target_ptr->skill_sav) && (m_ptr->r_idx != MON_KENSHIROU)) {
296             dam = 0;
297             ignore_wraith_form = TRUE;
298         }
299
300         break;
301     }
302
303     if (target_ptr->wraith_form && !ignore_wraith_form) {
304         dam /= 2;
305         if (!dam)
306             dam = 1;
307     }
308
309     if (dam > *max)
310         *max = dam;
311 }
312
313 /*!
314  * @brief 警告基準を定めるために魔法の効果属性に基づいて最大魔法ダメージを計算する。 /
315  * Calculate spell damages
316  * @param spell_num RF4ならRF4_SPELL_STARTのように32区切りのベースとなる数値
317  * @param typ 効果属性のID
318  * @param m_idx 魔法を行使するモンスターのID
319  * @param max 算出した最大ダメージを返すポインタ
320  * @return なし
321  */
322 void spell_damcalc_by_spellnum(player_type *creature_ptr, monster_spell_type ms_type, EFFECT_ID typ, MONSTER_IDX m_idx, int *max)
323 {
324     monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[m_idx];
325     HIT_POINT dam = monspell_damage(creature_ptr, ms_type, m_idx, DAM_MAX);
326     spell_damcalc(creature_ptr, m_ptr, typ, dam, max);
327 }
328
329 /*!
330  * @brief 警告基準を定めるためにモンスターの打撃最大ダメージを算出する /
331  * Calculate blow damages
332  * @param m_ptr 打撃を行使するモンスターの構造体参照ポインタ
333  * @param blow_ptr モンスターの打撃能力の構造体参照ポインタ
334  * @return 算出された最大ダメージを返す。
335  */
336 static int blow_damcalc(monster_type *m_ptr, player_type *target_ptr, monster_blow *blow_ptr)
337 {
338     int dam = blow_ptr->d_dice * blow_ptr->d_side;
339     int dummy_max = 0;
340
341     if (blow_ptr->method == RBM_EXPLODE) {
342         dam = (dam + 1) / 2;
343         spell_damcalc(target_ptr, m_ptr, mbe_info[blow_ptr->effect].explode_type, dam, &dummy_max);
344         dam = dummy_max;
345         return dam;
346     }
347
348     ARMOUR_CLASS ac = target_ptr->ac + target_ptr->to_a;
349     bool check_wraith_form = TRUE;
350     switch (blow_ptr->effect) {
351     case RBE_SUPERHURT: {
352         int tmp_dam = dam - (dam * ((ac < 150) ? ac : 150) / 250);
353         dam = MAX(dam, tmp_dam * 2);
354         break;
355     }
356
357     case RBE_HURT:
358     case RBE_SHATTER:
359         dam -= (dam * ((ac < 150) ? ac : 150) / 250);
360         break;
361
362     case RBE_ACID:
363         spell_damcalc(target_ptr, m_ptr, GF_ACID, dam, &dummy_max);
364         dam = dummy_max;
365         check_wraith_form = FALSE;
366         break;
367
368     case RBE_ELEC:
369         spell_damcalc(target_ptr, m_ptr, GF_ELEC, dam, &dummy_max);
370         dam = dummy_max;
371         check_wraith_form = FALSE;
372         break;
373
374     case RBE_FIRE:
375         spell_damcalc(target_ptr, m_ptr, GF_FIRE, dam, &dummy_max);
376         dam = dummy_max;
377         check_wraith_form = FALSE;
378         break;
379
380     case RBE_COLD:
381         spell_damcalc(target_ptr, m_ptr, GF_COLD, dam, &dummy_max);
382         dam = dummy_max;
383         check_wraith_form = FALSE;
384         break;
385
386     case RBE_DR_MANA:
387         dam = 0;
388         check_wraith_form = FALSE;
389         break;
390     }
391
392     if (check_wraith_form && target_ptr->wraith_form) {
393         dam /= 2;
394         if (!dam)
395             dam = 1;
396     }
397
398     return dam;
399 }
400
401 /*!
402  * @brief プレイヤーが特定地点へ移動した場合に警告を発する処理 /
403  * Examine the grid (xx,yy) and warn the player if there are any danger
404  * @param xx 危険性を調査するマスのX座標
405  * @param yy 危険性を調査するマスのY座標
406  * @return 警告を無視して進むことを選択するかか問題が無ければTRUE、警告に従ったならFALSEを返す。
407  */
408 bool process_warning(player_type *creature_ptr, POSITION xx, POSITION yy)
409 {
410     POSITION mx, my;
411     grid_type *g_ptr;
412     GAME_TEXT o_name[MAX_NLEN];
413
414 #define WARNING_AWARE_RANGE 12
415     int dam_max = 0;
416     static int old_damage = 0;
417
418     for (mx = xx - WARNING_AWARE_RANGE; mx < xx + WARNING_AWARE_RANGE + 1; mx++) {
419         for (my = yy - WARNING_AWARE_RANGE; my < yy + WARNING_AWARE_RANGE + 1; my++) {
420             int dam_max0 = 0;
421             monster_type *m_ptr;
422             monster_race *r_ptr;
423
424             if (!in_bounds(creature_ptr->current_floor_ptr, my, mx) || (distance(my, mx, yy, xx) > WARNING_AWARE_RANGE))
425                 continue;
426
427             g_ptr = &creature_ptr->current_floor_ptr->grid_array[my][mx];
428
429             if (!g_ptr->m_idx)
430                 continue;
431
432             m_ptr = &creature_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
433
434             if (monster_csleep_remaining(m_ptr))
435                 continue;
436             if (!is_hostile(m_ptr))
437                 continue;
438
439             r_ptr = &r_info[m_ptr->r_idx];
440
441             /* Monster spells (only powerful ones)*/
442             if (projectable(creature_ptr, my, mx, yy, xx)) {
443                 BIT_FLAGS f4 = r_ptr->flags4;
444                 BIT_FLAGS f5 = r_ptr->a_ability_flags1;
445                 BIT_FLAGS f6 = r_ptr->a_ability_flags2;
446
447                 if (!(d_info[creature_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC)) {
448                     if (f4 & RF4_BA_CHAO)
449                         spell_damcalc_by_spellnum(creature_ptr, MS_BALL_CHAOS, GF_CHAOS, g_ptr->m_idx, &dam_max0);
450                     if (f5 & RF5_BA_MANA)
451                         spell_damcalc_by_spellnum(creature_ptr, MS_BALL_MANA, GF_MANA, g_ptr->m_idx, &dam_max0);
452                     if (f5 & RF5_BA_DARK)
453                         spell_damcalc_by_spellnum(creature_ptr, MS_BALL_DARK, GF_DARK, g_ptr->m_idx, &dam_max0);
454                     if (f5 & RF5_BA_LITE)
455                         spell_damcalc_by_spellnum(creature_ptr, MS_STARBURST, GF_LITE, g_ptr->m_idx, &dam_max0);
456                     if (f6 & RF6_HAND_DOOM)
457                         spell_damcalc_by_spellnum(creature_ptr, MS_HAND_DOOM, GF_HAND_DOOM, g_ptr->m_idx, &dam_max0);
458                     if (f6 & RF6_PSY_SPEAR)
459                         spell_damcalc_by_spellnum(creature_ptr, MS_PSY_SPEAR, GF_PSY_SPEAR, g_ptr->m_idx, &dam_max0);
460                 }
461
462                 if (f4 & RF4_ROCKET)
463                     spell_damcalc_by_spellnum(creature_ptr, MS_ROCKET, GF_ROCKET, g_ptr->m_idx, &dam_max0);
464                 if (f4 & RF4_BR_ACID)
465                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_ACID, GF_ACID, g_ptr->m_idx, &dam_max0);
466                 if (f4 & RF4_BR_ELEC)
467                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_ELEC, GF_ELEC, g_ptr->m_idx, &dam_max0);
468                 if (f4 & RF4_BR_FIRE)
469                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_FIRE, GF_FIRE, g_ptr->m_idx, &dam_max0);
470                 if (f4 & RF4_BR_COLD)
471                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_COLD, GF_COLD, g_ptr->m_idx, &dam_max0);
472                 if (f4 & RF4_BR_POIS)
473                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_POIS, GF_POIS, g_ptr->m_idx, &dam_max0);
474                 if (f4 & RF4_BR_NETH)
475                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_NETHER, GF_NETHER, g_ptr->m_idx, &dam_max0);
476                 if (f4 & RF4_BR_LITE)
477                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_LITE, GF_LITE, g_ptr->m_idx, &dam_max0);
478                 if (f4 & RF4_BR_DARK)
479                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_DARK, GF_DARK, g_ptr->m_idx, &dam_max0);
480                 if (f4 & RF4_BR_CONF)
481                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_CONF, GF_CONFUSION, g_ptr->m_idx, &dam_max0);
482                 if (f4 & RF4_BR_SOUN)
483                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_SOUND, GF_SOUND, g_ptr->m_idx, &dam_max0);
484                 if (f4 & RF4_BR_CHAO)
485                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_CHAOS, GF_CHAOS, g_ptr->m_idx, &dam_max0);
486                 if (f4 & RF4_BR_DISE)
487                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_DISEN, GF_DISENCHANT, g_ptr->m_idx, &dam_max0);
488                 if (f4 & RF4_BR_NEXU)
489                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_NEXUS, GF_NEXUS, g_ptr->m_idx, &dam_max0);
490                 if (f4 & RF4_BR_TIME)
491                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_TIME, GF_TIME, g_ptr->m_idx, &dam_max0);
492                 if (f4 & RF4_BR_INER)
493                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_INERTIA, GF_INERTIAL, g_ptr->m_idx, &dam_max0);
494                 if (f4 & RF4_BR_GRAV)
495                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_GRAVITY, GF_GRAVITY, g_ptr->m_idx, &dam_max0);
496                 if (f4 & RF4_BR_SHAR)
497                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_SHARDS, GF_SHARDS, g_ptr->m_idx, &dam_max0);
498                 if (f4 & RF4_BR_PLAS)
499                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_PLASMA, GF_PLASMA, g_ptr->m_idx, &dam_max0);
500                 if (f4 & RF4_BR_WALL)
501                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_FORCE, GF_FORCE, g_ptr->m_idx, &dam_max0);
502                 if (f4 & RF4_BR_MANA)
503                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_MANA, GF_MANA, g_ptr->m_idx, &dam_max0);
504                 if (f4 & RF4_BR_NUKE)
505                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_NUKE, GF_NUKE, g_ptr->m_idx, &dam_max0);
506                 if (f4 & RF4_BR_DISI)
507                     spell_damcalc_by_spellnum(creature_ptr, MS_BR_DISI, GF_DISINTEGRATE, g_ptr->m_idx, &dam_max0);
508             }
509
510             /* Monster melee attacks */
511             if ((r_ptr->flags1 & RF1_NEVER_BLOW) || (d_info[creature_ptr->dungeon_idx].flags1 & DF1_NO_MELEE)) {
512                 dam_max += dam_max0;
513                 continue;
514             }
515
516             if (!(mx <= xx + 1 && mx >= xx - 1 && my <= yy + 1 && my >= yy - 1)) {
517                 dam_max += dam_max0;
518                 continue;
519             }
520
521             int dam_melee = 0;
522             for (int m = 0; m < 4; m++) {
523                 /* Skip non-attacks */
524                 if (!r_ptr->blow[m].method || (r_ptr->blow[m].method == RBM_SHOOT))
525                     continue;
526
527                 /* Extract the attack info */
528                 dam_melee += blow_damcalc(m_ptr, creature_ptr, &r_ptr->blow[m]);
529                 if (r_ptr->blow[m].method == RBM_EXPLODE)
530                     break;
531             }
532
533             if (dam_melee > dam_max0)
534                 dam_max0 = dam_melee;
535             dam_max += dam_max0;
536         }
537     }
538
539     /* Prevent excessive warning */
540     if (dam_max > old_damage) {
541         old_damage = dam_max * 3 / 2;
542
543         if (dam_max > creature_ptr->chp / 2) {
544             object_type *o_ptr = choose_warning_item(creature_ptr);
545
546             if (o_ptr)
547                 describe_flavor(creature_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
548             else
549                 strcpy(o_name, _("体", "body")); /* Warning ability without item */
550             msg_format(_("%sが鋭く震えた!", "Your %s pulsates sharply!"), o_name);
551
552             disturb(creature_ptr, FALSE, TRUE);
553             return get_check(_("本当にこのまま進むか?", "Really want to go ahead? "));
554         }
555     } else
556         old_damage = old_damage / 2;
557
558     g_ptr = &creature_ptr->current_floor_ptr->grid_array[yy][xx];
559     bool is_warning = (!easy_disarm && is_trap(creature_ptr, g_ptr->feat)) || (g_ptr->mimic && is_trap(creature_ptr, g_ptr->feat));
560     is_warning &= !one_in_(13);
561     if (!is_warning)
562         return TRUE;
563
564     object_type *o_ptr = choose_warning_item(creature_ptr);
565     if (o_ptr != NULL)
566         describe_flavor(creature_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
567     else
568         strcpy(o_name, _("体", "body")); /* Warning ability without item */
569     msg_format(_("%sが鋭く震えた!", "Your %s pulsates sharply!"), o_name);
570     disturb(creature_ptr, FALSE, TRUE);
571     return get_check(_("本当にこのまま進むか?", "Really want to go ahead? "));
572 }