mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Decouple MustAttackEntity from MustAttackEntityThisTurn for Alluring Siren.
This commit is contained in:
@@ -61,14 +61,21 @@ public class MustAttackEffect extends SpellAbilityEffect {
|
||||
|
||||
for (final Player p : tgtPlayers) {
|
||||
if ((tgt == null) || p.canBeTargetedBy(sa)) {
|
||||
p.setMustAttackEntity(entity);
|
||||
p.setMustAttackEntityThisTurn(thisTurn);
|
||||
if (thisTurn) {
|
||||
p.setMustAttackEntityThisTurn(entity);
|
||||
} else {
|
||||
p.setMustAttackEntity(entity);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
for (final Card c : getTargetCards(sa)) {
|
||||
if ((tgt == null) || c.canBeTargetedBy(sa)) {
|
||||
c.setMustAttackEntity(entity);
|
||||
c.setMustAttackEntityThisTurn(thisTurn);
|
||||
if (thisTurn) {
|
||||
c.setMustAttackEntityThisTurn(entity);
|
||||
} else {
|
||||
c.setMustAttackEntity(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
private GameEntity enchanting = null;
|
||||
|
||||
private GameEntity mustAttackEntity = null;
|
||||
private boolean mustAttackEntityThisTurn = false;
|
||||
private GameEntity mustAttackEntityThisTurn = null;
|
||||
|
||||
private final Map<StaticAbility, CardPlayOption> mayPlay = Maps.newTreeMap();
|
||||
private int mayPlayTurn = 0;
|
||||
@@ -950,13 +950,13 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
return mustAttackEntity;
|
||||
}
|
||||
public final void clearMustAttackEntity(final Player playerturn) {
|
||||
if (getController().equals(playerturn) || mustAttackEntityThisTurn) {
|
||||
if (getController().equals(playerturn)) {
|
||||
mustAttackEntity = null;
|
||||
mustAttackEntityThisTurn = false;
|
||||
}
|
||||
mustAttackEntityThisTurn = null;
|
||||
}
|
||||
public final boolean getMustAttackEntityThisTurn() { return mustAttackEntityThisTurn; }
|
||||
public final void setMustAttackEntityThisTurn(boolean thisTurnOnly) { mustAttackEntityThisTurn = thisTurnOnly; }
|
||||
public final GameEntity getMustAttackEntityThisTurn() { return mustAttackEntityThisTurn; }
|
||||
public final void setMustAttackEntityThisTurn(GameEntity entThisTurn) { mustAttackEntityThisTurn = entThisTurn; }
|
||||
|
||||
public final CardCollectionView getClones() {
|
||||
return CardCollection.getView(clones);
|
||||
|
||||
@@ -32,6 +32,10 @@ public class AttackRequirement {
|
||||
if (mustAttack != null) {
|
||||
defenderSpecific.add(mustAttack);
|
||||
}
|
||||
final GameEntity mustAttackThisTurn = attacker.getController().getMustAttackEntityThisTurn();
|
||||
if (mustAttackThisTurn != null) {
|
||||
defenderSpecific.add(mustAttackThisTurn);
|
||||
}
|
||||
|
||||
int nAttackAnything = 0;
|
||||
|
||||
@@ -54,6 +58,10 @@ public class AttackRequirement {
|
||||
if (mustAttack3 != null) {
|
||||
defenderSpecific.add(mustAttack3);
|
||||
}
|
||||
final GameEntity mustAttackThisTurn3 = attacker.getMustAttackEntityThisTurn();
|
||||
if (mustAttackThisTurn3 != null) {
|
||||
defenderSpecific.add(mustAttackThisTurn3);
|
||||
}
|
||||
|
||||
final Game game = attacker.getGame();
|
||||
for (final GameEntity defender : possibleDefenders) {
|
||||
|
||||
@@ -152,7 +152,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
private Map<Long, KeywordsChange> changedKeywords = new ConcurrentSkipListMap<Long, KeywordsChange>();
|
||||
private ManaPool manaPool = new ManaPool(this);
|
||||
private GameEntity mustAttackEntity = null;
|
||||
private boolean mustAttackEntityThisTurn = false;
|
||||
private GameEntity mustAttackEntityThisTurn = null;
|
||||
private boolean attackedWithCreatureThisTurn = false;
|
||||
private boolean activateLoyaltyAbilityThisTurn = false;
|
||||
private boolean tappedLandForManaThisTurn = false;
|
||||
@@ -2191,8 +2191,8 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public final void setMustAttackEntity(final GameEntity o) {
|
||||
mustAttackEntity = o;
|
||||
}
|
||||
public final boolean getMustAttackEntityThisTurn() { return mustAttackEntityThisTurn; }
|
||||
public final void setMustAttackEntityThisTurn(boolean thisTurnOnly) { mustAttackEntityThisTurn = thisTurnOnly; }
|
||||
public final GameEntity getMustAttackEntityThisTurn() { return mustAttackEntityThisTurn; }
|
||||
public final void setMustAttackEntityThisTurn(GameEntity entThisTurn) { mustAttackEntityThisTurn = entThisTurn; }
|
||||
|
||||
@Override
|
||||
public int compareTo(Player o) {
|
||||
|
||||
Reference in New Issue
Block a user