mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Added all of the required checks into canPlayLand() so they can't be played illegally through alternate effects.
This commit is contained in:
@@ -4189,11 +4189,17 @@ public class CardFactoryUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean canHumanPlayLand(){
|
public static boolean canHumanPlayLand(){
|
||||||
return (AllZone.GameInfo.humanNumberLandPlaysLeft() > 0 || CardFactoryUtil.getCards("Fastbond", "Human").size() > 0);
|
// LandsToPlay Left or Fastbond in play, Human's turn, Stack is Empty, In Main Phase
|
||||||
|
return (AllZone.GameInfo.humanNumberLandPlaysLeft() > 0 || CardFactoryUtil.getCards("Fastbond", "Human").size() > 0) &&
|
||||||
|
AllZone.GameAction.getLastPlayerToDraw().equals("Human") && (AllZone.Stack.size() == 0) &&
|
||||||
|
(AllZone.Phase.getPhase().equals(Constant.Phase.Main1) || AllZone.Phase.getPhase().equals(Constant.Phase.Main2));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean canComputerPlayLand(){
|
public static boolean canComputerPlayLand(){
|
||||||
return (AllZone.GameInfo.computerNumberLandPlaysLeft() > 0 || CardFactoryUtil.getCards("Fastbond", "Computer").size() > 0);
|
// LandsToPlay Left or Fastbond in play, Computer's turn, Stack is Empty, In Main Phase
|
||||||
|
return (AllZone.GameInfo.computerNumberLandPlaysLeft() > 0 || CardFactoryUtil.getCards("Fastbond", "Computer").size() > 0) &&
|
||||||
|
AllZone.GameAction.getLastPlayerToDraw().equals("Computer") && (AllZone.Stack.size() == 0) &&
|
||||||
|
(AllZone.Phase.getPhase().equals(Constant.Phase.Main1) || AllZone.Phase.getPhase().equals(Constant.Phase.Main2));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void playLandEffects(Card c){
|
public static void playLandEffects(Card c){
|
||||||
|
|||||||
@@ -2738,8 +2738,7 @@ public class CardFactory_Creatures {
|
|||||||
if(card.getController() == Constant.Player.Human) canPlayLand = CardFactoryUtil.canHumanPlayLand();
|
if(card.getController() == Constant.Player.Human) canPlayLand = CardFactoryUtil.canHumanPlayLand();
|
||||||
else canPlayLand = CardFactoryUtil.canComputerPlayLand();
|
else canPlayLand = CardFactoryUtil.canComputerPlayLand();
|
||||||
|
|
||||||
return (AllZone.GameAction.isCardInZone(card, play) && library.get(0).getType().contains("Land") && canPlayLand)
|
return (AllZone.GameAction.isCardInZone(card, play) && library.get(0).getType().contains("Land") && canPlayLand);
|
||||||
&& (AllZone.Stack.size() == 0) && AllZone.GameAction.getLastPlayerToDraw().equals(card.getController());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
ability.setStackDescription(card.getController() + " - plays land from top of library.");
|
ability.setStackDescription(card.getController() + " - plays land from top of library.");
|
||||||
|
|||||||
@@ -2235,9 +2235,8 @@ public class GameAction {
|
|||||||
|
|
||||||
ArrayList<String> choices = new ArrayList<String>();
|
ArrayList<String> choices = new ArrayList<String>();
|
||||||
|
|
||||||
if(AllZone.Stack.size() == 0 && CardFactoryUtil.canHumanPlayLand()
|
if(CardFactoryUtil.canHumanPlayLand())
|
||||||
&& (AllZone.Phase.getPhase().equals(Constant.Phase.Main1) || AllZone.Phase.getPhase().equals(
|
choices.add("Play land");
|
||||||
Constant.Phase.Main2))) choices.add("Play land");
|
|
||||||
|
|
||||||
for(SpellAbility sa:sas) {
|
for(SpellAbility sa:sas) {
|
||||||
if(sa.canPlay()) {
|
if(sa.canPlay()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user