mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Added locking stage of dynamic value in BoostControlledEffect
This commit is contained in:
parent
9a8f6e839d
commit
fe45c8adee
1 changed files with 11 additions and 0 deletions
|
@ -50,6 +50,8 @@ public class BoostControlledEffect extends ContinuousEffectImpl<BoostControlledE
|
|||
private DynamicValue toughness;
|
||||
protected boolean excludeSource;
|
||||
protected FilterCreaturePermanent filter;
|
||||
// if true, all dynamic values should be calculated once
|
||||
protected boolean isLockedIn = false;
|
||||
|
||||
public BoostControlledEffect(int power, int toughness, Duration duration) {
|
||||
this(power, toughness, duration, FilterCreaturePermanent.getDefault(), false);
|
||||
|
@ -86,6 +88,7 @@ public class BoostControlledEffect extends ContinuousEffectImpl<BoostControlledE
|
|||
this.toughness = effect.toughness;
|
||||
this.filter = effect.filter.copy();
|
||||
this.excludeSource = effect.excludeSource;
|
||||
this.isLockedIn = effect.isLockedIn;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -103,6 +106,10 @@ public class BoostControlledEffect extends ContinuousEffectImpl<BoostControlledE
|
|||
}
|
||||
}
|
||||
}
|
||||
if (this.isLockedIn) {
|
||||
power = new StaticValue(power.calculate(game, source));
|
||||
toughness = new StaticValue(toughness.calculate(game, source));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -148,4 +155,8 @@ public class BoostControlledEffect extends ContinuousEffectImpl<BoostControlledE
|
|||
staticText = rule;
|
||||
}
|
||||
|
||||
public void setLockedIn(boolean isLockedIn) {
|
||||
this.isLockedIn =isLockedIn;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue