mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Handle the text of GainAbilityAllEffect in the standard way
This commit is contained in:
parent
b9a77520eb
commit
a58a2a3215
1 changed files with 8 additions and 3 deletions
|
@ -33,6 +33,7 @@ import java.util.UUID;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.MageObjectReference;
|
import mage.MageObjectReference;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.Mode;
|
||||||
import mage.abilities.TriggeredAbility;
|
import mage.abilities.TriggeredAbility;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.effects.ContinuousEffectImpl;
|
import mage.abilities.effects.ContinuousEffectImpl;
|
||||||
|
@ -77,7 +78,6 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl {
|
||||||
this.ability = ability;
|
this.ability = ability;
|
||||||
this.filter = filter;
|
this.filter = filter;
|
||||||
this.excludeSource = excludeSource;
|
this.excludeSource = excludeSource;
|
||||||
setText();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public GainAbilityAllEffect(final GainAbilityAllEffect effect) {
|
public GainAbilityAllEffect(final GainAbilityAllEffect effect) {
|
||||||
|
@ -141,8 +141,13 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setText() {
|
public String getText(Mode mode) {
|
||||||
|
if(staticText != null && !staticText.isEmpty()) {
|
||||||
|
return staticText;
|
||||||
|
}
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
boolean quotes = (ability instanceof SimpleActivatedAbility) || (ability instanceof TriggeredAbility);
|
boolean quotes = (ability instanceof SimpleActivatedAbility) || (ability instanceof TriggeredAbility);
|
||||||
if (excludeSource) {
|
if (excludeSource) {
|
||||||
sb.append("Other ");
|
sb.append("Other ");
|
||||||
|
@ -171,6 +176,6 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl {
|
||||||
if (duration.toString().length() > 0) {
|
if (duration.toString().length() > 0) {
|
||||||
sb.append(" ").append(duration.toString());
|
sb.append(" ").append(duration.toString());
|
||||||
}
|
}
|
||||||
staticText = sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue