From 2b9fdc41dc929b95f8ec154db1163ade667d91f0 Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Sat, 2 Feb 2013 18:42:39 +0000 Subject: [PATCH] added 2 new restrictions for use in triggers and abilities ownerscontrol opponentscontrol ownerscontrol returns 1 if the owner has the card in thier battlefield. 0 otherwise. vice versa. this should make it easier to add cards which should be treated differently depending on who controls them. --- projects/mtg/src/MTGAbility.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index fd73dd369..f1d0416eb 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -332,6 +332,18 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe if(!isMorbid) return 0; } + check = restriction[i].find("ownerscontrol"); + if(check != string::npos) + { + if(card->currentZone != card->owner->game->battlefield) + return 0; + } + check = restriction[i].find("opponentscontrol"); + if(check != string::npos) + { + if(card->currentZone == card->owner->game->battlefield) + return 0; + } check = restriction[i].find("one of a kind"); if(check != string::npos) {