diff --git a/forge-ai/src/main/java/forge/ai/SpecialCardAi.java b/forge-ai/src/main/java/forge/ai/SpecialCardAi.java index 84e7d75897c..98c81ed6884 100644 --- a/forge-ai/src/main/java/forge/ai/SpecialCardAi.java +++ b/forge-ai/src/main/java/forge/ai/SpecialCardAi.java @@ -1145,9 +1145,13 @@ public class SpecialCardAi { topGY = ai.getCardsIn(ZoneType.Graveyard).get(0); } - if ((topGY != null && !topGY.isCreature()) || creatHand != null) { - if (numCreatsInHand > 1 || !ComputerUtilMana.canPayManaCost(creatHand.getSpellPermanent(), ai, 0)) { - return true; + if (creatHand != null) { + if (topGY == null + || !topGY.isCreature() + || ComputerUtilCard.evaluateCreature(creatHand) > ComputerUtilCard.evaluateCreature(topGY) + 80) { + if (numCreatsInHand > 1 || !ComputerUtilMana.canPayManaCost(creatHand.getSpellPermanent(), ai, 0)) { + return true; + } } } diff --git a/forge-ai/src/main/java/forge/ai/ability/PlayAi.java b/forge-ai/src/main/java/forge/ai/ability/PlayAi.java index 04b0124e232..d3d5a4c761b 100644 --- a/forge-ai/src/main/java/forge/ai/ability/PlayAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/PlayAi.java @@ -1,14 +1,8 @@ package forge.ai.ability; -import java.util.List; - import com.google.common.base.Predicate; - -import forge.ai.AiPlayDecision; -import forge.ai.ComputerUtil; -import forge.ai.ComputerUtilCard; -import forge.ai.PlayerControllerAi; -import forge.ai.SpellAbilityAi; +import forge.ai.*; +import forge.card.CardStateName; import forge.game.Game; import forge.game.ability.AbilityUtils; import forge.game.card.Card; @@ -22,6 +16,8 @@ import forge.game.spellability.SpellAbility; import forge.game.spellability.TargetRestrictions; import forge.game.zone.ZoneType; +import java.util.List; + public class PlayAi extends SpellAbilityAi { @Override @@ -105,7 +101,7 @@ public class PlayAi extends SpellAbilityAi { List tgtCards = CardLists.filter(options, new Predicate() { @Override public boolean apply(final Card c) { - for (SpellAbility s : c.getBasicSpells()) { + for (SpellAbility s : c.getBasicSpells(c.getState(CardStateName.Original))) { Spell spell = (Spell) s; s.setActivatingPlayer(ai); // timing restrictions still apply diff --git a/forge-game/src/main/java/forge/game/card/Card.java b/forge-game/src/main/java/forge/game/card/Card.java index d693fc862e6..cb2e12252bf 100644 --- a/forge-game/src/main/java/forge/game/card/Card.java +++ b/forge-game/src/main/java/forge/game/card/Card.java @@ -2232,8 +2232,12 @@ public class Card extends GameEntity implements Comparable { } public final FCollectionView getBasicSpells() { + return getBasicSpells(currentState); + } + + public final FCollectionView getBasicSpells(CardState state) { final FCollection res = new FCollection<>(); - for (final SpellAbility sa : currentState.getNonManaAbilities()) { + for (final SpellAbility sa : state.getNonManaAbilities()) { if (sa.isSpell() && sa.isBasicSpell()) { res.add(sa); } diff --git a/forge-gui/res/cardsfolder/h/howltooth_hollow.txt b/forge-gui/res/cardsfolder/h/howltooth_hollow.txt index 5e9edf60f44..e0aede13494 100644 --- a/forge-gui/res/cardsfolder/h/howltooth_hollow.txt +++ b/forge-gui/res/cardsfolder/h/howltooth_hollow.txt @@ -3,7 +3,7 @@ ManaCost:no cost Types:Land K:Hideaway A:AB$ Mana | Cost$ T | Produced$ B | SpellDescription$ Add {B} to your mana pool. -A:AB$ Play | Cost$ B T | Defined$ Remembered | Amount$ All | Controller$ You | WithoutManaCost$ True | Optional$ True | ConditionCheckSVar$ Hands | ConditionSVarCompare$ EQ0 | ForgetRemembered$ True | References$ Hands | SpellDescription$ You may play the exiled card without paying its mana cost if each player has no cards in hand. +A:AB$ Play | Cost$ B T | Defined$ Remembered | Amount$ All | Controller$ You | WithoutManaCost$ True | Optional$ True | ConditionCheckSVar$ Hands | ConditionSVarCompare$ EQ0 | ForgetRemembered$ True | References$ Hands | AILogic$ CheckCondition | SpellDescription$ You may play the exiled card without paying its mana cost if each player has no cards in hand. SVar:Hands:Count$NumInAllHands SVar:RemRandomDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/howltooth_hollow.jpg diff --git a/forge-gui/res/cardsfolder/m/mosswort_bridge.txt b/forge-gui/res/cardsfolder/m/mosswort_bridge.txt index d1248851c69..6c31fa30960 100644 --- a/forge-gui/res/cardsfolder/m/mosswort_bridge.txt +++ b/forge-gui/res/cardsfolder/m/mosswort_bridge.txt @@ -3,7 +3,7 @@ ManaCost:no cost Types:Land K:Hideaway A:AB$ Mana | Cost$ T | Produced$ G | SpellDescription$ Add {G} to your mana pool. -A:AB$ Play | Cost$ G T | Defined$ Remembered | Amount$ All | Controller$ You | WithoutManaCost$ True | Optional$ True | References$ X | ConditionCheckSVar$ X | ConditionSVarCompare$ GE10 | ForgetRemembered$ True | SpellDescription$ You may play the exiled card without paying its mana cost if creatures you control have total power 10 or greater. +A:AB$ Play | Cost$ G T | Defined$ Remembered | Amount$ All | Controller$ You | WithoutManaCost$ True | Optional$ True | References$ X | ConditionCheckSVar$ X | ConditionSVarCompare$ GE10 | ForgetRemembered$ True | AILogic$ CheckCondition | SpellDescription$ You may play the exiled card without paying its mana cost if creatures you control have total power 10 or greater. SVar:X:Count$SumPower_Creature.YouCtrl SVar:Picture:http://www.wizards.com/global/images/magic/general/mosswort_bridge.jpg Oracle:Hideaway (This land enters the battlefield tapped. When it does, look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library.)\n{T}: Add {G} to your mana pool.\n{G}, {T}: You may play the exiled card without paying its mana cost if creatures you control have total power 10 or greater. diff --git a/forge-gui/res/cardsfolder/s/shelldock_isle.txt b/forge-gui/res/cardsfolder/s/shelldock_isle.txt index eb659d6c512..b3adb2eebf1 100644 --- a/forge-gui/res/cardsfolder/s/shelldock_isle.txt +++ b/forge-gui/res/cardsfolder/s/shelldock_isle.txt @@ -3,9 +3,8 @@ ManaCost:no cost Types:Land K:Hideaway A:AB$ Mana | Cost$ T | Produced$ U | SpellDescription$ Add {U} to your mana pool. -A:AB$ Play | Cost$ U T | Defined$ Remembered | Amount$ All | Controller$ You | WithoutManaCost$ True | Optional$ True | ConditionCheckSVar$ X | ConditionSVarCompare$ LE20 | ForgetRemembered$ True | References$ X | SpellDescription$ You may play the exiled card without paying its mana cost if a library has twenty or fewer cards in it. +A:AB$ Play | Cost$ U T | Defined$ Remembered | Amount$ All | Controller$ You | WithoutManaCost$ True | Optional$ True | ConditionCheckSVar$ X | ConditionSVarCompare$ LE20 | ForgetRemembered$ True | References$ X | AILogic$ CheckCondition | SpellDescription$ You may play the exiled card without paying its mana cost if a library has twenty or fewer cards in it. SVar:X:PlayerCountPlayers$LowestValidLibrary Card.YouOwn SVar:RemRandomDeck:True -SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/shelldock_isle.jpg Oracle:Hideaway (This land enters the battlefield tapped. When it does, look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library.)\n{T}: Add {U} to your mana pool.\n{U}, {T}: You may play the exiled card without paying its mana cost if a library has twenty or fewer cards in it. diff --git a/forge-gui/res/cardsfolder/s/spinerock_knoll.txt b/forge-gui/res/cardsfolder/s/spinerock_knoll.txt index e83c8073872..c2cad5709cb 100644 --- a/forge-gui/res/cardsfolder/s/spinerock_knoll.txt +++ b/forge-gui/res/cardsfolder/s/spinerock_knoll.txt @@ -3,8 +3,7 @@ ManaCost:no cost Types:Land K:Hideaway A:AB$ Mana | Cost$ T | Produced$ R | SpellDescription$ Add {R} to your mana pool. -A:AB$ Play | Cost$ R T | Defined$ Remembered | Amount$ All | Controller$ You | WithoutManaCost$ True | Optional$ True | ConditionCheckSVar$ X | ConditionSVarCompare$ GE7 | References$ X | ForgetRemembered$ True | SpellDescription$ You may play the exiled card without paying its mana cost if an opponent was dealt 7 or more damage this turn. +A:AB$ Play | Cost$ R T | Defined$ Remembered | Amount$ All | Controller$ You | WithoutManaCost$ True | Optional$ True | ConditionCheckSVar$ X | ConditionSVarCompare$ GE7 | References$ X | ForgetRemembered$ True | AILogic$ CheckCondition | SpellDescription$ You may play the exiled card without paying its mana cost if an opponent was dealt 7 or more damage this turn. SVar:X:Count$MaxOppDamageThisTurn -SVar:RemRandomDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/spinerock_knoll.jpg Oracle:Hideaway (This land enters the battlefield tapped. When it does, look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library.)\n{T}: Add {R} to your mana pool.\n{R}, {T}: You may play the exiled card without paying its mana cost if an opponent was dealt 7 or more damage this turn. diff --git a/forge-gui/res/cardsfolder/w/windbrisk_heights.txt b/forge-gui/res/cardsfolder/w/windbrisk_heights.txt index 4cdc4986cee..8979626744c 100644 --- a/forge-gui/res/cardsfolder/w/windbrisk_heights.txt +++ b/forge-gui/res/cardsfolder/w/windbrisk_heights.txt @@ -3,8 +3,7 @@ ManaCost:no cost Types:Land K:Hideaway A:AB$ Mana | Cost$ T | Produced$ W | SpellDescription$ Add {W} to your mana pool. -A:AB$ Play | Cost$ W T | Defined$ Remembered | Amount$ All | Controller$ You | WithoutManaCost$ True | Optional$ True | ConditionCheckSVar$ X | ConditionSVarCompare$ GE3 | References$ X | ForgetRemembered$ True | PlayerTurn$ True | SpellDescription$ You may play the exiled card without paying its mana cost if you attacked with three or more creatures this turn. +A:AB$ Play | Cost$ W T | Defined$ Remembered | Amount$ All | Controller$ You | WithoutManaCost$ True | Optional$ True | ConditionCheckSVar$ X | ConditionSVarCompare$ GE3 | References$ X | ForgetRemembered$ True | PlayerTurn$ True | AILogic$ CheckCondition | SpellDescription$ You may play the exiled card without paying its mana cost if you attacked with three or more creatures this turn. SVar:X:Count$AttackersDeclared -SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/windbrisk_heights.jpg Oracle:Hideaway (This land enters the battlefield tapped. When it does, look at the top four cards of your library, exile one face down, then put the rest on the bottom of your library.)\n{T}: Add {W} to your mana pool.\n{W}, {T}: You may play the exiled card without paying its mana cost if you attacked with three or more creatures this turn.