OSDN Git Service

[FIx] 未鑑定の罠感知のロッド等を使用して罠が感知されたときに未感知エリアにならない #611
[hengbandforosx/hengbandosx.git] / src / spell-kind / spells-detection.cpp
1 #include "spell-kind/spells-detection.h"
2 #include "core/window-redrawer.h"
3 #include "dungeon/dungeon-flag-types.h"
4 #include "dungeon/dungeon.h"
5 #include "floor/cave.h"
6 #include "floor/floor-save-util.h"
7 #include "grid/grid.h"
8 #include "grid/trap.h"
9 #include "monster-race/monster-race.h"
10 #include "monster-race/race-flags2.h"
11 #include "monster-race/race-flags3.h"
12 #include "monster-race/monster-race-hook.h"
13 #include "monster/monster-flag-types.h"
14 #include "monster/monster-info.h"
15 #include "monster/monster-status.h"
16 #include "monster/monster-update.h"
17 #include "object-hook/hook-checker.h"
18 #include "object-hook/hook-enchant.h"
19 #include "object/object-mark-types.h"
20 #include "object/tval-types.h"
21 #include "realm/realm-song-numbers.h"
22 #include "realm/realm-song.h"
23 #include "system/floor-type-definition.h"
24 #include "system/object-type-definition.h"
25 #include "util/string-processor.h"
26 #include "view/display-messages.h"
27
28 /*!
29  * @brief プレイヤー周辺の地形を感知する
30  * @param caster_ptr プレーヤーへの参照ポインタ
31  * @param range 効果範囲
32  * @param flag 特定地形ID
33  * @param known 地形から危険フラグを外すならTRUE
34  * @return 効力があった場合TRUEを返す
35  */
36 static bool detect_feat_flag(player_type *caster_ptr, POSITION range, int flag, bool known)
37 {
38     if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
39         range /= 3;
40
41     grid_type *g_ptr;
42     bool detect = FALSE;
43     for (POSITION y = 1; y < caster_ptr->current_floor_ptr->height - 1; y++) {
44         for (POSITION x = 1; x <= caster_ptr->current_floor_ptr->width - 1; x++) {
45             int dist = distance(caster_ptr->y, caster_ptr->x, y, x);
46             if (dist > range)
47                 continue;
48             g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x];
49             if (flag == FF_TRAP) {
50                 /* Mark as detected */
51                 if (dist <= range && known) {
52                     if (dist <= range - 1)
53                         g_ptr->info |= (CAVE_IN_DETECT);
54
55                     g_ptr->info &= ~(CAVE_UNSAFE);
56
57                     lite_spot(caster_ptr, y, x);
58                 }
59             }
60
61             if (cave_has_flag_grid(g_ptr, flag)) {
62                 disclose_grid(caster_ptr, y, x);
63                 g_ptr->info |= (CAVE_MARK);
64                 lite_spot(caster_ptr, y, x);
65                 detect = TRUE;
66             }
67         }
68     }
69
70     return detect;
71 }
72
73 /*!
74  * @brief プレイヤー周辺のトラップを感知する / Detect all traps on current panel
75  * @param caster_ptr プレーヤーへの参照ポインタ
76  * @param range 効果範囲
77  * @param known 感知外範囲を超える警告フラグを立てる場合TRUEを返す
78  * @return 効力があった場合TRUEを返す
79  * @detail
80  * 吟遊詩人による感知についてはFALSEを返す
81  */
82 bool detect_traps(player_type *caster_ptr, POSITION range, bool known)
83 {
84     bool detect = detect_feat_flag(caster_ptr, range, FF_TRAP, known);
85     if (!known && detect)
86         detect_feat_flag(caster_ptr, range, FF_TRAP, true);
87
88     if (known || detect)
89         caster_ptr->dtrap = TRUE;
90
91     if (music_singing(caster_ptr, MUSIC_DETECT) && SINGING_COUNT(caster_ptr) > 0)
92         detect = FALSE;
93
94     if (detect)
95         msg_print(_("トラップの存在を感じとった!", "You sense the presence of traps!"));
96
97     return detect;
98 }
99
100 /*!
101  * @brief プレイヤー周辺のドアを感知する / Detect all doors on current panel
102  * @param caster_ptr プレーヤーへの参照ポインタ
103  * @param range 効果範囲
104  * @return 効力があった場合TRUEを返す
105  */
106 bool detect_doors(player_type *caster_ptr, POSITION range)
107 {
108     bool detect = detect_feat_flag(caster_ptr, range, FF_DOOR, TRUE);
109
110     if (music_singing(caster_ptr, MUSIC_DETECT) && SINGING_COUNT(caster_ptr) > 0)
111         detect = FALSE;
112     if (detect) {
113         msg_print(_("ドアの存在を感じとった!", "You sense the presence of doors!"));
114     }
115
116     return detect;
117 }
118
119 /*!
120  * @brief プレイヤー周辺の階段を感知する / Detect all stairs on current panel
121  * @param caster_ptr プレーヤーへの参照ポインタ
122  * @param range 効果範囲
123  * @return 効力があった場合TRUEを返す
124  */
125 bool detect_stairs(player_type *caster_ptr, POSITION range)
126 {
127     bool detect = detect_feat_flag(caster_ptr, range, FF_STAIRS, TRUE);
128
129     if (music_singing(caster_ptr, MUSIC_DETECT) && SINGING_COUNT(caster_ptr) > 0)
130         detect = FALSE;
131     if (detect) {
132         msg_print(_("階段の存在を感じとった!", "You sense the presence of stairs!"));
133     }
134
135     return detect;
136 }
137
138 /*!
139  * @brief プレイヤー周辺の地形財宝を感知する / Detect any treasure on the current panel
140  * @param caster_ptr プレーヤーへの参照ポインタ
141  * @param range 効果範囲
142  * @return 効力があった場合TRUEを返す
143  */
144 bool detect_treasure(player_type *caster_ptr, POSITION range)
145 {
146     bool detect = detect_feat_flag(caster_ptr, range, FF_HAS_GOLD, TRUE);
147
148     if (music_singing(caster_ptr, MUSIC_DETECT) && SINGING_COUNT(caster_ptr) > 6)
149         detect = FALSE;
150     if (detect) {
151         msg_print(_("埋蔵された財宝の存在を感じとった!", "You sense the presence of buried treasure!"));
152     }
153
154     return detect;
155 }
156 /*!
157  * @brief プレイヤー周辺のアイテム財宝を感知する / Detect all "gold" objects on the current panel
158  * @param caster_ptr プレーヤーへの参照ポインタ
159  * @param range 効果範囲
160  * @return 効力があった場合TRUEを返す
161  */
162 bool detect_objects_gold(player_type *caster_ptr, POSITION range)
163 {
164     POSITION range2 = range;
165     if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
166         range2 /= 3;
167
168     /* Scan objects */
169     bool detect = FALSE;
170     POSITION y, x;
171     for (OBJECT_IDX i = 1; i < caster_ptr->current_floor_ptr->o_max; i++) {
172         object_type *o_ptr = &caster_ptr->current_floor_ptr->o_list[i];
173
174         if (!object_is_valid(o_ptr))
175             continue;
176         if (object_is_held_monster(o_ptr))
177             continue;
178
179         y = o_ptr->iy;
180         x = o_ptr->ix;
181         if (distance(caster_ptr->y, caster_ptr->x, y, x) > range2)
182             continue;
183
184         if (o_ptr->tval == TV_GOLD) {
185             o_ptr->marked |= OM_FOUND;
186             lite_spot(caster_ptr, y, x);
187             detect = TRUE;
188         }
189     }
190
191     if (music_singing(caster_ptr, MUSIC_DETECT) && SINGING_COUNT(caster_ptr) > 6)
192         detect = FALSE;
193     if (detect) {
194         msg_print(_("財宝の存在を感じとった!", "You sense the presence of treasure!"));
195     }
196
197     if (detect_monsters_string(caster_ptr, range, "$")) {
198         detect = TRUE;
199     }
200
201     return detect;
202 }
203
204 /*!
205  * @brief 通常のアイテムオブジェクトを感知する / Detect all "normal" objects on the current panel
206  * @param caster_ptr プレーヤーへの参照ポインタ
207  * @param range 効果範囲
208  * @return 効力があった場合TRUEを返す
209  */
210 bool detect_objects_normal(player_type *caster_ptr, POSITION range)
211 {
212     POSITION range2 = range;
213     if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
214         range2 /= 3;
215
216     bool detect = FALSE;
217     for (OBJECT_IDX i = 1; i < caster_ptr->current_floor_ptr->o_max; i++) {
218         object_type *o_ptr = &caster_ptr->current_floor_ptr->o_list[i];
219
220         if (!object_is_valid(o_ptr))
221             continue;
222         if (object_is_held_monster(o_ptr))
223             continue;
224
225         POSITION y = o_ptr->iy;
226         POSITION x = o_ptr->ix;
227
228         if (distance(caster_ptr->y, caster_ptr->x, y, x) > range2)
229             continue;
230
231         if (o_ptr->tval != TV_GOLD) {
232             o_ptr->marked |= OM_FOUND;
233             lite_spot(caster_ptr, y, x);
234             detect = TRUE;
235         }
236     }
237
238     if (music_singing(caster_ptr, MUSIC_DETECT) && SINGING_COUNT(caster_ptr) > 6)
239         detect = FALSE;
240     if (detect) {
241         msg_print(_("アイテムの存在を感じとった!", "You sense the presence of objects!"));
242     }
243
244     if (detect_monsters_string(caster_ptr, range, "!=?|/`")) {
245         detect = TRUE;
246     }
247
248     return detect;
249 }
250
251 /*!
252  * @brief 魔法効果のあるのアイテムオブジェクトを感知する / Detect all "magic" objects on the current panel.
253  * @param caster_ptr プレーヤーへの参照ポインタ
254  * @param range 効果範囲
255  * @return 効力があった場合TRUEを返す
256  * @details
257  * <pre>
258  * This will light up all spaces with "magic" items, including artifacts,
259  * ego-items, potions, scrolls, books, rods, wands, staffs, amulets, rings,
260  * and "enchanted" items of the "good" variety.
261  *
262  * It can probably be argued that this function is now too powerful.
263  * </pre>
264  */
265 bool detect_objects_magic(player_type *caster_ptr, POSITION range)
266 {
267     if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
268         range /= 3;
269
270     tval_type tv;
271     bool detect = FALSE;
272     for (OBJECT_IDX i = 1; i < caster_ptr->current_floor_ptr->o_max; i++) {
273         object_type *o_ptr = &caster_ptr->current_floor_ptr->o_list[i];
274
275         if (!object_is_valid(o_ptr))
276             continue;
277         if (object_is_held_monster(o_ptr))
278             continue;
279
280         POSITION y = o_ptr->iy;
281         POSITION x = o_ptr->ix;
282
283         if (distance(caster_ptr->y, caster_ptr->x, y, x) > range)
284             continue;
285
286         tv = o_ptr->tval;
287         if (object_is_artifact(o_ptr) || object_is_ego(o_ptr) || (tv == TV_WHISTLE) || (tv == TV_AMULET) || (tv == TV_RING) || (tv == TV_STAFF)
288             || (tv == TV_WAND) || (tv == TV_ROD) || (tv == TV_SCROLL) || (tv == TV_POTION) || (tv == TV_LIFE_BOOK) || (tv == TV_SORCERY_BOOK)
289             || (tv == TV_NATURE_BOOK) || (tv == TV_CHAOS_BOOK) || (tv == TV_DEATH_BOOK) || (tv == TV_TRUMP_BOOK) || (tv == TV_ARCANE_BOOK)
290             || (tv == TV_CRAFT_BOOK) || (tv == TV_DEMON_BOOK) || (tv == TV_CRUSADE_BOOK) || (tv == TV_MUSIC_BOOK) || (tv == TV_HISSATSU_BOOK)
291             || (tv == TV_HEX_BOOK) || ((o_ptr->to_a > 0) || (o_ptr->to_h + o_ptr->to_d > 0))) {
292             o_ptr->marked |= OM_FOUND;
293             lite_spot(caster_ptr, y, x);
294             detect = TRUE;
295         }
296     }
297
298     if (detect) {
299         msg_print(_("魔法のアイテムの存在を感じとった!", "You sense the presence of magic objects!"));
300     }
301
302     return detect;
303 }
304
305 /*!
306  * @brief 一般のモンスターを感知する / Detect all "normal" monsters on the current panel
307  * @param caster_ptr プレーヤーへの参照ポインタ
308  * @param range 効果範囲
309  * @return 効力があった場合TRUEを返す
310  */
311 bool detect_monsters_normal(player_type *caster_ptr, POSITION range)
312 {
313     if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
314         range /= 3;
315
316     bool flag = FALSE;
317     for (MONSTER_IDX i = 1; i < caster_ptr->current_floor_ptr->m_max; i++) {
318         monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i];
319         monster_race *r_ptr = &r_info[m_ptr->r_idx];
320         if (!monster_is_valid(m_ptr))
321             continue;
322
323         POSITION y = m_ptr->fy;
324         POSITION x = m_ptr->fx;
325         if (distance(caster_ptr->y, caster_ptr->x, y, x) > range)
326             continue;
327
328         if (!(r_ptr->flags2 & RF2_INVISIBLE) || caster_ptr->see_inv) {
329             m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
330             update_monster(caster_ptr, i, FALSE);
331             flag = TRUE;
332         }
333     }
334
335     if (music_singing(caster_ptr, MUSIC_DETECT) && SINGING_COUNT(caster_ptr) > 3)
336         flag = FALSE;
337     if (flag) {
338         msg_print(_("モンスターの存在を感じとった!", "You sense the presence of monsters!"));
339     }
340
341     return flag;
342 }
343
344 /*!
345  * @brief 不可視のモンスターを感知する / Detect all "invisible" monsters around the player
346  * @param caster_ptr プレーヤーへの参照ポインタ
347  * @param range 効果範囲
348  * @return 効力があった場合TRUEを返す
349  */
350 bool detect_monsters_invis(player_type *caster_ptr, POSITION range)
351 {
352     if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
353         range /= 3;
354
355     bool flag = FALSE;
356     for (MONSTER_IDX i = 1; i < caster_ptr->current_floor_ptr->m_max; i++) {
357         monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i];
358         monster_race *r_ptr = &r_info[m_ptr->r_idx];
359
360         if (!monster_is_valid(m_ptr))
361             continue;
362
363         POSITION y = m_ptr->fy;
364         POSITION x = m_ptr->fx;
365
366         if (distance(caster_ptr->y, caster_ptr->x, y, x) > range)
367             continue;
368
369         if (r_ptr->flags2 & RF2_INVISIBLE) {
370             if (caster_ptr->monster_race_idx == m_ptr->r_idx) {
371                 caster_ptr->window_flags |= (PW_MONSTER);
372             }
373
374             m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
375             update_monster(caster_ptr, i, FALSE);
376             flag = TRUE;
377         }
378     }
379
380     if (music_singing(caster_ptr, MUSIC_DETECT) && SINGING_COUNT(caster_ptr) > 3)
381         flag = FALSE;
382     if (flag) {
383         msg_print(_("透明な生物の存在を感じとった!", "You sense the presence of invisible creatures!"));
384     }
385
386     return flag;
387 }
388
389 /*!
390  * @brief 邪悪なモンスターを感知する / Detect all "evil" monsters on current panel
391  * @param caster_ptr プレーヤーへの参照ポインタ
392  * @param range 効果範囲
393  * @return 効力があった場合TRUEを返す
394  */
395 bool detect_monsters_evil(player_type *caster_ptr, POSITION range)
396 {
397     if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
398         range /= 3;
399
400     bool flag = FALSE;
401     for (MONSTER_IDX i = 1; i < caster_ptr->current_floor_ptr->m_max; i++) {
402         monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i];
403         monster_race *r_ptr = &r_info[m_ptr->r_idx];
404         if (!monster_is_valid(m_ptr))
405             continue;
406
407         POSITION y = m_ptr->fy;
408         POSITION x = m_ptr->fx;
409
410         if (distance(caster_ptr->y, caster_ptr->x, y, x) > range)
411             continue;
412
413         if (r_ptr->flags3 & RF3_EVIL) {
414             if (is_original_ap(m_ptr)) {
415                 r_ptr->r_flags3 |= (RF3_EVIL);
416                 if (caster_ptr->monster_race_idx == m_ptr->r_idx) {
417                     caster_ptr->window_flags |= (PW_MONSTER);
418                 }
419             }
420
421             m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
422             update_monster(caster_ptr, i, FALSE);
423             flag = TRUE;
424         }
425     }
426
427     if (flag) {
428         msg_print(_("邪悪なる生物の存在を感じとった!", "You sense the presence of evil creatures!"));
429     }
430
431     return flag;
432 }
433
434 /*!
435  * @brief 無生命のモンスターを感知する(アンデッド、悪魔系を含む) / Detect all "nonliving", "undead" or "demonic" monsters on current panel
436  * @param caster_ptr プレーヤーへの参照ポインタ
437  * @param range 効果範囲
438  * @return 効力があった場合TRUEを返す
439  */
440 bool detect_monsters_nonliving(player_type *caster_ptr, POSITION range)
441 {
442     if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
443         range /= 3;
444
445     bool flag = FALSE;
446     for (MONSTER_IDX i = 1; i < caster_ptr->current_floor_ptr->m_max; i++) {
447         monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i];
448         if (!monster_is_valid(m_ptr))
449             continue;
450
451         POSITION y = m_ptr->fy;
452         POSITION x = m_ptr->fx;
453         if (distance(caster_ptr->y, caster_ptr->x, y, x) > range)
454             continue;
455
456         if (!monster_living(m_ptr->r_idx)) {
457             if (caster_ptr->monster_race_idx == m_ptr->r_idx) {
458                 caster_ptr->window_flags |= (PW_MONSTER);
459             }
460
461             m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
462             update_monster(caster_ptr, i, FALSE);
463             flag = TRUE;
464         }
465     }
466
467     if (flag) {
468         msg_print(_("自然でないモンスターの存在を感じた!", "You sense the presence of unnatural beings!"));
469     }
470
471     return flag;
472 }
473
474 /*!
475  * @brief 精神のあるモンスターを感知する / Detect all monsters it has mind on current panel
476  * @param caster_ptr プレーヤーへの参照ポインタ
477  * @param range 効果範囲
478  * @return 効力があった場合TRUEを返す
479  */
480 bool detect_monsters_mind(player_type *caster_ptr, POSITION range)
481 {
482     if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
483         range /= 3;
484
485     bool flag = FALSE;
486     for (MONSTER_IDX i = 1; i < caster_ptr->current_floor_ptr->m_max; i++) {
487         monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i];
488         monster_race *r_ptr = &r_info[m_ptr->r_idx];
489         if (!monster_is_valid(m_ptr))
490             continue;
491
492         POSITION y = m_ptr->fy;
493         POSITION x = m_ptr->fx;
494
495         if (distance(caster_ptr->y, caster_ptr->x, y, x) > range)
496             continue;
497
498         if (!(r_ptr->flags2 & RF2_EMPTY_MIND)) {
499             if (caster_ptr->monster_race_idx == m_ptr->r_idx) {
500                 caster_ptr->window_flags |= (PW_MONSTER);
501             }
502
503             m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
504             update_monster(caster_ptr, i, FALSE);
505             flag = TRUE;
506         }
507     }
508
509     if (flag) {
510         msg_print(_("殺気を感じとった!", "You sense the presence of someone's mind!"));
511     }
512
513     return flag;
514 }
515
516 /*!
517  * @brief 該当シンボルのモンスターを感知する / Detect all (string) monsters on current panel
518  * @param caster_ptr プレーヤーへの参照ポインタ
519  * @param range 効果範囲
520  * @param Match 対応シンボルの混じったモンスター文字列(複数指定化)
521  * @return 効力があった場合TRUEを返す
522  */
523 bool detect_monsters_string(player_type *caster_ptr, POSITION range, concptr Match)
524 {
525     if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
526         range /= 3;
527
528     bool flag = FALSE;
529     for (MONSTER_IDX i = 1; i < caster_ptr->current_floor_ptr->m_max; i++) {
530         monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i];
531         monster_race *r_ptr = &r_info[m_ptr->r_idx];
532         if (!monster_is_valid(m_ptr))
533             continue;
534
535         POSITION y = m_ptr->fy;
536         POSITION x = m_ptr->fx;
537
538         if (distance(caster_ptr->y, caster_ptr->x, y, x) > range)
539             continue;
540
541         if (angband_strchr(Match, r_ptr->d_char)) {
542             if (caster_ptr->monster_race_idx == m_ptr->r_idx) {
543                 caster_ptr->window_flags |= (PW_MONSTER);
544             }
545
546             m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
547             update_monster(caster_ptr, i, FALSE);
548             flag = TRUE;
549         }
550     }
551
552     if (music_singing(caster_ptr, MUSIC_DETECT) && SINGING_COUNT(caster_ptr) > 3)
553         flag = FALSE;
554     if (flag) {
555         msg_print(_("モンスターの存在を感じとった!", "You sense the presence of monsters!"));
556     }
557
558     return flag;
559 }
560
561 /*!
562  * @brief flags3に対応するモンスターを感知する / A "generic" detect monsters routine, tagged to flags3
563  * @param caster_ptr プレーヤーへの参照ポインタ
564  * @param range 効果範囲
565  * @param match_flag 感知フラグ
566  * @return 効力があった場合TRUEを返す
567  */
568 bool detect_monsters_xxx(player_type *caster_ptr, POSITION range, u32b match_flag)
569 {
570     if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
571         range /= 3;
572
573     bool flag = FALSE;
574     for (MONSTER_IDX i = 1; i < caster_ptr->current_floor_ptr->m_max; i++) {
575         monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i];
576         monster_race *r_ptr = &r_info[m_ptr->r_idx];
577         if (!monster_is_valid(m_ptr))
578             continue;
579
580         POSITION y = m_ptr->fy;
581         POSITION x = m_ptr->fx;
582
583         if (distance(caster_ptr->y, caster_ptr->x, y, x) > range)
584             continue;
585
586         if (r_ptr->flags3 & (match_flag)) {
587             if (is_original_ap(m_ptr)) {
588                 r_ptr->r_flags3 |= (match_flag);
589                 if (caster_ptr->monster_race_idx == m_ptr->r_idx) {
590                     caster_ptr->window_flags |= (PW_MONSTER);
591                 }
592             }
593
594             m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
595             update_monster(caster_ptr, i, FALSE);
596             flag = TRUE;
597         }
598     }
599
600     concptr desc_monsters = _("変なモンスター", "weird monsters");
601     if (flag) {
602         switch (match_flag) {
603         case RF3_DEMON:
604             desc_monsters = _("デーモン", "demons");
605             break;
606         case RF3_UNDEAD:
607             desc_monsters = _("アンデッド", "the undead");
608             break;
609         }
610
611         msg_format(_("%sの存在を感じとった!", "You sense the presence of %s!"), desc_monsters);
612         msg_print(NULL);
613     }
614
615     return flag;
616 }
617
618 /*!
619  * @brief 全感知処理 / Detect everything
620  * @param caster_ptr プレーヤーへの参照ポインタ
621  * @param range 効果範囲
622  * @return 効力があった場合TRUEを返す
623  */
624 bool detect_all(player_type *caster_ptr, POSITION range)
625 {
626     bool detect = FALSE;
627     if (detect_traps(caster_ptr, range, TRUE))
628         detect = TRUE;
629     if (detect_doors(caster_ptr, range))
630         detect = TRUE;
631     if (detect_stairs(caster_ptr, range))
632         detect = TRUE;
633     if (detect_objects_gold(caster_ptr, range))
634         detect = TRUE;
635     if (detect_objects_normal(caster_ptr, range))
636         detect = TRUE;
637     if (detect_monsters_invis(caster_ptr, range))
638         detect = TRUE;
639     if (detect_monsters_normal(caster_ptr, range))
640         detect = TRUE;
641     return (detect);
642 }