mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Merge branch 'cleanup' into 'master'
Minor clean up See merge request core-developers/forge!5068
This commit is contained in:
@@ -879,7 +879,7 @@ public class AiController {
|
|||||||
public boolean isNonDisabledCardInPlay(final String cardName) {
|
public boolean isNonDisabledCardInPlay(final String cardName) {
|
||||||
for (Card card : player.getCardsIn(ZoneType.Battlefield)) {
|
for (Card card : player.getCardsIn(ZoneType.Battlefield)) {
|
||||||
if (card.getName().equals(cardName)) {
|
if (card.getName().equals(cardName)) {
|
||||||
// TODO - Better logic to detemine if a permanent is disabled by local effects
|
// TODO - Better logic to determine if a permanent is disabled by local effects
|
||||||
// currently assuming any permanent enchanted by another player
|
// currently assuming any permanent enchanted by another player
|
||||||
// is disabled and a second copy is necessary
|
// is disabled and a second copy is necessary
|
||||||
// will need actual logic that determines if the enchantment is able
|
// will need actual logic that determines if the enchantment is able
|
||||||
|
|||||||
@@ -78,15 +78,13 @@ public class AiCostDecision extends CostDecisionMakerBase {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return PaymentDecision.card(player.getLastDrawnCard());
|
return PaymentDecision.card(player.getLastDrawnCard());
|
||||||
}
|
} else if (cost.payCostFromSource()) {
|
||||||
else if (cost.payCostFromSource()) {
|
|
||||||
if (!hand.contains(source)) {
|
if (!hand.contains(source)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return PaymentDecision.card(source);
|
return PaymentDecision.card(source);
|
||||||
}
|
} else if (type.equals("Hand")) {
|
||||||
else if (type.equals("Hand")) {
|
|
||||||
if (hand.size() > 1 && ability.getActivatingPlayer() != null) {
|
if (hand.size() > 1 && ability.getActivatingPlayer() != null) {
|
||||||
hand = ability.getActivatingPlayer().getController().orderMoveToZoneList(hand, ZoneType.Graveyard, ability);
|
hand = ability.getActivatingPlayer().getController().orderMoveToZoneList(hand, ZoneType.Graveyard, ability);
|
||||||
}
|
}
|
||||||
@@ -107,8 +105,7 @@ public class AiCostDecision extends CostDecisionMakerBase {
|
|||||||
randomSubset = ability.getActivatingPlayer().getController().orderMoveToZoneList(randomSubset, ZoneType.Graveyard, ability);
|
randomSubset = ability.getActivatingPlayer().getController().orderMoveToZoneList(randomSubset, ZoneType.Graveyard, ability);
|
||||||
}
|
}
|
||||||
return PaymentDecision.card(randomSubset);
|
return PaymentDecision.card(randomSubset);
|
||||||
}
|
} else if (type.equals("DifferentNames")) {
|
||||||
else if (type.equals("DifferentNames")) {
|
|
||||||
CardCollection differentNames = new CardCollection();
|
CardCollection differentNames = new CardCollection();
|
||||||
CardCollection discardMe = CardLists.filter(hand, CardPredicates.hasSVar("DiscardMe"));
|
CardCollection discardMe = CardLists.filter(hand, CardPredicates.hasSVar("DiscardMe"));
|
||||||
while (c > 0) {
|
while (c > 0) {
|
||||||
@@ -125,8 +122,7 @@ public class AiCostDecision extends CostDecisionMakerBase {
|
|||||||
c--;
|
c--;
|
||||||
}
|
}
|
||||||
return PaymentDecision.card(differentNames);
|
return PaymentDecision.card(differentNames);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
final AiController aic = ((PlayerControllerAi)player.getController()).getAi();
|
final AiController aic = ((PlayerControllerAi)player.getController()).getAi();
|
||||||
|
|
||||||
CardCollection result = aic.getCardsToDiscard(c, type.split(";"), ability, discarded);
|
CardCollection result = aic.getCardsToDiscard(c, type.split(";"), ability, discarded);
|
||||||
@@ -183,8 +179,7 @@ public class AiCostDecision extends CostDecisionMakerBase {
|
|||||||
else if (cost.sameZone) {
|
else if (cost.sameZone) {
|
||||||
// TODO Determine exile from same zone for AI
|
// TODO Determine exile from same zone for AI
|
||||||
return null;
|
return null;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
CardCollectionView chosen = ComputerUtil.chooseExileFrom(player, cost.getFrom(), cost.getType(), source, ability.getTargetCard(), c, ability);
|
CardCollectionView chosen = ComputerUtil.chooseExileFrom(player, cost.getFrom(), cost.getType(), source, ability.getTargetCard(), c, ability);
|
||||||
return null == chosen ? null : PaymentDecision.card(chosen);
|
return null == chosen ? null : PaymentDecision.card(chosen);
|
||||||
}
|
}
|
||||||
@@ -375,8 +370,7 @@ public class AiCostDecision extends CostDecisionMakerBase {
|
|||||||
|
|
||||||
if (cost.isSameZone()) {
|
if (cost.isSameZone()) {
|
||||||
list = new CardCollection(game.getCardsIn(cost.getFrom()));
|
list = new CardCollection(game.getCardsIn(cost.getFrom()));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
list = new CardCollection(player.getCardsIn(cost.getFrom()));
|
list = new CardCollection(player.getCardsIn(cost.getFrom()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -871,4 +865,3 @@ public class AiCostDecision extends CostDecisionMakerBase {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2832,7 +2832,6 @@ public class ComputerUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean lifegainPositive(final Player player, final Card source) {
|
public static boolean lifegainPositive(final Player player, final Card source) {
|
||||||
|
|
||||||
if (!player.canGainLife()) {
|
if (!player.canGainLife()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -716,6 +716,7 @@ public class ComputerUtilCard {
|
|||||||
|
|
||||||
int bigCMC = -1;
|
int bigCMC = -1;
|
||||||
for (final Card card : all) {
|
for (final Card card : all) {
|
||||||
|
// TODO when PlayAi can consider MDFC this should also look at the back face (if not on stack or battlefield)
|
||||||
int curCMC = card.getCMC();
|
int curCMC = card.getCMC();
|
||||||
|
|
||||||
// Add all cost of all auras with the same controller
|
// Add all cost of all auras with the same controller
|
||||||
|
|||||||
@@ -70,13 +70,12 @@ public class PlayAi extends SpellAbilityAi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sa.hasParam("ValidSA")) {
|
if (cards != null & sa.hasParam("ValidSA")) {
|
||||||
final String valid[] = {sa.getParam("ValidSA")};
|
final String valid[] = {sa.getParam("ValidSA")};
|
||||||
final Iterator<Card> itr = cards.iterator();
|
final Iterator<Card> itr = cards.iterator();
|
||||||
while (itr.hasNext()) {
|
while (itr.hasNext()) {
|
||||||
final Card c = itr.next();
|
final Card c = itr.next();
|
||||||
final List<SpellAbility> validSA = Lists.newArrayList(Iterables.filter(AbilityUtils.getBasicSpellsFromPlayEffect(c, ai), SpellAbilityPredicates.isValid(valid, ai , c, sa)));
|
if (!Iterables.any(AbilityUtils.getBasicSpellsFromPlayEffect(c, ai), SpellAbilityPredicates.isValid(valid, ai , c, sa))) {
|
||||||
if (validSA.size() == 0) {
|
|
||||||
itr.remove();
|
itr.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -173,6 +172,8 @@ public class PlayAi extends SpellAbilityAi {
|
|||||||
List<Card> tgtCards = CardLists.filter(options, new Predicate<Card>() {
|
List<Card> tgtCards = CardLists.filter(options, new Predicate<Card>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(final Card c) {
|
public boolean apply(final Card c) {
|
||||||
|
// TODO needs to be aligned for MDFC along with getAbilityToPlay so the knowledge
|
||||||
|
// of which spell was the reason for the choice can be used there
|
||||||
for (SpellAbility s : c.getBasicSpells(c.getState(CardStateName.Original))) {
|
for (SpellAbility s : c.getBasicSpells(c.getState(CardStateName.Original))) {
|
||||||
Spell spell = (Spell) s;
|
Spell spell = (Spell) s;
|
||||||
s.setActivatingPlayer(ai);
|
s.setActivatingPlayer(ai);
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ public class DeckGeneratorMonoColor extends DeckGeneratorBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final CardPool getDeck(final int size, final boolean forAi) {
|
public final CardPool getDeck(final int size, final boolean forAi) {
|
||||||
addCreaturesAndSpells(size, cmcLevels, forAi);
|
addCreaturesAndSpells(size, cmcLevels, forAi);
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ import forge.util.TextUtil;
|
|||||||
*/
|
*/
|
||||||
public class BoosterGenerator {
|
public class BoosterGenerator {
|
||||||
|
|
||||||
|
|
||||||
private final static Map<String, PrintSheet> cachedSheets = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
|
private final static Map<String, PrintSheet> cachedSheets = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
|
||||||
private static synchronized PrintSheet getPrintSheet(String key) {
|
private static synchronized PrintSheet getPrintSheet(String key) {
|
||||||
if( !cachedSheets.containsKey(key) )
|
if( !cachedSheets.containsKey(key) )
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ public class UnOpenedProduct implements IUnOpenedProduct {
|
|||||||
this.poolLimited = considerNumbersInPool; // TODO: Add 0 to parameter's name.
|
this.poolLimited = considerNumbersInPool; // TODO: Add 0 to parameter's name.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Means to select from all unique cards (from base game, ie. no schemes or avatars)
|
// Means to select from all unique cards (from base game, ie. no schemes or avatars)
|
||||||
public UnOpenedProduct(SealedProduct.Template template) {
|
public UnOpenedProduct(SealedProduct.Template template) {
|
||||||
tpl = template;
|
tpl = template;
|
||||||
|
|||||||
@@ -414,4 +414,3 @@ public enum FControl implements KeyEventDispatcher {
|
|||||||
return GamePlayerUtil.getGuiPlayer();
|
return GamePlayerUtil.getGuiPlayer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -194,7 +194,6 @@ public final class DeckManager extends ItemManager<DeckProxy> implements IHasGam
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
||||||
protected void buildAddFilterMenu(final JMenu menu) {
|
protected void buildAddFilterMenu(final JMenu menu) {
|
||||||
GuiUtils.addSeparator(menu); //separate from current search item
|
GuiUtils.addSeparator(menu); //separate from current search item
|
||||||
|
|
||||||
@@ -228,7 +227,6 @@ public final class DeckManager extends ItemManager<DeckProxy> implements IHasGam
|
|||||||
}
|
}
|
||||||
menu.add(fmt);
|
menu.add(fmt);
|
||||||
|
|
||||||
|
|
||||||
GuiUtils.addMenuItem(menu, localizer.getMessage("lblFormats") + "...", null, new Runnable() {
|
GuiUtils.addMenuItem(menu, localizer.getMessage("lblFormats") + "...", null, new Runnable() {
|
||||||
@Override public void run() {
|
@Override public void run() {
|
||||||
final DeckFormatFilter existingFilter = getFilter(DeckFormatFilter.class);
|
final DeckFormatFilter existingFilter = getFilter(DeckFormatFilter.class);
|
||||||
|
|||||||
@@ -340,4 +340,3 @@ public enum CDeckEditorUI implements ICDoc {
|
|||||||
@Override
|
@Override
|
||||||
public void update() { }
|
public void update() { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -294,8 +294,7 @@ public class DeckController<T extends DeckBase> {
|
|||||||
final String name = getModelName();
|
final String name = getModelName();
|
||||||
if (name.isEmpty()) {
|
if (name.isEmpty()) {
|
||||||
newModel();
|
newModel();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
load(name);
|
load(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -303,8 +302,7 @@ public class DeckController<T extends DeckBase> {
|
|||||||
public void load(final String path, final String name) {
|
public void load(final String path, final String name) {
|
||||||
if (StringUtils.isBlank(path)) {
|
if (StringUtils.isBlank(path)) {
|
||||||
currentFolder = rootFolder;
|
currentFolder = rootFolder;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
currentFolder = rootFolder.tryGetFolder(path);
|
currentFolder = rootFolder.tryGetFolder(path);
|
||||||
}
|
}
|
||||||
modelPath = path;
|
modelPath = path;
|
||||||
@@ -386,8 +384,7 @@ public class DeckController<T extends DeckBase> {
|
|||||||
public void refreshModel() {
|
public void refreshModel() {
|
||||||
if (model == null) {
|
if (model == null) {
|
||||||
newModel();
|
newModel();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
setModel(model, modelInStorage);
|
setModel(model, modelInStorage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -532,7 +532,6 @@ public final class CMatchUI
|
|||||||
for (final PlayerView p : manaPoolUpdate) {
|
for (final PlayerView p : manaPoolUpdate) {
|
||||||
getFieldViewFor(p).updateManaPool();
|
getFieldViewFor(p).updateManaPool();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Player's lives and poison counters
|
// Player's lives and poison counters
|
||||||
@@ -1367,7 +1366,6 @@ public final class CMatchUI
|
|||||||
nextNotifiableStackIndex++;
|
nextNotifiableStackIndex++;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Not yet time to show the modal - schedule the method again, and try again later
|
// Not yet time to show the modal - schedule the method again, and try again later
|
||||||
Runnable tryAgainThread = new Runnable() {
|
Runnable tryAgainThread = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@@ -1499,7 +1497,6 @@ public final class CMatchUI
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void createLandPopupPanel(Card land) {
|
private void createLandPopupPanel(Card land) {
|
||||||
|
|
||||||
String landPlayedNotificationPolicy = FModel.getPreferences().getPref(FPref.UI_LAND_PLAYED_NOTIFICATION_POLICY);
|
String landPlayedNotificationPolicy = FModel.getPreferences().getPref(FPref.UI_LAND_PLAYED_NOTIFICATION_POLICY);
|
||||||
Player cardController = land.getController();
|
Player cardController = land.getController();
|
||||||
boolean isAi = cardController.isAI();
|
boolean isAi = cardController.isAI();
|
||||||
|
|||||||
@@ -121,7 +121,6 @@ public class GameLogPanel extends JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addLogEntry(final String text) {
|
public void addLogEntry(final String text) {
|
||||||
|
|
||||||
final boolean useAlternateBackColor = (scrollablePanel.getComponents().length % 2 == 0);
|
final boolean useAlternateBackColor = (scrollablePanel.getComponents().length % 2 == 0);
|
||||||
final JTextArea tar = createNewLogEntryJTextArea(text, useAlternateBackColor);
|
final JTextArea tar = createNewLogEntryJTextArea(text, useAlternateBackColor);
|
||||||
|
|
||||||
@@ -138,7 +137,6 @@ public class GameLogPanel extends JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
forceVerticalScrollbarToMax();
|
forceVerticalScrollbarToMax();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTextFont(final SkinFont newFont) {
|
public void setTextFont(final SkinFont newFont) {
|
||||||
|
|||||||
@@ -407,7 +407,6 @@ public class VAssignCombatDamage {
|
|||||||
/** Updates labels and other UI elements.
|
/** Updates labels and other UI elements.
|
||||||
* @param index index of the last assigned damage*/
|
* @param index index of the last assigned damage*/
|
||||||
private void updateLabels() {
|
private void updateLabels() {
|
||||||
|
|
||||||
int damageLeft = totalDamageToAssign;
|
int damageLeft = totalDamageToAssign;
|
||||||
boolean allHaveLethal = true;
|
boolean allHaveLethal = true;
|
||||||
|
|
||||||
@@ -456,8 +455,7 @@ public class VAssignCombatDamage {
|
|||||||
final CardView pw = (CardView)defender;
|
final CardView pw = (CardView)defender;
|
||||||
lethalDamage = Integer.valueOf(pw.getCurrentState().getLoyalty());
|
lethalDamage = Integer.valueOf(pw.getCurrentState().getLoyalty());
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
lethalDamage = Math.max(0, card.getLethalDamage());
|
lethalDamage = Math.max(0, card.getLethalDamage());
|
||||||
if (card.getCurrentState().getType().isPlaneswalker()) {
|
if (card.getCurrentState().getType().isPlaneswalker()) {
|
||||||
lethalDamage = Integer.valueOf(card.getCurrentState().getLoyalty());
|
lethalDamage = Integer.valueOf(card.getCurrentState().getLoyalty());
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ public class CDetail implements ICDoc {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -390,7 +390,6 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void doLayout() {
|
public final void doLayout() {
|
||||||
|
|
||||||
int borderSize = calculateBorderSize();
|
int borderSize = calculateBorderSize();
|
||||||
|
|
||||||
final Point imgPos = new Point(cardXOffset + borderSize, cardYOffset + borderSize);
|
final Point imgPos = new Point(cardXOffset + borderSize, cardYOffset + borderSize);
|
||||||
@@ -408,7 +407,6 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int calculateBorderSize() {
|
private int calculateBorderSize() {
|
||||||
|
|
||||||
// Determine whether to render border from properties
|
// Determine whether to render border from properties
|
||||||
boolean noBorderPref = !isPreferenceEnabled(FPref.UI_RENDER_BLACK_BORDERS);
|
boolean noBorderPref = !isPreferenceEnabled(FPref.UI_RENDER_BLACK_BORDERS);
|
||||||
|
|
||||||
@@ -426,7 +424,6 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Dimension calculateImageSize() {
|
private Dimension calculateImageSize() {
|
||||||
@@ -491,7 +488,6 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (card.getCounters() != null && !card.getCounters().isEmpty()) {
|
if (card.getCounters() != null && !card.getCounters().isEmpty()) {
|
||||||
|
|
||||||
switch (CounterDisplayType.from(FModel.getPreferences().getPref(FPref.UI_CARD_COUNTER_DISPLAY_TYPE))) {
|
switch (CounterDisplayType.from(FModel.getPreferences().getPref(FPref.UI_CARD_COUNTER_DISPLAY_TYPE))) {
|
||||||
@@ -734,8 +730,7 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
abiY += abiSpace;
|
abiY += abiSpace;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
String keywordKey = card.getCurrentState().getKeywordKey();
|
String keywordKey = card.getCurrentState().getKeywordKey();
|
||||||
String abilityText = card.getCurrentState().getAbilityText();
|
String abilityText = card.getCurrentState().getAbilityText();
|
||||||
if (((keywordKey.indexOf("Flashback") == -1)
|
if (((keywordKey.indexOf("Flashback") == -1)
|
||||||
@@ -752,7 +747,6 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void drawCounterTabs(final Graphics g) {
|
private void drawCounterTabs(final Graphics g) {
|
||||||
|
|
||||||
final Dimension imgSize = calculateImageSize();
|
final Dimension imgSize = calculateImageSize();
|
||||||
final int titleY = Math.round(imgSize.height * (54f / 640)) - 15;
|
final int titleY = Math.round(imgSize.height * (54f / 640)) - 15;
|
||||||
|
|
||||||
@@ -767,7 +761,6 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
FontMetrics largeFontMetrics = g.getFontMetrics(largeCounterFont);
|
FontMetrics largeFontMetrics = g.getFontMetrics(largeCounterFont);
|
||||||
|
|
||||||
if (CounterDisplayType.from(FModel.getPreferences().getPref(FPref.UI_CARD_COUNTER_DISPLAY_TYPE)) == CounterDisplayType.OLD_WHEN_SMALL) {
|
if (CounterDisplayType.from(FModel.getPreferences().getPref(FPref.UI_CARD_COUNTER_DISPLAY_TYPE)) == CounterDisplayType.OLD_WHEN_SMALL) {
|
||||||
|
|
||||||
int maxCounters = 0;
|
int maxCounters = 0;
|
||||||
for (Integer numberOfCounters : card.getCounters().values()) {
|
for (Integer numberOfCounters : card.getCounters().values()) {
|
||||||
maxCounters = Math.max(maxCounters, numberOfCounters);
|
maxCounters = Math.max(maxCounters, numberOfCounters);
|
||||||
@@ -780,9 +773,7 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (Map.Entry<CounterType, Integer> counterEntry : card.getCounters().entrySet()) {
|
for (Map.Entry<CounterType, Integer> counterEntry : card.getCounters().entrySet()) {
|
||||||
|
|
||||||
final CounterType counter = counterEntry.getKey();
|
final CounterType counter = counterEntry.getKey();
|
||||||
final int numberOfCounters = counterEntry.getValue();
|
final int numberOfCounters = counterEntry.getValue();
|
||||||
final int counterBoxRealWidth = counterBoxBaseWidth + largeFontMetrics.stringWidth(String.valueOf(numberOfCounters));
|
final int counterBoxRealWidth = counterBoxBaseWidth + largeFontMetrics.stringWidth(String.valueOf(numberOfCounters));
|
||||||
@@ -827,7 +818,6 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void drawCounterImage(final Graphics g) {
|
private void drawCounterImage(final Graphics g) {
|
||||||
|
|
||||||
int counters = 0;
|
int counters = 0;
|
||||||
for (final Integer i : card.getCounters().values()) {
|
for (final Integer i : card.getCounters().values()) {
|
||||||
counters += i;
|
counters += i;
|
||||||
@@ -848,7 +838,6 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void drawMarkersTabs(final Graphics g, List<String> markers) {
|
private void drawMarkersTabs(final Graphics g, List<String> markers) {
|
||||||
|
|
||||||
final Dimension imgSize = calculateImageSize();
|
final Dimension imgSize = calculateImageSize();
|
||||||
final int titleY = Math.round(imgSize.height * (54f / 640)) - 15;
|
final int titleY = Math.round(imgSize.height * (54f / 640)) - 15;
|
||||||
|
|
||||||
@@ -862,7 +851,6 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
FontMetrics smallFontMetrics = g.getFontMetrics(smallCounterFont);
|
FontMetrics smallFontMetrics = g.getFontMetrics(smallCounterFont);
|
||||||
|
|
||||||
for (String marker : markers) {
|
for (String marker : markers) {
|
||||||
|
|
||||||
final int markerBoxRealWidth = markerBoxBaseWidth + smallFontMetrics.stringWidth(marker);
|
final int markerBoxRealWidth = markerBoxBaseWidth + smallFontMetrics.stringWidth(marker);
|
||||||
final int markerYOffset;
|
final int markerYOffset;
|
||||||
|
|
||||||
@@ -907,7 +895,6 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
* @param font The font to use to draw the text.
|
* @param font The font to use to draw the text.
|
||||||
*/
|
*/
|
||||||
private void drawVerticallyCenteredString(Graphics g, String text, Rectangle area, Font font, final FontMetrics fontMetrics) {
|
private void drawVerticallyCenteredString(Graphics g, String text, Rectangle area, Font font, final FontMetrics fontMetrics) {
|
||||||
|
|
||||||
Font oldFont = g.getFont();
|
Font oldFont = g.getFont();
|
||||||
|
|
||||||
int x = area.x;
|
int x = area.x;
|
||||||
@@ -1114,8 +1101,7 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean showCardManaCostOverlay() {
|
private boolean showCardManaCostOverlay() {
|
||||||
return isShowingOverlays() &&
|
return isShowingOverlays() && isPreferenceEnabled(FPref.UI_OVERLAY_CARD_MANA_COST);
|
||||||
isPreferenceEnabled(FPref.UI_OVERLAY_CARD_MANA_COST);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean showCardIdOverlay() {
|
private boolean showCardIdOverlay() {
|
||||||
|
|||||||
@@ -624,8 +624,7 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
|||||||
|
|
||||||
if (toDelete.size() == getCardPanels().size()) {
|
if (toDelete.size() == getCardPanels().size()) {
|
||||||
clear(false);
|
clear(false);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
for (final CardView card : toDelete) {
|
for (final CardView card : toDelete) {
|
||||||
removeCardPanel(getCardPanel(card.getId()),false);
|
removeCardPanel(getCardPanel(card.getId()),false);
|
||||||
}
|
}
|
||||||
@@ -681,8 +680,7 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
|||||||
if (card.isTapped()) {
|
if (card.isTapped()) {
|
||||||
toPanel.setTapped(true);
|
toPanel.setTapped(true);
|
||||||
toPanel.setTappedAngle(forge.view.arcane.CardPanel.TAPPED_ANGLE);
|
toPanel.setTappedAngle(forge.view.arcane.CardPanel.TAPPED_ANGLE);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
toPanel.setTapped(false);
|
toPanel.setTapped(false);
|
||||||
toPanel.setTappedAngle(0);
|
toPanel.setTappedAngle(0);
|
||||||
}
|
}
|
||||||
@@ -705,8 +703,7 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
|||||||
CardPanel attachedToPanel;
|
CardPanel attachedToPanel;
|
||||||
if (card.getAttachedTo() != null) {
|
if (card.getAttachedTo() != null) {
|
||||||
attachedToPanel = getCardPanel(card.getAttachedTo().getId());
|
attachedToPanel = getCardPanel(card.getAttachedTo().getId());
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
attachedToPanel = null;
|
attachedToPanel = null;
|
||||||
}
|
}
|
||||||
if (toPanel.getAttachedToPanel() != attachedToPanel) {
|
if (toPanel.getAttachedToPanel() != attachedToPanel) {
|
||||||
|
|||||||
@@ -104,8 +104,6 @@ public class ScaledImagePanel extends JPanel {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//System.out.println(sz + " -- " + src);
|
|
||||||
|
|
||||||
//ResampleOp resizer = new ResampleOp(DimensionConstrain.createMaxDimension(this.getWidth(), this.getHeight(), !scaleLarger));
|
//ResampleOp resizer = new ResampleOp(DimensionConstrain.createMaxDimension(this.getWidth(), this.getHeight(), !scaleLarger));
|
||||||
//resizer.setUnsharpenMask(UnsharpenMask.Soft);
|
//resizer.setUnsharpenMask(UnsharpenMask.Soft);
|
||||||
BufferedImage img = getSrcImage(); //resizer.filter(getSrcImage(), null);
|
BufferedImage img = getSrcImage(); //resizer.filter(getSrcImage(), null);
|
||||||
@@ -113,9 +111,6 @@ public class ScaledImagePanel extends JPanel {
|
|||||||
boolean needsScale = img.getWidth() < sz.width;
|
boolean needsScale = img.getWidth() < sz.width;
|
||||||
float scaleFactor = ((float)img.getWidth()) / sz.width;
|
float scaleFactor = ((float)img.getWidth()) / sz.width;
|
||||||
if (needsScale && ( scaleFactor < 0.95 || scaleFactor > 1.05 )) { // This should very low-quality scaling to draw during animation
|
if (needsScale && ( scaleFactor < 0.95 || scaleFactor > 1.05 )) { // This should very low-quality scaling to draw during animation
|
||||||
|
|
||||||
//System.out.println("Painting: " + img.getWidth() + " -> " + sz.width );
|
|
||||||
|
|
||||||
float maxZoomX = ((float)sz.width) / img.getWidth();
|
float maxZoomX = ((float)sz.width) / img.getWidth();
|
||||||
float maxZoomY = ((float)sz.height) / img.getHeight();
|
float maxZoomY = ((float)sz.height) / img.getHeight();
|
||||||
float zoom = Math.min(maxZoomX, maxZoomY);
|
float zoom = Math.min(maxZoomX, maxZoomY);
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ Types:Artifact Creature Construct
|
|||||||
PT:5/6
|
PT:5/6
|
||||||
K:Flash
|
K:Flash
|
||||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigPlay | TriggerDescription$ When CARDNAME enters the battlefield, you may cast target instant card from your graveyard without paying its mana cost. If that spell would be put into your graveyard this turn, exile it instead.
|
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigPlay | TriggerDescription$ When CARDNAME enters the battlefield, you may cast target instant card from your graveyard without paying its mana cost. If that spell would be put into your graveyard this turn, exile it instead.
|
||||||
SVar:TrigPlay:DB$ Play | TgtZone$ Graveyard | ValidTgts$ Instant.YouCtrl | TgtPrompt$ Choose target instant or sorcery card from your graveyard | WithoutManaCost$ True | Optional$ True | ReplaceGraveyard$ Exile | AILogic$ ReplaySpell
|
SVar:TrigPlay:DB$ Play | TgtZone$ Graveyard | ValidTgts$ Instant.YouCtrl | TgtPrompt$ Choose target instant card from your graveyard | WithoutManaCost$ True | Optional$ True | ReplaceGraveyard$ Exile | AILogic$ ReplaySpell
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/torrential_gearhulk.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/torrential_gearhulk.jpg
|
||||||
Oracle:Flash\nWhen Torrential Gearhulk enters the battlefield, you may cast target instant card from your graveyard without paying its mana cost. If that spell would be put into your graveyard this turn, exile it instead.
|
Oracle:Flash\nWhen Torrential Gearhulk enters the battlefield, you may cast target instant card from your graveyard without paying its mana cost. If that spell would be put into your graveyard this turn, exile it instead.
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ public class CardThemedDeckGenerator extends DeckProxy implements Comparable<Car
|
|||||||
return CardEdition.UNKNOWN;
|
return CardEdition.UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
|
|||||||
@@ -153,8 +153,7 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards {
|
|||||||
setCurrentPlayer(Iterables.getFirst(gameControllers.keySet(), null));
|
setCurrentPlayer(Iterables.getFirst(gameControllers.keySet(), null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
gameControllers.put(player, gameController);
|
gameControllers.put(player, gameController);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -315,12 +314,10 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards {
|
|||||||
// Concede each player on this Gui (except mind-controlled players)
|
// Concede each player on this Gui (except mind-controlled players)
|
||||||
c.concede();
|
c.concede();
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return !ignoreConcedeChain;
|
return !ignoreConcedeChain;
|
||||||
}
|
}
|
||||||
if (gameView.isGameOver()) {
|
if (gameView.isGameOver()) {
|
||||||
|
|||||||
@@ -200,8 +200,7 @@ public class CardDetailUtil {
|
|||||||
if (ptText.length() > 0) {
|
if (ptText.length() > 0) {
|
||||||
ptText.insert(0, "P/T: ");
|
ptText.insert(0, "P/T: ");
|
||||||
ptText.append(" - ").append("Loy: ");
|
ptText.append(" - ").append("Loy: ");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ptText.append("Loyalty: ");
|
ptText.append("Loyalty: ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -297,7 +296,6 @@ public class CardDetailUtil {
|
|||||||
card.getText(state, needTranslation ? CardTranslation.getTranslationTexts(state.getName(), "") : null) :
|
card.getText(state, needTranslation ? CardTranslation.getTranslationTexts(state.getName(), "") : null) :
|
||||||
card.getText(state, needTranslation ? CardTranslation.getTranslationTexts(card.getLeftSplitState().getName(), card.getRightSplitState().getName()) : null );
|
card.getText(state, needTranslation ? CardTranslation.getTranslationTexts(card.getLeftSplitState().getName(), card.getRightSplitState().getName()) : null );
|
||||||
|
|
||||||
|
|
||||||
// LEVEL [0-9]+-[0-9]+
|
// LEVEL [0-9]+-[0-9]+
|
||||||
// LEVEL [0-9]+\+
|
// LEVEL [0-9]+\+
|
||||||
|
|
||||||
|
|||||||
@@ -277,8 +277,6 @@ public class HumanCostDecision extends CostDecisionMakerBase {
|
|||||||
return exileFromSame(cost, list, c, payableZone);
|
return exileFromSame(cost, list, c, payableZone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Inputs
|
// Inputs
|
||||||
|
|
||||||
// Exile<Num/Type{/TypeDescription}>
|
// Exile<Num/Type{/TypeDescription}>
|
||||||
|
|||||||
@@ -334,7 +334,6 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
|||||||
String errMsg;
|
String errMsg;
|
||||||
if (newMain.size() < deckMinSize) {
|
if (newMain.size() < deckMinSize) {
|
||||||
errMsg = TextUtil.concatNoSpace(localizer.getMessage("lblTooFewCardsMainDeck", String.valueOf(deckMinSize)));
|
errMsg = TextUtil.concatNoSpace(localizer.getMessage("lblTooFewCardsMainDeck", String.valueOf(deckMinSize)));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
errMsg = TextUtil.concatNoSpace(localizer.getMessage("lblTooManyCardsSideboard", String.valueOf(sbMax)));
|
errMsg = TextUtil.concatNoSpace(localizer.getMessage("lblTooManyCardsSideboard", String.valueOf(sbMax)));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user