OSDN Git Service

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