Added Dust of Moments

Added optional param ValidZone to PutCountersAll and RemoveCountersAll
This commit is contained in:
moomarc
2012-07-12 12:14:37 +00:00
parent e8e8c8c486
commit b47bdd6289
3 changed files with 35 additions and 4 deletions

1
.gitattributes vendored
View File

@@ -2614,6 +2614,7 @@ res/cardsfolder/d/duskworker.txt svneol=native#text/plain
res/cardsfolder/d/dust_bowl.txt svneol=native#text/plain
res/cardsfolder/d/dust_corona.txt svneol=native#text/plain
res/cardsfolder/d/dust_elemental.txt svneol=native#text/plain
res/cardsfolder/d/dust_of_moments.txt -text
res/cardsfolder/d/dust_to_dust.txt svneol=native#text/plain
res/cardsfolder/d/duty_bound_dead.txt -text
res/cardsfolder/d/dwarven_armorer.txt svneol=native#text/plain

View File

@@ -0,0 +1,16 @@
Name:Dust of Moments
ManaCost:2 W
Types:Instant
Text:no text
A:SP$ Charm | Cost$ 2 W | CharmNum$ 1 | Choices$ LoseTime,GainTime | SpellDescription$ Choose one - Remove two time counters from each permanent and each suspended card; or put two time counters on each permanent with a time counter on it and each suspended card.
SVar:LoseTime:DB$ RemoveCounterAll | ValidCards$ Permanent | CounterType$ TIME | CounterNum$ 2 | SubAbility$ QuickenTime | SpellDescription$ Remove two time counters from each permanent and each suspended card.
SVar:QuickenTime:DB$ RemoveCounterAll | ValidCards$ Card.suspended | CounterType$ TIME | CounterNum$ 2 | ValidZone$ Exile
SVar:GainTime:DB$ PutCounterAll | ValidCards$ Permanent.counters_GE1_TIME | CounterType$ TIME | CounterNum$ 2 | SubAbility$ SlowTime | SpellDescription$ Put two time counters on each permanent with a time counter on it and each suspended card.
SVar:SlowTime:DB$ PutCounterAll | ValidCards$ Card.suspended | CounterType$ TIME | CounterNum$ 2 | ValidZone$ Exile
SVar:RemAIDeck:True
SVar:RemRandomDeck:True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/dust_of_moments.jpg
SetInfo:FUT|Uncommon|http://magiccards.info/scans/en/fut/5.jpg
Oracle:Choose one - Remove two time counters from each permanent and each suspended card; or put two time counters on each permanent with a time counter on it and each suspended card.
End

View File

@@ -1812,12 +1812,18 @@ public class AbilityFactoryCounters {
final Counters cType = Counters.valueOf(params.get("CounterType"));
final int amount = AbilityFactory.calculateAmount(sa.getSourceCard(), params.get("CounterNum"), sa);
final String zone = params.containsKey("ValidZone") ? params.get("ValidZone") : "Battlefield";
sb.append("Put ").append(amount).append(" ").append(cType.getName()).append(" counter");
if (amount != 1) {
sb.append("s");
}
sb.append(" on each valid permanent.");
sb.append(" on each valid ");
if (zone.matches("Battlefield")) {
sb.append("permanent.");
} else {
sb.append("card in ").append(zone).append(".");
}
final AbilitySub abSub = sa.getSubAbility();
if (abSub != null) {
@@ -1989,8 +1995,9 @@ public class AbilityFactoryCounters {
final String type = params.get("CounterType");
final int counterAmount = AbilityFactory.calculateAmount(sa.getSourceCard(), params.get("CounterNum"), sa);
final String valid = params.get("ValidCards");
final ZoneType zone = params.containsKey("ValidZone") ? ZoneType.smartValueOf(params.get("ValidZone")) : ZoneType.Battlefield;
CardList cards = AllZoneUtil.getCardsIn(ZoneType.Battlefield);
CardList cards = AllZoneUtil.getCardsIn(zone);
cards = cards.getValidCards(valid, sa.getSourceCard().getController(), sa.getSourceCard());
final Target tgt = sa.getTarget();
@@ -2168,6 +2175,7 @@ public class AbilityFactoryCounters {
final Counters cType = Counters.valueOf(params.get("CounterType"));
final int amount = AbilityFactory.calculateAmount(sa.getSourceCard(), params.get("CounterNum"), sa);
final String zone = params.containsKey("ValidZone") ? params.get("ValidZone") : "Battlefield";
String amountString = Integer.toString(amount);
if (params.containsKey("AllCounters")) {
@@ -2178,7 +2186,12 @@ public class AbilityFactoryCounters {
if (!amountString.equals("1")) {
sb.append("s");
}
sb.append(" from each valid permanent.");
sb.append(" from each valid ");
if (zone.matches("Battlefield")) {
sb.append("permanent.");
} else {
sb.append("card in ").append(zone).append(".");
}
final AbilitySub abSub = sa.getSubAbility();
if (abSub != null) {
@@ -2237,8 +2250,9 @@ public class AbilityFactoryCounters {
final String type = params.get("CounterType");
int counterAmount = AbilityFactory.calculateAmount(sa.getSourceCard(), params.get("CounterNum"), sa);
final String valid = params.get("ValidCards");
final ZoneType zone = params.containsKey("ValidZone") ? ZoneType.smartValueOf(params.get("ValidZone")) : ZoneType.Battlefield;
CardList cards = AllZoneUtil.getCardsIn(ZoneType.Battlefield);
CardList cards = AllZoneUtil.getCardsIn(zone);
cards = cards.getValidCards(valid, sa.getSourceCard().getController(), sa.getSourceCard());
final Target tgt = sa.getTarget();