mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- CheckStyle.
This commit is contained in:
@@ -514,7 +514,7 @@ public class ComputerUtil {
|
||||
extraManaNeeded += Integer.parseInt(snem);
|
||||
} catch (final NumberFormatException e) {
|
||||
System.out.println("wrong SpellsNeedExtraMana SVar format on " + c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
|
||||
private final Map<ZoneType, PlayerZone> zones = new EnumMap<ZoneType, PlayerZone>(ZoneType.class);
|
||||
|
||||
private PlayerStatistics stats = new PlayerStatistics();
|
||||
|
||||
|
||||
private final List<Card> schemeDeck = new ArrayList<Card>();
|
||||
private Card activeScheme = null;
|
||||
|
||||
@@ -209,31 +209,31 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
|
||||
//@Deprecated
|
||||
public abstract boolean isComputer();
|
||||
public abstract PlayerType getType();
|
||||
|
||||
public List<Card> getSchemeDeck()
|
||||
{
|
||||
|
||||
public List<Card> getSchemeDeck() {
|
||||
|
||||
return schemeDeck;
|
||||
}
|
||||
|
||||
public void setSchemeDeck(Iterable<Card> sd)
|
||||
{
|
||||
|
||||
public void setSchemeDeck(Iterable<Card> sd) {
|
||||
|
||||
schemeDeck.clear();
|
||||
for(Card c : sd)
|
||||
{
|
||||
for (Card c : sd) {
|
||||
|
||||
schemeDeck.add(c);
|
||||
c.setOwner(this);
|
||||
}
|
||||
CardLists.shuffle(schemeDeck);
|
||||
}
|
||||
|
||||
public boolean isArchenemy()
|
||||
{
|
||||
|
||||
public boolean isArchenemy() {
|
||||
|
||||
//Only the archenemy has schemes.
|
||||
return schemeDeck.size() > 0;
|
||||
}
|
||||
|
||||
public void setSchemeInMotion()
|
||||
{
|
||||
|
||||
public void setSchemeInMotion() {
|
||||
|
||||
// Replacement effects
|
||||
final HashMap<String, Object> repRunParams = new HashMap<String, Object>();
|
||||
repRunParams.put("Event", "SetInMotion");
|
||||
@@ -242,17 +242,17 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
|
||||
if (game.getReplacementHandler().run(repRunParams) != ReplacementResult.NotReplaced) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
game.getTriggerHandler().suppressMode(TriggerType.ChangesZone);
|
||||
|
||||
|
||||
activeScheme = schemeDeck.get(0);
|
||||
|
||||
|
||||
schemeDeck.remove(0);
|
||||
|
||||
|
||||
this.getZone(ZoneType.Command).add(activeScheme);
|
||||
|
||||
|
||||
game.getTriggerHandler().clearSuppression(TriggerType.ChangesZone);
|
||||
|
||||
|
||||
// Run triggers
|
||||
final HashMap<String, Object> runParams = new HashMap<String, Object>();
|
||||
runParams.put("Scheme", activeScheme);
|
||||
@@ -601,7 +601,7 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
|
||||
} else {
|
||||
// Worship does not reduce the damage dealt but changes the effect
|
||||
// of the damage
|
||||
if (this.hasKeyword("Damage that would reduce your life total to less than 1 reduces it to 1 instead.")
|
||||
if (this.hasKeyword("Damage that would reduce your life total to less than 1 reduces it to 1 instead.")
|
||||
&& this.life <= damageToDo) {
|
||||
this.loseLife(Math.min(damageToDo, this.life - 1));
|
||||
} else {
|
||||
|
||||
@@ -237,9 +237,9 @@ public class GuiChoose {
|
||||
|
||||
if (sideboardingMode) {
|
||||
persistentDeck.getMain().clear();
|
||||
persistentDeck.getMain().add((List<Card>)dual.getOrderedList());
|
||||
persistentDeck.getMain().add((List<Card>) dual.getOrderedList());
|
||||
persistentDeck.getSideboard().clear();
|
||||
persistentDeck.getSideboard().add((List<Card>)dual.getRemainingSourceList());
|
||||
persistentDeck.getSideboard().add((List<Card>) dual.getRemainingSourceList());
|
||||
}
|
||||
|
||||
dialog.dispose();
|
||||
|
||||
@@ -796,12 +796,12 @@ public final class GuiDisplayUtil {
|
||||
if (choices.isEmpty()) {
|
||||
return; // when would it happen?
|
||||
}
|
||||
|
||||
|
||||
final SpellAbility sa = choices.size() == 1 ? choices.get(0) : GuiChoose.oneOrNone("Choose", choices);
|
||||
if (sa == null) {
|
||||
return; // happens if cancelled
|
||||
}
|
||||
|
||||
|
||||
sa.setActivatingPlayer(p);
|
||||
game.getAction().moveToHand(forgeCard); // this is really needed
|
||||
game.getAction().playSpellAbilityForFree(sa);
|
||||
|
||||
@@ -108,7 +108,7 @@ public class SEditorIO {
|
||||
* Saves the current deck, with various prompts depending on the
|
||||
* current save environment.
|
||||
*
|
||||
* @param limitedDeckMode if true, the editor is in limited deck mode,
|
||||
* @param limitedDeckMode if true, the editor is in limited deck mode,
|
||||
* so the overwrite prompt should be adjusted accordingly.
|
||||
*
|
||||
* @return boolean, true if success
|
||||
@@ -129,8 +129,8 @@ public class SEditorIO {
|
||||
// Confirm if overwrite
|
||||
else if (controller.fileExists(name)) {
|
||||
final int m = JOptionPane.showConfirmDialog(null,
|
||||
limitedDeckMode ? "Would you like to save changes to your deck?" :
|
||||
"There is already a deck named '" + name + "'. Overwrite?",
|
||||
limitedDeckMode ? "Would you like to save changes to your deck?"
|
||||
: "There is already a deck named '" + name + "'. Overwrite?",
|
||||
limitedDeckMode ? "Save changes?" : "Overwrite Deck?",
|
||||
JOptionPane.YES_NO_OPTION,
|
||||
JOptionPane.QUESTION_MESSAGE);
|
||||
|
||||
@@ -66,7 +66,7 @@ public final class CEditorConstructed extends ACEditorBase<CardPrinted, Deck> {
|
||||
super();
|
||||
|
||||
boolean wantUnique = SEditorIO.getPref(EditorPreference.display_unique_only);
|
||||
|
||||
|
||||
final EditorTableView<CardPrinted> tblCatalog = new EditorTableView<CardPrinted>(wantUnique, CardPrinted.class);
|
||||
final EditorTableView<CardPrinted> tblDeck = new EditorTableView<CardPrinted>(wantUnique, CardPrinted.class);
|
||||
|
||||
@@ -154,7 +154,7 @@ public final class CEditorConstructed extends ACEditorBase<CardPrinted, Deck> {
|
||||
final List<TableColumnInfo<InventoryItem>> lstCatalogCols = SColumnUtil.getCatalogDefaultColumns();
|
||||
|
||||
if (isSideboarding) {
|
||||
|
||||
|
||||
this.getTableCatalog().setAvailableColumns(lstCatalogCols);
|
||||
this.getTableCatalog().setDeck(this.controller.getModel().getMain());
|
||||
this.getTableDeck().setDeck(this.controller.getModel().getSideboard());
|
||||
|
||||
@@ -275,7 +275,7 @@ public class CEditorDraftingProcess extends ACEditorBase<CardPrinted, DeckGroup>
|
||||
VCardCatalog.SINGLETON_INSTANCE.getBtnAdd4().setVisible(false);
|
||||
|
||||
VCurrentDeck.SINGLETON_INSTANCE.getBtnDoSideboard().setVisible(false);
|
||||
|
||||
|
||||
VCurrentDeck.SINGLETON_INSTANCE.getPnlHeader().setVisible(false);
|
||||
|
||||
if (VDeckgen.SINGLETON_INSTANCE.getParentCell() != null) {
|
||||
|
||||
@@ -95,7 +95,7 @@ public enum CEditorPreferences implements ICDoc {
|
||||
if (!SEditorIO.getPref(EditorPreference.stats_catalog)) {
|
||||
VCardCatalog.SINGLETON_INSTANCE.getPnlStats().setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
boolean wantUnique = SEditorIO.getPref(EditorPreference.display_unique_only);
|
||||
ACEditorBase<?, ?> curEditor = CDeckEditorUI.SINGLETON_INSTANCE.getCurrentEditorController();
|
||||
if (curEditor != null) {
|
||||
|
||||
@@ -121,7 +121,7 @@ public final class CEditorScheme extends ACEditorBase<CardPrinted, Deck> {
|
||||
*/
|
||||
@Override
|
||||
public void resetTables() {
|
||||
this.getTableCatalog().setDeck(ItemPool.createFrom(Iterables.filter(CardDb.instance().getAllNonTraditionalCards(),CardPrinted.Predicates.type("Scheme")), CardPrinted.class));
|
||||
this.getTableCatalog().setDeck(ItemPool.createFrom(Iterables.filter(CardDb.instance().getAllNonTraditionalCards(), CardPrinted.Predicates.type("Scheme")), CardPrinted.class));
|
||||
this.getTableDeck().setDeck(this.controller.getModel().getSchemes());
|
||||
}
|
||||
|
||||
|
||||
@@ -326,7 +326,7 @@ public final class EditorTableView<T extends InventoryItem> {
|
||||
|
||||
/**
|
||||
*
|
||||
* setWantUnique
|
||||
* setWantUnique.
|
||||
*
|
||||
* @param unique if true, the editor will be set to the "unique card names only" mode.
|
||||
*/
|
||||
@@ -336,7 +336,7 @@ public final class EditorTableView<T extends InventoryItem> {
|
||||
|
||||
/**
|
||||
*
|
||||
* getAlwaysNonUnique
|
||||
* getAlwaysNonUnique.
|
||||
*
|
||||
* @return if ture, this editor must always show non-unique cards (e.g. quest editor).
|
||||
*/
|
||||
@@ -346,9 +346,9 @@ public final class EditorTableView<T extends InventoryItem> {
|
||||
|
||||
/**
|
||||
*
|
||||
* setAlwaysNonUnique
|
||||
* setAlwaysNonUnique.
|
||||
*
|
||||
* @param nonUniqueOnly if true, this editor must always show non-unique cards (e.g. quest editor).
|
||||
* @param nonUniqueOnly if true, this editor must always show non-unique cards (e.g. quest editor).
|
||||
*/
|
||||
public void setAlwaysNonUnique(boolean nonUniqueOnly) {
|
||||
this.alwaysNonUnique = nonUniqueOnly;
|
||||
|
||||
@@ -77,15 +77,15 @@ public class ManaCostRenderer extends DefaultTableCellRenderer {
|
||||
: elemtWidth + elemtGap;
|
||||
final float offset = Math.min(elemtWidth + elemtGap, offsetIfNoSpace);
|
||||
|
||||
// Display X Mana before any other type of mana
|
||||
// Display X Mana before any other type of mana
|
||||
if (xManaCosts > 0) {
|
||||
for(int i = 0; i < xManaCosts; i++) {
|
||||
for (int i = 0; i < xManaCosts; i++) {
|
||||
CardFaceSymbols.drawSymbol(ManaCostShard.X.getImageKey(), g, (int) xpos, 1);
|
||||
xpos += offset;
|
||||
}
|
||||
}
|
||||
|
||||
// Display colorless mana before colored mana
|
||||
|
||||
// Display colorless mana before colored mana
|
||||
if (hasGeneric) {
|
||||
final String sGeneric = Integer.toString(genericManaCost);
|
||||
CardFaceSymbols.drawSymbol(sGeneric, g, (int) xpos, 1);
|
||||
@@ -94,7 +94,7 @@ public class ManaCostRenderer extends DefaultTableCellRenderer {
|
||||
|
||||
for (final ManaCostShard s : shards) {
|
||||
if (s.equals(ManaCostShard.X)) {
|
||||
// X costs already drawn up above
|
||||
// X costs already drawn up above
|
||||
continue;
|
||||
}
|
||||
CardFaceSymbols.drawSymbol(s.getImageKey(), g, (int) xpos, 1);
|
||||
|
||||
@@ -65,7 +65,7 @@ public enum VEditorPreferences implements IVDoc<CEditorPreferences> {
|
||||
private JCheckBox chbCatalogStats = new FCheckBox("Show stats in card catalog");
|
||||
|
||||
private JCheckBox chbCardDisplayUnique = new FCheckBox("Show unique cards only (only affects Constructed)");
|
||||
|
||||
|
||||
private JPanel pnl = new JPanel(new MigLayout("insets 0, gap 0, wrap 2, ax center"));
|
||||
private JScrollPane scroller = new JScrollPane(pnl);
|
||||
|
||||
@@ -122,7 +122,7 @@ public enum VEditorPreferences implements IVDoc<CEditorPreferences> {
|
||||
pnl.add(chbDeckPower, constraints);
|
||||
pnl.add(chbDeckToughness, constraints);
|
||||
pnl.add(chbDeckAI, constraints + ", wrap");
|
||||
|
||||
|
||||
pnl.add(lblDisplay, constraints + ", span 2 1");
|
||||
pnl.add(chbCardDisplayUnique, "h 25px!, gap 5px 5px 5px 5px, ax center, span 2 1");
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ public enum CSubmenuArchenemy implements ICDoc {
|
||||
*/
|
||||
@Override
|
||||
public void initialize() {
|
||||
|
||||
|
||||
VSubmenuArchenemy.SINGLETON_INSTANCE.getLblEditor().setCommand(new Command() {
|
||||
@Override
|
||||
public void execute() {
|
||||
@@ -65,7 +65,7 @@ public enum CSubmenuArchenemy implements ICDoc {
|
||||
FControl.SINGLETON_INSTANCE.changeState(FControl.DECK_EDITOR_CONSTRUCTED);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
final ForgePreferences prefs = Singletons.getModel().getPreferences();
|
||||
for (FDeckChooser fdc : view.getDeckChoosers()) {
|
||||
fdc.initialize();
|
||||
@@ -155,22 +155,21 @@ public enum CSubmenuArchenemy implements ICDoc {
|
||||
schemes = playerDecks.get(0).getSchemes().toFlatList();
|
||||
System.out.println(schemes.toString());
|
||||
usedDefaults = true;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
if (obj instanceof String) {
|
||||
String sel = (String)obj;
|
||||
if(sel.equals("Random"))
|
||||
{
|
||||
String sel = (String) obj;
|
||||
if (sel.equals("Random")) {
|
||||
|
||||
schemes = Iterables.get(view.getAllSchemeDecks(), rnd.nextInt(Iterables.size(view.getAllSchemeDecks()))).getSchemes().toFlatList();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
|
||||
//Generate
|
||||
schemes = DeckgenUtil.generateSchemeDeck().getSchemes().toFlatList();
|
||||
}
|
||||
} else {
|
||||
schemes = ((Deck)obj).getSchemes().toFlatList();
|
||||
schemes = ((Deck) obj).getSchemes().toFlatList();
|
||||
}
|
||||
}
|
||||
if (schemes == null) {
|
||||
@@ -189,13 +188,12 @@ public enum CSubmenuArchenemy implements ICDoc {
|
||||
for (int i = 0; i < view.getNumPlayers(); i++) {
|
||||
LobbyPlayer player = lobby.findLocalPlayer(i == 0 ? PlayerType.HUMAN : PlayerType.COMPUTER);
|
||||
|
||||
if(i == 0)
|
||||
{
|
||||
if (i == 0) {
|
||||
|
||||
helper.addArchenemy(player, playerDecks.get(i), schemes);
|
||||
helper.getPlayerMap().get(player).setStartingLife(10 + (10*(view.getNumPlayers()-1)));
|
||||
}
|
||||
else
|
||||
{
|
||||
helper.getPlayerMap().get(player).setStartingLife(10 + (10 * (view.getNumPlayers() - 1)));
|
||||
} else {
|
||||
|
||||
helper.addPlayer(player, playerDecks.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,21 +133,21 @@ public enum VSubmenuArchenemy implements IVSubmenu<CSubmenuArchenemy> {
|
||||
deckChoosers.add(tempChooser);
|
||||
|
||||
tempPanel.add(tempChooser, "span 1 2, w 44%!, gap 0 0 20px 20px, growy, pushy, wrap");
|
||||
if(i == 0)
|
||||
{
|
||||
if (i == 0) {
|
||||
|
||||
tempPanel.add(new FLabel.Builder().text("Select Scheme deck:").build(), "flowy");
|
||||
|
||||
|
||||
Vector<Object> listData = new Vector<Object>();
|
||||
listData.add("Random");
|
||||
listData.add("Generate");
|
||||
for(Deck schemeDeck : Singletons.getModel().getDecks().getScheme()) {
|
||||
for (Deck schemeDeck : Singletons.getModel().getDecks().getScheme()) {
|
||||
listData.add(schemeDeck);
|
||||
}
|
||||
|
||||
|
||||
archenemySchemes.setListData(listData);
|
||||
archenemySchemes.setSelectedIndex(0);
|
||||
archenemySchemes.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
|
||||
|
||||
|
||||
JScrollPane scrSchemes = new FScrollPane(archenemySchemes, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
tempPanel.add(scrSchemes, "h 90%!,wrap");
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ public enum VLog implements IVDoc<CLog> {
|
||||
|
||||
pnl.removeAll();
|
||||
|
||||
for (int i = size-1; i >= 0; i--) {
|
||||
for (int i = size - 1; i >= 0; i--) {
|
||||
JTextArea tar = new JTextArea(data.get(i).getMessage());
|
||||
|
||||
if (i % 2 == 1) { tar.setOpaque(false); }
|
||||
|
||||
@@ -112,7 +112,7 @@ public final class CardPrinted implements Comparable<CardPrinted>, InventoryItem
|
||||
}
|
||||
|
||||
public boolean isTraditional() {
|
||||
return !(getCard().getType().isVanguard()
|
||||
return !(getCard().getType().isVanguard()
|
||||
|| getCard().getType().isScheme());
|
||||
}
|
||||
|
||||
|
||||
@@ -112,8 +112,9 @@ public class EventVisualizer {
|
||||
if (sa.isSpell()) {
|
||||
// if there's a specific effect for this particular card, play it and
|
||||
// we're done.
|
||||
if (getSpecificCardEffect(source))
|
||||
if (getSpecificCardEffect(source)) {
|
||||
return SoundEffectType.ScriptedEffect;
|
||||
}
|
||||
|
||||
if (source.isCreature() && source.isArtifact()) {
|
||||
return SoundEffectType.ArtifactCreature;
|
||||
@@ -159,8 +160,9 @@ public class EventVisualizer {
|
||||
|
||||
// if there's a specific effect for this particular card, play it and
|
||||
// we're done.
|
||||
if (getSpecificCardEffect(land))
|
||||
if (getSpecificCardEffect(land)) {
|
||||
return SoundEffectType.ScriptedEffect;
|
||||
}
|
||||
|
||||
final List<SpellAbility> manaProduced = land.getManaAbility();
|
||||
|
||||
@@ -214,7 +216,7 @@ public class EventVisualizer {
|
||||
*/
|
||||
public String getScriptedSoundEffectName(Event evt) {
|
||||
Card c = null;
|
||||
|
||||
|
||||
if (evt instanceof SpellResolvedEvent) {
|
||||
c = ((SpellResolvedEvent) evt).Source;
|
||||
} else if (evt instanceof LandPlayedEvent) {
|
||||
|
||||
Reference in New Issue
Block a user