From 44aefaf47a07ec50950d5f23e7222e1b562926f7 Mon Sep 17 00:00:00 2001 From: Loki Date: Thu, 10 Feb 2011 22:41:20 +0200 Subject: [PATCH] now we can use GainAbilityAttachedEffect with aura too. fixes Eldrazi Conscription --- .../src/mage/sets/alarareborn/BehemothSledge.java | 6 ++++-- .../src/mage/sets/magic2011/SwordOfVengeance.java | 10 ++++++---- .../sets/riseoftheeldrazi/EldraziConscription.java | 9 +++++++++ .../mage/sets/scarsofmirrodin/AccordersShield.java | 2 +- .../mage/sets/scarsofmirrodin/BladedPinions.java | 5 +++-- .../mage/sets/scarsofmirrodin/StriderHarness.java | 2 +- .../sets/scarsofmirrodin/SwordofBodyandMind.java | 2 +- Mage.Sets/src/mage/sets/tenth/WhispersilkCloak.java | 6 ++++-- .../src/mage/sets/worldwake/BasiliskCollar.java | 6 ++++-- Mage/src/mage/Constants.java | 5 +++++ .../common/continious/BoostEnchantedEffect.java | 2 +- .../continious/GainAbilityAttachedEffect.java | 13 +++++++++++-- 12 files changed, 50 insertions(+), 18 deletions(-) diff --git a/Mage.Sets/src/mage/sets/alarareborn/BehemothSledge.java b/Mage.Sets/src/mage/sets/alarareborn/BehemothSledge.java index 925f48b32d..dd20c1f3d3 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/BehemothSledge.java +++ b/Mage.Sets/src/mage/sets/alarareborn/BehemothSledge.java @@ -29,6 +29,8 @@ package mage.sets.alarareborn; import java.util.UUID; + +import mage.Constants; import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; @@ -54,8 +56,8 @@ public class BehemothSledge extends CardImpl { this.expansionSetCode = "ARB"; this.subtype.add("Equipment"); this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(LifelinkAbility.getInstance()))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance()))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2))); } diff --git a/Mage.Sets/src/mage/sets/magic2011/SwordOfVengeance.java b/Mage.Sets/src/mage/sets/magic2011/SwordOfVengeance.java index 4b7c67a6f2..236fff93db 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SwordOfVengeance.java +++ b/Mage.Sets/src/mage/sets/magic2011/SwordOfVengeance.java @@ -29,6 +29,8 @@ package mage.sets.magic2011; import java.util.UUID; + +import mage.Constants.AttachmentType; import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; @@ -56,10 +58,10 @@ public class SwordOfVengeance extends CardImpl { this.expansionSetCode = "M11"; this.subtype.add("Equipment"); this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance()))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance()))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance()))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance()))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 0))); } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EldraziConscription.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EldraziConscription.java index eeed7aade1..7e401e2c10 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EldraziConscription.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EldraziConscription.java @@ -36,8 +36,13 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continious.BoostEnchantedEffect; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.keyword.AnnihilatorAbility; import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -59,6 +64,10 @@ public class EldraziConscription extends CardImpl { this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); + + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(10, 10, Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), Constants.AttachmentType.AURA))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new AnnihilatorAbility(2), Constants.AttachmentType.AURA))); } public EldraziConscription (final EldraziConscription card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/AccordersShield.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/AccordersShield.java index 9e8c24fad0..49562b0d61 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/AccordersShield.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/AccordersShield.java @@ -53,7 +53,7 @@ public class AccordersShield extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Equipment"); this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(3))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance()))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(0, 3))); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/BladedPinions.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/BladedPinions.java index 0b1fa97b3a..dc5fe44112 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/BladedPinions.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/BladedPinions.java @@ -31,6 +31,7 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; import mage.Constants; +import mage.Constants.AttachmentType; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.Constants.Zone; @@ -53,8 +54,8 @@ public class BladedPinions extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Equipment"); this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(2))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance()))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance()))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT))); } public BladedPinions (final BladedPinions card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/StriderHarness.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/StriderHarness.java index 9d43d7bfdd..f558707d5d 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/StriderHarness.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/StriderHarness.java @@ -53,7 +53,7 @@ public class StriderHarness extends CardImpl { this.expansionSetCode = "SOM"; this.subtype.add("Equipment"); this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(1))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance()))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1))); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordofBodyandMind.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordofBodyandMind.java index e5059887ca..a2750f6b9c 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordofBodyandMind.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordofBodyandMind.java @@ -76,7 +76,7 @@ public class SwordofBodyandMind extends CardImpl { this.subtype.add("Equipment"); this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(2))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new ProtectionAbility(filter)))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new ProtectionAbility(filter), Constants.AttachmentType.EQUIPMENT))); this.addAbility(new SwordofBodyandMindAbility()); } diff --git a/Mage.Sets/src/mage/sets/tenth/WhispersilkCloak.java b/Mage.Sets/src/mage/sets/tenth/WhispersilkCloak.java index e654a07fd8..66814ea56a 100644 --- a/Mage.Sets/src/mage/sets/tenth/WhispersilkCloak.java +++ b/Mage.Sets/src/mage/sets/tenth/WhispersilkCloak.java @@ -29,6 +29,8 @@ package mage.sets.tenth; import java.util.UUID; + +import mage.Constants.AttachmentType; import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; @@ -53,8 +55,8 @@ public class WhispersilkCloak extends CardImpl { this.expansionSetCode = "10E"; this.subtype.add("Equipment"); this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(UnblockableAbility.getInstance()))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ShroudAbility.getInstance()))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(UnblockableAbility.getInstance(), AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ShroudAbility.getInstance(), AttachmentType.EQUIPMENT))); } protected WhispersilkCloak(WhispersilkCloak me) { diff --git a/Mage.Sets/src/mage/sets/worldwake/BasiliskCollar.java b/Mage.Sets/src/mage/sets/worldwake/BasiliskCollar.java index 4116f7e275..1d0fb71ad0 100644 --- a/Mage.Sets/src/mage/sets/worldwake/BasiliskCollar.java +++ b/Mage.Sets/src/mage/sets/worldwake/BasiliskCollar.java @@ -29,6 +29,8 @@ package mage.sets.worldwake; import java.util.UUID; + +import mage.Constants; import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; @@ -52,8 +54,8 @@ public class BasiliskCollar extends CardImpl { this.expansionSetCode = "WWK"; this.subtype.add("Equipment"); this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(LifelinkAbility.getInstance()))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(DeathtouchAbility.getInstance()))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(DeathtouchAbility.getInstance(), Constants.AttachmentType.EQUIPMENT))); } public BasiliskCollar(final BasiliskCollar card) { diff --git a/Mage/src/mage/Constants.java b/Mage/src/mage/Constants.java index d64dba26fc..4108dccf7b 100644 --- a/Mage/src/mage/Constants.java +++ b/Mage/src/mage/Constants.java @@ -408,6 +408,11 @@ public final class Constants { } } + public enum AttachmentType { + EQUIPMENT, + AURA + } + public static final List PlaneswalkerTypes = new ArrayList() {{add("Ajani"); add("Bolas"); add("Chandra"); add("Elspeth");add("Garruk"); add("Jace"); add("Liliana"); add("Nissa"); add("Sarkhan"); add("Sorin"); add("Tezzeret");}}; diff --git a/Mage/src/mage/abilities/effects/common/continious/BoostEnchantedEffect.java b/Mage/src/mage/abilities/effects/common/continious/BoostEnchantedEffect.java index 1687c81084..19507dfe0f 100644 --- a/Mage/src/mage/abilities/effects/common/continious/BoostEnchantedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/BoostEnchantedEffect.java @@ -79,7 +79,7 @@ public class BoostEnchantedEffect extends ContinuousEffectImpl { protected Ability ability; + protected AttachmentType attachmentType; - public GainAbilityAttachedEffect(Ability ability) { + public GainAbilityAttachedEffect(Ability ability, AttachmentType attachmentType) { super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); this.ability = ability; + this.attachmentType = attachmentType; } public GainAbilityAttachedEffect(final GainAbilityAttachedEffect effect) { super(effect); this.ability = effect.ability.copy(); + this.attachmentType = effect.attachmentType; } @Override @@ -73,7 +77,12 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl