Some more fixes for Puzzle mode

This commit is contained in:
Sol
2017-05-09 02:04:08 +00:00
parent dcd08f0954
commit 546b9ac214
6 changed files with 51 additions and 0 deletions

2
.gitattributes vendored
View File

@@ -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/Heroic[!!-~]Age.mp3 -text
forge-gui/res/music/menus/Lord[!!-~]of[!!-~]the[!!-~]Land.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/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/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_l1.txt -text
forge-gui/res/quest/bazaar/ape_pet_l2.txt -text forge-gui/res/quest/bazaar/ape_pet_l2.txt -text
forge-gui/res/quest/bazaar/ape_pet_l3.txt -text forge-gui/res/quest/bazaar/ape_pet_l3.txt -text

View File

@@ -15,6 +15,7 @@ import com.google.common.collect.Lists;
import forge.card.CardStateName; import forge.card.CardStateName;
import forge.game.Game; import forge.game.Game;
import forge.game.GameEntity; import forge.game.GameEntity;
import forge.game.ability.AbilityFactory;
import forge.game.ability.effects.DetachedCardEffect; import forge.game.ability.effects.DetachedCardEffect;
import forge.game.card.Card; import forge.game.card.Card;
import forge.game.card.CardCollection; import forge.game.card.CardCollection;
@@ -51,6 +52,8 @@ public abstract class GameState {
private final Map<Integer, Card> idToCard = new HashMap<>(); private final Map<Integer, Card> idToCard = new HashMap<>();
private final Map<Card, Integer> cardToAttachId = new HashMap<>(); private final Map<Card, Integer> cardToAttachId = new HashMap<>();
private final Map<String, String> abilityString = new HashMap<>();
private String tChangePlayer = "NONE"; private String tChangePlayer = "NONE";
private String tChangePhase = "NONE"; private String tChangePhase = "NONE";
@@ -286,6 +289,10 @@ public abstract class GameState {
aiCardTexts.put(ZoneType.Command, categoryValue); aiCardTexts.put(ZoneType.Command, categoryValue);
} }
else if (categoryName.startsWith("ability")) {
abilityString.put(categoryName.substring("ability".length()), categoryValue);
}
else { else {
System.out.println("Unknown key: " + categoryName); System.out.println("Unknown key: " + categoryName);
} }
@@ -452,6 +459,9 @@ public abstract class GameState {
} else if (info.startsWith("Attaching:")) { } else if (info.startsWith("Attaching:")) {
int id = Integer.parseInt(info.substring(info.indexOf(':') + 1)); int id = Integer.parseInt(info.substring(info.indexOf(':') + 1));
cardToAttachId.put(c, id); 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));
} }
} }

View File

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

View File

@@ -3,6 +3,7 @@ Name:Possibility Storm #1
URL:https://i.redd.it/wws1h03gy7ky.png URL:https://i.redd.it/wws1h03gy7ky.png
Goal:Win Goal:Win
Turns:1 Turns:1
Difficulty:Easy
[state] [state]
ActivePlayer=Human ActivePlayer=Human
ActivePhase=Main1 ActivePhase=Main1

View File

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

View File

@@ -20,6 +20,7 @@ public class Puzzle extends GameState implements InventoryItem {
String name; String name;
String goal; String goal;
String url; String url;
String difficulty;
int turns; int turns;
public Puzzle(Map<String, List<String>> puzzleLines) { public Puzzle(Map<String, List<String>> puzzleLines) {
@@ -39,6 +40,8 @@ public class Puzzle extends GameState implements InventoryItem {
this.url = split[1]; this.url = split[1];
} else if ("Turns".equalsIgnoreCase(split[0])) { } else if ("Turns".equalsIgnoreCase(split[0])) {
this.turns = Integer.parseInt(split[1]); this.turns = Integer.parseInt(split[1]);
} else if ("Difficulty".equalsIgnoreCase(split[0])) {
this.difficulty = split[1];
} }
} }
} }