Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lua] Fix Casket Drop Rate Prowess #6406

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Changes from all commits
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
2 changes: 1 addition & 1 deletion scripts/globals/caskets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ local function dropChance(player)
--end

if player:hasStatusEffect(xi.effect.PROWESS_CASKET_RATE) then
prowessCasketsPower = casketProwessEffect:getPower()
prowessCasketsPower = casketProwessEffect:getPower() / 100
Copy link
Contributor

Choose a reason for hiding this comment

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

While you're here and you understand the code, can you change the local rand = math.random() below this to be math.random(1, 100) (like we're trying to use in the rest of the code?

Would that remove the need for this /100 divisor?

Copy link
Contributor Author

@UmeboshiXI UmeboshiXI Nov 4, 2024

Choose a reason for hiding this comment

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

I can change/update it. May need to make some adjustments. I could remove /100 divisor but something similar will still be needed depending on which option you prefer.

xi.settings.main.CASKET_DROP_RATE = 0.10 Default Setting.

kupowersMMBPower and prowessCasketsPower are integers (effect:getPower())

Options:

  1. I could change the casket droprate in settings to use 1-100 instead of a 0.0-1.0 float.

  2. I could multiply the settings drop rate by 100 to convert it into an integer. (This is the code block right below the original commit that adds/clamps everything)

    if math.random(1, 100) < utils.clamp((xi.settings.main.CASKET_DROP_RATE * 100) + kupowersMMBPower + prowessCasketsPower, 0, 100) then return true end

Whichever style/option you prefer.

Copy link
Contributor

Choose a reason for hiding this comment

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

If it's a much wider change, then leave it as it is 👍

end

local rand = math.random()
Expand Down
Loading