diff --git a/CHANGELOG.md b/CHANGELOG.md index 5372bb3cb..34b54b39e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,10 @@ ## [master] (https://github.com/WagicProject/wagic/tree/master) -### 03/11/21 +### 07/11/21 +- *Committed:* Fixed primitives, fixed a problem on "flip" ability for some backside cards (e.g. "Edgar Markov's Coffin"), added new keywords "pnumcreswp" and "onumcreswp" to calculate the number of creatures that have toughness greater than their power. ([Vitty85](https://github.com/Vitty85)) + +### 04/11/21 - *Committed:* Fixed a bug related to the "turnlimited" option on several ability triggers (e.g. Vampired, Discarded, etc.), restored some test of regression suite after this bug resolution. ([Vitty85](https://github.com/Vitty85)) - *Committed:* Fixed primitives, added new ability "exploits" to sacrifice a creature, added new trigger "exploited" and improved all primitives with Exploit ability, improved "tokencreated" and "sacrificed" triggers to allow "turnlimited" option, improved "flip" ability in order to keep track of current zone before flip. https://github.com/WagicProject/wagic/commit/79e560e2b299d763fde9783a098e55b4d8a08c9d ([Vitty85](https://github.com/Vitty85)) diff --git a/projects/mtg/bin/Res/sets/primitives/borderline.txt b/projects/mtg/bin/Res/sets/primitives/borderline.txt index ec2a4dc3d..02cc17c51 100644 --- a/projects/mtg/bin/Res/sets/primitives/borderline.txt +++ b/projects/mtg/bin/Res/sets/primitives/borderline.txt @@ -334,8 +334,7 @@ type=Instant [card] name=Adamant Will target=creature -auto=+2/+2 -auto=indestructible +auto=transforms((,newability[2/2],newability[indestructible])) ueot text=Target creature gets +2/+2 and gains indestructible until end of turn. (Damage and effects that say "destroy" don't destroy it.) mana={1}{W} type=Instant @@ -14285,8 +14284,8 @@ type=Sorcery [/card] [card] name=Crushing Canopy -auto=choice name(flying) destroy target(creature[flying]) -auto=choice name(enchantment) destroy target(enchantment) +auto=if type(creature[flying]|battlefield)~morethan~0 then choice name(Destroy creature with flying) name(Destroy creature with flying) destroy target(creature[flying]|battlefield) +auto=if type(enchantment|battlefield)~morethan~0 then choice name(Destroy enchantment) name(Destroy enchantment) destroy target(enchantment) text=Choose one -- Destroy target creature with flying. -- Destroy target enchantment. mana={2}{G} type=Instant @@ -17252,9 +17251,7 @@ toughness=1 [/card] [card] name=Diabolic Servitude -auto=moveTo(myBattlefield) target(creature|mygraveyard) -auto=soulbond _DIES_moveto(exile) && all(this) transforms((,newability[moveTo(ownerhand)])) -auto=soulbond _DIES_moveto(exile) +auto={B}{B}{L:2}{S(swamp|mybattlefield)}:name(Return creature) moveTo(myBattlefield) target(creature|mygraveyard) text={B}{B}, Pay 2 life, Sacrifice a Swamp: Return target creature card from your graveyard to the battlefield. mana={3}{B} type=Enchantment @@ -19336,7 +19333,7 @@ toughness=3 [card] name=Dryad of the Ilysian Grove auto=maxPlay(land)+1 -auto=lord(land|myBattlefield) transforms((plains forest mountain swamp island)) +auto=lord(land|myBattlefield) transforms((basic plains forest mountain swamp island)) text=You may play an additional land on each of your turns. -- Lands you control are every basic land type in addition to their other types. mana={2}{G} type=Enchantment Creature diff --git a/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt b/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt index 3331e702a..587eb30d2 100644 --- a/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt +++ b/projects/mtg/bin/Res/sets/primitives/planeswalkers.txt @@ -1823,9 +1823,10 @@ subtype=Lolth name=Lord Windgrace abilities=canbecommander auto=counter(0/0,5,Loyalty) -auto={C(0/0,2,Loyalty)}:name(+2: Discard and Draw) draw:1 controller && ability$!name(Choose one) choice name(Discard land) reject notatarget(*[land]|myhand) && draw:1 controller _ choice name(Discard non-land) reject notatarget(*[-land]|myhand)!$ controller -auto={C(0/0,-3,Loyalty)}:name(-3: Return up to two lands from graveyard) moveTo(myBattlefield) target(*[land]|myGraveyard) -auto={C(0/0,-11,Loyalty)}:name(-11: Destroy up to six and create six 2/2 Cat) destroy target(*[-land]) && token(Cat,Creature Cat,2/2,green,forestwalk)*6 +auto={C(0/0,2,Loyalty)}:name(+2: Discard land and draw) target(land|myhand) reject and!( draw:2 controller )! +auto={C(0/0,2,Loyalty)}:name(+2: Discard non-land and draw) target(*[-land]|myhand) reject and!( draw:1 controller )! +auto={C(0/0,-3,Loyalty)}:name(-3: Return up to two lands from graveyard) target(*[land]|myGraveyard) moveTo(myBattlefield) +auto={C(0/0,-11,Loyalty)}:name(-11: Destroy and create cats) thisforeach(variable{6}) ability$!name(Choose one) choice name(Destroy and create cat) target(*[-land]|battlefield) destroy && token(Cat,Creature Cat,2/2,green,forestwalk) _ choice name(Just create cat) token(Cat,Creature Cat,2/2,green,forestwalk)!$ controller text=+2: Discard a card, then draw a card. If a land card is discarded this way, draw an additional card. -- −3: Return up to two target land cards from your graveyard to the battlefield. -- −11: Destroy up to six target nonland permanents, then create six 2/2 green Cat Warrior creature tokens with forestwalk. -- Lord Windgrace can be your commander. mana={2}{B}{R}{G} type=Legendary Planeswalker diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index fedb88eaa..b091612a5 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -4794,7 +4794,7 @@ int AAFlip::resolve() int activatedanyability = 0; MTGCardInstance * Flipper = (MTGCardInstance*)source; this->oneShot = true; - if(Flipper->isFlipped > 0 && forcetype == "") + if(Flipper->isFlipped > 0 && forcetype == "" && flipStats != "myorigname" && flipStats != "chosenname" && flipStats != "backside") // Fixed a problem on some backside cards (e.g. "Edgar Markov's Coffin"). { game->removeObserver(this); return 0; diff --git a/projects/mtg/src/WParsedInt.cpp b/projects/mtg/src/WParsedInt.cpp index 1566a0812..d1788b9a7 100644 --- a/projects/mtg/src/WParsedInt.cpp +++ b/projects/mtg/src/WParsedInt.cpp @@ -1453,6 +1453,18 @@ void WParsedInt::extendedParse(string s, Spell * spell, MTGCardInstance * card) } } } + else if(s.find("pnumcreswp") != string::npos || s.find("onumcreswp") != string::npos){ //Number of creatures that have toughness greater than their power. + intValue = 0; + bool opponent = (s.find("onumcreswp")!=string::npos)?true:false; + Player* p = card->controller(); + if (opponent) + p = card->controller()->opponent(); + for(unsigned int i = 0; i < p->game->inPlay->cards.size(); i++){ + if(p->game->inPlay->cards[i]->hasType(Subtypes::TYPE_CREATURE) && p->game->inPlay->cards[i]->toughness > p->game->inPlay->cards[i]->power){ + intValue++; + } + } + } else if(!intValue)//found nothing, try parsing a atoi { intValue = atoi(s.c_str());