Some minor changes.

This commit is contained in:
LevelX2 2017-01-02 18:09:33 +01:00
parent f777668a4d
commit 54b40646d9
37 changed files with 202 additions and 320 deletions

View file

@ -41,8 +41,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetCreatureOrPlayer;
/** /**
@ -51,14 +50,8 @@ import mage.target.common.TargetCreatureOrPlayer;
*/ */
public class AcidicSliver extends CardImpl { public class AcidicSliver extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver creatures");
static {
filter.add(new SubtypePredicate("Sliver"));
}
public AcidicSliver(UUID ownerId, CardSetInfo setInfo) { public AcidicSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{R}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(2); this.power = new MageInt(2);
@ -70,7 +63,7 @@ public class AcidicSliver extends CardImpl {
ability.addTarget(new TargetCreatureOrPlayer()); ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityAllEffect(ability, new GainAbilityAllEffect(ability,
Duration.WhileOnBattlefield, filter, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS,
"All Slivers have \"{2}, Sacrifice this permanent: This permanent deals 2 damage to target creature or player.\""))); "All Slivers have \"{2}, Sacrifice this permanent: This permanent deals 2 damage to target creature or player.\"")));
} }

View file

@ -28,8 +28,6 @@
package mage.cards.a; package mage.cards.a;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -38,10 +36,10 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect; import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.SubtypePredicate;
/** /**
* *
@ -49,19 +47,15 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
*/ */
public class ArmorSliver extends CardImpl { public class ArmorSliver extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver creatures");
static {
filter.add(new SubtypePredicate("Sliver"));
}
public ArmorSliver(UUID ownerId, CardSetInfo setInfo) { public ArmorSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(0, 1, Duration.EndOfTurn), new GenericManaCost(2)), Duration.WhileOnBattlefield, filter, false))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(
new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(0, 1, Duration.EndOfTurn),
new GenericManaCost(2)), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS, false)));
} }
public ArmorSliver(final ArmorSliver card) { public ArmorSliver(final ArmorSliver card) {

View file

@ -30,35 +30,39 @@ package mage.cards.a;
import java.util.UUID; import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.CardsInHandCondition;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect; import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
import mage.abilities.keyword.MadnessAbility; import mage.abilities.keyword.MadnessAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.players.Player;
/** /**
* *
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com) * @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
*/ */
public class AsylumVisitor extends CardImpl { public class AsylumVisitor extends CardImpl {
public AsylumVisitor(UUID ownerId, CardSetInfo setInfo) { public AsylumVisitor(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
this.subtype.add("Vampire"); this.subtype.add("Vampire");
this.subtype.add("Wizard"); this.subtype.add("Wizard");
this.power = new MageInt(3); this.power = new MageInt(3);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// At the beginning of each player's upkeep, if that player has no cards in hand, you draw a card and you lose 1 life. // At the beginning of each player's upkeep, if that player has no cards in hand, you draw a card and you lose 1 life.
this.addAbility(new AsylumVisitorTriggeredAbility()); Ability ability = new ConditionalTriggeredAbility(new BeginningOfUpkeepTriggeredAbility(new DrawCardSourceControllerEffect(1), TargetController.ANY, false),
new CardsInHandCondition(CardsInHandCondition.CountType.EQUAL_TO, 0, null, TargetController.ACTIVE),
"At the beginning of each player's upkeep, if that player has no cards in hand, you draw a card and you lose 1 life.");
Effect effect = new LoseLifeSourceControllerEffect(1);
effect.setText("and you lose 1 life");
this.addAbility(ability);
// Madness {1}{B} // Madness {1}{B}
this.addAbility(new MadnessAbility(this, new ManaCostsImpl("{1}{B}"))); this.addAbility(new MadnessAbility(this, new ManaCostsImpl("{1}{B}")));
@ -73,67 +77,3 @@ public class AsylumVisitor extends CardImpl {
return new AsylumVisitor(this); return new AsylumVisitor(this);
} }
} }
class AsylumVisitorTriggeredAbility extends TriggeredAbilityImpl {
public AsylumVisitorTriggeredAbility() {
super(Zone.BATTLEFIELD, new AsylumVisitorEffect());
}
public AsylumVisitorTriggeredAbility(final AsylumVisitorTriggeredAbility ability) {
super(ability);
}
@Override
public AsylumVisitorTriggeredAbility copy() {
return new AsylumVisitorTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.UPKEEP_STEP_PRE;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Player upkeepPlayer = game.getPlayer(event.getPlayerId());
if (upkeepPlayer != null && upkeepPlayer.getHand().isEmpty()) {
return true;
}
return false;
}
@Override
public String getRule() {
return "At the beginning of each player's upkeep, if that player has no cards in hand, you draw a card and you lose 1 life.";
}
}
class AsylumVisitorEffect extends OneShotEffect {
public AsylumVisitorEffect() {
super(Outcome.DrawCard);
this.staticText = "you draw a card and you lose 1 life";
}
public AsylumVisitorEffect(final AsylumVisitorEffect effect) {
super(effect);
}
@Override
public AsylumVisitorEffect copy() {
return new AsylumVisitorEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player you = game.getPlayer(source.getControllerId());
Player upkeepPlayer = game.getPlayer(game.getActivePlayerId());
if (you != null && upkeepPlayer != null && upkeepPlayer.getHand().isEmpty()) {
you.drawCards(1, game);
you.loseLife(1, game, false);
return true;
}
return false;
}
}

View file

@ -28,17 +28,16 @@
package mage.cards.a; package mage.cards.a;
import java.util.UUID; import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.*; import mage.abilities.effects.PreventionEffectData;
import mage.abilities.effects.PreventionEffectImpl;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -79,22 +78,21 @@ class AweStrikeEffect extends PreventionEffectImpl {
@Override @Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) { public boolean replaceEvent(GameEvent event, Ability source, Game game) {
this.used = true;
this.discard();
PreventionEffectData preventionData = preventDamageAction(event, source, game); PreventionEffectData preventionData = preventDamageAction(event, source, game);
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if (player != null) { if (player != null) {
player.gainLife(preventionData.getPreventedDamage(), game); player.gainLife(preventionData.getPreventedDamage(), game);
} }
this.used = true;
this.discard();
return true; return true;
} }
@Override @Override
public boolean applies(GameEvent event, Ability source, Game game) { public boolean applies(GameEvent event, Ability source, Game game) {
if (!this.used && super.applies(event, source, game)) { if (!this.used && super.applies(event, source, game)) {
MageObject mageObject = game.getObject(event.getSourceId()); Permanent targetCreature = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
return this.getTargetPointer().getFirst(game, source).equals(mageObject.getId()); return targetCreature != null && targetCreature.getId().equals(event.getSourceId());
} }
return false; return false;
} }

View file

@ -28,8 +28,6 @@
package mage.cards.b; package mage.cards.b;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -38,10 +36,10 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect; import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.SubtypePredicate;
/** /**
* *
@ -49,19 +47,14 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
*/ */
public class BarbedSliver extends CardImpl { public class BarbedSliver extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver creatures");
static {
filter.add(new SubtypePredicate("Sliver"));
}
public BarbedSliver(UUID ownerId, CardSetInfo setInfo) { public BarbedSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new GenericManaCost(2)), Duration.WhileOnBattlefield, filter, false))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn),
new GenericManaCost(2)), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS, false)));
} }
public BarbedSliver(final BarbedSliver card) { public BarbedSliver(final BarbedSliver card) {

View file

@ -36,7 +36,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
/** /**
* *
@ -45,16 +45,16 @@ import mage.filter.common.FilterCreaturePermanent;
public class BattleSliver extends CardImpl { public class BattleSliver extends CardImpl {
public BattleSliver(UUID ownerId, CardSetInfo setInfo) { public BattleSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(3); this.power = new MageInt(3);
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Sliver creatures you control get +2/+0. // Sliver creatures you control get +2/+0.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new BoostControlledEffect(2, 0, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver","Sliver creatures")))); new BoostControlledEffect(2, 0, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS)));
} }
public BattleSliver(final BattleSliver card) { public BattleSliver(final BattleSliver card) {

View file

@ -36,7 +36,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
/** /**
* *
@ -45,14 +45,15 @@ import mage.filter.common.FilterCreaturePermanent;
public class BladeSliver extends CardImpl { public class BladeSliver extends CardImpl {
public BladeSliver(UUID ownerId, CardSetInfo setInfo) { public BladeSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// All Sliver creatures get +1/+0. // All Sliver creatures get +1/+0.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 0, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures"), false))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new BoostAllEffect(1, 0, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS, false)));
} }
public BladeSliver(final BladeSliver card) { public BladeSliver(final BladeSliver card) {

View file

@ -37,16 +37,16 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
/** /**
* *
* @author jeffwadsworth * @author jeffwadsworth
*/ */
public class BonescytheSliver extends CardImpl { public class BonescytheSliver extends CardImpl {
public BonescytheSliver(UUID ownerId, CardSetInfo setInfo) { public BonescytheSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(2); this.power = new MageInt(2);
@ -55,7 +55,7 @@ public class BonescytheSliver extends CardImpl {
// Sliver creatures you control have double strike. // Sliver creatures you control have double strike.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(),
Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver","Sliver creatures")))); Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS)));
} }
public BonescytheSliver(final BonescytheSliver card) { public BonescytheSliver(final BonescytheSliver card) {

View file

@ -36,7 +36,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
/** /**
* *
@ -45,18 +45,14 @@ import mage.filter.common.FilterCreaturePermanent;
public class BonesplitterSliver extends CardImpl { public class BonesplitterSliver extends CardImpl {
public BonesplitterSliver(UUID ownerId, CardSetInfo setInfo) { public BonesplitterSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// All Sliver creatures get +2/+0. // All Sliver creatures get +2/+0.
this.addAbility( this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new SimpleStaticAbility( new BoostAllEffect(2, 0, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS, false)));
Zone.BATTLEFIELD,
new BoostAllEffect(2, 0, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver","Sliver creatures"), false)
)
);
} }
public BonesplitterSliver(final BonesplitterSliver card) { public BonesplitterSliver(final BonesplitterSliver card) {

View file

@ -44,7 +44,7 @@ import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate; import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
@ -65,7 +65,7 @@ public class ConstrictingSliver extends CardImpl {
} }
public ConstrictingSliver(UUID ownerId, CardSetInfo setInfo) { public ConstrictingSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{W}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{W}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(3); this.power = new MageInt(3);
@ -78,7 +78,7 @@ public class ConstrictingSliver extends CardImpl {
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility())); ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility()));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityAllEffect(ability, new GainAbilityAllEffect(ability,
Duration.WhileOnBattlefield, new FilterControlledCreaturePermanent("Sliver", "Sliver creatures"), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS,
"Sliver creatures you control have \"When this creature enters the battlefield, you may exile target creature an opponent controls until this creature leaves the battlefield.\""))); "Sliver creatures you control have \"When this creature enters the battlefield, you may exile target creature an opponent controls until this creature leaves the battlefield.\"")));
} }

View file

@ -40,6 +40,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -50,7 +51,7 @@ import mage.target.common.TargetCreaturePermanent;
public class CryptSliver extends CardImpl { public class CryptSliver extends CardImpl {
public CryptSliver(UUID ownerId, CardSetInfo setInfo) { public CryptSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(1); this.power = new MageInt(1);
@ -59,7 +60,7 @@ public class CryptSliver extends CardImpl {
// All Slivers have "{tap}: Regenerate target Sliver." // All Slivers have "{tap}: Regenerate target Sliver."
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new TapSourceCost()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("Sliver", "Sliver"))); ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("Sliver", "Sliver")));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS)));
} }
public CryptSliver(final CryptSliver card) { public CryptSliver(final CryptSliver card) {

View file

@ -40,8 +40,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.SubtypePredicate;
/** /**
* *
@ -49,14 +48,8 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
*/ */
public class DarkheartSliver extends CardImpl { public class DarkheartSliver extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver creatures");
static {
filter.add(new SubtypePredicate("Sliver"));
}
public DarkheartSliver(UUID ownerId, CardSetInfo setInfo) { public DarkheartSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{G}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(2); this.power = new MageInt(2);
@ -66,7 +59,7 @@ public class DarkheartSliver extends CardImpl {
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(3), new SacrificeSourceCost()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(3), new SacrificeSourceCost());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityAllEffect(ability, new GainAbilityAllEffect(ability,
Duration.WhileOnBattlefield, filter, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS,
"All Slivers have \"Sacrifice this permanent: You gain 3 life.\""))); "All Slivers have \"Sacrifice this permanent: You gain 3 life.\"")));
} }

View file

@ -37,7 +37,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
/** /**
* *
@ -46,7 +46,7 @@ import mage.filter.common.FilterCreaturePermanent;
public class FurySliver extends CardImpl { public class FurySliver extends CardImpl {
public FurySliver(UUID ownerId, CardSetInfo setInfo) { public FurySliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{R}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(3); this.power = new MageInt(3);
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
@ -55,7 +55,7 @@ public class FurySliver extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityAllEffect(DoubleStrikeAbility.getInstance(), new GainAbilityAllEffect(DoubleStrikeAbility.getInstance(),
Duration.WhileOnBattlefield, Duration.WhileOnBattlefield,
new FilterCreaturePermanent("Sliver","Sliver creatures") StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS
) )
)); ));
} }

View file

@ -37,7 +37,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
/** /**
* *
@ -46,7 +46,7 @@ import mage.filter.common.FilterCreaturePermanent;
public class GaleriderSliver extends CardImpl { public class GaleriderSliver extends CardImpl {
public GaleriderSliver(UUID ownerId, CardSetInfo setInfo) { public GaleriderSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{U}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(1); this.power = new MageInt(1);
@ -55,7 +55,7 @@ public class GaleriderSliver extends CardImpl {
// Sliver creatures you control have flying. // Sliver creatures you control have flying.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityControlledEffect(FlyingAbility.getInstance(), new GainAbilityControlledEffect(FlyingAbility.getInstance(),
Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver","Sliver creatures")))); Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS)));
} }
public GaleriderSliver(final GaleriderSliver card) { public GaleriderSliver(final GaleriderSliver card) {

View file

@ -37,7 +37,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
/** /**
* *
@ -46,7 +46,7 @@ import mage.filter.common.FilterCreaturePermanent;
public class GroundshakerSliver extends CardImpl { public class GroundshakerSliver extends CardImpl {
public GroundshakerSliver(UUID ownerId, CardSetInfo setInfo) { public GroundshakerSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{6}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{6}{G}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(5); this.power = new MageInt(5);
@ -55,7 +55,7 @@ public class GroundshakerSliver extends CardImpl {
// Sliver creatures you control have trample. // Sliver creatures you control have trample.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityControlledEffect(TrampleAbility.getInstance(), new GainAbilityControlledEffect(TrampleAbility.getInstance(),
Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver","Sliver creatures")))); Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS)));
} }
public GroundshakerSliver(final GroundshakerSliver card) { public GroundshakerSliver(final GroundshakerSliver card) {

View file

@ -37,7 +37,7 @@ import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect; import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
/** /**
* *
@ -46,7 +46,7 @@ import mage.filter.common.FilterCreaturePermanent;
public class HunterSliver extends CardImpl { public class HunterSliver extends CardImpl {
public HunterSliver(UUID ownerId, CardSetInfo setInfo) { public HunterSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(1); this.power = new MageInt(1);
@ -54,7 +54,7 @@ public class HunterSliver extends CardImpl {
// All Sliver creatures have provoke. // All Sliver creatures have provoke.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(new ProvokeAbility(), this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(new ProvokeAbility(),
Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS)));
} }
public HunterSliver(final HunterSliver card) { public HunterSliver(final HunterSliver card) {

View file

@ -42,6 +42,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.target.Target; import mage.target.Target;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -51,19 +52,19 @@ import mage.target.common.TargetCreaturePermanent;
* @author cbt33 * @author cbt33
*/ */
public class MagmaSliver extends CardImpl { public class MagmaSliver extends CardImpl {
public MagmaSliver(UUID ownerId, CardSetInfo setInfo) { public MagmaSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(3); this.power = new MageInt(3);
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// All Slivers have "{tap}: Target Sliver creature gets +X/+0 until end of turn, where X is the number of Slivers on the battlefield." // All Slivers have "{tap}: Target Sliver creature gets +X/+0 until end of turn, where X is the number of Slivers on the battlefield."
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("Sliver", "Sliver creatures")), new StaticValue(0), Duration.EndOfTurn), new TapSourceCost()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(new PermanentsOnBattlefieldCount(StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS), new StaticValue(0), Duration.EndOfTurn), new TapSourceCost());
Target target = new TargetCreaturePermanent(new FilterCreaturePermanent("Sliver", "Sliver creature")); Target target = new TargetCreaturePermanent(new FilterCreaturePermanent("Sliver", "Sliver creature"));
ability.addTarget(target); ability.addTarget(target);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS)));
} }
public MagmaSliver(final MagmaSliver card) { public MagmaSliver(final MagmaSliver card) {

View file

@ -38,7 +38,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.StaticFilters;
/** /**
* *
@ -47,7 +47,7 @@ import mage.filter.common.FilterControlledCreaturePermanent;
public class ManaweftSliver extends CardImpl { public class ManaweftSliver extends CardImpl {
public ManaweftSliver(UUID ownerId, CardSetInfo setInfo) { public ManaweftSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(1); this.power = new MageInt(1);
@ -57,8 +57,8 @@ public class ManaweftSliver extends CardImpl {
Ability ability = new AnyColorManaAbility(); Ability ability = new AnyColorManaAbility();
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityAllEffect(ability, new GainAbilityAllEffect(ability,
Duration.WhileOnBattlefield, new FilterControlledCreaturePermanent("Sliver","Sliver creatures"), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS,
"Sliver creatures you control have \"{T}: Add one mana of any color to your mana pool.\""))); "Sliver creatures you control have \"{T}: Add one mana of any color to your mana pool.\"")));
} }
public ManaweftSliver(final ManaweftSliver card) { public ManaweftSliver(final ManaweftSliver card) {

View file

@ -36,7 +36,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
/** /**
* *
@ -45,15 +45,15 @@ import mage.filter.common.FilterCreaturePermanent;
public class MeganticSliver extends CardImpl { public class MeganticSliver extends CardImpl {
public MeganticSliver(UUID ownerId, CardSetInfo setInfo) { public MeganticSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(3); this.power = new MageInt(3);
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Sliver creatures you control get +3/+3. // Sliver creatures you control get +3/+3.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new BoostControlledEffect(3,3, Duration.WhileInGraveyard, new FilterCreaturePermanent("Sliver","Sliver creatures")))); new BoostControlledEffect(3, 3, Duration.WhileInGraveyard, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS)));
} }
public MeganticSliver(final MeganticSliver card) { public MeganticSliver(final MeganticSliver card) {

View file

@ -46,7 +46,7 @@ import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -59,7 +59,7 @@ import mage.target.targetpointer.FixedTarget;
public class MistformSliver extends CardImpl { public class MistformSliver extends CardImpl {
public MistformSliver(UUID ownerId, CardSetInfo setInfo) { public MistformSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.subtype.add("Illusion"); this.subtype.add("Illusion");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
@ -68,7 +68,7 @@ public class MistformSliver extends CardImpl {
// All Slivers have "{1}: This permanent becomes the creature type of your choice in addition to its other types until end of turn." // All Slivers have "{1}: This permanent becomes the creature type of your choice in addition to its other types until end of turn."
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MistformSliverEffect(), new ManaCostsImpl("{1}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MistformSliverEffect(), new ManaCostsImpl("{1}"));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS)));
} }
public MistformSliver(final MistformSliver card) { public MistformSliver(final MistformSliver card) {
@ -81,41 +81,41 @@ public class MistformSliver extends CardImpl {
} }
} }
class MistformSliverEffect extends OneShotEffect { class MistformSliverEffect extends OneShotEffect {
public MistformSliverEffect() {
super(Outcome.Benefit);
staticText = "This permanent becomes the creature type of your choice in addition to its other types until end of turn";
}
public MistformSliverEffect(final MistformSliverEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (player != null && permanent != null) {
Choice typeChoice = new ChoiceImpl(true);
typeChoice.setMessage("Choose creature type");
typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
while (!player.choose(Outcome.Detriment, typeChoice, game)) {
if (!player.canRespond()) {
return false;
}
}
game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + typeChoice.getChoice());
ContinuousEffect effect = new AddCardSubTypeTargetEffect(typeChoice.getChoice(), Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent.getId()));
game.addEffect(effect, source);
}
return false;
}
@Override
public MistformSliverEffect copy() {
return new MistformSliverEffect(this);
}
public MistformSliverEffect() {
super(Outcome.Benefit);
staticText = "This permanent becomes the creature type of your choice in addition to its other types until end of turn";
} }
public MistformSliverEffect(final MistformSliverEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (player != null && permanent != null) {
Choice typeChoice = new ChoiceImpl(true);
typeChoice.setMessage("Choose creature type");
typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
while (!player.choose(Outcome.Detriment, typeChoice, game)) {
if (!player.canRespond()) {
return false;
}
}
game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + typeChoice.getChoice());
ContinuousEffect effect = new AddCardSubTypeTargetEffect(typeChoice.getChoice(), Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent.getId()));
game.addEffect(effect, source);
}
return false;
}
@Override
public MistformSliverEffect copy() {
return new MistformSliverEffect(this);
}
}

View file

@ -28,8 +28,6 @@
package mage.cards.m; package mage.cards.m;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
@ -40,31 +38,26 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect; import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.SubtypePredicate;
/** /**
* @author Loki * @author Loki
*/ */
public class MnemonicSliver extends CardImpl { public class MnemonicSliver extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver creatures");
static {
filter.add(new SubtypePredicate("Sliver"));
}
public MnemonicSliver(UUID ownerId, CardSetInfo setInfo) { public MnemonicSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new GenericManaCost(2)); Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new GenericManaCost(2));
gainedAbility.addCost(new SacrificeSourceCost()); gainedAbility.addCost(new SacrificeSourceCost());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(gainedAbility, Duration.WhileOnBattlefield, filter, false))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityAllEffect(gainedAbility, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS, false)));
} }
public MnemonicSliver(final MnemonicSliver card) { public MnemonicSliver(final MnemonicSliver card) {

View file

@ -41,8 +41,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
/** /**
@ -51,14 +50,8 @@ import mage.target.TargetPermanent;
*/ */
public class NecroticSliver extends CardImpl { public class NecroticSliver extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver creatures");
static {
filter.add(new SubtypePredicate("Sliver"));
}
public NecroticSliver(UUID ownerId, CardSetInfo setInfo) { public NecroticSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}{B}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{B}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(2); this.power = new MageInt(2);
@ -70,7 +63,7 @@ public class NecroticSliver extends CardImpl {
ability.addTarget(new TargetPermanent()); ability.addTarget(new TargetPermanent());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityAllEffect(ability, new GainAbilityAllEffect(ability,
Duration.WhileOnBattlefield, filter, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS,
"All Slivers have \"{3}, Sacrifice this permanent: Destroy target permanent.\""))); "All Slivers have \"{3}, Sacrifice this permanent: Destroy target permanent.\"")));
} }

