mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 12:19:59 -08:00
* Persecute - Fixed that the discard was done for the controller of Persecute instead of the target player.
This commit is contained in:
parent
49fe489c0f
commit
9d3aefe05b
1 changed files with 5 additions and 4 deletions
|
|
@ -89,7 +89,8 @@ class PersecuteEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (controller != null && sourceObject != null) {
|
||||
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
if (controller != null && sourceObject != null && targetPlayer != null) {
|
||||
ChoiceColor choice = new ChoiceColor();
|
||||
while (!choice.isChosen()) {
|
||||
controller.choose(outcome, choice, game);
|
||||
|
|
@ -100,12 +101,12 @@ class PersecuteEffect extends OneShotEffect {
|
|||
if (choice.getColor() == null) {
|
||||
return false;
|
||||
}
|
||||
Cards hand = controller.getHand();
|
||||
controller.revealCards(sourceObject.getIdName(), hand, game);
|
||||
Cards hand = targetPlayer.getHand();
|
||||
targetPlayer.revealCards(sourceObject.getIdName(), hand, game);
|
||||
Set<Card> cards = hand.getCards(game);
|
||||
for (Card card : cards) {
|
||||
if (card != null && card.getColor(game).shares(choice.getColor())) {
|
||||
controller.discard(card, source, game);
|
||||
targetPlayer.discard(card, source, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue