mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
- 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:
@@ -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
|
Glasses of Urza
|
||||||
1
|
1
|
||||||
Artifact
|
Artifact
|
||||||
|
|||||||
@@ -14249,7 +14249,6 @@ public class CardFactory implements NewConstants {
|
|||||||
CardList list = getArtEnchantments();
|
CardList list = getArtEnchantments();
|
||||||
if(list.size() > 0) {
|
if(list.size() > 0) {
|
||||||
CardListUtil.sortCMC(list);
|
CardListUtil.sortCMC(list);
|
||||||
list.reverse();
|
|
||||||
setTargetCard(list.get(0));
|
setTargetCard(list.get(0));
|
||||||
AllZone.GameAction.sacrifice(card);
|
AllZone.GameAction.sacrifice(card);
|
||||||
}
|
}
|
||||||
@@ -17289,6 +17288,7 @@ public class CardFactory implements NewConstants {
|
|||||||
{
|
{
|
||||||
CardListUtil.sortAttackLowFirst(compCreats);
|
CardListUtil.sortAttackLowFirst(compCreats);
|
||||||
CardListUtil.sortCMC(compCreats);
|
CardListUtil.sortCMC(compCreats);
|
||||||
|
compCreats.reverse();
|
||||||
for (int i=0; i < compCreats.size()-humCreats.size();i++)
|
for (int i=0; i < compCreats.size()-humCreats.size();i++)
|
||||||
AllZone.GameAction.sacrifice(compCreats.get(i));
|
AllZone.GameAction.sacrifice(compCreats.get(i));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,6 +208,7 @@ public class CardListUtil
|
|||||||
list.sort(com);
|
list.sort(com);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Sorts from high to low
|
||||||
public static void sortCMC(CardList list)
|
public static void sortCMC(CardList list)
|
||||||
{
|
{
|
||||||
Comparator<Card> com = new Comparator<Card>()
|
Comparator<Card> com = new Comparator<Card>()
|
||||||
|
|||||||
@@ -780,37 +780,48 @@ public class CombatUtil {
|
|||||||
AllZone.Phase.getPhase().equals(Constant.Phase.Combat_Declare_Attackers_InstantAbility)) {
|
AllZone.Phase.getPhase().equals(Constant.Phase.Combat_Declare_Attackers_InstantAbility)) {
|
||||||
|
|
||||||
//Annihilator:
|
//Annihilator:
|
||||||
ArrayList<String> kws = c.getKeyword();
|
if (!c.getCreatureAttackedThisCombat())
|
||||||
Pattern p = Pattern.compile("Annihilator [0-9]+");
|
|
||||||
Matcher m;
|
|
||||||
for (String key : kws)
|
|
||||||
{
|
{
|
||||||
m = p.matcher(key);
|
ArrayList<String> kws = c.getKeyword();
|
||||||
if (m.find())
|
Pattern p = Pattern.compile("Annihilator [0-9]+");
|
||||||
{
|
Matcher m;
|
||||||
String k[] = key.split(" ");
|
for (String key : kws)
|
||||||
final int a = Integer.valueOf(k[1]);
|
{
|
||||||
final Card crd = c;
|
m = p.matcher(key);
|
||||||
|
if (m.find())
|
||||||
final Ability ability = new Ability(c, "0")
|
{
|
||||||
{
|
String k[] = key.split(" ");
|
||||||
public void resolve()
|
final int a = Integer.valueOf(k[1]);
|
||||||
{
|
final Card crd = c;
|
||||||
if (crd.getController().equals(Constant.Player.Human))
|
|
||||||
{
|
final Ability ability = new Ability(c, "0")
|
||||||
//comp sacks
|
{
|
||||||
}
|
public void resolve()
|
||||||
else
|
{
|
||||||
{
|
if (crd.getController().equals(Constant.Player.Human))
|
||||||
AllZone.InputControl.setInput(CardFactoryUtil.input_sacrificePermanents(a));
|
{
|
||||||
}
|
CardList list = new CardList(AllZone.Computer_Play.getCards());
|
||||||
|
CardListUtil.sortCMC(list);
|
||||||
}
|
list.reverse();
|
||||||
};
|
int max = list.size();
|
||||||
ability.setStackDescription("");
|
if (max>a)
|
||||||
AllZone.Stack.add(ability);
|
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
|
//Annihilator
|
||||||
|
|
||||||
//Beastmaster Ascension
|
//Beastmaster Ascension
|
||||||
|
|||||||
Reference in New Issue
Block a user