mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Fixed Doomed Necromancer. The AI will no longer target a creature with the keyword "At the beginning of the end step, sacrifice CARDNAME." if it is main phase 2.
This commit is contained in:
@@ -11789,28 +11789,33 @@ public class CardFactory_Creatures {
|
|||||||
ability.setAfterPayMana(target);
|
ability.setAfterPayMana(target);
|
||||||
}//*************** END ************ END **************************
|
}//*************** END ************ END **************************
|
||||||
|
|
||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
if(cardName.equals("Doomed Necromancer")) {
|
if(cardName.equals("Doomed Necromancer")) {
|
||||||
|
|
||||||
final SpellAbility ability = new Ability_Tap(card, "B") {
|
final SpellAbility ability = new Ability_Tap(card, "B") {
|
||||||
private static final long serialVersionUID = -6432831150810562390L;
|
private static final long serialVersionUID = -6432831150810562390L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
|
|
||||||
return getCreatures().length != 0;
|
return getCreatures().length != 0;
|
||||||
}
|
}//canPlayAI()
|
||||||
|
|
||||||
public Card[] getCreatures() {
|
public Card[] getCreatures() {
|
||||||
CardList creature = new CardList();
|
CardList creature = new CardList();
|
||||||
PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||||
creature.addAll(zone.getCards());
|
creature.addAll(zone.getCards());
|
||||||
creature = creature.getType("Creature");
|
creature = creature.getType("Creature");
|
||||||
|
if (AllZone.Phase.getPhase().equals(Constant.Phase.Main2) && card.getController().equals(Constant.Player.Computer)) {
|
||||||
|
creature = creature.getNotKeyword("At the beginning of the end step, sacrifice CARDNAME.");
|
||||||
|
}
|
||||||
creature = creature.filter(new CardListFilter() {
|
creature = creature.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
return c.getNetAttack() > 4;
|
return c.getNetAttack() > 4;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return creature.toArray();
|
return creature.toArray();
|
||||||
}
|
}//getCreatures()
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void chooseTargetAI() {
|
public void chooseTargetAI() {
|
||||||
Card c[] = getCreatures();
|
Card c[] = getCreatures();
|
||||||
@@ -11819,10 +11824,10 @@ public class CardFactory_Creatures {
|
|||||||
if(biggest.getNetAttack() < c[i].getNetAttack()) biggest = c[i];
|
if(biggest.getNetAttack() < c[i].getNetAttack()) biggest = c[i];
|
||||||
|
|
||||||
setTargetCard(biggest);
|
setTargetCard(biggest);
|
||||||
}
|
}//chooseTargetAI()
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
|
|
||||||
if(card.getController().equals(Constant.Player.Human)) {
|
if(card.getController().equals(Constant.Player.Human)) {
|
||||||
CardList creature = new CardList();
|
CardList creature = new CardList();
|
||||||
PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||||
@@ -11830,6 +11835,7 @@ public class CardFactory_Creatures {
|
|||||||
creature = creature.getType("Creature");
|
creature = creature.getType("Creature");
|
||||||
if(creature.size() != 0) {
|
if(creature.size() != 0) {
|
||||||
Object o = AllZone.Display.getChoice("Choose a creature from the graveyard to return to the battlefield", creature.toArray());
|
Object o = AllZone.Display.getChoice("Choose a creature from the graveyard to return to the battlefield", creature.toArray());
|
||||||
|
|
||||||
if(o != null) {
|
if(o != null) {
|
||||||
Card c = (Card) o;
|
Card c = (Card) o;
|
||||||
if(AllZone.GameAction.isCardInZone(c, zone)) {
|
if(AllZone.GameAction.isCardInZone(c, zone)) {
|
||||||
@@ -11841,7 +11847,7 @@ public class CardFactory_Creatures {
|
|||||||
} else {
|
} else {
|
||||||
AllZone.GameAction.sacrifice(card);
|
AllZone.GameAction.sacrifice(card);
|
||||||
}
|
}
|
||||||
} else {
|
} else {//Computer
|
||||||
CardList creature = new CardList();
|
CardList creature = new CardList();
|
||||||
PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||||
creature.addAll(zone.getCards());
|
creature.addAll(zone.getCards());
|
||||||
@@ -11850,6 +11856,7 @@ public class CardFactory_Creatures {
|
|||||||
Card biggest = c[0];
|
Card biggest = c[0];
|
||||||
for(int i = 0; i < c.length; i++)
|
for(int i = 0; i < c.length; i++)
|
||||||
if(biggest.getNetAttack() < c[i].getNetAttack()) biggest = c[i];
|
if(biggest.getNetAttack() < c[i].getNetAttack()) biggest = c[i];
|
||||||
|
|
||||||
if(creature.size() != 0) {
|
if(creature.size() != 0) {
|
||||||
if(biggest != null) {
|
if(biggest != null) {
|
||||||
if(AllZone.GameAction.isCardInZone(biggest, zone)) {
|
if(AllZone.GameAction.isCardInZone(biggest, zone)) {
|
||||||
@@ -11863,17 +11870,18 @@ public class CardFactory_Creatures {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}//resolve()
|
}//resolve()
|
||||||
};
|
};//SpellAbility
|
||||||
card.clearSpellAbility();
|
|
||||||
|
// card.clearSpellAbility();
|
||||||
card.addSpellAbility(ability);
|
card.addSpellAbility(ability);
|
||||||
ability.setStackDescription(cardName
|
ability.setStackDescription(cardName + " gets sacrificed to return target creature card from your graveyard to the battlefield");
|
||||||
+ " gets sacrificed to return target creature card from your graveyard to the battlefield");
|
// ability.setDescription("B, Tap: Sacrifice Doomed Necromancer: Return target creature card from your graveyard to the battlefield");
|
||||||
ability.setDescription("B, Tap: Sacrifice Doomed Necromancer: Return target creature card from your graveyard to the battlefield");
|
// card.addSpellAbility(new Spell_Permanent(card) {
|
||||||
card.addSpellAbility(new Spell_Permanent(card) {
|
// private static final long serialVersionUID = -462134621235305833L;
|
||||||
private static final long serialVersionUID = -462134621235305833L;
|
// });
|
||||||
});
|
|
||||||
}//*************** END ************ END **************************
|
}//*************** END ************ END **************************
|
||||||
|
|
||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Affa Guard Hound")) {
|
else if(cardName.equals("Affa Guard Hound")) {
|
||||||
final CommandReturn getCreature = new CommandReturn() {
|
final CommandReturn getCreature = new CommandReturn() {
|
||||||
|
|||||||
Reference in New Issue
Block a user