return (feat == FEAT_OPEN);
}
-static bool is_closed(int feat)
-{
- return ((feat >= FEAT_DOOR_HEAD) && (feat <= FEAT_DOOR_TAIL));
-}
/*
* Return the number of features around (or under) the character.
/* Check around (and under) the character */
for (d = 0; d < 9; d++)
{
+ cave_type *c_ptr;
+ byte feat;
+
/* if not searching under player continue */
if ((d == 8) && !under) continue;
yy = py + ddy_ddd[d];
xx = px + ddx_ddd[d];
+ /* Get the cave */
+ c_ptr = &cave[yy][xx];
+
/* Must have knowledge */
- if (!(cave[yy][xx].info & (CAVE_MARK))) continue;
+ if (!(c_ptr->info & (CAVE_MARK))) continue;
+ /* Feature code (applying "mimic" field) */
+ feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+
/* Not looking for this feature */
- if (!((*test)(cave[yy][xx].feat))) continue;
+ if (!((*test)(feat))) continue;
/* OK */
++count;
int num_doors, num_chests;
/* Count closed doors (locked or jammed) */
- num_doors = count_dt(&y, &x, is_closed, FALSE);
+ num_doors = count_dt(&y, &x, is_closed_door, FALSE);
/* Count chests (locked) */
num_chests = count_chests(&y, &x, FALSE);
o_idx = chest_check(y, x);
/* Nothing useful */
- if (!((c_ptr->feat >= FEAT_DOOR_HEAD) &&
- (c_ptr->feat <= FEAT_DOOR_TAIL)) &&
- !o_idx)
+ if (!(is_closed_door(c_ptr->feat) && !c_ptr->mimic) &&
+ !o_idx)
{
/* Message */
#ifdef JP
static bool do_cmd_tunnel_aux(int y, int x, int dir)
{
cave_type *c_ptr;
+ byte feat;
bool more = FALSE;
/* 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;
+
/* Sound */
sound(SOUND_DIG);
/* Titanium */
- if ((c_ptr->feat >= FEAT_PERM_EXTRA) &&
- (c_ptr->feat <= FEAT_PERM_SOLID))
+ if ((feat >= FEAT_PERM_EXTRA) &&
+ (feat <= FEAT_PERM_SOLID))
{
#ifdef JP
msg_print("¤³¤Î´ä¤Ï¹Å¤¹¤®¤Æ·¡¤ì¤Ê¤¤¤è¤¦¤À¡£");
}
/* No tunnelling through mountains */
- else if (c_ptr->feat == FEAT_MOUNTAIN)
+ else if (feat == FEAT_MOUNTAIN)
{
#ifdef JP
msg_print("¤½¤³¤Ï·¡¤ì¤Ê¤¤!");
}
- else if (c_ptr->feat == FEAT_TREES) /* -KMW- */
+ else if (feat == FEAT_TREES) /* -KMW- */
{
/* Chop Down */
if ((p_ptr->skill_dig > 10 + randint0(400)) && twall(y, x, FEAT_GRASS))
/* Granite */
- else if ((c_ptr->feat >= FEAT_WALL_EXTRA) &&
- (c_ptr->feat <= FEAT_WALL_SOLID))
+ else if ((feat >= FEAT_WALL_EXTRA) &&
+ (feat <= FEAT_WALL_SOLID))
{
/* Tunnel */
if ((p_ptr->skill_dig > 40 + randint0(1600)) && twall(y, x, floor_type[randint0(100)]))
/* Quartz / Magma */
- else if ((c_ptr->feat >= FEAT_MAGMA) &&
- (c_ptr->feat <= FEAT_QUARTZ_K))
+ else if ((feat >= FEAT_MAGMA) &&
+ (feat <= FEAT_QUARTZ_K))
{
bool okay = FALSE;
bool gold = FALSE;
bool hard = FALSE;
/* Found gold */
- if (c_ptr->feat >= FEAT_MAGMA_H) gold = TRUE;
+ if (feat >= FEAT_MAGMA_H) gold = TRUE;
/* Extract "quartz" flag XXX XXX XXX */
- if ((c_ptr->feat - FEAT_MAGMA) & 0x01) hard = TRUE;
+ if ((feat - FEAT_MAGMA) & 0x01) hard = TRUE;
/* Quartz */
if (hard)
}
/* Rubble */
- else if (c_ptr->feat == FEAT_RUBBLE)
+ else if (feat == FEAT_RUBBLE)
{
/* Remove the rubble */
if ((p_ptr->skill_dig > randint0(200)) && twall(y, x, floor_type[randint0(100)]))
}
}
- /* Secret doors */
- else if (c_ptr->feat >= FEAT_SECRET)
- {
- /* Tunnel */
- if ((p_ptr->skill_dig > 30 + randint0(1200)) && twall(y, x, floor_type[randint0(100)]))
- {
-#ifdef JP
- msg_print("·ê¤ò·¡¤ê½ª¤¨¤¿¡£");
-#else
- msg_print("You have finished the tunnel.");
-#endif
-
- }
-
- /* Keep trying */
- else
- {
- /* We may continue tunelling */
-#ifdef JP
- msg_print("²ÖÖ¾´ä¤ÎÊɤ˷ê¤ò·¡¤Ã¤Æ¤¤¤ë¡£");
-#else
- msg_print("You tunnel into the granite wall.");
-#endif
-
- more = TRUE;
-
- /* Occasional Search XXX XXX */
- if (randint0(100) < 25) search();
- }
- }
-
/* Doors */
else
{
}
}
+ if (is_hidden_door(c_ptr))
+ {
+ /* Occasional Search XXX XXX */
+ if (randint0(100) < 25) search();
+ }
+
/* Notice new floor grids */
if (!cave_floor_bold(y, x))
{
int y, x, dir;
cave_type *c_ptr;
+ byte feat;
bool more = FALSE;
/* 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;
+
/* No tunnelling through doors */
- if (((c_ptr->feat >= FEAT_DOOR_HEAD) && (c_ptr->feat <= FEAT_DOOR_TAIL)) ||
- ((c_ptr->feat >= FEAT_BLDG_HEAD) && (c_ptr->feat <= FEAT_BLDG_TAIL)) ||
- ((c_ptr->feat >= FEAT_SHOP_HEAD) && (c_ptr->feat <= FEAT_SHOP_TAIL)) ||
- (c_ptr->feat == FEAT_MUSEUM))
+ if (((feat >= FEAT_DOOR_HEAD) && (feat <= FEAT_DOOR_TAIL)) ||
+ ((feat >= FEAT_BLDG_HEAD) && (feat <= FEAT_BLDG_TAIL)) ||
+ ((feat >= FEAT_SHOP_HEAD) && (feat <= FEAT_SHOP_TAIL)) ||
+ (feat == FEAT_MUSEUM))
{
/* Message */
#ifdef JP
}
/* No tunnelling through air */
- else if (cave_floor_grid(c_ptr) || ((c_ptr->feat >= FEAT_MINOR_GLYPH) &&
- (c_ptr->feat <= FEAT_PATTERN_XTRA2)))
+ else if (cave_floor_grid(c_ptr) || ((feat >= FEAT_MINOR_GLYPH) &&
+ (feat <= FEAT_PATTERN_XTRA2)))
{
/* Message */
#ifdef JP
}
/* No tunnelling through mountains */
- else if (c_ptr->feat == FEAT_MOUNTAIN)
+ else if (feat == FEAT_MOUNTAIN)
{
#ifdef JP
msg_print("¤½¤³¤Ï·¡¤ì¤Ê¤¤¡£");
}
/* Tunnel through walls */
- else if (((c_ptr->feat >= FEAT_SECRET) &&
+ else if (((c_ptr->feat >= FEAT_RUBBLE) &&
(c_ptr->feat < FEAT_MINOR_GLYPH)) ||
((c_ptr->feat == FEAT_TREES) ||
(c_ptr->feat == FEAT_MOUNTAIN)))
{
- /* Tunnel */
more = do_cmd_tunnel_aux(y, x, dir);
}
- /* Bash jammed doors */
- else if ((c_ptr->feat >= FEAT_DOOR_HEAD + 0x08) &&
- (c_ptr->feat < FEAT_MINOR_GLYPH))
- {
- /* Tunnel */
- more = do_cmd_bash_aux(y, x, dir);
- }
-
- /* Open closed doors */
- else if ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
- (c_ptr->feat < FEAT_MINOR_GLYPH))
- {
- /* Tunnel */
- more = do_cmd_open_aux(y, x, dir);
- }
+ else if (is_closed_door(c_ptr->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)
+ {
+ more = do_cmd_bash_aux(y, x, dir);
+ }
+
+ /* Locked doors */
+ else
+ {
+ more = do_cmd_open_aux(y, x, dir);
+ }
+ }
/* Close open doors */
else if ((c_ptr->feat == FEAT_OPEN) ||
(c_ptr->feat == FEAT_BROKEN))
{
- /* Tunnel */
more = do_cmd_close_aux(y, x, dir);
}
/* Disarm traps */
else if (is_trap(c_ptr->feat))
{
- /* Tunnel */
more = do_cmd_disarm_aux(y, x, dir);
}
if (mult < 17) mult = 17;
}
+ /* Kill Animal */
+ if ((have_flag(flgs, TR_KILL_ANIMAL)) &&
+ (r_ptr->flags3 & RF3_ANIMAL))
+ {
+ if (m_ptr->ml)
+ {
+ r_ptr->r_flags3 |= RF3_ANIMAL;
+ }
+
+ if (mult < 27) mult = 27;
+ }
+
/* Slay Evil */
if ((have_flag(flgs, TR_SLAY_EVIL)) &&
(r_ptr->flags3 & RF3_EVIL))
if (mult < 15) mult = 15;
}
+ /* Kill Evil */
+ if ((have_flag(flgs, TR_KILL_EVIL)) &&
+ (r_ptr->flags3 & RF3_EVIL))
+ {
+ if (m_ptr->ml)
+ {
+ r_ptr->r_flags3 |= RF3_EVIL;
+ }
+
+ if (mult < 25) mult = 25;
+ }
+
/* Slay Human */
if ((have_flag(flgs, TR_SLAY_HUMAN)) &&
(r_ptr->flags2 & RF2_HUMAN))
if (mult < 17) mult = 17;
}
+ /* Kill Human */
+ if ((have_flag(flgs, TR_KILL_HUMAN)) &&
+ (r_ptr->flags2 & RF2_HUMAN))
+ {
+ if (m_ptr->ml)
+ {
+ r_ptr->r_flags2 |= RF2_HUMAN;
+ }
+
+ if (mult < 27) mult = 27;
+ }
+
/* Slay Undead */
if ((have_flag(flgs, TR_SLAY_UNDEAD)) &&
(r_ptr->flags3 & RF3_UNDEAD))
if (mult < 20) mult = 20;
}
+ /* Kill Undead */
+ if ((have_flag(flgs, TR_KILL_UNDEAD)) &&
+ (r_ptr->flags3 & RF3_UNDEAD))
+ {
+ if (m_ptr->ml)
+ {
+ r_ptr->r_flags3 |= RF3_UNDEAD;
+ }
+
+ if (mult < 30) mult = 30;
+ }
+
/* Slay Demon */
if ((have_flag(flgs, TR_SLAY_DEMON)) &&
(r_ptr->flags3 & RF3_DEMON))
if (mult < 20) mult = 20;
}
+ /* Kill Demon */
+ if ((have_flag(flgs, TR_KILL_DEMON)) &&
+ (r_ptr->flags3 & RF3_DEMON))
+ {
+ if (m_ptr->ml)
+ {
+ r_ptr->r_flags3 |= RF3_DEMON;
+ }
+
+ if (mult < 30) mult = 30;
+ }
+
/* Slay Orc */
if ((have_flag(flgs, TR_SLAY_ORC)) &&
(r_ptr->flags3 & RF3_ORC))
if (mult < 20) mult = 20;
}
+ /* Kill Orc */
+ if ((have_flag(flgs, TR_KILL_ORC)) &&
+ (r_ptr->flags3 & RF3_ORC))
+ {
+ if (m_ptr->ml)
+ {
+ r_ptr->r_flags3 |= RF3_ORC;
+ }
+
+ if (mult < 30) mult = 30;
+ }
+
/* Slay Troll */
if ((have_flag(flgs, TR_SLAY_TROLL)) &&
(r_ptr->flags3 & RF3_TROLL))
if (mult < 20) mult = 20;
}
+ /* Kill Troll */
+ if ((have_flag(flgs, TR_KILL_TROLL)) &&
+ (r_ptr->flags3 & RF3_TROLL))
+ {
+ if (m_ptr->ml)
+ {
+ r_ptr->r_flags3 |= RF3_TROLL;
+ }
+
+ if (mult < 30) mult = 30;
+ }
+
/* Slay Giant */
if ((have_flag(flgs, TR_SLAY_GIANT)) &&
(r_ptr->flags3 & RF3_GIANT))
if (mult < 20) mult = 20;
}
+ /* Kill Giant */
+ if ((have_flag(flgs, TR_KILL_GIANT)) &&
+ (r_ptr->flags3 & RF3_GIANT))
+ {
+ if (m_ptr->ml)
+ {
+ r_ptr->r_flags3 |= RF3_GIANT;
+ }
+
+ if (mult < 30) mult = 30;
+ }
+
/* Slay Dragon */
if ((have_flag(flgs, TR_SLAY_DRAGON)) &&
(r_ptr->flags3 & RF3_DRAGON))