mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 02:08:00 +00:00
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:
@@ -123,6 +123,13 @@ public enum DeckFormat {
|
||||
private final static String ADVPROCLAMATION = "Advantageous Proclamation";
|
||||
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) {
|
||||
mainRange = mainRange0;
|
||||
sideRange = sideRange0;
|
||||
|
||||
@@ -178,9 +178,6 @@ public abstract class ACEditorBase<TItem extends InventoryItem, TModel extends D
|
||||
None
|
||||
}
|
||||
|
||||
private static final List<String> limitExceptions = Arrays.asList(
|
||||
new String[]{"Relentless Rats", "Shadowborn Apostle"});
|
||||
|
||||
/**
|
||||
* @return pool of additions allowed to deck
|
||||
*/
|
||||
@@ -212,7 +209,7 @@ public abstract class ACEditorBase<TItem extends InventoryItem, TModel extends D
|
||||
|
||||
int max;
|
||||
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;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -441,7 +441,7 @@ public enum VSubmenuQuestPrefs implements IVSubmenu<CSubmenuQuestPrefs> {
|
||||
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();
|
||||
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(new PrefInput(QPref.PLAYSET_ANY_NUMBER_SIZE, QuestPreferencesErrType.DIFFICULTY), fieldConstraints + ", wrap");
|
||||
|
||||
|
||||
@@ -718,9 +718,6 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
|
||||
protected abstract void onCardActivated(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) {
|
||||
ItemPool<PaperCard> additions = new ItemPool<PaperCard>(cardManager.getGenericType());
|
||||
CardLimit limit = parentScreen.getCardLimit();
|
||||
@@ -733,7 +730,7 @@ public class FDeckEditor extends TabPageScreen<FDeckEditor> {
|
||||
if (deck == null || card == null) {
|
||||
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;
|
||||
if (parentScreen.isLimitedEditor() && !isAddSource) {
|
||||
//prevent adding more than is in other pool when editing limited decks
|
||||
|
||||
@@ -2,6 +2,7 @@ Name:Goblin Chainwhirler
|
||||
ManaCost:R R R
|
||||
Types:Creature Goblin Warrior
|
||||
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.
|
||||
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.
|
||||
@@ -4,6 +4,7 @@ import com.google.common.base.Function;
|
||||
import forge.GuiBase;
|
||||
import forge.deck.CardPool;
|
||||
import forge.deck.Deck;
|
||||
import forge.deck.DeckFormat;
|
||||
import forge.deck.DeckSection;
|
||||
import forge.item.*;
|
||||
import forge.itemmanager.IItemManager;
|
||||
@@ -345,7 +346,7 @@ public class QuestSpellShop {
|
||||
PaperCard card = (PaperCard)item.getKey();
|
||||
int numToKeep = card.getRules().getType().isBasic() ?
|
||||
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);
|
||||
}
|
||||
if (numToKeep < item.getValue()) {
|
||||
|
||||
Reference in New Issue
Block a user