mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
Merge branch 'master' of https://github.com/magefree/mage.git
This commit is contained in:
commit
ff5d16e132
6 changed files with 22 additions and 15 deletions
|
|
@ -194,11 +194,6 @@ public class MageActionCallback implements ActionCallback {
|
|||
}
|
||||
|
||||
private void showPopup(final TransferData data, final Component parentComponent, final Point parentPoint) {
|
||||
// skip popup for not implemented cards (they have Rarity.NA)
|
||||
if (data.card.getRarity().equals(Rarity.NA)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.component != null) {
|
||||
String showTooltips = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_ANY_ZONE, "true");
|
||||
if (showTooltips.equals("false")) {
|
||||
|
|
|
|||
|
|
@ -271,7 +271,9 @@ public class CardView extends SimpleCardView {
|
|||
this.name = emblem.getName();
|
||||
this.displayName = name;
|
||||
this.rules = emblem.getRules();
|
||||
this.expansionSetCode = emblem.getExpansionSetCode();
|
||||
// emblem images are always with common (black) symbol
|
||||
this.expansionSetCode = emblem.getExpansionSetCode();
|
||||
this.rarity = Rarity.COMMON;
|
||||
}
|
||||
|
||||
public CardView(boolean empty) {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ import mage.game.ExileZone;
|
|||
import mage.game.Game;
|
||||
import mage.game.GameState;
|
||||
import mage.game.combat.CombatGroup;
|
||||
import mage.game.command.CommandObject;
|
||||
import mage.game.command.Emblem;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.PermanentToken;
|
||||
|
|
@ -85,6 +84,7 @@ public class GameView implements Serializable {
|
|||
}
|
||||
for (StackObject stackObject: state.getStack()) {
|
||||
if (stackObject instanceof StackAbility) {
|
||||
// Stack Ability
|
||||
MageObject object = game.getObject(stackObject.getSourceId());
|
||||
Card card = game.getCard(stackObject.getSourceId());
|
||||
if (card != null) {
|
||||
|
|
@ -100,7 +100,7 @@ public class GameView implements Serializable {
|
|||
} else if (object != null) {
|
||||
if (object instanceof PermanentToken) {
|
||||
PermanentToken token = (PermanentToken)object;
|
||||
stack.put(stackObject.getId(), new CardView(token));
|
||||
stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility)stackObject, token.getName(), new CardView(token)));
|
||||
checkPaid(stackObject.getId(), (StackAbility)stackObject);
|
||||
} else if (object instanceof Emblem) {
|
||||
Card sourceCard = game.getCard(((Emblem)object).getSourceId());
|
||||
|
|
@ -110,7 +110,8 @@ public class GameView implements Serializable {
|
|||
} else {
|
||||
throw new IllegalArgumentException("Source card for emblem not found.");
|
||||
}
|
||||
stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility)stackObject, object.getName(), new CardView(((StackAbility)stackObject))));
|
||||
stack.put(stackObject.getId(),
|
||||
new StackAbilityView(game, (StackAbility)stackObject, object.getName(), new CardView(new EmblemView(((Emblem)object),sourceCard))));
|
||||
checkPaid(stackObject.getId(), ((StackAbility)stackObject));
|
||||
} else {
|
||||
StackAbility stackAbility = ((StackAbility)object);
|
||||
|
|
@ -118,9 +119,12 @@ public class GameView implements Serializable {
|
|||
stack.put(stackObject.getId(), new CardView(((StackAbility)stackObject)));
|
||||
checkPaid(stackObject.getId(), ((StackAbility)stackObject));
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Spell
|
||||
stack.put(stackObject.getId(), new CardView((Spell)stackObject));
|
||||
checkPaid(stackObject.getId(), (Spell)stackObject);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,12 +47,11 @@ import java.util.UUID;
|
|||
*/
|
||||
public class Emblem implements CommandObject {
|
||||
|
||||
private String name;
|
||||
private static List emptyList = new ArrayList();
|
||||
private static ObjectColor emptyColor = new ObjectColor();
|
||||
private static ManaCosts emptyCost = new ManaCostsImpl();
|
||||
|
||||
|
||||
private String name;
|
||||
private UUID id;
|
||||
private UUID controllerId;
|
||||
private UUID sourceId;
|
||||
|
|
@ -62,7 +61,7 @@ public class Emblem implements CommandObject {
|
|||
this.id = UUID.randomUUID();
|
||||
}
|
||||
|
||||
public Emblem(Emblem emblem) {
|
||||
public Emblem(final Emblem emblem) {
|
||||
this.id = emblem.id;
|
||||
this.controllerId = emblem.controllerId;
|
||||
this.sourceId = emblem.sourceId;
|
||||
|
|
@ -100,7 +99,7 @@ public class Emblem implements CommandObject {
|
|||
|
||||
@Override
|
||||
public String getImageName() {
|
||||
return "";
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -88,6 +88,9 @@ public class Token extends MageObjectImpl<Token> {
|
|||
super(token);
|
||||
this.description = token.description;
|
||||
this.tokenType = token.tokenType;
|
||||
this.lastAddedTokenId = token.lastAddedTokenId;
|
||||
this.originalCardNumber = token.originalCardNumber;
|
||||
this.originalExpansionSetCode = token.originalExpansionSetCode;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
|
|
|
|||
|
|
@ -59,8 +59,13 @@ public class CopyTokenFunction implements Function<Token, Card> {
|
|||
MageObject sourceObj = source;
|
||||
if (source instanceof PermanentToken) {
|
||||
sourceObj = ((PermanentToken) source).getToken();
|
||||
// to show the source image, the original values have to be used
|
||||
target.setOriginalExpansionSetCode(((Token)sourceObj).getOriginalExpansionSetCode());
|
||||
target.setOriginalCardNumber(((Token)sourceObj).getOriginalCardNumber());
|
||||
} else if (source instanceof PermanentCard) {
|
||||
sourceObj = ((PermanentCard) source).getCard();
|
||||
target.setOriginalExpansionSetCode(source.getExpansionSetCode());
|
||||
target.setOriginalCardNumber(source.getCardNumber());
|
||||
}
|
||||
|
||||
target.setName(sourceObj.getName());
|
||||
|
|
@ -79,8 +84,7 @@ public class CopyTokenFunction implements Function<Token, Card> {
|
|||
for (String type : sourceObj.getSupertype()) {
|
||||
target.getSupertype().add(type);
|
||||
}
|
||||
target.setOriginalExpansionSetCode(source.getExpansionSetCode());
|
||||
target.setOriginalCardNumber(source.getCardNumber());
|
||||
|
||||
target.getAbilities().clear();
|
||||
|
||||
for (Ability ability0 : sourceObj.getAbilities()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue