Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Fixed issue #325 #585

Merged
merged 2 commits into from
May 12, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions scripts/globals/weaponskills.lua
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ function doPhysicalWeaponskill(attacker, target, wsID, wsParams, tp, action, pri
if (wsParams.ignoresDef == not nil and wsParams.ignoresDef == true) then
ignoredDef = calculatedIgnoredDef(tp, target:getStat(tpz.mod.DEF), wsParams.ignored100, wsParams.ignored200, wsParams.ignored300)
end
local cratio, ccritratio = cMeleeRatio(attacker, target, wsParams, ignoredDef)
local cratio, ccritratio = cMeleeRatio(attacker, target, wsParams, ignoredDef, tp)

-- Set up conditions and wsParams used for calculating weaponskill damage
local gorgetBeltFTP, gorgetBeltAcc = handleWSGorgetBelt(attacker)
Expand Down Expand Up @@ -638,9 +638,9 @@ function getRangedHitRate(attacker,target,capHitRate,bonus)
end

function fTP(tp,ftp1,ftp2,ftp3)
if (tp < 1000) then
tp = 1000
end
--if (tp < 1000) then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these aren't being used anymore, they can just be deleted 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the intent was to floor at the minimum tp you could have in order to ws "just in case" some server decided to let you ws with less. I have no idea if thats even a problem but if it is I think that should be taken care of by whoever is customizing :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I believe it's not a necessary check either, as this function defaults to returning an ftp of 1 for invalid TP values anyway.

So I support the outright removal of the comment parts, @Xlaits ! 👍

-- tp = 1000
--end
if (tp >= 1000 and tp < 2000) then
return ftp1 + ( ((ftp2-ftp1)/1000) * (tp-1000))
elseif (tp >= 2000 and tp <= 3000) then
Expand All @@ -662,13 +662,13 @@ function calculatedIgnoredDef(tp, def, ignore1, ignore2, ignore3)
end

-- Given the raw ratio value (atk/def) and levels, returns the cRatio (min then max)
function cMeleeRatio(attacker, defender, params, ignoredDef)
function cMeleeRatio(attacker, defender, params, ignoredDef, tp)

local flourisheffect = attacker:getStatusEffect(tpz.effect.BUILDING_FLOURISH)
if flourisheffect ~= nil and flourisheffect:getPower() > 1 then
attacker:addMod(tpz.mod.ATTP, 25 + flourisheffect:getSubPower() / 2)
end
local atkmulti = fTP(params.atk100, params.atk200, params.atk300)
local atkmulti = fTP(tp, params.atk100, params.atk200, params.atk300)
local cratio = (attacker:getStat(tpz.mod.ATT) * atkmulti) / (defender:getStat(tpz.mod.DEF) - ignoredDef)
cratio = utils.clamp(cratio, 0, 2.25)
if flourisheffect ~= nil and flourisheffect:getPower() > 1 then
Expand Down