View file

@ -36,7 +36,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
/** /**
* *
@ -45,14 +45,14 @@ import mage.filter.common.FilterCreaturePermanent;
public class PlatedSliver extends CardImpl { public class PlatedSliver extends CardImpl {
public PlatedSliver(UUID ownerId, CardSetInfo setInfo) { public PlatedSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(1); this.power = new MageInt(1);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// All Sliver creatures get +0/+1. // All Sliver creatures get +0/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(0, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures"), false))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(0, 1, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS, false)));
} }
public PlatedSliver(final PlatedSliver card) { public PlatedSliver(final PlatedSliver card) {

View file

@ -41,8 +41,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
/** /**
@ -51,14 +50,8 @@ import mage.target.TargetPermanent;
*/ */
public class PoulticeSliver extends CardImpl { public class PoulticeSliver extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver creatures");
static {
filter.add(new SubtypePredicate("Sliver"));
}
public PoulticeSliver(UUID ownerId, CardSetInfo setInfo) { public PoulticeSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(2); this.power = new MageInt(2);
@ -67,11 +60,11 @@ public class PoulticeSliver extends CardImpl {
// All Slivers have "{2}, {tap}: Regenerate target Sliver." // All Slivers have "{2}, {tap}: Regenerate target Sliver."
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new GenericManaCost(2)); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new GenericManaCost(2));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
ability.addTarget(new TargetPermanent(filter)); ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityAllEffect(ability, new GainAbilityAllEffect(ability,
Duration.WhileOnBattlefield, filter, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS,
"Slivers have \"{2}, {T}: Regenerate target Sliver.\""))); "Slivers have \"{2}, {T}: Regenerate target Sliver.\"")));
} }

