mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Implement Rakdos Augermage
This commit is contained in:
parent
dcb1affb9d
commit
147a3cf91d
3 changed files with 138 additions and 0 deletions
95
Mage.Sets/src/mage/cards/r/RakdosAugermage.java
Normal file
95
Mage.Sets/src/mage/cards/r/RakdosAugermage.java
Normal file
|
@ -0,0 +1,95 @@
|
|||
package mage.cards.r;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.RevealHandSourceControllerEffect;
|
||||
import mage.abilities.effects.common.RevealHandTargetEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardCardYouChooseTargetEffect;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.cards.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
import mage.target.common.TargetOpponent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author noahg
|
||||
*/
|
||||
public final class RakdosAugermage extends CardImpl {
|
||||
|
||||
public RakdosAugermage(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{B}{R}");
|
||||
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.WIZARD);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// First strike
|
||||
this.addAbility(FirstStrikeAbility.getInstance());
|
||||
|
||||
// {tap}: Reveal your hand and discard a card of target opponent’s choice. Then that player reveals their hand and discards a card of your choice. Activate this ability only any time you could cast a sorcery.
|
||||
ActivateAsSorceryActivatedAbility ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new RevealHandSourceControllerEffect(), new TapSourceCost());
|
||||
ability.addEffect(new RakdosAugermageEffect());
|
||||
ability.addEffect(new RevealHandTargetEffect());
|
||||
ability.addEffect(new DiscardCardYouChooseTargetEffect());
|
||||
ability.addTarget(new TargetOpponent());
|
||||
}
|
||||
|
||||
public RakdosAugermage(final RakdosAugermage card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RakdosAugermage copy() {
|
||||
return new RakdosAugermage(this);
|
||||
}
|
||||
}
|
||||
|
||||
class RakdosAugermageEffect extends OneShotEffect {
|
||||
|
||||
public RakdosAugermageEffect() {
|
||||
super(Outcome.Discard);
|
||||
staticText = "discard a card of target opponent’s choice";
|
||||
}
|
||||
|
||||
public RakdosAugermageEffect(final RakdosAugermageEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Card sourceCard = game.getCard(source.getSourceId());
|
||||
if (player != null && controller != null) {
|
||||
Cards revealedCards = new CardsImpl();
|
||||
revealedCards.addAll(controller.getHand());
|
||||
player.revealCards(sourceCard != null ? sourceCard.getIdName() + " (" + sourceCard.getZoneChangeCounter(game) + ')' : "Discard", revealedCards, game);
|
||||
TargetCard target = new TargetCard(Zone.HAND, new FilterCard());
|
||||
if (player.choose(Outcome.Benefit, revealedCards, target, game)) {
|
||||
Card card = revealedCards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
return player.discard(card, source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RakdosAugermageEffect copy() {
|
||||
return new RakdosAugermageEffect(this);
|
||||
}
|
||||
}
|
|
@ -131,6 +131,7 @@ public final class Dissension extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Pure // Simple", 154, Rarity.UNCOMMON, mage.cards.p.PureSimple.class));
|
||||
cards.add(new SetCardInfo("Ragamuffyn", 51, Rarity.UNCOMMON, mage.cards.r.Ragamuffyn.class));
|
||||
cards.add(new SetCardInfo("Rain of Gore", 126, Rarity.RARE, mage.cards.r.RainOfGore.class));
|
||||
cards.add(new SetCardInfo("Rakdos Augermage", 127, Rarity.RARE, mage.cards.r.RakdosAugermage.class));
|
||||
cards.add(new SetCardInfo("Rakdos Carnarium", 178, Rarity.COMMON, mage.cards.r.RakdosCarnarium.class));
|
||||
cards.add(new SetCardInfo("Rakdos Guildmage", 145, Rarity.UNCOMMON, mage.cards.r.RakdosGuildmage.class));
|
||||
cards.add(new SetCardInfo("Rakdos Ickspitter", 128, Rarity.COMMON, mage.cards.r.RakdosIckspitter.class));
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author noahg
|
||||
*/
|
||||
public class RevealHandSourceControllerEffect extends OneShotEffect {
|
||||
|
||||
public RevealHandSourceControllerEffect() {
|
||||
super(Outcome.Discard);
|
||||
this.staticText = "reveal your hand";
|
||||
}
|
||||
|
||||
public RevealHandSourceControllerEffect(final RevealHandSourceControllerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (player != null && sourceObject != null) {
|
||||
player.revealCards(sourceObject.getIdName(), player.getHand(), game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RevealHandSourceControllerEffect copy() {
|
||||
return new RevealHandSourceControllerEffect(this);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue