mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- CheckStyle.
This commit is contained in:
@@ -352,44 +352,52 @@ public class Deck extends DeckBase {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(type == GameType.Commander)
|
if (type == GameType.Commander) { //Must contain exactly 1 legendary Commander and no sideboard.
|
||||||
{//Must contain exactly 1 legendary Commander and no sideboard.
|
|
||||||
//TODO:Enforce color identity
|
|
||||||
if ( null == getCommander())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if(!getCommander().getCard().getType().isLegendary())
|
//TODO:Enforce color identity
|
||||||
|
if (null == getCommander()) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
if (!getCommander().getCard().getType().isLegendary()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//No sideboarding in Commander
|
//No sideboarding in Commander
|
||||||
if(!getSideboard().isEmpty())
|
if (!getSideboard().isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if(type == GameType.Planechase)
|
|
||||||
{//Must contain at least 10 planes/phenomenons, but max 2 phenomenons. Singleton.
|
|
||||||
if(getPlanes().countAll() < 10)
|
|
||||||
return false;
|
|
||||||
int phenoms = 0;
|
|
||||||
for(CardPrinted cp : getPlanes().toFlatList())
|
|
||||||
{
|
|
||||||
if(cp.getType().contains("Phenomenon"))
|
|
||||||
phenoms++;
|
|
||||||
if(getPlanes().count(cp) > 1)
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
if(phenoms > 2)
|
else if (type == GameType.Planechase) { //Must contain at least 10 planes/phenomenons, but max 2 phenomenons. Singleton.
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if(type == GameType.Archenemy)
|
|
||||||
{//Must contain at least 20 schemes, max 2 of each.
|
|
||||||
if(getSchemes().countAll() < 20)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
for(CardPrinted cp : getSchemes().toFlatList())
|
if (getPlanes().countAll() < 10) {
|
||||||
{
|
|
||||||
if(getSchemes().count(cp) > 2)
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
int phenoms = 0;
|
||||||
|
for (CardPrinted cp : getPlanes().toFlatList()) {
|
||||||
|
|
||||||
|
if (cp.getType().contains("Phenomenon")) {
|
||||||
|
phenoms++;
|
||||||
|
}
|
||||||
|
if (getPlanes().count(cp) > 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (phenoms > 2) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (type == GameType.Archenemy) { //Must contain at least 20 schemes, max 2 of each.
|
||||||
|
|
||||||
|
if (getSchemes().countAll() < 20) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (CardPrinted cp : getSchemes().toFlatList()) {
|
||||||
|
|
||||||
|
if (getSchemes().count(cp) > 2) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -70,8 +70,9 @@ public class GameNew {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!useAnte && card.hasKeyword("Remove CARDNAME from your deck before playing if you're not playing for ante.")) {
|
if (!useAnte && card.hasKeyword("Remove CARDNAME from your deck before playing if you're not playing for ante.")) {
|
||||||
if(!removedAnteCards.containsKey(player))
|
if (!removedAnteCards.containsKey(player)) {
|
||||||
removedAnteCards.put(player, new ArrayList<String>());
|
removedAnteCards.put(player, new ArrayList<String>());
|
||||||
|
}
|
||||||
removedAnteCards.get(player).add(card.getName());
|
removedAnteCards.get(player).add(card.getName());
|
||||||
} else {
|
} else {
|
||||||
library.add(card);
|
library.add(card);
|
||||||
@@ -92,9 +93,10 @@ public class GameNew {
|
|||||||
// do this instead of shuffling Computer's deck
|
// do this instead of shuffling Computer's deck
|
||||||
final Iterable<Card> c1 = GameNew.smoothComputerManaCurve(player.getCardsIn(ZoneType.Library));
|
final Iterable<Card> c1 = GameNew.smoothComputerManaCurve(player.getCardsIn(ZoneType.Library));
|
||||||
player.getZone(ZoneType.Library).setCards(c1);
|
player.getZone(ZoneType.Library).setCards(c1);
|
||||||
} else
|
} else {
|
||||||
player.shuffle();
|
player.shuffle();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -388,8 +390,9 @@ public class GameNew {
|
|||||||
sb.append(" lost the last game.");
|
sb.append(" lost the last game.");
|
||||||
}
|
}
|
||||||
if (goesFirst.isHuman()) {
|
if (goesFirst.isHuman()) {
|
||||||
if( !humanPlayOrDraw(sb.toString()) )
|
if (!humanPlayOrDraw(sb.toString())) {
|
||||||
goesFirst = goesFirst.getOpponent();
|
goesFirst = goesFirst.getOpponent();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
sb.append("\nComputer Going First");
|
sb.append("\nComputer Going First");
|
||||||
JOptionPane.showMessageDialog(null, sb.toString(),
|
JOptionPane.showMessageDialog(null, sb.toString(),
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ public class MatchStartHelper {
|
|||||||
players.put(player, start);
|
players.put(player, start);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addVanguardPlayer(final LobbyPlayer player, final Deck deck, final CardPrinted avatar)
|
public void addVanguardPlayer(final LobbyPlayer player, final Deck deck, final CardPrinted avatar) {
|
||||||
{
|
|
||||||
PlayerStartConditions start = new PlayerStartConditions(deck);
|
PlayerStartConditions start = new PlayerStartConditions(deck);
|
||||||
|
|
||||||
start.setStartingLife(start.getStartingLife() + avatar.getCard().getLife());
|
start.setStartingLife(start.getStartingLife() + avatar.getCard().getLife());
|
||||||
@@ -50,8 +50,8 @@ public class MatchStartHelper {
|
|||||||
players.put(player, start);
|
players.put(player, start);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<LobbyPlayer, PlayerStartConditions> getPlayerMap()
|
public Map<LobbyPlayer, PlayerStartConditions> getPlayerMap() {
|
||||||
{
|
|
||||||
return players;
|
return players;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -488,9 +488,10 @@ public class MagicStack extends MyObservable {
|
|||||||
//GuiDisplayUtil.updateGUI();
|
//GuiDisplayUtil.updateGUI();
|
||||||
} else {
|
} else {
|
||||||
if (sp.getOptionalAdditionalCosts() != null) {
|
if (sp.getOptionalAdditionalCosts() != null) {
|
||||||
for (String s : sp.getOptionalAdditionalCosts())
|
for (String s : sp.getOptionalAdditionalCosts()) {
|
||||||
sp.getSourceCard().addOptionalAdditionalCostsPaid(s);
|
sp.getSourceCard().addOptionalAdditionalCostsPaid(s);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (sp.getSourceCard().isCopiedSpell()) {
|
if (sp.getSourceCard().isCopiedSpell()) {
|
||||||
this.push(sp);
|
this.push(sp);
|
||||||
} else if (!sp.isMultiKicker() && !sp.isReplicate() && !sp.isXCost()) {
|
} else if (!sp.isMultiKicker() && !sp.isReplicate() && !sp.isXCost()) {
|
||||||
@@ -1008,13 +1009,13 @@ public class MagicStack extends MyObservable {
|
|||||||
//Move rebounding card to exile
|
//Move rebounding card to exile
|
||||||
source = game.getAction().exile(source);
|
source = game.getAction().exile(source);
|
||||||
|
|
||||||
source.setSVar("ReboundAbilityTrigger", "DB$ Play | Defined$ Self " +
|
source.setSVar("ReboundAbilityTrigger", "DB$ Play | Defined$ Self "
|
||||||
"| WithoutManaCost$ True | Optional$ True");
|
+ "| WithoutManaCost$ True | Optional$ True");
|
||||||
|
|
||||||
//Setup a Rebound-trigger
|
//Setup a Rebound-trigger
|
||||||
final Trigger reboundTrigger = forge.card.trigger.TriggerHandler.parseTrigger("Mode$ Phase " +
|
final Trigger reboundTrigger = forge.card.trigger.TriggerHandler.parseTrigger("Mode$ Phase "
|
||||||
"| Phase$ Upkeep | ValidPlayer$ You | OptionalDecider$ You | Execute$ ReboundAbilityTrigger " +
|
+ "| Phase$ Upkeep | ValidPlayer$ You | OptionalDecider$ You | Execute$ ReboundAbilityTrigger "
|
||||||
"| TriggerDescription$ At the beginning of your next upkeep, you may cast " + source.toString()
|
+ "| TriggerDescription$ At the beginning of your next upkeep, you may cast " + source.toString()
|
||||||
+ " without paying it's manacost.", source, true);
|
+ " without paying it's manacost.", source, true);
|
||||||
|
|
||||||
game.getTriggerHandler().registerDelayedTrigger(reboundTrigger);
|
game.getTriggerHandler().registerDelayedTrigger(reboundTrigger);
|
||||||
@@ -1370,8 +1371,7 @@ public class MagicStack extends MyObservable {
|
|||||||
} else {
|
} else {
|
||||||
this.add(next);
|
this.add(next);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
// Otherwise, gave a dual list form to create instead of needing to do it one at a time
|
// Otherwise, gave a dual list form to create instead of needing to do it one at a time
|
||||||
List<SpellAbility> orderedSAs = GuiChoose.getOrderChoices("Select order for Simultaneous Spell Abilities", "Resolve first", 0, activePlayerSAs, null, null);
|
List<SpellAbility> orderedSAs = GuiChoose.getOrderChoices("Select order for Simultaneous Spell Abilities", "Resolve first", 0, activePlayerSAs, null, null);
|
||||||
int size = orderedSAs.size();
|
int size = orderedSAs.size();
|
||||||
|
|||||||
@@ -207,8 +207,9 @@ public class Zone extends MyObservable implements IZone, Observer, java.io.Seria
|
|||||||
@Override
|
@Override
|
||||||
public final void setCards(final Iterable<Card> cards) {
|
public final void setCards(final Iterable<Card> cards) {
|
||||||
cardList.clear();
|
cardList.clear();
|
||||||
for(Card c : cards)
|
for (Card c : cards) {
|
||||||
cardList.add(c);
|
cardList.add(c);
|
||||||
|
}
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user