diff --git a/bin/game/Command.class b/bin/game/Command.class index 5dd74be..72f25df 100644 Binary files a/bin/game/Command.class and b/bin/game/Command.class differ diff --git a/bin/game/Joueur.class b/bin/game/Joueur.class index 8fb6182..4b246f1 100644 Binary files a/bin/game/Joueur.class and b/bin/game/Joueur.class differ diff --git a/bin/game/Match.class b/bin/game/Match.class index 85c08f2..738eb5e 100644 Binary files a/bin/game/Match.class and b/bin/game/Match.class differ diff --git a/src/game/Command.java b/src/game/Command.java index b62f96c..c66f19e 100644 --- a/src/game/Command.java +++ b/src/game/Command.java @@ -30,6 +30,8 @@ public final class Command { public static final String SET_HP = "sethp"; public static final String SET_CARD_HP = "setcardhp"; public static final String SET_ADV_CARD_HP = "setadvcardhp"; + public static final String SET_CARD_ATK = "setcardatk"; + public static final String SET_ADV_CARD_ATK = "setadvcardatk"; } diff --git a/src/game/Joueur.java b/src/game/Joueur.java index e898677..5bc35f7 100644 --- a/src/game/Joueur.java +++ b/src/game/Joueur.java @@ -467,6 +467,25 @@ public class Joueur { this.getComs().send(zone+""); this.getComs().send(cardToUpDate.getHealth()); } + + /** + * met a jorus les hp d'une carte tout ce passe du poin de vue du joueur + * @param cardToUpDate + * @param adversaire + * @throws IOException + */ + private void updateCardAtk(Card cardToUpDate,Joueur adversaire) throws IOException + { + int zone = board.getZoneOf(cardToUpDate); + if(zone == -1)return; + adversaire.getComs().send(Command.SET_ADV_CARD_ATK); + adversaire.getComs().send(zone+""); + adversaire.getComs().send(cardToUpDate.getAttack()); + + this.getComs().send(Command.SET_CARD_ATK); + this.getComs().send(zone+""); + this.getComs().send(cardToUpDate.getAttack()); + } private Board getBoard() { return board; @@ -485,7 +504,7 @@ public class Joueur { } - public void onTurnStart() { + public void onTurnStart(Joueur adversaire) throws IOException { Iterator it = board.getIterator(); while(it.hasNext()) { @@ -493,6 +512,8 @@ public class Joueur { if(c != null) { c.onTurnStart(); + updateCardHp(c, adversaire); + updateCardAtk(c, adversaire); } } diff --git a/src/game/Match.java b/src/game/Match.java index 7d810d4..2f43ed9 100644 --- a/src/game/Match.java +++ b/src/game/Match.java @@ -117,7 +117,7 @@ public class Match extends Thread { //et on dit au joueur oposé que ce n'est pas le tien enemy.debutTourEnemie(); - joueur.onTurnStart(); + joueur.onTurnStart(enemy); joueur.mainPhase1(enemy); //Joue autant de carte qu'il veut/peut joueur.battlePhase(enemy);//lance des attaques à son adversaire qui peut répliquer //cette phases ne serira surment pas car nous manquon de temps pour implrementer les fonctionnalité specifique de certaine cartes