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.

This commit is contained in:
Vittorio Alfieri
2021-11-07 22:13:39 +01:00
parent f371295f24
commit 8012672a70
5 changed files with 26 additions and 13 deletions
+4 -1
View File
@@ -2,7 +2,10 @@
## [master] (https://github.com/WagicProject/wagic/tree/master) ## [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 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)) - *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))
@@ -334,8 +334,7 @@ type=Instant
[card] [card]
name=Adamant Will name=Adamant Will
target=creature target=creature
auto=+2/+2 auto=transforms((,newability[2/2],newability[indestructible])) ueot
auto=indestructible
text=Target creature gets +2/+2 and gains indestructible until end of turn. (Damage and effects that say "destroy" don't destroy it.) 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} mana={1}{W}
type=Instant type=Instant
@@ -14285,8 +14284,8 @@ type=Sorcery
[/card] [/card]
[card] [card]
name=Crushing Canopy name=Crushing Canopy
auto=choice name(flying) destroy target(creature[flying]) 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=choice name(enchantment) destroy target(enchantment) 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. text=Choose one -- Destroy target creature with flying. -- Destroy target enchantment.
mana={2}{G} mana={2}{G}
type=Instant type=Instant
@@ -17252,9 +17251,7 @@ toughness=1
[/card] [/card]
[card] [card]
name=Diabolic Servitude name=Diabolic Servitude
auto=moveTo(myBattlefield) target(creature|mygraveyard) auto={B}{B}{L:2}{S(swamp|mybattlefield)}:name(Return creature) moveTo(myBattlefield) target(creature|mygraveyard)
auto=soulbond _DIES_moveto(exile) && all(this) transforms((,newability[moveTo(ownerhand)]))
auto=soulbond _DIES_moveto(exile)
text={B}{B}, Pay 2 life, Sacrifice a Swamp: Return target creature card from your graveyard to the battlefield. text={B}{B}, Pay 2 life, Sacrifice a Swamp: Return target creature card from your graveyard to the battlefield.
mana={3}{B} mana={3}{B}
type=Enchantment type=Enchantment
@@ -19336,7 +19333,7 @@ toughness=3
[card] [card]
name=Dryad of the Ilysian Grove name=Dryad of the Ilysian Grove
auto=maxPlay(land)+1 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. 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} mana={2}{G}
type=Enchantment Creature type=Enchantment Creature
@@ -1823,9 +1823,10 @@ subtype=Lolth
name=Lord Windgrace name=Lord Windgrace
abilities=canbecommander abilities=canbecommander
auto=counter(0/0,5,Loyalty) 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,2,Loyalty)}:name(+2: Discard land and draw) target(land|myhand) reject and!( draw:2 controller )!
auto={C(0/0,-3,Loyalty)}:name(-3: Return up to two lands from graveyard) moveTo(myBattlefield) target(<upto:2>*[land]|myGraveyard) 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,-11,Loyalty)}:name(-11: Destroy up to six and create six 2/2 Cat) destroy target(<upto:6>*[-land]) && token(Cat,Creature Cat,2/2,green,forestwalk)*6 auto={C(0/0,-3,Loyalty)}:name(-3: Return up to two lands from graveyard) target(<upto:2>*[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. 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} mana={2}{B}{R}{G}
type=Legendary Planeswalker type=Legendary Planeswalker
+1 -1
View File
@@ -4794,7 +4794,7 @@ int AAFlip::resolve()
int activatedanyability = 0; int activatedanyability = 0;
MTGCardInstance * Flipper = (MTGCardInstance*)source; MTGCardInstance * Flipper = (MTGCardInstance*)source;
this->oneShot = true; 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); game->removeObserver(this);
return 0; return 0;
+12
View File
@@ -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 else if(!intValue)//found nothing, try parsing a atoi
{ {
intValue = atoi(s.c_str()); intValue = atoi(s.c_str());