server icon indicating copy to clipboard operation
server copied to clipboard

[LUA] WS crit cratio max should be 1 higher than normal cratio max

Open MowFord opened this issue 10 months ago • 4 comments

I affirm:

  • [x] I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • [x] I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • [x] I have read and understood the Contributing Guide and the Code of Conduct.
  • [x] I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.

What does this pull request do?

The issue fixed a couple weeks ago related to crit ws always critting made me wonder why we didn't notice sooner, and i found that cratio is being heavily limited for crit attacks

The cratio clamp is not properly extending the max, artificially limiting the dmg output of weaponskill hits that crit. We need to adjust two things:

  • clamp the cratio at 1 more than the max for crits
  • Adjust the getMeleePDifRange function to not hard cap at 3, now that we have a pdif weapon table, we can copy the logic from the xi.combat.physical.calculateMeleePDIF function

Edit: i've added a printDebug local function similar to here. Set the localvar debug equal to 1 on a player and they get pdif prints for each ws hit

image

Steps to test these changes

print of the cratio values inside of the ws function affected (xi.weaponskills.cMeleeRatio)

print(fmt("{}: cratio-{} min-{} max-{} critmin-{} critmax-{}", attacker:getName(), cratio, pdif[1], pdif[2], pdifcrit[1], pdifcrit[2]))

Then use ws for various weapon types after setting the target's def high/low to see the ranges scaling across pdif max and attack vs def of attacker/defender

  • !setmod def -500
  • !setmod def 1000

example of club vs h2h, then 3rd is h2h with defender having very high def: image

MowFord avatar Mar 28 '24 17:03 MowFord

Is there anything (other than your sanity) from stopping weaponskill.lua using the xi.combat.physical.calculateMeleePDIF function instead?

If it's just your sanity, understandable. we all hate that file.

WinterSolstice8 avatar Mar 30 '24 05:03 WinterSolstice8

Is there anything (other than your sanity) from stopping weaponskill.lua using the xi.combat.physical.calculateMeleePDIF function instead?

If it's just your sanity, understandable. we all hate that file.

Yea I looked at the flow and there's so much that would need to change to use the physical util

MowFord avatar Mar 30 '24 13:03 MowFord

I've added some debug prints that have been helpful in troubleshooting all this. Edited the OP about it

Edit: slight update to the debug print since I assume this is waiting re-approval for fmt exclusion to be merged and this branch rebased

MowFord avatar Apr 05 '24 14:04 MowFord

Rebased so we'd pass lua styling checks btw (from using fmt)

MowFord avatar Apr 21 '24 20:04 MowFord