1) While it was intended that the orb fires once per turn, instead it fires once per tile moved, leading to double the number of projectiles. I could just halve the damage to rebalance, but that feels a little awkward. Is there a way to change this to only fire once per turn?
2) Currently the bolts fired by the orb inherit the properties of the main spell, so speed, name, appearance etc. This is a problem as another spell detonates the orb, but due to sharing names it can target bolts too. The bolts also move very slowly due to inheriting the 200% movespeed, and it'd be nice to give them a different appearance to distinguish between the two. Is there a way to set these, or perhaps a way for the orb to call another function that creates the shards? This could also solve problem #1, as I could change the orb to range 4-5 to make it fire the right number of shards, which may be a better solution.
3) The orb is most effective when it travels the full distance, but being a beam targeting it tends to just default to the nearest target. This is pretty awkward to use, so ideally I'd like the targeting to be range 1 (like Fearless Cleave) and just have the orb travel to max range from there. Not sure if this is remotely possible though.
I've included the code below, this is a pretty difficult problem so thanks for any help in advance.
Code: Select all
newTalent{
name = "Frozen Orb",
type = {"spell/grave",1},
require = spells_req1,
points = 5,
random_ego = "attack",
mana = 14,
cooldown = 5,
tactical = { ATTACKAREA = { COLD = 2 } },
range = 10,
proj_speed = 2,
getDamage = function(self, t) return self:combatTalentSpellDamage(t, 12, 100) end,
getNb = function(self,t) return math.floor(self:combatTalentScale(t, 3, 5)) end,
action = function(self, t)
local tg = {type="beam", range=self:getTalentRange(t), talent=t, display={particle="bolt_ice"}}
local x, y = self:getTarget(tg)
if not x or not y then return nil end
local _ _, x, y = self:canProject(tg, x, y)
local dam = self:spellCrit(t.getDamage(self,t))
self:projectile(tg, x, y, function(px, py, tg, self)
name = "Frozen Orb (Main)"
local tgts = {}
local grids = core.fov.circle_grids(self.x, self.y, self:getTalentRange(t), true)
for x, yy in pairs(grids) do for y, _ in pairs(grids[x]) do
local a = game.level.map(x, y, Map.ACTOR)
if a and self:reactionToward(a) < 0 then
tgts[#tgts+1] = a
end
end end
local nb = t.getNb(self,t)
-- local tg2 = {type="bolt", range=self:getTalentRange(t), talent=t, friendlyfire=false, display={particle="arrow", particle_args={tile="particles_images/ice_shards"}}, start_x = px, start_y = py,}
local tg2 = {type="bolt", range=self:getTalentRange(t), talent=t, friendlyfire=false, display={particle="bolt_ice"}, start_x = px, start_y = py,}
for i = 1, nb do
if #tgts <= 0 then break end
local a, id = rng.table(tgts)
table.remove(tgts, id)
self:projectile(table.clone(tg2), a.x, a.y, DamageType.COLD, self:spellCrit(t.getDamage(self, t)), {type="freeze"})
end
end)
return true
end,
info = function(self, t)
local dam = t.getDamage(self, t)
local nb = t.getNb(self,t)
return ([[Conjure a frozen orb that slowly drifts outwards, firing %d ice shards each turn at nearby foes that deal %0.2f cold damage.
The damage will increase with your Spellpower.]]):format(nb, damDesc(self, DamageType.COLD, dam))
end,
}