Merge pull request #4139 from Zzooouhh/master

Implemented a whole bunch of cards + fixes for #4131, #4137, #4138 and #4090
This commit is contained in:
LevelX2 2017-11-02 14:08:26 +01:00 committed by GitHub
commit 583033ff3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 2235 additions and 42 deletions

View file

@ -10,6 +10,7 @@ import mage.abilities.effects.RedirectionEffect;
import mage.constants.Duration;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
/**
*
@ -33,9 +34,14 @@ public class RedirectDamageFromSourceToTargetEffect extends RedirectionEffect {
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getTargetId().equals(source.getSourceId())) {
this.redirectTarget = source.getTargets().get(0);
return true;
Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId());
if (permanent != null) {
if (event.getTargetId().equals(source.getSourceId())) {
if (getTargetPointer().getFirst(game, source) != null) {
this.redirectTarget = source.getTargets().get(0);
return true;
}
}
}
return false;
}