[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("2XM"); // Double Masters
add("AKR"); // Amonkhet Remastered add("AKR"); // Amonkhet Remastered
add("ZNR"); // Zendikar Rising add("ZNR"); // Zendikar Rising
add("ZNC"); // Zendikar Rising Commander
add("CMR"); // Commander Legends add("CMR"); // Commander Legends
add("CC1"); // Commander Collection: Green 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/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"); 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 // generate supported sets
supportedSets.clear(); supportedSets.clear();
for (String cardName : this.keySet()) { for (String cardName : this.keySet()) {

View file

@ -1439,3 +1439,21 @@
|Generate|TOK:ZNR|Insect|||InsectToken| |Generate|TOK:ZNR|Insect|||InsectToken|
|Generate|TOK:ZNR|Kor Warrior|||KorWarriorToken| |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; package mage.cards.o;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.DiesCreatureTriggeredAbility; import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -21,14 +19,16 @@ import mage.filter.predicate.permanent.AnotherPredicate;
import mage.filter.predicate.permanent.TokenPredicate; import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.permanent.token.RatToken; import mage.game.permanent.token.RatToken;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class OgreSlumlord extends CardImpl { public final class OgreSlumlord extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another nontoken creature"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another nontoken creature");
private static final FilterControlledPermanent filter2 = new FilterControlledPermanent("Rats you control"); private static final FilterControlledPermanent filter2 = new FilterControlledPermanent("Rats you control");
static { static {
filter.add(Predicates.not(TokenPredicate.instance)); filter.add(Predicates.not(TokenPredicate.instance));
filter.add(AnotherPredicate.instance); filter.add(AnotherPredicate.instance);
@ -40,14 +40,12 @@ public final class OgreSlumlord extends CardImpl {
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.OGRE);
this.subtype.add(SubType.ROGUE); this.subtype.add(SubType.ROGUE);
this.power = new MageInt(3); this.power = new MageInt(3);
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Whenever another nontoken creature dies, you may create a 1/1 black Rat creature token. // 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)); this.addAbility(new DiesCreatureTriggeredAbility(new CreateTokenEffect(new RatToken()), true, filter));
// Rats you control have deathtouch. // Rats you control have deathtouch.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield, filter2))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield, filter2)));

View file

@ -1,7 +1,5 @@
package mage.cards.o; package mage.cards.o;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
@ -9,24 +7,17 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card; import mage.cards.*;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.choices.ChoiceColor; import mage.choices.ChoiceColor;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.token.OonaQueenFaerieToken; import mage.game.permanent.token.OonaQueenFaerieRogueToken;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetOpponent; import mage.target.common.TargetOpponent;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class OonaQueenOfTheFae extends CardImpl { public final class OonaQueenOfTheFae extends CardImpl {
@ -42,6 +33,7 @@ public final class OonaQueenOfTheFae extends CardImpl {
// Flying // Flying
this.addAbility(FlyingAbility.getInstance()); 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. // {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 ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new OonaQueenOfTheFaeEffect(), new ManaCostsImpl("{X}{U/B}"));
ability.addTarget(new TargetOpponent()); ability.addTarget(new TargetOpponent());
@ -93,7 +85,7 @@ class OonaQueenOfTheFaeEffect extends OneShotEffect {
} }
controller.moveCards(cardsToExile, Zone.EXILED, source, game); controller.moveCards(cardsToExile, Zone.EXILED, source, game);
if (cardsWithColor > 0) { 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"); game.informPlayers("Oona: " + cardsWithColor + " Token" + (cardsWithColor != 1 ? "s" : "") + " created");
return true; return true;

View file

@ -16,7 +16,7 @@ public final class BeastToken2 extends TokenImpl {
static final private List<String> tokenImageSets = new ArrayList<>(); static final private List<String> tokenImageSets = new ArrayList<>();
static { 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() { public BeastToken2() {

View file

@ -22,7 +22,7 @@ public final class BirdToken extends TokenImpl {
toughness = new MageInt(1); toughness = new MageInt(1);
addAbility(FlyingAbility.getInstance()); 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) { public BirdToken(final BirdToken token) {

View file

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

View file

@ -1,14 +1,12 @@
package mage.game.permanent.token; package mage.game.permanent.token;
import java.util.Arrays; import mage.MageInt;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.MageInt;
import java.util.Arrays;
/** /**
*
* @author LoneFox * @author LoneFox
*/ */
public final class GoblinRogueToken extends TokenImpl { public final class GoblinRogueToken extends TokenImpl {
@ -21,7 +19,8 @@ public final class GoblinRogueToken extends TokenImpl {
subtype.add(SubType.ROGUE); subtype.add(SubType.ROGUE);
power = new MageInt(1); power = new MageInt(1);
toughness = 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) { public GoblinRogueToken(final GoblinRogueToken token) {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,30 +1,20 @@
package mage.game.permanent.token; package mage.game.permanent.token;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import mage.MageInt; import mage.MageInt;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.util.RandomUtil; import mage.util.RandomUtil;
import java.util.Arrays;
/** /**
*
* @author fireshoes * @author fireshoes
*/ */
public final class ThopterColorlessToken extends TokenImpl { public final class ThopterColorlessToken extends TokenImpl {
static final private List<String> tokenImageSets = new ArrayList<>();
static {
tokenImageSets.addAll(Arrays.asList("MBS", "ORI", "KLD"));
}
public ThopterColorlessToken() { public ThopterColorlessToken() {
super("Thopter", "1/1 colorless Thopter artifact creature token with flying"); super("Thopter", "1/1 colorless Thopter artifact creature token with flying");
availableImageSetCodes = tokenImageSets;
cardType.add(CardType.ARTIFACT); cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE); cardType.add(CardType.CREATURE);
subtype.add(SubType.THOPTER); subtype.add(SubType.THOPTER);
@ -32,17 +22,24 @@ public final class ThopterColorlessToken extends TokenImpl {
toughness = new MageInt(1); toughness = new MageInt(1);
addAbility(FlyingAbility.getInstance()); addAbility(FlyingAbility.getInstance());
availableImageSetCodes = Arrays.asList("C18", "EXO", "KLD", "MBS", "ORI", "TPR", "VMA", "M19", "ZNC");
} }
@Override @Override
public void setExpansionSetCodeForImage(String code) { public void setExpansionSetCodeForImage(String code) {
super.setExpansionSetCodeForImage(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")) { if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("KLD")) {
this.setTokenType(RandomUtil.nextInt(3) + 1); this.setTokenType(RandomUtil.nextInt(3) + 1);
} }
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("ORI")) {
this.setTokenType(RandomUtil.nextInt(2) + 1);
}
} }
public ThopterColorlessToken(final ThopterColorlessToken token) { public ThopterColorlessToken(final ThopterColorlessToken token) {
@ -51,7 +48,7 @@ public final class ThopterColorlessToken extends TokenImpl {
@Override @Override
public ThopterColorlessToken copy() { 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; package mage.game.permanent.token;
import mage.MageInt;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.MageInt;
import java.util.Arrays;
/** /**
*
* @author spjspj * @author spjspj
*/ */
public final class ZendikarsRoilElementalToken extends TokenImpl { public final class ZendikarsRoilElementalToken extends TokenImpl {
@ -14,11 +14,12 @@ public final class ZendikarsRoilElementalToken extends TokenImpl {
public ZendikarsRoilElementalToken() { public ZendikarsRoilElementalToken() {
super("Elemental", "2/2 green Elemental creature token"); super("Elemental", "2/2 green Elemental creature token");
cardType.add(CardType.CREATURE); cardType.add(CardType.CREATURE);
setOriginalExpansionSetCode("ORI");
subtype.add(SubType.ELEMENTAL); subtype.add(SubType.ELEMENTAL);
color.setGreen(true); color.setGreen(true);
power = new MageInt(2); power = new MageInt(2);
toughness = new MageInt(2); toughness = new MageInt(2);
availableImageSetCodes.addAll(Arrays.asList("ORI", "ZNC"));
} }
public ZendikarsRoilElementalToken(final ZendikarsRoilElementalToken token) { public ZendikarsRoilElementalToken(final ZendikarsRoilElementalToken token) {
@ -28,4 +29,13 @@ public final class ZendikarsRoilElementalToken extends TokenImpl {
public ZendikarsRoilElementalToken copy() { public ZendikarsRoilElementalToken copy() {
return new ZendikarsRoilElementalToken(this); return new ZendikarsRoilElementalToken(this);
} }
@Override
public void setExpansionSetCodeForImage(String code) {
super.setExpansionSetCodeForImage(code);
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("ZNC")) {
setTokenType(2);
}
}
} }