"lua error:/engine/interface/Game Targeting.lua:124: data/talent/gifts/wrath.lua:98: attempt to index global 'Object' (a nil value)
Here is the code for the talent in question:
Code: Select all
newTalent{
name = "tree growth",
type = {"wild-gift/wrath", 3},
require = gifts_req3,
points = 5,
random_ego = "defensive",
equilibrium = 10,
cooldown = 30,
range = 10,
tactical = { DISABLE = 2 },
requires_target = true,
action = function(self, t)
local tg = {type="bolt", range=self:getTalentRange(t), nolock=true, talent=t}
local x, y = self:getTarget(tg)
if not x or not y then return nil end
local _ _, x, y = self:canProject(tg, x, y)
if game.level.map:checkEntity(x, y, Map.TERRAIN, "block_move") then return nil end
local e = Object.new{
old_feat = game.level.map(x, y, Map.TERRAIN),
name = "summoned Tree",
display = '#', color=colors.LIGHT_BLUE, back_color=colors.BLUE,
always_remember = true,
can_pass = {pass_wall=1},
block_move = true,
block_sight = true,
temporary = 4 + self:getTalentLevel(t),
x = x, y = y,
canAct = false,
act = function(self)
self:useEnergy()
self.temporary = self.temporary - 1
if self.temporary <= 0 then
game.level.map(self.x, self.y, engine.Map.TERRAIN, self.old_feat)
game.level:removeEntity(self)
game.level.map:redisplay()
end
end,
summoner_gain_exp = true,
summoner = self,
}
game.level:addEntity(e)
game.level.map(x, y, Map.TERRAIN, e)
return true
end,
info = function(self, t)
return ([[Summons an tree for %d turns.]]):format(4 + self:getTalentLevel(t))
end,
}