Lua: ice theme room and melting ice
Allow the ice theme room to occasionally have melting ice. Add nh.abscoord() to convert room-relative to map-absolute coords.
This commit is contained in:
@@ -73,7 +73,16 @@ themerooms = {
|
||||
function()
|
||||
des.room({ type = "themed", filled = 1,
|
||||
contents = function()
|
||||
des.terrain(selection.floodfill(1,1), "I");
|
||||
local ice = selection.floodfill(1,1);
|
||||
des.terrain(ice, "I");
|
||||
if (percent(25)) then
|
||||
local mintime = 1000 - (nh.level_difficulty() * 100);
|
||||
local ice_melter = function(x,y)
|
||||
local ax,ay = nh.abscoord(x,y);
|
||||
nh.start_timer_at(ax,ay, "melt-ice", mintime + nh.rn2(1000));
|
||||
end;
|
||||
ice:iterate(ice_melter);
|
||||
end
|
||||
end
|
||||
});
|
||||
end,
|
||||
|
||||
Reference in New Issue
Block a user