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 (feat_floor(c_ptr->mimic))
/* 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;
}
int what[16];
- int align = 0;
+ monster_type align;
cave_type *c_ptr;
/* 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;
}