Added feature to allow some cards to copy and flip back at the end of turn, added feature to use type: keyword with chosentype and chosencolor combo, fixed crashes on "can play land" restriction, fixed land primitives with pay life or tap condition to avoid crashes.

This commit is contained in:
Vittorio Alfieri
2020-12-23 12:39:18 +01:00
parent d40d6f319e
commit 0ca310da54
7 changed files with 197 additions and 209 deletions
+4 -4
View File
@@ -3995,8 +3995,8 @@ AAMeld * AAMeld::clone() const
}
// flip a card
AAFlip::AAFlip(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,string flipStats, bool isflipcard, bool forcedcopy, string forcetype) :
InstantAbility(observer, id, card, _target),flipStats(flipStats),isflipcard(isflipcard),forcedcopy(forcedcopy),forcetype(forcetype)
AAFlip::AAFlip(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,string flipStats, bool isflipcard, bool forcedcopy, string forcetype, bool backfromcopy) :
InstantAbility(observer, id, card, _target),flipStats(flipStats),isflipcard(isflipcard),forcedcopy(forcedcopy),forcetype(forcetype),backfromcopy(backfromcopy)
{
target = _target;
}
@@ -4016,7 +4016,7 @@ int AAFlip::resolve()
if (_target)
{
if(_target->mutation && _target->parentCards.size() > 0) return 0; // Mutated down cards cannot be flipped, they will follow the fate of top-card
if(((_target->isACopier||_target->isToken) && !isflipcard) || _target->has(Constants::CANTTRANSFORM))
if(((_target->isACopier||_target->isToken) && !isflipcard && !backfromcopy) || _target->has(Constants::CANTTRANSFORM))
{
game->removeObserver(this);
return 0;
@@ -4166,7 +4166,7 @@ int AAFlip::resolve()
}
SAFE_DELETE(myFlip);
_target->mPropertiesChangedSinceLastUpdate = true;
if(!isflipcard)
if(!isflipcard && !backfromcopy)
{
if(_target->isFacedown)
_target->isFacedown = false;