diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index f7f6186eb..2fafc9a73 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -75301,7 +75301,7 @@ type=Sorcery [/card] [card] name=Nature's Will -auto=@combatdamaged(player) from(creature|myBattlefield):tap all(land|opponentBattlefield) && untap all(land|myBattlefield) +auto=@each combatdamage restriction{opponentdamagedbycombat}:tap all(land|opponentBattlefield) && untap all(land|myBattlefield) text=Whenever one or more creatures you control deal combat damage to a player, tap all lands that player controls and untap all lands you control. mana={2}{G}{G} type=Enchantment @@ -79039,7 +79039,7 @@ toughness=3 [/card] [card] name=Ongoing Investigation -auto=@combatdamaged(player) from(creature|mybattlefield):token(Clue,Artifact Clue,0/0) and!( transforms((,newability[{S}{2}:draw:1])) forever )! controller +auto=@each combatdamage restriction{opponentdamagedbycombat}:token(Clue,Artifact Clue,0/0) and!( transforms((,newability[{S}{2}:draw:1])) forever )! controller auto={1}{G}{e(creature|mygraveyard)}:token(Clue,Artifact Clue,0/0) and!( transforms((,newability[{S}{2}:draw:1])) forever )! controller && life:2 text=Whenever one or more creatures you control deal combat damage to a player, investigate. (Put a colorless Clue artifact token onto the battlefield with "{2}, Sacrifice this artifact: Draw a card.") -- {1}{G}, Exile a creature card from your graveyard: Investigate. You gain 2 life. mana={1}{U} @@ -86578,7 +86578,7 @@ type=Instant [card] name=Pyrewild Shaman autohand={1}{R}{discard}:name(bloodrush) target(creature[attacking]) 3/1 ueot -autograveyard=@combatdamaged(player) from(creature|mybattlefield):pay({3}) moveto(ownerhand) +autograveyard=@each combatdamage restriction{opponentdamagedbycombat}:pay({3}) moveto(ownerhand) text=Bloodrush — {1}{R}, Discard Pyrewild Shaman: Target attacking creature gets +3/+1 until end of turn. -- Whenever one or more creatures you control deal combat damage to a player, if Pyrewild Shaman is in your graveyard, you may pay {3}. If you do, return Pyrewild Shaman to your hand. mana={2}{R} type=Creature @@ -90875,7 +90875,7 @@ toughness=3 [/card] [card] name=Reveille Squad -auto=@combat(attacking,sourcenottap) source(creature|opponentbattlefield):may untap all(creature|mybattlefield) +auto=@each blockers restriction{type(creature[attacking]|opponentbattlefield)~morethan~0} sourcenottap:may untap all(creature|mybattlefield) text=Whenever one or more creatures attack you, if Reveille Squad is untapped, you may untap all creatures you control. mana={2}{W}{W} type=Creature @@ -116417,7 +116417,7 @@ toughness=2 name=Thunderblade Charge target=creature,player auto=damage:3 -autograveyard=@combatdamaged(player) from(creature|mybattlefield):pay({2}{R}{R}{R}) name(pay to cast) activate name(pay to cast) castcard(restricted) +autograveyard=@each combatdamage restriction{opponentdamagedbycombat}:pay({2}{R}{R}{R}) name(pay to cast) activate name(pay to cast) castcard(restricted) text=Thunderblade Charge deals 3 damage to target creature or player. -- Whenever one or more creatures you control deal combat damage to a player, if Thunderblade Charge is in your graveyard, you may pay {2}{R}{R}{R}. If you do, you may cast it without paying its mana cost. mana={1}{R}{R} type=Sorcery diff --git a/projects/mtg/include/Player.h b/projects/mtg/include/Player.h index 6ba887610..b69619f2c 100644 --- a/projects/mtg/include/Player.h +++ b/projects/mtg/include/Player.h @@ -45,6 +45,7 @@ public: int energyCount; int epic; int forcefield; + int dealsdamagebycombat; int initLife; int raidcount; int handmodifier; diff --git a/projects/mtg/src/Damage.cpp b/projects/mtg/src/Damage.cpp index 3fff0b8f7..50b2b3f5d 100644 --- a/projects/mtg/src/Damage.cpp +++ b/projects/mtg/src/Damage.cpp @@ -260,6 +260,7 @@ int Damage::resolve() target->lifeLostThisTurn += damage; if ( typeOfDamage == 1 && target == source->controller()->opponent() )//add vector prowledtypes. { + source->controller()->dealsdamagebycombat = 1; // for restriction check vector values = MTGAllCards::getCreatureValuesById();//getting a weird crash here. rarely. for (size_t i = 0; i < values.size(); ++i) { diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 884e332db..2a6f6f1a4 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -213,6 +213,7 @@ void GameObserver::nextGamePhase() currentPlayer->nonCombatDamage = 0; currentPlayer->drawCounter = 0; currentPlayer->raidcount = 0; + currentPlayer->dealsdamagebycombat = 0; //clear check for restriction currentPlayer->opponent()->raidcount = 0; currentPlayer->prowledTypes.clear(); currentPlayer->opponent()->damageCount = 0; //added to clear odcount diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index e29295ba3..e4715c33c 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -540,6 +540,14 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe if(card->controller()->raidcount < 1) return 0; } + + + check = restriction[i].find("opponentdamagedbycombat"); + if(check != string::npos) + { + if(card->controller()->dealsdamagebycombat < 1) + return 0; + } check = restriction[i].find("outnumbered");//opponent controls atleast 4 or more creatures than you if(check != string::npos) diff --git a/projects/mtg/src/Player.cpp b/projects/mtg/src/Player.cpp index 6a95ca748..188bfd8c6 100644 --- a/projects/mtg/src/Player.cpp +++ b/projects/mtg/src/Player.cpp @@ -37,6 +37,7 @@ Player::Player(GameObserver *observer, string file, string fileSmall, MTGDeck * energyCount = 0; epic = 0; forcefield = 0; + dealsdamagebycombat = 0; raidcount = 0; handmodifier = 0; snowManaG = 0;