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