*
* Returns TRUE if repeated commands may continue
*/
-static bool do_cmd_open_aux(int y, int x, int dir)
+static bool do_cmd_open_aux(int y, int x)
{
int i, j;
cave_type *c_ptr;
+ byte feat;
bool more = FALSE;
/* Get requested grid */
c_ptr = &cave[y][x];
+ /* Feature code (applying "mimic" field) */
+ feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
/* Jammed door */
- if (c_ptr->feat >= FEAT_DOOR_HEAD + 0x08)
+ if (feat >= FEAT_DOOR_HEAD + 0x08)
{
/* Stuck */
#ifdef JP
}
/* Locked door */
- else if (c_ptr->feat >= FEAT_DOOR_HEAD + 0x01)
+ else if (feat >= FEAT_DOOR_HEAD + 0x01)
{
/* Disarm factor */
i = p_ptr->skill_dis;
s16b o_idx;
- cave_type *c_ptr;
-
bool more = FALSE;
if (p_ptr->special_defense & KATA_MUSOU)
/* Get a "repeated" direction */
if (get_rep_dir(&dir, TRUE))
{
+ byte feat;
+ cave_type *c_ptr;
+
/* Get requested location */
y = py + ddy[dir];
x = px + ddx[dir];
/* Get requested grid */
c_ptr = &cave[y][x];
+ /* Feature code (applying "mimic" field) */
+ feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
/* Check for chest */
o_idx = chest_check(y, x);
/* Nothing useful */
- if (!(is_closed_door(c_ptr->feat) && !c_ptr->mimic) &&
- !o_idx)
+ if (!is_closed_door(feat) && !o_idx)
{
/* Message */
#ifdef JP
else
{
/* Open the door */
- more = do_cmd_open_aux(y, x, dir);
+ more = do_cmd_open_aux(y, x);
}
}
*
* Returns TRUE if repeated commands may continue
*/
-static bool do_cmd_close_aux(int y, int x, int dir)
+static bool do_cmd_close_aux(int y, int x)
{
cave_type *c_ptr;
+ byte feat;
bool more = FALSE;
/* Get grid and contents */
c_ptr = &cave[y][x];
+ /* Feature code (applying "mimic" field) */
+ feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
/* Broken door */
- if (c_ptr->feat == FEAT_BROKEN)
+ if (feat == FEAT_BROKEN)
{
/* Message */
#ifdef JP
{
int y, x, dir;
- cave_type *c_ptr;
-
bool more = FALSE;
if (p_ptr->special_defense & KATA_MUSOU)
/* Get a "repeated" direction */
if (get_rep_dir(&dir,FALSE))
{
+ cave_type *c_ptr;
+ byte feat;
+
/* Get requested location */
y = py + ddy[dir];
x = px + ddx[dir];
/* Get grid and contents */
c_ptr = &cave[y][x];
+ /* Feature code (applying "mimic" field) */
+ feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
/* Require open/broken door */
- if ((c_ptr->feat != FEAT_OPEN) && (c_ptr->feat != FEAT_BROKEN))
+ if ((feat != FEAT_OPEN) && (feat != FEAT_BROKEN))
{
/* Message */
#ifdef JP
- msg_print("¤½¤³¤Ë¤ÏÊĤ¸¤ë¤â¤Î¤¬¸«Åö¤¿¤é¤Ê¤¤¡£");
+ msg_print("¤½¤³¤Ë¤ÏÊĤ¸¤ë¤â¤Î¤¬¸«Åö¤¿¤é¤Ê¤¤¡£");
#else
msg_print("You see nothing there to close.");
#endif
else
{
/* Close the door */
- more = do_cmd_close_aux(y, x, dir);
+ more = do_cmd_close_aux(y, x);
}
}
*
* Returns TRUE if repeated commands may continue
*/
-static bool do_cmd_tunnel_aux(int y, int x, int dir)
+static bool do_cmd_tunnel_aux(int y, int x)
{
cave_type *c_ptr;
byte feat;
else
{
/* Tunnel through walls */
- more = do_cmd_tunnel_aux(y, x, dir);
+ more = do_cmd_tunnel_aux(y, x);
}
}
c_ptr->info &= ~(CAVE_MARK);
/* Remove the trap */
- c_ptr->feat = floor_type[randint0(100)];
- note_spot(y, x);
- lite_spot(y, x);
+ cave_set_feat(y, x, floor_type[randint0(100)]);
#ifdef ALLOW_EASY_DISARM /* TNB */
s16b o_idx;
- cave_type *c_ptr;
-
bool more = FALSE;
if (p_ptr->special_defense & KATA_MUSOU)
/* Get a direction (or abort) */
if (get_rep_dir(&dir,TRUE))
{
+ cave_type *c_ptr;
+ byte feat;
+
/* Get location */
y = py + ddy[dir];
x = px + ddx[dir];
/* Get grid and contents */
c_ptr = &cave[y][x];
+ /* Feature code (applying "mimic" field) */
+ feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
/* Check for chests */
o_idx = chest_check(y, x);
/* Disarm a trap */
- if (!is_trap(c_ptr->feat) && !o_idx)
+ if (!is_trap(feat) && !o_idx)
{
/* Message */
#ifdef JP
- msg_print("¤½¤³¤Ë¤Ï²ò½ü¤¹¤ë¤â¤Î¤¬¸«Åö¤¿¤é¤Ê¤¤¡£");
+ msg_print("¤½¤³¤Ë¤Ï²ò½ü¤¹¤ë¤â¤Î¤¬¸«Åö¤¿¤é¤Ê¤¤¡£");
#else
msg_print("You see nothing there to disarm.");
#endif
/* Get a "repeated" direction */
if (get_rep_dir(&dir,FALSE))
{
+ byte feat;
+
/* Bash location */
y = py + ddy[dir];
x = px + ddx[dir];
/* Get grid */
c_ptr = &cave[y][x];
+ /* Feature code (applying "mimic" field) */
+ feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
/* Nothing useful */
- if (!((c_ptr->feat >= FEAT_DOOR_HEAD) &&
- (c_ptr->feat <= FEAT_DOOR_TAIL)))
+ if (!((feat >= FEAT_DOOR_HEAD) &&
+ (feat <= FEAT_DOOR_TAIL)))
{
/* Message */
#ifdef JP
/* Get a direction */
if (get_rep_dir(&dir,TRUE))
{
+ byte feat;
+
/* Get location */
y = py + ddy[dir];
x = px + ddx[dir];
/* Get grid */
c_ptr = &cave[y][x];
+ /* Feature code (applying "mimic" field) */
+ feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
/* Take a turn */
energy_use = 100;
}
/* Tunnel through walls */
- else if (((c_ptr->feat >= FEAT_RUBBLE) &&
- (c_ptr->feat < FEAT_MINOR_GLYPH)) ||
- ((c_ptr->feat == FEAT_TREES) ||
- (c_ptr->feat == FEAT_MOUNTAIN)))
+ else if (((feat >= FEAT_RUBBLE) &&
+ (feat < FEAT_MINOR_GLYPH)) ||
+ ((feat == FEAT_TREES) ||
+ (feat == FEAT_MOUNTAIN)))
{
- more = do_cmd_tunnel_aux(y, x, dir);
+ more = do_cmd_tunnel_aux(y, x);
}
- else if (is_closed_door(c_ptr->feat))
+ else if (is_closed_door(feat))
{
- /* Tunnel hidden door */
- if (c_ptr->mimic)
- {
- more = do_cmd_tunnel_aux(y, x, dir);
- }
-
/* Bash jammed doors */
- else if (c_ptr->feat >= FEAT_DOOR_HEAD + 0x08)
+ if (feat >= FEAT_DOOR_HEAD + 0x08)
{
more = do_cmd_bash_aux(y, x, dir);
}
/* Locked doors */
else
{
- more = do_cmd_open_aux(y, x, dir);
+ more = do_cmd_open_aux(y, x);
}
}
/* Close open doors */
- else if ((c_ptr->feat == FEAT_OPEN) ||
- (c_ptr->feat == FEAT_BROKEN))
+ else if ((feat == FEAT_OPEN) ||
+ (feat == FEAT_BROKEN))
{
- more = do_cmd_close_aux(y, x, dir);
+ more = do_cmd_close_aux(y, x);
}
/* Disarm traps */
- else if (is_trap(c_ptr->feat))
+ else if (is_trap(feat))
{
more = do_cmd_disarm_aux(y, x, dir);
}
*/
void do_cmd_spike(void)
{
- int y, x, dir, item;
-
- cave_type *c_ptr;
-
+ int dir;
if (p_ptr->special_defense & KATA_MUSOU)
{
/* Get a "repeated" direction */
if (get_rep_dir(&dir,FALSE))
{
+ int y, x, item;
+ cave_type *c_ptr;
+ byte feat;
+
/* Get location */
y = py + ddy[dir];
x = px + ddx[dir];
/* Get grid and contents */
c_ptr = &cave[y][x];
+ /* Feature code (applying "mimic" field) */
+ feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
/* Require closed door */
- if (!((c_ptr->feat >= FEAT_DOOR_HEAD) &&
- (c_ptr->feat <= FEAT_DOOR_TAIL)))
+ if (!((feat >= FEAT_DOOR_HEAD) &&
+ (feat <= FEAT_DOOR_TAIL)))
{
/* Message */
#ifdef JP
#else
msg_format("A tree %s", message);
#endif
- c_ptr->feat = (one_in_(3) ? FEAT_DEEP_GRASS : FEAT_GRASS);
+ cave_set_feat(y, x, (one_in_(3) ? FEAT_DEEP_GRASS : FEAT_GRASS));
/* Observe */
if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
c_ptr->info &= ~(CAVE_MARK);
/* Destroy the wall */
- c_ptr->feat = floor_type[randint0(100)];
+ cave_set_feat(y, x, floor_type[randint0(100)]);
}
/* Quartz / Magma with treasure */
c_ptr->info &= ~(CAVE_MARK);
/* Destroy the wall */
- c_ptr->feat = floor_type[randint0(100)];
+ cave_set_feat(y, x, floor_type[randint0(100)]);
/* Place some gold */
place_gold(y, x);
c_ptr->info &= ~(CAVE_MARK);
/* Destroy the wall */
- c_ptr->feat = floor_type[randint0(100)];
+ cave_set_feat(y, x, floor_type[randint0(100)]);
}
/* Rubble */
c_ptr->info &= ~(CAVE_MARK);
/* Destroy the rubble */
- c_ptr->feat = floor_type[randint0(100)];
+ cave_set_feat(y, x, floor_type[randint0(100)]);
/* Hack -- place an object */
if (randint0(100) < 10)
c_ptr->info &= ~(CAVE_MARK);
/* Destroy the feature */
- c_ptr->feat = floor_type[randint0(100)];
+ cave_set_feat(y, x, floor_type[randint0(100)]);
}
/* Notice */
if (cave[y][x].feat == FEAT_TREES)
cave_set_feat(y, x, FEAT_GRASS);
else
- {
- cave[y][x].feat = floor_type[randint0(100)];
- }
+ cave_set_feat(y, x, floor_type[randint0(100)]);
}
/* Update some things -- similar to GF_KILL_WALL */
p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
if (cave[y][x].feat == FEAT_TREES)
cave_set_feat(y, x, FEAT_GRASS);
else
- {
- cave[y][x].feat = floor_type[randint0(100)];
- }
+ cave_set_feat(y, x, floor_type[randint0(100)]);
}
/* Update some things -- similar to GF_KILL_WALL */
/* Lose room and vault */
c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE | CAVE_OBJECT);
- /* Clear mimic type */
- c_ptr->mimic = 0;
-
/* Lose light and knowledge */
c_ptr->info &= ~(CAVE_MARK | CAVE_GLOW);
if (t < 20)
{
/* Create granite wall */
- c_ptr->feat = FEAT_WALL_EXTRA;
+ cave_set_feat(y, x, FEAT_WALL_EXTRA);
}
/* Quartz */
else if (t < 70)
{
/* Create quartz vein */
- c_ptr->feat = FEAT_QUARTZ;
+ cave_set_feat(y, x, FEAT_QUARTZ);
}
/* Magma */
else if (t < 100)
{
/* Create magma vein */
- c_ptr->feat = FEAT_MAGMA;
+ cave_set_feat(y, x, FEAT_MAGMA);
}
/* Floor */
else
{
/* Create floor */
- c_ptr->feat = floor_type[randint0(100)];
+ cave_set_feat(y, x, floor_type[randint0(100)]);
}
}
}
/* Delete objects */
delete_object(yy, xx);
- /* Clear mimic type */
- c_ptr->mimic = 0;
-
/* Clear mirror, runes flag */
c_ptr->info &= ~CAVE_OBJECT;
if (t < 20)
{
/* Create granite wall */
- c_ptr->feat = FEAT_WALL_EXTRA;
+ cave_set_feat(y, x, FEAT_WALL_EXTRA);
}
/* Quartz */
else if (t < 70)
{
/* Create quartz vein */
- c_ptr->feat = FEAT_QUARTZ;
+ cave_set_feat(y, x, FEAT_QUARTZ);
}
/* Magma */
else if (t < 100)
{
/* Create magma vein */
- c_ptr->feat = FEAT_MAGMA;
+ cave_set_feat(y, x, FEAT_MAGMA);
}
/* Floor */
else
{
/* Create floor */
- c_ptr->feat = floor_type[randint0(100)];
+ cave_set_feat(y, x, floor_type[randint0(100)]);
}
}
}