From ca11af6ab01b903c7b529eb94fbaa8cfe02a6265 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 11 Jan 2019 23:26:10 -0500 Subject: [PATCH] Implemented Territorial Boar --- .../src/mage/cards/t/TerritorialBoar.java | 58 +++++++++++++++++++ .../src/mage/sets/RavnicaAllegiance.java | 1 + 2 files changed, 59 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/t/TerritorialBoar.java diff --git a/Mage.Sets/src/mage/cards/t/TerritorialBoar.java b/Mage.Sets/src/mage/cards/t/TerritorialBoar.java new file mode 100644 index 0000000000..7d66f4fba4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TerritorialBoar.java @@ -0,0 +1,58 @@ +package mage.cards.t; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.VigilanceAbility; +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.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TerritorialBoar extends CardImpl { + + private static final FilterPermanent filter + = new FilterCreaturePermanent("a creature with power 4 or greater"); + + static { + filter.add(new PowerPredicate(ComparisonType.MORE_THAN, 3)); + } + + public TerritorialBoar(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); + + this.subtype.add(SubType.BOAR); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever a creature with power 4 or greater enters the battlefield under your control, Territorial Boar gets +1/+1 and gains vigilance until end of turn. + Ability ability = new EntersBattlefieldControlledTriggeredAbility(new BoostSourceEffect( + 1, 1, Duration.EndOfTurn + ).setText("{this} gets +1/+1"), filter); + ability.addEffect(new GainAbilitySourceEffect( + VigilanceAbility.getInstance(), Duration.EndOfTurn + ).setText("and gains vigilance until end of turn")); + this.addAbility(ability); + } + + private TerritorialBoar(final TerritorialBoar card) { + super(card); + } + + @Override + public TerritorialBoar copy() { + return new TerritorialBoar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/RavnicaAllegiance.java b/Mage.Sets/src/mage/sets/RavnicaAllegiance.java index b628f424fa..ede46cf56e 100644 --- a/Mage.Sets/src/mage/sets/RavnicaAllegiance.java +++ b/Mage.Sets/src/mage/sets/RavnicaAllegiance.java @@ -270,6 +270,7 @@ public final class RavnicaAllegiance extends ExpansionSet { cards.add(new SetCardInfo("Syndicate Guildmage", 211, Rarity.UNCOMMON, mage.cards.s.SyndicateGuildmage.class)); cards.add(new SetCardInfo("Syndicate Messenger", 25, Rarity.COMMON, mage.cards.s.SyndicateMessenger.class)); cards.add(new SetCardInfo("Tenth District Veteran", 26, Rarity.COMMON, mage.cards.t.TenthDistrictVeteran.class)); + cards.add(new SetCardInfo("Territorial Boar", 145, Rarity.COMMON, mage.cards.t.TerritorialBoar.class)); cards.add(new SetCardInfo("Teysa Karlov", 212, Rarity.RARE, mage.cards.t.TeysaKarlov.class)); cards.add(new SetCardInfo("The Haunt of Hightower", 273, Rarity.MYTHIC, mage.cards.t.TheHauntOfHightower.class)); cards.add(new SetCardInfo("Theater of Horrors", 213, Rarity.RARE, mage.cards.t.TheaterOfHorrors.class));