- Fixed Mana Drain and friends

This commit is contained in:
swordshine
2014-05-10 06:23:30 +00:00
parent fb41eb5992
commit b37be577cf
10 changed files with 56 additions and 19 deletions

View File

@@ -1399,7 +1399,16 @@ public class AbilityUtils {
return sum; return sum;
} }
if (sq[0].startsWith("TriggerRememberAmount")) {
final SpellAbility root = sa.getRootAbility();
int count = 0;
for (final Object o : root.getTriggerRemembered()) {
if (o instanceof Integer) {
count += (Integer) o;
}
}
return count;
}
// Count$Compare <int comparator value>.<True>.<False> // Count$Compare <int comparator value>.<True>.<False>
if (sq[0].startsWith("Compare")) { if (sq[0].startsWith("Compare")) {
final String[] compString = sq[0].split(" "); final String[] compString = sq[0].split(" ");

View File

@@ -104,6 +104,10 @@ public class CounterEffect extends SpellAbilityEffect {
continue; continue;
} }
if (sa.hasParam("RememberCounteredCMC")) {
sa.getHostCard().addRemembered((Integer) tgtSACard.getCMC());
}
this.removeFromStack(tgtSA, sa, si); this.removeFromStack(tgtSA, sa, si);
// Destroy Permanent may be able to be turned into a SubAbility // Destroy Permanent may be able to be turned into a SubAbility

View File

@@ -58,6 +58,14 @@ public class DelayedTriggerEffect extends SpellAbilityEffect {
} }
} }
if (sa.hasParam("RememberNumber")) {
for (final Object o : sa.getHostCard().getRemembered()) {
if (o instanceof Integer) {
delTrig.addRemembered((Integer) o);
}
}
}
if (mapParams.containsKey("Execute")) { if (mapParams.containsKey("Execute")) {
SpellAbility overridingSA = AbilityFactory.getAbility(sa.getSVar(mapParams.get("Execute")), sa.getHostCard()); SpellAbility overridingSA = AbilityFactory.getAbility(sa.getSVar(mapParams.get("Execute")), sa.getHostCard());
delTrig.setOverridingAbility(overridingSA); delTrig.setOverridingAbility(overridingSA);

View File

@@ -872,6 +872,16 @@ public class CardFactoryUtil {
return doXMath(c.getRemembered().size(), m, c); return doXMath(c.getRemembered().size(), m, c);
} }
if (l[0].startsWith("RememberedNumber")) {
int num = 0;
for (final Object o : c.getRemembered()) {
if (o instanceof Integer) {
num += (Integer) o;
}
}
return doXMath(num, m, c);
}
// Count$CountersAdded <CounterType> <ValidSource> // Count$CountersAdded <CounterType> <ValidSource>
if (l[0].startsWith("CountersAdded")) { if (l[0].startsWith("CountersAdded")) {
final String[] components = l[0].split(" ", 3); final String[] components = l[0].split(" ", 3);

View File

@@ -2,8 +2,9 @@ Name:Dovescape
ManaCost:3 WU WU WU ManaCost:3 WU WU WU
Types:Enchantment Types:Enchantment
T:Mode$ SpellCast | ValidCard$ Card.nonCreature | TriggerZones$ Battlefield | Execute$ TrigCounter | TriggerDescription$ Whenever a player casts a noncreature spell, counter that spell. That player puts X 1/1 white and blue Bird creature tokens with flying onto the battlefield, where X is the spell's converted mana cost. T:Mode$ SpellCast | ValidCard$ Card.nonCreature | TriggerZones$ Battlefield | Execute$ TrigCounter | TriggerDescription$ Whenever a player casts a noncreature spell, counter that spell. That player puts X 1/1 white and blue Bird creature tokens with flying onto the battlefield, where X is the spell's converted mana cost.
SVar:TrigCounter:AB$ Counter | Cost$ 0 | Defined$ TriggeredSpellAbility | SubAbility$ DBToken SVar:TrigCounter:AB$ Counter | Cost$ 0 | Defined$ TriggeredSpellAbility | RememberCounteredCMC$ True | SubAbility$ DBToken
SVar:DBToken:DB$ Token | TokenAmount$ X | TokenName$ Bird | TokenTypes$ Creature,Bird | TokenOwner$ TriggeredActivator | TokenColors$ White,Blue | TokenPower$ 1 | TokenToughness$ 1 | TokenKeywords$ Flying | References$ X SVar:DBToken:DB$ Token | TokenAmount$ X | TokenName$ Bird | TokenTypes$ Creature,Bird | TokenOwner$ TriggeredActivator | TokenColors$ White,Blue | TokenPower$ 1 | TokenToughness$ 1 | TokenKeywords$ Flying | References$ X | SubAbility$ DBCleanup
SVar:X:TriggeredCard$CardManaCost SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Count$RememberedNumber
SVar:Picture:http://www.wizards.com/global/images/magic/general/dovescape.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/dovescape.jpg
Oracle:({W/U} can be paid with either {W} or {U}.)\nWhenever a player casts a noncreature spell, counter that spell. That player puts X 1/1 white and blue Bird creature tokens with flying onto the battlefield, where X is the spell's converted mana cost. Oracle:({W/U} can be paid with either {W} or {U}.)\nWhenever a player casts a noncreature spell, counter that spell. That player puts X 1/1 white and blue Bird creature tokens with flying onto the battlefield, where X is the spell's converted mana cost.

View File

@@ -5,8 +5,9 @@ PT:1/1
K:Flash K:Flash
K:Flying K:Flying
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigCounter | TriggerDescription$ When CARDNAME enters the battlefield, counter target spell. Put X +1/+1 counters on CARDNAME, where X is that spell's converted mana cost. T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigCounter | TriggerDescription$ When CARDNAME enters the battlefield, counter target spell. Put X +1/+1 counters on CARDNAME, where X is that spell's converted mana cost.
SVar:TrigCounter:DB$ Counter | Cost$ 0 | TargetType$ Spell | ValidTgts$ Card | TgtPrompt$ Select target spell | SubAbility$ DBPutcounter SVar:TrigCounter:DB$ Counter | Cost$ 0 | TargetType$ Spell | ValidTgts$ Card | TgtPrompt$ Select target spell | RememberCounteredCMC$ True | SubAbility$ DBPutcounter
SVar:DBPutcounter:DB$ PutCounter | CounterType$ P1P1 | Defined$ Self | CounterNum$ X | References$ X SVar:DBPutcounter:DB$ PutCounter | CounterType$ P1P1 | Defined$ Self | CounterNum$ X | References$ X | SubAbility$ DBCleanup
SVar:X:Targeted$CardManaCost SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Count$RememberedNumber
SVar:Picture:http://www.wizards.com/global/images/magic/general/draining_whelk.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/draining_whelk.jpg
Oracle:Flash (You may cast this spell any time you could cast an instant.)\nFlying\nWhen Draining Whelk enters the battlefield, counter target spell. Put X +1/+1 counters on Draining Whelk, where X is that spell's converted mana cost. Oracle:Flash (You may cast this spell any time you could cast an instant.)\nFlying\nWhen Draining Whelk enters the battlefield, counter target spell. Put X +1/+1 counters on Draining Whelk, where X is that spell's converted mana cost.

View File

@@ -1,9 +1,10 @@
Name:Induce Paranoia Name:Induce Paranoia
ManaCost:2 U U ManaCost:2 U U
Types:Instant Types:Instant
A:SP$ Counter | Cost$ 2 U U | TargetType$ Spell | ValidTgts$ Card | SubAbility$ DBMill | SpellDescription$ Counter target spell. If {B} was spent to cast CARDNAME, that spell's controller puts the top X cards of his or her library into his or her graveyard, where X is the spell's converted mana cost. A:SP$ Counter | Cost$ 2 U U | TargetType$ Spell | ValidTgts$ Card | RememberCounteredCMC$ True | SubAbility$ DBMill | SpellDescription$ Counter target spell. If {B} was spent to cast CARDNAME, that spell's controller puts the top X cards of his or her library into his or her graveyard, where X is the spell's converted mana cost.
SVar:DBMill:DB$ Mill | NumCards$ X | Defined$ TargetedController | ConditionManaSpent$ B | References$ X SVar:DBMill:DB$ Mill | NumCards$ X | Defined$ TargetedController | ConditionManaSpent$ B | References$ X | SubAbility$ DBCleanup
SVar:X:Targeted$CardManaCost SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Count$RememberedNumber
SVar:ManaNeededToAvoidNegativeEffect:black SVar:ManaNeededToAvoidNegativeEffect:black
SVar:RemRandomDeck:True SVar:RemRandomDeck:True
DeckNeeds:Color$Black DeckNeeds:Color$Black

View File

@@ -1,9 +1,10 @@
Name:Mana Drain Name:Mana Drain
ManaCost:U U ManaCost:U U
Types:Instant Types:Instant
A:SP$Counter | Cost$ U U | TargetType$ Spell | RememberCountered$ True | ForgetOtherTargets$ True | ValidTgts$ Card | SubAbility$ DBDelTrig | SpellDescription$ Counter target spell. At the beginning of your next main phase, add {X} to your mana pool, where X is that spell's converted mana cost. A:SP$ Counter | Cost$ U U | TargetType$ Spell | RememberCounteredCMC$ True | ValidTgts$ Card | SubAbility$ DBDelTrig | SpellDescription$ Counter target spell. At the beginning of your next main phase, add {X} to your mana pool, where X is that spell's converted mana cost.
SVar:DBDelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ Main1,Main2 | ValidPlayer$ You | Execute$ AddMana | TriggerDescription$ CARDNAME - At the beginning of your next main phase, add X to your mana pool, where X is the countered spell's converted mana cost. SVar:DBDelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ Main1,Main2 | ValidPlayer$ You | Execute$ AddMana | TriggerDescription$ At the beginning of your next main phase, add X to your mana pool, where X is the countered spell's converted mana cost. | RememberNumber$ True | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:AddMana:DB$ Mana | Cost$ 0 | Produced$ 1 | Amount$ X | References$ X SVar:AddMana:DB$ Mana | Cost$ 0 | Produced$ 1 | Amount$ X | References$ X
SVar:X:Remembered$CardManaCost SVar:X:Count$TriggerRememberAmount
SVar:Picture:http://www.wizards.com/global/images/magic/general/mana_drain.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/mana_drain.jpg
Oracle:Counter target spell. At the beginning of your next main phase, add {X} to your mana pool, where X is that spell's converted mana cost. Oracle:Counter target spell. At the beginning of your next main phase, add {X} to your mana pool, where X is that spell's converted mana cost.

View File

@@ -1,8 +1,9 @@
Name:Mystic Genesis Name:Mystic Genesis
ManaCost:2 G U U ManaCost:2 G U U
Types:Instant Types:Instant
A:SP$ Counter | Cost$ 2 G U U | TargetType$ Spell | RememberCountered$ True | ForgetOtherTargets$ True | ValidTgts$ Card | SubAbility$ DBToken | SpellDescription$ Counter target spell. Put an X/X green Ooze creature token onto the battlefield, where X is that spell's converted mana cost. A:SP$ Counter | Cost$ 2 G U U | TargetType$ Spell | RememberCounteredCMC$ True | ValidTgts$ Card | SubAbility$ DBToken | SpellDescription$ Counter target spell. Put an X/X green Ooze creature token onto the battlefield, where X is that spell's converted mana cost.
SVar:DBToken:DB$ Token | TokenAmount$ 1 | TokenName$ Ooze | TokenTypes$ Creature,Ooze | TokenOwner$ You | TokenColors$ Green | TokenPower$ X | TokenToughness$ X | References$ X SVar:DBToken:DB$ Token | TokenAmount$ 1 | TokenName$ Ooze | TokenTypes$ Creature,Ooze | TokenOwner$ You | TokenColors$ Green | TokenPower$ X | TokenToughness$ X | References$ X | SubAbility$ DBCleanup
SVar:X:Remembered$CardManaCost SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Count$RememberedNumber
SVar:Picture:http://www.wizards.com/global/images/magic/general/mystic_genesis.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/mystic_genesis.jpg
Oracle:Counter target spell. Put an X/X green Ooze creature token onto the battlefield, where X is that spell's converted mana cost. Oracle:Counter target spell. Put an X/X green Ooze creature token onto the battlefield, where X is that spell's converted mana cost.

View File

@@ -1,9 +1,10 @@
Name:Plasm Capture Name:Plasm Capture
ManaCost:G G U U ManaCost:G G U U
Types:Instant Types:Instant
A:SP$ Counter | Cost$ G G U U | TargetType$ Spell | RememberCountered$ True | ForgetOtherTargets$ True | ValidTgts$ Card | SubAbility$ DBDelTrig | SpellDescription$ Counter target spell. At the beginning of your next precombat main phase, add X mana in any combination of colors to your mana pool, where X is that spell's converted mana cost. A:SP$ Counter | Cost$ G G U U | TargetType$ Spell | RememberCounteredCMC$ True | ValidTgts$ Card | SubAbility$ DBDelTrig | SpellDescription$ Counter target spell. At the beginning of your next precombat main phase, add X mana in any combination of colors to your mana pool, where X is that spell's converted mana cost.
SVar:DBDelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ Main1 | ValidPlayer$ You | Execute$ AddMana | TriggerDescription$ CARDNAME - At the beginning of your next precombat main phase, aadd X mana in any combination of colors to your mana pool, where X is that spell's converted mana cost. SVar:DBDelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ Main1 | ValidPlayer$ You | Execute$ AddMana | TriggerDescription$ CARDNAME - At the beginning of your next precombat main phase, aadd X mana in any combination of colors to your mana pool, where X is that spell's converted mana cost. | RememberNumber$ True | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:AddMana:DB$ Mana | Cost$ 0 | Produced$ Combo Any | Amount$ X | References$ X | AILogic$ MostProminentInComputerHand SVar:AddMana:DB$ Mana | Cost$ 0 | Produced$ Combo Any | Amount$ X | References$ X | AILogic$ MostProminentInComputerHand
SVar:X:Remembered$CardManaCost SVar:X:Count$TriggerRememberAmount
SVar:Picture:http://www.wizards.com/global/images/magic/general/plasm_capture.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/plasm_capture.jpg
Oracle:Counter target spell. At the beginning of your next precombat main phase, add X mana in any combination of colors to your mana pool, where X is that spell's converted mana cost. Oracle:Counter target spell. At the beginning of your next precombat main phase, add X mana in any combination of colors to your mana pool, where X is that spell's converted mana cost.