Tokens rework:

- added reminder / helper tokens support (example: Copy, Morph, Day // Night, related to #10139);
 - added verify checks for reminder tokens;
 - added images download for reminder tokens;
This commit is contained in:
Oleg Agafonov 2023-04-27 18:45:50 +04:00
parent 0e1e6a0f21
commit f86cf176d7
11 changed files with 242 additions and 40 deletions

View file

@ -1,5 +1,7 @@
package org.mage.plugins.card.dl.sources;
import mage.cards.repository.TokenRepository;
import java.util.HashMap;
import java.util.Map;
@ -13,11 +15,13 @@ public class ScryfallImageSupportTokens {
private static final Map<String, String> supportedCards = new HashMap<String, String>() {
{
// xmage token -> direct or api link:
//
// examples:
// direct example: https://img.scryfall.com/cards/large/en/trix/6.jpg
// direct example: https://cards.scryfall.io/large/back/d/c/dc26e13b-7a0f-4e7f-8593-4f22234f4517.jpg
// api example: https://api.scryfall.com/cards/trix/6/en?format=image
// api example: https://api.scryfall.com/cards/trix/6?format=image
// api format is primary
// api example: https://api.scryfall.com/cards/tvow/21/en?format=image&face=back
// api format is primary (direct images links can be changed by scryfall)
//
// code form for one token:
// set/token_name
@ -25,6 +29,14 @@ public class ScryfallImageSupportTokens {
// code form for same name tokens (alternative images):
// set/token_name/1
// set/token_name/2
//
// double faced cards:
// front face image: format=image&face=front
// back face image: format=image&face=back
// XMAGE
// additional tokens for reminder/helper images
putAll(TokenRepository.instance.prepareScryfallDownloadList());
// RIX
put("RIX/City's Blessing", "https://api.scryfall.com/cards/trix/6/en?format=image"); // TODO: missing from tokens data