1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-11 09:11:12 -09:00

* Reversed target handling of DestroyTargetEffect.

This commit is contained in:
LevelX2 2015-09-08 08:05:07 +02:00
parent 1d97129443
commit 0dcd11cf4b
3 changed files with 23 additions and 26 deletions
Mage.Sets/src/mage/sets/innistrad
Mage/src/mage/abilities/effects/common

View file

@ -28,13 +28,13 @@
package mage.sets.innistrad;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TimingRule;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TimingRule;
import mage.target.common.TargetControlledCreaturePermanent;
/**
@ -46,7 +46,6 @@ public class CacklingCounterpart extends CardImpl {
super(ownerId, 46, "Cackling Counterpart", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{U}{U}");
this.expansionSetCode = "ISD";
// Put a token onto the battlefield that's a copy of target creature you control.
this.getSpellAbility().addEffect(new PutTokenOntoBattlefieldCopyTargetEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
@ -64,5 +63,3 @@ public class CacklingCounterpart extends CardImpl {
return new CacklingCounterpart(this);
}
}

View file

@ -28,13 +28,12 @@
package mage.sets.innistrad;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TimingRule;
import mage.target.common.TargetCreaturePermanent;
@ -48,7 +47,6 @@ public class SilentDeparture extends CardImpl {
super(ownerId, 75, "Silent Departure", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}");
this.expansionSetCode = "ISD";
// Return target creature to its owner's hand.
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());

View file

@ -35,6 +35,7 @@ import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.Target;
import mage.target.targetpointer.FirstTargetPointer;
import mage.target.targetpointer.SecondTargetPointer;
import mage.util.CardUtil;
@ -73,22 +74,23 @@ public class DestroyTargetEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
int affectedTargets = 0;
// if (source.getTargets().size() > 1 && targetPointer instanceof FirstTargetPointer) { // for Rain of Thorns
// for (Target target : source.getTargets()) {
// for (UUID permanentId : target.getTargets()) {
// Permanent permanent = game.getPermanent(permanentId);
// if (permanent != null) {
// permanent.destroy(source.getSourceId(), game, noRegen);
// affectedTargets++;
// }
// }
// }
// } else
for (UUID permanentId : targetPointer.getTargets(game, source)) {
Permanent permanent = game.getPermanent(permanentId);
if (permanent != null) {
permanent.destroy(source.getSourceId(), game, noRegen);
affectedTargets++;
if (source.getTargets().size() > 1 && targetPointer instanceof FirstTargetPointer) { // Decimate
for (Target target : source.getTargets()) {
for (UUID permanentId : target.getTargets()) {
Permanent permanent = game.getPermanent(permanentId);
if (permanent != null) {
permanent.destroy(source.getSourceId(), game, noRegen);
affectedTargets++;
}
}
}
} else {
for (UUID permanentId : targetPointer.getTargets(game, source)) {
Permanent permanent = game.getPermanent(permanentId);
if (permanent != null) {
permanent.destroy(source.getSourceId(), game, noRegen);
affectedTargets++;
}
}
}
return affectedTargets > 0;