BuffedBy keyword (or SVar?)

First I would change the name, since it is not an ability, then I'm not sure if it's better to make it an SVar (just to make it consistend with PlayMain1).Chris H. wrote:Rob's new SVar:PlayMain1:TRUE is great for many of the cards and the three of us have added this SVar to most of the cards that needed it. Unfortunately, the Mimics and similar cards require a whole new keyword.
In the ComputerAI_General.getMain1() code the AI would have to check every one of it's cards in play to see if it contained the abBuffedBy keyword. If a card in play returned true then parse the params. Then check cards in hand to see if there is a match. If true then the card in hand should be cast in main 1.
I have figured out the basic logic but I'm not sure if my java/coding skills is up to the task. I do have a few short lines of code:
- Code: Select all
private SpellAbility[] getMain1() {
//Card list of all cards to consider
CardList hand = new CardList(AllZone.Computer_Hand.getCards());
hand = hand.filter(new CardListFilter() {
// Beached As Start
public boolean addCard(Card c) {
//Collection<Card> play = playMain1Cards;
if (c.getSVar("PlayMain1").equals("TRUE")) return true;
if (c.isLand()) return false;
if (c.isCreature() && (c.getKeyword().contains("Haste")) || c.getKeyword().contains("Exalted")) return true;
CardList buffedBy = new CardList();
buffedBy.addAll(AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer).getCards());
buffedBy.filter(new CardListFilter() {
public boolean addCard(Card card) {
return card.getKeyword().contains("abBuffedBy");
}
});
if (buffedBy.size() > 0) {
}
EDIT: If we already guide the AI with this, we can also specify what cards to play in Main 1. Example Shorecrasher Mimic:
BuffedBy:Spell.green+blue
We can use the getValidCard method for this (I hope).