1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-10 01:01:05 -09:00

updated implementation of Domain value

This commit is contained in:
Evan Kranzler 2022-03-06 18:31:07 -05:00
parent c8cdc0a502
commit 3833d7bab3
36 changed files with 103 additions and 157 deletions

View file

@ -21,7 +21,7 @@ public final class AlliedStrategies extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{U}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{U}");
// Domain - Target player draws a card for each basic land type among lands they control. // Domain - Target player draws a card for each basic land type among lands they control.
this.getSpellAbility().addEffect(new DrawCardTargetEffect(new DomainValue(true))); this.getSpellAbility().addEffect(new DrawCardTargetEffect(DomainValue.TARGET));
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN); this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);
this.getSpellAbility().addHint(DomainHint.instance); this.getSpellAbility().addHint(DomainHint.instance);

View file

@ -2,7 +2,6 @@ package mage.cards.a;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.DomainValue;
import mage.abilities.effects.common.continuous.SetToughnessSourceEffect; import mage.abilities.effects.common.continuous.SetToughnessSourceEffect;
import mage.abilities.hint.common.DomainHint; import mage.abilities.hint.common.DomainHint;
@ -18,8 +17,6 @@ import java.util.UUID;
*/ */
public final class AvenTrailblazer extends CardImpl { public final class AvenTrailblazer extends CardImpl {
private static final DynamicValue xValue = new DomainValue();
public AvenTrailblazer(UUID ownerId, CardSetInfo setInfo) { public AvenTrailblazer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.subtype.add(SubType.BIRD); this.subtype.add(SubType.BIRD);
@ -33,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. // Domain - Aven Trailblazer's toughness is equal to the number of basic land types among lands you control.
this.addAbility(new SimpleStaticAbility( this.addAbility(new SimpleStaticAbility(
Zone.ALL, new SetToughnessSourceEffect(xValue, Duration.EndOfGame) Zone.ALL, new SetToughnessSourceEffect(DomainValue.REGULAR, Duration.EndOfGame)
.setText("{this}'s toughness is equal to the number of basic land types among lands you control") .setText("{this}'s toughness is equal to the number of basic land types among lands you control")
).addHint(DomainHint.instance).setAbilityWord(AbilityWord.DOMAIN)); ).addHint(DomainHint.instance).setAbilityWord(AbilityWord.DOMAIN));
} }

View file

@ -1,7 +1,5 @@
package mage.cards.c; package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.DomainValue;
@ -15,10 +13,10 @@ import mage.constants.AbilityWord;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.TargetController; import mage.constants.TargetController;
import java.util.UUID;
/** /**
*
* @author LoneFox * @author LoneFox
*
*/ */
public final class CollapsingBorders extends CardImpl { public final class CollapsingBorders extends CardImpl {
@ -26,7 +24,7 @@ public final class CollapsingBorders extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}");
// Domain - At the beginning of each player's upkeep, that player gains 1 life for each basic land type among lands they control. Then Collapsing Borders deals 3 damage to that player. // Domain - At the beginning of each player's upkeep, that player gains 1 life for each basic land type among lands they control. Then Collapsing Borders deals 3 damage to that player.
Effect effect = new GainLifeTargetEffect(new DomainValue(true)); Effect effect = new GainLifeTargetEffect(DomainValue.TARGET);
effect.setText("that player gains 1 life for each basic land type among lands they control"); effect.setText("that player gains 1 life for each basic land type among lands they control");
Ability ability = new BeginningOfUpkeepTriggeredAbility(effect, TargetController.ANY, false); Ability ability = new BeginningOfUpkeepTriggeredAbility(effect, TargetController.ANY, false);
effect = new DamageTargetEffect(3); effect = new DamageTargetEffect(3);

View file

@ -56,7 +56,7 @@ class CollectiveRestraintPayManaToAttackAllEffect extends CantAttackYouUnlessPay
@Override @Override
public ManaCosts getManaCostToPay(GameEvent event, Ability source, Game game) { public ManaCosts getManaCostToPay(GameEvent event, Ability source, Game game) {
int domainValue = new DomainValue().calculate(game, source, this); int domainValue = DomainValue.REGULAR.calculate(game, source, this);
if (domainValue > 0) { if (domainValue > 0) {
return new ManaCostsImpl<>("{" + domainValue + '}'); return new ManaCostsImpl<>("{" + domainValue + '}');
} }

View file

@ -65,7 +65,7 @@ class DracoCostReductionEffect extends CostModificationEffectImpl {
@Override @Override
public boolean apply(Game game, Ability source, Ability abilityToModify) { public boolean apply(Game game, Ability source, Ability abilityToModify) {
CardUtil.reduceCost(abilityToModify, new DomainValue(2).calculate(game, source, this)); CardUtil.reduceCost(abilityToModify, 2 * DomainValue.REGULAR.calculate(game, source, this));
return true; return true;
} }
@ -98,7 +98,7 @@ class DracoSacrificeUnlessPaysEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(source.getSourceId()); Permanent permanent = game.getPermanent(source.getSourceId());
if (player != null && permanent != null) { if (player != null && permanent != null) {
// The cost is reduced by {2} for each basic land type. // The cost is reduced by {2} for each basic land type.
int domainValueReduction = new DomainValue(2).calculate(game, source, this); int domainValueReduction = 2 * DomainValue.REGULAR.calculate(game, source, this);
int count = Math.max(0, MAX_DOMAIN_VALUE - domainValueReduction); int count = Math.max(0, MAX_DOMAIN_VALUE - domainValueReduction);
if (player.chooseUse(Outcome.Benefit, "Pay {" + count + "}? Or " + permanent.getName() + " will be sacrificed.", source, game)) { if (player.chooseUse(Outcome.Benefit, "Pay {" + count + "}? Or " + permanent.getName() + " will be sacrificed.", source, game)) {
Cost cost = ManaUtil.createManaCost(count, false); Cost cost = ManaUtil.createManaCost(count, false);

View file

@ -1,6 +1,7 @@
package mage.cards.d; package mage.cards.d;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.MultipliedValue;
import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.DomainValue;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.hint.common.DomainHint; import mage.abilities.hint.common.DomainHint;
@ -18,13 +19,14 @@ import java.util.UUID;
*/ */
public final class DragDown extends CardImpl { public final class DragDown extends CardImpl {
private static final DynamicValue xValue = new DomainValue(-1); private static final DynamicValue xValue = new MultipliedValue(DomainValue.REGULAR, -1);
public DragDown(UUID ownerId, CardSetInfo setInfo) { public DragDown(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}");
// Domain - Target creature gets -1/-1 until end of turn for each basic land type among lands you control. // Domain - Target creature gets -1/-1 until end of turn for each basic land type among lands you control.
this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true)); this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn, true)
.setText("target creature gets -1/-1 until end of turn for each basic land type among lands you control"));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addHint(DomainHint.instance); this.getSpellAbility().addHint(DomainHint.instance);
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN); this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);

View file

@ -21,7 +21,7 @@ public final class EvasiveAction extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
// Domain - Counter target spell unless its controller pays {1} for each basic land type among lands you control. // Domain - Counter target spell unless its controller pays {1} for each basic land type among lands you control.
this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new DomainValue())); this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(DomainValue.REGULAR));
this.getSpellAbility().addTarget(new TargetSpell()); this.getSpellAbility().addTarget(new TargetSpell());
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN); this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);
this.getSpellAbility().addHint(DomainHint.instance); this.getSpellAbility().addHint(DomainHint.instance);

View file

@ -33,7 +33,7 @@ public final class ExoticCurse extends CardImpl {
this.addAbility(new EnchantAbility(auraTarget.getTargetName())); this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
// Domain - Enchanted creature gets -1/-1 for each basic land type among lands you control. // Domain - Enchanted creature gets -1/-1 for each basic land type among lands you control.
DynamicValue unboost = new SignInversionDynamicValue(new DomainValue()); DynamicValue unboost = new SignInversionDynamicValue(DomainValue.REGULAR);
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(unboost, unboost, Duration.WhileOnBattlefield)); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(unboost, unboost, Duration.WhileOnBattlefield));
ability.setAbilityWord(AbilityWord.DOMAIN); ability.setAbilityWord(AbilityWord.DOMAIN);
this.addAbility(ability.addHint(DomainHint.instance)); this.addAbility(ability.addHint(DomainHint.instance));

