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:
		| @@ -1,7 +1,7 @@ | |||||||
| attaque1,contre-attaque 1,contre-attaque 2,contre-attaque 3,contre-attaque 4,1 | "attaque1;contre-attaque 1;contre-attaque 2;contre-attaque 3;contre-attaque 4;1" | ||||||
| attaque2,contre-attaque 1,contre-attaque 2,contre-attaque 3,contre-attaque 4,10 | "attaque2;contre-attaque 1;contre-attaque 2;contre-attaque 3;contre-attaque 4;10" | ||||||
| attaque3,contre-attaque 1,contre-attaque 2,contre-attaque 3,contre-attaque 4,3 | "attaque3;contre-attaque 1;contre-attaque 2;contre-attaque 3;contre-attaque 4;3" | ||||||
| attaque4,contre-attaque 1,contre-attaque 2,contre-attaque 3,contre-attaque 4,45 | "attaque4;contre-attaque 1;contre-attaque 2;contre-attaque 3;contre-attaque 4;45" | ||||||
| attaque5,contre-attaque 1,contre-attaque 2,contre-attaque 3,contre-attaque 4,4 | "attaque5;contre-attaque 1;contre-attaque 2;contre-attaque 3;contre-attaque 4;4" | ||||||
| attaque6,contre-attaque 1,contre-attaque 2,contre-attaque 3,contre-attaque 4,6 | "attaque6;contre-attaque 1;contre-attaque 2;contre-attaque 3;contre-attaque 4;6" | ||||||
| attaque7,contre-attaque 1,contre-attaque 2,contre-attaque 3,contre-attaque 4,3 | "attaque7;contre-attaque 1;contre-attaque 2;contre-attaque 3;contre-attaque 4;3" | ||||||
|   | |||||||
| 
 | 
| @@ -1,5 +1,5 @@ | |||||||
| Convertir 0b01010111 en décimal :;87;79;afg;83;25 | Convertir 0b01010111 en d<EFBFBD>cimal :;87;79;afg;83;25 | ||||||
| Convertir 0b11110011 en héxadécimal :;F3;Q8;35;12;25 | Convertir 0b11110011 en h<EFBFBD>xad<EFBFBD>cimal :;F3;Q8;35;12;25 | ||||||
| Quel est la valeur de 'a' en ASCII en décimal ?;97;0;42;2;25 | Quel est la valeur de 'a' en ASCII en d<EFBFBD>cimal ?;97;0;42;2;25 | ||||||
| Quel mot est utile à une fonction qui retourne rien ?;void;break;Integer;false;25 | Quel mot est utile <EFBFBD> une fonction qui retourne rien ?;void;break;Integer;false;25 | ||||||
| Comment convertir un string en int ?;int a = Integer.parseInt(String s);int a  = String s;Je sais pas;int a = String.changeInt(String s);25 | Comment convertir un string en int ?;int a = Integer.parseInt(String s);int a  = String s;Je sais pas;int a = String.changeInt(String s);25 | ||||||
|   | |||||||
| 
 | 
							
								
								
									
										7
									
								
								resources/Battle/Speech/mudry.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								resources/Battle/Speech/mudry.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | |||||||
