NCC: Gavel of the Righteous and output support (#298)

This commit is contained in:
Northmoc
2022-05-10 08:53:49 -04:00
committed by GitHub
parent 6c4367efa4
commit 6c9ce36c17
8 changed files with 43 additions and 15 deletions

View File

@@ -2789,6 +2789,7 @@ public class CardFactoryUtil {
String valid = k.length > 2 && !k[2].isEmpty() ? k[2] : "Creature.YouCtrl"; String valid = k.length > 2 && !k[2].isEmpty() ? k[2] : "Creature.YouCtrl";
String vstr = k.length > 3 && !k[3].isEmpty() ? k[3] : "creature"; String vstr = k.length > 3 && !k[3].isEmpty() ? k[3] : "creature";
String extra = k.length > 4 ? k[4] : ""; String extra = k.length > 4 ? k[4] : "";
boolean altCost = extra.contains("AlternateCost");
String extraDesc = k.length > 5 ? k[5] : ""; String extraDesc = k.length > 5 ? k[5] : "";
// Create attach ability string // Create attach ability string
final StringBuilder abilityStr = new StringBuilder(); final StringBuilder abilityStr = new StringBuilder();
@@ -2806,17 +2807,21 @@ public class CardFactoryUtil {
abilityStr.append(" ").append(vstr); abilityStr.append(" ").append(vstr);
} }
Cost cost = new Cost(equipCost, true); Cost cost = new Cost(equipCost, true);
if (!cost.isOnlyManaCost()) { //Something other than a mana cost if (!cost.isOnlyManaCost() || altCost) { //Something other than a mana cost
abilityStr.append(""); abilityStr.append("");
} else { } else {
abilityStr.append(" "); abilityStr.append(" ");
} }
if (!altCost) {
abilityStr.append("| CostDesc$ ").append(cost.toSimpleString()).append(" "); abilityStr.append("| CostDesc$ ").append(cost.toSimpleString()).append(" ");
}
abilityStr.append("| SpellDescription$ "); abilityStr.append("| SpellDescription$ ");
if (!extraDesc.isEmpty()) { if (!extraDesc.isEmpty()) {
abilityStr.append(". ").append(extraDesc).append(". "); abilityStr.append(". ").append(extraDesc).append(". ");
} }
if (!altCost) {
abilityStr.append("(").append(inst.getReminderText()).append(")"); abilityStr.append("(").append(inst.getReminderText()).append(")");
}
if (!extra.isEmpty()) { if (!extra.isEmpty()) {
abilityStr.append(" | ").append(extra); abilityStr.append(" | ").append(extra);
} }

View File

@@ -864,15 +864,21 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
if (hasParam("CostDesc")) { if (hasParam("CostDesc")) {
sb.append(getParam("CostDesc")).append(" "); sb.append(getParam("CostDesc")).append(" ");
} else { } else {
sb.append(payCosts.toString());
// for cards like Crystal Shard with {3}, {T} or {U}, {T}:
if (hasParam("AlternateCost")) { if (hasParam("AlternateCost")) {
Cost alternateCost = new Cost(getParam("AlternateCost"), payCosts.isAbility()); Cost alternateCost = new Cost(getParam("AlternateCost"), payCosts.isAbility());
sb.append(" or ").append(alternateCost.toString()); boolean altOnlyMana = alternateCost.isOnlyManaCost();
if (payCosts.isOnlyManaCost() && !altOnlyMana) {
sb.append("Pay ");
}
sb.append(payCosts.toString());
sb.append(" or ").append(altOnlyMana ? alternateCost.toString() :
StringUtils.uncapitalize(alternateCost.toString()));
sb.append(isEquip() ? "." : "");
} else {
sb.append(payCosts.toString());
} }
if (payCosts.isAbility()) { if (payCosts.isAbility() && !isEquip()) {
sb.append(": "); sb.append(": ");
} }
} }

View File

@@ -0,0 +1,12 @@
Name:Gavel of the Righteous
ManaCost:2
Types:Artifact Equipment
T:Mode$ Phase | Phase$ BeginCombat | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ At the beginning of combat on your turn, put a charge counter on CARDNAME.
SVar:TrigPutCounter:DB$ PutCounter | CounterType$ CHARGE
S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddPower$ X | AddToughness$ X | Description$ Equipped creature gets +1/+1 for each counter on CARDNAME.
SVar:X:Count$CardCounters.ALL
S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddKeyword$ Double Strike | CheckSVar$ X | SVarCompare$ GE4 | Description$ As long as CARDNAME has four or more counters on it, equipped creature has double strike.
K:Equip:3:::AlternateCost$ RemoveAnyCounter<1/Any/Card.Self/CARDNAME>
DeckHas:Ability$Counters
DeckHints:Ability$Counters
Oracle:At the beginning of combat on your turn, put a charge counter on Gavel of the Righteous.\nEquipped creature gets +1/+1 for each counter on Gavel of the Righteous.\nAs long as Gavel of the Righteous has four or more counters on it, equipped creature has double strike.\nEquip—Pay {3} or remove a counter from Gavel of the Righteous.

View File

@@ -2389,7 +2389,7 @@ lblSelectNMoreTypeCardsTpReveal=Select {0} more {1} card(s) to reveal.
lblSelectTargetCounter=Select {0} to remove a counter lblSelectTargetCounter=Select {0} to remove a counter
lblRemoveCounterFromCard=remove counter from card lblRemoveCounterFromCard=remove counter from card
lblRemoveAllCountersConfirm=Remove all counters? lblRemoveAllCountersConfirm=Remove all counters?
lblRemoveNTargetCounterFromCardPayCostConfirm=Remove {0} {1} counter(s) from {2}? lblRemoveNTargetCounterFromCardPayCostConfirm=Select {2} to remove {0}{1} counter(s) from
lblRemoveCountersFromAInZoneCard=Remove counter(s) from a card in {0} lblRemoveCountersFromAInZoneCard=Remove counter(s) from a card in {0}
lblSacrificeCardConfirm=Sacrifice {0}? lblSacrificeCardConfirm=Sacrifice {0}?
lblSelectATargetToSacrifice=Select {0} to sacrifice ({1} left) lblSelectATargetToSacrifice=Select {0} to sacrifice ({1} left)

View File

@@ -816,8 +816,13 @@ public class HumanCostDecision extends CostDecisionMakerBase {
super(controller, cntCounters, cntCounters, sa); super(controller, cntCounters, cntCounters, sa);
this.validChoices = validCards; this.validChoices = validCards;
counterType = cType; counterType = cType;
String fromWhat = costPart.getDescriptiveType();
if (fromWhat.equals("CARDNAME")) {
fromWhat = sa.getHostCard().getName();
}
setMessage(Localizer.getInstance().getMessage("lblRemoveNTargetCounterFromCardPayCostConfirm", "%d", counterType == null ? "any" : counterType.getName().toLowerCase(), costPart.getDescriptiveType())); setMessage(Localizer.getInstance().getMessage("lblRemoveNTargetCounterFromCardPayCostConfirm",
"%d", counterType == null ? "" : " " + counterType.getName().toLowerCase(), fromWhat));
} }
@Override @Override