(final PlayerCollection millers, final int numCards, final ZoneType destination, final SpellAbility sa, final Map<AbilityKey, Object> moveParams)
| 2658 | } |
| 2659 | |
| 2660 | public CardCollection mill(final PlayerCollection millers, final int numCards, final ZoneType destination, final SpellAbility sa, final Map<AbilityKey, Object> moveParams) { |
| 2661 | final boolean showRevealDialog = sa != null && sa.hasParam("ShowMilledCards"); |
| 2662 | |
| 2663 | final CardCollection milled = new CardCollection(); |
| 2664 | |
| 2665 | for (final Player p : millers) { |
| 2666 | if (!p.isInGame()) { |
| 2667 | continue; |
| 2668 | } |
| 2669 | |
| 2670 | final CardCollectionView milledPlayer = p.mill(numCards, destination, sa, moveParams); |
| 2671 | milled.addAll(milledPlayer); |
| 2672 | |
| 2673 | // Reveal the milled cards, so players don't have to manually inspect the |
| 2674 | // graveyard to figure out which ones were milled. |
| 2675 | String toZoneStr = destination.equals(ZoneType.Graveyard) ? "" : " (" + |
| 2676 | Localizer.getInstance().getMessage("lblMilledToZone", destination.getTranslatedName()) + ")"; |
| 2677 | if (showRevealDialog) { |
| 2678 | final String message = Localizer.getInstance().getMessage("lblMilledCards"); |
| 2679 | final boolean addSuffix = !toZoneStr.isEmpty(); |
| 2680 | reveal(milledPlayer, destination, p, false, message, addSuffix); |
| 2681 | } |
| 2682 | game.fireEvent(new GameEventAddLog(GameLogEntryType.ZONE_CHANGE, p + " milled " + |
| 2683 | Lang.joinHomogenous(milledPlayer) + toZoneStr + ".")); |
| 2684 | } |
| 2685 | |
| 2686 | if (!milled.isEmpty()) { |
| 2687 | final Map<AbilityKey, Object> runParams = AbilityKey.newMap(); |
| 2688 | runParams.put(AbilityKey.Cards, milled); |
| 2689 | game.getTriggerHandler().runTrigger(TriggerType.MilledAll, runParams, false); |
| 2690 | } |
| 2691 | |
| 2692 | return milled; |
| 2693 | } |
| 2694 | |
| 2695 | public void dealDamage(final boolean isCombat, final CardDamageTable damageMap, final CardDamageTable preventMap, |
| 2696 | final GameEntityCounterTable counterTable, final SpellAbility cause) { |
nothing calls this directly
no test coverage detected