doshidak / showdex

Pokémon Showdown extension that harnesses the power of parabolic calculus to strategically extract your opponents' Elo.
GNU Affero General Public License v3.0
106 stars 21 forks source link

fix BP boosts from the Metronome item not correctly applying #113

Open doshidak opened 1 year ago

doshidak commented 1 year ago

Reported by: GuessMonster

Add proper support for the Metronome item (read: the item, not ability!!).

@smogon/calc already has a field for this apparently when you switch the Pokémon's item to Metronome. It will add a dropdown field next to each of the Pokémon's moves for the number of times the move was consecutively used (although, it doesn't actually know if you've consecutively used them as you must manually specify this) from values 0-5 (i.e., 'Never' → 0, 'Once' → 1, 'Twice' → 2, '3 times' → 3, '4 times' → 4, '5 times' → 5).

Apparently this item also functions differently between gen 4 and gens 5+ as well. In gen 4, it's a 10% boost per consecutive hit (up to a max of 2x, i.e., the counter can go up to 10 instead of 5), while in gens 5+, it's a 20% boost (up to a max of 2x, i.e., the counter can go up to 5, as previously mentioned).

Note that in calc.ps, when setting the gen to 4 (DPP), the number of consecutive hits dropdown does not correctly update to show up to 10, instead showing the aforementioned options for all applicable gens (4+). Also note that in gens < 4, the Metronome item does not exist!

While the Calcdex should automatically keep track of this metric (or hopefully, the battle object from the client will provide this info), we could also allow users to modify this value when editing the move.

doshidak commented 1 year ago

Since Showdown doesn't report this info in the battle object, need to write a stepQueue parser to figure out the consecutively used moves for each Pokémon.

In other words, this is gunna take awhile to figure out a good algorithm, so probably won't be fixed in v1.1.3 as to not delay the release further :c