mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Added the card property "attackingYou".
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user