mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +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(){
|
||||
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(){
|
||||
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){
|
||||
|
||||
@@ -2738,8 +2738,7 @@ public class CardFactory_Creatures {
|
||||
if(card.getController() == Constant.Player.Human) canPlayLand = CardFactoryUtil.canHumanPlayLand();
|
||||
else canPlayLand = CardFactoryUtil.canComputerPlayLand();
|
||||
|
||||
return (AllZone.GameAction.isCardInZone(card, play) && library.get(0).getType().contains("Land") && canPlayLand)
|
||||
&& (AllZone.Stack.size() == 0) && AllZone.GameAction.getLastPlayerToDraw().equals(card.getController());
|
||||
return (AllZone.GameAction.isCardInZone(card, play) && library.get(0).getType().contains("Land") && canPlayLand);
|
||||
}
|
||||
};
|
||||
ability.setStackDescription(card.getController() + " - plays land from top of library.");
|
||||
|
||||
@@ -2235,9 +2235,8 @@ public class GameAction {
|
||||
|
||||
ArrayList<String> choices = new ArrayList<String>();
|
||||
|
||||
if(AllZone.Stack.size() == 0 && CardFactoryUtil.canHumanPlayLand()
|
||||
&& (AllZone.Phase.getPhase().equals(Constant.Phase.Main1) || AllZone.Phase.getPhase().equals(
|
||||
Constant.Phase.Main2))) choices.add("Play land");
|
||||
if(CardFactoryUtil.canHumanPlayLand())
|
||||
choices.add("Play land");
|
||||
|
||||
for(SpellAbility sa:sas) {
|
||||
if(sa.canPlay()) {
|
||||
|
||||
Reference in New Issue
Block a user