Code: Select all
local tg = {type="bolt", selffire=false, talent=t}
local old = self.energy.value
self.energy.value = self.energy.value + game.energy_to_act * 10
local reset = function(self)
self.energy.value = old
end
game.logPlayer(self, "Targeting fire arrow.")
local targets1 = self:archeryAcquireTargets(tg)
if not targets1 then reset(self) return end
game.logPlayer(self, "Targeting acid arrow.")
local targets2 = self:archeryAcquireTargets(tg)
if not targets2 then
reset(self)
local weapon, ammo = self:hasArcheryWeapon()
ammo.combat.shots_left = ammo.combat.shots_left + 1
return end
game.logPlayer(self, "Targeting cold arrow.")
local targets3 = self:archeryAcquireTargets(tg)
if not targets3 then
reset(self)
local weapon, ammo = self:hasArcheryWeapon()
ammo.combat.shots_left = ammo.combat.shots_left + 2
return end
game.logPlayer(self, "Targeting lightning arrow.")
local targets4 = self:archeryAcquireTargets(tg)
if not targets4 then
reset(self)
local weapon, ammo = self:hasArcheryWeapon()
ammo.combat.shots_left = ammo.combat.shots_left + 3
return end
reset(self)
local firemult = t.getDamageElemental(self, t)
local acidmult = t.getDamageElemental(self, t)
local coldmult = t.getDamageElemental(self, t)
local lightningmult = t.getDamageElemental(self, t)
--[[if targets1 == targets2 then
firemult = firemult - 0.1
acidmult = acidmult - 0.1
game.logPlayer(self, "It's the same!.")
end
if targets1 == targets3 then
firemult = firemult - 0.1
coldmult = coldmult - 0.1
game.logPlayer(self, "It's the same!.")
end
if targets1 == targets4 then
firemult = firemult - 0.1
lightningmult = lightningmult - 0.1
game.logPlayer(self, "It's the same!.")
end
if targets2 == targets3 then
acidmult = acidmult - 0.1
coldmult = coldmult - 0.1
game.logPlayer(self, "It's the same!.")
end
if targets2 == targets4 then
acidmult = acidmult - 0.1
lightningmult = lightningmult - 0.1
game.logPlayer(self, "It's the same!.")
end
if targets3 == targets4 then
coldmult = coldmult - 0.1
lightningmult = lightningmult - 0.1
game.logPlayer(self, "It's the same!.")
end]]
self:archeryShoot(targets1, t, tg, {mult=firemult, damtype=DamageType.FIRE})
self:archeryShoot(targets2, t, tg, {mult=acidmult, damtype=DamageType.ACID})
self:archeryShoot(targets3, t, tg, {mult=coldmult, damtype=DamageType.COLD})
self:archeryShoot(targets4, t, tg, {mult=lightningmult, damtype=DamageType.LIGHTNING})
-- HACK
self.energy.value = old - game.energy_to_act
return true