- Annihilator Part 2, added Kozilek, Butcher of Truth (draw cards on cast not yet implemented), Annihilator seems to work alright though.

- Fixed some AI mistakes of cards using sortCMC.
This commit is contained in:
jendave
2011-08-06 04:05:19 +00:00
parent 7a61accea2
commit 0b8af7f05f
4 changed files with 51 additions and 31 deletions

View File

@@ -1,3 +1,11 @@
Kozilek, Butcher of Truth
10
Legendary Creature Eldrazi
no text
12/12
Annihilator 4
When this card is put into a graveyard from anywhere, reveal this card and shuffle it into its owner's library instead.
Glasses of Urza
1
Artifact

View File

@@ -14249,7 +14249,6 @@ public class CardFactory implements NewConstants {
CardList list = getArtEnchantments();
if(list.size() > 0) {
CardListUtil.sortCMC(list);
list.reverse();
setTargetCard(list.get(0));
AllZone.GameAction.sacrifice(card);
}
@@ -17289,6 +17288,7 @@ public class CardFactory implements NewConstants {
{
CardListUtil.sortAttackLowFirst(compCreats);
CardListUtil.sortCMC(compCreats);
compCreats.reverse();
for (int i=0; i < compCreats.size()-humCreats.size();i++)
AllZone.GameAction.sacrifice(compCreats.get(i));
}

View File

@@ -208,6 +208,7 @@ public class CardListUtil
list.sort(com);
}
//Sorts from high to low
public static void sortCMC(CardList list)
{
Comparator<Card> com = new Comparator<Card>()

View File

@@ -780,37 +780,48 @@ public class CombatUtil {
AllZone.Phase.getPhase().equals(Constant.Phase.Combat_Declare_Attackers_InstantAbility)) {
//Annihilator:
ArrayList<String> kws = c.getKeyword();
Pattern p = Pattern.compile("Annihilator [0-9]+");
Matcher m;
for (String key : kws)
if (!c.getCreatureAttackedThisCombat())
{
m = p.matcher(key);
if (m.find())
{
String k[] = key.split(" ");
final int a = Integer.valueOf(k[1]);
final Card crd = c;
final Ability ability = new Ability(c, "0")
{
public void resolve()
{
if (crd.getController().equals(Constant.Player.Human))
{
//comp sacks
}
else
{
AllZone.InputControl.setInput(CardFactoryUtil.input_sacrificePermanents(a));
}
}
};
ability.setStackDescription("");
AllZone.Stack.add(ability);
}
}
ArrayList<String> kws = c.getKeyword();
Pattern p = Pattern.compile("Annihilator [0-9]+");
Matcher m;
for (String key : kws)
{
m = p.matcher(key);
if (m.find())
{
String k[] = key.split(" ");
final int a = Integer.valueOf(k[1]);
final Card crd = c;
final Ability ability = new Ability(c, "0")
{
public void resolve()
{
if (crd.getController().equals(Constant.Player.Human))
{
CardList list = new CardList(AllZone.Computer_Play.getCards());
CardListUtil.sortCMC(list);
list.reverse();
int max = list.size();
if (max>a)
max = a;
for (int i=0;i<max;i++)
AllZone.GameAction.sacrifice(list.get(i));
}
else
{
AllZone.InputControl.setInput(CardFactoryUtil.input_sacrificePermanents(a));
}
}
};
ability.setStackDescription("Annihilator - Defending player sacrifices " + a + " permanents.");
AllZone.Stack.add(ability);
} //find
} //for
}//creatureAttacked
//Annihilator
//Beastmaster Ascension