forked from External/mage
[DFT] added image support for designations, added Speed image (visible on triggered abilities)
This commit is contained in:
parent
d018566324
commit
bf0b957948
4 changed files with 23 additions and 4 deletions
|
|
@ -944,7 +944,7 @@ public class CardView extends SimpleCardView {
|
|||
this(true);
|
||||
this.gameObject = true;
|
||||
this.id = designation.getId();
|
||||
this.mageObjectType = MageObjectType.NULL;
|
||||
this.mageObjectType = MageObjectType.DESIGNATION;
|
||||
this.name = designation.getName();
|
||||
this.displayName = name;
|
||||
this.displayFullName = name;
|
||||
|
|
@ -955,9 +955,8 @@ public class CardView extends SimpleCardView {
|
|||
this.frameStyle = FrameStyle.M15_NORMAL;
|
||||
this.cardNumber = designation.getCardNumber();
|
||||
this.expansionSetCode = designation.getExpansionSetCode();
|
||||
this.cardNumber = "";
|
||||
this.imageFileName = "";
|
||||
this.imageNumber = 0;
|
||||
this.imageFileName = designation.getImageFileName();
|
||||
this.imageNumber = designation.getImageNumber();
|
||||
this.rarity = Rarity.SPECIAL;
|
||||
|
||||
// no playable/chooseable marks for designations
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ public enum TokenRepository {
|
|||
public static final String XMAGE_IMAGE_NAME_RADIATION = "Radiation";
|
||||
public static final String XMAGE_IMAGE_NAME_THE_RING = "The Ring";
|
||||
public static final String XMAGE_IMAGE_NAME_HELPER_EMBLEM = "Helper Emblem";
|
||||
public static final String XMAGE_IMAGE_NAME_SPEED = "Speed";
|
||||
|
||||
private static final Logger logger = Logger.getLogger(TokenRepository.class);
|
||||
|
||||
|
|
@ -310,6 +311,9 @@ public enum TokenRepository {
|
|||
// The Ring
|
||||
res.add(createXmageToken(XMAGE_IMAGE_NAME_THE_RING, 1, "https://api.scryfall.com/cards/tltr/H13/en?format=image"));
|
||||
|
||||
// Speed
|
||||
res.add(createXmageToken(XMAGE_IMAGE_NAME_SPEED, 1, "https://api.scryfall.com/cards/tdft/14/en?format=image&&face=back"));
|
||||
|
||||
// Helper emblem (for global card hints)
|
||||
// use backface for it
|
||||
res.add(createXmageToken(XMAGE_IMAGE_NAME_HELPER_EMBLEM, 1, "https://upload.wikimedia.org/wikipedia/en/a/aa/Magic_the_gathering-card_back.jpg"));
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import mage.MageObject;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.repository.TokenInfo;
|
||||
import mage.cards.repository.TokenRepository;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
|
|
@ -20,6 +22,18 @@ public class Speed extends Designation {
|
|||
public Speed() {
|
||||
super(DesignationType.SPEED);
|
||||
addAbility(new SpeedTriggeredAbility());
|
||||
|
||||
TokenInfo foundInfo = TokenRepository.instance.findPreferredTokenInfoForXmage(TokenRepository.XMAGE_IMAGE_NAME_SPEED, null);
|
||||
if (foundInfo != null) {
|
||||
this.setExpansionSetCode(foundInfo.getSetCode());
|
||||
this.setUsesVariousArt(true);
|
||||
this.setCardNumber("");
|
||||
this.setImageFileName(""); // use default
|
||||
this.setImageNumber(foundInfo.getImageNumber());
|
||||
} else {
|
||||
// how-to fix: add image to the tokens-database TokenRepository->loadXmageTokens
|
||||
throw new IllegalArgumentException("Wrong code usage: can't find xmage token info for: " + TokenRepository.XMAGE_IMAGE_NAME_SPEED);
|
||||
}
|
||||
}
|
||||
|
||||
private Speed(final Speed card) {
|
||||
|
|
|
|||
|
|
@ -2862,6 +2862,8 @@ public abstract class GameImpl implements Game {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Start Your Engines // Max Speed
|
||||
if (perm.getAbilities(this).containsClass(StartYourEnginesAbility.class)) {
|
||||
Optional.ofNullable(perm.getControllerId())
|
||||
.map(this::getPlayer)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue