Merge pull request #930 from kevlahnota/master

auto close
This commit is contained in:
Anthony Calosa
2017-02-07 14:08:54 +08:00
committed by GitHub
2 changed files with 6 additions and 12 deletions

View File

@@ -3638,18 +3638,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
a->oneShot = 1; a->oneShot = 1;
a->canBeInterrupted = false; a->canBeInterrupted = false;
a->named = newName; a->named = newName;
/***********do nothing***********/ if(card->getAICustomCode().size() && card->controller()->isAI())
if((card->controller()->isAI() &&
card->controller()->opponent()->isAI())||
!card->getAICustomCode().size())
{
MTGAbility * a2 = parseMagicLine("activate donothing", id, spell, card);
a2->oneShot = 1;
a2->canBeInterrupted = false;
return a2;
}
/*******************************/
else if(card->getAICustomCode().size() && card->controller()->isAI())
{ {
MTGAbility * a3 = parseMagicLine(card->getAICustomCode(), id, spell, card); MTGAbility * a3 = parseMagicLine(card->getAICustomCode(), id, spell, card);
a3->oneShot = 1; a3->oneShot = 1;

View File

@@ -1041,6 +1041,11 @@ int TargetChooser::addTarget(Targetable * target)
if (canTarget(target)) if (canTarget(target))
{ {
TargetsList::addTarget(target); TargetsList::addTarget(target);
#if defined (ANDROID) //auto close... we need to close gui like swipe left...
if (target->getObserver()->guiOpenDisplay && getNbTargets() == maxtargets)
target->getObserver()->ButtonPressed(target->getObserver()->guiOpenDisplay);
#endif//example bug, cast Snapcaster Mage during a spell of opponent and target a Mana Leak..
//how can you cast the Mana Leak? If you can't close the graveyard window to tap for mana???
} }
return targetsReadyCheck(); return targetsReadyCheck();