mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
* Changes to image handling of copied permanents (image is more often shown now).
This commit is contained in:
parent
7ebb8a9cbe
commit
401d65a17e
4 changed files with 12 additions and 3 deletions
|
@ -337,6 +337,7 @@ public class ImageCache {
|
||||||
if (card.getUsesVariousArt()) {
|
if (card.getUsesVariousArt()) {
|
||||||
key += "#usesVariousArt";
|
key += "#usesVariousArt";
|
||||||
}
|
}
|
||||||
|
log.warn("getImage: " + key);
|
||||||
BufferedImage original = getImage(key);
|
BufferedImage original = getImage(key);
|
||||||
if (original == null) {
|
if (original == null) {
|
||||||
log.warn(key + " not found");
|
log.warn(key + " not found");
|
||||||
|
|
|
@ -48,6 +48,7 @@ import mage.abilities.keyword.HasteAbility;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
import mage.sets.tokens.EmptyToken;
|
import mage.sets.tokens.EmptyToken;
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
@ -106,10 +107,10 @@ class SplinterTwinEffect extends OneShotEffect<SplinterTwinEffect> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Card card = game.getCard(source.getSourceId());
|
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||||
if (card != null) {
|
if (permanent != null) {
|
||||||
EmptyToken token = new EmptyToken();
|
EmptyToken token = new EmptyToken();
|
||||||
CardUtil.copyTo(token).from(card);
|
CardUtil.copyTo(token).from(permanent);
|
||||||
|
|
||||||
token.addAbility(HasteAbility.getInstance());
|
token.addAbility(HasteAbility.getInstance());
|
||||||
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||||
|
|
|
@ -37,6 +37,7 @@ import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.game.permanent.PermanentCard;
|
import mage.game.permanent.PermanentCard;
|
||||||
|
import mage.game.permanent.PermanentToken;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -106,6 +107,9 @@ public class CopyEffect extends ContinuousEffectImpl<CopyEffect> {
|
||||||
if (target instanceof PermanentCard) {
|
if (target instanceof PermanentCard) {
|
||||||
permanent.setCardNumber(((PermanentCard) target).getCard().getCardNumber());
|
permanent.setCardNumber(((PermanentCard) target).getCard().getCardNumber());
|
||||||
permanent.setExpansionSetCode(((PermanentCard) target).getCard().getExpansionSetCode());
|
permanent.setExpansionSetCode(((PermanentCard) target).getCard().getExpansionSetCode());
|
||||||
|
} else if (target instanceof PermanentToken) {
|
||||||
|
permanent.setCardNumber(((PermanentToken) target).getCardNumber());
|
||||||
|
permanent.setExpansionSetCode(((PermanentToken) target).getExpansionSetCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
permanent.setCopy(true);
|
permanent.setCopy(true);
|
||||||
|
|
|
@ -66,6 +66,9 @@ public class CopyTokenFunction implements Function<Token, Card> {
|
||||||
sourceObj = ((PermanentCard) source).getCard();
|
sourceObj = ((PermanentCard) source).getCard();
|
||||||
target.setOriginalExpansionSetCode(source.getExpansionSetCode());
|
target.setOriginalExpansionSetCode(source.getExpansionSetCode());
|
||||||
target.setOriginalCardNumber(source.getCardNumber());
|
target.setOriginalCardNumber(source.getCardNumber());
|
||||||
|
} else {
|
||||||
|
target.setOriginalExpansionSetCode(source.getExpansionSetCode());
|
||||||
|
target.setOriginalCardNumber(source.getCardNumber());
|
||||||
}
|
}
|
||||||
|
|
||||||
target.setName(sourceObj.getName());
|
target.setName(sourceObj.getName());
|
||||||
|
|
Loading…
Reference in a new issue