forked from External/mage
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
This commit is contained in:
parent
0a31110164
commit
ca80806400
398 changed files with 946 additions and 989 deletions
|
|
@ -5,6 +5,7 @@ package mage.abilities.abilityword;
|
|||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.costs.common.DiscardTargetCost;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.AbilityWord;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.AnotherCardPredicate;
|
||||
|
|
@ -12,22 +13,22 @@ import mage.filter.predicate.mageobject.NamePredicate;
|
|||
import mage.target.common.TargetCardInHand;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author emerald000
|
||||
*/
|
||||
|
||||
public class GrandeurAbility extends ActivatedAbilityImpl {
|
||||
|
||||
|
||||
protected final String cardName;
|
||||
|
||||
public GrandeurAbility(Effect effect, String cardName) {
|
||||
super(Zone.BATTLEFIELD, effect);
|
||||
this.cardName = cardName;
|
||||
|
||||
|
||||
FilterCard filter = new FilterCard("another card named " + cardName);
|
||||
filter.add(new NamePredicate(cardName));
|
||||
filter.add(new AnotherCardPredicate());
|
||||
this.addCost(new DiscardTargetCost(new TargetCardInHand(filter)));
|
||||
setAbilityWord(AbilityWord.GRANDEUR);
|
||||
}
|
||||
|
||||
public GrandeurAbility(final GrandeurAbility ability) {
|
||||
|
|
@ -39,9 +40,4 @@ public class GrandeurAbility extends ActivatedAbilityImpl {
|
|||
public GrandeurAbility copy() {
|
||||
return new GrandeurAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("<i>Grandeur</i> — ").append(super.getRule()).toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue