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_ONE3.pzl.disabled b/forge-gui/res/puzzle/PS_ONE3.pzl similarity index 52% rename from forge-gui/res/puzzle/PS_ONE3.pzl.disabled rename to forge-gui/res/puzzle/PS_ONE3.pzl index 1706458ece9..dcfbf886921 100644 --- a/forge-gui/res/puzzle/PS_ONE3.pzl.disabled +++ b/forge-gui/res/puzzle/PS_ONE3.pzl @@ -1,11 +1,10 @@ -# TODO: adding a Meld card doesn't work because MeldedWith is not set correctly. [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 +Goal:Win Before Opponent's Next Turn Turns:9999 Difficulty:Mythic -Description:Start in your first main phase and 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. +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 @@ -14,7 +13,7 @@ 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;The Mightstone and Weakstone;Urza, Planeswalker|Meld|Counters:LOYALTY=7|Id:1;Levitating Statue;Ichormoon Gauntlet +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|Id:1;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 diff --git a/forge-gui/res/puzzle/PS_ONE5.pzl b/forge-gui/res/puzzle/PS_ONE5.pzl index 78cd6fdceba..6560c4e3c70 100644 --- a/forge-gui/res/puzzle/PS_ONE5.pzl +++ b/forge-gui/res/puzzle/PS_ONE5.pzl @@ -1,5 +1,5 @@ [metadata] -Name:Possibility Storm - All Will Be One #05 +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 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