mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Added OpponentTurn as a restriction to AF's.
This commit is contained in:
@@ -351,6 +351,9 @@ public class AbilityFactory {
|
|||||||
if (mapParams.containsKey("PlayerTurn"))
|
if (mapParams.containsKey("PlayerTurn"))
|
||||||
SA.getRestrictions().setPlayerTurn(true);
|
SA.getRestrictions().setPlayerTurn(true);
|
||||||
|
|
||||||
|
if (mapParams.containsKey("OpponentTurn"))
|
||||||
|
SA.getRestrictions().setOpponentTurn(true);
|
||||||
|
|
||||||
if (mapParams.containsKey("AnyPlayer"))
|
if (mapParams.containsKey("AnyPlayer"))
|
||||||
SA.getRestrictions().setAnyPlayer(true);
|
SA.getRestrictions().setAnyPlayer(true);
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,16 @@ public class SpellAbility_Restriction {
|
|||||||
return bPlayerTurn;
|
return bPlayerTurn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean bOpponentTurn = false;
|
||||||
|
|
||||||
|
public void setOpponentTurn(boolean bTurn){
|
||||||
|
bOpponentTurn = bTurn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getOpponentTurn(){
|
||||||
|
return bOpponentTurn;
|
||||||
|
}
|
||||||
|
|
||||||
private int activationLimit = -1;
|
private int activationLimit = -1;
|
||||||
private int numberTurnActivations = 0;
|
private int numberTurnActivations = 0;
|
||||||
|
|
||||||
@@ -118,6 +128,9 @@ public class SpellAbility_Restriction {
|
|||||||
if (bPlayerTurn && !AllZone.Phase.isPlayerTurn(activator))
|
if (bPlayerTurn && !AllZone.Phase.isPlayerTurn(activator))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (bOpponentTurn && AllZone.Phase.isPlayerTurn(activator))
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!bAnyPlayer && !activator.equals(c.getController()))
|
if (!bAnyPlayer && !activator.equals(c.getController()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user