forked from External/mage
add season 3
This commit is contained in:
parent
31839c4eca
commit
1ad521d340
6 changed files with 123 additions and 2 deletions
|
|
@ -21,6 +21,19 @@ public final class Constants {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final ImmutableList<Pair<String, String[]>> foulMagicsSets = ImmutableList.of(
|
public static final ImmutableList<Pair<String, String[]>> foulMagicsSets = ImmutableList.of(
|
||||||
|
new Pair<String, String[]>("Set 3 - Old Fat Men", new String[] {
|
||||||
|
"Ninth Edition",
|
||||||
|
"Tenth Edition",
|
||||||
|
"* Time Spiral Block",
|
||||||
|
"* Lorwyn Block",
|
||||||
|
"* Shards of Alara Block",
|
||||||
|
"Scars of Mirrodin",
|
||||||
|
"Zendikar",
|
||||||
|
"Rise of the Eldrazi",
|
||||||
|
"Worldwake",
|
||||||
|
"* Innstrad Block",
|
||||||
|
"Foul Magic Block 3 Extras"
|
||||||
|
}),
|
||||||
new Pair<String, String[]>("Set 2.5 - Ravnica Cultural Exchange", new String[] {
|
new Pair<String, String[]>("Set 2.5 - Ravnica Cultural Exchange", new String[] {
|
||||||
"* March of the Machine Block",
|
"* March of the Machine Block",
|
||||||
"* Phyrexia: All Will Be One Block",
|
"* Phyrexia: All Will Be One Block",
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,16 @@ package org.mage.plugins.card.dl.sources;
|
||||||
|
|
||||||
import org.tritonus.share.ArraySet;
|
import org.tritonus.share.ArraySet;
|
||||||
|
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.cards.CardWithHalves;
|
||||||
|
import mage.cards.ExpansionSet;
|
||||||
|
import mage.cards.Sets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
|
@ -619,6 +625,9 @@ public class ScryfallImageSupportCards {
|
||||||
|
|
||||||
// Custom sets using Scryfall images - must provide a direct link for each card in directDownloadLinks
|
// Custom sets using Scryfall images - must provide a direct link for each card in directDownloadLinks
|
||||||
add("CALC"); // Custom Alchemized versions of existing cards
|
add("CALC"); // Custom Alchemized versions of existing cards
|
||||||
|
|
||||||
|
// Foul Magics sets
|
||||||
|
add("FMB3E");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -758,6 +767,32 @@ public class ScryfallImageSupportCards {
|
||||||
put("TDM/Scavenger Regent/379b", "https://api.scryfall.com/cards/tdm/379/en?format=image&face=back");
|
put("TDM/Scavenger Regent/379b", "https://api.scryfall.com/cards/tdm/379/en?format=image&face=back");
|
||||||
put("TDM/Ugin, Eye of the Storms/382b", "https://api.scryfall.com/cards/tdm/382/en?format=image&face=back");
|
put("TDM/Ugin, Eye of the Storms/382b", "https://api.scryfall.com/cards/tdm/382/en?format=image&face=back");
|
||||||
|
|
||||||
|
for (ExpansionSet set : Sets.getInstance().values()) {
|
||||||
|
for (Integer key : set.cardAliases.keySet()) {
|
||||||
|
var value = set.cardAliases.get(key);
|
||||||
|
|
||||||
|
put(
|
||||||
|
String.format("%s/%s/%s", set.getCode(), value.cardInfo.getName(), value.cardInfo.getCardNumber()),
|
||||||
|
String.format("https://api.scryfall.com/cards/%s/%s/en?face=front&format=image", value.targetSet.toLowerCase(), value.targetSetNumber)
|
||||||
|
);
|
||||||
|
if (CardWithHalves.class.isAssignableFrom(value.cardInfo.getCardClass())) {
|
||||||
|
try {
|
||||||
|
UUID uid = UUID.randomUUID();
|
||||||
|
CardSetInfo info = new CardSetInfo(set.getName(), set.getCode(), value.targetSet, value.cardInfo.getRarity());
|
||||||
|
CardWithHalves backCard = (CardWithHalves) value.cardInfo.getCardClass().getDeclaredConstructor(UUID.class, CardSetInfo.class).newInstance(
|
||||||
|
uid, info);
|
||||||
|
|
||||||
|
put(
|
||||||
|
String.format("%s/%s/%s", set.getCode(), backCard.getRightHalfCard().getName(), value.cardInfo.getCardNumber()),
|
||||||
|
String.format("https://api.scryfall.com/cards/%s/%s/en?face=back", value.targetSet.toLowerCase(), value.targetSetNumber)
|
||||||
|
);
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -781,6 +816,7 @@ public class ScryfallImageSupportCards {
|
||||||
if (directDownloadLinks.containsKey(linkCode2)) {
|
if (directDownloadLinks.containsKey(linkCode2)) {
|
||||||
return linkCode2;
|
return linkCode2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// default
|
// default
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
43
Mage.Sets/src/mage/sets/FoulMagicBlock3Extras.java
Normal file
43
Mage.Sets/src/mage/sets/FoulMagicBlock3Extras.java
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
package mage.sets;
|
||||||
|
|
||||||
|
import mage.cards.ExpansionSet;
|
||||||
|
import mage.cards.ExpansionSet.SetCardInfo;
|
||||||
|
import mage.constants.Rarity;
|
||||||
|
import mage.constants.SetType;
|
||||||
|
|
||||||
|
public class FoulMagicBlock3Extras extends ExpansionSet {
|
||||||
|
|
||||||
|
|
||||||
|
private static final FoulMagicBlock3Extras instance = new FoulMagicBlock3Extras();
|
||||||
|
|
||||||
|
public static FoulMagicBlock3Extras getInstance() {
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
private FoulMagicBlock3Extras() {
|
||||||
|
super("Foul Magic Block 3 Extras", "FMB3E", ExpansionSet.buildDate(2025, 10, 25), SetType.CUSTOM_SET);
|
||||||
|
this.hasBasicLands = false;
|
||||||
|
addDualAlias("MH3", "252", new SetCardInfo("Bloodsoaked Insight", 1, Rarity.UNCOMMON, mage.cards.b.BloodsoakedInsight.class));
|
||||||
|
addDualAlias("MH3", "243", new SetCardInfo("Boggart Trawler", 2, Rarity.UNCOMMON, mage.cards.b.BoggartTrawler.class));
|
||||||
|
addDualAlias("MH3", "249", new SetCardInfo("Bridgeworks Battle", 3, Rarity.UNCOMMON, mage.cards.b.BridgeworksBattle.class));
|
||||||
|
addDualAlias("MH3", "250", new SetCardInfo("Disciple of Freyalise", 4, Rarity.UNCOMMON, mage.cards.d.DiscipleOfFreyalise.class));
|
||||||
|
addDualAlias("MH3", "253", new SetCardInfo("Drowner of Truth", 5, Rarity.UNCOMMON, mage.cards.d.DrownerOfTruth.class));
|
||||||
|
addDualAlias("MH3", "244", new SetCardInfo("Fell the Profane", 6, Rarity.UNCOMMON, mage.cards.f.FellTheProfane.class));
|
||||||
|
addDualAlias("MH3", "254", new SetCardInfo("Glasswing Grace", 7, Rarity.UNCOMMON, mage.cards.g.GlasswingGrace.class));
|
||||||
|
addDualAlias("MH3", "240", new SetCardInfo("Hydroelectric Specimen", 8, Rarity.UNCOMMON, mage.cards.h.HydroelectricSpecimen.class));
|
||||||
|
addDualAlias("MH3", "255", new SetCardInfo("Legion Leadership", 9, Rarity.UNCOMMON, mage.cards.l.LegionLeadership.class));
|
||||||
|
addDualAlias("MH3", "246", new SetCardInfo("Pinnacle Monk", 10, Rarity.UNCOMMON, mage.cards.p.PinnacleMonk.class));
|
||||||
|
addDualAlias("MH3", "238", new SetCardInfo("Razorgrass Ambush", 11, Rarity.UNCOMMON, mage.cards.r.RazorgrassAmbush.class));
|
||||||
|
addDualAlias("MH3", "256", new SetCardInfo("Revitalizing Repast", 12, Rarity.UNCOMMON, mage.cards.r.RevitalizingRepast.class));
|
||||||
|
addDualAlias("MH3", "257", new SetCardInfo("Rush of Inspiration", 13, Rarity.UNCOMMON, mage.cards.r.RushOfInspiration.class));
|
||||||
|
addDualAlias("MH3", "241", new SetCardInfo("Sink into Stupor", 14, Rarity.UNCOMMON, mage.cards.s.SinkIntoStupor.class));
|
||||||
|
addDualAlias("MH3", "258", new SetCardInfo("Strength of the Harvest", 15, Rarity.UNCOMMON, mage.cards.s.StrengthOfTheHarvest.class));
|
||||||
|
addDualAlias("MH3", "259", new SetCardInfo("Stump Stomp", 16, Rarity.UNCOMMON, mage.cards.s.StumpStomp.class));
|
||||||
|
addDualAlias("MH3", "248", new SetCardInfo("Sundering Eruption", 17, Rarity.UNCOMMON, mage.cards.s.SunderingEruption.class));
|
||||||
|
addDualAlias("MH3", "260", new SetCardInfo("Suppression Ray", 18, Rarity.UNCOMMON, mage.cards.s.SuppressionRay.class));
|
||||||
|
addDualAlias("MH3", "261", new SetCardInfo("Waterlogged Teachings", 19, Rarity.UNCOMMON, mage.cards.w.WaterloggedTeachings.class));
|
||||||
|
addDualAlias("MH3", "239", new SetCardInfo("Witch Enchanter", 20, Rarity.UNCOMMON, mage.cards.w.WitchEnchanter.class));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -21,7 +21,7 @@ public final class ModernHorizons3 extends ExpansionSet {
|
||||||
public static ModernHorizons3 getInstance() {
|
public static ModernHorizons3 getInstance() {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ModernHorizons3() {
|
private ModernHorizons3() {
|
||||||
super("Modern Horizons 3", "MH3", ExpansionSet.buildDate(2024, 6, 7), SetType.SUPPLEMENTAL_MODERN_LEGAL);
|
super("Modern Horizons 3", "MH3", ExpansionSet.buildDate(2024, 6, 7), SetType.SUPPLEMENTAL_MODERN_LEGAL);
|
||||||
this.blockName = "Modern Horizons 3";
|
this.blockName = "Modern Horizons 3";
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,41 @@ import java.io.Serializable;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
*/
|
*/
|
||||||
public abstract class ExpansionSet implements Serializable {
|
public abstract class ExpansionSet implements Serializable {
|
||||||
|
|
||||||
|
public class CardAlias {
|
||||||
|
public String targetSet;
|
||||||
|
public String targetSetNumber;
|
||||||
|
public boolean hasBack;
|
||||||
|
public SetCardInfo cardInfo;
|
||||||
|
public CardAlias(String targetSet, String targetSetNumber, boolean hasBack, SetCardInfo cardInfo) {
|
||||||
|
this.targetSet = targetSet;
|
||||||
|
this.targetSetNumber = targetSetNumber;
|
||||||
|
this.hasBack = hasBack;
|
||||||
|
this.cardInfo = cardInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(ExpansionSet.class);
|
private static final Logger logger = Logger.getLogger(ExpansionSet.class);
|
||||||
|
|
||||||
|
// Foul magic alias tweaks
|
||||||
|
public final HashMap<Integer, CardAlias> cardAliases = new HashMap<Integer, CardAlias>();
|
||||||
|
|
||||||
|
public void addAlias(String setCode, String setNumber, SetCardInfo cardInfo) {
|
||||||
|
cards.add(cardInfo);
|
||||||
|
cardAliases.put(cardInfo.getCardNumberAsInt(), new CardAlias(setCode, setNumber, false, cardInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addDualAlias(String setCode, String setNumber, SetCardInfo cardInfo) {
|
||||||
|
cards.add(cardInfo);
|
||||||
|
cardAliases.put(cardInfo.getCardNumberAsInt(), new CardAlias(setCode, setNumber, true, cardInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO: remove all usage to default (see below), keep bfz/zen/ust art styles for specific sets only
|
// TODO: remove all usage to default (see below), keep bfz/zen/ust art styles for specific sets only
|
||||||
// the main different in art styles - full art lands can have big mana icon at the bottom
|
// the main different in art styles - full art lands can have big mana icon at the bottom
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ public enum CardRepository {
|
||||||
private static final String VERSION_ENTITY_NAME = "card";
|
private static final String VERSION_ENTITY_NAME = "card";
|
||||||
private static final long CARD_DB_VERSION = 55; // raise this if db structure was changed
|
private static final long CARD_DB_VERSION = 55; // raise this if db structure was changed
|
||||||
private static final long CARD_CONTENT_VERSION = 241; // raise this if new cards were added to the server
|
private static final long CARD_CONTENT_VERSION = 241; // raise this if new cards were added to the server
|
||||||
private static final long CARD_CONTENT_VERSION_FOUL = 1; // raise this if specifically foul magic patches changed things
|
private static final long CARD_CONTENT_VERSION_FOUL = 2; // raise this if specifically foul magic patches changed things
|
||||||
|
|
||||||
|
|
||||||
private Dao<CardInfo, Object> cardsDao;
|
private Dao<CardInfo, Object> cardsDao;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue