mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
several code simplifications along the way...
This commit is contained in:
@@ -120,7 +120,7 @@ public class AllZoneUtil {
|
|||||||
*/
|
*/
|
||||||
public static CardList getPlayerCardsInPlay(final Player player) {
|
public static CardList getPlayerCardsInPlay(final Player player) {
|
||||||
CardList cards = new CardList();
|
CardList cards = new CardList();
|
||||||
if( player.equals(AllZone.HumanPlayer) || player.equals(AllZone.ComputerPlayer) ){
|
if( player.isHuman() || player.isComputer() ){
|
||||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, player);
|
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, player);
|
||||||
cards.addAll(play.getCards());
|
cards.addAll(play.getCards());
|
||||||
}
|
}
|
||||||
@@ -284,7 +284,7 @@ public class AllZoneUtil {
|
|||||||
*/
|
*/
|
||||||
public static CardList getPlayerCardsInExile(final Player player) {
|
public static CardList getPlayerCardsInExile(final Player player) {
|
||||||
CardList cards = new CardList();
|
CardList cards = new CardList();
|
||||||
if( player.equals(AllZone.HumanPlayer) || player.equals(AllZone.ComputerPlayer) ){
|
if( player.isHuman() || player.isComputer() ){
|
||||||
PlayerZone removed = AllZone.getZone(Constant.Zone.Exile, player);
|
PlayerZone removed = AllZone.getZone(Constant.Zone.Exile, player);
|
||||||
cards.addAll(removed.getCards());
|
cards.addAll(removed.getCards());
|
||||||
}
|
}
|
||||||
@@ -313,7 +313,7 @@ public class AllZoneUtil {
|
|||||||
*/
|
*/
|
||||||
public static CardList getPlayerCardsInLibrary(final Player player) {
|
public static CardList getPlayerCardsInLibrary(final Player player) {
|
||||||
CardList cards = new CardList();
|
CardList cards = new CardList();
|
||||||
if( player.equals(AllZone.HumanPlayer) || player.equals(AllZone.ComputerPlayer) ){
|
if( player.isHuman() || player.isComputer() ){
|
||||||
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player);
|
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player);
|
||||||
cards.addAll(lib.getCards());
|
cards.addAll(lib.getCards());
|
||||||
}
|
}
|
||||||
@@ -334,7 +334,7 @@ public class AllZoneUtil {
|
|||||||
|
|
||||||
public static CardList getPlayerCardsInLibrary(final Player player, int numCards) {
|
public static CardList getPlayerCardsInLibrary(final Player player, int numCards) {
|
||||||
CardList cards = new CardList();
|
CardList cards = new CardList();
|
||||||
if( player.equals(AllZone.HumanPlayer) || player.equals(AllZone.ComputerPlayer) ){
|
if( player.isHuman() || player.isComputer() ){
|
||||||
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player);
|
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player);
|
||||||
|
|
||||||
if (lib.size() <= numCards)
|
if (lib.size() <= numCards)
|
||||||
|
|||||||
@@ -1528,7 +1528,7 @@ public class CombatUtil {
|
|||||||
soldiers = soldiers.getType("Soldier");
|
soldiers = soldiers.getType("Soldier");
|
||||||
|
|
||||||
if(soldiers.size() > 0) {
|
if(soldiers.size() > 0) {
|
||||||
if(c.getController().equals(AllZone.HumanPlayer)) {
|
if(c.getController().isHuman()) {
|
||||||
Object o = GuiUtils.getChoiceOptional("Pick a soldier to put onto the battlefield",
|
Object o = GuiUtils.getChoiceOptional("Pick a soldier to put onto the battlefield",
|
||||||
soldiers.toArray());
|
soldiers.toArray());
|
||||||
if(o != null) {
|
if(o != null) {
|
||||||
@@ -1540,7 +1540,7 @@ public class CombatUtil {
|
|||||||
|
|
||||||
card.setCreatureAttackedThisCombat(true);
|
card.setCreatureAttackedThisCombat(true);
|
||||||
}
|
}
|
||||||
} else if(c.getController().equals(AllZone.ComputerPlayer)) {
|
} else if(c.getController().isComputer()) {
|
||||||
Card card = CardFactoryUtil.AI_getBestCreature(soldiers);
|
Card card = CardFactoryUtil.AI_getBestCreature(soldiers);
|
||||||
if (card != null){
|
if (card != null){
|
||||||
AllZone.GameAction.moveToPlay(card);
|
AllZone.GameAction.moveToPlay(card);
|
||||||
@@ -1602,7 +1602,7 @@ public class CombatUtil {
|
|||||||
ability.setStackDescription(sb.toString());
|
ability.setStackDescription(sb.toString());
|
||||||
|
|
||||||
setLorthosCancelled(false);
|
setLorthosCancelled(false);
|
||||||
if(c.getController().equals(AllZone.HumanPlayer)) {
|
if(c.getController().isHuman()) {
|
||||||
AllZone.InputControl.setInput(new Input_PayManaCost_Ability("Activate " + c.getName() + "'s ability: " + "\r\n",
|
AllZone.InputControl.setInput(new Input_PayManaCost_Ability("Activate " + c.getName() + "'s ability: " + "\r\n",
|
||||||
ability.getManaCost(), paidCommand, unpaidCommand));
|
ability.getManaCost(), paidCommand, unpaidCommand));
|
||||||
} else //computer
|
} else //computer
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public class ComputerUtil_Attack2 {
|
|||||||
ArrayList<Trigger> registeredTriggers = AllZone.TriggerHandler.getRegisteredTriggers();
|
ArrayList<Trigger> registeredTriggers = AllZone.TriggerHandler.getRegisteredTriggers();
|
||||||
for(Trigger trigger : registeredTriggers)
|
for(Trigger trigger : registeredTriggers)
|
||||||
if (CombatUtil.combatTriggerWillTrigger(attacker,null,trigger, combat)
|
if (CombatUtil.combatTriggerWillTrigger(attacker,null,trigger, combat)
|
||||||
&& trigger.getHostCard().getController().equals(AllZone.ComputerPlayer)) return true;
|
&& trigger.getHostCard().getController().isComputer()) return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -256,11 +256,11 @@ public class GameAction {
|
|||||||
boolean shouldRecoverForAI = false;
|
boolean shouldRecoverForAI = false;
|
||||||
boolean shouldRecoverForHuman = false;
|
boolean shouldRecoverForHuman = false;
|
||||||
|
|
||||||
if(c.getOwner().equals(AllZone.HumanPlayer))
|
if(c.getOwner().isHuman())
|
||||||
{
|
{
|
||||||
shouldRecoverForHuman = GameActionUtil.showYesNoDialog(recoverable, question.toString());
|
shouldRecoverForHuman = GameActionUtil.showYesNoDialog(recoverable, question.toString());
|
||||||
}
|
}
|
||||||
else if(c.getOwner().equals(AllZone.ComputerPlayer))
|
else if(c.getOwner().isComputer())
|
||||||
{
|
{
|
||||||
shouldRecoverForAI = ComputerUtil.canPayCost(abRecover);
|
shouldRecoverForAI = ComputerUtil.canPayCost(abRecover);
|
||||||
}
|
}
|
||||||
@@ -1001,7 +1001,7 @@ public class GameAction {
|
|||||||
final SpellAbility F_SpellAbility = SpellAbility[0];
|
final SpellAbility F_SpellAbility = SpellAbility[0];
|
||||||
|
|
||||||
if(k[7].contains("Choice_Instant") && k[4] != "Null") {
|
if(k[7].contains("Choice_Instant") && k[4] != "Null") {
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
Object[] possibleValues = {"Yes", "No"};
|
Object[] possibleValues = {"Yes", "No"};
|
||||||
Object q = JOptionPane.showOptionDialog(null, "Activate - " + card.getName(),card.getName() + " Ability",
|
Object q = JOptionPane.showOptionDialog(null, "Activate - " + card.getName(),card.getName() + " Ability",
|
||||||
JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,
|
JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,
|
||||||
@@ -1084,7 +1084,7 @@ public class GameAction {
|
|||||||
public void execute() {
|
public void execute() {
|
||||||
String WhichInput = F_k[5].split("/")[1];
|
String WhichInput = F_k[5].split("/")[1];
|
||||||
if(WhichInput.equals("Creature"))
|
if(WhichInput.equals("Creature"))
|
||||||
if(F_card.getController().equals(AllZone.HumanPlayer))
|
if(F_card.getController().isHuman())
|
||||||
AllZone.InputControl.setInput(CardFactoryUtil.input_targetCreature(F_SpellAbility, GetTargetsCommand));
|
AllZone.InputControl.setInput(CardFactoryUtil.input_targetCreature(F_SpellAbility, GetTargetsCommand));
|
||||||
else {
|
else {
|
||||||
CardList PossibleTargets = new CardList();
|
CardList PossibleTargets = new CardList();
|
||||||
@@ -1094,7 +1094,7 @@ public class GameAction {
|
|||||||
if(Whenever_AI_GoodEffect(F_k)) {
|
if(Whenever_AI_GoodEffect(F_k)) {
|
||||||
PossibleTargets = PossibleTargets.filter(new CardListFilter() {
|
PossibleTargets = PossibleTargets.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
if(c.getController().equals(AllZone.ComputerPlayer)) return true;
|
if(c.getController().isComputer()) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1106,7 +1106,7 @@ public class GameAction {
|
|||||||
} else {
|
} else {
|
||||||
PossibleTargets = PossibleTargets.filter(new CardListFilter() {
|
PossibleTargets = PossibleTargets.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
if(c.getController().equals(AllZone.HumanPlayer)) return true;
|
if(c.getController().isHuman()) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1119,7 +1119,7 @@ public class GameAction {
|
|||||||
|
|
||||||
}
|
}
|
||||||
if(WhichInput.equals("Player"))
|
if(WhichInput.equals("Player"))
|
||||||
if(F_card.getController().equals(AllZone.HumanPlayer))
|
if(F_card.getController().isHuman())
|
||||||
AllZone.InputControl.setInput(CardFactoryUtil.input_targetPlayer(F_SpellAbility, GetTargetsCommand));
|
AllZone.InputControl.setInput(CardFactoryUtil.input_targetPlayer(F_SpellAbility, GetTargetsCommand));
|
||||||
else {
|
else {
|
||||||
if(Whenever_AI_GoodEffect(F_k)) {
|
if(Whenever_AI_GoodEffect(F_k)) {
|
||||||
@@ -1183,13 +1183,13 @@ public class GameAction {
|
|||||||
}
|
}
|
||||||
Restriction_Count[0]++;
|
Restriction_Count[0]++;
|
||||||
}
|
}
|
||||||
if(F_card.getController().equals(AllZone.HumanPlayer))
|
if(F_card.getController().isHuman())
|
||||||
AllZone.InputControl.setInput(CardFactoryUtil.input_targetSpecific(F_SpellAbility, Cards_inPlay, "Select a Valid Card", GetTargetsCommand, true, true));
|
AllZone.InputControl.setInput(CardFactoryUtil.input_targetSpecific(F_SpellAbility, Cards_inPlay, "Select a Valid Card", GetTargetsCommand, true, true));
|
||||||
else {
|
else {
|
||||||
if(Whenever_AI_GoodEffect(F_k)) {
|
if(Whenever_AI_GoodEffect(F_k)) {
|
||||||
Cards_inPlay = Cards_inPlay.filter(new CardListFilter() {
|
Cards_inPlay = Cards_inPlay.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
if(c.getController().equals(AllZone.ComputerPlayer)) return true;
|
if(c.getController().isComputer()) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1201,7 +1201,7 @@ public class GameAction {
|
|||||||
} else {
|
} else {
|
||||||
Cards_inPlay = Cards_inPlay.filter(new CardListFilter() {
|
Cards_inPlay = Cards_inPlay.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
if(c.getController().equals(AllZone.HumanPlayer)) return true;
|
if(c.getController().isHuman()) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1683,7 +1683,7 @@ public class GameAction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(AllZone.GameAction.isCardInZone(F_card,Required_Zone) || F_Zones.equals("Any")) {
|
else if(AllZone.GameAction.isCardInZone(F_card,Required_Zone) || F_Zones.equals("Any")) {
|
||||||
if(F_card.getController().equals(AllZone.HumanPlayer)) {
|
if(F_card.getController().isHuman()) {
|
||||||
for(int z = 0; z < Targets_Multi.length; z++) {
|
for(int z = 0; z < Targets_Multi.length; z++) {
|
||||||
if(!(Targets_Multi[z].equals(AllZone.HumanPlayer) || Targets_Multi[z].equals(AllZone.ComputerPlayer))) {
|
if(!(Targets_Multi[z].equals(AllZone.HumanPlayer) || Targets_Multi[z].equals(AllZone.ComputerPlayer))) {
|
||||||
if(AllZoneUtil.isCardInPlay((Card) Targets_Multi[z])
|
if(AllZoneUtil.isCardInPlay((Card) Targets_Multi[z])
|
||||||
@@ -1697,7 +1697,7 @@ public class GameAction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(F_card.getController().equals(AllZone.ComputerPlayer)) AllZone.HumanPlayer.addDamage(F_Amount[0]*F_Multiple_Targets, F_card);
|
if(F_card.getController().isComputer()) AllZone.HumanPlayer.addDamage(F_Amount[0]*F_Multiple_Targets, F_card);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1706,7 +1706,7 @@ public class GameAction {
|
|||||||
Command_Effects[F_Target] = Proper_resolve;
|
Command_Effects[F_Target] = Proper_resolve;
|
||||||
if(Check_if_All_Targets(F_card, F_k).size() > 0) StackDescription = StackDescription + "deals " + F_Amount[0]*F_Multiple_Targets + " damage" + " to all specified permanents/players";
|
if(Check_if_All_Targets(F_card, F_k).size() > 0) StackDescription = StackDescription + "deals " + F_Amount[0]*F_Multiple_Targets + " damage" + " to all specified permanents/players";
|
||||||
else if(F_Multiple_Targets != 1) StackDescription = StackDescription + "deals " + F_Amount[0]*F_Multiple_Targets + " damage" + " divided among up to " + Multiple_Targets + " target creatures and/or players";
|
else if(F_Multiple_Targets != 1) StackDescription = StackDescription + "deals " + F_Amount[0]*F_Multiple_Targets + " damage" + " divided among up to " + Multiple_Targets + " target creatures and/or players";
|
||||||
else if(F_card.getController().equals(AllZone.ComputerPlayer)) StackDescription = StackDescription + "targeting Human ";
|
else if(F_card.getController().isComputer()) StackDescription = StackDescription + "targeting Human ";
|
||||||
else StackDescription = StackDescription + "targeting " + ((F_TargetCard[y] != null)? F_TargetCard[y]:"") +
|
else StackDescription = StackDescription + "targeting " + ((F_TargetCard[y] != null)? F_TargetCard[y]:"") +
|
||||||
((F_TargetPlayer[y] != null)? F_TargetPlayer[y]:"");
|
((F_TargetPlayer[y] != null)? F_TargetPlayer[y]:"");
|
||||||
}
|
}
|
||||||
@@ -1815,7 +1815,7 @@ public class GameAction {
|
|||||||
String SearchDescription = " ";
|
String SearchDescription = " ";
|
||||||
boolean SearchLib = true;
|
boolean SearchLib = true;
|
||||||
if(Keyword_Details[7].contains("Choice_Instant-SearchLibrary")) {
|
if(Keyword_Details[7].contains("Choice_Instant-SearchLibrary")) {
|
||||||
if(Source.getController().equals(AllZone.HumanPlayer)) {
|
if(Source.getController().isHuman()) {
|
||||||
Object[] possibleValues = {"Yes", "No"};
|
Object[] possibleValues = {"Yes", "No"};
|
||||||
Object q = JOptionPane.showOptionDialog(null, "Search Libraries?",Source.getName() + " F_SpellAbility",
|
Object q = JOptionPane.showOptionDialog(null, "Search Libraries?",Source.getName() + " F_SpellAbility",
|
||||||
JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,
|
JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,
|
||||||
@@ -1946,7 +1946,7 @@ public class GameAction {
|
|||||||
String PayAmountParse = Keyword_Details[7];
|
String PayAmountParse = Keyword_Details[7];
|
||||||
S_Amount = PayAmountParse.split("/")[1];
|
S_Amount = PayAmountParse.split("/")[1];
|
||||||
|
|
||||||
if(Source.getController().equals(AllZone.HumanPlayer)) {
|
if(Source.getController().isHuman()) {
|
||||||
final Command paid = new Command() {
|
final Command paid = new Command() {
|
||||||
private static final long serialVersionUID = 151367344511590317L;
|
private static final long serialVersionUID = 151367344511590317L;
|
||||||
|
|
||||||
@@ -1971,7 +1971,7 @@ public class GameAction {
|
|||||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, Source.getController());
|
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, Source.getController());
|
||||||
CardList choice = new CardList(play.getCards());
|
CardList choice = new CardList(play.getCards());
|
||||||
choice = choice.getType(S_Amount);
|
choice = choice.getType(S_Amount);
|
||||||
if(Source.getController().equals(AllZone.HumanPlayer)) {
|
if(Source.getController().isHuman()) {
|
||||||
AllZone.InputControl.setInput(CardFactoryUtil.Wheneverinput_sacrifice(ability, choice, "Select a " + S_Amount +" to sacrifice.",Proper_Resolve));
|
AllZone.InputControl.setInput(CardFactoryUtil.Wheneverinput_sacrifice(ability, choice, "Select a " + S_Amount +" to sacrifice.",Proper_Resolve));
|
||||||
} /*else {
|
} /*else {
|
||||||
if(choice.size() > 5) {
|
if(choice.size() > 5) {
|
||||||
@@ -1998,7 +1998,7 @@ public class GameAction {
|
|||||||
|
|
||||||
if(AllZoneUtil.isCardInZone(Required_Zone[0], Source) || Zones.equals("Any")) {
|
if(AllZoneUtil.isCardInZone(Required_Zone[0], Source) || Zones.equals("Any")) {
|
||||||
if(Keyword_Details[7].equals("Yes_No")) {
|
if(Keyword_Details[7].equals("Yes_No")) {
|
||||||
if(Source.getController().equals(AllZone.HumanPlayer)) {
|
if(Source.getController().isHuman()) {
|
||||||
Object[] possibleValues = {"Yes", "No"};
|
Object[] possibleValues = {"Yes", "No"};
|
||||||
Object q = JOptionPane.showOptionDialog(null, "Activate - " + Source.getName(),Source.getName() + " Ability",
|
Object q = JOptionPane.showOptionDialog(null, "Activate - " + Source.getName(),Source.getName() + " Ability",
|
||||||
JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,
|
JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,
|
||||||
@@ -2009,7 +2009,7 @@ public class GameAction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(Keyword_Details[7].equals("Opponent_Yes_No")) {
|
if(Keyword_Details[7].equals("Opponent_Yes_No")) {
|
||||||
if(!Source.getController().equals(AllZone.HumanPlayer)) {
|
if(!Source.getController().isHuman()) {
|
||||||
Object[] possibleValues = {"Yes", "No"};
|
Object[] possibleValues = {"Yes", "No"};
|
||||||
Object q = JOptionPane.showOptionDialog(null, "Activate - " + Source.getName(),Source.getName() + " Ability",
|
Object q = JOptionPane.showOptionDialog(null, "Activate - " + Source.getName(),Source.getName() + " Ability",
|
||||||
JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,
|
JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,
|
||||||
@@ -2037,10 +2037,10 @@ public class GameAction {
|
|||||||
|
|
||||||
if(AllZoneUtil.isCardInZone(Required_Zone[0], Source) || Zones.equals("Any")) {
|
if(AllZoneUtil.isCardInZone(Required_Zone[0], Source) || Zones.equals("Any")) {
|
||||||
if(Keyword_Details[6].equals("ASAP")) {
|
if(Keyword_Details[6].equals("ASAP")) {
|
||||||
if(Keyword_Details[5].equals("InputType - CreatureORPlayer") && Source.getController().equals(AllZone.HumanPlayer)) {
|
if(Keyword_Details[5].equals("InputType - CreatureORPlayer") && Source.getController().isHuman()) {
|
||||||
paidCommand.execute();
|
paidCommand.execute();
|
||||||
}
|
}
|
||||||
else if(Keyword_Details[5].equals("InputType - CreatureORPlayer") && Source.getController().equals(AllZone.ComputerPlayer))
|
else if(Keyword_Details[5].equals("InputType - CreatureORPlayer") && Source.getController().isComputer())
|
||||||
AllZone.Stack.add(ability);
|
AllZone.Stack.add(ability);
|
||||||
else if(Keyword_Details[5].contains("NormalInput")) {
|
else if(Keyword_Details[5].contains("NormalInput")) {
|
||||||
paidCommand.execute();
|
paidCommand.execute();
|
||||||
@@ -3287,7 +3287,7 @@ public class GameAction {
|
|||||||
public void searchLibraryTwoLand(String type, Player player,
|
public void searchLibraryTwoLand(String type, Player player,
|
||||||
String Zone1, boolean tapFirstLand,
|
String Zone1, boolean tapFirstLand,
|
||||||
String Zone2, boolean tapSecondLand) {
|
String Zone2, boolean tapSecondLand) {
|
||||||
if(player.equals(AllZone.HumanPlayer)) {
|
if(player.isHuman()) {
|
||||||
humanSearchTwoLand(type, Zone1, tapFirstLand, Zone2, tapSecondLand);
|
humanSearchTwoLand(type, Zone1, tapFirstLand, Zone2, tapSecondLand);
|
||||||
} else {
|
} else {
|
||||||
aiSearchTwoLand(type, Zone1, tapFirstLand, Zone2, tapSecondLand);
|
aiSearchTwoLand(type, Zone1, tapFirstLand, Zone2, tapSecondLand);
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ public class GameActionUtil {
|
|||||||
|
|
||||||
if (cascadedCard != null && !cascadedCard.isUnCastable()) {
|
if (cascadedCard != null && !cascadedCard.isUnCastable()) {
|
||||||
|
|
||||||
if (cascadedCard.getController().equals(AllZone.HumanPlayer)) {
|
if (cascadedCard.getController().isHuman()) {
|
||||||
StringBuilder title = new StringBuilder();
|
StringBuilder title = new StringBuilder();
|
||||||
title.append(cascCard.getName()).append(" - Cascade Ability");
|
title.append(cascCard.getName()).append(" - Cascade Ability");
|
||||||
StringBuilder question = new StringBuilder();
|
StringBuilder question = new StringBuilder();
|
||||||
@@ -270,11 +270,11 @@ public class GameActionUtil {
|
|||||||
Computer_ThrummingStone = Computer_ThrummingStone.getName("Thrumming Stone");
|
Computer_ThrummingStone = Computer_ThrummingStone.getName("Thrumming Stone");
|
||||||
for (int i=0;i<Human_ThrummingStone.size();i++)
|
for (int i=0;i<Human_ThrummingStone.size();i++)
|
||||||
{
|
{
|
||||||
if(c.getController().equals(AllZone.HumanPlayer)) c.addExtrinsicKeyword("Ripple:4");
|
if(c.getController().isHuman()) c.addExtrinsicKeyword("Ripple:4");
|
||||||
}
|
}
|
||||||
for (int i=0;i<Computer_ThrummingStone.size();i++)
|
for (int i=0;i<Computer_ThrummingStone.size();i++)
|
||||||
{
|
{
|
||||||
if(c.getController().equals(AllZone.ComputerPlayer)) c.addExtrinsicKeyword("Ripple:4");
|
if(c.getController().isComputer()) c.addExtrinsicKeyword("Ripple:4");
|
||||||
}
|
}
|
||||||
ArrayList<String> a = c.getKeyword();
|
ArrayList<String> a = c.getKeyword();
|
||||||
for(int x = 0; x < a.size(); x++)
|
for(int x = 0; x < a.size(); x++)
|
||||||
@@ -320,7 +320,7 @@ public class GameActionUtil {
|
|||||||
for(int i = 0; i < RippleMax; i++) {
|
for(int i = 0; i < RippleMax; i++) {
|
||||||
if(RippledCards[i] != null && !RippledCards[i].isUnCastable()) {
|
if(RippledCards[i] != null && !RippledCards[i].isUnCastable()) {
|
||||||
|
|
||||||
if(RippledCards[i].getController().equals(AllZone.HumanPlayer)) {
|
if(RippledCards[i].getController().isHuman()) {
|
||||||
Object[] possibleValues = {"Yes", "No"};
|
Object[] possibleValues = {"Yes", "No"};
|
||||||
Object q = JOptionPane.showOptionDialog(null, "Cast " + RippledCards[i].getName() + "?", "Ripple",
|
Object q = JOptionPane.showOptionDialog(null, "Cast " + RippledCards[i].getName() + "?", "Ripple",
|
||||||
JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,
|
JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,
|
||||||
@@ -499,7 +499,7 @@ public class GameActionUtil {
|
|||||||
};//Input
|
};//Input
|
||||||
|
|
||||||
ability.setBeforePayMana(runtime);
|
ability.setBeforePayMana(runtime);
|
||||||
if (controller.equals(AllZone.HumanPlayer))
|
if (controller.isHuman())
|
||||||
AllZone.GameAction.playSpellAbility(ability);
|
AllZone.GameAction.playSpellAbility(ability);
|
||||||
else {
|
else {
|
||||||
ability.chooseTargetAI();
|
ability.chooseTargetAI();
|
||||||
@@ -594,7 +594,7 @@ public class GameActionUtil {
|
|||||||
} else target = AllZone.HumanPlayer; // check for target of spell/abilities should be here
|
} else target = AllZone.HumanPlayer; // check for target of spell/abilities should be here
|
||||||
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, target);
|
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, target);
|
||||||
CardList fullHand = new CardList(hand.getCards());
|
CardList fullHand = new CardList(hand.getCards());
|
||||||
if(fullHand.size() > 0 && target.equals(AllZone.ComputerPlayer)) GuiUtils.getChoice(
|
if(fullHand.size() > 0 && target.isComputer()) GuiUtils.getChoice(
|
||||||
"Revealing hand", fullHand.toArray());
|
"Revealing hand", fullHand.toArray());
|
||||||
CardList discard = new CardList(hand.getCards());
|
CardList discard = new CardList(hand.getCards());
|
||||||
discard = discard.filter(new CardListFilter() {
|
discard = discard.filter(new CardListFilter() {
|
||||||
@@ -896,7 +896,7 @@ public class GameActionUtil {
|
|||||||
final Ability destroyAbility = new Ability(c, c.getTabernacleUpkeepCost()) {
|
final Ability destroyAbility = new Ability(c, c.getTabernacleUpkeepCost()) {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if(c.getController().equals(AllZone.HumanPlayer)) {
|
if(c.getController().isHuman()) {
|
||||||
payManaDuringAbilityResolve(sb.toString(), c.getTabernacleUpkeepCost(), paidCommand, unpaidCommand);
|
payManaDuringAbilityResolve(sb.toString(), c.getTabernacleUpkeepCost(), paidCommand, unpaidCommand);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -952,7 +952,7 @@ public class GameActionUtil {
|
|||||||
final Ability upkeepAbility = new Ability(c, c.getMagusTabernacleUpkeepCost()) {
|
final Ability upkeepAbility = new Ability(c, c.getMagusTabernacleUpkeepCost()) {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if(c.getController().equals(AllZone.HumanPlayer)) {
|
if(c.getController().isHuman()) {
|
||||||
payManaDuringAbilityResolve(sb.toString(), c.getMagusTabernacleUpkeepCost(), paidCommand, unpaidCommand);
|
payManaDuringAbilityResolve(sb.toString(), c.getMagusTabernacleUpkeepCost(), paidCommand, unpaidCommand);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1011,7 +1011,7 @@ public class GameActionUtil {
|
|||||||
final Ability upkeepAbility = new Ability(c, c.getUpkeepCost()) {
|
final Ability upkeepAbility = new Ability(c, c.getUpkeepCost()) {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if(c.getController().equals(AllZone.HumanPlayer)) {
|
if(c.getController().isHuman()) {
|
||||||
payManaDuringAbilityResolve(sb.toString(), c.getUpkeepCost(), paidCommand, unpaidCommand);
|
payManaDuringAbilityResolve(sb.toString(), c.getUpkeepCost(), paidCommand, unpaidCommand);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1058,7 +1058,7 @@ public class GameActionUtil {
|
|||||||
final Ability sacAbility = new Ability(c, "0") {
|
final Ability sacAbility = new Ability(c, "0") {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if(c.getController().equals(AllZone.HumanPlayer)) {
|
if(c.getController().isHuman()) {
|
||||||
payManaDuringAbilityResolve(sb.toString(), c.getEchoCost(), paidCommand, unpaidCommand);
|
payManaDuringAbilityResolve(sb.toString(), c.getEchoCost(), paidCommand, unpaidCommand);
|
||||||
}
|
}
|
||||||
else //computer
|
else //computer
|
||||||
@@ -1165,7 +1165,7 @@ public class GameActionUtil {
|
|||||||
final Ability upkeepAbility = new Ability(c, c.getUpkeepCost()) {
|
final Ability upkeepAbility = new Ability(c, c.getUpkeepCost()) {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if(c.getController().equals(AllZone.HumanPlayer)) {
|
if(c.getController().isHuman()) {
|
||||||
payManaDuringAbilityResolve(sb.toString(), c.getUpkeepCost(), paidCommand, unpaidCommand);
|
payManaDuringAbilityResolve(sb.toString(), c.getUpkeepCost(), paidCommand, unpaidCommand);
|
||||||
}
|
}
|
||||||
else //computer
|
else //computer
|
||||||
@@ -1224,7 +1224,7 @@ public class GameActionUtil {
|
|||||||
final Ability upkeepAbility = new Ability(c, c.getUpkeepCost()) {
|
final Ability upkeepAbility = new Ability(c, c.getUpkeepCost()) {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if(c.getController().equals(AllZone.HumanPlayer)) {
|
if(c.getController().isHuman()) {
|
||||||
payManaDuringAbilityResolve(sb.toString(), c.getUpkeepCost(), paidCommand, unpaidCommand);
|
payManaDuringAbilityResolve(sb.toString(), c.getUpkeepCost(), paidCommand, unpaidCommand);
|
||||||
}
|
}
|
||||||
else //computer
|
else //computer
|
||||||
@@ -1288,7 +1288,7 @@ public class GameActionUtil {
|
|||||||
final Ability upkeepAbility = new Ability(c, c.getUpkeepCost()) {
|
final Ability upkeepAbility = new Ability(c, c.getUpkeepCost()) {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if(c.getController().equals(AllZone.HumanPlayer)) {
|
if(c.getController().isHuman()) {
|
||||||
payManaDuringAbilityResolve(sb.toString(), c.getUpkeepCost(), paidCommand, unpaidCommand);
|
payManaDuringAbilityResolve(sb.toString(), c.getUpkeepCost(), paidCommand, unpaidCommand);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1335,7 +1335,7 @@ public class GameActionUtil {
|
|||||||
final Ability sacrificeCreature = new Ability(abyss, "") {
|
final Ability sacrificeCreature = new Ability(abyss, "") {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if(player.equals(AllZone.HumanPlayer)) {
|
if(player.isHuman()) {
|
||||||
if(abyss_getTargets(player, abyss).size() > 0) {
|
if(abyss_getTargets(player, abyss).size() > 0) {
|
||||||
AllZone.InputControl.setInput( new Input() {
|
AllZone.InputControl.setInput( new Input() {
|
||||||
private static final long serialVersionUID = 4820011040853968644L;
|
private static final long serialVersionUID = 4820011040853968644L;
|
||||||
@@ -1346,7 +1346,7 @@ public class GameActionUtil {
|
|||||||
public void selectCard(Card selected, PlayerZone zone) {
|
public void selectCard(Card selected, PlayerZone zone) {
|
||||||
//probably need to restrict by controller also
|
//probably need to restrict by controller also
|
||||||
if(selected.isCreature() && !selected.isArtifact() && CardFactoryUtil.canTarget(abyss, selected)
|
if(selected.isCreature() && !selected.isArtifact() && CardFactoryUtil.canTarget(abyss, selected)
|
||||||
&& zone.is(Constant.Zone.Battlefield) && zone.getPlayer().equals(AllZone.HumanPlayer)) {
|
&& zone.is(Constant.Zone.Battlefield) && zone.getPlayer().isHuman()) {
|
||||||
AllZone.GameAction.destroyNoRegeneration(selected);
|
AllZone.GameAction.destroyNoRegeneration(selected);
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
@@ -1489,7 +1489,7 @@ public class GameActionUtil {
|
|||||||
CardList artifacts = AllZoneUtil.getPlayerCardsInPlay(player);
|
CardList artifacts = AllZoneUtil.getPlayerCardsInPlay(player);
|
||||||
artifacts = artifacts.filter(AllZoneUtil.artifacts);
|
artifacts = artifacts.filter(AllZoneUtil.artifacts);
|
||||||
|
|
||||||
if(player.equals(AllZone.HumanPlayer)) {
|
if(player.isHuman()) {
|
||||||
AllZone.InputControl.setInput( new Input() {
|
AllZone.InputControl.setInput( new Input() {
|
||||||
private static final long serialVersionUID = -1698502376924356936L;
|
private static final long serialVersionUID = -1698502376924356936L;
|
||||||
public void showMessage() {
|
public void showMessage() {
|
||||||
@@ -1503,7 +1503,7 @@ public class GameActionUtil {
|
|||||||
public void selectCard(Card artifact, PlayerZone zone) {
|
public void selectCard(Card artifact, PlayerZone zone) {
|
||||||
//probably need to restrict by controller also
|
//probably need to restrict by controller also
|
||||||
if(artifact.isArtifact() && zone.is(Constant.Zone.Battlefield)
|
if(artifact.isArtifact() && zone.is(Constant.Zone.Battlefield)
|
||||||
&& zone.getPlayer().equals(AllZone.HumanPlayer)) {
|
&& zone.getPlayer().isHuman()) {
|
||||||
AllZone.GameAction.sacrifice(artifact);
|
AllZone.GameAction.sacrifice(artifact);
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
@@ -1555,7 +1555,7 @@ public class GameActionUtil {
|
|||||||
//TODO: this should handle the case where you sacrifice 2 LOTPs to each other
|
//TODO: this should handle the case where you sacrifice 2 LOTPs to each other
|
||||||
CardList creatures = AllZoneUtil.getCreaturesInPlay(player);
|
CardList creatures = AllZoneUtil.getCreaturesInPlay(player);
|
||||||
creatures.remove(c);
|
creatures.remove(c);
|
||||||
if(player.equals(AllZone.HumanPlayer)) {
|
if(player.isHuman()) {
|
||||||
AllZone.InputControl.setInput(CardFactoryUtil.input_sacrificePermanent(creatures, c.getName()+" - Select a creature to sacrifice."));
|
AllZone.InputControl.setInput(CardFactoryUtil.input_sacrificePermanent(creatures, c.getName()+" - Select a creature to sacrifice."));
|
||||||
}
|
}
|
||||||
else { //computer
|
else { //computer
|
||||||
@@ -1617,7 +1617,7 @@ public class GameActionUtil {
|
|||||||
if(creatures.size() > 0) {
|
if(creatures.size() > 0) {
|
||||||
CardListUtil.sortAttackLowFirst(creatures);
|
CardListUtil.sortAttackLowFirst(creatures);
|
||||||
int power = creatures.get(0).getNetAttack();
|
int power = creatures.get(0).getNetAttack();
|
||||||
if(player.equals(AllZone.HumanPlayer)) {
|
if(player.isHuman()) {
|
||||||
AllZone.InputControl.setInput(CardFactoryUtil.input_destroyNoRegeneration(getLowestPowerList(creatures), "Select creature with power: "+power+" to sacrifice."));
|
AllZone.InputControl.setInput(CardFactoryUtil.input_destroyNoRegeneration(getLowestPowerList(creatures), "Select creature with power: "+power+" to sacrifice."));
|
||||||
}
|
}
|
||||||
else { //computer
|
else { //computer
|
||||||
@@ -1642,7 +1642,7 @@ public class GameActionUtil {
|
|||||||
CardList options = getLowestPowerList(original);
|
CardList options = getLowestPowerList(original);
|
||||||
CardList humanCreatures = options.filter(new CardListFilter() {
|
CardList humanCreatures = options.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
return c.getController().equals(AllZone.HumanPlayer);
|
return c.getController().isHuman();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(humanCreatures.isEmpty()) {
|
if(humanCreatures.isEmpty()) {
|
||||||
@@ -1698,7 +1698,7 @@ public class GameActionUtil {
|
|||||||
} //end resolve()
|
} //end resolve()
|
||||||
}; //end noPay ability
|
}; //end noPay ability
|
||||||
|
|
||||||
if (c.getController().equals(AllZone.HumanPlayer)) {
|
if (c.getController().isHuman()) {
|
||||||
String question = "Pay Demonic Hordes upkeep cost?";
|
String question = "Pay Demonic Hordes upkeep cost?";
|
||||||
if (GameActionUtil.showYesNoDialog(c, question)) {
|
if (GameActionUtil.showYesNoDialog(c, question)) {
|
||||||
final Ability pay = new Ability(c, "0") {
|
final Ability pay = new Ability(c, "0") {
|
||||||
@@ -1726,7 +1726,7 @@ public class GameActionUtil {
|
|||||||
}
|
}
|
||||||
} //end human
|
} //end human
|
||||||
else { //computer
|
else { //computer
|
||||||
if((c.getController().equals(AllZone.ComputerPlayer) && (ComputerUtil.canPayCost(noPay)))) {
|
if((c.getController().isComputer() && (ComputerUtil.canPayCost(noPay)))) {
|
||||||
final Ability computerPay = new Ability(c, "0") {
|
final Ability computerPay = new Ability(c, "0") {
|
||||||
private static final long serialVersionUID = 4820011440852868644L;
|
private static final long serialVersionUID = 4820011440852868644L;
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
@@ -1778,7 +1778,7 @@ public class GameActionUtil {
|
|||||||
if (validTargets.size() == 0)
|
if (validTargets.size() == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (player.equals(AllZone.HumanPlayer))
|
if (player.isHuman())
|
||||||
{
|
{
|
||||||
Object o = GuiUtils.getChoiceOptional("Select creature for Wall of Reverence life gain", validTargets.toArray());
|
Object o = GuiUtils.getChoiceOptional("Select creature for Wall of Reverence life gain", validTargets.toArray());
|
||||||
if (o != null) {
|
if (o != null) {
|
||||||
@@ -2127,7 +2127,7 @@ public class GameActionUtil {
|
|||||||
sb.append(c.getName()).append(" - add one mana of any color to your mana pool.");
|
sb.append(c.getName()).append(" - add one mana of any color to your mana pool.");
|
||||||
ability.setStackDescription(sb.toString());
|
ability.setStackDescription(sb.toString());
|
||||||
|
|
||||||
if(c.getController().equals(AllZone.HumanPlayer)) {
|
if(c.getController().isHuman()) {
|
||||||
if(showLandfallDialog(c)) AllZone.Stack.addSimultaneousStackEntry(ability);
|
if(showLandfallDialog(c)) AllZone.Stack.addSimultaneousStackEntry(ability);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@@ -2307,7 +2307,7 @@ public class GameActionUtil {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(src.getController().equals(AllZone.HumanPlayer)) {
|
if(src.getController().isHuman()) {
|
||||||
Object o = GuiUtils.getChoiceOptional("Select target card", list.toArray());
|
Object o = GuiUtils.getChoiceOptional("Select target card", list.toArray());
|
||||||
if(o != null) {
|
if(o != null) {
|
||||||
ability.setTargetCard((Card) o);
|
ability.setTargetCard((Card) o);
|
||||||
@@ -2511,7 +2511,7 @@ public class GameActionUtil {
|
|||||||
final Player player = crd.getController();
|
final Player player = crd.getController();
|
||||||
final Player opponent = player.getOpponent();
|
final Player opponent = player.getOpponent();
|
||||||
|
|
||||||
if(opponent.equals(AllZone.HumanPlayer))
|
if(opponent.isHuman())
|
||||||
AllZone.HumanPlayer.addPoisonCounters(poison);
|
AllZone.HumanPlayer.addPoisonCounters(poison);
|
||||||
else
|
else
|
||||||
AllZone.ComputerPlayer.addPoisonCounters(poison);
|
AllZone.ComputerPlayer.addPoisonCounters(poison);
|
||||||
@@ -2611,7 +2611,7 @@ public class GameActionUtil {
|
|||||||
|
|
||||||
private static void playerCombatDamage_Rootwater_Thief(Card c) {
|
private static void playerCombatDamage_Rootwater_Thief(Card c) {
|
||||||
SpellAbility[] sa = c.getSpellAbility();
|
SpellAbility[] sa = c.getSpellAbility();
|
||||||
if(c.getController().equals(AllZone.HumanPlayer)) AllZone.GameAction.playSpellAbility(sa[2]); //because sa[1] is the kpump u: flying
|
if(c.getController().isHuman()) AllZone.GameAction.playSpellAbility(sa[2]); //because sa[1] is the kpump u: flying
|
||||||
else ComputerUtil.playNoStack(sa[2]);
|
else ComputerUtil.playNoStack(sa[2]);
|
||||||
|
|
||||||
|
|
||||||
@@ -2619,14 +2619,14 @@ public class GameActionUtil {
|
|||||||
|
|
||||||
private static void playerCombatDamage_Treva(Card c) {
|
private static void playerCombatDamage_Treva(Card c) {
|
||||||
SpellAbility[] sa = c.getSpellAbility();
|
SpellAbility[] sa = c.getSpellAbility();
|
||||||
if(c.getController().equals(AllZone.HumanPlayer)) AllZone.GameAction.playSpellAbility(sa[1]);
|
if(c.getController().isHuman()) AllZone.GameAction.playSpellAbility(sa[1]);
|
||||||
else ComputerUtil.playNoStack(sa[1]);
|
else ComputerUtil.playNoStack(sa[1]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void playerCombatDamage_Rith(Card c) {
|
private static void playerCombatDamage_Rith(Card c) {
|
||||||
SpellAbility[] sa = c.getSpellAbility();
|
SpellAbility[] sa = c.getSpellAbility();
|
||||||
if(c.getController().equals(AllZone.HumanPlayer)) AllZone.GameAction.playSpellAbility(sa[1]);
|
if(c.getController().isHuman()) AllZone.GameAction.playSpellAbility(sa[1]);
|
||||||
else ComputerUtil.playNoStack(sa[1]);
|
else ComputerUtil.playNoStack(sa[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4012,7 +4012,7 @@ public class GameActionUtil {
|
|||||||
CardList graveyardCreatures = AllZoneUtil.getPlayerTypeInGraveyard(player, "Creature");
|
CardList graveyardCreatures = AllZoneUtil.getPlayerTypeInGraveyard(player, "Creature");
|
||||||
|
|
||||||
if(graveyardCreatures.size() >= 4) {
|
if(graveyardCreatures.size() >= 4) {
|
||||||
if(player.equals(AllZone.HumanPlayer)) {
|
if(player.isHuman()) {
|
||||||
Object o = GuiUtils.getChoiceOptional("Pick a creature to return to hand",
|
Object o = GuiUtils.getChoiceOptional("Pick a creature to return to hand",
|
||||||
graveyardCreatures.toArray());
|
graveyardCreatures.toArray());
|
||||||
if(o != null) {
|
if(o != null) {
|
||||||
@@ -4021,7 +4021,7 @@ public class GameActionUtil {
|
|||||||
AllZone.GameAction.moveToHand(card);
|
AllZone.GameAction.moveToHand(card);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(player.equals(AllZone.ComputerPlayer)) {
|
else if(player.isComputer()) {
|
||||||
Card card = graveyardCreatures.get(0);
|
Card card = graveyardCreatures.get(0);
|
||||||
AllZone.GameAction.moveToHand(card);
|
AllZone.GameAction.moveToHand(card);
|
||||||
}
|
}
|
||||||
@@ -4214,7 +4214,7 @@ public class GameActionUtil {
|
|||||||
CardList graveyardCreatures = AllZoneUtil.getPlayerTypeInGraveyard(player, "Creature");
|
CardList graveyardCreatures = AllZoneUtil.getPlayerTypeInGraveyard(player, "Creature");
|
||||||
|
|
||||||
if(AllZoneUtil.compareTypeAmountInGraveyard(player, "Creature") > 0) {
|
if(AllZoneUtil.compareTypeAmountInGraveyard(player, "Creature") > 0) {
|
||||||
if(player.equals(AllZone.HumanPlayer)) {
|
if(player.isHuman()) {
|
||||||
Object o = GuiUtils.getChoiceOptional("Pick a creature to return to hand",
|
Object o = GuiUtils.getChoiceOptional("Pick a creature to return to hand",
|
||||||
graveyardCreatures.toArray());
|
graveyardCreatures.toArray());
|
||||||
if(o != null) {
|
if(o != null) {
|
||||||
@@ -4223,7 +4223,7 @@ public class GameActionUtil {
|
|||||||
AllZone.GameAction.moveToHand(card);
|
AllZone.GameAction.moveToHand(card);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(player.equals(AllZone.ComputerPlayer)) {
|
else if(player.isComputer()) {
|
||||||
Card card = graveyardCreatures.get(0);
|
Card card = graveyardCreatures.get(0);
|
||||||
|
|
||||||
AllZone.GameAction.moveToHand(card);
|
AllZone.GameAction.moveToHand(card);
|
||||||
@@ -4890,7 +4890,7 @@ public class GameActionUtil {
|
|||||||
ability = new Ability(crd, "0") {
|
ability = new Ability(crd, "0") {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if(crd.getController().equals(AllZone.HumanPlayer)) {
|
if(crd.getController().isHuman()) {
|
||||||
if(AllZone.Human_Hand.getCards().length == 0) AllZone.GameAction.sacrifice(crd);
|
if(AllZone.Human_Hand.getCards().length == 0) AllZone.GameAction.sacrifice(crd);
|
||||||
else AllZone.InputControl.setInput(discard);
|
else AllZone.InputControl.setInput(discard);
|
||||||
} else //comp
|
} else //comp
|
||||||
@@ -5066,7 +5066,7 @@ public class GameActionUtil {
|
|||||||
|
|
||||||
//System.out.println("Creats size: " + creats.size());
|
//System.out.println("Creats size: " + creats.size());
|
||||||
|
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
Object o = null;
|
Object o = null;
|
||||||
int creatsSize = creats.size();
|
int creatsSize = creats.size();
|
||||||
|
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ public class MagicStack extends MyObservable {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Card crd = sa.getSourceCard();
|
Card crd = sa.getSourceCard();
|
||||||
if (sp.getSourceCard().getController().equals(AllZone.HumanPlayer)) {
|
if (sp.getSourceCard().getController().isHuman()) {
|
||||||
AllZone.InputControl.setInput(new Input_PayManaCost_Ability("Pay X cost for " +
|
AllZone.InputControl.setInput(new Input_PayManaCost_Ability("Pay X cost for " +
|
||||||
sp.getSourceCard().getName() + " (X=" + crd.getXManaCostPaid() + ")\r\n",
|
sp.getSourceCard().getName() + " (X=" + crd.getXManaCostPaid() + ")\r\n",
|
||||||
ability.getManaCost(), paidCommand, unpaidCommand, true));
|
ability.getManaCost(), paidCommand, unpaidCommand, true));
|
||||||
@@ -536,7 +536,7 @@ public class MagicStack extends MyObservable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void selectCard(Card c, PlayerZone zone) {
|
public void selectCard(Card c, PlayerZone zone) {
|
||||||
if(zone.is(Constant.Zone.Battlefield) && c.getController().equals(AllZone.HumanPlayer)
|
if(zone.is(Constant.Zone.Battlefield) && c.getController().isHuman()
|
||||||
&& c.isLand()) {
|
&& c.isLand()) {
|
||||||
AllZone.GameAction.sacrifice(c);
|
AllZone.GameAction.sacrifice(c);
|
||||||
stop();
|
stop();
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ public class Phase extends MyObservable
|
|||||||
if (vaults.size() > 0){
|
if (vaults.size() > 0){
|
||||||
final Card crd = vaults.get(0);
|
final Card crd = vaults.get(0);
|
||||||
|
|
||||||
if(turn.equals(AllZone.HumanPlayer)) {
|
if(turn.isHuman()) {
|
||||||
if(GameActionUtil.showYesNoDialog(crd, "Untap " + crd + "?")) {
|
if(GameActionUtil.showYesNoDialog(crd, "Untap " + crd + "?")) {
|
||||||
crd.untap();
|
crd.untap();
|
||||||
turn = extraTurns.isEmpty() ? turn.getOpponent() : extraTurns.pop();
|
turn = extraTurns.isEmpty() ? turn.getOpponent() : extraTurns.pop();
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ public class PhaseUtil {
|
|||||||
//end opponent untapping during your untap phase
|
//end opponent untapping during your untap phase
|
||||||
|
|
||||||
if( canOnlyUntapOneLand()) {
|
if( canOnlyUntapOneLand()) {
|
||||||
if( AllZone.Phase.getPlayerTurn().equals(AllZone.ComputerPlayer)) {
|
if( AllZone.Phase.getPlayerTurn().isComputer()) {
|
||||||
//search for lands the computer has and only untap 1
|
//search for lands the computer has and only untap 1
|
||||||
CardList landList = AllZoneUtil.getPlayerLandsInPlay(AllZone.ComputerPlayer);
|
CardList landList = AllZoneUtil.getPlayerLandsInPlay(AllZone.ComputerPlayer);
|
||||||
landList = landList.filter(AllZoneUtil.tapped);
|
landList = landList.filter(AllZoneUtil.tapped);
|
||||||
@@ -196,7 +196,7 @@ public class PhaseUtil {
|
|||||||
public void selectButtonCancel() {stop();}
|
public void selectButtonCancel() {stop();}
|
||||||
public void selectCard(Card c, PlayerZone zone) {
|
public void selectCard(Card c, PlayerZone zone) {
|
||||||
if(c.isArtifact() && zone.is(Constant.Zone.Battlefield)
|
if(c.isArtifact() && zone.is(Constant.Zone.Battlefield)
|
||||||
&& c.getController().equals(AllZone.HumanPlayer)) {
|
&& c.getController().isHuman()) {
|
||||||
c.untap();
|
c.untap();
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
@@ -211,7 +211,7 @@ public class PhaseUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if((AllZoneUtil.isCardInPlay("Smoke") || AllZoneUtil.isCardInPlay("Stoic Angel")) ) {
|
if((AllZoneUtil.isCardInPlay("Smoke") || AllZoneUtil.isCardInPlay("Stoic Angel")) ) {
|
||||||
if( AllZone.Phase.getPlayerTurn().equals(AllZone.ComputerPlayer) ) {
|
if( AllZone.Phase.getPlayerTurn().isComputer() ) {
|
||||||
CardList creatures = AllZoneUtil.getCreaturesInPlay(AllZone.ComputerPlayer);
|
CardList creatures = AllZoneUtil.getCreaturesInPlay(AllZone.ComputerPlayer);
|
||||||
creatures = creatures.filter(AllZoneUtil.tapped);
|
creatures = creatures.filter(AllZoneUtil.tapped);
|
||||||
if( creatures.size() > 0 ) {
|
if( creatures.size() > 0 ) {
|
||||||
@@ -228,7 +228,7 @@ public class PhaseUtil {
|
|||||||
public void selectButtonCancel() {stop();}
|
public void selectButtonCancel() {stop();}
|
||||||
public void selectCard(Card c, PlayerZone zone) {
|
public void selectCard(Card c, PlayerZone zone) {
|
||||||
if(c.isCreature() && zone.is(Constant.Zone.Battlefield)
|
if(c.isCreature() && zone.is(Constant.Zone.Battlefield)
|
||||||
&& c.getController().equals(AllZone.HumanPlayer)) {
|
&& c.getController().isHuman()) {
|
||||||
c.untap();
|
c.untap();
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class RunTest
|
|||||||
CardFactory cf = AllZone.CardFactory;
|
CardFactory cf = AllZone.CardFactory;
|
||||||
//********* test Card
|
//********* test Card
|
||||||
c = cf.getCard("Elvish Warrior", AllZone.ComputerPlayer);
|
c = cf.getCard("Elvish Warrior", AllZone.ComputerPlayer);
|
||||||
check("1", c.getOwner().equals(AllZone.ComputerPlayer));
|
check("1", c.getOwner().isComputer());
|
||||||
check("1.1", c.getName().equals("Elvish Warrior"));
|
check("1.1", c.getName().equals("Elvish Warrior"));
|
||||||
check("2", c.getManaCost().equals("G G"));
|
check("2", c.getManaCost().equals("G G"));
|
||||||
check("2.1", c.getType().contains("Creature"));
|
check("2.1", c.getType().contains("Creature"));
|
||||||
|
|||||||
@@ -942,7 +942,7 @@ public class AbilityFactory_Counters {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (AF.getHostCard().getController().equals(AllZone.HumanPlayer)) {
|
if (AF.getHostCard().getController().isHuman()) {
|
||||||
cperms.addAll(hperms.toArray());
|
cperms.addAll(hperms.toArray());
|
||||||
final CardList unchosen = cperms;
|
final CardList unchosen = cperms;
|
||||||
AllZone.InputControl.setInput(new Input() {
|
AllZone.InputControl.setInput(new Input() {
|
||||||
@@ -974,12 +974,12 @@ public class AbilityFactory_Counters {
|
|||||||
boolean selHuman = false;
|
boolean selHuman = false;
|
||||||
@Override
|
@Override
|
||||||
public void selectPlayer(Player player) {
|
public void selectPlayer(Player player) {
|
||||||
if (player.equals(AllZone.HumanPlayer) && selHuman == false) {
|
if (player.isHuman() && selHuman == false) {
|
||||||
selHuman = true;
|
selHuman = true;
|
||||||
if (AllZone.HumanPlayer.getPoisonCounters() > 0)
|
if (AllZone.HumanPlayer.getPoisonCounters() > 0)
|
||||||
AllZone.HumanPlayer.addPoisonCounters(1);
|
AllZone.HumanPlayer.addPoisonCounters(1);
|
||||||
}
|
}
|
||||||
if (player.equals(AllZone.ComputerPlayer) && selComputer == false) {
|
if (player.isComputer() && selComputer == false) {
|
||||||
selComputer = true;
|
selComputer = true;
|
||||||
if (AllZone.ComputerPlayer.getPoisonCounters() > 0)
|
if (AllZone.ComputerPlayer.getPoisonCounters() > 0)
|
||||||
AllZone.ComputerPlayer.addPoisonCounters(1);
|
AllZone.ComputerPlayer.addPoisonCounters(1);
|
||||||
|
|||||||
@@ -1044,12 +1044,12 @@ public class AbilityFactory_PermanentState {
|
|||||||
if(validTappables.size() > 0) {
|
if(validTappables.size() > 0) {
|
||||||
CardList human = validTappables.filter(new CardListFilter() {
|
CardList human = validTappables.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
return c.getController().equals(AllZone.HumanPlayer);
|
return c.getController().isHuman();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
CardList compy = validTappables.filter(new CardListFilter() {
|
CardList compy = validTappables.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
return c.getController().equals(AllZone.HumanPlayer);
|
return c.getController().isHuman();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(human.size() > compy.size()) {
|
if(human.size() > compy.size()) {
|
||||||
@@ -1113,12 +1113,12 @@ public class AbilityFactory_PermanentState {
|
|||||||
if(validTappables.size() > 0) {
|
if(validTappables.size() > 0) {
|
||||||
CardList human = validTappables.filter(new CardListFilter() {
|
CardList human = validTappables.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
return c.getController().equals(AllZone.HumanPlayer);
|
return c.getController().isHuman();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
CardList compy = validTappables.filter(new CardListFilter() {
|
CardList compy = validTappables.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
return c.getController().equals(AllZone.HumanPlayer);
|
return c.getController().isHuman();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(human.size() > compy.size()) {
|
if(human.size() > compy.size()) {
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ public class AbilityFactory_ZoneAffecting {
|
|||||||
|
|
||||||
if (tgt != null){
|
if (tgt != null){
|
||||||
ArrayList<Player> players = tgt.getTargetPlayers();
|
ArrayList<Player> players = tgt.getTargetPlayers();
|
||||||
if (players.size() > 0 && players.get(0).equals(AllZone.HumanPlayer))
|
if (players.size() > 0 && players.get(0).isHuman())
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -829,9 +829,8 @@ public class AbilityFactory_ZoneAffecting {
|
|||||||
|
|
||||||
else if(mode.equals("RevealYouChoose") || mode.equals("RevealOppChoose")) {
|
else if(mode.equals("RevealYouChoose") || mode.equals("RevealOppChoose")) {
|
||||||
// Is Reveal you choose right? I think the wrong player is being used?
|
// Is Reveal you choose right? I think the wrong player is being used?
|
||||||
PlayerZone pzH = AllZone.getZone(Constant.Zone.Hand, p);
|
CardList dPHand = AllZoneUtil.getPlayerHand(p);
|
||||||
if(pzH.size() != 0) {
|
if(dPHand.size() != 0) {
|
||||||
CardList dPHand = new CardList(pzH.getCards());
|
|
||||||
CardList dPChHand = new CardList(dPHand.toArray());
|
CardList dPChHand = new CardList(dPHand.toArray());
|
||||||
|
|
||||||
if (params.containsKey("DiscardValid")) { // Restrict card choices
|
if (params.containsKey("DiscardValid")) { // Restrict card choices
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ public class CardFactory implements NewConstants {
|
|||||||
if(sa.isReplicate()) copySA.setIsReplicate(true);
|
if(sa.isReplicate()) copySA.setIsReplicate(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(source.getController().equals(AllZone.HumanPlayer))
|
if(source.getController().isHuman())
|
||||||
AllZone.GameAction.playSpellAbilityForFree(copySA);
|
AllZone.GameAction.playSpellAbilityForFree(copySA);
|
||||||
|
|
||||||
else if(copySA.canPlayAI())
|
else if(copySA.canPlayAI())
|
||||||
@@ -328,12 +328,12 @@ public class CardFactory implements NewConstants {
|
|||||||
copySA.setTargetCard(sa.getTargetCard());
|
copySA.setTargetCard(sa.getTargetCard());
|
||||||
|
|
||||||
if(sa.getTargetPlayer() != null) {
|
if(sa.getTargetPlayer() != null) {
|
||||||
if(sa.getTargetPlayer().equals(AllZone.HumanPlayer)
|
if(sa.getTargetPlayer().isHuman()
|
||||||
|| (sa.getTargetPlayer().equals(AllZone.ComputerPlayer)))
|
|| (sa.getTargetPlayer().isComputer()))
|
||||||
copySA.setTargetPlayer(sa.getTargetPlayer());
|
copySA.setTargetPlayer(sa.getTargetPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(source.getController().equals(AllZone.HumanPlayer))
|
if(source.getController().isHuman())
|
||||||
AllZone.GameAction.playSpellAbilityForFree(copySA);
|
AllZone.GameAction.playSpellAbilityForFree(copySA);
|
||||||
|
|
||||||
else if(copySA.canPlayAI())
|
else if(copySA.canPlayAI())
|
||||||
@@ -821,7 +821,7 @@ public class CardFactory implements NewConstants {
|
|||||||
|
|
||||||
//System.out.println("Creats size: " + creats.size());
|
//System.out.println("Creats size: " + creats.size());
|
||||||
|
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
if (creats.size() > 0)
|
if (creats.size() > 0)
|
||||||
{
|
{
|
||||||
List<Card> selection = GuiUtils.getChoicesOptional("Select creatures to sacrifice", creats.toArray());
|
List<Card> selection = GuiUtils.getChoicesOptional("Select creatures to sacrifice", creats.toArray());
|
||||||
@@ -895,7 +895,7 @@ public class CardFactory implements NewConstants {
|
|||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
// Target as Modular is Destroyed
|
// Target as Modular is Destroyed
|
||||||
if(card.getController().equals(AllZone.ComputerPlayer)) {
|
if(card.getController().isComputer()) {
|
||||||
CardList choices = new CardList(AllZone.Computer_Battlefield.getCards()).filter(new CardListFilter() {
|
CardList choices = new CardList(AllZone.Computer_Battlefield.getCards()).filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
return c.isCreature() && c.isArtifact();
|
return c.isCreature() && c.isArtifact();
|
||||||
@@ -1090,7 +1090,7 @@ public class CardFactory implements NewConstants {
|
|||||||
final SpellAbility ability = new Ability_Static(card, "0") {
|
final SpellAbility ability = new Ability_Static(card, "0") {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if(player.equals(AllZone.HumanPlayer)) {
|
if(player.isHuman()) {
|
||||||
input[0] = JOptionPane.showInputDialog(null, "Which creature type?", "Pick type",
|
input[0] = JOptionPane.showInputDialog(null, "Which creature type?", "Pick type",
|
||||||
JOptionPane.QUESTION_MESSAGE);
|
JOptionPane.QUESTION_MESSAGE);
|
||||||
|
|
||||||
@@ -1139,11 +1139,11 @@ public class CardFactory implements NewConstants {
|
|||||||
String imageName = "";
|
String imageName = "";
|
||||||
String color = "";
|
String color = "";
|
||||||
|
|
||||||
if(player.equals(AllZone.ComputerPlayer)) {
|
if(player.isComputer()) {
|
||||||
type = "Thrull";
|
type = "Thrull";
|
||||||
imageName = "B 1 1 Thrull";
|
imageName = "B 1 1 Thrull";
|
||||||
color = "B";
|
color = "B";
|
||||||
} else if(player.equals(AllZone.HumanPlayer)) {
|
} else if(player.isHuman()) {
|
||||||
Object q = GuiUtils.getChoiceOptional("Select type of creature", choices);
|
Object q = GuiUtils.getChoiceOptional("Select type of creature", choices);
|
||||||
if(q != null){
|
if(q != null){
|
||||||
if(q.equals("Citizen")) {
|
if(q.equals("Citizen")) {
|
||||||
@@ -1452,7 +1452,7 @@ public class CardFactory implements NewConstants {
|
|||||||
{
|
{
|
||||||
CardList newGrave;
|
CardList newGrave;
|
||||||
Card c = (Card)o;
|
Card c = (Card)o;
|
||||||
if (c.getOwner().equals(AllZone.HumanPlayer)){
|
if (c.getOwner().isHuman()){
|
||||||
newGrave = AllZoneUtil.getPlayerGraveyard(AllZone.HumanPlayer);
|
newGrave = AllZoneUtil.getPlayerGraveyard(AllZone.HumanPlayer);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -1744,7 +1744,7 @@ public class CardFactory implements NewConstants {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
return card.getController().equals(AllZone.HumanPlayer) && AllZone.ComputerPlayer.getLife() >= 9 &&
|
return card.getController().isHuman() && AllZone.ComputerPlayer.getLife() >= 9 &&
|
||||||
super.canPlay() && AllZone.Computer_Hand.size() > 0;
|
super.canPlay() && AllZone.Computer_Hand.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1790,7 +1790,7 @@ public class CardFactory implements NewConstants {
|
|||||||
final SpellAbility ability = new Ability(card, "0") {
|
final SpellAbility ability = new Ability(card, "0") {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
if(AllZone.Human_Hand.getCards().length == 0) AllZone.GameAction.sacrifice(card);
|
if(AllZone.Human_Hand.getCards().length == 0) AllZone.GameAction.sacrifice(card);
|
||||||
else AllZone.InputControl.setInput(discard);
|
else AllZone.InputControl.setInput(discard);
|
||||||
} else {
|
} else {
|
||||||
@@ -1977,7 +1977,7 @@ public class CardFactory implements NewConstants {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Card c = copyCard(getSourceCard().getAttachedCards()[0]);
|
Card c = copyCard(getSourceCard().getAttachedCards()[0]);
|
||||||
if(getSourceCard().getController().equals(AllZone.ComputerPlayer))
|
if(getSourceCard().getController().isComputer())
|
||||||
{
|
{
|
||||||
for(SpellAbility sa:getSourceCard().getAttachedCards()[0].getSpellAbility())
|
for(SpellAbility sa:getSourceCard().getAttachedCards()[0].getSpellAbility())
|
||||||
if(sa.canPlayAI())
|
if(sa.canPlayAI())
|
||||||
@@ -2046,7 +2046,7 @@ public class CardFactory implements NewConstants {
|
|||||||
final SpellAbility ability = new Ability(card, "0") {
|
final SpellAbility ability = new Ability(card, "0") {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
if(AllZone.Human_Hand.getCards().length > 0)
|
if(AllZone.Human_Hand.getCards().length > 0)
|
||||||
AllZone.InputControl.setInput(exile);
|
AllZone.InputControl.setInput(exile);
|
||||||
} else {
|
} else {
|
||||||
@@ -2179,7 +2179,7 @@ public class CardFactory implements NewConstants {
|
|||||||
|
|
||||||
CardList lands = new CardList(grave.getCards());
|
CardList lands = new CardList(grave.getCards());
|
||||||
lands = lands.filter(AllZoneUtil.basicLands);
|
lands = lands.filter(AllZoneUtil.basicLands);
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)){
|
if(card.getController().isHuman()){
|
||||||
//now, select up to four lands
|
//now, select up to four lands
|
||||||
int end = -1;
|
int end = -1;
|
||||||
end = Math.min(lands.size(), limit);
|
end = Math.min(lands.size(), limit);
|
||||||
@@ -2326,7 +2326,7 @@ public class CardFactory implements NewConstants {
|
|||||||
final Ability ability = new Ability(card, "0") {
|
final Ability ability = new Ability(card, "0") {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
|
|
||||||
String color = "";
|
String color = "";
|
||||||
String[] colors = Constant.Color.Colors;
|
String[] colors = Constant.Color.Colors;
|
||||||
@@ -2422,7 +2422,7 @@ public class CardFactory implements NewConstants {
|
|||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
String chosenType = "";
|
String chosenType = "";
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
chosenType = JOptionPane.showInputDialog(null, "Enter a creature type:", card.getName(),
|
chosenType = JOptionPane.showInputDialog(null, "Enter a creature type:", card.getName(),
|
||||||
JOptionPane.QUESTION_MESSAGE);
|
JOptionPane.QUESTION_MESSAGE);
|
||||||
}
|
}
|
||||||
@@ -2671,7 +2671,7 @@ public class CardFactory implements NewConstants {
|
|||||||
final String[] input = new String[1];
|
final String[] input = new String[1];
|
||||||
CardList allCards = factory.getAllCards();
|
CardList allCards = factory.getAllCards();
|
||||||
input[0] = "";
|
input[0] = "";
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
while(input[0] == "")
|
while(input[0] == "")
|
||||||
{
|
{
|
||||||
input[0] = JOptionPane.showInputDialog(null, "Which source?", "Pick a card",JOptionPane.QUESTION_MESSAGE);
|
input[0] = JOptionPane.showInputDialog(null, "Which source?", "Pick a card",JOptionPane.QUESTION_MESSAGE);
|
||||||
@@ -3439,13 +3439,13 @@ public class CardFactory implements NewConstants {
|
|||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
Log.debug("HandSize", "Control changed: " + card.getController());
|
Log.debug("HandSize", "Control changed: " + card.getController());
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
AllZone.HumanPlayer.removeHandSizeOperation(Integer.parseInt(card.getSVar("HSStamp")));
|
AllZone.HumanPlayer.removeHandSizeOperation(Integer.parseInt(card.getSVar("HSStamp")));
|
||||||
AllZone.ComputerPlayer.addHandSizeOperation(new HandSizeOp(Mode,Amount,Integer.parseInt(card.getSVar("HSStamp"))));
|
AllZone.ComputerPlayer.addHandSizeOperation(new HandSizeOp(Mode,Amount,Integer.parseInt(card.getSVar("HSStamp"))));
|
||||||
|
|
||||||
AllZone.ComputerPlayer.sortHandSizeOperations();
|
AllZone.ComputerPlayer.sortHandSizeOperations();
|
||||||
}
|
}
|
||||||
else if(card.getController().equals(AllZone.ComputerPlayer)) {
|
else if(card.getController().isComputer()) {
|
||||||
AllZone.ComputerPlayer.removeHandSizeOperation(Integer.parseInt(card.getSVar("HSStamp")));
|
AllZone.ComputerPlayer.removeHandSizeOperation(Integer.parseInt(card.getSVar("HSStamp")));
|
||||||
AllZone.HumanPlayer.addHandSizeOperation(new HandSizeOp(Mode,Amount,Integer.parseInt(card.getSVar("HSStamp"))));
|
AllZone.HumanPlayer.addHandSizeOperation(new HandSizeOp(Mode,Amount,Integer.parseInt(card.getSVar("HSStamp"))));
|
||||||
|
|
||||||
|
|||||||
@@ -1132,7 +1132,7 @@ public class CardFactoryUtil {
|
|||||||
}
|
}
|
||||||
if(mercs.size() == 0) return;
|
if(mercs.size() == 0) return;
|
||||||
|
|
||||||
if(sourceCard.getController().equals(AllZone.ComputerPlayer)) {
|
if(sourceCard.getController().isComputer()) {
|
||||||
Card merc = AI_getBestCreature(mercs);
|
Card merc = AI_getBestCreature(mercs);
|
||||||
AllZone.GameAction.moveToPlay(merc);
|
AllZone.GameAction.moveToPlay(merc);
|
||||||
} else //human
|
} else //human
|
||||||
@@ -1226,7 +1226,7 @@ public class CardFactoryUtil {
|
|||||||
}
|
}
|
||||||
if(rebels.size() == 0) return;
|
if(rebels.size() == 0) return;
|
||||||
|
|
||||||
if(sourceCard.getController().equals(AllZone.ComputerPlayer)) {
|
if(sourceCard.getController().isComputer()) {
|
||||||
Card rebel = AI_getBestCreature(rebels);
|
Card rebel = AI_getBestCreature(rebels);
|
||||||
AllZone.GameAction.moveToPlay(rebel);
|
AllZone.GameAction.moveToPlay(rebel);
|
||||||
} else //human
|
} else //human
|
||||||
@@ -3910,7 +3910,7 @@ public class CardFactoryUtil {
|
|||||||
if (d[0].contains("UntapUpTo")) // 8/10
|
if (d[0].contains("UntapUpTo")) // 8/10
|
||||||
{
|
{
|
||||||
int n = Integer.parseInt(d[1]);
|
int n = Integer.parseInt(d[1]);
|
||||||
if (dbPlayer.equals(AllZone.HumanPlayer))
|
if (dbPlayer.isHuman())
|
||||||
AllZone.InputControl.setInput(CardFactoryUtil.input_UntapUpToNType(n, d[2]));
|
AllZone.InputControl.setInput(CardFactoryUtil.input_UntapUpToNType(n, d[2]));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ public class CardFactory_Creatures {
|
|||||||
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player);
|
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player);
|
||||||
Card c = lib.get(0);
|
Card c = lib.get(0);
|
||||||
|
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
if(GameActionUtil.showYesNoDialog(card, "Mill "+c.getName()+"?")) {
|
if(GameActionUtil.showYesNoDialog(card, "Mill "+c.getName()+"?")) {
|
||||||
AllZone.GameAction.moveToGraveyard(c);
|
AllZone.GameAction.moveToGraveyard(c);
|
||||||
}
|
}
|
||||||
@@ -774,7 +774,7 @@ public class CardFactory_Creatures {
|
|||||||
};//Input target
|
};//Input target
|
||||||
|
|
||||||
|
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
CardList artifacts = AllZoneUtil.getPlayerTypeInPlay(AllZone.HumanPlayer, "Artifact");
|
CardList artifacts = AllZoneUtil.getPlayerTypeInPlay(AllZone.HumanPlayer, "Artifact");
|
||||||
|
|
||||||
if(artifacts.size() != 0) AllZone.InputControl.setInput(target);
|
if(artifacts.size() != 0) AllZone.InputControl.setInput(target);
|
||||||
@@ -929,7 +929,7 @@ public class CardFactory_Creatures {
|
|||||||
if(creature.size() == 0) {
|
if(creature.size() == 0) {
|
||||||
AllZone.GameAction.sacrifice(card);
|
AllZone.GameAction.sacrifice(card);
|
||||||
return;
|
return;
|
||||||
} else if(s.equals(AllZone.HumanPlayer)) AllZone.InputControl.setInput(inputComes);
|
} else if(s.isHuman()) AllZone.InputControl.setInput(inputComes);
|
||||||
else //computer
|
else //computer
|
||||||
{
|
{
|
||||||
Card target;
|
Card target;
|
||||||
@@ -1469,7 +1469,7 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
index[0] = 0;
|
index[0] = 0;
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) AllZone.InputControl.setInput(input);
|
if(card.getController().isHuman()) AllZone.InputControl.setInput(input);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1785,7 +1785,7 @@ public class CardFactory_Creatures {
|
|||||||
if(AllZoneUtil.isCardInPlay(card)) {
|
if(AllZoneUtil.isCardInPlay(card)) {
|
||||||
card.addTempAttackBoost(1);
|
card.addTempAttackBoost(1);
|
||||||
card.addTempDefenseBoost(1);
|
card.addTempDefenseBoost(1);
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
String[] colors = Constant.Color.onlyColors;
|
String[] colors = Constant.Color.onlyColors;
|
||||||
|
|
||||||
Object o = GuiUtils.getChoice("Choose color", colors);
|
Object o = GuiUtils.getChoice("Choose color", colors);
|
||||||
@@ -1863,7 +1863,7 @@ public class CardFactory_Creatures {
|
|||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if(AllZoneUtil.isCardInPlay(card)) {
|
if(AllZoneUtil.isCardInPlay(card)) {
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
String[] colors = Constant.Color.onlyColors;
|
String[] colors = Constant.Color.onlyColors;
|
||||||
|
|
||||||
Object o = GuiUtils.getChoice("Choose color", colors);
|
Object o = GuiUtils.getChoice("Choose color", colors);
|
||||||
@@ -1938,7 +1938,7 @@ public class CardFactory_Creatures {
|
|||||||
private static final long serialVersionUID = -2823505283781217181L;
|
private static final long serialVersionUID = -2823505283781217181L;
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) AllZone.InputControl.setInput(CardFactoryUtil.input_targetCreature(ability));
|
if(card.getController().isHuman()) AllZone.InputControl.setInput(CardFactoryUtil.input_targetCreature(ability));
|
||||||
else if(ability.canPlayAI()) {
|
else if(ability.canPlayAI()) {
|
||||||
ability.chooseTargetAI();
|
ability.chooseTargetAI();
|
||||||
//need to add this to the stack
|
//need to add this to the stack
|
||||||
@@ -1962,7 +1962,7 @@ public class CardFactory_Creatures {
|
|||||||
private static final long serialVersionUID = 333134223161L;
|
private static final long serialVersionUID = 333134223161L;
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
String[] colors = Constant.Color.onlyColors;
|
String[] colors = Constant.Color.onlyColors;
|
||||||
|
|
||||||
Object o = GuiUtils.getChoice("Choose color", colors);
|
Object o = GuiUtils.getChoice("Choose color", colors);
|
||||||
@@ -2442,7 +2442,7 @@ public class CardFactory_Creatures {
|
|||||||
CardList cards = new CardList(lib.getCards());
|
CardList cards = new CardList(lib.getCards());
|
||||||
|
|
||||||
if(cards.size() > 0) {
|
if(cards.size() > 0) {
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
Object o = GuiUtils.getChoiceOptional("Select card to remove: ",
|
Object o = GuiUtils.getChoiceOptional("Select card to remove: ",
|
||||||
cards.toArray());
|
cards.toArray());
|
||||||
Card c = (Card) o;
|
Card c = (Card) o;
|
||||||
@@ -2479,7 +2479,7 @@ public class CardFactory_Creatures {
|
|||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
int lifeGain = 0;
|
int lifeGain = 0;
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
String choices[] = {"white", "blue", "black", "red", "green"};
|
String choices[] = {"white", "blue", "black", "red", "green"};
|
||||||
Object o = GuiUtils.getChoiceOptional("Select Color: ", choices);
|
Object o = GuiUtils.getChoiceOptional("Select Color: ", choices);
|
||||||
Log.debug("Treva, the Renewer", "Color:" + o);
|
Log.debug("Treva, the Renewer", "Color:" + o);
|
||||||
@@ -2518,7 +2518,7 @@ public class CardFactory_Creatures {
|
|||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
int numberTokens = 0;
|
int numberTokens = 0;
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
String choices[] = {"white", "blue", "black", "red", "green"};
|
String choices[] = {"white", "blue", "black", "red", "green"};
|
||||||
Object o = GuiUtils.getChoiceOptional("Select Color: ", choices);
|
Object o = GuiUtils.getChoiceOptional("Select Color: ", choices);
|
||||||
//System.out.println("Color:" + o);
|
//System.out.println("Color:" + o);
|
||||||
@@ -2781,7 +2781,7 @@ public class CardFactory_Creatures {
|
|||||||
CardList sins = new CardList(graveyard.getCards());
|
CardList sins = new CardList(graveyard.getCards());
|
||||||
sins = sins.getType("Assassin");
|
sins = sins.getType("Assassin");
|
||||||
|
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
Object o = GuiUtils.getChoiceOptional("Select an Assassin to exile", sins.toArray());
|
Object o = GuiUtils.getChoiceOptional("Select an Assassin to exile", sins.toArray());
|
||||||
|
|
||||||
if(o != null) {
|
if(o != null) {
|
||||||
@@ -3240,7 +3240,7 @@ public class CardFactory_Creatures {
|
|||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
|
|
||||||
if (card.getController().equals(AllZone.HumanPlayer)) {
|
if (card.getController().isHuman()) {
|
||||||
StringBuilder question = new StringBuilder();
|
StringBuilder question = new StringBuilder();
|
||||||
if (card.getName().equals("Academy Rector")) {
|
if (card.getName().equals("Academy Rector")) {
|
||||||
question.append("Exile ").append(card.getName()).append(" and place ");
|
question.append("Exile ").append(card.getName()).append(" and place ");
|
||||||
@@ -3442,7 +3442,7 @@ public class CardFactory_Creatures {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if(list.size() > 0) {
|
if(list.size() > 0) {
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
GuiUtils.getChoiceOptional("Revealing hand", list.toArray());
|
GuiUtils.getChoiceOptional("Revealing hand", list.toArray());
|
||||||
if(nonLandList.size() > 0) {
|
if(nonLandList.size() > 0) {
|
||||||
Object o = GuiUtils.getChoiceOptional("Select nonland card",
|
Object o = GuiUtils.getChoiceOptional("Select nonland card",
|
||||||
@@ -3470,10 +3470,10 @@ public class CardFactory_Creatures {
|
|||||||
private static final long serialVersionUID = -5052568979553782714L;
|
private static final long serialVersionUID = -5052568979553782714L;
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
AllZone.InputControl.setInput(CardFactoryUtil.input_targetPlayer(ability));
|
AllZone.InputControl.setInput(CardFactoryUtil.input_targetPlayer(ability));
|
||||||
ButtonUtil.disableAll();
|
ButtonUtil.disableAll();
|
||||||
} else if(card.getController().equals(AllZone.ComputerPlayer)) {
|
} else if(card.getController().isComputer()) {
|
||||||
ability.setTargetPlayer(AllZone.HumanPlayer);
|
ability.setTargetPlayer(AllZone.HumanPlayer);
|
||||||
AllZone.Stack.addSimultaneousStackEntry(ability);
|
AllZone.Stack.addSimultaneousStackEntry(ability);
|
||||||
|
|
||||||
@@ -3569,7 +3569,7 @@ public class CardFactory_Creatures {
|
|||||||
private static final long serialVersionUID = -4246229185669164581L;
|
private static final long serialVersionUID = -4246229185669164581L;
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) AllZone.InputControl.setInput(inputComes);
|
if(card.getController().isHuman()) AllZone.InputControl.setInput(inputComes);
|
||||||
else //computer
|
else //computer
|
||||||
{
|
{
|
||||||
abilityComes.setTargetPlayer(AllZone.HumanPlayer);
|
abilityComes.setTargetPlayer(AllZone.HumanPlayer);
|
||||||
@@ -3614,7 +3614,7 @@ public class CardFactory_Creatures {
|
|||||||
final Ability ability = new Ability(card, "0") {
|
final Ability ability = new Ability(card, "0") {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
input[0] = JOptionPane.showInputDialog(null, "Which card?", "Pick card",
|
input[0] = JOptionPane.showInputDialog(null, "Which card?", "Pick card",
|
||||||
JOptionPane.QUESTION_MESSAGE);
|
JOptionPane.QUESTION_MESSAGE);
|
||||||
card.setNamedCard(input[0]);
|
card.setNamedCard(input[0]);
|
||||||
@@ -3675,7 +3675,7 @@ public class CardFactory_Creatures {
|
|||||||
private static final long serialVersionUID = 3331342605626623161L;
|
private static final long serialVersionUID = 3331342605626623161L;
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) {
|
if(card.getController().isHuman()) {
|
||||||
|
|
||||||
String color = "";
|
String color = "";
|
||||||
String[] colors = Constant.Color.Colors;
|
String[] colors = Constant.Color.Colors;
|
||||||
@@ -3978,7 +3978,7 @@ public class CardFactory_Creatures {
|
|||||||
final Ability ability = new Ability(card, "0") {
|
final Ability ability = new Ability(card, "0") {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
if (card.getController().equals(AllZone.ComputerPlayer))
|
if (card.getController().isComputer())
|
||||||
setTargetPlayer(AllZone.HumanPlayer);
|
setTargetPlayer(AllZone.HumanPlayer);
|
||||||
getTargetPlayer().sacrificeCreature();
|
getTargetPlayer().sacrificeCreature();
|
||||||
|
|
||||||
@@ -3991,7 +3991,7 @@ public class CardFactory_Creatures {
|
|||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if(card.isKicked()) {
|
if(card.isKicked()) {
|
||||||
if(card.getController().equals(AllZone.HumanPlayer)) AllZone.InputControl.setInput(CardFactoryUtil.input_targetPlayer(ability));
|
if(card.getController().isHuman()) AllZone.InputControl.setInput(CardFactoryUtil.input_targetPlayer(ability));
|
||||||
else //computer
|
else //computer
|
||||||
{
|
{
|
||||||
ability.setStackDescription("Gatekeeper of Malakir - targeting Human");
|
ability.setStackDescription("Gatekeeper of Malakir - targeting Human");
|
||||||
|
|||||||
@@ -194,11 +194,10 @@ class CardFactory_Equipment {
|
|||||||
|
|
||||||
//not changed
|
//not changed
|
||||||
CardList getCreature() {
|
CardList getCreature() {
|
||||||
CardList list = new CardList(AllZone.Computer_Battlefield.getCards());
|
CardList list = AllZoneUtil.getCreaturesInPlay(AllZone.ComputerPlayer);
|
||||||
list = list.filter(new CardListFilter() {
|
list = list.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
return c.isCreature()
|
return CardFactoryUtil.AI_doesCreatureAttack(c)
|
||||||
&& CardFactoryUtil.AI_doesCreatureAttack(c)
|
|
||||||
&& CardFactoryUtil.canTarget(card, c)
|
&& CardFactoryUtil.canTarget(card, c)
|
||||||
&& (!c.getKeyword().contains("Defender"));
|
&& (!c.getKeyword().contains("Defender"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class CardFactory_Instants {
|
|||||||
String getChosenColor() {
|
String getChosenColor() {
|
||||||
// Choose color for protection in Brave the Elements
|
// Choose color for protection in Brave the Elements
|
||||||
String color = "";
|
String color = "";
|
||||||
if (card.getController().equals(AllZone.HumanPlayer)) {
|
if (card.getController().isHuman()) {
|
||||||
|
|
||||||
// String[] colors = Constant.Color.Colors;
|
// String[] colors = Constant.Color.Colors;
|
||||||
// colors[colors.length-1] = null;
|
// colors[colors.length-1] = null;
|
||||||
@@ -474,7 +474,7 @@ public class CardFactory_Instants {
|
|||||||
|
|
||||||
GuiUtils.getChoice("Revealing top " + Count + " cards of library: ", cards.toArray());
|
GuiUtils.getChoice("Revealing top " + Count + " cards of library: ", cards.toArray());
|
||||||
//Human chooses
|
//Human chooses
|
||||||
if(card.getController().equals(AllZone.ComputerPlayer)) {
|
if(card.getController().isComputer()) {
|
||||||
for(int i = 0; i < Count; i++) {
|
for(int i = 0; i < Count; i++) {
|
||||||
if(stop == false) {
|
if(stop == false) {
|
||||||
choice = GuiUtils.getChoiceOptional("Choose cards to put into the first pile: ", cards.toArray());
|
choice = GuiUtils.getChoiceOptional("Choose cards to put into the first pile: ", cards.toArray());
|
||||||
@@ -966,7 +966,7 @@ public class CardFactory_Instants {
|
|||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
Player player = card.getController();
|
Player player = card.getController();
|
||||||
if(player.equals(AllZone.HumanPlayer)) humanResolve();
|
if(player.isHuman()) humanResolve();
|
||||||
else computerResolve();
|
else computerResolve();
|
||||||
player.shuffle();
|
player.shuffle();
|
||||||
}
|
}
|
||||||
@@ -1264,7 +1264,7 @@ public class CardFactory_Instants {
|
|||||||
CardList graveList = new CardList(grave.getCards());
|
CardList graveList = new CardList(grave.getCards());
|
||||||
int X = Math.min(max, graveList.size());
|
int X = Math.min(max, graveList.size());
|
||||||
|
|
||||||
if( player.equals(AllZone.HumanPlayer)) {
|
if( player.isHuman()) {
|
||||||
for(int i = 0; i < X; i++) {
|
for(int i = 0; i < X; i++) {
|
||||||
Object o = GuiUtils.getChoice("Remove from game", graveList.toArray());
|
Object o = GuiUtils.getChoice("Remove from game", graveList.toArray());
|
||||||
if(o == null) break;
|
if(o == null) break;
|
||||||
@@ -1377,12 +1377,12 @@ public class CardFactory_Instants {
|
|||||||
public void resolve() {
|
public void resolve() {
|
||||||
SpellAbility sa = AllZone.Stack.pop();
|
SpellAbility sa = AllZone.Stack.pop();
|
||||||
|
|
||||||
if(card.getController().equals(AllZone.HumanPlayer))
|
if(card.getController().isHuman())
|
||||||
{
|
{
|
||||||
Phase.getManaDrain_BonusMana_Human().add(CardUtil.getConvertedManaCost(sa.getSourceCard()));
|
Phase.getManaDrain_BonusMana_Human().add(CardUtil.getConvertedManaCost(sa.getSourceCard()));
|
||||||
Phase.getManaDrain_Source_Human().add(card);
|
Phase.getManaDrain_Source_Human().add(card);
|
||||||
}
|
}
|
||||||
else if(card.getController().equals(AllZone.ComputerPlayer))
|
else if(card.getController().isComputer())
|
||||||
{
|
{
|
||||||
Phase.getManaDrain_BonusMana_AI().add(CardUtil.getConvertedManaCost(sa.getSourceCard()));
|
Phase.getManaDrain_BonusMana_AI().add(CardUtil.getConvertedManaCost(sa.getSourceCard()));
|
||||||
Phase.getManaDrain_Source_AI().add(card);
|
Phase.getManaDrain_Source_AI().add(card);
|
||||||
@@ -1548,7 +1548,7 @@ public class CardFactory_Instants {
|
|||||||
public void resolve() {
|
public void resolve() {
|
||||||
CardList lands = AllZoneUtil.getPlayerLandsInPlay(getTargetPlayer());
|
CardList lands = AllZoneUtil.getPlayerLandsInPlay(getTargetPlayer());
|
||||||
for(Card c:lands) c.tap();
|
for(Card c:lands) c.tap();
|
||||||
if(getTargetPlayer().equals(AllZone.HumanPlayer)) AllZone.ManaPool.clearPool();
|
if(getTargetPlayer().isHuman()) AllZone.ManaPool.clearPool();
|
||||||
}//resolve()
|
}//resolve()
|
||||||
};//SpellAbility
|
};//SpellAbility
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class CardFactory_Lands {
|
|||||||
private static final long serialVersionUID = 7352127748114888255L;
|
private static final long serialVersionUID = 7352127748114888255L;
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if (card.getController().equals(AllZone.HumanPlayer)) humanExecute();
|
if (card.getController().isHuman()) humanExecute();
|
||||||
else computerExecute();
|
else computerExecute();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,6 +100,7 @@ class CardFactory_Lands {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
a[0] = new Ability(card, "0") {
|
a[0] = new Ability(card, "0") {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
@@ -112,60 +113,50 @@ class CardFactory_Lands {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
CardList creature = new CardList();
|
CardList creature = AllZoneUtil.getCreaturesInPlay(AllZone.ComputerPlayer);
|
||||||
PlayerZone zone = AllZone.getZone(Constant.Zone.Battlefield, AllZone.ComputerPlayer);
|
creature = creature.filter(new CardListFilter()
|
||||||
if(zone != null) {
|
{
|
||||||
creature.addAll(zone.getCards());
|
public boolean addCard(Card c)
|
||||||
creature = creature.getType("Creature");
|
|
||||||
creature = creature.filter(new CardListFilter()
|
|
||||||
{
|
{
|
||||||
public boolean addCard(Card c)
|
return CardFactoryUtil.canTarget(a[0], c) && !c.hasKeyword("Defender");
|
||||||
{
|
|
||||||
return (AllZoneUtil.isCardInPlay(c) && CardFactoryUtil.canTarget(a[0], c) && !c.hasKeyword("Defender"));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Card biggest = null;
|
|
||||||
if(creature.size() > 0) {
|
|
||||||
biggest = creature.get(0);
|
|
||||||
|
|
||||||
for(int i = 0; i < creature.size(); i++) {
|
|
||||||
if(biggest.getNetAttack() < creature.get(i).getNetAttack()) biggest = creature.get(i);
|
|
||||||
}
|
|
||||||
setTargetCard(biggest);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
Card biggest = null;
|
||||||
|
if(creature.size() > 0) {
|
||||||
|
biggest = creature.get(0);
|
||||||
|
|
||||||
|
for(int i = 0; i < creature.size(); i++) {
|
||||||
|
if(biggest.getNetAttack() < creature.get(i).getNetAttack()) biggest = creature.get(i);
|
||||||
|
}
|
||||||
|
setTargetCard(biggest);
|
||||||
|
|
||||||
}
|
}
|
||||||
PlayerZone Hzone = AllZone.getZone(Constant.Zone.Battlefield, AllZone.HumanPlayer);
|
CardList creature2 = AllZoneUtil.getCreaturesInPlay(AllZone.HumanPlayer);
|
||||||
if(zone != null) {
|
creature2 = creature2.filter(new CardListFilter()
|
||||||
CardList creature2 = new CardList();
|
{
|
||||||
creature2.addAll(Hzone.getCards());
|
public boolean addCard(Card c)
|
||||||
creature2 = creature2.getType("Creature");
|
|
||||||
creature2 = creature2.filter(new CardListFilter()
|
|
||||||
{
|
{
|
||||||
public boolean addCard(Card c)
|
return (!c.isTapped() && !CardUtil.getColors(c).contains(Constant.Color.Colorless));
|
||||||
{
|
|
||||||
return (!c.isTapped() && !CardUtil.getColors(c).contains(Constant.Color.Colorless));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Card biggest2 = null;
|
|
||||||
if(creature2.size() > 0) {
|
|
||||||
biggest2 = creature2.get(0);
|
|
||||||
for(int i = 0; i < creature2.size(); i++) {
|
|
||||||
if(biggest2.getNetAttack() < creature2.get(i).getNetAttack()) biggest2 = creature2.get(i);
|
|
||||||
}
|
|
||||||
if(biggest2 != null) {
|
|
||||||
if(biggest2.isGreen()) Color = "green";
|
|
||||||
if(biggest2.isBlue()) Color = "blue";
|
|
||||||
if(biggest2.isWhite()) Color = "white";
|
|
||||||
if(biggest2.isRed()) Color = "red";
|
|
||||||
if(biggest2.isBlack()) Color = "black";
|
|
||||||
} else {
|
|
||||||
Color = "black";
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
Color = "black";
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
Card biggest2 = null;
|
||||||
|
if(creature2.size() > 0) {
|
||||||
|
biggest2 = creature2.get(0);
|
||||||
|
for(int i = 0; i < creature2.size(); i++) {
|
||||||
|
if(biggest2.getNetAttack() < creature2.get(i).getNetAttack()) biggest2 = creature2.get(i);
|
||||||
|
}
|
||||||
|
if(biggest2 != null) {
|
||||||
|
if(biggest2.isGreen()) Color = "green";
|
||||||
|
if(biggest2.isBlue()) Color = "blue";
|
||||||
|
if(biggest2.isWhite()) Color = "white";
|
||||||
|
if(biggest2.isRed()) Color = "red";
|
||||||
|
if(biggest2.isBlack()) Color = "black";
|
||||||
|
} else {
|
||||||
|
Color = "black";
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Color = "black";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Card Target = getTargetCard();
|
Card Target = getTargetCard();
|
||||||
@@ -188,16 +179,14 @@ class CardFactory_Lands {
|
|||||||
private static final long serialVersionUID = 5055232386220487221L;
|
private static final long serialVersionUID = 5055232386220487221L;
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
CardList creats = new CardList(
|
CardList creats = AllZoneUtil.getCreaturesInPlay(card.getController());
|
||||||
AllZone.getZone(Constant.Zone.Battlefield, card.getController()).getCards());
|
|
||||||
creats = creats.getType("Creature");
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(card.getName()).append(" - target creature you control gains protection from the color of your choice until end of turn");
|
sb.append(card.getName()).append(" - target creature you control gains protection from the color of your choice until end of turn");
|
||||||
a[0].setStackDescription(sb.toString());
|
a[0].setStackDescription(sb.toString());
|
||||||
if(card.getController().isHuman()) {
|
if(card.getController().isHuman()) {
|
||||||
AllZone.InputControl.setInput(CardFactoryUtil.input_targetSpecific(a[0], creats, "Select target creature you control", false, false));
|
AllZone.InputControl.setInput(CardFactoryUtil.input_targetSpecific(a[0], creats, "Select target creature you control", false, false));
|
||||||
} else {
|
} else {
|
||||||
AllZone.Stack.addSimultaneousStackEntry(a[0]);
|
AllZone.Stack.addSimultaneousStackEntry(a[0]);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -296,18 +285,17 @@ class CardFactory_Lands {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
if(!(AllZone.Phase.getPhase().equals(Constant.Phase.Main1) && AllZone.Phase.getPlayerTurn().equals(
|
if(!(AllZone.Phase.getPhase().equals(Constant.Phase.Main1) && AllZone.Phase.getPlayerTurn().isComputer()))
|
||||||
AllZone.ComputerPlayer))) return false;
|
return false;
|
||||||
inPlay.clear();
|
inPlay.clear();
|
||||||
inPlay.addAll(AllZone.Computer_Battlefield.getCards());
|
inPlay.add(AllZoneUtil.getPlayerCardsInPlay(AllZone.ComputerPlayer));
|
||||||
return (inPlay.filter(targets).size() > 1) && super.canPlayAI();
|
return (inPlay.filter(targets).size() > 1) && super.canPlayAI();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
inPlay.clear();
|
inPlay.clear();
|
||||||
inPlay.addAll(AllZone.Human_Battlefield.getCards());
|
inPlay.add(AllZoneUtil.getCardsInPlay());
|
||||||
inPlay.addAll(AllZone.Computer_Battlefield.getCards());
|
|
||||||
for(Card targ:inPlay.filter(targets))
|
for(Card targ:inPlay.filter(targets))
|
||||||
targ.addCounter(Counters.P1P1, 1);
|
targ.addCounter(Counters.P1P1, 1);
|
||||||
}
|
}
|
||||||
@@ -388,7 +376,7 @@ class CardFactory_Lands {
|
|||||||
public void execute() {
|
public void execute() {
|
||||||
final CardList land = AllZoneUtil.getPlayerCardsInPlay(player).getValidCards(type[0], player, card);
|
final CardList land = AllZoneUtil.getPlayerCardsInPlay(player).getValidCards(type[0], player, card);
|
||||||
|
|
||||||
if( player.equals(AllZone.ComputerPlayer)) {
|
if( player.isComputer()) {
|
||||||
if( land.size() > 0 ) {
|
if( land.size() > 0 ) {
|
||||||
CardList tappedLand = new CardList(land.toArray());
|
CardList tappedLand = new CardList(land.toArray());
|
||||||
tappedLand = tappedLand.filter(AllZoneUtil.tapped);
|
tappedLand = tappedLand.filter(AllZoneUtil.tapped);
|
||||||
@@ -464,7 +452,7 @@ class CardFactory_Lands {
|
|||||||
plains = plains.getType("Land");
|
plains = plains.getType("Land");
|
||||||
plains = plains.getTapState("Untapped");
|
plains = plains.getTapState("Untapped");
|
||||||
|
|
||||||
if( player.equals(AllZone.ComputerPlayer)) {
|
if( player.isComputer()) {
|
||||||
if( plains.size() > 1 ) {
|
if( plains.size() > 1 ) {
|
||||||
CardList tappedPlains = new CardList(plains.toArray());
|
CardList tappedPlains = new CardList(plains.toArray());
|
||||||
tappedPlains = tappedPlains.getType("Basic");
|
tappedPlains = tappedPlains.getType("Basic");
|
||||||
@@ -849,7 +837,7 @@ class CardFactory_Lands {
|
|||||||
final Player player = card.getController();
|
final Player player = card.getController();
|
||||||
final CardList land = AllZoneUtil.getPlayerCardsInPlay(player).getValidCards(type[0]+".untapped", player, card);
|
final CardList land = AllZoneUtil.getPlayerCardsInPlay(player).getValidCards(type[0]+".untapped", player, card);
|
||||||
|
|
||||||
if( player.equals(AllZone.ComputerPlayer)) {
|
if( player.isComputer()) {
|
||||||
if( land.size() > 0 ) {
|
if( land.size() > 0 ) {
|
||||||
Card c = CardFactoryUtil.getWorstLand(land);
|
Card c = CardFactoryUtil.getWorstLand(land);
|
||||||
AllZone.GameAction.moveToHand(c);
|
AllZone.GameAction.moveToHand(c);
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ class CardFactory_Planeswalkers {
|
|||||||
public void execute() {
|
public void execute() {
|
||||||
Player player = card.getController();
|
Player player = card.getController();
|
||||||
CardList creatures;
|
CardList creatures;
|
||||||
if(player.equals(AllZone.HumanPlayer)) {
|
if(player.isHuman()) {
|
||||||
creatures = new CardList(AllZone.Human_Battlefield.getCards());
|
creatures = new CardList(AllZone.Human_Battlefield.getCards());
|
||||||
} else {
|
} else {
|
||||||
creatures = new CardList(AllZone.Computer_Battlefield.getCards());
|
creatures = new CardList(AllZone.Computer_Battlefield.getCards());
|
||||||
@@ -281,7 +281,7 @@ class CardFactory_Planeswalkers {
|
|||||||
|
|
||||||
Player player = card.getController();
|
Player player = card.getController();
|
||||||
CardList creatures;
|
CardList creatures;
|
||||||
if(player.equals(AllZone.HumanPlayer)) {
|
if(player.isHuman()) {
|
||||||
creatures = new CardList(AllZone.Human_Battlefield.getCards());
|
creatures = new CardList(AllZone.Human_Battlefield.getCards());
|
||||||
} else {
|
} else {
|
||||||
creatures = new CardList(AllZone.Computer_Battlefield.getCards());
|
creatures = new CardList(AllZone.Computer_Battlefield.getCards());
|
||||||
@@ -1016,7 +1016,7 @@ class CardFactory_Planeswalkers {
|
|||||||
|
|
||||||
Card c = lib.get(0);
|
Card c = lib.get(0);
|
||||||
|
|
||||||
if (card.getController().equals(AllZone.HumanPlayer)) {
|
if (card.getController().isHuman()) {
|
||||||
StringBuilder question = new StringBuilder();
|
StringBuilder question = new StringBuilder();
|
||||||
question.append("Put the card ").append(c).append(" on the bottom of the ");
|
question.append("Put the card ").append(c).append(" on the bottom of the ");
|
||||||
question.append(c.getController()).append("'s library?");
|
question.append(c.getController()).append("'s library?");
|
||||||
@@ -1067,7 +1067,7 @@ class CardFactory_Planeswalkers {
|
|||||||
card.getController().drawCards(3);
|
card.getController().drawCards(3);
|
||||||
|
|
||||||
Player player = card.getController();
|
Player player = card.getController();
|
||||||
if(player.equals(AllZone.HumanPlayer)) humanResolve();
|
if(player.isHuman()) humanResolve();
|
||||||
//else
|
//else
|
||||||
// computerResolve();
|
// computerResolve();
|
||||||
}
|
}
|
||||||
@@ -1658,7 +1658,7 @@ class CardFactory_Planeswalkers {
|
|||||||
{
|
{
|
||||||
public boolean addCard(Card c)
|
public boolean addCard(Card c)
|
||||||
{
|
{
|
||||||
return CardFactoryUtil.canTarget(card, c) && c.getOwner().equals(AllZone.ComputerPlayer) &&
|
return CardFactoryUtil.canTarget(card, c) && c.getOwner().isComputer() &&
|
||||||
!c.equals(card);
|
!c.equals(card);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1710,7 +1710,7 @@ class CardFactory_Planeswalkers {
|
|||||||
list.addAll(AllZone.Computer_Battlefield.getCards());
|
list.addAll(AllZone.Computer_Battlefield.getCards());
|
||||||
list = list.filter(new CardListFilter() {
|
list = list.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
return c.isPermanent() && c.getOwner().equals(AllZone.HumanPlayer)
|
return c.isPermanent() && c.getOwner().isHuman()
|
||||||
&& CardFactoryUtil.canTarget(card, c);
|
&& CardFactoryUtil.canTarget(card, c);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -790,7 +790,7 @@ public class CardFactory_Sorceries {
|
|||||||
|
|
||||||
GuiUtils.getChoice("Revealing top " + Count + " cards of library: ", cards.toArray());
|
GuiUtils.getChoice("Revealing top " + Count + " cards of library: ", cards.toArray());
|
||||||
//Human chooses
|
//Human chooses
|
||||||
if(card.getController().equals(AllZone.ComputerPlayer)) {
|
if(card.getController().isComputer()) {
|
||||||
for(int i = 0; i < Count; i++) {
|
for(int i = 0; i < Count; i++) {
|
||||||
if(stop == false) {
|
if(stop == false) {
|
||||||
choice = GuiUtils.getChoiceOptional("Choose cards to put into the first pile: ", cards.toArray());
|
choice = GuiUtils.getChoiceOptional("Choose cards to put into the first pile: ", cards.toArray());
|
||||||
@@ -1825,7 +1825,7 @@ public class CardFactory_Sorceries {
|
|||||||
@Override
|
@Override
|
||||||
public void selectCard(Card c, PlayerZone zone) {
|
public void selectCard(Card c, PlayerZone zone) {
|
||||||
if(c.isLand() && zone.is(Constant.Zone.Battlefield)
|
if(c.isLand() && zone.is(Constant.Zone.Battlefield)
|
||||||
&& c.getController().equals(AllZone.HumanPlayer)
|
&& c.getController().isHuman()
|
||||||
/*&& c.getName().equals(humanBasic.get(count))*/
|
/*&& c.getName().equals(humanBasic.get(count))*/
|
||||||
&& c.getType().contains(humanBasic.get(count))
|
&& c.getType().contains(humanBasic.get(count))
|
||||||
/*&& !saveList.contains(c) */) {
|
/*&& !saveList.contains(c) */) {
|
||||||
@@ -1922,7 +1922,7 @@ public class CardFactory_Sorceries {
|
|||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
Player player = card.getController();
|
Player player = card.getController();
|
||||||
if(player.equals(AllZone.HumanPlayer)) humanResolve();
|
if(player.isHuman()) humanResolve();
|
||||||
else computerResolve();
|
else computerResolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2939,7 +2939,7 @@ public class CardFactory_Sorceries {
|
|||||||
int size = graveList.size();
|
int size = graveList.size();
|
||||||
int damage = 0;
|
int damage = 0;
|
||||||
|
|
||||||
if( player.equals(AllZone.HumanPlayer)) {
|
if( player.isHuman()) {
|
||||||
for(int i = 0; i < size; i++) {
|
for(int i = 0; i < size; i++) {
|
||||||
Object o = GuiUtils.getChoice("Remove from game", graveList.toArray());
|
Object o = GuiUtils.getChoice("Remove from game", graveList.toArray());
|
||||||
if(o == null) break;
|
if(o == null) break;
|
||||||
@@ -3249,7 +3249,7 @@ public class CardFactory_Sorceries {
|
|||||||
printCardTargets();
|
printCardTargets();
|
||||||
Log.debug("Fireball", "Fireball - player targets: ");
|
Log.debug("Fireball", "Fireball - player targets: ");
|
||||||
printPlayerTargets();
|
printPlayerTargets();
|
||||||
if(card.getController().equals(AllZone.ComputerPlayer)) {
|
if(card.getController().isComputer()) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(cardName+" - Computer causes "+damage+" to:\n\n");
|
sb.append(cardName+" - Computer causes "+damage+" to:\n\n");
|
||||||
for(int i = 0; i < targets.size(); i++) {
|
for(int i = 0; i < targets.size(); i++) {
|
||||||
@@ -3441,7 +3441,7 @@ public class CardFactory_Sorceries {
|
|||||||
int maxCards = AllZoneUtil.getPlayerHand(player).size();
|
int maxCards = AllZoneUtil.getPlayerHand(player).size();
|
||||||
if(numCards != 0) {
|
if(numCards != 0) {
|
||||||
numCards = Math.min(numCards, maxCards);
|
numCards = Math.min(numCards, maxCards);
|
||||||
if(player.equals(AllZone.HumanPlayer)) {
|
if(player.isHuman()) {
|
||||||
AllZone.InputControl.setInput(CardFactoryUtil.input_discardRecall(numCards, card, this));
|
AllZone.InputControl.setInput(CardFactoryUtil.input_discardRecall(numCards, card, this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -741,7 +741,7 @@ public class Cost_Payment {
|
|||||||
@Override
|
@Override
|
||||||
public void selectPlayer(Player player)
|
public void selectPlayer(Player player)
|
||||||
{
|
{
|
||||||
if(player.equals(AllZone.HumanPlayer))
|
if(player.isHuman())
|
||||||
{
|
{
|
||||||
if(manaCost.payPhyrexian())
|
if(manaCost.payPhyrexian())
|
||||||
{
|
{
|
||||||
@@ -934,7 +934,7 @@ public class Cost_Payment {
|
|||||||
@Override
|
@Override
|
||||||
public void showMessage() {
|
public void showMessage() {
|
||||||
Card card = sa.getSourceCard();
|
Card card = sa.getSourceCard();
|
||||||
if(card.getController().equals(AllZone.HumanPlayer) && AllZoneUtil.isCardInPlay(card)) {
|
if(card.getController().isHuman() && AllZoneUtil.isCardInPlay(card)) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(card.getName());
|
sb.append(card.getName());
|
||||||
sb.append(" - Sacrifice?");
|
sb.append(" - Sacrifice?");
|
||||||
@@ -1088,7 +1088,7 @@ public class Cost_Payment {
|
|||||||
@Override
|
@Override
|
||||||
public void showMessage() {
|
public void showMessage() {
|
||||||
Card card = sa.getSourceCard();
|
Card card = sa.getSourceCard();
|
||||||
if(card.getController().equals(AllZone.HumanPlayer) && AllZoneUtil.isCardInPlay(card)) {
|
if(card.getController().isHuman() && AllZoneUtil.isCardInPlay(card)) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(card.getName());
|
sb.append(card.getName());
|
||||||
sb.append(" - Exile?");
|
sb.append(" - Exile?");
|
||||||
@@ -1122,7 +1122,7 @@ public class Cost_Payment {
|
|||||||
@Override
|
@Override
|
||||||
public void showMessage() {
|
public void showMessage() {
|
||||||
Card card = spell.getSourceCard();
|
Card card = spell.getSourceCard();
|
||||||
if(card.getController().equals(AllZone.HumanPlayer) && AllZoneUtil.isCardInPlayerHand(card.getController(), card)) {
|
if(card.getController().isHuman() && AllZoneUtil.isCardInPlayerHand(card.getController(), card)) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(card.getName());
|
sb.append(card.getName());
|
||||||
sb.append(" - Exile?");
|
sb.append(" - Exile?");
|
||||||
@@ -1155,7 +1155,7 @@ public class Cost_Payment {
|
|||||||
@Override
|
@Override
|
||||||
public void showMessage() {
|
public void showMessage() {
|
||||||
Card card = spell.getSourceCard();
|
Card card = spell.getSourceCard();
|
||||||
if(card.getController().equals(AllZone.HumanPlayer) && AllZoneUtil.isCardInPlayerHand(card.getController(), card)) {
|
if(card.getController().isHuman() && AllZoneUtil.isCardInPlayerHand(card.getController(), card)) {
|
||||||
//This can't really happen, but if for some reason it could....
|
//This can't really happen, but if for some reason it could....
|
||||||
if(AllZoneUtil.getPlayerCardsInLibrary(card.getController()).size() > 0) {
|
if(AllZoneUtil.getPlayerCardsInLibrary(card.getController()).size() > 0) {
|
||||||
payment.setPayExileFromTop(true);
|
payment.setPayExileFromTop(true);
|
||||||
@@ -1182,7 +1182,7 @@ public class Cost_Payment {
|
|||||||
@Override
|
@Override
|
||||||
public void showMessage() {
|
public void showMessage() {
|
||||||
Card card = spell.getSourceCard();
|
Card card = spell.getSourceCard();
|
||||||
if(card.getController().equals(AllZone.HumanPlayer) && AllZoneUtil.isCardInPlayerGraveyard(card.getController(), card)) {
|
if(card.getController().isHuman() && AllZoneUtil.isCardInPlayerGraveyard(card.getController(), card)) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(card.getName());
|
sb.append(card.getName());
|
||||||
sb.append(" - Exile?");
|
sb.append(" - Exile?");
|
||||||
@@ -1492,7 +1492,7 @@ public class Cost_Payment {
|
|||||||
@Override
|
@Override
|
||||||
public void showMessage() {
|
public void showMessage() {
|
||||||
Card card = sa.getSourceCard();
|
Card card = sa.getSourceCard();
|
||||||
if(card.getController().equals(AllZone.HumanPlayer) && AllZoneUtil.isCardInPlay(card)) {
|
if(card.getController().isHuman() && AllZoneUtil.isCardInPlay(card)) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(card.getName());
|
sb.append(card.getName());
|
||||||
sb.append(" - Return to Hand?");
|
sb.append(" - Return to Hand?");
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class Spell_Permanent extends Spell {
|
|||||||
if(creature.size() == 0) {
|
if(creature.size() == 0) {
|
||||||
AllZone.GameAction.sacrifice(getSourceCard());
|
AllZone.GameAction.sacrifice(getSourceCard());
|
||||||
return;
|
return;
|
||||||
} else if(s.equals(AllZone.HumanPlayer)) {
|
} else if(s.isHuman()) {
|
||||||
AllZone.InputControl.setInput(championInputComes);
|
AllZone.InputControl.setInput(championInputComes);
|
||||||
}
|
}
|
||||||
else { //Computer
|
else { //Computer
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ public class CardDetailPanel extends JPanel implements CardContainer {
|
|||||||
cdLabel5.setText("Card ID " + card.getUniqueNumber());
|
cdLabel5.setText("Card ID " + card.getUniqueNumber());
|
||||||
|
|
||||||
//rarity and set of a face down card should not be visible to the opponent
|
//rarity and set of a face down card should not be visible to the opponent
|
||||||
if (!card.isFaceDown() || card.getController().equals(AllZone.HumanPlayer)) cdLabel7.setText(card.getCurSetCode());
|
if (!card.isFaceDown() || card.getController().isHuman()) cdLabel7.setText(card.getCurSetCode());
|
||||||
|
|
||||||
if (!cdLabel7.getText().equals(""))
|
if (!cdLabel7.getText().equals(""))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
package forge.gui.input;
|
package forge.gui.input;
|
||||||
|
|
||||||
import forge.AllZone;
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
import forge.ButtonUtil;
|
import forge.ButtonUtil;
|
||||||
import forge.Card;
|
import forge.Card;
|
||||||
import forge.CombatUtil;
|
import forge.CombatUtil;
|
||||||
@@ -19,7 +20,7 @@ public class Input_Cleanup extends Input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ButtonUtil.disableAll();
|
ButtonUtil.disableAll();
|
||||||
int n = AllZone.Human_Hand.getCards().length;
|
int n = AllZoneUtil.getPlayerHand(AllZone.HumanPlayer).size();
|
||||||
|
|
||||||
//MUST showMessage() before stop() or it will overwrite the next Input's message
|
//MUST showMessage() before stop() or it will overwrite the next Input's message
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
@@ -47,7 +48,7 @@ public class Input_Cleanup extends Input {
|
|||||||
|
|
||||||
|
|
||||||
public void AI_CleanupDiscard(){
|
public void AI_CleanupDiscard(){
|
||||||
int size = AllZone.Computer_Hand.getCards().length;
|
int size = AllZoneUtil.getPlayerHand(AllZone.ComputerPlayer).size();
|
||||||
|
|
||||||
if (AllZone.ComputerPlayer.getMaxHandSize() != -1){
|
if (AllZone.ComputerPlayer.getMaxHandSize() != -1){
|
||||||
int numDiscards = size - AllZone.ComputerPlayer.getMaxHandSize();
|
int numDiscards = size - AllZone.ComputerPlayer.getMaxHandSize();
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public class Input_PayManaCost extends Input {
|
|||||||
public void selectPlayer(Player player)
|
public void selectPlayer(Player player)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(player.equals(AllZone.HumanPlayer))
|
if(player.isHuman())
|
||||||
{
|
{
|
||||||
if(manaCost.payPhyrexian())
|
if(manaCost.payPhyrexian())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class Input_PayManaCostUtil
|
|||||||
public static ManaCost activateManaAbility(SpellAbility sa, Card card, ManaCost manaCost)
|
public static ManaCost activateManaAbility(SpellAbility sa, Card card, ManaCost manaCost)
|
||||||
{
|
{
|
||||||
//make sure computer's lands aren't selected
|
//make sure computer's lands aren't selected
|
||||||
if(card.getController().equals(AllZone.ComputerPlayer))
|
if(card.getController().isComputer())
|
||||||
return manaCost;
|
return manaCost;
|
||||||
|
|
||||||
if(card instanceof ManaPool)
|
if(card instanceof ManaPool)
|
||||||
|
|||||||
Reference in New Issue
Block a user