• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[HELP] Exp.

Newbie Spellweaver
Joined
Aug 15, 2011
Messages
9
Reaction score
0
hey i am tring to add xp bar .But i cant find how the server count the remaining xp('baseExp' field at the db) .Also i found expType (MEDIUM, ERRATIC, FLUCTUATING, PARABOLIC, FAST, SLOW) and the growrate .But I can not find a way how all these are linked . It would be gratefull if anyone can help me :)

Thanks NofeaR
 
Last edited:
Banned
Banned
Joined
Jul 10, 2011
Messages
284
Reaction score
65
public double getExp() {
return m_exp;
}

PHP:
public double getExpForLevel(Pokemon poke, int level){
		double exp = 0;
		switch (poke.getExpType()){
		case MEDIUM: 
			exp = (int)java.lang.Math.pow((double)level, 3);
			break;
		case ERRATIC: 
			double p = 0;
			switch (level % 3){
			case 0:
				p = 0;
				break;
			case 1:
				p = 0.008;
				break;
			case 2:
				p = 0.014;
				break;
			}
			if (level <= 50){
				exp = java.lang.Math.pow((double)level, 3) * ((100 - (double)level) / 50);
			} else if (level <= 68){
				exp = java.lang.Math.pow((double)level, 3) * ((150 - (double)level) / 50);
			} else if (level <= 98){
				exp = (java.lang.Math.pow((double)level, 3) *
						(1.274 - ((1/50) * ((double)level / 3)) - p));
			} else {
				exp = java.lang.Math.pow((double)level, 3) * ((160 - (double)level) / 50);
			}
			break;
		case FAST: 
			exp = 4 * java.lang.Math.pow((double)level, 3) / 5;
			break;
		case FLUCTUATING: 
			if (level <= 15){
				exp = java.lang.Math.pow((double)level, 3) * 
					((24 + (((double)level + 1) / 3)) / 50);
			} else if ((double)level <= 35){
				exp = java.lang.Math.pow((double)level, 3) * 
				((14 + (double)level) / 50);
			} else {
				exp = java.lang.Math.pow((double)level, 3) * 
				((32 + ((double)level / 2)) / 50);
			}    		
			break;
		case PARABOLIC: 
			exp = (6 * (java.lang.Math.pow((double)level, 3) / 5)) - 
			(15 * java.lang.Math.pow((double)level, 2)) + (100 * (double)level) - 140;
			break;
		case SLOW: 
			exp = 5 * java.lang.Math.pow((double)level, 3) / 4;;
			break;
		}
		return exp;
	}

That is in BattleMechanics.java
 
Newbie Spellweaver
Joined
Aug 15, 2011
Messages
9
Reaction score
0
and how can i get the expType at BattleCanvas.java
 
Banned
Banned
Joined
Jul 10, 2011
Messages
284
Reaction score
65
It's probably compiled code. You're trying to make an exp bar right? Then isn't it just getExpForLevel - getExp ? lol
 
Back
Top