- Fixed Rebel/Merc fetch, can only get permanents now.

- Added the rest of the Harbingers.
- Added Meekstone and Qasali Pridemage.
This commit is contained in:
jendave
2011-08-06 02:50:22 +00:00
parent de91918e51
commit 9ba9b33126
7 changed files with 348 additions and 45 deletions

View File

@@ -973,7 +973,13 @@ public class CardFactoryUtil
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, sourceCard.getController());
CardList mercs = new CardList();
CardList list = new CardList(lib.getCards());
list = list.getType("Mercenary");
list = list.filter(new CardListFilter()
{
public boolean addCard(Card c) {
return (c.getType().contains("Mercenary") || c.getKeyword().contains("Changeling")) && c.isPermanent() ;
}
});
if (list.size()==0)
return false;
@@ -1071,7 +1077,12 @@ public class CardFactoryUtil
CardList rebels = new CardList();
CardList list = new CardList(lib.getCards());
list = list.getType("Rebel");
list = list.filter(new CardListFilter()
{
public boolean addCard(Card c) {
return (c.getType().contains("Rebel") || c.getKeyword().contains("Changeling")) && c.isPermanent() ;
}
});
if (list.size()==0)
return false;

View File

@@ -16333,6 +16333,258 @@ public class CardFactory_Creatures {
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Faerie Harbinger"))
{
final SpellAbility ability = new Ability(card, "0")
{
public void resolve()
{
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
if(AllZone.GameAction.isCardInZone(getTargetCard(), lib))
{
Card c = getTargetCard();
AllZone.GameAction.shuffle(card.getController());
lib.remove(c);
lib.add(c, 0);
}
}//resolve()
};
Command intoPlay = new Command()
{
private static final long serialVersionUID = -708639335039567945L;
public void execute()
{
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
CardList cards = new CardList(lib.getCards());
CardList faeries = new CardList();
for (int i=0;i<cards.size();i++)
{
if(cards.get(i).getType().contains("Faerie") || cards.get(i).getKeyword().contains("Changeling"))
{
faeries.add(cards.get(i));
}
}
String controller = card.getController();
if(faeries.size() == 0)
return;
if(controller.equals(Constant.Player.Human))
{
Object o = AllZone.Display.getChoiceOptional("Select target card", faeries.toArray());
if(o != null)
{
ability.setTargetCard((Card)o);
AllZone.Stack.add(ability);
}
}
else //computer
{
faeries.shuffle();
ability.setTargetCard(faeries.get(0));
AllZone.Stack.add(ability);
}
}//execute()
};//Command
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Flamekin Harbinger"))
{
final SpellAbility ability = new Ability(card, "0")
{
public void resolve()
{
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
if(AllZone.GameAction.isCardInZone(getTargetCard(), lib))
{
Card c = getTargetCard();
AllZone.GameAction.shuffle(card.getController());
lib.remove(c);
lib.add(c, 0);
}
}//resolve()
};
Command intoPlay = new Command()
{
private static final long serialVersionUID = 7114265436722599216L;
public void execute()
{
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
CardList cards = new CardList(lib.getCards());
CardList ele = new CardList();
for (int i=0;i<cards.size();i++)
{
if(cards.get(i).getType().contains("Elemental") || cards.get(i).getKeyword().contains("Changeling"))
{
ele.add(cards.get(i));
}
}
String controller = card.getController();
if(ele.size() == 0)
return;
if(controller.equals(Constant.Player.Human))
{
Object o = AllZone.Display.getChoiceOptional("Select target card", ele.toArray());
if(o != null)
{
ability.setTargetCard((Card)o);
AllZone.Stack.add(ability);
}
}
else //computer
{
ele.shuffle();
ability.setTargetCard(ele.get(0));
AllZone.Stack.add(ability);
}
}//execute()
};//Command
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Giant Harbinger"))
{
final SpellAbility ability = new Ability(card, "0")
{
public void resolve()
{
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
if(AllZone.GameAction.isCardInZone(getTargetCard(), lib))
{
Card c = getTargetCard();
AllZone.GameAction.shuffle(card.getController());
lib.remove(c);
lib.add(c, 0);
}
}//resolve()
};
Command intoPlay = new Command()
{
private static final long serialVersionUID = -2671592749882297551L;
public void execute()
{
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
CardList cards = new CardList(lib.getCards());
CardList giants = new CardList();
for (int i=0;i<cards.size();i++)
{
if(cards.get(i).getType().contains("Giant") || cards.get(i).getKeyword().contains("Changeling"))
{
giants.add(cards.get(i));
}
}
String controller = card.getController();
if(giants.size() == 0)
return;
if(controller.equals(Constant.Player.Human))
{
Object o = AllZone.Display.getChoiceOptional("Select target card", giants.toArray());
if(o != null)
{
ability.setTargetCard((Card)o);
AllZone.Stack.add(ability);
}
}
else //computer
{
giants.shuffle();
ability.setTargetCard(giants.get(0));
AllZone.Stack.add(ability);
}
}//execute()
};//Command
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if (cardName.equals("Qasali Pridemage"))
{
final Ability ability = new Ability(card, "1")
{
public void resolve() {
if (AllZone.GameAction.isCardInPlay(card))
AllZone.GameAction.sacrifice(card);
Card c = getTargetCard();
AllZone.GameAction.destroy(c);
}
public boolean canPlayAI()
{
PlayerZone hPlay = AllZone.getZone(Constant.Zone.Play, Constant.Player.Human);
CardList list = new CardList();
list.addAll(hPlay.getCards());
list = list.filter(new CardListFilter()
{
public boolean addCard(Card c) {
return c.isArtifact() || c.isEnchantment() && CardUtil.getConvertedManaCost(c.getManaCost()) >= 4;
}
});
if (list.size() > 0)
{
list.shuffle();
setTargetCard(list.get(0));
}
return list.size() > 0;
}
};
ability.setDescription("1, Sacrifice Qasali Pridemage: Destroy target artifact or enchantment.");
ability.setBeforePayMana(new Input()
{
private static final long serialVersionUID = -3565024591921095303L;
public void showMessage()
{
PlayerZone hPlay = AllZone.getZone(Constant.Zone.Play, Constant.Player.Human);
PlayerZone cPlay = AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer);
CardList list = new CardList();
list.addAll(hPlay.getCards());
list.addAll(cPlay.getCards());
list = list.filter(new CardListFilter()
{
public boolean addCard(Card c) {
return c.isArtifact() || c.isEnchantment();
}
});
stopSetNext(CardFactoryUtil.input_targetSpecific(ability, list, "Select an Artifact or Enchantment", true));
}
});
card.addSpellAbility(ability);
}//*************** END ************ END **************************
// Cards with Cycling abilities
// -1 means keyword "Cycling" not found

View File

@@ -34,13 +34,19 @@ public class Input_Untap extends Input
if(c[i].getNetAttack() < 3)
c[i].untap();
}
private boolean isMarbleTitanInPlay()
private boolean isMarbleTitanInPlay() //or Meekstone
{
CardList all = new CardList();
all.addAll(AllZone.Human_Play.getCards());
all.addAll(AllZone.Computer_Play.getCards());
all = all.getName("Marble Titan");
all = all.filter(new CardListFilter()
{
public boolean addCard(Card c) {
return c.getName().equals("Meekstone") || c.getName().equals("Marble Titan");
}
});
return all.size() > 0;
}
private void regularUntap()

View File

@@ -112,6 +112,8 @@ public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone
PlayerZone play = AllZone.getZone(Constant.Zone.Play, c.getController());
CardList meek = new CardList(grave.getCards());
meek = meek.getName("Sword of the Meek");
if (meek.size() > 0 && c.isCreature() && c.getNetAttack() == 1 && c.getNetDefense() == 1)
{
for (int i=0;i<meek.size();i++)