- Added the card property "attackingYou".

This commit is contained in:
Sloth
2012-11-10 09:31:05 +00:00
parent 20d1816485
commit 754b2d2b2d
10 changed files with 44 additions and 23 deletions

View File

@@ -7008,8 +7008,14 @@ public class Card extends GameEntity implements Comparable<Card> {
return false;
}
} else if (property.startsWith("attacking")) {
if (!this.isAttacking()) {
return false;
if (property.equals("attacking")) {
if (!this.isAttacking()) {
return false;
}
} else if (property.equals("attackingYou")) {
if (!this.isAttacking(sourceController)) {
return false;
}
}
} else if (property.startsWith("notattacking")) {
if (this.isAttacking()) {
@@ -7420,6 +7426,21 @@ public class Card extends GameEntity implements Comparable<Card> {
return Singletons.getModel().getGame().getCombat().isAttacking(this);
}
/**
* <p>
* isAttacking.
* </p>
*
* @return a boolean.
*/
public final boolean isAttacking(GameEntity ge) {
Combat combat = Singletons.getModel().getGame().getCombat();
if (!combat.isAttacking(this)) {
return false;
}
return combat.getDefenderByAttacker(this).equals(ge);
}
/**
* <p>
* isBlocking.