Skip to content

Commit

Permalink
Food token - fixed that it doesn't use multiple images;
Browse files Browse the repository at this point in the history
  • Loading branch information
JayDi85 committed Sep 27, 2019
1 parent a74fb36 commit 2227490
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions Mage/src/main/java/mage/game/permanent/token/FoodToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.util.RandomUtil;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -27,17 +28,8 @@ public final class FoodToken extends TokenImpl {
}

public FoodToken() {
this(null, 0);
}

public FoodToken(String setCode) {
this(setCode, 0);
}

public FoodToken(String setCode, int tokenType) {
super("Food", "Food token");
availableImageSetCodes = tokenImageSets;
setOriginalExpansionSetCode(setCode);
cardType.add(CardType.ARTIFACT);
subtype.add(SubType.FOOD);

Expand All @@ -50,6 +42,15 @@ public FoodToken(String setCode, int tokenType) {
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) {
super(token);
}
Expand Down

0 comments on commit 2227490

Please sign in to comment.