diff --git a/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java b/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java index 990666fa459..23ffb4a9a98 100644 --- a/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java +++ b/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java @@ -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); } diff --git a/forge-game/src/main/java/forge/game/ForgeScript.java b/forge-game/src/main/java/forge/game/ForgeScript.java index 90a8d8a02fe..263e03e5b96 100644 --- a/forge-game/src/main/java/forge/game/ForgeScript.java +++ b/forge-game/src/main/java/forge/game/ForgeScript.java @@ -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) { diff --git a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java index e216ebfb222..b8ec1f4eca3 100644 --- a/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java +++ b/forge-game/src/main/java/forge/game/card/CardFactoryUtil.java @@ -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]; diff --git a/forge-game/src/main/java/forge/game/spellability/SpellAbility.java b/forge-game/src/main/java/forge/game/spellability/SpellAbility.java index 8cc1569dd8a..8d494be7d60 100644 --- a/forge-game/src/main/java/forge/game/spellability/SpellAbility.java +++ b/forge-game/src/main/java/forge/game/spellability/SpellAbility.java @@ -115,6 +115,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit private Player targetingPlayer = null; private Pair 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(); diff --git a/forge-gui/res/cardsfolder/upcoming/tamiyo_compleated_sage.txt b/forge-gui/res/cardsfolder/upcoming/tamiyo_compleated_sage.txt new file mode 100644 index 00000000000..0c8b707251b --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/tamiyo_compleated_sage.txt @@ -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 | 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." diff --git a/forge-gui/src/main/java/forge/gamemodes/match/input/InputPayManaOfCostPayment.java b/forge-gui/src/main/java/forge/gamemodes/match/input/InputPayManaOfCostPayment.java index e8b414817e6..7df67e46d03 100644 --- a/forge-gui/src/main/java/forge/gamemodes/match/input/InputPayManaOfCostPayment.java +++ b/forge-gui/src/main/java/forge/gamemodes/match/input/InputPayManaOfCostPayment.java @@ -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)) { diff --git a/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java b/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java index 2b09d24bce5..33d65aba859 100644 --- a/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java +++ b/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java @@ -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");