This commit is contained in:
Evan Kranzler 2017-08-22 21:44:14 -04:00
parent 12cedf945d
commit c61651da69
2 changed files with 12 additions and 4 deletions

View file

@ -47,6 +47,7 @@ public class BoostEnchantedEffect extends ContinuousEffectImpl {
private DynamicValue power;
private DynamicValue toughness;
private boolean lockedIn = false;
public BoostEnchantedEffect(int power, int toughness) {
this(power, toughness, Duration.WhileOnBattlefield);
@ -81,6 +82,10 @@ public class BoostEnchantedEffect extends ContinuousEffectImpl {
@Override
public void init(Ability source, Game game) {
super.init(source, game);
if (lockedIn) {
power = new StaticValue(power.calculate(game, source, this));
toughness = new StaticValue(toughness.calculate(game, source, this));
}
if (affectedObjectsSet) {
// Added boosts of activated or triggered abilities exist independent from the source they are created by
// so a continuous effect for the permanent itself with the attachment is created
@ -113,6 +118,10 @@ public class BoostEnchantedEffect extends ContinuousEffectImpl {
return true;
}
public void setLockedIn(boolean lockedIn) {
this.lockedIn = lockedIn;
}
private void setText() {
StringBuilder sb = new StringBuilder();
sb.append("Enchanted creature gets ");