diff --git a/projects/mtg/bin/Res/sets/10E/_cards.dat b/projects/mtg/bin/Res/sets/10E/_cards.dat index a2f504f0e..fd4bf560f 100644 --- a/projects/mtg/bin/Res/sets/10E/_cards.dat +++ b/projects/mtg/bin/Res/sets/10E/_cards.dat @@ -1612,7 +1612,7 @@ toughness=* [card] text={T}: Orcish Artillery deals 2 damage to target creature or player and 3 damage to you. id=129663 -alias=1309 +auto={T}:damage:2 target(creature,player) && damage:3 controller name=Orcish Artillery rarity=U type=Creature @@ -2941,4 +2941,4 @@ mana={1}{W} power=2 subtype=Human Knight toughness=1 -[/card] +[/card] diff --git a/projects/mtg/bin/Res/sets/EXO/_cards.dat b/projects/mtg/bin/Res/sets/EXO/_cards.dat index e536fdedb..c4c8eb1d2 100644 --- a/projects/mtg/bin/Res/sets/EXO/_cards.dat +++ b/projects/mtg/bin/Res/sets/EXO/_cards.dat @@ -674,16 +674,4 @@ subtype=Frog auto={U}:flying power=1 toughness=3 -[/card] -[card] -text=When Wood Elves comes into play, search your library for a Forest card and put that card into play. Then shuffle your library. -auto=moveTo(mybattlefield) target(forest|myLibrary) -id=6135 -name=Wood Elves -rarity=C -mana={2}{G} -type=Creature -subtype=Elf Scout -power=1 -toughness=1 -[/card] +[/card] \ No newline at end of file diff --git a/projects/mtg/bin/Res/sets/EXO/todo.dat b/projects/mtg/bin/Res/sets/EXO/todo.dat index f73de0738..c475e2571 100644 --- a/projects/mtg/bin/Res/sets/EXO/todo.dat +++ b/projects/mtg/bin/Res/sets/EXO/todo.dat @@ -1,4 +1,4 @@ -[card] +[card] id=6071 name=AEther Tide mana={X}{U} @@ -188,7 +188,7 @@ id=6120 name=Flowstone Flood mana={3}{R} type=Sorcery -text=Buyback—Pay 3 life, Discard a card at random (You may pay 3 life and discard a card at random in addition to any other costs as you play this spell. If you do, put this card into your hand as it resolves.) Destroy target land. +text=Buyback?Pay 3 life, Discard a card at random (You may pay 3 life and discard a card at random in addition to any other costs as you play this spell. If you do, put this card into your hand as it resolves.) Destroy target land. rarity=U [/card] [card] @@ -196,7 +196,7 @@ id=5157 name=Forbid mana={1}{U}{U} type=Instant -text=Buyback—Discard two cards. (You may discard two cards in addition to any other costs as you play this spell. If you do, put this card into your hand as it resolves.) Counter target spell. +text=Buyback?Discard two cards. (You may discard two cards in addition to any other costs as you play this spell. If you do, put this card into your hand as it resolves.) Counter target spell. rarity=U [/card] [card] @@ -498,7 +498,7 @@ id=6044 name=Pegasus Stampede mana={1}{W} type=Sorcery -text=Buyback—Sacrifice a land. (You may sacrifice a land in addition to any other costs as you play this spell. If you do, put this card into your hand as it resolves.) Put a 1/1 white Pegasus creature token with flying into play. +text=Buyback?Sacrifice a land. (You may sacrifice a land in addition to any other costs as you play this spell. If you do, put this card into your hand as it resolves.) Put a 1/1 white Pegasus creature token with flying into play. rarity=U [/card] [card] @@ -536,7 +536,7 @@ id=6037 name=Reaping the Rewards mana={W} type=Instant -text=Buyback—Sacrifice a land. (You may sacrifice a land in addition to any other costs as you play this spell. If you do, put this card into your hand as it resolves.) You gain 2 life. +text=Buyback?Sacrifice a land. (You may sacrifice a land in addition to any other costs as you play this spell. If you do, put this card into your hand as it resolves.) You gain 2 life. rarity=C [/card] [card] @@ -613,7 +613,7 @@ id=6097 name=Slaughter mana={2}{B}{B} type=Instant -text=Buyback—Pay 4 life. (You may pay 4 life in addition to any other costs as you play this spell. If you do, put this card into your hand as it resolves.) Destroy target nonblack creature. It can't be regenerated. +text=Buyback?Pay 4 life. (You may pay 4 life in addition to any other costs as you play this spell. If you do, put this card into your hand as it resolves.) Destroy target nonblack creature. It can't be regenerated. rarity=U [/card] [card] @@ -750,7 +750,18 @@ toughness=7 text=Defender (This creature can't attack.) At end of combat, remove from the game all creatures blocked by Wall of Nets. When Wall of Nets leaves play, return to play under their owners' control all creatures removed from the game with Wall of Nets. rarity=R [/card] - +[card] +text=When Wood Elves comes into play, search your library for a Forest card and put that card into play. Then shuffle your library. +auto=moveTo(mybattlefield) target(forest|myLibrary) +id=6135 +name=Wood Elves +rarity=C +mana={2}{G} +type=Creature +subtype=Elf Scout +power=1 +toughness=1 +[/card] [card] id=6156 name=Workhorse diff --git a/projects/mtg/bin/Res/sets/M10/_cards.dat b/projects/mtg/bin/Res/sets/M10/_cards.dat index b99706539..8da8d8004 100644 --- a/projects/mtg/bin/Res/sets/M10/_cards.dat +++ b/projects/mtg/bin/Res/sets/M10/_cards.dat @@ -1380,7 +1380,7 @@ subtype=Rat power=2 toughness=2 text=Relentless Rats gets +1/+1 for each other creature on the battlefield named Relentless Rats. A deck can have any number of cards named Relentless Rats. -auto=foreach(Relentless Rats) 1/1 +auto=foreach(Relentless Rats) 1/1 other rarity=U [/card] [card] diff --git a/projects/mtg/bin/Res/sets/POR/_cards.dat b/projects/mtg/bin/Res/sets/POR/_cards.dat index 78c3f0056..b9e7f5373 100644 --- a/projects/mtg/bin/Res/sets/POR/_cards.dat +++ b/projects/mtg/bin/Res/sets/POR/_cards.dat @@ -1624,18 +1624,6 @@ mana={1}{G}{G} type=Sorcery [/card] [card] -text=When Wood Elves comes into play, search your library for a Forest card and put that card into play. Then shuffle your library. -auto=moveTo(inPlay) target(forest|myLibrary) -id=4327 -name=Wood Elves -rarity=R -type=Creature -mana={2}{G} -power=1 -subtype=Elf Scout -toughness=1 -[/card] -[card] text=Destroy all creatures. They can't be regenerated. auto=bury all(creature) alias=1372 @@ -1644,4 +1632,4 @@ name=Wrath of God rarity=R mana={2}{W}{W} type=Sorcery -[/card] +[/card] diff --git a/projects/mtg/bin/Res/sets/POR/todo.dat b/projects/mtg/bin/Res/sets/POR/todo.dat index 9cbd2b168..7dcdbd225 100644 --- a/projects/mtg/bin/Res/sets/POR/todo.dat +++ b/projects/mtg/bin/Res/sets/POR/todo.dat @@ -520,4 +520,15 @@ rarity=U type=Sorcery mana={2}{U} [/card] - +[card] +text=When Wood Elves comes into play, search your library for a Forest card and put that card into play. Then shuffle your library. +auto=moveTo(inPlay) target(forest|myLibrary) +id=4327 +name=Wood Elves +rarity=R +type=Creature +mana={2}{G} +power=1 +subtype=Elf Scout +toughness=1 +[/card] diff --git a/projects/mtg/bin/Res/sets/RV/_cards.dat b/projects/mtg/bin/Res/sets/RV/_cards.dat index 6bab36a42..d07e5d23b 100644 --- a/projects/mtg/bin/Res/sets/RV/_cards.dat +++ b/projects/mtg/bin/Res/sets/RV/_cards.dat @@ -1541,6 +1541,7 @@ toughness=2 text={T}: Orcish Artillery deals 2 damage to target creature or player and 3 damage to you. id=1309 name=Orcish Artillery +auto={T}:damage:2 target(creature,player) && damage:3 controller rarity=U type=Creature mana={1}{R}{R} @@ -2260,6 +2261,8 @@ subtype=Aura [card] text=Enchant creature Enchanted creature gets +3/+3. At the beginning of the upkeep of enchanted creature's controller, put a -1/-1 counter on that creature. target=creature +auto=3/3 +auto=@each targetcontroller upkeep:counter(-1/-1) id=1228 name=Unstable Mutation rarity=C diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index 5a421a7d7..b2b144f4b 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -85,6 +85,7 @@ dross_harvester.txt elvish_piper.txt elvish_promenade.txt fastbond.txt +fastbond2.txt fault_line.txt fists_of_ironwood.txt flare.txt @@ -106,6 +107,7 @@ goblin_king.txt gravedigger.txt #hammerfist_giant.txt hannas_custody.txt +#harpoon_sniper.txt uncomment when damages are correctly resolved at the damage resolution step hellfire.txt howl_of_the_night_pack.txt hymn_of_rebirth.txt @@ -138,7 +140,9 @@ nightmare.txt northern_paladin.txt northern_paladin2.txt Nyxathid.txt +orcish_artillery.txt orcish_lumberjack.txt +overrun.txt paralysis.txt paralysis2.txt persuasion.txt @@ -185,6 +189,7 @@ terror.txt titanic_ultimatum.txt tranquil_domain.txt volcanic_island.txt +unstable_mutation.txt wall_of_diffusion.txt wall_of_diffusion2.txt welkin_hawk.txt diff --git a/projects/mtg/bin/Res/test/fastbond2.txt b/projects/mtg/bin/Res/test/fastbond2.txt new file mode 100644 index 000000000..424a8986c --- /dev/null +++ b/projects/mtg/bin/Res/test/fastbond2.txt @@ -0,0 +1,19 @@ +#Bug:Fastbond doesn't work properly the turn it comes into play +[INIT] +FIRSTMAIN +[PLAYER1] +hand:forest,mountain,plains,fastbond +[PLAYER2] +[DO] +forest +forest +fastbond +mountain +plains +[ASSERT] +FIRSTMAIN +[PLAYER1] +inplay:forest,mountain,plains,fastbond +life:18 +[PLAYER2] +[END] \ No newline at end of file diff --git a/projects/mtg/bin/Res/test/harpoon_sniper.txt b/projects/mtg/bin/Res/test/harpoon_sniper.txt new file mode 100644 index 000000000..899f2c296 --- /dev/null +++ b/projects/mtg/bin/Res/test/harpoon_sniper.txt @@ -0,0 +1,26 @@ +#Bug: harpoon sniper doesn't work correctly +[INIT] +COMBATATTACKERS +[PLAYER1] +inplay:grizzly bears +[PLAYER2] +inplay:harpoon sniper,coral merfolk,plains +[DO] +grizzly bears +next +#blockers +plains +harpoon sniper +choice 1 +grizzly bears +next +#damage +next +#combat end +[ASSERT] +COMBATEND +[PLAYER1] +graveyard:grizzly bears +[PLAYER2] +inplay:harpoon sniper,coral merfolk,plains +[END] \ No newline at end of file diff --git a/projects/mtg/bin/Res/test/orcish_artillery.txt b/projects/mtg/bin/Res/test/orcish_artillery.txt new file mode 100644 index 000000000..0310393e6 --- /dev/null +++ b/projects/mtg/bin/Res/test/orcish_artillery.txt @@ -0,0 +1,21 @@ +#Bug: Orcish Artillery does not tap +[INIT] +FIRSTMAIN +[PLAYER1] +inplay:orcish artillery +[PLAYER2] +inplay:grizzly bears,white knight +[DO] +orcish artillery +white knight +orcish artillery +grizzly bears +[ASSERT] +FIRSTMAIN +[PLAYER1] +inplay:orcish artillery +life:17 +[PLAYER2] +inplay:grizzly bears +graveyard:white knight +[END] \ No newline at end of file diff --git a/projects/mtg/bin/Res/test/overrun.txt b/projects/mtg/bin/Res/test/overrun.txt new file mode 100644 index 000000000..63dcfe62a --- /dev/null +++ b/projects/mtg/bin/Res/test/overrun.txt @@ -0,0 +1,30 @@ +#Bug: Overrun from M10 seems not to work properly.It has regrowth effect instead +[INIT] +FIRSTMAIN +[PLAYER1] +inplay:grizzly bears,dragon engine +hand:189906 +manapool:{2}{G}{G}{G} +[PLAYER2] +[DO] +189906 +next +#begins +next +#attack +grizzly bears +dragon engine +next +#block +next +#damage +next +#end +[ASSERT] +COMBATEND +[PLAYER1] +inplay:grizzly bears,dragon engine +graveyard:189906 +[PLAYER2] +life:11 +[END] \ No newline at end of file diff --git a/projects/mtg/bin/Res/test/unstable_mutation.txt b/projects/mtg/bin/Res/test/unstable_mutation.txt new file mode 100644 index 000000000..8604f63eb --- /dev/null +++ b/projects/mtg/bin/Res/test/unstable_mutation.txt @@ -0,0 +1,43 @@ +#Bug: unstable mutation doesn't give +3/+3 +[INIT] +FIRSTMAIN +[PLAYER1] +inplay:raging goblin +hand:unstable mutation +manapool:{U} +[PLAYER2] +[DO] +unstable mutation +raging goblin +next +#combat begins +next +#attackers +raging goblin +eot +eot +#untap +next +#upkeep +next +#draw +next +#main +next +#combat +next +#atackers +raging goblin +next +#blockers +next +#damage +next +end +[ASSERT] +COMBATEND +[PLAYER1] +inplay:raging goblin,unstable mutation +[PLAYER2] +life:13 +[END] \ No newline at end of file diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 82fdca384..2404f3be3 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -973,35 +973,6 @@ class APowerToughnessModifier: public MTGAbility{ }; -// Permanent life alteration evry turn of the target's controller. Useful only for unstable mutation currently -class APowerToughnessModifierRegularCounter:public MTGAbility{ - public: - int power, toughness; - int phase; - APowerToughnessModifierRegularCounter(int id, MTGCardInstance * _source, MTGCardInstance * _target, int _phase, int _power, int _toughness):MTGAbility(id,_source,_target),power(_power),toughness(_toughness), phase(_phase){ - } - - void Update(float dt){ - if (newPhase !=currentPhase && newPhase==phase && game->currentPlayer==((MTGCardInstance *)target)->controller()){ - ((MTGCardInstance *)target)->power += power; - ((MTGCardInstance *)target)->addToToughness(toughness); - } - } - virtual ostream& toString(ostream& out) const - { - out << "APowerToughnessModifierRegularCounter ::: power : " << power - << " ; toughness : " << toughness - << " ; phase : " << phase - << " ("; - return MTGAbility::toString(out) << ")"; - } - APowerToughnessModifierRegularCounter * clone() const{ - APowerToughnessModifierRegularCounter * a = NEW APowerToughnessModifierRegularCounter(*this); - a->isClone = 1; - return a; - } -}; - //Alteration of Power and Toughness until end of turn (TargetAbility) // Gives +n/+m until end of turn to any card that's a target @@ -2763,6 +2734,11 @@ class AFastbond:public TriggeredAbility{ int previous; AFastbond(int _id, MTGCardInstance * card):TriggeredAbility(_id, card){ alreadyPlayedALand = 0; + if (source->controller()->canPutLandsIntoPlay == 0){ + alreadyPlayedALand = 1; + source->controller()->canPutLandsIntoPlay = 1; + } + previous = source->controller()->canPutLandsIntoPlay; } void Update(float dt){ @@ -2773,7 +2749,7 @@ class AFastbond:public TriggeredAbility{ } int trigger(){ - if(source->controller()->canPutLandsIntoPlay==0 && previous ==1){ + if(source->controller()->canPutLandsIntoPlay==0 && previous == 1){ previous = 0; source->controller()->canPutLandsIntoPlay = 1; if (alreadyPlayedALand) return 1; @@ -2786,6 +2762,7 @@ class AFastbond:public TriggeredAbility{ int resolve(){ game->mLayers->stackLayer()->addDamage(source, source->controller(), 1); + game->mLayers->stackLayer()->resolve(); return 1; } @@ -3412,29 +3389,6 @@ class AForceOfNature:public ActivatedAbility{ }; - - -//1309 Orcish Artilery -class AOrcishArtillery: public TADamager{ - public: - AOrcishArtillery(int _id,MTGCardInstance * card): TADamager(_id, card, NEW ManaCost(), 2){ - } - - int resolve(){ - TADamager::resolve(); - game->mLayers->stackLayer()->addDamage(source,source->controller(), 3); - return 1; - } - - - AOrcishArtillery * clone() const{ - AOrcishArtillery * a = NEW AOrcishArtillery(*this); - a->isClone = 1; - return a; - } -}; - - //1351 Island Sanctuary class AIslandSanctuary:public MTGAbility{ public: @@ -3755,42 +3709,6 @@ class AARandomDiscarder:public ActivatedAbilityTP{ } }; -// Generic Karma -class ADamageForTypeControlled: public TriggeredAbility{ - public: - char type[20]; - ADamageForTypeControlled(int _id, MTGCardInstance * _source,const char * _type):TriggeredAbility(_id, _source){ - sprintf(type,"%s",_type); - } - - int trigger(){ - if (newPhase != currentPhase && newPhase == Constants::MTG_PHASE_UPKEEP) return 1; - return 0; - } - - int resolve(){ - int totaldamage = 0; - MTGGameZone * zone = game->currentPlayer->game->inPlay; - for (int i = 0; i < zone->nb_cards; i++){ - if (zone->cards[i]->hasType(type)) totaldamage++;; - } - if (totaldamage) game->mLayers->stackLayer()->addDamage(source,game->currentPlayer, totaldamage); - return 1; - } - - virtual ostream& toString(ostream& out) const - { - out << "ADamageForTypeControlled ::: type : " << type - << " ("; - return TriggeredAbility::toString(out) << ")"; - } - - ADamageForTypeControlled * clone() const{ - ADamageForTypeControlled * a = NEW ADamageForTypeControlled(*this); - a->isClone = 1; - return a; - } -}; // Dreamborn Muse class ADreambornMuse: public TriggeredAbility{ diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 4260bf62f..c7cf55d6b 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -99,6 +99,7 @@ TriggeredAbility * AbilityFactory::parseTrigger(string magicText, int id, Spell int who = 0; if (s.find("my") != string::npos) who = 1; if (s.find("opponent") != string::npos) who = -1; + if (s.find("targetcontroller") != string::npos) who = -2; //Next Time... found = s.find("next"); @@ -1288,13 +1289,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){ game->addObserver( NEW AControlStealAura(_id, card, card->target)); break; } - case 1228: //Unstable mutation - { - game->addObserver(NEW APowerToughnessModifier(_id, card, card->target, 3, 3)); - game->addObserver(NEW APowerToughnessModifierRegularCounter(_id, card, card->target, Constants::MTG_PHASE_UPKEEP, -1, -1)); - break; - } - case 1235: //Aspect of Wolf { game->addObserver(NEW AAspectOfWolf(_id, card, card->target)); @@ -1396,11 +1390,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){ game->addObserver(NEW AFastbond(_id, card)); break; } - case 1309: //Orcish Artillery - { - game->addObserver(NEW AOrcishArtillery(_id, card)); - break; - } case 1326: //Wheel of fortune { for (int i = 0; i < 2; i++){ @@ -2178,6 +2167,13 @@ int TriggerAtPhase::trigger(){ case -1: if(g->currentPlayer != source->controller()) result = 1; break; + case -2: + if(source->target) { + if (g->currentPlayer == source->target->controller()) result = 1; + }else { + if(g->currentPlayer == source->controller()) result = 1; + } + break; default: result = 1; break;