From 37ffeac23d42aaa7ee1d0bd33b922bfd5cd9fbde Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 9 Jul 2017 15:32:52 +0200 Subject: [PATCH] * Instill Energy - Fixed that the enchanted creature could not attack (but should be able) the turn it came into play. --- Mage.Sets/src/mage/cards/i/InstillEnergy.java | 10 +++------- Mage.Sets/src/mage/cards/u/UrilTheMiststalker.java | 12 ++++-------- .../main/java/mage/constants/AsThoughEffectType.java | 1 + .../main/java/mage/game/permanent/PermanentImpl.java | 2 +- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/Mage.Sets/src/mage/cards/i/InstillEnergy.java b/Mage.Sets/src/mage/cards/i/InstillEnergy.java index d89c08b54b7..cf96fb09ecf 100644 --- a/Mage.Sets/src/mage/cards/i/InstillEnergy.java +++ b/Mage.Sets/src/mage/cards/i/InstillEnergy.java @@ -36,12 +36,10 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.AsThoughEffectImpl; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.UntapEnchantedEffect; -import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.AsThoughEffectType; -import mage.constants.AttachmentType; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; @@ -58,7 +56,7 @@ import mage.target.common.TargetCreaturePermanent; public class InstillEnergy extends CardImpl { public InstillEnergy(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{G}"); this.subtype.add("Aura"); // Enchant creature @@ -68,9 +66,7 @@ public class InstillEnergy extends CardImpl { Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Enchanted creature can attack as though it had haste. - Ability asThough = new SimpleStaticAbility(Zone.BATTLEFIELD, new CanAttackAsThoughItHadHasteEnchantedEffect(Duration.WhileOnBattlefield)); - Ability haste = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(asThough, AttachmentType.AURA, Duration.WhileOnBattlefield, "Enchanted creature can attack as though it had haste.")); - this.addAbility(haste); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanAttackAsThoughItHadHasteEnchantedEffect(Duration.WhileOnBattlefield))); // {0}: Untap enchanted creature. Activate this ability only during your turn and only once each turn. this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new UntapEnchantedEffect(), new GenericManaCost(0), 1, MyTurnCondition.instance)); } @@ -88,7 +84,7 @@ public class InstillEnergy extends CardImpl { class CanAttackAsThoughItHadHasteEnchantedEffect extends AsThoughEffectImpl { public CanAttackAsThoughItHadHasteEnchantedEffect(Duration duration) { - super(AsThoughEffectType.ATTACK, duration, Outcome.Benefit); + super(AsThoughEffectType.ATTACK_AS_HASTE, duration, Outcome.Benefit); staticText = "Enchanted creature can attack as though it had haste"; } diff --git a/Mage.Sets/src/mage/cards/u/UrilTheMiststalker.java b/Mage.Sets/src/mage/cards/u/UrilTheMiststalker.java index 857c0aa7f9e..c056fb09433 100644 --- a/Mage.Sets/src/mage/cards/u/UrilTheMiststalker.java +++ b/Mage.Sets/src/mage/cards/u/UrilTheMiststalker.java @@ -27,6 +27,7 @@ */ package mage.cards.u; +import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.AuraAttachedCount; @@ -39,8 +40,6 @@ import mage.constants.Duration; import mage.constants.SuperType; import mage.constants.Zone; -import java.util.UUID; - /** * * @author jeffwadsworth @@ -48,23 +47,20 @@ import java.util.UUID; public class UrilTheMiststalker extends CardImpl { public UrilTheMiststalker(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{G}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{G}{W}"); addSuperType(SuperType.LEGENDARY); this.subtype.add("Beast"); - - - this.power = new MageInt(5); this.toughness = new MageInt(5); // Hexproof this.addAbility(HexproofAbility.getInstance()); - + // Uril, the Miststalker gets +2/+2 for each Aura attached to it. AuraAttachedCount count = new AuraAttachedCount(2); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(count, count, Duration.WhileOnBattlefield))); - + } public UrilTheMiststalker(final UrilTheMiststalker card) { diff --git a/Mage/src/main/java/mage/constants/AsThoughEffectType.java b/Mage/src/main/java/mage/constants/AsThoughEffectType.java index c15bd8b8301..af2e4bf30f6 100644 --- a/Mage/src/main/java/mage/constants/AsThoughEffectType.java +++ b/Mage/src/main/java/mage/constants/AsThoughEffectType.java @@ -7,6 +7,7 @@ package mage.constants; public enum AsThoughEffectType { ATTACK, + ATTACK_AS_HASTE, ACTIVATE_HASTE, BLOCK_TAPPED, BLOCK_SHADOW, diff --git a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java index 589038d04f0..6042e8e60f0 100644 --- a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java +++ b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java @@ -1037,7 +1037,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { if (tapped) { return false; } - if (hasSummoningSickness()) { + if (hasSummoningSickness() && !game.getContinuousEffects().asThough(this.objectId, AsThoughEffectType.ATTACK_AS_HASTE, this.getControllerId(), game)) { return false; } //20101001 - 508.1c