Fixed that AI destroyed all their permanents with Rats of Rath.

This commit is contained in:
LevelX2 2015-05-10 01:32:14 +02:00
parent 9c97953b6b
commit 7cdda24e9a
2 changed files with 8 additions and 1 deletions

View file

@ -35,9 +35,11 @@ import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ColoredManaCost; import mage.abilities.costs.mana.ColoredManaCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.ColoredManaSymbol; import mage.constants.ColoredManaSymbol;
import mage.constants.Outcome;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
@ -63,9 +65,13 @@ public class RatsOfRath extends CardImpl {
super(ownerId, 44, "Rats of Rath", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); super(ownerId, 44, "Rats of Rath", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}");
this.expansionSetCode = "TMP"; this.expansionSetCode = "TMP";
this.subtype.add("Rat"); this.subtype.add("Rat");
this.color.setBlack(true);
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// {B}: Destroy target artifact, creature, or land you control.
Effect effect = new DestroyTargetEffect();
effect.setOutcome(Outcome.AIDontUseIt); // AI can't handle this
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ColoredManaCost(ColoredManaSymbol.B)); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ColoredManaCost(ColoredManaSymbol.B));
ability.addTarget(new TargetControlledPermanent(filter)); ability.addTarget(new TargetControlledPermanent(filter));
this.addAbility(ability); this.addAbility(ability);

View file

@ -49,6 +49,7 @@ public interface Effect extends Serializable {
void setText(String staticText); void setText(String staticText);
boolean apply(Game game, Ability source); boolean apply(Game game, Ability source);
Outcome getOutcome(); Outcome getOutcome();
void setOutcome(Outcome outcome);
EffectType getEffectType(); EffectType getEffectType();
void setTargetPointer(TargetPointer targetPointer); void setTargetPointer(TargetPointer targetPointer);
TargetPointer getTargetPointer(); TargetPointer getTargetPointer();