Changed the syntax of YouCtrl in isValidCard.

This commit is contained in:
jendave
2011-08-06 08:07:59 +00:00
parent 55c055d878
commit f609f390df
2 changed files with 20 additions and 12 deletions

View File

@@ -3,8 +3,8 @@ ManaCost:3 UR UR UR
Types:Creature Horror
Text:UR UR UR UR: You may put a blue or red creature card from your hand onto the battlefield.
PT:4/4
K:stPumpOther:YouCtrl Creature.Blue:1/1:No Condition:Other blue creatures you control get +1/+1.
K:stPumpOther:YouCtrl Creature.Red:1/1:No Condition:Other red creatures you control get +1/+1.
K:stPumpOther:Creature.Blue+:1/1:No Condition:Other blue creatures you control get +1/+1.
K:stPumpOther:Creature.Red+:1/1:No Condition:Other red creatures you control get +1/+1.
SVar:PlayMain1:TRUE
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/mindwrack_liege.jpg

View File

@@ -2034,16 +2034,24 @@ public class Card extends MyObservable {
}
public boolean isValidCard(String Restrictions[], String Controller) {
String Restriction[] = Restrictions;
if (Restrictions[0].startsWith("YouCtrl")) {
if (!controller.equals(Controller)) return false;
Restriction[0] = Restriction[0].replaceFirst("YouCtrl ", "");
}
if (Restrictions[0].startsWith("YouDontCtrl")) {
if (controller.equals(Controller)) return false;
Restriction[0] = Restriction[0].replaceFirst("YouDontCtrl ", "");
}
return isValidCard(Restriction);
for (int i=0; i<Restrictions.length; i++)
{
if (Restrictions[i].contains("YouCtrl"))
{
if (!getController().equals(Controller))
return false;
Restrictions[i].replaceAll(".YouCtrl", "");
Restrictions[i].replaceAll("YouCtrl", "");
}
else if (Restrictions[i].contains("YouDontCtrl"))
{
if (getController().equals(Controller))
return false;
Restrictions[i].replaceAll(".YouDontCtrl", "");
Restrictions[i].replaceAll("YouDontCtrl", "");
}
}
return isValidCard(Restrictions);
}
public boolean isValidCard(String Restrictions[]) {