talent with projection
Posted: Tue Dec 05, 2017 6:01 pm
Given a description of a talent like this:
Born in the mountains, you are very familiar with boulders. Throw a large boulder at your enemy,
doing 200-600 physical damage. The Boulder interferes with their movement, slowing them down by 20-60%
for 3-7 turns. Each size category above +2 makes you able to throw larger boulders, gaining 25% damage
per size category. Range 3+level.
At talent level 7, you learn to give the boulder a lot of spin, making it have a 75% chance of bouncing towards enemy after killing the first, gaining power as it does so (25% for each kill). The number of enemies you can reach depends on your size - 1 for each level above +1.
in what function or addon source would I best look to implement the projection part?
I now have this (untested, uncompiled) mess:
but I have a hard time finding a talent with projection that seems to resemble what I want.
Thanks!
Born in the mountains, you are very familiar with boulders. Throw a large boulder at your enemy,
doing 200-600 physical damage. The Boulder interferes with their movement, slowing them down by 20-60%
for 3-7 turns. Each size category above +2 makes you able to throw larger boulders, gaining 25% damage
per size category. Range 3+level.
At talent level 7, you learn to give the boulder a lot of spin, making it have a 75% chance of bouncing towards enemy after killing the first, gaining power as it does so (25% for each kill). The number of enemies you can reach depends on your size - 1 for each level above +1.
in what function or addon source would I best look to implement the projection part?
I now have this (untested, uncompiled) mess:
Code: Select all
newTalent{
short_name = "bouncingboulder",
name = "Bouncing Boulder",
type = {"race/troll", 4},
require = racial_req4,
points = 5,
cooldown = function(self,t) return math.floor(100/self.size_category) end,
direct_hit = true,
requires_target = true,
getDam = function(self, t) return self:combatScale(self:getStr() * self:getTalentLevel(t) * 2, 12, 0, 262, 500) end,
getDist = function(self, t) return math.floor(self:combatTalentScale(t, 4, 8)) end,
action = function(self, t)
local tg = self:getTalentTarget(t)
local x, y = self:getTarget(tg)
if not x or not y then return nil end
local target = game.level.map(x, y, engine.Map.ACTOR) or self.ai_target.actor or {name="something"}
self:logCombat(target, "#Source# hurls a huge boulder at #target#!")
self:project(tg, x, y, DamageType.PHYSICAL, {dist=t.getDist(self, t), dam=self:mindCrit(t.getDam(self, t))}, {type="archery"})
game:playSoundNear(self, "talents/ice")
return true
end,
info = function(self, t)
return ([[Throw a huge boulder, dealing %0.2f physical damage at a target in range %d and slowing them down for %d%% for %d turns.
The damage will increase with your Strength.]]):format(damDesc(self, DamageType.PHYSICAL, t.getDam(self, t)), self:getTalentRadius(t))
end,
}
Thanks!