git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3987 c06c8d41-db1a-0410-9941-cceddc491573
44YRMW5JNVUBYX3M6UFQOPENNHGO7G2CRZ7SGPIIUTQGYWTRWENAC
XXZGTB5UAFMP2SW2WWUHCTDY5TEM7LZEPAASEXKQLT7BSLBY3OTQC
KA5FM5FELFEKHCCICIQCKVKOLHOYXOCODGK4NFJWRSPJ4UXULC2AC
ED62QWGKBPORWVKDFOQRKJXEIWZVNGR3O4KWQBDSRNPT36AYOQYAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
UU5EKED2RA2U3CFZ3UEJQEWSWHQPEU7ZD4KH3I22IIVZFHD4Y67QC
AUXHSGS4EFOPZ6TVZYWNVOUDO7NYKUKE3HBKGQQWTALSVFOE3HAAC
7Y5HSDFKA5TPLS2TWTRFMQVX6UXUDHXU5MUMXQSDFAIY4THQ3BIQC
RGHXFBNIULRVRYLBGG5JZDMYVM2E2JJ2Y5KQPMU6PUS3V26G6ZXQC
H3552BCIAVBLKAYKE4DHFLBLFW5RGRMYBMRRYHYEB5IPIJRUVU5QC
VCISXSXE6WGRO6PQN7Y6IFZ7C4VFUMKQK6KGAXA6YZ5RCZIB64WAC
W52PCSHX72WAMWKG6L4BPUBVMO6E72KYYBNKAA7554KNOTY6V7WQC
// This is assuming the royal jelly is a unique monster. Is it?
// FIXME: Needs check for being at bottom level of the branch.
if (monster->type == MONS_ROYAL_JELLY
&& player_in_branch( BRANCH_SLIME_PITS ))
{
mpr("Suddenly, all colour oozes out of the surrounding stone!",
MSGCH_MONSTER_ENCHANT);
replace_area_wrapper(DNGN_STONE_WALL, DNGN_CLEAR_ROCK_WALL);
}
-- Special effects for Slime:6
function slime_wall_morph(x)
local stone = dgn.feature_number('stone_wall')
local inlos = false
for x = 0, dgn.GXM - 1 do
for y = 0, dgn.GYM - 1 do
if dgn.grid(x, y) == stone and you.see_grid(x, y) then
inlos = true
break
end
end
if inlos then break end
end
dgn.replace_feat { stone_wall= "clear_rock_wall" }
if inlos then
crawl.mpr("Suddenly all colour oozes out of the stone walls.",
"monster_enchant")
else
crawl.mpr("You feel a strange vibration for a moment.",
"monster_enchant")
end
end
}}
function dgn.fnum(feat)
if type(feat) == 'string' then
return dgn.feature_number(feat)
else
return feat
end
end
function dgn.fnum_map(map)
local fnmap = { }
for k, v in pairs(map) do
fnmap[dgn.fnum(k)] = dgn.fnum(v)
end
return fnmap
end
-- Replaces all features matching
function dgn.replace_feat(rmap)
local cmap = dgn.fnum_map(rmap)
for x = 0, dgn.GXM - 1 do
for y = 0, dgn.GYM - 1 do
local grid = dgn.grid(x, y)
local repl = cmap[grid]
if repl then
dgn.terrain_changed(x, y, repl)
end
end
end
end