refactor vanishing (#11408)

This commit is contained in:
Evan Kranzler 2023-11-14 08:26:08 -05:00 committed by GitHub
parent df5020ed9c
commit 791496d285
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 197 additions and 362 deletions

View file

@ -1,30 +1,24 @@
package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.EntersBattlefieldOrLeavesSourceTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.counters.CounterType;
import java.util.UUID;
/**
*
* @author dustinconrad
*/
public final class AvenRiftwatcher extends CardImpl {
public AvenRiftwatcher(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.subtype.add(SubType.BIRD);
this.subtype.add(SubType.REBEL);
this.subtype.add(SubType.SOLDIER);
@ -34,12 +28,9 @@ public final class AvenRiftwatcher extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Vanishing 3
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(3));
this.addAbility(new VanishingSacrificeAbility());
this.addAbility(new VanishingAbility(3));
// When Aven Riftwatcher enters the battlefield or leaves the battlefield, you gain 2 life.
this.addAbility(new EntersBattlefieldOrLeavesSourceTriggeredAbility(new GainLifeEffect(2), false));

View file

@ -1,28 +1,22 @@
package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.ShroudAbility;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.counters.CounterType;
import java.util.UUID;
/**
*
* @author Loki
*/
public final class Calciderm extends CardImpl {
public Calciderm(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{W}");
this.subtype.add(SubType.BEAST);
this.power = new MageInt(5);
@ -30,12 +24,9 @@ public final class Calciderm extends CardImpl {
// Shroud
this.addAbility(ShroudAbility.getInstance());
// Vanishing 4
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(4)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(4));
this.addAbility(new VanishingSacrificeAbility());
this.addAbility(new VanishingAbility(4));
}
private Calciderm(final Calciderm card) {

View file

@ -1,29 +1,23 @@
package mage.cards.c;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesSourceTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.common.LastTimeCounterRemovedCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.CreateTokenCopySourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.Effect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.counters.CounterType;
import java.util.UUID;
/**
*
* @author Gal Lerman
*
*/
public final class Chronozoa extends CardImpl {
@ -37,11 +31,7 @@ public final class Chronozoa extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Vanishing 3 (This permanent enters the battlefield with three time counters on it. At the beginning of your upkeep, remove a time counter from it. When the last is removed, sacrifice it.)
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(3));
this.addAbility(new VanishingSacrificeAbility());
this.addAbility(new VanishingAbility(3));
// When Chronozoa is put into a graveyard from play, if it had no time counters on it, create two tokens that are copies of it.
Effect effect = new CreateTokenCopySourceEffect(2);

View file

@ -2,19 +2,15 @@ package mage.cards.c;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfPreCombatMainTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.ExileUntilSourceLeavesEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.abilities.meta.OrTriggeredAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent;
@ -29,14 +25,10 @@ public final class CrackInTime extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}");
// Vanishing 3
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(3));
this.addAbility(new VanishingSacrificeAbility());
this.addAbility(new VanishingAbility(3));
// When Crack in Time enters the battlefield and at the beginning of your precombat main phase, exile target creature an opponent controls until Crack in Time leaves the battlefield.
ability = new OrTriggeredAbility(Zone.BATTLEFIELD, new ExileUntilSourceLeavesEffect(), false,
Ability ability = new OrTriggeredAbility(Zone.BATTLEFIELD, new ExileUntilSourceLeavesEffect(), false,
"When {this} enters the battlefield and at the beginning of your precombat main phase, ",
new EntersBattlefieldTriggeredAbility(null),
new BeginningOfPreCombatMainTriggeredAbility(null, TargetController.YOU, false)

View file

@ -1,26 +1,20 @@
package mage.cards.d;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesSourceTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.common.LastTimeCounterRemovedCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.game.permanent.token.DeadlyGrubInsectToken;
import java.util.UUID;
/**
*
* @author LoneFox
*/
public final class DeadlyGrub extends CardImpl {
@ -32,11 +26,7 @@ public final class DeadlyGrub extends CardImpl {
this.toughness = new MageInt(1);
// Vanishing 3
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(3));
this.addAbility(new VanishingSacrificeAbility());
this.addAbility(new VanishingAbility(3));
// When Deadly Grub dies, if it had no time counters on it, create a 6/1 green Insect creature token with shroud.
this.addAbility(new ConditionalInterveningIfTriggeredAbility(new DiesSourceTriggeredAbility(new CreateTokenEffect(new DeadlyGrubInsectToken(), 1)),

View file

@ -1,51 +1,44 @@
package mage.cards.d;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.EntersBattlefieldOrLeavesSourceTriggeredAbility;
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.target.Target;
import mage.target.common.TargetCardInYourGraveyard;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class DeadwoodTreefolk extends CardImpl {
private static final FilterCreatureCard filter = new FilterCreatureCard("another target creature card from your graveyard");
static {
filter.add(AnotherPredicate.instance);
}
public DeadwoodTreefolk(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}");
this.subtype.add(SubType.TREEFOLK);
this.power = new MageInt(3);
this.toughness = new MageInt(6);
// Vanishing 3
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(3));
this.addAbility(new VanishingSacrificeAbility());
this.addAbility(new VanishingAbility(3));
// When Deadwood Treefolk enters the battlefield or leaves the battlefield, return another target creature card from your graveyard to your hand.
ability = new EntersBattlefieldOrLeavesSourceTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect(), false);
Ability ability = new EntersBattlefieldOrLeavesSourceTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect(), false);
Target target = new TargetCardInYourGraveyard(filter);
ability.addTarget(target);
this.addAbility(ability);

View file

@ -1,21 +1,16 @@
package mage.cards.d;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.permanent.token.SquirrelToken;
@ -38,11 +33,7 @@ public final class DeepForestHermit extends CardImpl {
this.toughness = new MageInt(1);
// Vanishing 3
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(3));
this.addAbility(new VanishingSacrificeAbility());
this.addAbility(new VanishingAbility(3));
// When Deep Forest Hermit enters the battlefield, create four 1/1 green Squirrel creature tokens.
this.addAbility(new EntersBattlefieldTriggeredAbility(

View file

@ -1,17 +1,12 @@
package mage.cards.f;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfPreCombatMainTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.counters.CounterType;
import java.util.UUID;
@ -24,11 +19,7 @@ public final class FourKnocks extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
// Vanishing 4
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(4)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(4));
this.addAbility(new VanishingSacrificeAbility());
this.addAbility(new VanishingAbility(4));
// At the beginning of your precombat main phase, draw a card.
this.addAbility(new BeginningOfPreCombatMainTriggeredAbility(

View file

@ -1,24 +1,19 @@
package mage.cards.k;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.EntersBattlefieldOrLeavesSourceTriggeredAbility;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.target.common.TargetPlayerOrPlaneswalker;
import java.util.UUID;
/**
*
* @author jonubuu
*/
public final class KeldonMarauders extends CardImpl {
@ -32,14 +27,10 @@ public final class KeldonMarauders extends CardImpl {
this.toughness = new MageInt(3);
// Vanishing 2
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(2)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(2));
this.addAbility(new VanishingSacrificeAbility());
this.addAbility(new VanishingAbility(2));
// When Keldon Marauders enters the battlefield or leaves the battlefield, it deals 1 damage to target player.
ability = new EntersBattlefieldOrLeavesSourceTriggeredAbility(new DamageTargetEffect(1, "it"), false);
Ability ability = new EntersBattlefieldOrLeavesSourceTriggeredAbility(new DamageTargetEffect(1, "it"), false);
ability.addTarget(new TargetPlayerOrPlaneswalker());
this.addAbility(ability);
}

View file

@ -1,41 +1,33 @@
package mage.cards.l;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DealsDamageToAPlayerAllTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SetTargetPointer;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public final class LavacoreElemental extends CardImpl {
public LavacoreElemental(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(SubType.ELEMENTAL);
this.power = new MageInt(5);
this.toughness = new MageInt(3);
// Vanishing 1
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(1)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(1));
this.addAbility(new VanishingSacrificeAbility());
this.addAbility(new VanishingAbility(1));
// Whenever a creature you control deals combat damage to a player, put a time counter on Lavacore Elemental.
Effect effect = new AddCountersSourceEffect(CounterType.TIME.createInstance(1));

View file

@ -1,15 +1,9 @@
package mage.cards.l;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -22,25 +16,22 @@ import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
/**
*
* @author Quercitron
*/
public final class LostAuramancers extends CardImpl {
public LostAuramancers(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.WIZARD);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Vanishing 3
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(3));
this.addAbility(new VanishingSacrificeAbility());
this.addAbility(new VanishingAbility(3));
// When Lost Auramancers dies, if it had no time counters on it, you may search your library
// for an enchantment card and put it onto the battlefield. If you do, shuffle your library.

View file

@ -1,49 +1,47 @@
package mage.cards.m;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.MorphAbility;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.counters.CounterType;
import java.util.UUID;
/**
*
* @author LoneFox
*/
public final class MaelstromDjinn extends CardImpl {
public MaelstromDjinn(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{7}{U}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{7}{U}");
this.subtype.add(SubType.DJINN);
this.power = new MageInt(5);
this.toughness = new MageInt(6);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Morph {2}{U}
this.addAbility(new MorphAbility(this, new ManaCostsImpl<>("{2}{U}")));
// When Maelstrom Djinn is turned face up, put two time counters on it and it gains vanishing.
Ability ability = new TurnedFaceUpSourceTriggeredAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(2)));
Effect effect = new GainAbilitySourceEffect(new VanishingUpkeepAbility(0), Duration.WhileOnBattlefield);
effect.setText("and it gains vanishing");
ability.addEffect(effect);
effect = new GainAbilitySourceEffect(new VanishingSacrificeAbility(), Duration.WhileOnBattlefield);
effect.setText("");
ability.addEffect(effect);
Ability ability = new TurnedFaceUpSourceTriggeredAbility(
new AddCountersSourceEffect(CounterType.TIME.createInstance(2))
);
ability.addEffect(new GainAbilitySourceEffect(
new VanishingAbility(0), Duration.WhileOnBattlefield
).setText("and it gains vanishing"));
this.addAbility(ability);
}

View file

@ -1,7 +1,5 @@
package mage.cards.o;
import java.util.*;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -9,8 +7,7 @@ import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.PhaseOutAllEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -24,8 +21,9 @@ import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import java.util.*;
/**
*
* @author weirddan455
*/
public final class OutOfTime extends CardImpl {
@ -38,8 +36,7 @@ public final class OutOfTime extends CardImpl {
this.addAbility(new EntersBattlefieldTriggeredAbility(new OutOfTimePhaseOutEffect()));
// Vanishing
this.addAbility(new VanishingUpkeepAbility(0, "enchantment"));
this.addAbility(new VanishingSacrificeAbility());
this.addAbility(new VanishingAbility(0));
}
private OutOfTime(final OutOfTime card) {

View file

@ -1,44 +1,40 @@
package mage.cards.r;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.KickerAbility;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.counters.CounterType;
import java.util.UUID;
/**
*
* @author LoneFox
*/
public final class RavagingRiftwurm extends CardImpl {
public RavagingRiftwurm(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(SubType.WURM);
this.power = new MageInt(6);
this.toughness = new MageInt(6);
// Kicker {4}
this.addAbility(new KickerAbility("{4}"));
// Vanishing 2
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(2)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(2));
this.addAbility(new VanishingSacrificeAbility());
this.addAbility(new VanishingAbility(2));
// If Ravaging Riftwurm was kicked, it enters the battlefield with three additional time counters on it.
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)),
KickedCondition.ONCE, "If {this} was kicked, it enters the battlefield with three additional time counters on it.", ""));
KickedCondition.ONCE, "If {this} was kicked, it enters the battlefield with three additional time counters on it.", ""));
}
private RavagingRiftwurm(final RavagingRiftwurm card) {

View file

@ -1,38 +1,33 @@
package mage.cards.r;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.ZoneChangeTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.SacrificeTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public final class RealityAcid extends CardImpl {
public RealityAcid(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
this.subtype.add(SubType.AURA);
// Enchant permanent
@ -43,11 +38,7 @@ public final class RealityAcid extends CardImpl {
this.addAbility(ability);
// Vanishing 3
ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(3, "aura"));
this.addAbility(new VanishingSacrificeAbility());
this.addAbility(new VanishingAbility(3));
// When Reality Acid leaves the battlefield, enchanted permanent's controller sacrifices it.
Effect effect = new SacrificeTargetEffect("enchanted permanent's controller sacrifices it");

View file

@ -2,18 +2,15 @@ package mage.cards.r;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
import mage.abilities.condition.common.SourceHasCounterCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileSourceEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect;
import mage.abilities.effects.keyword.ScryEffect;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -34,11 +31,7 @@ public final class RegenerationsRestored extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}{U}");
// Vanishing 12
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(12)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(12));
this.addAbility(new VanishingSacrificeAbility());
this.addAbility(new VanishingAbility(12));
// Whenever one or more time counters are removed from Regenerations Restored, scry 1 and you gain 1 life. Then if Regenerations Restored has no time counters on it, exile it. When you do, take an extra turn after this one.
this.addAbility(new RegenerationsRestoredTriggeredAbility());

View file

@ -1,12 +1,9 @@
package mage.cards.s;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -38,11 +35,7 @@ public final class SoultetherGolem extends CardImpl {
this.toughness = new MageInt(3);
// Vanishing 1
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(1)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(1));
this.addAbility(new VanishingSacrificeAbility());
this.addAbility(new VanishingAbility(1));
// Whenever another creature enters the battlefield under your control, put a time counter on Soultether Golem.
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(

View file

@ -1,7 +1,5 @@
package mage.cards.t;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -9,8 +7,7 @@ import mage.abilities.dynamicvalue.common.CountersSourceCount;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -19,8 +16,9 @@ import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterControlledPermanent;
import java.util.UUID;
/**
*
* @author LoneFox
*/
public final class Tidewalker extends CardImpl {
@ -32,16 +30,17 @@ public final class Tidewalker extends CardImpl {
}
public Tidewalker(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
this.subtype.add(SubType.ELEMENTAL);
this.power = new MageInt(0);
this.toughness = new MageInt(0);
// Tidewalker enters the battlefield with a time counter on it for each Island you control.
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(0), new PermanentsOnBattlefieldCount(filter), true), "with a time counter on it for each Island you control"));
// Vanishing
this.addAbility(new VanishingUpkeepAbility(0));
this.addAbility(new VanishingSacrificeAbility());
this.addAbility(new VanishingAbility(0));
// Tidewalker's power and toughness are each equal to the number of time counters on it.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(new CountersSourceCount(CounterType.TIME))));
}

View file

@ -1,38 +1,28 @@
package mage.cards.w;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.VanishingSacrificeAbility;
import mage.abilities.keyword.VanishingUpkeepAbility;
import mage.abilities.keyword.VanishingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.counters.CounterType;
import java.util.UUID;
/**
*
* @author LoneFox
*/
public final class WaningWurm extends CardImpl {
public WaningWurm(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(SubType.ZOMBIE);
this.subtype.add(SubType.WURM);
this.power = new MageInt(7);
this.toughness = new MageInt(6);
// Vanishing 2
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(2)));
ability.setRuleVisible(false);
this.addAbility(ability);
this.addAbility(new VanishingUpkeepAbility(2));
this.addAbility(new VanishingSacrificeAbility());
this.addAbility(new VanishingAbility(2));
}
private WaningWurm(final WaningWurm card) {

View file

@ -0,0 +1,97 @@
package mage.abilities.keyword;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.SourceHasCounterCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.util.CardUtil;
/**
* @author TheElk801
*/
public class VanishingAbility extends EntersBattlefieldAbility {
private static final Condition condition = new SourceHasCounterCondition(CounterType.TIME);
private final int amount;
public VanishingAbility(int amount) {
super(new AddCountersSourceEffect(CounterType.TIME.createInstance(amount)));
this.amount = amount;
this.addSubAbility(new ConditionalInterveningIfTriggeredAbility(
new BeginningOfUpkeepTriggeredAbility(
new RemoveCounterSourceEffect(CounterType.TIME.createInstance()),
TargetController.YOU, false
), condition, "At the beginning of your upkeep, if this permanent " +
"has a time counter on it, remove a time counter from it."
).setRuleVisible(false));
this.addSubAbility(new VanishingTriggeredAbility());
}
private VanishingAbility(final VanishingAbility ability) {
super(ability);
this.amount = ability.amount;
}
@Override
public VanishingAbility copy() {
return new VanishingAbility(this);
}
@Override
public String getRule() {
if (amount > 0) {
return "Vanishing " + amount + " <i>(This permanent enters the battlefield with " +
CardUtil.numberToText(amount) + " time counters on it. At the beginning of your upkeep, " +
"remove a time counter from it. When the last is removed, sacrifice it.)</i>";
}
return "Vanishing <i>(At the beginning of your upkeep, remove a time counter " +
"from this permanent. When the last is removed, sacrifice it.)</i>";
}
}
class VanishingTriggeredAbility extends TriggeredAbilityImpl {
VanishingTriggeredAbility() {
super(Zone.BATTLEFIELD, new SacrificeSourceEffect());
this.setRuleVisible(false);
}
private VanishingTriggeredAbility(final VanishingTriggeredAbility ability) {
super(ability);
}
@Override
public VanishingTriggeredAbility copy() {
return new VanishingTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.COUNTERS_REMOVED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (!CounterType.TIME.getName().equals(event.getData())) {
return false;
}
Permanent permanent = getSourcePermanentIfItStillExists(game);
return permanent != null && permanent.getCounters(game).getCount(CounterType.TIME) < 1;
}
@Override
public String getRule() {
return "When the last time counter is removed from {this}, sacrifice it.";
}
}

View file

@ -1,42 +0,0 @@
package mage.abilities.keyword;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
public class VanishingSacrificeAbility extends TriggeredAbilityImpl {
public VanishingSacrificeAbility() {
super(Zone.BATTLEFIELD, new SacrificeSourceEffect());
this.setRuleVisible(false);
}
protected VanishingSacrificeAbility(final VanishingSacrificeAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.COUNTER_REMOVED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId())) {
Permanent p = game.getPermanent(this.getSourceId());
if (p != null) {
return p.getCounters(game).getCount(CounterType.TIME) == 0;
}
}
return false;
}
@Override
public VanishingSacrificeAbility copy() {
return new VanishingSacrificeAbility(this);
}
}

View file

@ -1,81 +0,0 @@
package mage.abilities.keyword;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.util.CardUtil;
public class VanishingUpkeepAbility extends BeginningOfUpkeepTriggeredAbility {
private int vanishingAmount;
private String permanentType;
public VanishingUpkeepAbility(int vanishingEffect) {
super(new VanishingEffect(), TargetController.YOU, false);
this.vanishingAmount = vanishingEffect;
this.permanentType = "creature";
}
public VanishingUpkeepAbility(int vanishingEffect, String permanentType) {
super(new VanishingEffect(), TargetController.YOU, false);
this.vanishingAmount = vanishingEffect;
this.permanentType = permanentType;
}
protected VanishingUpkeepAbility(final VanishingUpkeepAbility ability) {
super(ability);
this.vanishingAmount = ability.vanishingAmount;
this.permanentType = ability.permanentType;
}
@Override
public VanishingUpkeepAbility copy() {
return new VanishingUpkeepAbility(this);
}
@Override
public String getRule() {
if (vanishingAmount > 0) {
return "Vanishing " + vanishingAmount
+ " <i>(This " + permanentType + " enters the battlefield with " + CardUtil.numberToText(vanishingAmount)
+ " time counters on it. At the beginning of your upkeep, remove a time counter from it. When the last is removed, sacrifice it.)</i>";
} else {
return "Vanishing <i>(At the beginning of your upkeep, remove a time counter from this " + permanentType + ". When the last is removed, sacrifice it.)</i>";
}
}
}
class VanishingEffect extends OneShotEffect {
VanishingEffect() {
super(Outcome.Sacrifice);
}
VanishingEffect(final VanishingEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent p = game.getPermanent(source.getSourceId());
if (p != null) {
int amount = p.getCounters(game).getCount(CounterType.TIME);
if (amount > 0) {
p.removeCounters(CounterType.TIME.createInstance(), source, game);
game.informPlayers("Removed a time counter from " + p.getLogName() + " (" + amount + " left)");
}
return true;
}
return false;
}
@Override
public VanishingEffect copy() {
return new VanishingEffect(this);
}
}

View file

@ -128,6 +128,7 @@ Undaunted|new|
Undying|new|
Unearth|cost|
Unleash|new|
Vanishing|number|
Vigilance|instance|
Ward|cost|
Wither|instance|