mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 02:08:00 +00:00
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:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
18
forge-gui/res/puzzle/PS_GRN7.pzl
Normal file
18
forge-gui/res/puzzle/PS_GRN7.pzl
Normal 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
|
||||
Reference in New Issue
Block a user