1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-11 09:11:12 -09:00

Refactor: fixed flavor word for ability (related to comments from 6dafb3ad81);

This commit is contained in:
Oleg Agafonov 2021-06-30 16:30:39 +04:00
parent 6dafb3ad81
commit a1de8cc85a
10 changed files with 14 additions and 10 deletions

View file

@ -31,7 +31,7 @@ public final class BalefulBeholder extends CardImpl {
// When Baleful Beholder enters the battlefield, choose one
// Antimagic Cone Each opponent sacrifices an enchantment.
Ability ability = new EntersBattlefieldTriggeredAbility(new SacrificeOpponentsEffect(StaticFilters.FILTER_ENCHANTMENT_PERMANENT));
ability.withFlavorWord("Antimagic Cone");
ability.getModes().getMode().withFlavorWord("Antimagic Cone");
// Fear Ray Creatures you control gain menace until end of turn.
ability.addMode(new Mode(new GainAbilityControlledEffect(

View file

@ -32,7 +32,7 @@ public final class DawnbringerCleric extends CardImpl {
// When Dawnbringer Cleric enters the battlefield, choose one
// Cure Wounds You gain 2 life.
Ability ability = new EntersBattlefieldTriggeredAbility(new GainLifeEffect(1));
ability.withFlavorWord("Cure Wounds");
ability.getModes().getMode().withFlavorWord("Cure Wounds");
// Dispel Magic Destroy target enchantment.
Mode mode = new Mode(new DestroyTargetEffect());

View file

@ -31,7 +31,7 @@ public final class InspiringBard extends CardImpl {
// Bardic Inspiration Target creature gets +2/+2 until end of turn.
Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(2, 2));
ability.addTarget(new TargetCreaturePermanent());
ability.withFlavorWord("Bardic Inspiration");
ability.getModes().getMode().withFlavorWord("Bardic Inspiration");
// Song of Rest You gain 3 life.
ability.addMode(new Mode(

View file

@ -32,7 +32,7 @@ public final class PlunderingBarbarian extends CardImpl {
// Smash the Chest Destroy target artifact.
Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect());
ability.addTarget(new TargetArtifactPermanent());
ability.withFlavorWord("Smash the Chest");
ability.getModes().getMode().withFlavorWord("Smash the Chest");
// Pry It Open Creature a Treasure token.
ability.addMode(new Mode(

View file

@ -22,7 +22,7 @@ public final class YouFindTheVillainsLair extends CardImpl {
// Foil Their Scheme Counter target spell.
this.getSpellAbility().addEffect(new CounterTargetEffect());
this.getSpellAbility().addTarget(new TargetSpell());
this.getSpellAbility().withFlavorWord("Foil Their Scheme");
this.getSpellAbility().getModes().getMode().withFlavorWord("Foil Their Scheme");
// Learn Their Secrets Draw two cards, then discard two cards.
this.getSpellAbility().addMode(new Mode(

View file

@ -25,7 +25,7 @@ public final class YouSeeAGuardApproach extends CardImpl {
// Distract the Guard Tap target creature.
this.getSpellAbility().addEffect(new TapTargetEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().withFlavorWord("Distract the Guard");
this.getSpellAbility().getModes().getMode().withFlavorWord("Distract the Guard");
// Hide Target creature you control gains hexproof until end of turn.
Mode mode = new Mode(new GainAbilityTargetEffect(HexproofAbility.getInstance(), Duration.EndOfTurn));

View file

@ -22,7 +22,7 @@ public final class YouSeeAPairOfGoblins extends CardImpl {
// Choose one
// Charge Them Creatures you control get +2/+0 until end of turn.
this.getSpellAbility().addEffect(new BoostControlledEffect(2, 0, Duration.EndOfTurn));
this.getSpellAbility().withFlavorWord("Charge Them");
this.getSpellAbility().getModes().getMode().withFlavorWord("Charge Them");
// Befriend Them Create two 1/1 red Goblin creature tokens.
this.getSpellAbility().addMode(new Mode(

View file

@ -467,7 +467,7 @@ public interface Ability extends Controllable, Serializable {
Ability setAbilityWord(AbilityWord abilityWord);
/**
* Set Flavor word for current mode
* Set flavor word for whole ability (if you need flavor word for choices then call it from mode)
*
* @param flavorWord
* @return

View file

@ -60,6 +60,7 @@ public abstract class AbilityImpl implements Ability {
protected Zone zone;
protected String name;
protected AbilityWord abilityWord;
protected String flavorWord;
protected boolean usesStack = true;
protected boolean ruleAtTheTop = false;
protected boolean ruleVisible = true;
@ -117,6 +118,7 @@ public abstract class AbilityImpl implements Ability {
this.ruleAdditionalCostsVisible = ability.ruleAdditionalCostsVisible;
this.worksFaceDown = ability.worksFaceDown;
this.abilityWord = ability.abilityWord;
this.flavorWord = ability.flavorWord;
this.sourceObjectZoneChangeCounter = ability.sourceObjectZoneChangeCounter;
this.canFizzle = ability.canFizzle;
this.targetAdjuster = ability.targetAdjuster;
@ -803,6 +805,8 @@ public abstract class AbilityImpl implements Ability {
String prefix;
if (abilityWord != null) {
prefix = abilityWord.formatWord();
} else if (flavorWord != null) {
prefix = "<i>" + flavorWord + "</i> &mdash; ";
} else {
prefix = null;
}
@ -1070,7 +1074,7 @@ public abstract class AbilityImpl implements Ability {
@Override
public Ability withFlavorWord(String flavorWord) {
this.getModes().getMode().withFlavorWord(flavorWord);
this.flavorWord = flavorWord;
return this;
}

View file

@ -78,7 +78,7 @@ public class Mode implements Serializable {
}
/**
* Set Flavor word to the mode (same as ability/ancher words, but uses for lore/info and represents a possible choices)
* Set Flavor word for choice in the mode (same as ability/ancher words, but uses for lore/info and represents a possible choices)
*
* @param flavorWord
* @return