Merge branch 'puzzle-engine' into 'master'

Added puzzle PS_GRN7 (Possibility Storm - Guilds of Ravnica 07). Fixed Setup Game State not clearing effect cards from command zone.

See merge request core-developers/forge!1120
This commit is contained in:
Michael Kamensky
2018-11-20 05:17:28 +00:00
3 changed files with 37 additions and 0 deletions

View File

@@ -1004,6 +1004,12 @@ public abstract class GameState {
private void setupPlayerState(int life, Map<ZoneType, String> cardTexts, final Player p, final int landsPlayed, final int landsPlayedLastTurn) {
// Lock check static as we setup player state
// Clear all zones first, this ensures that any lingering cards and effects (e.g. in command zone) get cleared up
// before setting up a new state
for (ZoneType zt : ZONES.keySet()) {
p.getZone(zt).removeAllCards(true);
}
Map<ZoneType, CardCollectionView> playerCards = new EnumMap<ZoneType, CardCollectionView>(ZoneType.class);
for (Entry<ZoneType, String> kv : cardTexts.entrySet()) {
String value = kv.getValue();

View File

@@ -141,6 +141,19 @@ public class Zone implements java.io.Serializable, Iterable<Card> {
game.fireEvent(new GameEventZone(zoneType, getPlayer(), EventValueChangeType.ComplexUpdate, null));
}
public final void removeAllCards(boolean forcedWithoutEvents) {
if (forcedWithoutEvents) {
cardList.clear();
} else {
for (Card c : cardList) {
if (cardList.remove(c)) {
onChanged();
game.fireEvent(new GameEventZone(zoneType, getPlayer(), EventValueChangeType.Removed, c));
}
}
}
}
public final boolean is(final ZoneType zone) {
return zone == zoneType;
}

View File

@@ -0,0 +1,18 @@
[metadata]
Name:Possibility Storm - Guilds of Ravnica #07
URL:http://www.possibilitystorm.com/wp-content/uploads/2018/11/089.-GRN7.jpg
Goal:Win
Turns:1
Difficulty:Rare
Description:Win this turn. Remember that your answer must satisfy all possible blocking scenarios. Assume the top three cards of your opponent's library are all basic Forests. Titanic Growth and Prying Blade are exiled with your Thief of Sanity.
[state]
humanlife=20
ailife=14
turn=1
activeplayer=human
activephase=MAIN1
humanhand=Urza's Ruinous Blast;The Eldest Reborn;Demonic Vigor;Switcheroo
humanbattlefield=Thief of Sanity|Id:1|RememberedCards:2,3|ExecuteScript:DBEffect;Etrata, the Silencer;Steadfast Armasaur;Goring Ceratops;Watery Grave|NoETBTrigs;Watery Grave|NoETBTrigs;Watery Grave|NoETBTrigs;Glacial Fortress;Glacial Fortress;Glacial Fortress;Glacial Fortress
ailibrary=Forest;Forest;Forest
aibattlefield=Kraul Harpooner;Primordial Wurm;Trostani Discordant
aiexile=Titanic Growth|Id:2|ExiledWith:1|FaceDown;Prying Blade|Id:3|ExiledWith:1|FaceDown