mirror of
https://github.com/magefree/mage.git
synced 2026-01-18 09:19:56 -08:00
Added the possibility to hide a ability for rule text generation.
This commit is contained in:
parent
dc131fa8dd
commit
31616f876e
4 changed files with 50 additions and 2 deletions
|
|
@ -77,6 +77,7 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
|
|||
protected String name;
|
||||
protected boolean usesStack = true;
|
||||
protected boolean ruleAtTheTop = false;
|
||||
protected boolean ruleVisible = true;
|
||||
|
||||
@Override
|
||||
public abstract T copy();
|
||||
|
|
@ -111,6 +112,7 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
|
|||
}
|
||||
this.modes = ability.modes.copy();
|
||||
this.ruleAtTheTop = ability.ruleAtTheTop;
|
||||
this.ruleVisible = ability.ruleVisible;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -417,7 +419,7 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
|
|||
|
||||
protected String formatRule(String rule, String source) {
|
||||
String replace = rule;
|
||||
if (source != null && !source.isEmpty()) {
|
||||
if (rule != null && source != null && !source.isEmpty()) {
|
||||
replace = rule.replace("{this}", source);
|
||||
replace = replace.replace("{source}", source);
|
||||
}
|
||||
|
|
@ -574,6 +576,17 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
|
|||
this.ruleAtTheTop = ruleAtTheTop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getRuleVisible() {
|
||||
return ruleVisible;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRuleVisible(boolean ruleVisible) {
|
||||
this.ruleVisible = ruleVisible;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public UUID getOriginalId() {
|
||||
return this.originalId;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue