mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Fix for Cabal Slaver
Cabal Slaver's ability caused the damaging goblin's controller to discard
This commit is contained in:
parent
57db49fcf0
commit
6c98f4802e
1 changed files with 11 additions and 0 deletions
|
@ -47,12 +47,18 @@ public class DealsDamageToAPlayerAllTriggeredAbility extends TriggeredAbilityImp
|
|||
private final FilterPermanent filter;
|
||||
private final SetTargetPointer setTargetPointer;
|
||||
private final boolean onlyCombat;
|
||||
private final boolean affectsDefendingPlayer;
|
||||
|
||||
public DealsDamageToAPlayerAllTriggeredAbility(Effect effect, FilterPermanent filter, boolean optional, SetTargetPointer setTargetPointer, boolean onlyCombat) {
|
||||
this(effect, filter, optional, setTargetPointer, onlyCombat, false);
|
||||
}
|
||||
|
||||
public DealsDamageToAPlayerAllTriggeredAbility(Effect effect, FilterPermanent filter, boolean optional, SetTargetPointer setTargetPointer, boolean onlyCombat, boolean affectsDefendingPlayer) {
|
||||
super(Zone.BATTLEFIELD, effect, optional);
|
||||
this.setTargetPointer = setTargetPointer;
|
||||
this.filter = filter;
|
||||
this.onlyCombat = onlyCombat;
|
||||
this.affectsDefendingPlayer = affectsDefendingPlayer;
|
||||
}
|
||||
|
||||
public DealsDamageToAPlayerAllTriggeredAbility(final DealsDamageToAPlayerAllTriggeredAbility ability) {
|
||||
|
@ -60,6 +66,7 @@ public class DealsDamageToAPlayerAllTriggeredAbility extends TriggeredAbilityImp
|
|||
this.setTargetPointer = ability.setTargetPointer;
|
||||
this.filter = ability.filter;
|
||||
this.onlyCombat = ability.onlyCombat;
|
||||
this.affectsDefendingPlayer = ability.affectsDefendingPlayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -81,6 +88,10 @@ public class DealsDamageToAPlayerAllTriggeredAbility extends TriggeredAbilityImp
|
|||
for (Effect effect : this.getEffects()) {
|
||||
effect.setValue("damage", event.getAmount());
|
||||
effect.setValue("sourceId", event.getSourceId());
|
||||
if (affectsDefendingPlayer) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
continue;
|
||||
}
|
||||
switch (setTargetPointer) {
|
||||
case PLAYER:
|
||||
effect.setTargetPointer(new FixedTarget(permanent.getControllerId()));
|
||||
|
|
Loading…
Reference in a new issue