mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- Improved the AI of Consume the Meek, Culling Sun, Retribution of the Meek, Cleanse and Plague Wind by considering indestructible.
- reverted the changes to Mirror Gallery
This commit is contained in:
@@ -10411,6 +10411,17 @@ public class CardFactory implements NewConstants {
|
|||||||
if(c.isCreature()) AllZone.GameAction.destroyNoRegeneration(c);
|
if(c.isCreature()) AllZone.GameAction.destroyNoRegeneration(c);
|
||||||
}
|
}
|
||||||
}//resolve()
|
}//resolve()
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPlayAI() {
|
||||||
|
CardList human = new CardList(AllZone.Human_Play.getCards());
|
||||||
|
|
||||||
|
human = human.getType("Creature");
|
||||||
|
human = human.getNotKeyword("Indestructible");
|
||||||
|
|
||||||
|
// the computer will at least destroy 1 creature
|
||||||
|
return !human.isEmpty();
|
||||||
|
}
|
||||||
};//SpellAbility
|
};//SpellAbility
|
||||||
card.clearSpellAbility();
|
card.clearSpellAbility();
|
||||||
card.addSpellAbility(spell);
|
card.addSpellAbility(spell);
|
||||||
@@ -13543,31 +13554,52 @@ public class CardFactory implements NewConstants {
|
|||||||
SpellAbility spell = new Spell(card) {
|
SpellAbility spell = new Spell(card) {
|
||||||
private static final long serialVersionUID = 2169815434022673011L;
|
private static final long serialVersionUID = 2169815434022673011L;
|
||||||
|
|
||||||
@Override
|
CardListFilter filter = new CardListFilter() {
|
||||||
public void resolve() {
|
public boolean addCard(Card c) {
|
||||||
CardList all = new CardList();
|
return c.isCreature() && CardUtil.getConvertedManaCost(c) <= 3;
|
||||||
all.addAll(AllZone.Human_Play.getCards());
|
}
|
||||||
all.addAll(AllZone.Computer_Play.getCards());
|
};
|
||||||
|
|
||||||
for(int i = 0; i < all.size(); i++) {
|
@Override
|
||||||
Card c = all.get(i);
|
public void resolve() {
|
||||||
int convertedManaCost = CardUtil.getConvertedManaCost(c.getManaCost());
|
CardList all = new CardList();
|
||||||
if(c.isCreature() && (convertedManaCost <= 3)) AllZone.GameAction.destroy(c);
|
all.add(getHumanCreatures());
|
||||||
|
all.add(getComputerCreatures());
|
||||||
|
|
||||||
|
for(int i = 0; i < all.size(); i++) {
|
||||||
|
Card c = all.get(i);
|
||||||
|
AllZone.GameAction.destroy(c);
|
||||||
}
|
}
|
||||||
}//resolve()
|
}//resolve()
|
||||||
|
|
||||||
@Override
|
CardListFilter filter = new CardListFilter() {
|
||||||
public boolean canPlayAI() {
|
public boolean addCard(Card c) {
|
||||||
CardList human = new CardList(AllZone.Human_Play.getCards());
|
return c.isCreature() && CardUtil.getConvertedManaCost(c) <= 3;
|
||||||
CardList computer = new CardList(AllZone.Computer_Play.getCards());
|
}
|
||||||
|
};
|
||||||
|
|
||||||
human = human.getType("Creature");
|
private CardList getHumanCreatures() {
|
||||||
computer = computer.getType("Creature");
|
CardList human = AllZoneUtil.getPlayerCardsInPlay(Constant.Player.Human);
|
||||||
|
return human.filter(filter);
|
||||||
|
}
|
||||||
|
|
||||||
//the computer will at least destroy 2 more human creatures
|
private CardList getComputerCreatures() {
|
||||||
return computer.size() < human.size() - 1
|
CardList comp = AllZoneUtil.getPlayerCardsInPlay(Constant.Player.Computer);
|
||||||
|| (AllZone.Computer_Life.getLife() < 7 && !human.isEmpty());
|
return comp.filter(filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPlayAI() {
|
||||||
|
CardList human = getHumanCreatures();
|
||||||
|
human = human.getNotKeyword("Indestructible");
|
||||||
|
CardList computer = getComputerCreatures();
|
||||||
|
computer = computer.getNotKeyword("Indestructible");
|
||||||
|
|
||||||
|
// the computer will at least destroy 2 more human creatures
|
||||||
|
return AllZone.Phase.getPhase().equals(Constant.Phase.Main2) &&
|
||||||
|
(computer.size() < human.size() - 1
|
||||||
|
|| (AllZone.Computer_Life.getLife() < 7 && !human.isEmpty()));
|
||||||
|
}
|
||||||
};//SpellAbility
|
};//SpellAbility
|
||||||
card.clearSpellAbility();
|
card.clearSpellAbility();
|
||||||
card.addSpellAbility(spell);
|
card.addSpellAbility(spell);
|
||||||
@@ -13602,7 +13634,9 @@ public class CardFactory implements NewConstants {
|
|||||||
CardList computer = new CardList(AllZone.Computer_Play.getCards());
|
CardList computer = new CardList(AllZone.Computer_Play.getCards());
|
||||||
|
|
||||||
human = human.getType("Creature");
|
human = human.getType("Creature");
|
||||||
|
human = human.getNotKeyword("Indestructible");
|
||||||
computer = computer.getType("Creature");
|
computer = computer.getType("Creature");
|
||||||
|
computer = computer.getNotKeyword("Indestructible");
|
||||||
|
|
||||||
human = human.filter(new CardListFilter() {
|
human = human.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
@@ -13610,6 +13644,13 @@ public class CardFactory implements NewConstants {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
computer = computer.filter(new CardListFilter() {
|
||||||
|
public boolean addCard(Card c) {
|
||||||
|
return c.getNetAttack() >= 4;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
//the computer will at least destroy 2 more human creatures
|
//the computer will at least destroy 2 more human creatures
|
||||||
return computer.size() < human.size() - 1
|
return computer.size() < human.size() - 1
|
||||||
|| (AllZone.Computer_Life.getLife() < 7 && !human.isEmpty());
|
|| (AllZone.Computer_Life.getLife() < 7 && !human.isEmpty());
|
||||||
@@ -13678,7 +13719,9 @@ public class CardFactory implements NewConstants {
|
|||||||
CardList comp = new CardList(AllZone.Computer_Play.getCards());
|
CardList comp = new CardList(AllZone.Computer_Play.getCards());
|
||||||
|
|
||||||
hum = hum.getType("Creature");
|
hum = hum.getType("Creature");
|
||||||
|
hum = hum.getNotKeyword("Indestructible");
|
||||||
comp = comp.getType("Creature");
|
comp = comp.getType("Creature");
|
||||||
|
comp = comp.getNotKeyword("Indestructible");
|
||||||
|
|
||||||
CardList human = new CardList();
|
CardList human = new CardList();
|
||||||
CardList computer = new CardList();
|
CardList computer = new CardList();
|
||||||
@@ -21405,7 +21448,9 @@ public class CardFactory implements NewConstants {
|
|||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
CardList human = getHumanCreatures();
|
CardList human = getHumanCreatures();
|
||||||
|
human = human.getNotKeyword("Indestructible");
|
||||||
CardList computer = getComputerCreatures();
|
CardList computer = getComputerCreatures();
|
||||||
|
computer = computer.getNotKeyword("Indestructible");
|
||||||
|
|
||||||
// the computer will at least destroy 2 more human creatures
|
// the computer will at least destroy 2 more human creatures
|
||||||
return AllZone.Phase.getPhase().equals(Constant.Phase.Main2) &&
|
return AllZone.Phase.getPhase().equals(Constant.Phase.Main2) &&
|
||||||
@@ -21996,7 +22041,11 @@ public class CardFactory implements NewConstants {
|
|||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
CardList human = AllZoneUtil.getCreaturesInPlay(Constant.Player.Human);
|
CardList human = AllZoneUtil.getCreaturesInPlay(Constant.Player.Human);
|
||||||
|
human = human.filter(AllZoneUtil.tapped);
|
||||||
|
human = human.getNotKeyword("Indestructible");
|
||||||
CardList computer = AllZoneUtil.getCreaturesInPlay(Constant.Player.Computer);
|
CardList computer = AllZoneUtil.getCreaturesInPlay(Constant.Player.Computer);
|
||||||
|
computer = computer.filter(AllZoneUtil.tapped);
|
||||||
|
computer = computer.getNotKeyword("Indestructible");
|
||||||
|
|
||||||
// the computer will at least destroy 2 more human creatures
|
// the computer will at least destroy 2 more human creatures
|
||||||
return AllZone.Phase.getPhase().equals(Constant.Phase.Main2) &&
|
return AllZone.Phase.getPhase().equals(Constant.Phase.Main2) &&
|
||||||
@@ -22029,8 +22078,10 @@ public class CardFactory implements NewConstants {
|
|||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
CardList human = AllZoneUtil.getCreaturesInPlay(Constant.Player.Human);
|
CardList human = AllZoneUtil.getCreaturesInPlay(Constant.Player.Human);
|
||||||
human = human.filter(powerSix);
|
human = human.filter(powerSix);
|
||||||
|
human = human.getNotKeyword("Indestructible");
|
||||||
CardList computer = AllZoneUtil.getCreaturesInPlay(Constant.Player.Computer);
|
CardList computer = AllZoneUtil.getCreaturesInPlay(Constant.Player.Computer);
|
||||||
computer = computer.filter(powerSix);
|
computer = computer.filter(powerSix);
|
||||||
|
computer = computer.getNotKeyword("Indestructible");
|
||||||
|
|
||||||
// the computer will at least destroy 2 more human creatures
|
// the computer will at least destroy 2 more human creatures
|
||||||
return (AllZone.Phase.getPhase().equals(Constant.Phase.Main2) &&
|
return (AllZone.Phase.getPhase().equals(Constant.Phase.Main2) &&
|
||||||
|
|||||||
@@ -640,8 +640,13 @@ public class GameAction {
|
|||||||
ArrayList<Card> a = PlayerZoneUtil.getCardType(AllZone.Human_Play, "Legendary");
|
ArrayList<Card> a = PlayerZoneUtil.getCardType(AllZone.Human_Play, "Legendary");
|
||||||
a.addAll(PlayerZoneUtil.getCardType(AllZone.Computer_Play, "Legendary"));
|
a.addAll(PlayerZoneUtil.getCardType(AllZone.Computer_Play, "Legendary"));
|
||||||
|
|
||||||
|
CardList Mirror_Gallery = new CardList(); // Mirror Gallery suppresses the Legend rule
|
||||||
|
Mirror_Gallery.addAll(AllZone.Human_Play.getCards());
|
||||||
|
Mirror_Gallery.addAll(AllZone.Computer_Play.getCards());
|
||||||
|
Mirror_Gallery = Mirror_Gallery.getName("Mirror Gallery");
|
||||||
|
|
||||||
while(!a.isEmpty() && !isCardInPlay("Mirror Gallery")) { // Mirror Gallery suppresses the Legend rule
|
|
||||||
|
while(!a.isEmpty() && Mirror_Gallery.isEmpty()) {
|
||||||
ArrayList<Card> b = getCardsNamed(a, (a.get(0)).getName());
|
ArrayList<Card> b = getCardsNamed(a, (a.get(0)).getName());
|
||||||
a.remove(0);
|
a.remove(0);
|
||||||
if(1 < b.size()) {
|
if(1 < b.size()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user