farkam135 / GoIV

https://www.reddit.com/r/goiv
Other
372 stars 138 forks source link

Values in tag 'UIV-mixed-07' are showing incorrect values #1016

Open BigCabbage opened 5 years ago

BigCabbage commented 5 years ago

There is a problem in this calculation (within module MixedUnicodeToken.java). The results do not match the description, as they currently show the IV values of the lowest IV combination, instead of the individual lowest atk/def/hp IVs.

When a stat, like HP has for all combinations a value of 15, that number is shown as black 15, which is fine. The defense has different numbers, so it should be white and show the lowest number, for example 6. However, while I noticed my attack has a range of 11-15, it should be white 11, not white 15 as currently assigned.

I created this issue so I can link it when presenting the solution through a PR.

The return string currently returns the IV values of the lowest IV combination, instead of the individual lowest atk/def/hp IVs (MixedUnicodeToken.java:102-105)

The code:

return attToUse[lowestIVCombination.att]
   + defToUse[lowestIVCombination.def]
   + staToUse[lowestIVCombination.sta];

should become:

return attToUse[lowestAttackStat]
   + defToUse[lowestDefenseStat]
   + staToUse[lowestStaminaStat];
BigCabbage commented 5 years ago

Just to be clear, there are many discussions about adding other Tokens which might show not lowest but highest value for each stat, or even show the lowest IV combination based on the range. All of this is possible, but this fix is about bringing this module in sync with the description of the Token in GoIV: show the lowest possible value for each stat. Currently it does not, so it's a bug.