* Some fixed to cards submitted by BursegSardaukar.

This commit is contained in:
LevelX2 2015-10-04 09:45:22 +02:00
parent ab9856fb86
commit 87078057e0
11 changed files with 131 additions and 167 deletions

View file

@ -28,21 +28,18 @@
package mage.sets.archenemy; package mage.sets.archenemy;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.keyword.MorphAbility; import mage.abilities.keyword.MorphAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.Outcome; import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.game.events.GameEvent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -50,7 +47,7 @@ import mage.target.common.TargetCreaturePermanent;
* @author BursegSardaukar * @author BursegSardaukar
*/ */
public class SkirkCommando extends CardImpl { public class SkirkCommando extends CardImpl {
public SkirkCommando(UUID ownerId) { public SkirkCommando(UUID ownerId) {
super(ownerId, 47, "Skirk Commando", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); super(ownerId, 47, "Skirk Commando", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}");
this.expansionSetCode = "ARC"; this.expansionSetCode = "ARC";
@ -59,13 +56,13 @@ public class SkirkCommando extends CardImpl {
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
//Whenever Skirk Commando deals combat damage to a player, you may have it deal 2 damage to target creature that player controls. //Whenever Skirk Commando deals combat damage to a player, you may have it deal 2 damage to target creature that player controls.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new SkirkCommandoEffect(), true, true)); this.addAbility(new SkirkCommandoTriggeredAbility());
//Morph {2}{R} (You may cast this card face down as a 2/2 creature for 3. Turn it face up any time for its morph cost.) //Morph {2}{R} (You may cast this card face down as a 2/2 creature for 3. Turn it face up any time for its morph cost.)
this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{R}"))); this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{R}")));
} }
public SkirkCommando(final SkirkCommando card) { public SkirkCommando(final SkirkCommando card) {
@ -78,37 +75,29 @@ public class SkirkCommando extends CardImpl {
} }
} }
class SkirkCommandoEffect extends OneShotEffect { class SkirkCommandoTriggeredAbility extends DealsCombatDamageToAPlayerTriggeredAbility {
public SkirkCommandoTriggeredAbility() {
super(new DamageTargetEffect(2), true, false);
public SkirkCommandoEffect() {
super(Outcome.Damage);
staticText = "have it deal 2 damage to target creature that player controls";
} }
public SkirkCommandoEffect(final SkirkCommandoEffect effect) { public SkirkCommandoTriggeredAbility(SkirkCommandoTriggeredAbility ability) {
super(effect); super(ability);
} }
@Override @Override
public boolean apply(Game game, Ability source) { public boolean checkTrigger(GameEvent event, Game game) {
Player player = game.getPlayer(targetPointer.getFirst(game, source)); if (super.checkTrigger(event, game)) {
if (player != null) { FilterCreaturePermanent filter = new FilterCreaturePermanent("creature that player controls");
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + player.getLogName() + " controls"); filter.add(new ControllerIdPredicate(event.getPlayerId()));
filter.add(new ControllerIdPredicate(player.getId())); addTarget(new TargetCreaturePermanent(filter));
TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
if (target.canChoose(source.getControllerId(), game) && target.choose(Outcome.Damage, source.getControllerId(), source.getSourceId(), game)) {
UUID creature = target.getFirstTarget();
if (creature != null) {
game.getPermanent(creature).damage(2, source.getSourceId(), game, false, true);
return true;
}
}
} }
return false; return false;
} }
@Override @Override
public SkirkCommandoEffect copy() { public SkirkCommandoTriggeredAbility copy() {
return new SkirkCommandoEffect(this); return new SkirkCommandoTriggeredAbility(this);
} }
} }

View file

