* Cabal Slaver - Fixed that the discard effect for damaged opponents did not work.

This commit is contained in:
LevelX2 2015-09-02 12:26:16 +02:00
parent 2c4d23bbb4
commit 22adee71ca
2 changed files with 11 additions and 11 deletions

View file

@ -1,16 +1,16 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
@ -20,12 +20,11 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.common;
import mage.abilities.TriggeredAbilityImpl;
@ -43,8 +42,8 @@ import mage.target.targetpointer.FixedTarget;
*
* @author LevelX2
*/
public class DealsDamageToAPlayerAllTriggeredAbility extends TriggeredAbilityImpl {
private final FilterPermanent filter;
private final SetTargetPointer setTargetPointer;
private final boolean onlyCombat;
@ -81,12 +80,12 @@ public class DealsDamageToAPlayerAllTriggeredAbility extends TriggeredAbilityImp
if (!setTargetPointer.equals(SetTargetPointer.NONE)) {
for (Effect effect : this.getEffects()) {
effect.setValue("damage", event.getAmount());
switch(setTargetPointer) {
switch (setTargetPointer) {
case PLAYER:
effect.setTargetPointer(new FixedTarget(permanent.getControllerId()));
break;
case PERMANENT:
effect.setTargetPointer(new FixedTarget(permanent.getId()));
effect.setTargetPointer(new FixedTarget(permanent.getId(), permanent.getZoneChangeCounter(game)));
break;
}
@ -100,7 +99,7 @@ public class DealsDamageToAPlayerAllTriggeredAbility extends TriggeredAbilityImp
@Override
public String getRule() {
return "Whenever " + filter.getMessage() + " deals "+(onlyCombat ? "combat ":"") + "damage to a player, " + super.getRule();
return "Whenever " + filter.getMessage() + " deals " + (onlyCombat ? "combat " : "") + "damage to a player, " + super.getRule();
}
}