- Added a first draft of the use of getValidCard in xCount.

- Added Dogpile
This commit is contained in:
jendave
2011-08-06 09:01:40 +00:00
parent 625ae172b5
commit acc160dcfd
3 changed files with 27 additions and 0 deletions

1
.gitattributes vendored
View File

@@ -1061,6 +1061,7 @@ res/cardsfolder/djinn_of_the_lamp.txt -text svneol=native#text/plain
res/cardsfolder/do_or_die.txt -text svneol=native#text/plain res/cardsfolder/do_or_die.txt -text svneol=native#text/plain
res/cardsfolder/dodecapod.txt -text svneol=native#text/plain res/cardsfolder/dodecapod.txt -text svneol=native#text/plain
res/cardsfolder/dogged_hunter.txt -text svneol=native#text/plain res/cardsfolder/dogged_hunter.txt -text svneol=native#text/plain
res/cardsfolder/dogpile.txt -text svneol=native#text/plain
res/cardsfolder/donate.txt -text svneol=native#text/plain res/cardsfolder/donate.txt -text svneol=native#text/plain
res/cardsfolder/doom_blade.txt -text svneol=native#text/plain res/cardsfolder/doom_blade.txt -text svneol=native#text/plain
res/cardsfolder/doomed_necromancer.txt -text svneol=native#text/plain res/cardsfolder/doomed_necromancer.txt -text svneol=native#text/plain

View File

@@ -0,0 +1,10 @@
Name:Dogpile
ManaCost:3 R
Types:Instant
Text:no text
K:spDamageTgtCP:X:Dogpile deals damage to target creature or player equal to the number of attacking creatures you control.
SVar:X:Count$Valid Creature.attacking+YouCtrl
SVar:RemAIDeck:True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/dogpile.jpg
End

View File

@@ -3571,6 +3571,21 @@ public class CardFactoryUtil {
l = s.split("/"); // separate the specification from any math l = s.split("/"); // separate the specification from any math
final String m[] = {"none"}; final String m[] = {"none"};
if(l.length > 1) m[0] = l[1]; if(l.length > 1) m[0] = l[1];
// count valid cards on the battlefield
if(l[0].contains("Valid")) {
final String restrictions = l[0].replace("Valid ", "");
final String rest[] = restrictions.split(",");
CardList cardsonbattlefield = new CardList();
cardsonbattlefield.addAll(myField.getCards());
cardsonbattlefield.addAll(opField.getCards());
cardsonbattlefield = cardsonbattlefield.getValidCards(rest, c.getController());
n = cardsonbattlefield.size();
return doXMath(n, m);
}
final String[] sq; final String[] sq;
sq = l[0].split("\\."); sq = l[0].split("\\.");
@@ -3722,6 +3737,7 @@ public class CardFactoryUtil {
// filter lists based on the specified quality // filter lists based on the specified quality
// "Clerics you control" - Count$TypeYouCtrl.Cleric // "Clerics you control" - Count$TypeYouCtrl.Cleric
if(sq[0].contains("Type")) { if(sq[0].contains("Type")) {
someCards = someCards.filter(new CardListFilter() { someCards = someCards.filter(new CardListFilter() {