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

Fix aspd buffing v1 #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

nmaligec
Copy link

@nmaligec nmaligec commented Aug 2, 2021

This fix addresses 2 points that still prevent aspd buffs from selecting the correct character.

  1. The extremely low but still present chance that a valid character is not chosen at random from the list of units even after 1000 tries. Now an eligible character will always get chosen without even needing to retry.
  2. The list used to detect ineligible characters was repurposed from other code. That list is for characters who cannot safely do damage on their own and so should not appear as the only selections on the buy screen. For example on that list is the 'sage' which cannot do damage (until level 3) but would charge faster with an aspd buff. Now a new list has been added to determine which characters should receive an aspd buff. Additionally, the list of non cooldown and non attacking characters have been updated against the current characters in the game.

I'm also pushing an alternate v2 of this fix, that does the same thing but a bit more efficiently. Instead of lookup tables, it uses variables set for each character in the Player:init section. You can decide which approach, if any, you prefer. This also gave me a chance to learn about basic branching in Git, I hope you don't mind.

… code that deal with awarding a character their aspd buff.
The original list of non_attacking_characters seems to have been used in buy_screen.lua to prevent all three buyable character options from being on that list. It is more accurately a list of characters who cannot safely do damage on their own, reguardless of whether they could benefit from an aspd increase. For example a lvl 1 sage cannot do damage but does use a timer with the 'shoot' tag for an attack. Only timed actions that have a 'shoot' or 'attack' tag can benefit from an aspd buff. The creation of a separate list was needed to accurately record which characters don't have approriate tags in thier timed actions.

A thorough inspection the Player:init code and lots of testing were done to verify which characters should be on what list. As a result the non_attacking_characters and non_cooldown_characters lists were updated and the new non_speed_buffable list was added. Note: all psykers were removed from the non attacking list, since after the orb update they can viably do damage on their own.
@nmaligec
Copy link
Author

nmaligec commented Aug 7, 2021

I just noticed that in the code, a level 3 fairy can pick the exact same unit twice! The unit doesn't gain any extra benefit and the second buff is wasted.

The motivation for making this fix came from watching a YouTube run where they were trying a build that forced attack speed buffs to target certain units. Here is the video timestamped 8 seconds before where a max fairy only buffs 1 unit. I originally thought it was because of case 1 (the extremely rare chance that a second unit doesn't get picked after 1000 tries), but now I see this is the most likely cause for what I saw.

The fix (both v1 and v2) handles this issue properly and reliably gives a second eligible unit the buff from a level 3 fairy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants