foul-magics/Mage/src/main/java/mage/abilities/keyword/BattalionAbility.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

54 lines
1.4 KiB
Java

package mage.abilities.keyword;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.constants.AbilityWord;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
/**
* FAQ 2013/01/11
* <p>
* Battalion is an ability word that appears in italics at the beginning of abilities
* that trigger whenever you attack with that creature and at least two other
* creatures. (An ability word has no rules meaning.)
*
* @author LevelX2
*/
public class BattalionAbility extends TriggeredAbilityImpl {
public BattalionAbility(Effect effect) {
super(Zone.BATTLEFIELD, effect);
this.setAbilityWord(AbilityWord.BATTALION);
}
public BattalionAbility(final BattalionAbility ability) {
super(ability);
}
@Override
public BattalionAbility copy() {
return new BattalionAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DECLARED_ATTACKERS;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return game.getCombat().getAttackers().size() >= 3 && game.getCombat().getAttackers().contains(this.sourceId);
}
@Override
public String getTriggerPhrase() {
return "Whenever {this} and at least two other creatures attack, ";
}
}