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
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
package mage.abilities.keyword;
|
||||
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.costs.common.DiscardSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.AbilityWord;
|
||||
import mage.constants.TimingRule;
|
||||
|
||||
import mage.constants.Zone;
|
||||
|
||||
|
||||
public class ChannelAbility extends ActivatedAbilityImpl {
|
||||
|
|
@ -16,11 +16,12 @@ public class ChannelAbility extends ActivatedAbilityImpl {
|
|||
public ChannelAbility(String manaString, Effect effect) {
|
||||
this(manaString, effect, TimingRule.INSTANT);
|
||||
}
|
||||
|
||||
|
||||
public ChannelAbility(String manaString, Effect effect, TimingRule timing) {
|
||||
super(Zone.HAND, effect, new ManaCostsImpl(manaString));
|
||||
this.addCost(new DiscardSourceCost());
|
||||
this.timing = timing;
|
||||
this.setAbilityWord(AbilityWord.CHANNEL);
|
||||
}
|
||||
|
||||
public ChannelAbility(final ChannelAbility ability) {
|
||||
|
|
@ -34,12 +35,10 @@ public class ChannelAbility extends ActivatedAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
StringBuilder sb = new StringBuilder("<i>Channel</i> — ");
|
||||
sb.append(super.getRule());
|
||||
if(this.timing == TimingRule.SORCERY) {
|
||||
sb.append(" Activate only as a sorcery.");
|
||||
if (this.timing == TimingRule.SORCERY) {
|
||||
return super.getRule() + " Activate only as a sorcery.";
|
||||
}
|
||||
return sb.toString();
|
||||
return super.getRule();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue