mirror of
https://github.com/Klagarge/PokeHES.git
synced 2024-11-23 01:43:28 +00:00
xp modification
This commit is contained in:
parent
b4a899bdcd
commit
744b160542
@ -6,15 +6,16 @@ public class Enemy extends Character{
|
||||
|
||||
|
||||
|
||||
public Enemy(String name, int x, int y, String img, String map) {
|
||||
public Enemy(String name, int x, int y, String img, String map, int pv) {
|
||||
super(name, x, y, img, map);
|
||||
//generate his text
|
||||
|
||||
this.map = map;
|
||||
|
||||
turn(Character.Direction.DOWN);
|
||||
//generate the vector of fight
|
||||
//FightData fightData = new FightData(name);
|
||||
|
||||
this.pv = pv;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -28,8 +29,8 @@ public class Enemy extends Character{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void removedPv(int pv) {
|
||||
// TODO Auto-generated method stub
|
||||
public void removedPv(int pv) {
|
||||
this.pv -= pv;
|
||||
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ import Screen.ScreenMap;
|
||||
|
||||
public class Player extends Character{
|
||||
|
||||
private int xp;
|
||||
private int xp = 0;
|
||||
public Enemy lastEnemy = null;
|
||||
public boolean onEnemy = false;
|
||||
|
||||
@ -21,7 +21,7 @@ public class Player extends Character{
|
||||
}
|
||||
|
||||
public void addXp(int xp){
|
||||
|
||||
this.xp += xp;
|
||||
}
|
||||
|
||||
public void manageEntity(ScreenMap sm, Controller c) {
|
||||
|
@ -6,24 +6,21 @@ import Entity.Enemy;
|
||||
import Text.TextEnemy;
|
||||
|
||||
public class Battle {
|
||||
|
||||
|
||||
TextEnemy textEnemy;
|
||||
public TextEnemy textEnemy;
|
||||
private int lineSpeech;
|
||||
|
||||
public int answer;
|
||||
|
||||
private int winPoint;
|
||||
private int newXp;
|
||||
|
||||
public boolean screenBattleOn = true;
|
||||
|
||||
|
||||
public Battle(Enemy enemy){
|
||||
public Battle(Enemy e){
|
||||
textEnemy = new TextEnemy("enemi"); // should be enemy.name
|
||||
textEnemy.generateText();
|
||||
|
||||
lineSpeech = 0;
|
||||
winPoint = 0;
|
||||
newXp = 0;
|
||||
|
||||
System.out.println("lll : "+ getLine());
|
||||
|
||||
@ -46,7 +43,6 @@ public class Battle {
|
||||
|
||||
//get number current answer random
|
||||
int currentAnswer = textEnemy.getCurrentData().get(attack)[answer];
|
||||
System.out.println("current answer : " + currentAnswer);
|
||||
|
||||
//get the answer of the player
|
||||
String answerPlayer = textEnemy.fightData.getAttack(currentAttack).getAnswer(currentAnswer);
|
||||
@ -58,7 +54,9 @@ public class Battle {
|
||||
|
||||
//check the choice of the player
|
||||
if(answerPlayer == trueAsnwer){
|
||||
newXp += textEnemy.fightData.getAttack(currentAttack).getXp();
|
||||
System.out.println("it's true !!!!");
|
||||
|
||||
}
|
||||
else{
|
||||
System.out.println("it's false !!!!");
|
||||
@ -89,6 +87,8 @@ public class Battle {
|
||||
public boolean getScreenBattleOn(){
|
||||
return screenBattleOn;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getNewXp(){
|
||||
return newXp;
|
||||
}
|
||||
}
|
||||
|
@ -45,8 +45,8 @@ public class PokeMudry extends PortableApplication {
|
||||
|
||||
// add player, create and add all enemies in entities
|
||||
entities.add((Entity) sp.p);
|
||||
enemies.add(new Enemy("Mudry", 10, 15, "lumberjack_sheet32", "desert"));
|
||||
enemies.add(new Enemy("Pignat", 5, 1, "lumberjack_sheet32", "test"));
|
||||
enemies.add(new Enemy("Mudry", 10, 15, "lumberjack_sheet32", "desert", 100));
|
||||
enemies.add(new Enemy("Pignat", 5, 1, "lumberjack_sheet32", "test", 150));
|
||||
for (Enemy enemy : enemies) { entities.add(enemy); }
|
||||
|
||||
//Init all entities
|
||||
@ -75,6 +75,8 @@ public class PokeMudry extends PortableApplication {
|
||||
if(!sp.b.getScreenBattleOn() && onBattleScreen){
|
||||
sp.p.onEnemy = false;
|
||||
sp.sm = sp.screenManager.getScreenMap();
|
||||
sp.p.addXp(sp.b.getNewXp());
|
||||
sp.e.removedPv(sp.b.getNewXp());
|
||||
}
|
||||
|
||||
// Graphics render
|
||||
|
@ -9,7 +9,7 @@ public class Attack {
|
||||
String answer4;
|
||||
public String[] s;
|
||||
|
||||
float xp;
|
||||
private int xp;
|
||||
|
||||
Attack(String attack, String answer1,String answer2,String answer3, String answer4, float xp){
|
||||
this.attack = attack;
|
||||
@ -38,4 +38,8 @@ public class Attack {
|
||||
return answer1;
|
||||
}
|
||||
|
||||
public int getXp() {
|
||||
return xp;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user