OSDN Git Service

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