mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
attach: rework attaching names
This commit is contained in:
@@ -442,22 +442,22 @@ public class CardView extends GameEntityView {
|
||||
return get(TrackableProperty.EncodedCards);
|
||||
}
|
||||
|
||||
public GameEntityView getAttaching() {
|
||||
return get(TrackableProperty.Attaching);
|
||||
public GameEntityView getAttachingEntity() {
|
||||
return get(TrackableProperty.AttachingEntity);
|
||||
}
|
||||
void updateAttaching(Card c) {
|
||||
set(TrackableProperty.Attaching, GameEntityView.get(c.getAttachingEntity()));
|
||||
set(TrackableProperty.AttachingEntity, GameEntityView.get(c.getAttachingEntity()));
|
||||
}
|
||||
|
||||
public CardView getAttachingCard() {
|
||||
GameEntityView enchanting = getAttaching();
|
||||
GameEntityView enchanting = getAttachingEntity();
|
||||
if (enchanting instanceof CardView) {
|
||||
return (CardView) enchanting;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public PlayerView getAttachingPlayer() {
|
||||
GameEntityView enchanting = getAttaching();
|
||||
GameEntityView enchanting = getAttachingEntity();
|
||||
if (enchanting instanceof PlayerView) {
|
||||
return (PlayerView) enchanting;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public enum TrackableProperty {
|
||||
NamedCard(TrackableTypes.StringType),
|
||||
PlayerMayLook(TrackableTypes.PlayerViewCollectionType, FreezeMode.IgnoresFreeze),
|
||||
PlayerMayLookTemp(TrackableTypes.PlayerViewCollectionType, FreezeMode.IgnoresFreeze),
|
||||
Attaching(TrackableTypes.GameEntityViewType),
|
||||
AttachingEntity(TrackableTypes.GameEntityViewType),
|
||||
EncodedCards(TrackableTypes.CardViewCollectionType),
|
||||
GainControlTargets(TrackableTypes.CardViewCollectionType),
|
||||
CloneOrigin(TrackableTypes.CardViewType),
|
||||
|
||||
@@ -99,7 +99,7 @@ public class VField extends FContainer {
|
||||
};
|
||||
|
||||
private boolean tryStackCard(CardView card, List<CardView> cardsOfType) {
|
||||
if (card.isAttached()) {
|
||||
if (card.isAttachedByCards()) {
|
||||
return false; //can stack with enchanted or equipped card
|
||||
}
|
||||
if (card.getCurrentState().isCreature() && !card.isToken()) {
|
||||
@@ -107,7 +107,7 @@ public class VField extends FContainer {
|
||||
}
|
||||
final String cardName = card.getCurrentState().getName();
|
||||
for (CardView c : cardsOfType) {
|
||||
if (!c.isAttached() &&
|
||||
if (!c.isAttachedByCards() &&
|
||||
cardName.equals(c.getCurrentState().getName()) &&
|
||||
card.hasSameCounters(c) &&
|
||||
card.isToken() == c.isToken()) { //don't stack tokens on top of non-tokens
|
||||
|
||||
Reference in New Issue
Block a user