forked from External/mage
[BRC] Implement Wondrous Crucible
This commit is contained in:
parent
1772b56086
commit
8def408d41
2 changed files with 94 additions and 0 deletions
93
Mage.Sets/src/mage/cards/w/WondrousCrucible.java
Normal file
93
Mage.Sets/src/mage/cards/w/WondrousCrucible.java
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
package mage.cards.w;
|
||||
|
||||
import mage.ApprovingObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
||||
import mage.abilities.keyword.WardAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.util.RandomUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class WondrousCrucible extends CardImpl {
|
||||
|
||||
public WondrousCrucible(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{7}");
|
||||
|
||||
// Permanents you control have ward {2}.
|
||||
this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(
|
||||
new WardAbility(new GenericManaCost(2), false), Duration.WhileOnBattlefield
|
||||
)));
|
||||
|
||||
// At the beginning of your end step, mill two cards, then exile a nonland card at random from your graveyard. Copy it. You may cast the copy without paying its mana cost.
|
||||
this.addAbility(new BeginningOfEndStepTriggeredAbility(
|
||||
new WondrousCrucibleEffect(), TargetController.YOU, false
|
||||
));
|
||||
}
|
||||
|
||||
private WondrousCrucible(final WondrousCrucible card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WondrousCrucible copy() {
|
||||
return new WondrousCrucible(this);
|
||||
}
|
||||
}
|
||||
|
||||
class WondrousCrucibleEffect extends OneShotEffect {
|
||||
|
||||
WondrousCrucibleEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "mill two cards, then exile a nonland card at random from your graveyard. " +
|
||||
"Copy it. You may cast the copy without paying its mana cost";
|
||||
}
|
||||
|
||||
private WondrousCrucibleEffect(final WondrousCrucibleEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WondrousCrucibleEffect copy() {
|
||||
return new WondrousCrucibleEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
player.millCards(2, source, game);
|
||||
Card card = RandomUtil.randomFromCollection(
|
||||
player.getGraveyard().getCards(StaticFilters.FILTER_CARD_NON_LAND, game)
|
||||
);
|
||||
if (card == null) {
|
||||
return true;
|
||||
}
|
||||
Card copiedCard = game.copyCard(card, source, player.getId());
|
||||
game.getState().setValue("PlayFromNotOwnHandZone" + copiedCard.getId(), Boolean.TRUE);
|
||||
player.cast(
|
||||
player.chooseAbilityForCast(copiedCard, game, false),
|
||||
game, false, new ApprovingObject(source, game)
|
||||
);
|
||||
game.getState().setValue("PlayFromNotOwnHandZone" + copiedCard.getId(), null);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -182,6 +182,7 @@ public final class TheBrothersWarCommander extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Wayfarer's Bauble", 171, Rarity.COMMON, mage.cards.w.WayfarersBauble.class));
|
||||
cards.add(new SetCardInfo("Whirler Rogue", 101, Rarity.UNCOMMON, mage.cards.w.WhirlerRogue.class));
|
||||
cards.add(new SetCardInfo("Wire Surgeons", 10, Rarity.RARE, mage.cards.w.WireSurgeons.class));
|
||||
cards.add(new SetCardInfo("Wondrous Crucible", 20, Rarity.RARE, mage.cards.w.WondrousCrucible.class));
|
||||
cards.add(new SetCardInfo("Workshop Elders", 102, Rarity.RARE, mage.cards.w.WorkshopElders.class));
|
||||
cards.add(new SetCardInfo("Wreck Hunter", 11, Rarity.RARE, mage.cards.w.WreckHunter.class));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue