1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-14 01:01:08 -09:00

Card updates.

This commit is contained in:
MitchelStein 2014-08-20 10:50:21 -07:00
parent 174a0217ed
commit 454efbbef6
3 changed files with 9 additions and 40 deletions
Mage.Sets/src/mage/sets

View file

@ -30,13 +30,10 @@ package mage.sets.darksteel;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.common.DiscardsACardOpponentTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
/** /**
* *
@ -48,8 +45,10 @@ public class GethsGrimoire extends CardImpl {
super(ownerId, 123, "Geth's Grimoire", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); super(ownerId, 123, "Geth's Grimoire", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}");
this.expansionSetCode = "DST"; this.expansionSetCode = "DST";
Effect drawTrigger = new DrawCardSourceControllerEffect(1);
drawTrigger.setText("You may draw a card.");
// Whenever an opponent discards a card, you may draw a card. // Whenever an opponent discards a card, you may draw a card.
this.addAbility(new GethsGrimoireTriggeredAbility()); this.addAbility(new DiscardsACardOpponentTriggeredAbility(drawTrigger, true));
} }
public GethsGrimoire(final GethsGrimoire card) { public GethsGrimoire(final GethsGrimoire card) {
@ -60,32 +59,4 @@ public class GethsGrimoire extends CardImpl {
public GethsGrimoire copy() { public GethsGrimoire copy() {
return new GethsGrimoire(this); return new GethsGrimoire(this);
} }
} }
class GethsGrimoireTriggeredAbility extends TriggeredAbilityImpl {
GethsGrimoireTriggeredAbility() {
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), true);
}
GethsGrimoireTriggeredAbility(final GethsGrimoireTriggeredAbility ability) {
super(ability);
}
@Override
public GethsGrimoireTriggeredAbility copy() {
return new GethsGrimoireTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DISCARDED_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) {
return true;
}
return false;
}
@Override
public String getRule() {
return "Whenever an opponent discards a card, you may draw a card.";
}
}

View file

@ -116,7 +116,7 @@ class OrcishLibrarianEffect extends OneShotEffect {
if (cards.size() > 0) if (cards.size() > 0)
{ {
Card card = cards.getRandom(game); Card card = cards.getRandom(game);
card.moveToExile(null, null, source.getSourceId(), game); player.moveCardToExileWithInfo(card, null, null, source.getId(), game, Zone.LIBRARY);
cards.remove(card); cards.remove(card);
} }
} }

View file

@ -41,11 +41,10 @@ import static mage.constants.Layer.TypeChangingEffects_4;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.SubLayer; import mage.constants.SubLayer;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterPermanent; import mage.filter.common.FilterEnchantmentPermanent;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -79,10 +78,9 @@ public class Opalescence extends CardImpl {
class OpalescenceEffect extends ContinuousEffectImpl { class OpalescenceEffect extends ContinuousEffectImpl {
private static final FilterPermanent filter = new FilterPermanent("Each other non-Aura enchantment"); private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("Each other non-Aura enchantment");
static { static {
filter.add(Predicates.not(new SubtypePredicate("Aura"))); filter.add(Predicates.not(new SubtypePredicate("Aura")));
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
} }
public OpalescenceEffect() { public OpalescenceEffect() {