*Added a ThisTurnEntered equivalent for DefinedCards.

*Added Second Sunrise.
This commit is contained in:
Hellfish
2011-08-27 12:53:23 +00:00
parent 8755ce80c2
commit f627b8497b
5 changed files with 56 additions and 14 deletions

1
.gitattributes vendored
View File

@@ -6542,6 +6542,7 @@ res/cardsfolder/s/secluded_glen.txt svneol=native#text/plain
res/cardsfolder/s/secluded_steppe.txt svneol=native#text/plain
res/cardsfolder/s/second_chance.txt svneol=native#text/plain
res/cardsfolder/s/second_sight.txt svneol=native#text/plain
res/cardsfolder/s/second_sunrise.txt -text
res/cardsfolder/s/second_thoughts.txt svneol=native#text/plain
res/cardsfolder/s/second_wind.txt svneol=native#text/plain
res/cardsfolder/s/security_detail.txt svneol=native#text/plain

View File

@@ -0,0 +1,7 @@
Name:Second Sunrise
ManaCost:1 W W
Types:Instant
Text:no text
A:SP$ChangeZone | Cost$ 1 W W | Origin$ Graveyard | Destination$ Battlefield | Defined$ ThisTurnEntered Graveyard from Battlefield Card.Artifact,Card.Creature,Card.Enchantment,Card.Land | SpellDescription$ Each player returns to the battlefield all artifact, creature, enchantment, and land cards in his or her graveyard that were put there from the battlefield this turn.
SetInfo:MRD|Rare|http://magiccards.info/scans/en/mi/20.jpg
End

View File

@@ -636,4 +636,32 @@ public final class CardUtil {
return result;
}
public static CardList getThisTurnEntered(final String to, final String from, final String valid,final Card src)
{
CardList res = new CardList();
if(to != Constant.Zone.Stack)
{
res.addAll(((DefaultPlayerZone)AllZone.getZone(to, AllZone.getComputerPlayer())).getCardsAddedThisTurn(from));
res.addAll(((DefaultPlayerZone)AllZone.getZone(to, AllZone.getHumanPlayer())).getCardsAddedThisTurn(from));
}
else
{
res.addAll(((DefaultPlayerZone)AllZone.getZone(to,null)).getCardsAddedThisTurn(from));
}
res = res.filter(new CardListFilter() {
public boolean addCard(Card c)
{
if(c.isValidCard(valid.split(","), src.getController(), src))
{
return true;
}
return false;
}
});
return res;
}
}

View File

@@ -1200,7 +1200,24 @@ public class AbilityFactory {
for (Card imprint : hostCard.getImprinted()) {
cards.add(AllZoneUtil.getCardState(imprint));
}
} else if(defined.startsWith("ThisTurnEntered")) {
String[] workingCopy = defined.split(" ");
String destination, origin, validFilter;
destination = workingCopy[1];
if (workingCopy[2].equals("from")) {
origin = workingCopy[3];
validFilter = workingCopy[4];
} else {
origin = "Any";
validFilter = workingCopy[2];
}
for(Card cl : CardUtil.getThisTurnEntered(destination, origin, validFilter, hostCard))
{
cards.add(cl);
}
}
else {
CardList list = null;
if (defined.startsWith("Sacrificed"))
list = findRootAbility(sa).getPaidList("Sacrificed");

View File

@@ -2947,18 +2947,7 @@ public class CardFactoryUtil {
validFilter = workingCopy[2];
}
final String[] valid = validFilter.split(",");
final Card csource = c;
CardList res = ((DefaultPlayerZone) AllZone.getZone(destination, AllZone.getHumanPlayer()))
.getCardsAddedThisTurn(origin);
res.addAll(((DefaultPlayerZone) AllZone.getZone(destination, AllZone.getComputerPlayer()))
.getCardsAddedThisTurn(origin));
res = res.filter(new CardListFilter() {
public boolean addCard(Card csubject) {
return csubject.isValidCard(valid, csource.getController(), csource);
}
});
CardList res = CardUtil.getThisTurnEntered(destination, origin, validFilter, c);
return doXMath(res.size(), m, c);
}