mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Keyword: add Monstrosity in Keyword format
This commit is contained in:
@@ -1431,7 +1431,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
|| keyword.startsWith("Strive") || keyword.startsWith("Escalate")
|
||||
|| keyword.startsWith("Cycling") || keyword.startsWith("TypeCycling")
|
||||
|| keyword.startsWith("ETBReplacement") || keyword.startsWith("MayEffectFromOpeningHand")
|
||||
|| keyword.equals("Undaunted")) {
|
||||
|| keyword.equals("Undaunted") || keyword.startsWith("Monstrosity")) {
|
||||
} else if (keyword.startsWith("Provoke") || keyword.startsWith("Devour") || keyword.equals("Unleash")
|
||||
|| keyword.startsWith("Soulbond") || keyword.equals("Partner") || keyword.equals("Retrace")
|
||||
|| keyword.equals("Living Weapon")) {
|
||||
|
||||
@@ -26,7 +26,6 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import forge.card.mana.ManaAtom;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
@@ -40,6 +39,7 @@ import forge.card.CardType;
|
||||
import forge.card.ColorSet;
|
||||
import forge.card.ICardFace;
|
||||
import forge.card.MagicColor;
|
||||
import forge.card.mana.ManaAtom;
|
||||
import forge.card.mana.ManaCost;
|
||||
import forge.card.mana.ManaCostParser;
|
||||
import forge.card.mana.ManaCostShard;
|
||||
@@ -74,8 +74,8 @@ import forge.game.trigger.TriggerHandler;
|
||||
import forge.game.zone.Zone;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.util.Aggregates;
|
||||
import forge.util.collect.FCollectionView;
|
||||
import forge.util.Lang;
|
||||
import forge.util.collect.FCollectionView;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -2068,23 +2068,7 @@ public class CardFactoryUtil {
|
||||
addTriggerAbility(keyword, card, null);
|
||||
}
|
||||
else if (keyword.startsWith("Monstrosity")) {
|
||||
final String[] k = keyword.split(":");
|
||||
final String magnitude = k[0].substring(12);
|
||||
final String manacost = k[1];
|
||||
card.removeIntrinsicKeyword(keyword);
|
||||
|
||||
String ref = "X".equals(magnitude) ? " | References$ X" : "";
|
||||
String counters = StringUtils.isNumeric(magnitude)
|
||||
? Lang.nounWithNumeral(Integer.parseInt(magnitude), "+1/+1 counter"): "X +1/+1 counters";
|
||||
String effect = "AB$ PutCounter | Cost$ " + manacost + " | ConditionPresent$ " +
|
||||
"Card.Self+IsNotMonstrous | Monstrosity$ True | CounterNum$ " +
|
||||
magnitude + " | CounterType$ P1P1 | SpellDescription$ Monstrosity " +
|
||||
magnitude + " (If this creature isn't monstrous, put " +
|
||||
counters + " on it and it becomes monstrous.) | StackDescription$ SpellDescription" + ref;
|
||||
|
||||
card.addSpellAbility(AbilityFactory.getAbility(effect, card));
|
||||
// add ability to instrinic strings so copies/clones create the ability also
|
||||
card.getCurrentState().addUnparsedAbility(effect);
|
||||
addSpellAbility(keyword, card, null);
|
||||
}
|
||||
else if (keyword.startsWith("Ninjutsu")) {
|
||||
addSpellAbility(keyword, card, null);
|
||||
@@ -3356,6 +3340,30 @@ public class CardFactoryUtil {
|
||||
evokedSpell.setPayCosts(evokedCost);
|
||||
|
||||
card.addSpellAbility(evokedSpell);
|
||||
} else if (keyword.startsWith("Monstrosity")) {
|
||||
final String[] k = keyword.split(":");
|
||||
final String magnitude = k[1];
|
||||
final String manacost = k[2];
|
||||
|
||||
String effect = "AB$ PutCounter | Cost$ " + manacost + " | ConditionPresent$ "
|
||||
+ "Card.Self+IsNotMonstrous | Monstrosity$ True | CounterNum$ " + magnitude
|
||||
+ " | CounterType$ P1P1 | SpellDescription$ Monstrosity " + magnitude + " ("
|
||||
+ Keyword.getInstance(keyword).getReminderText() + ") | StackDescription$ SpellDescription";
|
||||
if ("X".equals(magnitude)) {
|
||||
effect += " | References$ X";
|
||||
}
|
||||
if (card.hasSVar("MonstrosityAILogic")) {
|
||||
effect += "| AILogic$ " + card.getSVar("MonstrosityAILogic");
|
||||
}
|
||||
|
||||
final SpellAbility sa = AbilityFactory.getAbility(effect, card);
|
||||
if (!intrinsic) {
|
||||
sa.setTemporary(true);
|
||||
sa.setIntrinsic(false);
|
||||
// sa.setOriginalHost(hostCard);
|
||||
kws.addSpellAbility(sa);
|
||||
}
|
||||
card.addSpellAbility(sa);
|
||||
} else if (keyword.startsWith("Ninjutsu")) {
|
||||
final String[] k = keyword.split(":");
|
||||
final String manacost = k[1];
|
||||
|
||||
@@ -80,6 +80,7 @@ public enum Keyword {
|
||||
MELEE(SimpleKeyword.class, true, "Whenever this creature attacks, it gets +1/+1 until end of turn for each opponent you attacked with a creature this combat."),
|
||||
MENACE(SimpleKeyword.class, true, "This creature can't be blocked except by two or more creatures."),
|
||||
MEGAMORPH(KeywordWithCost.class, true, "You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its megamorph cost and put a +1/+1 counter on it."),
|
||||
MONSTROSITY(KeywordWithCostAndAmount.class, false, "If this creature isn't monstrous, put {%2$d:+1/+1 counter} on it and it becomes monstrous."),
|
||||
MODULAR(KeywordWithAmount.class, false, "This creature enters the battlefield with %d +1/+1 counters on it. When it dies, you may put its +1/+1 counters on target artifact creature."),
|
||||
MORPH(KeywordWithCost.class, true, "You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost."),
|
||||
MULTIKICKER(KeywordWithCost.class, false, "You may pay an additional %s any number of times as you cast this spell."),
|
||||
|
||||
Reference in New Issue
Block a user