Sheol: Use absolute coordinates in Sheol midlevel house
 placement.

This avoids the left_right_3walls() hack that was ensuring no
empty pockets would form behind the house on the level. The
new placement always places the house right next to the wall,
making sure there cannot be anything behind it.


git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1243 f1e491ac-5ded-4967-80bf-9f4855be876a
Sheol: Fix sheol midlevel stairs placement. Allows flipping the
 level.

There was a problem with both stairs appearing in the Sheol midlevel
house area. This was caused by a mistake in the stairs regions in
the level description file. This commit fixes the region and again
allows flipping this level around.


git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1244 f1e491ac-5ded-4967-80bf-9f4855be876a
Sheol: Fix Sheol-only monsters not generated in Sheol.

This was caused by a generation flag G_SHEOLONLY meaning that
a monster should not be generated outside Sheol. The trick is that
it also doesn't mean it should be generated in Sheol (that would need
G_SHEOL flag to be set on the monster as well). This commit makes
G_SHEOLONLY also include G_SHEOL.


git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1245 f1e491ac-5ded-4967-80bf-9f4855be876a
Sheol: Boost Sheol-only monster generation in Sheol.



git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1246 f1e491ac-5ded-4967-80bf-9f4855be876a
Sheol: Fix Sheol monster generation some more.

It has to go right this time.


git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1247 f1e491ac-5ded-4967-80bf-9f4855be876a
lev_comp: Add external function level.mon_at()

MONSTER:'h', (5,5)

IF [ level.mon_at(monster:'h', (5,5)) ] {
   MESSAGE:"There is a monster of class h."
}

IF [ level.mon_at(monster:('h',"hobbit"), (5,5)) ] {
   MESSAGE:"There is a hobbit."
}

IF [ level.mon_at(monster:random, (5,5)) ] {
   MESSAGE:"There is a monster"
}




git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1248 f1e491ac-5ded-4967-80bf-9f4855be876a
Sheol: Make Sheol middle level house blend better with the level.



git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1249 f1e491ac-5ded-4967-80bf-9f4855be876a
Improve random location searches for special levels.

Fixes the problem of eels being generated in lava,
and improves monster random placement in general.



git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1250 f1e491ac-5ded-4967-80bf-9f4855be876a
Actually implement setting shape changer monster form in lev_comp.

Even though the level compiler allowed using
 MONSTER:"chameleon", random, m_monster "horse"
It wasn't actually implemented.

You can set the monster form for any of the shape changing monsters:
chameleons, doppelgangers and sandestins.



git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1251 f1e491ac-5ded-4967-80bf-9f4855be876a
Handle shape changer "random" appearance.

Using "random" as a shape changer monster appearance
will make the monster choose an appropriate random shape.
Sandestins will usually pick a nasty monster,
doppelgangers usually choose a monster player,
and chameleons pretend to be an animal.



git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1252 f1e491ac-5ded-4967-80bf-9f4855be876a
lev_comp: Change WALLIFY to accept a selection parameter.


git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1253 f1e491ac-5ded-4967-80bf-9f4855be876a
lev_comp: Allow math expressions and vars in FOR-loop start and end values. 



git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1254 f1e491ac-5ded-4967-80bf-9f4855be876a
lev_comp: Allow variables in SPILL parameters.

SPILL: $coord, $mapchar, north, $length



git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1255 f1e491ac-5ded-4967-80bf-9f4855be876a
lev_comp: Add selection gradients.


gradient(grad_type, (min_dist - max_dist [, limited]), coord [, coord2 ])

Selects random points with distance from coord between min_dist
and max_dist, with higher probability closer to max_dist.
No points closer than min_dist will be included. All points at
max_dist will be included.

Using the optional "limited" will make the selection stop at max_dist.
Leaving the "limited" out, or using "unlimited", will select all points
outside the max_dist radius.

grad_type can be one of "radial" or "square", and affects the distance
calculation from the center.

Using an optional second coordinate, the "center" of the area is
a line segment between the two coordinates.


For example:
 $r = selection: gradient(radial, (1 - 9, limited), (11,10))
 TERRAIN:$r,'L'




git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1256 f1e491ac-5ded-4967-80bf-9f4855be876a
lev_comp: Make square gradient selection work more like it should.


git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1257 f1e491ac-5ded-4967-80bf-9f4855be876a
Fix mswin compilation


git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1258 f1e491ac-5ded-4967-80bf-9f4855be876a
Some commands should be allowed to use coordinates outside the level;
don't complain in those cases.

Use the correct flag for solid wall if placing an incorporeal monster.

Guard against accessing level data outside level.


git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1259 f1e491ac-5ded-4967-80bf-9f4855be876a
Remove unused function set_terrain()


git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1260 f1e491ac-5ded-4967-80bf-9f4855be876a
lev_comp: Allow BREAKing out of new places.

BREAK can be used within LOOPs, FOR-loops, SWITCHes,
ROOMs, SUBROOMs, CONTAINERs, MONSTER inventories, and REGIONs. 


git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1261 f1e491ac-5ded-4967-80bf-9f4855be876a
Don't hang in infinite loop if special level has nothing but solid stone.


git-svn-id: https://unnethack.svn.sourceforge.net/svnroot/unnethack/trunk@1262 f1e491ac-5ded-4967-80bf-9f4855be876a