mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Card: add addIntrinsicKeywords and fixed it in CardState
use it for CardFactory too
This commit is contained in:
@@ -3504,6 +3504,12 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final void addIntrinsicKeywords(final Iterable<String> s) {
|
||||||
|
if (currentState.addIntrinsicKeywords(s)) {
|
||||||
|
currentState.getView().updateKeywords(this, currentState);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public final void removeIntrinsicKeyword(final String s) {
|
public final void removeIntrinsicKeyword(final String s) {
|
||||||
if (currentState.removeIntrinsicKeyword(s)) {
|
if (currentState.removeIntrinsicKeyword(s)) {
|
||||||
currentState.getView().updateKeywords(this, currentState);
|
currentState.getView().updateKeywords(this, currentState);
|
||||||
|
|||||||
@@ -424,8 +424,8 @@ public class CardFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void readCardFace(Card c, ICardFace face) {
|
private static void readCardFace(Card c, ICardFace face) {
|
||||||
|
c.addIntrinsicKeywords(face.getKeywords());
|
||||||
|
|
||||||
for (String k : face.getKeywords()) c.addIntrinsicKeyword(k);
|
|
||||||
for (String r : face.getReplacements()) c.addReplacementEffect(ReplacementHandler.parseReplacement(r, c, true));
|
for (String r : face.getReplacements()) c.addReplacementEffect(ReplacementHandler.parseReplacement(r, c, true));
|
||||||
for (String s : face.getStaticAbilities()) c.addStaticAbility(s);
|
for (String s : face.getStaticAbilities()) c.addStaticAbility(s);
|
||||||
for (String t : face.getTriggers()) c.addTrigger(TriggerHandler.parseTrigger(t, c, true));
|
for (String t : face.getTriggers()) c.addTrigger(TriggerHandler.parseTrigger(t, c, true));
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ public class CardState extends GameObject {
|
|||||||
boolean changed = false;
|
boolean changed = false;
|
||||||
for (String k : keywords) {
|
for (String k : keywords) {
|
||||||
if (addIntrinsicKeyword(k)) {
|
if (addIntrinsicKeyword(k)) {
|
||||||
changed = false;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return changed;
|
return changed;
|
||||||
|
|||||||
Reference in New Issue
Block a user