View file

@ -1,36 +1,33 @@
package mage.cards.e; package mage.cards.e;
import java.util.UUID;
import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.DomainValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.abilities.hint.common.DomainHint; import mage.abilities.hint.common.DomainHint;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.AbilityWord;
import mage.constants.CardType; import mage.constants.CardType;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
import java.util.UUID;
/** /**
*
* @author LoneFox * @author LoneFox
*/ */
public final class ExoticDisease extends CardImpl { public final class ExoticDisease extends CardImpl {
public ExoticDisease(UUID ownerId, CardSetInfo setInfo) { public ExoticDisease(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{B}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{B}");
// Domain - Target player loses X life and you gain X life, where X is the number of basic land types among lands you control. // Domain - Target player loses X life and you gain X life, where X is the number of basic land types among lands you control.
DomainValue dv = new DomainValue(); this.getSpellAbility().addEffect(new LoseLifeTargetEffect(DomainValue.REGULAR)
Effect effect = new LoseLifeTargetEffect(dv); .setText("target player loses X life"));
effect.setText("<i>Domain</i> &mdash; Target player loses X life"); this.getSpellAbility().addEffect(new GainLifeEffect(DomainValue.REGULAR)
this.getSpellAbility().addEffect(effect); .setText("and you gain X life, where X is the number of basic land types among lands you control"));
effect = new GainLifeEffect(dv);
effect.setText("and you gain X life, where X is the number of basic land types among lands you control");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addHint(DomainHint.instance); this.getSpellAbility().addHint(DomainHint.instance);
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);
} }
private ExoticDisease(final ExoticDisease card) { private ExoticDisease(final ExoticDisease card) {

View file

@ -24,7 +24,7 @@ public final class ExplodingBorders extends CardImpl {
// Domain - Search your library for a basic land card, put that card onto the battlefield tapped, then shuffle your library. Exploding Borders deals X damage to target player, where X is the number of basic land types among lands you control. // Domain - Search your library for a basic land card, put that card onto the battlefield tapped, then shuffle your library. Exploding Borders deals X damage to target player, where X is the number of basic land types among lands you control.
this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), true)); this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), true));
this.getSpellAbility().addEffect(new DamageTargetEffect(new DomainValue())); this.getSpellAbility().addEffect(new DamageTargetEffect(DomainValue.REGULAR));
this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker()); this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker());
this.getSpellAbility().addHint(DomainHint.instance); this.getSpellAbility().addHint(DomainHint.instance);
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN); this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);

