Allow webs to be placed without a giant spider on them

Allow creating webs without spiders in the lua level scripts:

des.trap({ type = "web", spider_on_web = 0 });

Based on xNetHack commit by copperwater <aosdict@gmail.com>.

Also changes the Spider nest themed room to generate without
spiders when the level difficulty is 8 or less.
This commit is contained in:
Pasi Kallinen
2021-05-10 17:48:47 +03:00
parent 09b71fcc95
commit 1e1d580336
6 changed files with 29 additions and 15 deletions

View File

@@ -101,22 +101,21 @@ themerooms = {
},
-- Spider nest
{
mindiff = 10,
contents = function()
des.room({ type = "themed",
function()
des.room({ type = "themed",
contents = function(rm)
local spooders = nh.level_difficulty() > 8;
for x = 0, rm.width - 1 do
for y = 0, rm.height - 1 do
if (percent(30)) then
des.trap("web", x, y);
des.trap({ type = "web", x = x, y = y,
spider_on_web = spooders and percent(80) });
end
end
end
end
});
end
},
});
end,
-- Trap room
function()