- Added OpponentTurn as a restriction to AF's.

This commit is contained in:
jendave
2011-08-06 10:43:42 +00:00
parent ed1eee1b69
commit 8d15bec375
2 changed files with 16 additions and 0 deletions

View File

@@ -351,6 +351,9 @@ public class AbilityFactory {
if (mapParams.containsKey("PlayerTurn"))
SA.getRestrictions().setPlayerTurn(true);
if (mapParams.containsKey("OpponentTurn"))
SA.getRestrictions().setOpponentTurn(true);
if (mapParams.containsKey("AnyPlayer"))
SA.getRestrictions().setAnyPlayer(true);

View File

@@ -50,6 +50,16 @@ public class SpellAbility_Restriction {
return bPlayerTurn;
}
private boolean bOpponentTurn = false;
public void setOpponentTurn(boolean bTurn){
bOpponentTurn = bTurn;
}
public boolean getOpponentTurn(){
return bOpponentTurn;
}
private int activationLimit = -1;
private int numberTurnActivations = 0;
@@ -118,6 +128,9 @@ public class SpellAbility_Restriction {
if (bPlayerTurn && !AllZone.Phase.isPlayerTurn(activator))
return false;
if (bOpponentTurn && AllZone.Phase.isPlayerTurn(activator))
return false;
if (!bAnyPlayer && !activator.equals(c.getController()))
return false;