From 5c63069522bf058c42eb8bbfafdb1f6d4d4d07c6 Mon Sep 17 00:00:00 2001 From: spjspj Date: Fri, 4 Nov 2016 22:52:00 +1100 Subject: [PATCH] spjspj - Stonehoof Chieftain (C16) --- .../src/mage/cards/s/StonehoofChieftain.java | 91 +++++++++++++++++++ Mage.Sets/src/mage/sets/Commander2016.java | 1 + Utils/gen-card.pl | 2 +- 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/s/StonehoofChieftain.java diff --git a/Mage.Sets/src/mage/cards/s/StonehoofChieftain.java b/Mage.Sets/src/mage/cards/s/StonehoofChieftain.java new file mode 100644 index 0000000000..bf09633d1a --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/StonehoofChieftain.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.s; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAllTriggeredAbility; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SetTargetPointer; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author spjspj + */ +public class StonehoofChieftain extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature you control"); + + static { + filter.add(new ControllerPredicate(TargetController.YOU)); + filter.add(new AnotherPredicate()); + } + + public StonehoofChieftain(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{7}{G}"); + + this.subtype.add("Centaur"); + this.subtype.add("Warrior"); + this.power = new MageInt(8); + this.toughness = new MageInt(8); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Indestructible + this.addAbility(IndestructibleAbility.getInstance()); + + // Whenever another creature you control attacks, it gains trample and indestructible until end of turn. + GainAbilityTargetEffect effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); + effect.setText("it gains trample "); + Ability ability = new AttacksAllTriggeredAbility(effect, false, filter, SetTargetPointer.PERMANENT, false); + GainAbilityTargetEffect effect2 = new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn); + effect2.setText(" and indestructible until end of turn"); + ability.addEffect(effect2); + this.addAbility(ability); + } + + public StonehoofChieftain(final StonehoofChieftain card) { + super(card); + } + + @Override + public StonehoofChieftain copy() { + return new StonehoofChieftain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Commander2016.java b/Mage.Sets/src/mage/sets/Commander2016.java index 5add37b831..4f64772df8 100644 --- a/Mage.Sets/src/mage/sets/Commander2016.java +++ b/Mage.Sets/src/mage/sets/Commander2016.java @@ -313,6 +313,7 @@ public class Commander2016 extends ExpansionSet { cards.add(new SetCardInfo("Spinerock Knoll", 327, Rarity.RARE, mage.cards.s.SpinerockKnoll.class)); cards.add(new SetCardInfo("Spitting Image", 236, Rarity.RARE, mage.cards.s.SpittingImage.class)); cards.add(new SetCardInfo("Stalking Vengeance", 134, Rarity.RARE, mage.cards.s.StalkingVengeance.class)); + cards.add(new SetCardInfo("Stonehoof Chieftain", 25, Rarity.RARE, mage.cards.s.StonehoofChieftain.class)); cards.add(new SetCardInfo("Sublime Exhalation", 5, Rarity.RARE, mage.cards.s.SublimeExhalation.class)); cards.add(new SetCardInfo("Sunforger", 275, Rarity.RARE, mage.cards.s.Sunforger.class)); cards.add(new SetCardInfo("Sungrass Prairie", 328, Rarity.RARE, mage.cards.s.SungrassPrairie.class)); diff --git a/Utils/gen-card.pl b/Utils/gen-card.pl index 1f6236beb9..9075b5d9bc 100755 --- a/Utils/gen-card.pl +++ b/Utils/gen-card.pl @@ -122,7 +122,7 @@ my @card; foreach my $setName (keys %{$cards{$cardName}}) { my $setFileName = "../Mage.Sets/src/mage/sets/".$knownSets{$setName}.".java"; @card = @{${cards{$cardName}{$setName}}}; - my $line = "\tcards.add(new SetCardInfo(\"".$card[0]."\", ".$card[2].", Rarity.".$raritiesConversion{$card[3]}.", mage.cards.".$vars{'cardNameFirstLetter'}.".".$vars{'className'}.".class));\n"; + my $line = " cards.add(new SetCardInfo(\"".$card[0]."\", ".$card[2].", Rarity.".$raritiesConversion{$card[3]}.", mage.cards.".$vars{'cardNameFirstLetter'}.".".$vars{'className'}.".class));\n"; @ARGV = ($setFileName); $^I = '.bak';