Merge branch 'assorted-fixes' into 'master'

Adding Rat Colony to card limit exceptions, fixing Goblin Chainwhirler.

Closes #527

See merge request core-developers/forge!470
This commit is contained in:
austinio7116
2018-04-23 06:36:40 +00:00
6 changed files with 13 additions and 10 deletions

View File

@@ -123,6 +123,13 @@ public enum DeckFormat {
private final static String ADVPROCLAMATION = "Advantageous Proclamation"; private final static String ADVPROCLAMATION = "Advantageous Proclamation";
private final static String SOVREALM = "Sovereign's Realm"; private final static String SOVREALM = "Sovereign's Realm";
private static final List<String> limitExceptions = Arrays.asList(
new String[]{"Relentless Rats", "Shadowborn Apostle", "Rat Colony"});
public static List<String> getLimitExceptions(){
return limitExceptions;
}
private DeckFormat(Range<Integer> mainRange0, Range<Integer> sideRange0, int maxCardCopies0, Predicate<CardRules> cardPoolFilter0, Predicate<PaperCard> paperCardPoolFilter0) { private DeckFormat(Range<Integer> mainRange0, Range<Integer> sideRange0, int maxCardCopies0, Predicate<CardRules> cardPoolFilter0, Predicate<PaperCard> paperCardPoolFilter0) {
mainRange = mainRange0; mainRange = mainRange0;
sideRange = sideRange0; sideRange = sideRange0;

View File

@@ -178,9 +178,6 @@ public abstract class ACEditorBase<TItem extends InventoryItem, TModel extends D
None None
} }
private static final List<String> limitExceptions = Arrays.asList(
new String[]{"Relentless Rats", "Shadowborn Apostle"});
/** /**
* @return pool of additions allowed to deck * @return pool of additions allowed to deck
*/ */
@@ -212,7 +209,7 @@ public abstract class ACEditorBase<TItem extends InventoryItem, TModel extends D
int max; int max;
if (deck == null || card == null || card.getRules().getType().isBasic() || if (deck == null || card == null || card.getRules().getType().isBasic() ||
limit == CardLimit.None || limitExceptions.contains(card.getName())) { limit == CardLimit.None || DeckFormat.getLimitExceptions().contains(card.getName())) {
max = Integer.MAX_VALUE; max = Integer.MAX_VALUE;
} }
else { else {

View File

@@ -441,7 +441,7 @@ public enum VSubmenuQuestPrefs implements IVSubmenu<CSubmenuQuestPrefs> {
pnlShop.add(new PrefInput(QPref.PLAYSET_BASIC_LAND_SIZE, QuestPreferencesErrType.DIFFICULTY), fieldConstraints + ", wrap"); pnlShop.add(new PrefInput(QPref.PLAYSET_BASIC_LAND_SIZE, QuestPreferencesErrType.DIFFICULTY), fieldConstraints + ", wrap");
FLabel infiniteToKeep = new FLabel.Builder().text("Playset Size: Any Number").fontAlign(SwingConstants.RIGHT).build(); FLabel infiniteToKeep = new FLabel.Builder().text("Playset Size: Any Number").fontAlign(SwingConstants.RIGHT).build();
infiniteToKeep.setToolTipText("The number of copies of Relentless Rats or Shadowborn Apostles to keep before selling extras."); infiniteToKeep.setToolTipText("The number of copies of Relentless Rats or other similar cards with no limit to keep before selling extras.");
pnlShop.add(infiniteToKeep, labelConstraints); pnlShop.add(infiniteToKeep, labelConstraints);
pnlShop.add(new PrefInput(QPref.PLAYSET_ANY_NUMBER_SIZE, QuestPreferencesErrType.DIFFICULTY), fieldConstraints + ", wrap"); pnlShop.add(new PrefInput(QPref.PLAYSET_ANY_NUMBER_SIZE, QuestPreferencesErrType.DIFFICULTY), fieldConstraints + ", wrap");

View File

@@ -718,9 +718,6 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
protected abstract void onCardActivated(PaperCard card); protected abstract void onCardActivated(PaperCard card);
protected abstract void buildMenu(final FDropDownMenu menu, final PaperCard card); protected abstract void buildMenu(final FDropDownMenu menu, final PaperCard card);
private static final List<String> limitExceptions = Arrays.asList(
new String[]{"Relentless Rats", "Shadowborn Apostle"});
private ItemPool<PaperCard> getAllowedAdditions(Iterable<Entry<PaperCard, Integer>> itemsToAdd, boolean isAddSource) { private ItemPool<PaperCard> getAllowedAdditions(Iterable<Entry<PaperCard, Integer>> itemsToAdd, boolean isAddSource) {
ItemPool<PaperCard> additions = new ItemPool<PaperCard>(cardManager.getGenericType()); ItemPool<PaperCard> additions = new ItemPool<PaperCard>(cardManager.getGenericType());
CardLimit limit = parentScreen.getCardLimit(); CardLimit limit = parentScreen.getCardLimit();
@@ -733,7 +730,7 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
if (deck == null || card == null) { if (deck == null || card == null) {
max = Integer.MAX_VALUE; max = Integer.MAX_VALUE;
} }
else if (limit == CardLimit.None || card.getRules().getType().isBasic() || limitExceptions.contains(card.getName())) { else if (limit == CardLimit.None || card.getRules().getType().isBasic() || DeckFormat.getLimitExceptions().contains(card.getName())) {
max = Integer.MAX_VALUE; max = Integer.MAX_VALUE;
if (parentScreen.isLimitedEditor() && !isAddSource) { if (parentScreen.isLimitedEditor() && !isAddSource) {
//prevent adding more than is in other pool when editing limited decks //prevent adding more than is in other pool when editing limited decks

View File

@@ -2,6 +2,7 @@ Name:Goblin Chainwhirler
ManaCost:R R R ManaCost:R R R
Types:Creature Goblin Warrior Types:Creature Goblin Warrior
PT:3/3 PT:3/3
K:First Strike
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDamageAll | TriggerDescription$ When CARDNAME enters the battlefield, it deals 1 damage to each opponent and each creature and planeswalker they control. T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDamageAll | TriggerDescription$ When CARDNAME enters the battlefield, it deals 1 damage to each opponent and each creature and planeswalker they control.
SVar:TrigDamageAll:DB$ DamageAll | ValidPlayers$ Player.Opponent | ValidCards$ Creature.OppCtrl,Planeswalker.OppCtrl | NumDmg$ 1 | ValidDescription$ each opponent and each creature and planeswalker they control. SVar:TrigDamageAll:DB$ DamageAll | ValidPlayers$ Player.Opponent | ValidCards$ Creature.OppCtrl,Planeswalker.OppCtrl | NumDmg$ 1 | ValidDescription$ each opponent and each creature and planeswalker they control.
Oracle:First strike\nWhen Goblin Chainwhirler enters the battlefield, it deals 1 damage to each opponent and each creature and planeswalker they control. Oracle:First strike\nWhen Goblin Chainwhirler enters the battlefield, it deals 1 damage to each opponent and each creature and planeswalker they control.

View File

@@ -4,6 +4,7 @@ import com.google.common.base.Function;
import forge.GuiBase; import forge.GuiBase;
import forge.deck.CardPool; import forge.deck.CardPool;
import forge.deck.Deck; import forge.deck.Deck;
import forge.deck.DeckFormat;
import forge.deck.DeckSection; import forge.deck.DeckSection;
import forge.item.*; import forge.item.*;
import forge.itemmanager.IItemManager; import forge.itemmanager.IItemManager;
@@ -345,7 +346,7 @@ public class QuestSpellShop {
PaperCard card = (PaperCard)item.getKey(); PaperCard card = (PaperCard)item.getKey();
int numToKeep = card.getRules().getType().isBasic() ? int numToKeep = card.getRules().getType().isBasic() ?
FModel.getQuestPreferences().getPrefInt(QPref.PLAYSET_BASIC_LAND_SIZE) : FModel.getQuestPreferences().getPrefInt(QPref.PLAYSET_SIZE); FModel.getQuestPreferences().getPrefInt(QPref.PLAYSET_BASIC_LAND_SIZE) : FModel.getQuestPreferences().getPrefInt(QPref.PLAYSET_SIZE);
if (card.getName().equals("Relentless Rats") || card.getName().equals("Shadowborn Apostle")) { if (DeckFormat.getLimitExceptions().contains(card.getName())) {
numToKeep = FModel.getQuestPreferences().getPrefInt(QPref.PLAYSET_ANY_NUMBER_SIZE); numToKeep = FModel.getQuestPreferences().getPrefInt(QPref.PLAYSET_ANY_NUMBER_SIZE);
} }
if (numToKeep < item.getValue()) { if (numToKeep < item.getValue()) {