diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 1ebf6e90d..6b8d6142a 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -344,6 +344,18 @@ private: { intValue = target->controller()->handsize; } + else if (s == "controllerturn")//intvalue = 1 if its your turn this(variable{controllerturn}) + { + intValue = 0; + if ( target->controller() == target->getObserver()->currentPlayer) + intValue = 1; + } + else if (s == "opponentturn")//intvalue = 1 if its your turn this(variable{opponentturn}) + { + intValue = 0; + if ( target->controller()->opponent() == target->getObserver()->currentPlayer) + intValue = 1; + } else if (s == "phandcount") { intValue = target->controller()->game->hand->nb_cards; diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index c1e406780..d42612f46 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -356,6 +356,18 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe if(cPhase < MTG_PHASE_COMBATBEGIN ||cPhase > MTG_PHASE_COMBATEND ) return 0; } + check = restriction[i].find("during my turn"); + if(check != string::npos) + { + if(player != observer->currentPlayer) + return 0; + } + check = restriction[i].find("during opponent turn"); + if(check != string::npos) + { + if(player == observer->currentPlayer) + return 0; + } check = restriction[i].find("control snow land"); if(check != string::npos) {