[MH2] added tokens and images download;

This commit is contained in:
Oleg Agafonov 2021-07-05 22:20:48 +04:00
parent 9624b27b3a
commit 6e26a8d7a6
20 changed files with 146 additions and 131 deletions

View file

@ -592,6 +592,27 @@ public class ScryfallImageSupportTokens {
put("C21/Wurm", "https://api.scryfall.com/cards/tc21/19/en?format=image");
put("C21/Zombie", "https://api.scryfall.com/cards/tc21/9/en?format=image");
// MH2
put("MH2/Beast", "https://api.scryfall.com/cards/tmh2/9/en?format=image");
put("MH2/Bird", "https://api.scryfall.com/cards/tmh2/1/en?format=image");
put("MH2/Clue/1", "https://api.scryfall.com/cards/tmh2/14/en?format=image");
put("MH2/Clue/2", "https://api.scryfall.com/cards/tmh2/15/en?format=image");
put("MH2/Construct", "https://api.scryfall.com/cards/tmh2/16/en?format=image");
put("MH2/Crab", "https://api.scryfall.com/cards/tmh2/2/en?format=image");
put("MH2/Elemental", "https://api.scryfall.com/cards/tmh2/10/en?format=image");
put("MH2/Food/1", "https://api.scryfall.com/cards/tmh2/17/en?format=image");
put("MH2/Food/2", "https://api.scryfall.com/cards/tmh2/18/en?format=image");
put("MH2/Goblin", "https://api.scryfall.com/cards/tmh2/8/en?format=image");
put("MH2/Golem", "https://api.scryfall.com/cards/tmh2/12/en?format=image");
put("MH2/Insect", "https://api.scryfall.com/cards/tmh2/13/en?format=image");
put("MH2/Phyrexian Germ", "https://api.scryfall.com/cards/tmh2/3/en?format=image");
put("MH2/Squirrel", "https://api.scryfall.com/cards/tmh2/11/en?format=image");
put("MH2/Thopter", "https://api.scryfall.com/cards/tmh2/19/en?format=image");
put("MH2/Treasure/1", "https://api.scryfall.com/cards/tmh2/20/en?format=image");
put("MH2/Treasure/2", "https://api.scryfall.com/cards/tmh2/21/en?format=image");
put("MH2/Zombie Army", "https://api.scryfall.com/cards/tmh2/7/en?format=image");
put("MH2/Zombie", "https://api.scryfall.com/cards/tmh2/6/en?format=image");
// generate supported sets
supportedSets.clear();
for (String cardName : this.keySet()) {

View file

@ -313,7 +313,7 @@
|Generate|TOK:C14|Equipment|||NahiriTheLithomancerEquipmentToken|
|Generate|TOK:C14|Fish|||ReefWormFishToken|
|Generate|TOK:C14|Gargoyle|||GargoyleToken|
|Generate|TOK:C14|Germ|||GermToken|
|Generate|TOK:C14|Germ|||PhyrexianGermToken|
|Generate|TOK:C14|Goat|||GoatToken|
|Generate|TOK:C14|Goblin Golem|||TuktukTheReturnedToken|
|Generate|TOK:C14|Goblin|||GoblinToken|
@ -344,7 +344,7 @@
|Generate|TOK:C15|Elemental|2||LightningRagerToken|
|Generate|TOK:C15|Elephant|||ElephantToken|
|Generate|TOK:C15|Frog Lizard|||RapidHybridizationToken|
|Generate|TOK:C15|Germ|||GermToken|
|Generate|TOK:C15|Germ|||PhyrexianGermToken|
|Generate|TOK:C15|Gold||
|Generate|TOK:C15|Knight|1||KnightToken|
|Generate|TOK:C15|Knight|2||HuntedDragonKnightToken|
@ -849,7 +849,7 @@
|Generate|TOK:M15|Treefolk Warrior|||KalonianTwingroveTreefolkWarriorToken|
|Generate|TOK:M15|Zombie|||ZombieToken|
|Generate|TOK:MBS|Cat|||CatToken|
|Generate|TOK:MBS|Germ|||GermToken|
|Generate|TOK:MBS|Germ|||PhyrexianGermToken|
|Generate|TOK:MBS|Golem|||TitanForgeGolemToken|
|Generate|TOK:MBS|Horror|||PhyrexianRebirthHorrorToken|
|Generate|TOK:MBS|Myr|||MyrToken|
@ -886,7 +886,7 @@
|Generate|TOK:MM2|Eldrazi Spawn|||EldraziSpawnToken|
|Generate|TOK:MM2|Elephant|||ElephantToken|
|Generate|TOK:MM2|Faerie Rogue|||FaerieRogueToken|
|Generate|TOK:MM2|Germ|||GermToken|
|Generate|TOK:MM2|Germ|||PhyrexianGermToken|
|Generate|TOK:MM2|Golem|||GolemToken|
|Generate|TOK:MM2|Insect|||InsectToken|
|Generate|TOK:MM2|Myr|||MyrToken|
@ -962,7 +962,7 @@
|Generate|TOK:NEM|Saproling|1||SaprolingBurstToken|
|Generate|TOK:NEM|Saproling|2||SaprolingToken|
|Generate|TOK:NPH|Beast|||BeastToken|
|Generate|TOK:NPH|Germ|||GermToken|
|Generate|TOK:NPH|Germ|||PhyrexianGermToken|
|Generate|TOK:NPH|Goblin|||GoblinTokenWithHaste|
|Generate|TOK:NPH|Goblin|||GoblinToken|
|Generate|TOK:NPH|Golem|||GolemToken|
@ -1011,7 +1011,7 @@
|Generate|TOK:PC2|Beast|||BeastToken|
|Generate|TOK:PC2|Boar|||BoarToken|
|Generate|TOK:PC2|Eldrazi Spawn|||EldraziSpawnToken|
|Generate|TOK:PC2|Germ|||GermToken|
|Generate|TOK:PC2|Germ|||PhyrexianGermToken|
|Generate|TOK:PC2|Goblin|||GoblinToken|
|Generate|TOK:PC2|Hellion|||HellionToken|
|Generate|TOK:PC2|Insect|||InsectToken|
@ -1423,7 +1423,7 @@
# 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|Germ|||PhyrexianGermToken|
#
|Generate|TOK:ZNC|Goblin Rogue|||GoblinRogueToken|
|Generate|TOK:ZNC|Kor Ally|||KorAllyToken|
@ -1540,4 +1540,27 @@
|Generate|TOK:C21|Thopter|||ThopterColorlessToken|
|Generate|TOK:C21|Whale|||ReefWormWhaleToken|
|Generate|TOK:C21|Wurm|||WurmToken|
|Generate|TOK:C21|Zombie|||ZombieToken|
|Generate|TOK:C21|Zombie|||ZombieToken|
// MH2
|Generate|TOK:MH2|Beast|||BeastToken2|
|Generate|TOK:MH2|Bird|||BirdToken|
|Generate|TOK:MH2|Clue|1||ClueArtifactToken|
|Generate|TOK:MH2|Clue|2||ClueArtifactToken|
|Generate|TOK:MH2|Construct|||KarnConstructToken|
|Generate|TOK:MH2|Crab|||CrabToken|
|Generate|TOK:MH2|Elemental|||TitaniaProtectorOfArgothElementalToken|
|Generate|TOK:MH2|Food|1||FoodToken|
|Generate|TOK:MH2|Food|2||FoodToken|
|Generate|TOK:MH2|Goblin|||GoblinToken|
|Generate|TOK:MH2|Golem|||RedWhiteGolemToken|
|Generate|TOK:MH2|Insect|||IzoniInsectToken|
|Generate|TOK:MH2|Phyrexian Germ|||PhyrexianGermToken|
|Generate|TOK:MH2|Squirrel|||SquirrelToken|
|Generate|TOK:MH2|Thopter|||ThopterColorlessToken|
# no need tokens for Eternalize ability, but scryfall have it: https://scryfall.com/card/tmh2/4/timeless-dragon
# no need tokens for Eternalize ability, but scryfall have it: https://scryfall.com/card/tmh2/5/timeless-witness
|Generate|TOK:MH2|Treasure|1||TreasureToken|
|Generate|TOK:MH2|Treasure|2||TreasureToken|
|Generate|TOK:MH2|Zombie|||ZombieToken|
|Generate|TOK:MH2|Zombie Army|||ZombieArmyToken|

View file

@ -1,7 +1,5 @@
package mage.cards.g;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
@ -13,13 +11,14 @@ import mage.constants.SubType;
import mage.filter.FilterPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.GermToken;
import mage.game.permanent.token.PhyrexianGermToken;
import mage.players.Player;
import mage.target.Target;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
*
* @author spjspj
*/
public final class GripOfPhyresis extends CardImpl {
@ -56,7 +55,7 @@ public final class GripOfPhyresis extends CardImpl {
class GripOfPhyresisEffect extends CreateTokenEffect {
GripOfPhyresisEffect() {
super(new GermToken());
super(new PhyrexianGermToken());
}
GripOfPhyresisEffect(final GripOfPhyresisEffect effect) {

View file

@ -2,12 +2,12 @@ package mage.abilities.keyword;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.CreateTokenAttachSourceEffect;
import mage.game.permanent.token.GermToken;
import mage.game.permanent.token.PhyrexianGermToken;
public class LivingWeaponAbility extends EntersBattlefieldTriggeredAbility {
public LivingWeaponAbility() {
super(new CreateTokenAttachSourceEffect(new GermToken()));
super(new CreateTokenAttachSourceEffect(new PhyrexianGermToken()));
}
public LivingWeaponAbility(final LivingWeaponAbility ability) {

View file

@ -20,7 +20,7 @@ public final class BeastToken2 extends TokenImpl {
toughness = new MageInt(4);
availableImageSetCodes = Arrays.asList("C13", "C14", "C15", "C19", "CMA", "CMD", "GVL", "DDD",
"E01", "ODY", "SCG", "ZEN", "C20", "ZNC", "CMR", "C21");
"E01", "ODY", "SCG", "ZEN", "C20", "ZNC", "CMR", "C21", "MH2");
}
public BeastToken2(final BeastToken2 token) {

View file

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

View file

@ -1,4 +1,3 @@
package mage.game.permanent.token;
import mage.abilities.Ability;
@ -11,24 +10,15 @@ import mage.constants.SubType;
import mage.constants.Zone;
import mage.util.RandomUtil;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
*
*/
public final class ClueArtifactToken extends TokenImpl {
static final private List<String> tokenImageSets = new ArrayList<>();
static {
tokenImageSets.addAll(Arrays.asList("SOI", "EDM"));
}
public ClueArtifactToken() {
super("Clue", "colorless Clue artifact token with \"{2}, Sacrifice this artifact: Draw a card.\"");
availableImageSetCodes = tokenImageSets;
cardType.add(CardType.ARTIFACT);
subtype.add(SubType.CLUE);
@ -38,16 +28,20 @@ public final class ClueArtifactToken extends TokenImpl {
cost.setText("Sacrifice this artifact");
ability.addCost(cost);
this.addAbility(ability);
availableImageSetCodes = Arrays.asList("C18", "SOI", "MH2");
}
@Override
public void setExpansionSetCodeForImage(String code) {
super.setExpansionSetCodeForImage(code);
if (getOriginalExpansionSetCode().equals("SOI")) {
this.setTokenType(RandomUtil.nextInt(6) + 1); // 6 different images
}
if (getOriginalExpansionSetCode().equals("EDM")) {
this.setTokenType(RandomUtil.nextInt(6) + 1); // 6 different images
if (getOriginalExpansionSetCode().equals("MH2")) {
this.setTokenType(RandomUtil.nextInt(2) + 1); // 2 different images
}
}

View file

@ -4,6 +4,8 @@ import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
import java.util.Arrays;
/**
* @author TheElk801
*/
@ -16,6 +18,8 @@ public final class CrabToken extends TokenImpl {
subtype.add(SubType.CRAB);
power = new MageInt(0);
toughness = new MageInt(3);
availableImageSetCodes = Arrays.asList("MH2");
}
public CrabToken(final CrabToken token) {

View file

@ -36,7 +36,7 @@ public final class FoodToken extends TokenImpl {
ability.addCost(cost);
this.addAbility(ability);
availableImageSetCodes = Arrays.asList("ELD", "C21");
availableImageSetCodes = Arrays.asList("ELD", "C21", "MH2");
}
@Override
@ -44,7 +44,11 @@ public final class FoodToken extends TokenImpl {
super.setExpansionSetCodeForImage(code);
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("ELD")) {
setTokenType(RandomUtil.nextInt(4) + 1); // 1...4
setTokenType(RandomUtil.nextInt(4) + 1); // 1..4
}
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("MH2")) {
setTokenType(RandomUtil.nextInt(2) + 1); // 1..2
}
}

View file

@ -1,55 +0,0 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @author spjspj
*/
public final class GermToken extends TokenImpl {
static final private List<String> tokenImageSets = new ArrayList<>();
static {
tokenImageSets.addAll(Arrays.asList("NPH", "MBS", "SOM", "EMA", "C16"));
}
public GermToken() {
this(null, 0);
}
public GermToken(String setCode) {
this(setCode, 0);
}
public GermToken(String setCode, int tokenType) {
super("Phyrexian Germ", "0/0 black Phyrexian Germ creature token");
availableImageSetCodes = tokenImageSets;
setOriginalExpansionSetCode(setCode);
cardType.add(CardType.CREATURE);
color.setBlack(true);
subtype.add(SubType.PHYREXIAN);
subtype.add(SubType.GERM);
power = new MageInt(0);
toughness = new MageInt(0);
}
@Override
public void setExpansionSetCodeForImage(String code) {
super.setExpansionSetCodeForImage(code);
}
public GermToken(final GermToken token) {
super(token);
}
@Override
public GermToken copy() {
return new GermToken(this);
}
}

View file

@ -5,9 +5,7 @@ import mage.abilities.keyword.HasteAbility;
import mage.constants.CardType;
import mage.constants.SubType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @author North
@ -34,7 +32,7 @@ public final class GoblinToken extends TokenImpl {
availableImageSetCodes = Arrays.asList("10E", "ALA", "SOM", "M10", "NPH", "M13", "RTR",
"MMA", "M15", "C14", "KTK", "EVG", "DTK", "ORI", "DDG", "DDN", "EVG", "MM2",
"MM3", "EMA", "C16", "DOM", "ANA", "RNA", "WAR", "MH1", "TSR");
"MM3", "EMA", "C16", "DOM", "ANA", "RNA", "WAR", "MH1", "TSR", "MH2");
}
public GoblinToken(final GoblinToken token) {

View file

@ -1,13 +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 TheElk801
*/
public final class IzoniInsectToken extends TokenImpl {
@ -20,6 +19,8 @@ public final class IzoniInsectToken extends TokenImpl {
subtype.add(SubType.INSECT);
power = new MageInt(1);
toughness = new MageInt(1);
availableImageSetCodes = Arrays.asList("GRN", "MH2");
}
public IzoniInsectToken(final IzoniInsectToken token) {

View file

@ -30,7 +30,7 @@ public final class KarnConstructToken extends TokenImpl {
.setText("This creature gets +1/+1 for each artifact you control")
));
availableImageSetCodes = Arrays.asList("DOM", "MH1", "C21");
availableImageSetCodes = Arrays.asList("DOM", "MH1", "C21", "MH2");
}
public KarnConstructToken(final KarnConstructToken token) {

View file

@ -0,0 +1,39 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
import java.util.Arrays;
/**
* @author spjspj
*/
public final class PhyrexianGermToken extends TokenImpl {
public PhyrexianGermToken() {
super("Phyrexian Germ", "0/0 black Phyrexian Germ creature token");
cardType.add(CardType.CREATURE);
color.setBlack(true);
subtype.add(SubType.PHYREXIAN);
subtype.add(SubType.GERM);
power = new MageInt(0);
toughness = new MageInt(0);
availableImageSetCodes = Arrays.asList("C14", "C15", "MBS", "MM2", "NPH", "PC2", "MH2");
}
@Override
public void setExpansionSetCodeForImage(String code) {
super.setExpansionSetCodeForImage(code);
}
public PhyrexianGermToken(final PhyrexianGermToken token) {
super(token);
}
@Override
public PhyrexianGermToken copy() {
return new PhyrexianGermToken(this);
}
}

View file

@ -4,6 +4,11 @@ import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
import java.util.Arrays;
/**
* @author weirddan455
*/
public class RedWhiteGolemToken extends TokenImpl {
public RedWhiteGolemToken() {
@ -15,6 +20,8 @@ public class RedWhiteGolemToken extends TokenImpl {
color.setWhite(true);
power = new MageInt(4);
toughness = new MageInt(4);
availableImageSetCodes = Arrays.asList("MH2");
}
private RedWhiteGolemToken(final RedWhiteGolemToken token) {

View file

@ -4,30 +4,23 @@ import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @author North
*/
public final class SquirrelToken extends TokenImpl {
static final private List<String> tokenImageSets = new ArrayList<>();
static {
tokenImageSets.addAll(Arrays.asList("CNS", "MH1"));
}
public SquirrelToken() {
super("Squirrel", "1/1 green Squirrel creature token");
availableImageSetCodes = tokenImageSets;
cardType.add(CardType.CREATURE);
subtype.add(SubType.SQUIRREL);
color.setGreen(true);
power = new MageInt(1);
toughness = new MageInt(1);
availableImageSetCodes = Arrays.asList("CMD", "CNS", "ODY", "PCY", "TOR", "ULG", "UNH", "WMA",
"WTH", "MH1", "MH2");
}
public SquirrelToken(final SquirrelToken token) {

View file

@ -23,7 +23,8 @@ public final class ThopterColorlessToken extends TokenImpl {
addAbility(FlyingAbility.getInstance());
availableImageSetCodes = Arrays.asList("C18", "EXO", "KLD", "MBS", "ORI", "VMA", "M19", "ZNC", "KHC", "C21");
availableImageSetCodes = Arrays.asList("C18", "EXO", "KLD", "MBS", "ORI", "VMA", "M19", "ZNC",
"KHC", "C21", "MH2");
}
@Override

View file

@ -1,39 +1,26 @@
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.ObjectColor;
import mage.constants.CardType;
import mage.constants.SubType;
import java.util.Arrays;
/**
*
* @author spjspj
*/
public final class TitaniaProtectorOfArgothElementalToken extends TokenImpl {
static final private List<String> tokenImageSets = new ArrayList<>();
static {
tokenImageSets.addAll(Arrays.asList("C14", "CMA"));
}
public TitaniaProtectorOfArgothElementalToken() {
this((String)null);
}
public TitaniaProtectorOfArgothElementalToken(String setCode) {
super("Elemental", "5/3 green Elemental creature token");
availableImageSetCodes = tokenImageSets;
this.setOriginalExpansionSetCode(setCode);
this.cardType.add(CardType.CREATURE);
this.color = ObjectColor.GREEN;
this.subtype.add(SubType.ELEMENTAL);
this.power = new MageInt(5);
this.toughness = new MageInt(3);
availableImageSetCodes = Arrays.asList("C14", "CMA", "MH2");
}
public TitaniaProtectorOfArgothElementalToken(final TitaniaProtectorOfArgothElementalToken token) {

View file

@ -10,26 +10,24 @@ import mage.constants.SubType;
import mage.constants.Zone;
import mage.util.RandomUtil;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @author TheElk801
*/
public final class TreasureToken extends TokenImpl {
static final private List<String> tokenImageSets = new ArrayList<>();
public TreasureToken() {
super("Treasure", "Treasure token");
cardType.add(CardType.ARTIFACT);
subtype.add(SubType.TREASURE);
// {T}, Sacrifice this artifact: Add one mana of any color.
Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);
availableImageSetCodes = Arrays.asList("XLN", "RNA", "M20", "C19", "C20", "M21", "CMR", "KHM", "STX");
availableImageSetCodes = Arrays.asList("XLN", "RNA", "M20", "C19", "C20", "M21", "CMR", "KHM", "STX", "MH2");
}
public TreasureToken(final TreasureToken token) {

View file

@ -25,7 +25,7 @@ public final class ZombieToken extends TokenImpl {
"CNS", "MMA", "BNG", "KTK", "DTK", "ORI", "OGW",
"SOI", "EMN", "EMA", "MM3", "AKH", "CMA", "E01",
"RNA", "WAR", "MH1", "M20", "C19", "THB", "M21",
"CMR", "C21");
"CMR", "C21", "MH2");
}
@Override