mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
Basic groundwork for extra decks (contraptions, attractions) (#10378)
* extra deck cards not counted in deck size * extra deck handling in deckbuilder * move responsibility for extraDeckCard boolean to CardImpl * remove redundant field copy
This commit is contained in:
parent
978ebfc873
commit
9ba0da00ff
29 changed files with 97 additions and 47 deletions
|
|
@ -77,8 +77,8 @@ public final class DeckBuilder {
|
|||
addCardsToDeck(remainingCards, min, max, deckCount[index]);
|
||||
min = max + 1;
|
||||
}
|
||||
addCardsToDeck(remainingCards, 0, 4, deckSpells - deck.getCards().size());
|
||||
addCardsToDeck(remainingCards, 5, 10, deckSpells - deck.getCards().size());
|
||||
addCardsToDeck(remainingCards, 0, 4, deckSpells - deck.getMaindeckCards().size());
|
||||
addCardsToDeck(remainingCards, 5, 10, deckSpells - deck.getMaindeckCards().size());
|
||||
addLandsToDeck(allowedColors, setsToUse, landCardPool, callback);
|
||||
|
||||
Deck returnedDeck = deck;
|
||||
|
|
@ -174,7 +174,7 @@ public final class DeckBuilder {
|
|||
}
|
||||
|
||||
// Add optimal basic lands to deck.
|
||||
while (deck.getCards().size() < deckSize) {
|
||||
while (deck.getMaindeckCards().size() < deckSize) {
|
||||
ColoredManaSymbol bestColor = null;
|
||||
//Default to a color in the allowed colors
|
||||
if (allowedColors != null && !allowedColors.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ public class CardView extends SimpleCardView {
|
|||
protected CardView ability;
|
||||
protected int imageNumber;
|
||||
|
||||
protected boolean extraDeckCard;
|
||||
protected boolean transformable; // can toggle one card side to another (transformable cards, modal double faces)
|
||||
protected CardView secondCardFace;
|
||||
protected boolean transformed;
|
||||
|
|
@ -198,6 +199,7 @@ public class CardView extends SimpleCardView {
|
|||
this.isToken = cardView.isToken;
|
||||
this.ability = cardView.ability; // reference, not copy
|
||||
|
||||
this.extraDeckCard = cardView.extraDeckCard;
|
||||
this.transformable = cardView.transformable;
|
||||
this.secondCardFace = cardView.secondCardFace == null ? null : new CardView(cardView.secondCardFace);
|
||||
this.transformed = cardView.transformed;
|
||||
|
|
@ -500,6 +502,8 @@ public class CardView extends SimpleCardView {
|
|||
this.isToken = false;
|
||||
}
|
||||
|
||||
this.extraDeckCard = card.isExtraDeckCard();
|
||||
|
||||
// transformable, double faces cards
|
||||
this.transformable = card.isTransformable();
|
||||
|
||||
|
|
@ -1246,6 +1250,9 @@ public class CardView extends SimpleCardView {
|
|||
return typeText.toString();
|
||||
}
|
||||
|
||||
public boolean isExtraDeckCard() {
|
||||
return this.extraDeckCard;
|
||||
}
|
||||
public boolean isLand() {
|
||||
return cardTypes.contains(CardType.LAND);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue