From 44115b93d06d3f1e231ac0bd3c84f7fb8faaad10 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 7 Jan 2019 19:30:47 -0500 Subject: [PATCH] Implemented Gruul Beastmaster --- .../src/mage/cards/g/GruulBeastmaster.java | 64 +++++++++++++++++++ .../src/mage/sets/RavnicaAllegiance.java | 1 + .../dynamicvalue/common/StaticValue.java | 9 ++- 3 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/g/GruulBeastmaster.java diff --git a/Mage.Sets/src/mage/cards/g/GruulBeastmaster.java b/Mage.Sets/src/mage/cards/g/GruulBeastmaster.java new file mode 100644 index 0000000000..3a3a774020 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GruulBeastmaster.java @@ -0,0 +1,64 @@ +package mage.cards.g; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.RiotAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.target.TargetPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GruulBeastmaster extends CardImpl { + + private static final FilterPermanent filter + = new FilterControlledCreaturePermanent("another target creature you control"); + + static { + filter.add(new AnotherPredicate()); + } + + private static final DynamicValue xValue = new SourcePermanentPowerCount(false); + + public GruulBeastmaster(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SHAMAN); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Riot + this.addAbility(new RiotAbility()); + + // Whenever Gruul Beastmaster attacks, another target creature you control gets +X/+0 until end of turn, where X is Gruul Beastmaster's power. + Ability ability = new AttacksTriggeredAbility(new BoostTargetEffect( + xValue, StaticValue.getZeroValue(), Duration.EndOfTurn, true + ), false); + ability.addTarget(new TargetPermanent(filter)); + this.addAbility(ability); + } + + private GruulBeastmaster(final GruulBeastmaster card) { + super(card); + } + + @Override + public GruulBeastmaster copy() { + return new GruulBeastmaster(this); + } +} diff --git a/Mage.Sets/src/mage/sets/RavnicaAllegiance.java b/Mage.Sets/src/mage/sets/RavnicaAllegiance.java index f12fcbdbbf..598742d837 100644 --- a/Mage.Sets/src/mage/sets/RavnicaAllegiance.java +++ b/Mage.Sets/src/mage/sets/RavnicaAllegiance.java @@ -68,6 +68,7 @@ public final class RavnicaAllegiance extends ExpansionSet { cards.add(new SetCardInfo("Grasping Thrull", 177, Rarity.COMMON, mage.cards.g.GraspingThrull.class)); cards.add(new SetCardInfo("Growth Spiral", 178, Rarity.COMMON, mage.cards.g.GrowthSpiral.class)); cards.add(new SetCardInfo("Growth-Chamber Guardian", 128, Rarity.RARE, mage.cards.g.GrowthChamberGuardian.class)); + cards.add(new SetCardInfo("Gruul Beastmaster", 129, Rarity.UNCOMMON, mage.cards.g.GruulBeastmaster.class)); cards.add(new SetCardInfo("Gruul Guildgate", 249, Rarity.COMMON, mage.cards.g.GruulGuildgate.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Gruul Guildgate", 250, Rarity.COMMON, mage.cards.g.GruulGuildgate.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Gruul Locket", 234, Rarity.COMMON, mage.cards.g.GruulLocket.class)); diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/StaticValue.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/StaticValue.java index 0297eec66a..f5a11f8136 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/StaticValue.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/StaticValue.java @@ -7,8 +7,9 @@ import mage.game.Game; public class StaticValue implements DynamicValue { - private int value = 0; - private String message; + private final int value; + private final String message; + private static final StaticValue zeroValue = new StaticValue(0); public StaticValue(int value) { this(value, ""); @@ -47,4 +48,8 @@ public class StaticValue implements DynamicValue { public int getValue() { return value; } + + public static StaticValue getZeroValue() { + return zeroValue; + } }