View file

@ -36,7 +36,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
/** /**
* *
@ -45,7 +45,7 @@ import mage.filter.common.FilterCreaturePermanent;
public class PredatorySliver extends CardImpl { public class PredatorySliver extends CardImpl {
public PredatorySliver(UUID ownerId, CardSetInfo setInfo) { public PredatorySliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(1); this.power = new MageInt(1);
@ -53,7 +53,7 @@ public class PredatorySliver extends CardImpl {
// Sliver creatures you control get +1/+1. // Sliver creatures you control get +1/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new BoostControlledEffect(1,1, Duration.WhileInGraveyard, new FilterCreaturePermanent("Sliver","Sliver creatures")))); new BoostControlledEffect(1, 1, Duration.WhileInGraveyard, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS)));
} }
public PredatorySliver(final PredatorySliver card) { public PredatorySliver(final PredatorySliver card) {

View file

@ -37,7 +37,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
/** /**
* *
@ -46,7 +46,7 @@ import mage.filter.common.FilterCreaturePermanent;
public class SliverHivelord extends CardImpl { public class SliverHivelord extends CardImpl {
public SliverHivelord(UUID ownerId, CardSetInfo setInfo) { public SliverHivelord(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}{U}{B}{R}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{U}{B}{R}{G}");
this.supertype.add("Legendary"); this.supertype.add("Legendary");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
@ -56,7 +56,7 @@ public class SliverHivelord extends CardImpl {
// Sliver creatures you control have indestructible. // Sliver creatures you control have indestructible.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityControlledEffect(IndestructibleAbility.getInstance(), new GainAbilityControlledEffect(IndestructibleAbility.getInstance(),
Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS)));
} }

View file

@ -40,17 +40,16 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
/** /**
* *
* @author cbt33 * @author cbt33
*/ */
public class SpectralSliver extends CardImpl { public class SpectralSliver extends CardImpl {
public SpectralSliver(UUID ownerId, CardSetInfo setInfo) { public SpectralSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.subtype.add("Spirit"); this.subtype.add("Spirit");
@ -58,8 +57,8 @@ public class SpectralSliver extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// All Sliver creatures have "{2}: This creature gets +1/+1 until end of turn." // All Sliver creatures have "{2}: This creature gets +1/+1 until end of turn."
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,1,Duration.EndOfTurn), new ManaCostsImpl("{2}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{2}"));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS)));
} }
public SpectralSliver(final SpectralSliver card) { public SpectralSliver(final SpectralSliver card) {

View file

@ -38,11 +38,9 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.combat.CombatGroup; import mage.game.combat.CombatGroup;
import mage.target.targetpointer.TargetPointer;
/** /**
* *
@ -50,14 +48,8 @@ import mage.target.targetpointer.TargetPointer;
*/ */
public class SpinedSliver extends CardImpl { public class SpinedSliver extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver creatures");
static {
filter.add(new SubtypePredicate("Sliver"));
}
public SpinedSliver(UUID ownerId, CardSetInfo setInfo) { public SpinedSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{G}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(2); this.power = new MageInt(2);
@ -67,7 +59,7 @@ public class SpinedSliver extends CardImpl {
BlockersCount value = new BlockersCount(); BlockersCount value = new BlockersCount();
Effect effect = new BoostTargetEffect(value, value, Duration.EndOfTurn, true); Effect effect = new BoostTargetEffect(value, value, Duration.EndOfTurn, true);
effect.setText("it gets +1/+1 until end of turn for each creature blocking it"); effect.setText("it gets +1/+1 until end of turn for each creature blocking it");
this.addAbility(new BecomesBlockedAllTriggeredAbility(effect, false, filter, true)); this.addAbility(new BecomesBlockedAllTriggeredAbility(effect, false, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS, true));
} }
public SpinedSliver(final SpinedSliver card) { public SpinedSliver(final SpinedSliver card) {
@ -82,7 +74,7 @@ public class SpinedSliver extends CardImpl {
class BlockersCount implements DynamicValue { class BlockersCount implements DynamicValue {
private String message; private final String message;
public BlockersCount() { public BlockersCount() {
this.message = "each creature blocking it"; this.message = "each creature blocking it";
@ -95,8 +87,7 @@ class BlockersCount implements DynamicValue {
@Override @Override
public int calculate(Game game, Ability sourceAbility, Effect effect) { public int calculate(Game game, Ability sourceAbility, Effect effect) {
TargetPointer attacker = effect.getTargetPointer(); UUID attackerId = effect.getTargetPointer().getFirst(game, sourceAbility);
UUID attackerId = attacker.getFirst(game, sourceAbility);
for (CombatGroup combatGroup : game.getCombat().getGroups()) { for (CombatGroup combatGroup : game.getCombat().getGroups()) {
if (combatGroup.getAttackers().contains(attackerId)) { if (combatGroup.getAttackers().contains(attackerId)) {
return combatGroup.getBlockers().size(); return combatGroup.getBlockers().size();

View file

@ -36,7 +36,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
/** /**
* *
@ -45,16 +45,16 @@ import mage.filter.common.FilterCreaturePermanent;
public class SteelformSliver extends CardImpl { public class SteelformSliver extends CardImpl {
public SteelformSliver(UUID ownerId, CardSetInfo setInfo) { public SteelformSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Sliver creatures you control get +0/+1. // Sliver creatures you control get +0/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new BoostControlledEffect(0, 1, Duration.WhileOnBattlefield, new BoostControlledEffect(0, 1, Duration.WhileOnBattlefield,
new FilterCreaturePermanent("Sliver", "Sliver creatures"), false))); StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS, false)));
} }
public SteelformSliver(final SteelformSliver card) { public SteelformSliver(final SteelformSliver card) {

View file

@ -37,7 +37,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
/** /**
* *
@ -46,7 +46,7 @@ import mage.filter.common.FilterCreaturePermanent;
public class StrikingSliver extends CardImpl { public class StrikingSliver extends CardImpl {
public StrikingSliver(UUID ownerId, CardSetInfo setInfo) { public StrikingSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(1); this.power = new MageInt(1);
@ -55,7 +55,7 @@ public class StrikingSliver extends CardImpl {
// Sliver creatures you control have first strike. // Sliver creatures you control have first strike.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(),
Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver","Sliver creatures")))); Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS)));
} }
public StrikingSliver(final StrikingSliver card) { public StrikingSliver(final StrikingSliver card) {

View file

@ -37,7 +37,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
/** /**
* *
@ -46,7 +46,7 @@ import mage.filter.common.FilterCreaturePermanent;
public class SyphonSliver extends CardImpl { public class SyphonSliver extends CardImpl {
public SyphonSliver(UUID ownerId, CardSetInfo setInfo) { public SyphonSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(2); this.power = new MageInt(2);
@ -55,7 +55,7 @@ public class SyphonSliver extends CardImpl {
// Sliver creatures you control have lifelink. // Sliver creatures you control have lifelink.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityControlledEffect(LifelinkAbility.getInstance(), new GainAbilityControlledEffect(LifelinkAbility.getInstance(),
Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver","Sliver creatures")))); Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS)));
} }
public SyphonSliver(final SyphonSliver card) { public SyphonSliver(final SyphonSliver card) {

View file

@ -39,7 +39,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.StaticFilters;
import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetCreatureOrPlayer;
/** /**
@ -49,7 +49,7 @@ import mage.target.common.TargetCreatureOrPlayer;
public class ThorncasterSliver extends CardImpl { public class ThorncasterSliver extends CardImpl {
public ThorncasterSliver(UUID ownerId, CardSetInfo setInfo) { public ThorncasterSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(2); this.power = new MageInt(2);
@ -60,8 +60,8 @@ public class ThorncasterSliver extends CardImpl {
ability.addTarget(new TargetCreatureOrPlayer()); ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityAllEffect(ability, new GainAbilityAllEffect(ability,
Duration.WhileOnBattlefield, new FilterControlledCreaturePermanent("Sliver","Sliver creatures"), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS,
"Sliver creatures you control have \"Whenever this creature attacks, it deals 1 damage to target creature or player.\""))); "Sliver creatures you control have \"Whenever this creature attacks, it deals 1 damage to target creature or player.\"")));
} }
public ThorncasterSliver(final ThorncasterSliver card) { public ThorncasterSliver(final ThorncasterSliver card) {

View file

@ -38,8 +38,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.SubtypePredicate;
/** /**
* *
@ -47,14 +46,8 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
*/ */
public class TwoHeadedSliver extends CardImpl { public class TwoHeadedSliver extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver creatures");
static {
filter.add(new SubtypePredicate("Sliver"));
}
public TwoHeadedSliver(UUID ownerId, CardSetInfo setInfo) { public TwoHeadedSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(1); this.power = new MageInt(1);
@ -63,8 +56,8 @@ public class TwoHeadedSliver extends CardImpl {
// All Sliver creatures have menace. (They can't be blocked except by two or more creatures.) // All Sliver creatures have menace. (They can't be blocked except by two or more creatures.)
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect( this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(
new MenaceAbility(), new MenaceAbility(),
Duration.WhileOnBattlefield, filter, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS,
"All Sliver creatures have menace. (They can't be blocked except by two or more creatures.)"))); "All Sliver creatures have menace. <i>(They can't be blocked except by two or more creatures.)</i>")));
} }
public TwoHeadedSliver(final TwoHeadedSliver card) { public TwoHeadedSliver(final TwoHeadedSliver card) {

View file

@ -37,7 +37,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
/** /**
* *
@ -46,7 +46,7 @@ import mage.filter.common.FilterCreaturePermanent;
public class VenomSliver extends CardImpl { public class VenomSliver extends CardImpl {
public VenomSliver(UUID ownerId, CardSetInfo setInfo) { public VenomSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(1); this.power = new MageInt(1);
@ -55,7 +55,7 @@ public class VenomSliver extends CardImpl {
// Sliver creatures you control have deathtouch. // Sliver creatures you control have deathtouch.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityControlledEffect(DeathtouchAbility.getInstance(), new GainAbilityControlledEffect(DeathtouchAbility.getInstance(),
Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver","Sliver creatures")))); Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS)));
} }
public VenomSliver(final VenomSliver card) { public VenomSliver(final VenomSliver card) {

View file

@ -41,8 +41,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.SubtypePredicate;
/** /**
* *
@ -50,14 +49,8 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
*/ */
public class VictualSliver extends CardImpl { public class VictualSliver extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver creatures");
static {
filter.add(new SubtypePredicate("Sliver"));
}
public VictualSliver(UUID ownerId, CardSetInfo setInfo) { public VictualSliver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{G}{W}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}{W}");
this.subtype.add("Sliver"); this.subtype.add("Sliver");
this.power = new MageInt(2); this.power = new MageInt(2);
@ -69,7 +62,7 @@ public class VictualSliver extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityAllEffect(ability, new GainAbilityAllEffect(ability,
Duration.WhileOnBattlefield, filter, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE_SLIVERS,
"All Slivers have \"{2}, Sacrifice this permanent: You gain 4 life.\""))); "All Slivers have \"{2}, Sacrifice this permanent: You gain 4 life.\"")));
} }

View file

@ -91,12 +91,28 @@ public class CardsInHandCondition implements Condition {
break; break;
} }
break; break;
case ACTIVE:
Player player = game.getPlayer(game.getActivePlayerId());
if (player != null) {
switch (this.type) {
case FEWER_THAN:
conditionApplies = player.getHand().size() < this.count;
break;
case MORE_THAN:
conditionApplies = player.getHand().size() > this.count;
break;
case EQUAL_TO:
conditionApplies = player.getHand().size() == this.count;
break;
}
}
break;
case ANY: case ANY:
boolean conflict = false; boolean conflict = false;
switch (this.type) { switch (this.type) {
case FEWER_THAN: case FEWER_THAN:
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId); player = game.getPlayer(playerId);
if (player != null) { if (player != null) {
if (player.getHand().size() >= this.count) { if (player.getHand().size() >= this.count) {
conflict = true; conflict = true;
@ -107,7 +123,7 @@ public class CardsInHandCondition implements Condition {
break; break;
case MORE_THAN: case MORE_THAN:
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId); player = game.getPlayer(playerId);
if (player != null) { if (player != null) {
if (player.getHand().size() <= this.count) { if (player.getHand().size() <= this.count) {
conflict = true; conflict = true;
@ -118,7 +134,7 @@ public class CardsInHandCondition implements Condition {
break; break;
case EQUAL_TO: case EQUAL_TO:
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
Player player = game.getPlayer(playerId); player = game.getPlayer(playerId);
if (player != null) { if (player != null) {
if (player.getHand().size() != this.count) { if (player.getHand().size() != this.count) {
conflict = true; conflict = true;

View file

@ -30,6 +30,7 @@ public class StaticFilters {
public static final FilterCard FILTER_CARD_ARTIFACT_OR_CREATURE = new FilterCard("artifact or creature card"); public static final FilterCard FILTER_CARD_ARTIFACT_OR_CREATURE = new FilterCard("artifact or creature card");
public static final FilterCreaturePermanent FILTER_PERMANENT_CREATURE_GOBLINS = new FilterCreaturePermanent("Goblin", "Goblin creatures"); public static final FilterCreaturePermanent FILTER_PERMANENT_CREATURE_GOBLINS = new FilterCreaturePermanent("Goblin", "Goblin creatures");
public static final FilterCreaturePermanent FILTER_PERMANENT_CREATURE_SLIVERS = new FilterCreaturePermanent("Sliver", "Sliver creatures");
static { static {
FILTER_PERMANENT_ARTIFACT_OR_CREATURE.add(Predicates.or( FILTER_PERMANENT_ARTIFACT_OR_CREATURE.add(Predicates.or(