From b4966f5e68c40c242259381ecc534b0fcd406d7a Mon Sep 17 00:00:00 2001 From: myersn024 Date: Thu, 26 Feb 2015 14:25:11 -0600 Subject: [PATCH 1/3] Implemented AuraThief.java --- .../src/mage/sets/urzasdestiny/AuraThief.java | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/AuraThief.java diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/AuraThief.java b/Mage.Sets/src/mage/sets/urzasdestiny/AuraThief.java new file mode 100644 index 0000000000..556fb43250 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/AuraThief.java @@ -0,0 +1,85 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.sets.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continious.GainControlTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author nick.myers + */ + +public class AuraThief extends CardImpl { + + public AuraThief(UUID ownerId) { + super(ownerId, 26, "Aura Thief", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Illusion"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Aura Thief dies, you gain control of all enchantments. You don't get + // to move Auras. + this.addAbility(new DiesTriggeredAbility(new AuraThiefDiesTriggeredEffect())); + } + + public AuraThief(final AuraThief card) { + super(card); + } + + @Override + public AuraThief copy() { + return new AuraThief(this); + } + +} + +class AuraThiefDiesTriggeredEffect extends OneShotEffect { + + public AuraThiefDiesTriggeredEffect() { + super(Outcome.Benefit); + this.staticText = "gain control of all enchantments"; + } + + public AuraThiefDiesTriggeredEffect(final AuraThiefDiesTriggeredEffect effect) { + super(effect); + } + + @Override + public AuraThiefDiesTriggeredEffect copy() { + return new AuraThiefDiesTriggeredEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + boolean ret = false; + ContinuousEffect gainControl = new GainControlTargetEffect(Duration.EndOfGame); + for(Permanent enchantment : game.getBattlefield().getAllActivePermanents(CardType.ENCHANTMENT)) { + gainControl.setTargetPointer(new FixedTarget(enchantment.getId())); + game.addEffect(gainControl, source); + ret = true; + } + return ret; + } +} From 4c2570574a4a8c2aec5426038ac823cda0a59965 Mon Sep 17 00:00:00 2001 From: nickmyers Date: Thu, 26 Feb 2015 18:07:15 -0600 Subject: [PATCH 2/3] Edited AuraThief.java based on suggestions from LevelX2 --- Mage.Sets/src/mage/sets/urzasdestiny/AuraThief.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/AuraThief.java b/Mage.Sets/src/mage/sets/urzasdestiny/AuraThief.java index 556fb43250..380d139410 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/AuraThief.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/AuraThief.java @@ -18,6 +18,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; +import mage.filter.common.FilterEnchantmentPermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -59,7 +60,7 @@ class AuraThiefDiesTriggeredEffect extends OneShotEffect { public AuraThiefDiesTriggeredEffect() { super(Outcome.Benefit); - this.staticText = "gain control of all enchantments"; + this.staticText = "gain control of all enchantments. (You don't get to move Auras.)"; } public AuraThiefDiesTriggeredEffect(final AuraThiefDiesTriggeredEffect effect) { @@ -74,8 +75,9 @@ class AuraThiefDiesTriggeredEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { boolean ret = false; - ContinuousEffect gainControl = new GainControlTargetEffect(Duration.EndOfGame); - for(Permanent enchantment : game.getBattlefield().getAllActivePermanents(CardType.ENCHANTMENT)) { + // ContinuousEffect gainControl = new GainControlTargetEffect(Duration.EndOfGame); + for(Permanent enchantment : game.getBattlefield().getActivePermanents(new FilterEnchantmentPermanent(), source.getControllerId(), source.getControllerId(), game)) { + ContinuousEffect gainControl = new GainControlTargetEffect(Duration.EndOfGame); gainControl.setTargetPointer(new FixedTarget(enchantment.getId())); game.addEffect(gainControl, source); ret = true; From af697616eccbf850668706c8c15d742807862b1a Mon Sep 17 00:00:00 2001 From: nickmyers Date: Thu, 26 Feb 2015 18:09:12 -0600 Subject: [PATCH 3/3] Removed commented code from AuraThief.java --- Mage.Sets/src/mage/sets/urzasdestiny/AuraThief.java | 1 - 1 file changed, 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/AuraThief.java b/Mage.Sets/src/mage/sets/urzasdestiny/AuraThief.java index 380d139410..6eec8702b0 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/AuraThief.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/AuraThief.java @@ -75,7 +75,6 @@ class AuraThiefDiesTriggeredEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { boolean ret = false; - // ContinuousEffect gainControl = new GainControlTargetEffect(Duration.EndOfGame); for(Permanent enchantment : game.getBattlefield().getActivePermanents(new FilterEnchantmentPermanent(), source.getControllerId(), source.getControllerId(), game)) { ContinuousEffect gainControl = new GainControlTargetEffect(Duration.EndOfGame); gainControl.setTargetPointer(new FixedTarget(enchantment.getId()));