diff --git a/.gitattributes b/.gitattributes index d1b60ff0715..ef41c82be48 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4011,6 +4011,7 @@ res/cardsfolder/plague_wind.txt -text svneol=native#text/plain res/cardsfolder/plague_witch.txt -text svneol=native#text/plain res/cardsfolder/plagued_rusalka.txt -text svneol=native#text/plain res/cardsfolder/plains.txt -text svneol=native#text/plain +res/cardsfolder/planar_birth.txt -text svneol=native#text/plain res/cardsfolder/planar_cleansing.txt -text svneol=native#text/plain res/cardsfolder/planar_collapse.txt -text svneol=native#text/plain res/cardsfolder/planar_despair.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/planar_birth.txt b/res/cardsfolder/planar_birth.txt new file mode 100644 index 00000000000..4d8c4c5692c --- /dev/null +++ b/res/cardsfolder/planar_birth.txt @@ -0,0 +1,9 @@ +Name:Planar Birth +ManaCost:1 W +Types:Sorcery +Text:no text +A:SP$ChangeZoneAll | Cost$ 1 W | ChangeType$ Land.Basic | Origin$ Graveyard | Destination$ Battlefield | Tapped$ True | SpellDescription$ Return all basic land cards from all graveyards to the battlefield tapped under their owners' control. +SVar:RemAIDeck:True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/planar_birth.jpg +End \ No newline at end of file diff --git a/res/cardsfolder/retract.txt b/res/cardsfolder/retract.txt index 6c87d256060..1a797bf992a 100644 --- a/res/cardsfolder/retract.txt +++ b/res/cardsfolder/retract.txt @@ -1,8 +1,8 @@ Name:Retract ManaCost:U Types:Instant -Text:Return all artifacts you control to their owner's hand. -K:spBounceAll:Artifact.YouCtrl:Hand +Text:no text +A:SP$ChangeZoneAll | Cost$ U | ChangeType$ Artifact.YouCtrl | Origin$ Battlefield | Destination$ Hand | SpellDescription$ Return all artifacts you control to their owner's hand. SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/retract.jpg diff --git a/src/forge/AbilityFactory_ChangeZone.java b/src/forge/AbilityFactory_ChangeZone.java index 0d2d77cb3df..e86d1373657 100644 --- a/src/forge/AbilityFactory_ChangeZone.java +++ b/src/forge/AbilityFactory_ChangeZone.java @@ -646,8 +646,9 @@ public class AbilityFactory_ChangeZone { // AI Targeting Card choice = null; - if (list.getNotType("Creature").size() == 0 && destination.equals("Battlefield")) - choice = CardFactoryUtil.AI_getBestCreature(list); //if only creatures take the best + if (CardFactoryUtil.AI_getMostExpensivePermanent(list, af.getHostCard(), false).isCreature() + && destination.equals("Battlefield")) + choice = CardFactoryUtil.AI_getBestCreatureToBounce(list); //if a creature is most expensive take the best else if (destination.equals("Battlefield")) choice = CardFactoryUtil.AI_getMostExpensivePermanent(list, af.getHostCard(), false); else{ @@ -1035,11 +1036,13 @@ public class AbilityFactory_ChangeZone { else if (origin.equals("Battlefield")){ // this statement is assuming the AI is trying to use this spell offensively // if the AI is using it defensively, then something else needs to occur - if (computerType.size()+1 > humanType.size()) - return false; - - if (humanType.size() <= 1) // unless that 1 thing is going to kill me soon? - return false; + // if only creatures are affected evaluate both lists and pass only if human creatures are more valuable + if (humanType.getNotType("Creature").size() == 0 && computerType.getNotType("Creature").size() == 0) { + if(CardFactoryUtil.evaluateCreatureList(computerType) + 200 >= CardFactoryUtil.evaluateCreatureList(humanType)) + return false; + } // otherwise evaluate both lists by CMC and pass only if human permanents are more valuable + else if(CardFactoryUtil.evaluatePermanentList(computerType) + 3 >= CardFactoryUtil.evaluatePermanentList(humanType)) + return false; // Don't cast during main1? if (AllZone.Phase.is(Constant.Phase.Main1, AllZone.ComputerPlayer)) @@ -1066,14 +1069,21 @@ public class AbilityFactory_ChangeZone { if (destination.equals(Constant.Zone.Battlefield)){ if (params.get("GainControl") != null){ - // todo: don't activate if less than 4 cards. - // although if those cards are awesome, or we need the blockers maybe we should - if (humanType.size() + computerType.size() < 4) + // Check if the cards are valuable enough + if (humanType.getNotType("Creature").size() == 0 && computerType.getNotType("Creature").size() == 0) { + if(CardFactoryUtil.evaluateCreatureList(computerType) + CardFactoryUtil.evaluateCreatureList(humanType) < 400) + return false; + } // otherwise evaluate both lists by CMC and pass only if human permanents are less valuable + else if(CardFactoryUtil.evaluatePermanentList(computerType) + CardFactoryUtil.evaluatePermanentList(humanType) < 6) return false; } else{ // don't activate if human gets more back than AI does - if (humanType.size() > computerType.size()) + if (humanType.getNotType("Creature").size() == 0 && computerType.getNotType("Creature").size() == 0) { + if(CardFactoryUtil.evaluateCreatureList(computerType) <= CardFactoryUtil.evaluateCreatureList(humanType) + 100) + return false; + } // otherwise evaluate both lists by CMC and pass only if human permanents are less valuable + else if(CardFactoryUtil.evaluatePermanentList(computerType) <= CardFactoryUtil.evaluatePermanentList(humanType) + 2) return false; } } @@ -1128,6 +1138,8 @@ public class AbilityFactory_ChangeZone { // I don't know if library position is necessary. It's here if it is, just in case int libraryPos = params.containsKey("LibraryPosition") ? Integer.parseInt(params.get("LibraryPosition")) : 0; for(Card c : cards){ + if (destination.equals("Battlefield") && params.containsKey("Tapped")) + c.tap(); if (params.containsKey("GainControl")) AllZone.GameAction.moveToPlay(c, sa.getActivatingPlayer()); else diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index 2d667b4b38b..c7ad745e4a4 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -391,7 +391,7 @@ public class CardFactoryUtil { if (biggest.isToken()) biggestvalue += 100; // raise the value of tokens newvalue = evaluateCreature(all.get(i)); if (all.get(i).isToken()) newvalue += 100; // raise the value of tokens - if(evaluateCreature(biggest) < evaluateCreature(all.get(i))) biggest = all.get(i); + if(biggestvalue < newvalue) biggest = all.get(i); } } return biggest;