forked from External/mage
[MID] Implemented Geistwave
This commit is contained in:
parent
90ad64749d
commit
e799765518
2 changed files with 72 additions and 0 deletions
71
Mage.Sets/src/mage/cards/g/Geistwave.java
Normal file
71
Mage.Sets/src/mage/cards/g/Geistwave.java
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
package mage.cards.g;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetNonlandPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class Geistwave extends CardImpl {
|
||||
|
||||
public Geistwave(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
|
||||
|
||||
// Return target nonland permanent to its owner's hand. If you controlled that permanent, draw a card.
|
||||
this.getSpellAbility().addEffect(new GeistwaveEffect());
|
||||
this.getSpellAbility().addTarget(new TargetNonlandPermanent());
|
||||
}
|
||||
|
||||
private Geistwave(final Geistwave card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Geistwave copy() {
|
||||
return new Geistwave(this);
|
||||
}
|
||||
}
|
||||
|
||||
class GeistwaveEffect extends OneShotEffect {
|
||||
|
||||
GeistwaveEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "return target nonland permanent to its owner's hand. " +
|
||||
"If you controlled that permanent, draw a card";
|
||||
}
|
||||
|
||||
private GeistwaveEffect(final GeistwaveEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeistwaveEffect copy() {
|
||||
return new GeistwaveEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(source.getControllerId());
|
||||
if (player == null || permanent == null) {
|
||||
return false;
|
||||
}
|
||||
boolean flag = permanent.isControlledBy(source.getControllerId());
|
||||
player.moveCards(permanent, Zone.HAND, source, game);
|
||||
if (flag) {
|
||||
player.drawCards(1, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -127,6 +127,7 @@ public final class InnistradMidnightHunt extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Gavony Silversmith", 21, Rarity.COMMON, mage.cards.g.GavonySilversmith.class));
|
||||
cards.add(new SetCardInfo("Gavony Trapper", 22, Rarity.COMMON, mage.cards.g.GavonyTrapper.class));
|
||||
cards.add(new SetCardInfo("Geistflame Reservoir", 142, Rarity.RARE, mage.cards.g.GeistflameReservoir.class));
|
||||
cards.add(new SetCardInfo("Geistwave", 56, Rarity.COMMON, mage.cards.g.Geistwave.class));
|
||||
cards.add(new SetCardInfo("Ghoulcaller's Harvest", 225, Rarity.RARE, mage.cards.g.GhoulcallersHarvest.class));
|
||||
cards.add(new SetCardInfo("Grafted Identity", 57, Rarity.RARE, mage.cards.g.GraftedIdentity.class));
|
||||
cards.add(new SetCardInfo("Graveyard Glutton", 104, Rarity.RARE, mage.cards.g.GraveyardGlutton.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue