aura parent
This commit is contained in:
@@ -48,6 +48,13 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
||||
return NEW CardTargetChooser(observer, target, card);
|
||||
};
|
||||
|
||||
found = s.find("mychild");
|
||||
if (found == 0)
|
||||
{
|
||||
int maxtargets = 1;
|
||||
return NEW ChildrenChooser(observer, card, maxtargets);
|
||||
};
|
||||
|
||||
found = s.find("targetedplayer");
|
||||
if (found == 0)
|
||||
{
|
||||
@@ -2015,3 +2022,42 @@ ParentChildChooser::~ParentChildChooser()
|
||||
{
|
||||
SAFE_DELETE(deeperTargeting);
|
||||
}
|
||||
|
||||
//child only
|
||||
bool ChildrenChooser::canTarget(Targetable * target,bool withoutProtections)
|
||||
{
|
||||
if (MTGCardInstance * card = dynamic_cast<MTGCardInstance*>(target))
|
||||
{
|
||||
if(card == source)
|
||||
return false;
|
||||
if(!card->isInPlay(observer))
|
||||
return false;
|
||||
if(card->auraParent)
|
||||
{
|
||||
if(card->auraParent == source)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
ChildrenChooser* ChildrenChooser::clone() const
|
||||
{
|
||||
ChildrenChooser * a = NEW ChildrenChooser(*this);
|
||||
return a;
|
||||
}
|
||||
|
||||
bool ChildrenChooser::equals(TargetChooser * tc)
|
||||
{
|
||||
|
||||
ChildrenChooser * dtc = dynamic_cast<ChildrenChooser *> (tc);
|
||||
if (!dtc)
|
||||
return false;
|
||||
|
||||
return TypeTargetChooser::equals(tc);
|
||||
}
|
||||
|
||||
ChildrenChooser::~ChildrenChooser()
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user