talent with projection

If you have a module that you'd like comments on or would like to know how to create your very own module, post here

Moderator: Moderator

Post Reply
Message
Author
Jurriaan
Wyrmic
Posts: 227
Joined: Mon Mar 25, 2013 9:39 am

talent with projection

#1 Post by Jurriaan »

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:

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,
}
but I have a hard time finding a talent with projection that seems to resemble what I want.

Thanks!

PseudoLoneWolf
Wyrmic
Posts: 257
Joined: Tue Jan 03, 2017 7:12 pm

Re: talent with projection

#2 Post by PseudoLoneWolf »

Your description of the skill sounds like something that you could finagle out of Slime Spit with some work. For one thing, Slime Spit always bounces if there's an enemy in range, so you'll have to play around with that behavior (only bouncing when it kills), and the number of bounces is dependent on size rather than TL but that shouldn't be hard to check.
Let slip the toast of war.

Jurriaan
Wyrmic
Posts: 227
Joined: Mon Mar 25, 2013 9:39 am

Re: talent with projection

#3 Post by Jurriaan »

I noticed trick shot getting even closer, now that I saw what to search for. Thanks!

Post Reply