Fixed that it only is triggered by creatures.

This commit is contained in:
LevelX2 2013-03-09 18:38:29 +01:00
parent f457817a05
commit da289a7f67

View file

@ -5,10 +5,12 @@
package mage.abilities.common;
import mage.Constants;
import mage.Constants.CardType;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
/**
*
@ -31,9 +33,13 @@ public class BecomesTappedCreatureControlledTriggeredAbility extends TriggeredAb
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.TAPPED && game.getPermanent(event.getTargetId()).getControllerId().equals(this.controllerId)) {
if (event.getType() == GameEvent.EventType.TAPPED) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null && permanent.getControllerId().equals(this.controllerId)
&& permanent.getCardType().contains(CardType.CREATURE)) {
return true;
}
}
return false;
}
@ -41,5 +47,4 @@ public class BecomesTappedCreatureControlledTriggeredAbility extends TriggeredAb
public String getRule() {
return "When a creature you control becomes tapped, " + super.getRule();
}
}