From 133f9fbfbc37e591d3c6e6fb6bd93dc4960fbb34 Mon Sep 17 00:00:00 2001 From: North Date: Mon, 27 Aug 2012 23:09:38 +0300 Subject: [PATCH] [ROE] 5 cards --- .../mage/sets/riseoftheeldrazi/EchoMage.java | 140 ++++++++++++++++ .../riseoftheeldrazi/HedronFieldPurists.java | 152 ++++++++++++++++++ .../LordOfShatterskullPass.java | 121 ++++++++++++++ .../RenegadeDoppelganger.java | 147 +++++++++++++++++ .../sets/riseoftheeldrazi/UmbraMystic.java | 102 ++++++++++++ 5 files changed, 662 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/riseoftheeldrazi/EchoMage.java create mode 100644 Mage.Sets/src/mage/sets/riseoftheeldrazi/HedronFieldPurists.java create mode 100644 Mage.Sets/src/mage/sets/riseoftheeldrazi/LordOfShatterskullPass.java create mode 100644 Mage.Sets/src/mage/sets/riseoftheeldrazi/RenegadeDoppelganger.java create mode 100644 Mage.Sets/src/mage/sets/riseoftheeldrazi/UmbraMystic.java diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EchoMage.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EchoMage.java new file mode 100644 index 00000000000..0246c6e64ec --- /dev/null +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EchoMage.java @@ -0,0 +1,140 @@ +/* + * 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.riseoftheeldrazi; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Abilities; +import mage.abilities.AbilitiesImpl; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CopyTargetSpellEffect; +import mage.abilities.keyword.LevelUpAbility; +import mage.abilities.keyword.LevelerCardBuilder; +import mage.cards.CardImpl; +import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.target.TargetSpell; + +/** + * + * @author North + */ +public class EchoMage extends CardImpl { + + private final static FilterSpell filter = new FilterSpell("instant or sorcery spell"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); + } + + public EchoMage(UUID ownerId) { + super(ownerId, 64, "Echo Mage", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + + this.color.setBlue(true); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Level up {1}{U} + this.addAbility(new LevelUpAbility(new ManaCostsImpl("{1}{U}"))); + // LEVEL 2-3 + // 2/4 + // {U}{U}, {tap}: Copy target instant or sorcery spell. You may choose new targets for the copy. + Abilities abilities1 = new AbilitiesImpl(); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CopyTargetSpellEffect(), new ManaCostsImpl("{U}{U}")); + ability.addTarget(new TargetSpell(filter)); + abilities1.add(ability); + // LEVEL 4+ + // 2/5 + // {U}{U}, {tap}: Copy target instant or sorcery spell twice. You may choose new targets for the copies. + Abilities abilities2 = new AbilitiesImpl(); + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new EchoMageEffect(), new ManaCostsImpl("{U}{U}")); + ability.addTarget(new TargetSpell(filter)); + abilities2.add(ability); + + LevelerCardBuilder.construct(this, + new LevelerCardBuilder.LevelAbility(2, 3, abilities1, 2, 4), + new LevelerCardBuilder.LevelAbility(4, -1, abilities2, 2, 5)); + } + + public EchoMage(final EchoMage card) { + super(card); + } + + @Override + public EchoMage copy() { + return new EchoMage(this); + } +} + +class EchoMageEffect extends OneShotEffect { + + public EchoMageEffect() { + super(Outcome.Copy); + this.staticText = "Copy target instant or sorcery spell twice. You may choose new targets for the copies"; + } + + public EchoMageEffect(final EchoMageEffect effect) { + super(effect); + } + + @Override + public EchoMageEffect copy() { + return new EchoMageEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); + if (spell != null) { + for (int i = 0; i < 2; i++) { + Spell copy = spell.copySpell(); + copy.setControllerId(source.getControllerId()); + copy.setCopiedSpell(true); + game.getStack().push(copy); + copy.chooseNewTargets(game, source.getControllerId()); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/HedronFieldPurists.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/HedronFieldPurists.java new file mode 100644 index 00000000000..9ce2f0abea3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/HedronFieldPurists.java @@ -0,0 +1,152 @@ +/* + * 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.riseoftheeldrazi; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Abilities; +import mage.abilities.AbilitiesImpl; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.PreventionEffectImpl; +import mage.abilities.keyword.LevelUpAbility; +import mage.abilities.keyword.LevelerCardBuilder; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; + +/** + * + * @author North + */ +public class HedronFieldPurists extends CardImpl { + + public HedronFieldPurists(UUID ownerId) { + super(ownerId, 25, "Hedron-Field Purists", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + + this.color.setWhite(true); + this.power = new MageInt(0); + this.toughness = new MageInt(3); + + // Level up {2}{W} + this.addAbility(new LevelUpAbility(new ManaCostsImpl("{2}{W}"))); + // LEVEL 1-4 + // 1/4 + // If a source would deal damage to you or a creature you control, prevent 1 of that damage. + Abilities abilities1 = new AbilitiesImpl(); + abilities1.add(new SimpleStaticAbility(Zone.BATTLEFIELD, new HedronFieldPuristsEffect(1))); + // LEVEL 5+ + // 2/5 + // If a source would deal damage to you or a creature you control, prevent 2 of that damage. + Abilities abilities2 = new AbilitiesImpl(); + abilities2.add(new SimpleStaticAbility(Zone.BATTLEFIELD, new HedronFieldPuristsEffect(2))); + + LevelerCardBuilder.construct(this, + new LevelerCardBuilder.LevelAbility(1, 4, abilities1, 1, 4), + new LevelerCardBuilder.LevelAbility(5, -1, abilities2, 2, 5)); + } + + public HedronFieldPurists(final HedronFieldPurists card) { + super(card); + } + + @Override + public HedronFieldPurists copy() { + return new HedronFieldPurists(this); + } +} + +class HedronFieldPuristsEffect extends PreventionEffectImpl { + + private int amount; + + public HedronFieldPuristsEffect(int amount) { + super(Duration.WhileOnBattlefield); + this.amount = amount; + this.staticText = "If a source would deal damage to you or a creature you control, prevent " + amount + " of that damage"; + } + + public HedronFieldPuristsEffect(HedronFieldPuristsEffect effect) { + super(effect); + this.amount = effect.amount; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), 1, false); + if (!game.replaceEvent(preventEvent)) { + int damage = event.getAmount(); + if (damage >= this.amount) { + event.setAmount(damage - amount); + damage = amount; + this.used = true; + } else { + event.setAmount(0); + amount -= damage; + } + game.informPlayers(damage + " damage has been prevented."); + game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage)); + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER) + && event.getTargetId().equals(source.getControllerId())) { + return super.applies(event, source, game); + } + + if (event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE)) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) { + return super.applies(event, source, game); + } + } + return false; + } + + @Override + public HedronFieldPuristsEffect copy() { + return new HedronFieldPuristsEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LordOfShatterskullPass.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LordOfShatterskullPass.java new file mode 100644 index 00000000000..4294cf01c2f --- /dev/null +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LordOfShatterskullPass.java @@ -0,0 +1,121 @@ +/* + * 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.riseoftheeldrazi; + +import java.util.List; +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Abilities; +import mage.abilities.AbilitiesImpl; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.LevelUpAbility; +import mage.abilities.keyword.LevelerCardBuilder; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author North + */ +public class LordOfShatterskullPass extends CardImpl { + + public LordOfShatterskullPass(UUID ownerId) { + super(ownerId, 156, "Lord of Shatterskull Pass", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Minotaur"); + this.subtype.add("Shaman"); + + this.color.setRed(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Level up {1}{R} + this.addAbility(new LevelUpAbility(new ManaCostsImpl("{1}{R}"))); + // LEVEL 1-5 + // 6/6 + Abilities abilities1 = new AbilitiesImpl(); + // LEVEL 6+ + // 6/6 + // Whenever Lord of Shatterskull Pass attacks, it deals 6 damage to each creature defending player controls. + Abilities abilities2 = new AbilitiesImpl(); + abilities2.add(new AttacksTriggeredAbility(new LordOfShatterskullPassEffect(), false)); + + LevelerCardBuilder.construct(this, + new LevelerCardBuilder.LevelAbility(1, 5, abilities1, 6, 6), + new LevelerCardBuilder.LevelAbility(6, -1, abilities2, 6, 6)); + } + + public LordOfShatterskullPass(final LordOfShatterskullPass card) { + super(card); + } + + @Override + public LordOfShatterskullPass copy() { + return new LordOfShatterskullPass(this); + } +} + +class LordOfShatterskullPassEffect extends OneShotEffect { + + public LordOfShatterskullPassEffect() { + super(Outcome.Damage); + this.staticText = "it deals 6 damage to each creature defending player controls"; + } + + public LordOfShatterskullPassEffect(final LordOfShatterskullPassEffect effect) { + super(effect); + } + + @Override + public LordOfShatterskullPassEffect copy() { + return new LordOfShatterskullPassEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + UUID defenderId = game.getCombat().getDefendingPlayer(source.getSourceId()); + if (defenderId != null) { + FilterCreaturePermanent filter = new FilterCreaturePermanent(); + filter.add(new ControllerIdPredicate(defenderId)); + List permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game); + for (Permanent permanent : permanents) { + permanent.damage(6, source.getSourceId(), game, true, false); + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/RenegadeDoppelganger.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RenegadeDoppelganger.java new file mode 100644 index 00000000000..290a3a39460 --- /dev/null +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RenegadeDoppelganger.java @@ -0,0 +1,147 @@ +/* + * 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.riseoftheeldrazi; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Layer; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.SubLayer; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.Effect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; +import mage.util.CardUtil; + +/** + * + * @author North + */ +public class RenegadeDoppelganger extends CardImpl { + + public RenegadeDoppelganger(UUID ownerId) { + super(ownerId, 84, "Renegade Doppelganger", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Shapeshifter"); + + this.color.setBlue(true); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + // Whenever another creature enters the battlefield under your control, you may have Renegade Doppelganger become a copy of that creature until end of turn. + this.addAbility(new RenegadeDoppelgangerTriggeredAbility()); + } + + public RenegadeDoppelganger(final RenegadeDoppelganger card) { + super(card); + } + + @Override + public RenegadeDoppelganger copy() { + return new RenegadeDoppelganger(this); + } +} + +class RenegadeDoppelgangerTriggeredAbility extends TriggeredAbilityImpl { + + RenegadeDoppelgangerTriggeredAbility() { + super(Zone.BATTLEFIELD, new RenegadeDoppelgangerEffect(), true); + } + + RenegadeDoppelgangerTriggeredAbility(final RenegadeDoppelgangerTriggeredAbility ability) { + super(ability); + } + + @Override + public RenegadeDoppelgangerTriggeredAbility copy() { + return new RenegadeDoppelgangerTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.ZONE_CHANGE && !event.getTargetId().equals(this.getSourceId())) { + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getToZone() == Zone.BATTLEFIELD) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.getControllerId().equals(this.getControllerId())) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(permanent.getId())); + } + return true; + } + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever another creature enters the battlefield under your control, you may have {this} become a copy of that creature until end of turn."; + } +} + +class RenegadeDoppelgangerEffect extends ContinuousEffectImpl { + + RenegadeDoppelgangerEffect() { + super(Duration.EndOfTurn, Layer.CopyEffects_1, SubLayer.NA, Outcome.Copy); + } + + RenegadeDoppelgangerEffect(final RenegadeDoppelgangerEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Card card = game.getCard(targetPointer.getFirst(game, source)); + Permanent permanent = game.getPermanent(source.getSourceId()); + + if (card == null || permanent == null) { + return false; + } + + CardUtil.copyTo(permanent).from(card, game); + + return true; + } + + @Override + public RenegadeDoppelgangerEffect copy() { + return new RenegadeDoppelgangerEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/UmbraMystic.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/UmbraMystic.java new file mode 100644 index 00000000000..edceefc2614 --- /dev/null +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/UmbraMystic.java @@ -0,0 +1,102 @@ +/* + * 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.riseoftheeldrazi; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continious.GainAbilityAllEffect; +import mage.abilities.keyword.TotemArmorAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterEnchantment; +import mage.filter.predicate.ObjectPlayer; +import mage.filter.predicate.ObjectPlayerPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author North + */ +public class UmbraMystic extends CardImpl { + + private static final FilterEnchantment filter = new FilterEnchantment("Auras attached to permanents you control"); + + static { + filter.add(new SubtypePredicate("Aura")); + } + + public UmbraMystic(UUID ownerId) { + super(ownerId, 52, "Umbra Mystic", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "ROE"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Auras attached to permanents you control have totem armor. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(new TotemArmorAbility(), Duration.WhileOnBattlefield, filter, false))); + } + + public UmbraMystic(final UmbraMystic card) { + super(card); + } + + @Override + public UmbraMystic copy() { + return new UmbraMystic(this); + } +} + +class UmbraMysticPredicate implements ObjectPlayerPredicate> { + + @Override + public boolean apply(ObjectPlayer input, Game game) { + Permanent attachement = input.getObject(); + if (attachement != null) { + Permanent permanent = game.getPermanent(attachement.getAttachedTo()); + if (permanent != null && permanent.getControllerId().equals(input.getPlayerId())) { + return true; + } + } + + return false; + } + + @Override + public String toString() { + return "Attached to permanents you control"; + } +}