mirror of
https://github.com/Klagarge/PokeHES.git
synced 2024-11-26 19:13:27 +00:00
commit
296caeb0e4
@ -43,21 +43,23 @@ public class Battle {
|
|||||||
System.out.println("xp player : " + xpPlayer);
|
System.out.println("xp player : " + xpPlayer);
|
||||||
System.out.println("xp win " + newXp);
|
System.out.println("xp win " + newXp);
|
||||||
|
|
||||||
|
//the player is at the last question, the finish text must be displayed
|
||||||
if(getLineSpeech() == 4){
|
if(getLineSpeech() == 4){
|
||||||
FinishSpeech();
|
finishSpeech();
|
||||||
}
|
}
|
||||||
|
//the player is at the finish text and he must quit the battle
|
||||||
else if( getLineSpeech() == 5 || getLineSpeech() == 6){
|
else if( getLineSpeech() == 5 || getLineSpeech() == 6){
|
||||||
finish();
|
finish();
|
||||||
e.recoveredTime = 0;
|
|
||||||
}
|
}
|
||||||
|
//the player answer the question and it is check and if the enemy is killed
|
||||||
else if(0 < getLineSpeech() && getLineSpeech() < 4){
|
else if(0 < getLineSpeech() && getLineSpeech() < 4){
|
||||||
checkAnswer(answer);
|
checkAnswer(answer);
|
||||||
|
|
||||||
if(pvEnemy <= 0){
|
if(pvEnemy <= 0){
|
||||||
FinishSpeech();
|
finishSpeech();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//default case : increase speech to display the new line
|
||||||
else{
|
else{
|
||||||
readNextLine();
|
readNextLine();
|
||||||
}
|
}
|
||||||
@ -100,7 +102,7 @@ public class Battle {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FinishSpeech(){
|
public void finishSpeech(){
|
||||||
if(pvEnemy>0){
|
if(pvEnemy>0){
|
||||||
//alive (speechLine = 6)
|
//alive (speechLine = 6)
|
||||||
lineSpeech = 6;
|
lineSpeech = 6;
|
||||||
@ -116,6 +118,7 @@ public class Battle {
|
|||||||
|
|
||||||
public void finish(){
|
public void finish(){
|
||||||
screenBattleOn = false;
|
screenBattleOn = false;
|
||||||
|
e.recoveredTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getAttackOn(){
|
public boolean getAttackOn(){
|
||||||
|
@ -2,6 +2,7 @@ package Text;
|
|||||||
|
|
||||||
import Entity.Enemy;
|
import Entity.Enemy;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
public class TextEnemy {
|
public class TextEnemy {
|
||||||
@ -87,7 +88,7 @@ public class TextEnemy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Format the line
|
//Format the line
|
||||||
String attack = formatLine(speechData.getSpeechs(i++) + fightData.getAttack(orderAttack[j]).attack + " ? ("+fightData.getAttack(orderAttack[j]).getXp()+ ") ", CUT);
|
String attack = formatLine(speechData.getSpeechs(i++) + fightData.getAttack(orderAttack[j]).attack + " ("+fightData.getAttack(orderAttack[j]).getXp()+ ") ", CUT);
|
||||||
String answer1 = formatLine("1. " + fightData.getAttack(orderAttack[j]).getAnswer(orderAnswer[0]) , CUT);
|
String answer1 = formatLine("1. " + fightData.getAttack(orderAttack[j]).getAnswer(orderAnswer[0]) , CUT);
|
||||||
String answer2 = formatLine("2. " + fightData.getAttack(orderAttack[j]).getAnswer(orderAnswer[1]) , CUT);
|
String answer2 = formatLine("2. " + fightData.getAttack(orderAttack[j]).getAnswer(orderAnswer[1]) , CUT);
|
||||||
String answer3 = formatLine("3. " + fightData.getAttack(orderAttack[j]).getAnswer(orderAnswer[2]) , CUT);
|
String answer3 = formatLine("3. " + fightData.getAttack(orderAttack[j]).getAnswer(orderAnswer[2]) , CUT);
|
||||||
@ -100,11 +101,11 @@ public class TextEnemy {
|
|||||||
currentData.add(currentRandom);
|
currentData.add(currentRandom);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
//display answer
|
||||||
for(int[] a : currentData){
|
for(int[] a : currentData){
|
||||||
System.out.println(Arrays.toString(a));
|
System.out.println(Arrays.toString(a));
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
//finish (win and death)
|
//finish (win and death)
|
||||||
String dead = formatLine(speechData.getSpeechs(5),CUT);
|
String dead = formatLine(speechData.getSpeechs(5),CUT);
|
||||||
|
Loading…
Reference in New Issue
Block a user