Updated Control of the Court, Goblin Lore, Sisay's RIng, Ur Golem's Eye, Dragon Mage, and Helm of Possession

This commit is contained in:
fireshoes 2015-02-19 12:58:14 -06:00
parent 31feb14bc0
commit b3e9731549
6 changed files with 94 additions and 230 deletions

View file

@ -33,9 +33,10 @@ import java.util.UUID;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.Mana; import mage.Mana;
import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.mana.BasicManaAbility; import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.Zone;
/** /**
* *
@ -46,7 +47,9 @@ public class UrGolemsEye extends CardImpl {
public UrGolemsEye (UUID ownerId) { public UrGolemsEye (UUID ownerId) {
super(ownerId, 155, "Ur-Golem's Eye", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); super(ownerId, 155, "Ur-Golem's Eye", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{4}");
this.expansionSetCode = "DST"; this.expansionSetCode = "DST";
this.addAbility(new UrGolemsEyeAbility());
// {tap}: Add {2} to your mana pool.
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0,0,0,0,0,2,0), new TapSourceCost()));
} }
public UrGolemsEye (final UrGolemsEye card) { public UrGolemsEye (final UrGolemsEye card) {
@ -60,20 +63,3 @@ public class UrGolemsEye extends CardImpl {
} }
class UrGolemsEyeAbility extends BasicManaAbility {
public UrGolemsEyeAbility() {
super(new BasicManaEffect(new Mana(0, 0, 0, 0, 0, 2, 0)));
this.netMana.add(new Mana(0, 0, 0, 0, 0, 2, 0));
}
public UrGolemsEyeAbility(final UrGolemsEyeAbility ability) {
super(ability);
}
@Override
public UrGolemsEyeAbility copy() {
return new UrGolemsEyeAbility(this);
}
}

View file

@ -28,16 +28,12 @@
package mage.sets.portalthreekingdoms; package mage.sets.portalthreekingdoms;
import java.util.UUID; import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.Card; import mage.abilities.effects.common.discard.DiscardControllerEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.game.Game;
import mage.players.Player;
/** /**
* *
@ -50,7 +46,10 @@ public class ControlOfTheCourt extends CardImpl {
this.expansionSetCode = "PTK"; this.expansionSetCode = "PTK";
// Draw four cards, then discard three cards at random. // Draw four cards, then discard three cards at random.
this.getSpellAbility().addEffect(new ControlOfTheCourtEffect()); this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(4));
Effect effect = new DiscardControllerEffect(3, true);
effect.setText("then discard three cards at random");
this.getSpellAbility().addEffect(effect);
} }
public ControlOfTheCourt(final ControlOfTheCourt card) { public ControlOfTheCourt(final ControlOfTheCourt card) {
@ -62,37 +61,3 @@ public class ControlOfTheCourt extends CardImpl {
return new ControlOfTheCourt(this); return new ControlOfTheCourt(this);
} }
} }
class ControlOfTheCourtEffect extends OneShotEffect {
public ControlOfTheCourtEffect() {
super(Outcome.DrawCard);
this.staticText = "Draw four cards, then discard three cards at random";
}
public ControlOfTheCourtEffect(final ControlOfTheCourtEffect effect) {
super(effect);
}
@Override
public ControlOfTheCourtEffect copy() {
return new ControlOfTheCourtEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
player.drawCards(4, game);
Cards hand = player.getHand();
for (int i = 0; i < 3; i++) {
Card card = hand.getRandom(game);
if (card != null) {
player.discard(card, source, game);
}
}
return true;
}
return false;
}
}

View file

@ -31,16 +31,13 @@ import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.Effect;
import mage.abilities.effects.common.discard.DiscardEachPlayerEffect; import mage.abilities.effects.common.DrawCardAllEffect;
import mage.abilities.effects.common.discard.DiscardHandAllEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.game.Game;
import mage.players.Player;
/** /**
* *
@ -59,7 +56,11 @@ public class DragonMage extends CardImpl {
// Flying // Flying
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// Whenever Dragon Mage deals combat damage to a player, each player discards his or her hand and draws seven cards. // Whenever Dragon Mage deals combat damage to a player, each player discards his or her hand and draws seven cards.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DragonMageEffect(), false)); Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new DiscardHandAllEffect(), false);
Effect effect = new DrawCardAllEffect(7);
effect.setText("and draws seven cards");
ability.addEffect(effect);
this.addAbility(ability);
} }
public DragonMage(final DragonMage card) { public DragonMage(final DragonMage card) {
@ -71,39 +72,3 @@ public class DragonMage extends CardImpl {
return new DragonMage(this); return new DragonMage(this);
} }
} }
class DragonMageEffect extends OneShotEffect {
public DragonMageEffect() {
super(Outcome.DrawCard);
this.staticText = "Each player discards his or her hand, then draws seven cards";
}
public DragonMageEffect(final DragonMageEffect effect) {
super(effect);
}
@Override
public DragonMageEffect copy() {
return new DragonMageEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
for (UUID playerId : controller.getInRange()) {
Player player = game.getPlayer(playerId);
if (player != null) {
for (Card card : player.getHand().getCards(game)) {
player.discard(card, source, game);
}
player.drawCards(7, game);
}
}
return true;
}
return false;
}
}

View file

@ -29,11 +29,12 @@ package mage.sets.seventhedition;
import java.util.UUID; import java.util.UUID;
import mage.Mana; import mage.Mana;
import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.mana.BasicManaAbility; import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.Zone;
/** /**
* *
@ -46,7 +47,7 @@ public class SisaysRing extends CardImpl {
this.expansionSetCode = "7ED"; this.expansionSetCode = "7ED";
// {tap}: Add {2} to your mana pool. // {tap}: Add {2} to your mana pool.
this.addAbility(new SisaysRingAbility()); this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new Mana(0,0,0,0,0,2,0), new TapSourceCost()));
} }
public SisaysRing(final SisaysRing card) { public SisaysRing(final SisaysRing card) {
@ -58,20 +59,3 @@ public class SisaysRing extends CardImpl {
return new SisaysRing(this); return new SisaysRing(this);
} }
} }
class SisaysRingAbility extends BasicManaAbility {
public SisaysRingAbility() {
super(new BasicManaEffect(new Mana(0, 0, 0, 0, 0, 2, 0)));
this.netMana.add(new Mana(0, 0, 0, 0, 0, 2, 0));
}
public SisaysRingAbility(final SisaysRingAbility ability) {
super(ability);
}
@Override
public SisaysRingAbility copy() {
return new SisaysRingAbility(this);
}
}

View file

@ -61,9 +61,9 @@ public class HelmOfPossession extends CardImpl {
// {2}, {tap}, Sacrifice a creature: Gain control of target creature for as long as you control Helm of Possession and Helm of Possession remains tapped. // {2}, {tap}, Sacrifice a creature: Gain control of target creature for as long as you control Helm of Possession and Helm of Possession remains tapped.
ConditionalContinousEffect effect = new ConditionalContinousEffect( ConditionalContinousEffect effect = new ConditionalContinousEffect(
new GainControlTargetEffect(Duration.OneUse), new GainControlTargetEffect(Duration.Custom),
new HelmOfPossessionCondition(), new HelmOfPossessionCondition(),
"Gain control of target creature for as long as you control Helm of Possession and Helm of Possession remains tapped"); "Gain control of target creature for as long as you control {this} and {this} remains tapped");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent()));

View file

@ -29,15 +29,11 @@ package mage.sets.tenth;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.abilities.Ability; import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.Card; import mage.abilities.effects.common.discard.DiscardControllerEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.game.Game;
import mage.players.Player;
/** /**
* *
@ -52,8 +48,10 @@ public class GoblinLore extends CardImpl {
this.color.setRed(true); this.color.setRed(true);
// Draw four cards, then discard three cards at random. // Draw four cards, then discard three cards at random.
this.getSpellAbility().addEffect(new GoblinLoreEffect()); this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(4));
} Effect effect = new DiscardControllerEffect(3, true);
effect.setText("then discard three cards at random");
this.getSpellAbility().addEffect(effect); }
public GoblinLore(final GoblinLore card) { public GoblinLore(final GoblinLore card) {
super(card); super(card);
@ -64,37 +62,3 @@ public class GoblinLore extends CardImpl {
return new GoblinLore(this); return new GoblinLore(this);
} }
} }
class GoblinLoreEffect extends OneShotEffect {
public GoblinLoreEffect() {
super(Outcome.DrawCard);
this.staticText = "Draw four cards, then discard three cards at random";
}
public GoblinLoreEffect(final GoblinLoreEffect effect) {
super(effect);
}
@Override
public GoblinLoreEffect copy() {
return new GoblinLoreEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
player.drawCards(4, game);
Cards hand = player.getHand();
for (int i = 0; i < 3; i++) {
Card card = hand.getRandom(game);
if (card != null) {
player.discard(card, source, game);
}
}
return true;
}
return false;
}
}