mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08: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;
|
package mage.sets.fatereforged;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.common.DamageTargetEffect;
|
import mage.abilities.effects.common.DamageTargetEffect;
|
||||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
|
|
@ -49,10 +50,9 @@ public class CunningStrike extends CardImpl {
|
||||||
this.expansionSetCode = "FRF";
|
this.expansionSetCode = "FRF";
|
||||||
|
|
||||||
// Cunning Strike deals 2 damage to target creature and 2 damage to target player.
|
// 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());
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||||
|
Effect effect = new DamageTargetEffect(new StaticValue(2), true, "", true);
|
||||||
Effect effect = new DamageTargetEffect(2);
|
|
||||||
effect.setTargetPointer(new SecondTargetPointer());
|
effect.setTargetPointer(new SecondTargetPointer());
|
||||||
effect.setText("and 2 damage to target player");
|
effect.setText("and 2 damage to target player");
|
||||||
this.getSpellAbility().addEffect(effect);
|
this.getSpellAbility().addEffect(effect);
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ public class DamageTargetEffect extends OneShotEffect {
|
||||||
protected DynamicValue amount;
|
protected DynamicValue amount;
|
||||||
protected boolean preventable;
|
protected boolean preventable;
|
||||||
protected String targetDescription;
|
protected String targetDescription;
|
||||||
|
protected boolean useOnlyTargetPointer;
|
||||||
|
|
||||||
public DamageTargetEffect(int amount) {
|
public DamageTargetEffect(int amount) {
|
||||||
this(new StaticValue(amount), true);
|
this(new StaticValue(amount), true);
|
||||||
|
|
@ -72,10 +73,15 @@ public class DamageTargetEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
public DamageTargetEffect(DynamicValue amount, boolean preventable, String targetDescription) {
|
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);
|
super(Outcome.Damage);
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
this.preventable = preventable;
|
this.preventable = preventable;
|
||||||
this.targetDescription = targetDescription;
|
this.targetDescription = targetDescription;
|
||||||
|
this.useOnlyTargetPointer = useOnlyTargetPointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getAmount() {
|
public int getAmount() {
|
||||||
|
|
@ -95,6 +101,7 @@ public class DamageTargetEffect extends OneShotEffect {
|
||||||
this.amount = effect.amount.copy();
|
this.amount = effect.amount.copy();
|
||||||
this.preventable = effect.preventable;
|
this.preventable = effect.preventable;
|
||||||
this.targetDescription = effect.targetDescription;
|
this.targetDescription = effect.targetDescription;
|
||||||
|
this.useOnlyTargetPointer = effect.useOnlyTargetPointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -104,7 +111,7 @@ public class DamageTargetEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
if (source.getTargets().size() > 1) {
|
if (!useOnlyTargetPointer && source.getTargets().size() > 1) {
|
||||||
for (Target target : source.getTargets()) {
|
for (Target target : source.getTargets()) {
|
||||||
for (UUID targetId : target.getTargets()) {
|
for (UUID targetId : target.getTargets()) {
|
||||||
Permanent permanent = game.getPermanent(targetId);
|
Permanent permanent = game.getPermanent(targetId);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue