foul-magics/Mage/src/main/java/mage/abilities/common/DrawCardControllerTriggeredAbility.java
Evan Kranzler ca80806400
Reworking triggered ability text generation to allow for ability words and flavor words to be added more easily (#8010)
* refactor all instances of getRule in triggered abilities using new getTriggerPrefix method

* updated triggered ability rules generation

* renamed method

* fixed a test failure

* some more refactoring

* simplified some instances of ability word usage
2021-07-15 07:46:38 -04:00

47 lines
1.2 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 North
*/
public class DrawCardControllerTriggeredAbility extends TriggeredAbilityImpl {
public DrawCardControllerTriggeredAbility(Effect effect, boolean optional) {
this(Zone.BATTLEFIELD, effect, optional);
}
public DrawCardControllerTriggeredAbility(Zone zone, Effect effect, boolean optional) {
super(zone, effect, optional);
}
public DrawCardControllerTriggeredAbility(final DrawCardControllerTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DREW_CARD;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getPlayerId().equals(controllerId);
}
@Override
public String getTriggerPhrase() {
return "Whenever you draw a card, " ;
}
@Override
public DrawCardControllerTriggeredAbility copy() {
return new DrawCardControllerTriggeredAbility(this);
}
}