mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
* Cunning Strike - Fixed that double damage (2 x 2 to each target) was dealt.
This commit is contained in:
parent
54e0068053
commit
ba8290a0c0
2 changed files with 11 additions and 4 deletions
|
@ -28,6 +28,7 @@
|
|||
package mage.sets.fatereforged;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
|
@ -49,10 +50,9 @@ public class CunningStrike extends CardImpl {
|
|||
this.expansionSetCode = "FRF";
|
||||
|
||||
// Cunning Strike deals 2 damage to target creature and 2 damage to target player.
|
||||
this.getSpellAbility().addEffect(new DamageTargetEffect(2));
|
||||
this.getSpellAbility().addEffect(new DamageTargetEffect(new StaticValue(2), true, "", true));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
|
||||
Effect effect = new DamageTargetEffect(2);
|
||||
Effect effect = new DamageTargetEffect(new StaticValue(2), true, "", true);
|
||||
effect.setTargetPointer(new SecondTargetPointer());
|
||||
effect.setText("and 2 damage to target player");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
|
|
|
@ -50,6 +50,7 @@ public class DamageTargetEffect extends OneShotEffect {
|
|||
protected DynamicValue amount;
|
||||
protected boolean preventable;
|
||||
protected String targetDescription;
|
||||
protected boolean useOnlyTargetPointer;
|
||||
|
||||
public DamageTargetEffect(int amount) {
|
||||
this(new StaticValue(amount), true);
|
||||
|
@ -72,10 +73,15 @@ public class DamageTargetEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
public DamageTargetEffect(DynamicValue amount, boolean preventable, String targetDescription) {
|
||||
this(amount, preventable, targetDescription, false);
|
||||
}
|
||||
|
||||
public DamageTargetEffect(DynamicValue amount, boolean preventable, String targetDescription, boolean useOnlyTargetPointer) {
|
||||
super(Outcome.Damage);
|
||||
this.amount = amount;
|
||||
this.preventable = preventable;
|
||||
this.targetDescription = targetDescription;
|
||||
this.useOnlyTargetPointer = useOnlyTargetPointer;
|
||||
}
|
||||
|
||||
public int getAmount() {
|
||||
|
@ -95,6 +101,7 @@ public class DamageTargetEffect extends OneShotEffect {
|
|||
this.amount = effect.amount.copy();
|
||||
this.preventable = effect.preventable;
|
||||
this.targetDescription = effect.targetDescription;
|
||||
this.useOnlyTargetPointer = effect.useOnlyTargetPointer;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -104,7 +111,7 @@ public class DamageTargetEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (source.getTargets().size() > 1) {
|
||||
if (!useOnlyTargetPointer && source.getTargets().size() > 1) {
|
||||
for (Target target : source.getTargets()) {
|
||||
for (UUID targetId : target.getTargets()) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
|
|
Loading…
Reference in a new issue