mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
Fix DealsDamageToOpponentTriggeredAbility unconditionally overwriting the targets of any effects added to it.
This fixes at least Charnelhoard Wurm, and possibly other similar abilities.
This commit is contained in:
parent
a2e1e2e614
commit
6d90539b7b
7 changed files with 20 additions and 12 deletions
|
|
@ -40,24 +40,30 @@ import mage.target.targetpointer.FixedTarget;
|
|||
*/
|
||||
public class DealsDamageToOpponentTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
boolean onlyCombat;
|
||||
private final boolean onlyCombat, setTargetPointer;
|
||||
|
||||
public DealsDamageToOpponentTriggeredAbility(Effect effect) {
|
||||
this(effect, false, false);
|
||||
this(effect, false, false, false);
|
||||
}
|
||||
|
||||
public DealsDamageToOpponentTriggeredAbility(Effect effect, boolean optional) {
|
||||
this(effect, optional, false);
|
||||
this(effect, optional, false, false);
|
||||
}
|
||||
|
||||
public DealsDamageToOpponentTriggeredAbility(Effect effect, boolean optional, boolean onlyCombat) {
|
||||
this(effect, optional, onlyCombat, false);
|
||||
}
|
||||
|
||||
public DealsDamageToOpponentTriggeredAbility(Effect effect, boolean optional, boolean onlyCombat, boolean setTargetPointer) {
|
||||
super(Zone.BATTLEFIELD, effect, optional);
|
||||
this.onlyCombat = onlyCombat;
|
||||
this.setTargetPointer = setTargetPointer;
|
||||
}
|
||||
|
||||
public DealsDamageToOpponentTriggeredAbility(final DealsDamageToOpponentTriggeredAbility ability) {
|
||||
super(ability);
|
||||
this.onlyCombat = ability.onlyCombat;
|
||||
this.setTargetPointer = ability.setTargetPointer;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -80,9 +86,11 @@ public class DealsDamageToOpponentTriggeredAbility extends TriggeredAbilityImpl
|
|||
return false;
|
||||
}
|
||||
}
|
||||
for (Effect effect : getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
effect.setValue("damage", event.getAmount());
|
||||
if(setTargetPointer) {
|
||||
for (Effect effect : getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
effect.setValue("damage", event.getAmount());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue