[ZNC] Added images and tokens support/download

This commit is contained in:
Oleg Agafonov 2020-11-05 12:55:08 +04:00
parent 6bc040ef6c
commit 8fa0ba1cfd
16 changed files with 104 additions and 86 deletions

View file

@ -489,6 +489,7 @@ public class ScryfallImageSupportCards {
add("2XM"); // Double Masters
add("AKR"); // Amonkhet Remastered
add("ZNR"); // Zendikar Rising
add("ZNC"); // Zendikar Rising Commander
add("CMR"); // Commander Legends
add("CC1"); // Commander Collection: Green
}

View file

@ -461,6 +461,20 @@ public class ScryfallImageSupportTokens {
put("ZNR/Kor Warrior", "https://api.scryfall.com/cards/tznr/4/en?format=image");
put("ZNR/Plant", "https://api.scryfall.com/cards/tznr/8/en?format=image");
// ZNC
put("ZNC/Beast", "https://api.scryfall.com/cards/tznc/7/en?format=image");
put("ZNC/Bird", "https://api.scryfall.com/cards/tznc/1/en?format=image");
put("ZNC/Elemental/1", "https://api.scryfall.com/cards/tznc/10/en?format=image"); // 5/5
put("ZNC/Elemental/2", "https://api.scryfall.com/cards/tznc/8/en?format=image"); // 2/2
put("ZNC/Faerie Rogue", "https://api.scryfall.com/cards/tznc/3/en?format=image");
//put("ZNC/Germ", "https://api.scryfall.com/cards/tznc/4/en?format=image"); // must be in chest or antology
put("ZNC/Goblin Rogue", "https://api.scryfall.com/cards/tznc/5/en?format=image");
put("ZNC/Kor Ally", "https://api.scryfall.com/cards/tznc/2/en?format=image");
put("ZNC/Rat", "https://api.scryfall.com/cards/tznc/6/en?format=image");
put("ZNC/Saproling", "https://api.scryfall.com/cards/tznc/9/en?format=image");
put("ZNC/Thopter", "https://api.scryfall.com/cards/tznc/11/en?format=image");
// generate supported sets
supportedSets.clear();
for (String cardName : this.keySet()) {

View file

@ -1438,4 +1438,22 @@
|Generate|TOK:ZNR|Illusion|||CustomIllusionToken|
|Generate|TOK:ZNR|Insect|||InsectToken|
|Generate|TOK:ZNR|Kor Warrior|||KorWarriorToken|
|Generate|TOK:ZNR|Plant|||PlantToken|
|Generate|TOK:ZNR|Plant|||PlantToken|
# ZNC
|Generate|TOK:ZNC|Bird|||BirdToken|
|Generate|TOK:ZNC|Beast|||BeastToken2|
|Generate|TOK:ZNC|Elemental|1||OmnathElementalToken|
|Generate|TOK:ZNC|Elemental|2||ZendikarsRoilElementalToken|
|Generate|TOK:ZNC|Faerie Rogue|||FaerieRogueToken|
#
# OonaQueenFaerieRogueToken is FaerieRogueToken with additional blue color, but ZNC contains only one token - so don't use normal token for it
#|Generate|TOK:ZNC|Faerie Rogue|||OonaQueenFaerieRogueToken|
# Germ token uses in chest and antology, but scryfall put it here
#|Generate|TOK:ZNC|Germ|||GermToken|
#
|Generate|TOK:ZNC|Goblin Rogue|||GoblinRogueToken|
|Generate|TOK:ZNC|Kor Ally|||KorAllyToken|
|Generate|TOK:ZNC|Rat|||RatToken|
|Generate|TOK:ZNC|Saproling|||SaprolingToken|
|Generate|TOK:ZNC|Thopter|||ThopterColorlessToken|

View file

@ -1,7 +1,5 @@
package mage.cards.o;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -21,36 +19,36 @@ import mage.filter.predicate.permanent.AnotherPredicate;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.permanent.token.RatToken;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class OgreSlumlord extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another nontoken creature");
private static final FilterControlledPermanent filter2 = new FilterControlledPermanent("Rats you control");
static {
filter.add(Predicates.not(TokenPredicate.instance));
filter.add(AnotherPredicate.instance);
filter2.add(SubType.RAT.getPredicate());
}
public OgreSlumlord(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
this.subtype.add(SubType.OGRE);
this.subtype.add(SubType.ROGUE);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Whenever another nontoken creature dies, you may create a 1/1 black Rat creature token.
this.addAbility(new DiesCreatureTriggeredAbility(new CreateTokenEffect(new RatToken()), true, filter));
// Rats you control have deathtouch.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield, filter2)));
}
public OgreSlumlord(final OgreSlumlord card) {

View file

@ -1,7 +1,5 @@
package mage.cards.o;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -9,24 +7,17 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.cards.*;
import mage.choices.ChoiceColor;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.permanent.token.OonaQueenFaerieToken;
import mage.game.permanent.token.OonaQueenFaerieRogueToken;
import mage.players.Player;
import mage.target.common.TargetOpponent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class OonaQueenOfTheFae extends CardImpl {
@ -42,6 +33,7 @@ public final class OonaQueenOfTheFae extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// {X}{UB}: Choose a color. Target opponent exiles the top X cards of their library. For each card of the chosen color exiled this way, create a 1/1 blue and black Faerie Rogue creature token with flying.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new OonaQueenOfTheFaeEffect(), new ManaCostsImpl("{X}{U/B}"));
ability.addTarget(new TargetOpponent());
@ -93,7 +85,7 @@ class OonaQueenOfTheFaeEffect extends OneShotEffect {
}
controller.moveCards(cardsToExile, Zone.EXILED, source, game);
if (cardsWithColor > 0) {
new CreateTokenEffect(new OonaQueenFaerieToken(), cardsWithColor).apply(game, source);
new CreateTokenEffect(new OonaQueenFaerieRogueToken(), cardsWithColor).apply(game, source);
}
game.informPlayers("Oona: " + cardsWithColor + " Token" + (cardsWithColor != 1 ? "s" : "") + " created");
return true;

View file

@ -16,7 +16,7 @@ public final class BeastToken2 extends TokenImpl {
static final private List<String> tokenImageSets = new ArrayList<>();
static {
tokenImageSets.addAll(Arrays.asList("ZEN", "C14", "DDD", "C15", "GVL", "MM3", "CMA", "E01", "C19", "C20"));
tokenImageSets.addAll(Arrays.asList("ZEN", "C14", "DDD", "C15", "GVL", "MM3", "CMA", "E01", "C19", "C20", "ZNC"));
}
public BeastToken2() {

View file

@ -22,7 +22,7 @@ public final class BirdToken extends TokenImpl {
toughness = new MageInt(1);
addAbility(FlyingAbility.getInstance());
availableImageSetCodes.addAll(Arrays.asList("BNG", "CSP", "DGM", "JUD", "MM3", "RTR", "VMA", "ZEN", "MH1", "C20", "M21"));
availableImageSetCodes.addAll(Arrays.asList("BNG", "CSP", "DGM", "JUD", "MM3", "RTR", "VMA", "ZEN", "MH1", "C20", "M21", "ZNC"));
}
public BirdToken(final BirdToken token) {

View file

@ -1,28 +1,17 @@
package mage.game.permanent.token;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.MageInt;
import mage.abilities.keyword.FlyingAbility;
import mage.constants.CardType;
import mage.constants.SubType;
import java.util.Arrays;
/**
*
* @author LoneFox
*/
public final class FaerieRogueToken extends TokenImpl {
static final private List<String> tokenImageSets = new ArrayList<>();
static {
tokenImageSets.addAll(Arrays.asList("SHM", "MOR", "MMA", "MM2"));
}
public FaerieRogueToken() {
super("Faerie Rogue", "1/1 black Faerie Rogue creature token with flying");
cardType.add(CardType.CREATURE);
@ -33,7 +22,7 @@ public final class FaerieRogueToken extends TokenImpl {
toughness = new MageInt(1);
addAbility(FlyingAbility.getInstance());
availableImageSetCodes = tokenImageSets;
availableImageSetCodes = Arrays.asList("SHM", "MOR", "MMA", "MM2", "ZNC");
}
public FaerieRogueToken(final FaerieRogueToken token) {

View file

@ -1,14 +1,12 @@
package mage.game.permanent.token;
import java.util.Arrays;
import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.MageInt;
import java.util.Arrays;
/**
*
* @author LoneFox
*/
public final class GoblinRogueToken extends TokenImpl {
@ -21,7 +19,8 @@ public final class GoblinRogueToken extends TokenImpl {
subtype.add(SubType.ROGUE);
power = new MageInt(1);
toughness = new MageInt(1);
availableImageSetCodes.addAll(Arrays.asList("LRW", "MMA"));
availableImageSetCodes.addAll(Arrays.asList("LRW", "MMA", "ZNC"));
}
public GoblinRogueToken(final GoblinRogueToken token) {

View file

@ -4,17 +4,20 @@ import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
import java.util.Arrays;
public final class KorAllyToken extends TokenImpl {
public KorAllyToken() {
super("Kor Ally", "1/1 white Kor Ally creature token");
this.setExpansionSetCodeForImage("BFZ");
cardType.add(CardType.CREATURE);
subtype.add(SubType.KOR);
subtype.add(SubType.ALLY);
color.setWhite(true);
power = new MageInt(1);
toughness = new MageInt(1);
availableImageSetCodes = Arrays.asList("BFZ", "OGW", "ZNC");
}
public KorAllyToken(final KorAllyToken token) {

View file

@ -4,6 +4,8 @@ import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
import java.util.Arrays;
/**
* @author spjspj
*/
@ -20,6 +22,8 @@ public final class OmnathElementalToken extends TokenImpl {
color.setGreen(true);
power = new MageInt(5);
toughness = new MageInt(5);
availableImageSetCodes.addAll(Arrays.asList("BFZ", "ZNC"));
}
public OmnathElementalToken(final OmnathElementalToken token) {

View file

@ -10,9 +10,9 @@ import mage.abilities.keyword.FlyingAbility;
*
* @author spjspj
*/
public final class OonaQueenFaerieToken extends TokenImpl {
public final class OonaQueenFaerieRogueToken extends TokenImpl {
public OonaQueenFaerieToken() {
public OonaQueenFaerieRogueToken() {
super("Faerie Rogue", "1/1 blue and black Faerie Rogue creature token with flying");
cardType.add(CardType.CREATURE);
color.setBlue(true);
@ -23,11 +23,11 @@ public final class OonaQueenFaerieToken extends TokenImpl {
toughness = new MageInt(1);
this.addAbility(FlyingAbility.getInstance());
}
public OonaQueenFaerieToken(final OonaQueenFaerieToken token) {
public OonaQueenFaerieRogueToken(final OonaQueenFaerieRogueToken token) {
super(token);
}
public OonaQueenFaerieToken copy() {
return new OonaQueenFaerieToken(this);
public OonaQueenFaerieRogueToken copy() {
return new OonaQueenFaerieRogueToken(this);
}
}

View file

@ -4,21 +4,13 @@ import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @author LevelX2
*/
public final class RatToken extends TokenImpl {
static final private List<String> tokenImageSets = new ArrayList<>();
static {
tokenImageSets.addAll(Arrays.asList("GTC", "ELD"));
}
public RatToken() {
super("Rat", "1/1 black Rat creature token");
cardType.add(CardType.CREATURE);
@ -27,7 +19,7 @@ public final class RatToken extends TokenImpl {
power = new MageInt(1);
toughness = new MageInt(1);
availableImageSetCodes = tokenImageSets;
availableImageSetCodes = Arrays.asList("C17", "CHK", "GTC", "SHM", "STH", "TPR", "ELD", "ZNC");
}
public RatToken(final RatToken token) {

View file

@ -42,7 +42,8 @@ public final class SaprolingToken extends TokenImpl {
"DOM", // 3 different token images
"C19",
"C20",
"M21"
"M21",
"ZNC"
));
}

View file

@ -1,30 +1,20 @@
package mage.game.permanent.token;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import mage.MageInt;
import mage.abilities.keyword.FlyingAbility;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.util.RandomUtil;
import java.util.Arrays;
/**
*
* @author fireshoes
*/
public final class ThopterColorlessToken extends TokenImpl {
static final private List<String> tokenImageSets = new ArrayList<>();
static {
tokenImageSets.addAll(Arrays.asList("MBS", "ORI", "KLD"));
}
public ThopterColorlessToken() {
super("Thopter", "1/1 colorless Thopter artifact creature token with flying");
availableImageSetCodes = tokenImageSets;
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
subtype.add(SubType.THOPTER);
@ -32,17 +22,24 @@ public final class ThopterColorlessToken extends TokenImpl {
toughness = new MageInt(1);
addAbility(FlyingAbility.getInstance());
availableImageSetCodes = Arrays.asList("C18", "EXO", "KLD", "MBS", "ORI", "TPR", "VMA", "M19", "ZNC");
}
@Override
public void setExpansionSetCodeForImage(String code) {
super.setExpansionSetCodeForImage(code);
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("ORI")) {
this.setTokenType(RandomUtil.nextInt(2) + 1);
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("C18")) {
this.setTokenType(RandomUtil.nextInt(3) + 1);
}
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("KLD")) {
this.setTokenType(RandomUtil.nextInt(3) + 1);
}
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("ORI")) {
this.setTokenType(RandomUtil.nextInt(2) + 1);
}
}
public ThopterColorlessToken(final ThopterColorlessToken token) {
@ -51,7 +48,7 @@ public final class ThopterColorlessToken extends TokenImpl {
@Override
public ThopterColorlessToken copy() {
return new ThopterColorlessToken(this); //To change body of generated methods, choose Tools | Templates.
return new ThopterColorlessToken(this);
}
}

View file

@ -1,12 +1,12 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.MageInt;
import java.util.Arrays;
/**
*
* @author spjspj
*/
public final class ZendikarsRoilElementalToken extends TokenImpl {
@ -14,11 +14,12 @@ public final class ZendikarsRoilElementalToken extends TokenImpl {
public ZendikarsRoilElementalToken() {
super("Elemental", "2/2 green Elemental creature token");
cardType.add(CardType.CREATURE);
setOriginalExpansionSetCode("ORI");
subtype.add(SubType.ELEMENTAL);
color.setGreen(true);
power = new MageInt(2);
toughness = new MageInt(2);
availableImageSetCodes.addAll(Arrays.asList("ORI", "ZNC"));
}
public ZendikarsRoilElementalToken(final ZendikarsRoilElementalToken token) {
@ -28,4 +29,13 @@ public final class ZendikarsRoilElementalToken extends TokenImpl {
public ZendikarsRoilElementalToken copy() {
return new ZendikarsRoilElementalToken(this);
}
@Override
public void setExpansionSetCodeForImage(String code) {
super.setExpansionSetCodeForImage(code);
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("ZNC")) {
setTokenType(2);
}
}
}