View Single Post
  #44  
Old 09-12-2012, 09:42 AM
paperfairy's Avatar
paperfairy Offline
 
Join Date: Mar 2004
Location: Manchester, Connecticut
Posts: 3,991
Send a message via AIM to paperfairy Send a message via Skype™ to paperfairy
Default Re: ASB Odd Jobs [NEW JOB! (10/02/2011 5:54 GMT -4)]

$15 to narphoenix for finding the following bug... it's pretty game breaking (and embarassing!)

Quote:
Originally Posted by narphoenix
Quote:
Originally Posted by paperfairy
Quote:
Originally Posted by narphoenix
Hello Justin,

In the "Formulae" section of the Compendium, the formula for Energy output generates ridiculously higher numbers than it should (based on the number the simulator spit out). The formula as written is "((BP/20)*S)^(1+(10-EXP))+M. The exponentiation in the formula creates such a ridiculously large number that most attack attacks a Pokemon could use (according to the formula) would make the Pokemon basically faint instantly from lack of energy.
Unfortunately, you are incorrect. The following is the code straight from the Compendium:

Code:
document.calculator.energy.value = Math.ceil(Math.pow((BP * (0.05) * NRGS), (1 + ((10 - parseFloat(battle_EXP[1])) / 10))) + parseFloat(M));
document.calculator.energy.value = Final Energy Value
Math.ceil = Round Up
Math.pow(x,y) = x^y

(BP * (0.05) * NRGS) = x = (BP/20)*S)
(1 + ((10 - parseFloat(battle_EXP[1])) / 10) = y = (1+(10-EXP))
parseFloat(M) = M

But thanks anyways!

Ok, let's use an example:

Staryu used Thunderbolt!

Compendium gives energy usage at: 24

Formula yields:

((BP/20)*S)^(1+(10-EXP))+M

BP=95; S=1.5; EXP=4; M=0 (all from the compendium)

((95/20)*1.5)^(1+(10-4))+0=
(4.75*1.5)^(1+6)=
(7.125)^(7)=
932,167.765232563

I might be wrong, but I believe there is a slight difference between the two numbers. Just a thought.
I forgot to divide part of the exponent by ten in the formulae page. Ugh.
__________________
Or yet in wise old Ravenclaw
If you've a ready mind
Where those of wit and learning

Will always find their kind.
ASBL | twins with Jenn <3