View Single Post
Old 01-23-2013, 10:30 PM   PM User | #20
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,249
Thanks: 59
Thanked 3,999 Times in 3,968 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Okay...
Code:
var xpup = (xneeded * Math.ceil(Math.pow(1.15, plevel)))
var showxp= (xpup - (xneeded * Math.ceil(Math.pow(1.15, plevel-1))))
NewCode =  topR + midR + name + ": " + sign +" "+ plevel + "<BR> XP: "+ (EXP-showxp) +"<BR> Experience needed: " +  (xpup-EXP)+ "<BR>Overall Experience:" + (xneeded * EXP / xneeded) +"<br><!-- placeholder --><br><br>"
So
Code:
xpup = 500 * Math.ceil( Math.pow(1.15, 12) ) ==>>
xpup = 500 * Math.ceil( 5.35 ) ==>>
xpup = 500 * 6 ==>>
xpup = 3000

showxp= (xpup - (xneeded * Math.ceil(Math.pow(1.15, plevel-1)))) ==>>
showxp = (3000 - (500 * Math.ceil( Math.pow( 1.15, 11 ) ) ) ) ==>>
showxp = (3000 - (500 * Math.ceil( 4.65 ) ) ) ==>>
showxp = (3000 - (500 * 5) ) ==>>
showxp = 3000 - 2500 ==>>
showxp = 500

NewCode =  "...other stuff..."+ plevel 
        + "<BR> XP: "+ (EXP-showxp) 
        + "<BR> Experience needed: " +  (xpup-EXP)
        + "<BR>Overall Experience:" + (xneeded * EXP / xneeded) + ...
NewCode =  "...other stuff..."+ 12
        + "<BR> XP: "+ (2500-500) 
        + "<BR> Experience needed: " +  (3000-500)
        + "<BR>Overall Experience:" + (500 * 2500 / 500) + ...
NewCode =  "...other stuff..."+ 12
        + "<BR> XP: "+ 2000 
        + "<BR> Experience needed: " +  2500
        + "<BR>Overall Experience:" + 2500 + ...
This expression is especially silly:
(xneeded * EXP / xneeded)

Pointless. The two uses of xneeded cancel out, so the value is always simply EXP.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote