mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
Fixed that it only is triggered by creatures.
This commit is contained in:
parent
f457817a05
commit
da289a7f67
1 changed files with 9 additions and 4 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue