mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Card: remove non hidden extrinsic keyword
This commit is contained in:
@@ -290,7 +290,6 @@ public class GameCopier {
|
||||
// TODO: Is this correct? Does it not duplicate keywords from enchantments and such?
|
||||
for (KeywordInterface kw : c.getHiddenExtrinsicKeywords())
|
||||
newCard.addHiddenExtrinsicKeyword(kw);
|
||||
newCard.setExtrinsicKeyword(Lists.newArrayList(c.getExtrinsicKeyword()));
|
||||
if (c.isTapped()) {
|
||||
newCard.setTapped(true);
|
||||
}
|
||||
|
||||
@@ -94,7 +94,6 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
|
||||
private final CardDamageHistory damageHistory = new CardDamageHistory();
|
||||
private Map<Card, Map<CounterType, Integer>> countersAddedBy = Maps.newTreeMap();
|
||||
private KeywordCollection extrinsicKeyword = new KeywordCollection();
|
||||
// Hidden keywords won't be displayed on the card
|
||||
private final KeywordCollection hiddenExtrinsicKeyword = new KeywordCollection();
|
||||
|
||||
@@ -3727,7 +3726,6 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
if (!removeIntrinsic) {
|
||||
keywords.insertAll(state.getIntrinsicKeywords());
|
||||
}
|
||||
keywords.insertAll(extrinsicKeyword.getValues());
|
||||
|
||||
// see if keyword changes are in effect
|
||||
for (final KeywordsChange ck : changedCardKeywords.values()) {
|
||||
@@ -3755,11 +3753,6 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (KeywordInterface kw : extrinsicKeyword.getValues()) {
|
||||
if (!visitor.visit(kw)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (KeywordInterface kw : getUnhiddenKeywords(state)) {
|
||||
if (!visitor.visit(kw)) {
|
||||
@@ -3927,55 +3920,6 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
}
|
||||
}
|
||||
|
||||
public Collection<KeywordInterface> getExtrinsicKeyword() {
|
||||
return extrinsicKeyword.getValues();
|
||||
}
|
||||
public final void setExtrinsicKeyword(final List<String> a) {
|
||||
extrinsicKeyword.clear();
|
||||
extrinsicKeyword.addAll(a);
|
||||
}
|
||||
public void setExtrinsicKeyword(Collection<KeywordInterface> extrinsicKeyword2) {
|
||||
extrinsicKeyword.clear();
|
||||
extrinsicKeyword.insertAll(extrinsicKeyword2);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void addExtrinsicKeyword(final String s) {
|
||||
if (s.startsWith("HIDDEN")) {
|
||||
addHiddenExtrinsicKeyword(s);
|
||||
}
|
||||
else {
|
||||
extrinsicKeyword.add(s);
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void removeExtrinsicKeyword(final String s) {
|
||||
if (s.startsWith("HIDDEN")) {
|
||||
removeHiddenExtrinsicKeyword(s);
|
||||
}
|
||||
else if (extrinsicKeyword.remove(s)) {
|
||||
currentState.getView().updateKeywords(this, currentState);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeAllExtrinsicKeyword(final String s) {
|
||||
final List<String> strings = Lists.newArrayList();
|
||||
strings.add(s);
|
||||
boolean needKeywordUpdate = false;
|
||||
if (extrinsicKeyword.removeAll(strings)) {
|
||||
needKeywordUpdate = true;
|
||||
}
|
||||
strings.add("HIDDEN " + s);
|
||||
if (hiddenExtrinsicKeyword.removeAll(strings)) {
|
||||
view.updateNonAbilityText(this);
|
||||
needKeywordUpdate = true;
|
||||
}
|
||||
if (needKeywordUpdate) {
|
||||
currentState.getView().updateKeywords(this, currentState);
|
||||
}
|
||||
}
|
||||
|
||||
// Hidden Keywords will be returned without the indicator HIDDEN
|
||||
public final List<KeywordInterface> getHiddenExtrinsicKeywords() {
|
||||
ListKeywordVisitor visitor = new ListKeywordVisitor();
|
||||
|
||||
@@ -255,7 +255,6 @@ public final class CardUtil {
|
||||
newCopy.setBaseToughness(in.getCurrentToughness() + in.getTempToughnessBoost() + in.getSemiPermanentToughnessBoost());
|
||||
|
||||
newCopy.setCounters(Maps.newEnumMap(in.getCounters()));
|
||||
newCopy.setExtrinsicKeyword(in.getExtrinsicKeyword());
|
||||
|
||||
newCopy.setColor(in.determineColor().getColor());
|
||||
newCopy.setReceivedDamageFromThisTurn(in.getReceivedDamageFromThisTurn());
|
||||
|
||||
@@ -209,11 +209,10 @@ public class Untap extends Phase {
|
||||
|
||||
// Remove temporary keywords
|
||||
for (final Card c : player.getCardsIn(ZoneType.Battlefield)) {
|
||||
c.removeAllExtrinsicKeyword("This card doesn't untap during your next untap step.");
|
||||
c.removeAllExtrinsicKeyword("HIDDEN This card doesn't untap during your next untap step.");
|
||||
c.removeHiddenExtrinsicKeyword("This card doesn't untap during your next untap step.");
|
||||
if (c.hasKeyword("This card doesn't untap during your next two untap steps.")) {
|
||||
c.removeAllExtrinsicKeyword("HIDDEN This card doesn't untap during your next two untap steps.");
|
||||
c.addHiddenExtrinsicKeyword("HIDDEN This card doesn't untap during your next untap step.");
|
||||
c.removeHiddenExtrinsicKeyword("This card doesn't untap during your next two untap steps.");
|
||||
c.addHiddenExtrinsicKeyword("This card doesn't untap during your next untap step.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user