View file

@ -22,7 +22,7 @@ public final class GaeasMight extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}");
// Domain - Target creature gets +1/+1 until end of turn for each basic land type among lands you control. // Domain - Target creature gets +1/+1 until end of turn for each basic land type among lands you control.
this.getSpellAbility().addEffect(new BoostTargetEffect(new DomainValue(), new DomainValue(), Duration.EndOfTurn)); this.getSpellAbility().addEffect(new BoostTargetEffect(DomainValue.REGULAR, DomainValue.REGULAR, Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN); this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);
this.getSpellAbility().addHint(DomainHint.instance); this.getSpellAbility().addHint(DomainHint.instance);

View file

@ -5,7 +5,6 @@ import mage.abilities.Ability;
import mage.abilities.common.ActivateAsSorceryActivatedAbility; import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.DomainValue;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
@ -95,8 +94,6 @@ enum HiveheartShamanPredicate implements ObjectSourcePlayerPredicate<Card> {
class HiveheartShamanEffect extends OneShotEffect { class HiveheartShamanEffect extends OneShotEffect {
private static final DynamicValue xValue = new DomainValue();
HiveheartShamanEffect() { HiveheartShamanEffect() {
super(Outcome.Benefit); super(Outcome.Benefit);
staticText = "create a 1/1 green Insect creature token. Put X +1/+1 counters on it, " + staticText = "create a 1/1 green Insect creature token. Put X +1/+1 counters on it, " +
@ -116,7 +113,7 @@ class HiveheartShamanEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Token token = new InsectToken(); Token token = new InsectToken();
token.putOntoBattlefield(1, game, source); token.putOntoBattlefield(1, game, source);
int domainCount = xValue.calculate(game, source, this); int domainCount = DomainValue.REGULAR.calculate(game, source, this);
if (domainCount < 1) { if (domainCount < 1) {
return true; return true;
} }

View file

@ -32,7 +32,7 @@ public final class KavuScout extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Domain - Kavu Scout gets +1/+0 for each basic land type among lands you control. // Domain - Kavu Scout gets +1/+0 for each basic land type among lands you control.
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(new DomainValue(), StaticValue.get(0), Duration.WhileOnBattlefield)); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(DomainValue.REGULAR, StaticValue.get(0), Duration.WhileOnBattlefield));
ability.setAbilityWord(AbilityWord.DOMAIN); ability.setAbilityWord(AbilityWord.DOMAIN);
this.addAbility(ability.addHint(DomainHint.instance)); this.addAbility(ability.addHint(DomainHint.instance));
} }

View file

@ -26,7 +26,7 @@ public final class ManaforceMace extends CardImpl {
// Domain - Equipped creature gets +1/+1 for each basic land type among lands you control. // Domain - Equipped creature gets +1/+1 for each basic land type among lands you control.
this.addAbility(new SimpleStaticAbility( this.addAbility(new SimpleStaticAbility(
new BoostEquippedEffect(new DomainValue(), new DomainValue()) new BoostEquippedEffect(DomainValue.REGULAR, DomainValue.REGULAR)
).addHint(DomainHint.instance).setAbilityWord(AbilityWord.DOMAIN)); ).addHint(DomainHint.instance).setAbilityWord(AbilityWord.DOMAIN));
// Equip {3} // Equip {3}

View file

@ -1,10 +1,8 @@
package mage.cards.m; package mage.cards.m;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.IntCompareCondition; import mage.abilities.condition.IntCompareCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.DomainValue;
@ -15,22 +13,25 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.ComparisonType; import mage.constants.ComparisonType;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import java.util.UUID;
/** /**
*
* @author LoneFox * @author LoneFox
*/ */
public final class MaskOfIntolerance extends CardImpl { public final class MaskOfIntolerance extends CardImpl {
private static final Condition condition = new MaskOfIntoleranceCondition();
public MaskOfIntolerance(UUID ownerId, CardSetInfo setInfo) { public MaskOfIntolerance(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
// At the beginning of each player's upkeep, if there are four or more basic land types among lands that player controls, Mask of Intolerance deals 3 damage to that player. // At the beginning of each player's upkeep, if there are four or more basic land types among lands that player controls, Mask of Intolerance deals 3 damage to that player.
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new DamageTargetEffect(3), TargetController.ANY, false); this.addAbility(new ConditionalInterveningIfTriggeredAbility(new BeginningOfUpkeepTriggeredAbility(
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new MaskOfIntoleranceCondition(), new DamageTargetEffect(3), TargetController.ANY, false
"At the beginning of each player's upkeep, if there are four or more basic land types among lands that player controls, {this} deals 3 damage to that player.").addHint(DomainHint.instance)); ), condition, "At the beginning of each player's upkeep, if there are four or more basic land types " +
"among lands that player controls, {this} deals 3 damage to that player.").addHint(DomainHint.instance));
} }
private MaskOfIntolerance(final MaskOfIntolerance card) { private MaskOfIntolerance(final MaskOfIntolerance card) {
@ -51,6 +52,6 @@ class MaskOfIntoleranceCondition extends IntCompareCondition {
@Override @Override
protected int getInputValue(Game game, Ability source) { protected int getInputValue(Game game, Ability source) {
return new DomainValue(1, game.getActivePlayerId()).calculate(game, source, null); return DomainValue.ACTIVE.calculate(game, source, null);
} }
} }

View file

@ -30,7 +30,7 @@ public final class MatcaRioters extends CardImpl {
this.toughness = new MageInt(0); this.toughness = new MageInt(0);
// Domain - Matca Rioters's power and toughness are each equal to the number of basic land types among lands you control. // Domain - Matca Rioters's power and toughness are each equal to the number of basic land types among lands you control.
Effect effect = new SetPowerToughnessSourceEffect(new DomainValue(), Duration.EndOfGame); Effect effect = new SetPowerToughnessSourceEffect(DomainValue.REGULAR, Duration.EndOfGame);
effect.setText("<i>Domain</i> &mdash; {this}'s power and toughness are each equal to the number of basic land types among lands you control."); effect.setText("<i>Domain</i> &mdash; {this}'s power and toughness are each equal to the number of basic land types among lands you control.");
this.addAbility(new SimpleStaticAbility(Zone.ALL, effect).addHint(DomainHint.instance)); this.addAbility(new SimpleStaticAbility(Zone.ALL, effect).addHint(DomainHint.instance));
} }

View file

@ -23,7 +23,7 @@ public final class MightOfAlara extends CardImpl {
// Domain - Target creature gets +1/+1 until end of turn for each basic land type among lands you control. // Domain - Target creature gets +1/+1 until end of turn for each basic land type among lands you control.
this.getSpellAbility().addEffect(new BoostTargetEffect( this.getSpellAbility().addEffect(new BoostTargetEffect(
new DomainValue(), new DomainValue(), Duration.EndOfTurn, true DomainValue.REGULAR, DomainValue.REGULAR, Duration.EndOfTurn, true
)); ));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addHint(DomainHint.instance); this.getSpellAbility().addHint(DomainHint.instance);

View file

@ -22,7 +22,7 @@ public final class OrderedMigration extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{W}{U}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{W}{U}");
// Domain - Create a 1/1 blue Bird creature token with flying for each basic land type among lands you control. // Domain - Create a 1/1 blue Bird creature token with flying for each basic land type among lands you control.
this.getSpellAbility().addEffect(new CreateTokenEffect(new OrderedMigrationBirdToken(), new DomainValue())); this.getSpellAbility().addEffect(new CreateTokenEffect(new OrderedMigrationBirdToken(), DomainValue.REGULAR));
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN); this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);
this.getSpellAbility().addHint(DomainHint.instance); this.getSpellAbility().addHint(DomainHint.instance);
} }

