diff --git a/Mage.Sets/src/mage/sets/avacynrestored/CraterhoofBehemoth.java b/Mage.Sets/src/mage/sets/avacynrestored/CraterhoofBehemoth.java index 3aff59121fc..09af21350b8 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/CraterhoofBehemoth.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/CraterhoofBehemoth.java @@ -70,8 +70,8 @@ public class CraterhoofBehemoth extends CardImpl { // When Craterhoof Behemoth enters the battlefield, creatures you control gain trample and get +X/+X until end of turn, where X is the number of creatures you control. Ability ability = new EntersBattlefieldTriggeredAbility(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, filter)); - PermanentsOnBattlefieldCount x = new PermanentsOnBattlefieldCount(filter); - ability.addEffect(new BoostControlledEffect(x, x, Duration.EndOfTurn, filter, false, true)); + PermanentsOnBattlefieldCount controlledCreatures = new PermanentsOnBattlefieldCount(filter); + ability.addEffect(new BoostControlledEffect(controlledCreatures, controlledCreatures, Duration.EndOfTurn, filter, false, true)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/conflux/WorldlyCounsel.java b/Mage.Sets/src/mage/sets/conflux/WorldlyCounsel.java index d134d3745a9..eb800300426 100644 --- a/Mage.Sets/src/mage/sets/conflux/WorldlyCounsel.java +++ b/Mage.Sets/src/mage/sets/conflux/WorldlyCounsel.java @@ -74,7 +74,7 @@ class WorldlyCounselEffect extends OneShotEffect { public WorldlyCounselEffect() { super(Outcome.DrawCard); - this.staticText = "// Domain - Look at the top X cards of your library, where X is the number of basic land types among lands you control. Put one of those cards into your hand and the rest on the bottom of your library in any order"; + this.staticText = "Domain - Look at the top X cards of your library, where X is the number of basic land types among lands you control. Put one of those cards into your hand and the rest on the bottom of your library in any order"; } public WorldlyCounselEffect(final WorldlyCounselEffect effect) { diff --git a/Mage.Sets/src/mage/sets/fifthedition/UrzasMine.java b/Mage.Sets/src/mage/sets/fifthedition/UrzasMine.java index f9c1879994d..c53287ccea4 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/UrzasMine.java +++ b/Mage.Sets/src/mage/sets/fifthedition/UrzasMine.java @@ -44,7 +44,10 @@ public class UrzasMine extends CardImpl { public UrzasMine(UUID ownerId) { super(ownerId, 447, "Urza's Mine", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "5ED"; - Ability urzaManaAbility = new DynamicManaAbility(Mana.ColorlessMana, new UrzaTerrainValue(2)); + + // {T}: Add {1} to your mana pool. If you control an Urza's Power-Plant and an Urza's Tower, add {2} to your mana pool instead. + Ability urzaManaAbility = new DynamicManaAbility(Mana.ColorlessMana, new UrzaTerrainValue(2), + "Add {1} to your mana pool. If you control an Urza's Power-Plant and an Urza's Tower, add {2} to your mana pool instead"); this.addAbility(urzaManaAbility); } @@ -56,4 +59,4 @@ public class UrzasMine extends CardImpl { public UrzasMine copy() { return new UrzasMine(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/UrzasPowerPlant.java b/Mage.Sets/src/mage/sets/fifthedition/UrzasPowerPlant.java index 55acb2b5fb5..5726feeb9e5 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/UrzasPowerPlant.java +++ b/Mage.Sets/src/mage/sets/fifthedition/UrzasPowerPlant.java @@ -44,7 +44,10 @@ public class UrzasPowerPlant extends CardImpl { public UrzasPowerPlant(UUID ownerId) { super(ownerId, 448, "Urza's Power Plant", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "5ED"; - Ability urzaManaAbility = new DynamicManaAbility(Mana.ColorlessMana, new UrzaTerrainValue(2)); + + // {T}: Add {1} to your mana pool. If you control an Urza's Mine and an Urza's Tower, add {2} to your mana pool instead. + Ability urzaManaAbility = new DynamicManaAbility(Mana.ColorlessMana, new UrzaTerrainValue(2), + "Add {1} to your mana pool. If you control an Urza's Mine and an Urza's Tower, add {2} to your mana pool instead"); this.addAbility(urzaManaAbility); } @@ -56,4 +59,4 @@ public class UrzasPowerPlant extends CardImpl { public UrzasPowerPlant copy() { return new UrzasPowerPlant(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/UrzasTower.java b/Mage.Sets/src/mage/sets/fifthedition/UrzasTower.java index e123fe093f8..1b2e134f66b 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/UrzasTower.java +++ b/Mage.Sets/src/mage/sets/fifthedition/UrzasTower.java @@ -44,7 +44,10 @@ public class UrzasTower extends CardImpl { public UrzasTower(UUID ownerId) { super(ownerId, 449, "Urza's Tower", Rarity.COMMON, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "5ED"; - Ability urzaManaAbility = new DynamicManaAbility(Mana.ColorlessMana, new UrzaTerrainValue(3)); + + // {T}: Add {1} to your mana pool. If you control an Urza's Mine and an Urza's Power-Plant, add {3} to your mana pool instead. + Ability urzaManaAbility = new DynamicManaAbility(Mana.ColorlessMana, new UrzaTerrainValue(3), + "Add {1} to your mana pool. If you control an Urza's Mine and an Urza's Power-Plant, add {3} to your mana pool instead"); this.addAbility(urzaManaAbility); } @@ -56,4 +59,4 @@ public class UrzasTower extends CardImpl { public UrzasTower copy() { return new UrzasTower(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/guildpact/WitchMawNephilim.java b/Mage.Sets/src/mage/sets/guildpact/WitchMawNephilim.java index c16dddda677..18b1b429ff5 100644 --- a/Mage.Sets/src/mage/sets/guildpact/WitchMawNephilim.java +++ b/Mage.Sets/src/mage/sets/guildpact/WitchMawNephilim.java @@ -28,9 +28,8 @@ package mage.sets.guildpact; import java.util.UUID; - -import mage.Constants; import mage.Constants.CardType; +import mage.Constants.Duration; import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.common.AttacksTriggeredAbility; @@ -64,6 +63,8 @@ public class WitchMawNephilim extends CardImpl { // Whenever you cast a spell, you may put two +1/+1 counters on Witch-Maw Nephilim. this.addAbility(new SpellCastTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), true)); + + // Whenever Witch-Maw Nephilim attacks, it gains trample until end of turn if its power is 10 or greater. this.addAbility(new WitchMawNephilimTriggeredAbility()); } @@ -79,7 +80,7 @@ public class WitchMawNephilim extends CardImpl { class WitchMawNephilimTriggeredAbility extends AttacksTriggeredAbility { WitchMawNephilimTriggeredAbility() { - super(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Constants.Duration.EndOfTurn), false); + super(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn), false); } WitchMawNephilimTriggeredAbility(final WitchMawNephilimTriggeredAbility ability) { @@ -90,8 +91,9 @@ class WitchMawNephilimTriggeredAbility extends AttacksTriggeredAbility { public boolean checkTrigger(GameEvent event, Game game) { if (super.checkTrigger(event, game)) { Permanent source = game.getPermanent(event.getSourceId()); - if (source.getPower().getValue() >= 10) + if (source.getPower().getValue() >= 10) { return true; + } } return false; } diff --git a/Mage.Sets/src/mage/sets/mirrodin/Cloudpost.java b/Mage.Sets/src/mage/sets/mirrodin/Cloudpost.java index de1e2392bc1..6a38c9187b0 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Cloudpost.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Cloudpost.java @@ -44,7 +44,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class Cloudpost extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent("Locus"); + private static final FilterLandPermanent filter = new FilterLandPermanent("Locus in play"); static { filter.add(new SubtypePredicate("Locus")); diff --git a/Mage.Sets/src/mage/sets/urzassaga/PriestOfTitania.java b/Mage.Sets/src/mage/sets/urzassaga/PriestOfTitania.java index 7bcb053b019..695e7a38416 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/PriestOfTitania.java +++ b/Mage.Sets/src/mage/sets/urzassaga/PriestOfTitania.java @@ -45,7 +45,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class PriestOfTitania extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf creatures"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf on the battlefield"); static { filter.add(new SubtypePredicate("Elf")); @@ -60,7 +60,8 @@ public class PriestOfTitania extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); - this.addAbility(new DynamicManaAbility(Mana.GreenMana, new PermanentsOnBattlefieldCount(filter))); + // {T}: Add {G} to your mana pool for each Elf on the battlefield. + this.addAbility(new DynamicManaAbility(Mana.GreenMana, new PermanentsOnBattlefieldCount(filter))); } public PriestOfTitania(final PriestOfTitania card) { diff --git a/Mage/src/mage/abilities/dynamicvalue/common/UrzaTerrainValue.java b/Mage/src/mage/abilities/dynamicvalue/common/UrzaTerrainValue.java index a1ea0b3bbad..950cd04a173 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/UrzaTerrainValue.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/UrzaTerrainValue.java @@ -7,10 +7,10 @@ import mage.filter.predicate.mageobject.NamePredicate; import mage.game.Game; public class UrzaTerrainValue implements DynamicValue { - private final int v; + private final int value; - public UrzaTerrainValue(int val) { - v = val; + public UrzaTerrainValue(int value) { + this.value = value; } @Override @@ -19,31 +19,37 @@ public class UrzaTerrainValue implements DynamicValue { pp.add(new NamePredicate("Urza's Power Plant")); PermanentsOnBattlefieldCount ppP = new PermanentsOnBattlefieldCount(pp); if (ppP.calculate(game, sourceAbility) < 1) + { return 1; + } FilterControlledPermanent to = new FilterControlledPermanent("Urza's Tower"); to.add(new NamePredicate("Urza's Tower")); PermanentsOnBattlefieldCount toP = new PermanentsOnBattlefieldCount(to); if (toP.calculate(game, sourceAbility) < 1) + { return 1; + } FilterControlledPermanent mi = new FilterControlledPermanent("Urza's Mine"); mi.add(new NamePredicate("Urza's Mine")); PermanentsOnBattlefieldCount miP = new PermanentsOnBattlefieldCount(mi); if (miP.calculate(game, sourceAbility) < 1) + { return 1; + } - return v; + return value; } @Override public DynamicValue copy() { - return new UrzaTerrainValue(v); + return new UrzaTerrainValue(value); } @Override public String toString() { - return "1 or " + v; + return "1 or " + value; } @Override diff --git a/Mage/src/mage/abilities/effects/common/DynamicManaEffect.java b/Mage/src/mage/abilities/effects/common/DynamicManaEffect.java index 6ab4f05db52..930574566b7 100644 --- a/Mage/src/mage/abilities/effects/common/DynamicManaEffect.java +++ b/Mage/src/mage/abilities/effects/common/DynamicManaEffect.java @@ -41,6 +41,7 @@ public class DynamicManaEffect extends BasicManaEffect { private Mana computedMana; private DynamicValue amount; + private String text = null; public DynamicManaEffect(Mana mana, DynamicValue amount) { super(mana); @@ -48,10 +49,18 @@ public class DynamicManaEffect extends BasicManaEffect { computedMana = new Mana(); } + public DynamicManaEffect(Mana mana, DynamicValue amount, String text) { + super(mana); + this.amount = amount; + computedMana = new Mana(); + this.text = text; + } + public DynamicManaEffect(final DynamicManaEffect effect) { super(effect); this.computedMana = effect.computedMana.copy(); this.amount = effect.amount.copy(); + this.text = effect.text; } @Override @@ -68,6 +77,9 @@ public class DynamicManaEffect extends BasicManaEffect { @Override public String getText(Mode mode) { + if (text != null && !text.isEmpty()) { + return text; + } return super.getText(mode) + " for each " + amount.getMessage(); } diff --git a/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java b/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java index f0de56fe725..b336dad3510 100644 --- a/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java @@ -116,19 +116,23 @@ public class BoostTargetEffect extends ContinuousEffectImpl { sb.append("Target ").append(target.getTargetName()).append(" gets "); } String p = power.toString(); - if(!p.startsWith("-")) + if(!p.startsWith("-")) { sb.append("+"); + } sb.append(p).append("/"); String t = toughness.toString(); if(!t.startsWith("-")){ - if(p.startsWith("-")) + if(p.startsWith("-")) { sb.append("-"); - else + } + else { sb.append("+"); + } } sb.append(t); - if (duration != Duration.WhileOnBattlefield) + if (duration != Duration.WhileOnBattlefield) { sb.append(" ").append(duration.toString()); + } String message = power.getMessage(); if (message.length() > 0) { sb.append(" for each "); diff --git a/Mage/src/mage/abilities/mana/DynamicManaAbility.java b/Mage/src/mage/abilities/mana/DynamicManaAbility.java index 482996001ab..4f1d3429974 100644 --- a/Mage/src/mage/abilities/mana/DynamicManaAbility.java +++ b/Mage/src/mage/abilities/mana/DynamicManaAbility.java @@ -42,6 +42,7 @@ import mage.game.Game; public class DynamicManaAbility extends ManaAbility { private DynamicManaEffect manaEffect; + private String rule; /** * TapSourceCost added by default @@ -50,14 +51,29 @@ public class DynamicManaAbility extends ManaAbility { this(mana, amount, new TapSourceCost()); } + /** + * + * @param mana - kind of mana + * @param amount - value for the numbe rof numer + * @param text - rule text for the DynamicManaEffect + */ + public DynamicManaAbility(Mana mana, DynamicValue amount, String text) { + this(mana, amount, new TapSourceCost(), text); + } + public DynamicManaAbility(Mana mana, DynamicValue amount, Cost cost) { - super(Zone.BATTLEFIELD, new DynamicManaEffect(mana, amount), cost); + this(mana, amount, cost, null); + } + + public DynamicManaAbility(Mana mana, DynamicValue amount, Cost cost, String text) { + super(Zone.BATTLEFIELD, new DynamicManaEffect(mana, amount, text), cost); manaEffect = (DynamicManaEffect) this.getEffects().get(0); } public DynamicManaAbility(final DynamicManaAbility ability) { super(ability); manaEffect = ability.manaEffect; + rule = ability.rule; } @Override