mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +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);
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
|
||||
//*************** START *********** START **************************
|
||||
if(cardName.equals("Doomed Necromancer")) {
|
||||
|
||||
final SpellAbility ability = new Ability_Tap(card, "B") {
|
||||
private static final long serialVersionUID = -6432831150810562390L;
|
||||
|
||||
@Override
|
||||
public boolean canPlayAI() {
|
||||
|
||||
return getCreatures().length != 0;
|
||||
}
|
||||
}//canPlayAI()
|
||||
|
||||
public Card[] getCreatures() {
|
||||
CardList creature = new CardList();
|
||||
PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||
creature.addAll(zone.getCards());
|
||||
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() {
|
||||
public boolean addCard(Card c) {
|
||||
return c.getNetAttack() > 4;
|
||||
}
|
||||
});
|
||||
return creature.toArray();
|
||||
}
|
||||
}//getCreatures()
|
||||
|
||||
@Override
|
||||
public void chooseTargetAI() {
|
||||
Card c[] = getCreatures();
|
||||
@@ -11819,10 +11824,10 @@ public class CardFactory_Creatures {
|
||||
if(biggest.getNetAttack() < c[i].getNetAttack()) biggest = c[i];
|
||||
|
||||
setTargetCard(biggest);
|
||||
}
|
||||
}//chooseTargetAI()
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
|
||||
if(card.getController().equals(Constant.Player.Human)) {
|
||||
CardList creature = new CardList();
|
||||
PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||
@@ -11830,6 +11835,7 @@ public class CardFactory_Creatures {
|
||||
creature = creature.getType("Creature");
|
||||
if(creature.size() != 0) {
|
||||
Object o = AllZone.Display.getChoice("Choose a creature from the graveyard to return to the battlefield", creature.toArray());
|
||||
|
||||
if(o != null) {
|
||||
Card c = (Card) o;
|
||||
if(AllZone.GameAction.isCardInZone(c, zone)) {
|
||||
@@ -11841,7 +11847,7 @@ public class CardFactory_Creatures {
|
||||
} else {
|
||||
AllZone.GameAction.sacrifice(card);
|
||||
}
|
||||
} else {
|
||||
} else {//Computer
|
||||
CardList creature = new CardList();
|
||||
PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||
creature.addAll(zone.getCards());
|
||||
@@ -11850,6 +11856,7 @@ public class CardFactory_Creatures {
|
||||
Card biggest = c[0];
|
||||
for(int i = 0; i < c.length; i++)
|
||||
if(biggest.getNetAttack() < c[i].getNetAttack()) biggest = c[i];
|
||||
|
||||
if(creature.size() != 0) {
|
||||
if(biggest != null) {
|
||||
if(AllZone.GameAction.isCardInZone(biggest, zone)) {
|
||||
@@ -11863,17 +11870,18 @@ public class CardFactory_Creatures {
|
||||
}
|
||||
}
|
||||
}//resolve()
|
||||
};
|
||||
card.clearSpellAbility();
|
||||
};//SpellAbility
|
||||
|
||||
// card.clearSpellAbility();
|
||||
card.addSpellAbility(ability);
|
||||
ability.setStackDescription(cardName
|
||||
+ " 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");
|
||||
card.addSpellAbility(new Spell_Permanent(card) {
|
||||
private static final long serialVersionUID = -462134621235305833L;
|
||||
});
|
||||
ability.setStackDescription(cardName + " 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");
|
||||
// card.addSpellAbility(new Spell_Permanent(card) {
|
||||
// private static final long serialVersionUID = -462134621235305833L;
|
||||
// });
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Affa Guard Hound")) {
|
||||
final CommandReturn getCreature = new CommandReturn() {
|
||||
|
||||
Reference in New Issue
Block a user