[BNG] Fixes to Nessian Wilds Ravager, Scourge of Skola Vale, Felhide Brawler, Mogis, God of Slaughter, Odunos River Trawler and TributeAbility.

This commit is contained in:
LevelX2 2014-01-25 15:13:58 +01:00
parent 7147e47199
commit f1b8fe3efb
7 changed files with 107 additions and 10 deletions

View file

@ -103,7 +103,8 @@ class FelhideBrawlerRestrictionEffect extends RestrictionEffect<FelhideBrawlerRe
@Override @Override
public boolean applies(Permanent permanent, Ability source, Game game) { public boolean applies(Permanent permanent, Ability source, Game game) {
if (game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) == 0) { if (permanent.getId().equals(source.getSourceId())
&& game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) == 0) {
return true; return true;
} }
return false; return false;

View file

@ -80,7 +80,7 @@ public class MogisGodOfSlaughter extends CardImpl<MogisGodOfSlaughter> {
// At the beginning of each opponent's upkeep, Mogis deals 2 damage to that player unless he or she sacrifices a creature. // 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()), 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"); 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); Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.OPPONENT, false, true);
this.addAbility(ability); this.addAbility(ability);

View file

@ -33,7 +33,7 @@ import mage.abilities.TriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.TributeNotPaidCondition; import mage.abilities.condition.common.TributeNotPaidCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.FightTargetsEffect; import mage.abilities.effects.common.FightTargetSourceEffect;
import mage.abilities.keyword.TributeAbility; import mage.abilities.keyword.TributeAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
@ -65,7 +65,7 @@ public class NessianWildsRavager extends CardImpl<NessianWildsRavager> {
// Tribute 6 // Tribute 6
this.addAbility(new TributeAbility(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. // 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)); ability.addTarget(new TargetCreaturePermanent(true));
this.addAbility(new ConditionalTriggeredAbility(ability, TributeNotPaidCondition.getInstance(), 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.")); "When {this} enters the battlefield, if its tribute wasn't paid, you may have {this} fight another target creature."));

View file

@ -48,7 +48,7 @@ import mage.target.common.TargetCardInYourGraveyard;
*/ */
public class OdunosRiverTrawler extends CardImpl<OdunosRiverTrawler> { public class OdunosRiverTrawler extends CardImpl<OdunosRiverTrawler> {
private static final FilterCard filter = new FilterCard("enchantment creature cards"); private static final FilterCard filter = new FilterCard("enchantment creature card from your graveyard");
static { static {
filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); filter.add(new CardTypePredicate(CardType.ENCHANTMENT));

View file

@ -45,9 +45,11 @@ import mage.constants.Outcome;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; 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<ScourgeOfSkolaVale> { public class ScourgeOfSkolaVale extends CardImpl<ScourgeOfSkolaVale> {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another creature");
static {
filter.add(new AnotherPredicate());
}
public ScourgeOfSkolaVale(UUID ownerId) { public ScourgeOfSkolaVale(UUID ownerId) {
super(ownerId, 137, "Scourge of Skola Vale", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}"); super(ownerId, 137, "Scourge of Skola Vale", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}");
this.expansionSetCode = "BNG"; this.expansionSetCode = "BNG";
@ -72,7 +80,7 @@ public class ScourgeOfSkolaVale extends CardImpl<ScourgeOfSkolaVale> {
this.addAbility(new EntersBattlefieldAbility(effect)); 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. // {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 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); this.addAbility(ability);
} }
@ -104,10 +112,9 @@ class ScourgeOfSkolaValeEffect extends OneShotEffect<ScourgeOfSkolaValeEffect> {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
int amount = 0;
for (Cost cost : source.getCosts()) { for (Cost cost : source.getCosts()) {
if (cost instanceof SacrificeTargetCost) { 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()); Player player = game.getPlayer(source.getControllerId());
if (amount > 0 && player != null) { if (amount > 0 && player != null) {
return new AddCountersSourceEffect(CounterType.P1P1.createInstance(amount), true).apply(game, source); return new AddCountersSourceEffect(CounterType.P1P1.createInstance(amount), true).apply(game, source);

View file

@ -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<FightTargetSourceEffect> {
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();
}
}

View file

@ -117,7 +117,7 @@ class TributeEffect extends OneShotEffect<TributeEffect> {
StringBuilder sb = new StringBuilder("Pay tribute to "); StringBuilder sb = new StringBuilder("Pay tribute to ");
sb.append(sourcePermanent.getName()); sb.append(sourcePermanent.getName());
sb.append(" (add ").append(CardUtil.numberToText(tributeValue)).append(" +1/+1 counter"); 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)) { if (opponent.chooseUse(outcome, sb.toString(), game)) {
game.informPlayers(new StringBuilder(opponent.getName()).append(" pays tribute to ").append(sourcePermanent.getName()).toString()); 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"); game.getState().setValue(new StringBuilder("tributeValue").append(source.getSourceId()).toString(), "yes");