[LTR] Implement Assault on Osgiliath

This commit is contained in:
theelk801 2023-06-07 21:50:57 -04:00
parent d49ed24ba1
commit 90163acef5
2 changed files with 79 additions and 0 deletions

View file

@ -0,0 +1,78 @@
package mage.cards.a;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.effects.keyword.AmassEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.game.Game;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class AssaultOnOsgiliath extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent();
static {
filter.add(Predicates.or(
SubType.GOBLIN.getPredicate(),
SubType.ORC.getPredicate()
));
}
public AssaultOnOsgiliath(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{R}{R}{R}");
// Amass Orcs X, then Goblins and Orcs you control gain double strike and haste until end of turn.
this.getSpellAbility().addEffect(new AssimilateEssenceEffect());
this.getSpellAbility().addEffect(new GainAbilityControlledEffect(
DoubleStrikeAbility.getInstance(), Duration.EndOfTurn, filter
).setText(", then Goblins and Orcs you control gain double strike"));
this.getSpellAbility().addEffect(new GainAbilityControlledEffect(
HasteAbility.getInstance(), Duration.EndOfTurn, filter
).setText("and haste until end of turn"));
}
private AssaultOnOsgiliath(final AssaultOnOsgiliath card) {
super(card);
}
@Override
public AssaultOnOsgiliath copy() {
return new AssaultOnOsgiliath(this);
}
}
class AssaultOnOsgiliathEffect extends OneShotEffect {
AssaultOnOsgiliathEffect() {
super(Outcome.Benefit);
staticText = "amass Orcs X";
}
private AssaultOnOsgiliathEffect(final AssaultOnOsgiliathEffect effect) {
super(effect);
}
@Override
public AssaultOnOsgiliathEffect copy() {
return new AssaultOnOsgiliathEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
return AmassEffect.doAmass(source.getManaCostsToPay().getX(), SubType.ORC, game, source) != null;
}
}

View file

@ -21,6 +21,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet {
cards.add(new SetCardInfo("Aragorn and Arwen, Wed", 287, Rarity.MYTHIC, mage.cards.a.AragornAndArwenWed.class));
cards.add(new SetCardInfo("Aragorn, the Uniter", 192, Rarity.MYTHIC, mage.cards.a.AragornTheUniter.class));
cards.add(new SetCardInfo("Arwen's Gift", 39, Rarity.COMMON, mage.cards.a.ArwensGift.class));
cards.add(new SetCardInfo("Assault on Osgiliath", 285, Rarity.RARE, mage.cards.a.AssaultOnOsgiliath.class));
cards.add(new SetCardInfo("Bag End Porter", 153, Rarity.COMMON, mage.cards.b.BagEndPorter.class));
cards.add(new SetCardInfo("Barad-dur", 253, Rarity.RARE, mage.cards.b.BaradDur.class));
cards.add(new SetCardInfo("Bilbo, Retired Burglar", 196, Rarity.UNCOMMON, mage.cards.b.BilboRetiredBurglar.class));