- Adding Advantageous Proclamation (CNS)

This commit is contained in:
Sol
2016-08-02 20:08:40 +00:00
parent be014c4237
commit 4c49db4c89
4 changed files with 21 additions and 2 deletions

1
.gitattributes vendored
View File

@@ -1540,6 +1540,7 @@ forge-gui/res/cardsfolder/a/adun_oakenshield.txt svneol=native#text/plain
forge-gui/res/cardsfolder/a/advance_scout.txt svneol=native#text/plain
forge-gui/res/cardsfolder/a/advanced_hoverguard.txt svneol=native#text/plain
forge-gui/res/cardsfolder/a/advanced_stitchwing.txt -text
forge-gui/res/cardsfolder/a/advantageous_proclamation.txt -text
forge-gui/res/cardsfolder/a/advent_of_the_wurm.txt -text
forge-gui/res/cardsfolder/a/adventurers_guildhouse.txt -text
forge-gui/res/cardsfolder/a/adventuring_gear.txt svneol=native#text/plain

View File

@@ -114,7 +114,7 @@ public class CardPool extends ItemPool<PaperCard> {
/**
* returns n-th card from this DeckSection. LINEAR time. No fixed order between changes
* @param i
* @param n
* @return
*/
public PaperCard get(int n) {
@@ -125,6 +125,14 @@ public class CardPool extends ItemPool<PaperCard> {
return null;
}
public int countByName(String cardName, boolean isCommonCard) {
PaperCard pc = isCommonCard
? StaticData.instance().getCommonCards().getCard(cardName)
: StaticData.instance().getVariantCards().getCard(cardName);
return this.count(pc);
}
@Override
public String toString() {
if (this.isEmpty()) { return "[]"; }

View File

@@ -98,6 +98,7 @@ public enum DeckFormat {
private final Range<Integer> sideRange; // null => no check
private final int maxCardCopies;
private final Predicate<CardRules> cardPoolFilter;
private final static String ADVPROCLAMATION = "Advantageous Proclamation";
private DeckFormat(Range<Integer> mainRange0, Range<Integer> sideRange0, int maxCardCopies0) {
this(mainRange0, sideRange0, maxCardCopies0, null);
@@ -166,8 +167,11 @@ public enum DeckFormat {
int min = getMainRange().getMinimum();
int max = getMainRange().getMaximum();
// TODO "Your minimum deck size is reduced by five."
// Adjust minimum base on number of Advantageous Proclamation or similar cards
CardPool conspiracies = deck.get(DeckSection.Conspiracy);
if (conspiracies != null) {
min -= (5 * conspiracies.countByName(ADVPROCLAMATION, true));
}
if (deckSize < min) {
return String.format("should have at least %d cards", min);

View File

@@ -0,0 +1,6 @@
Name:Advantageous Proclamation
ManaCost:no cost
Types:Conspiracy
K:Your minimum deck size is reduced by five.
SVar:Picture:http://www.wizards.com/global/images/magic/general/advantageous_proclamation.jpg
Oracle:(Start the game with this conspiracy face up in the command zone.)\nYour minimum deck size is reduced by five.