Skip to content
Snippets Groups Projects
Commit 2949243a authored by Hachem_Muche's avatar Hachem_Muche
Browse files

Update tactical info for some charm talents.

Fixed targetting bugs in Retch and Stone Wall.
parent bee1d278
No related branches found
No related tags found
No related merge requests found
......@@ -83,8 +83,8 @@ newAI("use_tactical", function(self)
if type(tactical) == "function" then tactical = tactical(self, t) end
if tactical and aitarget then
local tg = self:getTalentTarget(t)
-- print("** target parameters:")
-- table.print(tg, "---")
--print("** target parameters:")
--table.print(tg, "---")
local default_tg = {type=util.getval(t.direct_hit, self, t) and "hit" or "bolt"}
-- Only assume range... some talents may no require LOS, etc
local within_range = target_dist and target_dist <= ((self:getTalentRange(t) or 0) + (self:getTalentRadius(t) or 0))
......@@ -100,6 +100,7 @@ newAI("use_tactical", function(self)
t_avail = true
end
if t_avail then
--print("** ", t.name, "available")
-- Project the talent if possible, counting foes and allies hit
local foes_hit = {}
local allies_hit = {}
......
......@@ -108,12 +108,27 @@ newTalent{
positive = 10,
negative = 10,
no_energy = true,
tactical = { DEFEND = 2, ATTACKAREA = 1 },
on_pre_use_ai = function(self, t) return not self:hasEffect(self.EFF_SANCTITY) end,
tactical = {
DEFEND = function(self, t, aitarget) -- can the target silence us?
local num, t = 0
for tid, lev in pairs(aitarget.talents) do
t = aitarget.talents_def[tid]
if t.tactical and type(t.tactical) == "table" and t.tactical.disable and type(t.tactical.disable) == "table" and t.tactical.disable.silence then
num = num + 1
end
end
return math.min(num*2, 2)
end,
DISABLE = function(self, t, aitarget)
if aitarget:attr("has_arcane_knowledge") and self.fov.actors[aitarget] and self.fov.actors[aitarget].sqdist < t.radius(self, t)^2 then return {silence = 2} end
end
},
getDuration = function(self, t) return math.floor(self:combatTalentScale(t, 4, 8)) end,
range = 0,
radius = function(self, t) return math.floor(self:combatTalentScale(t, 2.5, 4.5)) end,
target = function(self, t)
return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t)}
return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t), selffire = false}
end,
action = function(self, t)
-- Add a lasting map effect
......@@ -145,7 +160,7 @@ newTalent{
positive = 10,
negative = 10,
no_energy = true,
tactical = { DEFEND = 2, ATTACKAREA = {LIGHT = 0.5, DARKNESS = 0.5} },
tactical = { DEFEND = 2, ESCAPE = 1, ATTACKAREA = {LIGHT = 0.5, DARKNESS = 0.5} },
getDuration = function(self, t) return math.floor(self:combatTalentScale(t, 4, 8)) end,
range = 0,
radius = function(self, t) return math.floor(self:combatTalentScale(t, 2.5, 4.5)) end,
......
......@@ -69,13 +69,17 @@ newTalent{
random_ego = "attack",
cooldown = 22,
positive = -15,
tactical = { ATTACKAREA = {LIGHT = 1}, DISABLE = 2 },
tactical = { DISABLE = 2,
ATTACKAREA = function(self, t, aitarget)
if self:getTalentLevel(t) >= 3 then return {light = 1} end
end, },
direct_hit = true,
range = 0,
radius = function(self, t) return math.floor(self:combatTalentScale(t, 2.5, 4.5)) end,
target = function(self, t)
return {type="ball", range=self:getTalentRange(t), selffire=false, radius=self:getTalentRadius(t), talent=t}
end,
requires_target = true,
getDamage = function(self, t) return self:combatTalentSpellDamage(t, 4, 80) end,
getDuration = function(self, t) return math.floor(self:combatTalentScale(t, 4, 8)) end,
action = function(self, t)
......
......@@ -78,7 +78,7 @@ newTalent{
cooldown = 10,
hate = 12,
range = 5,
tactical = { ATTACK = { MIND = 2 } },
tactical = { ATTACK = { MIND = 2 }, HATE = 1 },
direct_hit = true,
requires_target = true,
getDuration = function(self, t)
......
......@@ -306,9 +306,14 @@ newTalent{
type = {"wild-gift/objects", 1},
points = 5,
no_energy = true,
tactical = { ATTACK = { ARCANE = 3 } },
tactical = { DISABLE = function(self, t, aitarget)
return (aitarget:attr("has_arcane_knowledge") and 1 or 0) + (self:getTalentLevel(t)>=5 and (aitarget.undead or aitarget.construct) and 1 or 0)
end,
ATTACK = function(self, t, aitarget)
return self:getTalentLevel(t)>=5 and (aitarget.undead or aitarget.construct) and {arcane = 2} or 0
end,
},
cooldown = function(self, t) return 50 end,
tactical = { HEAL = 2 },
target = function(self, t)
return {type="hit", range=1, talent=t}
end,
......
......@@ -133,11 +133,25 @@ newTalent{
points = 5,
cooldown = 40,
mana = 50,
range = 7,
tactical = { ATTACKAREA = {PHYSICAL = 2}, DISABLE = 4, DEFEND = 3, PROTECT = 3, ESCAPE = 1 },
target = function(self, t) return {type="ball", nowarning=true, selffire=false, friendlyfire=false, range=self:getTalentRange(t), radius=1, talent=t} end,
range = function(self, t) return self:getTalentLevel(t) >= 4 and 7 or 0 end,
radius = 1,
target = function(self, t) return {type="ball", nowarning=true, selffire=false, friendlyfire=false, range=self:getTalentRange(t), radius=self:getTalentRadius(t), talent=t} end,
tactical = { ATTACKAREA = {PHYSICAL = 2},
DISABLE = function(self, t, aitarget)
return self:getTalentLevel(t) >=4 and self.fov.actors[aitarget] and self.fov.actors[aitarget].sqdist > 1 and 1 or nil
end,
DEFEND = function(self, t, aitarget) -- surrounded by foes
return self.fov.actors[aitarget] and self.fov.actors[aitarget].sqdist <= 1 and 3 or nil
end,
PROTECT = function(self, t, aitarget) -- summoner needs protection
return self.summoner and self:getTalentLevel(t) >=4 and core.fov.distance(self.summoner.x, self.summoner.y, aitarget.x, aitarget.y) > 1 and 3 or nil
end,
ESCAPE = function(self, t, aitarget) -- protect self or trap target
return self.fov.actors[aitarget] and self.fov.actors[aitarget].sqdist > 1 and 1 or nil
end
},
getDamage = function(self, t) return self:combatTalentSpellDamage(t, 20, 250) end,
requires_target = function(self, t) return self:getTalentLevel(t) >= 4 end,
requires_target = true,
getDuration = function(self, t) return util.bound(2 + self:combatTalentSpellDamage(t, 5, 12), 2, 25) end,
action = function(self, t)
local x, y = self.x, self.y
......
......@@ -59,7 +59,7 @@ newTalent{
points = 5,
mana = 25,
cooldown = 18,
tactical = { DEFEND = 2 },
tactical = { DEFEND = 2, HEAL = 1 },
range = 10,
no_energy = true,
getMaxAbsorb = function(self, t) return 50 + self:combatTalentSpellDamage(t, 50, 450) end,
......
......@@ -128,7 +128,7 @@ newTalent{
stamina = 10,
require = techs_strdex_req3,
no_energy = true,
tactical = { ATTACK = 4 },
tactical = { BUFF = 2 },
getDuration = function(self, t) return math.floor(self:combatTalentLimit(t, 25, 2, 6)) end, -- Limit < 25
getAtk = function(self, t) return self:combatTalentScale(t, 40, 100, 0.75) end,
action = function(self, t)
......
......@@ -84,26 +84,37 @@ newTalent{
require = undeads_req3,
points = 5,
cooldown = 25,
tactical = { ATTACK = { BLIGHT = 1 }, HEAL = 1 },
tactical = { ATTACKAREA = function(self, t, aitarget)
return not aitarget:attr("undead") and { BLIGHT = 1 } or nil
end,
HEAL = function(self, t, aitarget)
return self:attr("undead") and 1 or nil
end},
range=1,
radius = 3,
target = function(self, t) return {type="ball", range=self:getTalentRange(t), radius=self:getTalentRadius(t), selffire = not self:attr("undead")} end, --selffire is set only for the ai, the map effect doesn't use it
requires_target = true,
getduration = function(self, t) return self:combatTalentScale(t, 7, 15, 0.5) end,
getPurgeChance = function(self, t) return self:combatTalentLimit(t, 100, 5, 25) end, -- Limit < 100%
-- status effect removal handled in mod.data.damage_types (type = "RETCH")
action = function(self, t)
local duration = t.getduration(self, t)
local radius = 3
local dam = 10 + self:combatTalentStatDamage(t, "con", 10, 60)
local tg = {type="ball", range=self:getTalentRange(t), radius=radius}
local tg = self:getTalentTarget(t)
local tx, ty = self:getTarget(tg)
if not tx or not ty then return nil end
local _, tx, ty = self:canProject(tg, tx, ty)
-- Add a lasting map effect
game.level.map:addEffect(self,
self.x, self.y, duration,
tx, ty, duration,
DamageType.RETCH, dam,
radius,
tg.radius,
5, nil,
MapEffect.new{color_br=30, color_bg=180, color_bb=60, effect_shader="shader_images/retch_effect.png"},
nil, self:spellFriendlyFire()
)
game.logSeen(self, "%s #YELLOW_GREEN#VOMITS#LAST# on the ground!", self.name:capitalize())
game:playSoundNear(self, "talents/cloud")
return true
end,
......
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