1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-03 09:18:59 -09:00

[NEO] Implemented Reckoner Shakedown

This commit is contained in:
Evan Kranzler 2022-02-06 22:28:01 -05:00
parent da6fc9858b
commit e79bf5d1f6
2 changed files with 104 additions and 0 deletions

View file

@ -0,0 +1,103 @@
package mage.cards.r;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.TargetPermanent;
import mage.target.common.TargetCardInHand;
import mage.target.common.TargetOpponent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ReckonerShakedown extends CardImpl {
public ReckonerShakedown(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}");
// Target opponent reveals their hand. You may choose a nonland card from it. If you do, that player discards that card. If you don't, put two +1/+1 counters on a creature or Vehicle you control.
this.getSpellAbility().addEffect(new ReckonerShakedownEffect());
this.getSpellAbility().addTarget(new TargetOpponent());
}
private ReckonerShakedown(final ReckonerShakedown card) {
super(card);
}
@Override
public ReckonerShakedown copy() {
return new ReckonerShakedown(this);
}
}
class ReckonerShakedownEffect extends OneShotEffect {
private static final FilterPermanent filter = new FilterControlledPermanent("creature or Vehicle you control");
static {
filter.add(Predicates.or(
CardType.CREATURE.getPredicate(),
SubType.VEHICLE.getPredicate()
));
}
ReckonerShakedownEffect() {
super(Outcome.Benefit);
staticText = "target opponent reveals their hand. You may choose a nonland card from it. " +
"If you do, that player discards that card. If you don't, " +
"put two +1/+1 counters on a creature or Vehicle you control";
}
private ReckonerShakedownEffect(final ReckonerShakedownEffect effect) {
super(effect);
}
@Override
public ReckonerShakedownEffect copy() {
return new ReckonerShakedownEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Player player = game.getPlayer(source.getFirstTarget());
if (controller == null || player == null) {
return false;
}
player.revealCards(source, player.getHand(), game);
TargetCard target = new TargetCardInHand(0, 1, StaticFilters.FILTER_CARD_A_NON_LAND);
controller.choose(Outcome.Discard, player.getHand(), target, game);
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
player.discard(card, false, source, game);
return true;
}
if (!game.getBattlefield().contains(filter, source, game, 1)) {
return true;
}
TargetPermanent targetPermanent = new TargetPermanent(filter);
targetPermanent.setNotTarget(true);
player.choose(Outcome.BoostCreature, targetPermanent, source.getSourceId(), game);
Permanent permanent = game.getPermanent(targetPermanent.getFirstTarget());
if (permanent != null) {
permanent.addCounters(CounterType.P1P1.createInstance(2), source, game);
}
return true;
}
}

View file

@ -212,6 +212,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet {
cards.add(new SetCardInfo("Raiyuu, Storm's Edge", 232, Rarity.RARE, mage.cards.r.RaiyuuStormsEdge.class));
cards.add(new SetCardInfo("Reality Heist", 75, Rarity.UNCOMMON, mage.cards.r.RealityHeist.class));
cards.add(new SetCardInfo("Reckoner Bankbuster", 255, Rarity.RARE, mage.cards.r.ReckonerBankbuster.class));
cards.add(new SetCardInfo("Reckoner Shakedown", 119, Rarity.COMMON, mage.cards.r.ReckonerShakedown.class));
cards.add(new SetCardInfo("Reckoner's Bargain", 120, Rarity.COMMON, mage.cards.r.ReckonersBargain.class));
cards.add(new SetCardInfo("Regent's Authority", 32, Rarity.COMMON, mage.cards.r.RegentsAuthority.class));
cards.add(new SetCardInfo("Reinforced Ronin", 158, Rarity.UNCOMMON, mage.cards.r.ReinforcedRonin.class));