From d4fe16cc7a1f28c6efdced2f3162a3b6a1f94004 Mon Sep 17 00:00:00 2001 From: Sloth Date: Tue, 15 Nov 2011 15:57:29 +0000 Subject: [PATCH] - Added player targeting AI to AF GainControl. --- res/cardsfolder/m/mogg_cannon.txt | 19 ++++++++++--------- .../AbilityFactoryGainControl.java | 5 +++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/res/cardsfolder/m/mogg_cannon.txt b/res/cardsfolder/m/mogg_cannon.txt index 2d7b4265000..2b23af93c7e 100644 --- a/res/cardsfolder/m/mogg_cannon.txt +++ b/res/cardsfolder/m/mogg_cannon.txt @@ -1,10 +1,11 @@ -Name:Mogg Cannon -ManaCost:2 -Types:Artifact -Text:no text -A:AB$ Pump | Cost$ T | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control | NumAtt$ +1 | NumDef$ +0 | KW$ Flying & At the beginning of the end step, destroy CARDNAME. | SpellDescription$ Target creature you control gets +1/+0 and gains flying until end of turn. Destroy that creature at the beginning of the next end step. -SVar:Rarity:Uncommon -SVar:Picture:http://www.wizards.com/global/images/magic/general/mogg_cannon.jpg -SetInfo:TMP|Uncommon|http://magiccards.info/scans/en/tp/288.jpg -Oracle:{T}: Target creature you control gets +1/+0 and gains flying until end of turn. Destroy that creature at the beginning of the next end step. +Name:Mogg Cannon +ManaCost:2 +Types:Artifact +Text:no text +A:AB$ Pump | Cost$ T | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control | NumAtt$ +1 | NumDef$ +0 | KW$ Flying & At the beginning of the end step, destroy CARDNAME. | SpellDescription$ Target creature you control gets +1/+0 and gains flying until end of turn. Destroy that creature at the beginning of the next end step. +SVar:RemAIDeck:True +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/mogg_cannon.jpg +SetInfo:TMP|Uncommon|http://magiccards.info/scans/en/tp/288.jpg +Oracle:{T}: Target creature you control gets +1/+0 and gains flying until end of turn. Destroy that creature at the beginning of the next end step. End \ No newline at end of file diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryGainControl.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryGainControl.java index b7217e6b3b7..11d45f76670 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryGainControl.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryGainControl.java @@ -277,6 +277,11 @@ public class AbilityFactoryGainControl { // if Defined, then don't worry about targeting if (tgt == null) { return true; + } else if (tgt.canOnlyTgtOpponent()) { + if (!AllZone.getHumanPlayer().canBeTargetedBy(sa)) { + return false; + } + tgt.addTarget(AllZone.getHumanPlayer()); } CardList list = AllZone.getHumanPlayer().getCardsIn(Zone.Battlefield);