Imprint
todo others...
This commit is contained in:
@@ -2927,8 +2927,8 @@ AInstantCastRestrictionUEOT::~AInstantCastRestrictionUEOT()
|
||||
|
||||
|
||||
//AAMover
|
||||
AAMover::AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string newName, ManaCost * _cost, bool undying, bool persist) :
|
||||
ActivatedAbility(observer, _id, _source, _cost, 0), destination(dest),named(newName),undying(undying),persist(persist)
|
||||
AAMover::AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string newName, ManaCost * _cost, bool undying, bool persist, bool imprint) :
|
||||
ActivatedAbility(observer, _id, _source, _cost, 0), destination(dest),named(newName),undying(undying),persist(persist),imprint(imprint)
|
||||
{
|
||||
if (_target)
|
||||
target = _target;
|
||||
@@ -2986,6 +2986,8 @@ int AAMover::resolve()
|
||||
p->game->putInZone(_target, fromZone, destZone);
|
||||
while(_target->next)
|
||||
_target = _target->next;
|
||||
if (imprint)
|
||||
source->imprintedCards.push_back(_target);
|
||||
if(andAbility)
|
||||
{
|
||||
MTGAbility * andAbilityClone = andAbility->clone();
|
||||
@@ -3062,6 +3064,8 @@ const char* AAMover::getMenuText(TargetChooser * tc)
|
||||
// move card into exile
|
||||
else if (dest == game->players[i]->game->exile)
|
||||
{
|
||||
if(imprint)
|
||||
return "Imprint";
|
||||
return "Exile";
|
||||
}
|
||||
|
||||
|
||||
@@ -687,6 +687,46 @@ void GameObserver::gameStateBasedEffects()
|
||||
card->myPair->myPair = NULL;
|
||||
card->myPair = NULL;
|
||||
}
|
||||
///clear imprints
|
||||
if(isInPlay(card) && card->imprintedCards.size())
|
||||
{
|
||||
for(size_t ic = 0; ic < card->imprintedCards.size(); ic++)
|
||||
{
|
||||
if(!isInExile(card->imprintedCards[ic]))
|
||||
card->imprintedCards.erase(card->imprintedCards.begin() + ic);
|
||||
}
|
||||
}
|
||||
//reset imprints
|
||||
if(isInPlay(card))
|
||||
{
|
||||
card->imprintG = 0;
|
||||
card->imprintU = 0;
|
||||
card->imprintR = 0;
|
||||
card->imprintB = 0;
|
||||
card->imprintW = 0;
|
||||
card->currentimprintName = "";
|
||||
if (card->imprintedCards.size())
|
||||
{
|
||||
for(size_t i = 0; i < card->imprintedCards.size(); i++)
|
||||
{
|
||||
if (card->imprintedCards[i]->hasColor(Constants::MTG_COLOR_GREEN))
|
||||
card->imprintG += 1;
|
||||
if (card->imprintedCards[i]->hasColor(Constants::MTG_COLOR_BLUE))
|
||||
card->imprintU += 1;
|
||||
if (card->imprintedCards[i]->hasColor(Constants::MTG_COLOR_RED))
|
||||
card->imprintR += 1;
|
||||
if (card->imprintedCards[i]->hasColor(Constants::MTG_COLOR_BLACK))
|
||||
card->imprintB += 1;
|
||||
if (card->imprintedCards[i]->hasColor(Constants::MTG_COLOR_WHITE))
|
||||
card->imprintW += 1;
|
||||
if (card->imprintedCards[i]->getName().size())
|
||||
{
|
||||
card->currentimprintName = card->imprintedCards[i]->getName();
|
||||
card->imprintedNames.push_back(card->imprintedCards[i]->getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
card->bypassTC = false; //turn off bypass
|
||||
////////////////////////////////////////////////////
|
||||
//Unattach Equipments that dont have valid targets//
|
||||
|
||||
@@ -2361,6 +2361,15 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
}
|
||||
|
||||
//imprint
|
||||
found = s.find("imprint");
|
||||
if (found != string::npos)
|
||||
{
|
||||
MTGAbility * a = NEW AAMover(observer, id, card, target, "exile",newName,NULL,false,false,true);
|
||||
a->oneShot = 1;
|
||||
return a;
|
||||
}
|
||||
|
||||
//phaseout
|
||||
found = s.find("phaseout");
|
||||
if (found != string::npos)
|
||||
{
|
||||
|
||||
@@ -206,6 +206,14 @@ void MTGCardInstance::initMTGCI()
|
||||
myPair = NULL;
|
||||
miracle = false;
|
||||
countTrini = 0;
|
||||
imprintedCards.clear();
|
||||
imprintG = 0;
|
||||
imprintU = 0;
|
||||
imprintR = 0;
|
||||
imprintB = 0;
|
||||
imprintW = 0;
|
||||
currentimprintName = "";
|
||||
imprintedNames.clear();
|
||||
|
||||
for (int i = 0; i < ManaCost::MANA_PAID_WITH_SUSPEND +1; i++)
|
||||
alternateCostPaid[i] = 0;
|
||||
|
||||
Reference in New Issue
Block a user