mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Keyword V: Rise of the intrinsic
This commit is contained in:
@@ -414,13 +414,16 @@ 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 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));
|
||||||
|
|
||||||
for (Entry<String, String> v : face.getVariables()) c.setSVar(v.getKey(), v.getValue());
|
for (Entry<String, String> v : face.getVariables()) c.setSVar(v.getKey(), v.getValue());
|
||||||
|
|
||||||
|
// keywords not before variables
|
||||||
|
c.addIntrinsicKeywords(face.getKeywords());
|
||||||
|
|
||||||
c.setName(face.getName());
|
c.setName(face.getName());
|
||||||
c.setManaCost(face.getManaCost());
|
c.setManaCost(face.getManaCost());
|
||||||
c.setText(face.getNonAbilityText());
|
c.setText(face.getNonAbilityText());
|
||||||
|
|||||||
@@ -1949,10 +1949,6 @@ public class CardFactoryUtil {
|
|||||||
// Cards with Cycling abilities
|
// Cards with Cycling abilities
|
||||||
// -1 means keyword "Cycling" not found
|
// -1 means keyword "Cycling" not found
|
||||||
|
|
||||||
for (KeywordInterface inst : card.getKeywords()) {
|
|
||||||
inst.createTraits(card, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// AddCost
|
// AddCost
|
||||||
if (card.hasSVar("FullCost")) {
|
if (card.hasSVar("FullCost")) {
|
||||||
String k[] = card.getSVar("FullCost").split(":");
|
String k[] = card.getSVar("FullCost").split(":");
|
||||||
|
|||||||
@@ -158,15 +158,18 @@ public class CardState extends GameObject {
|
|||||||
}
|
}
|
||||||
public final void setIntrinsicKeywords(final Iterable<String> intrinsicKeyword0) {
|
public final void setIntrinsicKeywords(final Iterable<String> intrinsicKeyword0) {
|
||||||
intrinsicKeywords.clear();
|
intrinsicKeywords.clear();
|
||||||
intrinsicKeywords.addAll(intrinsicKeyword0);
|
addIntrinsicKeywords(intrinsicKeyword0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final KeywordInterface addIntrinsicKeyword(final String s) {
|
public final KeywordInterface addIntrinsicKeyword(final String s) {
|
||||||
if (s.trim().length() == 0) {
|
if (s.trim().length() == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
KeywordInterface inst = intrinsicKeywords.add(s);
|
||||||
return intrinsicKeywords.add(s);
|
if (inst != null) {
|
||||||
|
inst.createTraits(card, true);
|
||||||
|
}
|
||||||
|
return inst;
|
||||||
}
|
}
|
||||||
public final boolean addIntrinsicKeywords(final Iterable<String> keywords) {
|
public final boolean addIntrinsicKeywords(final Iterable<String> keywords) {
|
||||||
boolean changed = false;
|
boolean changed = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user