Skip to content
Snippets Groups Projects
Commit 93b1b67b authored by dg's avatar dg
Browse files

change

git-svn-id: http://svn.net-core.org/repos/t-engine4@5118 51575b47-30f0-44d4-a5cc-537603b46e54
parent 137bec7e
No related branches found
No related tags found
No related merge requests found
......@@ -149,9 +149,7 @@ local function archery_projectile(tx, ty, tg, self, tmp)
print("[ATTACK ARCHERY] after range", dam)
local crit
if tg.archery.crit_chance then self.combat_physcrit = self.combat_physcrit + tg.archery.crit_chance end
dam, crit = self:physicalCrit(dam, ammo, target, atk, def)
if tg.archery.crit_chance then self.combat_physcrit = self.combat_physcrit - tg.archery.crit_chance end
dam, crit = self:physicalCrit(dam, ammo, target, atk, def, tg.archery.crit_chance or 0, tg.archery.crit_power or 0)
print("[ATTACK ARCHERY] after crit", dam)
dam = dam * mult
......
......@@ -1131,11 +1131,11 @@ function _M:combatCritReduction()
end
--- Computes physical crit for a damage
function _M:physicalCrit(dam, weapon, target, atk, def)
function _M:physicalCrit(dam, weapon, target, atk, def, add_chance, crit_power_add)
local tier_diff = self:getTierDiff(atk, def)
local chance = self:combatCrit(weapon)
local crit_power_add = 0
local chance = self:combatCrit(weapon) + (add_chance or 0)
crit_power_add = crit_power_add or 0
local crit = false
if self:knowTalent(self.T_BACKSTAB) and target:attr("stunned") then chance = chance + self:getTalentLevel(self.T_BACKSTAB) * 10 end
......@@ -1175,8 +1175,8 @@ function _M:physicalCrit(dam, weapon, target, atk, def)
end
--- Computes spell crit for a damage
function _M:spellCrit(dam, add_chance)
local crit_power_add = 0
function _M:spellCrit(dam, add_chance, crit_power_add)
crit_power_add = crit_power_add or 0
local chance = self:combatSpellCrit() + (add_chance or 0)
local crit = false
......@@ -1215,8 +1215,8 @@ function _M:spellCrit(dam, add_chance)
end
--- Computes mind crit for a damage
function _M:mindCrit(dam, add_chance)
local crit_power_add = 0
function _M:mindCrit(dam, add_chance, crit_power_add)
crit_power_add = crit_power_add or 0
local chance = self:combatMindCrit() + (add_chance or 0)
local crit = false
......
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