Merge branch '2079-kamigawa-compleated' into 'master'

Resolve "Kamigawa: Compleated"

Closes #2079

See merge request core-developers/forge!6319
This commit is contained in:
Hans Mackowiak
2022-02-28 13:38:10 +00:00
7 changed files with 34 additions and 2 deletions

View File

@@ -795,6 +795,9 @@ public class ComputerUtilMana {
if (toPay.isPhyrexian()) {
cost.payPhyrexian();
if (!test) {
sa.setSpendPhyrexianMana(true);
}
} else if (lifeInsteadOfBlack) {
cost.decreaseShard(ManaCostShard.BLACK, 1);
}

View File

@@ -182,6 +182,8 @@ public class ForgeScript {
return sa.hasParam("Daybound");
} else if (property.equals("Nightbound")) {
return sa.hasParam("Nightbound");
} else if (property.equals("paidPhyrexianMana")) {
return sa.getSpendPhyrexianMana();
} else if (property.equals("MayPlaySource")) {
StaticAbility m = sa.getMayPlay();
if (m == null) {

View File

@@ -2147,6 +2147,11 @@ public class CardFactoryUtil {
re.setOverridingAbility(saReturn);
inst.addReplacement(re);
} else if (keyword.equals("Compleated")) {
String sb = "etbCounter:LOYALTY:-2:ValidCard$ Card.CastSa Spell.paidPhyrexianMana:If life was paid, this planeswalker enters with two fewer loyalty counters";
final ReplacementEffect re = makeEtbCounter(sb, card, intrinsic);
inst.addReplacement(re);
} else if (keyword.startsWith("Dredge")) {
final String dredgeAmount = keyword.split(":")[1];

View File

@@ -115,6 +115,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
private Player targetingPlayer = null;
private Pair<Long, Player> controlledByPlayer = null;
private ManaCostBeingPaid manaCostBeingPaid = null;
private boolean spentPhyrexian = false;
private SpellAbility grantorOriginal = null;
private StaticAbility grantorStatic = null;
@@ -613,6 +614,13 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
payingMana.clear();
}
public final boolean getSpendPhyrexianMana() {
return this.spentPhyrexian;
}
public final void setSpendPhyrexianMana(boolean value) {
this.spentPhyrexian = value;
}
public final void applyPayingManaEffects() {
Card host = getHostCard();

View File

@@ -0,0 +1,13 @@
Name:Tamiyo, Compleated Sage
ManaCost:2 G PGU U
Types:Legendary Planeswalker Tamiyo
Loyalty:5
K:Compleated
A:AB$ Tap | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | ValidTgts$ Artifact,Creature | TgtPrompt$ Select up to one target artifact or creature | TargetMin$ 0 | TargetMax$ 1 | SubAbility$ DBPump | SpellDescription$ Tap up to one target artifact or creature. It doesn't untap during its controller's next untap step.
SVar:DBPump:DB$ Pump | Defined$ Targeted | KW$ HIDDEN This card doesn't untap during your next untap step. | Duration$ Permanent
A:AB$ ChangeZone | Cost$ SubCounter<X/LOYALTY> | Planeswalker$ True | ValidTgts$ Permanent.nonLand+cmcEQX | TgtPrompt$ Select target nonland permanent card with mana value X | AILogic$ BestCard | Origin$ Graveyard | Destination$ Exile | SubAbility$ DBCopy | SpellDescription$ Exile target nonland permanent card with mana value X from your graveyard.
SVar:DBCopy:DB$ CopyPermanent | Defined$ Targeted | SpellDescription$ Create a token that's a copy of that card.
SVar:X:Count$xPaid
A:AB$ Token | Cost$ SubCounter<7/LOYALTY> | Planeswalker$ True | Ultimate$ True | TokenScript$ tamiyos_notebook | SpellDescription$ Create Tamiyo's Notebook, a legendary colorless artifact token with "Spells you cast cost {2} less to cast" and "{T}: Draw a card."
DeckHas:Ability$Token & Type$Artifact
Oracle:Compleated ({PGU} can be paid with {G}, {U}, or 2 life. If life was paid, this planeswalker enters with two fewer loyalty counters.)\n[+1]: Tap up to one target artifact or creature. It doesn't untap during its controller's next untap step.\n[X]: Exile target nonland permanent card with mana value X from your graveyard. Create a token that's a copy of that card.\n[7]: Create Tamiyo's Notebook, a legendary colorless artifact token with "Spells you cast cost {2} less to cast" and "{T}: Draw a card."

View File

@@ -46,6 +46,7 @@ public class InputPayManaOfCostPayment extends InputPayMana {
if (player == selected) {
if (player.canPayLife(this.phyLifeToLose + 2, this.effect, saPaidFor)) {
if (manaCost.payPhyrexian()) {
saPaidFor.setSpendPhyrexianMana(true);
this.phyLifeToLose += 2;
} else {
if (player.hasKeyword("PayLifeInsteadOf:B") && manaCost.hasAnyKind(ManaAtom.BLACK)) {

View File

@@ -217,9 +217,9 @@ public class HumanPlaySpellAbility {
fromZone.add(oldCard, zonePosition >= 0 ? Integer.valueOf(zonePosition) : null);
ability.setHostCard(oldCard);
ability.setXManaCostPaid(null);
ability.setSpendPhyrexianMana(false);
if (ability.hasParam("Announce")) {
final String announce = ability.getParam("Announce");
for (final String aVar : announce.split(",")) {
for (final String aVar : ability.getParam("Announce").split(",")) {
final String varName = aVar.trim();
if (!varName.equals("X")) {
ability.setSVar(varName, "0");