mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08:00
* Cragganwick Cremator - Fixed that wrongly the target player discards a card instead of the spell controller.
This commit is contained in:
parent
5981816a4b
commit
67d78f19ee
1 changed files with 9 additions and 9 deletions
|
|
@ -31,9 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -42,7 +40,6 @@ import mage.constants.Rarity;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -94,15 +91,18 @@ class CragganwickCrematorEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
Player targetedPlayer = game.getPlayer(source.getFirstTarget());
|
||||
if (you != null && targetedPlayer != null) {
|
||||
Card discardedCard = targetedPlayer.discardOne(true, source, game);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
|
||||
if (controller != null) {
|
||||
Card discardedCard = controller.discardOne(true, source, game);
|
||||
if (discardedCard != null
|
||||
&& discardedCard.getCardType().contains(CardType.CREATURE)) {
|
||||
Player targetedPlayer = game.getPlayer(source.getFirstTarget());
|
||||
if (targetedPlayer != null) {
|
||||
int damage = discardedCard.getPower().getValue();
|
||||
targetedPlayer.damage(damage, source.getSourceId(), game, false, true);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue