From 6ea6cc66566177ea0d25f8aa5c19e5c9d9f67c44 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Mon, 22 Jun 2015 20:08:31 +0300 Subject: [PATCH] Implement cards: Opal Archangel, Opal Caryatid, Opal Champion, Opal Gargoyle, and Opal Guardian --- .../mage/sets/timespiral/OpalGuardian.java | 95 +++++++++++++++++++ .../mage/sets/urzaslegacy/OpalChampion.java | 84 ++++++++++++++++ .../mage/sets/urzassaga/OpalArchangel.java | 86 +++++++++++++++++ .../src/mage/sets/urzassaga/OpalCaryatid.java | 82 ++++++++++++++++ .../src/mage/sets/urzassaga/OpalGargoyle.java | 84 ++++++++++++++++ .../common/SourceMatchesFilterCondition.java | 6 +- .../BecomesCreatureSourceEffect.java | 24 +++-- 7 files changed, 451 insertions(+), 10 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/timespiral/OpalGuardian.java create mode 100644 Mage.Sets/src/mage/sets/urzaslegacy/OpalChampion.java create mode 100644 Mage.Sets/src/mage/sets/urzassaga/OpalArchangel.java create mode 100644 Mage.Sets/src/mage/sets/urzassaga/OpalCaryatid.java create mode 100644 Mage.Sets/src/mage/sets/urzassaga/OpalGargoyle.java diff --git a/Mage.Sets/src/mage/sets/timespiral/OpalGuardian.java b/Mage.Sets/src/mage/sets/timespiral/OpalGuardian.java new file mode 100644 index 00000000000..04e6861f177 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/OpalGuardian.java @@ -0,0 +1,95 @@ +/* + * 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.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.SpellCastOpponentTriggeredAbility; +import mage.abilities.condition.common.SourceMatchesFilterCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureSpell; +import mage.filter.common.FilterEnchantmentPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.permanent.token.Token; + +/** + * + * @author LoneFox + + */ +public class OpalGuardian extends CardImpl { + + public OpalGuardian(UUID ownerId) { + super(ownerId, 30, "Opal Guardian", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{W}{W}{W}"); + this.expansionSetCode = "TSP"; + + // When an opponent casts a creature spell, if Opal Guardian is an enchantment, Opal Guardian becomes a 3/4 Gargoyle creature with flying and protection from red. + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalGuardianGargoyle(), "", Duration.WhileOnBattlefield, true), + new FilterCreatureSpell(), false); + this.addAbility(new ConditionalTriggeredAbility(ability, new SourceMatchesFilterCondition(new FilterEnchantmentPermanent()), + "When an opponent casts a creature spell, if {this} is an enchantment, {this} becomes a 3/4 Gargoyle creature with flying and protection from red.")); + } + + public OpalGuardian(final OpalGuardian card) { + super(card); + } + + @Override + public OpalGuardian copy() { + return new OpalGuardian(this); + } +} + +class OpalGuardianGargoyle extends Token { + + private static final FilterCard filter = new FilterCard("red"); + + static { + filter.add(new ColorPredicate(ObjectColor.RED)); + } + + public OpalGuardianGargoyle() { + super("Gargoyle", "a 3/4 Gargoyle creature with flying and protection from red"); + cardType.add(CardType.CREATURE); + subtype.add("Knight"); + power = new MageInt(3); + toughness = new MageInt(4); + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(new ProtectionAbility(filter)); + } +} diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/OpalChampion.java b/Mage.Sets/src/mage/sets/urzaslegacy/OpalChampion.java new file mode 100644 index 00000000000..a0975dbf769 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzaslegacy/OpalChampion.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.urzaslegacy; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.SpellCastOpponentTriggeredAbility; +import mage.abilities.condition.common.SourceMatchesFilterCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreatureSpell; +import mage.filter.common.FilterEnchantmentPermanent; +import mage.game.permanent.token.Token; + +/** + * + * @author LoneFox + + */ +public class OpalChampion extends CardImpl { + + public OpalChampion(UUID ownerId) { + super(ownerId, 16, "Opal Champion", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); + this.expansionSetCode = "ULG"; + + // When an opponent casts a creature spell, if Opal Champion is an enchantment, Opal Champion becomes a 3/3 Knight creature with first strike. + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalChampionKnight(), "", Duration.WhileOnBattlefield, true), + new FilterCreatureSpell(), false); + this.addAbility(new ConditionalTriggeredAbility(ability, new SourceMatchesFilterCondition(new FilterEnchantmentPermanent()), + "When an opponent casts a creature spell, if {this} is an enchantment, {this} becomes a 3/3 Knight creature with first strike.")); + } + + public OpalChampion(final OpalChampion card) { + super(card); + } + + @Override + public OpalChampion copy() { + return new OpalChampion(this); + } +} + +class OpalChampionKnight extends Token { + + public OpalChampionKnight() { + super("Knight", "a 3/3 Knight creature with first strike"); + cardType.add(CardType.CREATURE); + subtype.add("Knight"); + power = new MageInt(3); + toughness = new MageInt(3); + this.addAbility(FirstStrikeAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/OpalArchangel.java b/Mage.Sets/src/mage/sets/urzassaga/OpalArchangel.java new file mode 100644 index 00000000000..274081c672d --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/OpalArchangel.java @@ -0,0 +1,86 @@ +/* + * 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.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.SpellCastOpponentTriggeredAbility; +import mage.abilities.condition.common.SourceMatchesFilterCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreatureSpell; +import mage.filter.common.FilterEnchantmentPermanent; +import mage.game.permanent.token.Token; + +/** + * + * @author LoneFox + + */ +public class OpalArchangel extends CardImpl { + + public OpalArchangel(UUID ownerId) { + super(ownerId, 23, "Opal Archangel", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{W}"); + this.expansionSetCode = "USG"; + + // When an opponent casts a creature spell, if Opal Archangel is an enchantment, Opal Archangel becomes a 5/5 Angel creature with flying and vigilance. + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalArchangelToken(), "", Duration.WhileOnBattlefield, true), + new FilterCreatureSpell(), false); + this.addAbility(new ConditionalTriggeredAbility(ability, new SourceMatchesFilterCondition(new FilterEnchantmentPermanent()), + "When an opponent casts a creature spell, if {this} is an enchantment, {this} becomes a 5/5 Angel creature with flying and vigilance.")); + } + + public OpalArchangel(final OpalArchangel card) { + super(card); + } + + @Override + public OpalArchangel copy() { + return new OpalArchangel(this); + } +} + +class OpalArchangelToken extends Token { + + public OpalArchangelToken() { + super("Angel", "a 3/3 Angelt creature with flying and vigilance"); + cardType.add(CardType.CREATURE); + subtype.add("Angel"); + power = new MageInt(5); + toughness = new MageInt(5); + this.addAbility(FlyingAbility.getInstance()); + this.addAbility(VigilanceAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/OpalCaryatid.java b/Mage.Sets/src/mage/sets/urzassaga/OpalCaryatid.java new file mode 100644 index 00000000000..3981a15928c --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/OpalCaryatid.java @@ -0,0 +1,82 @@ +/* + * 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.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.SpellCastOpponentTriggeredAbility; +import mage.abilities.condition.common.SourceMatchesFilterCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreatureSpell; +import mage.filter.common.FilterEnchantmentPermanent; +import mage.game.permanent.token.Token; + +/** + * + * @author LoneFox + + */ +public class OpalCaryatid extends CardImpl { + + public OpalCaryatid(UUID ownerId) { + super(ownerId, 24, "Opal Caryatid", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); + this.expansionSetCode = "USG"; + + // When an opponent casts a creature spell, if Opal Caryatid is an enchantment, Opal Caryatid becomes a 2/2 Soldier creature. + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalCaryatidSoldier(), "", Duration.WhileOnBattlefield, true), + new FilterCreatureSpell(), false); + this.addAbility(new ConditionalTriggeredAbility(ability, new SourceMatchesFilterCondition(new FilterEnchantmentPermanent()), + "When an opponent casts a creature spell, if {this} is an enchantment, {this} becomes a 2/2 Soldier creature.")); + } + + public OpalCaryatid(final OpalCaryatid card) { + super(card); + } + + @Override + public OpalCaryatid copy() { + return new OpalCaryatid(this); + } +} + +class OpalCaryatidSoldier extends Token { + + public OpalCaryatidSoldier() { + super("Soldier", "a 2/2 Soldier creature"); + cardType.add(CardType.CREATURE); + subtype.add("Soldier"); + power = new MageInt(2); + toughness = new MageInt(2); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/OpalGargoyle.java b/Mage.Sets/src/mage/sets/urzassaga/OpalGargoyle.java new file mode 100644 index 00000000000..be650e80db5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/OpalGargoyle.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.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.SpellCastOpponentTriggeredAbility; +import mage.abilities.condition.common.SourceMatchesFilterCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreatureSpell; +import mage.filter.common.FilterEnchantmentPermanent; +import mage.game.permanent.token.Token; + +/** + * + * @author LoneFox + + */ +public class OpalGargoyle extends CardImpl { + + public OpalGargoyle(UUID ownerId) { + super(ownerId, 25, "Opal Gargoyle", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + this.expansionSetCode = "USG"; + + // When an opponent casts a creature spell, if Opal Gargoyle is an enchantment, Opal Gargoyle becomes a 2/2 Gargoyle creature with flying. + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalGargoyleToken(), "", Duration.WhileOnBattlefield, true), + new FilterCreatureSpell(), false); + this.addAbility(new ConditionalTriggeredAbility(ability, new SourceMatchesFilterCondition(new FilterEnchantmentPermanent()), + "When an opponent casts a creature spell, if {this} is an enchantment, {this} becomes a 2/2 Gargoyle creature with flying.")); + } + + public OpalGargoyle(final OpalGargoyle card) { + super(card); + } + + @Override + public OpalGargoyle copy() { + return new OpalGargoyle(this); + } +} + +class OpalGargoyleToken extends Token { + + public OpalGargoyleToken() { + super("Gargoyle", "a 2/2 Gargoyle creature with flying"); + cardType.add(CardType.CREATURE); + subtype.add("Knight"); + power = new MageInt(2); + toughness = new MageInt(2); + this.addAbility(FlyingAbility.getInstance()); + } +} diff --git a/Mage/src/mage/abilities/condition/common/SourceMatchesFilterCondition.java b/Mage/src/mage/abilities/condition/common/SourceMatchesFilterCondition.java index 7aeca178e79..8c2b39a8ad3 100644 --- a/Mage/src/mage/abilities/condition/common/SourceMatchesFilterCondition.java +++ b/Mage/src/mage/abilities/condition/common/SourceMatchesFilterCondition.java @@ -29,7 +29,7 @@ package mage.abilities.condition.common; import mage.abilities.Ability; import mage.abilities.condition.Condition; -import mage.filter.common.FilterCreaturePermanent; +import mage.filter.FilterPermanent; import mage.game.Game; import mage.game.permanent.Permanent; @@ -41,9 +41,9 @@ import mage.game.permanent.Permanent; */ public class SourceMatchesFilterCondition implements Condition { - private FilterCreaturePermanent filter; + private FilterPermanent filter; - public SourceMatchesFilterCondition(FilterCreaturePermanent filter) { + public SourceMatchesFilterCondition(FilterPermanent filter) { this.filter = filter; } diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java index 927f8974466..37d0e41ac46 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java @@ -1,16 +1,16 @@ /* * 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 @@ -20,7 +20,7 @@ * 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. @@ -49,25 +49,32 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements protected Token token; protected String type; + protected boolean losePreviousTypes; - public BecomesCreatureSourceEffect(Token token, String type, Duration duration) { + public BecomesCreatureSourceEffect(Token token, String type, Duration duration, boolean losePreviousTypes) { super(duration, Outcome.BecomeCreature); this.token = token; this.type = type; + this.losePreviousTypes = losePreviousTypes; setText(); } + public BecomesCreatureSourceEffect(Token token, String type, Duration duration) { + this(token, type, duration, false); + } + public BecomesCreatureSourceEffect(final BecomesCreatureSourceEffect effect) { super(effect); this.token = effect.token.copy(); this.type = effect.type; + this.losePreviousTypes = effect.losePreviousTypes; } @Override public BecomesCreatureSourceEffect copy() { return new BecomesCreatureSourceEffect(this); } - + @Override public void init(Ability source, Game game) { super.init(source, game); @@ -88,6 +95,9 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements switch (layer) { case TypeChangingEffects_4: if (sublayer == SubLayer.NA) { + if (losePreviousTypes) { + permanent.getCardType().clear(); + } if (token.getCardType().size() > 0) { for (CardType t : token.getCardType()) { if (!permanent.getCardType().contains(t)) {