mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
StaticAbilityContinous now have AffectedDefined for card list (#6986)
* StaticAbilityContinous now have AffectedDefined for card list
This commit is contained in:
@@ -4139,7 +4139,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars, ITr
|
|||||||
eff.setRenderForUI(false);
|
eff.setRenderForUI(false);
|
||||||
eff.addRemembered(this);
|
eff.addRemembered(this);
|
||||||
|
|
||||||
String s = "Mode$ Continuous | Affected$ Card.IsRemembered | EffectZone$ Command | RemoveType$ Creature";
|
String s = "Mode$ Continuous | AffectedDefined$ RememberedCard | EffectZone$ Command | RemoveType$ Creature";
|
||||||
eff.addStaticAbility(s);
|
eff.addStaticAbility(s);
|
||||||
|
|
||||||
GameCommand until = SpellAbilityEffect.exileEffectCommand(game, eff);
|
GameCommand until = SpellAbilityEffect.exileEffectCommand(game, eff);
|
||||||
|
|||||||
@@ -452,29 +452,11 @@ public final class StaticAbilityContinuous {
|
|||||||
|
|
||||||
if (layer == StaticAbilityLayer.COLOR) {
|
if (layer == StaticAbilityLayer.COLOR) {
|
||||||
if (params.containsKey("AddColor")) {
|
if (params.containsKey("AddColor")) {
|
||||||
final String colors = params.get("AddColor");
|
addColors = getColorsFromParam(stAb, params.get("AddColor"));
|
||||||
if (colors.equals("ChosenColor")) {
|
|
||||||
if (hostCard.hasChosenColor()) {
|
|
||||||
addColors = ColorSet.fromNames(hostCard.getChosenColors());
|
|
||||||
}
|
|
||||||
} else if (colors.equals("All")) {
|
|
||||||
addColors = ColorSet.ALL_COLORS;
|
|
||||||
} else {
|
|
||||||
addColors = ColorSet.fromNames(colors.split(" & "));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.containsKey("SetColor")) {
|
if (params.containsKey("SetColor")) {
|
||||||
final String colors = params.get("SetColor");
|
addColors = getColorsFromParam(stAb, params.get("SetColor"));
|
||||||
if (colors.equals("ChosenColor")) {
|
|
||||||
if (hostCard.hasChosenColor()) {
|
|
||||||
addColors = ColorSet.fromNames(hostCard.getChosenColors());
|
|
||||||
}
|
|
||||||
} else if (colors.equals("All")) {
|
|
||||||
addColors = ColorSet.ALL_COLORS;
|
|
||||||
} else {
|
|
||||||
addColors = ColorSet.fromNames(colors.split(" & "));
|
|
||||||
}
|
|
||||||
overwriteColors = true;
|
overwriteColors = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -933,6 +915,22 @@ public final class StaticAbilityContinuous {
|
|||||||
return affectedCards;
|
return affectedCards;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static ColorSet getColorsFromParam(StaticAbility stAb, final String colors) {
|
||||||
|
final Card hostCard = stAb.getHostCard();
|
||||||
|
ColorSet addColors;
|
||||||
|
if (colors.equals("ChosenColor")) {
|
||||||
|
if (hostCard.hasChosenColor()) {
|
||||||
|
addColors = ColorSet.fromNames(hostCard.getChosenColors());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
} else if (colors.equals("All")) {
|
||||||
|
addColors = ColorSet.ALL_COLORS;
|
||||||
|
} else {
|
||||||
|
addColors = ColorSet.fromNames(colors.split(" & "));
|
||||||
|
}
|
||||||
|
return addColors;
|
||||||
|
}
|
||||||
|
|
||||||
private static void buildIgnorEffectAbility(final StaticAbility stAb, final String costString, final List<Player> players, final CardCollectionView cards) {
|
private static void buildIgnorEffectAbility(final StaticAbility stAb, final String costString, final List<Player> players, final CardCollectionView cards) {
|
||||||
final List<Player> validActivator = new ArrayList<>(players);
|
final List<Player> validActivator = new ArrayList<>(players);
|
||||||
for (final Card c : cards) {
|
for (final Card c : cards) {
|
||||||
@@ -1032,10 +1030,18 @@ public final class StaticAbilityContinuous {
|
|||||||
// non - CharacteristicDefining
|
// non - CharacteristicDefining
|
||||||
CardCollection affectedCards = new CardCollection();
|
CardCollection affectedCards = new CardCollection();
|
||||||
|
|
||||||
|
CardCollection definedCards = null;
|
||||||
|
if (stAb.hasParam("AffectedDefined")) {
|
||||||
|
definedCards = AbilityUtils.getDefinedCards(hostCard, stAb.getParam("AffectedDefined"), stAb).filter(CardPredicates.phasedIn());
|
||||||
|
}
|
||||||
|
|
||||||
// add preList in addition to the normal affected cards
|
// add preList in addition to the normal affected cards
|
||||||
// need to add before game cards to have preference over them
|
// need to add before game cards to have preference over them
|
||||||
if (!preList.isEmpty()) {
|
if (!preList.isEmpty()) {
|
||||||
if (stAb.hasParam("AffectedZone")) {
|
if (stAb.hasParam("AffectedDefined")) {
|
||||||
|
affectedCards.addAll(preList);
|
||||||
|
affectedCards.retainAll(definedCards);
|
||||||
|
} else if (stAb.hasParam("AffectedZone")) {
|
||||||
affectedCards.addAll(CardLists.filter(preList, CardPredicates.inZone(
|
affectedCards.addAll(CardLists.filter(preList, CardPredicates.inZone(
|
||||||
ZoneType.listValueOf(stAb.getParam("AffectedZone")))));
|
ZoneType.listValueOf(stAb.getParam("AffectedZone")))));
|
||||||
} else {
|
} else {
|
||||||
@@ -1043,7 +1049,9 @@ public final class StaticAbilityContinuous {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stAb.hasParam("AffectedZone")) {
|
if (stAb.hasParam("AffectedDefined")) {
|
||||||
|
affectedCards.addAll(definedCards);
|
||||||
|
} else if (stAb.hasParam("AffectedZone")) {
|
||||||
affectedCards.addAll(game.getCardsIn(ZoneType.listValueOf(stAb.getParam("AffectedZone"))));
|
affectedCards.addAll(game.getCardsIn(ZoneType.listValueOf(stAb.getParam("AffectedZone"))));
|
||||||
} else {
|
} else {
|
||||||
affectedCards.addAll(game.getCardsIn(ZoneType.Battlefield));
|
affectedCards.addAll(game.getCardsIn(ZoneType.Battlefield));
|
||||||
|
|||||||
Reference in New Issue
Block a user