View file

@ -4,7 +4,6 @@ import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.DomainValue;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.abilities.effects.keyword.ScryEffect; import mage.abilities.effects.keyword.ScryEffect;
@ -13,7 +12,6 @@ import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.TimingRule;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCardInLibrary;
@ -56,10 +54,9 @@ public final class PathToTheFestival extends CardImpl {
enum PathToTheFestivalCondition implements Condition { enum PathToTheFestivalCondition implements Condition {
instance; instance;
private static final DynamicValue xValue = new DomainValue();
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
return xValue.calculate(game, source, null) >= 3; return DomainValue.REGULAR.calculate(game, source, null) >= 3;
} }
} }

View file

@ -24,7 +24,7 @@ public final class PlanarDespair extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{B}{B}"); super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{B}{B}");
// Domain - All creatures get -1/-1 until end of turn for each basic land type among lands you control. // Domain - All creatures get -1/-1 until end of turn for each basic land type among lands you control.
DynamicValue dv = new SignInversionDynamicValue(new DomainValue()); DynamicValue dv = new SignInversionDynamicValue(DomainValue.REGULAR);
Effect effect = new BoostAllEffect(dv, dv, Duration.EndOfTurn); Effect effect = new BoostAllEffect(dv, dv, Duration.EndOfTurn);
effect.setText("<i>Domain</i> &mdash; All creatures get -1/-1 until end of turn for each basic land type among lands you control."); effect.setText("<i>Domain</i> &mdash; All creatures get -1/-1 until end of turn for each basic land type among lands you control.");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);

