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

@ -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