Merge branch 'master' into 'master'

STX: One Ward, two card

See merge request core-developers/forge!4273
This commit is contained in:
Michael Kamensky
2021-03-27 04:37:13 +00:00
6 changed files with 63 additions and 2 deletions

View File

@@ -2061,6 +2061,19 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
sb.append(" (").append(inst.getReminderText()).append(")");
printedKW.add(keyword);
}
} else if (keyword.startsWith("Ward")) {
final String[] k = keyword.split(":");
final Cost cost = new Cost(k[1], false);
StringBuilder sbCost = new StringBuilder(k[0]);
if (!cost.isOnlyManaCost()) {
sbCost.append("");
} else {
sbCost.append(" ");
}
sbCost.append(cost.toSimpleString());
sbLong.append(sbCost).append(" (").append(inst.getReminderText()).append(")");
sbLong.append("\r\n");
} else if (keyword.endsWith(" offering")) {
String offeringType = keyword.split(" ")[0];
if (sb.length() != 0) {

View File

@@ -3331,7 +3331,7 @@ public class CardFactoryUtil {
// sacrifice trigger
final StringBuilder sacTrig = new StringBuilder("Mode$ CounterRemoved | TriggerZones$ Battlefield" +
" | ValidCard$ Card.Self | NewCounterAmount$ 0 | CounterType$ TIME");
" | ValidCard$ Card.Self | NewCounterAmount$ 0 | CounterType$ TIME");
if (keyword.contains(":")) {
sacTrig.append("| Secondary$ True");
}
@@ -3343,6 +3343,21 @@ public class CardFactoryUtil {
inst.addTrigger(parsedUpkeepTrig);
inst.addTrigger(parsedSacTrigger);
} else if (keyword.startsWith("Ward")) {
final String[] k = keyword.split(":");
final Cost cost = new Cost(k[1], false);
String costDesc = cost.toSimpleString();
String strTrig = "Mode$ BecomesTarget | ValidSource$ Card.OppCtrl | ValidTarget$ Card.Self "
+ " | Secondary$ True | TriggerDescription$ Ward " + costDesc + " ("
+ inst.getReminderText() + ")";
String effect = "DB$ Counter | Defined$ TriggeredSourceSA | UnlessCost$ " + k[1]
+ " | UnlessPayer$ TriggeredSourceSAController";
final Trigger trigger = TriggerHandler.parseTrigger(strTrig, card, intrinsic);
trigger.setOverridingAbility(AbilityFactory.getAbility(effect, card));
inst.addTrigger(trigger);
} else if (keyword.equals("MayFlashSac")) {
String strTrig = "Mode$ SpellCast | ValidCard$ Card.Self | ValidSA$ Spell.MayPlaySource | Static$ True | Secondary$ True "
+ " | TriggerDescription$ If you cast it any time a sorcery couldn't have been cast, "

View File

@@ -65,7 +65,7 @@ public final class CardUtil {
"Fortify", "Transfigure", "Champion", "Evoke", "Prowl", "IfReach",
"Reinforce", "Unearth", "Level up", "Miracle", "Overload",
"Scavenge", "Encore", "Bestow", "Outlast", "Dash", "Surge", "Emerge", "Hexproof:",
"etbCounter", "Reflect").build();
"etbCounter", "Reflect", "Ward").build();
/** List of keyword endings of keywords that could be modified by text changes. */
public static final ImmutableList<String> modifiableKeywordEndings = ImmutableList.<String>builder().add(
"walk", "cycling", "offering").build();

View File

@@ -161,6 +161,7 @@ public enum Keyword {
UNLEASH("Unleash", SimpleKeyword.class, false, "You may have this creature enter the battlefield with a +1/+1 counter on it. It can't block as long as it has a +1/+1 counter on it."),
VANISHING("Vanishing", KeywordWithAmount.class, false, "This permanent enters the battlefield with {%d:time counter} on it. At the beginning of your upkeep, remove a time counter from it. When the last is removed, sacrifice it."),
VIGILANCE("Vigilance", SimpleKeyword.class, true, "Attacking doesn't cause this creature to tap."),
WARD("Ward", KeywordWithCost.class, false, "Whenever this permanent becomes the target of a spell or ability an opponent controls, counter it unless that player pays %s."),
WITHER("Wither", SimpleKeyword.class, true, "This deals damage to creatures in the form of -1/-1 counters."),
// mayflash additional cast