@ -28,9 +28,6 @@
package mage.sets.guildpact; package mage.sets.guildpact;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
@ -42,7 +39,9 @@ import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.keyword.BloodthirstAbility; import mage.abilities.keyword.BloodthirstAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterAttackingCreature; import mage.filter.common.FilterAttackingCreature;
@ -51,9 +50,7 @@ import mage.filter.common.FilterAttackingCreature;
* @author BursegSardaukar * @author BursegSardaukar
*/ */
public class RabbleRouser extends CardImpl { public class RabbleRouser extends CardImpl {
final static private String rule = "Attacking creatures get +X/+0 until end of turn, where X is Rabble-Rouser's power.";
public RabbleRouser(UUID ownerId) { public RabbleRouser(UUID ownerId) {
super(ownerId, 73, "Rabble-Rouser", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); super(ownerId, 73, "Rabble-Rouser", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.expansionSetCode = "GPT"; this.expansionSetCode = "GPT";
@ -68,7 +65,10 @@ public class RabbleRouser extends CardImpl {
//{R}, {T}: Attacking creatures get +X/+0 until end of turn, where X is Rabble-Rouser's power. //{R}, {T}: Attacking creatures get +X/+0 until end of turn, where X is Rabble-Rouser's power.
DynamicValue amount = new SourcePermanentPowerCount(); DynamicValue amount = new SourcePermanentPowerCount();
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(amount, new StaticValue(0), Duration.EndOfTurn, new FilterAttackingCreature(), false, rule), new ManaCostsImpl("{R}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new BoostAllEffect(amount, new StaticValue(0), Duration.EndOfTurn, new FilterAttackingCreature(), false,
"Attacking creatures get +X/+0 until end of turn, where X is {this}'s power"),
new ManaCostsImpl("{R}"));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -28,21 +28,22 @@
package mage.sets.iceage; package mage.sets.iceage;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.BlocksTriggeredAbility; import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.PreventCombatDamageBySourceEffect; import mage.abilities.effects.common.PreventCombatDamageBySourceEffect;
import mage.abilities.effects.common.PreventCombatDamageToSourceEffect; import mage.abilities.effects.common.PreventCombatDamageToSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterAttackingCreature; import mage.filter.common.FilterAttackingCreature;
import mage.filter.predicate.permanent.BlockedByIdPredicate;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -60,15 +61,20 @@ public class GoblinSnowman extends CardImpl {
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
//Whenever Goblin Snowman blocks, prevent all combat damage that would be dealt to and dealt by it this turn. //Whenever Goblin Snowman blocks, prevent all combat damage that would be dealt to and dealt by it this turn.
this.addAbility(new BlocksTriggeredAbility(new PreventCombatDamageBySourceEffect(Duration.EndOfTurn), false)); Effect effect = new PreventCombatDamageBySourceEffect(Duration.EndOfTurn);
this.addAbility(new BlocksTriggeredAbility(new PreventCombatDamageToSourceEffect(Duration.EndOfTurn), false)); effect.setText("prevent all combat damage that would be dealt to");
Ability ability = new BlocksTriggeredAbility(effect, false);
effect = new PreventCombatDamageToSourceEffect(Duration.EndOfTurn);
effect.setText("and dealt by it this turn");
ability.addEffect(effect);
this.addAbility(ability);
//{T}: Goblin Snowman deals 1 damage to target creature it's blocking. //{T}: Goblin Snowman deals 1 damage to target creature it's blocking.
FilterAttackingCreature filter = new FilterAttackingCreature("creature it's blocking"); FilterAttackingCreature filter = new FilterAttackingCreature("creature it's blocking");
filter.add(new BlockingByPredicate(this.getId())); filter.add(new BlockedByIdPredicate(this.getId()));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(filter)); ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability, new BlockedByWatcher()); this.addAbility(ability);
} }
public GoblinSnowman(final GoblinSnowman card) { public GoblinSnowman(final GoblinSnowman card) {

View file

@ -43,16 +43,15 @@ import mage.cards.CardImpl;
import mage.constants.WatcherScope; import mage.constants.WatcherScope;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterAttackingCreature; import mage.filter.common.FilterAttackingCreature;
import mage.filter.predicate.Predicate;
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.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import mage.watchers.Watcher; import mage.watchers.Watcher;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import mage.filter.predicate.permanent.BlockedByIdPredicate;
/** /**
* *
@ -75,7 +74,7 @@ public class TinderWall extends CardImpl {
this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(Mana.RedMana(2)), new SacrificeSourceCost())); this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(Mana.RedMana(2)), new SacrificeSourceCost()));
// {R}, Sacrifice Tinder Wall: Tinder Wall deals 2 damage to target creature it's blocking. // {R}, Sacrifice Tinder Wall: Tinder Wall deals 2 damage to target creature it's blocking.
FilterAttackingCreature filter = new FilterAttackingCreature("creature it's blocking"); FilterAttackingCreature filter = new FilterAttackingCreature("creature it's blocking");
filter.add(new BlockingByPredicate(this.getId())); filter.add(new BlockedByIdPredicate(this.getId()));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{R}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{R}"));
ability.addTarget(new TargetCreaturePermanent(filter)); ability.addTarget(new TargetCreaturePermanent(filter));
ability.addCost(new SacrificeSourceCost()); ability.addCost(new SacrificeSourceCost());
@ -92,10 +91,9 @@ public class TinderWall extends CardImpl {
} }
} }
class BlockedByWatcher extends Watcher { class BlockedByWatcher extends Watcher {
public List<UUID> blockedByWatcher = new ArrayList<UUID>(); public List<UUID> blockedByWatcher = new ArrayList<>();
public BlockedByWatcher() { public BlockedByWatcher() {
super("BlockedByWatcher", WatcherScope.CARD); super("BlockedByWatcher", WatcherScope.CARD);
@ -127,31 +125,3 @@ class BlockedByWatcher extends Watcher {
} }
} }
class BlockingByPredicate implements Predicate<Permanent> {
private UUID source;
public BlockingByPredicate(UUID source) {
this.source = source;
}
@Override
public boolean apply(Permanent input, Game game) {
BlockedByWatcher watcher = (BlockedByWatcher) game.getState().getWatchers().get("BlockedByWatcher", source);
for(UUID uuid :watcher.blockedByWatcher){
Permanent creature = game.getPermanent(uuid);
if(creature != null && creature.getId().equals(input.getId())){
return true;
}
}
return false;
}
@Override
public String toString() {
return "creature it's blocking";
}
}

View file

@ -29,9 +29,11 @@ package mage.sets.lorwyn;
import java.util.UUID; import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostSourceWhileControlsEffect; import mage.abilities.effects.common.continuous.BoostSourceWhileControlsEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
@ -41,7 +43,6 @@ import mage.constants.Duration;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
/** /**
* *
@ -49,14 +50,6 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
*/ */
public class BoggartSpriteChaser extends CardImpl { public class BoggartSpriteChaser extends CardImpl {
final static private String rule = "{this} has flying as long as you control a Faerie";
private static final FilterPermanent filter = new FilterPermanent("Faerie");
static {
filter.add(new SubtypePredicate("Faerie"));
}
public BoggartSpriteChaser(UUID ownerId) { public BoggartSpriteChaser(UUID ownerId) {
super(ownerId, 156, "Boggart Sprite-Chaser", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); super(ownerId, 156, "Boggart Sprite-Chaser", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}");
this.expansionSetCode = "LRW"; this.expansionSetCode = "LRW";
@ -67,8 +60,15 @@ public class BoggartSpriteChaser extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// As long as you control a Faerie, Boggart Sprite-Chaser gets +1/+1 and has flying. // As long as you control a Faerie, Boggart Sprite-Chaser gets +1/+1 and has flying.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceWhileControlsEffect(filter, 1, 1))); FilterPermanent filter = new FilterPermanent("Faerie", "Faerie");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield), new PermanentsOnTheBattlefieldCondition(filter), rule))); Effect effect = new BoostSourceWhileControlsEffect(filter, 1, 1);
effect.setText("As long as you control a Faerie, {this} gets +1/+1");
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
ability.addEffect(new ConditionalContinuousEffect(
new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield),
new PermanentsOnTheBattlefieldCondition(filter), "and has flying"));
this.addAbility(ability);
} }
public BoggartSpriteChaser(final BoggartSpriteChaser card) { public BoggartSpriteChaser(final BoggartSpriteChaser card) {

View file

@ -25,26 +25,18 @@
* authors and should not be interpreted as representing official policies, either expressed * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package mage.sets.lorwyn; package mage.sets.lorwyn;
import java.util.UUID; import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetControllerEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -53,24 +45,18 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public class FodderLaunch extends CardImpl { public class FodderLaunch extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a Goblin");
static {
filter.add(new SubtypePredicate("Goblin"));
}
public FodderLaunch(UUID ownerId) { public FodderLaunch(UUID ownerId) {
super(ownerId, 114, "Fodder Launch", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{B}"); super(ownerId, 114, "Fodder Launch", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{B}");
this.expansionSetCode = "LRW"; this.expansionSetCode = "LRW";
this.subtype.add("Goblin"); this.subtype.add("Goblin");
//As an additional cost to cast Fodder Launch, sacrifice a Goblin. //As an additional cost to cast Fodder Launch, sacrifice a Goblin.
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, false))); this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("Goblin", "a Goblin"), true)));
//Target creature gets -5/-5 until end of turn. Fodder Launch deals 5 damage to that creature's controller. //Target creature gets -5/-5 until end of turn. Fodder Launch deals 5 damage to that creature's controller.
this.getSpellAbility().addEffect(new BoostTargetEffect(-5, -5, Duration.EndOfTurn)); this.getSpellAbility().addEffect(new BoostTargetEffect(-5, -5, Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new FodderLaunchEffect()); this.getSpellAbility().addEffect(new DamageTargetControllerEffect(5));
} }
public FodderLaunch(final FodderLaunch card) { public FodderLaunch(final FodderLaunch card) {
@ -83,35 +69,3 @@ public class FodderLaunch extends CardImpl {
} }
} }
class FodderLaunchEffect extends OneShotEffect {
public FodderLaunchEffect() {
super(Outcome.Damage);
this.staticText = "Target creature gets -5/-5 until end of turn. Fodder Launch deals 5 damage to that creature's controller.";
}
public FodderLaunchEffect(final FodderLaunchEffect effect) {
super(effect);
}
@Override
public FodderLaunchEffect copy() {
return new FodderLaunchEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller != null && sourceObject != null) {
Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
if (targetCreature != null) {
Player controllerOfTargetCreature = game.getPlayer(targetCreature.getControllerId());
controllerOfTargetCreature.damage(5, source.getSourceId(), game, false, true);
return true;
}
}
return false;
}
}

View file

@ -61,7 +61,7 @@ public class QuillSlingerBoggart extends CardImpl {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Whenever a player casts a Kithkin spell, you may have target player lose 1 life. // Whenever a player casts a Kithkin spell, you may have target player lose 1 life.
Ability ability = new SpellCastAllTriggeredAbility(new LoseLifeTargetEffect(2), filter, true); Ability ability = new SpellCastAllTriggeredAbility(new LoseLifeTargetEffect(1), filter, true);
ability.addTarget(new TargetPlayer()); ability.addTarget(new TargetPlayer());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -28,21 +28,18 @@
package mage.sets.planarchaos; package mage.sets.planarchaos;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.ObjectColor; import mage.ObjectColor;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleEvasionAbility;
import mage.abilities.costs.common.DiscardCardCost; import mage.abilities.costs.common.DiscardCardCost;
import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; import mage.abilities.effects.common.combat.CantBeBlockedByAllTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
@ -55,7 +52,7 @@ import mage.target.common.TargetCreaturePermanent;
* @author BursegSardaukar * @author BursegSardaukar
*/ */
public class FirefrightMage extends CardImpl { public class FirefrightMage extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("except by artifact creatures and/or red creatures"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("except by artifact creatures and/or red creatures");
static { static {
@ -65,7 +62,7 @@ public class FirefrightMage extends CardImpl {
Predicates.and(new CardTypePredicate(CardType.CREATURE), new ColorPredicate(ObjectColor.RED) Predicates.and(new CardTypePredicate(CardType.CREATURE), new ColorPredicate(ObjectColor.RED)
)))); ))));
} }
public FirefrightMage(UUID ownerId) { public FirefrightMage(UUID ownerId) {
super(ownerId, 99, "Firefright Mage", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); super(ownerId, 99, "Firefright Mage", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}");
this.expansionSetCode = "PLC"; this.expansionSetCode = "PLC";
@ -75,8 +72,8 @@ public class FirefrightMage extends CardImpl {
this.power = new MageInt(1); this.power = new MageInt(1);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
//{1} {R}, {T}, Discard a card: Target creature can't be blocked this turn except by artifact creatures and/or red creatures. //{1}{R}, {T}, Discard a card: Target creature can't be blocked this turn except by artifact creatures and/or red creatures.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.EndOfTurn)), Duration.EndOfTurn),new ManaCostsImpl("{1}{R}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedByAllTargetEffect(filter, Duration.EndOfTurn), new ManaCostsImpl("{1}{R}"));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
ability.addCost(new DiscardCardCost()); ability.addCost(new DiscardCardCost());
ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetCreaturePermanent());

View file

@ -32,11 +32,9 @@ import java.util.UUID;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.combat.MustBeBlockedByAtLeastOneSourceEffect; import mage.abilities.effects.common.combat.MustBeBlockedByAtLeastOneSourceEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.HasteAbility;
@ -49,7 +47,7 @@ import mage.constants.Zone;
* @author BursegSardaukar * @author BursegSardaukar
*/ */
public class GoblinFireFiend extends CardImpl { public class GoblinFireFiend extends CardImpl {
public GoblinFireFiend(UUID ownerId) { public GoblinFireFiend(UUID ownerId) {
super(ownerId, 127, "Goblin Fire Fiend", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); super(ownerId, 127, "Goblin Fire Fiend", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.expansionSetCode = "RAV"; this.expansionSetCode = "RAV";
@ -58,16 +56,15 @@ public class GoblinFireFiend extends CardImpl {
this.power = new MageInt(1); this.power = new MageInt(1);
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
//Haste //Haste
this.addAbility(HasteAbility.getInstance()); this.addAbility(HasteAbility.getInstance());
//Goblin Fire Fiend must be blocked if able. //Goblin Fire Fiend must be blocked if able.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MustBeBlockedByAtLeastOneSourceEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MustBeBlockedByAtLeastOneSourceEffect()));
//{R}: Goblin Fire Fiend gets +1/+0 until end of turn. //{R}: Goblin Fire Fiend gets +1/+0 until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(new StaticValue(1), new StaticValue(0), Duration.EndOfTurn), new ManaCostsImpl("{R}")); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}")));
this.addAbility(ability);
} }
public GoblinFireFiend(final GoblinFireFiend card) { public GoblinFireFiend(final GoblinFireFiend card) {

View file

@ -28,9 +28,6 @@
package mage.sets.tempest; package mage.sets.tempest;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -39,7 +36,9 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate; import mage.filter.predicate.permanent.AnotherPredicate;
@ -63,7 +62,8 @@ public class MoggSquad extends CardImpl {
this.power = new MageInt(3); this.power = new MageInt(3);
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Mogg Squad gets -1/-1 for each other creature on the battlefield.
DynamicValue amount = new SignInversionDynamicValue(new PermanentsOnBattlefieldCount(filter)); DynamicValue amount = new SignInversionDynamicValue(new PermanentsOnBattlefieldCount(filter));
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(amount, amount, Duration.WhileOnBattlefield)); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(amount, amount, Duration.WhileOnBattlefield));
this.addAbility(ability); this.addAbility(ability);

View file

@ -0,0 +1,51 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.effects.common.combat;
import mage.abilities.Ability;
import mage.abilities.effects.RestrictionEffect;
import mage.constants.Duration;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author LevelX2
*/
public class CantBeBlockedByAllTargetEffect extends RestrictionEffect {
private final FilterCreaturePermanent filterBlockedBy;
public CantBeBlockedByAllTargetEffect(FilterCreaturePermanent filterBlockedBy, Duration duration) {
super(Duration.WhileOnBattlefield);
this.filterBlockedBy = filterBlockedBy;
staticText = "Target creature"
+ " can't be blocked "
+ (filterBlockedBy.getMessage().startsWith("except by") ? "" : "by ")
+ filterBlockedBy.getMessage();
}
public CantBeBlockedByAllTargetEffect(final CantBeBlockedByAllTargetEffect effect) {
super(effect);
this.filterBlockedBy = effect.filterBlockedBy;
}
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
return getTargetPointer().getTargets(game, source).contains(permanent.getId());
}
@Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
return !filterBlockedBy.match(blocker, source.getSourceId(), source.getControllerId(), game);
}
@Override
public CantBeBlockedByAllTargetEffect copy() {
return new CantBeBlockedByAllTargetEffect(this);
}
}