Implemented The Royal Scions

This commit is contained in:
Evan Kranzler 2019-09-09 20:35:17 -04:00
parent c2ed868787
commit 4a3cced728
2 changed files with 126 additions and 0 deletions

View file

@ -0,0 +1,125 @@
package mage.cards.t;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.DrawDiscardControllerEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.common.TargetAnyTarget;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class TheRoyalScions extends CardImpl {
public TheRoyalScions(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{1}{U}{R}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.WILL);
this.subtype.add(SubType.ROWAN);
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// +1: Draw a card, then discard a card.
this.addAbility(new LoyaltyAbility(new DrawDiscardControllerEffect(1, 1), 1));
// +1: Target creature gets +2/+0 and gains first strike until end of turn.
Ability ability = new LoyaltyAbility(new BoostTargetEffect(
2, 0, Duration.EndOfTurn
).setText("Target creature gets +2/+0"), 1);
ability.addEffect(new GainAbilityTargetEffect(
FirstStrikeAbility.getInstance(), Duration.EndOfTurn
).setText("and gains first strike until end of turn"));
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
// 8: Draw four cards. When you do, The Royal Scions deals damage to any target equal to the number of cards in your hand.
this.addAbility(new LoyaltyAbility(new TheRoyalScionsCreateReflexiveTriggerEffect(), -8));
}
private TheRoyalScions(final TheRoyalScions card) {
super(card);
}
@Override
public TheRoyalScions copy() {
return new TheRoyalScions(this);
}
}
class TheRoyalScionsCreateReflexiveTriggerEffect extends OneShotEffect {
private static final Effect effect = new DrawCardSourceControllerEffect(4);
TheRoyalScionsCreateReflexiveTriggerEffect() {
super(Outcome.Benefit);
staticText = "Draw four cards. When you do, {this} deals damage " +
"to any target equal to the number of cards in your hand.";
}
private TheRoyalScionsCreateReflexiveTriggerEffect(final TheRoyalScionsCreateReflexiveTriggerEffect effect) {
super(effect);
}
@Override
public TheRoyalScionsCreateReflexiveTriggerEffect copy() {
return new TheRoyalScionsCreateReflexiveTriggerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
effect.apply(game, source);
game.addDelayedTriggeredAbility(new TheRoyalScionsReflexiveTriggeredAbility(), source);
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.OPTION_USED, source.getOriginalId(), source.getSourceId(), source.getControllerId(), 0));
return true;
}
}
class TheRoyalScionsReflexiveTriggeredAbility extends DelayedTriggeredAbility {
TheRoyalScionsReflexiveTriggeredAbility() {
super(new DamageTargetEffect(CardsInControllerHandCount.instance), Duration.OneUse, true);
this.addTarget(new TargetAnyTarget());
}
private TheRoyalScionsReflexiveTriggeredAbility(final TheRoyalScionsReflexiveTriggeredAbility ability) {
super(ability);
}
@Override
public TheRoyalScionsReflexiveTriggeredAbility copy() {
return new TheRoyalScionsReflexiveTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.OPTION_USED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getPlayerId().equals(this.getControllerId())
&& event.getSourceId().equals(this.getSourceId());
}
@Override
public String getRule() {
return "When you do, {this} deals damage to any target equal to the number of cards in your hand.";
}
}

View file

@ -104,6 +104,7 @@ public final class ThroneOfEldraine extends ExpansionSet {
cards.add(new SetCardInfo("Syr Konrad, the Grim", 107, Rarity.UNCOMMON, mage.cards.s.SyrKonradTheGrim.class)); cards.add(new SetCardInfo("Syr Konrad, the Grim", 107, Rarity.UNCOMMON, mage.cards.s.SyrKonradTheGrim.class));
cards.add(new SetCardInfo("Taste of Death", 320, Rarity.RARE, mage.cards.t.TasteOfDeath.class)); cards.add(new SetCardInfo("Taste of Death", 320, Rarity.RARE, mage.cards.t.TasteOfDeath.class));
cards.add(new SetCardInfo("The Circle of Loyalty", 9, Rarity.MYTHIC, mage.cards.t.TheCircleOfLoyalty.class)); cards.add(new SetCardInfo("The Circle of Loyalty", 9, Rarity.MYTHIC, mage.cards.t.TheCircleOfLoyalty.class));
cards.add(new SetCardInfo("The Royal Scions", 199, Rarity.MYTHIC, mage.cards.t.TheRoyalScions.class));
cards.add(new SetCardInfo("Thorn Mammoth", 323, Rarity.RARE, mage.cards.t.ThornMammoth.class)); cards.add(new SetCardInfo("Thorn Mammoth", 323, Rarity.RARE, mage.cards.t.ThornMammoth.class));
cards.add(new SetCardInfo("Thornwood Falls", 313, Rarity.COMMON, mage.cards.t.ThornwoodFalls.class)); cards.add(new SetCardInfo("Thornwood Falls", 313, Rarity.COMMON, mage.cards.t.ThornwoodFalls.class));
cards.add(new SetCardInfo("Tome Raider", 68, Rarity.COMMON, mage.cards.t.TomeRaider.class)); cards.add(new SetCardInfo("Tome Raider", 68, Rarity.COMMON, mage.cards.t.TomeRaider.class));