1
0
mirror of https://github.com/Klagarge/PokeHES.git synced 2024-11-26 19:13:27 +00:00

xp modification

This commit is contained in:
Fastium 2022-06-14 12:51:47 +02:00
parent c1ed41fdbe
commit 26a8b0280b
4 changed files with 44 additions and 5 deletions

View File

@ -24,6 +24,10 @@ public class Player extends Character{
this.xp += xp;
}
public int getXp(){
return xp;
}
public void manageEntity(ScreenMap sm, Controller c) {
// Do nothing if hero is already moving

View File

@ -13,6 +13,8 @@ public class Battle {
public int answer;
private int newXp;
private int pvEnemy;
private int xpPlayer;
public boolean screenBattleOn = true;
@ -69,35 +71,56 @@ public class Battle {
}
public void FinishSpeech(int pvEnemy){
if(pvEnemy>0){
//alive
readNextLine();
}
else{
//dead
}
}
public boolean finish(){
return false;
}
public boolean getAttackOn(){
return textEnemy.lines.get(lineSpeech).attackOn;
}
public String getLine(){
if(e==null) return null;
return textEnemy.lines.get(lineSpeech).line;
}
//get the line for the dialog
public int getLineSpeech() {
return lineSpeech;
}
//return true if the screen is active
public boolean getScreenBattleOn(){
return screenBattleOn;
}
//get the total xp win in the battle
public int getNewXp(){
return newXp;
}
public void setPvEnemy(int pv){
pvEnemy = pv;
}
public void setXpPlayer(int xp){
xpPlayer = xp;
}
//set enemy
public void setEnemy(Enemy e){
this.e = e;
}

View File

@ -73,6 +73,12 @@ public class PokeMudry extends PortableApplication {
if(onBattleScreen) sp.sb.manage(controller, sp.b);
//manage battle
if(!sp.b.getScreenBattleOn()){
sp.b.setPvEnemy(sp.e.getPv());
sp.b.setXpPlayer(sp.p.getXp());
}
if(!sp.b.getScreenBattleOn() && onBattleScreen){
sp.p.onEnemy = false;

View File

@ -101,8 +101,14 @@ public class ScreenBattle extends RenderingScreen{
if( battle.getAttackOn() == false){
if (c.keyStatus.get(Input.Keys.SPACE)){
System.out.println("in");
battle.readNextLine();
if(battle.getLineSpeech() <= 5){
battle.screenBattleOn = battle.finish();
}
else{
System.out.println("in");
battle.readNextLine();
}
}
if (c.keyStatus.get(Input.Keys.ENTER)){
battle.screenBattleOn = battle.finish();