mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
- Improved the AI of Echoing Decay.
This commit is contained in:
@@ -3,7 +3,6 @@ ManaCost:1 B
|
|||||||
Types:Instant
|
Types:Instant
|
||||||
Text:Target creature and all other creatures with the same name as that creature get -2/-2 until end of turn.
|
Text:Target creature and all other creatures with the same name as that creature get -2/-2 until end of turn.
|
||||||
SVar:Rarity:Common
|
SVar:Rarity:Common
|
||||||
SVar:RemAIDeck:True
|
|
||||||
SVar:Picture:http://resources.wizards.com/magic/cards/dst/en-us/card46176.jpg
|
SVar:Picture:http://resources.wizards.com/magic/cards/dst/en-us/card46176.jpg
|
||||||
SetInfo:DST|Common|http://magiccards.info/scans/en/ds/41.jpg
|
SetInfo:DST|Common|http://magiccards.info/scans/en/ds/41.jpg
|
||||||
Oracle:Target creature and all other creatures with the same name as that creature get -2/-2 until end of turn.
|
Oracle:Target creature and all other creatures with the same name as that creature get -2/-2 until end of turn.
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import forge.ButtonUtil;
|
|||||||
import forge.Card;
|
import forge.Card;
|
||||||
import forge.CardList;
|
import forge.CardList;
|
||||||
import forge.CardListFilter;
|
import forge.CardListFilter;
|
||||||
import forge.CardListUtil;
|
|
||||||
import forge.CardUtil;
|
import forge.CardUtil;
|
||||||
import forge.Command;
|
import forge.Command;
|
||||||
import forge.ComputerUtil;
|
import forge.ComputerUtil;
|
||||||
@@ -284,36 +283,19 @@ public class CardFactoryInstants {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
final CardList c = this.getCreature();
|
final CardList cl = CardFactoryUtil.getHumanCreatureAI(2, this, true);
|
||||||
if (c.isEmpty()) {
|
if (cl.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
}
|
||||||
this.setTargetCard(c.get(0));
|
Card best = CardFactoryUtil.getBestCreatureAI(cl);
|
||||||
|
// don't target a creature that would hurt your own
|
||||||
|
if (!AllZone.getComputerPlayer().getCardsIn(Constant.Zone.Battlefield, best.getName()).isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.setTargetCard(best);
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
} // canPlayAI()
|
} // canPlayAI()
|
||||||
|
|
||||||
CardList getCreature() {
|
|
||||||
final CardList out = new CardList();
|
|
||||||
final CardList list = CardFactoryUtil.getHumanCreatureAI("Flying", this, true);
|
|
||||||
list.shuffle();
|
|
||||||
|
|
||||||
for (int i = 0; i < list.size(); i++) {
|
|
||||||
if ((list.get(i).getNetAttack() >= 2) && (list.get(i).getNetDefense() <= 2)) {
|
|
||||||
out.add(list.get(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// in case human player only has a few creatures in play,
|
|
||||||
// target anything
|
|
||||||
if (out.isEmpty() && (0 < CardFactoryUtil.getHumanCreatureAI(2, this, true).size())
|
|
||||||
&& (3 > CardFactoryUtil.getHumanCreatureAI(this, true).size())) {
|
|
||||||
out.addAll(CardFactoryUtil.getHumanCreatureAI(2, this, true));
|
|
||||||
CardListUtil.sortFlying(out);
|
|
||||||
}
|
|
||||||
return out;
|
|
||||||
} // getCreature()
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if (AllZoneUtil.isCardInPlay(this.getTargetCard()) && this.getTargetCard().canBeTargetedBy(this)) {
|
if (AllZoneUtil.isCardInPlay(this.getTargetCard()) && this.getTargetCard().canBeTargetedBy(this)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user