[BRO] Implemented Kayla's Command

This commit is contained in:
Daniel Bomar 2022-11-03 14:57:54 -05:00
parent 023954bb28
commit c869acbdcf
No known key found for this signature in database
GPG key ID: C86C8658F4023918
3 changed files with 142 additions and 0 deletions

View file

@ -0,0 +1,111 @@
package mage.cards.k;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.abilities.effects.keyword.ScryEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Construct2Token;
import mage.players.Player;
import mage.target.common.TargetCardInLibrary;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author weirddan455
*/
public final class KaylasCommand extends CardImpl {
private static final FilterCard filter
= new FilterCard("a basic Plains card");
static {
filter.add(SubType.PLAINS.getPredicate());
filter.add(SuperType.BASIC.getPredicate());
}
public KaylasCommand(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{W}{W}");
// Choose two --
this.getSpellAbility().getModes().setMinModes(2);
this.getSpellAbility().getModes().setMaxModes(2);
// * Create a 2/2 colorless Construct artifact creature token.
this.getSpellAbility().addEffect(new CreateTokenEffect(new Construct2Token()));
// * Put a +1/+1 counter on a creature you control. It gains double strike until end of turn.
this.getSpellAbility().addMode(new Mode(new KaylasCommandCounterEffect()));
// * Search your library for a basic Plains card, reveal it, put it into your hand, then shuffle.
this.getSpellAbility().addMode(new Mode(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true)));
// * You gain 2 life and scry 2.
Mode mode = new Mode(new GainLifeEffect(2));
mode.addEffect(new ScryEffect(2, false).concatBy("and"));
this.getSpellAbility().addMode(mode);
}
private KaylasCommand(final KaylasCommand card) {
super(card);
}
@Override
public KaylasCommand copy() {
return new KaylasCommand(this);
}
}
class KaylasCommandCounterEffect extends OneShotEffect {
public KaylasCommandCounterEffect() {
super(Outcome.BoostCreature);
this.staticText = "Put a +1/+1 counter on a creature you control. It gains double strike until end of turn.";
}
private KaylasCommandCounterEffect(final KaylasCommandCounterEffect effect) {
super(effect);
}
@Override
public KaylasCommandCounterEffect copy() {
return new KaylasCommandCounterEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent();
target.setNotTarget(true);
controller.chooseTarget(outcome, target, source, game);
Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent == null) {
return false;
}
permanent.addCounters(CounterType.P1P1.createInstance(), source, game);
GainAbilityTargetEffect effect = new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance());
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
return true;
}
}

View file

@ -85,6 +85,7 @@ public final class TheBrothersWar extends ExpansionSet {
cards.add(new SetCardInfo("Hurkyl, Master Wizard", 51, Rarity.RARE, mage.cards.h.HurkylMasterWizard.class));
cards.add(new SetCardInfo("In the Trenches", 8, Rarity.MYTHIC, mage.cards.i.InTheTrenches.class));
cards.add(new SetCardInfo("Island", 270, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Kayla's Command", 9, Rarity.RARE, mage.cards.k.KaylasCommand.class));
cards.add(new SetCardInfo("Keeper of the Cadence", 54, Rarity.UNCOMMON, mage.cards.k.KeeperOfTheCadence.class));
cards.add(new SetCardInfo("Lat-Nam Adept", 56, Rarity.COMMON, mage.cards.l.LatNamAdept.class));
cards.add(new SetCardInfo("Llanowar Wastes", 264, Rarity.RARE, mage.cards.l.LlanowarWastes.class));

View file

@ -0,0 +1,30 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
/**
*
* @author weirddan455
*/
public class Construct2Token extends TokenImpl {
public Construct2Token() {
super("Construct Token", "2/2 colorless Construct artifact creature token");
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
subtype.add(SubType.CONSTRUCT);
power = new MageInt(2);
toughness = new MageInt(2);
}
private Construct2Token(final Construct2Token token) {
super(token);
}
@Override
public Construct2Token copy() {
return new Construct2Token(this);
}
}