mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
[RNA] added tokens and download support from scryfall;
This commit is contained in:
parent
5a91494be3
commit
1b55cbd44c
15 changed files with 140 additions and 62 deletions
|
@ -34,6 +34,22 @@ public class ScryfallImageSupportTokens {
|
|||
put("RIX/Emblem Huatli, Radiant Champion", "https://api.scryfall.com/cards/trix/5/en?format=image");
|
||||
put("RIX/Saproling", "https://api.scryfall.com/cards/trix/3/en?format=image");
|
||||
|
||||
// RNA
|
||||
put("RNA/Beast", "https://api.scryfall.com/cards/trna/8/en?format=image");
|
||||
put("RNA/Centaur", "https://api.scryfall.com/cards/trna/5/en?format=image");
|
||||
put("RNA/Domri, Chaos Bringer", "https://api.scryfall.com/cards/trna/13/en?format=image");
|
||||
put("RNA/Frog Lizard", "https://api.scryfall.com/cards/trna/6/en?format=image");
|
||||
put("RNA/Goblin", "https://api.scryfall.com/cards/trna/4/en?format=image");
|
||||
put("RNA/Human", "https://api.scryfall.com/cards/trna/1/en?format=image");
|
||||
put("RNA/Illusion", "https://api.scryfall.com/cards/trna/2/en?format=image");
|
||||
put("RNA/Ooze", "https://api.scryfall.com/cards/trna/7/en?format=image");
|
||||
put("RNA/Sphinx", "https://api.scryfall.com/cards/trna/9/en?format=image");
|
||||
put("RNA/Spirit", "https://api.scryfall.com/cards/trna/10/en?format=image");
|
||||
put("RNA/Thopter", "https://api.scryfall.com/cards/trna/11/en?format=image");
|
||||
put("RNA/Treasure", "https://api.scryfall.com/cards/trna/12/en?format=image");
|
||||
put("RNA/Zombie", "https://api.scryfall.com/cards/trna/3/en?format=image");
|
||||
|
||||
|
||||
// generate supported sets
|
||||
supportedSets.clear();
|
||||
for (String cardName : this.keySet()) {
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
|Generate|EMBLEM:MMA|Elspeth, Knight Errant||Emblem Elspeth|ElspethKnightErrantEmblem|
|
||||
|Generate|EMBLEM:SWS|Obi-Wan Kenobi||Emblem Obi-Wan Kenobi|ObiWanKenobiEmblem|
|
||||
|Generate|EMBLEM:RIX|Huatli, Radiant Champion||Emblem Huatli|HuatliRadiantChampionEmblem|
|
||||
|Generate|EMBLEM:RNA|Domri, Chaos Bringer||Emblem Domri|DomriChaosBringerEmblem|
|
||||
|Generate|PLANE:PCA|Plane - Academy At Tolaria West|||AcademyAtTolariaWestPlane|
|
||||
|Generate|PLANE:PCA|Plane - Agyrem|||AgyremPlane|
|
||||
|Generate|PLANE:PCA|Plane - Akoum|||AkoumPlane|
|
||||
|
@ -1185,3 +1186,15 @@
|
|||
|Generate|TOK:ZEN|Vampire||
|
||||
|Generate|TOK:ZEN|Wolf|||WolfToken|
|
||||
|Generate|TOK:ZEN|Zombie Giant|||QuestForTheGravelordZombieToken|
|
||||
|Generate|TOK:RNA|Beast|||RedGreenBeastToken|
|
||||
|Generate|TOK:RNA|Centaur|||CentaurToken|
|
||||
|Generate|TOK:RNA|Frog Lizard|||FrogLizardToken|
|
||||
|Generate|TOK:RNA|Goblin|||GoblinToken|
|
||||
|Generate|TOK:RNA|Human|||HumanToken|
|
||||
|Generate|TOK:RNA|Illusion|||MesmerizingBenthidToken|
|
||||
|Generate|TOK:RNA|Ooze|||BiogenicOozeToken|
|
||||
|Generate|TOK:RNA|Sphinx|||WardenSphinxToken|
|
||||
|Generate|TOK:RNA|Spirit|||SpiritWhiteToken|
|
||||
|Generate|TOK:RNA|Thopter|||ThopterToken|
|
||||
|Generate|TOK:RNA|Treasure|||TreasureToken|
|
||||
|Generate|TOK:RNA|Zombie|||ZombieToken|
|
|
@ -17,7 +17,7 @@ import mage.counters.CounterType;
|
|||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.permanent.token.OozeToken;
|
||||
import mage.game.permanent.token.BiogenicOozeToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -41,7 +41,7 @@ public final class BiogenicOoze extends CardImpl {
|
|||
|
||||
// When Biogenic Ooze enters the battlefield, create a 2/2 green Ooze creature token.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(
|
||||
new CreateTokenEffect(new OozeToken(2, 2))
|
||||
new CreateTokenEffect(new BiogenicOozeToken())
|
||||
));
|
||||
|
||||
// At the beginning if your end step, put a +1/+1 counter on each Ooze you control.
|
||||
|
@ -52,7 +52,7 @@ public final class BiogenicOoze extends CardImpl {
|
|||
|
||||
// {1}{G}{G}{G}: Create a 2/2 green Ooze creature token.
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
new CreateTokenEffect(new OozeToken(2, 2)),
|
||||
new CreateTokenEffect(new BiogenicOozeToken()),
|
||||
new ManaCostsImpl("{1}{G}{G}{G}")
|
||||
);
|
||||
}
|
||||
|
|
|
@ -2,13 +2,11 @@ package mage.cards.w;
|
|||
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.PutOnLibraryTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.SplitCard;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SpellAbilityType;
|
||||
import mage.game.permanent.token.custom.CreatureToken;
|
||||
import mage.game.permanent.token.WardenSphinxToken;
|
||||
import mage.target.common.TargetAttackingOrBlockingCreature;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -28,12 +26,7 @@ public final class WarrantWarden extends SplitCard {
|
|||
|
||||
// Warden
|
||||
// Create a 4/4 white and blue Sphinx creature token with flying and vigilance.
|
||||
this.getRightHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(
|
||||
new CreatureToken(4, 4, "4/4 white and blue Sphinx creature token with flying and vigilance")
|
||||
.withColor("WU")
|
||||
.withAbility(FlyingAbility.getInstance())
|
||||
.withAbility(VigilanceAbility.getInstance())
|
||||
));
|
||||
this.getRightHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new WardenSphinxToken()));
|
||||
}
|
||||
|
||||
private WarrantWarden(final WarrantWarden card) {
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
public final class BiogenicOozeToken extends TokenImpl {
|
||||
|
||||
public BiogenicOozeToken() {
|
||||
super("Ooze", "2/2 green Ooze creature token");
|
||||
cardType.add(CardType.CREATURE);
|
||||
subtype.add(SubType.OOZE);
|
||||
color.setGreen(true);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
setOriginalExpansionSetCode("RNA");
|
||||
}
|
||||
|
||||
public BiogenicOozeToken(final BiogenicOozeToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public BiogenicOozeToken copy() {
|
||||
return new BiogenicOozeToken(this);
|
||||
}
|
||||
}
|
|
@ -1,17 +1,15 @@
|
|||
|
||||
|
||||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.util.RandomUtil;
|
||||
|
||||
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.util.RandomUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class CentaurToken extends TokenImpl {
|
||||
|
@ -19,13 +17,16 @@ public final class CentaurToken extends TokenImpl {
|
|||
final static private List<String> tokenImageSets = new ArrayList<>();
|
||||
|
||||
static {
|
||||
tokenImageSets.addAll(Arrays.asList("RTR", "MM3"));
|
||||
tokenImageSets.addAll(Arrays.asList("RTR", "MM3", "RNA"));
|
||||
}
|
||||
|
||||
public CentaurToken() {
|
||||
super("Centaur", "3/3 green Centaur creature token");
|
||||
cardType.add(CardType.CREATURE);
|
||||
setTokenType(RandomUtil.nextInt(2) +1); // randomly take image 1 or 2
|
||||
availableImageSetCodes = tokenImageSets;
|
||||
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("RNA")) {
|
||||
setTokenType(RandomUtil.nextInt(2) + 1); // randomly take image 1 or 2
|
||||
}
|
||||
color.setGreen(true);
|
||||
subtype.add(SubType.CENTAUR);
|
||||
power = new MageInt(3);
|
||||
|
|
|
@ -1,19 +1,16 @@
|
|||
|
||||
|
||||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.MageInt;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public final class FrogLizardToken extends TokenImpl {
|
||||
|
||||
public FrogLizardToken() {
|
||||
super("Frog Lizard", "3/3 green Frog Lizard creature token");
|
||||
this.setOriginalExpansionSetCode("GTC");
|
||||
cardType.add(CardType.CREATURE);
|
||||
|
||||
color.setGreen(true);
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
|
||||
package mage.game.permanent.token;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import mage.MageInt;
|
||||
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
|
||||
*/
|
||||
public final class GoblinToken extends TokenImpl {
|
||||
|
@ -20,7 +19,7 @@ public final class GoblinToken extends TokenImpl {
|
|||
static {
|
||||
tokenImageSets.addAll(Arrays.asList("10E", "ALA", "SOM", "M10", "NPH", "M13", "RTR",
|
||||
"MMA", "M15", "C14", "KTK", "EVG", "DTK", "ORI", "DDG", "DDN", "DD3EVG", "MM2",
|
||||
"MM3", "EMA", "C16", "DOM", "ANA"));
|
||||
"MM3", "EMA", "C16", "DOM", "ANA", "RNA"));
|
||||
}
|
||||
|
||||
public GoblinToken(boolean withHaste) {
|
||||
|
|
|
@ -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 HumanToken extends TokenImpl {
|
||||
|
@ -20,7 +18,7 @@ public final class HumanToken extends TokenImpl {
|
|||
subtype.add(SubType.HUMAN);
|
||||
power = new MageInt(1);
|
||||
toughness = new MageInt(1);
|
||||
availableImageSetCodes.addAll(Arrays.asList("DKA", "AVR", "FNMP"));
|
||||
availableImageSetCodes.addAll(Arrays.asList("DKA", "AVR", "FNMP", "RNA"));
|
||||
}
|
||||
|
||||
public HumanToken(final HumanToken token) {
|
||||
|
@ -28,7 +26,7 @@ public final class HumanToken extends TokenImpl {
|
|||
}
|
||||
|
||||
@Override
|
||||
public HumanToken copy() {
|
||||
public HumanToken copy() {
|
||||
return new HumanToken(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
|
@ -16,6 +15,7 @@ public final class MesmerizingBenthidToken extends TokenImpl {
|
|||
super("Illusion", "0/2 blue Illusion creature token with \"Whenever this creature blocks a creature, that creature doesn't untap during its controller's next untap step.\"");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setBlue(true);
|
||||
setOriginalExpansionSetCode("RNA");
|
||||
|
||||
subtype.add(SubType.ILLUSION);
|
||||
power = new MageInt(0);
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
|
||||
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 java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author nantuko
|
||||
*/
|
||||
|
@ -17,7 +17,8 @@ public final class SpiritWhiteToken extends TokenImpl {
|
|||
final static private List<String> tokenImageSets = new ArrayList<>();
|
||||
|
||||
static {
|
||||
tokenImageSets.addAll(Arrays.asList("AVR", "C14", "CNS", "DDC", "DDK", "FRF", "ISD", "KTK", "M15", "MM2", "SHM", "SOI", "EMA", "C16", "MM3", "CMA", "E01", "ANA"));
|
||||
tokenImageSets.addAll(Arrays.asList("AVR", "C14", "CNS", "DDC", "DDK", "FRF", "ISD", "KTK", "M15", "MM2", "SHM",
|
||||
"SOI", "EMA", "C16", "MM3", "CMA", "E01", "ANA", "RNA"));
|
||||
}
|
||||
|
||||
public SpiritWhiteToken() {
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.MageObjectImpl;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -18,6 +14,11 @@ import mage.game.permanent.PermanentToken;
|
|||
import mage.players.Player;
|
||||
import mage.util.RandomUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
|
||||
public abstract class TokenImpl extends MageObjectImpl implements Token {
|
||||
|
||||
protected String description;
|
||||
|
@ -241,6 +242,8 @@ public abstract class TokenImpl extends MageObjectImpl implements Token {
|
|||
|
||||
@Override
|
||||
public void setOriginalExpansionSetCode(String originalExpansionSetCode) {
|
||||
// TODO: remove original set code at all... token image must be takes by card source or by latest set (on null source)
|
||||
// TODO: if set have same tokens then selects it by random
|
||||
this.originalExpansionSetCode = originalExpansionSetCode;
|
||||
setTokenDescriptor();
|
||||
}
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
|
||||
package mage.game.permanent.token;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
|
@ -13,8 +9,11 @@ import mage.constants.CardType;
|
|||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class TreasureToken extends TokenImpl {
|
||||
|
@ -22,7 +21,7 @@ public final class TreasureToken extends TokenImpl {
|
|||
final static private List<String> tokenImageSets = new ArrayList<>();
|
||||
|
||||
static {
|
||||
tokenImageSets.addAll(Arrays.asList("XLN"));
|
||||
tokenImageSets.addAll(Arrays.asList("XLN", "RNA"));
|
||||
}
|
||||
|
||||
public TreasureToken() {
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public final class WardenSphinxToken extends TokenImpl {
|
||||
|
||||
public WardenSphinxToken() {
|
||||
super("Sphinx", "4/4 white and blue Sphinx creature token with flying and vigilance");
|
||||
this.setOriginalExpansionSetCode("RNA");
|
||||
color.setWhite(true);
|
||||
color.setBlue(true);
|
||||
cardType.add(CardType.CREATURE);
|
||||
subtype.add(SubType.SPHINX);
|
||||
power = new MageInt(4);
|
||||
toughness = new MageInt(4);
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
this.addAbility(VigilanceAbility.getInstance());
|
||||
}
|
||||
|
||||
public WardenSphinxToken(final WardenSphinxToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public WardenSphinxToken copy() {
|
||||
return new WardenSphinxToken(this);
|
||||
}
|
||||
}
|
|
@ -1,17 +1,15 @@
|
|||
|
||||
package mage.game.permanent.token;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.util.RandomUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public final class ZombieToken extends TokenImpl {
|
||||
|
@ -20,7 +18,7 @@ public final class ZombieToken extends TokenImpl {
|
|||
|
||||
static {
|
||||
tokenImageSets.addAll(Arrays.asList("10E", "M10", "M11", "M12", "M13", "M14", "M15", "MBS", "ALA", "ISD", "C14", "C15", "C16", "C17", "CNS",
|
||||
"MMA", "BNG", "KTK", "DTK", "ORI", "OGW", "SOI", "EMN", "EMA", "MM3", "AKH", "CMA", "E01"));
|
||||
"MMA", "BNG", "KTK", "DTK", "ORI", "OGW", "SOI", "EMN", "EMA", "MM3", "AKH", "CMA", "E01", "RNA"));
|
||||
}
|
||||
|
||||
public ZombieToken() {
|
||||
|
|
Loading…
Reference in a new issue