Skip to content
Snippets Groups Projects
Commit b0040a0d authored by DarkGod's avatar DarkGod
Browse files

fix intuitive shot

parent d6971f3d
Branches minmay-bugfixes
No related tags found
No related merge requests found
...@@ -128,33 +128,44 @@ newTalent{ ...@@ -128,33 +128,44 @@ newTalent{
points = 5, points = 5,
cooldown = 10, cooldown = 10,
sustain_stamina = 30, sustain_stamina = 30,
no_reload_break = true,
no_energy = true,
require = techs_dex_req_high3, require = techs_dex_req_high3,
tactical = { BUFF = 2 }, tactical = { BUFF = 2 },
getDist = function(self, t) return math.floor(self:combatTalentScale(t, 1, 3)) end, getDist = function(self, t) return math.floor(self:combatTalentLimit(t, 11, 1, 3)) end, -- Limit <=10
getChance = function(self, t) return math.floor(self:combatTalentLimit(t, 100, 20, 50)) end, getChance = function(self, t) return math.floor(self:combatTalentLimit(t, 100, 20, 50)) end,
archery_onhit = function(self, t, target, x, y) archery_onhit = function(self, t, target, x, y)
if not target or not target:canBe("knockback") then return end if not target or not target:canBe("knockback") then return end
target:knockback(self.x, self.y, t.getDist(self, t)) target:knockback(self.x, self.y, t.getDist(self, t))
end, end,
-- called by _M:attackTarget in mod.class.interface.Combat.lua
proc = function(self, t, target) proc = function(self, t, target)
if not self:hasArcheryWeapon() then return end local weapon, ammo = self:hasArcheryWeapon()
if not weapon then return end
if self.turn_procs.intuitive_shots and self.turn_procs.intuitive_shots ~= target then return end if self.turn_procs.intuitive_shots and self.turn_procs.intuitive_shots ~= target then return end
if self.turn_procs.intuitive_shots == target then return true end if self.turn_procs.intuitive_shots == target then return true end
local targets = self:archeryAcquireTargets(nil, {one_shot=true, x=target.x, y=target.y}) --Ammo check done here
local targets = self:archeryAcquireTargets(nil, {one_shot=true, x=target.x, y=target.y}) if not targets then return end
if targets then self:archeryShoot(targets, t, nil, {mult=self:combatTalentWeaponDamage(t, 0.4, 0.9)}) end
self.turn_procs.intuitive_shots = target self.turn_procs.intuitive_shots = target
return true local xatk, ret = 1e6, true
--Precheck hit chance so a miss doesn't stop the melee attack
if not self:checkHit(self:combatAttackRanged(weapon, ammo), target:combatDefenseRanged()) or target:checkEvasion(self) then
xatk, ret = -1e6, false
end
game.logSeen(self, "%s %s the attack!", self.name:capitalize(), ret and "intercepts" or "fails to intercept")
self:archeryShoot(targets, t, nil, {atk = xatk, mult=self:combatTalentWeaponDamage(t, 0.4, 0.9)})
return ret
end, end,
on_pre_use = function(self, t, silent) if not self:hasArcheryWeapon() then if not silent then game.logPlayer(self, "You require a bow or sling for this talent.") end return false end return true end, on_pre_use = function(self, t, silent) if not self:hasArcheryWeapon() then if not silent then game.logPlayer(self, "You require a bow or sling for this talent.") end return false end return true end,
activate = function(self, t) activate = function(self, t)
return {} return {}
end, end,
deactivate = function(self, t, p) deactivate = function(self, t, p)
return true
end, end,
info = function(self, t) info = function(self, t)
return ([[Activating this talent enhances your reflexes to incredible levels. Each time you are attacked in melee, you have a %d%% chance get a defensive shot off in time to intercept the attack, fully disrupting it and all other attacks from the attacker for the turn. return ([[Activating this talent enhances your reflexes to incredible levels. Each time you are attacked in melee, you have a %d%% chance get a defensive shot off in time to intercept the attack, fully disrupting it (including extra blows from certain talents), dealing %d%% archery damage, and knocking the attacker back %d tiles.
In addition, the shot deals %d%% damage and causes %d knockback.]]) Activating this talent will not interrupt reloading.]])
:format(t.getChance(self, t), self:combatTalentWeaponDamage(t, 0.4, 0.9) * 100, t.getDist(self, t)) :format(t.getChance(self, t), self:combatTalentWeaponDamage(t, 0.4, 0.9) * 100, t.getDist(self, t))
end, end,
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment