place_closed_door(y, x);
/* Hide by inner wall because this is used in rooms only */
- c_ptr->mimic = feat_wall_inner;
+ c_ptr->mimic = f_info[feat_wall_inner].mimic;
/* Floor type terrain cannot hide a door */
- if (!(c_ptr->mimic & 0x20))
+ if (feat_floor(c_ptr->mimic))
{
c_ptr->feat = c_ptr->mimic;
c_ptr->mimic = 0;
}
/* Place a treasure in the vault */
- place_object(yval, xval, FALSE, FALSE);
+ place_object(yval, xval, 0L);
/* Let's guard the treasure well */
vault_monsters(yval, xval, randint0(2) + 3);
/* Object (80%) */
if (randint0(100) < 80)
{
- place_object(yval, xval, FALSE, FALSE);
+ place_object(yval, xval, 0L);
}
/* Stairs (20%) */
vault_monsters(yval, xval + 2, randint1(2));
/* Objects */
- if (one_in_(3)) place_object(yval, xval - 2, FALSE, FALSE);
- if (one_in_(3)) place_object(yval, xval + 2, FALSE, FALSE);
+ if (one_in_(3)) place_object(yval, xval - 2, 0L);
+ if (one_in_(3)) place_object(yval, xval + 2, 0L);
}
break;
(monster_dungeon(I) && \
!(r_info[I].flags1 & RF1_UNIQUE) && \
!(r_info[I].flags7 & RF7_UNIQUE2) && \
- !(r_info[I].flags3 & RF3_RES_ALL) && \
+ !(r_info[I].flagsr & RFR_RES_ALL) && \
!(r_info[I].flags7 & RF7_AQUATIC))
/* Validate the monster */
if (!vault_monster_okay(r_idx)) return (FALSE);
- if (r_ptr->flags2 & (RF2_KILL_BODY)) return (FALSE);
+ if ((r_ptr->flags2 & RF2_KILL_BODY) && !(r_ptr->flags1 & RF1_NEVER_BLOW)) return (FALSE);
/* Also decline evil jellies (like death molds and shoggoths) */
if (r_ptr->flags3 & (RF3_EVIL)) return (FALSE);
/* Validate the monster */
if (!vault_monster_okay(r_idx)) return (FALSE);
- if (r_ptr->flags2 & (RF2_KILL_BODY)) return (FALSE);
+ if ((r_ptr->flags2 & RF2_KILL_BODY) && !(r_ptr->flags1 & RF1_NEVER_BLOW)) return (FALSE);
if (r_ptr->flags3 & (RF3_GOOD)) return (FALSE);
/* Validate the monster */
if (!vault_monster_okay(r_idx)) return (FALSE);
- if (r_ptr->flags2 & (RF2_KILL_BODY)) return (FALSE);
+ if ((r_ptr->flags2 & RF2_KILL_BODY) && !(r_ptr->flags1 & RF1_NEVER_BLOW)) return (FALSE);
if (r_ptr->flags3 & (RF3_EVIL)) return (FALSE);
/* Validate the monster */
if (!vault_monster_okay(r_idx)) return (FALSE);
- if (r_ptr->flags2 & (RF2_KILL_BODY)) return (FALSE);
+ if ((r_ptr->flags2 & RF2_KILL_BODY) && !(r_ptr->flags1 & RF1_NEVER_BLOW)) return (FALSE);
/* Require demon */
if (!(r_ptr->flags3 & RF3_DEMON)) return (FALSE);
/* Validate the monster */
if (!vault_monster_okay(r_idx)) return (FALSE);
- if (r_ptr->flags2 & (RF2_KILL_BODY)) return (FALSE);
+ if ((r_ptr->flags2 & RF2_KILL_BODY) && !(r_ptr->flags1 & RF1_NEVER_BLOW)) return (FALSE);
/* Require eldritch horror */
if (!(r_ptr->flags2 & (RF2_ELDRITCH_HORROR))) return (FALSE);
int i;
nest_mon_info_type nest_mon_info[NUM_NEST_MON_TYPE];
- int align = 0;
+ monster_type align;
cave_type *c_ptr;
/* Prepare allocation table */
get_mon_num_prep(n_ptr->hook_func, NULL);
+ align.sub_align = SUB_ALIGN_NEUTRAL;
+
/* Pick some monster types */
for (i = 0; i < NUM_NEST_MON_TYPE; i++)
{
int r_idx = 0, attempts = 100;
+ monster_race *r_ptr = NULL;
while (attempts--)
{
/* Get a (hard) monster type */
r_idx = get_mon_num(dun_level + 10);
+ r_ptr = &r_info[r_idx];
/* Decline incorrect alignment */
- if (((align < 0) && (r_info[r_idx].flags3 & RF3_GOOD)) ||
- ((align > 0) && (r_info[r_idx].flags3 & RF3_EVIL)))
- {
- continue;
- }
+ if (monster_has_hostile_align(&align, 0, 0, r_ptr)) continue;
/* Accept this monster */
break;
if (!r_idx || !attempts) return;
/* Note the alignment */
- if (r_info[r_idx].flags3 & RF3_GOOD) align++;
- else if (r_info[r_idx].flags3 & RF3_EVIL) align--;
+ if (r_ptr->flags3 & RF3_EVIL) align.sub_align |= SUB_ALIGN_EVIL;
+ if (r_ptr->flags3 & RF3_GOOD) align.sub_align |= SUB_ALIGN_GOOD;
nest_mon_info[i].r_idx = r_idx;
nest_mon_info[i].used = FALSE;
int what[16];
- int align = 0;
+ monster_type align;
cave_type *c_ptr;
/* Prepare allocation table */
get_mon_num_prep(n_ptr->hook_func, NULL);
+ align.sub_align = SUB_ALIGN_NEUTRAL;
+
/* Pick some monster types */
for (i = 0; i < 16; i++)
{
int r_idx = 0, attempts = 100;
+ monster_race *r_ptr = NULL;
while (attempts--)
{
/* Get a (hard) monster type */
r_idx = get_mon_num(dun_level + 10);
+ r_ptr = &r_info[r_idx];
/* Decline incorrect alignment */
- if (((align < 0) && (r_info[r_idx].flags3 & RF3_GOOD)) ||
- ((align > 0) && (r_info[r_idx].flags3 & RF3_EVIL)))
- {
- continue;
- }
+ if (monster_has_hostile_align(&align, 0, 0, r_ptr)) continue;
/* Accept this monster */
break;
if (!r_idx || !attempts) return;
/* Note the alignment */
- if (r_info[r_idx].flags3 & RF3_GOOD) align++;
- else if (r_info[r_idx].flags3 & RF3_EVIL) align--;
+ if (r_ptr->flags3 & RF3_EVIL) align.sub_align |= SUB_ALIGN_EVIL;
+ if (r_ptr->flags3 & RF3_GOOD) align.sub_align |= SUB_ALIGN_GOOD;
what[i] = r_idx;
}
case '*':
if (randint0(100) < 75)
{
- place_object(y, x, FALSE, FALSE);
+ place_object(y, x, 0L);
}
else
{
case 'A':
/* Reward for Pattern walk */
object_level = base_level + 12;
- place_object(y, x, TRUE, FALSE);
+ place_object(y, x, AM_GOOD | AM_GREAT);
object_level = base_level;
break;
}
place_monster(y, x, PM_ALLOW_SLEEP);
monster_level = base_level;
object_level = base_level + 7;
- place_object(y, x, TRUE, FALSE);
+ place_object(y, x, AM_GOOD);
object_level = base_level;
break;
}
place_monster(y, x, PM_ALLOW_SLEEP);
monster_level = base_level;
object_level = base_level + 20;
- place_object(y, x, TRUE, TRUE);
+ place_object(y, x, AM_GOOD | AM_GREAT);
object_level = base_level;
break;
}
if (randint0(100) < 50)
{
object_level = base_level + 7;
- place_object(y, x, FALSE, FALSE);
+ place_object(y, x, 0L);
object_level = base_level;
}
break;
place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
monster_level = base_level;
object_level = base_level + 20;
- place_object(y, x, TRUE, FALSE);
+ place_object(y, x, AM_GOOD);
object_level = base_level;
}
else if (value < 5)
place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
monster_level = base_level;
object_level = base_level + 10;
- place_object(y, x, TRUE, FALSE);
+ place_object(y, x, AM_GOOD);
object_level = base_level;
}
else if (value < 10)
/* Object or trap */
if (randint0(100) < 25)
{
- place_object(y, x, FALSE, FALSE);
+ place_object(y, x, 0L);
}
else
{
if (randint0(100) < 50)
{
object_level = base_level + 7;
- place_object(y, x, FALSE, FALSE);
+ place_object(y, x, 0L);
object_level = base_level;
}
}
}
else if (randint0(100) < 50)
{
- place_object(y, x, FALSE, FALSE);
+ place_object(y, x, 0L);
}
}
build_small_room(x0, y0);
/* Place a treasure in the vault */
- place_object(y0, x0, FALSE, FALSE);
+ place_object(y0, x0, 0L);
/* Let's guard the treasure well */
vault_monsters(y0, x0, randint0(2) + 3);
int what[16];
- int align = 0;
+ monster_type align;
cave_type *c_ptr;
}
}
+ /* Pre-apply default mimic field */
+ cave[yval][xval].mimic = f_info[cave[yval][xval].feat].mimic;
+
/* Place the wall open trap */
- cave[yval][xval].mimic = cave[yval][xval].feat;
cave[yval][xval].feat = FEAT_TRAP_OPEN;
/* Prepare allocation table */
get_mon_num_prep(n_ptr->hook_func, vault_aux_trapped_pit);
+ align.sub_align = SUB_ALIGN_NEUTRAL;
+
/* Pick some monster types */
for (i = 0; i < 16; i++)
{
int r_idx = 0, attempts = 100;
+ monster_race *r_ptr = NULL;
while (attempts--)
{
/* Get a (hard) monster type */
r_idx = get_mon_num(dun_level + 0);
+ r_ptr = &r_info[r_idx];
/* Decline incorrect alignment */
- if (((align < 0) && (r_info[r_idx].flags3 & RF3_GOOD)) ||
- ((align > 0) && (r_info[r_idx].flags3 & RF3_EVIL)))
- {
- continue;
- }
+ if (monster_has_hostile_align(&align, 0, 0, r_ptr)) continue;
/* Accept this monster */
break;
if (!r_idx || !attempts) return;
/* Note the alignment */
- if (r_info[r_idx].flags3 & RF3_GOOD) align++;
- else if (r_info[r_idx].flags3 & RF3_EVIL) align--;
+ if (r_ptr->flags3 & RF3_EVIL) align.sub_align |= SUB_ALIGN_EVIL;
+ if (r_ptr->flags3 & RF3_GOOD) align.sub_align |= SUB_ALIGN_GOOD;
what[i] = r_idx;
}
/* Place a special trap */
c_ptr = &cave[rand_spread(yval, ysize/4)][rand_spread(xval, xsize/4)];
- c_ptr->mimic = c_ptr->feat;
+ c_ptr->mimic = f_info[c_ptr->feat].mimic;
c_ptr->feat = trap;
/* Message */