[RC1] Arcane Combat attempting to cast spells cooling down?
Posted: Mon Dec 17, 2012 8:28 pm
I was just playing a caster based Arcane Blade with psiblades that had all three spells (Flame, Lightning and Earthen Missiles). I was planing on using my mana to fire of two spells and use the last one to trigger Arcane Combat but when I have two out of three spells on cooldown my it felt like Arcane Combat rarely triggered.
From magical-combat.lua:37
As far as I can see it nevers checks if the spell is on cooldown. The code itself make a point of setting the spells cooldown back to the starting cooldown.
But according to the description a cooling down spell should never get selected.
self:forceUseTalent can be found in game\engines\te4-0.9.43.teae \engine\interface\ActorTalents.lua:225 and it in turn calls useTalent (line 115) which have the following line. My logfile is filled with "is still on cooldown for" lines so it seems like Arcane Combat is unintentionally gimped.
The solution is to changetoif you should be able to cast a cooling down spell or to add a isTalentCoolingDown check on line 40, 41 and 42
toI am not really sure about the syntax for the isTalentCoolingDown negation but you get the point.
From magical-combat.lua:37
Code: Select all
local spells = {}
local fatigue = (100 + 2 * self:combatFatigue()) / 100
local mana = self:getMana() - 1
if self:knowTalent(self.T_FLAME) and mana > self:getTalentFromId(self.T_FLAME).mana * fatigue then spells[#spells+1] = self.T_FLAME end
if self:knowTalent(self.T_LIGHTNING) and mana > self:getTalentFromId(self.T_LIGHTNING).mana * fatigue then spells[#spells+1] = self.T_LIGHTNING end
if self:knowTalent(self.T_EARTHEN_MISSILES) and mana > self:getTalentFromId(self.T_EARTHEN_MISSILES).mana * fatigue then spells[#spells+1] = self.T_EARTHEN_MISSILES end
Code: Select all
local old_cd = self:isTalentCoolingDown(self:getTalentFromId(tid))
self:forceUseTalent(tid, {ignore_energy=true, force_target={x=target_x, y=target_y, __no_self=true}})
-- Do not setup a cooldown
if not old_cd then
self.talents_cd[tid] = nil
end
self:forceUseTalent can be found in game\engines\te4-0.9.43.teae \engine\interface\ActorTalents.lua:225 and it in turn calls useTalent (line 115) which have the following line.
Code: Select all
if self:isTalentCoolingDown(ab) and not ignore_cd then
game.logPlayer(who, "%s is still on cooldown for %d turns.", ab.name:capitalize(), self.talents_cd[ab.id])
return
end
The solution is to change
Code: Select all
self:forceUseTalent(tid, {ignore_energy=true, force_target={x=target_x, y=target_y, __no_self=true}})
Code: Select all
self:forceUseTalent(tid, {ignore_energy=true, ignore_cd=true, force_target={x=target_x, y=target_y, __no_self=true}})
Code: Select all
if self:knowTalent(self.T_FLAME) and mana > self:getTalentFromId(self.T_FLAME).mana * fatigue then spells[#spells+1] = self.T_FLAME end
Code: Select all
if self:knowTalent(self.T_FLAME) and self:isTalentCoolingDown(self.T_FLAME) == false and mana > self:getTalentFromId(self.T_FLAME).mana * fatigue then spells[#spells+1] = self.T_FLAME end