[LTC] Implement Of Herbs and Stewed Rabbit (#10718)

This commit is contained in:
Susucre 2023-08-01 05:52:28 +02:00 committed by GitHub
parent 378fd2743e
commit d61e454e77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 85 additions and 8 deletions

View file

@ -1,7 +1,6 @@
package mage.cards.f;
import java.util.UUID;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.dynamicvalue.common.SacrificeCostConvertedMana;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
@ -10,10 +9,11 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledPermanent;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LoneFox
@ -21,13 +21,13 @@ import mage.target.common.TargetCreaturePermanent;
public final class ForgeArmor extends CardImpl {
public ForgeArmor(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{R}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{R}");
// As an additional cost to cast Forge Armor, sacrifice an artifact.
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT_AN))));
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT_AN)));
// Put X +1/+1 counters on target creature, where X is the sacrificed artifact's converted mana cost.
this.getSpellAbility().addEffect(new AddCountersTargetEffect(new AddCountersTargetEffect(
CounterType.P1P1.createInstance(), new SacrificeCostConvertedMana("artifact"))));
this.getSpellAbility().addEffect(new AddCountersTargetEffect(
CounterType.P1P1.createInstance(), new SacrificeCostConvertedMana("artifact")));
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}

View file

@ -0,0 +1,76 @@
package mage.cards.o;
import mage.abilities.common.SagaAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.Effects;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
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.filter.common.FilterControlledPermanent;
import mage.game.permanent.token.FoodToken;
import mage.game.permanent.token.HalflingToken;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author Susucr
*/
public final class OfHerbsAndStewedRabbit extends CardImpl {
private static final FilterControlledPermanent filter =
new FilterControlledPermanent(SubType.FOOD, "Food you control");
public OfHerbsAndStewedRabbit(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
this.subtype.add(SubType.SAGA);
// (As this Saga enters and after your draw step, add a lore counter. Sacrifice after III.)
SagaAbility sagaAbility = new SagaAbility(this);
// I -- Put a +1/+1 counter on up to one target creature. Create a Food token.
Effects effect1 = new Effects();
effect1.add(new AddCountersTargetEffect(CounterType.P1P1.createInstance()));
effect1.add(new CreateTokenEffect(new FoodToken()));
sagaAbility.addChapterEffect(
this, SagaChapter.CHAPTER_I,
effect1, new TargetCreaturePermanent(0,1)
);
// II -- Draw a card. Create a Food token.
sagaAbility.addChapterEffect(
this, SagaChapter.CHAPTER_II,
new DrawCardSourceControllerEffect(1),
new CreateTokenEffect(new FoodToken())
);
// III -- Create a 1/1 white Halfling creature token for each Food you control.
sagaAbility.addChapterEffect(
this, SagaChapter.CHAPTER_III,
new CreateTokenEffect(
new HalflingToken(),
new PermanentsOnBattlefieldCount(filter)
)
);
this.addAbility(sagaAbility);
}
private OfHerbsAndStewedRabbit(final OfHerbsAndStewedRabbit card) {
super(card);
}
@Override
public OfHerbsAndStewedRabbit copy() {
return new OfHerbsAndStewedRabbit(this);
}
}

View file

@ -182,6 +182,7 @@ public final class TalesOfMiddleEarthCommander extends ExpansionSet {
cards.add(new SetCardInfo("Notion Thief", 270, Rarity.RARE, mage.cards.n.NotionThief.class));
cards.add(new SetCardInfo("Oath of Eorl", 64, Rarity.RARE, mage.cards.o.OathOfEorl.class));
cards.add(new SetCardInfo("Oboro, Palace in the Clouds", 371, Rarity.MYTHIC, mage.cards.o.OboroPalaceInTheClouds.class));
cards.add(new SetCardInfo("Of Herbs and Stewed Rabbit", 17, Rarity.RARE, mage.cards.o.OfHerbsAndStewedRabbit.class));
cards.add(new SetCardInfo("Opt", 194, Rarity.COMMON, mage.cards.o.Opt.class));
cards.add(new SetCardInfo("Orchard Strider", 253, Rarity.COMMON, mage.cards.o.OrchardStrider.class));
cards.add(new SetCardInfo("Orcish Siegemaster", 33, Rarity.RARE, mage.cards.o.OrcishSiegemaster.class));

View file

@ -43,7 +43,7 @@ public class AddCountersTargetEffect extends OneShotEffect {
this.amount = amount;
}
public AddCountersTargetEffect(final AddCountersTargetEffect effect) {
protected AddCountersTargetEffect(final AddCountersTargetEffect effect) {
super(effect);
if (effect.counter != null) {
this.counter = effect.counter.copy();

View file

@ -29,7 +29,7 @@ public class FilterControlledPermanent extends FilterPermanent {
}
}
public FilterControlledPermanent(final FilterControlledPermanent filter) {
protected FilterControlledPermanent(final FilterControlledPermanent filter) {
super(filter);
}