#include "angband.h"
-#include "floor.h"
+#include "util.h"
+
#include "trap.h"
#include "player-damage.h"
-#include "projection.h"
+#include "player-move.h"
+#include "player-effects.h"
#include "spells-summon.h"
#include "quest.h"
#include "artifact.h"
#include "feature.h"
+#include "player-status.h"
+#include "grid.h"
+#include "spells.h"
+#include "floor.h"
+#include "floor-save.h"
+#include "init.h"
+#include "files.h"
+#include "dungeon.h"
+#include "world.h"
static s16b normal_traps[MAX_NORMAL_TRAPS];
/*!
+ * @brief 箱のトラップテーブル
+ * @details
+ * <pre>
+ * Each chest has a certain set of traps, determined by pval
+ * Each chest has a "pval" from 1 to the chest level (max 55)
+ * If the "pval" is negative then the trap has been disarmed
+ * The "pval" of a chest determines the quality of its treasure
+ * Note that disarming a trap on a chest also removes the lock.
+ * </pre>
+ */
+const int chest_traps[64] =
+{
+ 0, /* 0 == empty */
+ (CHEST_POISON),
+ (CHEST_LOSE_STR),
+ (CHEST_LOSE_CON),
+ (CHEST_LOSE_STR),
+ (CHEST_LOSE_CON), /* 5 == best small wooden */
+ 0,
+ (CHEST_ALARM),
+ (CHEST_ALARM),
+ (CHEST_LOSE_STR),
+ (CHEST_LOSE_CON),
+ (CHEST_POISON),
+ (CHEST_SCATTER),
+ (CHEST_LOSE_STR | CHEST_LOSE_CON),
+ (CHEST_LOSE_STR | CHEST_LOSE_CON),
+ (CHEST_SUMMON), /* 15 == best large wooden */
+ 0,
+ (CHEST_ALARM),
+ (CHEST_SCATTER),
+ (CHEST_PARALYZE),
+ (CHEST_LOSE_STR | CHEST_LOSE_CON),
+ (CHEST_SUMMON),
+ (CHEST_PARALYZE),
+ (CHEST_LOSE_STR),
+ (CHEST_LOSE_CON),
+ (CHEST_EXPLODE), /* 25 == best small iron */
+ 0,
+ (CHEST_E_SUMMON),
+ (CHEST_POISON | CHEST_LOSE_CON),
+ (CHEST_LOSE_STR | CHEST_LOSE_CON),
+ (CHEST_EXPLODE | CHEST_SUMMON),
+ (CHEST_BIRD_STORM),
+ (CHEST_POISON | CHEST_SUMMON),
+ (CHEST_E_SUMMON | CHEST_ALARM),
+ (CHEST_EXPLODE),
+ (CHEST_EXPLODE | CHEST_SUMMON), /* 35 == best large iron */
+ 0,
+ (CHEST_SUMMON | CHEST_ALARM),
+ (CHEST_EXPLODE),
+ (CHEST_EXPLODE | CHEST_SUMMON),
+ (CHEST_EXPLODE | CHEST_SUMMON),
+ (CHEST_POISON | CHEST_PARALYZE),
+ (CHEST_EXPLODE),
+ (CHEST_BIRD_STORM),
+ (CHEST_EXPLODE | CHEST_E_SUMMON | CHEST_ALARM),
+ (CHEST_H_SUMMON), /* 45 == best small steel */
+ 0,
+ (CHEST_EXPLODE | CHEST_SUMMON | CHEST_ALARM),
+ (CHEST_BIRD_STORM),
+ (CHEST_RUNES_OF_EVIL),
+ (CHEST_EXPLODE | CHEST_SUMMON | CHEST_ALARM),
+ (CHEST_BIRD_STORM | CHEST_ALARM),
+ (CHEST_H_SUMMON | CHEST_ALARM),
+ (CHEST_RUNES_OF_EVIL),
+ (CHEST_H_SUMMON | CHEST_SCATTER | CHEST_ALARM),
+ (CHEST_RUNES_OF_EVIL | CHEST_EXPLODE), /* 55 == best large steel */
+ (CHEST_EXPLODE | CHEST_SUMMON),
+ (CHEST_EXPLODE | CHEST_SUMMON),
+ (CHEST_EXPLODE | CHEST_SUMMON),
+ (CHEST_EXPLODE | CHEST_SUMMON),
+ (CHEST_EXPLODE | CHEST_SUMMON),
+ (CHEST_EXPLODE | CHEST_SUMMON),
+ (CHEST_EXPLODE | CHEST_SUMMON),
+ (CHEST_EXPLODE | CHEST_SUMMON),
+};
+
+
+/*!
* @brief タグに従って、基本トラップテーブルを初期化する / Initialize arrays for normal traps
* @return なし
*/
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;
+ if (p_ptr->inside_arena || quest_number(current_floor_ptr->dun_level)) continue;
/* Hack -- no trap doors on the deepest level */
- if (dun_level >= d_info[p_ptr->dungeon_idx].maxdepth) continue;
+ if (current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth) continue;
break;
}
*/
void disclose_grid(POSITION y, POSITION x)
{
- grid_type *g_ptr = ¤t_floor->grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
if (cave_have_flag_grid(g_ptr, FF_SECRET))
{
*/
void place_trap(POSITION y, POSITION x)
{
- grid_type *g_ptr = ¤t_floor->grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Paranoia -- verify location */
if (!in_bounds(y, x)) return;
* @param trap_message メッセージの補完文字列
* @param resist 状態異常に抵抗する判定が出たならTRUE
* @param set_status 状態異常を指定する関数ポインタ
-* @param turn 状態異常の追加ターン量
+* @param current_world_ptr->game_turn 状態異常の追加ターン量
* @return なし
*/
static void hit_trap_set_abnormal_status(concptr trap_message, bool resist, bool(*set_status)(IDX), IDX turn_aux)
{
int i, num, dam;
POSITION x = p_ptr->x, y = p_ptr->y;
- grid_type *g_ptr = ¤t_floor->grid_array[y][x];
+ grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
int trap_feat_type = have_flag(f_ptr->flags, FF_TRAP) ? f_ptr->subtype : NOT_TRAP;
concptr name = _("トラップ", "a trap");
do_cmd_write_nikki(NIKKI_BUNSHOU, 0, _("落とし戸に落ちた", "You have fallen through a trap door!"));
prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
-
- /* Leaving */
p_ptr->leaving = TRUE;
}
break;
num = 2 + randint1(3);
for (i = 0; i < num; i++)
{
- (void)summon_specific(0, y, x, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0');
+ (void)summon_specific(0, y, x, current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET), '\0');
}
- if (dun_level > randint1(100)) /* No nasty effect for low levels */
+ if (current_floor_ptr->dun_level > randint1(100)) /* No nasty effect for low levels */
{
bool stop_ty = FALSE;
int count = 0;
msg_print(_("突然天界の戦争に巻き込まれた!", "Suddenly, you are surrounded by immotal beings!"));
/* Summon Demons and Angels */
- for (lev = dun_level; lev >= 20; lev -= 1 + lev / 16)
+ for (lev = current_floor_ptr->dun_level; lev >= 20; lev -= 1 + lev / 16)
{
num = levs[MIN(lev / 10, 9)];
for (i = 0; i < num; i++)
/* Let them fight each other */
if (evil_idx && good_idx)
{
- monster_type *evil_ptr = &m_list[evil_idx];
- monster_type *good_ptr = &m_list[good_idx];
+ monster_type *evil_ptr = ¤t_floor_ptr->m_list[evil_idx];
+ monster_type *good_ptr = ¤t_floor_ptr->m_list[good_idx];
evil_ptr->target_y = good_ptr->fy;
evil_ptr->target_x = good_ptr->fx;
good_ptr->target_y = evil_ptr->fy;
fire_ball_hide(GF_WATER_FLOW, 0, 1, 10);
/* Summon Piranhas */
- num = 1 + dun_level / 20;
+ num = 1 + current_floor_ptr->dun_level / 20;
for (i = 0; i < num; i++)
{
- (void)summon_specific(0, y, x, dun_level, SUMMON_PIRANHAS, (PM_ALLOW_GROUP | PM_NO_PET), '\0');
+ (void)summon_specific(0, y, x, current_floor_ptr->dun_level, SUMMON_PIRANHAS, (PM_ALLOW_GROUP | PM_NO_PET), '\0');
}
break;
}