- RemAIDeck update: next iteration.

This commit is contained in:
Agetian
2017-10-03 11:09:10 +00:00
parent 08a6af547c
commit d4e72f07f9
15 changed files with 26 additions and 26 deletions

View File

@@ -38,6 +38,7 @@ import forge.game.phase.PhaseType;
import forge.game.player.Player; import forge.game.player.Player;
import forge.game.player.PlayerPredicates; import forge.game.player.PlayerPredicates;
import forge.game.spellability.SpellAbility; import forge.game.spellability.SpellAbility;
import forge.game.spellability.SpellPermanent;
import forge.game.staticability.StaticAbility; import forge.game.staticability.StaticAbility;
import forge.game.trigger.Trigger; import forge.game.trigger.Trigger;
import forge.game.zone.ZoneType; import forge.game.zone.ZoneType;
@@ -1265,12 +1266,16 @@ public class SpecialCardAi {
} }
} }
// Yawgmoth's Will (can potentially be expanded for other broadly similar effects too) // Yawgmoth's Will and other cards with similar effect, e.g. Magus of the Will
public static class YawgmothsWill { public static class YawgmothsWill {
public static boolean consider(final Player ai, final SpellAbility sa) { public static boolean consider(final Player ai, final SpellAbility sa) {
CardCollectionView cardsInGY = ai.getCardsIn(ZoneType.Graveyard); CardCollectionView cardsInGY = ai.getCardsIn(ZoneType.Graveyard);
if (cardsInGY.size() == 0) { if (cardsInGY.size() == 0) {
return false; return false;
} else if (ai.getGame().getPhaseHandler().getPlayerTurn() != ai) {
// The AI is not very good at deciding for what to viably do during the opp's turn when this
// comes from an instant speed effect (e.g. Magus of the Will)
return false;
} }
int minManaAdj = 2; // we want the AI to have some spare mana for possible other spells to cast int minManaAdj = 2; // we want the AI to have some spare mana for possible other spells to cast
@@ -1287,8 +1292,8 @@ public class SpecialCardAi {
continue; continue;
} }
if (ComputerUtilAbility.getAbilitySourceName(ab).equals(ComputerUtilAbility.getAbilitySourceName(sa)) if ((ComputerUtilAbility.getAbilitySourceName(ab).equals(ComputerUtilAbility.getAbilitySourceName(sa))
|| ab.hasParam("AINoRecursiveCheck")) { && !(ab instanceof SpellPermanent)) || ab.hasParam("AINoRecursiveCheck")) {
// prevent infinitely recursing abilities that are susceptible to reentry // prevent infinitely recursing abilities that are susceptible to reentry
continue; continue;
} }

View File

@@ -1,11 +1,6 @@
package forge.ai.ability; package forge.ai.ability;
import forge.ai.ComputerUtil; import forge.ai.*;
import forge.ai.ComputerUtilAbility;
import forge.ai.ComputerUtilCard;
import forge.ai.ComputerUtilMana;
import forge.ai.SpecialCardAi;
import forge.ai.SpellAbilityAi;
import forge.game.Game; import forge.game.Game;
import forge.game.ability.AbilityUtils; import forge.game.ability.AbilityUtils;
import forge.game.card.Card; import forge.game.card.Card;
@@ -46,6 +41,8 @@ public class DigAi extends SpellAbilityAi {
if ("Never".equals(sa.getParam("AILogic"))) { if ("Never".equals(sa.getParam("AILogic"))) {
return false; return false;
} else if ("AtOppEndOfTurn".equals(sa.getParam("AILogic"))) {
return game.getPhaseHandler().getNextTurn() == ai && game.getPhaseHandler().is(PhaseType.END_OF_TURN);
} }
// don't deck yourself // don't deck yourself

View File

@@ -4,6 +4,6 @@ Types:Creature Human Wizard
PT:1/1 PT:1/1
A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C} to your mana pool. A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C} to your mana pool.
A:AB$ Draw | Cost$ T | NumCards$ 1 | ActivationCardsInHand$ 7 | SpellDescription$ Draw a card. Activate this ability only if you have exactly seven cards in hand. A:AB$ Draw | Cost$ T | NumCards$ 1 | ActivationCardsInHand$ 7 | SpellDescription$ Draw a card. Activate this ability only if you have exactly seven cards in hand.
SVar:RemAIDeck:True SVar:RemRandomDeck:True
SVar:Picture:http://resources.wizards.com/magic/cards/plc/en-us/card134741.jpg SVar:Picture:http://resources.wizards.com/magic/cards/plc/en-us/card134741.jpg
Oracle:{T}: Add {C} to your mana pool.\n{T}: Draw a card. Activate this ability only if you have exactly seven cards in hand. Oracle:{T}: Add {C} to your mana pool.\n{T}: Draw a card. Activate this ability only if you have exactly seven cards in hand.

View File

@@ -2,13 +2,12 @@ Name:Magus of the Will
ManaCost:2 B ManaCost:2 B
Types:Creature Human Wizard Types:Creature Human Wizard
PT:3/3 PT:3/3
A:AB$ Effect | Cost$ 2 B T Exile<1/CARDNAME> | Name$ Magus of the Will Effect | ReplacementEffects$ GraveToExile | StaticAbilities$ STPlay | SVars$ Exile | SpellDescription$ Until end of turn, you may play cards from your graveyard. If a card would be put into your graveyard from anywhere this turn, exile that card instead. A:AB$ Effect | Cost$ 2 B T Exile<1/CARDNAME> | Name$ Magus of the Will Effect | ReplacementEffects$ GraveToExile | StaticAbilities$ STPlay | SVars$ Exile | AILogic$ YawgmothsWill | SpellDescription$ Until end of turn, you may play cards from your graveyard. If a card would be put into your graveyard from anywhere this turn, exile that card instead.
SVar:STPlay:Mode$ Continuous | EffectZone$ Command | Affected$ Card.YouCtrl | AffectedZone$ Graveyard | MayPlay$ True | Description$ You may play cards from your graveyard. SVar:STPlay:Mode$ Continuous | EffectZone$ Command | Affected$ Card.YouCtrl | AffectedZone$ Graveyard | MayPlay$ True | Description$ You may play cards from your graveyard.
SVar:GraveToExile:Event$ Moved | ActiveZones$ Command | Destination$ Graveyard | ValidCard$ Card.nonToken+YouOwn | ReplaceWith$ Exile | Description$ If a card would be put into your graveyard from anywhere, exile it instead. SVar:GraveToExile:Event$ Moved | ActiveZones$ Command | Destination$ Graveyard | ValidCard$ Card.nonToken+YouOwn | ReplaceWith$ Exile | Description$ If a card would be put into your graveyard from anywhere, exile it instead.
SVar:Exile:AB$ ChangeZone | Cost$ 0 | Hidden$ True | Origin$ All | Destination$ Exile | Defined$ ReplacedCard SVar:Exile:DB$ ChangeZone | Hidden$ True | Origin$ All | Destination$ Exile | Defined$ ReplacedCard
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/magus_of_the_will.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/magus_of_the_will.jpg
Oracle:{2}{B}, {T}, Exile Magus of the Will: Until end of turn, you may play cards from your graveyard. If a card would be put into your graveyard from anywhere this turn, exile that card instead. Oracle:{2}{B}, {T}, Exile Magus of the Will: Until end of turn, you may play cards from your graveyard. If a card would be put into your graveyard from anywhere this turn, exile that card instead.

View File

@@ -6,6 +6,6 @@ A:SP$ Attach | Cost$ 1 R | ValidTgts$ Creature | AILogic$ Pump
S:Mode$ Continuous | Affected$ Card.EnchantedBy | AddAbility$ HostileAct | Description$ Enchanted creature has "{T}: Target creature can't block this turn." S:Mode$ Continuous | Affected$ Card.EnchantedBy | AddAbility$ HostileAct | Description$ Enchanted creature has "{T}: Target creature can't block this turn."
SVar:HostileAct:AB$Pump | Cost$ T | ValidTgts$ Creature | TgtPrompt$ Select target creature | IsCurse$ True | KW$ HIDDEN CARDNAME can't block. | SpellDescription$ Target creature can't block this turn. SVar:HostileAct:AB$Pump | Cost$ T | ValidTgts$ Creature | TgtPrompt$ Select target creature | IsCurse$ True | KW$ HIDDEN CARDNAME can't block. | SpellDescription$ Target creature can't block this turn.
SVar:NonStackingAttachEffect:True SVar:NonStackingAttachEffect:True
SVar:RemAIDeck:True SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/malicious_intent.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/malicious_intent.jpg
Oracle:Enchant creature\nEnchanted creature has "{T}: Target creature can't block this turn." Oracle:Enchant creature\nEnchanted creature has "{T}: Target creature can't block this turn."

View File

@@ -7,6 +7,5 @@ A:AB$ Tap | Cost$ T | ValidTgts$ Land | RememberTapped$ True | AlwaysRemember$ T
S:Mode$ Continuous | Affected$ Land.IsRemembered | AddHiddenKeyword$ CARDNAME doesn't untap during your untap step. S:Mode$ Continuous | Affected$ Land.IsRemembered | AddHiddenKeyword$ CARDNAME doesn't untap during your untap step.
T:Mode$ Untaps | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ ClearRemembered | Static$ True T:Mode$ Untaps | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ ClearRemembered | Static$ True
SVar:ClearRemembered:DB$ Cleanup | ClearRemembered$ True SVar:ClearRemembered:DB$ Cleanup | ClearRemembered$ True
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/mana_leech.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/mana_leech.jpg
Oracle:You may choose not to untap Mana Leech during your untap step.\n{T}: Tap target land. It doesn't untap during its controller's untap step for as long as Mana Leech remains tapped. Oracle:You may choose not to untap Mana Leech during your untap step.\n{T}: Tap target land. It doesn't untap during its controller's untap step for as long as Mana Leech remains tapped.

View File

@@ -2,6 +2,8 @@ Name:Mana Vapors
ManaCost:1 U ManaCost:1 U
Types:Sorcery Types:Sorcery
A:SP$ PumpAll | Cost$ 1 U | ValidTgts$ Player | IsCurse$ True | ValidCards$ Land.TargetedPlayerCtrl | KW$ HIDDEN This card doesn't untap during your next untap step. | Permanent$ True | SpellDescription$ Lands target player controls don't untap during his or her next untap step. A:SP$ PumpAll | Cost$ 1 U | ValidTgts$ Player | IsCurse$ True | ValidCards$ Land.TargetedPlayerCtrl | KW$ HIDDEN This card doesn't untap during your next untap step. | Permanent$ True | SpellDescription$ Lands target player controls don't untap during his or her next untap step.
#TODO: the AI doesn't really target the opponent with the tapped lands in a multiplayer game (not necessarily, anyway). Could use improvement before this card is marked AI playable.
SVar:NeedsToPlay:Land.OppCtrl+tapped
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/mana_vapors.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/mana_vapors.jpg
Oracle:Lands target player controls don't untap during his or her next untap step. Oracle:Lands target player controls don't untap during his or her next untap step.

View File

@@ -4,8 +4,9 @@ Types:Creature Crocodile
PT:4/4 PT:4/4
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.Self | Execute$ TrigChange | TriggerDescription$ When CARDNAME enters the battlefield, return a blue or black creature you control to its owner's hand. T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.Self | Execute$ TrigChange | TriggerDescription$ When CARDNAME enters the battlefield, return a blue or black creature you control to its owner's hand.
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDiscard | TriggerDescription$ When CARDNAME enters the battlefield, each player discards a card. T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDiscard | TriggerDescription$ When CARDNAME enters the battlefield, each player discards a card.
SVar:TrigChange:AB$ChangeZone | Cost$ 0 | Origin$ Battlefield | Destination$ Hand | Hidden$ True | Mandatory$ True | ChangeType$ Creature.Black+YouCtrl,Creature.Blue+YouCtrl SVar:TrigChange:DB$ ChangeZone | Origin$ Battlefield | Destination$ Hand | Hidden$ True | Mandatory$ True | ChangeType$ Creature.Black+YouCtrl,Creature.Blue+YouCtrl
SVar:TrigDiscard:AB$Discard | Cost$ 0 | Defined$ Player | NumCards$ 1 | Mode$ TgtChoose SVar:TrigDiscard:DB$ Discard | Defined$ Player | NumCards$ 1 | Mode$ TgtChoose
SVar:RemAIDeck:True SVar:NeedsToPlay:Creature.Black+YouCtrl+cmcLE3+inZoneBattlefield,Creature.Blue+YouCtrl+cmcLE3+inZoneBattlefield
SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/marsh_crocodile.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/marsh_crocodile.jpg
Oracle:When Marsh Crocodile enters the battlefield, return a blue or black creature you control to its owner's hand.\nWhen Marsh Crocodile enters the battlefield, each player discards a card. Oracle:When Marsh Crocodile enters the battlefield, return a blue or black creature you control to its owner's hand.\nWhen Marsh Crocodile enters the battlefield, each player discards a card.

View File

@@ -4,6 +4,6 @@ Types:Legendary Creature Moonfolk Wizard
PT:2/4 PT:2/4
K:Flying K:Flying
A:AB$ Token | Cost$ 1 Return<1/Land> | TokenAmount$ 1 | TokenName$ Illusion | TokenTypes$ Creature,Illusion | TokenOwner$ You | TokenColors$ Blue | TokenPower$ 1 | TokenToughness$ 1 | TokenKeywords$ Flying | SpellDescription$ Create a 1/1 blue Illusion creature token with flying. A:AB$ Token | Cost$ 1 Return<1/Land> | TokenAmount$ 1 | TokenName$ Illusion | TokenTypes$ Creature,Illusion | TokenOwner$ You | TokenColors$ Blue | TokenPower$ 1 | TokenToughness$ 1 | TokenKeywords$ Flying | SpellDescription$ Create a 1/1 blue Illusion creature token with flying.
SVar:RemAIDeck:True SVar:RemRandomDeck:True
SVar:Picture:http://resources.wizards.com/magic/cards/chk/en-us/card75268.jpg SVar:Picture:http://resources.wizards.com/magic/cards/chk/en-us/card75268.jpg
Oracle:Flying\n{1}, Return a land you control to its owner's hand: Create a 1/1 blue Illusion creature token with flying. Oracle:Flying\n{1}, Return a land you control to its owner's hand: Create a 1/1 blue Illusion creature token with flying.

View File

@@ -1,7 +1,7 @@
Name:Meteor Shower Name:Meteor Shower
ManaCost:X X R ManaCost:X X R
Types:Sorcery Types:Sorcery
A:SP$ DealDamage | Cost$ X X R | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature and/or player to distribute damage to | NumDmg$ DistroDmg | TargetMin$ 1 | TargetMax$ MaxTgts | DividedAsYouChoose$ DistroDmg | References$ DistroDmg,X,MaxTgts | SpellDescription$ CARDNAME deals X plus 1 damage divided as you choose among any number of target creatures and/or players. A:SP$ DealDamage | Cost$ X X R | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature and/or player to distribute damage to | NumDmg$ DistroDmg | TargetMin$ 1 | TargetMax$ MaxTgts | DividedAsYouChoose$ DistroDmg | References$ DistroDmg,X,MaxTgts,NumPlayers,NumCreatures | SpellDescription$ CARDNAME deals X plus 1 damage divided as you choose among any number of target creatures and/or players.
SVar:NumPlayers:PlayerCountPlayers$Amount/Plus.NumCreatures SVar:NumPlayers:PlayerCountPlayers$Amount/Plus.NumCreatures
SVar:NumCreatures:Count$Valid Creature SVar:NumCreatures:Count$Valid Creature
SVar:MaxTgts:SVar$NumPlayers/Plus.1 SVar:MaxTgts:SVar$NumPlayers/Plus.1

View File

@@ -3,6 +3,5 @@ ManaCost:X B B
Types:Sorcery Types:Sorcery
A:SP$ Discard | Cost$ X B B | ValidTgts$ Player | NumCards$ X | References$ X | Mode$ Random | SpellDescription$ Target player discards X cards at random. A:SP$ Discard | Cost$ X B B | ValidTgts$ Player | NumCards$ X | References$ X | Mode$ Random | SpellDescription$ Target player discards X cards at random.
SVar:X:Count$xPaid SVar:X:Count$xPaid
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/mind_shatter.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/mind_shatter.jpg
Oracle:Target player discards X cards at random. Oracle:Target player discards X cards at random.

View File

@@ -7,6 +7,5 @@ SVar:DBGainLife:DB$ GainLife | LifeAmount$ 4
SVar:Misfortune:DB$ PutCounterAll | ValidCards$ Creature.ChosenCtrl | CounterType$ M1M1 | CounterNum$ 1 | SubAbility$ DBLoseLife | SpellDescription$ You put a -1/-1 counter on each creature that player controls and CARDNAME deals 4 damage to him or her. | SubAbility$ DBDamage SVar:Misfortune:DB$ PutCounterAll | ValidCards$ Creature.ChosenCtrl | CounterType$ M1M1 | CounterNum$ 1 | SubAbility$ DBLoseLife | SpellDescription$ You put a -1/-1 counter on each creature that player controls and CARDNAME deals 4 damage to him or her. | SubAbility$ DBDamage
SVar:DBDamage:DB$ DealDamage | Defined$ ChosenPlayer | NumDmg$ 4 SVar:DBDamage:DB$ DealDamage | Defined$ ChosenPlayer | NumDmg$ 4
SVar:ChooserDraws:DB$ Draw | NumCards$ 3 | Defined$ ChosenPlayer SVar:ChooserDraws:DB$ Draw | NumCards$ 3 | Defined$ ChosenPlayer
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/misfortune.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/misfortune.jpg
Oracle:An opponent chooses one —\n• You put a +1/+1 counter on each creature you control and gain 4 life.\n• You put a -1/-1 counter on each creature that player controls and Misfortune deals 4 damage to him or her. Oracle:An opponent chooses one —\n• You put a +1/+1 counter on each creature you control and gain 4 life.\n• You put a -1/-1 counter on each creature that player controls and Misfortune deals 4 damage to him or her.

View File

@@ -2,6 +2,5 @@ Name:Mishra's Groundbreaker
ManaCost:4 ManaCost:4
Types:Artifact Types:Artifact
A:AB$ Animate | Cost$ T Sac<1/CARDNAME> | ValidTgts$ Land | TgtPrompt$ Select target land | Power$ 3 | Toughness$ 3 | Types$ Artifact,Creature | Permanent$ True | SpellDescription$ Target land becomes a 3/3 artifact creature that's still a land. (This effect lasts indefinitely.) A:AB$ Animate | Cost$ T Sac<1/CARDNAME> | ValidTgts$ Land | TgtPrompt$ Select target land | Power$ 3 | Toughness$ 3 | Types$ Artifact,Creature | Permanent$ True | SpellDescription$ Target land becomes a 3/3 artifact creature that's still a land. (This effect lasts indefinitely.)
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/mishras_groundbreaker.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/mishras_groundbreaker.jpg
Oracle:{T}, Sacrifice Mishra's Groundbreaker: Target land becomes a 3/3 artifact creature that's still a land. (This effect lasts indefinitely.) Oracle:{T}, Sacrifice Mishra's Groundbreaker: Target land becomes a 3/3 artifact creature that's still a land. (This effect lasts indefinitely.)

View File

@@ -3,7 +3,8 @@ ManaCost:4
Types:Artifact Equipment Types:Artifact Equipment
S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddPower$ 2 | AddToughness$ 2 | Description$ Equipped creature gets +2/+2. S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddPower$ 2 | AddToughness$ 2 | Description$ Equipped creature gets +2/+2.
K:Equip Discard<1/Card> K:Equip Discard<1/Card>
SVar:RemAIDeck:True SVar:AIPreference:DiscardCost$Card
SVar:RemRandomDeck:True
DeckHas:Ability$Discard DeckHas:Ability$Discard
DeckHints:Keyword$Madness & Ability$Delirium DeckHints:Keyword$Madness & Ability$Delirium
SVar:Picture:http://www.wizards.com/global/images/magic/general/murderers_axe.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/murderers_axe.jpg

View File

@@ -2,8 +2,7 @@ Name:Muzzio, Visionary Architect
ManaCost:1 U U ManaCost:1 U U
Types:Legendary Creature Human Artificer Types:Legendary Creature Human Artificer
PT:1/3 PT:1/3
A:AB$ Dig | Cost$ 3 U T | DigNum$ X | References$ X | Optional$ True | ChangeValid$ Artifact | DestinationZone$ Battlefield | SpellDescription$ Look at the top X cards of your library, where X is the highest converted mana cost among artifacts you control. You may reveal an artifact card from among them and put it onto the battlefield. Put the rest on the bottom of your library in any order. A:AB$ Dig | Cost$ 3 U T | DigNum$ X | References$ X | Optional$ True | ChangeValid$ Artifact | DestinationZone$ Battlefield | AILogic$ AtOppEndOfTurn | SpellDescription$ Look at the top X cards of your library, where X is the highest converted mana cost among artifacts you control. You may reveal an artifact card from among them and put it onto the battlefield. Put the rest on the bottom of your library in any order.
SVar:X:Count$HighestCMC_Artifact.YouCtrl+inZoneBattlefield SVar:X:Count$HighestCMC_Artifact.YouCtrl+inZoneBattlefield
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/muzzio_visionary_architect.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/muzzio_visionary_architect.jpg
Oracle:{3}{U}, {T}: Look at the top X cards of your library, where X is the highest converted mana cost among artifacts you control. You may reveal an artifact card from among them and put it onto the battlefield. Put the rest on the bottom of your library in any order. Oracle:{3}{U}, {T}: Look at the top X cards of your library, where X is the highest converted mana cost among artifacts you control. You may reveal an artifact card from among them and put it onto the battlefield. Put the rest on the bottom of your library in any order.