* Fixed some redirect effect sthat were implemented as prevention effects (fixes #1216).

This commit is contained in:
LevelX2 2015-10-20 22:58:24 +02:00
parent d58288da6d
commit 701a722904
9 changed files with 176 additions and 225 deletions

View file

@ -0,0 +1,42 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.effects.RedirectionEffect;
import mage.constants.Duration;
import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author LevelX2
*/
public class RedirectDamageFromSourceToTargetEffect extends RedirectionEffect {
public RedirectDamageFromSourceToTargetEffect(Duration duration, int amountToRedirect, boolean oneUsage) {
super(duration, amountToRedirect, oneUsage);
staticText = "The next " + amountToRedirect + " damage that would be dealt to {this} this turn is dealt to target creature you control instead.";
}
public RedirectDamageFromSourceToTargetEffect(final RedirectDamageFromSourceToTargetEffect effect) {
super(effect);
}
@Override
public RedirectDamageFromSourceToTargetEffect copy() {
return new RedirectDamageFromSourceToTargetEffect(this);
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getTargetId().equals(source.getSourceId())) {
this.redirectTarget = source.getTargets().get(0);
return true;
}
return false;
}
}