mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Reveal cards to human player and add game log when the cards from Command Zone moves to Player's hand.
closes issue #1550
This commit is contained in:
@@ -10,6 +10,7 @@ import forge.GameCommand;
|
||||
import forge.card.CardStateName;
|
||||
import forge.game.Game;
|
||||
import forge.game.GameEntity;
|
||||
import forge.game.GameLogEntryType;
|
||||
import forge.game.GameObject;
|
||||
import forge.game.ability.AbilityKey;
|
||||
import forge.game.ability.AbilityUtils;
|
||||
@@ -431,6 +432,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||
final Player player = sa.getActivatingPlayer();
|
||||
final Card hostCard = sa.getHostCard();
|
||||
final Game game = player.getGame();
|
||||
final List<Card> commandCards = Lists.newArrayList();
|
||||
|
||||
ZoneType destination = ZoneType.smartValueOf(sa.getParam("Destination"));
|
||||
final List<ZoneType> origin = Lists.newArrayList();
|
||||
@@ -664,6 +666,12 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||
tgtC.setExiledWith(host);
|
||||
}
|
||||
movedCard = game.getAction().moveTo(destination, tgtC, sa);
|
||||
if (ZoneType.Hand.equals(destination) && ZoneType.Command.equals(originZone.getZoneType())) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(movedCard.getName()).append(" has moved from Command Zone to ").append(player).append("'s hand.");
|
||||
game.getGameLog().add(GameLogEntryType.ZONE_CHANGE, sb.toString());
|
||||
commandCards.add(movedCard); //add to list to reveal the commandzone cards
|
||||
}
|
||||
// If a card is Exiled from the stack, remove its spells from the stack
|
||||
if (sa.hasParam("Fizzle")) {
|
||||
if (tgtC.isInZone(ZoneType.Exile) || tgtC.isInZone(ZoneType.Hand)
|
||||
@@ -709,6 +717,15 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||
}
|
||||
}
|
||||
|
||||
//reveal command cards that changes zone from command zone to player's hand
|
||||
if (!commandCards.isEmpty()) {
|
||||
for (Player observer : game.getPlayers()){
|
||||
if(!observer.isAI() && !observer.getController().isAI() && observer != player) {
|
||||
observer.getController().reveal(new CardCollection(commandCards), player.getZone(ZoneType.Hand).getZoneType(), player, "Revealed cards in ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
triggerList.triggerChangesZoneAll(game);
|
||||
|
||||
// for things like Gaea's Blessing
|
||||
|
||||
Reference in New Issue
Block a user