[Refactor] Merged some similar abilities together

This commit is contained in:
Styxo 2017-01-05 14:12:18 +01:00
parent e4727a1063
commit e057bde150
85 changed files with 412 additions and 845 deletions

View file

@ -35,7 +35,7 @@ import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.game.Game;
import java.util.UUID;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.game.permanent.Permanent;
@ -57,7 +57,7 @@ public class AbattoirGhoul extends CardImpl {
this.addAbility(FirstStrikeAbility.getInstance());
// Whenever a creature dealt damage by Abattoir Ghoul this turn dies, you gain life equal to that creature's toughness.
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AbattoirGhoulEffect(), false));
this.addAbility(new DealtDamageAndDiedTriggeredAbility(new AbattoirGhoulEffect(), false));
}
public AbattoirGhoul(final AbattoirGhoul card) {

View file

@ -30,7 +30,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@ -55,17 +55,16 @@ public class Abomination extends CardImpl {
}
public Abomination(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
this.subtype.add("Horror");
this.power = new MageInt(2);
this.toughness = new MageInt(6);
// Whenever Abomination blocks or becomes blocked by a green or white creature, destroy that creature at end of combat.
Effect effect = new CreateDelayedTriggeredAbilityEffect(
new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true);
Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true);
effect.setText("destroy that creature at end of combat");
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, filter, false));
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false));
}
public Abomination(final Abomination card) {

View file

@ -29,7 +29,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksCreatureTriggeredAbility;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@ -47,20 +47,21 @@ import mage.constants.CardType;
public class AetherMembrane extends CardImpl {
public AetherMembrane(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}{R}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{R}");
this.subtype.add("Wall");
this.power = new MageInt(0);
this.toughness = new MageInt(5);
// Defender; reach
this.addAbility(ReachAbility.getInstance());
// Defender
this.addAbility(DefenderAbility.getInstance());
// Reach
this.addAbility(ReachAbility.getInstance());
// Whenever Aether Membrane blocks a creature, return that creature to its owner's hand at end of combat.
Effect effect = new ReturnToHandTargetEffect();
effect.setText("return that creature to its owner's hand at end of combat");
this.addAbility(new BlocksCreatureTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(
new AtTheEndOfCombatDelayedTriggeredAbility(effect)), false, true));
this.addAbility(new BlocksTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(effect)), false, true));
}
public AetherMembrane(final AetherMembrane card) {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BecomesColorTargetEffect;
import mage.cards.CardImpl;
@ -46,7 +46,7 @@ import mage.constants.Duration;
public class AislingLeprechaun extends CardImpl {
public AislingLeprechaun(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}");
this.subtype.add("Faerie");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
@ -54,7 +54,7 @@ public class AislingLeprechaun extends CardImpl {
// Whenever Aisling Leprechaun blocks or becomes blocked by a creature, that creature becomes green.
Effect effect = new BecomesColorTargetEffect(ObjectColor.GREEN, Duration.EndOfGame);
effect.setText("that creature becomes green");
Ability ability = new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, false);
Ability ability = new BlocksOrBecomesBlockedTriggeredAbility(effect, false);
this.addAbility(ability);
}

View file

@ -30,7 +30,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -42,7 +42,7 @@ import mage.cards.CardSetInfo;
public class AshmouthHound extends CardImpl {
public AshmouthHound(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("Elemental");
this.subtype.add("Hound");
@ -50,7 +50,7 @@ public class AshmouthHound extends CardImpl {
this.toughness = new MageInt(1);
// Whenever Ashmouth Hound blocks or becomes blocked by a creature, Ashmouth Hound deals 1 damage to that creature.
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(new DamageTargetEffect(1, true, "that creature"), false));
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new DamageTargetEffect(1, true, "that creature"), false));
}
public AshmouthHound(final AshmouthHound card) {

View file

@ -30,7 +30,7 @@ package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetControllerEffect;
import mage.abilities.effects.common.DamageTargetEffect;
@ -45,13 +45,13 @@ import mage.constants.CardType;
public class AssembledAlphas extends CardImpl {
public AssembledAlphas(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("Wolf");
this.power = new MageInt(5);
this.toughness = new MageInt(5);
// Whenever Assembled Alphas blocks or becomes blocked by a creature, Assembled Alphas deals 3 damage to that creature and 3 damage to that creature's controller.
Ability ability = new BlocksOrBecomesBlockedByCreatureTriggeredAbility(new DamageTargetEffect(3, true, "that creature"), false);
Ability ability = new BlocksOrBecomesBlockedTriggeredAbility(new DamageTargetEffect(3, true, "that creature"), false);
Effect effect = new DamageTargetControllerEffect(3);
effect.setText("and 3 damage to that creature's controller");
ability.addEffect(effect);

View file

@ -30,12 +30,15 @@ package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.AnotherCreatureEntersBattlefieldTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
/**
*
@ -43,8 +46,14 @@ import mage.constants.CardType;
*/
public class AuriokChampion extends CardImpl {
private static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature");
static {
filter.add(new AnotherPredicate());
}
public AuriokChampion(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{W}");
this.subtype.add("Human");
this.subtype.add("Cleric");
@ -53,8 +62,9 @@ public class AuriokChampion extends CardImpl {
// Protection from black and from red
this.addAbility(ProtectionAbility.from(ObjectColor.BLACK, ObjectColor.RED));
// Whenever another creature enters the battlefield, you may gain 1 life.
this.addAbility(new AnotherCreatureEntersBattlefieldTriggeredAbility(new GainLifeEffect(1), true));
this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), filter, true));
}

View file

@ -30,7 +30,7 @@ package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.RegenerateTargetEffect;
@ -70,7 +70,7 @@ public class BaronSengir extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Whenever a creature dealt damage by Baron Sengir this turn dies, put a +2/+2 counter on Baron Sengir.
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P2P2.createInstance()), false));
this.addAbility(new DealtDamageAndDiedTriggeredAbility(new AddCountersSourceEffect(CounterType.P2P2.createInstance()), false));
// {tap}: Regenerate another target Vampire.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new TapSourceCost());

View file

@ -29,7 +29,7 @@ package mage.cards.b;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.DamageDealtToAttachedTriggeredAbility;
import mage.abilities.common.DealtDamageAttachedTriggeredAbility;
import mage.abilities.dynamicvalue.common.NumericSetToEffectValues;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
@ -63,7 +63,7 @@ public class BindingAgony extends CardImpl {
// Whenever enchanted creature is dealt damage, Binding Agony deals that much damage to that creature's controller.
Effect effect = new DamageTargetEffect(new NumericSetToEffectValues("that much", "damage"));
effect.setText("{this} deals that much damage to that creature's controller");
this.addAbility(new DamageDealtToAttachedTriggeredAbility(Zone.BATTLEFIELD, effect, false, SetTargetPointer.PLAYER));
this.addAbility(new DealtDamageAttachedTriggeredAbility(Zone.BATTLEFIELD, effect, false, SetTargetPointer.PLAYER));
}
public BindingAgony(final BindingAgony card) {

View file

@ -30,7 +30,7 @@ package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.DamageTargetEffect;
@ -61,7 +61,7 @@ public class BloodCultist extends CardImpl {
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
// Whenever a creature dealt damage by Blood Cultist this turn dies, put a +1/+1 counter on Blood Cultist.
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance())));
this.addAbility(new DealtDamageAndDiedTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance())));
}
public BloodCultist(final BloodCultist card) {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.BlocksCreatureTriggeredAbility;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.VigilanceAbility;
@ -53,7 +53,7 @@ import mage.game.permanent.token.CatSoldierCreatureToken;
public class BrimazKingOfOreskos extends CardImpl {
public BrimazKingOfOreskos(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{W}");
this.supertype.add("Legendary");
this.subtype.add("Cat");
this.subtype.add("Soldier");
@ -68,7 +68,7 @@ public class BrimazKingOfOreskos extends CardImpl {
this.addAbility(new AttacksTriggeredAbility(new CreateTokenEffect(new CatSoldierCreatureToken(), 1, false, true), false));
// Whenever Brimaz blocks a creature, create a 1/1 white Cat Soldier creature token with vigilance blocking that creature.
this.addAbility(new BlocksCreatureTriggeredAbility(new BrimazKingOfOreskosEffect(), false, true));
this.addAbility(new BlocksTriggeredAbility(new BrimazKingOfOreskosEffect(), false, true));
}
public BrimazKingOfOreskos(final BrimazKingOfOreskos card) {

View file

@ -32,7 +32,7 @@ package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.FlipSourceEffect;
import mage.abilities.keyword.BushidoAbility;
@ -68,7 +68,7 @@ public class BushiTenderfoot extends CardImpl {
// When that creature is put into a graveyard this turn, flip Initiate of Blood.
Effect effect = new FlipSourceEffect(new KenzoTheHardhearted());
effect.setText("flip {this}");
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(effect));
this.addAbility(new DealtDamageAndDiedTriggeredAbility(effect));
}
public BushiTenderfoot(final BushiTenderfoot card) {

View file

@ -30,7 +30,6 @@ package mage.cards.c;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersAnotherCreatureYourControlTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.RestrictionEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
@ -43,14 +42,23 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
/**
* @author noxx
*/
public class ChampionOfLambholt extends CardImpl {
private static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature");
static {
filter.add(new AnotherPredicate());
}
public ChampionOfLambholt(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{G}");
this.subtype.add("Human");
this.subtype.add("Warrior");
@ -61,7 +69,8 @@ public class ChampionOfLambholt extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ChampionOfLambholtEffect()));
// Whenever another creature enters the battlefield under your control, put a +1/+1 counter on Champion of Lambholt.
this.addAbility(new EntersAnotherCreatureYourControlTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance())));
this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), filter, false, null, true));
}
public ChampionOfLambholt(final ChampionOfLambholt card) {
@ -87,20 +96,14 @@ class ChampionOfLambholtEffect extends RestrictionEffect {
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (sourcePermanent != null) {
return true;
}
return false;
return true;
}
@Override
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) {
if (attacker != null && blocker != null) {
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (sourcePermanent != null && attacker.getControllerId().equals(sourcePermanent.getControllerId())) {
return blocker.getPower().getValue() >= sourcePermanent.getPower().getValue();
}
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (sourcePermanent != null && attacker.getControllerId().equals(sourcePermanent.getControllerId())) {
return blocker.getPower().getValue() >= sourcePermanent.getPower().getValue();
}
return true;
}

View file

@ -29,7 +29,7 @@ package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@ -55,7 +55,7 @@ public class Cockatrice extends CardImpl {
}
public Cockatrice(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}");
this.subtype.add("Cockatrice");
this.power = new MageInt(2);
@ -63,11 +63,11 @@ public class Cockatrice extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever Cockatrice blocks or becomes blocked by a non-Wall creature, destroy that creature at end of combat.
Effect effect = new CreateDelayedTriggeredAbilityEffect(
new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true);
Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true);
effect.setText("destroy that creature at end of combat");
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, filter, false));
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false));
}
public Cockatrice(final Cockatrice card) {

View file

@ -30,7 +30,7 @@ package mage.cards.d;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@ -55,17 +55,16 @@ public class Deathgazer extends CardImpl {
}
public Deathgazer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
this.subtype.add("Lizard");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Whenever Deathgazer blocks or becomes blocked by a nonblack creature, destroy that creature at end of combat.
Effect effect = new CreateDelayedTriggeredAbilityEffect(
new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true);
Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true);
effect.setText("destroy that creature at end of combat");
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, filter, false));
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false));
}

View file

@ -33,16 +33,13 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.RestrictionEffect;
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesWithLessPowerEffect;
import mage.abilities.keyword.MorphAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCardInYourGraveyard;
/**
@ -52,14 +49,14 @@ import mage.target.common.TargetCardInYourGraveyard;
public class DenProtector extends CardImpl {
public DenProtector(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("Human");
this.subtype.add("Warrior");
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Creatures with power less than Den Protector's power can't block it.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DenProtectorRestrictionEffect()));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByCreaturesWithLessPowerEffect()));
// Megamorph {1}{G}
this.addAbility(new MorphAbility(this, new ManaCostsImpl("{1}{G}"), true));
@ -80,30 +77,3 @@ public class DenProtector extends CardImpl {
return new DenProtector(this);
}
}
class DenProtectorRestrictionEffect extends RestrictionEffect {
public DenProtectorRestrictionEffect() {
super(Duration.WhileOnBattlefield);
staticText = "Creatures with power less than {this}'s power can't block it";
}
public DenProtectorRestrictionEffect(final DenProtectorRestrictionEffect effect) {
super(effect);
}
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
return permanent.getId().equals(source.getSourceId());
}
@Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
return (blocker.getPower().getValue() >= attacker.getPower().getValue());
}
@Override
public DenProtectorRestrictionEffect copy() {
return new DenProtectorRestrictionEffect(this);
}
}

View file

@ -36,7 +36,7 @@ import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.OneShotEffect;
@ -63,7 +63,7 @@ public class DreadSlaver extends CardImpl {
this.toughness = new MageInt(5);
// Whenever a creature dealt damage by Dread Slaver this turn dies, return it to the battlefield under your control. That creature is a black Zombie in addition to its other colors and types.
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new DreadSlaverEffect(), false));
this.addAbility(new DealtDamageAndDiedTriggeredAbility(new DreadSlaverEffect(), false));
}
public DreadSlaver(final DreadSlaver card) {

View file

@ -30,7 +30,7 @@ package mage.cards.d;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@ -47,7 +47,7 @@ import mage.filter.predicate.mageobject.ColorPredicate;
* @author djbrez
*/
public class DreadSpecter extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature");
static {
@ -55,16 +55,15 @@ public class DreadSpecter extends CardImpl {
}
public DreadSpecter(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
this.subtype.add("Specter");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Whenever Dread Specter blocks or becomes blocked by a nonblack creature, destroy that creature at end of combat.
Effect effect = new CreateDelayedTriggeredAbilityEffect(
new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true);
Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true);
effect.setText("destroy that creature at end of combat");
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, filter, false));
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false));
}
public DreadSpecter(final DreadSpecter card) {

View file

@ -29,7 +29,7 @@ package mage.cards.d;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.DamageDealtToAttachedTriggeredAbility;
import mage.abilities.common.DealtDamageAttachedTriggeredAbility;
import mage.abilities.dynamicvalue.common.NumericSetToEffectValues;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
@ -66,7 +66,7 @@ public class DruidsCall extends CardImpl {
// Whenever enchanted creature is dealt damage, its controller creates that many 1/1 green Squirrel creature tokens.
Effect effect = new CreateTokenTargetEffect(new SquirrelToken(), new NumericSetToEffectValues("that much", "damage"));
effect.setText("its controller creates that many 1/1 green Squirrel creature tokens");
this.addAbility(new DamageDealtToAttachedTriggeredAbility(Zone.BATTLEFIELD, effect, false, SetTargetPointer.PLAYER));
this.addAbility(new DealtDamageAttachedTriggeredAbility(Zone.BATTLEFIELD, effect, false, SetTargetPointer.PLAYER));
}
public DruidsCall(final DruidsCall card) {

View file

@ -29,7 +29,7 @@ package mage.cards.d;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -43,17 +43,15 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public class DwarvenSoldier extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Orc", "Orc creature");
public DwarvenSoldier(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("Dwarf");
this.subtype.add("Soldier");
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Whenever Dwarven Soldier blocks or becomes blocked by one or more Orcs, Dwarven Soldier gets +0/+2 until end of turn.
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(new BoostSourceEffect(0, 2, Duration.EndOfTurn), filter, false));
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new BoostSourceEffect(0, 2, Duration.EndOfTurn), new FilterCreaturePermanent("Orc", "Orc creature"), false));
}
public DwarvenSoldier(final DwarvenSoldier card) {

View file

@ -25,13 +25,12 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.e;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
@ -48,20 +47,20 @@ import mage.players.Player;
*/
public class EngulfingSlagwurm extends CardImpl {
public EngulfingSlagwurm (UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{G}{G}");
public EngulfingSlagwurm(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}{G}");
this.subtype.add("Wurm");
this.power = new MageInt(7);
this.toughness = new MageInt(7);
// Whenever Engulfing Slagwurm blocks or becomes blocked by a creature, destroy that creature. You gain life equal to that creature's toughness.
Ability ability = new BlocksOrBecomesBlockedByCreatureTriggeredAbility(new DestroyTargetEffect(), false);
Ability ability = new BlocksOrBecomesBlockedTriggeredAbility(new DestroyTargetEffect(), false);
ability.addEffect(new EngulfingSlagwurmEffect());
this.addAbility(ability);
}
public EngulfingSlagwurm (final EngulfingSlagwurm card) {
public EngulfingSlagwurm(final EngulfingSlagwurm card) {
super(card);
}
@ -73,6 +72,7 @@ public class EngulfingSlagwurm extends CardImpl {
}
class EngulfingSlagwurmEffect extends OneShotEffect {
EngulfingSlagwurmEffect() {
super(Outcome.GainLife);
staticText = "You gain life equal to that creature's toughness";

View file

@ -30,7 +30,7 @@ package mage.cards.f;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.keyword.FlyingAbility;
@ -46,7 +46,7 @@ import mage.constants.Duration;
public class FlailingDrake extends CardImpl {
public FlailingDrake(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
this.subtype.add("Drake");
this.power = new MageInt(2);
this.toughness = new MageInt(3);
@ -56,7 +56,7 @@ public class FlailingDrake extends CardImpl {
// Whenever Flailing Drake blocks or becomes blocked by a creature, that creature gets +1/+1 until end of turn.
Effect effect = new BoostTargetEffect(+1, +1, Duration.EndOfTurn);
effect.setText("that creature gets +1/+1 until end of turn");
Ability ability = new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, false);
Ability ability = new BlocksOrBecomesBlockedTriggeredAbility(effect, false);
this.addAbility(ability);
}

View file

@ -31,7 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.condition.common.TwoOrMoreSpellsWereCastLastTurnCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.DamageTargetEffect;
@ -49,7 +49,7 @@ import mage.constants.TargetController;
public class FlameheartWerewolf extends CardImpl {
public FlameheartWerewolf(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "");
this.subtype.add("Werewolf");
this.power = new MageInt(3);
this.toughness = new MageInt(2);
@ -60,7 +60,7 @@ public class FlameheartWerewolf extends CardImpl {
this.transformable = true;
// Whenever Flameheart Werewolf blocks or becomes blocked by a creature, Flameheart Werewolf deals 2 damage to that creature.
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(new DamageTargetEffect(2, true, "that creature"), false));
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new DamageTargetEffect(2, true, "that creature"), false));
// At the beginning of each upkeep, if a player cast two or more spells last turn, transform Flameheart Werewolf.
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false);

View file

@ -29,7 +29,7 @@ package mage.cards.f;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.DamageDealtToAttachedTriggeredAbility;
import mage.abilities.common.DealtDamageAttachedTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DestroyAttachedEffect;
@ -62,7 +62,7 @@ public class FrozenSolid extends CardImpl {
// Enchanted creature doesn't untap during its controller's untap step.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepEnchantedEffect()));
// When enchanted creature is dealt damage, destroy it.
this.addAbility(new DamageDealtToAttachedTriggeredAbility(new DestroyAttachedEffect("it"), false));
this.addAbility(new DealtDamageAttachedTriggeredAbility(new DestroyAttachedEffect("it"), false));
}
public FrozenSolid(final FrozenSolid card) {

View file

@ -30,7 +30,7 @@ package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility;
@ -60,7 +60,7 @@ public class GarzaZolPlagueQueen extends CardImpl {
this.addAbility(HasteAbility.getInstance());
// Whenever a creature dealt damage by Garza Zol, Plague Queen this turn dies, put a +1/+1 counter on Garza Zol.
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance())));
this.addAbility(new DealtDamageAndDiedTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance())));
// Whenever Garza Zol deals combat damage to a player, you may draw a card.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardSourceControllerEffect(1), true));

View file

@ -30,7 +30,7 @@ package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
@ -50,18 +50,24 @@ import mage.abilities.effects.common.DoUnlessControllerPaysEffect;
public class GoblinFlotilla extends CardImpl {
public GoblinFlotilla(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("Goblin");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Islandwalk
this.addAbility(new IslandwalkAbility());
// At the beginning of each combat, unless you pay {R}, whenever Goblin Flotilla blocks or becomes blocked by a creature this combat, that creature gains first strike until end of turn.
this.addAbility(new BeginningOfCombatTriggeredAbility(new DoUnlessControllerPaysEffect(
new GainAbilitySourceEffect(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, "Blocks or Blocked by Goblin Flotilla"), false), Duration.EndOfCombat)
//new GoblinFlotillaEffect()
, new ManaCostsImpl("{R}"), "Pay Goblin Flotilla combat effect?"), TargetController.ANY, false));
this.addAbility(new BeginningOfCombatTriggeredAbility(
new DoUnlessControllerPaysEffect(
new GainAbilitySourceEffect(new BlocksOrBecomesBlockedTriggeredAbility(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, "Blocks or Blocked by Goblin Flotilla"), false), Duration.EndOfCombat),
new ManaCostsImpl("{R}"),
"Pay Goblin Flotilla combat effect?"
),
TargetController.ANY,
false
));
}
public GoblinFlotilla(final GoblinFlotilla card) {
@ -73,19 +79,3 @@ public class GoblinFlotilla extends CardImpl {
return new GoblinFlotilla(this);
}
}
/*
class GoblinFlotillaEffect extends OneShotEffect {
GoblinFlotillaEffect() {
super(Outcome.BoostCreature);
staticText = "unless you pay {R}, whenever Goblin Flotilla blocks or becomes blocked by a creature this combat, that creature gains first strike until end of turn.";
}
GoblinFlotillaEffect(final GoblinFlotillaEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
new GainAbilitySourceEffect(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), false), Duration.EndOfCombat);
}
}*/

View file

@ -27,23 +27,31 @@
*/
package mage.cards.g;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.common.EntersAnotherCreatureYourControlTriggeredAbility;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.Duration;
import java.util.UUID;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
/**
* @author Loki
*/
public class GoldnightCommander extends CardImpl {
private static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature");
static {
filter.add(new AnotherPredicate());
}
public GoldnightCommander(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("Human");
this.subtype.add("Cleric");
this.subtype.add("Soldier");
@ -52,7 +60,7 @@ public class GoldnightCommander extends CardImpl {
this.toughness = new MageInt(2);
// Whenever another creature enters the battlefield under your control, creatures you control get +1/+1 until end of turn.
this.addAbility(new EntersAnotherCreatureYourControlTriggeredAbility(new BoostControlledEffect(1, 1, Duration.EndOfTurn)));
this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.EndOfTurn), filter, false, null, true));
}
public GoldnightCommander(final GoldnightCommander card) {
@ -63,4 +71,4 @@ public class GoldnightCommander extends CardImpl {
public GoldnightCommander copy() {
return new GoldnightCommander(this);
}
}
}

View file

@ -30,7 +30,7 @@ package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
@ -57,16 +57,16 @@ public class GorgonRecluse extends CardImpl {
}
public GorgonRecluse(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
this.subtype.add("Gorgon");
this.power = new MageInt(2);
this.toughness = new MageInt(4);
// Whenever Gorgon Recluse blocks or becomes blocked by a nonblack creature, destroy that creature at end of combat.
Effect effect = new CreateDelayedTriggeredAbilityEffect(
new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true);
Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true);
effect.setText("destroy that creature at end of combat");
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, filter, false));
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false));
// Madness {B}{B}
this.addAbility(new MadnessAbility(this, new ManaCostsImpl("{B}{B}")));
}

View file

@ -1,64 +0,0 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.mana.GreenManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
/**
*
* @author Styxo
*/
public class GreenbeltDruid extends CardImpl {
public GreenbeltDruid(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
this.subtype.add("Elf");
this.subtype.add("Druid");
this.power = new MageInt(1);
this.toughness = new MageInt(3);
// {T}: Add G to your mana pool.
this.addAbility(new GreenManaAbility());
}
public GreenbeltDruid(final GreenbeltDruid card) {
super(card);
}
@Override
public GreenbeltDruid copy() {
return new GreenbeltDruid(this);
}
}

View file

@ -28,15 +28,17 @@
package mage.cards.g;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.common.EntersAnotherCreatureYourControlTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
/**
*
@ -44,8 +46,14 @@ import mage.constants.Duration;
*/
public class GriffinProtector extends CardImpl {
private static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature");
static {
filter.add(new AnotherPredicate());
}
public GriffinProtector(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("Griffin");
this.power = new MageInt(2);
@ -53,8 +61,10 @@ public class GriffinProtector extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever another creature enters the battlefield under your control, Griffin Protector gets +1/+1 until end of turn.
this.addAbility(new EntersAnotherCreatureYourControlTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn)));
this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), filter, false, null, true));
}
public GriffinProtector(final GriffinProtector card) {

View file

@ -29,7 +29,7 @@ package mage.cards.g;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.DiscardedByOpponentTrigger;
import mage.abilities.common.DiscardedByOpponentTriggerAbility;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -50,7 +50,7 @@ public class GuerrillaTactics extends CardImpl {
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
// When a spell or ability an opponent controls causes you to discard Guerrilla Tactics, Guerrilla Tactics deals 4 damage to target creature or player.
Ability ability = new DiscardedByOpponentTrigger(new DamageTargetEffect(4));
Ability ability = new DiscardedByOpponentTriggerAbility(new DamageTargetEffect(4));
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
}

View file

@ -30,10 +30,13 @@ package mage.cards.h;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.common.EntersAnotherCreatureYourControlTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
/**
*
@ -41,8 +44,14 @@ import mage.cards.CardSetInfo;
*/
public class HealerOfThePride extends CardImpl {
private static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature");
static {
filter.add(new AnotherPredicate());
}
public HealerOfThePride(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("Cat");
this.subtype.add("Cleric");
@ -50,7 +59,8 @@ public class HealerOfThePride extends CardImpl {
this.toughness = new MageInt(3);
// Whenever another creature enters the battlefield under your control, you gain 2 life.
this.addAbility(new EntersAnotherCreatureYourControlTriggeredAbility(new GainLifeEffect(2)));
this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(2), filter, false, null, true));
}
public HealerOfThePride(final HealerOfThePride card) {

View file

@ -30,7 +30,7 @@ package mage.cards.i;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -42,14 +42,14 @@ import mage.cards.CardSetInfo;
public class InfernoElemental extends CardImpl {
public InfernoElemental(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}{R}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{R}");
this.subtype.add("Elemental");
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Whenever Inferno Elemental blocks or becomes blocked by a creature, Inferno Elemental deals 3 damage to that creature.
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(new DamageTargetEffect(3, true, "that creature"), false));
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new DamageTargetEffect(3, true, "that creature"), false));
}
public InfernoElemental(final InfernoElemental card) {

View file

@ -32,7 +32,7 @@ package mage.cards.i;
import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.DamageTargetEffect;
@ -74,7 +74,7 @@ public class InitiateOfBlood extends CardImpl {
this.addAbility(ability);
// When that creature is put into a graveyard this turn, flip Initiate of Blood.
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new FlipSourceEffect(new GokaTheUnjust())));
this.addAbility(new DealtDamageAndDiedTriggeredAbility(new FlipSourceEffect(new GokaTheUnjust())));
}

View file

@ -43,7 +43,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
*
* @author Styxo
*/
public class InspirationalMonuments extends CardImpl {
public class InspiringStatuary extends CardImpl {
private static final FilterSpell filter = new FilterSpell("non-artifact spells you cast");
@ -51,7 +51,7 @@ public class InspirationalMonuments extends CardImpl {
filter.add(Predicates.not(new CardTypePredicate(CardType.ARTIFACT)));
}
public InspirationalMonuments(UUID ownerId, CardSetInfo setInfo) {
public InspiringStatuary(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
// Non-artifact spells you cast have improvise.
@ -59,12 +59,12 @@ public class InspirationalMonuments extends CardImpl {
}
public InspirationalMonuments(final InspirationalMonuments card) {
public InspiringStatuary(final InspiringStatuary card) {
super(card);
}
@Override
public InspirationalMonuments copy() {
return new InspirationalMonuments(this);
public InspiringStatuary copy() {
return new InspiringStatuary(this);
}
}

View file

@ -29,7 +29,7 @@ package mage.cards.k;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksCreatureTriggeredAbility;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@ -46,19 +46,19 @@ import mage.constants.CardType;
public class KaijinOfTheVanishingTouch extends CardImpl {
public KaijinOfTheVanishingTouch(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("Spirit");
this.power = new MageInt(0);
this.toughness = new MageInt(3);
// Defender (This creature can't attack.)
// Defender
this.addAbility(DefenderAbility.getInstance());
// Whenever Kaijin of the Vanishing Touch blocks a creature, return that creature to its owner's hand at end of combat. (Return it only if it's on the battlefield.)
// Whenever Kaijin of the Vanishing Touch blocks a creature, return that creature to its owner's hand at end of combat.
Effect effect = new ReturnToHandTargetEffect();
effect.setText("return that creature to its owner's hand at end of combat");
this.addAbility(new BlocksCreatureTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(
new AtTheEndOfCombatDelayedTriggeredAbility(effect)), false, true));
this.addAbility(new BlocksTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(effect)), false, true));
}
public KaijinOfTheVanishingTouch(final KaijinOfTheVanishingTouch card) {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.condition.common.NoSpellsWereCastLastTurnCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.DamageTargetEffect;
@ -50,7 +50,7 @@ import mage.constants.TargetController;
public class KessigForgemaster extends CardImpl {
public KessigForgemaster(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("Human");
this.subtype.add("Shaman");
this.subtype.add("Werewolf");
@ -61,7 +61,7 @@ public class KessigForgemaster extends CardImpl {
this.secondSideCardClazz = FlameheartWerewolf.class;
// Whenever Kessig Forgemaster blocks or becomes blocked by a creature, Kessig Forgemaster deals 1 damage to that creature.
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(new DamageTargetEffect(1, true, "that creature"), false));
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new DamageTargetEffect(1, true, "that creature"), false));
// At the beginning of each upkeep, if no spells were cast last turn, transform Kessig Forgemaster.
this.addAbility(new TransformAbility());

View file

@ -25,7 +25,6 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.l;
import java.util.UUID;
@ -33,7 +32,7 @@ import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksCreatureTriggeredAbility;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -47,8 +46,8 @@ import mage.game.permanent.Permanent;
*/
public class LoyalSentry extends CardImpl {
public LoyalSentry (UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}");
public LoyalSentry(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}");
this.subtype.add("Human");
this.subtype.add("Soldier");
@ -56,10 +55,10 @@ public class LoyalSentry extends CardImpl {
this.toughness = new MageInt(1);
// When Loyal Sentry blocks a creature, destroy that creature and Loyal Sentry.
this.addAbility(new BlocksCreatureTriggeredAbility(new LoyalSentryEffect(), false, true));
this.addAbility(new BlocksTriggeredAbility(new LoyalSentryEffect(), false, true));
}
public LoyalSentry (final LoyalSentry card) {
public LoyalSentry(final LoyalSentry card) {
super(card);
}
@ -70,6 +69,7 @@ public class LoyalSentry extends CardImpl {
}
class LoyalSentryEffect extends OneShotEffect {
LoyalSentryEffect() {
super(Outcome.DestroyPermanent);
staticText = "destroy that creature and {this}";
@ -81,7 +81,7 @@ class LoyalSentryEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent p = game.getPermanent(getTargetPointer().getFirst(game, source));
Permanent p = game.getPermanent(getTargetPointer().getFirst(game, source));
if (p != null) {
p.destroy(source.getSourceId(), game, false);
}

View file

@ -30,7 +30,7 @@ package mage.cards.m;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksCreatureTriggeredAbility;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.abilities.keyword.VigilanceAbility;
@ -48,7 +48,7 @@ import mage.game.permanent.Permanent;
public class Meglonoth extends CardImpl {
public Meglonoth(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}{G}{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}{G}{W}");
this.subtype.add("Beast");
this.power = new MageInt(6);
@ -61,7 +61,7 @@ public class Meglonoth extends CardImpl {
this.addAbility(TrampleAbility.getInstance());
// Whenever Meglonoth blocks a creature, Meglonoth deals damage to that creature's controller equal to Meglonoth's power.
this.addAbility(new BlocksCreatureTriggeredAbility(new MeglonothEffect(), false, true));
this.addAbility(new BlocksTriggeredAbility(new MeglonothEffect(), false, true));
}

View file

@ -30,7 +30,7 @@ package mage.cards.m;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiscardedByOpponentTrigger;
import mage.abilities.common.DiscardedByOpponentTriggerAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
@ -51,7 +51,7 @@ public class Metrognome extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
// When a spell or ability an opponent controls causes you to discard Metrognome, create four 1/1 colorless Gnome artifact creature tokens.
this.addAbility(new DiscardedByOpponentTrigger(new CreateTokenEffect(new GnomeToken(), 4)));
this.addAbility(new DiscardedByOpponentTriggerAbility(new CreateTokenEffect(new GnomeToken(), 4)));
// {4}, {tap}: Create a 1/1 colorless Gnome artifact creature token.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new GnomeToken()), new ManaCostsImpl("{4}"));

View file

@ -29,7 +29,7 @@ package mage.cards.m;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.DamageDealtToAttachedTriggeredAbility;
import mage.abilities.common.DealtDamageAttachedTriggeredAbility;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DestroyAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
@ -58,7 +58,7 @@ public class MireBlight extends CardImpl {
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// When enchanted creature is dealt damage, destroy it.
this.addAbility(new DamageDealtToAttachedTriggeredAbility(new DestroyAttachedEffect("it"), false));
this.addAbility(new DealtDamageAttachedTriggeredAbility(new DestroyAttachedEffect("it"), false));
}
public MireBlight(final MireBlight card) {

View file

@ -29,7 +29,7 @@ package mage.cards.m;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.DamageDealtToAttachedTriggeredAbility;
import mage.abilities.common.DealtDamageAttachedTriggeredAbility;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DestroyAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
@ -57,7 +57,7 @@ public class MortalWound extends CardImpl {
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// When enchanted creature is dealt damage, destroy it.
this.addAbility(new DamageDealtToAttachedTriggeredAbility(new DestroyAttachedEffect("it"), false));
this.addAbility(new DealtDamageAttachedTriggeredAbility(new DestroyAttachedEffect("it"), false));
}
public MortalWound(final MortalWound card) {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl;
@ -58,7 +58,7 @@ public class PredatorOoze extends CardImpl {
this.addAbility(new AttacksTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false));
// Whenever a creature dealt damage by Predator Ooze this turn dies, put a +1/+1 counter on Predator Ooze.
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance())));
this.addAbility(new DealtDamageAndDiedTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance())));
}
public PredatorOoze(final PredatorOoze card) {

View file

@ -29,7 +29,7 @@ package mage.cards.q;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DiscardedByOpponentTrigger;
import mage.abilities.common.DiscardedByOpponentTriggerAbility;
import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.abilities.keyword.ShroudAbility;
import mage.abilities.keyword.SplitSecondAbility;
@ -56,7 +56,7 @@ public class Quagnoth extends CardImpl {
this.addAbility(ShroudAbility.getInstance());
// When a spell or ability an opponent controls causes you to discard Quagnoth, return it to your hand.
this.addAbility(new DiscardedByOpponentTrigger(new ReturnToHandSourceEffect()));
this.addAbility(new DiscardedByOpponentTriggerAbility(new ReturnToHandSourceEffect()));
}
public Quagnoth(final Quagnoth card) {

View file

@ -29,7 +29,7 @@
package mage.cards.r;
import java.util.UUID;
import mage.abilities.common.DamageDealtToAttachedTriggeredAbility;
import mage.abilities.common.DealtDamageAttachedTriggeredAbility;
import mage.abilities.dynamicvalue.common.NumericSetToEffectValues;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
@ -68,7 +68,7 @@ public class RaggedVeins extends CardImpl {
// Whenever enchanted creature is dealt damage, its controller loses that much life.
Effect effect = new LoseLifeTargetEffect(new NumericSetToEffectValues("that much", "damage"));
effect.setText("its controller loses that much life");
this.addAbility(new DamageDealtToAttachedTriggeredAbility(Zone.BATTLEFIELD, effect, false, SetTargetPointer.PLAYER));
this.addAbility(new DealtDamageAttachedTriggeredAbility(Zone.BATTLEFIELD, effect, false, SetTargetPointer.PLAYER));
}
public RaggedVeins(final RaggedVeins card) {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.CardsInControllerGraveCondition;
@ -74,7 +74,7 @@ public class RepentantVampire extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever a creature dealt damage by Repentant Vampire this turn dies, put a +1/+1 counter on Repentant Vampire.
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false));
this.addAbility(new DealtDamageAndDiedTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false));
// Threshold - As long as seven or more cards are in your graveyard, Repentant Vampire is white and has "{tap}: Destroy target black creature."
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new BecomesColorSourceEffect(ObjectColor.WHITE, Duration.WhileOnBattlefield),

View file

@ -29,7 +29,7 @@ package mage.cards.r;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@ -54,7 +54,7 @@ public class RockBasilisk extends CardImpl {
}
public RockBasilisk(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{G}");
this.subtype.add("Basilisk");
this.power = new MageInt(4);
@ -64,7 +64,7 @@ public class RockBasilisk extends CardImpl {
Effect effect = new CreateDelayedTriggeredAbilityEffect(
new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true);
effect.setText("destroy that creature at end of combat");
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, filter, false));
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false));
}
public RockBasilisk(final RockBasilisk card) {

View file

@ -30,7 +30,7 @@ package mage.cards.r;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.keyword.InfectAbility;
import mage.cards.CardImpl;
@ -51,7 +51,7 @@ public class RotWolf extends CardImpl {
this.addAbility(InfectAbility.getInstance());
// Whenever a creature dealt damage by Rot Wolf this turn dies, you may draw a card.
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new DrawCardSourceControllerEffect(1), true));
this.addAbility(new DealtDamageAndDiedTriggeredAbility(new DrawCardSourceControllerEffect(1), true));
}
public RotWolf(final RotWolf card) {

View file

@ -29,7 +29,7 @@ package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
@ -52,7 +52,7 @@ public class SengirBats extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever a creature dealt damage by Sengir Bats this turn dies, put a +1/+1 counter on Sengir Bats.
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false));
this.addAbility(new DealtDamageAndDiedTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false));
}
public SengirBats(final SengirBats card) {

View file

@ -29,7 +29,7 @@ package mage.cards.s;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
@ -53,7 +53,7 @@ public class SengirVampire extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Whenever a creature dealt damage by Sengir Vampire this turn dies, put a +1/+1 counter on Sengir Vampire.
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false));
this.addAbility(new DealtDamageAndDiedTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false));
}
public SengirVampire(final SengirVampire card) {

View file

@ -30,7 +30,7 @@ package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
@ -51,7 +51,7 @@ import mage.players.Player;
public class ShapeStealer extends CardImpl {
public ShapeStealer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{U}{U}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{U}");
this.subtype.add("Shapeshifter");
this.subtype.add("Spirit");
this.power = new MageInt(1);
@ -62,7 +62,7 @@ public class ShapeStealer extends CardImpl {
// each one in succession. The first trigger put on the stack will be the last to resolve,
// so that will set Shape Stealer's final power and toughness.
// Whenever Shape Stealer blocks or becomes blocked by a creature, change Shape Stealer's base power and toughness to that creature's power and toughness until end of turn.
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(new ShapeStealerEffect(), false));
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new ShapeStealerEffect(), false));
}
public ShapeStealer(final ShapeStealer card) {

View file

@ -28,7 +28,7 @@
package mage.cards.s;
import java.util.UUID;
import mage.abilities.common.BlocksCreatureAttachedTriggeredAbility;
import mage.abilities.common.BlocksAttachedTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect;
@ -51,16 +51,16 @@ import mage.target.common.TargetControlledCreaturePermanent;
public class ShieldOfTheRighteous extends CardImpl {
public ShieldOfTheRighteous(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{W}{U}");
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{W}{U}");
this.subtype.add("Equipment");
// Equipped creature gets +0/+2 and has vigilance.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(0, 2)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.EQUIPMENT)));
// Whenever equipped creature blocks a creature, that creature doesn't untap during its controller's next untap step.
this.addAbility(new BlocksCreatureAttachedTriggeredAbility(new DontUntapInControllersNextUntapStepTargetEffect("that creature"), "equipped", false, false, true));
this.addAbility(new BlocksAttachedTriggeredAbility(new DontUntapInControllersNextUntapStepTargetEffect("that creature"), "equipped", false, false, true));
// Equip {2}
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2), new TargetControlledCreaturePermanent()));
}

View file

@ -29,7 +29,7 @@ package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.SpaceflightAbility;
@ -58,7 +58,7 @@ public class SlaveI extends CardImpl {
this.addAbility(SpaceflightAbility.getInstance());
// Whenever a creature dealt damage by Slave I this turn dies, put two +1/+1 counters on Slave I.
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), false));
this.addAbility(new DealtDamageAndDiedTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), false));
}

View file

@ -29,7 +29,7 @@ package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEffect;
@ -53,7 +53,7 @@ public class SoulCollector extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever a creature dealt damage by Soul Collector this turn dies, return that card to the battlefield under your control.
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new ReturnToBattlefieldUnderYourControlTargetEffect(false)));
this.addAbility(new DealtDamageAndDiedTriggeredAbility(new ReturnToBattlefieldUnderYourControlTargetEffect(false)));
// Morph {B}{B}{B}
this.addAbility(new MorphAbility(this, new ManaCostsImpl("{B}{B}{B}")));
}

View file

@ -30,7 +30,7 @@ package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.DealsDamageAttachedTriggeredAbility;
import mage.abilities.common.DamageDealtToAttachedTriggeredAbility;
import mage.abilities.common.DealtDamageAttachedTriggeredAbility;
import mage.abilities.dynamicvalue.common.NumericSetToEffectValues;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.GainLifeEffect;
@ -63,7 +63,7 @@ public class SoulLink extends CardImpl {
this.addAbility(new DealsDamageAttachedTriggeredAbility(Zone.BATTLEFIELD,
new GainLifeEffect(new NumericSetToEffectValues("that much", "damage")), false));
// Whenever enchanted creature is dealt damage, you gain that much life.
this.addAbility(new DamageDealtToAttachedTriggeredAbility(new GainLifeEffect(new NumericSetToEffectValues("that much", "damage")), false));
this.addAbility(new DealtDamageAttachedTriggeredAbility(new GainLifeEffect(new NumericSetToEffectValues("that much", "damage")), false));
}
public SoulLink(final SoulLink card) {

View file

@ -27,14 +27,16 @@
*/
package mage.cards.s;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.common.AnotherCreatureEntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import java.util.UUID;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
/**
*
@ -42,8 +44,14 @@ import java.util.UUID;
*/
public class SoulsAttendant extends CardImpl {
private static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature");
static {
filter.add(new AnotherPredicate());
}
public SoulsAttendant(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}");
this.subtype.add("Human");
this.subtype.add("Cleric");
@ -51,7 +59,7 @@ public class SoulsAttendant extends CardImpl {
this.toughness = new MageInt(1);
// Whenever another creature enters the battlefield, you may gain 1 life.
this.addAbility(new AnotherCreatureEntersBattlefieldTriggeredAbility(new GainLifeEffect(1), true));
this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), filter, true));
}
public SoulsAttendant(final SoulsAttendant card) {
@ -63,4 +71,3 @@ public class SoulsAttendant extends CardImpl {
return new SoulsAttendant(this);
}
}

View file

@ -29,7 +29,7 @@ package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.DamageDealtToAttachedTriggeredAbility;
import mage.abilities.common.DealtDamageAttachedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.keyword.EnchantAbility;
@ -63,7 +63,7 @@ public class SpitefulShadows extends CardImpl {
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
// Whenever enchanted creature is dealt damage, it deals that much damage to its controller.
this.addAbility(new DamageDealtToAttachedTriggeredAbility(Zone.BATTLEFIELD, new SpitefulShadowsEffect(),
this.addAbility(new DealtDamageAttachedTriggeredAbility(Zone.BATTLEFIELD, new SpitefulShadowsEffect(),
false, SetTargetPointer.PERMANENT));
}

View file

@ -29,7 +29,7 @@ package mage.cards.t;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.LoseAbilityTargetEffect;
import mage.abilities.keyword.FirstStrikeAbility;
@ -45,7 +45,7 @@ import mage.constants.Duration;
public class TalruumChampion extends CardImpl {
public TalruumChampion(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("Minotaur");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
@ -56,7 +56,7 @@ public class TalruumChampion extends CardImpl {
// Whenever Talruum Champion blocks or becomes blocked by a creature, that creature loses first strike until end of turn.
Effect effect = new LoseAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn);
effect.setText("that creature loses first strike until end of turn");
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, false));
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, false));
}
public TalruumChampion(final TalruumChampion card) {

View file

@ -29,7 +29,7 @@ package mage.cards.t;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@ -45,7 +45,7 @@ import mage.constants.CardType;
public class TangleAsp extends CardImpl {
public TangleAsp(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("Snake");
this.color.setGreen(true);
@ -53,10 +53,9 @@ public class TangleAsp extends CardImpl {
this.toughness = new MageInt(2);
// Whenever Tangle Asp blocks or becomes blocked by a creature, destroy that creature at end of combat.
Effect effect = new CreateDelayedTriggeredAbilityEffect(
new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true);
Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true);
effect.setText("destroy that creature at end of combat");
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, false));
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, false));
}
public TangleAsp(final TangleAsp card) {

View file

@ -29,7 +29,7 @@ package mage.cards.t;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@ -54,17 +54,16 @@ public class ThicketBasilisk extends CardImpl {
}
public ThicketBasilisk(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}");
this.subtype.add("Basilisk");
this.power = new MageInt(2);
this.toughness = new MageInt(4);
// Whenever Thicket Basilisk blocks or becomes blocked by a non-Wall creature, destroy that creature at end of combat.
Effect effect = new CreateDelayedTriggeredAbilityEffect(
new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true);
Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()), true);
effect.setText("destroy that creature at end of combat");
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, filter, false));
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, filter, false));
}
public ThicketBasilisk(final ThicketBasilisk card) {

View file

@ -34,7 +34,7 @@ import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -49,14 +49,14 @@ import mage.game.permanent.Permanent;
public class TreefolkMystic extends CardImpl {
public TreefolkMystic(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
this.subtype.add("Treefolk");
this.power = new MageInt(2);
this.toughness = new MageInt(4);
// Whenever Treefolk Mystic blocks or becomes blocked by a creature, destroy all Auras attached to that creature.
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(new TreefolkMysticEffect(), false));
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new TreefolkMysticEffect(), false));
}
public TreefolkMystic(final TreefolkMystic card) {
@ -71,8 +71,6 @@ public class TreefolkMystic extends CardImpl {
class TreefolkMysticEffect extends OneShotEffect {
public TreefolkMysticEffect() {
super(Outcome.DestroyPermanent);
}
@ -89,15 +87,12 @@ class TreefolkMysticEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if(permanent != null)
{
if (permanent != null) {
LinkedList<UUID> attachments = new LinkedList();
attachments.addAll(permanent.getAttachments());
for(UUID uuid : attachments)
{
for (UUID uuid : attachments) {
Permanent aura = game.getPermanent(uuid);
if(aura != null && aura.getSubtype(game).contains("Aura"))
{
if (aura != null && aura.getSubtype(game).contains("Aura")) {
aura.destroy(source.getSourceId(), game, false);
}
}

View file

@ -30,7 +30,7 @@ package mage.cards.v;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DamageTargetEffect;
@ -61,7 +61,7 @@ public class VampiricDragon extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Whenever a creature dealt damage by Vampiric Dragon this turn dies, put a +1/+1 counter on Vampiric Dragon.
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false));
this.addAbility(new DealtDamageAndDiedTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false));
// {1}{R}: Vampiric Dragon deals 1 damage to target creature.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{1}{R}"));

View file

@ -29,7 +29,7 @@ package mage.cards.v;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
@ -71,7 +71,7 @@ public class VampiricEmbrace extends CardImpl {
ability.addEffect(effect);
this.addAbility(ability);
// Whenever a creature dealt damage by enchanted creature this turn dies, put a +1/+1 counter on that creature.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false), AttachmentType.AURA)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new DealtDamageAndDiedTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false), AttachmentType.AURA)));
}
public VampiricEmbrace(final VampiricEmbrace card) {

View file

@ -29,7 +29,7 @@ package mage.cards.v;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
@ -63,7 +63,7 @@ public class VampiricSliver extends CardImpl {
// All Sliver creatures have "Whenever a creature dealt damage by this creature this turn dies, put a +1/+1 counter on this creature."
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(
new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance())), Duration.WhileOnBattlefield,
new DealtDamageAndDiedTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance())), Duration.WhileOnBattlefield,
filter, "All Sliver creatures have \"Whenever a creature dealt damage by this creature this turn dies, put a +1/+1 counter on this creature.\"")));
}