|  | Un mudry sauvage se balade dans les salles de classe. Il va te tester pour savoir si tu a traviallé cette année | ||||||
|  | Une question pour commencer : | ||||||
|  | Encore une autre : | ||||||
|  | Est ce que tu est vraiment chaud pour | ||||||
|  | Vas-y...quoi ! | ||||||
|  | Tu m'as vaincu. Moi le Mudry tout puissant ! | ||||||
|  | Pas fortiche mon gars ! | ||||||
| @@ -4,9 +4,11 @@ import com.badlogic.gdx.math.Vector2; | |||||||
|  |  | ||||||
| public class Enemy extends Character{ | public class Enemy extends Character{ | ||||||
|  |  | ||||||
|  |     private String branch; | ||||||
|  |  | ||||||
|  |  | ||||||
|     public Enemy(String name, int x, int y, String img, String map, int pv) { |  | ||||||
|  |     public Enemy(String name, int x, int y, String img, String map, int pv, String branch) { | ||||||
|         super(name, x, y, img, map); |         super(name, x, y, img, map); | ||||||
|         //generate his text |         //generate his text | ||||||
|  |  | ||||||
| @@ -14,6 +16,8 @@ public class Enemy extends Character{ | |||||||
|  |  | ||||||
|         turn(Character.Direction.DOWN); |         turn(Character.Direction.DOWN); | ||||||
|  |  | ||||||
|  |         this.branch = branch; | ||||||
|  |  | ||||||
|         this.pv = pv; |         this.pv = pv; | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -34,4 +38,8 @@ public class Enemy extends Character{ | |||||||
|          |          | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     public String getBranch(){ | ||||||
|  |         return branch; | ||||||
|  |     } | ||||||
|  |      | ||||||
| } | } | ||||||
|   | |||||||
| @@ -7,6 +7,7 @@ import Text.TextEnemy; | |||||||
|  |  | ||||||
| public class Battle { | public class Battle { | ||||||
|  |  | ||||||
|  |     private Enemy e; | ||||||
|     public TextEnemy textEnemy; |     public TextEnemy textEnemy; | ||||||
|     private int lineSpeech; |     private int lineSpeech; | ||||||
| 	public int answer; | 	public int answer; | ||||||
| @@ -16,8 +17,10 @@ public class Battle { | |||||||
|     public boolean screenBattleOn = true; |     public boolean screenBattleOn = true; | ||||||
|     |     | ||||||
|     public Battle(Enemy e){ |     public Battle(Enemy e){ | ||||||
|         textEnemy = new TextEnemy("enemi"); // should be enemy.name |         if(e != null){ | ||||||
| 		textEnemy.generateText(); |             textEnemy = new TextEnemy(e);   | ||||||
|  |             textEnemy.generateText(); | ||||||
|  |         } | ||||||
|          |          | ||||||
|         lineSpeech = 0; |         lineSpeech = 0; | ||||||
|         newXp = 0; |         newXp = 0; | ||||||
| @@ -76,7 +79,10 @@ public class Battle { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     public String getLine(){ |     public String getLine(){ | ||||||
|  |         if(e==null) return null; | ||||||
|  |      | ||||||
|         return textEnemy.lines.get(lineSpeech).line; |         return textEnemy.lines.get(lineSpeech).line; | ||||||
|  |          | ||||||
|     } |     } | ||||||
|  |  | ||||||
|      |      | ||||||
| @@ -91,4 +97,8 @@ public class Battle { | |||||||
|     public int getNewXp(){ |     public int getNewXp(){ | ||||||
|         return newXp; |         return newXp; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     public void setEnemy(Enemy e){ | ||||||
|  |         this.e = e; | ||||||
|  |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -45,8 +45,8 @@ public class PokeMudry extends PortableApplication { | |||||||
|  |  | ||||||
|         // add player, create and add all enemies in entities |         // add player, create and add all enemies in entities | ||||||
| 		entities.add((Entity) sp.p); | 		entities.add((Entity) sp.p); | ||||||
| 		enemies.add(new Enemy("Mudry", 10, 15, "lumberjack_sheet32", "desert", 100)); | 		enemies.add(new Enemy("Mudry", 10, 15, "lumberjack_sheet32", "desert", 25, "informatique")); | ||||||
| 		enemies.add(new Enemy("Pignat", 5, 1, "lumberjack_sheet32", "test", 150)); | 		//enemies.add(new Enemy("Pignat", 5, 1, "lumberjack_sheet32", "test", 150)); | ||||||
|         for (Enemy enemy : enemies) { entities.add(enemy); } |         for (Enemy enemy : enemies) { entities.add(enemy); } | ||||||
|  |  | ||||||
| 		//Init all entities | 		//Init all entities | ||||||
| @@ -65,6 +65,8 @@ public class PokeMudry extends PortableApplication { | |||||||
|         if (sp.p.onEnemy && onMapScreen){ |         if (sp.p.onEnemy && onMapScreen){ | ||||||
|             sp.e = sp.p.lastEnemy; |             sp.e = sp.p.lastEnemy; | ||||||
|             sp.sb = sp.screenManager.getScreenBattle(); |             sp.sb = sp.screenManager.getScreenBattle(); | ||||||
|  |             if(sp.e == null) System.out.println("sdfsdfsdfsdf"); | ||||||
|  |              | ||||||
|             sp.b = new Battle(sp.e); |             sp.b = new Battle(sp.e); | ||||||
|             g.resetCamera(); |             g.resetCamera(); | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -17,7 +17,8 @@ public class ScreenPlayer { | |||||||
|  |  | ||||||
|         // One player by ScreenPlayer |         // One player by ScreenPlayer | ||||||
|         p = new Player(8, 15, "desert"); |         p = new Player(8, 15, "desert"); | ||||||
|         b = new Battle(e); |  | ||||||
|  |         b = new Battle(new Enemy("enemi", 0, 0, "charachter", "desert", 50, "enemi")); | ||||||
|  |  | ||||||
|         // Create both type of screen and record for reuse |         // Create both type of screen and record for reuse | ||||||
|         screenManager.registerScreen(ScreenMap.class); |         screenManager.registerScreen(ScreenMap.class); | ||||||
| @@ -34,6 +35,7 @@ public class ScreenPlayer { | |||||||
|          |          | ||||||
|         if(sb != null){ |         if(sb != null){ | ||||||
|             sb.setBattle(b); |             sb.setBattle(b); | ||||||
|  |              | ||||||
|         } |         } | ||||||
|          |          | ||||||
|         screenManager.render(g); |         screenManager.render(g); | ||||||
|   | |||||||
| @@ -9,14 +9,14 @@ public class FightData { | |||||||
|  |  | ||||||
|     private  Vector<Attack> attacks = new Vector<Attack>(); |     private  Vector<Attack> attacks = new Vector<Attack>(); | ||||||
|     private  File file; |     private  File file; | ||||||
|     private static final String REGEX = ","; |     private static String regex = ";"; | ||||||
|  |  | ||||||
|      |      | ||||||
|  |  | ||||||
|     public int nbre_line =0; |     public int nbre_line =0; | ||||||
|  |  | ||||||
|     public FightData(String name) { |     public FightData(String branch) { | ||||||
|         file = new File("./resources/Battle/Fight/" + name + ".csv"); |         file = new File("./resources/Battle/Fight/" + branch + ".csv"); | ||||||
|          |          | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -30,9 +30,11 @@ public class FightData { | |||||||
|  |  | ||||||
|             //add the line in the vector attacks of attack |             //add the line in the vector attacks of attack | ||||||
|             line = bf.readLine();  |             line = bf.readLine();  | ||||||
|  |             System.out.println(line); | ||||||
|             while(line != null){ |             while(line != null){ | ||||||
|                 String[] a = line.split(REGEX);//change the regex if it is another |                 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])); |                 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); |                 attacks.add(attack); | ||||||
|                 line = bf.readLine(); |                 line = bf.readLine(); | ||||||
|                 //add line |                 //add line | ||||||
|   | |||||||
| @@ -1,6 +1,9 @@ | |||||||
| package Text; | package Text; | ||||||
|  |  | ||||||
| import java.util.Vector; | import java.util.Vector; | ||||||
|  |  | ||||||
|  | import Entity.Enemy; | ||||||
|  |  | ||||||
| import java.util.Arrays; | import java.util.Arrays; | ||||||
| import java.util.Random; | import java.util.Random; | ||||||
|  |  | ||||||
| @@ -17,24 +20,22 @@ public class TextEnemy { | |||||||
|  |  | ||||||
|     public static void main(String[] args) { |     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(); |         t.generateText(); | ||||||
|  |  | ||||||
|         for(Line l : t.lines) { |         for(Line l : t.lines) { | ||||||
|             System.out.println(l.line); |             System.out.println(l.line); | ||||||
|         } |         } | ||||||
|          |  | ||||||
|         |  | ||||||
|     } |     } | ||||||
|      |      | ||||||
|     public TextEnemy(String name){ |     public TextEnemy(Enemy e){ | ||||||
|         //generate the vector of fight |         //generate the vector of fight | ||||||
|         fightData = new FightData(name); |         fightData = new FightData(e.getBranch()); | ||||||
|         fightData.readFile(); |         fightData.readFile(); | ||||||
|  |  | ||||||
|         //generate the vector of Speechs |         //generate the vector of Speechs | ||||||
|         speechData = new SpeechData(name); |         speechData = new SpeechData(e.getName()); | ||||||
|         speechData.readFile(); |         speechData.readFile(); | ||||||
|  |  | ||||||
|         //save random data (attack and ansver) : attack, answer 1, answer 2 answer 3, answer 4 |         //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)  |             //attack and answer (number on vector : 1-4)  | ||||||
|             lines.add(new Line( |             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" + |                 "1. " + fightData.getAttack(orderAttack[j]).getAnswer(orderAnswer[0]) + "\n" + | ||||||
|                 "2. " + fightData.getAttack(orderAttack[j]).getAnswer(orderAnswer[1]) + "\n" +  |                 "2. " + fightData.getAttack(orderAttack[j]).getAnswer(orderAnswer[1]) + "\n" +  | ||||||
|                 "3. " + fightData.getAttack(orderAttack[j]).getAnswer(orderAnswer[2]) + "\n" +  |                 "3. " + fightData.getAttack(orderAttack[j]).getAnswer(orderAnswer[2]) + "\n" +  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user