View file

@ -28,7 +28,7 @@ public final class PowerArmor extends CardImpl {
// Domain - {3}, {tap}: Target creature gets +1/+1 until end of turn for each basic land type among lands you control. // Domain - {3}, {tap}: Target creature gets +1/+1 until end of turn for each basic land type among lands you control.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect( Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(
new DomainValue(), new DomainValue(), Duration.EndOfTurn), new TapSourceCost()); DomainValue.REGULAR, DomainValue.REGULAR, Duration.EndOfTurn), new TapSourceCost());
ability.addCost(new ManaCostsImpl("{3}")); ability.addCost(new ManaCostsImpl("{3}"));
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
ability.setAbilityWord(AbilityWord.DOMAIN); ability.setAbilityWord(AbilityWord.DOMAIN);

View file

@ -28,7 +28,7 @@ public final class PrismaticGeoscope extends CardImpl {
// <i>Domain</i> &mdash; {T}: Add X mana in any combination of colors, where X is the number of basic land types among lands you control. // <i>Domain</i> &mdash; {T}: Add X mana in any combination of colors, where X is the number of basic land types among lands you control.
Ability ability = new DynamicManaAbility( Ability ability = new DynamicManaAbility(
new Mana(0, 0, 0, 0, 0, 0, 1, 0), new DomainValue(), new TapSourceCost(), new Mana(0, 0, 0, 0, 0, 0, 1, 0), DomainValue.REGULAR, new TapSourceCost(),
"Add X mana in any combination of colors," "Add X mana in any combination of colors,"
+ " where X is the number of basic land types among lands you control." + " where X is the number of basic land types among lands you control."
); );

View file

@ -65,7 +65,7 @@ class SamitePilgrimPreventDamageToTargetEffect extends PreventionEffectImpl {
@Override @Override
public void init(Ability source, Game game) { public void init(Ability source, Game game) {
super.init(source, game); super.init(source, game);
amountToPrevent = new DomainValue().calculate(game, source, this); amountToPrevent = DomainValue.REGULAR.calculate(game, source, this);
} }
@Override @Override

View file

@ -4,7 +4,6 @@ import mage.MageInt;
import mage.ObjectColor; import mage.ObjectColor;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.DomainValue;
import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.cost.SpellCostReductionForEachSourceEffect; import mage.abilities.effects.common.cost.SpellCostReductionForEachSourceEffect;
@ -24,8 +23,6 @@ import java.util.UUID;
*/ */
public final class ScionOfDraco extends CardImpl { public final class ScionOfDraco extends CardImpl {
private static final DynamicValue xValue = new DomainValue();
public ScionOfDraco(UUID ownerId, CardSetInfo setInfo) { public ScionOfDraco(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{12}"); super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{12}");
@ -35,7 +32,7 @@ public final class ScionOfDraco extends CardImpl {
// Domain This spell costs {2} less to cast for each basic land type among lands you control. // Domain This spell costs {2} less to cast for each basic land type among lands you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL, this.addAbility(new SimpleStaticAbility(Zone.ALL,
new SpellCostReductionForEachSourceEffect(2, xValue) new SpellCostReductionForEachSourceEffect(2, DomainValue.REGULAR)
.setText("this spell costs {2} less to cast for each basic land type among lands you control") .setText("this spell costs {2} less to cast for each basic land type among lands you control")
).addHint(DomainHint.instance).setAbilityWord(AbilityWord.DOMAIN)); ).addHint(DomainHint.instance).setAbilityWord(AbilityWord.DOMAIN));

View file

@ -22,7 +22,7 @@ public final class SporeBurst extends CardImpl {
// Domain - Create a 1/1 green Saproling creature token for each basic land type among lands you control. // Domain - Create a 1/1 green Saproling creature token for each basic land type among lands you control.
this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), new DomainValue())); this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), DomainValue.REGULAR));
this.getSpellAbility().addHint(DomainHint.instance); this.getSpellAbility().addHint(DomainHint.instance);
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN); this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);
} }

