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

Slightly decreased random elite chance

Random elites must now respect talent levels (roughtly)
Implode is not usable by NPCs


git-svn-id: http://svn.net-core.org/repos/t-engine4@5105 51575b47-30f0-44d4-a5cc-537603b46e54
parent 132b660c
No related branches found
No related tags found
No related merge requests found
......@@ -1108,6 +1108,7 @@ function _M:entityFilterPost(zone, level, type, e, filter)
return true
end,
level = filter.random_elite.level or zone:level_adjust_level(level, zone, type),
check_talents_level = true,
}
e = self:createRandomBoss(e, table.merge(base, filter.random_elite, true))
end
......@@ -1591,7 +1592,19 @@ function _M:createRandomBoss(base, data)
-- Select additional talents from the class
local list = {}
for _, t in pairs(b.talents_def) do if b.talents_types[t.type[1]] and not t.no_npc_use then list[t.id] = true end end
for _, t in pairs(b.talents_def) do
if b.talents_types[t.type[1]] and not t.no_npc_use then
local ok = true
if data.check_talents_level then
local req = util.getval(rawget(t, 'require'), b, t)
if req and req.level and util.getval(req.level, 1) > data.level then
print("Random boss forbade talent because of level", t.name, data.level)
end
end
if ok then list[t.id] = true end
end
end
local nb = 4 + (data.level / 7)
nb = math.max(rng.range(math.floor(nb * 0.7), math.ceil(nb * 1.3)), 1)
print("Adding "..nb.." random class talents to boss")
......
......@@ -25,7 +25,7 @@ module(..., package.seeall, class.inherit(OnSpots))
function _M:init(zone, map, level, spots)
OnSpots.init(self, zone, map, level, spots)
local data = level.data.generator.actor
self.randelite = data.randelite or 20
self.randelite = data.randelite or 25
end
function _M:generateOne()
......
......@@ -25,7 +25,7 @@ module(..., package.seeall, class.inherit(Random))
function _M:init(zone, map, level, spots)
Random.init(self, zone, map, level, spots)
local data = level.data.generator.actor
self.randelite = data.randelite or 20
self.randelite = data.randelite or 25
end
function _M:generateOne()
......
......@@ -123,7 +123,7 @@ function _M:attackTarget(target, damtype, mult, noenergy)
local hd = {"Combat:attackTarget", target=target, damtype=damtype, mult=mult, noenergy=noenergy}
if self:triggerHook(hd) then
speed, hit, damtype, mult = ht.speed, hd.hit, hd.damtype, hd.mult
speed, hit, damtype, mult = hd.speed, hd.hit, hd.damtype, hd.mult
if hd.stop then return hit end
end
......
......@@ -111,6 +111,7 @@ newTalent{
end,
psi = 40,
tactical = { ATTACK = { PHYSICAL = 2 } },
no_npc_use = true,
range = function(self, t)
local r = 3
local gem_level = getGemLevel(self)
......
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