mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
[CLB] Implemented Stonespeaker Crystal
This commit is contained in:
parent
3c08b75893
commit
ef7dae99c6
2 changed files with 89 additions and 0 deletions
88
Mage.Sets/src/mage/cards/s/StonespeakerCrystal.java
Normal file
88
Mage.Sets/src/mage/cards/s/StonespeakerCrystal.java
Normal file
|
@ -0,0 +1,88 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class StonespeakerCrystal extends CardImpl {
|
||||
|
||||
public StonespeakerCrystal(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
|
||||
|
||||
// {T}: Add {C}{C}.
|
||||
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(2), new TapSourceCost()));
|
||||
|
||||
// {2}, {T}, Sacrifice Stonespeaker Crystal: Exile any number of target players' graveyards. Draw a card.
|
||||
Ability ability = new SimpleActivatedAbility(new StonespeakerCrystalEffect(), new GenericManaCost(2));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
ability.addTarget(new TargetPlayer(0, Integer.MAX_VALUE, false));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private StonespeakerCrystal(final StonespeakerCrystal card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StonespeakerCrystal copy() {
|
||||
return new StonespeakerCrystal(this);
|
||||
}
|
||||
}
|
||||
|
||||
class StonespeakerCrystalEffect extends OneShotEffect {
|
||||
|
||||
StonespeakerCrystalEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "exile any number of target players' graveyards. Draw a card";
|
||||
}
|
||||
|
||||
private StonespeakerCrystalEffect(final StonespeakerCrystalEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StonespeakerCrystalEffect copy() {
|
||||
return new StonespeakerCrystalEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
Cards cards = new CardsImpl();
|
||||
this.getTargetPointer()
|
||||
.getTargets(game, source)
|
||||
.stream()
|
||||
.map(game::getPlayer)
|
||||
.filter(Objects::nonNull)
|
||||
.map(Player::getGraveyard)
|
||||
.forEach(cards::addAll);
|
||||
controller.moveCards(cards, Zone.EXILED, source, game);
|
||||
controller.drawCards(1, source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -162,6 +162,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Slaughter the Strong", 43, Rarity.UNCOMMON, mage.cards.s.SlaughterTheStrong.class));
|
||||
cards.add(new SetCardInfo("Spire Garden", 361, Rarity.RARE, mage.cards.s.SpireGarden.class));
|
||||
cards.add(new SetCardInfo("Stirge", 150, Rarity.COMMON, mage.cards.s.Stirge.class));
|
||||
cards.add(new SetCardInfo("Stonespeaker Crystal", 338, Rarity.UNCOMMON, mage.cards.s.StonespeakerCrystal.class));
|
||||
cards.add(new SetCardInfo("Street Urchin", 197, Rarity.UNCOMMON, mage.cards.s.StreetUrchin.class));
|
||||
cards.add(new SetCardInfo("Summon Undead", 151, Rarity.COMMON, mage.cards.s.SummonUndead.class));
|
||||
cards.add(new SetCardInfo("Swamp", 459, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));
|
||||
|
|
Loading…
Reference in a new issue