* Skirk Commando - Fixed triggered ability.

This commit is contained in:
LevelX2 2018-03-13 23:19:36 +01:00
parent f0950518e9
commit 87f590f6b8

View file

@ -41,6 +41,7 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
/**
@ -87,9 +88,14 @@ class SkirkCommandoTriggeredAbility extends DealsCombatDamageToAPlayerTriggeredA
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (super.checkTrigger(event, game)) {
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature that player controls");
Player player = game.getPlayer(event.getPlayerId());
if (player != null) {
getTargets().clear();
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature that player " + player.getName() + " controls");
filter.add(new ControllerIdPredicate(event.getPlayerId()));
addTarget(new TargetCreaturePermanent(filter));
return true;
}
}
return false;
}