now we can use GainAbilityAttachedEffect with aura too. fixes Eldrazi Conscription

This commit is contained in:
Loki 2011-02-10 22:41:20 +02:00
parent 3521b7d89f
commit 44aefaf47a
12 changed files with 50 additions and 18 deletions

View file

@ -29,6 +29,8 @@
package mage.sets.alarareborn; package mage.sets.alarareborn;
import java.util.UUID; import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Outcome; import mage.Constants.Outcome;
import mage.Constants.Rarity; import mage.Constants.Rarity;
@ -54,8 +56,8 @@ public class BehemothSledge extends CardImpl<BehemothSledge> {
this.expansionSetCode = "ARB"; this.expansionSetCode = "ARB";
this.subtype.add("Equipment"); this.subtype.add("Equipment");
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3))); 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(LifelinkAbility.getInstance(), Constants.AttachmentType.EQUIPMENT)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance()))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), Constants.AttachmentType.EQUIPMENT)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2)));
} }

View file

@ -29,6 +29,8 @@
package mage.sets.magic2011; package mage.sets.magic2011;
import java.util.UUID; import java.util.UUID;
import mage.Constants.AttachmentType;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Outcome; import mage.Constants.Outcome;
import mage.Constants.Rarity; import mage.Constants.Rarity;
@ -56,10 +58,10 @@ public class SwordOfVengeance extends CardImpl<SwordOfVengeance> {
this.expansionSetCode = "M11"; this.expansionSetCode = "M11";
this.subtype.add("Equipment"); this.subtype.add("Equipment");
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3))); 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(FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance()))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.EQUIPMENT)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance()))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.EQUIPMENT)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance()))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 0))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 0)));
} }

View file

@ -36,8 +36,13 @@ import mage.Constants.Duration;
import mage.Constants.Rarity; import mage.Constants.Rarity;
import mage.Constants.Zone; import mage.Constants.Zone;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect; 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.EnchantAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -59,6 +64,10 @@ public class EldraziConscription extends CardImpl<EldraziConscription> {
this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature)); this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName()); Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability); 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) { public EldraziConscription (final EldraziConscription card) {

View file

@ -53,7 +53,7 @@ public class AccordersShield extends CardImpl<AccordersShield> {
this.expansionSetCode = "SOM"; this.expansionSetCode = "SOM";
this.subtype.add("Equipment"); this.subtype.add("Equipment");
this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(3))); 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))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(0, 3)));
} }

View file

@ -31,6 +31,7 @@ package mage.sets.scarsofmirrodin;
import java.util.UUID; import java.util.UUID;
import mage.Constants; import mage.Constants;
import mage.Constants.AttachmentType;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity; import mage.Constants.Rarity;
import mage.Constants.Zone; import mage.Constants.Zone;
@ -53,8 +54,8 @@ public class BladedPinions extends CardImpl<BladedPinions> {
this.expansionSetCode = "SOM"; this.expansionSetCode = "SOM";
this.subtype.add("Equipment"); this.subtype.add("Equipment");
this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(2))); 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(FlyingAbility.getInstance(), AttachmentType.EQUIPMENT)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance()))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT)));
} }
public BladedPinions (final BladedPinions card) { public BladedPinions (final BladedPinions card) {

View file

@ -53,7 +53,7 @@ public class StriderHarness extends CardImpl<StriderHarness> {
this.expansionSetCode = "SOM"; this.expansionSetCode = "SOM";
this.subtype.add("Equipment"); this.subtype.add("Equipment");
this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(1))); 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))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1)));
} }

View file

@ -76,7 +76,7 @@ public class SwordofBodyandMind extends CardImpl<SwordofBodyandMind> {
this.subtype.add("Equipment"); this.subtype.add("Equipment");
this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(2))); 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 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()); this.addAbility(new SwordofBodyandMindAbility());
} }

View file

