- Add support for MeldedWith in Game State.

- Add proper support for PS_ONE3 (goal and all).
This commit is contained in:
Michael Kamensky
2023-05-08 14:08:46 +03:00
parent dfb69fa0d4
commit f4984495f4
4 changed files with 23 additions and 5 deletions

View File

@@ -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);

View File

@@ -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

View File

@@ -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

View File

@@ -196,6 +196,11 @@ public class Puzzle extends GameState implements InventoryItem, Comparable<Puzzl
String countOTB = "Count$Valid " + targets;
clearSA.setSVar("PermCount", countOTB);
break;
case "win before opponent's next turn":
trig = "Mode$ Phase | Phase$ Upkeep | ValidPlayer$ Opponent | TriggerZones$ Command | Static$ True | " +
" | TriggerDescription$ At the beginning of your opponent's next turn, you lose the game.";
eff = "DB$ LosesGame | Defined$ You";
break;
default:
break;
}