Refactor: Add proper support for modifying and querying base P/T (#9409)

This commit is contained in:
Alex Vasile 2022-09-01 19:57:30 -04:00 committed by GitHub
parent d83eb41073
commit 07a142c9e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
415 changed files with 1844 additions and 2095 deletions

View file

@ -882,7 +882,7 @@ public class NewTournamentDialog extends MageDialog {
// this.spnNumPlayers.setModel(new SpinnerNumberModel(gameType.getMinPlayers(), gameType.getMinPlayers(), gameType.getMaxPlayers(), 1));
// this.spnNumPlayers.setEnabled(gameType.getMinPlayers() != gameType.getMaxPlayers());
// if (oldValue >= gameType.getMinPlayers() && oldValue <= gameType.getMaxPlayers()){
// this.spnNumPlayers.setValue(oldValue);
// this.spnNumPlayers.setBoostedValue(oldValue);
// }
// this.cbAttackOption.setEnabled(gameType.isUseAttackOption());
// this.cbRange.setEnabled(gameType.isUseRange());

View file

@ -110,7 +110,7 @@ public class TestCardRenderDialog extends MageDialog {
this.removeDialog();
}
private PermanentView createPermanentCard(Game game, UUID controllerId, String code, String cardNumber, int power, int toughness, int damage, boolean tapped, boolean transform, List<Ability> extraAbilities) {
private PermanentView createPermanentCard(Game game, UUID controllerId, String code, String cardNumber, int powerBoosted, int toughnessBoosted, int damage, boolean tapped, boolean transform, List<Ability> extraAbilities) {
CardInfo cardInfo = CardRepository.instance.findCard(code, cardNumber);
ExpansionInfo setInfo = ExpansionRepository.instance.getSetByCode(code);
CardSetInfo testSet = new CardSetInfo(cardInfo.getName(), setInfo.getCode(), cardNumber, cardInfo.getRarity(),
@ -133,8 +133,8 @@ public class TestCardRenderDialog extends MageDialog {
}
if (damage > 0) perm.damage(damage, controllerId, null, game);
if (power > 0) perm.getPower().setValue(power);
if (toughness > 0) perm.getToughness().setValue(toughness);
if (powerBoosted > 0) perm.getPower().setBoostedValue(powerBoosted);
if (toughnessBoosted > 0) perm.getToughness().setBoostedValue(toughnessBoosted);
perm.removeSummoningSickness();
perm.setTapped(tapped);
PermanentView cardView = new PermanentView(perm, permCard, controllerId, game);

View file

@ -244,7 +244,7 @@ public final class CardRendererUtils {
// boost colorizing
if (value != null) {
int current = value.getValue();
int origin = value.getBaseValueModified();
int origin = value.getModifiedBaseValue();
if (origin != 0) {
if (current < origin) {
return textLight ? CARD_TEXT_COLOR_BAD_LIGHT : CARD_TEXT_COLOR_BAD_DARK;

View file

@ -8,7 +8,7 @@ import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -45,7 +45,7 @@ public final class AbominableTreefolk extends CardImpl {
// Abominable Treefolk's power and toughness are each equal to the number of snow permanents you control.
this.addAbility(new SimpleStaticAbility(
Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame)
Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame)
));
// When Abominable Treefolk enters the battlefield, tap target creature an opponent controls. That creature doesn't untap during its controller's next untap step.

View file

@ -6,7 +6,7 @@ import mage.abilities.dynamicvalue.AdditiveDynamicValue;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.MenaceAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
@ -54,7 +54,7 @@ public final class AbominationOfLlanowar extends CardImpl {
// Abomination of Llanowar's power and toughness are each equal to the number of Elves you control plus the number of Elf cards in your graveyard.
this.addAbility(new SimpleStaticAbility(
Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame)
Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame)
));
}

View file

@ -6,7 +6,7 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
@ -29,7 +29,7 @@ public final class AdamaroFirstToDesire extends CardImpl {
this.toughness = new MageInt(0);
// Adamaro, First to Desire's power and toughness are each equal to the number of cards in the hand of the opponent with the most cards in hand.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new MostCardsInOpponentsHandCount(), Duration.WhileOnBattlefield)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new MostCardsInOpponentsHandCount(), Duration.EndOfGame)));
}
private AdamaroFirstToDesire(final AdamaroFirstToDesire card) {

View file

@ -7,7 +7,7 @@ import mage.abilities.common.AttacksWithCreaturesTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.CreaturesYouControlCount;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect;
import mage.abilities.hint.common.CreaturesYouControlHint;
import mage.constants.*;
import mage.abilities.keyword.VigilanceAbility;
@ -35,7 +35,7 @@ public final class AdelineResplendentCathar extends CardImpl {
this.addAbility(VigilanceAbility.getInstance());
// Adeline, Resplendent Cathar's power is equal to the number of creatures you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(
CreaturesYouControlCount.instance, Duration.EndOfGame)).addHint(CreaturesYouControlHint.instance)
);

View file

@ -9,7 +9,7 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.SuspendAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -20,7 +20,6 @@ import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
/**
*
@ -36,7 +35,7 @@ public final class AeonChronicler extends CardImpl {
this.toughness = new MageInt(0);
// Aeon Chronicler's power and toughness are each equal to the number of cards in your hand.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(CardsInControllerHandCount.instance, Duration.EndOfGame)));
// Suspend X-{X}{3}{U}. X can't be 0.
this.addAbility(new SuspendAbility(Integer.MAX_VALUE, new ManaCostsImpl<>("{3}{U}"), this, true));

View file

@ -10,7 +10,7 @@ import mage.abilities.costs.common.ExileFromHandCost;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.IntPlusDynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -47,7 +47,7 @@ public final class AllosaurusRider extends CardImpl {
// Allosaurus Rider's power and toughness are each equal to 1 plus the number of lands you control.
DynamicValue onePlusControlledLands = new IntPlusDynamicValue(1, new PermanentsOnBattlefieldCount(new FilterControlledLandPermanent("lands you control")));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(onePlusControlledLands, Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(onePlusControlledLands, Duration.EndOfGame)));
}

View file

@ -9,7 +9,7 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CantBeCounteredControlledEffect;
import mage.abilities.effects.common.continuous.CreaturesBecomeOtherTypeEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
@ -48,7 +48,7 @@ public class AllosaurusShepherd extends CardImpl {
//4GG: Until end of turn, each Elf creature you control has base power and toughness 5/5
// and becomes a Dinosaur in addition to its other creature types.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new SetPowerToughnessAllEffect(5, 5, Duration.EndOfTurn, elvesFilter, true)
new SetBasePowerToughnessAllEffect(5, 5, Duration.EndOfTurn, elvesFilter, true)
.setText("Until end of turn, each Elf creature you control has base power and toughness 5/5"),
new ManaCostsImpl<>("{4}{G}{G}"));
ability.addEffect(new CreaturesBecomeOtherTypeEffect(elvesFilter, SubType.DINOSAUR, Duration.EndOfTurn)

View file

@ -10,7 +10,7 @@ import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect;
import mage.abilities.effects.common.UntapSourceEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -48,7 +48,7 @@ public final class AltarGolem extends CardImpl {
// Altar Golem's power and toughness are each equal to the number of creatures on the battlefield.
DynamicValue amount = new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("creatures on the battlefield"));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(amount, Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(amount, Duration.EndOfGame)));
// Altar Golem doesn't untap during your untap step.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepSourceEffect()));

View file

@ -4,7 +4,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.*;
import mage.constants.*;
import mage.game.Game;
@ -24,7 +24,9 @@ public final class Amplifire extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// At the beginning of your upkeep, reveal cards from the top of your library until you reveal a creature card. Until your next turn, Amplifire's base power becomes twice that card's power and its base toughness becomes twice that card's toughness. Put the revealed cards on the bottom of your library in a random order.
// At the beginning of your upkeep, reveal cards from the top of your library until you reveal a creature card.
// Until your next turn, Amplifire's base power becomes twice that card's power and its base toughness becomes twice that card's toughness.
// Put the revealed cards on the bottom of your library in a random order.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
new AmplifireEffect(), TargetController.YOU, false
));
@ -78,11 +80,14 @@ class AmplifireEffect extends OneShotEffect {
}
player.revealCards(source, cards, game);
if (lastCard != null) {
game.addEffect(new SetPowerToughnessSourceEffect(
SetBasePowerToughnessSourceEffect setBasePowerToughnessSourceEffect = new SetBasePowerToughnessSourceEffect(
2*lastCard.getPower().getValue(),
2*lastCard.getToughness().getValue(),
Duration.UntilYourNextTurn, SubLayer.SetPT_7b
), source);
Duration.UntilYourNextTurn,
SubLayer.SetPT_7b,
true
);
game.addEffect(setBasePowerToughnessSourceEffect, source);
}
player.putCardsOnBottomOfLibrary(cards, game, source, false);
return true;

View file

@ -70,7 +70,7 @@ class AnHavvaConstableEffect extends ContinuousEffectImpl {
filter.add(new ColorPredicate(ObjectColor.GREEN));
int numberOfGreenCreatures = game.getBattlefield().count(filter, source.getSourceId(), source, game);
mageObject.getToughness().setValue(1 + numberOfGreenCreatures);
mageObject.getToughness().setModifiedBaseValue(1 + numberOfGreenCreatures);
return true;
}

View file

@ -4,7 +4,7 @@ import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
@ -42,7 +42,7 @@ public final class AnaxHardenedInTheForge extends CardImpl {
// Anax's power is equal to your devotion to red.
this.addAbility(new SimpleStaticAbility(
Zone.ALL,
new SetPowerSourceEffect(DevotionCount.R, Duration.EndOfGame)
new SetBasePowerSourceEffect(DevotionCount.R, Duration.EndOfGame)
.setText("{this}'s power is equal to your devotion to red")
).addHint(DevotionCount.R.getHint()));

View file

@ -6,7 +6,7 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -32,7 +32,7 @@ public final class AncientOoze extends CardImpl {
this.toughness = new MageInt(0);
// Ancient Ooze's power and toughness are each equal to the total converted mana cost of other creatures you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new AncientOozePowerToughnessValue(), Duration.EndOfGame)
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new AncientOozePowerToughnessValue(), Duration.EndOfGame)
.setText("{this}'s power and toughness are each equal to the total mana value of other creatures you control.")
));
}

View file

@ -6,7 +6,7 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.ControllerLifeCount;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.continuous.GainAbilityControllerEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.HexproofAbility;
import mage.cards.CardImpl;
@ -39,7 +39,7 @@ public final class AngelicEnforcer extends CardImpl {
this.addAbility(new SimpleStaticAbility(new GainAbilityControllerEffect(HexproofAbility.getInstance())));
// Angelic Enforcer's power and toughness are each equal to your life total.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(
ControllerLifeCount.instance, Duration.EndOfGame
).setText("{this}'s power and toughness are each equal to your life total")));

View file

@ -75,19 +75,21 @@ class AnimateArtifactContinuousEffect extends ContinuousEffectImpl {
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
// Not sure, if this is layerwise handled absolutely correctly
Permanent enchantment = game.getPermanent(source.getSourceId());
if (enchantment != null) {
if (enchantment == null) {
return false;
}
Permanent permanent = game.getPermanent(enchantment.getAttachedTo());
if (permanent != null && !permanent.isCreature(game)) {
if (sublayer == SubLayer.NA) {
permanent.addCardType(game, CardType.CREATURE);
permanent.getPower().setValue(permanent.getManaValue());
permanent.getToughness().setValue(permanent.getManaValue());
if (permanent == null || permanent.isCreature(game)) {
return false;
}
}
return true;
if (sublayer != SubLayer.NA) {
return false;
}
return false;
permanent.addCardType(game, CardType.CREATURE);
permanent.getPower().setModifiedBaseValue(permanent.getManaValue());
permanent.getToughness().setModifiedBaseValue(permanent.getManaValue());
return true;
}
@Override

View file

@ -2,7 +2,7 @@ package mage.cards.a;
import mage.MageInt;
import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.AdventureCard;
@ -45,7 +45,7 @@ public final class AnimatingFaerie extends AdventureCard {
this.getSpellCard().getSpellAbility().addEffect(new AddCardTypeTargetEffect(
Duration.EndOfGame, CardType.ARTIFACT, CardType.CREATURE
).setText("Target noncreature artifact you control becomes a 0/0 artifact creature"));
this.getSpellCard().getSpellAbility().addEffect(new SetPowerToughnessTargetEffect(
this.getSpellCard().getSpellAbility().addEffect(new SetBasePowerToughnessTargetEffect(
0, 0, Duration.EndOfGame
).setText("Put four +1/+1 counters on it."));
this.getSpellCard().getSpellAbility().addEffect(new AddCountersTargetEffect(

View file

@ -7,7 +7,7 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
import mage.abilities.effects.common.TapSourceUnlessPaysEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -36,7 +36,7 @@ public final class ApocalypseDemon extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Apocalypse Demon's power and toughness are each equal to the number of cards in your graveyard.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInControllerGraveyardCount(), Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new CardsInControllerGraveyardCount(), Duration.EndOfGame)));
// At the beginning of your upkeep, tap Apocalypse Demon unless you sacrifice another creature.
TapSourceUnlessPaysEffect tapEffect = new TapSourceUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledPermanent(filter)));

View file

@ -6,7 +6,7 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.MorphAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -126,7 +126,7 @@ class AquamorphEntityReplacementEffect extends ReplacementEffectImpl {
toughness = 5;
break;
}
game.addEffect(new SetPowerToughnessSourceEffect(power, toughness, Duration.Custom, SubLayer.SetPT_7b), source);
game.addEffect(new SetBasePowerToughnessSourceEffect(power, toughness, Duration.WhileOnBattlefield, true), source);
return false;
}

View file

@ -9,7 +9,7 @@ import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.dynamicvalue.common.PartyCount;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect;
import mage.abilities.hint.common.PartyCountHint;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
@ -35,7 +35,7 @@ public final class ArchpriestOfIona extends CardImpl {
// Archpriest of Iona's power is equal to the number of creatures in your party.
this.addAbility(new SimpleStaticAbility(
Zone.ALL,
new SetPowerSourceEffect(
new SetBasePowerSourceEffect(
PartyCount.instance, Duration.EndOfGame
).setText("{this}'s power is equal to the number of creatures in your party. " + PartyCount.getReminder())
).addHint(PartyCountHint.instance));

View file

@ -91,8 +91,8 @@ class ArlinnTheMoonsFuryEffect extends ContinuousEffectImpl {
return true;
case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) {
permanent.getPower().setValue(5);
permanent.getToughness().setValue(5);
permanent.getPower().setModifiedBaseValue(5);
permanent.getToughness().setModifiedBaseValue(5);
return true;
}
}

View file

@ -6,7 +6,7 @@ import mage.abilities.Ability;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.BoastAbility;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
@ -88,7 +88,7 @@ class ArniBrokenbrowEffect extends OneShotEffect {
if (controller.chooseUse(outcome, "Change base power of " + mageObject.getLogName() + " to "
+ power + " until end of turn?", source, game
)) {
game.addEffect(new SetPowerSourceEffect(StaticValue.get(power), Duration.EndOfTurn), source);
game.addEffect(new SetBasePowerToughnessSourceEffect(StaticValue.get(power), null, Duration.EndOfTurn, SubLayer.SetPT_7b, true), source);
return true;
}
return false;

View file

@ -9,7 +9,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.AddCardSubTypeSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
@ -36,8 +36,12 @@ public final class AscendantSpirit extends CardImpl {
Ability ability = new SimpleActivatedAbility(new AddCardSubTypeSourceEffect(
Duration.Custom, SubType.SPIRIT, SubType.WARRIOR
).setText("{this} becomes a Spirit Warrior"), new ManaCostsImpl<>("{S}{S}"));
ability.addEffect(new SetPowerToughnessSourceEffect(
2, 3, Duration.Custom, SubLayer.SetPT_7b
ability.addEffect(new SetBasePowerToughnessSourceEffect(
2,
3,
Duration.WhileOnBattlefield,
SubLayer.SetPT_7b,
true
).setText("with base power and toughness 2/3"));
this.addAbility(ability);
@ -89,8 +93,8 @@ class AscendantSpiritWarriorEffect extends OneShotEffect {
game.addEffect(new AddCardSubTypeSourceEffect(
Duration.Custom, SubType.SPIRIT, SubType.WARRIOR, SubType.ANGEL
), source);
game.addEffect(new SetPowerToughnessSourceEffect(
4, 4, Duration.Custom, SubLayer.SetPT_7b
game.addEffect(new SetBasePowerToughnessSourceEffect(
4, 4, Duration.Custom, SubLayer.SetPT_7b, true
), source);
return true;
}

View file

@ -5,7 +5,7 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.LandsYouControlCount;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.mana.GreenManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -33,7 +33,7 @@ public final class AshayaSoulOfTheWild extends CardImpl {
// Ashaya, Soul of the Wilds power and toughness are each equal to the number of lands you control.
this.addAbility(new SimpleStaticAbility(
Zone.ALL, new SetPowerToughnessSourceEffect(LandsYouControlCount.instance, Duration.EndOfGame)
Zone.ALL, new SetBasePowerToughnessSourceEffect(LandsYouControlCount.instance, Duration.EndOfGame)
));
// Nontoken creatures you control are Forest lands in addition to their other types. (Theyre still affected by summoning sickness.)

View file

@ -28,8 +28,6 @@ public final class AvenMimeomancer extends CardImpl {
this.subtype.add(SubType.BIRD);
this.subtype.add(SubType.WIZARD);
this.power = new MageInt(3);
this.toughness = new MageInt(1);
@ -58,6 +56,7 @@ class AvenEffect extends ContinuousEffectImpl {
public AvenEffect() {
super(Duration.Custom, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature);
this.staticText = "If you do, that creature has base power and toughness 3/1 and has flying for as long as it has a feather counter on it";
}
public AvenEffect(final AvenEffect effect) {
@ -72,13 +71,13 @@ class AvenEffect extends ContinuousEffectImpl {
@Override
public boolean apply(Game game, Ability source) {
Permanent target = game.getPermanent(getTargetPointer().getFirst(game, source));
if (target != null) {
target.getPower().setValue(3);
target.getToughness().setValue(1);
return true;
}
if (target == null) {
return false;
}
target.getPower().setModifiedBaseValue(3);
target.getToughness().setModifiedBaseValue(1);
return true;
}
@Override
public boolean isInactive(Ability source, Game game) {
@ -88,11 +87,6 @@ class AvenEffect extends ContinuousEffectImpl {
}
return false;
}
@Override
public String getText(Mode mode) {
return "If you do, that creature has base power and toughness 3/1 and has flying for as long as it has a feather counter on it";
}
}
class AvenEffect2 extends ContinuousEffectImpl {

View file

@ -3,7 +3,7 @@ package mage.cards.a;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.DomainValue;
import mage.abilities.effects.common.continuous.SetToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBaseToughnessSourceEffect;
import mage.abilities.hint.common.DomainHint;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
@ -30,7 +30,7 @@ public final class AvenTrailblazer extends CardImpl {
// Domain - Aven Trailblazer's toughness is equal to the number of basic land types among lands you control.
this.addAbility(new SimpleStaticAbility(
Zone.ALL, new SetToughnessSourceEffect(DomainValue.REGULAR, Duration.EndOfGame)
Zone.ALL, new SetBaseToughnessSourceEffect(DomainValue.REGULAR, Duration.EndOfGame)
.setText("{this}'s toughness is equal to the number of basic land types among lands you control")
).addHint(DomainHint.instance).setAbilityWord(AbilityWord.DOMAIN));
}

View file

@ -9,7 +9,7 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -34,7 +34,7 @@ public final class AwakenedAmalgam extends CardImpl {
// Awakened Amalgam's power and toughness are each equal to the number of differently named lands you control.
DynamicValue value = (new AwakenedAmalgamLandNamesCount());
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(value, Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(value, Duration.EndOfGame)));
}
private AwakenedAmalgam(final AwakenedAmalgam card) {

View file

@ -74,14 +74,17 @@ class AwakenedAwarenessEffect extends ContinuousEffectImpl {
@Override
public boolean apply(Game game, Ability source) {
Permanent enchantment = source.getSourcePermanentIfItStillExists(game);
if (enchantment != null) {
if (enchantment == null) {
return false;
}
Permanent creature = game.getPermanent(enchantment.getAttachedTo());
if (creature != null && creature.isCreature(game)) {
creature.getPower().setValue(1);
creature.getToughness().setValue(1);
if (creature == null || !creature.isCreature(game)) {
return false;
}
creature.getPower().setModifiedBaseValue(1);
creature.getToughness().setModifiedBaseValue(1);
return true;
}
}
return false;
}
}

View file

@ -7,7 +7,7 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.IntPlusDynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -44,7 +44,7 @@ public final class AysenCrusader extends CardImpl {
// Aysen Crusader's power and toughness are each equal to 2 plus the number of Soldiers and Warriors you control.
DynamicValue value = new IntPlusDynamicValue(2, new PermanentsOnBattlefieldCount(filter));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(value, Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(value, Duration.EndOfGame)));
}
private AysenCrusader(final AysenCrusader card) {

View file

@ -3,7 +3,7 @@ package mage.cards.b;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.CreaturesYouControlCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.hint.common.CreaturesYouControlHint;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
@ -30,7 +30,7 @@ public final class BattleSquadron extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Battle Squadron's power and toughness are each equal to the number of creatures you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame))
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame))
.addHint(CreaturesYouControlHint.instance));
}

View file

@ -7,7 +7,7 @@ import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -41,7 +41,8 @@ public final class BattlegateMimic extends CardImpl {
this.toughness = new MageInt(1);
// Whenever you cast a spell that's both red and white, Battlegate Mimic has base power and toughness 4/2 and gains first strike until end of turn.
Ability ability = new SpellCastControllerTriggeredAbility(new SetPowerToughnessSourceEffect(4, 2, Duration.EndOfTurn, SubLayer.SetPT_7b), filter, false, rule);
SetBasePowerToughnessSourceEffect baseToughnessSourceEffect = new SetBasePowerToughnessSourceEffect(4, 2, Duration.EndOfTurn, SubLayer.SetPT_7b, true);
Ability ability = new SpellCastControllerTriggeredAbility(baseToughnessSourceEffect, filter, false, rule);
ability.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, false, true));
this.addAbility(ability);

View file

@ -4,7 +4,7 @@ import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.cards.AdventureCard;
import mage.cards.CardSetInfo;
@ -33,7 +33,7 @@ public final class BeanstalkGiant extends AdventureCard {
this.toughness = new MageInt(0);
// Beanstalk Giant's power and toughness are each equal to the number of lands you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame)));
// Fertile Footsteps
// Search your library for a basic land card, put it onto the battlefield, then shuffle your library.

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -28,7 +28,7 @@ public final class BeastOfBurden extends CardImpl {
this.toughness = new MageInt(0);
// Beast of Burden's power and toughness are each equal to the number of creatures on the battlefield.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("creatures on the battlefield")), Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("creatures on the battlefield")), Duration.EndOfGame)));
}

View file

@ -10,7 +10,7 @@ import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.InfoEffect;
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -46,7 +46,7 @@ public final class BellBorcaSpectralSergeant extends CardImpl {
this.addAbility(BellBorcaSpectralSergeantAbility.getInstance());
// Bell Borca, Spectral Sergeant's power is equal to the greatest number noted for it this turn.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(
BellBorcaSpectralSergeantValue.instance, Duration.EndOfGame
).setText("{this}'s power is equal to the greatest number noted for it this turn")));

View file

@ -3,7 +3,7 @@ package mage.cards.b;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.CostAdjuster;
import mage.abilities.effects.common.continuous.SetPowerToughnessEnchantedEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessEnchantedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -29,7 +29,7 @@ public final class BeltOfGiantStrength extends CardImpl {
this.subtype.add(SubType.EQUIPMENT);
// Equipped creature has base power and toughness 10/10.
this.addAbility(new SimpleStaticAbility(new SetPowerToughnessEnchantedEffect(10, 10)
this.addAbility(new SimpleStaticAbility(new SetBasePowerToughnessEnchantedEffect(10, 10)
.setText("equipped creature has base power and toughness 10/10")));
// Equip {10}. This ability costs {X} less to activate where X is the power of the creature it targets.

View file

@ -8,7 +8,7 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.SuspendAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -20,7 +20,6 @@ import mage.counters.CounterType;
import mage.filter.common.FilterControlledPermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.token.SoldierToken;
/**
@ -43,7 +42,7 @@ public final class BenalishCommander extends CardImpl {
this.toughness = new MageInt(0);
// Benalish Commander's power and toughness are each equal to the number of Soldiers you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame)));
// Suspend X-{X}{W}{W}. X can't be 0.
this.addAbility(new SuspendAbility(Integer.MAX_VALUE, new ManaCostsImpl<>("{W}{W}"), this, true));

View file

@ -4,7 +4,7 @@ package mage.cards.b;
import java.util.UUID;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -23,7 +23,7 @@ public final class BiomassMutation extends CardImpl {
// Creatures you control have base power and toughness X/X until end of turn.
DynamicValue variableMana = ManacostVariableValue.REGULAR;
this.getSpellAbility().addEffect(new SetPowerToughnessAllEffect(variableMana, variableMana, Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURES, true));
this.getSpellAbility().addEffect(new SetBasePowerToughnessAllEffect(variableMana, variableMana, Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURES, true));
}
private BiomassMutation(final BiomassMutation card) {

View file

@ -88,8 +88,8 @@ class BladeOfTheOniEffect extends ContinuousEffectImpl {
if (sublayer != SubLayer.SetPT_7b) {
return false;
}
permanent.getPower().setValue(5);
permanent.getToughness().setValue(5);
permanent.getPower().setModifiedBaseValue(5);
permanent.getToughness().setModifiedBaseValue(5);
return true;
}
return false;

View file

@ -10,13 +10,14 @@ import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import java.util.UUID;
@ -41,7 +42,7 @@ public final class BloodswornKnight extends CardImpl {
this.nightCard = true;
// Bloodsworn Knight's power and toughness are each equal to the number of creature cards in your graveyard.
this.addAbility(new SimpleStaticAbility(new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame)));
// {1}{B}, Discard a card: Bloodsworn Knight gains indestructible until end of turn. Tap it.
Ability ability = new SimpleActivatedAbility(

View file

@ -7,7 +7,7 @@ import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
import mage.abilities.dynamicvalue.common.SavedDamageValue;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -32,7 +32,7 @@ public final class BodyOfKnowledge extends CardImpl {
// Body of Knowledge's power and toughness are each equal to the number of cards in your hand.
this.addAbility(new SimpleStaticAbility(
Zone.ALL,
new SetPowerToughnessSourceEffect(
new SetBasePowerToughnessSourceEffect(
CardsInControllerHandCount.instance, Duration.EndOfGame
)
));

View file

@ -5,7 +5,7 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.ScavengeAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -40,7 +40,7 @@ public final class BoneyardMycodrax extends CardImpl {
this.toughness = new MageInt(0);
// Boneyard Mycodrax's power and toughness are each equal to the number of other creature cards in your graveyard.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(xValue, Duration.EndOfGame)));
// Scavenge {4}{B}
this.addAbility(new ScavengeAbility(new ManaCostsImpl<>("{4}{B}")));

View file

@ -4,7 +4,7 @@ import java.util.UUID;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -24,7 +24,7 @@ public final class BoneyardWurm extends CardImpl {
// Boneyard Wurm's power and toughness are each equal to the number of creature cards in your graveyard.
DynamicValue value = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE);
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(value, Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(value, Duration.EndOfGame)));
}
private BoneyardWurm(final BoneyardWurm card) {

View file

@ -5,7 +5,7 @@ import mage.abilities.common.ActivateIfConditionActivatedAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
@ -31,9 +31,13 @@ public final class BramblefortFink extends CardImpl {
this.toughness = new MageInt(2);
// {8}: Bramblefort Fink has base power and toughness 10/10 until end of turn. Activate this ability only if you control an Oko planeswalker.
this.addAbility(new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(
10, 10, Duration.EndOfTurn, SubLayer.SetPT_7b
).setText("{this} has base power and toughness 10/10 until end of turn"), new GenericManaCost(8), condition));
this.addAbility(new ActivateIfConditionActivatedAbility(
Zone.BATTLEFIELD,
new SetBasePowerToughnessSourceEffect(
10, 10, Duration.EndOfTurn, SubLayer.SetPT_7b, true
).setText("{this} has base power and toughness 10/10 until end of turn"),
new GenericManaCost(8),
condition));
}
private BramblefortFink(final BramblefortFink card) {

View file

@ -9,7 +9,7 @@ import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.common.DiesSourceTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -68,15 +68,21 @@ class BrineHagEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) { return false; }
if (controller == null) {
return false;
}
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (sourcePermanent == null) { return false; }
if (sourcePermanent == null) {
return false;
}
List<Permanent> list = new ArrayList<>();
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId);
if (player == null) { continue; }
if (player == null) {
continue;
}
for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, playerId, game)) {
if (sourcePermanent.getDealtDamageByThisTurn().contains(new MageObjectReference(creature.getId(), game))) {
@ -87,7 +93,7 @@ class BrineHagEffect extends OneShotEffect {
if (!list.isEmpty()) {
FilterCreaturePermanent filter = new FilterCreaturePermanent();
filter.add(new PermanentInListPredicate(list));
game.addEffect(new SetPowerToughnessAllEffect(0, 2, Duration.Custom, filter, true), source);
game.addEffect(new SetBasePowerToughnessAllEffect(0, 2, Duration.Custom, filter, true), source);
}
return true;
}

View file

@ -3,7 +3,7 @@ package mage.cards.b;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -27,9 +27,10 @@ public final class BrokersInitiate extends CardImpl {
this.toughness = new MageInt(4);
// {4}{G/U}: Brokers Initiate has base power and toughness 5/5 until end of turn.
this.addAbility(new SimpleActivatedAbility(new SetPowerToughnessSourceEffect(
5, 5, Duration.EndOfTurn, SubLayer.SetPT_7b
), new ManaCostsImpl<>("{4}{G/U}")));
this.addAbility(new SimpleActivatedAbility(
new SetBasePowerToughnessSourceEffect(5, 5, Duration.EndOfTurn, SubLayer.SetPT_7b, true),
new ManaCostsImpl<>("{4}{G/U}")
));
}
private BrokersInitiate(final BrokersInitiate card) {

View file

@ -6,7 +6,7 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.ArtifactYouControlCount;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.abilities.keyword.WardAbility;
import mage.cards.CardImpl;
@ -44,7 +44,7 @@ public final class BronzeGuardian extends CardImpl {
)));
// Bronze Guardian's power is equal to the number of artifacts you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(
ArtifactYouControlCount.instance, Duration.EndOfGame
)));
}

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.AffinityForArtifactsAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
@ -38,7 +38,7 @@ public final class Broodstar extends CardImpl {
this.addAbility(new AffinityForArtifactsAbility());
this.addAbility(FlyingAbility.getInstance());
// Broodstar's power and toughness are each equal to the number of artifacts you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame)));
}
private Broodstar(final Broodstar card) {

View file

@ -5,7 +5,7 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect;
import mage.abilities.effects.common.cost.SpellsCostModificationThatTargetSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -41,7 +41,7 @@ public final class CallapheBelovedOfTheSea extends CardImpl {
// Callaphe's power is equal to your to devotion to blue.
this.addAbility(new SimpleStaticAbility(
Zone.ALL, new SetPowerSourceEffect(DevotionCount.U, Duration.EndOfGame)
Zone.ALL, new SetBasePowerSourceEffect(DevotionCount.U, Duration.EndOfGame)
.setText("{this}'s power is equal to your devotion to blue")
).addHint(DevotionCount.U.getHint()));

View file

@ -10,7 +10,7 @@ import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.InfoEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.choices.Choice;
@ -114,7 +114,7 @@ enum CallerOfTheHuntAdjuster implements CostAdjuster {
// apply boost
FilterCreaturePermanent filter = new FilterCreaturePermanent("chosen creature type");
filter.add(typeChoice.getPredicate());
ContinuousEffect effectPowerToughness = new SetPowerToughnessSourceEffect(
ContinuousEffect effectPowerToughness = new SetBasePowerToughnessSourceEffect(
new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame);
effectPowerToughness.setText("");
SimpleStaticAbility setPT = new SimpleStaticAbility(Zone.ALL, effectPowerToughness);

View file

@ -3,7 +3,7 @@ package mage.cards.c;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.SetPowerToughnessAllEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessAllEffect;
import mage.abilities.hint.Hint;
import mage.abilities.hint.ValueHint;
import mage.cards.AdventureCard;
@ -32,7 +32,7 @@ public final class CandlekeepInspiration extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{U}");
// Until end of turn, creatures you control have base power and toughness X/X, where X is the number of cards you own in exile and in your graveyard that are instant cards, are sorcery cards, and/or have an Adventure.
this.getSpellAbility().addEffect(new SetPowerToughnessAllEffect(
this.getSpellAbility().addEffect(new SetBasePowerToughnessAllEffect(
CandlekeepInspirationValue.instance, CandlekeepInspirationValue.instance,
Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURE, true
).setText("until end of turn, creatures you control have base power and toughness X/X, " +

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -40,7 +40,7 @@ public final class Cantivore extends CardImpl {
this.addAbility(VigilanceAbility.getInstance());
// Cantivore's power and toughness are each equal to the number of enchantment cards in all graveyards.
DynamicValue value = (new CardsInAllGraveyardsCount(filter));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(value , Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(value , Duration.EndOfGame)));
}
private Cantivore(final Cantivore card) {

View file

@ -58,8 +58,8 @@ class CephalidFacetakerEffect extends OneShotEffect {
private static final CopyApplier copyApplier = new CopyApplier() {
@Override
public boolean apply(Game game, MageObject blueprint, Ability source, UUID targetObjectId) {
blueprint.getPower().modifyBaseValue(1);
blueprint.getToughness().modifyBaseValue(4);
blueprint.getPower().setModifiedBaseValue(1);
blueprint.getToughness().setModifiedBaseValue(4);
blueprint.getAbilities().add(new SimpleStaticAbility(
new CantBeBlockedSourceEffect().setText("this creature can't be blocked")
));

View file

@ -9,13 +9,10 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.ChooseColorEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.constants.SubType;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.constants.*;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
@ -41,7 +38,8 @@ public final class ChameleonSpirit extends CardImpl {
// Chameleon Spirit's power and toughness are each equal to the number
// of permanents of the chosen color your opponents control.
this.addAbility(new SimpleStaticAbility(
new SetPowerToughnessSourceEffect(
Zone.ALL,
new SetBasePowerToughnessSourceEffect(
PermanentsOfTheChosenColorOpponentsControlCount.instance,
Duration.EndOfGame)));
}

View file

@ -76,7 +76,7 @@ class ChariotOfTheSunEffect extends ContinuousEffectImpl {
this.discard();
return false;
}
permanent.getToughness().setValue(1);
permanent.getToughness().setModifiedBaseValue(1);
return true;
}
}

View file

@ -75,8 +75,8 @@ class ChimericCoilsEffect extends ContinuousEffectImpl {
case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) {
int xValue = source.getManaCostsToPay().getX();
permanent.getPower().setValue(xValue);
permanent.getToughness().setValue(xValue);
permanent.getPower().setModifiedBaseValue(xValue);
permanent.getToughness().setModifiedBaseValue(xValue);
}
}
return true;

View file

@ -10,7 +10,7 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.dynamicvalue.common.CountersSourceCount;
import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -37,7 +37,7 @@ public final class ChimericMass extends CardImpl {
new CreatureToken(0, 0, "Construct artifact creature with \"This creature's power and toughness are each equal to the number of charge counters on it.\"")
.withType(CardType.ARTIFACT)
.withSubType(SubType.CONSTRUCT)
.withAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetPowerToughnessSourceEffect(new CountersSourceCount(CounterType.CHARGE), Duration.WhileOnBattlefield))),
.withAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetBasePowerToughnessSourceEffect(new CountersSourceCount(CounterType.CHARGE), Duration.WhileOnBattlefield))),
"", Duration.EndOfTurn, false, true), new GenericManaCost(1)));
}

View file

@ -70,8 +70,8 @@ class ChimericStaffEffect extends ContinuousEffectImpl {
case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) {
int xValue = source.getManaCostsToPay().getX();
permanent.getPower().setValue(xValue);
permanent.getToughness().setValue(xValue);
permanent.getPower().setModifiedBaseValue(xValue);
permanent.getToughness().setModifiedBaseValue(xValue);
}
}
return true;

View file

@ -27,7 +27,7 @@ public final class CircleOfTheMoonDruid extends CardImpl {
this.toughness = new MageInt(4);
// Bear Form As long as its your turn, Circle of the Moon Druid is a Bear with base power and toughness 4/2.
this.addAbility(new SimpleStaticAbility(new WerewolfPackLeaderEffect()).withFlavorWord("Bear Form"));
this.addAbility(new SimpleStaticAbility(new CircleOfTheMoonDruidBearEffect()).withFlavorWord("Bear Form"));
}
private CircleOfTheMoonDruid(final CircleOfTheMoonDruid card) {
@ -40,20 +40,20 @@ public final class CircleOfTheMoonDruid extends CardImpl {
}
}
class WerewolfPackLeaderEffect extends ContinuousEffectImpl {
class CircleOfTheMoonDruidBearEffect extends ContinuousEffectImpl {
WerewolfPackLeaderEffect() {
CircleOfTheMoonDruidBearEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "as long as it's your turn, {this} is a Bear with base power and toughness 4/2";
}
private WerewolfPackLeaderEffect(final WerewolfPackLeaderEffect effect) {
private CircleOfTheMoonDruidBearEffect(final CircleOfTheMoonDruidBearEffect effect) {
super(effect);
}
@Override
public WerewolfPackLeaderEffect copy() {
return new WerewolfPackLeaderEffect(this);
public CircleOfTheMoonDruidBearEffect copy() {
return new CircleOfTheMoonDruidBearEffect(this);
}
@Override
@ -69,8 +69,8 @@ class WerewolfPackLeaderEffect extends ContinuousEffectImpl {
return true;
case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) {
permanent.getPower().setValue(4);
permanent.getToughness().setValue(2);
permanent.getPower().setModifiedBaseValue(4);
permanent.getToughness().setModifiedBaseValue(2);
return true;
}
}

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -38,7 +38,7 @@ public final class Cognivore extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Cognivore's power and toughness are each equal to the number of instant cards in all graveyards.
DynamicValue value = (new CardsInAllGraveyardsCount(filter));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(value, Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(value, Duration.EndOfGame)));
}
private Cognivore(final Cognivore card) {

View file

@ -5,7 +5,7 @@ import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -34,7 +34,7 @@ public final class CoilingWoodworm extends CardImpl {
this.toughness = new MageInt(1);
// Coiling Woodworm's power is equal to the number of Forests on the battlefield.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(count, Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(count, Duration.EndOfGame)));
}
private CoilingWoodworm(final CoilingWoodworm card) {

View file

@ -9,7 +9,7 @@ import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.*;
import mage.constants.CardType;
import mage.constants.Duration;
@ -34,7 +34,7 @@ public final class ConsumingAberration extends CardImpl {
this.toughness = new MageInt(0);
//Consuming Aberration's power and toughness are each equal to the number of cards in your opponents' graveyards.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInOpponentsGraveyardsCount(), Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new CardsInOpponentsGraveyardsCount(), Duration.EndOfGame)));
//Whenever you cast a spell, each opponent reveals cards from the top of their library until they reveal a land card, then puts those cards into their graveyard.
this.addAbility(new SpellCastControllerTriggeredAbility(new ConsumingAberrationEffect(), false));
}

View file

@ -5,13 +5,18 @@ import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.AdditiveDynamicValue;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CardTypesInGraveyardCount;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.hint.common.CardTypesInGraveyardHint;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.token.ConsumingBlobOozeToken;
@ -22,6 +27,9 @@ import java.util.UUID;
*/
public final class ConsumingBlob extends CardImpl {
private static final DynamicValue powerValue = CardTypesInGraveyardCount.YOU;
private static final DynamicValue toughnessValue = new AdditiveDynamicValue(powerValue, StaticValue.get(1));
public ConsumingBlob(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}");
@ -30,7 +38,11 @@ public final class ConsumingBlob extends CardImpl {
this.toughness = new MageInt(1);
// Consuming Blob's power is equal to the number of card types among cards in your graveyard and its toughness is equal to that number plus 1.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new ConsumingBlobEffect()).addHint(CardTypesInGraveyardHint.YOU));
this.addAbility(new SimpleStaticAbility(
Zone.ALL,
new SetBasePowerToughnessSourceEffect(powerValue, toughnessValue, Duration.EndOfGame, SubLayer.CharacteristicDefining_7a, false)
.setText("{this}'s power is equal to the number of creature cards in all graveyards and its toughness is equal to that number plus 1")
));
// At the beginning of your end step, create a green Ooze creature token with "This creature's power is equal to the number of card types among cards in your graveyard and its toughness is equal to that number plus 1".
this.addAbility(new BeginningOfEndStepTriggeredAbility(
@ -47,32 +59,3 @@ public final class ConsumingBlob extends CardImpl {
return new ConsumingBlob(this);
}
}
class ConsumingBlobEffect extends ContinuousEffectImpl {
public ConsumingBlobEffect() {
super(Duration.EndOfGame, Layer.PTChangingEffects_7, SubLayer.CharacteristicDefining_7a, Outcome.BoostCreature);
staticText = "{this}'s power is equal to the number of card types among cards in your graveyard and its toughness is equal to that number plus 1";
}
public ConsumingBlobEffect(final ConsumingBlobEffect effect) {
super(effect);
}
@Override
public ConsumingBlobEffect copy() {
return new ConsumingBlobEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
MageObject target = source.getSourceObject(game);
if (target == null) {
return false;
}
int number = CardTypesInGraveyardCount.YOU.calculate(game, source, this);
target.getPower().setValue(number);
target.getToughness().setValue(number + 1);
return true;
}
}

View file

@ -5,7 +5,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.InstantSorceryExileGraveyardCount;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect;
import mage.abilities.hint.Hint;
import mage.abilities.hint.ValueHint;
import mage.abilities.keyword.FlyingAbility;
@ -40,7 +40,7 @@ public final class CracklingDrake extends CardImpl {
// Crackling Drake's power is equal to the total number of instant and sorcery cards you own in exile and in your graveyard.
this.addAbility(new SimpleStaticAbility(
Zone.ALL,
new SetPowerSourceEffect(
new SetBasePowerSourceEffect(
InstantSorceryExileGraveyardCount.instance, Duration.EndOfGame
).setText("{this}'s power is equal to the total number "
+ "of instant and sorcery cards you own "

View file

@ -10,7 +10,7 @@ import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
@ -41,7 +41,7 @@ public final class CraterElemental extends CardImpl {
// <i>Formidable</i> &mdash; {2}{R}: Crater Elemental has base power 8 until end of turn. Activate this ability only if creatures you control have total power 8 or greater.
ability = new ActivateIfConditionActivatedAbility(
Zone.BATTLEFIELD,
new SetPowerSourceEffect(StaticValue.get(8), Duration.EndOfTurn, SubLayer.SetPT_7b)
new SetBasePowerToughnessSourceEffect(StaticValue.get(8), null, Duration.EndOfTurn, SubLayer.SetPT_7b,true)
.setText("{this} has base power 8 until end of turn"),
new ManaCostsImpl<>("{2}{R}"),
FormidableCondition.instance

View file

@ -8,7 +8,7 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -35,13 +35,12 @@ public final class Creeperhulk extends CardImpl {
// Trample
this.addAbility(TrampleAbility.getInstance());
// {1}{G}: Until end of turn, target creature you control has base power and toughness 5/5 and gains trample.
Effect effect = new SetPowerToughnessTargetEffect(5,5, Duration.EndOfTurn);
Effect effect = new SetBasePowerToughnessTargetEffect(5,5, Duration.EndOfTurn);
effect.setText("Until end of turn, target creature you control has base power and toughness 5/5");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{1}{G}"));
ability.addTarget(new TargetControlledCreaturePermanent());
ability.addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, "and gains Trample"));
this.addAbility(ability);
}
private Creeperhulk(final Creeperhulk card) {

View file

@ -2,7 +2,7 @@ package mage.cards.c;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -49,7 +49,7 @@ public final class CreepyPuppeteer extends CardImpl {
class CreepyPuppeteerTriggeredAbility extends TriggeredAbilityImpl {
CreepyPuppeteerTriggeredAbility() {
super(Zone.BATTLEFIELD, new SetPowerToughnessTargetEffect(4, 3, Duration.EndOfTurn), true);
super(Zone.BATTLEFIELD, new SetBasePowerToughnessTargetEffect(4, 3, Duration.EndOfTurn), true);
}
private CreepyPuppeteerTriggeredAbility(final CreepyPuppeteerTriggeredAbility ability) {

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.FearAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -38,7 +38,7 @@ public final class CrowdOfCinders extends CardImpl {
this.addAbility(FearAbility.getInstance());
// Crowd of Cinders's power and toughness are each equal to the number of black permanents you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame)));
}
private CrowdOfCinders(final CrowdOfCinders card) {

View file

@ -3,7 +3,7 @@ package mage.cards.c;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.CreaturesYouControlCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.hint.common.CreaturesYouControlHint;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -28,7 +28,7 @@ public final class CrusaderOfOdric extends CardImpl {
this.toughness = new MageInt(0);
// Crusader of Odric's power and toughness are each equal to the number of creatures you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame))
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(CreaturesYouControlCount.instance, Duration.EndOfGame))
.addHint(CreaturesYouControlHint.instance));
}

View file

@ -6,7 +6,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.LandsYouControlCount;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
@ -38,7 +38,7 @@ public final class CultivatorColossus extends CardImpl {
// Cultivator Colossus's power and toughness are each equal to the number of lands you control.
this.addAbility(new SimpleStaticAbility(
Zone.ALL, new SetPowerToughnessSourceEffect(LandsYouControlCount.instance, Duration.EndOfGame)
Zone.ALL, new SetBasePowerToughnessSourceEffect(LandsYouControlCount.instance, Duration.EndOfGame)
));
// When Cultivator Colossus enters the battlefield, you may put a land card from your hand onto the battlefield tapped. If you do, draw a card and repeat this process.

View file

@ -83,8 +83,8 @@ class CurseOfConformityEffect extends ContinuousEffectImpl {
break;
case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) {
permanent.getPower().setValue(3);
permanent.getToughness().setValue(3);
permanent.getPower().setModifiedBaseValue(3);
permanent.getToughness().setModifiedBaseValue(3);
}
}
}

View file

@ -105,8 +105,8 @@ class CyberdriveAwakenerEffect extends ContinuousEffectImpl {
break;
case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) {
permanent.getPower().setValue(4);
permanent.getToughness().setValue(4);
permanent.getPower().setModifiedBaseValue(4);
permanent.getToughness().setModifiedBaseValue(4);
}
}
}

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -35,7 +35,7 @@ public final class DakkonBlackblade extends CardImpl {
// Dakkon Blackblade's power and toughness are each equal to the number of lands you control.
DynamicValue controlledLands = new PermanentsOnBattlefieldCount(filter);
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(controlledLands, Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(controlledLands, Duration.EndOfGame)));
}
private DakkonBlackblade(final DakkonBlackblade card) {

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -34,7 +34,7 @@ public final class DakmorSorceress extends CardImpl {
this.toughness = new MageInt(4);
// Dakmor Sorceress's power is equal to the number of Swamps you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame)));
}
private DakmorSorceress(final DakmorSorceress card) {

View file

@ -4,7 +4,7 @@ import mage.abilities.Ability;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
@ -112,7 +112,7 @@ class DanceOfTheManseEffect extends OneShotEffect {
ContinuousEffect effect = new AddCardTypeTargetEffect(Duration.EndOfGame, CardType.CREATURE);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
effect = new SetPowerToughnessTargetEffect(4, 4, Duration.EndOfGame);
effect = new SetBasePowerToughnessTargetEffect(4, 4, Duration.EndOfGame);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
});

View file

@ -88,8 +88,8 @@ class DancingSwordEffect extends ContinuousEffectImpl {
return true;
case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) {
permanent.getPower().setValue(2);
permanent.getToughness().setValue(1);
permanent.getPower().setModifiedBaseValue(2);
permanent.getToughness().setModifiedBaseValue(1);
return true;
}
}

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.common.AttacksEachCombatStaticAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -32,8 +32,10 @@ public final class DarksteelJuggernaut extends CardImpl {
this.addAbility(IndestructibleAbility.getInstance());
// Darksteel Juggernaut's power and toughness are each equal to the number of artifacts you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL,
new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(new FilterControlledArtifactPermanent("artifacts you control")), Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(
Zone.ALL,
new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(new FilterControlledArtifactPermanent("artifacts you control")), Duration.EndOfGame)
));
// Darksteel Juggernaut attacks each turn if able.
this.addAbility(new AttacksEachCombatStaticAbility());

View file

@ -9,7 +9,7 @@ import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -51,7 +51,7 @@ public final class DauntlessDourbark extends CardImpl {
// Dauntless Dourbark's power and toughness are each equal to the number of Forests you control plus the number of Treefolk you control.
DynamicValue amount = new PermanentsOnBattlefieldCount(filter);
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(amount, Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(amount, Duration.EndOfGame)));
// Dauntless Dourbark has trample as long as you control another Treefolk.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield), new PermanentsOnTheBattlefieldCondition(filter2), rule)));

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect;
import mage.abilities.keyword.ShadowAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -41,7 +41,7 @@ public final class DauthiWarlord extends CardImpl {
this.addAbility(ShadowAbility.getInstance());
// Dauthi Warlord's power is equal to the number of creatures with shadow on the battlefield.
Effect effect = new SetPowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame);
Effect effect = new SetBasePowerSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame);
this.addAbility(new SimpleStaticAbility(Zone.ALL, effect));
}

View file

@ -5,7 +5,7 @@ import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.continuous.SetToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBaseToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
@ -32,7 +32,7 @@ public final class DaxosBlessedByTheSun extends CardImpl {
// Daxos's toughness is equal to your devotion to white.
this.addAbility(new SimpleStaticAbility(
Zone.ALL,
new SetToughnessSourceEffect(DevotionCount.W, Duration.EndOfGame)
new SetBaseToughnessSourceEffect(DevotionCount.W, Duration.EndOfGame)
.setText("{this}'s toughness is equal to your devotion to white")
).addHint(DevotionCount.W.getHint()));

View file

@ -10,7 +10,7 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.SuspendAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -41,7 +41,7 @@ public final class Detritivore extends CardImpl {
this.toughness = new MageInt(0);
// Detritivore's power and toughness are each equal to the number of nonbasic land cards in your opponents' graveyards.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new NonBasicLandsInOpponentsGraveyards(), Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new NonBasicLandsInOpponentsGraveyards(), Duration.EndOfGame)));
// Suspend X-{X}{3}{R}. X can't be 0.
this.addAbility(new SuspendAbility(Integer.MAX_VALUE, new ManaCostsImpl<>("{3}{R}"), this, true));

View file

@ -55,8 +55,8 @@ class DevastatingSummonsEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
DevastatingSummonsElementalToken token = new DevastatingSummonsElementalToken();
token.getPower().modifyBaseValue(GetXValue.instance.calculate(game, source, this));
token.getToughness().modifyBaseValue(GetXValue.instance.calculate(game, source, this));
token.setPower(GetXValue.instance.calculate(game, source, this));
token.setToughness(GetXValue.instance.calculate(game, source, this));
token.putOntoBattlefield(2, game, source, source.getControllerId());

View file

@ -3,7 +3,7 @@
package mage.cards.d;
import java.util.UUID;
import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -20,7 +20,7 @@ public final class Diminish extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}");
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new SetPowerToughnessTargetEffect(1, 1, Duration.EndOfTurn));
this.getSpellAbility().addEffect(new SetBasePowerToughnessTargetEffect(1, 1, Duration.EndOfTurn));
}
private Diminish(final Diminish card) {

View file

@ -7,7 +7,7 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect;
import mage.abilities.keyword.CrewAbility;
import mage.abilities.keyword.ScavengeAbility;
import mage.abilities.keyword.TrampleAbility;
@ -39,7 +39,7 @@ public final class DodgyJalopy extends CardImpl {
// Dodgy Jalopy's power is equal to the highest mana value among creatures you control.
this.addAbility(new SimpleStaticAbility(
Zone.ALL, new SetPowerSourceEffect(DodgyJalopyValue.instance, Duration.EndOfGame)
Zone.ALL, new SetBasePowerSourceEffect(DodgyJalopyValue.instance, Duration.EndOfGame)
));
// Crew 3

View file

@ -108,8 +108,8 @@ enum DonalHeraldOfWingsApplier implements StackObjectCopyApplier {
@Override
public void modifySpell(StackObject copiedSpell, Game game) {
copiedSpell.addSubType(SubType.SPIRIT);
copiedSpell.getPower().modifyBaseValue(1);
copiedSpell.getToughness().modifyBaseValue(1);
copiedSpell.getPower().setModifiedBaseValue(1);
copiedSpell.getToughness().setModifiedBaseValue(1);
}
@Override

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.abilities.common.DealsDamageGainLifeSourceTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -35,7 +35,7 @@ public final class DoubtlessOne extends CardImpl {
this.toughness = new MageInt(0);
// Doubtless One's power and toughness are each equal to the number of Clerics on the battlefield.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame)));
// Whenever Doubtless One deals damage, you gain that much life.
this.addAbility(new DealsDamageGainLifeSourceTriggeredAbility());

View file

@ -10,7 +10,7 @@ import mage.abilities.costs.mana.ColoredManaCost;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -94,13 +94,20 @@ class DracoplasmEffect extends ReplacementEffectImpl {
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
Player controller = game.getPlayer(source.getControllerId());
if (creature != null && controller != null) {
if (creature == null || controller == null) {
return false;
}
Target target = new TargetControlledPermanent(0, Integer.MAX_VALUE, filter, true);
if (!target.canChoose(source.getControllerId(), source, game)) {
return false;
}
controller.chooseTarget(Outcome.Detriment, target, source, game);
if (!target.getTargets().isEmpty()) {
if (target.getTargets().isEmpty()) {
return false;
}
int power = 0;
int toughness = 0;
for (UUID targetId : target.getTargets()) {
@ -110,10 +117,8 @@ class DracoplasmEffect extends ReplacementEffectImpl {
toughness = CardUtil.overflowInc(toughness, targetCreature.getToughness().getValue());
}
}
ContinuousEffect effect = new SetPowerToughnessSourceEffect(power, toughness, Duration.Custom, SubLayer.SetPT_7b);
ContinuousEffect effect = new SetBasePowerToughnessSourceEffect(power, toughness, Duration.Custom, SubLayer.SetPT_7b);
game.addEffect(effect, source);
}
}
return false;
return true;
}
}

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.constants.SubType;
import mage.abilities.keyword.DefenderAbility;
import mage.cards.CardImpl;
@ -42,7 +42,7 @@ public final class DriftOfTheDead extends CardImpl {
this.addAbility(DefenderAbility.getInstance());
// Drift of the Dead's power and toughness are each equal to the number of snow lands you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame)));
}
private DriftOfTheDead(final DriftOfTheDead card) {

View file

@ -6,7 +6,7 @@ import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.HexproofAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -38,7 +38,7 @@ public final class DroveOfElves extends CardImpl {
this.addAbility(HexproofAbility.getInstance());
// Drove of Elves's power and toughness are each equal to the number of green permanents you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Duration.EndOfGame)));
}
private DroveOfElves(final DroveOfElves card) {

View file

@ -10,7 +10,7 @@ import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect;
import mage.abilities.effects.common.continuous.GainClassAbilitySourceEffect;
import mage.abilities.effects.common.continuous.PlayAdditionalLandsControllerEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.ClassLevelAbility;
import mage.abilities.keyword.ClassReminderAbility;
import mage.abilities.keyword.HasteAbility;
@ -82,7 +82,7 @@ class DruidClassToken extends TokenImpl {
this.toughness = new MageInt(0);
this.addAbility(HasteAbility.getInstance());
this.addAbility(new SimpleStaticAbility(new SetPowerToughnessSourceEffect(
this.addAbility(new SimpleStaticAbility(new SetBasePowerToughnessSourceEffect(
LandsYouControlCount.instance, Duration.EndOfGame, SubLayer.SetPT_7b
).setText("this creature's power and toughness are each equal to the number of lands you control")));
}

View file

@ -6,7 +6,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.HexproofAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -39,7 +39,7 @@ public final class DungroveElder extends CardImpl {
this.addAbility(HexproofAbility.getInstance());
// Dungrove Elder's power and toughness are each equal to the number of Forests you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterLands), Duration.EndOfGame)));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterLands), Duration.EndOfGame)));
}
public DungroveElder (final DungroveElder card) {

View file

@ -133,8 +133,8 @@ class DuplicantContinuousEffect extends ContinuousEffectImpl {
break;
case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) {
permanent.getPower().setValue(card.getPower().getValue());
permanent.getToughness().setValue(card.getToughness().getValue());
permanent.getPower().setModifiedBaseValue(card.getPower().getValue());
permanent.getToughness().setModifiedBaseValue(card.getToughness().getValue());
}
}
return true;

View file

@ -92,8 +92,8 @@ class EccentricApprenticeEffect extends ContinuousEffectImpl {
return true;
case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) {
permanent.getPower().setValue(1);
permanent.getToughness().setValue(1);
permanent.getPower().setModifiedBaseValue(1);
permanent.getToughness().setModifiedBaseValue(1);
return true;
}
}

View file

@ -6,7 +6,7 @@ import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
@ -71,15 +71,14 @@ class EldraziMimicEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Permanent permanent = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);
if (permanent != null) {
ContinuousEffect effect = new SetPowerToughnessTargetEffect(permanent.getPower().getValue(), permanent.getToughness().getValue(), Duration.EndOfTurn);
if (controller == null || permanent == null) {
return false;
}
ContinuousEffect effect = new SetBasePowerToughnessTargetEffect(permanent.getPower().getValue(), permanent.getToughness().getValue(), Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(source.getSourceId(), game));
game.addEffect(effect, source);
return true;
}
}
return false;
}
}

View file

@ -8,7 +8,7 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -33,7 +33,7 @@ public final class ElvishHouseParty extends CardImpl {
// Elvish House Party's power and toughness are each equal to the current hour,
// using the twelve-hour system.
this.addAbility(new SimpleStaticAbility(Zone.ALL,
new SetPowerToughnessSourceEffect(new CurrentHourCount(), Duration.WhileOnBattlefield)));
new SetBasePowerToughnessSourceEffect(new CurrentHourCount(), Duration.WhileOnBattlefield)));
}
private ElvishHouseParty(final ElvishHouseParty card) {

View file

@ -5,7 +5,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
@ -59,13 +59,13 @@ class ElvishImpersonatorsEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
if (controller == null) {
return false;
}
List<Integer> results = controller.rollDice(outcome, source, game, 6, 2, 0);
int firstRoll = results.get(0);
int secondRoll = results.get(1);
game.addEffect(new SetPowerToughnessSourceEffect(firstRoll, secondRoll, Duration.WhileOnBattlefield, SubLayer.SetPT_7b), source);
game.addEffect(new SetBasePowerToughnessSourceEffect(firstRoll, secondRoll, Duration.WhileOnBattlefield, SubLayer.SetPT_7b, true), source);
return true;
}
return false;
}
}

View file

@ -5,7 +5,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
import mage.abilities.effects.common.continuous.SetPowerSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -32,7 +32,7 @@ public final class EnigmaDrake extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Enigma Drakes's power is equal to the number of instant and sorcery cards in your graveyard.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerSourceEffect(
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerSourceEffect(
new CardsInControllerGraveyardCount(new FilterInstantOrSorceryCard("instant and sorcery cards")), Duration.EndOfGame)));
}

View file

@ -9,7 +9,7 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.ChooseOpponentEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
@ -42,7 +42,7 @@ public final class EntropicSpecter extends CardImpl {
// Entropic Specter's power and toughness are each equal to the number of cards in the chosen player's hand.
this.addAbility(new SimpleStaticAbility(Zone.ALL,
// back to the graveyard or if the chosen player left the gane it's again a 0/0
new SetPowerToughnessSourceEffect(CardsInTargetPlayerHandCount.instance, Duration.WhileOnBattlefield, SubLayer.CharacteristicDefining_7a)));
new SetBasePowerToughnessSourceEffect(CardsInTargetPlayerHandCount.instance, Duration.WhileOnBattlefield, SubLayer.CharacteristicDefining_7a)));
// Whenever Entropic Specter deals damage to a player, that player discards a card.
this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(1, false), false, true));

View file

@ -95,7 +95,7 @@ class EssenceSymbioteTriggeredAbility extends TriggeredAbilityImpl {
&& controller.getId().equals(sourcePermanent.getControllerId())
&& this.isControlledBy(controller.getId())) {
for (Effect effect : this.getEffects()) {
effect.setValue("targetId", targetPermanent.getId());
effect.setBoostedValue("targetId", targetPermanent.getId());
effect.setTargetPointer(new FixedTarget(targetPermanent.getId(), targetPermanent.getZoneChangeCounter(game)));
}
return true;

View file

@ -160,8 +160,8 @@ class ChimericStaffEffect extends ContinuousEffectImpl {
case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) {
int xValue = source.getManaCostsToPay().getX();
permanent.getPower().setValue(xValue);
permanent.getToughness().setValue(xValue);
permanent.getPower().setModifiedBaseValue(xValue);
permanent.getToughness().setModifiedBaseValue(xValue);
}
}
return true;

Some files were not shown because too many files have changed in this diff Show more