mirror of
https://github.com/correl/mage.git
synced 2024-12-26 19:16:54 +00:00
* Skirk Commando - Fixed triggered ability.
This commit is contained in:
parent
f0950518e9
commit
87f590f6b8
1 changed files with 10 additions and 4 deletions
|
@ -41,6 +41,7 @@ import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
|
import mage.players.Player;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -50,7 +51,7 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
public class SkirkCommando extends CardImpl {
|
public class SkirkCommando extends CardImpl {
|
||||||
|
|
||||||
public SkirkCommando(UUID ownerId, CardSetInfo setInfo) {
|
public SkirkCommando(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}{R}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{R}");
|
||||||
this.subtype.add(SubType.GOBLIN);
|
this.subtype.add(SubType.GOBLIN);
|
||||||
|
|
||||||
this.power = new MageInt(2);
|
this.power = new MageInt(2);
|
||||||
|
@ -87,9 +88,14 @@ class SkirkCommandoTriggeredAbility extends DealsCombatDamageToAPlayerTriggeredA
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
if (super.checkTrigger(event, game)) {
|
if (super.checkTrigger(event, game)) {
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature that player controls");
|
Player player = game.getPlayer(event.getPlayerId());
|
||||||
filter.add(new ControllerIdPredicate(event.getPlayerId()));
|
if (player != null) {
|
||||||
addTarget(new TargetCreaturePermanent(filter));
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue