mirror of
				https://github.com/Klagarge/PokeHES.git
				synced 2025-10-31 03:39:16 +00:00 
			
		
		
		
	change the world
This commit is contained in:
		| @@ -9,14 +9,14 @@ public class FightData { | ||||
|  | ||||
|     private  Vector<Attack> attacks = new Vector<Attack>(); | ||||
|     private  File file; | ||||
|     private static final String REGEX = ","; | ||||
|     private static String regex = ";"; | ||||
|  | ||||
|      | ||||
|  | ||||
|     public int nbre_line =0; | ||||
|  | ||||
|     public FightData(String name) { | ||||
|         file = new File("./resources/Battle/Fight/" + name + ".csv"); | ||||
|     public FightData(String branch) { | ||||
|         file = new File("./resources/Battle/Fight/" + branch + ".csv"); | ||||
|          | ||||
|     } | ||||
|  | ||||
| @@ -30,9 +30,11 @@ public class FightData { | ||||
|  | ||||
|             //add the line in the vector attacks of attack | ||||
|             line = bf.readLine();  | ||||
|             System.out.println(line); | ||||
|             while(line != null){ | ||||
|                 String[] a = line.split(REGEX);//change the regex if it is another | ||||
|                 attack = new Attack(a[0], a[1], a[2], a[3], a[4], Float.valueOf(a[5])); | ||||
|                 String[] a = line.split(regex);//change the regex if it is another | ||||
|                 System.out.println(a.length); | ||||
|                 attack = new Attack(a[0], a[1], a[2], a[3], a[4], Integer.valueOf(a[5])); | ||||
|                 attacks.add(attack); | ||||
|                 line = bf.readLine(); | ||||
|                 //add line | ||||
|   | ||||
| @@ -1,6 +1,9 @@ | ||||
| package Text; | ||||
|  | ||||
| import java.util.Vector; | ||||
|  | ||||
| import Entity.Enemy; | ||||
|  | ||||
| import java.util.Arrays; | ||||
| import java.util.Random; | ||||
|  | ||||
| @@ -17,24 +20,22 @@ public class TextEnemy { | ||||
|  | ||||
|     public static void main(String[] args) { | ||||
|          | ||||
|         TextEnemy t  = new TextEnemy("enemi"); | ||||
|         TextEnemy t  = new TextEnemy(new Enemy("Mudry", 10, 15, "lumberjack_sheet32", "desert", 25, "informatique")); | ||||
|  | ||||
|         t.generateText(); | ||||
|  | ||||
|         for(Line l : t.lines) { | ||||
|             System.out.println(l.line); | ||||
|         } | ||||
|          | ||||
|         | ||||
|     } | ||||
|      | ||||
|     public TextEnemy(String name){ | ||||
|     public TextEnemy(Enemy e){ | ||||
|         //generate the vector of fight | ||||
|         fightData = new FightData(name); | ||||
|         fightData = new FightData(e.getBranch()); | ||||
|         fightData.readFile(); | ||||
|  | ||||
|         //generate the vector of Speechs | ||||
|         speechData = new SpeechData(name); | ||||
|         speechData = new SpeechData(e.getName()); | ||||
|         speechData.readFile(); | ||||
|  | ||||
|         //save random data (attack and ansver) : attack, answer 1, answer 2 answer 3, answer 4 | ||||
| @@ -98,7 +99,7 @@ public class TextEnemy { | ||||
|  | ||||
|             //attack and answer (number on vector : 1-4)  | ||||
|             lines.add(new Line( | ||||
|                 speechData.getSpeechs(i++) + fightData.getAttack(orderAttack[j]).attack + " ?  ("+fightData.getAttack(orderAttack[j]).xp+ ") " + "\n" + | ||||
|                 speechData.getSpeechs(i++) + fightData.getAttack(orderAttack[j]).attack + " ?  ("+fightData.getAttack(orderAttack[j]).getXp()+ ") " + "\n" + | ||||
|                 "1. " + fightData.getAttack(orderAttack[j]).getAnswer(orderAnswer[0]) + "\n" + | ||||
|                 "2. " + fightData.getAttack(orderAttack[j]).getAnswer(orderAnswer[1]) + "\n" +  | ||||
|                 "3. " + fightData.getAttack(orderAttack[j]).getAnswer(orderAnswer[2]) + "\n" +  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user