mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Merge pull request #138 from Northmoc/snc_ab_ql
Arcane Bombardment - quality of life
This commit is contained in:
@@ -192,6 +192,7 @@ public class ChangeZoneAllEffect extends SpellAbilityEffect {
|
||||
if (host == null) {
|
||||
host = sa.getHostCard();
|
||||
}
|
||||
host.addExiledCard(movedCard);
|
||||
movedCard.setExiledWith(host);
|
||||
movedCard.setExiledBy(host.getController());
|
||||
}
|
||||
|
||||
@@ -719,6 +719,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||
if (host == null) {
|
||||
host = sa.getHostCard();
|
||||
}
|
||||
host.addExiledCard(gameCard);
|
||||
gameCard.setExiledWith(host);
|
||||
gameCard.setExiledBy(host.getController());
|
||||
}
|
||||
@@ -745,6 +746,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||
if (destination.equals(ZoneType.Exile) && !movedCard.isToken()) {
|
||||
movedCard.setExiledWith(host);
|
||||
if (host != null) {
|
||||
host.addExiledCard(movedCard);
|
||||
movedCard.setExiledBy(host.getController());
|
||||
}
|
||||
}
|
||||
@@ -1350,6 +1352,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||
if (host == null) {
|
||||
host = sa.getHostCard();
|
||||
}
|
||||
host.addExiledCard(movedCard);
|
||||
movedCard.setExiledWith(host);
|
||||
movedCard.setExiledBy(host.getController());
|
||||
}
|
||||
@@ -1541,6 +1544,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||
host = srcSA.getHostCard();
|
||||
}
|
||||
movedCard = game.getAction().exile(tgtHost, srcSA, params);
|
||||
host.addExiledCard(movedCard);
|
||||
movedCard.setExiledWith(host);
|
||||
movedCard.setExiledBy(host.getController());
|
||||
} else if (srcSA.getParam("Destination").equals("TopOfLibrary")) {
|
||||
|
||||
@@ -420,6 +420,7 @@ public class DigEffect extends SpellAbilityEffect {
|
||||
if (sa.hasParam("ExileWithCounter")) {
|
||||
c.addCounter(CounterType.getType(sa.getParam("ExileWithCounter")), 1, player, counterTable);
|
||||
}
|
||||
effectHost.addExiledCard(c);
|
||||
c.setExiledWith(effectHost);
|
||||
c.setExiledBy(effectHost.getController());
|
||||
}
|
||||
@@ -492,6 +493,7 @@ public class DigEffect extends SpellAbilityEffect {
|
||||
if (sa.hasParam("ExileWithCounter")) {
|
||||
c.addCounter(CounterType.getType(sa.getParam("ExileWithCounter")), 1, player, counterTable);
|
||||
}
|
||||
effectHost.addExiledCard(c);
|
||||
c.setExiledWith(effectHost);
|
||||
c.setExiledBy(effectHost.getController());
|
||||
if (remZone2) {
|
||||
|
||||
@@ -68,6 +68,7 @@ public class MillEffect extends SpellAbilityEffect {
|
||||
host = sa.getHostCard();
|
||||
}
|
||||
for (final Card c : milled) {
|
||||
host.addExiledCard(c);
|
||||
c.setExiledWith(host);
|
||||
if (facedown) {
|
||||
c.turnFaceDown(true);
|
||||
|
||||
@@ -109,7 +109,8 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
||||
private final Table<Long, Long, List<String>> hiddenExtrinsicKeywords = TreeBasedTable.create();
|
||||
|
||||
// cards attached or otherwise linked to this card
|
||||
private CardCollection hauntedBy, devouredCards, exploitedCards, delvedCards, convokedCards, imprintedCards, encodedCards;
|
||||
private CardCollection hauntedBy, devouredCards, exploitedCards, delvedCards, convokedCards, imprintedCards,
|
||||
exiledCards, encodedCards;
|
||||
private CardCollection gainControlTargets, chosenCards;
|
||||
private CardCollection mergedCards;
|
||||
private Map<Long, CardCollection> mustBlockCards = Maps.newHashMap();
|
||||
@@ -1079,6 +1080,31 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
||||
imprintedCards = view.clearCards(imprintedCards, TrackableProperty.ImprintedCards);
|
||||
}
|
||||
|
||||
public final CardCollectionView getExiledCards() {
|
||||
return CardCollection.getView(exiledCards);
|
||||
}
|
||||
public final boolean hasExiledCard() {
|
||||
return FCollection.hasElements(exiledCards);
|
||||
}
|
||||
public final boolean hasExiledCard(Card c) {
|
||||
return FCollection.hasElement(exiledCards, c);
|
||||
}
|
||||
public final void addExiledCard(final Card c) {
|
||||
exiledCards = view.addCard(exiledCards, c, TrackableProperty.ExiledCards);
|
||||
}
|
||||
public final void addExiledCards(final Iterable<Card> cards) {
|
||||
exiledCards = view.addCards(exiledCards, cards, TrackableProperty.ExiledCards);
|
||||
}
|
||||
public final void removeExiledCard(final Card c) {
|
||||
exiledCards = view.removeCard(exiledCards, c, TrackableProperty.ExiledCards);
|
||||
}
|
||||
public final void removeExiledCards(final Iterable<Card> cards) {
|
||||
exiledCards = view.removeCards(exiledCards, cards, TrackableProperty.ExiledCards);
|
||||
}
|
||||
public final void clearExiledCards() {
|
||||
exiledCards = view.clearCards(exiledCards, TrackableProperty.ExiledCards);
|
||||
}
|
||||
|
||||
public final CardCollectionView getEncodedCards() {
|
||||
return CardCollection.getView(encodedCards);
|
||||
}
|
||||
@@ -1668,6 +1694,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
||||
return;
|
||||
}
|
||||
|
||||
exiledWith.removeExiledCard(this);
|
||||
exiledWith.removeUntilLeavesBattlefield(this);
|
||||
|
||||
exiledWith = null;
|
||||
|
||||
@@ -647,6 +647,10 @@ public class CardView extends GameEntityView {
|
||||
return get(TrackableProperty.ImprintedCards);
|
||||
}
|
||||
|
||||
public FCollectionView<CardView> getExiledCards() {
|
||||
return get(TrackableProperty.ExiledCards);
|
||||
}
|
||||
|
||||
public FCollectionView<CardView> getHauntedBy() {
|
||||
return get(TrackableProperty.HauntedBy);
|
||||
}
|
||||
|
||||
@@ -232,8 +232,10 @@ public class CostAdjustment {
|
||||
} else if (!test) {
|
||||
sa.getHostCard().addDelved(c);
|
||||
final Card d = game.getAction().exile(c, null);
|
||||
d.setExiledWith(sa.getHostCard());
|
||||
d.setExiledBy(sa.getHostCard().getController());
|
||||
final Card host = sa.getHostCard();
|
||||
host.addExiledCard(d);
|
||||
d.setExiledWith(host);
|
||||
d.setExiledBy(host.getController());
|
||||
table.put(ZoneType.Graveyard, d.getZone().getZoneType(), d);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,8 +180,10 @@ public class CostExile extends CostPartWithList {
|
||||
@Override
|
||||
protected Card doPayment(SpellAbility ability, Card targetCard, final boolean effect) {
|
||||
final Game game = targetCard.getGame();
|
||||
final Card host = ability.getHostCard();
|
||||
Card newCard = game.getAction().exile(targetCard, null);
|
||||
newCard.setExiledWith(ability.getHostCard());
|
||||
host.addExiledCard(newCard);
|
||||
newCard.setExiledWith(host);
|
||||
newCard.setExiledBy(ability.getActivatingPlayer());
|
||||
return newCard;
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@ public enum TrackableProperty {
|
||||
NeedsTapAnimation(TrackableTypes.BooleanType, FreezeMode.IgnoresFreeze),
|
||||
|
||||
ImprintedCards(TrackableTypes.CardViewCollectionType),
|
||||
ExiledCards(TrackableTypes.CardViewCollectionType),
|
||||
HauntedBy(TrackableTypes.CardViewCollectionType),
|
||||
Haunting(TrackableTypes.CardViewType),
|
||||
MustBlockCards(TrackableTypes.CardViewCollectionType),
|
||||
|
||||
Reference in New Issue
Block a user