diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index 2233647a251..a55185b38e9 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -492,14 +492,6 @@ public class Card extends GameEntity implements Comparable { return Card.storableSVars; } - // hacky code below, used to limit the number of times an ability - // can be used per turn like Vampire Bats - // should be put in SpellAbility, but it is put here for convenience - // this is make public just to make things easy - // this code presumes that each card only has one ability that can be - // used a limited number of times per turn - // CardFactory.SSP_canPlay(Card) uses these variables - /** * * Resets the unique number for this Card to 1. @@ -951,22 +943,6 @@ public class Card extends GameEntity implements Comparable { this.blockedByThisTurn = null; } - /** - *

- * canAnyPlayerActivate. - *

- * - * @return a boolean. - */ - public final boolean canAnyPlayerActivate() { - for (final SpellAbility s : this.getCharacteristics().getSpellAbility()) { - if (s.getRestrictions().isAnyPlayer()) { - return true; - } - } - return false; - } - /** * a Card that this Card must block if able in an upcoming combat. This is * cleared at the end of each turn. @@ -1071,17 +1047,6 @@ public class Card extends GameEntity implements Comparable { this.cloneOrigin = name; } - /** - *

- * Getter for the field sacrificeAtEOT. - *

- * - * @return a boolean. - */ - public final boolean getSacrificeAtEOT() { - return this.hasKeyword("At the beginning of the end step, sacrifice CARDNAME."); - } - /** *

* hasFirstStrike. @@ -1286,9 +1251,6 @@ public class Card extends GameEntity implements Comparable { return !this.counters.isEmpty(); } - - - // get all counters from a card /** *

* Setter for the field counters. @@ -1302,7 +1264,6 @@ public class Card extends GameEntity implements Comparable { this.counters = allCounters; } - // get all counters from a card /** *

* clearCounters. @@ -4723,7 +4684,6 @@ public class Card extends GameEntity implements Comparable { public final void setUniqueNumber(final int n) { //System.out.println("Card _ " + n); this.uniqueNumber = n; - //this.updateObservers(); } /** @@ -6168,13 +6128,13 @@ public class Card extends GameEntity implements Comparable { } } else if (property.equals("wasDealtDamageByEquipeeThisTurn")) { Card equipee = source.getEquippingCard(); - if (this.getReceivedDamageFromThisTurn().keySet().isEmpty() + if (equipee == null || this.getReceivedDamageFromThisTurn().keySet().isEmpty() || !this.getReceivedDamageFromThisTurn().keySet().contains(equipee)) { return false; } } else if (property.equals("wasDealtDamageByEnchantedThisTurn")) { Card enchanted = source.getEnchantingCard(); - if (this.getReceivedDamageFromThisTurn().keySet().isEmpty() + if (enchanted == null || this.getReceivedDamageFromThisTurn().keySet().isEmpty() || !this.getReceivedDamageFromThisTurn().keySet().contains(enchanted)) { return false; } @@ -7025,8 +6985,7 @@ public class Card extends GameEntity implements Comparable { this.dealtDamageToPlayerThisTurn.clear(); } - // this is the minimal damage a trampling creature has to assign to a - // blocker + // this is the minimal damage a trampling creature has to assign to a blocker /** *

* getLethalDamage. @@ -7086,17 +7045,6 @@ public class Card extends GameEntity implements Comparable { } else { this.assignedDamageMap.put(sourceCard, this.assignedDamageMap.get(sourceCard) + assignedDamage); } - - Log.debug("***"); - /* - * if(sourceCards.size() > 1) - * System.out.println("(MULTIPLE blockers):"); - * System.out.println("Assigned " + damage + " damage to " + card); for - * (int i=0;i { } } - // This should be also usable by the AI to forecast an effect (so it must not change the game state) + // This is used by the AI to forecast an effect (so it must not change the game state) /** *

* staticDamagePrevention. @@ -7392,7 +7340,7 @@ public class Card extends GameEntity implements Comparable { return restDamage; } - // This should be also usable by the AI to forecast an effect (so it must not change the game state) + // This is used by the AI to forecast an effect (so it must not change the game state) /** *

* staticReplaceDamage. @@ -7584,9 +7532,6 @@ public class Card extends GameEntity implements Comparable { game.getStack().addSimultaneousStackEntry(abDestoryNoRegen); } } - - - boolean wither = (getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.alwaysWither) || source.hasKeyword("Wither") || source.hasKeyword("Infect")); diff --git a/src/main/java/forge/card/ability/effects/DestroyAllEffect.java b/src/main/java/forge/card/ability/effects/DestroyAllEffect.java index 58f979b6ef8..f30a7674619 100644 --- a/src/main/java/forge/card/ability/effects/DestroyAllEffect.java +++ b/src/main/java/forge/card/ability/effects/DestroyAllEffect.java @@ -1,6 +1,5 @@ package forge.card.ability.effects; -import java.util.ArrayList; import java.util.List; import forge.Card; diff --git a/src/main/java/forge/game/ai/AiAttackController.java b/src/main/java/forge/game/ai/AiAttackController.java index beeb88693a5..b1ef12da3d4 100644 --- a/src/main/java/forge/game/ai/AiAttackController.java +++ b/src/main/java/forge/game/ai/AiAttackController.java @@ -522,8 +522,7 @@ public class AiAttackController { break; } } - if (mustAttack || attacker.getSacrificeAtEOT() - || attacker.getController().getMustAttackEntity() != null + if (mustAttack || attacker.getController().getMustAttackEntity() != null || attacker.getSVar("MustAttack").equals("True")) { combat.addAttacker(attacker, defender); attackersLeft.remove(attacker);