mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- Converted Life from the Loam and Reinforcements to keyword.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
Name:Life from the Loam
|
||||
ManaCost:1 G
|
||||
Types:Sorcery
|
||||
Text:Return up to three target land cards from your graveyard to your hand.
|
||||
Text:Return up to three target land cards from your graveyard to your hand.
|
||||
K:spReturnTgt:3/UpTo:Land:Hand
|
||||
K:Dredge 3
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/life_from_the_loam.jpg
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
Name:Reinforcements
|
||||
ManaCost:W
|
||||
Types:Instant
|
||||
Text:Put up to three target creature cards from your graveyard on top of your library.
|
||||
Text:Put up to three target creature cards from your graveyard on top of your library.
|
||||
K:spReturnTgt:3/UpTo:Creature:TopofLibrary
|
||||
SVar:RemAIDeck:True
|
||||
SVar:Rarity:Common
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/reinforcements.jpg
|
||||
End
|
||||
|
||||
@@ -3787,15 +3787,24 @@ public class CardFactory implements NewConstants {
|
||||
}// for nctr
|
||||
}// if choices
|
||||
|
||||
if (!anyNumber[0]
|
||||
&& results.size() >= numCardsToReturn) {
|
||||
results.shuffle();
|
||||
if (!anyNumber[0]) {
|
||||
CardList targets = new CardList();
|
||||
for (int i = 0; i < numCardsToReturn; i++) {
|
||||
targets.add(results.get(i));
|
||||
|
||||
if (results.size() >= numCardsToReturn) {
|
||||
results.shuffle();
|
||||
for (int i = 0; i < numCardsToReturn; i++) {
|
||||
targets.add(results.get(i));
|
||||
}
|
||||
|
||||
} else if (results.size() >= 1
|
||||
&& returnUpTo[0]) {
|
||||
targets = results;
|
||||
}
|
||||
|
||||
if (targets.size() > 0) {
|
||||
setTargetList(targets);
|
||||
return true;
|
||||
}
|
||||
setTargetList(targets);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}// canPlayAI()
|
||||
@@ -3871,7 +3880,7 @@ public class CardFactory implements NewConstants {
|
||||
};// spRtrnTgt
|
||||
|
||||
spRtrnTgt.setBeforePayMana(CardFactoryUtil.spReturnTgt_input_targetCards_InGraveyard(
|
||||
card, spRtrnTgt, returnUpTo[0], numCardsToReturn, Tgts, anyNumber[0]));
|
||||
card, spRtrnTgt, returnUpTo[0], numCardsToReturn, Tgts, anyNumber[0]));
|
||||
|
||||
if (desc.length() > 0) {
|
||||
spRtrnTgt.setDescription(desc);
|
||||
|
||||
@@ -4197,149 +4197,7 @@ public class CardFactory_Instants {
|
||||
}
|
||||
//*************** END ************ END **************************
|
||||
|
||||
/*
|
||||
//*************** START *********** START **************************
|
||||
else if (cardName.equals("Reprisal")) {
|
||||
final SpellAbility spell = new Spell(card) {
|
||||
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)
|
||||
&& !c.getKeyword().contains("Indestructible");
|
||||
}
|
||||
});
|
||||
|
||||
if (list.isEmpty()) return false;
|
||||
|
||||
CardListUtil.sortAttack(list);
|
||||
CardListUtil.sortFlying(list);
|
||||
setTargetCard(list.get(0));
|
||||
return true;
|
||||
}//canPlayAI()
|
||||
|
||||
public void resolve() {
|
||||
if (AllZone.GameAction.isCardInPlay(getTargetCard())) {
|
||||
AllZone.GameAction.destroyNoRegeneration(getTargetCard());
|
||||
}
|
||||
}//resolve
|
||||
};//SpellAbility
|
||||
|
||||
card.clearSpellAbility();
|
||||
card.addSpellAbility(spell);
|
||||
|
||||
Input target = new Input() {
|
||||
private static final long serialVersionUID = 4794354831721082791L;
|
||||
public void showMessage() {
|
||||
AllZone.Display.showMessage("Select target Creature to destroy");
|
||||
ButtonUtil.enableOnlyCancel();
|
||||
}
|
||||
public void selectButtonCancel() {
|
||||
stop();
|
||||
}
|
||||
public void selectCard(Card c, PlayerZone zone) {
|
||||
if (zone.is(Constant.Zone.Play)
|
||||
&& c.isCreature()
|
||||
&& (c.getNetAttack() > 3)
|
||||
&& CardFactoryUtil.canTarget(card, c)) {
|
||||
spell.setTargetCard(c);
|
||||
if (this.isFree())
|
||||
{
|
||||
this.setFree(false);
|
||||
AllZone.Stack.add(spell);
|
||||
stop();
|
||||
}
|
||||
else
|
||||
stopSetNext(new Input_PayManaCost(spell));
|
||||
}
|
||||
}
|
||||
};//input
|
||||
|
||||
card.setSVar("PlayMain1", "TRUE");
|
||||
|
||||
spell.setBeforePayMana(target);
|
||||
}//*************** END ************ END **************************
|
||||
*/
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Reinforcements")) {
|
||||
/* Put up to three target creature cards from your
|
||||
* graveyard on top of your library.
|
||||
*/
|
||||
final SpellAbility spell = new Spell(card) {
|
||||
private static final long serialVersionUID = 4075591356690396548L;
|
||||
|
||||
CardList getComputerCreatures()
|
||||
{
|
||||
CardList list = new CardList(AllZone.Computer_Graveyard.getCards());
|
||||
list = list.getType("Creature");
|
||||
|
||||
//put biggest attack creats first
|
||||
if (list.size()>0)
|
||||
CardListUtil.sortAttack(list);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlayAI() {
|
||||
return getComputerCreatures().size() >= 3;
|
||||
}
|
||||
@Override
|
||||
public void resolve() {
|
||||
String player = card.getController();
|
||||
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, player);
|
||||
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player);
|
||||
|
||||
CardList creatures = new CardList(grave.getCards());
|
||||
creatures = creatures.filter(new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
return c.isCreature();
|
||||
}
|
||||
});
|
||||
if (player.equals(Constant.Player.Human))
|
||||
{
|
||||
//now, select three creatures
|
||||
int end = -1;
|
||||
end = Math.min(creatures.size(), 3);
|
||||
for(int i = 1; i <= end; i++) {
|
||||
String Title = "Put on top of library: ";
|
||||
if(i == 2) Title = "Put second from top of library: ";
|
||||
if(i == 3) Title = "Put third from top of library: ";
|
||||
Object o = AllZone.Display.getChoiceOptional(Title, creatures.toArray());
|
||||
if(o == null) break;
|
||||
Card c_1 = (Card) o;
|
||||
creatures.remove(c_1); //remove from the display list
|
||||
grave.remove(c_1); //remove from graveyard
|
||||
lib.add(c_1, i - 1);
|
||||
}
|
||||
}
|
||||
else //Computer
|
||||
{
|
||||
CardList list = getComputerCreatures();
|
||||
int max = list.size();
|
||||
|
||||
if (max > 3)
|
||||
max = 3;
|
||||
|
||||
for (int i=0;i<max;i++)
|
||||
{
|
||||
grave.remove(list.get(i));
|
||||
lib.add(list.get(i), i);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
};//spell
|
||||
card.clearSpellAbility();
|
||||
card.addSpellAbility(spell);
|
||||
}
|
||||
//*************** END ************ END **************************
|
||||
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Natural Selection")) {
|
||||
/* Look at the top 3 cards of target player's library and put them
|
||||
|
||||
@@ -7132,103 +7132,6 @@ public class CardFactory_Sorceries {
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
|
||||
//*************** START *********** START **************************
|
||||
if(cardName.equals("Life from the Loam")) {
|
||||
final SpellAbility spell = new Spell(card) {
|
||||
|
||||
private static final long serialVersionUID = 9071771496065272936L;
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
|
||||
|
||||
CardList cards = new CardList(grave.getCards());
|
||||
CardList lands = new CardList();
|
||||
|
||||
for(int i = 0; i < cards.size(); i++) {
|
||||
if(cards.get(i).getType().contains("Land")) {
|
||||
lands.add(cards.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
String controller = card.getController();
|
||||
|
||||
if(lands.size() == 0) return;
|
||||
|
||||
if(controller.equals(Constant.Player.Human)) {
|
||||
Object o = AllZone.Display.getChoiceOptional("Select First Land", lands.toArray());
|
||||
if(o != null) {
|
||||
//ability.setTargetCard((Card)o);
|
||||
//AllZone.Stack.add(ability);
|
||||
Card c1 = (Card) o;
|
||||
grave.remove(c1);
|
||||
hand.add(c1);
|
||||
lands.remove(c1);
|
||||
|
||||
if(lands.size() == 0) return;
|
||||
|
||||
o = AllZone.Display.getChoiceOptional("Select Second Land", lands.toArray());
|
||||
|
||||
if(o != null) {
|
||||
Card c2 = (Card) o;
|
||||
grave.remove(c2);
|
||||
hand.add(c2);
|
||||
lands.remove(c2);
|
||||
|
||||
if(lands.size() == 0) return;
|
||||
|
||||
o = AllZone.Display.getChoiceOptional("Select Third Land", lands.toArray());
|
||||
|
||||
if(o != null) {
|
||||
Card c3 = (Card) o;
|
||||
grave.remove(c3);
|
||||
hand.add(c3);
|
||||
lands.remove(c3);
|
||||
}
|
||||
}
|
||||
}
|
||||
AllZone.GameAction.shuffle(controller);
|
||||
} else //computer
|
||||
{
|
||||
lands.shuffle();
|
||||
if(lands.size() >= 1) {
|
||||
Card c1 = lands.getCard(0);
|
||||
grave.remove(c1);
|
||||
hand.add(c1);
|
||||
lands.remove(c1);
|
||||
|
||||
if(lands.size() >= 1) {
|
||||
Card c2 = lands.getCard(0);
|
||||
grave.remove(c2);
|
||||
hand.add(c2);
|
||||
lands.remove(c2);
|
||||
|
||||
if(lands.size() >= 1) {
|
||||
Card c3 = lands.getCard(0);
|
||||
grave.remove(c3);
|
||||
hand.add(c3);
|
||||
lands.remove(c3);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//ability.setTargetCard(powerTwoCreatures.get(0));
|
||||
//AllZone.Stack.add(ability);
|
||||
AllZone.GameAction.shuffle(controller);
|
||||
}
|
||||
|
||||
|
||||
//...
|
||||
|
||||
}//resolve()
|
||||
};
|
||||
card.clearSpellAbility();
|
||||
card.addSpellAbility(spell);
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if (cardName.equals("Natural Order")){
|
||||
final SpellAbility spell = new Spell(card) {
|
||||
|
||||
Reference in New Issue
Block a user