Professor-Redwood-Team / Professor-Redwood

Pokemon Go Discord Bot
MIT License
34 stars 21 forks source link

fix bp calculations (stop rounding cpm) #47

Closed awilbur closed 6 years ago

awilbur commented 7 years ago

Our breakpoint calculations have been very slightly off.

ComplexMangoes alerted me to differences in Raikou's breakpoints versus Suicune, after seeing conflicting results from other sources. We were saying Raikou with Thunder Shock and 15 attack IV has a breakpoint at 30.5, whereas other sources claimed 31. Doing the math, I see that they're correct, and ours is just a bit off. When I removed the rounding in the getCPM method, I got the expected result. (It makes sense to use the exact CpM values instead of rounding them - otherwise, the full CpM values would be unnecessary, and probably not exist.)

~I should note that other sources also claim the same breakpoint for 14 attack IV, which I'm just not seeing in the math, either by manual calculations or from the bot. I think those sources are wrong.~ EDIT: Found the issue after some research. Raid boss CP multipliers are basically rounded to 2 decimals. Regular pokemon use the full CP multiplier.

The previous breakpoint calculations for things like Golem vs Moltres hold steady with this change. Added a test for the Raikou/Suicune case.

mralanlee commented 6 years ago

@awilbur you have some conflicts on the tests, could you resolve this and I will merge the file.

stefangimmillaro commented 6 years ago

resolve conflict in test then merge