From 037b5c3598760457838b0e6dcb69b64d2b7d26a0 Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Tue, 19 Oct 2010 19:26:46 +0000 Subject: [PATCH] corrected an issue where basicability modifier was not returning the name but "ability instead..did minor correctsions to some Substr values. --- projects/mtg/include/AllAbilities.h | 6 ++++++ projects/mtg/src/MTGAbility.cpp | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index ee707358d..da9407a3c 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -1515,6 +1515,12 @@ public: } } + + const char * getMenuText(){ + return Constants::MTGBasicAbilities[ability]; + } + + virtual ostream& toString(ostream& out) const { out << "ABasicAbilityModifier ::: modifier : " << modifier diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 35ba7fbee..b00b0ad65 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -529,7 +529,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG found = s.find("alternative "); if (found == 0){ if (spell && spell->AlternativeWasPaid()){ - string s1 = s.substr(found+7); + string s1 = s.substr(found+12); return parseMagicLine(s1,id,spell, card); } return NULL; @@ -539,7 +539,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG found = s.find("buyback "); if (found == 0){ if (spell && spell->BuyBackWasPaid()){ - string s1 = s.substr(found+7); + string s1 = s.substr(found+8); return parseMagicLine(s1,id,spell, card); } return NULL; @@ -549,7 +549,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG found = s.find("flashback "); if (found == 0){ if (spell && spell->FlashBackWasPaid()){ - string s1 = s.substr(found+7); + string s1 = s.substr(found+9); return parseMagicLine(s1,id,spell, card); } return NULL; @@ -559,7 +559,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG found = s.find("retrace "); if (found == 0){ if (spell && spell->RetraceWasPaid()){ - string s1 = s.substr(found+7); + string s1 = s.substr(found+8); return parseMagicLine(s1,id,spell, card); } return NULL; @@ -578,7 +578,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG //When...comes into play, choose one... found = s.find("choice "); if (found == 0){ - string s1 = sWithoutTc.substr(found+4); + string s1 = sWithoutTc.substr(found+7); MTGAbility * a1 = parseMagicLine(s1,id,spell, card); if (!a1) return NULL;