Page 1 of 1
[1.0.4] Vimsense doesn't work correctly on items
Posted: Wed Aug 21, 2013 10:46 pm
by minmay
vim.lua line 64:
Code: Select all
a:setEffect(a.EFF_VIMSENSE, 2, {power=self:combatTalentSpellDamage(self.T_VIMSENSE, 10, 45)})
self.T_VIMSENSE is the actor's Vimsense talent, which works fine if you're casting the spell...but doesn't work fine at all if you're using it from an item, such as Corrupted Gaze. Should be changed to
Code: Select all
a:setEffect(a.EFF_VIMSENSE, 2, {power=self:combatTalentSpellDamage(t, 10, 45)})
Re: [1.0.4] Vimsense doesn't work correctly on items
Posted: Thu Aug 22, 2013 6:15 pm
by Hachem_Muche
Those changes don't fix the problem. The issue is that, after the initial item activation, the calculation performed in
minmay wrote:vim.lua line 64:
Code: Select all
a:setEffect(a.EFF_VIMSENSE, 2, {power=self:combatTalentSpellDamage(self.T_VIMSENSE, 10, 45)})
is rerun with the player's talent stats (which are overridden by the item's talent stats when it's used by the use object code), that often include no talent levels. The fix is to store the appropriate value for blight resistance and then apply that on each turn as needed. This is the 1.0.5 compatible patch:
Code: Select all
game/modules/tome/data/talents/corruptions/vim.lua | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/game/modules/tome/data/talents/corruptions/vim.lua b/game/modules/tome/data/talents/corruptions/vim.lua
index 092bbe7..d1081a7 100644
--- a/game/modules/tome/data/talents/corruptions/vim.lua
+++ b/game/modules/tome/data/talents/corruptions/vim.lua
@@ -61,11 +61,12 @@ newTalent{
self:setEffect(self.EFF_SENSE, t.getDuration(self,t), {
range = rad,
actor = 1,
+ VimsensePenalty = t.getResistPenalty(self,t), -- Compute resist penalty at time of activation
on_detect = function(self, x, y)
local a = game.level.map(x, y, engine.Map.ACTOR)
if not a or self:reactionToward(a) >= 0 then return end
a:setTarget(game.player)
- a:setEffect(a.EFF_VIMSENSE, 2, {power=t.getResistPenalty(self,t)})
+ a:setEffect(a.EFF_VIMSENSE, 2, {power=self:hasEffect(self.EFF_SENSE).VimsensePenalty or 0})
end,
})
game:playSoundNear(self, "talents/spell_generic")