View file

@ -31,7 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
@ -66,7 +66,7 @@ public class VeinDrinker extends CardImpl {
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
// Whenever a creature dealt damage by Vein Drinker this turn dies, put a +1/+1 counter on Vein Drinker.
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance())));
this.addAbility(new DealtDamageAndDiedTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance())));
}
public VeinDrinker(final VeinDrinker card) {

View file

@ -29,7 +29,7 @@ package mage.cards.v;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@ -46,7 +46,7 @@ import mage.constants.CardType;
public class VenomousDragonfly extends CardImpl {
public VenomousDragonfly(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
this.subtype.add("Insect");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
@ -55,10 +55,9 @@ public class VenomousDragonfly extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Whenever Venomous Dragonfly blocks or becomes blocked by a creature, destroy that creature at end of combat.
Effect effect = new CreateDelayedTriggeredAbilityEffect(
new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()));
Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect()));
effect.setText("destroy that creature at end of combat");
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, false));
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, false));
}
public VenomousDragonfly(final VenomousDragonfly card) {

View file

@ -30,7 +30,7 @@ package mage.cards.v;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksCreatureTriggeredAbility;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.keyword.DefenderAbility;
@ -45,7 +45,7 @@ import mage.constants.CardType;
public class VertigoSpawn extends CardImpl {
public VertigoSpawn(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.power = new MageInt(0);
this.toughness = new MageInt(3);
@ -54,7 +54,7 @@ public class VertigoSpawn extends CardImpl {
this.addAbility(DefenderAbility.getInstance());
// Whenever Vertigo Spawn blocks a creature, tap that creature. That creature doesn't untap during its controller's next untap step.
Ability ability = new BlocksCreatureTriggeredAbility(new TapTargetEffect("that creature"), false, true);
Ability ability = new BlocksTriggeredAbility(new TapTargetEffect("that creature"), false, true);
ability.addEffect(new DontUntapInControllersNextUntapStepTargetEffect("that creature"));
this.addAbility(ability);
}

View file

@ -30,7 +30,7 @@ package mage.cards.w;
import java.util.UUID;
import mage.constants.CardType;
import mage.MageInt;
import mage.abilities.common.BlocksCreatureTriggeredAbility;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect;
import mage.abilities.keyword.DefenderAbility;
import mage.cards.CardImpl;
@ -42,15 +42,17 @@ import mage.cards.CardSetInfo;
public class WallOfFrost extends CardImpl {
public WallOfFrost(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}{U}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{U}");
this.subtype.add("Wall");
this.power = new MageInt(0);
this.toughness = new MageInt(7);
// Defender
this.addAbility(DefenderAbility.getInstance());
// Whenever Wall of Frost blocks a creature, that creature doesn't untap during its controller's next untap step.
this.addAbility(new BlocksCreatureTriggeredAbility(new DontUntapInControllersNextUntapStepTargetEffect("that creature"), false, true));
this.addAbility(new BlocksTriggeredAbility(new DontUntapInControllersNextUntapStepTargetEffect("that creature"), false, true));
}
public WallOfFrost(final WallOfFrost card) {

View file

@ -29,7 +29,7 @@ package mage.cards.w;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksCreatureTriggeredAbility;
import mage.abilities.common.BlocksTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@ -46,18 +46,18 @@ import mage.constants.CardType;
public class WallOfTears extends CardImpl {
public WallOfTears(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("Wall");
this.power = new MageInt(0);
this.toughness = new MageInt(4);
// Defender
this.addAbility(DefenderAbility.getInstance());
// Whenever Wall of Tears blocks a creature, return that creature to its owner's hand at end of combat.
Effect effect = new ReturnToHandTargetEffect();
effect.setText("return that creature to its owner's hand at end of combat");
this.addAbility(new BlocksCreatureTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(
new AtTheEndOfCombatDelayedTriggeredAbility(effect)), false, true));
this.addAbility(new BlocksTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(new AtTheEndOfCombatDelayedTriggeredAbility(effect)), false, true));
}
public WallOfTears(final WallOfTears card) {

View file

@ -29,7 +29,7 @@ package mage.cards.w;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.RemoveAllCountersSourceEffect;
@ -48,7 +48,7 @@ import mage.counters.CounterType;
public class WitherscaleWurm extends CardImpl {
public WitherscaleWurm(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{G}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}{G}");
this.subtype.add("Wurm");
this.power = new MageInt(9);
@ -57,7 +57,7 @@ public class WitherscaleWurm extends CardImpl {
// Whenever Witherscale Wurm blocks or becomes blocked by a creature, that creature gains wither until end of turn.
Effect effect = new GainAbilityTargetEffect(WitherAbility.getInstance(), Duration.EndOfTurn);
effect.setText("that creature gains wither until end of turn");
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, false));
this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(effect, false));
// Whenever Witherscale Wurm deals damage to an opponent, remove all -1/-1 counters from it.
this.addAbility(new DealsDamageToOpponentTriggeredAbility(new RemoveAllCountersSourceEffect(CounterType.M1M1), false));

View file

@ -30,7 +30,7 @@ package mage.cards.z;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.AttacksEachCombatStaticAbility;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.DealtDamageAndDiedTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.MyTurnCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
@ -71,7 +71,7 @@ public class ZurgoHelmsmasher extends CardImpl {
"{this} has indestructible as long as it's your turn")));
// Whenever a creature dealt damage by Zurgo Helmsmasher this turn dies, put a +1/+1 counter on Zurgo Helmsmasher.
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false));
this.addAbility(new DealtDamageAndDiedTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false));
}
public ZurgoHelmsmasher(final ZurgoHelmsmasher card) {

View file

@ -89,7 +89,6 @@ public class AetherRevolt extends ExpansionSet {
cards.add(new SetCardInfo("Freejam Regent", 81, Rarity.RARE, mage.cards.f.FreejamRegent.class));
cards.add(new SetCardInfo("Glint-Sleeve Siphoner", 62, Rarity.RARE, mage.cards.g.GlintSleeveSiphoner.class));
cards.add(new SetCardInfo("Gonti's Aether Heart", 152, Rarity.MYTHIC, mage.cards.g.GontisAetherHeart.class));
cards.add(new SetCardInfo("Greenbelt Druid", 106, Rarity.COMMON, mage.cards.g.GreenbeltDruid.class));
cards.add(new SetCardInfo("Greenbelt Rampager", 107, Rarity.RARE, mage.cards.g.GreenbeltRampager.class));
cards.add(new SetCardInfo("Greenwheel Liberator", 108, Rarity.RARE, mage.cards.g.GreenwheelLiberator.class));
cards.add(new SetCardInfo("Heart of Kiran", 153, Rarity.MYTHIC, mage.cards.h.HeartOfKiran.class));

View file

@ -1,53 +0,0 @@
package mage.abilities.common;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
public class AnotherCreatureEntersBattlefieldTriggeredAbility extends TriggeredAbilityImpl {
public AnotherCreatureEntersBattlefieldTriggeredAbility(Effect effect) {
this(effect, false);
}
public AnotherCreatureEntersBattlefieldTriggeredAbility(Effect effect, boolean optional) {
super(Zone.BATTLEFIELD, effect, optional);
}
public AnotherCreatureEntersBattlefieldTriggeredAbility(AnotherCreatureEntersBattlefieldTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getTargetId() != this.getSourceId()) {
Permanent permanent = game.getPermanentEntering(event.getTargetId());
if (permanent == null) {
permanent = game.getPermanent(event.getTargetId());
}
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) {
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever another creature enters the battlefield, " + super.getRule();
}
@Override
public AnotherCreatureEntersBattlefieldTriggeredAbility copy() {
return new AnotherCreatureEntersBattlefieldTriggeredAbility(this);
}
}

View file

@ -33,22 +33,38 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author garnold
*/
public class BlocksAttachedTriggeredAbility extends TriggeredAbilityImpl{
private final String attachedDescription;
public class BlocksAttachedTriggeredAbility extends TriggeredAbilityImpl {
private boolean setFixedTargetPointer;
private String attachedDescription;
private boolean setFixedTargetPointerToBlocked;
public BlocksAttachedTriggeredAbility(Effect effect, String attachedDescription, boolean optional) {
this(effect, attachedDescription, optional, false);
}
public BlocksAttachedTriggeredAbility(Effect effect, String attachedDescription, boolean optional, boolean setFixedTargetPointer) {
super(Zone.BATTLEFIELD, effect, optional);
this.setFixedTargetPointer = setFixedTargetPointer;
this.attachedDescription = attachedDescription;
}
public BlocksAttachedTriggeredAbility(Effect effect, String attachedDescription, boolean optional, boolean setFixedTargetPointer, boolean setFixedTargetPointerToBlocked) {
super(Zone.BATTLEFIELD, effect, optional);
this.setFixedTargetPointer = setFixedTargetPointer;
this.attachedDescription = attachedDescription;
this.setFixedTargetPointerToBlocked = setFixedTargetPointerToBlocked;
}
public BlocksAttachedTriggeredAbility(final BlocksAttachedTriggeredAbility ability) {
super(ability);
this.setFixedTargetPointer = ability.setFixedTargetPointer;
this.attachedDescription = ability.attachedDescription;
}
@ -59,13 +75,23 @@ public class BlocksAttachedTriggeredAbility extends TriggeredAbilityImpl{
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DECLARED_BLOCKERS;
return event.getType() == GameEvent.EventType.BLOCKER_DECLARED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent attachment = game.getPermanent(this.getSourceId());
if (attachment != null && attachment.getAttachedTo() != null && game.getCombat().getBlockers().contains(attachment.getAttachedTo())) {
Permanent p = game.getPermanent(event.getSourceId());
if (p != null && p.getAttachments().contains(this.getSourceId())) {
if (setFixedTargetPointer) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
}
if (setFixedTargetPointerToBlocked) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
}
return true;
}
return false;
@ -73,6 +99,6 @@ public class BlocksAttachedTriggeredAbility extends TriggeredAbilityImpl{
@Override
public String getRule() {
return "Whenever " + attachedDescription + " creature blocks, " + super.getRule();
return "Whenever " + attachedDescription + " creature blocks" + (setFixedTargetPointerToBlocked ? " a creature, " : ", ") + super.getRule();
}
}

View file

@ -1,105 +0,0 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.common;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author LevelX2
*/
public class BlocksCreatureAttachedTriggeredAbility extends TriggeredAbilityImpl{
private boolean setFixedTargetPointer;
private String attachedDescription;
private boolean setFixedTargetPointerToBlocked;
public BlocksCreatureAttachedTriggeredAbility(Effect effect, String attachedDescription, boolean optional) {
this(effect, attachedDescription, optional, false);
}
public BlocksCreatureAttachedTriggeredAbility(Effect effect, String attachedDescription, boolean optional, boolean setFixedTargetPointer) {
super(Zone.BATTLEFIELD, effect, optional);
this.setFixedTargetPointer = setFixedTargetPointer;
this.attachedDescription = attachedDescription;
}
public BlocksCreatureAttachedTriggeredAbility(Effect effect, String attachedDescription, boolean optional, boolean setFixedTargetPointer, boolean setFixedTargetPointerToBlocked) {
super(Zone.BATTLEFIELD, effect, optional);
this.setFixedTargetPointer = setFixedTargetPointer;
this.attachedDescription = attachedDescription;
this.setFixedTargetPointerToBlocked = setFixedTargetPointerToBlocked;
}
public BlocksCreatureAttachedTriggeredAbility(final BlocksCreatureAttachedTriggeredAbility ability) {
super(ability);
this.setFixedTargetPointer = ability.setFixedTargetPointer;
this.attachedDescription = ability.attachedDescription;
}
@Override
public BlocksCreatureAttachedTriggeredAbility copy() {
return new BlocksCreatureAttachedTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.BLOCKER_DECLARED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent p = game.getPermanent(event.getSourceId());
if (p != null && p.getAttachments().contains(this.getSourceId())) {
if (setFixedTargetPointer) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
}
if (setFixedTargetPointerToBlocked) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
}
return true;
}
return false;
}
@Override
public String getRule() {
return "Whenever " + attachedDescription + " creature blocks a creature, " + super.getRule();
}
}

View file

@ -1,86 +0,0 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.common;
import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author LevelX2
*/
public class BlocksCreatureTriggeredAbility extends TriggeredAbilityImpl {
private boolean setTargetPointer;
public BlocksCreatureTriggeredAbility(Effect effect, boolean optional) {
this(effect, optional, false);
}
public BlocksCreatureTriggeredAbility(Effect effect, boolean optional, boolean setTargetPointer) {
super(Zone.BATTLEFIELD, effect, optional);
this.setTargetPointer = setTargetPointer;
}
public BlocksCreatureTriggeredAbility(final BlocksCreatureTriggeredAbility ability) {
super(ability);
this.setTargetPointer = ability.setTargetPointer;
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.BLOCKER_DECLARED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getSourceId().equals(this.getSourceId())) {
if (setTargetPointer) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
}
return true;
}
return false;
}
@Override
public String getRule() {
return "Whenever {this} blocks a creature, " + super.getRule();
}
@Override
public BlocksCreatureTriggeredAbility copy() {
return new BlocksCreatureTriggeredAbility(this);
}
}

