From ac23ad25fc8fdfa5f35c93ace82a3b404920ecbd Mon Sep 17 00:00:00 2001 From: Michael Kamensky Date: Mon, 28 Jun 2021 06:44:37 +0300 Subject: [PATCH 1/3] - Added puzzles PS_KHM6, PS_TSR1, PS_STX1. --- forge-gui/res/puzzle/PS_KHM6.pzl | 19 +++++++++++++++++++ forge-gui/res/puzzle/PS_STX1.pzl | 16 ++++++++++++++++ forge-gui/res/puzzle/PS_TSR1.pzl | 16 ++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 forge-gui/res/puzzle/PS_KHM6.pzl create mode 100644 forge-gui/res/puzzle/PS_STX1.pzl create mode 100644 forge-gui/res/puzzle/PS_TSR1.pzl diff --git a/forge-gui/res/puzzle/PS_KHM6.pzl b/forge-gui/res/puzzle/PS_KHM6.pzl new file mode 100644 index 00000000000..959308b2312 --- /dev/null +++ b/forge-gui/res/puzzle/PS_KHM6.pzl @@ -0,0 +1,19 @@ +[metadata] +Name:Possibility Storm - Kaldheim #06 +URL:https://i2.wp.com/www.possibilitystorm.com/wp-content/uploads/2021/03/170.-KHM6-scaled.jpg +Goal:Win +Turns:1 +Difficulty:Mythic +Description:Win this turn. Start in your draw step. Last turn, you exchanged control of Rankle and Goldmaw Champion. Archon of Sun's Grace is enchanted with your opponent's Valor of the Worthy. +[state] +humanlife=4 +ailife=7 +turn=2 +activeplayer=human +activephase=DRAW +humanhand=Liliana, Death Mage;Bala Ged Recovery;Brazen Borrower;Omen of the Dead;Thorn Mammoth +humangraveyard=Demon's Disciple;Gingerbrute;Fruit of Tizerus +humanbattlefield=Nissa of Shadowed Boughs|Counters:LOYALTY=3;Vorinclex, Monstrous Raider|Counters:P1P1=4;The Trickster-God's Heist|Counters:LORE=1;Island;Island;Swamp;Swamp;Forest;Forest;Goldmaw Champion|Owner:AI +aibattlefield=Archon of Sun's Grace|Id:100;Basri Ket|Counters:LOYALTY=3;Nine Lives|Counters:INCARNATION=5;Valor of the Worthy|AttachedTo:100;Rankle, Master of Pranks|Owner:Human +aiprecast=Basri Ket:CustomScript:DB$ Token | TokenOwner$ You | TokenAmount$ 2 | TokenScript$ w_1_1_soldier +removesummoningsickness=true diff --git a/forge-gui/res/puzzle/PS_STX1.pzl b/forge-gui/res/puzzle/PS_STX1.pzl new file mode 100644 index 00000000000..05ee9736872 --- /dev/null +++ b/forge-gui/res/puzzle/PS_STX1.pzl @@ -0,0 +1,16 @@ +[metadata] +Name:Possibility Storm - Strixhaven #01 +URL:https://i0.wp.com/www.possibilitystorm.com/wp-content/uploads/2021/04/172.-STX1-scaled.jpg +Goal:Win +Turns:1 +Difficulty:Rare +Description:Win this turn. Assume your opponent has no mana available and no cards in hand. +[state] +humanlife=20 +ailife=10 +turn=1 +activeplayer=human +activephase=MAIN1 +humanhand=Hall Monitor;Lorehold Command;Sentinel's Eyes;Venerable Knight +humanbattlefield=Hofri Ghostforge;Fuming Effigy;Plargg, Dean of Chaos|Modal;Plains;Plains;Plains;Mountain;Mountain;Mountain +aibattlefield=Colossal Dreadmaw;Joraga Visionary;Spined Karok diff --git a/forge-gui/res/puzzle/PS_TSR1.pzl b/forge-gui/res/puzzle/PS_TSR1.pzl new file mode 100644 index 00000000000..0726d1d067f --- /dev/null +++ b/forge-gui/res/puzzle/PS_TSR1.pzl @@ -0,0 +1,16 @@ +[metadata] +Name:Possibility Storm - Time Spiral Remastered #01 +URL:https://i2.wp.com/www.possibilitystorm.com/wp-content/uploads/2021/04/171.-TSR1-scaled.jpg +Goal:Win +Turns:1 +Difficulty:Rare +Description:Win this turn. Assume your opponent has no mana available and no cards in hand. +[state] +humanlife=20 +ailife=16 +turn=1 +activeplayer=human +activephase=MAIN1 +humanhand=Thelonite Hermit|Set:TSR;Exquisite Firecraft|Set:TSR;Utopia Mycon|Set:TSR;Haze of Rage|Set:TSR;Grapeshot|Set:TSR +humanbattlefield=Grinning Ignus|Set:TSR;Pendelhaven Elder|Set:TSR;Life and Limb|Set:TSR;Forest;Forest;Forest;Forest;Mountain;Mountain +aibattlefield=Shriekmaw|Set:TSR;Grave Scrabbler|Set:TSR;Nightshade Assassin|Set:TSR From b5bc614c6543fbfdfb234dd70a1ece425be0c805 Mon Sep 17 00:00:00 2001 From: Michael Kamensky Date: Mon, 28 Jun 2021 07:22:11 +0300 Subject: [PATCH 2/3] - Added puzzle PS_STX2 with GameState support. --- .../src/main/java/forge/ai/GameState.java | 20 ++++++++++++++++ forge-gui/res/puzzle/PS_STX2.pzl | 23 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 forge-gui/res/puzzle/PS_STX2.pzl diff --git a/forge-ai/src/main/java/forge/ai/GameState.java b/forge-ai/src/main/java/forge/ai/GameState.java index 19c9bee363e..007c1a4a5eb 100644 --- a/forge-ai/src/main/java/forge/ai/GameState.java +++ b/forge-ai/src/main/java/forge/ai/GameState.java @@ -49,6 +49,7 @@ public abstract class GameState { ZONES.put(ZoneType.Library, "library"); ZONES.put(ZoneType.Exile, "exile"); ZONES.put(ZoneType.Command, "command"); + ZONES.put(ZoneType.Sideboard, "sideboard"); } private int humanLife = -1; @@ -398,6 +399,12 @@ public abstract class GameState { // Need to figure out a better way to detect if it's actually on adventure. newText.append("|OnAdventure"); } + if (c.isForetold()) { + newText.append("|Foretold"); + } + if (c.isForetoldThisTurn()) { + newText.append("|ForetoldThisTurn"); + } } @@ -565,6 +572,13 @@ public abstract class GameState { aiCardTexts.put(ZoneType.Command, categoryValue); } + else if (categoryName.endsWith("sideboard")) { + if (isHuman) + humanCardTexts.put(ZoneType.Sideboard, categoryValue); + else + aiCardTexts.put(ZoneType.Sideboard, categoryValue); + } + else if (categoryName.startsWith("ability")) { abilityString.put(categoryName.substring("ability".length()), categoryValue); } @@ -1391,6 +1405,12 @@ public abstract class GameState { } } else if (info.equals("NoETBTrigs")) { cardsWithoutETBTrigs.add(c); + } else if (info.equals("Foretold")) { + c.setForetold(true); + c.turnFaceDown(true); + c.addMayLookTemp(c.getOwner()); + } else if (info.equals("ForetoldThisTurn")) { + c.setForetoldThisTurn(true); } } diff --git a/forge-gui/res/puzzle/PS_STX2.pzl b/forge-gui/res/puzzle/PS_STX2.pzl new file mode 100644 index 00000000000..82ecc5345b6 --- /dev/null +++ b/forge-gui/res/puzzle/PS_STX2.pzl @@ -0,0 +1,23 @@ +[metadata] +Name:Possibility Storm - Strixhaven: School of Mages #02 +URL:https://i1.wp.com/www.possibilitystorm.com/wp-content/uploads/2021/05/173.-STX2-scaled.jpg +Goal:Win +Turns:1 +Difficulty:Mythic +Description:Win this turn. You have 36 cards remaining in your library. Your opponent has 40. Assume that any that are drawn are not relevant to the puzzle. Mystic Reflection is Foretold in exile and you have three Lessons in your sideboard: Expanded Anatomy, Environmental Sciences, Confront the Past +[state] +humanlife=20 +ailife=19 +turn=2 +activeplayer=human +activephase=MAIN1 +humanhand=Plumb the Forbidden;Peer into the Abyss;Quandrix Command;Poison the Cup +humanlibrary=Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt +humanbattlefield=Kasmina, Enigma Sage|Counters:LOYALTY=4;Garruk, Cursed Huntsman|Counters:LOYALTY=5;Gingerbrute|Counters:P1P1=6;Lorescale Coatl|Counters:P1P1=2;Eyetwitch;Necroblossom Snarl;Necroblossom Snarl;Necroblossom Snarl;Necroblossom Snarl;Vineglimmer Snarl;Vineglimmer Snarl;Vineglimmer Snarl +humanexile=Mystic Reflection|Foretold +humansideboard=Expanded Anatomy;Environmental Sciences;Confront the Past +humanprecast=Garruk, Cursed Huntsman:1 +ailibrary=Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt +aibattlefield=Cubwarden;Eradicator Valkyrie;Chrome Replicator;Glorious Anthem +removesummoningsickness=true +aiprecast=Cubwarden:CustomScript:DB$ Token | TokenAmount$ 2 | TokenScript$ w_1_1_cat_lifelink | TokenOwner$ You;Chrome Replicator:CustomScript:DB$ Token | TokenAmount$ 1 | TokenScript$ c_4_4_a_construct | TokenOwner$ You From 0d30d8659a25c1557368279252a383c19a49e36e Mon Sep 17 00:00:00 2001 From: Michael Kamensky Date: Mon, 28 Jun 2021 12:38:18 +0300 Subject: [PATCH 3/3] - Added puzzles PS_STX3, PS_STX4. Tweaked PS_STX1. - PS_STX4 needs extra AI logic for Leyline Tyrant (DamageDealAi#chkAIDrawback). --- forge-gui/res/puzzle/PS_STX1.pzl | 2 +- forge-gui/res/puzzle/PS_STX3.pzl | 17 +++++++++++++++++ forge-gui/res/puzzle/PS_STX4.pzl | 20 ++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 forge-gui/res/puzzle/PS_STX3.pzl create mode 100644 forge-gui/res/puzzle/PS_STX4.pzl diff --git a/forge-gui/res/puzzle/PS_STX1.pzl b/forge-gui/res/puzzle/PS_STX1.pzl index 05ee9736872..e34789b16f5 100644 --- a/forge-gui/res/puzzle/PS_STX1.pzl +++ b/forge-gui/res/puzzle/PS_STX1.pzl @@ -1,5 +1,5 @@ [metadata] -Name:Possibility Storm - Strixhaven #01 +Name:Possibility Storm - Strixhaven: School of Mages #01 URL:https://i0.wp.com/www.possibilitystorm.com/wp-content/uploads/2021/04/172.-STX1-scaled.jpg Goal:Win Turns:1 diff --git a/forge-gui/res/puzzle/PS_STX3.pzl b/forge-gui/res/puzzle/PS_STX3.pzl new file mode 100644 index 00000000000..0a6c23d41d2 --- /dev/null +++ b/forge-gui/res/puzzle/PS_STX3.pzl @@ -0,0 +1,17 @@ +[metadata] +Name:Possibility Storm - Strixhaven: School of Mages #03 +URL:https://i2.wp.com/www.possibilitystorm.com/wp-content/uploads/2021/05/174.-STX3-scaled.jpg +Goal:Win +Turns:1 +Difficulty:Uncommon +Description:Win this turn. You have five Lessons in your sideboard: Expanded Anatomy, Environmental Sciences, Necrotic Fumes, Containment Breach, Pest Summoning +[state] +humanlife=20 +ailife=9 +turn=1 +activeplayer=human +activephase=MAIN1 +humanhand=Witherbloom Command;Valentin, Dean of the Vein;Cram Session;Bake into a Pie +humanbattlefield=Eyetwitch;Accomplished Alchemist;Bushmeat Poacher;Swamp;Swamp;Swamp;Swamp;Forest;Forest;Forest +humansideboard=Expanded Anatomy;Environmental Sciences;Necrotic Fumes;Containment Breach;Pest Summoning +aibattlefield=t:Giant Wizard,P:4,T:4,Cost:no cost,Color:U,Types:Creature-Giant-Wizard,Keywords:,Image:u_4_4_giant_wizard_khm|Id:1;Giant's Amulet|AttachedTo:1 diff --git a/forge-gui/res/puzzle/PS_STX4.pzl b/forge-gui/res/puzzle/PS_STX4.pzl new file mode 100644 index 00000000000..a21a37e28ff --- /dev/null +++ b/forge-gui/res/puzzle/PS_STX4.pzl @@ -0,0 +1,20 @@ +# TODO: Leyline Tyrant needs additional AI logic to handle paying mana when it dies +[metadata] +Name:Possibility Storm - Strixhaven: School of Mages #04 +URL:https://i2.wp.com/www.possibilitystorm.com/wp-content/uploads/2021/06/175.-STX4-scaled.jpg +Goal:Win +Turns:1 +Difficulty:Rare +Description:Win this turn. Your opponent has seven red mana floating and no other mana sources available. Assume any cards you could draw are not relevant to the puzzle. +[state] +humanlife=1 +ailife=6 +turn=1 +activeplayer=human +activephase=MAIN1 +humanhand=Silverquill Command;Killian, Ink Duelist;Heated Debate;Tome Shredder +humanlibrary=Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt +humanbattlefield=Bonecrusher Giant;Blade Historian;Dogged Pursuit;Dogged Pursuit;Dogged Pursuit;Savai Triome;Savai Triome;Savai Triome;Furycalm Snarl;Furycalm Snarl;Furycalm Snarl +aibattlefield=Leyline Tyrant +ailibrary=Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt;Opt +aipersistentmana=R R R R R R R