@ -29,6 +29,8 @@
package mage.sets.tenth; package mage.sets.tenth;
import java.util.UUID; import java.util.UUID;
import mage.Constants.AttachmentType;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Outcome; import mage.Constants.Outcome;
import mage.Constants.Rarity; import mage.Constants.Rarity;
@ -53,8 +55,8 @@ public class WhispersilkCloak extends CardImpl<WhispersilkCloak> {
this.expansionSetCode = "10E"; this.expansionSetCode = "10E";
this.subtype.add("Equipment"); this.subtype.add("Equipment");
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2))); 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(UnblockableAbility.getInstance(), AttachmentType.EQUIPMENT)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ShroudAbility.getInstance()))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ShroudAbility.getInstance(), AttachmentType.EQUIPMENT)));
} }
protected WhispersilkCloak(WhispersilkCloak me) { protected WhispersilkCloak(WhispersilkCloak me) {

View file

@ -29,6 +29,8 @@
package mage.sets.worldwake; package mage.sets.worldwake;
import java.util.UUID; import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Outcome; import mage.Constants.Outcome;
import mage.Constants.Rarity; import mage.Constants.Rarity;
@ -52,8 +54,8 @@ public class BasiliskCollar extends CardImpl<BasiliskCollar> {
this.expansionSetCode = "WWK"; this.expansionSetCode = "WWK";
this.subtype.add("Equipment"); this.subtype.add("Equipment");
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2))); 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(LifelinkAbility.getInstance(), Constants.AttachmentType.EQUIPMENT)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(DeathtouchAbility.getInstance()))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(DeathtouchAbility.getInstance(), Constants.AttachmentType.EQUIPMENT)));
} }
public BasiliskCollar(final BasiliskCollar card) { public BasiliskCollar(final BasiliskCollar card) {

View file

@ -408,6 +408,11 @@ public final class Constants {
} }
} }
public enum AttachmentType {
EQUIPMENT,
AURA
}
public static final List<String> PlaneswalkerTypes = new ArrayList<String>() public static final List<String> PlaneswalkerTypes = new ArrayList<String>()
{{add("Ajani"); add("Bolas"); add("Chandra"); add("Elspeth");add("Garruk"); add("Jace"); add("Liliana"); add("Nissa"); add("Sarkhan"); add("Sorin"); add("Tezzeret");}}; {{add("Ajani"); add("Bolas"); add("Chandra"); add("Elspeth");add("Garruk"); add("Jace"); add("Liliana"); add("Nissa"); add("Sarkhan"); add("Sorin"); add("Tezzeret");}};

View file

@ -79,7 +79,7 @@ public class BoostEnchantedEffect extends ContinuousEffectImpl<BoostEnchantedEff
@Override @Override
public String getText(Ability source) { public String getText(Ability source) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("Enchanted creatures gets ").append(String.format("%1$+d/%2$+d", power, toughness)); sb.append("Enchanted creature gets ").append(String.format("%1$+d/%2$+d", power, toughness));
if (duration != Duration.WhileOnBattlefield) if (duration != Duration.WhileOnBattlefield)
sb.append(" ").append(duration.toString()); sb.append(" ").append(duration.toString());
return sb.toString(); return sb.toString();

View file

@ -28,6 +28,7 @@
package mage.abilities.effects.common.continious; package mage.abilities.effects.common.continious;
import mage.Constants.AttachmentType;
import mage.Constants.Duration; import mage.Constants.Duration;
import mage.Constants.Layer; import mage.Constants.Layer;
import mage.Constants.Outcome; import mage.Constants.Outcome;
@ -44,15 +45,18 @@ import mage.game.permanent.Permanent;
public class GainAbilityAttachedEffect extends ContinuousEffectImpl<GainAbilityAttachedEffect> { public class GainAbilityAttachedEffect extends ContinuousEffectImpl<GainAbilityAttachedEffect> {
protected Ability ability; 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); super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
this.ability = ability; this.ability = ability;
this.attachmentType = attachmentType;
} }
public GainAbilityAttachedEffect(final GainAbilityAttachedEffect effect) { public GainAbilityAttachedEffect(final GainAbilityAttachedEffect effect) {
super(effect); super(effect);
this.ability = effect.ability.copy(); this.ability = effect.ability.copy();
this.attachmentType = effect.attachmentType;
} }
@Override @Override
@ -73,7 +77,12 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl<GainAbilityA
@Override @Override
public String getText(Ability source) { public String getText(Ability source) {
return "Equipped creature gains " + ability.getRule(); String prefix = "";
if (attachmentType == AttachmentType.AURA)
prefix = "Enchanted";
else if (attachmentType == AttachmentType.EQUIPMENT)
prefix = "Equipped";
return prefix + " creature gains " + ability.getRule();
} }
} }