From d7351a23be05dc2ccffe191250fb386c2123bd23 Mon Sep 17 00:00:00 2001 From: magenoxx <magenoxx@gmail> Date: Wed, 21 Sep 2011 21:32:12 +0400 Subject: [PATCH] [ISD] 8 equipments --- .../mage/sets/innistrad/ButchersCleaver.java | 78 +++++++++++ .../src/mage/sets/innistrad/CobbledWings.java | 69 ++++++++++ .../mage/sets/innistrad/DemonmailHauberk.java | 70 ++++++++++ .../src/mage/sets/innistrad/MaskOfAvacyn.java | 69 ++++++++++ .../mage/sets/innistrad/RunechantersPike.java | 111 +++++++++++++++ .../sets/innistrad/SharpenedPitchfork.java | 77 +++++++++++ .../sets/innistrad/SilverInlaidDagger.java | 73 ++++++++++ .../src/mage/sets/innistrad/WoodenStake.java | 127 ++++++++++++++++++ 8 files changed, 674 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/innistrad/ButchersCleaver.java create mode 100644 Mage.Sets/src/mage/sets/innistrad/CobbledWings.java create mode 100644 Mage.Sets/src/mage/sets/innistrad/DemonmailHauberk.java create mode 100644 Mage.Sets/src/mage/sets/innistrad/MaskOfAvacyn.java create mode 100644 Mage.Sets/src/mage/sets/innistrad/RunechantersPike.java create mode 100644 Mage.Sets/src/mage/sets/innistrad/SharpenedPitchfork.java create mode 100644 Mage.Sets/src/mage/sets/innistrad/SilverInlaidDagger.java create mode 100644 Mage.Sets/src/mage/sets/innistrad/WoodenStake.java diff --git a/Mage.Sets/src/mage/sets/innistrad/ButchersCleaver.java b/Mage.Sets/src/mage/sets/innistrad/ButchersCleaver.java new file mode 100644 index 0000000000..0484e4196e --- /dev/null +++ b/Mage.Sets/src/mage/sets/innistrad/ButchersCleaver.java @@ -0,0 +1,78 @@ +/* + * 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.sets.innistrad; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.EquippedHasSubtypeCondition; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.effects.common.continious.BoostEquippedEffect; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.abilities.keyword.UnblockableAbility; +import mage.cards.CardImpl; +import mage.sets.magic2010.Lifelink; + +/** + * + * @author nantuko + */ +public class ButchersCleaver extends CardImpl<ButchersCleaver> { + + private static final String staticText = "As long as equipped creature is a Human, it has lifelink"; + + public ButchersCleaver(UUID ownerId) { + super(ownerId, 217, "Butcher's Cleaver", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Equipment"); + + // Equip {3} + this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(3))); + + // Equipped creature gets +3/+0. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(3, 0))); + + // As long as equipped creature is a Human, it has lifelink. + this.addAbility(new ConditionalStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), Constants.AttachmentType.EQUIPMENT), new EquippedHasSubtypeCondition("Human"), staticText)); + } + + public ButchersCleaver(final ButchersCleaver card) { + super(card); + } + + @Override + public ButchersCleaver copy() { + return new ButchersCleaver(this); + } +} diff --git a/Mage.Sets/src/mage/sets/innistrad/CobbledWings.java b/Mage.Sets/src/mage/sets/innistrad/CobbledWings.java new file mode 100644 index 0000000000..057474d5f2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/innistrad/CobbledWings.java @@ -0,0 +1,69 @@ +/* + * 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.sets.innistrad; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.UnblockableAbility; +import mage.cards.CardImpl; + +/** + * + * @author nantuko + */ +public class CobbledWings extends CardImpl<CobbledWings> { + + public CobbledWings(UUID ownerId) { + super(ownerId, 219, "Cobbled Wings", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Equipment"); + + // Equip {1} + this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(1))); + + // Equipped creature has flying. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); + } + + public CobbledWings(final CobbledWings card) { + super(card); + } + + @Override + public CobbledWings copy() { + return new CobbledWings(this); + } +} diff --git a/Mage.Sets/src/mage/sets/innistrad/DemonmailHauberk.java b/Mage.Sets/src/mage/sets/innistrad/DemonmailHauberk.java new file mode 100644 index 0000000000..5affe0260a --- /dev/null +++ b/Mage.Sets/src/mage/sets/innistrad/DemonmailHauberk.java @@ -0,0 +1,70 @@ +/* + * 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.sets.innistrad; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.continious.BoostEquippedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.cards.CardImpl; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author nantuko + */ +public class DemonmailHauberk extends CardImpl<DemonmailHauberk> { + + public DemonmailHauberk(UUID ownerId) { + super(ownerId, 221, "Demonmail Hauberk", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Equipment"); + + // Equip - Sacrifice a creature. + this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new SacrificeTargetCost(new TargetControlledCreaturePermanent()))); + + // Equipped creature gets +4/+2. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(4, 2))); + } + + public DemonmailHauberk(final DemonmailHauberk card) { + super(card); + } + + @Override + public DemonmailHauberk copy() { + return new DemonmailHauberk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/innistrad/MaskOfAvacyn.java b/Mage.Sets/src/mage/sets/innistrad/MaskOfAvacyn.java new file mode 100644 index 0000000000..3b1597240e --- /dev/null +++ b/Mage.Sets/src/mage/sets/innistrad/MaskOfAvacyn.java @@ -0,0 +1,69 @@ +/* + * 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.sets.innistrad; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.continious.BoostEquippedEffect; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.HexproofAbility; +import mage.cards.CardImpl; + +import java.util.UUID; + +/** + * @author nantuko + */ +public class MaskOfAvacyn extends CardImpl<MaskOfAvacyn> { + + public MaskOfAvacyn(UUID ownerId) { + super(ownerId, 229, "Mask of Avacyn", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Equipment"); + + // Equip {3} + this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(3))); + + // Equipped creature gets +1/+2 and has hexproof. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new HexproofAbility(), Constants.AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(1, 2))); + } + + public MaskOfAvacyn(final MaskOfAvacyn card) { + super(card); + } + + @Override + public MaskOfAvacyn copy() { + return new MaskOfAvacyn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/innistrad/RunechantersPike.java b/Mage.Sets/src/mage/sets/innistrad/RunechantersPike.java new file mode 100644 index 0000000000..9089d421b3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/innistrad/RunechantersPike.java @@ -0,0 +1,111 @@ +/* + * 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.sets.innistrad; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.continious.BoostEquippedEffect; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.filter.Filter; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author nantuko + */ +public class RunechantersPike extends CardImpl<RunechantersPike> { + + protected static final FilterCard filterCard = new FilterCard(); + + static { + filterCard.getCardType().add(CardType.INSTANT); + filterCard.getCardType().add(CardType.SORCERY); + filterCard.setScopeCardType(Filter.ComparisonScope.Any); + } + + public RunechantersPike(UUID ownerId) { + super(ownerId, 231, "Runechanter's Pike", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Equipment"); + + // Equip {2} + this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(2))); + + // Equipped creature has first strike and gets +X/+0 where X is the number of instant and sorcery cards in your graveyard. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(new RunechantersPikeValue(), new StaticValue(0)))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); + } + + public RunechantersPike(final RunechantersPike card) { + super(card); + } + + @Override + public RunechantersPike copy() { + return new RunechantersPike(this); + } +} + +class RunechantersPikeValue implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility) { + Player player = game.getPlayer(sourceAbility.getControllerId()); + if (player != null) { + return player.getGraveyard().getCards(RunechantersPike.filterCard, game).size(); + } + return 0; + } + + @Override + public DynamicValue clone() { + return this; + } + + @Override + public String getMessage() { + return "instant and sorcery card in your graveyard"; + } + + @Override + public String toString() { + return "+X"; + } +} diff --git a/Mage.Sets/src/mage/sets/innistrad/SharpenedPitchfork.java b/Mage.Sets/src/mage/sets/innistrad/SharpenedPitchfork.java new file mode 100644 index 0000000000..1e7b9d006c --- /dev/null +++ b/Mage.Sets/src/mage/sets/innistrad/SharpenedPitchfork.java @@ -0,0 +1,77 @@ +/* + * 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.sets.innistrad; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.EquippedHasSubtypeCondition; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.effects.common.continious.BoostEquippedEffect; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.HexproofAbility; +import mage.cards.CardImpl; + +/** + * + * @author nantuko + */ +public class SharpenedPitchfork extends CardImpl<SharpenedPitchfork> { + + private static final String staticText = "As long as equipped creature is a Human, it gets +1/+1"; + + public SharpenedPitchfork(UUID ownerId) { + super(ownerId, 233, "Sharpened Pitchfork", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Equipment"); + + // Equip {1} + this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(1))); + + // Equipped creature has first strike. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); + + // As long as equipped creature is a Human, it gets +1/+1. + this.addAbility(new ConditionalStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1), new EquippedHasSubtypeCondition("Human"), staticText)); + } + + public SharpenedPitchfork(final SharpenedPitchfork card) { + super(card); + } + + @Override + public SharpenedPitchfork copy() { + return new SharpenedPitchfork(this); + } +} diff --git a/Mage.Sets/src/mage/sets/innistrad/SilverInlaidDagger.java b/Mage.Sets/src/mage/sets/innistrad/SilverInlaidDagger.java new file mode 100644 index 0000000000..d71fc8a693 --- /dev/null +++ b/Mage.Sets/src/mage/sets/innistrad/SilverInlaidDagger.java @@ -0,0 +1,73 @@ +/* + * 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.sets.innistrad; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.EquippedHasSubtypeCondition; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.effects.common.continious.BoostEquippedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.cards.CardImpl; + +/** + * @author nantuko + */ +public class SilverInlaidDagger extends CardImpl<SilverInlaidDagger> { + + private static final String staticText = "As long as equipped creature is a Human, it gets an additional +1/+0"; + + public SilverInlaidDagger(UUID ownerId) { + super(ownerId, 233, "Silver-Inlaid Dagger", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Equipment"); + + // Equip {2} + this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(2))); + + // Equipped creature gets +2/+0 + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(2, 0))); + + // As long as equipped creature is a Human, it gets an additional +1/+0 + this.addAbility(new ConditionalStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(1, 0), new EquippedHasSubtypeCondition("Human"), staticText)); + } + + public SilverInlaidDagger(final SilverInlaidDagger card) { + super(card); + } + + @Override + public SilverInlaidDagger copy() { + return new SilverInlaidDagger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/innistrad/WoodenStake.java b/Mage.Sets/src/mage/sets/innistrad/WoodenStake.java new file mode 100644 index 0000000000..7f8408dba6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/innistrad/WoodenStake.java @@ -0,0 +1,127 @@ +/* + * 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.sets.innistrad; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.continious.BoostEquippedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * @author nantuko + */ +public class WoodenStake extends CardImpl<WoodenStake> { + + public WoodenStake(UUID ownerId) { + super(ownerId, 237, "Wooden Stake", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Equipment"); + + // Equip {1} + this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(1))); + + // Equipped creature gets +1/+0. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(1, 0))); + + // Whenever equipped creature blocks or becomes blocked by a Vampire, destroy that creature. It can't be regenerated. + this.addAbility(new WoodenStakeBlocksOrBecomesBlockedTriggeredAbility()); + } + + public WoodenStake(final WoodenStake card) { + super(card); + } + + @Override + public WoodenStake copy() { + return new WoodenStake(this); + } +} + +class WoodenStakeBlocksOrBecomesBlockedTriggeredAbility extends TriggeredAbilityImpl<WoodenStakeBlocksOrBecomesBlockedTriggeredAbility> { + + public WoodenStakeBlocksOrBecomesBlockedTriggeredAbility() { + super(Constants.Zone.BATTLEFIELD, new DestroyTargetEffect(true), false); + } + + public WoodenStakeBlocksOrBecomesBlockedTriggeredAbility(final WoodenStakeBlocksOrBecomesBlockedTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) { + Permanent equipment = game.getPermanent(sourceId); + if (equipment != null && equipment.getAttachedTo() != null) { + if (event.getSourceId().equals(equipment.getAttachedTo())) { + Permanent blocks = game.getPermanent(event.getTargetId()); + if (blocks != null && blocks.hasSubtype("Vampire")) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); + } + return true; + } + return false; + } + if (event.getTargetId().equals(equipment.getAttachedTo())) { + Permanent blockedBy = game.getPermanent(event.getSourceId()); + if (blockedBy != null && blockedBy.hasSubtype("Vampire")) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getSourceId())); + } + return true; + } + return false; + } + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever equipped creature blocks or becomes blocked by a Vampire, destroy that creature. It can't be regenerated."; + } + + @Override + public WoodenStakeBlocksOrBecomesBlockedTriggeredAbility copy() { + return new WoodenStakeBlocksOrBecomesBlockedTriggeredAbility(this); + } +}