1
0
mirror of https://github.com/Klagarge/PokeHES.git synced 2025-03-14 06:44:33 +00:00
PokeHES/src/Text/TextEnemy.java

53 lines
1.5 KiB
Java
Raw Normal View History

package Text;
import java.util.Vector;
public class TextEnemy {
public FightData fightData;
public SpeechData speechData;
2022-06-10 19:33:24 +02:00
public Vector<Line> lines = new Vector<Line>();
public static void main(String[] args) {
TextEnemy t = new TextEnemy("enemi");
t.generateText();
for(Line l : t.lines) {
System.out.println(l.line);
}
}
public TextEnemy(String name){
//generate the vector of fight
fightData = new FightData(name);
fightData.readFile();
//generate the vector of Speechs
speechData = new SpeechData(name);
speechData.readFile();
}
public void generateText(){
2022-06-10 19:33:24 +02:00
int i =1;
//introduction line
2022-06-10 19:33:24 +02:00
lines.add(new Line(speechData.getSpeechs(0), false));
for(int j=0; j<4;j++){
2022-06-09 06:58:49 +02:00
//attack and answer (number on vector : 1-4)
2022-06-10 19:33:24 +02:00
lines.add(new Line(
speechData.getSpeechs(i++) + fightData.getAttack(j).attack + "? ("+fightData.getAttack(j).xp+ ") " + "\n" +
fightData.getAttack(j).answer1 + "\n" +
fightData.getAttack(j).answer2 + "\n" +
fightData.getAttack(j).answer3 + "\n" +
fightData.getAttack(j).answer4, true));
2022-06-09 06:58:49 +02:00
// TODO mélanger les attaques aléatoirement
}
//finish (win and death)
2022-06-10 19:33:24 +02:00
lines.add(new Line(speechData.getSpeechs(5), false));
lines.add(new Line(speechData.getSpeechs(6), false));
}
}
2022-06-09 06:58:49 +02:00