Tokens improves:

* [M21] added tokens;
 * [M21] added tokens download support;
 * Fixed wrong images for some tokens (Angel, Beast, Bird, Cat, etc);
This commit is contained in:
Oleg Agafonov 2020-07-09 02:38:37 +04:00
parent 4dc99fbb58
commit 99ceeb5076
26 changed files with 298 additions and 206 deletions

View file

@ -5,42 +5,23 @@ 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 SoldierToken extends TokenImpl {
static final private List<String> tokenImageSets = new ArrayList<>();
static {
tokenImageSets.addAll(Arrays.asList("10E", "M15", "C14", "ORI", "ALA", "DDF", "THS", "M12", "M13", "MM2", "MMA", "RTR",
"SOM", "DDO", "M10", "ORI", "EMN", "EMA", "CN2", "C16", "MM3", "E01", "DOM", "MH1", "M20", "C20"));
}
public SoldierToken() {
super("Soldier", "1/1 white Soldier creature token");
availableImageSetCodes = tokenImageSets;
cardType.add(CardType.CREATURE);
color.setWhite(true);
subtype.add(SubType.SOLDIER);
power = new MageInt(1);
toughness = new MageInt(1);
}
@Override
public void setExpansionSetCodeForImage(String code) {
super.setExpansionSetCodeForImage(code);
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("THS")) {
this.setTokenType(RandomUtil.nextInt(2) + 1);
}
if (getOriginalExpansionSetCode() != null && (getOriginalExpansionSetCode().equals("CN2") || getOriginalExpansionSetCode().equals("MM3"))) {
setTokenType(1);
}
availableImageSetCodes = Arrays.asList("10E", "M15", "C14", "ORI", "ALA", "DDF", "THS", "M12", "M13", "MM2", "MMA", "RTR",
"SOM", "DDO", "M10", "ORI", "EMN", "EMA", "CN2", "C16", "MM3", "E01", "DOM", "MH1", "M20", "C20", "M21");
}
public SoldierToken(final SoldierToken token) {
@ -49,6 +30,24 @@ public final class SoldierToken extends TokenImpl {
@Override
public SoldierToken copy() {
return new SoldierToken(this); //To change body of generated methods, choose Tools | Templates.
return new SoldierToken(this);
}
@Override
public void setExpansionSetCodeForImage(String code) {
super.setExpansionSetCodeForImage(code);
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("CN2")) {
this.setTokenType(RandomUtil.nextInt(2) + 1);
}
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("CN2")) {
this.setTokenType(RandomUtil.nextInt(2) + 1);
}
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("MM3")) {
this.setTokenType(RandomUtil.nextInt(2) + 1);
}
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("THS")) {
this.setTokenType(RandomUtil.nextInt(2) + 1);
}
}
}