Fix aspd buffing v1#18
Open
nmaligec wants to merge 2 commits intoa327ex:masterfrom
Open
Conversation
… 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.
Author
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fix addresses 2 points that still prevent aspd buffs from selecting the correct character.
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.