Making a projectile vary in speed and persist
Posted: Tue Jun 03, 2014 8:22 am
I have a spell in my addon (the code of which is below) that fires a slow moving bolt that pulses damage around it each turn. While potent, some of my players find it awkward to use due to 2 reasons:
1) The slow movement means that ranged attackers and fast melee like snakes can often evade it entirely or evade it
2) Another ability detonates the orb, but as a projectile the orb will vanish on reaching the target square, meaning you always need to target 1 space beyond
Merely speeding up the orb will cause it to do less damage due to it passing mobs too quickly, so my idea was to give it 'variable, decaying' speed. So if you targeted something within 2 tiles, it would travel at the usual 1.25 speed. If you targeted it at 10, it would initial travel at 400%, then drop to 200% the next turn, then 125% (numbers are made up). On top of this, rather than disappear on reaching the location, it would 'persist' for a single turn, in order to get another tick of damage and allow for easy detonation. Can anyone give me some pointers on how to do this? Or if anyone else has a better design idea for this spell, I'd be open to that.
1) The slow movement means that ranged attackers and fast melee like snakes can often evade it entirely or evade it
2) Another ability detonates the orb, but as a projectile the orb will vanish on reaching the target square, meaning you always need to target 1 space beyond
Merely speeding up the orb will cause it to do less damage due to it passing mobs too quickly, so my idea was to give it 'variable, decaying' speed. So if you targeted something within 2 tiles, it would travel at the usual 1.25 speed. If you targeted it at 10, it would initial travel at 400%, then drop to 200% the next turn, then 125% (numbers are made up). On top of this, rather than disappear on reaching the location, it would 'persist' for a single turn, in order to get another tick of damage and allow for easy detonation. Can anyone give me some pointers on how to do this? Or if anyone else has a better design idea for this spell, I'd be open to that.
Code: Select all
newTalent{
name = "Cold Flames", short_name = "COLD_FLAMES_2",
type = {"spell/grave",3},
require = spells_req3,
points = 5,
random_ego = "attack",
mana = 18,
cooldown = 6,
tactical = { ATTACKAREA = { COLD = 2 } },
range = 10,
proj_speed = 1.25,
getDamage = function(self, t) return self:combatTalentSpellDamage(t, 18, 190) end,
on_learn = function(self, t)
self:learnTalent(self.T_COLD_FLAMES_DETONATE, nil, nil, {no_unlearn=true})
end,
on_unlearn = function(self, t)
self:unlearnTalent(self.T_COLD_FLAMES_DETONATE)
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"
local aoe = {type="ball", radius=1, friendlyfire=false, talent=t or tg.talent}
self:project(aoe, px, py, function(tx, ty)
DamageType:get(DamageType.COLD).projector(self, tx, ty, DamageType.COLD, dam, {type="freeze"})
end)
end)
return true
end,
info = function(self, t)
local dam = t.getDamage(self, t)
return ([[Conjure a sphere of cold fire that slowly drifts outwards, dealing %0.2f cold damage to adjacent targets each turn. While the sphere is active, you gain the ability to detonate it.
The damage will increase with your Spellpower.]]):format(damDesc(self, DamageType.COLD, dam))
end,
}