Skip to content
Snippets Groups Projects
Commit ed56bb19 authored by dg's avatar dg
Browse files

Low levels of the Infinite Dungeon do not all have random bosses

git-svn-id: http://svn.net-core.org/repos/t-engine4@4012 51575b47-30f0-44d4-a5cc-537603b46e54
parent 93a068a8
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ function _M:generate()
-- Add a guard on the stairs, except on the last level
local data = self.level.data.generator.actor
local glevel = self.zone.max_level
if self.level.level < glevel and self.level.default_down and data.guard then
if self.level.level < glevel and self.level.default_down and data.guard and (not data.guard_test or data.guard_test(self.level)) then
local m = self.zone:makeEntity(self.level, "actor", rng.table(data.guard), nil, true)
if m then
local x, y = util.findFreeGrid(self.level.default_down.x, self.level.default_down.y, 5, true, {[Map.ACTOR]=true})
......
......@@ -44,6 +44,11 @@ return {
},
actor = {
class = "mod.class.generator.actor.RandomStairGuard",
guard_test = function(level)
local allow = {[5]=true, [8]=true, [11]=true, [14]=true, [16]=true, [18]=true, [20]=true, [22]=true, [24]=true, [26]=true, [28]=true }
if level.level >= 30 then return true end
return allow[level.level]
end,
guard = {
{random_boss={rank = 3.5, loot_quantity = 3,}},
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment