[RC1] Arcane Combat attempting to cast spells cooling down?

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
Moander
Halfling
Posts: 88
Joined: Fri Jan 06, 2012 11:48 am

[RC1] Arcane Combat attempting to cast spells cooling down?

#1 Post by Moander »

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

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
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.

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
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.

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
My logfile is filled with "is still on cooldown for" lines so it seems like Arcane Combat is unintentionally gimped.

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}})
to

Code: Select all

self:forceUseTalent(tid, {ignore_energy=true, ignore_cd=true, force_target={x=target_x, y=target_y, __no_self=true}})
if you should be able to cast a cooling down spell or to add a isTalentCoolingDown check on line 40, 41 and 42

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
to

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
I am not really sure about the syntax for the isTalentCoolingDown negation but you get the point.

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: [RC1] Arcane Combat attempting to cast spells cooling do

#2 Post by darkgod »

fixed
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply