Update unsuported cards, set a condition for showing poison counters and energy counter, added tribal al card type check, show the amount o

This commit is contained in:
punkeduard
2017-08-02 18:42:52 -05:00
parent b0506bcd96
commit c805a58fb0
4 changed files with 31 additions and 171 deletions
+2 -2
View File
@@ -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)
+4 -2
View File
@@ -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;
}
+24 -5
View File
@@ -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<int, int>::iterator it;
ostringstream ss_creatures, ss_lands, ss_spells;
int numberOfCreatures = 0;
int numberOfSpells = 0;
int numberOfLands = 0;
map<int, int>::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 <<endl;
setInfo = NULL;
// Add counter to know number of creatures, non-creature spells and lands present in the deck
if ( card->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("");