From fd78277f93f6efb9eb06fb445038e42121c7f55e Mon Sep 17 00:00:00 2001 From: Sloth Date: Thu, 6 Dec 2012 14:47:57 +0000 Subject: [PATCH] - Added Scrounge. --- .gitattributes | 1 + res/cardsfolder/s/scrounge.txt | 10 ++++++++++ .../forge/card/abilityfactory/ai/ChangeZoneAi.java | 9 +++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 res/cardsfolder/s/scrounge.txt diff --git a/.gitattributes b/.gitattributes index a0081472996..cf4074be545 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8572,6 +8572,7 @@ res/cardsfolder/s/scroll_of_griselbrand.txt -text res/cardsfolder/s/scroll_of_origins.txt -text res/cardsfolder/s/scroll_rack.txt svneol=native#text/plain res/cardsfolder/s/scroll_thief.txt svneol=native#text/plain +res/cardsfolder/s/scrounge.txt -text res/cardsfolder/s/scrubland.txt svneol=native#text/plain res/cardsfolder/s/scryb_ranger.txt svneol=native#text/plain res/cardsfolder/s/scryb_sprites.txt svneol=native#text/plain diff --git a/res/cardsfolder/s/scrounge.txt b/res/cardsfolder/s/scrounge.txt new file mode 100644 index 00000000000..2e085f65b88 --- /dev/null +++ b/res/cardsfolder/s/scrounge.txt @@ -0,0 +1,10 @@ +Name:Scrounge +ManaCost:2 B +Types:Sorcery +Text:no text +A:SP$ ChangeZone | Cost$ 2 B | Origin$ Graveyard | Destination$ Battlefield | ValidTgts$ Opponent | Hidden$ True | ChangeType$ Artifact.TargetedPlayerCtrl | ChangeNum$ 1 | GainControl$ True | IsCurse$ True | Chooser$ Targeted | IsCurse$ True | SpellDescription$ Target opponent chooses an artifact card in his or her graveyard. Put that card onto the battlefield under your control. +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/scrounge.jpg +SetInfo:DST|Uncommon|http://magiccards.info/scans/en/ds/53.jpg +Oracle:Target opponent chooses an artifact card in his or her graveyard. Put that card onto the battlefield under your control. +End \ No newline at end of file diff --git a/src/main/java/forge/card/abilityfactory/ai/ChangeZoneAi.java b/src/main/java/forge/card/abilityfactory/ai/ChangeZoneAi.java index bfa6283e172..82bed67e943 100644 --- a/src/main/java/forge/card/abilityfactory/ai/ChangeZoneAi.java +++ b/src/main/java/forge/card/abilityfactory/ai/ChangeZoneAi.java @@ -1066,6 +1066,7 @@ public class ChangeZoneAi extends SpellAiLogic { final Target tgt = sa.getTarget(); final Card card = sa.getSourceCard(); final boolean defined = sa.hasParam("Defined"); + final Player activator = sa.getActivatingPlayer(); if (tgt != null) { if (!tgt.getTargetPlayers().isEmpty()) { @@ -1146,7 +1147,7 @@ public class ChangeZoneAi extends SpellAiLogic { return true; } }); - if (player.isHuman() && sa.hasParam("GainControl")) { + if (player.isHuman() && sa.hasParam("GainControl") && activator.equals(ai)) { fetchList = CardLists.filter(fetchList, new Predicate() { @Override public boolean apply(final Card c) { @@ -1171,7 +1172,11 @@ public class ChangeZoneAi extends SpellAiLogic { } else if (ZoneType.Hand.equals(destination) && CardLists.getNotType(fetchList, "Creature").size() == 0) { c = chooseCreature(ai, fetchList); } else if (ZoneType.Battlefield.equals(destination) || ZoneType.Graveyard.equals(destination)) { - c = CardFactoryUtil.getBestAI(fetchList); + if (!activator.equals(ai) && sa.hasParam("GainControl")) { + c = CardFactoryUtil.getWorstAI(fetchList); + } else { + c = CardFactoryUtil.getBestAI(fetchList); + } } else { // Don't fetch another tutor with the same name List sameNamed = CardLists.filter(fetchList, Predicates.not(CardPredicates.nameEquals(card.getName())));