added new functionality to AAMover...
you can now do moveto(targetzone) and((ability)) moveto(mybatlefield) and((transforms((zombie,black)) forever))
This commit is contained in:
@@ -984,13 +984,14 @@ class AAMover: public ActivatedAbility
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
string destination;
|
string destination;
|
||||||
|
MTGAbility * andAbility;
|
||||||
AAMover(int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest, ManaCost * _cost = NULL);
|
AAMover(int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest, ManaCost * _cost = NULL);
|
||||||
MTGGameZone * destinationZone(Targetable * target = NULL);
|
MTGGameZone * destinationZone(Targetable * target = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
const char * getMenuText(TargetChooser * fromTc);
|
const char * getMenuText(TargetChooser * fromTc);
|
||||||
AAMover * clone() const;
|
AAMover * clone() const;
|
||||||
|
~AAMover();
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -1781,6 +1781,7 @@ AAMover::AAMover(int _id, MTGCardInstance * _source, MTGCardInstance * _target,
|
|||||||
{
|
{
|
||||||
if (_target)
|
if (_target)
|
||||||
target = _target;
|
target = _target;
|
||||||
|
andAbility = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
MTGGameZone * AAMover::destinationZone(Targetable * target)
|
MTGGameZone * AAMover::destinationZone(Targetable * target)
|
||||||
@@ -1810,11 +1811,39 @@ int AAMover::resolve()
|
|||||||
MTGCardInstance * copy = g->players[i]->game->putInZone(_target, fromZone, g->players[i]->game->temp);
|
MTGCardInstance * copy = g->players[i]->game->putInZone(_target, fromZone, g->players[i]->game->temp);
|
||||||
Spell * spell = NEW Spell(copy);
|
Spell * spell = NEW Spell(copy);
|
||||||
spell->resolve();
|
spell->resolve();
|
||||||
|
if(andAbility)
|
||||||
|
{
|
||||||
|
MTGAbility * andAbilityClone = andAbility->clone();
|
||||||
|
andAbilityClone->target = spell->source;
|
||||||
|
if(andAbility->oneShot)
|
||||||
|
{
|
||||||
|
andAbilityClone->resolve();
|
||||||
|
SAFE_DELETE(andAbilityClone);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
andAbilityClone->addToGame();
|
||||||
|
}
|
||||||
|
}
|
||||||
delete spell;
|
delete spell;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p->game->putInZone(_target, fromZone, destZone);
|
p->game->putInZone(_target, fromZone, destZone);
|
||||||
|
if(andAbility)
|
||||||
|
{
|
||||||
|
MTGAbility * andAbilityClone = andAbility->clone();
|
||||||
|
andAbilityClone->target = _target;
|
||||||
|
if(andAbility->oneShot)
|
||||||
|
{
|
||||||
|
andAbilityClone->resolve();
|
||||||
|
SAFE_DELETE(andAbilityClone);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
andAbilityClone->addToGame();
|
||||||
|
}
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1889,7 +1918,15 @@ const char * AAMover::getMenuText(TargetChooser * tc)
|
|||||||
|
|
||||||
AAMover * AAMover::clone() const
|
AAMover * AAMover::clone() const
|
||||||
{
|
{
|
||||||
return NEW AAMover(*this);
|
AAMover * a = NEW AAMover(*this);
|
||||||
|
if(andAbility)
|
||||||
|
a->andAbility = andAbility->clone();
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
AAMover::~AAMover()
|
||||||
|
{
|
||||||
|
SAFE_DELETE(andAbility);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Random Discard
|
//Random Discard
|
||||||
|
|||||||
@@ -1542,6 +1542,14 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
|
|
||||||
MTGAbility * a = NEW AAMover(id, card, target, splitMove[1]);
|
MTGAbility * a = NEW AAMover(id, card, target, splitMove[1]);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
|
if(s.find("and(") != string::npos)
|
||||||
|
{
|
||||||
|
vector<string> splitAnd = parseBetween(s, "and((", "))");
|
||||||
|
if(splitAnd.size())
|
||||||
|
{
|
||||||
|
((AAMover*)a)->andAbility = parseMagicLine(splitAnd[1], id, spell, card);
|
||||||
|
}
|
||||||
|
}
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user