Keyword: add Afterlife

This commit is contained in:
Hanmac
2018-12-22 08:27:53 +01:00
parent b0c5cacc05
commit e85f9e08be
8 changed files with 38 additions and 4 deletions

View File

@@ -96,7 +96,9 @@ public class PaperToken implements InventoryItemFromSet, IPaperCard {
build.add(keyword); build.add(keyword);
} }
build.add(edition.getCode()); if (edition != null) {
build.add(edition.getCode());
}
// Should future image file names be all lower case? Instead of Up case sets? // Should future image file names be all lower case? Instead of Up case sets?
return StringUtils.join(build, "_").toLowerCase(); return StringUtils.join(build, "_").toLowerCase();
@@ -121,7 +123,7 @@ public class PaperToken implements InventoryItemFromSet, IPaperCard {
@Override public String getName() { return name; } @Override public String getName() { return name; }
@Override public String toString() { return name; } @Override public String toString() { return name; }
@Override public String getEdition() { return edition.getCode(); } @Override public String getEdition() { return edition != null ? edition.getCode() : "???"; }
@Override public int getArtIndex() { return 0; } // This might change however @Override public int getArtIndex() { return 0; } // This might change however
@Override public boolean isFoil() { return false; } @Override public boolean isFoil() { return false; }
@Override public CardRules getRules() { return card; } @Override public CardRules getRules() { return card; }

View File

@@ -47,7 +47,7 @@ public class TokenDb implements ITokenDatabase {
tokensByName.put(fullName, pt); tokensByName.put(fullName, pt);
return pt; return pt;
} catch(Exception e) { } catch(Exception e) {
return null; throw e;
} }
} }

View File

@@ -207,6 +207,8 @@ public class TokenEffect extends SpellAbilityEffect {
if (result != null) { if (result != null) {
tokenName = result.getName(); tokenName = result.getName();
} else {
throw new RuntimeException("don't find Token for TokenScript: " + sa.getParam("TokenScript"));
} }
return result; return result;

View File

@@ -1622,7 +1622,8 @@ public class Card extends GameEntity implements Comparable<Card> {
|| keyword.startsWith("Fabricate") || keyword.startsWith("Soulshift") || keyword.startsWith("Bushido") || keyword.startsWith("Fabricate") || keyword.startsWith("Soulshift") || keyword.startsWith("Bushido")
|| keyword.startsWith("Crew") || keyword.startsWith("Tribute") || keyword.startsWith("Absorb") || keyword.startsWith("Crew") || keyword.startsWith("Tribute") || keyword.startsWith("Absorb")
|| keyword.startsWith("Graft") || keyword.startsWith("Fading") || keyword.startsWith("Vanishing") || keyword.startsWith("Graft") || keyword.startsWith("Fading") || keyword.startsWith("Vanishing")
|| keyword.startsWith ("Afflict") || keyword.startsWith ("Poisonous") || keyword.startsWith("Rampage") || keyword.startsWith("Afterlife")
|| keyword.startsWith("Afflict") || keyword.startsWith ("Poisonous") || keyword.startsWith("Rampage")
|| keyword.startsWith("Renown") || keyword.startsWith("Annihilator") || keyword.startsWith("Devour")) { || keyword.startsWith("Renown") || keyword.startsWith("Annihilator") || keyword.startsWith("Devour")) {
final String[] k = keyword.split(":"); final String[] k = keyword.split(":");
sbLong.append(k[0] + " " + k[1] + " (" + inst.getReminderText() + ")"); sbLong.append(k[0] + " " + k[1] + " (" + inst.getReminderText() + ")");

View File

@@ -2137,6 +2137,20 @@ public class CardFactoryUtil {
afflictTrigger.setOverridingAbility(AbilityFactory.getAbility(abStringAfflict, card)); afflictTrigger.setOverridingAbility(AbilityFactory.getAbility(abStringAfflict, card));
inst.addTrigger(afflictTrigger); inst.addTrigger(afflictTrigger);
} else if (keyword.startsWith("Afterlife")) {
final String k[] = keyword.split(":");
final String name = StringUtils.join(k, " ");
final StringBuilder sb = new StringBuilder();
sb.append("Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self ");
sb.append("| Secondary$ True | TriggerDescription$ ").append(name);
sb.append(" (").append(inst.getReminderText()).append(")");
final String effect = "DB$ Token | TokenAmount$ " + k[1] + " | TokenScript$ wb_1_1_spirit_flying";
final Trigger trigger = TriggerHandler.parseTrigger(sb.toString(), card, intrinsic);
trigger.setOverridingAbility(AbilityFactory.getAbility(effect, card));
inst.addTrigger(trigger);
} else if (keyword.startsWith("Annihilator")) { } else if (keyword.startsWith("Annihilator")) {
final String[] k = keyword.split(":"); final String[] k = keyword.split(":");
final String n = k[1]; final String n = k[1];

View File

@@ -15,6 +15,7 @@ public enum Keyword {
ABSORB(KeywordWithAmount.class, false, "If a source would deal damage to this creature, prevent %d of that damage."), ABSORB(KeywordWithAmount.class, false, "If a source would deal damage to this creature, prevent %d of that damage."),
AFFINITY(KeywordWithType.class, false, "This spell costs you {1} less to cast for each %s you control."), AFFINITY(KeywordWithType.class, false, "This spell costs you {1} less to cast for each %s you control."),
AFFLICT(KeywordWithAmount.class, false, "Whenever this creature becomes blocked, defending player loses %d life."), AFFLICT(KeywordWithAmount.class, false, "Whenever this creature becomes blocked, defending player loses %d life."),
AFTERLIFE(KeywordWithAmount.class, false, "When this creature dies, create {%1$d:1/1 white and black Spirit creature token} with flying."),
AFTERMATH(SimpleKeyword.class, false, "Cast this spell only from your graveyard. Then exile it."), AFTERMATH(SimpleKeyword.class, false, "Cast this spell only from your graveyard. Then exile it."),
AMPLIFY(KeywordWithAmountAndType.class, false, "As this creature enters the battlefield, put {%d:+1/+1 counter} on it for each %s card you reveal in your hand."), AMPLIFY(KeywordWithAmountAndType.class, false, "As this creature enters the battlefield, put {%d:+1/+1 counter} on it for each %s card you reveal in your hand."),
ANNIHILATOR(KeywordWithAmount.class, false, "Whenever this creature attacks, defending player sacrifices {%d:permanent}."), ANNIHILATOR(KeywordWithAmount.class, false, "Whenever this creature attacks, defending player sacrifices {%d:permanent}."),

View File

@@ -0,0 +1,7 @@
Name:Imperious Oligarch
ManaCost:W B
Types:Creature Human Cleric
PT:2/1
K:Vigilance
K:Afterlife:1
Oracle:Vigilance\nAfterlife 1 (When this creature dies, create a 1/1 white and black Spirit creature token with flying.)

View File

@@ -0,0 +1,7 @@
Name:Spirit
ManaCost:no cost
Types:Creature Spirit
Colors:white,black
PT:1/1
K:Flying
Oracle:Flying