View file

@ -1,112 +0,0 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.common;
import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author North
*/
public class BlocksOrBecomesBlockedByCreatureTriggeredAbility extends TriggeredAbilityImpl {
// note that this is using the Filter#match(E e, Game game),
// not FilterInPlay#(E o, UUID sourceId, UUID playerId, Game game)
// this triggers on both blocked and blocking, so source and player don't have a consistent definition
protected FilterPermanent filter;
protected String rule;
public BlocksOrBecomesBlockedByCreatureTriggeredAbility(Effect effect, boolean optional) {
this(effect, new FilterCreaturePermanent(), optional, null);
}
public BlocksOrBecomesBlockedByCreatureTriggeredAbility(Effect effect, FilterPermanent filter, boolean optional) {
this(effect, filter, optional, null);
}
public BlocksOrBecomesBlockedByCreatureTriggeredAbility(Effect effect, FilterPermanent filter, boolean optional, String rule) {
super(Zone.BATTLEFIELD, effect, optional);
this.filter = filter;
this.rule = rule;
}
public BlocksOrBecomesBlockedByCreatureTriggeredAbility(final BlocksOrBecomesBlockedByCreatureTriggeredAbility ability) {
super(ability);
this.filter = ability.filter;
this.rule = ability.rule;
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.BLOCKER_DECLARED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getSourceId().equals(this.getSourceId())) {
Permanent blocked = game.getPermanent(event.getTargetId());
if (blocked != null && filter.match(blocked, game)) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
return true;
}
}
if (event.getTargetId().equals(this.getSourceId())) {
Permanent blocker = game.getPermanent(event.getSourceId());
if (blocker != null && filter.match(blocker, game)) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getSourceId()));
}
return true;
}
}
return false;
}
@Override
public String getRule() {
if (rule != null) {
return rule;
}
return "Whenever {this} blocks or becomes blocked by a " + filter.getMessage() + ", " + super.getRule();
}
@Override
public BlocksOrBecomesBlockedByCreatureTriggeredAbility copy() {
return new BlocksOrBecomesBlockedByCreatureTriggeredAbility(this);
}
}

View file

