From b946965af53ff0028f794794403f1dc88d640fbd Mon Sep 17 00:00:00 2001 From: sayterdarkwynd Date: Tue, 24 Jan 2017 08:16:41 -0500 Subject: [PATCH] bow fix --- items/active/weapons/bow/abilities/bowshot.lua | 5 ++++- items/active/weapons/ranged/gunfire.lua | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/items/active/weapons/bow/abilities/bowshot.lua b/items/active/weapons/bow/abilities/bowshot.lua index 96dd7482..4b2f4311 100644 --- a/items/active/weapons/bow/abilities/bowshot.lua +++ b/items/active/weapons/bow/abilities/bowshot.lua @@ -32,11 +32,14 @@ function BowShot:setCritDamage(damage) if heldItem then if root.itemHasTag(heldItem, "bow") then self.critChance = 9 + weaponModifier - elseif if root.itemHasTag(heldItem, "crossbow") then + elseif root.itemHasTag(heldItem, "crossbow") then self.critChance = 9 + weaponModifier end end --sb.logInfo("crit chance base="..self.critChance) + if not self.critChance then + self.critChance = 0 + end --critBonus is bonus damage done with crits self.critBonus = ( ( ( (status.stat("critBonus") + config.getParameter("critBonus",0)) * self.critChance ) /100 ) /2 ) or 0 diff --git a/items/active/weapons/ranged/gunfire.lua b/items/active/weapons/ranged/gunfire.lua index 85bc50bb..4f56cbac 100644 --- a/items/active/weapons/ranged/gunfire.lua +++ b/items/active/weapons/ranged/gunfire.lua @@ -55,6 +55,9 @@ function GunFire:setCritDamage(damage) end end --sb.logInfo("crit chance base="..self.critChance) + if not self.critChance then + self.critChance = 0 + end --critBonus is bonus damage done with crits self.critBonus = ( ( ( (status.stat("critBonus") + config.getParameter("critBonus",0)) * self.critChance ) /100 ) /2 ) or 0