[NEO] Implemented Jugan Defends the Temple / Remnant of the Rising Star

This commit is contained in:
Evan Kranzler 2022-02-06 21:24:36 -05:00
parent 260175a528
commit 2303c42b5b
3 changed files with 193 additions and 0 deletions

View file

@ -0,0 +1,57 @@
package mage.cards.j;
import mage.abilities.common.SagaAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ExileSagaAndReturnTransformedEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SagaChapter;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.game.permanent.token.HumanMonkToken;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class JuganDefendsTheTemple extends CardImpl {
public JuganDefendsTheTemple(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
this.subtype.add(SubType.SAGA);
this.secondSideCardClazz = mage.cards.r.RemnantOfTheRisingStar.class;
// (As this Saga enters and after your draw step, add a lore counter.)
SagaAbility sagaAbility = new SagaAbility(this);
// I Create a 1/1 green Human Monk creature token with "{T}: Add {G}."
sagaAbility.addChapterEffect(this, SagaChapter.CHAPTER_I, new CreateTokenEffect(new HumanMonkToken()));
// II Put a +1/+1 counter on each of up to two target creatures.
sagaAbility.addChapterEffect(
this, SagaChapter.CHAPTER_II, SagaChapter.CHAPTER_II,
new AddCountersTargetEffect(CounterType.P1P1.createInstance()), new TargetCreaturePermanent(0, 2)
);
// III Exile this Saga, then return it to the battlefield transformed under your control.
this.addAbility(new TransformAbility());
sagaAbility.addChapterEffect(this, SagaChapter.CHAPTER_III, new ExileSagaAndReturnTransformedEffect());
this.addAbility(sagaAbility);
}
private JuganDefendsTheTemple(final JuganDefendsTheTemple card) {
super(card);
}
@Override
public JuganDefendsTheTemple copy() {
return new JuganDefendsTheTemple(this);
}
}

View file

@ -0,0 +1,134 @@
package mage.cards.r;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.hint.Hint;
import mage.abilities.hint.ValueHint;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.ModifiedPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class RemnantOfTheRisingStar extends CardImpl {
private static final FilterPermanent filter = new FilterControlledCreaturePermanent();
static {
filter.add(ModifiedPredicate.instance);
}
private static final Condition condition
= new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.MORE_THAN, 4);
private static final Hint hint
= new ValueHint("Modified creatures you control", new PermanentsOnBattlefieldCount(filter));
public RemnantOfTheRisingStar(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "");
this.subtype.add(SubType.DRAGON);
this.subtype.add(SubType.SPIRIT);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.color.setGreen(true);
this.nightCard = true;
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever another creature enters the battlefield under your control, you may pay {X}. When you do, put X +1/+1 counters on that creature.
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(
new RemnantOfTheRisingStarEffect(), StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE
));
// As long as you control five or more modified creatures, Remnant of the Rising Star gets +5/+5 and has trample.
Ability ability = new SimpleStaticAbility(new ConditionalContinuousEffect(
new BoostSourceEffect(5, 5, Duration.WhileOnBattlefield),
condition, "as long as you control five or more modified creatures, {this} gets +5/+5"
));
ability.addEffect(new ConditionalContinuousEffect(
new GainAbilitySourceEffect(TrampleAbility.getInstance()), condition, "and has trample"
));
this.addAbility(ability.addHint(hint));
}
private RemnantOfTheRisingStar(final RemnantOfTheRisingStar card) {
super(card);
}
@Override
public RemnantOfTheRisingStar copy() {
return new RemnantOfTheRisingStar(this);
}
}
class RemnantOfTheRisingStarEffect extends OneShotEffect {
RemnantOfTheRisingStarEffect() {
super(Outcome.Benefit);
staticText = "you may pay {X}. When you do, put X +1/+1 counters on that creature";
}
private RemnantOfTheRisingStarEffect(final RemnantOfTheRisingStarEffect effect) {
super(effect);
}
@Override
public RemnantOfTheRisingStarEffect copy() {
return new RemnantOfTheRisingStarEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
ManaCosts<ManaCost> cost = new ManaCostsImpl<>("{X}");
if (player == null || !player.chooseUse(
Outcome.BoostCreature, "Pay " + cost.getText() + "?", source, game
)) {
return false;
}
int xValue = player.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source);
cost.add(new GenericManaCost(xValue));
if (!cost.pay(source, game, source, source.getControllerId(), false, null)) {
return false;
}
Permanent permanent = (Permanent) getValue("permanentEnteringBattlefield");
if (permanent == null) {
return false;
}
game.fireReflexiveTriggeredAbility(new ReflexiveTriggeredAbility(
new AddCountersTargetEffect(CounterType.P1P1.createInstance(xValue))
.setTargetPointer(new FixedTarget(permanent, game)), false
), source);
return true;
}
}

View file

@ -136,6 +136,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet {
cards.add(new SetCardInfo("Ironhoof Boar", 148, Rarity.COMMON, mage.cards.i.IronhoofBoar.class));
cards.add(new SetCardInfo("Island", 285, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Isshin, Two Heavens as One", 224, Rarity.RARE, mage.cards.i.IsshinTwoHeavensAsOne.class));
cards.add(new SetCardInfo("Jugan Defends the Temple", 194, Rarity.MYTHIC, mage.cards.j.JuganDefendsTheTemple.class));
cards.add(new SetCardInfo("Jukai Naturalist", 225, Rarity.UNCOMMON, mage.cards.j.JukaiNaturalist.class));
cards.add(new SetCardInfo("Jukai Preserver", 195, Rarity.COMMON, mage.cards.j.JukaiPreserver.class));
cards.add(new SetCardInfo("Jukai Trainee", 196, Rarity.COMMON, mage.cards.j.JukaiTrainee.class));
@ -213,6 +214,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet {
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));
cards.add(new SetCardInfo("Reito Sentinel", 256, Rarity.UNCOMMON, mage.cards.r.ReitoSentinel.class));
cards.add(new SetCardInfo("Remnant of the Rising Star", 194, Rarity.MYTHIC, mage.cards.r.RemnantOfTheRisingStar.class));
cards.add(new SetCardInfo("Repel the Vile", 33, Rarity.COMMON, mage.cards.r.RepelTheVile.class));
cards.add(new SetCardInfo("Replication Specialist", 76, Rarity.UNCOMMON, mage.cards.r.ReplicationSpecialist.class));
cards.add(new SetCardInfo("Return to Action", 121, Rarity.COMMON, mage.cards.r.ReturnToAction.class));