Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sayterdarkwynd committed Jan 24, 2017
1 parent fb48df9 commit 8c557e9
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 24 deletions.
12 changes: 9 additions & 3 deletions items/active/weapons/bow/abilities/bowshot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ function BowShot:setCritDamage(damage)
--used for checking dual-wield setups
local opposedhandHeldItem = world.entityHandItem(activeItem.ownerEntityId(), activeItem.hand() == "primary" and "alt" or "primary")
local weaponModifier = config.getParameter("critChance",0)
if not self.critChance then
local self.critChance = 0
end

if heldItem then
if root.itemHasTag(heldItem, "bow") then
self.critChance = 9 + weaponModifier
Expand All @@ -38,6 +36,9 @@ function BowShot: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
Expand All @@ -52,7 +53,12 @@ function BowShot:setCritDamage(damage)
damage = crit and (damage*2) + self.critBonus or damage

if crit then
if heldItem then
-- exclude mining lasers
if not root.itemHasTag(heldItem, "mininggun") then
status.addEphemeralEffect("crithit", 0.3, activeItem.ownerEntityId())
end
end
end

return damage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,16 @@ function setCritDamageBoomerang(damage)
local heldItem = world.entityHandItem(activeItem.ownerEntityId(), activeItem.hand())
--used for checking dual-wield setups
local opposedhandHeldItem = world.entityHandItem(activeItem.ownerEntityId(), activeItem.hand() == "primary" and "alt" or "primary")
local weaponModifier = config.getParameter("critChance",0)

local weaponModifier = config.getParameter("critChance",0)
if heldItem then
if root.itemHasTag(heldItem, "magnorb") then
self.critChance = 4 + 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
-- this next modifier only applies if they have a multiply item equipped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ function setCritDamageBoomerang(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
-- this next modifier only applies if they have a multiply item equipped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,16 @@ function setCritDamageBoomerang(damage)
local heldItem = world.entityHandItem(activeItem.ownerEntityId(), activeItem.hand())
--used for checking dual-wield setups
local opposedhandHeldItem = world.entityHandItem(activeItem.ownerEntityId(), activeItem.hand() == "primary" and "alt" or "primary")
local weaponModifier = config.getParameter("critChance",0)

local weaponModifier = config.getParameter("critChance",0)
if heldItem then
if root.itemHasTag(heldItem, "magnorb") then
self.critChance = 4 + 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
-- this next modifier only applies if they have a multiply item equipped
Expand Down
4 changes: 3 additions & 1 deletion items/active/weapons/other/magnorbs/magnorbs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ function setCritDamageBoomerang(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
-- this next modifier only applies if they have a multiply item equipped
Expand Down
4 changes: 3 additions & 1 deletion items/active/weapons/other/magnorbs/magnorbs_multi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ function setCritDamageBoomerang(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
-- this next modifier only applies if they have a multiply item equipped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ function setCritDamageBoomerang(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
-- this next modifier only applies if they have a multiply item equipped
Expand Down
4 changes: 3 additions & 1 deletion items/active/weapons/other/magnorbs/magnorbsquad.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ function setCritDamageBoomerang(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
-- this next modifier only applies if they have a multiply item equipped
Expand Down
8 changes: 4 additions & 4 deletions items/active/weapons/ranged/gunfire.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ function GunFire:setCritDamage(damage)
--used for checking dual-wield setups
local opposedhandHeldItem = world.entityHandItem(activeItem.ownerEntityId(), activeItem.hand() == "primary" and "alt" or "primary")
local weaponModifier = config.getParameter("critChance",0)
if not self.critChance then
local self.critChance = 0
end

if heldItem then
if root.itemHasTag(heldItem, "pistol") then
self.critChance = 4 + weaponModifier
Expand All @@ -60,7 +58,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
-- this next modifier only applies if they have a multiply item equipped
Expand Down
10 changes: 4 additions & 6 deletions items/active/weapons/weapon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@ end
-- FU Crit Damage Script

function setCritDamage(damage)

-- check their equipped weapon
-- Primary hand, or single-hand equip
local heldItem = world.entityHandItem(activeItem.ownerEntityId(), activeItem.hand())
--used for checking dual-wield setups
local opposedhandHeldItem = world.entityHandItem(activeItem.ownerEntityId(), activeItem.hand() == "primary" and "alt" or "primary")
local weaponModifier = config.getParameter("critChance",0)

if heldItem then
if root.itemHasTag(heldItem, "dagger") then
self.critChance = 1 + weaponModifier
Expand All @@ -63,13 +62,12 @@ function setCritDamage(damage)
self.critChance = 3 + weaponModifier
elseif root.itemHasTag(heldItem, "rapier") then
self.critChance = 1 + weaponModifier
elseif root.itemHasTag(heldItem, "mininggun") then
self.critChance = 0
end
end

if not self.critChance then
local self.critChance = 0
end
self.critChance = 0
end
--sb.logInfo("crit chance base="..self.critChance)

--critBonus is bonus damage done with crits
Expand Down

0 comments on commit 8c557e9

Please sign in to comment.