From ef55d9bf166cd9889ae238822c9b992dbaa3b19e Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sat, 3 Jun 2023 10:16:21 -0400 Subject: [PATCH] [LTR] Implement Olog-hai Crusher --- .../src/mage/cards/o/OlogHaiCrusher.java | 70 +++++++++++++++++++ .../TheLordOfTheRingsTalesOfMiddleEarth.java | 1 + 2 files changed, 71 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/o/OlogHaiCrusher.java diff --git a/Mage.Sets/src/mage/cards/o/OlogHaiCrusher.java b/Mage.Sets/src/mage/cards/o/OlogHaiCrusher.java new file mode 100644 index 0000000000..f156d10471 --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/OlogHaiCrusher.java @@ -0,0 +1,70 @@ +package mage.cards.o; + +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalRestrictionEffect; +import mage.abilities.effects.common.combat.CantBlockSourceEffect; +import mage.abilities.hint.ConditionHint; +import mage.abilities.hint.Hint; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.ComparisonType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class OlogHaiCrusher extends CardImpl { + + private static final FilterPermanent filter = new FilterControlledPermanent(); + + static { + filter.add(Predicates.or( + SubType.GOBLIN.getPredicate(), + SubType.ORC.getPredicate() + )); + } + + private static final Condition condition = + new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.EQUAL_TO, 0); + private static final Hint hint = new ConditionHint( + new PermanentsOnTheBattlefieldCondition(filter), "You control a Goblin or Orc" + ); + + public OlogHaiCrusher(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}"); + + this.subtype.add(SubType.TROLL); + this.subtype.add(SubType.SOLDIER); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Olog-hai Crusher can't block unless you control a Goblin or Orc. + this.addAbility(new SimpleStaticAbility(new ConditionalRestrictionEffect( + new CantBlockSourceEffect(Duration.WhileOnBattlefield), + condition, "{this} can't block unless you control a Goblin or Orc" + )).addHint(hint)); + } + + private OlogHaiCrusher(final OlogHaiCrusher card) { + super(card); + } + + @Override + public OlogHaiCrusher copy() { + return new OlogHaiCrusher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java index ac0fbfb5ee..7dfca6cf1b 100644 --- a/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java +++ b/Mage.Sets/src/mage/sets/TheLordOfTheRingsTalesOfMiddleEarth.java @@ -76,6 +76,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet { cards.add(new SetCardInfo("Mushroom Watchdogs", 180, Rarity.COMMON, mage.cards.m.MushroomWatchdogs.class)); cards.add(new SetCardInfo("Nazgul", 100, Rarity.UNCOMMON, mage.cards.n.Nazgul.class)); cards.add(new SetCardInfo("Oliphaunt", 139, Rarity.COMMON, mage.cards.o.Oliphaunt.class)); + cards.add(new SetCardInfo("Olog-hai Crusher", 140, Rarity.COMMON, mage.cards.o.OlogHaiCrusher.class)); cards.add(new SetCardInfo("Pippin's Bravery", 182, Rarity.COMMON, mage.cards.p.PippinsBravery.class)); cards.add(new SetCardInfo("Plains", 262, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Prince Imrahil the Fair", 219, Rarity.UNCOMMON, mage.cards.p.PrinceImrahilTheFair.class));