diff --git a/projects/mtg/include/MTGAbility.h b/projects/mtg/include/MTGAbility.h index c8290f09d..5f2284931 100644 --- a/projects/mtg/include/MTGAbility.h +++ b/projects/mtg/include/MTGAbility.h @@ -445,6 +445,7 @@ class AbilityFactory { private: string storedString; + string storedAbilityString; string storedAndAbility; int countCards(TargetChooser * tc, Player * player = NULL, int option = 0); TriggeredAbility * parseTrigger(string s, string magicText, int id, Spell * spell, MTGCardInstance *card, Targetable * target); diff --git a/projects/mtg/include/MTGDefinitions.h b/projects/mtg/include/MTGDefinitions.h index 0d55fa954..2995578a8 100644 --- a/projects/mtg/include/MTGDefinitions.h +++ b/projects/mtg/include/MTGDefinitions.h @@ -217,8 +217,9 @@ class Constants NOACTIVATEDTAP = 96, NOMANA = 97, ONLYMANA = 98, + POISONDAMAGER = 99, - NB_BASIC_ABILITIES = 99, + NB_BASIC_ABILITIES = 100, RARITY_S = 'S', //Special Rarity diff --git a/projects/mtg/src/Damage.cpp b/projects/mtg/src/Damage.cpp index 253116aa8..546ad0048 100644 --- a/projects/mtg/src/Damage.cpp +++ b/projects/mtg/src/Damage.cpp @@ -146,7 +146,7 @@ int Damage::resolve() if(_target->toughness <= 0 && _target->has(Constants::INDESTRUCTIBLE)) _target->controller()->game->putInGraveyard(_target); } - else if (target->type_as_damageable == DAMAGEABLE_PLAYER && source->has(Constants::INFECT)) + else if (target->type_as_damageable == DAMAGEABLE_PLAYER && (source->has(Constants::INFECT)||source->has(Constants::POISONDAMAGER))) { // Poison on player Player * _target = (Player *) target; diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 22d1431e6..97b43015c 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -1014,18 +1014,18 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG { size_t real_end = s.find("!$", found); size_t sIndex = found + 9; - storedString.append(s.substr(sIndex, real_end - sIndex).c_str()); + storedAbilityString.append(s.substr(sIndex, real_end - sIndex).c_str()); s.erase(sIndex, real_end - sIndex); } - found = s.find("and(("); + found = s.find("and!("); if (found != string::npos && found + 6 != ')' && storedAndAbility.empty()) { - vector splitAnd = parseBetween(s, "and((", " ))",false); + vector splitAnd = parseBetween(s, "and!(", ")!",false); if(splitAnd.size()) { storedAndAbility.append(splitAnd[1]); - size_t real_end = s.find("))", found); + size_t real_end = s.find(")!", found); size_t sIndex = found + 5; s.erase(sIndex, real_end - sIndex); } @@ -1779,9 +1779,9 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG //ability creator the target has to do the ability. if(s.find("ability$") != string::npos) { - if (storedString.size()) + if (storedAbilityString.size()) { - ATargetedAbilityCreator * abl = NEW ATargetedAbilityCreator(observer, id, card,target, NULL,newName, storedString, who); + ATargetedAbilityCreator * abl = NEW ATargetedAbilityCreator(observer, id, card,target, NULL,newName, storedAbilityString, who); abl->oneShot = 1; storedString.clear(); return abl; diff --git a/projects/mtg/src/MTGDefinitions.cpp b/projects/mtg/src/MTGDefinitions.cpp index 575bdc42d..8765091dd 100644 --- a/projects/mtg/src/MTGDefinitions.cpp +++ b/projects/mtg/src/MTGDefinitions.cpp @@ -127,7 +127,8 @@ const char* Constants::MTGBasicAbilities[] = { "noactivatedability", "notapability", "nomanaability", - "onlymanaability" + "onlymanaability", + "poisondamager"//deals damage to players as poison counters. }; map Constants::MTGBasicAbilitiesMap;