OSDN Git Service

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