View file

@ -61,7 +61,7 @@ class StratadonCostReductionEffect extends CostModificationEffectImpl {
@Override @Override
public boolean apply(Game game, Ability source, Ability abilityToModify) { public boolean apply(Game game, Ability source, Ability abilityToModify) {
CardUtil.reduceCost(abilityToModify, new DomainValue().calculate(game, source, this)); CardUtil.reduceCost(abilityToModify, DomainValue.REGULAR.calculate(game, source, this));
return true; return true;
} }

View file

@ -1,7 +1,5 @@
package mage.cards.s; package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.DomainValue;
@ -13,21 +11,21 @@ import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone; import mage.constants.Zone;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** import java.util.UUID;
*
* @author LoneFox
/**
* @author LoneFox
*/ */
public final class StrengthOfUnity extends CardImpl { public final class StrengthOfUnity extends CardImpl {
public StrengthOfUnity(UUID ownerId, CardSetInfo setInfo) { public StrengthOfUnity(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{W}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}");
this.subtype.add(SubType.AURA); this.subtype.add(SubType.AURA);
// Enchant creature // Enchant creature
@ -37,8 +35,7 @@ public final class StrengthOfUnity extends CardImpl {
Ability ability = new EnchantAbility(auraTarget.getTargetName()); Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability); this.addAbility(ability);
// Domain - Enchanted creature gets +1/+1 for each basic land type among lands you control. // Domain - Enchanted creature gets +1/+1 for each basic land type among lands you control.
DomainValue dv = new DomainValue(); Effect effect = new BoostEnchantedEffect(DomainValue.REGULAR, DomainValue.REGULAR);
Effect effect = new BoostEnchantedEffect(dv, dv);
effect.setText("<i>Domain</i> &mdash; Enchanted creature gets +1/+1 for each basic land type among lands you control."); effect.setText("<i>Domain</i> &mdash; Enchanted creature gets +1/+1 for each basic land type among lands you control.");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect).addHint(DomainHint.instance)); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect).addHint(DomainHint.instance));
} }

View file

@ -6,7 +6,6 @@ import mage.abilities.Mode;
import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.DiscardCardCost; import mage.abilities.costs.common.DiscardCardCost;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.DomainValue;
import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect;
@ -25,8 +24,6 @@ import java.util.UUID;
*/ */
public final class TerritorialKavu extends CardImpl { public final class TerritorialKavu extends CardImpl {
private static final DynamicValue xValue = new DomainValue();
public TerritorialKavu(UUID ownerId, CardSetInfo setInfo) { public TerritorialKavu(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{G}");
@ -36,7 +33,7 @@ public final class TerritorialKavu extends CardImpl {
// Domain Territorial Kavu's power and toughness are each equal to the number of basic land types among lands you control. // Domain Territorial Kavu's power and toughness are each equal to the number of basic land types among lands you control.
this.addAbility(new SimpleStaticAbility( this.addAbility(new SimpleStaticAbility(
Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame) Zone.ALL, new SetPowerToughnessSourceEffect(DomainValue.REGULAR, Duration.EndOfGame)
).addHint(DomainHint.instance).setAbilityWord(AbilityWord.DOMAIN)); ).addHint(DomainHint.instance).setAbilityWord(AbilityWord.DOMAIN));
// Whenever Territorial Kavu attacks, choose one // Whenever Territorial Kavu attacks, choose one

View file

@ -22,7 +22,7 @@ public final class TribalFlames extends CardImpl {
// Domain - Tribal Flames deals X damage to any target, where X is the number of basic land types among lands you control. // Domain - Tribal Flames deals X damage to any target, where X is the number of basic land types among lands you control.
this.getSpellAbility().addEffect(new DamageTargetEffect(new DomainValue())); this.getSpellAbility().addEffect(new DamageTargetEffect(DomainValue.REGULAR));
this.getSpellAbility().addTarget(new TargetAnyTarget()); this.getSpellAbility().addTarget(new TargetAnyTarget());
this.getSpellAbility().addHint(DomainHint.instance); this.getSpellAbility().addHint(DomainHint.instance);
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN); this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);

View file

@ -1,22 +1,20 @@
package mage.cards.t; package mage.cards.t;
import java.util.UUID;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.DomainValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.hint.common.DomainHint; import mage.abilities.hint.common.DomainHint;
import mage.abilities.keyword.TrampleAbility; import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.AbilityWord;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import java.util.UUID;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public final class TrompTheDomains extends CardImpl { public final class TrompTheDomains extends CardImpl {
@ -25,15 +23,15 @@ public final class TrompTheDomains extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{G}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{G}");
// Domain - Until end of turn, creatures you control gain trample and get +1/+1 for each basic land type among lands you control. // Domain - Until end of turn, creatures you control gain trample and get +1/+1 for each basic land type among lands you control.
Effect effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); this.getSpellAbility().addEffect(new GainAbilityControlledEffect(
effect.setText("<i>Domain</i> &mdash; Until end of turn, creatures you control gain trample"); TrampleAbility.getInstance(), Duration.EndOfTurn
this.getSpellAbility().addEffect(effect); ).setText("until end of turn, creatures you control gain trample"));
DynamicValue domain = new DomainValue(); this.getSpellAbility().addEffect(new BoostControlledEffect(
effect = new BoostControlledEffect(domain, domain, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false); DomainValue.REGULAR, DomainValue.REGULAR, Duration.EndOfTurn,
effect.setText("and get +1/+1 for each basic land type among lands you control"); StaticFilters.FILTER_PERMANENT_CREATURE, false
this.getSpellAbility().addEffect(effect); ).setText("and get +1/+1 for each basic land type among lands you control"));
this.getSpellAbility().addHint(DomainHint.instance); this.getSpellAbility().addHint(DomainHint.instance);
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);
} }
private TrompTheDomains(final TrompTheDomains card) { private TrompTheDomains(final TrompTheDomains card) {

View file

@ -1,6 +1,5 @@
package mage.cards.v; package mage.cards.v;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.DomainValue;
import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.abilities.hint.common.DomainHint; import mage.abilities.hint.common.DomainHint;
@ -17,13 +16,11 @@ import java.util.UUID;
*/ */
public final class VoicesFromTheVoid extends CardImpl { public final class VoicesFromTheVoid extends CardImpl {
private static final DynamicValue xValue = new DomainValue();
public VoicesFromTheVoid(UUID ownerId, CardSetInfo setInfo) { public VoicesFromTheVoid(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{B}"); super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{B}");
// Domain - Target player discards a card for each basic land type among lands you control. // Domain - Target player discards a card for each basic land type among lands you control.
this.getSpellAbility().addEffect(new DiscardTargetEffect(xValue)); this.getSpellAbility().addEffect(new DiscardTargetEffect(DomainValue.REGULAR));
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addHint(DomainHint.instance); this.getSpellAbility().addHint(DomainHint.instance);
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN); this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);

View file

@ -3,7 +3,6 @@ package mage.cards.w;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.DomainValue;
import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect;
@ -22,8 +21,6 @@ import java.util.UUID;
*/ */
public final class WanderingGoblins extends CardImpl { public final class WanderingGoblins extends CardImpl {
private static final DynamicValue xValue = new DomainValue();
public WanderingGoblins(UUID ownerId, CardSetInfo setInfo) { public WanderingGoblins(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
this.subtype.add(SubType.GOBLIN); this.subtype.add(SubType.GOBLIN);
@ -34,7 +31,7 @@ public final class WanderingGoblins extends CardImpl {
// Domain - {3}: Wandering Goblins gets +1/+0 until end of turn for each basic land type among lands you control. // Domain - {3}: Wandering Goblins gets +1/+0 until end of turn for each basic land type among lands you control.
this.addAbility(new SimpleActivatedAbility(new BoostSourceEffect( this.addAbility(new SimpleActivatedAbility(new BoostSourceEffect(
xValue, StaticValue.get(0), Duration.EndOfTurn, true DomainValue.REGULAR, StaticValue.get(0), Duration.EndOfTurn, true
), new GenericManaCost(3)).addHint(DomainHint.instance).setAbilityWord(AbilityWord.DOMAIN)); ), new GenericManaCost(3)).addHint(DomainHint.instance).setAbilityWord(AbilityWord.DOMAIN));
} }

View file

@ -21,7 +21,7 @@ public final class WanderingStream extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{G}"); super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{G}");
// Domain - You gain 2 life for each basic land type among lands you control. // Domain - You gain 2 life for each basic land type among lands you control.
Effect effect = new GainLifeEffect(new MultipliedValue(new DomainValue(), 2)); Effect effect = new GainLifeEffect(new MultipliedValue(DomainValue.REGULAR, 2));
effect.setText("<i>Domain</i> &mdash; You gain 2 life for each basic land type among lands you control"); effect.setText("<i>Domain</i> &mdash; You gain 2 life for each basic land type among lands you control");
this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addHint(DomainHint.instance); this.getSpellAbility().addHint(DomainHint.instance);

View file

@ -1,38 +1,35 @@
package mage.cards.w; package mage.cards.w;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.DomainValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.hint.common.DomainHint; import mage.abilities.hint.common.DomainHint;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.AbilityWord;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.SubType;
import java.util.UUID;
/** /**
*
* @author LoneFox * @author LoneFox
*/ */
public final class WayfaringGiant extends CardImpl { public final class WayfaringGiant extends CardImpl {
public WayfaringGiant(UUID ownerId, CardSetInfo setInfo) { public WayfaringGiant(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{W}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{W}");
this.subtype.add(SubType.GIANT); this.subtype.add(SubType.GIANT);
this.power = new MageInt(1); this.power = new MageInt(1);
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Domain - Wayfaring Giant gets +1/+1 for each basic land type among lands you control. // Domain - Wayfaring Giant gets +1/+1 for each basic land type among lands you control.
DomainValue dv = new DomainValue(); this.addAbility(new SimpleStaticAbility(new BoostSourceEffect(
Effect effect = new BoostSourceEffect(dv, dv, Duration.WhileOnBattlefield); DomainValue.REGULAR, DomainValue.REGULAR, Duration.WhileOnBattlefield
effect.setText("<i>Domain</i> &mdash; {this} gets +1/+1 for each basic land type among lands you control."); ).setText("{this} gets +1/+1 for each basic land type among lands you control."))
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect).addHint(DomainHint.instance)); .addHint(DomainHint.instance).setAbilityWord(AbilityWord.DOMAIN));
} }
private WayfaringGiant(final WayfaringGiant card) { private WayfaringGiant(final WayfaringGiant card) {

View file

@ -66,7 +66,7 @@ class WorldlyCounselEffect extends OneShotEffect {
return false; return false;
} }
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, (new DomainValue()).calculate(game, source, this))); Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, (DomainValue.REGULAR).calculate(game, source, this)));
controller.lookAtCards(source, null, cards, game); controller.lookAtCards(source, null, cards, game);
if (!cards.isEmpty()) { if (!cards.isEmpty()) {

View file

@ -14,49 +14,26 @@ import java.util.stream.Collectors;
/** /**
* @author Loki * @author Loki
*/ */
public class DomainValue implements DynamicValue { public enum DomainValue implements DynamicValue {
REGULAR,
private final int amount; TARGET,
private final boolean countTargetPlayer; ACTIVE;
private UUID playerId;
public DomainValue() {
this(1);
}
public DomainValue(boolean countTargetPlayer) {
this(1, countTargetPlayer);
}
public DomainValue(int amount) {
this(amount, false);
}
public DomainValue(int amount, boolean countTargetPlayer) {
this.amount = amount;
this.countTargetPlayer = countTargetPlayer;
}
public DomainValue(int amount, UUID playerId) {
this(amount, false);
this.playerId = playerId;
}
public DomainValue(final DomainValue dynamicValue) {
this.amount = dynamicValue.amount;
this.countTargetPlayer = dynamicValue.countTargetPlayer;
this.playerId = dynamicValue.playerId;
}
@Override @Override
public int calculate(Game game, Ability sourceAbility, Effect effect) { public int calculate(Game game, Ability sourceAbility, Effect effect) {
UUID targetPlayer; UUID targetPlayer;
if (playerId != null) { switch (this) {
targetPlayer = playerId; case ACTIVE:
} else if (countTargetPlayer) { targetPlayer = game.getActivePlayerId();
targetPlayer = effect.getTargetPointer().getFirst(game, sourceAbility); break;
} else { case TARGET:
targetPlayer = sourceAbility.getControllerId(); targetPlayer = effect.getTargetPointer().getFirst(game, sourceAbility);
break;
case REGULAR:
targetPlayer = sourceAbility.getControllerId();
break;
default:
targetPlayer = null;
} }
return game.getBattlefield() return game.getBattlefield()
.getActivePermanents( .getActivePermanents(
@ -70,26 +47,26 @@ public class DomainValue implements DynamicValue {
.collect(Collectors.toSet())) .collect(Collectors.toSet()))
.flatMap(Collection::stream) .flatMap(Collection::stream)
.distinct() .distinct()
.mapToInt(x -> amount) .mapToInt(x -> 1)
.sum(); .sum();
} }
@Override @Override
public DomainValue copy() { public DomainValue copy() {
return new DomainValue(this); return this;
} }
@Override @Override
public String toString() { public String toString() {
return String.valueOf(amount); return "1";
} }
public int getAmount() { public int getAmount() {
return amount; return 1;
} }
@Override @Override
public String getMessage() { public String getMessage() {
return "basic land type among lands " + (countTargetPlayer ? "they control" : "you control"); return "basic land type among lands " + (this == TARGET ? "they control" : "you control");
} }
} }