forked from External/mage
* apply regex to change public copy constructors to protected * cleanup code using now protected constructors * fix manaBuilder weird casting of Mana into ConditionalMana
42 lines
1.1 KiB
Java
42 lines
1.1 KiB
Java
|
|
package mage.abilities.common;
|
|
|
|
import mage.abilities.TriggeredAbilityImpl;
|
|
import mage.abilities.effects.Effect;
|
|
import mage.constants.Zone;
|
|
import mage.game.Game;
|
|
import mage.game.events.GameEvent;
|
|
|
|
/**
|
|
* @author nantuko
|
|
*/
|
|
public class BecomesTappedSourceTriggeredAbility extends TriggeredAbilityImpl {
|
|
|
|
public BecomesTappedSourceTriggeredAbility(Effect effect) {
|
|
this(effect, false);
|
|
}
|
|
|
|
public BecomesTappedSourceTriggeredAbility(Effect effect, boolean isOptional) {
|
|
super(Zone.BATTLEFIELD, effect, isOptional);
|
|
setTriggerPhrase("Whenever {this} becomes tapped, ");
|
|
}
|
|
|
|
protected BecomesTappedSourceTriggeredAbility(final BecomesTappedSourceTriggeredAbility ability) {
|
|
super(ability);
|
|
}
|
|
|
|
@Override
|
|
public BecomesTappedSourceTriggeredAbility copy() {
|
|
return new BecomesTappedSourceTriggeredAbility(this);
|
|
}
|
|
|
|
@Override
|
|
public boolean checkEventType(GameEvent event, Game game) {
|
|
return event.getType() == GameEvent.EventType.TAPPED;
|
|
}
|
|
|
|
@Override
|
|
public boolean checkTrigger(GameEvent event, Game game) {
|
|
return event.getTargetId().equals(sourceId);
|
|
}
|
|
}
|