Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 0 1 2 3 4 5 6 7 8 9
- int[] lvlformula = {0000000,00000100,0000200,0000400,0000800,0001600,0003200,0006400,0012800,0025600
- // 10 11 12 13 14 15 16 17 19 20
- 0051200,01024000,0204800,0409600,0819200,1638600,3276800,6555200,0000000,0000000
- };
- lvlformula=Math.pow(2, level+1);
- //Levelup checker
- if(exp*lvlforumula>level){
- OR
- if(exp>levels[level++]){
- levelup(stats);
- levelup=true;
- }
- if(levelup==true){
- g.drawString("Levelup! Level "+level+" achieved.", 50, 100);
- if(k!=0)levelup=false;
- }
- battleStep=randInt.nextInt(15)+10;
- package gameTest;
- public class Actions(){
- //int oldhp, oldmaxhp;
- //int hp, maxhp;
- double hperc;
- //int oldmp, oldmaxmp;
- //int mp, maxmp;
- double mperc;
- public static int[] levelup(int[] stats){
- //level, skillPTS, maxhp, hp, maxmp, mp
- //int[] stats = {0, 0, 0, 0, 0};
- //level++;
- stats[0]++; //Update Level
- //skillPTS+=5;
- stats[1]+=5; //Give five spendable skill points
- //hperc=oldmaxhp/oldhp;
- hperc=stats[2]/stats[3]; //Calculate HP %age
- //mperc=oldmaxmp/oldmp;
- mperc=stats[4]/stats[5]; //Calculate MP %age
- //maxhp=(int)(1.2*maxhp);
- stats[2]=(int)(1.2*stats[2]); //Set new MaxHP
- //maxmp=(int)(1.2*maxmp);
- stats[4]=(int)(1.2*stats[4]); //Set new MaxMP
- //hp=(int)(maxhp*hperc);
- stats[3]=(int)(1.2*hperc); //Calculate new instantaneous HP
- //mp=(int)(maxmp*mperc);
- stats[5]=(int)(1.2*mperc); //Calculate new instantaneous MP
- return stats;
- }
- }
- package gameTest;
- public class Actions(){
- double hperc, mperc;
- public static int[] levelup(int[] stats){
- stats[0]++; //Update Level
- stats[1]+=5; //Give five spendable skill points
- hperc=stats[2]/stats[3]; //Calculate HP %age
- mperc=stats[4]/stats[5]; //Calculate MP %age
- stats[2]=(int)(1.2*stats[2]); //Set new MaxHP
- stats[4]=(int)(1.2*stats[4]); //Set new MaxMP
- stats[3]=(int)(stats[]*hperc); //Calculate new instantaneous HP
- stats[5]=(int)(1.2*mperc); //Calculate new instantaneous MP
- return stats;
- }
- }
Add Comment
Please, Sign In to add comment