-
Notifications
You must be signed in to change notification settings - Fork 657
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
HK: fix grubhunt required grubs count #4094
Conversation
Given how complicated this seems to be, can you add unit tests for it? |
Co-authored-by: Mysteryem <[email protected]>
"link_replacement": True, | ||
"replacement_item": "Grub", | ||
}] | ||
expected_grubs = 46 + 23 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked in DMs, but I should put this here as well:
Why is the expected grub count 69 when there are 92 Grubs in the pool and playthrough also expects players to get 92 Grubs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently only one of the players is linking the replacement Grub. I hate itemlinks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. There are always 1 fewer replacement items, per linked item, than the number of items being linked together.
If there were 6 players in an item link, linking an item between them would become 1 linked item + 5 replacements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, what I said is also apparently completely wrong. The link_relacement is for the group, the replacement item is per player
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested some configurations of players and saw that the proper values were found. The unit tests pass and the code makes sense after I, regretfully, learned a lot more about itemlinks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I trust medic
What is this fixing or adding?
somehow this mixup got into the final grubhunt PR
the original code that somehow got mixed up in the final grubhunt PR (in a per player loop, which is why we need the loop in the new code)
How was this tested?
gen'd with a breakpoint to confirm world.grub_count with 4 grubhunt: all players using both replacement grubs and null, and confirmed that the number gets honored when not using all still
If this makes graphical changes, please attach screenshots.