From 799095ef810f6b99fc64e4122647d4e0b6335957 Mon Sep 17 00:00:00 2001 From: jeffwadsworth Date: Thu, 12 Jul 2012 21:54:44 -0500 Subject: [PATCH] - Added the Rings. --- .../mage/sets/magic2013/RingOfEvosIsle.java | 88 ++++++++++++++++++ .../mage/sets/magic2013/RingOfKalonia.java | 85 ++++++++++++++++++ .../src/mage/sets/magic2013/RingOfThune.java | 85 ++++++++++++++++++ .../src/mage/sets/magic2013/RingOfValkas.java | 85 ++++++++++++++++++ .../mage/sets/magic2013/RingOfXathrid.java | 84 +++++++++++++++++ .../common/RegenerateEquippedEffect.java | 90 +++++++++++++++++++ .../continious/GainAbilityAttachedEffect.java | 8 ++ 7 files changed, 525 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/magic2013/RingOfEvosIsle.java create mode 100644 Mage.Sets/src/mage/sets/magic2013/RingOfKalonia.java create mode 100644 Mage.Sets/src/mage/sets/magic2013/RingOfThune.java create mode 100644 Mage.Sets/src/mage/sets/magic2013/RingOfValkas.java create mode 100644 Mage.Sets/src/mage/sets/magic2013/RingOfXathrid.java create mode 100644 Mage/src/mage/abilities/effects/common/RegenerateEquippedEffect.java diff --git a/Mage.Sets/src/mage/sets/magic2013/RingOfEvosIsle.java b/Mage.Sets/src/mage/sets/magic2013/RingOfEvosIsle.java new file mode 100644 index 00000000000..6406173540f --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2013/RingOfEvosIsle.java @@ -0,0 +1,88 @@ +/* + * 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.magic2013; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.ObjectColor; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.condition.common.EquippedMatchesFilterCondition; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.HexproofAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author jeffwadsworth + */ +public class RingOfEvosIsle extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + static { + filter.getColor().setBlue(true); + filter.setUseColor(true); + } + + + + public RingOfEvosIsle(UUID ownerId) { + super(ownerId, 211, "Ring of Evos Isle", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "M13"; + this.subtype.add("Equipment"); + + // {2}: Equipped creature gains hexproof until end of turn. + this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HexproofAbility.getInstance(), Constants.AttachmentType.EQUIPMENT, Constants.Duration.EndOfTurn), new GenericManaCost(2))); + + // At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's blue. + TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(Constants.Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1), Constants.TargetController.YOU, false); + ConditionalTriggeredAbility ability = new ConditionalTriggeredAbility(triggeredAbility, new EquippedMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's blue"); + this.addAbility(ability); + + // Equip {1} + this.addAbility(new EquipAbility(Constants.Outcome.BoostCreature, new GenericManaCost(1))); + } + + public RingOfEvosIsle(final RingOfEvosIsle card) { + super(card); + } + + @Override + public RingOfEvosIsle copy() { + return new RingOfEvosIsle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2013/RingOfKalonia.java b/Mage.Sets/src/mage/sets/magic2013/RingOfKalonia.java new file mode 100644 index 00000000000..7bd4988835e --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2013/RingOfKalonia.java @@ -0,0 +1,85 @@ +/* + * 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.magic2013; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.EquippedMatchesFilterCondition; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author jeffwadsworth + */ +public class RingOfKalonia extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + static { + filter.getColor().setGreen(true); + filter.setUseColor(true); + } + + public RingOfKalonia(UUID ownerId) { + super(ownerId, 212, "Ring of Kalonia", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "M13"; + this.subtype.add("Equipment"); + + // Equipped creature has trample. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); + + // At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's green. + TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(Constants.Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1), Constants.TargetController.YOU, false); + ConditionalTriggeredAbility ability = new ConditionalTriggeredAbility(triggeredAbility, new EquippedMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's green"); + this.addAbility(ability); + + // Equip {1} + this.addAbility(new EquipAbility(Constants.Outcome.BoostCreature, new GenericManaCost(1))); + } + + public RingOfKalonia(final RingOfKalonia card) { + super(card); + } + + @Override + public RingOfKalonia copy() { + return new RingOfKalonia(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2013/RingOfThune.java b/Mage.Sets/src/mage/sets/magic2013/RingOfThune.java new file mode 100644 index 00000000000..810b4c06088 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2013/RingOfThune.java @@ -0,0 +1,85 @@ +/* + * 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.magic2013; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.EquippedMatchesFilterCondition; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author jeffwadsworth + */ +public class RingOfThune extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + static { + filter.getColor().setWhite(true); + filter.setUseColor(true); + } + + public RingOfThune(UUID ownerId) { + super(ownerId, 213, "Ring of Thune", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "M13"; + this.subtype.add("Equipment"); + + // Equipped creature has vigilance. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); + + // At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's white. + TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(Constants.Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1), Constants.TargetController.YOU, false); + ConditionalTriggeredAbility ability = new ConditionalTriggeredAbility(triggeredAbility, new EquippedMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's white"); + this.addAbility(ability); + + // Equip {1} + this.addAbility(new EquipAbility(Constants.Outcome.BoostCreature, new GenericManaCost(1))); + } + + public RingOfThune(final RingOfThune card) { + super(card); + } + + @Override + public RingOfThune copy() { + return new RingOfThune(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2013/RingOfValkas.java b/Mage.Sets/src/mage/sets/magic2013/RingOfValkas.java new file mode 100644 index 00000000000..92c259d099b --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2013/RingOfValkas.java @@ -0,0 +1,85 @@ +/* + * 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.magic2013; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.EquippedMatchesFilterCondition; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author jeffwadsworth + */ +public class RingOfValkas extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + static { + filter.getColor().setRed(true); + filter.setUseColor(true); + } + + public RingOfValkas(UUID ownerId) { + super(ownerId, 214, "Ring of Valkas", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "M13"; + this.subtype.add("Equipment"); + + // Equipped creature has haste. + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); + + // At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's red. + TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(Constants.Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1), Constants.TargetController.YOU, false); + ConditionalTriggeredAbility ability = new ConditionalTriggeredAbility(triggeredAbility, new EquippedMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's red"); + this.addAbility(ability); + + // Equip {1} + this.addAbility(new EquipAbility(Constants.Outcome.BoostCreature, new GenericManaCost(1))); + } + + public RingOfValkas(final RingOfValkas card) { + super(card); + } + + @Override + public RingOfValkas copy() { + return new RingOfValkas(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2013/RingOfXathrid.java b/Mage.Sets/src/mage/sets/magic2013/RingOfXathrid.java new file mode 100644 index 00000000000..e49c559d412 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2013/RingOfXathrid.java @@ -0,0 +1,84 @@ +/* + * 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.magic2013; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.condition.common.EquippedMatchesFilterCondition; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.RegenerateEquippedEffect; +import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author jeffwadsworth + */ +public class RingOfXathrid extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + static { + filter.getColor().setBlack(true); + filter.setUseColor(true); + } + + public RingOfXathrid(UUID ownerId) { + super(ownerId, 215, "Ring of Xathrid", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "M13"; + this.subtype.add("Equipment"); + + // {2}: Regenerate equipped creature. + this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new RegenerateEquippedEffect(), new GenericManaCost(2))); + + // At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's black. + TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(Constants.Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1), Constants.TargetController.YOU, false); + ConditionalTriggeredAbility ability = new ConditionalTriggeredAbility(triggeredAbility, new EquippedMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's black"); + this.addAbility(ability); + + // Equip {1} + this.addAbility(new EquipAbility(Constants.Outcome.BoostCreature, new GenericManaCost(1))); + } + + public RingOfXathrid(final RingOfXathrid card) { + super(card); + } + + @Override + public RingOfXathrid copy() { + return new RingOfXathrid(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/RegenerateEquippedEffect.java b/Mage/src/mage/abilities/effects/common/RegenerateEquippedEffect.java new file mode 100644 index 00000000000..bd9c27c1e4d --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/RegenerateEquippedEffect.java @@ -0,0 +1,90 @@ +/* + * 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.abilities.effects.common; + +import java.util.UUID; +import mage.Constants.Duration; +import mage.Constants.Outcome; +import mage.abilities.Ability; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; + +/** + * + * @author jeff + */ +public class RegenerateEquippedEffect extends ReplacementEffectImpl { + + public RegenerateEquippedEffect() { + super(Duration.EndOfTurn, Outcome.Regenerate); + staticText = "Regenerate equipped creature"; + } + + public RegenerateEquippedEffect(final RegenerateEquippedEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + //20110204 - 701.11 + Permanent permanent = game.getPermanent(source.getSourceId()); + Permanent equipped = game.getPermanent(permanent.getAttachedTo()); + if (permanent != null && equipped.regenerate(this.getId(), game)) { + this.used = true; + return true; + } + return false; + } + + @Override + public RegenerateEquippedEffect copy() { + return new RegenerateEquippedEffect(this); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return apply(game, source); + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + //20110204 - 701.11c - event.getAmount() is used to signal if regeneration is allowed + Permanent equipment = game.getPermanent(source.getSourceId()); + Permanent equipped = game.getPermanent(equipment.getAttachedTo()); + UUID equippedID = equipped.getId(); + if (event.getType() == EventType.DESTROY_PERMANENT && event.getAmount() == 0 && event.getTargetId().equals(equippedID) && !this.used) { + return true; + } + return false; + } + +} diff --git a/Mage/src/mage/abilities/effects/common/continious/GainAbilityAttachedEffect.java b/Mage/src/mage/abilities/effects/common/continious/GainAbilityAttachedEffect.java index f468aa3312d..66b89bdc298 100644 --- a/Mage/src/mage/abilities/effects/common/continious/GainAbilityAttachedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/GainAbilityAttachedEffect.java @@ -46,6 +46,14 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl