Food token - fixed that it doesn't use multiple images;

This commit is contained in:
Oleg Agafonov 2019-09-27 22:49:17 +04:00
parent a74fb36053
commit 2227490413

View file

@ -9,6 +9,7 @@ import mage.abilities.effects.common.GainLifeEffect;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType; import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.util.RandomUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -27,17 +28,8 @@ public final class FoodToken extends TokenImpl {
} }
public FoodToken() { public FoodToken() {
this(null, 0);
}
public FoodToken(String setCode) {
this(setCode, 0);
}
public FoodToken(String setCode, int tokenType) {
super("Food", "Food token"); super("Food", "Food token");
availableImageSetCodes = tokenImageSets; availableImageSetCodes = tokenImageSets;
setOriginalExpansionSetCode(setCode);
cardType.add(CardType.ARTIFACT); cardType.add(CardType.ARTIFACT);
subtype.add(SubType.FOOD); subtype.add(SubType.FOOD);
@ -50,6 +42,15 @@ public final class FoodToken extends TokenImpl {
this.addAbility(ability); this.addAbility(ability);
} }
@Override
public void setExpansionSetCodeForImage(String code) {
super.setExpansionSetCodeForImage(code);
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("ELD")) {
setTokenType(RandomUtil.nextInt(4) + 1); // 1...4
}
}
public FoodToken(final FoodToken token) { public FoodToken(final FoodToken token) {
super(token); super(token);
} }