diff --git a/Mage.Sets/src/mage/sets/mirrodin/GolemSkinGauntlets.java b/Mage.Sets/src/mage/sets/mirrodin/GolemSkinGauntlets.java index 9c8189886f..307b15a0e1 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/GolemSkinGauntlets.java +++ b/Mage.Sets/src/mage/sets/mirrodin/GolemSkinGauntlets.java @@ -27,23 +27,19 @@ */ package mage.sets.mirrodin; -import java.util.List; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.Constants.Zone; -import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.EquipmentAttachedCount; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.continious.BoostEquippedEffect; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; /** * @@ -68,39 +64,4 @@ public class GolemSkinGauntlets extends CardImpl { public GolemSkinGauntlets copy() { return new GolemSkinGauntlets(this); } - - private class EquipmentAttachedCount implements DynamicValue { - - @Override - public int calculate(Game game, Ability source) { - int count = 0; - Permanent p = game.getPermanent(source.getSourceId()); - if (p != null) { - List attachments = p.getAttachments(); - for (UUID attachmentId : attachments) { - Permanent attached = game.getPermanent(attachmentId); - if (attached != null && attached.getSubtype().contains("Equipment")) { - count++; - } - } - - } - return count; - } - - @Override - public DynamicValue clone() { - return new EquipmentAttachedCount(); - } - - @Override - public String toString() { - return "1"; - } - - @Override - public String getMessage() { - return "Equipment attached to it"; - } - } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/LoxodonPunisher.java b/Mage.Sets/src/mage/sets/mirrodin/LoxodonPunisher.java index 4c4641463b..ced5145656 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/LoxodonPunisher.java +++ b/Mage.Sets/src/mage/sets/mirrodin/LoxodonPunisher.java @@ -27,20 +27,16 @@ */ package mage.sets.mirrodin; -import java.util.List; 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.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.EquipmentAttachedCount; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; /** * @@ -58,7 +54,7 @@ public class LoxodonPunisher extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - EquipmentAttachedCount amount = new EquipmentAttachedCount(); + EquipmentAttachedCount amount = new EquipmentAttachedCount(2); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(amount, amount, Duration.WhileOnBattlefield))); } @@ -70,39 +66,4 @@ public class LoxodonPunisher extends CardImpl { public LoxodonPunisher copy() { return new LoxodonPunisher(this); } - - private class EquipmentAttachedCount implements DynamicValue { - - @Override - public int calculate(Game game, Ability source) { - int count = 0; - Permanent p = game.getPermanent(source.getSourceId()); - if (p != null) { - List attachments = p.getAttachments(); - for (UUID attachmentId : attachments) { - Permanent attached = game.getPermanent(attachmentId); - if (attached != null && attached.getSubtype().contains("Equipment")) { - count++; - } - } - - } - return 2 * count; - } - - @Override - public DynamicValue clone() { - return new EquipmentAttachedCount(); - } - - @Override - public String toString() { - return "2"; - } - - @Override - public String getMessage() { - return "Equipment attached to it"; - } - } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/MyrAdapter.java b/Mage.Sets/src/mage/sets/mirrodin/MyrAdapter.java index 908e819521..bceac09468 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/MyrAdapter.java +++ b/Mage.Sets/src/mage/sets/mirrodin/MyrAdapter.java @@ -27,20 +27,16 @@ */ package mage.sets.mirrodin; -import java.util.List; 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.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.EquipmentAttachedCount; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; /** * @@ -68,39 +64,4 @@ public class MyrAdapter extends CardImpl { public MyrAdapter copy() { return new MyrAdapter(this); } - - private class EquipmentAttachedCount implements DynamicValue { - - @Override - public int calculate(Game game, Ability source) { - int count = 0; - Permanent p = game.getPermanent(source.getSourceId()); - if (p != null) { - List attachments = p.getAttachments(); - for (UUID attachmentId : attachments) { - Permanent attached = game.getPermanent(attachmentId); - if (attached != null && attached.getSubtype().contains("Equipment")) { - count++; - } - } - - } - return count; - } - - @Override - public DynamicValue clone() { - return new EquipmentAttachedCount(); - } - - @Override - public String toString() { - return "1"; - } - - @Override - public String getMessage() { - return "Equipment attached to it"; - } - } } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/CreepingCorrosion.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/CreepingCorrosion.java index 88ebca1bc1..2690743940 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/CreepingCorrosion.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/CreepingCorrosion.java @@ -31,7 +31,6 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.abilities.Ability; import mage.abilities.effects.common.DestroyAllEffect; import mage.cards.CardImpl; import mage.filter.common.FilterArtifactPermanent; diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/FangrenMarauder.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/FangrenMarauder.java index 8596e4a588..8ae18688ec 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/FangrenMarauder.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/FangrenMarauder.java @@ -30,10 +30,15 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; -import mage.abilities.common.ArtifactIntoGraveFromBattlefieldTriggeredAbility; +import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.events.ZoneChangeEvent; /** * @@ -50,7 +55,7 @@ public class FangrenMarauder extends CardImpl { this.power = new MageInt(5); this.toughness = new MageInt(5); - this.addAbility(new ArtifactIntoGraveFromBattlefieldTriggeredAbility(new GainLifeEffect(5), true)); + this.addAbility(new FangrenMarauderTriggeredAbility()); } public FangrenMarauder(final FangrenMarauder card) { @@ -61,4 +66,38 @@ public class FangrenMarauder extends CardImpl { public FangrenMarauder copy() { return new FangrenMarauder(this); } -} \ No newline at end of file +} + +class FangrenMarauderTriggeredAbility extends TriggeredAbilityImpl { + + public FangrenMarauderTriggeredAbility() { + super(Zone.BATTLEFIELD, new GainLifeEffect(5), true); + } + + public FangrenMarauderTriggeredAbility(final FangrenMarauderTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ZONE_CHANGE) { + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getFromZone() == Zone.BATTLEFIELD + && zEvent.getToZone() == Zone.GRAVEYARD + && zEvent.getTarget().getCardType().contains(CardType.ARTIFACT)) { + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever an artifact is put into a graveyard from the battlefield, you may gain 5 life."; + } + + @Override + public FangrenMarauderTriggeredAbility copy() { + return new FangrenMarauderTriggeredAbility(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianCrusader.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianCrusader.java index 492ec195f1..869f786052 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianCrusader.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianCrusader.java @@ -30,16 +30,12 @@ package mage.sets.mirrodinbesieged; 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.keyword.FirstStrikeAbility; import mage.abilities.keyword.InfectAbility; import mage.abilities.keyword.ProtectionAbility; -import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; /** @@ -48,17 +44,15 @@ import mage.filter.FilterCard; */ public class PhyrexianCrusader extends CardImpl { - private static FilterCard filter = new FilterCard("Red"); - private static FilterCard filter2 = new FilterCard("White"); + private static final FilterCard filter = new FilterCard("Red"); + private static final FilterCard filter2 = new FilterCard("White"); static { filter.setUseColor(true); filter.getColor().setRed(true); - filter.setScopeColor(ComparisonScope.Any); filter2.setUseColor(true); filter2.getColor().setWhite(true); - filter2.setScopeColor(ComparisonScope.Any); } public PhyrexianCrusader (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianVatmother.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianVatmother.java index 176ee7c534..34ba1d4768 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianVatmother.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianVatmother.java @@ -57,7 +57,7 @@ public class PhyrexianVatmother extends CardImpl { this.power = new MageInt(4); this.toughness = new MageInt(5); this.addAbility(InfectAbility.getInstance()); - this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new PoisonControllerEffect(1))); + this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new PoisonControllerEffect())); } public PhyrexianVatmother (final PhyrexianVatmother card) { @@ -73,18 +73,14 @@ public class PhyrexianVatmother extends CardImpl { class PoisonControllerEffect extends OneShotEffect { - protected int amount; - - public PoisonControllerEffect(int amount) { + public PoisonControllerEffect() { super(Outcome.Damage); - this.amount = amount; - staticText = "you get " + amount + " poison counter(s)"; + staticText = "you get a poison counter"; } public PoisonControllerEffect(final PoisonControllerEffect effect) { super(effect); - this.amount = effect.amount; } @Override @@ -96,7 +92,7 @@ class PoisonControllerEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - player.getCounters().addCounter(CounterType.POISON.createInstance(amount)); + player.getCounters().addCounter(CounterType.POISON.createInstance()); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PistonSledge.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PistonSledge.java index 4524847b5b..5f8ecc1bd4 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/PistonSledge.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PistonSledge.java @@ -38,7 +38,6 @@ import mage.Constants.Zone; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.costs.AlternativeCost; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continious.BoostEquippedEffect; @@ -50,21 +49,22 @@ import mage.target.common.TargetControlledPermanent; /** * - * @author Viserion + * @author Viserion, North */ public class PistonSledge extends CardImpl { + private static FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); public PistonSledge (UUID ownerId) { super(ownerId, 124, "Piston Sledge", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); this.expansionSetCode = "MBS"; this.subtype.add("Equipment"); - this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new PistonSledgeEquipCost())); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(3, 1))); - Ability ability = new EntersBattlefieldTriggeredAbility(new PistonSledgeEffect(Constants.Outcome.AddAbility), false); + Ability ability = new EntersBattlefieldTriggeredAbility(new AttachEffect(Outcome.BoostCreature, "attach it to target creature you control"), false); ability.addTarget(new TargetControlledCreaturePermanent()); this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(3, 1))); + this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new SacrificeTargetCost(new TargetControlledPermanent(filter)))); } public PistonSledge (final PistonSledge card) { @@ -76,43 +76,3 @@ public class PistonSledge extends CardImpl { return new PistonSledge(this); } } - -class PistonSledgeEquipCost extends AlternativeCost { - private static FilterControlledPermanent filter = new FilterControlledPermanent("artifact"); - - static { - filter.getCardType().add(CardType.ARTIFACT); - } - - public PistonSledgeEquipCost() { - super("sacrifice an artifact"); - this.add(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, filter, false))); - } - - public PistonSledgeEquipCost(final PistonSledgeEquipCost cost) { - super(cost); - } - - @Override - public PistonSledgeEquipCost copy() { - return new PistonSledgeEquipCost(this); - } - - @Override - public String getText() { - return " sacrifice an artifact"; - } - -} - -class PistonSledgeEffect extends AttachEffect{ - public PistonSledgeEffect(Outcome outcome) { - super(outcome); - staticText = "attach it to target creature you control"; - } - - public PistonSledgeEffect(final AttachEffect effect) { - super(effect); - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PistusStrike.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PistusStrike.java index 5248a5ee37..57d84f71d9 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/PistusStrike.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PistusStrike.java @@ -51,7 +51,7 @@ import mage.target.common.TargetCreaturePermanent; */ public class PistusStrike extends CardImpl { - private static FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); static { filter.getAbilities().add(FlyingAbility.getInstance()); @@ -62,10 +62,9 @@ public class PistusStrike extends CardImpl { this.expansionSetCode = "MBS"; this.color.setGreen(true); - TargetCreaturePermanent target1 = new TargetCreaturePermanent(filter); - this.getSpellAbility().addTarget(target1); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); this.getSpellAbility().addEffect(new DestroyTargetEffect()); - this.getSpellAbility().addEffect(new PoisonControllerTargetCreatureEffect(1)); + this.getSpellAbility().addEffect(new PoisonControllerTargetCreatureEffect()); } public PistusStrike(final PistusStrike card) { @@ -80,17 +79,13 @@ public class PistusStrike extends CardImpl { class PoisonControllerTargetCreatureEffect extends OneShotEffect { - protected int amount; - - public PoisonControllerTargetCreatureEffect(int amount) { + public PoisonControllerTargetCreatureEffect() { super(Outcome.Damage); - this.amount = amount; - setText(); + staticText = "Its controller gets a poison counter"; } public PoisonControllerTargetCreatureEffect(final PoisonControllerTargetCreatureEffect effect) { super(effect); - this.amount = effect.amount; } @Override @@ -107,17 +102,9 @@ class PoisonControllerTargetCreatureEffect extends OneShotEffect { - private static FilterCard filter = new FilterCard("green and from black"); + private static final FilterCard filter = new FilterCard("green and from black"); static { filter.setUseColor(true); filter.getColor().setBlack(true); filter.getColor().setGreen(true); - filter.setScopeColor(Filter.ComparisonScope.Any); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GoblinGaveleer.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GoblinGaveleer.java index a91e352aee..d0227d7b76 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GoblinGaveleer.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GoblinGaveleer.java @@ -27,21 +27,17 @@ */ package mage.sets.scarsofmirrodin; -import java.util.List; 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.Ability; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.EquipmentAttachedCount; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; /** * @@ -59,7 +55,7 @@ public class GoblinGaveleer extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(new EquipmentAttachedCount(), + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(new EquipmentAttachedCount(2), new StaticValue(0), Duration.WhileOnBattlefield))); } @@ -71,39 +67,4 @@ public class GoblinGaveleer extends CardImpl { public GoblinGaveleer copy() { return new GoblinGaveleer(this); } - - private class EquipmentAttachedCount implements DynamicValue { - - @Override - public int calculate(Game game, Ability source) { - int count = 0; - Permanent p = game.getPermanent(source.getSourceId()); - if (p != null) { - List attachments = p.getAttachments(); - for (UUID attachmentId : attachments) { - Permanent attached = game.getPermanent(attachmentId); - if (attached != null && attached.getSubtype().contains("Equipment")) { - count++; - } - } - - } - return 2 * count; - } - - @Override - public DynamicValue clone() { - return new EquipmentAttachedCount(); - } - - @Override - public String toString() { - return "2"; - } - - @Override - public String getMessage() { - return "Equipment attached to it"; - } - } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/KembaKhaRegent.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/KembaKhaRegent.java index cdc67d35a1..50b444631c 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/KembaKhaRegent.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/KembaKhaRegent.java @@ -25,24 +25,19 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; -import java.util.List; import java.util.UUID; -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.TargetController; import mage.MageInt; import mage.ObjectColor; -import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.EquipmentAttachedCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; /** @@ -51,22 +46,22 @@ import mage.game.permanent.token.Token; */ public class KembaKhaRegent extends CardImpl { - public KembaKhaRegent (UUID ownerId) { + public KembaKhaRegent(UUID ownerId) { super(ownerId, 12, "Kemba, Kha Regent", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); this.expansionSetCode = "SOM"; this.supertype.add("Legendary"); this.subtype.add("Cat"); this.subtype.add("Cleric"); - this.color.setWhite(true); + this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(4); this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new CatToken(), new EquipmentAttachedCount()), - Constants.TargetController.YOU, false)); + TargetController.YOU, false)); } - public KembaKhaRegent (final KembaKhaRegent card) { + public KembaKhaRegent(final KembaKhaRegent card) { super(card); } @@ -74,50 +69,16 @@ public class KembaKhaRegent extends CardImpl { public KembaKhaRegent copy() { return new KembaKhaRegent(this); } - - private class EquipmentAttachedCount implements DynamicValue { - - @Override - public int calculate(Game game, Ability source) { - int count = 0; - Permanent p = game.getPermanent(source.getSourceId()); - if (p != null) { - List attachments = p.getAttachments(); - for (UUID attachmentId : attachments) { - Permanent attached = game.getPermanent(attachmentId); - if (attached != null && attached.getSubtype().contains("Equipment")) { - count++; - } - } - - } - return count; - } - - @Override - public DynamicValue clone() { - return new EquipmentAttachedCount(); - } - - @Override - public String toString() { - return "1"; - } - - @Override - public String getMessage() { - return "Equipment attached to {this}"; - } - } } class CatToken extends Token { + public CatToken() { super("Cat", "a 2/2 white Cat creature token"); cardType.add(CardType.CREATURE); - color = ObjectColor.WHITE; - subtype.add("Cat"); - power = new MageInt(2); - toughness = new MageInt(2); + color = ObjectColor.WHITE; + subtype.add("Cat"); + power = new MageInt(2); + toughness = new MageInt(2); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MolderBeast.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MolderBeast.java index f6e9fa7d75..d278d65412 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MolderBeast.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MolderBeast.java @@ -25,40 +25,43 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; +import java.util.UUID; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; -import mage.abilities.common.ArtifactIntoGraveFromBattlefieldTriggeredAbility; +import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; - -import java.util.UUID; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.events.ZoneChangeEvent; /** * - * @author Loki + * @author Loki, North */ public class MolderBeast extends CardImpl { - public MolderBeast (UUID ownerId) { + public MolderBeast(UUID ownerId) { super(ownerId, 125, "Molder Beast", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{G}"); this.expansionSetCode = "SOM"; this.subtype.add("Beast"); - - this.color.setGreen(true); + + this.color.setGreen(true); this.power = new MageInt(5); this.toughness = new MageInt(3); - + this.addAbility(TrampleAbility.getInstance()); - this.addAbility(new ArtifactIntoGraveFromBattlefieldTriggeredAbility(new BoostSourceEffect(2, 0, Constants.Duration.EndOfTurn), false)); + this.addAbility(new MolderBeastTriggeredAbility()); } - public MolderBeast (final MolderBeast card) { + public MolderBeast(final MolderBeast card) { super(card); } @@ -66,5 +69,38 @@ public class MolderBeast extends CardImpl { public MolderBeast copy() { return new MolderBeast(this); } +} +class MolderBeastTriggeredAbility extends TriggeredAbilityImpl { + + public MolderBeastTriggeredAbility() { + super(Zone.BATTLEFIELD, new BoostSourceEffect(2, 0, Constants.Duration.EndOfTurn), false); + } + + public MolderBeastTriggeredAbility(final MolderBeastTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ZONE_CHANGE) { + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getFromZone() == Zone.BATTLEFIELD + && zEvent.getToZone() == Zone.GRAVEYARD + && zEvent.getTarget().getCardType().contains(CardType.ARTIFACT)) { + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever an artifact is put into a graveyard from the battlefield, {this} gets +2/+0 until end of turn."; + } + + @Override + public MolderBeastTriggeredAbility copy() { + return new MolderBeastTriggeredAbility(this); + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/zendikar/KhalniHeartExpedition.java b/Mage.Sets/src/mage/sets/zendikar/KhalniHeartExpedition.java index 10daedd42d..faa3d8d0f4 100644 --- a/Mage.Sets/src/mage/sets/zendikar/KhalniHeartExpedition.java +++ b/Mage.Sets/src/mage/sets/zendikar/KhalniHeartExpedition.java @@ -33,13 +33,10 @@ import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.Constants.Zone; -import mage.abilities.ActivatedAbilityImpl; import mage.abilities.common.LandfallAbility; -import mage.abilities.costs.Costs; -import mage.abilities.costs.CostsImpl; +import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.RemoveCountersSourceCost; import mage.abilities.costs.common.SacrificeSourceCost; -import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; @@ -60,7 +57,12 @@ public class KhalniHeartExpedition extends CardImpl { this.color.setGreen(true); this.addAbility(new LandfallAbility(new AddCountersSourceEffect(new QuestCounter()), true)); - this.addAbility(new KhalniHeartExpeditionAbility()); + TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard()); + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new SearchLibraryPutInPlayEffect(target, true, Outcome.PutLandInPlay), + new RemoveCountersSourceCost(CounterType.QUEST.createInstance(3))); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); } public KhalniHeartExpedition(final KhalniHeartExpedition card) { @@ -72,32 +74,3 @@ public class KhalniHeartExpedition extends CardImpl { return new KhalniHeartExpedition(this); } } - -class KhalniHeartExpeditionAbility extends ActivatedAbilityImpl { - - public KhalniHeartExpeditionAbility() { - super(Zone.BATTLEFIELD, null); - - Costs additionalCosts = new CostsImpl(); - additionalCosts.add(new RemoveCountersSourceCost(CounterType.QUEST.createInstance(3))); - additionalCosts.add(new SacrificeSourceCost()); - costs.add(additionalCosts); - TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard()); - addEffect(new SearchLibraryPutInPlayEffect(target, true, Outcome.PutLandInPlay)); - } - - public KhalniHeartExpeditionAbility(final KhalniHeartExpeditionAbility ability) { - super(ability); - } - - @Override - public KhalniHeartExpeditionAbility copy() { - return new KhalniHeartExpeditionAbility(this); - } - - @Override - public String getRule() { - return "Remove three quest counters from {this} and sacrifice it: Search your library for up to two basic land cards, put them onto the battlefield tapped, then shuffle your library."; - } - -} diff --git a/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java b/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java index d3109b3d65..8119e2d07c 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java +++ b/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java @@ -45,7 +45,6 @@ import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.common.TargetCreatureOrPlayer; -import mage.watchers.WatcherImpl; /** * @@ -53,7 +52,7 @@ import mage.watchers.WatcherImpl; */ public class ValakutTheMoltenPinnacle extends CardImpl { - static FilterLandPermanent filter = new FilterLandPermanent("Mountain"); + static final FilterLandPermanent filter = new FilterLandPermanent("Mountain"); static { filter.getSubtype().add("Mountain"); diff --git a/Mage/src/mage/abilities/common/ArtifactIntoGraveFromBattlefieldTriggeredAbility.java b/Mage/src/mage/abilities/common/ArtifactIntoGraveFromBattlefieldTriggeredAbility.java deleted file mode 100644 index ba82533510..0000000000 --- a/Mage/src/mage/abilities/common/ArtifactIntoGraveFromBattlefieldTriggeredAbility.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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.abilities.common; - -import mage.Constants; -import mage.Constants.Zone; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.effects.Effect; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.events.ZoneChangeEvent; - -/** - * - * @author North - */ -public class ArtifactIntoGraveFromBattlefieldTriggeredAbility extends TriggeredAbilityImpl { - - public ArtifactIntoGraveFromBattlefieldTriggeredAbility(Effect effect, boolean optional) { - super(Zone.BATTLEFIELD, effect, optional); - } - - public ArtifactIntoGraveFromBattlefieldTriggeredAbility(final ArtifactIntoGraveFromBattlefieldTriggeredAbility ability) { - super(ability); - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ZONE_CHANGE) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getFromZone() == Zone.BATTLEFIELD - && zEvent.getToZone() == Zone.GRAVEYARD - && zEvent.getTarget().getCardType().contains(Constants.CardType.ARTIFACT)) { - return true; - } - } - return false; - } - - @Override - public String getRule() { - return "Whenever an artifact is put into a graveyard from the battlefield, " + super.getRule(); - } - - @Override - public ArtifactIntoGraveFromBattlefieldTriggeredAbility copy() { - return new ArtifactIntoGraveFromBattlefieldTriggeredAbility(this); - } -} \ No newline at end of file diff --git a/Mage/src/mage/abilities/keyword/EquipAbility.java b/Mage/src/mage/abilities/keyword/EquipAbility.java index 0dcc47dbfa..eec54b66fe 100644 --- a/Mage/src/mage/abilities/keyword/EquipAbility.java +++ b/Mage/src/mage/abilities/keyword/EquipAbility.java @@ -32,7 +32,6 @@ import mage.Constants.Outcome; import mage.Constants.TimingRule; import mage.Constants.Zone; import mage.abilities.ActivatedAbilityImpl; -import mage.abilities.Mode; import mage.abilities.costs.Cost; import mage.abilities.effects.common.AttachEffect; import mage.target.common.TargetControlledCreaturePermanent; diff --git a/Mage/src/mage/game/permanent/PermanentCard.java b/Mage/src/mage/game/permanent/PermanentCard.java index 50f65e7289..d5638d2d84 100644 --- a/Mage/src/mage/game/permanent/PermanentCard.java +++ b/Mage/src/mage/game/permanent/PermanentCard.java @@ -31,9 +31,7 @@ package mage.game.permanent; import java.util.ArrayList; import java.util.List; import java.util.UUID; -import mage.Constants.CardType; import mage.Constants.Zone; -import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbility; import mage.abilities.common.ZoneChangeTriggeredAbility; @@ -42,11 +40,9 @@ import mage.cards.Card; import mage.cards.LevelerCard; import mage.counters.CounterType; import mage.game.Game; -import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; import mage.players.Player; -import javax.swing.*; /** *