mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Merge branch 'staticKeywordChangeList' into 'master'
refactor Keywords using Chosen Values See merge request core-developers/forge!2462
This commit is contained in:
@@ -276,6 +276,10 @@ public class StaticEffect {
|
|||||||
affectedCard.removeChangedCardKeywords(getTimestamp());
|
affectedCard.removeChangedCardKeywords(getTimestamp());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hasParam("CantHaveKeyword")) {
|
||||||
|
affectedCard.removeCantHaveKeyword(getTimestamp());
|
||||||
|
}
|
||||||
|
|
||||||
if (addHiddenKeywords != null) {
|
if (addHiddenKeywords != null) {
|
||||||
for (final String k : addHiddenKeywords) {
|
for (final String k : addHiddenKeywords) {
|
||||||
affectedCard.removeHiddenExtrinsicKeyword(k);
|
affectedCard.removeHiddenExtrinsicKeyword(k);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ package forge.game.ability.effects;
|
|||||||
import forge.card.CardType;
|
import forge.card.CardType;
|
||||||
import forge.game.ability.SpellAbilityEffect;
|
import forge.game.ability.SpellAbilityEffect;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
|
import forge.game.keyword.Keyword;
|
||||||
import forge.game.spellability.SpellAbility;
|
import forge.game.spellability.SpellAbility;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -101,6 +101,10 @@ public abstract class AnimateEffectBase extends SpellAbilityEffect {
|
|||||||
c.addChangedCardKeywords(keywords, removeKeywords,
|
c.addChangedCardKeywords(keywords, removeKeywords,
|
||||||
sa.hasParam("RemoveAllAbilities"), sa.hasParam("RemoveIntrinsicAbilities"), timestamp);
|
sa.hasParam("RemoveAllAbilities"), sa.hasParam("RemoveIntrinsicAbilities"), timestamp);
|
||||||
|
|
||||||
|
if (sa.hasParam("CantHaveKeyword")) {
|
||||||
|
c.addCantHaveKeyword(timestamp, Keyword.setValueOf(sa.getParam("CantHaveKeyword")));
|
||||||
|
}
|
||||||
|
|
||||||
for (final String k : hiddenKeywords) {
|
for (final String k : hiddenKeywords) {
|
||||||
c.addHiddenExtrinsicKeyword(k);
|
c.addHiddenExtrinsicKeyword(k);
|
||||||
}
|
}
|
||||||
@@ -138,6 +142,8 @@ public abstract class AnimateEffectBase extends SpellAbilityEffect {
|
|||||||
|
|
||||||
c.removeChangedCardTraits(timestamp);
|
c.removeChangedCardTraits(timestamp);
|
||||||
|
|
||||||
|
c.removeCantHaveKeyword(timestamp);
|
||||||
|
|
||||||
for (final String k : hiddenKeywords) {
|
for (final String k : hiddenKeywords) {
|
||||||
c.removeHiddenExtrinsicKeyword(k);
|
c.removeHiddenExtrinsicKeyword(k);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,6 +127,8 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
private final NavigableMap<Long, CardCloneStates> clonedStates = Maps.newTreeMap();
|
private final NavigableMap<Long, CardCloneStates> clonedStates = Maps.newTreeMap();
|
||||||
private final NavigableMap<Long, CardCloneStates> textChangeStates = Maps.newTreeMap();
|
private final NavigableMap<Long, CardCloneStates> textChangeStates = Maps.newTreeMap();
|
||||||
|
|
||||||
|
private final Multimap<Long, Keyword> cantHaveKeywords = MultimapBuilder.hashKeys().enumSetValues(Keyword.class).build();
|
||||||
|
|
||||||
private final Map<Long, Integer> canBlockAdditional = Maps.newTreeMap();
|
private final Map<Long, Integer> canBlockAdditional = Maps.newTreeMap();
|
||||||
private final Set<Long> canBlockAny = Sets.newHashSet();
|
private final Set<Long> canBlockAny = Sets.newHashSet();
|
||||||
|
|
||||||
@@ -232,8 +234,8 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
private String originalText = "", text = "";
|
private String originalText = "", text = "";
|
||||||
private String chosenType = "";
|
private String chosenType = "";
|
||||||
private List<String> chosenColors;
|
private List<String> chosenColors;
|
||||||
private String namedCard = "";
|
private String chosenName = "";
|
||||||
private int chosenNumber;
|
private Integer chosenNumber;
|
||||||
private Player chosenPlayer;
|
private Player chosenPlayer;
|
||||||
private Direction chosenDirection = null;
|
private Direction chosenDirection = null;
|
||||||
private String chosenMode = "";
|
private String chosenMode = "";
|
||||||
@@ -1445,6 +1447,9 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
return currentState.getManaCost();
|
return currentState.getManaCost();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final boolean hasChosenPlayer() {
|
||||||
|
return chosenPlayer != null;
|
||||||
|
}
|
||||||
public final Player getChosenPlayer() {
|
public final Player getChosenPlayer() {
|
||||||
return chosenPlayer;
|
return chosenPlayer;
|
||||||
}
|
}
|
||||||
@@ -1454,7 +1459,11 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
view.updateChosenPlayer(this);
|
view.updateChosenPlayer(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int getChosenNumber() {
|
public final boolean hasChosenNumber() {
|
||||||
|
return chosenNumber != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final Integer getChosenNumber() {
|
||||||
return chosenNumber;
|
return chosenNumber;
|
||||||
}
|
}
|
||||||
public final void setChosenNumber(final int i) {
|
public final void setChosenNumber(final int i) {
|
||||||
@@ -1472,6 +1481,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
public final String getChosenType() {
|
public final String getChosenType() {
|
||||||
return chosenType;
|
return chosenType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setChosenType(final String s) {
|
public final void setChosenType(final String s) {
|
||||||
chosenType = s;
|
chosenType = s;
|
||||||
view.updateChosenType(this);
|
view.updateChosenType(this);
|
||||||
@@ -1537,13 +1547,24 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
view.updateChosenMode(this);
|
view.updateChosenMode(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasChosenName() {
|
||||||
|
return chosenName != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getChosenName() {
|
||||||
|
return chosenName;
|
||||||
|
}
|
||||||
|
public final void setChosenName(final String s) {
|
||||||
|
chosenName = s;
|
||||||
|
view.updateNamedCard(this);
|
||||||
|
}
|
||||||
|
|
||||||
// used for cards like Meddling Mage...
|
// used for cards like Meddling Mage...
|
||||||
public final String getNamedCard() {
|
public final String getNamedCard() {
|
||||||
return namedCard;
|
return getChosenName();
|
||||||
}
|
}
|
||||||
public final void setNamedCard(final String s) {
|
public final void setNamedCard(final String s) {
|
||||||
namedCard = s;
|
setChosenName(s);
|
||||||
view.updateNamedCard(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean getDrawnThisTurn() {
|
public final boolean getDrawnThisTurn() {
|
||||||
@@ -3677,7 +3698,6 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
|
|
||||||
public final void addChangedCardKeywords(final List<String> keywords, final List<String> removeKeywords,
|
public final void addChangedCardKeywords(final List<String> keywords, final List<String> removeKeywords,
|
||||||
final boolean removeAllKeywords, final boolean removeIntrinsicKeywords, final long timestamp, final boolean updateView) {
|
final boolean removeAllKeywords, final boolean removeIntrinsicKeywords, final long timestamp, final boolean updateView) {
|
||||||
keywords.removeAll(getCantHaveOrGainKeyword());
|
|
||||||
// if the key already exists - merge entries
|
// if the key already exists - merge entries
|
||||||
final KeywordsChange cks = changedCardKeywords.get(timestamp);
|
final KeywordsChange cks = changedCardKeywords.get(timestamp);
|
||||||
if (cks != null) {
|
if (cks != null) {
|
||||||
@@ -3706,7 +3726,6 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
final long timestamp, final boolean updateView) {
|
final long timestamp, final boolean updateView) {
|
||||||
KeywordCollection list = new KeywordCollection();
|
KeywordCollection list = new KeywordCollection();
|
||||||
list.insertAll(keywords);
|
list.insertAll(keywords);
|
||||||
list.removeAll(getCantHaveOrGainKeyword());
|
|
||||||
// if the key already exists - merge entries
|
// if the key already exists - merge entries
|
||||||
final KeywordsChange cks = changedCardKeywords.get(timestamp);
|
final KeywordsChange cks = changedCardKeywords.get(timestamp);
|
||||||
if (cks != null) {
|
if (cks != null) {
|
||||||
@@ -3727,22 +3746,6 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void addChangedCardKeywords(final String[] keywords, final String[] removeKeywords,
|
|
||||||
final boolean removeAllKeywords, final boolean removeIntrinsicKeywords, final long timestamp) {
|
|
||||||
List<String> keywordsList = Lists.newArrayList();
|
|
||||||
List<String> removeKeywordsList = Lists.newArrayList();
|
|
||||||
if (keywords != null) {
|
|
||||||
keywordsList = Lists.newArrayList(Arrays.asList(keywords));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (removeKeywords != null) {
|
|
||||||
removeKeywordsList = Lists.newArrayList(Arrays.asList(removeKeywords));
|
|
||||||
}
|
|
||||||
|
|
||||||
addChangedCardKeywords(keywordsList, removeKeywordsList,
|
|
||||||
removeAllKeywords, removeIntrinsicKeywords, timestamp);
|
|
||||||
}
|
|
||||||
|
|
||||||
public final KeywordsChange removeChangedCardKeywords(final long timestamp) {
|
public final KeywordsChange removeChangedCardKeywords(final long timestamp) {
|
||||||
return removeChangedCardKeywords(timestamp, true);
|
return removeChangedCardKeywords(timestamp, true);
|
||||||
}
|
}
|
||||||
@@ -3817,24 +3820,20 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remove Can't have keywords
|
||||||
|
for (Keyword k : getCantHaveKeyword()) {
|
||||||
|
keywords.removeAll(k);
|
||||||
|
}
|
||||||
|
|
||||||
state.setCachedKeywords(keywords);
|
state.setCachedKeywords(keywords);
|
||||||
}
|
}
|
||||||
private void visitUnhiddenKeywords(CardState state, Visitor<KeywordInterface> visitor) {
|
private void visitUnhiddenKeywords(CardState state, Visitor<KeywordInterface> visitor) {
|
||||||
if (changedCardKeywords.isEmpty()) {
|
|
||||||
// Fast path that doesn't involve temp allocations.
|
|
||||||
for (KeywordInterface kw : state.getIntrinsicKeywords()) {
|
|
||||||
if (!visitor.visit(kw)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (KeywordInterface kw : getUnhiddenKeywords(state)) {
|
for (KeywordInterface kw : getUnhiddenKeywords(state)) {
|
||||||
if (!visitor.visit(kw)) {
|
if (!visitor.visit(kw)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replace all instances of one color word in this card's text by another.
|
* Replace all instances of one color word in this card's text by another.
|
||||||
@@ -4035,14 +4034,32 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final List<String> getCantHaveOrGainKeyword() {
|
public void addCantHaveKeyword(Keyword keyword, Long timestamp) {
|
||||||
final List<String> cantGain = Lists.newArrayList();
|
cantHaveKeywords.put(timestamp, keyword);
|
||||||
for (String s : hiddenExtrinsicKeyword) {
|
getView().updateCantHaveKeyword(this);
|
||||||
if (s.contains("can't have or gain")) {
|
|
||||||
cantGain.add(s.split("can't have or gain ")[1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addCantHaveKeyword(Long timestamp, Iterable<Keyword> keywords) {
|
||||||
|
cantHaveKeywords.putAll(timestamp, keywords);
|
||||||
|
getView().updateCantHaveKeyword(this);
|
||||||
}
|
}
|
||||||
return cantGain;
|
|
||||||
|
public boolean removeCantHaveKeyword(Long timestamp) {
|
||||||
|
return removeCantHaveKeyword(timestamp, true);
|
||||||
|
}
|
||||||
|
public boolean removeCantHaveKeyword(Long timestamp, boolean updateView) {
|
||||||
|
boolean change = !cantHaveKeywords.removeAll(timestamp).isEmpty();
|
||||||
|
if (change && updateView) {
|
||||||
|
getView().updateCantHaveKeyword(this);
|
||||||
|
updateKeywords();
|
||||||
|
if (isToken())
|
||||||
|
game.fireEvent(new GameEventTokenStateUpdate(this));
|
||||||
|
}
|
||||||
|
return change;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection<Keyword> getCantHaveKeyword() {
|
||||||
|
return cantHaveKeywords.values();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setStaticAbilities(final List<StaticAbility> a) {
|
public final void setStaticAbilities(final List<StaticAbility> a) {
|
||||||
@@ -5403,6 +5420,12 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
final String[] kws = kw.split(":");
|
final String[] kws = kw.split(":");
|
||||||
String characteristic = kws[1];
|
String characteristic = kws[1];
|
||||||
|
|
||||||
|
if (characteristic.startsWith("Player")) {
|
||||||
|
// TODO need to handle that better in CardProperty
|
||||||
|
if (source.getController().isValid(characteristic.split(","), getController(), this, null)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
// if colorlessDamage then it does only check damage color..
|
// if colorlessDamage then it does only check damage color..
|
||||||
if (colorlessDamage) {
|
if (colorlessDamage) {
|
||||||
if (characteristic.endsWith("White") || characteristic.endsWith("Blue")
|
if (characteristic.endsWith("White") || characteristic.endsWith("Blue")
|
||||||
@@ -5419,18 +5442,11 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
&& (!checkSBA || exception == null || !source.isValid(exception, getController(), this, null))) {
|
&& (!checkSBA || exception == null || !source.isValid(exception, getController(), this, null))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (kw.equals("Protection from colored spells")) {
|
} else if (kw.equals("Protection from colored spells")) {
|
||||||
if (source.isSpell() && !source.isColorless()) {
|
if (source.isSpell() && !source.isColorless()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else if (kw.equals("Protection from the chosen player")) {
|
|
||||||
if (source.getController().equals(chosenPlayer)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} else if (kw.equals("Protection from each converted mana cost other than the chosen number")) {
|
|
||||||
if (source.getCMC() != chosenNumber) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} else if (kw.startsWith("Protection from opponent of ")) {
|
} else if (kw.startsWith("Protection from opponent of ")) {
|
||||||
final String playerName = kw.substring("Protection from opponent of ".length());
|
final String playerName = kw.substring("Protection from opponent of ".length());
|
||||||
if (source.getController().isOpponentOf(playerName)) {
|
if (source.getController().isOpponentOf(playerName)) {
|
||||||
|
|||||||
@@ -677,7 +677,8 @@ public class CardFactoryUtil {
|
|||||||
if (l[0].startsWith("Number$")) {
|
if (l[0].startsWith("Number$")) {
|
||||||
final String number = l[0].substring(7);
|
final String number = l[0].substring(7);
|
||||||
if (number.equals("ChosenNumber")) {
|
if (number.equals("ChosenNumber")) {
|
||||||
return doXMath(c.getChosenNumber(), m, c);
|
int x = c.getChosenNumber() == null ? 0 : c.getChosenNumber();
|
||||||
|
return doXMath(x, m, c);
|
||||||
}
|
}
|
||||||
return doXMath(Integer.parseInt(number), m, c);
|
return doXMath(Integer.parseInt(number), m, c);
|
||||||
}
|
}
|
||||||
@@ -1980,35 +1981,37 @@ public class CardFactoryUtil {
|
|||||||
final List<String> filteredkw = Lists.newArrayList();
|
final List<String> filteredkw = Lists.newArrayList();
|
||||||
final Player p = host.getController();
|
final Player p = host.getController();
|
||||||
CardCollectionView cardlist = p.getGame().getCardsIn(zones);
|
CardCollectionView cardlist = p.getGame().getCardsIn(zones);
|
||||||
final List<String> landkw = Lists.newArrayList();
|
final Set<String> landkw = Sets.newHashSet();
|
||||||
final List<String> protectionkw = Lists.newArrayList();
|
final Set<String> protectionkw = Sets.newHashSet();
|
||||||
final List<String> hexproofkw = Lists.newArrayList();
|
final Set<String> protectionColorkw = Sets.newHashSet();
|
||||||
final List<String> allkw = Lists.newArrayList();
|
final Set<String> hexproofkw = Sets.newHashSet();
|
||||||
|
final Set<String> allkw = Sets.newHashSet();
|
||||||
|
|
||||||
|
|
||||||
for (Card c : CardLists.getValidCards(cardlist, restrictions, p, host, null)) {
|
for (Card c : CardLists.getValidCards(cardlist, restrictions, p, host, null)) {
|
||||||
for (KeywordInterface inst : c.getKeywords()) {
|
for (KeywordInterface inst : c.getKeywords()) {
|
||||||
final String k = inst.getOriginal();
|
final String k = inst.getOriginal();
|
||||||
if (k.endsWith("walk")) {
|
if (k.endsWith("walk")) {
|
||||||
if (!landkw.contains(k)) {
|
|
||||||
landkw.add(k);
|
landkw.add(k);
|
||||||
}
|
|
||||||
} else if (k.startsWith("Protection")) {
|
} else if (k.startsWith("Protection")) {
|
||||||
if (!protectionkw.contains(k)) {
|
|
||||||
protectionkw.add(k);
|
protectionkw.add(k);
|
||||||
|
for(byte col : MagicColor.WUBRG) {
|
||||||
|
final String colString = "Protection from " + MagicColor.toLongString(col).toLowerCase();
|
||||||
|
if (k.contains(colString)) {
|
||||||
|
protectionColorkw.add(colString);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (k.startsWith("Hexproof")) {
|
} else if (k.startsWith("Hexproof")) {
|
||||||
if (!hexproofkw.contains(k)) {
|
|
||||||
hexproofkw.add(k);
|
hexproofkw.add(k);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!allkw.contains(k)) {
|
|
||||||
allkw.add(k);
|
allkw.add(k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
for (String keyword : kw) {
|
for (String keyword : kw) {
|
||||||
if (keyword.equals("Protection")) {
|
if (keyword.equals("Protection")) {
|
||||||
filteredkw.addAll(protectionkw);
|
filteredkw.addAll(protectionkw);
|
||||||
|
} else if (keyword.equals("ProtectionColor")) {
|
||||||
|
filteredkw.addAll(protectionColorkw);
|
||||||
} else if (keyword.equals("Landwalk")) {
|
} else if (keyword.equals("Landwalk")) {
|
||||||
filteredkw.addAll(landkw);
|
filteredkw.addAll(landkw);
|
||||||
} else if (keyword.equals("Hexproof")) {
|
} else if (keyword.equals("Hexproof")) {
|
||||||
|
|||||||
@@ -319,6 +319,14 @@ public final class CardUtil {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ColorSet getColorsYouCtrl(final Player p) {
|
||||||
|
byte b = 0;
|
||||||
|
for (Card c : p.getCardsIn(ZoneType.Battlefield)) {
|
||||||
|
b |= c.determineColor().getColor();
|
||||||
|
}
|
||||||
|
return ColorSet.fromMask(b);
|
||||||
|
}
|
||||||
|
|
||||||
public static CardState getFaceDownCharacteristic(Card c) {
|
public static CardState getFaceDownCharacteristic(Card c) {
|
||||||
final CardType type = new CardType();
|
final CardType type = new CardType();
|
||||||
type.add("Creature");
|
type.add("Creature");
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package forge.game.card;
|
|||||||
|
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
import forge.ImageKeys;
|
import forge.ImageKeys;
|
||||||
import forge.card.*;
|
import forge.card.*;
|
||||||
import forge.card.mana.ManaCost;
|
import forge.card.mana.ManaCost;
|
||||||
@@ -26,6 +28,7 @@ import java.util.EnumSet;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public class CardView extends GameEntityView {
|
public class CardView extends GameEntityView {
|
||||||
private static final long serialVersionUID = -3624090829028979255L;
|
private static final long serialVersionUID = -3624090829028979255L;
|
||||||
@@ -422,6 +425,8 @@ public class CardView extends GameEntityView {
|
|||||||
case SchemeDeck:
|
case SchemeDeck:
|
||||||
// true for now, to actually see the Scheme cards (can't see deck anyway)
|
// true for now, to actually see the Scheme cards (can't see deck anyway)
|
||||||
return true;
|
return true;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// special viewing permissions for viewer
|
// special viewing permissions for viewer
|
||||||
@@ -649,6 +654,17 @@ public class CardView extends GameEntityView {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Set<String> cantHaveKeyword = this.getCantHaveKeyword();
|
||||||
|
if (cantHaveKeyword != null && !cantHaveKeyword.isEmpty()) {
|
||||||
|
sb.append("\r\n\r\n");
|
||||||
|
for(String k : cantHaveKeyword) {
|
||||||
|
sb.append("CARDNAME can't have or gain ".replaceAll("CARDNAME", getName()));
|
||||||
|
sb.append(k);
|
||||||
|
sb.append(".");
|
||||||
|
sb.append("\r\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String cloner = get(TrackableProperty.Cloner);
|
String cloner = get(TrackableProperty.Cloner);
|
||||||
if (!cloner.isEmpty()) {
|
if (!cloner.isEmpty()) {
|
||||||
sb.append("\r\nCloned by: ").append(cloner);
|
sb.append("\r\nCloned by: ").append(cloner);
|
||||||
@@ -768,6 +784,18 @@ public class CardView extends GameEntityView {
|
|||||||
set(TrackableProperty.BlockAny, c.canBlockAny());
|
set(TrackableProperty.BlockAny, c.canBlockAny());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Set<String> getCantHaveKeyword() {
|
||||||
|
return get(TrackableProperty.CantHaveKeyword);
|
||||||
|
}
|
||||||
|
|
||||||
|
void updateCantHaveKeyword(Card c) {
|
||||||
|
Set<String> keywords = Sets.newTreeSet();
|
||||||
|
for (Keyword k : c.getCantHaveKeyword()) {
|
||||||
|
keywords.add(k.toString());
|
||||||
|
}
|
||||||
|
set(TrackableProperty.CantHaveKeyword, keywords);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
String name = getName();
|
String name = getName();
|
||||||
|
|||||||
@@ -287,4 +287,15 @@ public enum Keyword {
|
|||||||
|
|
||||||
return UNDEFINED;
|
return UNDEFINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Set<Keyword> setValueOf(String value) {
|
||||||
|
Set<Keyword> result = EnumSet.noneOf(Keyword.class);
|
||||||
|
for (String s : value.split(" & ")) {
|
||||||
|
Keyword k = smartValueOf(s);
|
||||||
|
if (!UNDEFINED.equals(k)) {
|
||||||
|
result.add(k);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,6 +102,10 @@ public class KeywordCollection implements Iterable<String>, Serializable {
|
|||||||
return map.remove(keyword.getKeyword(), keyword);
|
return map.remove(keyword.getKeyword(), keyword);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean removeAll(Keyword kenum) {
|
||||||
|
return !map.removeAll(kenum).isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean removeAll(Iterable<String> keywords) {
|
public boolean removeAll(Iterable<String> keywords) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
for (String k : keywords) {
|
for (String k : keywords) {
|
||||||
@@ -164,7 +168,6 @@ public class KeywordCollection implements Iterable<String>, Serializable {
|
|||||||
return new Iterator<String>() {
|
return new Iterator<String>() {
|
||||||
private final Iterator<KeywordInterface> iterator = map.values().iterator();
|
private final Iterator<KeywordInterface> iterator = map.values().iterator();
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasNext() {
|
public boolean hasNext() {
|
||||||
return iterator.hasNext();
|
return iterator.hasNext();
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ public class PlayerProperty {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (property.startsWith("PlayerUID_")) {
|
||||||
|
if (player.getId() != Integer.parseInt(property.split("PlayerUID_")[1])) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else if (property.equals("YourTeam")) {
|
} else if (property.equals("YourTeam")) {
|
||||||
if (!player.sameTeam(sourceController)) {
|
if (!player.sameTeam(sourceController)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -165,7 +165,8 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
|
|||||||
if (hasParam("AddKeyword") || hasParam("AddAbility")
|
if (hasParam("AddKeyword") || hasParam("AddAbility")
|
||||||
|| hasParam("AddTrigger") || hasParam("RemoveTriggers")
|
|| hasParam("AddTrigger") || hasParam("RemoveTriggers")
|
||||||
|| hasParam("RemoveKeyword") || hasParam("AddReplacementEffects")
|
|| hasParam("RemoveKeyword") || hasParam("AddReplacementEffects")
|
||||||
|| hasParam("AddStaticAbility") || hasParam("AddSVar")) {
|
|| hasParam("AddStaticAbility") || hasParam("AddSVar")
|
||||||
|
|| hasParam("CantHaveKeyword")) {
|
||||||
layers.add(StaticAbilityLayer.ABILITIES);
|
layers.add(StaticAbilityLayer.ABILITIES);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,10 +182,6 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (hasParam("AddHiddenKeyword")) {
|
if (hasParam("AddHiddenKeyword")) {
|
||||||
// special rule for can't have or gain
|
|
||||||
if (getParam("AddHiddenKeyword").contains("can't have or gain")) {
|
|
||||||
layers.add(StaticAbilityLayer.ABILITIES);
|
|
||||||
}
|
|
||||||
layers.add(StaticAbilityLayer.RULES);
|
layers.add(StaticAbilityLayer.RULES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,11 +17,13 @@
|
|||||||
*/
|
*/
|
||||||
package forge.game.staticability;
|
package forge.game.staticability;
|
||||||
|
|
||||||
|
import com.google.common.base.Function;
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import forge.GameCommand;
|
import forge.GameCommand;
|
||||||
|
import forge.card.ColorSet;
|
||||||
import forge.card.CardType;
|
import forge.card.CardType;
|
||||||
import forge.card.MagicColor;
|
import forge.card.MagicColor;
|
||||||
import forge.game.Game;
|
import forge.game.Game;
|
||||||
@@ -33,6 +35,7 @@ import forge.game.ability.AbilityUtils;
|
|||||||
import forge.game.ability.ApiType;
|
import forge.game.ability.ApiType;
|
||||||
import forge.game.card.*;
|
import forge.game.card.*;
|
||||||
import forge.game.cost.Cost;
|
import forge.game.cost.Cost;
|
||||||
|
import forge.game.keyword.Keyword;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.replacement.ReplacementEffect;
|
import forge.game.replacement.ReplacementEffect;
|
||||||
import forge.game.replacement.ReplacementHandler;
|
import forge.game.replacement.ReplacementHandler;
|
||||||
@@ -113,9 +116,9 @@ public final class StaticAbilityContinuous {
|
|||||||
String setT = "";
|
String setT = "";
|
||||||
int setToughness = Integer.MAX_VALUE;
|
int setToughness = Integer.MAX_VALUE;
|
||||||
|
|
||||||
String[] addKeywords = null;
|
List<String> addKeywords = null;
|
||||||
List<String> addHiddenKeywords = Lists.newArrayList();
|
List<String> addHiddenKeywords = Lists.newArrayList();
|
||||||
String[] removeKeywords = null;
|
List<String> removeKeywords = null;
|
||||||
String[] addAbilities = null;
|
String[] addAbilities = null;
|
||||||
String[] addReplacements = null;
|
String[] addReplacements = null;
|
||||||
String[] addSVars = null;
|
String[] addSVars = null;
|
||||||
@@ -137,6 +140,8 @@ public final class StaticAbilityContinuous {
|
|||||||
|
|
||||||
boolean overwriteColors = false;
|
boolean overwriteColors = false;
|
||||||
|
|
||||||
|
Set<Keyword> cantHaveKeyword = null;
|
||||||
|
|
||||||
List<Player> mayLookAt = null;
|
List<Player> mayLookAt = null;
|
||||||
List<Player> withFlash = null;
|
List<Player> withFlash = null;
|
||||||
|
|
||||||
@@ -189,50 +194,96 @@ public final class StaticAbilityContinuous {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (layer == StaticAbilityLayer.ABILITIES && params.containsKey("AddKeyword")) {
|
if (layer == StaticAbilityLayer.ABILITIES && params.containsKey("AddKeyword")) {
|
||||||
addKeywords = params.get("AddKeyword").split(" & ");
|
addKeywords = Lists.newArrayList(Arrays.asList(params.get("AddKeyword").split(" & ")));
|
||||||
final Iterable<String> chosencolors = hostCard.getChosenColors();
|
final List<String> newKeywords = Lists.newArrayList();
|
||||||
for (final String color : chosencolors) {
|
|
||||||
for (int w = 0; w < addKeywords.length; w++) {
|
// update keywords with Chosen parts
|
||||||
addKeywords[w] = addKeywords[w].replaceAll("ChosenColor", StringUtils.capitalize(color));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
final String chosenType = hostCard.getChosenType();
|
|
||||||
for (int w = 0; w < addKeywords.length; w++) {
|
|
||||||
addKeywords[w] = addKeywords[w].replaceAll("ChosenType", chosenType);
|
|
||||||
}
|
|
||||||
final String chosenName = hostCard.getNamedCard().replace(",", ";");
|
|
||||||
final String hostCardUID = Integer.toString(hostCard.getId()); // Protection with "doesn't remove" effect
|
final String hostCardUID = Integer.toString(hostCard.getId()); // Protection with "doesn't remove" effect
|
||||||
final String hostCardPower = Integer.toString(hostCard.getNetPower());
|
|
||||||
for (int w = 0; w < addKeywords.length; w++) {
|
final ColorSet colorsYouCtrl = CardUtil.getColorsYouCtrl(controller);
|
||||||
if (addKeywords[w].startsWith("Protection:")) {
|
|
||||||
String k = addKeywords[w];
|
Iterables.removeIf(addKeywords, new Predicate<String>() {
|
||||||
k = k.replaceAll("ChosenName", "Card.named" + chosenName);
|
@Override
|
||||||
k = k.replace("HostCardUID", hostCardUID);
|
public boolean apply(String input) {
|
||||||
addKeywords[w] = k;
|
if (!hostCard.hasChosenColor() && input.contains("ChosenColor")) {
|
||||||
} else if (addKeywords[w].startsWith("CantBeBlockedBy")) {
|
return true;
|
||||||
String k = addKeywords[w];
|
|
||||||
k = k.replaceAll("HostCardPower", hostCardPower);
|
|
||||||
addKeywords[w] = k;
|
|
||||||
}
|
}
|
||||||
|
if (!hostCard.hasChosenType() && input.contains("ChosenType")) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
if (!hostCard.hasChosenNumber() && input.contains("ChosenNumber")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!hostCard.hasChosenPlayer() && input.contains("ChosenPlayer")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!hostCard.hasChosenName() && input.contains("ChosenName")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// two variants for Red vs. red in keyword
|
||||||
|
if (input.contains("ColorsYouCtrl") || input.contains("colorsYouCtrl")) {
|
||||||
|
for (byte color : colorsYouCtrl) {
|
||||||
|
final String colorWord = MagicColor.toLongString(color);
|
||||||
|
String y = input.replaceAll("ColorsYouCtrl", StringUtils.capitalize(colorWord));
|
||||||
|
y = y.replaceAll("colorsYouCtrl", colorWord);
|
||||||
|
newKeywords.add(y);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
addKeywords.addAll(newKeywords);
|
||||||
|
|
||||||
|
addKeywords = Lists.transform(addKeywords, new Function<String, String>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apply(String input) {
|
||||||
|
if (hostCard.hasChosenColor()) {
|
||||||
|
input = input.replaceAll("ChosenColor", StringUtils.capitalize(hostCard.getChosenColor()));
|
||||||
|
}
|
||||||
|
if (hostCard.hasChosenType()) {
|
||||||
|
input = input.replaceAll("ChosenType", hostCard.getChosenType());
|
||||||
|
}
|
||||||
|
if (hostCard.hasChosenNumber()) {
|
||||||
|
input = input.replaceAll("ChosenNumber", String.valueOf(hostCard.getChosenNumber()));
|
||||||
|
}
|
||||||
|
if (hostCard.hasChosenPlayer()) {
|
||||||
|
Player cp = hostCard.getChosenPlayer();
|
||||||
|
input = input.replaceAll("ChosenPlayerUID", String.valueOf(cp.getId()));
|
||||||
|
input = input.replaceAll("ChosenPlayerName", cp.getName());
|
||||||
|
}
|
||||||
|
if (hostCard.hasChosenName()) {
|
||||||
|
final String chosenName = hostCard.getChosenName().replace(",", ";");
|
||||||
|
input = input.replaceAll("ChosenName", "Card.named" + chosenName);
|
||||||
|
}
|
||||||
|
input = input.replace("HostCardUID", hostCardUID);
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
if (params.containsKey("SharedKeywordsZone")) {
|
if (params.containsKey("SharedKeywordsZone")) {
|
||||||
List<ZoneType> zones = ZoneType.listValueOf(params.get("SharedKeywordsZone"));
|
List<ZoneType> zones = ZoneType.listValueOf(params.get("SharedKeywordsZone"));
|
||||||
String[] restrictions = params.containsKey("SharedRestrictions") ? params.get("SharedRestrictions").split(",") : new String[] {"Card"};
|
String[] restrictions = params.containsKey("SharedRestrictions") ? params.get("SharedRestrictions").split(",") : new String[] {"Card"};
|
||||||
List<String> kw = CardFactoryUtil.sharedKeywords(Arrays.asList(addKeywords), restrictions, zones, hostCard);
|
addKeywords = CardFactoryUtil.sharedKeywords(addKeywords, restrictions, zones, hostCard);
|
||||||
addKeywords = kw.toArray(new String[kw.size()]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((layer == StaticAbilityLayer.RULES || layer == StaticAbilityLayer.ABILITIES) && params.containsKey("AddHiddenKeyword")) {
|
if (layer == StaticAbilityLayer.ABILITIES && params.containsKey("CantHaveKeyword")) {
|
||||||
// can't have or gain, need to be applyed in ABILITIES1
|
cantHaveKeyword = Keyword.setValueOf(params.get("CantHaveKeyword"));
|
||||||
for (String k : params.get("AddHiddenKeyword").split(" & ")) {
|
|
||||||
if ( (k.contains("can't have or gain")) == (layer == StaticAbilityLayer.ABILITIES))
|
|
||||||
addHiddenKeywords.add(k);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((layer == StaticAbilityLayer.RULES) && params.containsKey("AddHiddenKeyword")) {
|
||||||
|
addHiddenKeywords.addAll(Arrays.asList(params.get("AddHiddenKeyword").split(" & ")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (layer == StaticAbilityLayer.ABILITIES && params.containsKey("RemoveKeyword")) {
|
if (layer == StaticAbilityLayer.ABILITIES && params.containsKey("RemoveKeyword")) {
|
||||||
removeKeywords = params.get("RemoveKeyword").split(" & ");
|
removeKeywords = Arrays.asList(params.get("RemoveKeyword").split(" & "));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (layer == StaticAbilityLayer.ABILITIES && params.containsKey("RemoveAllAbilities")) {
|
if (layer == StaticAbilityLayer.ABILITIES && params.containsKey("RemoveAllAbilities")) {
|
||||||
@@ -419,7 +470,7 @@ public final class StaticAbilityContinuous {
|
|||||||
|
|
||||||
// add keywords
|
// add keywords
|
||||||
if (addKeywords != null) {
|
if (addKeywords != null) {
|
||||||
p.addChangedKeywords(addKeywords, removeKeywords == null ? new String[0] : removeKeywords, se.getTimestamp());
|
p.addChangedKeywords(addKeywords, removeKeywords, se.getTimestamp());
|
||||||
}
|
}
|
||||||
|
|
||||||
// add static abilities
|
// add static abilities
|
||||||
@@ -530,21 +581,44 @@ public final class StaticAbilityContinuous {
|
|||||||
// TODO regular keywords currently don't try to use keyword multiplier
|
// TODO regular keywords currently don't try to use keyword multiplier
|
||||||
// (Although nothing uses it at this time)
|
// (Although nothing uses it at this time)
|
||||||
if ((addKeywords != null) || (removeKeywords != null) || removeAllAbilities || removeIntrinsicAbilities) {
|
if ((addKeywords != null) || (removeKeywords != null) || removeAllAbilities || removeIntrinsicAbilities) {
|
||||||
String[] newKeywords = null;
|
List<String> newKeywords = null;
|
||||||
if (addKeywords != null) {
|
if (addKeywords != null) {
|
||||||
newKeywords = Arrays.copyOf(addKeywords, addKeywords.length);
|
newKeywords = Lists.newArrayList(addKeywords);
|
||||||
for (int j = 0; j < newKeywords.length; ++j) {
|
final List<String> extraKeywords = Lists.newArrayList();
|
||||||
if (newKeywords[j].contains("CardManaCost")) {
|
|
||||||
|
Iterables.removeIf(newKeywords, new Predicate<String>() {
|
||||||
|
@Override
|
||||||
|
public boolean apply(String input) {
|
||||||
|
if (input.contains("CardManaCost")) {
|
||||||
if (affectedCard.getManaCost().isNoCost()) {
|
if (affectedCard.getManaCost().isNoCost()) {
|
||||||
newKeywords[j] = ""; // prevent a crash (varolz the scar-striped + dryad arbor)
|
return true;
|
||||||
} else {
|
|
||||||
newKeywords[j] = newKeywords[j].replace("CardManaCost", affectedCard.getManaCost().getShortString());
|
|
||||||
}
|
}
|
||||||
} else if (newKeywords[j].contains("ConvertedManaCost")) {
|
}
|
||||||
|
// replace one Keyword with list of keywords
|
||||||
|
if (input.startsWith("Protection") && input.contains("CardColors")) {
|
||||||
|
for (Byte color : affectedCard.determineColor()) {
|
||||||
|
extraKeywords.add(input.replace("CardColors", MagicColor.toLongString(color)));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
newKeywords.addAll(extraKeywords);
|
||||||
|
|
||||||
|
newKeywords = Lists.transform(newKeywords, new Function<String, String>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String apply(String input) {
|
||||||
|
if (input.contains("CardManaCost")) {
|
||||||
|
input = input.replace("CardManaCost", affectedCard.getManaCost().getShortString());
|
||||||
|
} else if (input.contains("ConvertedManaCost")) {
|
||||||
final String costcmc = Integer.toString(affectedCard.getCMC());
|
final String costcmc = Integer.toString(affectedCard.getCMC());
|
||||||
newKeywords[j] = newKeywords[j].replace("ConvertedManaCost", costcmc);
|
input = input.replace("ConvertedManaCost", costcmc);
|
||||||
}
|
}
|
||||||
|
return input;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
affectedCard.addChangedCardKeywords(newKeywords, removeKeywords,
|
affectedCard.addChangedCardKeywords(newKeywords, removeKeywords,
|
||||||
@@ -682,6 +756,10 @@ public final class StaticAbilityContinuous {
|
|||||||
|| removeAllAbilities) {
|
|| removeAllAbilities) {
|
||||||
affectedCard.addChangedCardTraits(addedAbilities, null, addedTrigger, addedReplacementEffects, addedStaticAbility, removeAllAbilities, removeNonMana, false, hostCard.getTimestamp());
|
affectedCard.addChangedCardTraits(addedAbilities, null, addedTrigger, addedReplacementEffects, addedStaticAbility, removeAllAbilities, removeNonMana, false, hostCard.getTimestamp());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cantHaveKeyword != null) {
|
||||||
|
affectedCard.addCantHaveKeyword(hostCard.getTimestamp(), cantHaveKeyword);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (layer == StaticAbilityLayer.TYPE && removeIntrinsicAbilities) {
|
if (layer == StaticAbilityLayer.TYPE && removeIntrinsicAbilities) {
|
||||||
|
|||||||
@@ -117,6 +117,8 @@ public enum TrackableProperty {
|
|||||||
NonAbilityText(TrackableTypes.StringType),
|
NonAbilityText(TrackableTypes.StringType),
|
||||||
FoilIndex(TrackableTypes.IntegerType),
|
FoilIndex(TrackableTypes.IntegerType),
|
||||||
|
|
||||||
|
CantHaveKeyword(TrackableTypes.StringListType),
|
||||||
|
|
||||||
//Player
|
//Player
|
||||||
IsAI(TrackableTypes.BooleanType),
|
IsAI(TrackableTypes.BooleanType),
|
||||||
LobbyPlayerName(TrackableTypes.StringType),
|
LobbyPlayerName(TrackableTypes.StringType),
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ Name:Arcane Lighthouse
|
|||||||
ManaCost:no cost
|
ManaCost:no cost
|
||||||
Types:Land
|
Types:Land
|
||||||
A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C}.
|
A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C}.
|
||||||
A:AB$ AnimateAll | Cost$ 1 T | ValidCards$ Creature.OppCtrl | RemoveKeywords$ Hexproof & Shroud | HiddenKeywords$ CARDNAME can't have or gain Hexproof & CARDNAME can't have or gain Shroud | SpellDescription$ Until end of turn, creatures your opponents control lose hexproof and shroud and can't have hexproof or shroud.
|
A:AB$ AnimateAll | Cost$ 1 T | ValidCards$ Creature.OppCtrl | RemoveKeywords$ Hexproof & Shroud | CantHaveKeyword$ Hexproof & Shroud | StackDescription$ SpellDescription | SpellDescription$ Until end of turn, creatures your opponents control lose hexproof and shroud and can't have hexproof or shroud.
|
||||||
AI:RemoveDeck:All
|
AI:RemoveDeck:All
|
||||||
Oracle:{T}: Add {C}.\n{1}, {T}: Until end of turn, creatures your opponents control lose hexproof and shroud and can't have hexproof or shroud.
|
Oracle:{T}: Add {C}.\n{1}, {T}: Until end of turn, creatures your opponents control lose hexproof and shroud and can't have hexproof or shroud.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ ManaCost:1 R R
|
|||||||
Types:Enchantment Creature Human Warrior
|
Types:Enchantment Creature Human Warrior
|
||||||
PT:3/2
|
PT:3/2
|
||||||
S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddKeyword$ Trample | Description$ Creatures you control have trample.
|
S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddKeyword$ Trample | Description$ Creatures you control have trample.
|
||||||
S:Mode$ Continuous | Affected$ Creature.OppCtrl | RemoveKeyword$ Trample | AddHiddenKeyword$ CARDNAME can't have or gain Trample | Description$ Creatures your opponents control lose trample and can't have or gain trample.
|
S:Mode$ Continuous | Affected$ Creature.OppCtrl | RemoveKeyword$ Trample | CantHaveKeyword$ Trample | Description$ Creatures your opponents control lose trample and can't have or gain trample.
|
||||||
SVar:PlayMain1:TRUE
|
SVar:PlayMain1:TRUE
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/archetype_of_aggression.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/archetype_of_aggression.jpg
|
||||||
Oracle:Creatures you control have trample.\nCreatures your opponents control lose trample and can't have or gain trample.
|
Oracle:Creatures you control have trample.\nCreatures your opponents control lose trample and can't have or gain trample.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ ManaCost:1 W W
|
|||||||
Types:Enchantment Creature Human Soldier
|
Types:Enchantment Creature Human Soldier
|
||||||
PT:2/2
|
PT:2/2
|
||||||
S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddKeyword$ First Strike | Description$ Creatures you control have first strike.
|
S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddKeyword$ First Strike | Description$ Creatures you control have first strike.
|
||||||
S:Mode$ Continuous | Affected$ Creature.OppCtrl | RemoveKeyword$ First Strike | AddHiddenKeyword$ CARDNAME can't have or gain First Strike | Description$ Creatures your opponents control lose first strike and can't have or gain first strike.
|
S:Mode$ Continuous | Affected$ Creature.OppCtrl | RemoveKeyword$ First Strike | CantHaveKeyword$ First Strike | Description$ Creatures your opponents control lose first strike and can't have or gain first strike.
|
||||||
SVar:PlayMain1:TRUE
|
SVar:PlayMain1:TRUE
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/archetype_of_courage.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/archetype_of_courage.jpg
|
||||||
Oracle:Creatures you control have first strike.\nCreatures your opponents control lose first strike and can't have or gain first strike.
|
Oracle:Creatures you control have first strike.\nCreatures your opponents control lose first strike and can't have or gain first strike.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ ManaCost:6 G G
|
|||||||
Types:Enchantment Creature Boar
|
Types:Enchantment Creature Boar
|
||||||
PT:6/5
|
PT:6/5
|
||||||
S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddKeyword$ Hexproof | Description$ Creatures you control have hexproof.
|
S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddKeyword$ Hexproof | Description$ Creatures you control have hexproof.
|
||||||
S:Mode$ Continuous | Affected$ Creature.OppCtrl | RemoveKeyword$ Hexproof | AddHiddenKeyword$ CARDNAME can't have or gain Hexproof | Description$ Creatures your opponents control lose hexproof and can't have or gain hexproof.
|
S:Mode$ Continuous | Affected$ Creature.OppCtrl | RemoveKeyword$ Hexproof | CantHaveKeyword$ Hexproof | Description$ Creatures your opponents control lose hexproof and can't have or gain hexproof.
|
||||||
SVar:PlayMain1:TRUE
|
SVar:PlayMain1:TRUE
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/archetype_of_endurance.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/archetype_of_endurance.jpg
|
||||||
Oracle:Creatures you control have hexproof.\nCreatures your opponents control lose hexproof and can't have or gain hexproof.
|
Oracle:Creatures you control have hexproof.\nCreatures your opponents control lose hexproof and can't have or gain hexproof.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ ManaCost:4 B B
|
|||||||
Types:Enchantment Creature Gorgon
|
Types:Enchantment Creature Gorgon
|
||||||
PT:2/3
|
PT:2/3
|
||||||
S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddKeyword$ Deathtouch | Description$ Creatures you control have deathtouch.
|
S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddKeyword$ Deathtouch | Description$ Creatures you control have deathtouch.
|
||||||
S:Mode$ Continuous | Affected$ Creature.OppCtrl | RemoveKeyword$ Deathtouch | AddHiddenKeyword$ CARDNAME can't have or gain Deathtouch | Description$ Creatures your opponents control lose deathtouch and can't have or gain deathtouch.
|
S:Mode$ Continuous | Affected$ Creature.OppCtrl | RemoveKeyword$ Deathtouch | CantHaveKeyword$ Deathtouch | Description$ Creatures your opponents control lose deathtouch and can't have or gain deathtouch.
|
||||||
SVar:PlayMain1:TRUE
|
SVar:PlayMain1:TRUE
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/archetype_of_finality.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/archetype_of_finality.jpg
|
||||||
Oracle:Creatures you control have deathtouch.\nCreatures your opponents control lose deathtouch and can't have or gain deathtouch.
|
Oracle:Creatures you control have deathtouch.\nCreatures your opponents control lose deathtouch and can't have or gain deathtouch.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ ManaCost:4 U U
|
|||||||
Types:Enchantment Creature Human Wizard
|
Types:Enchantment Creature Human Wizard
|
||||||
PT:3/2
|
PT:3/2
|
||||||
S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddKeyword$ Flying | Description$ Creatures you control have flying.
|
S:Mode$ Continuous | Affected$ Creature.YouCtrl | AddKeyword$ Flying | Description$ Creatures you control have flying.
|
||||||
S:Mode$ Continuous | Affected$ Creature.OppCtrl | RemoveKeyword$ Flying | AddHiddenKeyword$ CARDNAME can't have or gain Flying | Description$ Creatures your opponents control lose flying and can't have or gain flying.
|
S:Mode$ Continuous | Affected$ Creature.OppCtrl | RemoveKeyword$ Flying | CantHaveKeyword$ Flying | Description$ Creatures your opponents control lose flying and can't have or gain flying.
|
||||||
SVar:PlayMain1:TRUE
|
SVar:PlayMain1:TRUE
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/archetype_of_imagination.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/archetype_of_imagination.jpg
|
||||||
Oracle:Creatures you control have flying.\nCreatures your opponents control lose flying and can't have or gain flying.
|
Oracle:Creatures you control have flying.\nCreatures your opponents control lose flying and can't have or gain flying.
|
||||||
|
|||||||
@@ -1,12 +1,7 @@
|
|||||||
Name:Earnest Fellowship
|
Name:Earnest Fellowship
|
||||||
ManaCost:1 W
|
ManaCost:1 W
|
||||||
Types:Enchantment
|
Types:Enchantment
|
||||||
Text:Each creature has protection from its colors.
|
S:Mode$ Continuous | Affected$ Creature | AddKeyword$ Protection from CardColors | Description$ Each creature has protection from its colors.
|
||||||
S:Mode$ Continuous | Affected$ Creature.White | AddKeyword$ Protection from white
|
|
||||||
S:Mode$ Continuous | Affected$ Creature.Blue | AddKeyword$ Protection from blue
|
|
||||||
S:Mode$ Continuous | Affected$ Creature.Black | AddKeyword$ Protection from black
|
|
||||||
S:Mode$ Continuous | Affected$ Creature.Red | AddKeyword$ Protection from red
|
|
||||||
S:Mode$ Continuous | Affected$ Creature.Green | AddKeyword$ Protection from green
|
|
||||||
SVar:NonStackingEffect:True
|
SVar:NonStackingEffect:True
|
||||||
SVar:PlayMain1:TRUE
|
SVar:PlayMain1:TRUE
|
||||||
AI:RemoveDeck:Random
|
AI:RemoveDeck:Random
|
||||||
|
|||||||
@@ -2,15 +2,6 @@ Name:Empty-Shrine Kannushi
|
|||||||
ManaCost:W
|
ManaCost:W
|
||||||
Types:Creature Human Cleric
|
Types:Creature Human Cleric
|
||||||
PT:1/1
|
PT:1/1
|
||||||
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Protection from white | CheckSVar$ WHITE | SVarCompare$ GE1 | Description$ CARDNAME has protection from the colors of permanents you control.
|
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Protection from colorsYouCtrl | Description$ CARDNAME has protection from the colors of permanents you control.
|
||||||
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Protection from blue | CheckSVar$ BLUE | SVarCompare$ GE1
|
|
||||||
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Protection from black | CheckSVar$ BLACK | SVarCompare$ GE1
|
|
||||||
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Protection from red | CheckSVar$ RED | SVarCompare$ GE1
|
|
||||||
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Protection from green | CheckSVar$ GREEN | SVarCompare$ GE1
|
|
||||||
SVar:WHITE:Count$Valid Permanent.White+YouCtrl
|
|
||||||
SVar:BLUE:Count$Valid Permanent.Blue+YouCtrl
|
|
||||||
SVar:BLACK:Count$Valid Permanent.Black+YouCtrl
|
|
||||||
SVar:RED:Count$Valid Permanent.Red+YouCtrl
|
|
||||||
SVar:GREEN:Count$Valid Permanent.Green+YouCtrl
|
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/empty_shrine_kannushi.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/empty_shrine_kannushi.jpg
|
||||||
Oracle:Empty-Shrine Kannushi has protection from the colors of permanents you control.
|
Oracle:Empty-Shrine Kannushi has protection from the colors of permanents you control.
|
||||||
|
|||||||
@@ -2,21 +2,5 @@ Name:Escaped Shapeshifter
|
|||||||
ManaCost:3 U U
|
ManaCost:3 U U
|
||||||
Types:Creature Shapeshifter
|
Types:Creature Shapeshifter
|
||||||
PT:3/4
|
PT:3/4
|
||||||
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Flying | CheckSVar$ FLYING | SVarCompare$ GE1 | Description$ As long as an opponent controls a creature with flying not named CARDNAME, CARDNAME has flying. The same is true for first strike, trample, and protection from any color.
|
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Flying & First Strike & Trample & ProtectionColor | SharedKeywordsZone$ Battlefield | SharedRestrictions$ Creature.notnamed Escaped Shapeshifter+OppCtrl | Description$ As long as an opponent controls a creature with flying not named Escaped Shapeshifter, CARDNAME has flying. The same is true for first strike, trample, and protection from any color.
|
||||||
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ First Strike | CheckSVar$ FIRSTSTRIKE | SVarCompare$ GE1
|
|
||||||
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Trample | CheckSVar$ TRAMPLE | SVarCompare$ GE1
|
|
||||||
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Protection from white | CheckSVar$ WHITE | SVarCompare$ GE1
|
|
||||||
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Protection from blue | CheckSVar$ BLUE | SVarCompare$ GE1
|
|
||||||
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Protection from black | CheckSVar$ BLACK | SVarCompare$ GE1
|
|
||||||
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Protection from red | CheckSVar$ RED | SVarCompare$ GE1
|
|
||||||
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Protection from green | CheckSVar$ GREEN | SVarCompare$ GE1
|
|
||||||
SVar:FLYING:Count$Valid Creature.withFlying+notnamed Escaped Shapeshifter+OppCtrl
|
|
||||||
SVar:FIRSTSTRIKE:Count$Valid Creature.withFirst Strike+notnamed Escaped Shapeshifter+OppCtrl
|
|
||||||
SVar:TRAMPLE:Count$Valid Creature.withTrample+notnamed Escaped Shapeshifter+OppCtrl
|
|
||||||
SVar:WHITE:Count$Valid Creature.withProtection from white+notnamed Escaped Shapeshifter+OppCtrl
|
|
||||||
SVar:BLUE:Count$Valid Creature.withProtection from blue+notnamed Escaped Shapeshifter+OppCtrl
|
|
||||||
SVar:BLACK:Count$Valid Creature.withProtection from black+notnamed Escaped Shapeshifter+OppCtrl
|
|
||||||
SVar:RED:Count$Valid Creature.withProtection from red+notnamed Escaped Shapeshifter+OppCtrl
|
|
||||||
SVar:GREEN:Count$Valid Creature.withProtection from green+notnamed Escaped Shapeshifter+OppCtrl
|
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/escaped_shapeshifter.jpg
|
|
||||||
Oracle:As long as an opponent controls a creature with flying not named Escaped Shapeshifter, Escaped Shapeshifter has flying. The same is true for first strike, trample, and protection from any color.
|
Oracle:As long as an opponent controls a creature with flying not named Escaped Shapeshifter, Escaped Shapeshifter has flying. The same is true for first strike, trample, and protection from any color.
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ Types:Legendary Creature Human Warrior
|
|||||||
PT:6/1
|
PT:6/1
|
||||||
K:CARDNAME attacks each combat if able.
|
K:CARDNAME attacks each combat if able.
|
||||||
K:ETBReplacement:Other:ChooseNum
|
K:ETBReplacement:Other:ChooseNum
|
||||||
SVar:ChooseNum:DB$ ChooseNumber | Min$ 2 | Max$ 4 | Defined$ You | Random$ True
|
SVar:ChooseNum:DB$ ChooseNumber | Min$ 2 | Max$ 4 | Defined$ You | Random$ True | SpellDescription$ As Haktos enters the battlefield, choose 2, 3, or 4 at random.
|
||||||
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Protection from each converted mana cost other than the chosen number | Description$ CARDNAME has protection from each converted mana cost other than the chosen number.
|
S:Mode$ Continuous | Affected$ Card.Self | AddKeyword$ Protection:Card.cmcNEChosenNumber:Protection from each converted mana cost other than ChosenNumber | Description$ CARDNAME has protection from each converted mana cost other than the chosen number.
|
||||||
Oracle:Haktos the Unscarred attacks each combat if able.\nAs Haktos enters the battlefield, choose 2, 3, or 4 at random.\nHaktos has protection from each converted mana cost other than the chosen number.
|
Oracle:Haktos the Unscarred attacks each combat if able.\nAs Haktos enters the battlefield, choose 2, 3, or 4 at random.\nHaktos has protection from each converted mana cost other than the chosen number.
|
||||||
|
|||||||
@@ -3,15 +3,6 @@ ManaCost:1 W
|
|||||||
Types:Enchantment Aura
|
Types:Enchantment Aura
|
||||||
K:Enchant creature
|
K:Enchant creature
|
||||||
A:SP$ Attach | Cost$ 1 W | ValidTgts$ Creature | AILogic$ Pump
|
A:SP$ Attach | Cost$ 1 W | ValidTgts$ Creature | AILogic$ Pump
|
||||||
S:Mode$ Continuous | Affected$ Card.EnchantedBy | AddKeyword$ Protection:Card.White:Protection from white:Card.CardUID_HostCardUID | CheckSVar$ WHITE | SVarCompare$ GE1 | Description$ Enchanted creature has protection from the colors of permanents you control. This effect doesn't remove CARDNAME.
|
S:Mode$ Continuous | Affected$ Card.EnchantedBy | AddKeyword$ Protection:Card.ColorsYouCtrl:Protection from colorsYouCtrl:Card.CardUID_HostCardUID | Description$ Enchanted creature has protection from the colors of permanents you control. This effect doesn't remove CARDNAME.
|
||||||
S:Mode$ Continuous | Affected$ Card.EnchantedBy | AddKeyword$ Protection:Card.Blue:Protection from blue:Card.CardUID_HostCardUID | CheckSVar$ BLUE | SVarCompare$ GE1
|
|
||||||
S:Mode$ Continuous | Affected$ Card.EnchantedBy | AddKeyword$ Protection:Card.Black:Protection from black:Card.CardUID_HostCardUID | CheckSVar$ BLACK | SVarCompare$ GE1
|
|
||||||
S:Mode$ Continuous | Affected$ Card.EnchantedBy | AddKeyword$ Protection:Card.Red:Protection from red:Card.CardUID_HostCardUID | CheckSVar$ RED | SVarCompare$ GE1
|
|
||||||
S:Mode$ Continuous | Affected$ Card.EnchantedBy | AddKeyword$ Protection:Card.Green:Protection from green:Card.CardUID_HostCardUID | CheckSVar$ GREEN | SVarCompare$ GE1
|
|
||||||
SVar:WHITE:Count$Valid Permanent.White+YouCtrl
|
|
||||||
SVar:BLUE:Count$Valid Permanent.Blue+YouCtrl
|
|
||||||
SVar:BLACK:Count$Valid Permanent.Black+YouCtrl
|
|
||||||
SVar:RED:Count$Valid Permanent.Red+YouCtrl
|
|
||||||
SVar:GREEN:Count$Valid Permanent.Green+YouCtrl
|
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/pledge_of_loyalty.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/pledge_of_loyalty.jpg
|
||||||
Oracle:Enchant creature\nEnchanted creature has protection from the colors of permanents you control. This effect doesn't remove Pledge of Loyalty.
|
Oracle:Enchant creature\nEnchanted creature has protection from the colors of permanents you control. This effect doesn't remove Pledge of Loyalty.
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ Types:Creature Merfolk Rogue
|
|||||||
PT:3/1
|
PT:3/1
|
||||||
K:ETBReplacement:Other:ChooseP
|
K:ETBReplacement:Other:ChooseP
|
||||||
SVar:ChooseP:DB$ ChoosePlayer | Defined$ You | Choices$ Player | AILogic$ Curse | SpellDescription$ As CARDNAME enters the battlefield, choose a player.
|
SVar:ChooseP:DB$ ChoosePlayer | Defined$ You | Choices$ Player | AILogic$ Curse | SpellDescription$ As CARDNAME enters the battlefield, choose a player.
|
||||||
S:Mode$ Continuous | AddKeyword$ Protection from the chosen player | Affected$ Card.Self | Description$ CARDNAME has protection from that player. (This creature can't be blocked, targeted, dealt damage, or enchanted by anything controlled by that player.)
|
S:Mode$ Continuous | AddKeyword$ Protection:Player.PlayerUID_ChosenPlayerUID:Protection from ChosenPlayerName | Affected$ Card.Self | Description$ CARDNAME has protection from that player. (This creature can't be blocked, targeted, dealt damage, or enchanted by anything controlled by that player.)
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/true_name_nemesis.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/true_name_nemesis.jpg
|
||||||
Oracle:As True-Name Nemesis enters the battlefield, choose a player.\nTrue-Name Nemesis has protection from the chosen player. (This creature can't be blocked, targeted, dealt damage, or enchanted by anything controlled by that player.)
|
Oracle:As True-Name Nemesis enters the battlefield, choose a player.\nTrue-Name Nemesis has protection from the chosen player. (This creature can't be blocked, targeted, dealt damage, or enchanted by anything controlled by that player.)
|
||||||
|
|||||||
Reference in New Issue
Block a user