mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
1) Added a canPlayAI() method to Reprisal.
2) Added the updated canPlayAI() method to Squirrel Nest.
This commit is contained in:
@@ -17078,6 +17078,21 @@ public class CardFactory implements NewConstants {
|
|||||||
final SpellAbility spell = new Spell(card) {
|
final SpellAbility spell = new Spell(card) {
|
||||||
private static final long serialVersionUID = 8653455310355884536L;
|
private static final long serialVersionUID = 8653455310355884536L;
|
||||||
|
|
||||||
|
public boolean canPlayAI() {
|
||||||
|
CardList list = new CardList(AllZone.Human_Play.getCards());
|
||||||
|
list = list.filter(new CardListFilter() {
|
||||||
|
public boolean addCard(Card c) {
|
||||||
|
return c.isCreature() && c.getNetAttack() > 3 && CardFactoryUtil.canTarget(card, c);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (list.isEmpty()) return false;
|
||||||
|
|
||||||
|
CardListUtil.sortAttack(list);
|
||||||
|
CardListUtil.sortFlying(list);
|
||||||
|
setTargetCard(list.get(0));
|
||||||
|
return true;
|
||||||
|
}//canPlayAI()
|
||||||
|
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if(AllZone.GameAction.isCardInPlay(getTargetCard())) {
|
if(AllZone.GameAction.isCardInPlay(getTargetCard())) {
|
||||||
AllZone.GameAction.destroy(getTargetCard());
|
AllZone.GameAction.destroy(getTargetCard());
|
||||||
|
|||||||
@@ -394,6 +394,23 @@ class CardFactory_Auras {
|
|||||||
private static final long serialVersionUID = 6115713202262504968L;
|
private static final long serialVersionUID = 6115713202262504968L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
public boolean canPlayAI() {
|
||||||
|
|
||||||
|
CardList list = new CardList(AllZone.Computer_Play.getCards());
|
||||||
|
list = list.filter(new CardListFilter() {
|
||||||
|
public boolean addCard(Card c) {
|
||||||
|
return c.isLand() && !c.isEnchanted() && CardFactoryUtil.canTarget(card, c);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (list.isEmpty()) return false;
|
||||||
|
else {
|
||||||
|
list.shuffle();
|
||||||
|
setTargetCard(list.get(0));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}//canPlayAI()
|
||||||
|
/*
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
CardList list = new CardList(AllZone.Computer_Play.getCards());
|
CardList list = new CardList(AllZone.Computer_Play.getCards());
|
||||||
list = list.getType("Land");
|
list = list.getType("Land");
|
||||||
@@ -403,6 +420,7 @@ class CardFactory_Auras {
|
|||||||
setTargetCard(list.get(0));
|
setTargetCard(list.get(0));
|
||||||
return true;
|
return true;
|
||||||
}//canPlayAI()
|
}//canPlayAI()
|
||||||
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
|
|||||||
Reference in New Issue
Block a user