#define SP_COORD_IS_RANDOM 0x01000000
/* Humidity flags for get_location() and friends, used with
* SP_COORD_PACK_RANDOM() */
-#define DRY 0x1
-#define WET 0x2
-#define HOT 0x4
-#define SOLID 0x8
-#define ANY_LOC 0x10 /* even outside the level */
+#define DRY 0x01
+#define WET 0x02
+#define HOT 0x04
+#define SOLID 0x08
+#define ANY_LOC 0x10 /* even outside the level */
#define NO_LOC_WARN 0x20 /* no complaints and set x & y to -1, if no loc */
+#define SPACELOC 0x40 /* like DRY, but accepts furniture too */
#define SP_COORD_X(l) (l & 0xff)
#define SP_COORD_Y(l) ((l >> 16) & 0xff)
STATIC_DCL void FDECL(create_trap, (trap *, struct mkroom *));
STATIC_DCL int FDECL(noncoalignment, (ALIGNTYP_P));
STATIC_DCL boolean FDECL(m_bad_boulder_spot, (int, int));
+STATIC_DCL int FDECL(pm_to_humidity, (struct permonst *));
STATIC_DCL void FDECL(create_monster, (monster *, struct mkroom *));
STATIC_DCL void FDECL(create_object, (object *, struct mkroom *));
STATIC_DCL void FDECL(create_altar, (altar *, struct mkroom *));
|| typ == CORR)
return TRUE;
}
+ if ((humidity & SPACELOC) && SPACE_POS(levl[x][y].typ))
+ return TRUE;
if ((humidity & WET) && is_pool(x, y))
return TRUE;
if ((humidity & HOT) && is_lava(x, y))
return FALSE;
}
+STATIC_OVL int
+pm_to_humidity(pm)
+struct permonst *pm;
+{
+ int loc = DRY;
+ if (!pm)
+ return loc;
+ if (pm->mlet == S_EEL || amphibious(pm) || is_swimmer(pm))
+ loc = WET;
+ if (is_flyer(pm) || is_floater(pm))
+ loc |= (HOT | WET);
+ if (passes_walls(pm) || noncorporeal(pm))
+ loc |= SOLID;
+ if (flaming(pm))
+ loc |= HOT;
+ return loc;
+}
+
STATIC_OVL void
create_monster(m, croom)
monster *m;
pm = (struct permonst *) 0;
if (pm) {
- int loc = DRY;
- if (pm->mlet == S_EEL || amphibious(pm) || is_swimmer(pm))
- loc = WET;
- if (is_flyer(pm) || is_floater(pm))
- loc |= (HOT | WET);
- if (passes_walls(pm) || noncorporeal(pm))
- loc |= SOLID;
- if (flaming(pm))
- loc |= HOT;
+ int loc = pm_to_humidity(pm);
/* If water-liking monster, first try is without DRY */
get_location_coord(&x, &y, loc | NO_LOC_WARN, croom, m->coord);
if (x == -1 && y == -1) {