Possible to use damage formula of different talent?
Posted: Sat Feb 10, 2018 5:09 pm
I'm trying to rewrite shockwave bomb into a skill that deals the theoretical maximum bonus of explosive expert contained to a single tile based on the level of throw bomb, and only have range scale with talent level (with damage being based on throw bomb's talent level/damage formula). It took a bit but I got shockwave bomb (renamed contained explosion) to deal the same multiplier as the maximum of explosion fairly easily.
However, I'm stumped on how to get it to have its damage based on throw bomb's. It's very easy to give it the same formula as throw bomb, but it feels somewhat weird to need 5 points in it.
I've tried replacing compute damage with
throws (attempt to index global 'self' (nil value)
returns :
attempt to index local 'ammo' a nil value
When I try to add ammo to it it gets... weird.
I'll just post the screenshot of the error it gives when trying to create a new character.

Disabling zomnibus gives this error instead :
https://imgur.com/a/K2i9n
I've also tried creating a local variable that gets the talent level of throw bomb and then just using that in place of the "t" in the same compute damage block as I have in throw bomb.
When I do this, contained explosion deals 5.7 damage while throw bomb deals 33.7, and I'm not sure why (just on hovering over it at level 1, and when trying it out this damage calculation is correct, though it's pre explosion expert modifier).
edit : I believe i've figured it out. I needed to call it under action(self, t)
like this :
It's doing exactly 25% lower damage for some reason, but that's really easy to fix.
However, I'm stumped on how to get it to have its damage based on throw bomb's. It's very easy to give it the same formula as throw bomb, but it feels somewhat weird to need 5 points in it.
I've tried replacing compute damage with
Code: Select all
dam = self:callTalent(self.T_THROW_BOMB "computeDamage", t),
Code: Select all
computeDamage = function(self, t) return self:callTalent(self.T_THROW_BOMB, "computeDamage") end,
attempt to index local 'ammo' a nil value
When I try to add ammo to it it gets... weird.
Code: Select all
computeDamage = function(self, t, ammo) return self:callTalent(self.T_THROW_BOMB, "computeDamage") end,

Disabling zomnibus gives this error instead :
https://imgur.com/a/K2i9n
I've also tried creating a local variable that gets the talent level of throw bomb and then just using that in place of the "t" in the same compute damage block as I have in throw bomb.
Code: Select all
computeDamage = function(self, t, ammo)
local inc_dam = 0
local predam = self:getTalentLevel(self.T_THROW_BOMB)
local damtype = DamageType.SPELLKNOCKBACK
local particle = "ball_physical"
if self:isTalentActive(self.T_ACID_INFUSION) then damtype = DamageType.ACID_BLIND; particle = "ball_acid"
elseif self:isTalentActive(self.T_LIGHTNING_INFUSION) then damtype = DamageType.LIGHTNING_DAZE; particle = "ball_lightning_beam"
elseif self:isTalentActive(self.T_FROST_INFUSION) then damtype = DamageType.ICE_SLOWONLY; particle = "ball_ice"
elseif self:isTalentActive(self.T_FIRE_INFUSION) then damtype = DamageType.FIREBURN; particle = "fireflash"
end
-- want to make field occur twice but am unsure how
inc_dam = inc_dam + (ammo.alchemist_bomb and ammo.alchemist_power or 0) / 100
local dam = self:combatTalentSpellDamage(predam, 5, 175, ((self:combatSpellpower()*1.5 - 5)))
local dam = dam * (1 + inc_dam)
return dam, damtype, particle
end,
edit : I believe i've figured it out. I needed to call it under action(self, t)
like this :
Code: Select all
local dam, damtype, particle = self:callTalent(self.T_THROW_BOMB, "computeDamage", self, t, ammo)