diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index a8621c37f..2c18a7638 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -282,7 +282,26 @@ int AACounter::resolve() const char* AACounter::getMenuText() { - return "Counter"; + + if(name.size()){ + string s = name; + if(power == 0 && toughness == 0) + { + if( nb != 1) sprintf(menuText, "%s Counter:%i", s.c_str(),nb); + else sprintf(menuText, "%s Counter", s.c_str(),nb); + } + else + { + if( nb != 1) sprintf(menuText, "%i/%i %s Counter:%i",power,toughness, s.c_str(),nb); + else sprintf(menuText, "%i/%i %s Counter",power,toughness, s.c_str(),nb); + } + } + else + { + if(nb != 1) sprintf(menuText, "%i/%i Counter:%i",power,toughness,nb); + else sprintf(menuText, "%i/%i Counter",power,toughness,nb); + } + return menuText; } AACounter * AACounter::clone() const diff --git a/projects/mtg/src/Counters.cpp b/projects/mtg/src/Counters.cpp index f98372251..1814203bc 100644 --- a/projects/mtg/src/Counters.cpp +++ b/projects/mtg/src/Counters.cpp @@ -72,7 +72,7 @@ Counters::~Counters() int Counters::addCounter(const char * _name, int _power, int _toughness) { - for (int i = 0; i < mCount; i++) + /* for (int i = 0; i < mCount; i++) { if (counters[i]->cancels(_power, _toughness) && counters[i]->nb > 0) { @@ -80,7 +80,15 @@ int Counters::addCounter(const char * _name, int _power, int _toughness) counters[i]->nb--; return mCount; } - } + }*/ + //leaving this commented out incase it was placed here to avoid some bug(maybe a misunderstanding of how counters work in MTG) + //bug fix, creatures that have abilities based on +1/+1 counters should still be allowed to use their counter + //putting a -1/-1 counter is not the same thing as removing a 1/1 counter. + //consider this effect, put a 1/1 counter on creature, then put a - 1/-1 counter on creature. it never saids + //remove the counter 1/1, it saids put a NEW counter -1/-1. + //the card should have both a 1/1 and a -1/-1 counter at this point. + //if an effect states that it should take off the counters, then it should be done with the following code + //counter(1/1,-1) this is removel of 1/1 counters. judging by the primitives its fully understood as i see this method being used often. for (int i = 0; i < mCount; i++) { diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 40b386dfc..805341148 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -1315,7 +1315,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG } //Damage - found = s.find("damage"); + found = s.find("damage:"); if (found != string::npos) { size_t start = s.find(":", found); @@ -1387,7 +1387,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG return a; } //set life total - found = s.find("lifeset"); + found = s.find("lifeset:"); if (found != string::npos) { size_t start = s.find(":", found);