Skip to content
Snippets Groups Projects
Commit 75979a8d authored by DarkGod's avatar DarkGod
Browse files

Merge branch 'fix_ice_wall' into 'master'

Fix ice wall

fixed ice wall targeting, found some upvalues, fixed those
parents 6a49dbf8 1479bfeb
No related branches found
No related tags found
No related merge requests found
......@@ -117,7 +117,13 @@ newTalent{
range = 10,
tactical = { DISABLE = 2 },
requires_target = true,
target = function(self, t) return {type="wall", range=self:getTalentRange(t), halflength=halflength, talent=t, halfmax_spots=halflength+1, block_radius=block} end,
target = function(self, t)
local halflength = math.floor(t.getLength(self,t)/2)
local block = function(_, lx, ly)
return game.level.map:checkAllEntities(lx, ly, "block_move")
end
return {type="wall", range=self:getTalentRange(t), halflength=halflength, talent=t, halfmax_spots=halflength+1, block_radius=block}
end,
on_learn = function(self, t) self.resists[DamageType.COLD] = (self.resists[DamageType.COLD] or 0) + 1 end,
on_unlearn = function(self, t) self.resists[DamageType.COLD] = (self.resists[DamageType.COLD] or 0) - 1 end,
getDuration = function(self, t) return math.floor(self:combatTalentScale(t, 5, 9)) end,
......@@ -125,10 +131,6 @@ newTalent{
getIceDamage = function(self, t) return self:combatTalentMindDamage(t, 3, 15) end,
getIceRadius = function(self, t) return math.floor(self:combatTalentScale(t, 1, 2)) end,
action = function(self, t)
local halflength = math.floor(t.getLength(self,t)/2)
local block = function(_, lx, ly)
return game.level.map:checkAllEntities(lx, ly, "block_move")
end
local tg = self:getTalentTarget(t)
local x, y = self:getTarget(tg)
if not x or not y then return nil end
......@@ -159,7 +161,8 @@ newTalent{
dam = ice_damage,
radius = ice_radius,
act = function(self)
local tg = {type="ball", range=0, radius=ice_radius, friendlyfire=false, talent=t, x=self.x, y=self.y}
local t = self.summoner:getTalentFromId(self.T_ICE_WALL)
local tg = {type="ball", range=0, radius=self.radius, friendlyfire=false, talent=t, x=self.x, y=self.y}
self.summoner.__project_source = self
self.summoner:project(tg, self.x, self.y, engine.DamageType.ICE, self.dam)
self.summoner.__project_source = nil
......
......@@ -152,7 +152,7 @@ newTalent{
dam = forge_damage,
radius = self:getTalentRadius(t),
act = function(self)
local t = self:getTalentFromId(self.T_FORGE_BELLOWS)
local t = self.summoner:getTalentFromId(self.T_FORGE_BELLOWS)
local tg = {type="ball", range=0, friendlyfire=false, radius = 1, talent=t, x=self.x, y=self.y,}
self.summoner.__project_source = self
self.summoner:project(tg, self.x, self.y, engine.DamageType.DREAMFORGE, self.dam)
......
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