mirror of
https://github.com/correl/mage.git
synced 2024-11-28 19:19:55 +00:00
parent
a0f8a42699
commit
76f30b3046
2 changed files with 26 additions and 2 deletions
|
@ -334,6 +334,9 @@ public final class GuiDisplayUtil {
|
||||||
buffer.append("[only controlled] ");
|
buffer.append("[only controlled] ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (card instanceof PermanentView && ((PermanentView) card).isAttachedToDifferentlyControlledPermanent()) {
|
||||||
|
buffer.append('(').append(((PermanentView) card).getNameController()).append(") ");
|
||||||
|
}
|
||||||
if (card.getMageObjectType() != MageObjectType.NULL) {
|
if (card.getMageObjectType() != MageObjectType.NULL) {
|
||||||
buffer.append(card.getMageObjectType().toString());
|
buffer.append(card.getMageObjectType().toString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,11 +29,14 @@ public class PermanentView extends CardView {
|
||||||
private final CardView original; // original card before transforms and modifications (null for opponents face down cards)
|
private final CardView original; // original card before transforms and modifications (null for opponents face down cards)
|
||||||
private final boolean copy;
|
private final boolean copy;
|
||||||
private final String nameOwner; // only filled if != controller
|
private final String nameOwner; // only filled if != controller
|
||||||
|
private final String nameController;
|
||||||
private final boolean controlled;
|
private final boolean controlled;
|
||||||
private final UUID attachedTo;
|
private final UUID attachedTo;
|
||||||
private final boolean morphed;
|
private final boolean morphed;
|
||||||
private final boolean manifested;
|
private final boolean manifested;
|
||||||
private final boolean attachedToPermanent;
|
private final boolean attachedToPermanent;
|
||||||
|
// If this card is attached to a permanent which is controlled by a player other than the one which controls this permanent
|
||||||
|
private final boolean attachedControllerDiffers;
|
||||||
|
|
||||||
public PermanentView(Permanent permanent, Card card, UUID createdForPlayerId, Game game) {
|
public PermanentView(Permanent permanent, Card card, UUID createdForPlayerId, Game game) {
|
||||||
super(permanent, game, permanent.getControllerId() != null && permanent.getControllerId().equals(createdForPlayerId));
|
super(permanent, game, permanent.getControllerId() != null && permanent.getControllerId().equals(createdForPlayerId));
|
||||||
|
@ -89,6 +92,13 @@ public class PermanentView extends CardView {
|
||||||
this.nameOwner = "";
|
this.nameOwner = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Player controller = game.getPlayer(permanent.getControllerId());
|
||||||
|
if (controller != null) {
|
||||||
|
nameController = controller.getName();
|
||||||
|
} else {
|
||||||
|
nameController = "";
|
||||||
|
}
|
||||||
|
|
||||||
// add info for face down permanents
|
// add info for face down permanents
|
||||||
if (permanent.isFaceDown(game) && card != null) {
|
if (permanent.isFaceDown(game) && card != null) {
|
||||||
if (showFaceDownInfo) {
|
if (showFaceDownInfo) {
|
||||||
|
@ -116,10 +126,13 @@ public class PermanentView extends CardView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// determines if shown in it's own column
|
// determines if shown in it's own column
|
||||||
if (permanent.getAttachedTo() != null) {
|
Permanent attachment = game.getPermanent(permanent.getAttachedTo());
|
||||||
attachedToPermanent = game.getPermanent(permanent.getAttachedTo()) != null;
|
if (attachment != null) {
|
||||||
|
attachedToPermanent = true;
|
||||||
|
attachedControllerDiffers = !attachment.getControllerId().equals(permanent.getControllerId());
|
||||||
} else {
|
} else {
|
||||||
attachedToPermanent = false;
|
attachedToPermanent = false;
|
||||||
|
attachedControllerDiffers = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,6 +176,10 @@ public class PermanentView extends CardView {
|
||||||
return nameOwner;
|
return nameOwner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getNameController() {
|
||||||
|
return nameController;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isControlled() {
|
public boolean isControlled() {
|
||||||
return controlled;
|
return controlled;
|
||||||
}
|
}
|
||||||
|
@ -179,6 +196,10 @@ public class PermanentView extends CardView {
|
||||||
return attachedToPermanent;
|
return attachedToPermanent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isAttachedToDifferentlyControlledPermanent() {
|
||||||
|
return attachedControllerDiffers;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isMorphed() {
|
public boolean isMorphed() {
|
||||||
return morphed;
|
return morphed;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue