diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 01d3f88c7..68e264bf7 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -3910,9 +3910,10 @@ public: class ACounterShroud: public MTGAbility { public: + TargetChooser * csTc; Counter * counter; RECountersPrevention * re; - ACounterShroud(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, Counter * counter = NULL); + ACounterShroud(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target,TargetChooser * tc, Counter * counter = NULL); int addToGame(); int destroy(); ACounterShroud * clone() const; diff --git a/projects/mtg/include/ReplacementEffects.h b/projects/mtg/include/ReplacementEffects.h index a1986fa3c..7a26caf9e 100644 --- a/projects/mtg/include/ReplacementEffects.h +++ b/projects/mtg/include/ReplacementEffects.h @@ -42,9 +42,10 @@ protected: MTGAbility * source; MTGCardInstance * cardSource; MTGCardInstance * cardTarget; + TargetChooser * TargetingCards; Counter * counter; public: - RECountersPrevention(MTGAbility * _source,MTGCardInstance * cardSource = NULL,MTGCardInstance * cardTarget = NULL,Counter * counter = NULL); + RECountersPrevention(MTGAbility * _source,MTGCardInstance * cardSource = NULL,MTGCardInstance * cardTarget = NULL,TargetChooser * tc = NULL,Counter * counter = NULL); WEvent * replace(WEvent *e); ~RECountersPrevention(); }; diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 3a5a896b4..15b12f1d7 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -538,15 +538,15 @@ AACounter * AACounter::clone() const } //shield a card from a certain type of counter. -ACounterShroud::ACounterShroud(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, Counter * counter) : -MTGAbility(observer, id, source),counter(counter),re(NULL) +ACounterShroud::ACounterShroud(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target,TargetChooser * tc, Counter * counter) : +MTGAbility(observer, id, source),csTc(tc),counter(counter),re(NULL) { } int ACounterShroud::addToGame() { SAFE_DELETE(re); - re = NEW RECountersPrevention(this,source,(MTGCardInstance*)target,counter); + re = NEW RECountersPrevention(this,source,(MTGCardInstance*)target,csTc,counter); if (re) { game->replacementEffects->add(re); diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 73c3a973d..3b785ed37 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -2330,7 +2330,13 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG return NULL; } } - MTGAbility * a = NEW ACounterShroud(observer, id, card, target,counter); + TargetChooser * csTc = NULL; + if(splitCounterShroud[2].size() > 1) + { + TargetChooserFactory af(card->getObserver()); + csTc = af.createTargetChooser(splitCounterShroud[2],card); + } + MTGAbility * a = NEW ACounterShroud(observer, id, card, target,csTc,counter); return a; } //use counters to track by counters to track an efect by counter name. diff --git a/projects/mtg/src/ReplacementEffects.cpp b/projects/mtg/src/ReplacementEffects.cpp index d99b424d6..0a762e87a 100644 --- a/projects/mtg/src/ReplacementEffects.cpp +++ b/projects/mtg/src/ReplacementEffects.cpp @@ -49,8 +49,8 @@ REDamagePrevention::~REDamagePrevention() SAFE_DELETE(tcTarget); } //counters replacement effect/////////////////// -RECountersPrevention::RECountersPrevention(MTGAbility * source,MTGCardInstance * cardSource,MTGCardInstance * cardTarget,Counter * counter) : - source(source),cardSource(cardSource),cardTarget(cardTarget),counter(counter) +RECountersPrevention::RECountersPrevention(MTGAbility * source,MTGCardInstance * cardSource,MTGCardInstance * cardTarget,TargetChooser * tc,Counter * counter) : + source(source),cardSource(cardSource),cardTarget(cardTarget),TargetingCards(tc),counter(counter) { } @@ -68,12 +68,14 @@ RECountersPrevention::RECountersPrevention(MTGAbility * source,MTGCardInstance * } else if((MTGCardInstance*)e->targetCard == cardSource) return event = NULL; + else if(TargetingCards && TargetingCards->canTarget((MTGCardInstance*)e->targetCard)) + return event = NULL; } return event; } RECountersPrevention::~RECountersPrevention() { - + SAFE_DELETE(TargetingCards); } ////////////////////////////////////////////// ReplacementEffects::ReplacementEffects() diff --git a/projects/mtg/src/WGui.cpp b/projects/mtg/src/WGui.cpp index 2629be237..1c06d6674 100644 --- a/projects/mtg/src/WGui.cpp +++ b/projects/mtg/src/WGui.cpp @@ -2044,7 +2044,7 @@ void WGuiFilterItem::updateValue() SAFE_DELETE(mParent->subMenu); mParent->clearArgs(); mState = STATE_CHOOSE_VAL; - mParent->subMenu = NEW SimpleMenu(JGE::GetInstance(), -1234, this, Fonts::MENU_FONT, 20, 20, "Filter:"); + mParent->subMenu = NEW SimpleMenu(JGE::GetInstance(), -1234, this, Fonts::MAIN_FONT, 20, 20, "Filter:"); if (filterType == FILTER_TYPE) { mParent->addArg("Artifact", "t:Artifact;");