diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 8173de892..69686467a 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -13317,6 +13317,18 @@ type=Creature subtype=Faerie Soldier power=3 toughness=2 +[/card] +[card] +name=Feral Hydra +type=Creature +subtype=Hydra Beast +mana={X}{G} +power=0 +toughness=0 +text=Feral Hydra comes into play with X +1/+1 counters on it. -- {3}: Put a +1/+1 counter on Feral Hydra. Any player may play this ability +auto=counter(1/1,X) +auto={3}:counter(1/1) +grade=borderline [/card] [card] name=Feral Animist diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index 5b33103f4..4b976768f 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -1,6 +1,7 @@ ######################## #Generic engine features ######################## +zzz.txt generic/attacks_each_turn.txt generic/cycling.txt generic/cycling2.txt diff --git a/projects/mtg/bin/daily_build/template.exe b/projects/mtg/bin/daily_build/template.exe index f30573451..06199f304 100644 Binary files a/projects/mtg/bin/daily_build/template.exe and b/projects/mtg/bin/daily_build/template.exe differ diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 731d44c4a..e4931684a 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -183,8 +183,8 @@ public: int triggerOnEvent(WEvent * event){ WEventDamage * e = dynamic_cast(event); if (!e) return 0; - if(!tc->canTarget(e->damage->target)) return 0; - if (fromTc && !fromTc->canTarget(e->damage->source)) return 0; + if(!tc->canTarget(e->damage->target)) return 0; + if (fromTc && !fromTc->canTarget(e->damage->source)) return 0; return 1; } diff --git a/projects/mtg/include/MTGAbility.h b/projects/mtg/include/MTGAbility.h index 209541f88..ff4ecf69b 100644 --- a/projects/mtg/include/MTGAbility.h +++ b/projects/mtg/include/MTGAbility.h @@ -256,7 +256,7 @@ class AbilityFactory{ TriggeredAbility * parseTrigger(string s, int id, Spell * spell, MTGCardInstance *card, Targetable * target); int parseRestriction(string s); public: - Counter * parseCounter(string s, MTGCardInstance * target); + Counter * parseCounter(string s, MTGCardInstance * target, Spell * spell = NULL); int parsePowerToughness(string s, int *power, int *toughness); int getAbilities(vector * v, Spell * spell, MTGCardInstance * card = NULL, int id = 0,MTGGameZone * dest = NULL); MTGAbility * parseMagicLine(string s, int id, Spell * spell, MTGCardInstance *card, int activated = 0, int forceUEOT = 0,MTGGameZone * dest = NULL); diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index f787fe845..51b29acc7 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -36,7 +36,7 @@ int AbilityFactory::countCards(TargetChooser * tc, Player * player, int option){ return result; } -Counter * AbilityFactory::parseCounter(string s, MTGCardInstance * target) { +Counter * AbilityFactory::parseCounter(string s, MTGCardInstance * target, Spell * spell) { int nb = 1; string name = ""; size_t start = 0; @@ -50,7 +50,13 @@ Counter * AbilityFactory::parseCounter(string s, MTGCardInstance * target) { name = s.substr(separator2+1,end-separator2-1); } string nbstr = s.substr(separator+1,separator2-separator-1); - nb = atoi(nbstr.c_str()); + WParsedInt * wpi; + if (target){ + wpi = NEW WParsedInt(nbstr,spell,target); + }else{ + wpi = NEW WParsedInt(atoi(nbstr.c_str())); + } + nb = wpi->getValue(); end = separator; } @@ -802,7 +808,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG size_t start = s.find("("); size_t end = s.find(")"); string counterString = s.substr(start+1,end-start-1); - Counter * counter = parseCounter(counterString,target); + Counter * counter = parseCounter(counterString,target,spell); if (counter){ MTGAbility * a = NEW AACounter(id,card,target,counter->name.c_str(),counter->power,counter->toughness,counter->nb); a->oneShot = 1;