From c805a58fb0e025c95d741861ceb413fed5293a5e Mon Sep 17 00:00:00 2001 From: punkeduard Date: Wed, 2 Aug 2017 18:42:52 -0500 Subject: [PATCH] Update unsuported cards, set a condition for showing poison counters and energy counter, added tribal al card type check, show the amount o --- .../bin/Res/sets/primitives/unsupported.txt | 163 +----------------- projects/mtg/src/GuiStatic.cpp | 4 +- projects/mtg/src/MTGAbility.cpp | 6 +- projects/mtg/src/MTGDeck.cpp | 29 +++- 4 files changed, 31 insertions(+), 171 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/unsupported.txt b/projects/mtg/bin/Res/sets/primitives/unsupported.txt index 2bc9b8ad5..51166763e 100644 --- a/projects/mtg/bin/Res/sets/primitives/unsupported.txt +++ b/projects/mtg/bin/Res/sets/primitives/unsupported.txt @@ -1936,12 +1936,6 @@ mana={3}{R} type=Enchantment [/card] [card] -name=Burning Wish -text=You may choose a sorcery card you own from outside the game, reveal that card, and put it into your hand. Exile Burning Wish. -mana={1}{R} -type=Sorcery -[/card] -[card] name=Burning-Eye Zubera text=When Burning-Eye Zubera dies, if 4 or more damage was dealt to it this turn, Burning-Eye Zubera deals 3 damage to target creature or player. mana={2}{R}{R} @@ -3340,15 +3334,6 @@ mana={4}{U}{U} type=Instant [/card] [card] -name=Courser of Kruphix -text=Play with the top card of your library revealed. -- You may play the top card of your library if it's a land card. -- Whenever a land enters the battlefield under your control, you gain 1 life. -mana={1}{G}{G} -type=Enchantment Creature -subtype=Centaur -power=2 -toughness=4 -[/card] -[card] name=Covenant of Minds text=Reveal the top three cards of your library. Target opponent may choose to put those cards into your hand. If he or she doesn't, put those cards into your graveyard and draw five cards. mana={4}{U} @@ -3468,12 +3453,6 @@ mana={4} type=Artifact [/card] [card] -name=Crown of Convergence -text=Play with the top card of your library revealed. -- As long as the top card of your library is a creature card, creatures you control that share a color with that card get +1/+1. -- {G}{W}: Put the top card of your library on the bottom of your library. -mana={2} -type=Artifact -[/card] -[card] name=Crown of Doom text=Whenever a creature attacks you or a planeswalker you control, it gets +2/+0 until end of turn. -- {2}: Target player other than Crown of Doom's owner gains control of it. Activate this ability only during your turn. mana={3} @@ -3585,12 +3564,6 @@ mana={4}{U}{U} type=Sorcery [/card] [card] -name=Cunning Wish -text=You may choose an instant card you own from outside the game, reveal that card, and put it into your hand. Exile Cunning Wish. -mana={2}{U} -type=Instant -[/card] -[card] name=Curious Homunculus text={T}: Add {C} to your mana pool. Spend this mana only to cast an instant or sorcery spell. -- At the beginning of your upkeep, if there are three or more instant and/or sorcery cards in your graveyard, transform Curious Homunculus. mana={1}{U} @@ -4008,12 +3981,6 @@ mana={R} type=Instant [/card] [card] -name=Death Wish -text=You may choose a card you own from outside the game and put it into your hand. You lose half your life, rounded up. Exile Death Wish. -mana={1}{B}{B} -type=Sorcery -[/card] -[card] name=Death-Mask Duplicant text=Imprint — {1}: Exile target creature card from your graveyard. -- As long as a card exiled with Death-Mask Duplicant has flying, Death-Mask Duplicant has flying. The same is true for fear, first strike, double strike, haste, landwalk, protection, and trample. mana={7} @@ -5321,7 +5288,7 @@ mana={2}{G}{G} type=Sorcery [/card] [card] -name=Evasive Action +name= text=Domain — Counter target spell unless its controller pays {1} for each basic land type among lands you control. mana={1}{U} type=Instant @@ -6325,12 +6292,6 @@ mana={1}{R}{R}{R} type=Enchantment [/card] [card] -name=Future Sight -text=Play with the top card of your library revealed. -- You may play the top card of your library. -mana={2}{U}{U}{U} -type=Enchantment -[/card] -[card] name=Gabriel Angelfire text=At the beginning of your upkeep, choose flying, first strike, trample, or rampage 3. Gabriel Angelfire gains that ability until your next upkeep. (Whenever a creature with rampage 3 becomes blocked, it gets +3/+3 until end of turn for each creature blocking it beyond the first.) mana={3}{G}{G}{W}{W} @@ -6355,15 +6316,6 @@ mana={3}{G} type=Sorcery [/card] [card] -name=Gaea's Herald -text=Creature spells can't be countered. -mana={1}{G} -type=Creature -subtype=Elf -power=1 -toughness=1 -[/card] -[card] name=Gaea's Liege text=As long as Gaea's Liege isn't attacking, its power and toughness are each equal to the number of Forests you control. As long as Gaea's Liege is attacking, its power and toughness are each equal to the number of Forests defending player controls. -- {T}: Target land becomes a Forest until Gaea's Liege leaves the battlefield. mana={3}{G}{G}{G} @@ -6415,16 +6367,6 @@ mana={2}{R} type=Instant [/card] [card] -name=Garruk's Horde -abilities=trample -text=Trample -- Play with the top card of your library revealed. -- You may cast the top card of your library if it's a creature card. (Do this only any time you could cast that creature card. You still pay the spell's costs.) -mana={5}{G}{G} -type=Creature -subtype=Beast -power=7 -toughness=7 -[/card] -[card] name=Garrulous Sycophant text=At the beginning of your end step, if you're the monarch, each opponent loses 1 life and you gain 1 life. mana={2}{B} @@ -6701,16 +6643,6 @@ power=5 toughness=5 [/card] [card] -name=Gisela, the Broken Blade -abilities=flying,first strike,lifelink -text=Flying, first strike, lifelink -- At the beginning of your end step, if you both own and control Gisela, the Broken Blade and a creature named Bruna, the Fading Light, exile them, then meld them into Brisela, Voice of Nightmares. -mana={2}{W}{W} -type=Legendary Creature -subtype=Angel Horror -power=4 -toughness=3 -[/card] -[card] name=Give // Take text=Put three +1/+1 counters on target creature. -- // -- Remove all +1/+1 counters from target creature you control. Draw that many cards. -- -- Fuse (You may cast one or both halves of this card from your hand.) mana={2}{G} // {2}{U} @@ -6828,12 +6760,6 @@ power=1 toughness=1 [/card] [card] -name=Glittering Wish -text=You may choose a multicolored card you own from outside the game, reveal that card, and put it into your hand. Exile Glittering Wish. -mana={G}{W} -type=Sorcery -[/card] -[card] name=Global Ruin text=Each player chooses from the lands he or she controls a land of each basic land type, then sacrifices the rest. mana={4}{W} @@ -7045,15 +6971,6 @@ power=1 toughness=1 [/card] [card] -name=Goblin Spy -text=Play with the top card of your library revealed. -mana={R} -type=Creature -subtype=Goblin Rogue -power=1 -toughness=1 -[/card] -[card] name=Goblin Test Pilot abilities=flying text=Flying -- {T}: Goblin Test Pilot deals 2 damage to target creature or player chosen at random. @@ -7092,12 +7009,6 @@ type=Legendary Artifact subtype=Equipment [/card] [card] -name=Golden Wish -text=You may choose an artifact or enchantment card you own from outside the game, reveal that card, and put it into your hand. Exile Golden Wish. -mana={3}{W}{W} -type=Sorcery -[/card] -[card] name=Goldenhide Ox text=Constellation — Whenever Goldenhide Ox or another enchantment enters the battlefield under your control, target creature must be blocked this turn if able. mana={5}{G} @@ -7624,15 +7535,6 @@ type=Artifact subtype=Equipment [/card] [card] -name=Hanweir, the Writhing Township -text=Whenever Hanweir Garrison attacks, put two 1/1 red Human creature tokens onto the battlefield tapped and attacking. -- (Melds with Hanweir Battlements.) -mana={2}{R} -type=Creature -subtype=Human Soldier -power=2 -toughness=3 -[/card] -[card] name=Harbinger of the Tides text=You may cast Harbinger of the Tides as though it had flash if you pay {2} more to cast it. (You may cast it any time you could cast an instant.) -- When Harbinger of the Tides enters the battlefield, you may return target tapped creature an opponent controls to its owner's hand. mana={U}{U} @@ -9828,12 +9730,6 @@ mana={1}{R}{R} type=World Enchantment [/card] [card] -name=Lantern of Insight -text=Each player plays with the top card of his or her library revealed. -- {T}, Sacrifice Lantern of Insight: Target player shuffles his or her library. -mana={1} -type=Artifact -[/card] -[card] name=Laquatus's Disdain text=Counter target spell cast from a graveyard. -- Draw a card. mana={1}{U} @@ -10230,12 +10126,6 @@ power=* toughness=* [/card] [card] -name=Living Wish -text=You may choose a creature or land card you own from outside the game, reveal that card, and put it into your hand. Exile Living Wish. -mana={1}{G} -type=Sorcery -[/card] -[card] name=Loafing Giant text=Whenever Loafing Giant attacks or blocks, put the top card of your library into your graveyard. If that card is a land card, prevent all combat damage Loafing Giant would deal this turn. mana={4}{R} @@ -10468,15 +10358,6 @@ power=5 toughness=5 [/card] [card] -name=Magus of the Future -text=Play with the top card of your library revealed. -- You may play the top card of your library. -mana={2}{U}{U}{U} -type=Creature -subtype=Human Wizard -power=2 -toughness=3 -[/card] -[card] name=Magus of the Scroll text={3}, {T}: Name a card. Reveal a card at random from your hand. If it's the named card, Magus of the Scroll deals 2 damage to target creature or player. mana={R} @@ -10854,15 +10735,6 @@ mana={4}{R} type=Instant [/card] [card] -name=Melek, Izzet Paragon -text=Play with the top card of your library revealed. -- You may cast the top card of your library if it's an instant or sorcery card. -- Whenever you cast an instant or sorcery spell from your library, copy it. You may choose new targets for the copy. -mana={4}{U}{R} -type=Legendary Creature -subtype=Weird Wizard -power=2 -toughness=4 -[/card] -[card] name=Meletis Charlatan text={2}{U}, {T}: The controller of target instant or sorcery spell copies it. That player may choose new targets for the copy. mana={2}{U} @@ -11511,15 +11383,6 @@ power=3 toughness=3 [/card] [card] -name=Mul Daya Channelers -text=Play with the top card of your library revealed. -- As long as the top card of your library is a creature card, Mul Daya Channelers gets +3/+3. -- As long as the top card of your library is a land card, Mul Daya Channelers has "{T}: Add two mana of any one color to your mana pool." -mana={1}{G}{G} -type=Creature -subtype=Elf Druid Shaman -power=2 -toughness=2 -[/card] -[card] name=Multani's Presence text=Whenever a spell you've cast is countered, draw a card. mana={G} @@ -12475,15 +12338,6 @@ power=3 toughness=1 [/card] [card] -name=Oracle of Mul Daya -text=You may play an additional land on each of your turns. -- Play with the top card of your library revealed. -- You may play the top card of your library if it's a land card. -mana={3}{G} -type=Creature -subtype=Elf Shaman -power=2 -toughness=2 -[/card] -[card] name=Oracle's Attendants text={T}: All damage that would be dealt to target creature this turn by a source of your choice is dealt to Oracle's Attendants instead. mana={3}{W} @@ -18201,12 +18055,6 @@ power=3 toughness=3 [/card] [card] -name=Temporal Aperture -text={5}, {T}: Shuffle your library, then reveal the top card. Until end of turn, for as long as that card remains on top of your library, play with the top card of your library revealed and you may play that card without paying its mana cost. (If it has X in its mana cost, X is 0.) -mana={2} -type=Artifact -[/card] -[card] name=Temporal Extortion text=When you cast Temporal Extortion, any player may pay half his or her life, rounded up. If a player does, counter Temporal Extortion. -- Take an extra turn after this one. mana={B}{B}{B}{B} @@ -19380,15 +19228,6 @@ mana={W} type=Instant [/card] [card] -name=Vampire Nocturnus -text=Play with the top card of your library revealed. -- As long as the top card of your library is black, Vampire Nocturnus and other Vampire creatures you control get +2/+1 and have flying. -mana={1}{B}{B}{B} -type=Creature -subtype=Vampire -power=3 -toughness=3 -[/card] -[card] name=Vandalize text=Choose one or both — -- • Destroy target artifact. -- • Destroy target land. mana={4}{R} diff --git a/projects/mtg/src/GuiStatic.cpp b/projects/mtg/src/GuiStatic.cpp index 9639f3b7f..6b1ee99e0 100644 --- a/projects/mtg/src/GuiStatic.cpp +++ b/projects/mtg/src/GuiStatic.cpp @@ -134,7 +134,7 @@ void GuiAvatar::Render() } //poison char poison[10]; - if (poisonCount >= 0) + if (poisonCount > 0) { sprintf(poison, "%i", poisonCount); switch (corner) @@ -151,7 +151,7 @@ void GuiAvatar::Render() } //energy char energy[15]; - if (energyCount >= 0) + if (energyCount > 0) { sprintf(energy, "%i", energyCount); switch (corner) diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index a2a333d14..28d9007cf 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -432,13 +432,14 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe MTGGameZone * grave = checkCurrent->game->graveyard; int checkTypesAmount = 0; - if(grave->hasType("creature")) checkTypesAmount++; + if (grave->hasType("creature")) checkTypesAmount++; if (grave->hasType("enchantment")) checkTypesAmount++; if (grave->hasType("sorcery")) checkTypesAmount++; if (grave->hasType("instant")) checkTypesAmount++; if (grave->hasType("land")) checkTypesAmount++; if (grave->hasType("artifact")) checkTypesAmount++; if (grave->hasType("planeswalker")) checkTypesAmount++; + if (grave->hasType("tribal")) checkTypesAmount++; if (checkTypesAmount < 4) return 0; } @@ -450,13 +451,14 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe MTGGameZone * grave = checkCurrent->game->graveyard; int checkTypesAmount = 0; - if(grave->hasType("creature")) checkTypesAmount++; + if (grave->hasType("creature")) checkTypesAmount++; if (grave->hasType("enchantment")) checkTypesAmount++; if (grave->hasType("sorcery")) checkTypesAmount++; if (grave->hasType("instant")) checkTypesAmount++; if (grave->hasType("land")) checkTypesAmount++; if (grave->hasType("artifact")) checkTypesAmount++; if (grave->hasType("planeswalker")) checkTypesAmount++; + if (grave->hasType("tribal")) checkTypesAmount++; if (checkTypesAmount > 3) return 0; } diff --git a/projects/mtg/src/MTGDeck.cpp b/projects/mtg/src/MTGDeck.cpp index 83c9c8bd7..7dd645ff5 100644 --- a/projects/mtg/src/MTGDeck.cpp +++ b/projects/mtg/src/MTGDeck.cpp @@ -1219,7 +1219,12 @@ int MTGDeck::save(const string& destFileName, bool useExpandedDescriptions, cons void MTGDeck::printDetailedDeckText(std::ofstream& file ) { ostringstream currentCard, creatures, lands, spells, types; - map::iterator it; + ostringstream ss_creatures, ss_lands, ss_spells; + int numberOfCreatures = 0; + int numberOfSpells = 0; + int numberOfLands = 0; + + map::iterator it; for (it = cards.begin(); it != cards.end(); it++) { int cardId = it->first; @@ -1266,17 +1271,31 @@ void MTGDeck::printDetailedDeckText(std::ofstream& file ) currentCard <data->isLand() ) + { lands<< currentCard.str(); + numberOfLands+=nbCards; + } else if ( card->data->isCreature() ) + { creatures << currentCard.str(); - else + numberOfCreatures+=nbCards; + } + else + { spells << currentCard.str(); + numberOfSpells+=nbCards; + } currentCard.str(""); } - file << getCardBlockText( "Creatures", creatures.str() ) << endl; - file << getCardBlockText( "Spells", spells.str() ) << endl; - file << getCardBlockText( "Lands", lands.str() ) << endl; + ss_creatures << numberOfCreatures; + ss_spells << numberOfSpells; + ss_lands << numberOfLands; + + file << getCardBlockText( "Creatures x " + ss_creatures.str(), creatures.str() ) << endl; + file << getCardBlockText( "Spells x " + ss_spells.str(), spells.str() ) << endl; + file << getCardBlockText( "Lands x " + ss_lands.str(), lands.str() ) << endl; creatures.str(""); spells.str(""); lands.str("");