mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
implement [MH3] Brainsurge
This commit is contained in:
parent
12a81d6657
commit
bf99f2a846
3 changed files with 51 additions and 4 deletions
31
Mage.Sets/src/mage/cards/b/Brainsurge.java
Normal file
31
Mage.Sets/src/mage/cards/b/Brainsurge.java
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
package mage.cards.b;
|
||||
|
||||
import mage.abilities.effects.common.BrainstormEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Susucr
|
||||
*/
|
||||
public final class Brainsurge extends CardImpl {
|
||||
|
||||
public Brainsurge(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}");
|
||||
|
||||
// Draw four cards, then put two cards from your hand on top of your library in any order.
|
||||
this.getSpellAbility().addEffect(new BrainstormEffect(4, 2));
|
||||
}
|
||||
|
||||
private Brainsurge(final Brainsurge card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Brainsurge copy() {
|
||||
return new Brainsurge(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -25,6 +25,7 @@ public final class ModernHorizons3 extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Ajani, Nacatl Pariah", 237, Rarity.MYTHIC, mage.cards.a.AjaniNacatlPariah.class));
|
||||
cards.add(new SetCardInfo("Basking Broodscale", 145, Rarity.COMMON, mage.cards.b.BaskingBroodscale.class));
|
||||
cards.add(new SetCardInfo("Bloodstained Mire", 216, Rarity.RARE, mage.cards.b.BloodstainedMire.class));
|
||||
cards.add(new SetCardInfo("Brainsurge", 53, Rarity.UNCOMMON, mage.cards.b.Brainsurge.class));
|
||||
cards.add(new SetCardInfo("Breaker of Creation", 1, Rarity.UNCOMMON, mage.cards.b.BreakerOfCreation.class));
|
||||
cards.add(new SetCardInfo("Breya, Etherium Shaper", 289, Rarity.MYTHIC, mage.cards.b.BreyaEtheriumShaper.class));
|
||||
cards.add(new SetCardInfo("Chthonian Nightmare", 83, Rarity.RARE, mage.cards.c.ChthonianNightmare.class));
|
||||
|
|
|
|||
|
|
@ -8,16 +8,30 @@ import mage.constants.Zone;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
public class BrainstormEffect extends OneShotEffect {
|
||||
|
||||
private final int toDraw;
|
||||
private final int toPutOnTop;
|
||||
|
||||
public BrainstormEffect() {
|
||||
this(3, 2);
|
||||
}
|
||||
|
||||
public BrainstormEffect(int toDraw, int toPutOnTop) {
|
||||
super(Outcome.DrawCard);
|
||||
staticText = "draw three cards, then put two cards from your hand on top of your library in any order";
|
||||
this.toDraw = toDraw;
|
||||
this.toPutOnTop = toPutOnTop;
|
||||
staticText = "draw " + CardUtil.numberToText(toDraw) + (toDraw > 1 ? " cards" : " card")
|
||||
+ ", then put " + CardUtil.numberToText(toPutOnTop) + (toPutOnTop > 1 ? " cards" : " card")
|
||||
+ " from your hand on top of your library in any order";
|
||||
}
|
||||
|
||||
protected BrainstormEffect(final BrainstormEffect effect) {
|
||||
super(effect);
|
||||
this.toDraw = effect.toDraw;
|
||||
this.toPutOnTop = effect.toPutOnTop;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -29,9 +43,10 @@ public class BrainstormEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
player.drawCards(3, source, game);
|
||||
putOnLibrary(player, source, game);
|
||||
putOnLibrary(player, source, game);
|
||||
player.drawCards(toDraw, source, game);
|
||||
for (int i = 0; i < toPutOnTop; ++i) {
|
||||
putOnLibrary(player, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue