mirror of
https://github.com/correl/mage.git
synced 2025-04-02 17:00:11 -09:00
updated implementation of Domain value
This commit is contained in:
parent
c8cdc0a502
commit
3833d7bab3
36 changed files with 103 additions and 157 deletions
Mage.Sets/src/mage/cards
a
c
d
e
g
h
k
m
o
p
s
t
v
w
Mage/src/main/java/mage/abilities/dynamicvalue/common
|
@ -21,7 +21,7 @@ public final class AlliedStrategies extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{U}");
|
||||
|
||||
// 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().setAbilityWord(AbilityWord.DOMAIN);
|
||||
this.getSpellAbility().addHint(DomainHint.instance);
|
||||
|
|
|
@ -2,7 +2,6 @@ package mage.cards.a;
|
|||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.DomainValue;
|
||||
import mage.abilities.effects.common.continuous.SetToughnessSourceEffect;
|
||||
import mage.abilities.hint.common.DomainHint;
|
||||
|
@ -18,8 +17,6 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class AvenTrailblazer extends CardImpl {
|
||||
|
||||
private static final DynamicValue xValue = new DomainValue();
|
||||
|
||||
public AvenTrailblazer(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
|
||||
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.
|
||||
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")
|
||||
).addHint(DomainHint.instance).setAbilityWord(AbilityWord.DOMAIN));
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.DomainValue;
|
||||
|
@ -15,10 +13,10 @@ import mage.constants.AbilityWord;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.TargetController;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LoneFox
|
||||
*
|
||||
*/
|
||||
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}");
|
||||
|
||||
// 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");
|
||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(effect, TargetController.ANY, false);
|
||||
effect = new DamageTargetEffect(3);
|
||||
|
|
|
@ -56,7 +56,7 @@ class CollectiveRestraintPayManaToAttackAllEffect extends CantAttackYouUnlessPay
|
|||
|
||||
@Override
|
||||
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) {
|
||||
return new ManaCostsImpl<>("{" + domainValue + '}');
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ class DracoCostReductionEffect extends CostModificationEffectImpl {
|
|||
|
||||
@Override
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ class DracoSacrificeUnlessPaysEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (player != null && permanent != null) {
|
||||
// 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);
|
||||
if (player.chooseUse(Outcome.Benefit, "Pay {" + count + "}? Or " + permanent.getName() + " will be sacrificed.", source, game)) {
|
||||
Cost cost = ManaUtil.createManaCost(count, false);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.MultipliedValue;
|
||||
import mage.abilities.dynamicvalue.common.DomainValue;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.abilities.hint.common.DomainHint;
|
||||
|
@ -18,13 +19,14 @@ import java.util.UUID;
|
|||
*/
|
||||
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) {
|
||||
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.
|
||||
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().addHint(DomainHint.instance);
|
||||
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);
|
||||
|
|
|
@ -21,7 +21,7 @@ public final class EvasiveAction extends CardImpl {
|
|||
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.
|
||||
this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new DomainValue()));
|
||||
this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(DomainValue.REGULAR));
|
||||
this.getSpellAbility().addTarget(new TargetSpell());
|
||||
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);
|
||||
this.getSpellAbility().addHint(DomainHint.instance);
|
||||
|
|
|
@ -33,7 +33,7 @@ public final class ExoticCurse extends CardImpl {
|
|||
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
|
||||
|
||||
// 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.setAbilityWord(AbilityWord.DOMAIN);
|
||||
this.addAbility(ability.addHint(DomainHint.instance));
|
||||
|
|
|
@ -1,36 +1,33 @@
|
|||
|
||||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.dynamicvalue.common.DomainValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.abilities.effects.common.LoseLifeTargetEffect;
|
||||
import mage.abilities.hint.common.DomainHint;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AbilityWord;
|
||||
import mage.constants.CardType;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LoneFox
|
||||
*/
|
||||
public final class ExoticDisease extends CardImpl {
|
||||
|
||||
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.
|
||||
DomainValue dv = new DomainValue();
|
||||
Effect effect = new LoseLifeTargetEffect(dv);
|
||||
effect.setText("<i>Domain</i> — Target player loses X life");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
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().addEffect(new LoseLifeTargetEffect(DomainValue.REGULAR)
|
||||
.setText("target player loses X life"));
|
||||
this.getSpellAbility().addEffect(new GainLifeEffect(DomainValue.REGULAR)
|
||||
.setText("and you gain X life, where X is the number of basic land types among lands you control"));
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
this.getSpellAbility().addHint(DomainHint.instance);
|
||||
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);
|
||||
}
|
||||
|
||||
private ExoticDisease(final ExoticDisease card) {
|
||||
|
|
|
@ -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.
|
||||
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().addHint(DomainHint.instance);
|
||||
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);
|
||||
|
|
|
@ -22,7 +22,7 @@ public final class GaeasMight extends CardImpl {
|
|||
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.
|
||||
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().setAbilityWord(AbilityWord.DOMAIN);
|
||||
this.getSpellAbility().addHint(DomainHint.instance);
|
||||
|
|
|
@ -5,7 +5,6 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.DomainValue;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
|
||||
|
@ -95,8 +94,6 @@ enum HiveheartShamanPredicate implements ObjectSourcePlayerPredicate<Card> {
|
|||
|
||||
class HiveheartShamanEffect extends OneShotEffect {
|
||||
|
||||
private static final DynamicValue xValue = new DomainValue();
|
||||
|
||||
HiveheartShamanEffect() {
|
||||
super(Outcome.Benefit);
|
||||
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) {
|
||||
Token token = new InsectToken();
|
||||
token.putOntoBattlefield(1, game, source);
|
||||
int domainCount = xValue.calculate(game, source, this);
|
||||
int domainCount = DomainValue.REGULAR.calculate(game, source, this);
|
||||
if (domainCount < 1) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public final class KavuScout extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// 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);
|
||||
this.addAbility(ability.addHint(DomainHint.instance));
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
new BoostEquippedEffect(new DomainValue(), new DomainValue())
|
||||
new BoostEquippedEffect(DomainValue.REGULAR, DomainValue.REGULAR)
|
||||
).addHint(DomainHint.instance).setAbilityWord(AbilityWord.DOMAIN));
|
||||
|
||||
// Equip {3}
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.IntCompareCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.DomainValue;
|
||||
|
@ -15,22 +13,25 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LoneFox
|
||||
*/
|
||||
public final class MaskOfIntolerance extends CardImpl {
|
||||
|
||||
private static final Condition condition = new MaskOfIntoleranceCondition();
|
||||
|
||||
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.
|
||||
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new DamageTargetEffect(3), TargetController.ANY, false);
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new MaskOfIntoleranceCondition(),
|
||||
"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));
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(new BeginningOfUpkeepTriggeredAbility(
|
||||
new DamageTargetEffect(3), TargetController.ANY, false
|
||||
), 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) {
|
||||
|
@ -51,6 +52,6 @@ class MaskOfIntoleranceCondition extends IntCompareCondition {
|
|||
|
||||
@Override
|
||||
protected int getInputValue(Game game, Ability source) {
|
||||
return new DomainValue(1, game.getActivePlayerId()).calculate(game, source, null);
|
||||
return DomainValue.ACTIVE.calculate(game, source, null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ public final class MatcaRioters extends CardImpl {
|
|||
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.
|
||||
Effect effect = new SetPowerToughnessSourceEffect(new DomainValue(), Duration.EndOfGame);
|
||||
Effect effect = new SetPowerToughnessSourceEffect(DomainValue.REGULAR, Duration.EndOfGame);
|
||||
effect.setText("<i>Domain</i> — {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));
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
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().addHint(DomainHint.instance);
|
||||
|
|
|
@ -22,7 +22,7 @@ public final class OrderedMigration extends CardImpl {
|
|||
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.
|
||||
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().addHint(DomainHint.instance);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.DomainValue;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
|
||||
import mage.abilities.effects.keyword.ScryEffect;
|
||||
|
@ -13,7 +12,6 @@ import mage.abilities.keyword.FlashbackAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.TimingRule;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
@ -56,10 +54,9 @@ public final class PathToTheFestival extends CardImpl {
|
|||
|
||||
enum PathToTheFestivalCondition implements Condition {
|
||||
instance;
|
||||
private static final DynamicValue xValue = new DomainValue();
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return xValue.calculate(game, source, null) >= 3;
|
||||
return DomainValue.REGULAR.calculate(game, source, null) >= 3;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public final class PlanarDespair extends CardImpl {
|
|||
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.
|
||||
DynamicValue dv = new SignInversionDynamicValue(new DomainValue());
|
||||
DynamicValue dv = new SignInversionDynamicValue(DomainValue.REGULAR);
|
||||
Effect effect = new BoostAllEffect(dv, dv, Duration.EndOfTurn);
|
||||
effect.setText("<i>Domain</i> — All creatures get -1/-1 until end of turn for each basic land type among lands you control.");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
|
|
|
@ -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.
|
||||
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.addTarget(new TargetCreaturePermanent());
|
||||
ability.setAbilityWord(AbilityWord.DOMAIN);
|
||||
|
|
|
@ -28,7 +28,7 @@ public final class PrismaticGeoscope extends CardImpl {
|
|||
|
||||
// <i>Domain</i> — {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(
|
||||
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,"
|
||||
+ " where X is the number of basic land types among lands you control."
|
||||
);
|
||||
|
|
|
@ -65,7 +65,7 @@ class SamitePilgrimPreventDamageToTargetEffect extends PreventionEffectImpl {
|
|||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
amountToPrevent = new DomainValue().calculate(game, source, this);
|
||||
amountToPrevent = DomainValue.REGULAR.calculate(game, source, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,7 +4,6 @@ import mage.MageInt;
|
|||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.DomainValue;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.common.cost.SpellCostReductionForEachSourceEffect;
|
||||
|
@ -24,8 +23,6 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class ScionOfDraco extends CardImpl {
|
||||
|
||||
private static final DynamicValue xValue = new DomainValue();
|
||||
|
||||
public ScionOfDraco(UUID ownerId, CardSetInfo setInfo) {
|
||||
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.
|
||||
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")
|
||||
).addHint(DomainHint.instance).setAbilityWord(AbilityWord.DOMAIN));
|
||||
|
||||
|
|
|
@ -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.
|
||||
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().setAbilityWord(AbilityWord.DOMAIN);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ class StratadonCostReductionEffect extends CostModificationEffectImpl {
|
|||
|
||||
@Override
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.common.DomainValue;
|
||||
|
@ -13,21 +11,21 @@ import mage.abilities.keyword.EnchantAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LoneFox
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author LoneFox
|
||||
*/
|
||||
public final class StrengthOfUnity extends CardImpl {
|
||||
|
||||
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);
|
||||
|
||||
// Enchant creature
|
||||
|
@ -37,8 +35,7 @@ public final class StrengthOfUnity extends CardImpl {
|
|||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
// Domain - Enchanted creature gets +1/+1 for each basic land type among lands you control.
|
||||
DomainValue dv = new DomainValue();
|
||||
Effect effect = new BoostEnchantedEffect(dv, dv);
|
||||
Effect effect = new BoostEnchantedEffect(DomainValue.REGULAR, DomainValue.REGULAR);
|
||||
effect.setText("<i>Domain</i> — Enchanted creature gets +1/+1 for each basic land type among lands you control.");
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect).addHint(DomainHint.instance));
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ import mage.abilities.Mode;
|
|||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.common.DiscardCardCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.DomainValue;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
|
@ -25,8 +24,6 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class TerritorialKavu extends CardImpl {
|
||||
|
||||
private static final DynamicValue xValue = new DomainValue();
|
||||
|
||||
public TerritorialKavu(UUID ownerId, CardSetInfo setInfo) {
|
||||
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.
|
||||
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));
|
||||
|
||||
// Whenever Territorial Kavu attacks, choose one —
|
||||
|
|
|
@ -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.
|
||||
this.getSpellAbility().addEffect(new DamageTargetEffect(new DomainValue()));
|
||||
this.getSpellAbility().addEffect(new DamageTargetEffect(DomainValue.REGULAR));
|
||||
this.getSpellAbility().addTarget(new TargetAnyTarget());
|
||||
this.getSpellAbility().addHint(DomainHint.instance);
|
||||
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);
|
||||
|
|
|
@ -1,22 +1,20 @@
|
|||
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.DomainValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
||||
import mage.abilities.hint.common.DomainHint;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AbilityWord;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
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}");
|
||||
|
||||
// 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);
|
||||
effect.setText("<i>Domain</i> — Until end of turn, creatures you control gain trample");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
DynamicValue domain = new DomainValue();
|
||||
effect = new BoostControlledEffect(domain, domain, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false);
|
||||
effect.setText("and get +1/+1 for each basic land type among lands you control");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
this.getSpellAbility().addEffect(new GainAbilityControlledEffect(
|
||||
TrampleAbility.getInstance(), Duration.EndOfTurn
|
||||
).setText("until end of turn, creatures you control gain trample"));
|
||||
this.getSpellAbility().addEffect(new BoostControlledEffect(
|
||||
DomainValue.REGULAR, DomainValue.REGULAR, Duration.EndOfTurn,
|
||||
StaticFilters.FILTER_PERMANENT_CREATURE, false
|
||||
).setText("and get +1/+1 for each basic land type among lands you control"));
|
||||
this.getSpellAbility().addHint(DomainHint.instance);
|
||||
|
||||
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);
|
||||
}
|
||||
|
||||
private TrompTheDomains(final TrompTheDomains card) {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package mage.cards.v;
|
||||
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.DomainValue;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.abilities.hint.common.DomainHint;
|
||||
|
@ -17,13 +16,11 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class VoicesFromTheVoid extends CardImpl {
|
||||
|
||||
private static final DynamicValue xValue = new DomainValue();
|
||||
|
||||
public VoicesFromTheVoid(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{B}");
|
||||
|
||||
// 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().addHint(DomainHint.instance);
|
||||
this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN);
|
||||
|
|
|
@ -3,7 +3,6 @@ package mage.cards.w;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.DomainValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
|
@ -22,8 +21,6 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class WanderingGoblins extends CardImpl {
|
||||
|
||||
private static final DynamicValue xValue = new DomainValue();
|
||||
|
||||
public WanderingGoblins(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
|
||||
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.
|
||||
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));
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ public final class WanderingStream extends CardImpl {
|
|||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{G}");
|
||||
|
||||
// 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> — You gain 2 life for each basic land type among lands you control");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
this.getSpellAbility().addHint(DomainHint.instance);
|
||||
|
|
|
@ -1,38 +1,35 @@
|
|||
|
||||
package mage.cards.w;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.common.DomainValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.hint.common.DomainHint;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AbilityWord;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.SubType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LoneFox
|
||||
|
||||
*/
|
||||
public final class WayfaringGiant extends CardImpl {
|
||||
|
||||
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.power = new MageInt(1);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Domain - Wayfaring Giant gets +1/+1 for each basic land type among lands you control.
|
||||
DomainValue dv = new DomainValue();
|
||||
Effect effect = new BoostSourceEffect(dv, dv, Duration.WhileOnBattlefield);
|
||||
effect.setText("<i>Domain</i> — {this} 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(new BoostSourceEffect(
|
||||
DomainValue.REGULAR, DomainValue.REGULAR, Duration.WhileOnBattlefield
|
||||
).setText("{this} gets +1/+1 for each basic land type among lands you control."))
|
||||
.addHint(DomainHint.instance).setAbilityWord(AbilityWord.DOMAIN));
|
||||
}
|
||||
|
||||
private WayfaringGiant(final WayfaringGiant card) {
|
||||
|
|
|
@ -66,7 +66,7 @@ class WorldlyCounselEffect extends OneShotEffect {
|
|||
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);
|
||||
|
||||
if (!cards.isEmpty()) {
|
||||
|
|
|
@ -14,49 +14,26 @@ import java.util.stream.Collectors;
|
|||
/**
|
||||
* @author Loki
|
||||
*/
|
||||
public class DomainValue implements DynamicValue {
|
||||
|
||||
private final int amount;
|
||||
private final boolean countTargetPlayer;
|
||||
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;
|
||||
}
|
||||
public enum DomainValue implements DynamicValue {
|
||||
REGULAR,
|
||||
TARGET,
|
||||
ACTIVE;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
UUID targetPlayer;
|
||||
if (playerId != null) {
|
||||
targetPlayer = playerId;
|
||||
} else if (countTargetPlayer) {
|
||||
targetPlayer = effect.getTargetPointer().getFirst(game, sourceAbility);
|
||||
} else {
|
||||
targetPlayer = sourceAbility.getControllerId();
|
||||
switch (this) {
|
||||
case ACTIVE:
|
||||
targetPlayer = game.getActivePlayerId();
|
||||
break;
|
||||
case TARGET:
|
||||
targetPlayer = effect.getTargetPointer().getFirst(game, sourceAbility);
|
||||
break;
|
||||
case REGULAR:
|
||||
targetPlayer = sourceAbility.getControllerId();
|
||||
break;
|
||||
default:
|
||||
targetPlayer = null;
|
||||
}
|
||||
return game.getBattlefield()
|
||||
.getActivePermanents(
|
||||
|
@ -70,26 +47,26 @@ public class DomainValue implements DynamicValue {
|
|||
.collect(Collectors.toSet()))
|
||||
.flatMap(Collection::stream)
|
||||
.distinct()
|
||||
.mapToInt(x -> amount)
|
||||
.mapToInt(x -> 1)
|
||||
.sum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DomainValue copy() {
|
||||
return new DomainValue(this);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(amount);
|
||||
return "1";
|
||||
}
|
||||
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue