mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
clear up warnings,
remove useless setters in RegisteredPlayer a few style clean ups in cardfactory/CardFactoryUtil.java
This commit is contained in:
@@ -2042,25 +2042,20 @@ public class CardFactoryUtil {
|
||||
|
||||
public static final void addCommanderAbilities(final Card cmd) {
|
||||
ReplacementEffect re = ReplacementHandler.parseReplacement(
|
||||
"Event$ Moved | Destination$ Graveyard,Exile | ValidCard$ Card.Self | Secondary$ True | Optional$ True | OptionalDecider$ You | ReplaceWith$ CommanderMoveReplacement | Description$ If a commander would be put into its owner's graveyard or exile from anywhere, that player may put it into the command zone instead.",
|
||||
"Event$ Moved | Destination$ Graveyard,Exile | ValidCard$ Card.Self | Secondary$ True | Optional$ True | OptionalDecider$ You | ReplaceWith$ CommanderMoveReplacement | " +
|
||||
"Description$ If a commander would be put into its owner's graveyard or exile from anywhere, that player may put it into the command zone instead.",
|
||||
cmd, true);
|
||||
cmd.addReplacementEffect(re);
|
||||
if(cmd.getSVar("CommanderCostRaise").equals(""))
|
||||
{
|
||||
if(StringUtils.isBlank(cmd.getSVar("CommanderCostRaise"))) // why condition check is needed?
|
||||
cmd.setSVar("CommanderCostRaise", "Number$0");
|
||||
}
|
||||
cmd.setSVar("CommanderMoveReplacement",
|
||||
"DB$ ChangeZone | Origin$ Battlefield,Graveyard,Exile,Library | Destination$ Command | Defined$ ReplacedCard");
|
||||
|
||||
cmd.setSVar("DBCommanderIncCast",
|
||||
"DB$ StoreSVar | SVar$ CommanderCostRaise | Type$ CountSVar | Expression$ CommanderCostRaise/Plus.2");
|
||||
SpellAbility sa = AbilityFactory.getAbility(
|
||||
"AB$ PermanentCreature | ActivationZone$ Command | SubAbility$ DBCommanderIncCast | Cost$ " + cmd.getManaCost().toString(),
|
||||
cmd);
|
||||
|
||||
String cmdManaCost = cmd.getManaCost().toString();
|
||||
cmd.setSVar("CommanderMoveReplacement", "DB$ ChangeZone | Origin$ Battlefield,Graveyard,Exile,Library | Destination$ Command | Defined$ ReplacedCard");
|
||||
cmd.setSVar("DBCommanderIncCast", "DB$ StoreSVar | SVar$ CommanderCostRaise | Type$ CountSVar | Expression$ CommanderCostRaise/Plus.2");
|
||||
SpellAbility sa = AbilityFactory.getAbility("AB$ PermanentCreature | ActivationZone$ Command | SubAbility$ DBCommanderIncCast | Cost$ " + cmdManaCost, cmd);
|
||||
cmd.addSpellAbility(sa);
|
||||
cmd.addIntrinsicAbility("AB$ PermanentCreature | SorcerySpeed$ True | ActivationZone$ Command | SubAbility$ DBCommanderIncCast | Cost$ " + cmd.getManaCost().toString());
|
||||
|
||||
cmd.addIntrinsicAbility("AB$ PermanentCreature | SorcerySpeed$ True | ActivationZone$ Command | SubAbility$ DBCommanderIncCast | Cost$ " + cmdManaCost);
|
||||
cmd.addStaticAbility("Mode$ RaiseCost | Amount$ CommanderCostRaise | Type$ Ability | Affected$ Card.Self | EffectZone$ Command | AffectedZone$ Command");
|
||||
}
|
||||
|
||||
|
||||
@@ -101,13 +101,6 @@ public class RegisteredPlayer {
|
||||
return schemes == null ? EmptyList : schemes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param schemes0 the schemes to set
|
||||
*/
|
||||
public void setSchemes(Iterable<? extends IPaperCard> s) {
|
||||
this.schemes = s;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Write javadoc for this method.
|
||||
*/
|
||||
@@ -122,13 +115,6 @@ public class RegisteredPlayer {
|
||||
return planes == null ? EmptyList : planes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param planes0 the planes to set
|
||||
*/
|
||||
public void setPlanes(Iterable<PaperCard> planes0) {
|
||||
this.planes = planes0;
|
||||
}
|
||||
|
||||
public int getTeamNumber() {
|
||||
return teamNumber;
|
||||
}
|
||||
@@ -153,19 +139,19 @@ public class RegisteredPlayer {
|
||||
|
||||
public static RegisteredPlayer forArchenemy(final Deck deck, final Iterable<PaperCard> schemes) {
|
||||
RegisteredPlayer start = fromDeck(deck);
|
||||
start.setSchemes(schemes);
|
||||
start.schemes = schemes;
|
||||
return start;
|
||||
}
|
||||
|
||||
public static RegisteredPlayer forPlanechase(final Deck deck, final Iterable<PaperCard> planes) {
|
||||
RegisteredPlayer start = fromDeck(deck);
|
||||
start.setPlanes(planes);
|
||||
start.planes = planes;
|
||||
return start;
|
||||
}
|
||||
|
||||
public static RegisteredPlayer forCommander(final Deck deck) {
|
||||
RegisteredPlayer start = fromDeck(deck);
|
||||
start.setCommander(deck.get(DeckSection.Commander).get(0));
|
||||
start.commander = deck.get(DeckSection.Commander).get(0);
|
||||
start.setStartingLife(40);
|
||||
return start;
|
||||
}
|
||||
@@ -180,18 +166,10 @@ public class RegisteredPlayer {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the commander
|
||||
* TODO: Write javadoc for this method.
|
||||
* @return
|
||||
*/
|
||||
public PaperCard getCommander() {
|
||||
public IPaperCard getCommander() {
|
||||
return commander;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param commander0 the commander to set
|
||||
*/
|
||||
public void setCommander(PaperCard commander0) {
|
||||
this.commander = commander0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ import forge.card.trigger.Trigger;
|
||||
import forge.card.trigger.TriggerHandler;
|
||||
import forge.card.trigger.TriggerType;
|
||||
import forge.game.Game;
|
||||
import forge.game.GameType;
|
||||
import forge.game.GlobalRuleChange;
|
||||
import forge.game.combat.Combat;
|
||||
import forge.game.combat.CombatUtil;
|
||||
|
||||
@@ -22,7 +22,6 @@ import forge.card.spellability.Spell;
|
||||
import forge.card.spellability.SpellAbility;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.util.MyRandom;
|
||||
import forge.util.TextUtil;
|
||||
|
||||
/**
|
||||
|
||||
@@ -278,6 +278,8 @@ public final class CEditorCommander extends ACEditorBase<PaperCard, Deck> {
|
||||
title = "Commander";
|
||||
tabtext = "Card Catalog";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
VCardCatalog.SINGLETON_INSTANCE.getTabLabel().setText(tabtext);
|
||||
|
||||
@@ -19,9 +19,7 @@
|
||||
package forge.gui.home.settings;
|
||||
|
||||
import forge.Command;
|
||||
import forge.Singletons;
|
||||
import forge.gui.framework.ICDoc;
|
||||
import forge.properties.ForgePreferences;
|
||||
import forge.util.FileUtil;
|
||||
|
||||
/**
|
||||
@@ -35,7 +33,7 @@ public enum CSubmenuReleaseNotes implements ICDoc {
|
||||
SINGLETON_INSTANCE;
|
||||
|
||||
private VSubmenuReleaseNotes view;
|
||||
private ForgePreferences prefs;
|
||||
//private ForgePreferences prefs;
|
||||
private boolean isReleaseNotesUpdated = false;
|
||||
|
||||
/* (non-Javadoc)
|
||||
@@ -44,7 +42,7 @@ public enum CSubmenuReleaseNotes implements ICDoc {
|
||||
@Override
|
||||
public void initialize() {
|
||||
this.view = VSubmenuReleaseNotes.SINGLETON_INSTANCE;
|
||||
this.prefs = Singletons.getModel().getPreferences();
|
||||
//this.prefs = Singletons.getModel().getPreferences();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@@ -53,7 +51,7 @@ public enum CSubmenuReleaseNotes implements ICDoc {
|
||||
@Override
|
||||
public void update() {
|
||||
this.view = VSubmenuReleaseNotes.SINGLETON_INSTANCE;
|
||||
this.prefs = Singletons.getModel().getPreferences();
|
||||
//this.prefs = Singletons.getModel().getPreferences();
|
||||
setReleaseNotesContent();
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ public abstract class ItemManager<T extends InventoryItem> extends JPanel {
|
||||
@Override
|
||||
public void doLayout()
|
||||
{
|
||||
int number = 0;
|
||||
//int number = 0;
|
||||
LayoutHelper helper = new LayoutHelper(this);
|
||||
/*for (ItemFilter<T> filter : this.orderedFilters) {
|
||||
filter.updatePanelTitle(++number);
|
||||
|
||||
@@ -61,11 +61,10 @@ public class FDeckChooser extends JPanel {
|
||||
private boolean isAi;
|
||||
|
||||
private final MouseAdapter madDecklist = new MouseAdapter() {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void mouseClicked(final MouseEvent e) {
|
||||
if (MouseEvent.BUTTON1 == e.getButton() && e.getClickCount() == 2) {
|
||||
final JList<String> src = ((JList<String>) e.getSource());
|
||||
//final JList<String> src = ((JList<String>) e.getSource());
|
||||
if (getRadColors().isSelected() || getRadThemes().isSelected()) { return; }
|
||||
DeckgenUtil.showDecklist(getDeck());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user