1
0
mirror of https://github.com/Klagarge/PokeHES.git synced 2024-11-23 01:43:28 +00:00

Merge pull request #47 from Klagarge:comment-Yann

Comment-Yann
This commit is contained in:
Fastium 2022-06-17 09:40:01 +02:00 committed by GitHub
commit 296caeb0e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 8 deletions

View File

@ -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(){

View File

@ -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);