-#define MAX_NORMAL_TRAPS 18
-
-/* See init_feat_variables() in init2.c */
-static s16b normal_traps[MAX_NORMAL_TRAPS];
-
-/*!
- * @brief タグに従って、基本トラップテーブルを初期化する / Initialize arrays for normal traps
- * @return なし
- */
-void init_normal_traps(void)
-{
- int cur_trap = 0;
-
- normal_traps[cur_trap++] = f_tag_to_index_in_init("TRAP_TRAPDOOR");
- normal_traps[cur_trap++] = f_tag_to_index_in_init("TRAP_PIT");
- normal_traps[cur_trap++] = f_tag_to_index_in_init("TRAP_SPIKED_PIT");
- normal_traps[cur_trap++] = f_tag_to_index_in_init("TRAP_POISON_PIT");
- normal_traps[cur_trap++] = f_tag_to_index_in_init("TRAP_TY_CURSE");
- normal_traps[cur_trap++] = f_tag_to_index_in_init("TRAP_TELEPORT");
- normal_traps[cur_trap++] = f_tag_to_index_in_init("TRAP_FIRE");
- normal_traps[cur_trap++] = f_tag_to_index_in_init("TRAP_ACID");
- normal_traps[cur_trap++] = f_tag_to_index_in_init("TRAP_SLOW");
- normal_traps[cur_trap++] = f_tag_to_index_in_init("TRAP_LOSE_STR");
- normal_traps[cur_trap++] = f_tag_to_index_in_init("TRAP_LOSE_DEX");
- normal_traps[cur_trap++] = f_tag_to_index_in_init("TRAP_LOSE_CON");
- normal_traps[cur_trap++] = f_tag_to_index_in_init("TRAP_BLIND");
- normal_traps[cur_trap++] = f_tag_to_index_in_init("TRAP_CONFUSE");
- normal_traps[cur_trap++] = f_tag_to_index_in_init("TRAP_POISON");
- normal_traps[cur_trap++] = f_tag_to_index_in_init("TRAP_SLEEP");
- normal_traps[cur_trap++] = f_tag_to_index_in_init("TRAP_TRAPS");
- normal_traps[cur_trap++] = f_tag_to_index_in_init("TRAP_ALARM");
-}
-
-/*!
- * @brief 基本トラップをランダムに選択する /
- * Get random trap
- * @return 選択したトラップのID
- * @details
- * XXX XXX XXX This routine should be redone to reflect trap "level".\n
- * That is, it does not make sense to have spiked pits at 50 feet.\n
- * Actually, it is not this routine, but the "trap instantiation"\n
- * code, which should also check for "trap doors" on quest levels.\n
- */
-s16b choose_random_trap(void)
-{
- s16b feat;
-
- /* Pick a trap */
- while (1)
- {
- /* Hack -- pick a trap */
- feat = normal_traps[randint0(MAX_NORMAL_TRAPS)];
-
- /* Accept non-trapdoors */
- if (!have_flag(f_info[feat].flags, FF_MORE)) break;
-
- /* Hack -- no trap doors on special levels */
- if (p_ptr->inside_arena || quest_number(dun_level)) continue;
-
- /* Hack -- no trap doors on the deepest level */
- if (dun_level >= d_info[dungeon_type].maxdepth) continue;
-
- break;
- }
-
- return feat;
-}
-
-/*!
- * @brief マスに存在するトラップを秘匿する /
- * Disclose an invisible trap
- * @param y 秘匿したいマスのY座標
- * @param x 秘匿したいマスのX座標
- * @return なし
- */
-void disclose_grid(int y, int x)
-{
- cave_type *c_ptr = &cave[y][x];
-
- if (cave_have_flag_grid(c_ptr, FF_SECRET))
- {
- /* No longer hidden */
- cave_alter_feat(y, x, FF_SECRET);
- }
- else if (c_ptr->mimic)
- {
- /* No longer hidden */
- c_ptr->mimic = 0;
-
- /* Notice */
- note_spot(y, x);
-
- /* Redraw */
- lite_spot(y, x);
- }
-}
-
-/*!
- * @brief マスをトラップを配置する /
- * The location must be a legal, naked, floor grid.
- * @param y 配置したいマスのY座標
- * @param x 配置したいマスのX座標
- * @return
- * Note that all traps start out as "invisible" and "untyped", and then\n
- * when they are "discovered" (by detecting them or setting them off),\n
- * the trap is "instantiated" as a visible, "typed", trap.\n
- */
-void place_trap(int y, int x)
-{
- cave_type *c_ptr = &cave[y][x];
-
- /* Paranoia -- verify location */
- if (!in_bounds(y, x)) return;
-
- /* Require empty, clean, floor grid */
- if (!cave_clean_bold(y, x)) return;
-
- /* Place an invisible trap */
- c_ptr->mimic = c_ptr->feat;
- c_ptr->feat = choose_random_trap();
-}
-