copy/flip limit
if the copy/flip is activated, it means it's already in the battlefield, so "enters the battlefield" must not trigger...
This commit is contained in:
@@ -119077,8 +119077,7 @@ toughness=4
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
name=Vesuva
|
name=Vesuva
|
||||||
auto=tap(noevent)
|
auto=may copy notatarget(land) and!( tap(noevent) )!
|
||||||
auto=may copy notatarget(land)
|
|
||||||
text=You may have Vesuva enter the battlefield tapped as a copy of any land on the battlefield.
|
text=You may have Vesuva enter the battlefield tapped as a copy of any land on the battlefield.
|
||||||
type=Land
|
type=Land
|
||||||
[/card]
|
[/card]
|
||||||
|
|||||||
@@ -1949,7 +1949,8 @@ class AACopier: public ActivatedAbility
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MTGAbility * andAbility;
|
MTGAbility * andAbility;
|
||||||
AACopier(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL);
|
bool activated;
|
||||||
|
AACopier(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL, bool activated = false);
|
||||||
int resolve();
|
int resolve();
|
||||||
const string getMenuText();
|
const string getMenuText();
|
||||||
AACopier * clone() const;
|
AACopier * clone() const;
|
||||||
@@ -4595,7 +4596,8 @@ public:
|
|||||||
string flipStats;
|
string flipStats;
|
||||||
bool isflipcard;
|
bool isflipcard;
|
||||||
bool forcedcopy;
|
bool forcedcopy;
|
||||||
AAFlip(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,string flipStats, bool isflipcard = false, bool forcedcopy = false);
|
bool activated;
|
||||||
|
AAFlip(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,string flipStats, bool isflipcard = false, bool forcedcopy = false, bool activated = false);
|
||||||
int resolve();
|
int resolve();
|
||||||
int testDestroy();
|
int testDestroy();
|
||||||
const string getMenuText();
|
const string getMenuText();
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ public:
|
|||||||
bool turningOver;
|
bool turningOver;
|
||||||
bool isMorphed;
|
bool isMorphed;
|
||||||
bool isFlipped;
|
bool isFlipped;
|
||||||
|
bool activateCF;
|
||||||
string MeldedFrom;
|
string MeldedFrom;
|
||||||
bool isPhased;
|
bool isPhased;
|
||||||
bool isCascaded;
|
bool isCascaded;
|
||||||
|
|||||||
@@ -1449,11 +1449,12 @@ AALibraryBottom * AALibraryBottom::clone() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
//AACopier
|
//AACopier
|
||||||
AACopier::AACopier(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost) :
|
AACopier::AACopier(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost, bool _activated) :
|
||||||
ActivatedAbility(observer, _id, _source, _cost, 0)
|
ActivatedAbility(observer, _id, _source, _cost, 0)
|
||||||
{
|
{
|
||||||
target = _target;
|
target = _target;
|
||||||
andAbility = NULL;
|
andAbility = NULL;
|
||||||
|
activated = _activated;
|
||||||
}
|
}
|
||||||
|
|
||||||
int AACopier::resolve()
|
int AACopier::resolve()
|
||||||
@@ -1462,6 +1463,7 @@ int AACopier::resolve()
|
|||||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
MTGCardInstance * _target = (MTGCardInstance *) target;
|
||||||
if (_target)
|
if (_target)
|
||||||
{
|
{
|
||||||
|
_target->activateCF = activated;
|
||||||
MTGCard* clone ;
|
MTGCard* clone ;
|
||||||
if(_target->isToken || (_target->isACopier && _target->hasCopiedToken))
|
if(_target->isToken || (_target->isACopier && _target->hasCopiedToken))
|
||||||
{//fix crash when copying token
|
{//fix crash when copying token
|
||||||
@@ -1482,7 +1484,7 @@ int AACopier::resolve()
|
|||||||
* instead of using source->copy(myClone) use *
|
* instead of using source->copy(myClone) use *
|
||||||
* AAFlip with forcedcopy to true *
|
* AAFlip with forcedcopy to true *
|
||||||
*********************************************/
|
*********************************************/
|
||||||
AAFlip * af = NEW AAFlip(game, game->mLayers->actionLayer()->getMaxId(), source, source, clone->data->name, false, true);
|
AAFlip * af = NEW AAFlip(game, game->mLayers->actionLayer()->getMaxId(), source, source, clone->data->name, false, true, activated);
|
||||||
af->oneShot = 1;
|
af->oneShot = 1;
|
||||||
af->canBeInterrupted = false;
|
af->canBeInterrupted = false;
|
||||||
af->resolve();
|
af->resolve();
|
||||||
@@ -1532,6 +1534,7 @@ int AACopier::resolve()
|
|||||||
andAbilityClone->addToGame();
|
andAbilityClone->addToGame();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_target->activateCF = false;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1653,7 +1656,7 @@ AACounter::AACounter(GameObserver* observer, int id, MTGCardInstance * source, M
|
|||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
MTGCardInstance * _target = (MTGCardInstance *) target;
|
||||||
if(_target->isFlipped && _target->hasType(Subtypes::TYPE_PLANESWALKER))//is flipping pw
|
if(_target->isFlipped && (_target->activateCF || _target->hasType(Subtypes::TYPE_PLANESWALKER)))//is flipping && activated flip or activated copy or Planeswalker
|
||||||
{
|
{
|
||||||
this->forceDestroy = 1;
|
this->forceDestroy = 1;
|
||||||
return 0;
|
return 0;
|
||||||
@@ -3204,10 +3207,11 @@ AAMeld * AAMeld::clone() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// flip a card
|
// flip a card
|
||||||
AAFlip::AAFlip(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,string flipStats, bool isflipcard, bool forcedcopy) :
|
AAFlip::AAFlip(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,string flipStats, bool isflipcard, bool forcedcopy, bool _activated) :
|
||||||
InstantAbility(observer, id, card, _target),flipStats(flipStats),isflipcard(isflipcard),forcedcopy(forcedcopy)
|
InstantAbility(observer, id, card, _target),flipStats(flipStats),isflipcard(isflipcard),forcedcopy(forcedcopy)
|
||||||
{
|
{
|
||||||
target = _target;
|
target = _target;
|
||||||
|
activated = _activated;
|
||||||
}
|
}
|
||||||
|
|
||||||
int AAFlip::resolve()
|
int AAFlip::resolve()
|
||||||
@@ -3239,6 +3243,7 @@ int AAFlip::resolve()
|
|||||||
|
|
||||||
AbilityFactory af(game);
|
AbilityFactory af(game);
|
||||||
_target->isFlipped = true;
|
_target->isFlipped = true;
|
||||||
|
_target->activateCF = activated;
|
||||||
GameObserver * game = _target->getObserver();
|
GameObserver * game = _target->getObserver();
|
||||||
if(flipStats.size())
|
if(flipStats.size())
|
||||||
{
|
{
|
||||||
@@ -3286,7 +3291,8 @@ int AAFlip::resolve()
|
|||||||
{
|
{
|
||||||
if (a->oneShot)
|
if (a->oneShot)
|
||||||
{
|
{
|
||||||
a->resolve();
|
if(!activated)
|
||||||
|
a->resolve();
|
||||||
SAFE_DELETE(a);
|
SAFE_DELETE(a);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -3368,6 +3374,7 @@ int AAFlip::testDestroy()
|
|||||||
//originally added as a safegaurd to insure the ability was removed
|
//originally added as a safegaurd to insure the ability was removed
|
||||||
//it's been so long and so much has changed that it appears to do nothing but cause a crash now
|
//it's been so long and so much has changed that it appears to do nothing but cause a crash now
|
||||||
_target->isFlipped = false;
|
_target->isFlipped = false;
|
||||||
|
_target->activateCF = false;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ GuiAvatars::GuiAvatars(DuelLayers* duelLayers) :
|
|||||||
{
|
{
|
||||||
Add(self = NEW GuiAvatar(SCREEN_WIDTH, SCREEN_HEIGHT, false, mpDuelLayers->getRenderedPlayer(), GuiAvatar::BOTTOM_RIGHT, this));
|
Add(self = NEW GuiAvatar(SCREEN_WIDTH, SCREEN_HEIGHT, false, mpDuelLayers->getRenderedPlayer(), GuiAvatar::BOTTOM_RIGHT, this));
|
||||||
self->zoom = 0.9f;
|
self->zoom = 0.9f;
|
||||||
Add(selfGraveyard = NEW GuiGraveyard(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 - 11, SCREEN_HEIGHT - GuiAvatar::Height - 1, false, mpDuelLayers->getRenderedPlayer(), this));
|
Add(selfGraveyard = NEW GuiGraveyard(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 - 11, SCREEN_HEIGHT - GuiAvatar::Height - 7, false, mpDuelLayers->getRenderedPlayer(), this));
|
||||||
Add(selfLibrary = NEW GuiLibrary(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 - 11, SCREEN_HEIGHT - GuiAvatar::Height - 5 + GuiGameZone::Height + 5, false, mpDuelLayers->getRenderedPlayer(), this));
|
Add(selfLibrary = NEW GuiLibrary(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 - 11, SCREEN_HEIGHT - GuiAvatar::Height - 10 + GuiGameZone::Height + 5, false, mpDuelLayers->getRenderedPlayer(), this));
|
||||||
//myexile
|
//myexile
|
||||||
Add(selfExile = NEW GuiExile(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 - 11, SCREEN_HEIGHT - GuiAvatar::Height - 30, false, mpDuelLayers->getRenderedPlayer(), this));
|
Add(selfExile = NEW GuiExile(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 - 11, SCREEN_HEIGHT - GuiAvatar::Height - 34, false, mpDuelLayers->getRenderedPlayer(), this));
|
||||||
|
|
||||||
Add(opponent = NEW GuiAvatar(0, 0, false, mpDuelLayers->getRenderedPlayerOpponent(), GuiAvatar::TOP_LEFT, this));
|
Add(opponent = NEW GuiAvatar(0, 0, false, mpDuelLayers->getRenderedPlayerOpponent(), GuiAvatar::TOP_LEFT, this));
|
||||||
opponent->zoom = 0.9f;
|
opponent->zoom = 0.9f;
|
||||||
|
|||||||
@@ -2547,6 +2547,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
MTGAbility * a = NEW AACopier(observer, id, card, target);
|
MTGAbility * a = NEW AACopier(observer, id, card, target);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
a->canBeInterrupted = false;
|
a->canBeInterrupted = false;
|
||||||
|
((AACopier*)a)->activated = activated;
|
||||||
//andability
|
//andability
|
||||||
if(storedAndAbility.size())
|
if(storedAndAbility.size())
|
||||||
{
|
{
|
||||||
@@ -3393,12 +3394,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
}
|
}
|
||||||
if(card->getdoubleFaced() == "kamiflip")
|
if(card->getdoubleFaced() == "kamiflip")
|
||||||
{//old flip cards kamigawa
|
{//old flip cards kamigawa
|
||||||
MTGAbility * a = NEW AAFlip(observer, id, card, target,flipStats,true);
|
MTGAbility * a = NEW AAFlip(observer, id, card, target,flipStats,true,false,activated);
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
else//regular transform
|
else//regular transform
|
||||||
{
|
{
|
||||||
MTGAbility * a = NEW AAFlip(observer, id, card, target,flipStats);
|
MTGAbility * a = NEW AAFlip(observer, id, card, target,flipStats,false,false,activated);
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,6 +195,7 @@ void MTGCardInstance::initMTGCI()
|
|||||||
isMorphed = false;
|
isMorphed = false;
|
||||||
MeldedFrom = "";
|
MeldedFrom = "";
|
||||||
isFlipped = false;
|
isFlipped = false;
|
||||||
|
activateCF = false;
|
||||||
isPhased = false;
|
isPhased = false;
|
||||||
isCascaded = false;
|
isCascaded = false;
|
||||||
phasedTurn = -1;
|
phasedTurn = -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user