1
0
mirror of https://github.com/Klagarge/PokeHES.git synced 2025-10-30 11:19:17 +00:00

dialog ok

This commit is contained in:
Fastium
2022-06-10 19:33:24 +02:00
parent 4c47120c40
commit 0fe608e183
10 changed files with 149 additions and 69 deletions

View File

@@ -6,7 +6,16 @@ public class TextEnemy {
public FightData fightData;
public SpeechData speechData;
Vector<Line> line = new Vector<Line>();
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
@@ -20,33 +29,24 @@ public class TextEnemy {
}
public void generateText(){
int i =0;
int i =1;
//introduction line
line.add(new Line(speechData.getSpeechs(i++), false));
for(int j=0; i<4;i++){
lines.add(new Line(speechData.getSpeechs(0), false));
for(int j=0; j<4;j++){
//attack and answer (number on vector : 1-4)
line.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 ));
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));
// TODO mélanger les attaques aléatoirement
}
//finish (win and death)
line.add(new Line(speechData.getSpeechs(i++), false));
line.add(new Line(speechData.getSpeechs(i++), false));
lines.add(new Line(speechData.getSpeechs(5), false));
lines.add(new Line(speechData.getSpeechs(6), false));
}
}
class Line {
String line;
boolean attackOn;
Line( String line, boolean attackOn){
this.line = line;
this.attackOn = attackOn;
}
}