correction de la limitation d'une carte pour jouer
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -28,4 +28,8 @@ public class Board {
|
||||
return board[zone];
|
||||
}
|
||||
|
||||
public int getNumberCardInZone() {
|
||||
return board.length;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+10
-2
@@ -219,7 +219,12 @@ public class Joueur {
|
||||
* cette methode a pour but d'executé les evenement de fin de trous des cartes
|
||||
*/
|
||||
public void endPhase() {
|
||||
// TODO Auto-generated method stub
|
||||
for (int i = 0; i < board.getNumberCardInZone(); i++) {
|
||||
Card c = board.getCardInZone(i);
|
||||
if (c != null) {
|
||||
c.resetAttack();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ComsJoueur getComs() {
|
||||
@@ -312,14 +317,17 @@ public class Joueur {
|
||||
if (attackingCard == null) {
|
||||
throw new RuntimeException("invalid attack");
|
||||
} else {
|
||||
if (carteCible.equals("100")) {
|
||||
if (carteCible.equals("100") && attackingCard.alreadyAttack()) {
|
||||
boolean isadvDead = handleAttackAgainstPlayer(attackingCard, adversaire);
|
||||
if(isadvDead)
|
||||
{
|
||||
phaseActive = false;
|
||||
}
|
||||
} else {
|
||||
if (attackingCard.alreadyAttack()) {
|
||||
handleAttackAgainstCard(attackingCard, carteCible, adversaire);
|
||||
attackingCard.haveAttack();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -4,6 +4,7 @@ public abstract class Card{
|
||||
|
||||
private int attack;
|
||||
private int health;
|
||||
private boolean notPlay=true;
|
||||
|
||||
public Card() {
|
||||
attack = getDefaultAttack();
|
||||
@@ -76,5 +77,17 @@ public abstract class Card{
|
||||
}
|
||||
return health == 0;
|
||||
}
|
||||
|
||||
public boolean alreadyAttack() {
|
||||
return notPlay;
|
||||
}
|
||||
|
||||
public void haveAttack() {
|
||||
notPlay = false;
|
||||
}
|
||||
|
||||
public void resetAttack() {
|
||||
notPlay=true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user