mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 17:58:01 +00:00
Keyword: add Afterlife
This commit is contained in:
@@ -96,7 +96,9 @@ public class PaperToken implements InventoryItemFromSet, IPaperCard {
|
||||
build.add(keyword);
|
||||
}
|
||||
|
||||
if (edition != null) {
|
||||
build.add(edition.getCode());
|
||||
}
|
||||
|
||||
// Should future image file names be all lower case? Instead of Up case sets?
|
||||
return StringUtils.join(build, "_").toLowerCase();
|
||||
@@ -121,7 +123,7 @@ public class PaperToken implements InventoryItemFromSet, IPaperCard {
|
||||
@Override public String getName() { 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 boolean isFoil() { return false; }
|
||||
@Override public CardRules getRules() { return card; }
|
||||
|
||||
@@ -47,7 +47,7 @@ public class TokenDb implements ITokenDatabase {
|
||||
tokensByName.put(fullName, pt);
|
||||
return pt;
|
||||
} catch(Exception e) {
|
||||
return null;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -207,6 +207,8 @@ public class TokenEffect extends SpellAbilityEffect {
|
||||
|
||||
if (result != null) {
|
||||
tokenName = result.getName();
|
||||
} else {
|
||||
throw new RuntimeException("don't find Token for TokenScript: " + sa.getParam("TokenScript"));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -1622,6 +1622,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
|| keyword.startsWith("Fabricate") || keyword.startsWith("Soulshift") || keyword.startsWith("Bushido")
|
||||
|| keyword.startsWith("Crew") || keyword.startsWith("Tribute") || keyword.startsWith("Absorb")
|
||||
|| keyword.startsWith("Graft") || keyword.startsWith("Fading") || keyword.startsWith("Vanishing")
|
||||
|| keyword.startsWith("Afterlife")
|
||||
|| keyword.startsWith("Afflict") || keyword.startsWith ("Poisonous") || keyword.startsWith("Rampage")
|
||||
|| keyword.startsWith("Renown") || keyword.startsWith("Annihilator") || keyword.startsWith("Devour")) {
|
||||
final String[] k = keyword.split(":");
|
||||
|
||||
@@ -2137,6 +2137,20 @@ public class CardFactoryUtil {
|
||||
afflictTrigger.setOverridingAbility(AbilityFactory.getAbility(abStringAfflict, card));
|
||||
|
||||
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")) {
|
||||
final String[] k = keyword.split(":");
|
||||
final String n = k[1];
|
||||
|
||||
@@ -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."),
|
||||
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."),
|
||||
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."),
|
||||
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}."),
|
||||
|
||||
@@ -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.)
|
||||
7
forge-gui/res/tokenscripts/wb_1_1_spirit_flying.txt
Normal file
7
forge-gui/res/tokenscripts/wb_1_1_spirit_flying.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
Name:Spirit
|
||||
ManaCost:no cost
|
||||
Types:Creature Spirit
|
||||
Colors:white,black
|
||||
PT:1/1
|
||||
K:Flying
|
||||
Oracle:Flying
|
||||
Reference in New Issue
Block a user