mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Added puzzle PS_GRN7.
- Fixed effect cards lingering in the command zone across Setup Game State calls from the dev mode menu.
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) {
|
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
|
// 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);
|
Map<ZoneType, CardCollectionView> playerCards = new EnumMap<ZoneType, CardCollectionView>(ZoneType.class);
|
||||||
for (Entry<ZoneType, String> kv : cardTexts.entrySet()) {
|
for (Entry<ZoneType, String> kv : cardTexts.entrySet()) {
|
||||||
String value = kv.getValue();
|
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));
|
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) {
|
public final boolean is(final ZoneType zone) {
|
||||||
return zone == zoneType;
|
return zone == zoneType;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user