mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
[J22] Implement Ashcoat of the Shadow Swarm (#9771)
* [J22] Implement Ashcoat of the Shadow Swarm * Improve Ashcoat end of turn ability * Fix Ashcoat filter in custom effect * Implement requested changes
This commit is contained in:
parent
82b6923a9d
commit
06c53731c4
2 changed files with 107 additions and 0 deletions
106
Mage.Sets/src/mage/cards/a/AshcoatOfTheShadowSwarm.java
Normal file
106
Mage.Sets/src/mage/cards/a/AshcoatOfTheShadowSwarm.java
Normal file
|
@ -0,0 +1,106 @@
|
||||||
|
package mage.cards.a;
|
||||||
|
|
||||||
|
import mage.MageInt;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.AttacksOrBlocksTriggeredAbility;
|
||||||
|
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
||||||
|
import mage.abilities.dynamicvalue.DynamicValue;
|
||||||
|
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.MillCardsControllerEffect;
|
||||||
|
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||||
|
import mage.abilities.hint.Hint;
|
||||||
|
import mage.abilities.hint.ValueHint;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.cards.CardsImpl;
|
||||||
|
import mage.constants.*;
|
||||||
|
import mage.filter.common.FilterCreatureCard;
|
||||||
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.players.Player;
|
||||||
|
import mage.target.TargetCard;
|
||||||
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author PurpleCrowbar
|
||||||
|
*/
|
||||||
|
public final class AshcoatOfTheShadowSwarm extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(SubType.RAT, "Rats you control");
|
||||||
|
private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(filter, null);
|
||||||
|
private static final Hint hint = new ValueHint(
|
||||||
|
"Number of Rats you control", xValue
|
||||||
|
);
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(TargetController.YOU.getControllerPredicate());
|
||||||
|
}
|
||||||
|
|
||||||
|
public AshcoatOfTheShadowSwarm(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
|
||||||
|
addSuperType(SuperType.LEGENDARY);
|
||||||
|
this.subtype.add(SubType.RAT, SubType.WARLOCK);
|
||||||
|
this.power = new MageInt(3);
|
||||||
|
this.toughness = new MageInt(4);
|
||||||
|
|
||||||
|
// Whenever Ashcoat of the Shadow Swarm attacks or blocks, other Rats you control
|
||||||
|
// get +X/+X until end of turn, where X is the number of Rats you control.
|
||||||
|
this.addAbility(new AttacksOrBlocksTriggeredAbility(new BoostControlledEffect(
|
||||||
|
xValue, xValue, Duration.EndOfTurn, filter, true
|
||||||
|
), false).addHint(hint));
|
||||||
|
|
||||||
|
// At the beginning of your end step, you may mill four cards. If you do,
|
||||||
|
// return up to two Rat creature cards from your graveyard to your hand.
|
||||||
|
Ability ability = new BeginningOfEndStepTriggeredAbility(new MillCardsControllerEffect(4),
|
||||||
|
TargetController.YOU, true);
|
||||||
|
ability.addEffect(new AshcoatEffect());
|
||||||
|
this.addAbility(ability);
|
||||||
|
}
|
||||||
|
|
||||||
|
private AshcoatOfTheShadowSwarm(final AshcoatOfTheShadowSwarm card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AshcoatOfTheShadowSwarm copy() {
|
||||||
|
return new AshcoatOfTheShadowSwarm(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AshcoatEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
private static final FilterCreatureCard filter = new FilterCreatureCard("Rat creature cards");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(SubType.RAT.getPredicate());
|
||||||
|
}
|
||||||
|
|
||||||
|
AshcoatEffect() {
|
||||||
|
super(Outcome.ReturnToHand);
|
||||||
|
staticText = "If you do, return up to two Rat creature cards from your graveyard to your hand.";
|
||||||
|
}
|
||||||
|
|
||||||
|
private AshcoatEffect(final AshcoatEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AshcoatEffect copy() {
|
||||||
|
return new AshcoatEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Player player = game.getPlayer(source.getControllerId());
|
||||||
|
if (player == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
TargetCard target = new TargetCardInYourGraveyard(0, 2, filter, true);
|
||||||
|
player.choose(outcome, target, source, game);
|
||||||
|
player.moveCards(new CardsImpl(target.getTargets()), Zone.HAND, source, game);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -25,6 +25,7 @@ public final class Jumpstart2022 extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Ardoz, Cobbler of War", 29, Rarity.RARE, mage.cards.a.ArdozCobblerOfWar.class));
|
cards.add(new SetCardInfo("Ardoz, Cobbler of War", 29, Rarity.RARE, mage.cards.a.ArdozCobblerOfWar.class));
|
||||||
cards.add(new SetCardInfo("Arlinn, Voice of the Pack", 85, Rarity.UNCOMMON, mage.cards.a.ArlinnVoiceOfThePack.class));
|
cards.add(new SetCardInfo("Arlinn, Voice of the Pack", 85, Rarity.UNCOMMON, mage.cards.a.ArlinnVoiceOfThePack.class));
|
||||||
cards.add(new SetCardInfo("Arrest", 52, Rarity.UNCOMMON, mage.cards.a.Arrest.class));
|
cards.add(new SetCardInfo("Arrest", 52, Rarity.UNCOMMON, mage.cards.a.Arrest.class));
|
||||||
|
cards.add(new SetCardInfo("Ashcoat of the Shadow Swarm", 19, Rarity.MYTHIC, mage.cards.a.AshcoatOfTheShadowSwarm.class));
|
||||||
cards.add(new SetCardInfo("Balan, Wandering Knight", 53, Rarity.RARE, mage.cards.b.BalanWanderingKnight.class));
|
cards.add(new SetCardInfo("Balan, Wandering Knight", 53, Rarity.RARE, mage.cards.b.BalanWanderingKnight.class));
|
||||||
cards.add(new SetCardInfo("Biblioplex Kraken", 10, Rarity.UNCOMMON, mage.cards.b.BiblioplexKraken.class));
|
cards.add(new SetCardInfo("Biblioplex Kraken", 10, Rarity.UNCOMMON, mage.cards.b.BiblioplexKraken.class));
|
||||||
cards.add(new SetCardInfo("Blood Artist", 117, Rarity.UNCOMMON, mage.cards.b.BloodArtist.class));
|
cards.add(new SetCardInfo("Blood Artist", 117, Rarity.UNCOMMON, mage.cards.b.BloodArtist.class));
|
||||||
|
|
Loading…
Reference in a new issue