Implement Ice Cauldron

This commit is contained in:
Lyu Zong-Hong
2021-01-19 22:35:41 +09:00
parent e10c982b7e
commit 4cd6fca6d1
2 changed files with 29 additions and 4 deletions

View File

@@ -181,12 +181,21 @@ public class ManaEffect extends SpellAbilityEffect {
}
abMana.setExpressChoice(sb.toString().trim());
} else if (type.equals("LastNotedType")) {
Mana manaType = (Mana) Iterables.getFirst(card.getRemembered(), null);
if (manaType == null) {
final StringBuilder sb = new StringBuilder();
int nMana = 0;
for (Object o : card.getRemembered()) {
if (o instanceof Mana) {
if (nMana > 0) {
sb.append(" ");
}
sb.append(o.toString());
nMana++;
}
}
if (nMana == 0) {
return;
}
String cs = manaType.toString();
abMana.setExpressChoice(cs);
abMana.setExpressChoice(sb.toString());
} else if (type.startsWith("EachColorAmong")) {
final String res = type.split("_")[1];
final CardCollection list = CardLists.getValidCards(card.getGame().getCardsIn(ZoneType.Battlefield),

View File

@@ -0,0 +1,16 @@
Name:Ice Cauldron
ManaCost:4
Types:Artifact
A:AB$ PutCounter | Cost$ X T | RememberCostMana$ True | CounterType$ CHARGE | CounterNum$ 1 | CheckSVar$ Y | SVarCompare$ EQ0 | References$ X,Y | SubAbility$ DBExile | SpellDescription$ You may exile a nonland card from your hand. You may cast that card for as long as it remains exiled. Put a charge counter on CARDNAME and note the type and amount of mana spent to pay this activation cost. Activate this ability only if there are no charge counters on CARDNAME.
SVar:X:Count$xPaid
SVar:Y:Count$CardCounters.CHARGE
SVar:DBExile:DB$ ChangeZone | Optional$ True | RememberChanged$ True | Origin$ Hand | Destination$ Exile | ChangeType$ Card.nonLand | ChangeNum$ 1 | SubAbility$ DBEffect
SVar:DBEffect:DB$ Effect | StaticAbilities$ STPlay | RememberObjects$ Remembered | Duration$ Permanent | ForgetOnMoved$ Exile
SVar:STPlay:Mode$ Continuous | MayPlay$ True | EffectZone$ Command | Affected$ Card.IsRemembered | AffectedZone$ Exile
T:Mode$ ChangesZone | ValidCard$ Card.IsRemembered+ExiledWithSource | Origin$ Exile | Destination$ Any | Execute$ ForgetCard | Static$ True
SVar:ForgetCard:DB$ Cleanup | ForgetDefined$ TriggeredCard
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | Static$ True | ValidCard$ Card.Self | Execute$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
A:AB$ Mana | Cost$ T SubCounter<1/CHARGE> | Produced$ Special LastNotedType | RestrictValid$ Card.IsRemembered | SpellDescription$ Add CARDNAME's last noted type and amount of mana. Spend this mana only to cast the last card exiled with CARDNAME.
AI:RemoveDeck:All
Oracle:{X}, {T}: You may exile a nonland card from your hand. You may cast that card for as long as it remains exiled. Put a charge counter on Ice Cauldron and note the type and amount of mana spent to pay this activation cost. Activate this ability only if there are no charge counters on Ice Cauldron.\n{T}, Remove a charge counter from Ice Cauldron: Add Ice Cauldron's last noted type and amount of mana. Spend this mana only to cast the last card exiled with Ice Cauldron.