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; package mage.abilities.common;
import mage.Constants; import mage.Constants;
import mage.Constants.CardType;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
/** /**
* *
@ -31,8 +33,12 @@ public class BecomesTappedCreatureControlledTriggeredAbility extends TriggeredAb
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { 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) {
return true; Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null && permanent.getControllerId().equals(this.controllerId)
&& permanent.getCardType().contains(CardType.CREATURE)) {
return true;
}
} }
return false; return false;
} }
@ -40,6 +46,5 @@ public class BecomesTappedCreatureControlledTriggeredAbility extends TriggeredAb
@Override @Override
public String getRule() { public String getRule() {
return "When a creature you control becomes tapped, " + super.getRule(); return "When a creature you control becomes tapped, " + super.getRule();
} }
} }