From b349f14ce56ff1645883f5bf37d85e592b17e7c3 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 05:55:23 +0000 Subject: [PATCH] - Added SVar AntiBuffedby to be used on permanents the human controls to make the AI play certain cards in Main1. - Added AntiBuffedby SVar to Timid Drake. --- res/cards.txt | 1 + src/forge/ComputerAI_General.java | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/res/cards.txt b/res/cards.txt index 12736e811cb..6ba4f32314d 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -31155,6 +31155,7 @@ no text 3/3 Flying WheneverKeyword:EntersBattleField:Type/Creature:Play:MoveFrom-Play-Hand:Self:ASAP:No_Condition:Initiator - Other than Self:When another creature enters the battlefield, return Timid Drake to its owner's hand. +SVar:AntiBuffedBy:Creature SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/timid_drake.jpg diff --git a/src/forge/ComputerAI_General.java b/src/forge/ComputerAI_General.java index 0423aadbaa2..ffaebbaef1a 100644 --- a/src/forge/ComputerAI_General.java +++ b/src/forge/ComputerAI_General.java @@ -153,8 +153,7 @@ public class ComputerAI_General implements Computer { if(c.isCreature() && (c.getKeyword().contains("Haste")) || c.getKeyword().contains("Exalted")) return true; - CardList buffed = new CardList(AllZone.Computer_Play.getCards()); - // buffed.getKeyword("BuffedBy"); //get all cards the computer controls with BuffedBy + CardList buffed = new CardList(AllZone.Computer_Play.getCards()); //get all cards the computer controls with BuffedBy for(int i = 0; i < buffed.size(); i++) { Card buffedcard = buffed.get(i); if (buffedcard.getSVar("BuffedBy").length() > 0) { @@ -164,6 +163,16 @@ public class ComputerAI_General implements Computer { } } + CardList antibuffed = new CardList(AllZone.Human_Play.getCards()); //get all cards the computer controls with AntiBuffedBy + for(int i = 0; i < buffed.size(); i++) { + Card buffedcard = antibuffed.get(i); + if (buffedcard.getSVar("AntiBuffedBy").length() > 0) { + String buffedby = buffedcard.getSVar("AntiBuffedBy"); + final String bffdby[] = buffedby.split(","); + if (c.isValidCard(bffdby)) return true; + } + } + if(c.isLand()) return false; CardList Vengevines = new CardList();