diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 1541fa501..5519b6f4b 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -2707,7 +2707,7 @@ type=Artifact [card] name=Avenging Angel auto=flying -autograveyard=@movedTo(this|mygraveyard) from(myBattlefield):moveTo(mylibrary) && shuffle +autograveyard=@movedTo(this|mygraveyard) from(myBattlefield):moveTo(mylibrary) text=Flying -- When Avenging Angel is put into a graveyard from the battlefield, shuffle Avenging Angel into its owner's library. mana={3}{W}{W} type=Creature @@ -5254,7 +5254,7 @@ type=Instant [card] name=Bonded Fetch abilities=defender,haste -auto={T}:token(-1111113) && draw:1 +auto={T}:token(-1111145) && draw:1 text=Defender, haste -- {T}: Draw a card, then discard a card. mana={2}{U} type=Creature @@ -5267,7 +5267,7 @@ name=Bonded Fetch's Discard auto=counter(0/0,1,Bonded Fetch) auto=@movedTo(*|myhand) from(mylibrary):thisforeach(counter{0/0.1.Bonded Fetch}>0) moveTo(mygraveyard) target(*|myhand) && counter(0/0,-1,Bonded Fetch) && counter(0/0,1,Bury) auto=thisforeach(counter{0/0.1.Bury}>0) bury -id=-1111113 +id=-1111145 type=nothing [/card] [card] @@ -8850,7 +8850,7 @@ name=Corpse Hatch target=creature[-black] auto=destroy auto=Token(-193507)*2 -text=Destroy target nonblack creature. -- Put two 0/1 colorless Eldrazi Spawn creature tokens onto the battlefield. They have “Sacrifice this creature: Add {1} to your mana pool.” +text=Destroy target nonblack creature. -- Put two 0/1 colorless Eldrazi Spawn creature tokens onto the battlefield. They have “Sacrifice this creature: Add {1} to your mana pool.E mana={3}{B}{B} type=Sorcery [/card] @@ -15026,30 +15026,30 @@ type=Creature subtype=Faerie Soldier power=3 toughness=2 -[/card] +[/card] -[card] +[card] name=Feral Hydra - + type=Creature - + subtype=Hydra Beast - + mana={X}{G} - + power=0 - -toughness=0 + +toughness=0 text=Feral Hydra enters the battlefield with X +1/+1 counters on it. -- {3}: Put a +1/+1 counter on Feral Hydra. Any player may play this ability - + auto=counter(1/1,X) - + auto={3}:counter(1/1) - + grade=borderline - + [/card] [card] name=Feral Instinct @@ -19433,7 +19433,7 @@ name=Grizzly Fate auto=token(Bear,creature bear, 2/2,green)*2 auto=aslongas(*|mygraveyard) token(Bear,creature bear, 2/2,green)*2 >6 autograveyard={5}{G}{G}:copy(this) && moveTo(mystack) asSorcery -text=Put two 2/2 green Bear creature tokens onto the battlefield. -- Threshold — Put four 2/2 green Bear creature tokens onto the battlefield instead if seven or more cards are in your graveyard. -- Flashback {2}{G}{G} (You may cast this card from your graveyard for its flashback cost. Then exile it.) +text=Put two 2/2 green Bear creature tokens onto the battlefield. -- Threshold EPut four 2/2 green Bear creature tokens onto the battlefield instead if seven or more cards are in your graveyard. -- Flashback {2}{G}{G} (You may cast this card from your graveyard for its flashback cost. Then exile it.) mana={3}{G}{G} type=Sorcery [/card] @@ -22389,7 +22389,7 @@ type=Enchantment name=Ior Ruin Expedition auto=@movedTo(land|myBattlefield):may counter(0/0,1,Quest) auto={C(0/0,-3,Quest)}{S}:draw:2 -text=Landfall — Whenever a land enters the battlefield under your control, you may put a quest counter on Ior Ruin Expedition. -- Remove three quest counters from Ior Ruin Expedition and sacrifice it: Draw two cards. +text=Landfall EWhenever a land enters the battlefield under your control, you may put a quest counter on Ior Ruin Expedition. -- Remove three quest counters from Ior Ruin Expedition and sacrifice it: Draw two cards. mana={1}{U} type=Enchantment [/card] @@ -26623,7 +26623,7 @@ type=Artifact [card] name=Lotus Cobra auto=@movedTo(land|myBattlefield):may token(-1111129) -text=Landfall — Whenever a land enters the battlefield under your control, you may add one mana of any color to your mana pool. +text=Landfall EWhenever a land enters the battlefield under your control, you may add one mana of any color to your mana pool. mana={1}{G} type=Creature subtype=Snake @@ -44177,7 +44177,7 @@ toughness=1 name=Sunspring Expedition auto=@movedTo(land|myBattlefield):may counter(0/0,1,Quest) auto={C(0/0,-3,Quest)}{S}:life:8 -text=Landfall — Whenever a land enters the battlefield under your control, you may put a quest counter on Sunspring Expedition. -- Remove three quest counters from Sunspring Expedition and sacrifice it: You gain 8 life. +text=Landfall EWhenever a land enters the battlefield under your control, you may put a quest counter on Sunspring Expedition. -- Remove three quest counters from Sunspring Expedition and sacrifice it: You gain 8 life. mana={W} type=Enchantment [/card] @@ -47855,7 +47855,7 @@ auto=foreach(other creature[red]|myBattlefield) counter(1/1,1) auto=foreach(other creature[green]|myBattlefield) counter(1/1,1) auto={1}{C(1/1,-1)}:damage:1 target(creature) auto={1}{C(1/1,-1)}:token(Saproling,Creature Saproling,1/1,green) -text=Ulasht, the Hate Seed enters the battlefield with a +1/+1 counter on it for each other red creature you control and a +1/+1 counter on it for each other green creature you control. -- {1}, Remove a +1/+1 counter from Ulasht: Choose one — Ulasht deals 1 damage to target creature; or put a 1/1 green Saproling creature token onto the battlefield. +text=Ulasht, the Hate Seed enters the battlefield with a +1/+1 counter on it for each other red creature you control and a +1/+1 counter on it for each other green creature you control. -- {1}, Remove a +1/+1 counter from Ulasht: Choose one EUlasht deals 1 damage to target creature; or put a 1/1 green Saproling creature token onto the battlefield. mana={2}{R}{G} type=Legendary Creature subtype=Hellion Hydra @@ -47881,7 +47881,7 @@ auto=@damaged(creature,player) from(mytgt):counter(0/0,2,Charge) all(this) auto={C(0/0,-1,Charge)}:2/2 auto={C(0/0,-1,Charge)}:-1/-1 target(creature) auto={C(0/0,-1,Charge)}:life:2 controller -text=Whenever equipped creature deals combat damage, put two charge counters on Umezawa's Jitte. -- Remove a charge counter from Umezawa's Jitte: Choose one — Equipped creature gets +2/+2 until end of turn; or target creature gets -1/-1 until end of turn; or you gain 2 life. -- Equip {2} +text=Whenever equipped creature deals combat damage, put two charge counters on Umezawa's Jitte. -- Remove a charge counter from Umezawa's Jitte: Choose one EEquipped creature gets +2/+2 until end of turn; or target creature gets -1/-1 until end of turn; or you gain 2 life. -- Equip {2} mana={2} type=Legendary Artifact subtype=Equipment diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index 2413b6bdd..7524f575f 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -349,6 +349,7 @@ prowess_of_the_fair.txt prowess_of_the_fair2.txt prowess_of_the_fair3.txt pygmy_troll.txt +pyknite_i426.txt pyroclasm.txt quilled_sliver.txt rain_of_filth_i206.txt diff --git a/projects/mtg/bin/Res/test/pyknite_i426.txt b/projects/mtg/bin/Res/test/pyknite_i426.txt new file mode 100644 index 000000000..b0728d521 --- /dev/null +++ b/projects/mtg/bin/Res/test/pyknite_i426.txt @@ -0,0 +1,25 @@ +#Bug: The phrase "@next upkeep" does not work for permanents +[INIT] +SECONDMAIN +[PLAYER1] +manapool:{2}{G} +hand:pyknite +library:forest,plains,mountain +[PLAYER2] +[DO] +pyknite +eot +eot +next +#upkeep +next +#draw +next +[ASSERT] +FIRSTMAIN +[PLAYER1] +inplay:pyknite +hand:mountain,plains +library:forest +[PLAYER2] +[END] \ No newline at end of file diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 02fbe442c..d048dc8cc 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -2205,6 +2205,7 @@ TriggerAtPhase::TriggerAtPhase(int id, MTGCardInstance * source, Targetable * ta } int TriggerAtPhase::trigger(){ + if (testDestroy()) return 0; // http://code.google.com/p/wagic/issues/detail?id=426 GameObserver * g = GameObserver::GetInstance(); int result = 0; if (currentPhase != newPhase && newPhase == phaseId){ @@ -2242,8 +2243,10 @@ TriggerNextPhase::TriggerNextPhase(int id, MTGCardInstance * source, Targetable } int TriggerNextPhase::testDestroy(){ - if (newPhase <= phaseId) destroyActivated = 1; - if ( newPhase > phaseId && destroyActivated){ + //dirty hack because of http://code.google.com/p/wagic/issues/detail?id=426 + if (newPhase <= phaseId && !destroyActivated) destroyActivated = 1; + if (destroyActivated > 1 || (newPhase > phaseId && destroyActivated)){ + destroyActivated++; return 1; } return 0; @@ -2266,7 +2269,7 @@ GenericTriggeredAbility::GenericTriggeredAbility(int id, MTGCardInstance * _sour ability->target = target; if (destroyCondition){ destroyCondition->source = source; - destroyCondition->target = target;; + destroyCondition->target = target; } }