forked from External/mage
[DFT] Implement Riverchurn Monument (#13405)
* fix MillCardsTargetEffect to work with multiple targets
This commit is contained in:
parent
f9aa8c1527
commit
f22755d44d
3 changed files with 99 additions and 5 deletions
|
|
@ -10,6 +10,8 @@ import mage.game.Game;
|
|||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
|
@ -38,12 +40,13 @@ public class MillCardsTargetEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
if (player != null) {
|
||||
player.millCards(numberCards.calculate(game, source, this), source, game);
|
||||
return true;
|
||||
for (UUID playerId : getTargetPointer().getTargets(game, source)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.millCards(numberCards.calculate(game, source, this), source, game);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue