From f1b8fe3efb328558a26c717874abfcbd7a31a172 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 25 Jan 2014 15:13:58 +0100 Subject: [PATCH] [BNG] Fixes to Nessian Wilds Ravager, Scourge of Skola Vale, Felhide Brawler, Mogis, God of Slaughter, Odunos River Trawler and TributeAbility. --- .../sets/bornofthegods/FelhideBrawler.java | 3 +- .../bornofthegods/MogisGodOfSlaughter.java | 2 +- .../bornofthegods/NessianWildsRavager.java | 4 +- .../bornofthegods/OdunosRiverTrawler.java | 2 +- .../bornofthegods/ScourgeOfSkolaVale.java | 15 +++- .../common/FightTargetSourceEffect.java | 89 +++++++++++++++++++ .../abilities/keyword/TributeAbility.java | 2 +- 7 files changed, 107 insertions(+), 10 deletions(-) create mode 100644 Mage/src/mage/abilities/effects/common/FightTargetSourceEffect.java diff --git a/Mage.Sets/src/mage/sets/bornofthegods/FelhideBrawler.java b/Mage.Sets/src/mage/sets/bornofthegods/FelhideBrawler.java index 5a12e5179d0..74ace084d0c 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/FelhideBrawler.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/FelhideBrawler.java @@ -103,7 +103,8 @@ class FelhideBrawlerRestrictionEffect extends RestrictionEffect { // At the beginning of each opponent's upkeep, Mogis deals 2 damage to that player unless he or she sacrifices a creature. effect = new DoUnlessTargetPaysCost(new DamageTargetEffect(2, false, "that player"), new SacrificeTargetCost(new TargetControlledCreaturePermanent()), - "Sacrifice a creature? (Otherwise you get 2 damge.)"); + "Sacrifice a creature? (otherwise you get 2 damage)"); effect.setText("Mogis deals 2 damage to that player unless he or she sacrifices a creature"); Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.OPPONENT, false, true); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/bornofthegods/NessianWildsRavager.java b/Mage.Sets/src/mage/sets/bornofthegods/NessianWildsRavager.java index d58e1c16afd..3f4534d3707 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/NessianWildsRavager.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/NessianWildsRavager.java @@ -33,7 +33,7 @@ import mage.abilities.TriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.common.TributeNotPaidCondition; import mage.abilities.decorator.ConditionalTriggeredAbility; -import mage.abilities.effects.common.FightTargetsEffect; +import mage.abilities.effects.common.FightTargetSourceEffect; import mage.abilities.keyword.TributeAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -65,7 +65,7 @@ public class NessianWildsRavager extends CardImpl { // Tribute 6 this.addAbility(new TributeAbility(6)); // When Nessian Wilds Ravager enters the battlefield, if tribute wasn't paid, you may have Nessian Wilds Ravager fight another target creature. - TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new FightTargetsEffect(), true); + TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new FightTargetSourceEffect(), true); ability.addTarget(new TargetCreaturePermanent(true)); this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), "When {this} enters the battlefield, if its tribute wasn't paid, you may have {this} fight another target creature.")); diff --git a/Mage.Sets/src/mage/sets/bornofthegods/OdunosRiverTrawler.java b/Mage.Sets/src/mage/sets/bornofthegods/OdunosRiverTrawler.java index 21ac91c5604..fa1cd0ef470 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/OdunosRiverTrawler.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/OdunosRiverTrawler.java @@ -48,7 +48,7 @@ import mage.target.common.TargetCardInYourGraveyard; */ public class OdunosRiverTrawler extends CardImpl { - private static final FilterCard filter = new FilterCard("enchantment creature cards"); + private static final FilterCard filter = new FilterCard("enchantment creature card from your graveyard"); static { filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); diff --git a/Mage.Sets/src/mage/sets/bornofthegods/ScourgeOfSkolaVale.java b/Mage.Sets/src/mage/sets/bornofthegods/ScourgeOfSkolaVale.java index 840cdae8ebc..63918b088ea 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/ScourgeOfSkolaVale.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/ScourgeOfSkolaVale.java @@ -45,9 +45,11 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; import mage.players.Player; -import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetControlledPermanent; /** * @@ -55,6 +57,12 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class ScourgeOfSkolaVale extends CardImpl { + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another creature"); + + static { + filter.add(new AnotherPredicate()); + } + public ScourgeOfSkolaVale(UUID ownerId) { super(ownerId, 137, "Scourge of Skola Vale", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.expansionSetCode = "BNG"; @@ -72,7 +80,7 @@ public class ScourgeOfSkolaVale extends CardImpl { this.addAbility(new EntersBattlefieldAbility(effect)); // {T}, Sacrifice another creature: Put a number of +1/+1 counters on Scourge of Skola Vale equal to the sacrificed creature's toughness. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ScourgeOfSkolaValeEffect(), new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); this.addAbility(ability); } @@ -104,10 +112,9 @@ class ScourgeOfSkolaValeEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - int amount = 0; for (Cost cost : source.getCosts()) { if (cost instanceof SacrificeTargetCost) { - amount = ((SacrificeTargetCost) cost).getPermanents().get(0).getToughness().getValue(); + int amount = ((SacrificeTargetCost) cost).getPermanents().get(0).getToughness().getValue(); Player player = game.getPlayer(source.getControllerId()); if (amount > 0 && player != null) { return new AddCountersSourceEffect(CounterType.P1P1.createInstance(amount), true).apply(game, source); diff --git a/Mage/src/mage/abilities/effects/common/FightTargetSourceEffect.java b/Mage/src/mage/abilities/effects/common/FightTargetSourceEffect.java new file mode 100644 index 00000000000..aa3686851a9 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/FightTargetSourceEffect.java @@ -0,0 +1,89 @@ +/* + * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.abilities.effects.common; + +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LevelX2 + */ +public class FightTargetSourceEffect extends OneShotEffect { + + public FightTargetSourceEffect() { + super(Outcome.Damage); + } + + public FightTargetSourceEffect(final FightTargetSourceEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Card card = game.getCard(source.getSourceId()); + if (card != null) { + // only if both targets are legal the effect will be applied + if (source.getTargets().get(0).isLegal(source, game) && source.getTargets().get(1).isLegal(source, game)) { + Permanent creature1 = game.getPermanent(source.getTargets().get(0).getFirstTarget()); + Permanent creature2 = game.getPermanent(source.getSourceId()); + // 20110930 - 701.10 + if (creature1 != null && creature2 != null) { + if (creature1.getCardType().contains(CardType.CREATURE) && creature2.getCardType().contains(CardType.CREATURE)) { + creature1.damage(creature2.getPower().getValue(), creature2.getId(), game, true, false); + creature2.damage(creature1.getPower().getValue(), creature1.getId(), game, true, false); + return true; + } + } + } + game.informPlayers(card.getName() + ": Fighting effect has been fizzled."); + } + return false; + } + + @Override + public FightTargetSourceEffect copy() { + return new FightTargetSourceEffect(this); + } + + @Override + public String getText(Mode mode) { + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } + return new StringBuilder("{this} fight another target ").append(mode.getTargets().get(0).getTargetName()).toString(); + } + +} + diff --git a/Mage/src/mage/abilities/keyword/TributeAbility.java b/Mage/src/mage/abilities/keyword/TributeAbility.java index 77f12fe835b..efe5c124943 100644 --- a/Mage/src/mage/abilities/keyword/TributeAbility.java +++ b/Mage/src/mage/abilities/keyword/TributeAbility.java @@ -117,7 +117,7 @@ class TributeEffect extends OneShotEffect { StringBuilder sb = new StringBuilder("Pay tribute to "); sb.append(sourcePermanent.getName()); sb.append(" (add ").append(CardUtil.numberToText(tributeValue)).append(" +1/+1 counter"); - sb.append(tributeValue > 1 ? "s":"").append("to it)?"); + sb.append(tributeValue > 1 ? "s":"").append(" to it)?"); if (opponent.chooseUse(outcome, sb.toString(), game)) { game.informPlayers(new StringBuilder(opponent.getName()).append(" pays tribute to ").append(sourcePermanent.getName()).toString()); game.getState().setValue(new StringBuilder("tributeValue").append(source.getSourceId()).toString(), "yes");