(void)restore_level(creature_ptr);
(void)cure_critical_wounds(creature_ptr, 1000);
- cave_set_feat(creature_ptr->y, creature_ptr->x, feat_pattern_old);
+ cave_set_feat(creature_ptr->current_floor_ptr, creature_ptr->y, creature_ptr->x, feat_pattern_old);
msg_print(_("「パターン」のこの部分は他の部分より強力でないようだ。", "This section of the Pattern looks less powerful."));
/*
#include "rooms.h"
#include "quest.h"
#include "object-hook.h"
+#include "world.h"
+#include "player-effects.h"
/*
* The array of floor [MAX_WID][MAX_HGT].
return (TRUE);
}
+/*
+ * Change the "feat" flag for a grid, and notice/redraw the grid
+ */
+void cave_set_feat(floor_type *floor_ptr, POSITION y, POSITION x, FEAT_IDX feat)
+{
+ grid_type *g_ptr = &floor_ptr->grid_array[y][x];
+ feature_type *f_ptr = &f_info[feat];
+ bool old_los, old_mirror;
+
+ if (!current_world_ptr->character_dungeon)
+ {
+ /* Clear mimic type */
+ g_ptr->mimic = 0;
+
+ /* Change the feature */
+ g_ptr->feat = feat;
+
+ /* Hack -- glow the GLOW terrain */
+ if (have_flag(f_ptr->flags, FF_GLOW) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
+ {
+ DIRECTION i;
+ POSITION yy, xx;
+
+ for (i = 0; i < 9; i++)
+ {
+ yy = y + ddy_ddd[i];
+ xx = x + ddx_ddd[i];
+ if (!in_bounds2(floor_ptr, yy, xx)) continue;
+ floor_ptr->grid_array[yy][xx].info |= CAVE_GLOW;
+ }
+ }
+
+ return;
+ }
+
+ old_los = cave_have_flag_bold(y, x, FF_LOS);
+ old_mirror = is_mirror_grid(g_ptr);
+
+ /* Clear mimic type */
+ g_ptr->mimic = 0;
+
+ /* Change the feature */
+ g_ptr->feat = feat;
+
+ /* Remove flag for mirror/glyph */
+ g_ptr->info &= ~(CAVE_OBJECT);
+
+ if (old_mirror && (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
+ {
+ g_ptr->info &= ~(CAVE_GLOW);
+ if (!view_torch_grids) g_ptr->info &= ~(CAVE_MARK);
+
+ update_local_illumination(p_ptr, y, x);
+ }
+
+ /* Check for change to boring grid */
+ if (!have_flag(f_ptr->flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
+ if (g_ptr->m_idx) update_monster(p_ptr, g_ptr->m_idx, FALSE);
+
+ note_spot(y, x);
+ lite_spot(y, x);
+
+ /* Check if los has changed */
+ if (old_los ^ have_flag(f_ptr->flags, FF_LOS))
+ {
+
+#ifdef COMPLEX_WALL_ILLUMINATION /* COMPLEX_WALL_ILLUMINATION */
+
+ update_local_illumination(p_ptr, y, x);
+
+#endif /* COMPLEX_WALL_ILLUMINATION */
+
+ /* Update the visuals */
+ p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE | PU_MONSTERS);
+ }
+
+ /* Hack -- glow the GLOW terrain */
+ if (have_flag(f_ptr->flags, FF_GLOW) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
+ {
+ DIRECTION i;
+ POSITION yy, xx;
+ grid_type *cc_ptr;
+
+ for (i = 0; i < 9; i++)
+ {
+ yy = y + ddy_ddd[i];
+ xx = x + ddx_ddd[i];
+ if (!in_bounds2(floor_ptr, yy, xx)) continue;
+ cc_ptr = &floor_ptr->grid_array[yy][xx];
+ cc_ptr->info |= CAVE_GLOW;
+
+ if (player_has_los_grid(cc_ptr))
+ {
+ if (cc_ptr->m_idx) update_monster(p_ptr, cc_ptr->m_idx, FALSE);
+ note_spot(yy, xx);
+ lite_spot(yy, xx);
+ }
+
+ update_local_illumination(p_ptr, yy, xx);
+ }
+
+ if (p_ptr->special_defense & NINJA_S_STEALTH)
+ {
+ if (floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
+ }
+ }
+}
extern void vault_monsters(floor_type *floor_ptr, POSITION y1, POSITION x1, int num);
extern bool cave_valid_bold(floor_type *floor_ptr, POSITION y, POSITION x);
+extern void cave_set_feat(floor_type *floor_ptr, POSITION y, POSITION x, FEAT_IDX feat);
if (feat != feat_none)
{
- cave_set_feat(y, x, feat);
+ cave_set_feat(p_ptr->current_floor_ptr, y, x, feat);
/* Now it is not floor */
p_ptr->current_floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
}
}
-/*
- * Change the "feat" flag for a grid, and notice/redraw the grid
- */
-void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat)
-{
- grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
- feature_type *f_ptr = &f_info[feat];
- bool old_los, old_mirror;
-
- if (!current_world_ptr->character_dungeon)
- {
- /* Clear mimic type */
- g_ptr->mimic = 0;
-
- /* Change the feature */
- g_ptr->feat = feat;
-
- /* Hack -- glow the GLOW terrain */
- if (have_flag(f_ptr->flags, FF_GLOW) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
- {
- DIRECTION i;
- POSITION yy, xx;
-
- for (i = 0; i < 9; i++)
- {
- yy = y + ddy_ddd[i];
- xx = x + ddx_ddd[i];
- if (!in_bounds2(p_ptr->current_floor_ptr, yy, xx)) continue;
- p_ptr->current_floor_ptr->grid_array[yy][xx].info |= CAVE_GLOW;
- }
- }
-
- return;
- }
-
- old_los = cave_have_flag_bold(y, x, FF_LOS);
- old_mirror = is_mirror_grid(g_ptr);
-
- /* Clear mimic type */
- g_ptr->mimic = 0;
-
- /* Change the feature */
- g_ptr->feat = feat;
-
- /* Remove flag for mirror/glyph */
- g_ptr->info &= ~(CAVE_OBJECT);
-
- if (old_mirror && (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
- {
- g_ptr->info &= ~(CAVE_GLOW);
- if (!view_torch_grids) g_ptr->info &= ~(CAVE_MARK);
-
- update_local_illumination(p_ptr, y, x);
- }
-
- /* Check for change to boring grid */
- if (!have_flag(f_ptr->flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
- if (g_ptr->m_idx) update_monster(p_ptr, g_ptr->m_idx, FALSE);
-
- note_spot(y, x);
- lite_spot(y, x);
-
- /* Check if los has changed */
- if (old_los ^ have_flag(f_ptr->flags, FF_LOS))
- {
-
-#ifdef COMPLEX_WALL_ILLUMINATION /* COMPLEX_WALL_ILLUMINATION */
-
- update_local_illumination(p_ptr, y, x);
-
-#endif /* COMPLEX_WALL_ILLUMINATION */
-
- /* Update the visuals */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE | PU_MONSTERS);
- }
-
- /* Hack -- glow the GLOW terrain */
- if (have_flag(f_ptr->flags, FF_GLOW) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
- {
- DIRECTION i;
- POSITION yy, xx;
- grid_type *cc_ptr;
-
- for (i = 0; i < 9; i++)
- {
- yy = y + ddy_ddd[i];
- xx = x + ddx_ddd[i];
- if (!in_bounds2(p_ptr->current_floor_ptr, yy, xx)) continue;
- cc_ptr = &p_ptr->current_floor_ptr->grid_array[yy][xx];
- cc_ptr->info |= CAVE_GLOW;
-
- if (player_has_los_grid(cc_ptr))
- {
- if (cc_ptr->m_idx) update_monster(p_ptr, cc_ptr->m_idx, FALSE);
-
- note_spot(yy, xx);
-
- lite_spot(yy, xx);
- }
-
- update_local_illumination(p_ptr, yy, xx);
- }
-
- if (p_ptr->special_defense & NINJA_S_STEALTH)
- {
- if (p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
- }
- }
-}
FEAT_IDX conv_dungeon_feat(FEAT_IDX newfeat)
{
if (newfeat == oldfeat) return;
/* Set the new feature */
- cave_set_feat(y, x, newfeat);
+ cave_set_feat(p_ptr->current_floor_ptr, y, x, newfeat);
if (!(feature_action_flags[action] & FAF_NO_DROP))
{
extern void lite_spot(POSITION y, POSITION x);
extern void delayed_visual_update(void);
extern void update_flow(void);
-extern void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat);
extern FEAT_IDX conv_dungeon_feat(FEAT_IDX newfeat);
extern FEAT_IDX feat_state(FEAT_IDX feat, int action);
extern void cave_alter_feat(POSITION y, POSITION x, int action);
if (pattern_tile(r_y, r_x) &&
(f_info[p_ptr->current_floor_ptr->grid_array[r_y][r_x].feat].subtype != PATTERN_TILE_WRECKED))
{
- cave_set_feat(r_y, r_x, feat_pattern_corrupted);
+ cave_set_feat(p_ptr->current_floor_ptr, r_y, r_x, feat_pattern_corrupted);
}
}
- cave_set_feat(creature_ptr->y, creature_ptr->x, feat_pattern_corrupted);
+ cave_set_feat(p_ptr->current_floor_ptr, creature_ptr->y, creature_ptr->x, feat_pattern_corrupted);
}
msg_print(_("魔法の階段が現れた...", "A magical staircase appears..."));
/* Create stairs down */
- cave_set_feat(y, x, feat_down_stair);
+ cave_set_feat(p_ptr->current_floor_ptr, y, x, feat_down_stair);
/* Remember to update everything */
p_ptr->update |= (PU_FLOW);
/* Clear previous contents, add a store door */
if (j < max_f_idx)
{
- cave_set_feat(ltcy + y, ltcx + x, j);
+ cave_set_feat(p_ptr->current_floor_ptr, ltcy + y, ltcx + x, j);
/* Init store */
store_init(NO_TOWN, stores[i]);
/* Remove old stairs */
g_ptr->special = 0;
- cave_set_feat(y, x, feat_ground_type[randint0(100)]);
+ cave_set_feat(floor_ptr, y, x, feat_ground_type[randint0(100)]);
}
}
}
/* Create a staircase */
if (up)
{
- cave_set_feat(caster_ptr->y, caster_ptr->x,
+ cave_set_feat(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x,
(dest_sf_ptr->last_visit && (dest_sf_ptr->dun_level <= floor_ptr->dun_level - 2)) ?
feat_state(feat_up_stair, FF_SHAFT) : feat_up_stair);
}
else
{
- cave_set_feat(caster_ptr->y, caster_ptr->x,
+ cave_set_feat(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x,
(dest_sf_ptr->last_visit && (dest_sf_ptr->dun_level >= floor_ptr->dun_level + 2)) ?
feat_state(feat_down_stair, FF_SHAFT) : feat_down_stair);
}
if (t < 20)
{
/* Create granite wall */
- cave_set_feat(y, x, feat_granite);
+ cave_set_feat(floor_ptr, y, x, feat_granite);
}
else if (t < 70)
{
/* Create quartz vein */
- cave_set_feat(y, x, feat_quartz_vein);
+ cave_set_feat(floor_ptr, y, x, feat_quartz_vein);
}
else if (t < 100)
{
/* Create magma vein */
- cave_set_feat(y, x, feat_magma_vein);
+ cave_set_feat(floor_ptr, y, x, feat_magma_vein);
}
else
{
/* Create floor */
- cave_set_feat(y, x, feat_ground_type[randint0(100)]);
+ cave_set_feat(floor_ptr, y, x, feat_ground_type[randint0(100)]);
}
}
else /* In generation */
if (t < 20)
{
/* Create granite wall */
- cave_set_feat(yy, xx, feat_granite);
+ cave_set_feat(caster_ptr->current_floor_ptr, yy, xx, feat_granite);
}
/* Quartz */
else if (t < 70)
{
/* Create quartz vein */
- cave_set_feat(yy, xx, feat_quartz_vein);
+ cave_set_feat(caster_ptr->current_floor_ptr, yy, xx, feat_quartz_vein);
}
/* Magma */
else if (t < 100)
{
/* Create magma vein */
- cave_set_feat(yy, xx, feat_magma_vein);
+ cave_set_feat(caster_ptr->current_floor_ptr, yy, xx, feat_magma_vein);
}
/* Floor */
else
{
/* Create floor */
- cave_set_feat(yy, xx, feat_ground_type[randint0(100)]);
+ cave_set_feat(caster_ptr->current_floor_ptr, yy, xx, feat_ground_type[randint0(100)]);
}
}
}
if (message)
{
msg_format(_("木は%s。", "A tree %s"), message);
- cave_set_feat(y, x, one_in_(3) ? feat_brake : feat_grass);
+ cave_set_feat(floor_ptr, y, x, one_in_(3) ? feat_brake : feat_grass);
/* Observe */
if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
{
if (!cave_naked_bold(p_ptr, p_ptr->current_floor_ptr, y, x)) break;
if (player_bold(p_ptr, y, x)) break;
- cave_set_feat(y, x, feat_door[DOOR_DOOR].closed);
+ cave_set_feat(floor_ptr, y, x, feat_door[DOOR_DOOR].closed);
if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
break;
}
{
if (!cave_naked_bold(p_ptr, p_ptr->current_floor_ptr, y, x)) break;
if (player_bold(p_ptr, y, x)) break;
- cave_set_feat(y, x, feat_tree);
+ cave_set_feat(floor_ptr, y, x, feat_tree);
if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
break;
}
{
if (!cave_naked_bold(p_ptr, p_ptr->current_floor_ptr, y, x)) break;
if (player_bold(p_ptr, y, x)) break;
- cave_set_feat(y, x, feat_granite);
+ cave_set_feat(floor_ptr, y, x, feat_granite);
break;
}
if (dam == 1)
{
if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
- cave_set_feat(y, x, feat_shallow_lava);
+ cave_set_feat(floor_ptr, y, x, feat_shallow_lava);
}
else if (dam)
{
- cave_set_feat(y, x, feat_deep_lava);
+ cave_set_feat(floor_ptr, y, x, feat_deep_lava);
}
break;
}
if (dam == 1)
{
if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
- cave_set_feat(y, x, feat_shallow_water);
+ cave_set_feat(floor_ptr, y, x, feat_shallow_water);
}
else if (dam)
{
- cave_set_feat(y, x, feat_deep_water);
+ cave_set_feat(floor_ptr, y, x, feat_deep_water);
}
break;
}
if (tmp_mimic < 0) tmp_mimic = 0;
else if (tmp_mimic >= max_f_idx) tmp_mimic = max_f_idx - 1;
- cave_set_feat(y, x, tmp_feat);
+ cave_set_feat(creature_ptr->current_floor_ptr, y, x, tmp_feat);
g_ptr->mimic = (s16b)tmp_mimic;
f_ptr = &f_info[get_feat_mimic(g_ptr)];