Merge branch 'dungeon' into 'master'

Add Dungeon to EditionSectionWithCollectorNumbers

See merge request core-developers/forge!5099
This commit is contained in:
Michael Kamensky
2021-07-24 05:17:57 +00:00
22 changed files with 74 additions and 94 deletions

View File

@@ -322,7 +322,6 @@ public class StaticData {
} }
public PaperCard getCardByEditionDate(PaperCard card, Date editionDate) { public PaperCard getCardByEditionDate(PaperCard card, Date editionDate) {
PaperCard c = this.getCommonCards().getCardFromEdition(card.getName(), editionDate, CardDb.SetPreference.LatestCoreExp, card.getArtIndex()); PaperCard c = this.getCommonCards().getCardFromEdition(card.getName(), editionDate, CardDb.SetPreference.LatestCoreExp, card.getArtIndex());
if (null != c) { if (null != c) {
@@ -346,7 +345,6 @@ public class StaticData {
} }
public PaperCard getCardFromLatestorEarliest(PaperCard card) { public PaperCard getCardFromLatestorEarliest(PaperCard card) {
PaperCard c = this.getCommonCards().getCardFromEdition(card.getName(), null, CardDb.SetPreference.Latest, card.getArtIndex()); PaperCard c = this.getCommonCards().getCardFromEdition(card.getName(), null, CardDb.SetPreference.Latest, card.getArtIndex());
if (null != c && c.hasImage()) { if (null != c && c.hasImage()) {
@@ -376,7 +374,6 @@ public class StaticData {
} }
public PaperCard getCardFromEarliestCoreExp(PaperCard card) { public PaperCard getCardFromEarliestCoreExp(PaperCard card) {
PaperCard c = this.getCommonCards().getCardFromEdition(card.getName(), null, CardDb.SetPreference.EarliestCoreExp, card.getArtIndex()); PaperCard c = this.getCommonCards().getCardFromEdition(card.getName(), null, CardDb.SetPreference.EarliestCoreExp, card.getArtIndex());
if (null != c && c.hasImage()) { if (null != c && c.hasImage()) {

View File

@@ -212,16 +212,14 @@ public final class CardDb implements ICardDatabase, IDeckGenPool {
CardRules cr = rulesByName.get(cis.name); CardRules cr = rulesByName.get(cis.name);
if (cr != null) { if (cr != null) {
addSetCard(e, cis, cr); addSetCard(e, cis, cr);
} } else {
else {
missingCards.add(cis.name); missingCards.add(cis.name);
} }
} }
if (isCoreExpSet && logMissingPerEdition) { if (isCoreExpSet && logMissingPerEdition) {
if (missingCards.isEmpty()) { if (missingCards.isEmpty()) {
System.out.println(" ... 100% "); System.out.println(" ... 100% ");
} } else {
else {
int missing = (e.getAllCardsInSet().size() - missingCards.size()) * 10000 / e.getAllCardsInSet().size(); int missing = (e.getAllCardsInSet().size() - missingCards.size()) * 10000 / e.getAllCardsInSet().size();
System.out.printf(" ... %.2f%% (%s missing: %s)%n", missing * 0.01f, Lang.nounWithAmount(missingCards.size(), "card"), StringUtils.join(missingCards, " | ")); System.out.printf(" ... %.2f%% (%s missing: %s)%n", missing * 0.01f, Lang.nounWithAmount(missingCards.size(), "card"), StringUtils.join(missingCards, " | "));
} }
@@ -505,7 +503,6 @@ public final class CardDb implements ICardDatabase, IDeckGenPool {
if (pc.hasImage()) { if (pc.hasImage()) {
return pc; return pc;
} }
else {
if (firstWithoutImage == null) { if (firstWithoutImage == null) {
firstWithoutImage = pc; //ensure first without image returns if none have image firstWithoutImage = pc; //ensure first without image returns if none have image
} }
@@ -515,7 +512,7 @@ public final class CardDb implements ICardDatabase, IDeckGenPool {
} }
cards.remove(randomIndex); //remove card from collection and try another random card cards.remove(randomIndex); //remove card from collection and try another random card
sz--; sz--;
}
} }
} }
} }

View File

@@ -146,7 +146,8 @@ public final class CardEdition implements Comparable<CardEdition> {
BUY_A_BOX("buy a box"), BUY_A_BOX("buy a box"),
PROMO("promo"), PROMO("promo"),
BUNDLE("bundle"), BUNDLE("bundle"),
BOX_TOPPER("box topper"); BOX_TOPPER("box topper"),
DUNGEONS("dungeons");
private final String name; private final String name;

View File

@@ -451,8 +451,7 @@ public final class CardType implements Comparable<CardType>, CardTypeView {
if (calculatedType == null) { if (calculatedType == null) {
if (subtypes.isEmpty()) { if (subtypes.isEmpty()) {
calculatedType = StringUtils.join(getTypesBeforeDash(), ' '); calculatedType = StringUtils.join(getTypesBeforeDash(), ' ');
} } else {
else {
calculatedType = StringUtils.join(getTypesBeforeDash(), ' ') + " - " + StringUtils.join(subtypes, " "); calculatedType = StringUtils.join(getTypesBeforeDash(), ' ') + " - " + StringUtils.join(subtypes, " ");
} }
} }

View File

@@ -73,8 +73,7 @@ public class DamageAllEffect extends DamageBaseEffect {
CardCollectionView list; CardCollectionView list;
if (sa.hasParam("ValidCards")) { if (sa.hasParam("ValidCards")) {
list = game.getCardsIn(ZoneType.Battlefield); list = game.getCardsIn(ZoneType.Battlefield);
} } else {
else {
list = CardCollection.EMPTY; list = CardCollection.EMPTY;
} }

View File

@@ -36,8 +36,7 @@ public class ManaConversionMatrix {
rowIdx = rowIdx < 0 ? identityMatrix.length - 1 : rowIdx; rowIdx = rowIdx < 0 ? identityMatrix.length - 1 : rowIdx;
if (additive) { if (additive) {
colorConversionMatrix[rowIdx] |= replacementColor; colorConversionMatrix[rowIdx] |= replacementColor;
} } else {
else {
colorRestrictionMatrix[rowIdx] &= replacementColor; colorRestrictionMatrix[rowIdx] &= replacementColor;
} }
} }

View File

@@ -258,8 +258,7 @@ public class ManaCostBeingPaid {
ManaCostShard shard; ManaCostShard shard;
if (StringUtils.isEmpty(xColor)) { if (StringUtils.isEmpty(xColor)) {
shard = ManaCostShard.GENERIC; shard = ManaCostShard.GENERIC;
} } else {
else {
shard = ManaCostShard.parseNonGeneric(xColor); shard = ManaCostShard.parseNonGeneric(xColor);
} }
increaseShard(shard, xCost, true); increaseShard(shard, xCost, true);

View File

@@ -137,18 +137,15 @@ public class ManaPool extends ManaConversionMatrix implements Iterable<Mana> {
if (convertToColorless) { if (convertToColorless) {
convertManaColor(b, (byte)ManaAtom.COLORLESS); convertManaColor(b, (byte)ManaAtom.COLORLESS);
cm.addAll(pMana); cm.addAll(pMana);
} } else {
else {
cleared.addAll(cm); cleared.addAll(cm);
cm.clear(); cm.clear();
floatingMana.putAll(b, pMana); floatingMana.putAll(b, pMana);
} }
} } else {
else {
if (convertToColorless) { if (convertToColorless) {
convertManaColor(b, (byte)ManaAtom.COLORLESS); convertManaColor(b, (byte)ManaAtom.COLORLESS);
} } else {
else {
cleared.addAll(cm); cleared.addAll(cm);
cm.clear(); cm.clear();
} }
@@ -261,8 +258,7 @@ public class ManaPool extends ManaConversionMatrix implements Iterable<Mana> {
if (poolLane != null && poolLane.contains(mana)) { if (poolLane != null && poolLane.contains(mana)) {
removeFloating.add(mana); removeFloating.add(mana);
} } else {
else {
manaNotAccountedFor = true; manaNotAccountedFor = true;
break; break;
} }

View File

@@ -163,7 +163,6 @@ public class StaticAbilityCantBeCast {
return false; return false;
} }
if (stAb.hasParam("AffectedZone") && !card.isInZone(ZoneType.smartValueOf(stAb.getParam("AffectedZone")))) { if (stAb.hasParam("AffectedZone") && !card.isInZone(ZoneType.smartValueOf(stAb.getParam("AffectedZone")))) {
return false; return false;
} }

View File

@@ -48,11 +48,7 @@ public class StaticAbilityCastWithFlash {
return false; return false;
} }
public static boolean commonParts(final StaticAbility stAb, final SpellAbility sa, final Card card, final Player activator) { public static boolean commonParts(final StaticAbility stAb, final SpellAbility sa, final Card card, final Player activator) {
if (!stAb.matchesValidParam("ValidCard", card)) { if (!stAb.matchesValidParam("ValidCard", card)) {
return false; return false;
} }

View File

@@ -535,14 +535,12 @@ public abstract class Trigger extends TriggerReplacementBase {
return this.numberTurnActivations; return this.numberTurnActivations;
} }
public void triggerRun() public void triggerRun() {
{
this.numberTurnActivations++; this.numberTurnActivations++;
} }
// Resets the state stored each turn for per-turn and per-instance restriction // Resets the state stored each turn for per-turn and per-instance restriction
public void resetTurnState() public void resetTurnState() {
{
this.numberTurnActivations = 0; this.numberTurnActivations = 0;
} }