Fix for Cabal Slaver

Cabal Slaver's ability caused the damaging goblin's controller to discard
This commit is contained in:
L_J 2018-03-31 00:06:44 +00:00 committed by GitHub
parent 57db49fcf0
commit 6c98f4802e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()));