mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
removed locked in parameter from BoostAllEffect
This commit is contained in:
parent
07f49bb863
commit
ecbfc4edc4
12 changed files with 13 additions and 23 deletions
|
@ -34,7 +34,7 @@ public final class BaneOfTheLiving extends CardImpl {
|
|||
this.addAbility(new MorphAbility(new ManaCostsImpl<>("{X}{B}{B}")));
|
||||
|
||||
// When Bane of the Living is turned face up, all creatures get -X/-X until end of turn.
|
||||
this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new BoostAllEffect(morphX, morphX, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_ALL_CREATURES, false, null, true)));
|
||||
this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new BoostAllEffect(morphX, morphX, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_ALL_CREATURES, false, null)));
|
||||
}
|
||||
|
||||
private BaneOfTheLiving(final BaneOfTheLiving card) {
|
||||
|
|
|
@ -40,7 +40,7 @@ public final class DeadOfWinter extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new BoostAllEffect(
|
||||
xValue, xValue, Duration.EndOfTurn, filter, false,
|
||||
"All nonsnow creatures get -X/-X until end of turn," +
|
||||
" where X is the number of snow permanents you control.", true
|
||||
" where X is the number of snow permanents you control."
|
||||
));
|
||||
this.getSpellAbility().addHint(hint);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public final class IchorExplosion extends CardImpl {
|
|||
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
|
||||
// All creatures get -X/-X until end of turn, where X is the sacrificed creature's power.
|
||||
DynamicValue xValue = new IchorExplosionDynamicValue();
|
||||
this.getSpellAbility().addEffect(new BoostAllEffect(xValue, xValue, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_ALL_CREATURES, false, null, true));
|
||||
this.getSpellAbility().addEffect(new BoostAllEffect(xValue, xValue, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_ALL_CREATURES, false, null));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ public final class KagemaroFirstToSuffer extends CardImpl {
|
|||
Ability ability = new SimpleActivatedAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new BoostAllEffect(xMinusValue, xMinusValue, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false,
|
||||
"All creatures get -X/-X until end of turn, where X is the number of cards in your hand", true),
|
||||
"All creatures get -X/-X until end of turn, where X is the number of cards in your hand"),
|
||||
new ManaCostsImpl("{B}")
|
||||
);
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
|
|
|
@ -45,10 +45,10 @@ public final class MartonStromgald extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// Whenever Marton Stromgald attacks, other attacking creatures get +1/+1 until end of turn for each attacking creature other than Marton Stromgald.
|
||||
this.addAbility(new AttacksTriggeredAbility(new BoostAllEffect(attackingValue, attackingValue, Duration.EndOfTurn, StaticFilters.FILTER_ATTACKING_CREATURES, true, null, true), false));
|
||||
this.addAbility(new AttacksTriggeredAbility(new BoostAllEffect(attackingValue, attackingValue, Duration.EndOfTurn, StaticFilters.FILTER_ATTACKING_CREATURES, true, null), false));
|
||||
|
||||
// Whenever Marton Stromgald blocks, other blocking creatures get +1/+1 until end of turn for each blocking creature other than Marton Stromgald.
|
||||
this.addAbility(new BlocksSourceTriggeredAbility(new BoostAllEffect(blockingValue, blockingValue, Duration.EndOfTurn, StaticFilters.FILTER_BLOCKING_CREATURES, true, null, true), false));
|
||||
this.addAbility(new BlocksSourceTriggeredAbility(new BoostAllEffect(blockingValue, blockingValue, Duration.EndOfTurn, StaticFilters.FILTER_BLOCKING_CREATURES, true, null), false));
|
||||
}
|
||||
|
||||
private MartonStromgald(final MartonStromgald card) {
|
||||
|
|
|
@ -35,7 +35,7 @@ public final class Mutilate extends CardImpl {
|
|||
// All creatures get -1/-1 until end of turn for each Swamp you control.
|
||||
PermanentsOnBattlefieldCount count = new PermanentsOnBattlefieldCount(filter, -1);
|
||||
this.getSpellAbility().addEffect(
|
||||
new BoostAllEffect(count, count, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES, false, null, true)
|
||||
new BoostAllEffect(count, count, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES, false, null)
|
||||
.setText(ruleText)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public final class OliviasWrath extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new BoostAllEffect(
|
||||
xValue, xValue, Duration.EndOfTurn, filter, false,
|
||||
"each non-Vampire creature gets -X/-X until end of turn, "
|
||||
+ "where X is the number of Vampires you control", true
|
||||
+ "where X is the number of Vampires you control"
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ public final class PackAttack extends CardImpl {
|
|||
// Attacking creatures get +X/+0 until end of turn, where X is the number of players being attacked.
|
||||
this.getSpellAbility().addEffect(new BoostAllEffect(
|
||||
PackAttackValue.instance, StaticValue.get(0), Duration.EndOfTurn,
|
||||
StaticFilters.FILTER_ATTACKING_CREATURES, false, null, true
|
||||
StaticFilters.FILTER_ATTACKING_CREATURES, false, null
|
||||
));
|
||||
|
||||
// Draw a card.
|
||||
|
|
|
@ -41,7 +41,7 @@ public final class RabbleRouser extends CardImpl {
|
|||
//{R}, {T}: Attacking creatures get +X/+0 until end of turn, where X is Rabble-Rouser's power.
|
||||
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
new BoostAllEffect(xValue, StaticValue.get(0), Duration.EndOfTurn, StaticFilters.FILTER_ATTACKING_CREATURES, false, null, true),
|
||||
new BoostAllEffect(xValue, StaticValue.get(0), Duration.EndOfTurn, StaticFilters.FILTER_ATTACKING_CREATURES, false, null),
|
||||
new ColoredManaCost(ColoredManaSymbol.R));
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
|
|
|
@ -30,7 +30,7 @@ public final class RoilmagesTrick extends CardImpl {
|
|||
this.getSpellAbility().setAbilityWord(AbilityWord.CONVERGE);
|
||||
this.getSpellAbility().addEffect(new BoostAllEffect(
|
||||
xValue, StaticValue.get(0), Duration.EndOfTurn,
|
||||
StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, false, null, true
|
||||
StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURES, false, null
|
||||
));
|
||||
|
||||
// Draw a card.
|
||||
|
|
|
@ -27,7 +27,7 @@ public final class ToxicDeluge extends CardImpl {
|
|||
this.getSpellAbility().addCost(new PayVariableLifeCost(true));
|
||||
|
||||
// All creatures get -X/-X until end of turn.
|
||||
this.getSpellAbility().addEffect(new BoostAllEffect(xValue, xValue, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_ALL_CREATURES, false, null, true));
|
||||
this.getSpellAbility().addEffect(new BoostAllEffect(xValue, xValue, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_ALL_CREATURES, false, null));
|
||||
}
|
||||
|
||||
private ToxicDeluge(final ToxicDeluge card) {
|
||||
|
|
|
@ -19,7 +19,6 @@ import java.util.Iterator;
|
|||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class BoostAllEffect extends ContinuousEffectImpl {
|
||||
|
@ -28,7 +27,6 @@ public class BoostAllEffect extends ContinuousEffectImpl {
|
|||
protected DynamicValue toughness;
|
||||
protected boolean excludeSource;
|
||||
protected FilterCreaturePermanent filter;
|
||||
protected boolean lockedInPT;
|
||||
|
||||
public BoostAllEffect(int power, int toughness, Duration duration) {
|
||||
this(power, toughness, duration, false);
|
||||
|
@ -51,17 +49,12 @@ public class BoostAllEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
|
||||
public BoostAllEffect(DynamicValue power, DynamicValue toughness, Duration duration, FilterCreaturePermanent filter, boolean excludeSource, String rule) {
|
||||
this(power, toughness, duration, filter, excludeSource, rule, false);
|
||||
}
|
||||
|
||||
public BoostAllEffect(DynamicValue power, DynamicValue toughness, Duration duration, FilterCreaturePermanent filter, boolean excludeSource, String rule, boolean lockedInPT) {
|
||||
super(duration, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, isCanKill(toughness) ? Outcome.UnboostCreature : Outcome.BoostCreature);
|
||||
this.power = power;
|
||||
this.toughness = toughness;
|
||||
this.filter = filter;
|
||||
this.excludeSource = excludeSource;
|
||||
|
||||
this.lockedInPT = lockedInPT;
|
||||
if (rule == null || rule.isEmpty()) {
|
||||
setText();
|
||||
} else {
|
||||
|
@ -75,7 +68,6 @@ public class BoostAllEffect extends ContinuousEffectImpl {
|
|||
this.toughness = effect.toughness;
|
||||
this.filter = effect.filter.copy();
|
||||
this.excludeSource = effect.excludeSource;
|
||||
this.lockedInPT = effect.lockedInPT;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -93,8 +85,6 @@ public class BoostAllEffect extends ContinuousEffectImpl {
|
|||
affectedObjectList.add(new MageObjectReference(perm, game));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (lockedInPT) {
|
||||
power = StaticValue.get(power.calculate(game, source, this));
|
||||
toughness = StaticValue.get(toughness.calculate(game, source, this));
|
||||
}
|
||||
|
@ -103,7 +93,7 @@ public class BoostAllEffect extends ContinuousEffectImpl {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (this.affectedObjectsSet) {
|
||||
for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) { // filter may not be used again, because object can have changed filter relevant attributes but still geets boost
|
||||
for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext(); ) { // filter may not be used again, because object can have changed filter relevant attributes but still geets boost
|
||||
Permanent permanent = it.next().getPermanent(game);
|
||||
if (permanent != null) {
|
||||
permanent.addPower(power.calculate(game, source, this));
|
||||
|
|
Loading…
Reference in a new issue