@ -30,9 +30,12 @@ package mage.abilities.common;
import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
/**
*
@ -40,33 +43,75 @@ import mage.game.events.GameEvent.EventType;
*/
public class BlocksOrBecomesBlockedTriggeredAbility extends TriggeredAbilityImpl {
protected FilterPermanent filter;
protected String rule;
protected boolean setTargetPointer;
public BlocksOrBecomesBlockedTriggeredAbility(Effect effect, boolean optional) {
this(effect, new FilterCreaturePermanent(), optional, null, false);
}
public BlocksOrBecomesBlockedTriggeredAbility(Effect effect, FilterPermanent filter, boolean optional) {
this(effect, filter, optional, null, true);
}
public BlocksOrBecomesBlockedTriggeredAbility(Effect effect, FilterPermanent filter, boolean optional, String rule) {
this(effect, filter, optional, rule, true);
}
public BlocksOrBecomesBlockedTriggeredAbility(Effect effect, FilterPermanent filter, boolean optional, String rule, boolean setTargetPointer) {
super(Zone.BATTLEFIELD, effect, optional);
this.filter = filter;
this.rule = rule;
this.setTargetPointer = setTargetPointer;
}
public BlocksOrBecomesBlockedTriggeredAbility(final BlocksOrBecomesBlockedTriggeredAbility ability) {
super(ability);
this.filter = ability.filter;
this.rule = ability.rule;
this.setTargetPointer = ability.setTargetPointer;
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.BLOCKER_DECLARED || event.getType() == GameEvent.EventType.CREATURE_BLOCKED;
return event.getType() == GameEvent.EventType.BLOCKER_DECLARED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == EventType.BLOCKER_DECLARED && event.getSourceId().equals(this.getSourceId())) {
return true;
if (event.getSourceId().equals(this.getSourceId())) {
Permanent blocked = game.getPermanent(event.getTargetId());
if (blocked != null && filter.match(blocked, game)) {
if (setTargetPointer) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
}
return true;
}
}
if (event.getType() == EventType.CREATURE_BLOCKED && event.getTargetId().equals(this.getSourceId())) {
return true;
if (event.getTargetId().equals(this.getSourceId())) {
Permanent blocker = game.getPermanent(event.getSourceId());
if (blocker != null && filter.match(blocker, game)) {
if (setTargetPointer) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getSourceId()));
}
}
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever {this} blocks or becomes blocked, " + super.getRule();
if (rule != null) {
return rule;
}
return "Whenever {this} blocks or becomes blocked" + (setTargetPointer ? " by a " + filter.getMessage() : "") + ", " + super.getRule();
}
@Override

View file

@ -32,7 +32,7 @@ import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
*
@ -40,26 +40,35 @@ import mage.game.events.GameEvent.EventType;
*/
public class BlocksTriggeredAbility extends TriggeredAbilityImpl {
private boolean setTargetPointer;
public BlocksTriggeredAbility(Effect effect, boolean optional) {
this(effect, optional, false);
}
public BlocksTriggeredAbility(Effect effect, boolean optional, boolean fixedTargetPointer) {
public BlocksTriggeredAbility(Effect effect, boolean optional, boolean setTargetPointer) {
super(Zone.BATTLEFIELD, effect, optional);
this.setTargetPointer = setTargetPointer;
}
public BlocksTriggeredAbility(final BlocksTriggeredAbility ability) {
super(ability);
this.setTargetPointer = ability.setTargetPointer;
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.DECLARED_BLOCKERS;
return event.getType() == GameEvent.EventType.BLOCKER_DECLARED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (game.getCombat().getBlockers().contains(this.getSourceId())) {
if (event.getSourceId().equals(this.getSourceId())) {
if (setTargetPointer) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
}
return true;
}
return false;
@ -67,11 +76,11 @@ public class BlocksTriggeredAbility extends TriggeredAbilityImpl {
@Override
public String getRule() {
return "Whenever {this} blocks, " + super.getRule();
return "Whenever {this} blocks" + (setTargetPointer ? " a creature, " : ", ") + super.getRule();
}
@Override
public BlocksTriggeredAbility copy() {
return new BlocksTriggeredAbility(this);
}
}
}

View file

@ -10,23 +10,23 @@ import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.target.targetpointer.FixedTarget;
public class DiesAndDealtDamageThisTurnTriggeredAbility extends TriggeredAbilityImpl {
public class DealtDamageAndDiedTriggeredAbility extends TriggeredAbilityImpl {
public DiesAndDealtDamageThisTurnTriggeredAbility(Effect effect) {
public DealtDamageAndDiedTriggeredAbility(Effect effect) {
this(effect, false);
}
public DiesAndDealtDamageThisTurnTriggeredAbility(Effect effect, boolean optional) {
public DealtDamageAndDiedTriggeredAbility(Effect effect, boolean optional) {
super(Zone.ALL, effect, optional);
}
public DiesAndDealtDamageThisTurnTriggeredAbility(final DiesAndDealtDamageThisTurnTriggeredAbility ability) {
public DealtDamageAndDiedTriggeredAbility(final DealtDamageAndDiedTriggeredAbility ability) {
super(ability);
}
@Override
public DiesAndDealtDamageThisTurnTriggeredAbility copy() {
return new DiesAndDealtDamageThisTurnTriggeredAbility(this);
public DealtDamageAndDiedTriggeredAbility copy() {
return new DealtDamageAndDiedTriggeredAbility(this);
}
@Override

View file

@ -42,27 +42,27 @@ import mage.target.targetpointer.FixedTarget;
*
* @author LoneFox
*/
public class DamageDealtToAttachedTriggeredAbility extends TriggeredAbilityImpl {
public class DealtDamageAttachedTriggeredAbility extends TriggeredAbilityImpl {
protected SetTargetPointer setTargetPointer;
public DamageDealtToAttachedTriggeredAbility(Effect effect, boolean optional) {
public DealtDamageAttachedTriggeredAbility(Effect effect, boolean optional) {
this(Zone.BATTLEFIELD, effect, optional, SetTargetPointer.NONE);
}
public DamageDealtToAttachedTriggeredAbility(Zone zone, Effect effect, boolean optional, SetTargetPointer setTargetPointer) {
public DealtDamageAttachedTriggeredAbility(Zone zone, Effect effect, boolean optional, SetTargetPointer setTargetPointer) {
super(zone, effect, optional);
this.setTargetPointer = setTargetPointer;
}
public DamageDealtToAttachedTriggeredAbility(final DamageDealtToAttachedTriggeredAbility ability) {
public DealtDamageAttachedTriggeredAbility(final DealtDamageAttachedTriggeredAbility ability) {
super(ability);
this.setTargetPointer = ability.setTargetPointer;
}
@Override
public DamageDealtToAttachedTriggeredAbility copy() {
return new DamageDealtToAttachedTriggeredAbility(this);
public DealtDamageAttachedTriggeredAbility copy() {
return new DealtDamageAttachedTriggeredAbility(this);
}
@Override

View file

@ -39,23 +39,23 @@ import mage.game.stack.StackObject;
*
* @author Styxo
*/
public class DiscardedByOpponentTrigger extends TriggeredAbilityImpl {
public class DiscardedByOpponentTriggerAbility extends TriggeredAbilityImpl {
public DiscardedByOpponentTrigger(Effect effect) {
public DiscardedByOpponentTriggerAbility(Effect effect) {
this(effect, false);
}
public DiscardedByOpponentTrigger(Effect effect, boolean optional) {
public DiscardedByOpponentTriggerAbility(Effect effect, boolean optional) {
super(Zone.GRAVEYARD, effect, optional);
}
public DiscardedByOpponentTrigger(final DiscardedByOpponentTrigger ability) {
public DiscardedByOpponentTriggerAbility(final DiscardedByOpponentTriggerAbility ability) {
super(ability);
}
@Override
public DiscardedByOpponentTrigger copy() {
return new DiscardedByOpponentTrigger(this);
public DiscardedByOpponentTriggerAbility copy() {
return new DiscardedByOpponentTriggerAbility(this);
}
@Override

View file

@ -1,77 +0,0 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.common;
import mage.constants.Zone;
import mage.abilities.effects.Effect;
import mage.constants.CardType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
/**
*
* @author noxx
*/
public class EntersAnotherCreatureYourControlTriggeredAbility extends ZoneChangeTriggeredAbility {
public EntersAnotherCreatureYourControlTriggeredAbility(Effect effect) {
this(effect, false);
}
public EntersAnotherCreatureYourControlTriggeredAbility(Effect effect, boolean optional) {
super(Zone.BATTLEFIELD, effect, "Whenever another creature enters the battlefield under your control, ", optional);
}
public EntersAnotherCreatureYourControlTriggeredAbility(EntersAnotherCreatureYourControlTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (!event.getTargetId().equals(this.getSourceId())) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.getControllerId().equals(this.getControllerId())) {
return true;
}
}
return false;
}
@Override
public EntersAnotherCreatureYourControlTriggeredAbility copy() {
return new EntersAnotherCreatureYourControlTriggeredAbility(this);
}
}

View file

@ -37,7 +37,6 @@ import mage.game.permanent.Permanent;
*
* @author LevelX2
*/
public class CantBeBlockedByCreaturesWithGreaterPowerEffect extends RestrictionEffect {
public CantBeBlockedByCreaturesWithGreaterPowerEffect() {
@ -51,18 +50,12 @@ public class CantBeBlockedByCreaturesWithGreaterPowerEffect extends RestrictionE
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) {
return true;
}
return false;
return permanent.getId().equals(source.getSourceId());
}
@Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
if (blocker.getPower().getValue() > attacker.getPower().getValue()) {
return false;
}
return true;
return blocker.getPower().getValue() <= attacker.getPower().getValue();
}
@Override

View file

@ -50,18 +50,12 @@ public class CantBeBlockedByCreaturesWithLessPowerEffect extends RestrictionEffe
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) {
return true;
}
return false;
return permanent.getId().equals(source.getSourceId());
}
@Override
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
if (blocker.getPower().getValue() < attacker.getPower().getValue()) {
return false;
}
return true;
return (blocker.getPower().getValue() >= attacker.getPower().getValue());
}
@Override