mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
- Extracted reveal to players function into Game.
- Cascade will no longer call GuiChoose for AI vs AI matches
This commit is contained in:
@@ -8,6 +8,7 @@ import java.util.Random;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import forge.Card;
|
||||
import forge.CardCharacteristicName;
|
||||
@@ -1346,12 +1347,7 @@ public class ChangeZoneAi extends SpellAbilityAi {
|
||||
&& !sa.hasParam("NoReveal")) {
|
||||
final String picked = player + " picked:";
|
||||
|
||||
List<Player> otherPlayers = game.getPlayers();
|
||||
for (Player p : otherPlayers) {
|
||||
if (!p.equals(player)) {
|
||||
p.getController().reveal(picked, fetched, destination, player);
|
||||
}
|
||||
}
|
||||
game.revealToPlayers(picked, fetched, destination, Lists.newArrayList(player));
|
||||
}
|
||||
} // end changeHiddenOriginResolveAI
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ package forge.game;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -640,4 +641,13 @@ public class Game {
|
||||
public void setAge(GameAge value) {
|
||||
age = value;
|
||||
}
|
||||
|
||||
public void revealToPlayers(String string, Collection<Card> cards, ZoneType zone, List<Player> skipReveal) {
|
||||
List<Player> allPlayers = this.getPlayers();
|
||||
for (Player p : allPlayers) {
|
||||
if (skipReveal != null && !skipReveal.contains(p)) {
|
||||
p.getController().reveal(string, cards, zone, p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,8 @@ public final class GameActionUtil {
|
||||
}
|
||||
|
||||
} // while
|
||||
GuiChoose.oneOrNone("Revealed cards:", revealed);
|
||||
|
||||
game.revealToPlayers("Revealed Cascade Cards:", revealed, ZoneType.Library, null);
|
||||
|
||||
if (cascadedCard != null) {
|
||||
Player p = cascadedCard.getController();
|
||||
|
||||
Reference in New Issue
Block a user