2022-06-08 23:30:15 +02:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2022-06-08 23:30:15 +02:00
|
|
|
|
|
|
|
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;
|
2022-06-08 23:30:15 +02:00
|
|
|
//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
|
2022-06-08 23:30:15 +02:00
|
|
|
}
|
|
|
|
//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-08 23:30:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2022-06-09 06:58:49 +02:00
|
|
|
|