diff --git a/forge-ai/src/main/java/forge/ai/GameState.java b/forge-ai/src/main/java/forge/ai/GameState.java index 09e5e9c8dcf..0dce859f59b 100644 --- a/forge-ai/src/main/java/forge/ai/GameState.java +++ b/forge-ai/src/main/java/forge/ai/GameState.java @@ -303,6 +303,10 @@ public abstract class GameState { newText.append("|Flipped"); } else if (c.getCurrentStateName().equals(CardStateName.Meld)) { newText.append("|Meld"); + if (c.getMeldedWith() != null) { + newText.append("|MeldedWith:"); + newText.append(c.getMeldedWith().getName()); + } } else if (c.getCurrentStateName().equals(CardStateName.Modal)) { newText.append("|Modal"); } @@ -1245,6 +1249,16 @@ public abstract class GameState { c.setBackSide(true); } else if (info.startsWith("Flipped")) { c.setState(CardStateName.Flipped, true); + } else if (info.startsWith("MeldedWith")) { + String meldCardName = info.substring(info.indexOf(':') + 1).replace("^", ","); + Card meldTarget; + PaperCard pc = StaticData.instance().getCommonCards().getCard(meldCardName); + if (pc == null) { + System.err.println("ERROR: Tried to create a non-existent card named " + meldCardName + " (as a MeldedWith card) when loading game state!"); + continue; + } + meldTarget = Card.fromPaperCard(pc, c.getOwner()); + c.setMeldedWith(meldTarget); } else if (info.startsWith("Meld")) { c.setState(CardStateName.Meld, true); c.setBackSide(true); diff --git a/forge-gui/res/puzzle/PS_MOM1.pzl b/forge-gui/res/puzzle/PS_MOM1.pzl new file mode 100644 index 00000000000..a6f40d11954 --- /dev/null +++ b/forge-gui/res/puzzle/PS_MOM1.pzl @@ -0,0 +1,21 @@ +[metadata] +Name:Possibility Storm - March of the Machines #01 +URL:https://twitter.com/mtgpuzzles/status/1648895487607554054/photo/1 +Goal:Win +Turns:1 +Difficulty:Uncommon +Description:Win this turn. Assume that any cards you could access from your library are irrelevant to the solution. Remember that your solution must satisfy all opponent decisions (including both blocking and activated abilities.) +[state] +turn=1 +activeplayer=p0 +activephase=MAIN1 +p0life=20 +p0landsplayed=0 +p0landsplayedlastturn=0 +p0hand=Annihilating Glare;Boon-Bringer Valkyrie;Night Clubber +p0library=Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt +p0battlefield=Drana and Linvala;Knight of Dusk's Shadow;Swamp;Swamp;Swamp;Shattered Sanctum;Shattered Sanctum +p1life=10 +p1landsplayed=0 +p1landsplayedlastturn=0 +p1battlefield=Cutthroat Centurion;Cutthroat Centurion;Mandible Justiciar diff --git a/forge-gui/res/puzzle/PS_MOM2.pzl b/forge-gui/res/puzzle/PS_MOM2.pzl new file mode 100644 index 00000000000..d9d6543c19d --- /dev/null +++ b/forge-gui/res/puzzle/PS_MOM2.pzl @@ -0,0 +1,20 @@ +[metadata] +Name:Possibility Storm - March of the Machines #02 +URL:https://i2.wp.com/www.possibilitystorm.com/wp-content/uploads/2023/04/latest-1-scaled.jpg?ssl=1 +Goal:Win +Turns:1 +Difficulty:Rare +Description:Win this turn. Battles are a new card type that you cast, and is then defended by your opponent. You can attack it and deal it damage like planeswalkers. When defeated, its owner casts it transformed. Remember that your solution must satisfy all possible blocking decisions. +[state] +turn=1 +activeplayer=p0 +activephase=MAIN1 +p0life=20 +p0landsplayed=0 +p0landsplayedlastturn=0 +p0hand=Rampaging Raptor;Mountain;Into the Fire;Volcanic Spite +p0battlefield=Invasion of Karsus|Counters:DEFENSE=2;Invasion of Kaldheim|Counters:DEFENSE=2;Dwarven Forge-Chanter;Mountain;Mountain;Mountain;Mountain +p1life=8 +p1landsplayed=0 +p1landsplayedlastturn=0 +p1battlefield=Invasion of Xerex|Counters:DEFENSE=2;Swordsworn Cavalier;Swordsworn Cavalier diff --git a/forge-gui/res/puzzle/PS_ONE3.pzl b/forge-gui/res/puzzle/PS_ONE3.pzl new file mode 100644 index 00000000000..b6ab6b43248 --- /dev/null +++ b/forge-gui/res/puzzle/PS_ONE3.pzl @@ -0,0 +1,20 @@ +[metadata] +Name:Possibility Storm - Phyrexia: All Will Be One #03 +URL:https://i1.wp.com/www.possibilitystorm.com/wp-content/uploads/2023/02/latest-1-scaled.jpg?ssl=1 +Goal:Win Before Opponent's Next Turn +Turns:9999 +Difficulty:Mythic +Description:Start in your first main phase and win before your opponent's next turn. Your opponent has no board, and you have no land! You have 20 cards remaining in your library. Assume any of them that you could draw are not relevant to the solution. +[state] +turn=1 +activeplayer=p0 +activephase=MAIN1 +p0life=20 +p0landsplayed=0 +p0landsplayedlastturn=0 +p0hand=Cement Shoes;Prophetic Prism +p0battlefield=Kaito, Dancing Shadow|Counters:LOYALTY=3;Tezzeret, Betrayer of Flesh|Counters:LOYALTY=2;Urza, Planeswalker|Meld|MeldedWith:The Mightstone and Weakstone|Counters:LOYALTY=7;Levitating Statue;Ichormoon Gauntlet +p0library=Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt +p1life=21 +p1landsplayed=0 +p1landsplayedlastturn=0 diff --git a/forge-gui/res/puzzle/PS_ONE4.pzl b/forge-gui/res/puzzle/PS_ONE4.pzl new file mode 100644 index 00000000000..fe017d9786b --- /dev/null +++ b/forge-gui/res/puzzle/PS_ONE4.pzl @@ -0,0 +1,22 @@ +[metadata] +Name:Possibility Storm - Phyrexia: All Will Be One #04 +URL:https://i1.wp.com/www.possibilitystorm.com/wp-content/uploads/2023/03/latest-scaled.jpg?ssl=1 +Goal:Win +Turns:1 +Difficulty:Uncommon +Description:Win this turn. Assume that any cards you could draw are irrelevant to the solution. +[state] +turn=1 +activeplayer=p0 +activephase=MAIN1 +p0life=5 +p0landsplayed=0 +p0landsplayedlastturn=0 +p0hand=Volt Charge;Furnace Skullbomb;Experimental Augury;Blazing Crescendo +p0library=Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt +p0battlefield=Tekuthal, Inquiry Dominus;Ichor Synthesizer;Serum-Core Chimera|Counters:OIL=2;Cacophony Scamp;Urabrask's Forge|Counters:OIL=2;Island;Island;Mountain;Mountain;Mountain +p1life=16 +p1landsplayed=0 +p1landsplayedlastturn=0 +p1battlefield=Phyrexian Vindicator;Porcelain Zealot;Porcelain Zealot;Porcelain Zealot +p1counters=POISON=4 diff --git a/forge-gui/res/puzzle/PS_ONE5.pzl b/forge-gui/res/puzzle/PS_ONE5.pzl new file mode 100644 index 00000000000..6560c4e3c70 --- /dev/null +++ b/forge-gui/res/puzzle/PS_ONE5.pzl @@ -0,0 +1,21 @@ +[metadata] +Name:Possibility Storm - Phyrexia: All Will Be One #05 +URL:https://i0.wp.com/www.possibilitystorm.com/wp-content/uploads/2023/03/latest-1-scaled.jpg?ssl=1 +Goal:Win +Turns:1 +Difficulty:Uncommon +Description:Win this turn. Assume that any cards that you could access from your library are irrelevant to the solution. Remember that your solution must satisfy all opponent decisions (including both blocking and activated abilities.) +[state] +turn=1 +activeplayer=p0 +activephase=MAIN1 +p0life=20 +p0landsplayed=0 +p0landsplayedlastturn=0 +p0hand=Annihilating Glare;Drown in Ichor;Charforger +p0library=Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt +p0battlefield=Churning Reservoir;Cutthroat Centurion;Cutthroat Centurion;Furnace Strider|Counters:OIL=1;Swamp;Swamp;Mountain;Mountain;Mountain +p1life=8 +p1landsplayed=0 +p1landsplayedlastturn=0 +p1battlefield=Drana and Linvala;Benalish Sleeper;Necrosquito|Counters:OIL=3 diff --git a/forge-gui/src/main/java/forge/gamemodes/puzzle/Puzzle.java b/forge-gui/src/main/java/forge/gamemodes/puzzle/Puzzle.java index e27ecd33d98..3435a16252c 100644 --- a/forge-gui/src/main/java/forge/gamemodes/puzzle/Puzzle.java +++ b/forge-gui/src/main/java/forge/gamemodes/puzzle/Puzzle.java @@ -196,6 +196,11 @@ public class Puzzle extends GameState implements InventoryItem, Comparable