diff --git a/.gitattributes b/.gitattributes index 7ca5272319b..5bbd713b54a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -19004,7 +19004,9 @@ forge-gui/res/music/menus/Evil[!!-~]March.mp3 -text forge-gui/res/music/menus/Heroic[!!-~]Age.mp3 -text forge-gui/res/music/menus/Lord[!!-~]of[!!-~]the[!!-~]Land.mp3 -text forge-gui/res/music/menus/The[!!-~]Pyre.mp3 -text +forge-gui/res/puzzle/PM3[!!-~]-[!!-~]Critical[!!-~]to[!!-~]Win.pzl -text forge-gui/res/puzzle/PS1.pzl -text +forge-gui/res/puzzle/PS2.pzl -text forge-gui/res/quest/bazaar/ape_pet_l1.txt -text forge-gui/res/quest/bazaar/ape_pet_l2.txt -text forge-gui/res/quest/bazaar/ape_pet_l3.txt -text diff --git a/forge-ai/src/main/java/forge/ai/GameState.java b/forge-ai/src/main/java/forge/ai/GameState.java index 230172270b5..88a339dd01e 100644 --- a/forge-ai/src/main/java/forge/ai/GameState.java +++ b/forge-ai/src/main/java/forge/ai/GameState.java @@ -15,6 +15,7 @@ import com.google.common.collect.Lists; import forge.card.CardStateName; import forge.game.Game; import forge.game.GameEntity; +import forge.game.ability.AbilityFactory; import forge.game.ability.effects.DetachedCardEffect; import forge.game.card.Card; import forge.game.card.CardCollection; @@ -51,6 +52,8 @@ public abstract class GameState { private final Map idToCard = new HashMap<>(); private final Map cardToAttachId = new HashMap<>(); + private final Map abilityString = new HashMap<>(); + private String tChangePlayer = "NONE"; private String tChangePhase = "NONE"; @@ -286,6 +289,10 @@ public abstract class GameState { aiCardTexts.put(ZoneType.Command, categoryValue); } + else if (categoryName.startsWith("ability")) { + abilityString.put(categoryName.substring("ability".length()), categoryValue); + } + else { System.out.println("Unknown key: " + categoryName); } @@ -452,6 +459,9 @@ public abstract class GameState { } else if (info.startsWith("Attaching:")) { int id = Integer.parseInt(info.substring(info.indexOf(':') + 1)); cardToAttachId.put(c, id); + } else if (info.startsWith("Ability:")) { + String abString = info.substring(info.indexOf(':') + 1).toLowerCase(); + c.addSpellAbility(AbilityFactory.getAbility(abilityString.get(abString), c)); } } diff --git a/forge-gui/res/puzzle/PM3 - Critical to Win.pzl b/forge-gui/res/puzzle/PM3 - Critical to Win.pzl new file mode 100644 index 00000000000..302bd5d181d --- /dev/null +++ b/forge-gui/res/puzzle/PM3 - Critical to Win.pzl @@ -0,0 +1,18 @@ +[metadata] +Name:Puzzling Magic #3 - Critical to Win +URL:http://www.gatheringmagic.com/puzzling-magic-3-%E2%80%93-critical-to-win/ +Goal:Win +Turns:1 +Difficulty:Medium +[state] +ActivePlayer=Human +ActivePhase=Main1 +HumanLife=7 +AILife=5 +HumanPlay=Blind Zealot; Mortis Dogs|Id:2; Shrine of Boundless Growth|Counters:CHARGE=7|Id:3; Strider Harness|Attaching:2; Viridian Harvest|Attaching:3; Plains; Forest; Swamp; Swamp +HumanHand=Gut Shot; Karn Liberated; Noxious Revival; Phyrexian Metamorph +AIPlay=Alpha Tyrranax; Caustic Hound|Id:1; Batterskull|Attaching:1; Fangren Marauder|Tapped; Soul Conduit; Forest; Forest; Forest; Mountain; Mountain; Mountain +# Ramp difficulty by changing +# A) Noxious Revival => Surgical Extraction +# B) Blind Zealot => Pro Artifacts, Apostle's Blessing => Your graveyard +# C) Blind Zealout => -1/-1 Counter \ No newline at end of file diff --git a/forge-gui/res/puzzle/PS1.pzl b/forge-gui/res/puzzle/PS1.pzl index d1fb1ee4479..9373588a9a5 100644 --- a/forge-gui/res/puzzle/PS1.pzl +++ b/forge-gui/res/puzzle/PS1.pzl @@ -3,6 +3,7 @@ Name:Possibility Storm #1 URL:https://i.redd.it/wws1h03gy7ky.png Goal:Win Turns:1 +Difficulty:Easy [state] ActivePlayer=Human ActivePhase=Main1 diff --git a/forge-gui/res/puzzle/PS2.pzl b/forge-gui/res/puzzle/PS2.pzl new file mode 100644 index 00000000000..c78f6f23744 --- /dev/null +++ b/forge-gui/res/puzzle/PS2.pzl @@ -0,0 +1,17 @@ +[metadata] +Name:Possibility Storm #2 +URL:https://i.redd.it/e7t8ck386lly.png +Goal:Win +Turns:1 +Difficulty:Medium +[state] +ActivePlayer=Human +ActivePhase=Main1 +HumanLife=20 +humancounters=ENERGY=3 +AILife=15 +humanhand=Savage Alliance;Hungry Flames;Confiscation Coup;Tezzeret's Touch;Yahenni's Expertise +humanbattlefield=Island;Swamp;Swamp;Mountain;Electrostatic Pummeler;Tezzeret the Schemer|Counters:LOYALTY=7;t:Etherium Cell,P:0,T:0,Cost:no cost,Types:Artifact,Keywords:,Image:c_etherium_cell|Ability:Petal;t:Etherium Cell,P:0,T:0,Cost:no cost,Types:Artifact,Keywords:,Image:c_etherium_cell|Ability:Petal;t:Etherium Cell,P:0,T:0,Cost:no cost,Types:Artifact,Keywords:,Image:c_etherium_cell|Ability:Petal;t:Etherium Cell,P:0,T:0,Cost:no cost,Types:Artifact,Keywords:,Image:c_etherium_cell|Ability:Petal +aihand=Island;Bound by Moonsilver;Plains;Plains;Emissary of the Sleepless;Nearheath Chaplain;Plains +aibattlefield=Kessig Dire Swine;Brood Monitor;Consulate Skygate;t:Servo,P:1,T:1,Cost:no cost,Types:Artifact-Creature-Servo,Keywords:,Image:c_1_1_servo3;t:Servo,P:1,T:1,Cost:no cost,Types:Artifact-Creature-Servo,Keywords:,Image:c_1_1_servo3;t:Servo,P:1,T:1,Cost:no cost,Types:Artifact-Creature-Servo,Keywords:,Image:c_1_1_servo3;t:Servo,P:1,T:1,Cost:no cost,Types:Artifact-Creature-Servo,Keywords:,Image:c_1_1_servo3 +AbilityPetal=AB$ Mana | Cost$ T Sac<1/CARDNAME> | Produced$ Any | SpellDescription$ Add one mana of any color to your mana pool. \ No newline at end of file diff --git a/forge-gui/src/main/java/forge/puzzle/Puzzle.java b/forge-gui/src/main/java/forge/puzzle/Puzzle.java index 15e4e56250f..6892df90160 100644 --- a/forge-gui/src/main/java/forge/puzzle/Puzzle.java +++ b/forge-gui/src/main/java/forge/puzzle/Puzzle.java @@ -20,6 +20,7 @@ public class Puzzle extends GameState implements InventoryItem { String name; String goal; String url; + String difficulty; int turns; public Puzzle(Map> puzzleLines) { @@ -39,6 +40,8 @@ public class Puzzle extends GameState implements InventoryItem { this.url = split[1]; } else if ("Turns".equalsIgnoreCase(split[0])) { this.turns = Integer.parseInt(split[1]); + } else if ("Difficulty".equalsIgnoreCase(split[0])) { + this.difficulty = split[1]; } } }