forked from External/mage
Cleanup activated ability constructors (#11283)
* simplify LoyaltyAbility constructors * remove unused constructors in ActivatedAbilityImpl * cleanup * remove null rule setting * another unused constructor * fix escape ability reminder text * escape text adjustment * simplify Trigons, remove Costs constructor * rework Villainous Ogre, remove another class and constructor * fix test using wrong text for trigon ability
This commit is contained in:
parent
25e559dd9d
commit
4e2a5bd5a9
38 changed files with 138 additions and 368 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -6,7 +5,6 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.dynamicvalue.common.ControllerLifeCount;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
|
|
@ -41,10 +39,10 @@ public final class AjaniCallerOfThePride extends CardImpl {
|
|||
ability.addTarget(new TargetCreaturePermanent(0, 1));
|
||||
this.addAbility(ability);
|
||||
// -3: Target creature gains flying and double strike until end of turn.
|
||||
Effects effects = new Effects();
|
||||
effects.add(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn).setText("target creature gains flying"));
|
||||
effects.add(new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn).setText("and double strike until end of turn"));
|
||||
ability = new LoyaltyAbility(effects, -3);
|
||||
Effect flyingEffect = new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn).setText("target creature gains flying");
|
||||
Effect doubleStrike = new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn).setText("and double strike until end of turn");
|
||||
ability = new LoyaltyAbility(flyingEffect, -3);
|
||||
ability.addEffect(doubleStrike);
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
// -8: create X 2/2 white Cat creature tokens, where X is your life total.
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.DestroyAllControlledTargetEffect;
|
||||
import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect;
|
||||
|
|
@ -43,10 +41,8 @@ public final class AjaniVengeant extends CardImpl {
|
|||
this.addAbility(ability1);
|
||||
|
||||
// −2: Ajani Vengeant deals 3 damage to any target and you gain 3 life.
|
||||
Effects effects1 = new Effects();
|
||||
effects1.add(new DamageTargetEffect(3));
|
||||
effects1.add(new GainLifeEffect(3).concatBy("and"));
|
||||
LoyaltyAbility ability2 = new LoyaltyAbility(effects1, -2);
|
||||
LoyaltyAbility ability2 = new LoyaltyAbility(new DamageTargetEffect(3), -2);
|
||||
ability2.addEffect(new GainLifeEffect(3).concatBy("and"));
|
||||
ability2.addTarget(new TargetAnyTarget());
|
||||
this.addAbility(ability2);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package mage.cards.a;
|
|||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DamageAllControlledTargetEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
|
|
@ -39,12 +38,9 @@ public final class AngrathMinotaurPirate extends CardImpl {
|
|||
this.setStartingLoyalty(5);
|
||||
|
||||
// +2: Angrath, Minotaur Pirate deals 1 damage to target opponent and each creature that player controls.
|
||||
Effects effects1 = new Effects();
|
||||
effects1.add(new DamageTargetEffect(1));
|
||||
effects1.add(new DamageAllControlledTargetEffect(1, new FilterCreaturePermanent())
|
||||
.setText("and each creature that player or that planeswalker's controller controls")
|
||||
);
|
||||
LoyaltyAbility ability1 = new LoyaltyAbility(effects1, +2);
|
||||
LoyaltyAbility ability1 = new LoyaltyAbility(new DamageTargetEffect(1), +2);
|
||||
ability1.addEffect(new DamageAllControlledTargetEffect(1, new FilterCreaturePermanent())
|
||||
.setText("and each creature that player or that planeswalker's controller controls"));
|
||||
ability1.addTarget(new TargetOpponentOrPlaneswalker());
|
||||
this.addAbility(ability1);
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public final class AugurIlVec extends CardImpl {
|
|||
this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
||||
new GainLifeEffect(4),
|
||||
new SacrificeSourceCost(),
|
||||
new IsStepCondition(PhaseStep.UPKEEP), null));
|
||||
new IsStepCondition(PhaseStep.UPKEEP)));
|
||||
}
|
||||
|
||||
private AugurIlVec(final AugurIlVec card) {
|
||||
|
|
|
|||
|
|
@ -38,9 +38,8 @@ public final class AugurOfSkulls extends CardImpl {
|
|||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
||||
new DiscardTargetEffect(2),
|
||||
new SacrificeSourceCost(),
|
||||
new IsStepCondition(PhaseStep.UPKEEP),
|
||||
null
|
||||
);
|
||||
new IsStepCondition(PhaseStep.UPKEEP)
|
||||
);
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,8 +37,7 @@ public final class AvenAugur extends CardImpl {
|
|||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
||||
new ReturnToHandTargetEffect(),
|
||||
new SacrificeSourceCost(),
|
||||
new IsStepCondition(PhaseStep.UPKEEP),
|
||||
null);
|
||||
new IsStepCondition(PhaseStep.UPKEEP));
|
||||
ability.addTarget(new TargetCreaturePermanent(0, 2));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.mana.BasicManaEffect;
|
||||
import mage.abilities.effects.common.DamageAllControlledTargetEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
|
|
@ -43,10 +41,9 @@ public final class ChandraBoldPyromancer extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
|
||||
// −7: Chandra, Bold Pyromancer deals 10 damage to target player and each creature and planeswalker they control.
|
||||
Effects effects1 = new Effects();
|
||||
effects1.add(new DamageTargetEffect(10));
|
||||
effects1.add(new DamageAllControlledTargetEffect(10, new FilterCreatureOrPlaneswalkerPermanent()).setText("and each creature and planeswalker they control"));
|
||||
LoyaltyAbility ability3 = new LoyaltyAbility(effects1, -7);
|
||||
LoyaltyAbility ability3 = new LoyaltyAbility(new DamageTargetEffect(10), -7);
|
||||
ability3.addEffect(new DamageAllControlledTargetEffect(10, new FilterCreatureOrPlaneswalkerPermanent())
|
||||
.setText("and each creature and planeswalker they control"));
|
||||
ability3.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability3);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.dynamicvalue.common.GetXLoyaltyValue;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.common.DamageAllControlledTargetEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -40,12 +38,10 @@ public final class ChandraNalaar extends CardImpl {
|
|||
this.addAbility(ability2);
|
||||
|
||||
// -8: Chandra Nalaar deals 10 damage to target player or planeswalker and each creature that player or that planeswalker’s controller controls.
|
||||
Effects effects1 = new Effects();
|
||||
effects1.add(new DamageTargetEffect(10));
|
||||
effects1.add(new DamageAllControlledTargetEffect(10, new FilterCreaturePermanent())
|
||||
LoyaltyAbility ability3 = new LoyaltyAbility(new DamageTargetEffect(10), -8);
|
||||
ability3.addEffect(new DamageAllControlledTargetEffect(10, new FilterCreaturePermanent())
|
||||
.setText("and each creature that player or that planeswalker's controller controls")
|
||||
);
|
||||
LoyaltyAbility ability3 = new LoyaltyAbility(effects1, -8);
|
||||
ability3.addTarget(new TargetPlayerOrPlaneswalker());
|
||||
this.addAbility(ability3);
|
||||
}
|
||||
|
|
@ -59,4 +55,3 @@ public final class ChandraNalaar extends CardImpl {
|
|||
return new ChandraNalaar(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.common.DamageAllControlledTargetEffect;
|
||||
import mage.abilities.effects.common.DamagePlayersEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
|
|
@ -41,12 +39,9 @@ public final class ChandraPyrogenius extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
|
||||
// -10: Chandra, Pyrogenius deals 6 damage to target player and each creature they control.
|
||||
Effects effects = new Effects();
|
||||
effects.add(new DamageTargetEffect(6));
|
||||
effects.add(new DamageAllControlledTargetEffect(6, new FilterCreaturePermanent())
|
||||
.setText("and each creature that player or that planeswalker's controller controls")
|
||||
);
|
||||
ability = new LoyaltyAbility(effects, -10);
|
||||
ability = new LoyaltyAbility(new DamageTargetEffect(6), -10);
|
||||
ability.addEffect(new DamageAllControlledTargetEffect(6, new FilterCreaturePermanent())
|
||||
.setText("and each creature that player or that planeswalker's controller controls"));
|
||||
ability.addTarget(new TargetPlayerOrPlaneswalker());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public final class Desert extends CardImpl {
|
|||
// {tap}: Add {C}.
|
||||
this.addAbility(new ColorlessManaAbility());
|
||||
// {tap}: Desert deals 1 damage to target attacking creature. Activate this ability only during the end of combat step.
|
||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost(), new IsStepCondition(PhaseStep.END_COMBAT, false), null);
|
||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost(), new IsStepCondition(PhaseStep.END_COMBAT, false));
|
||||
Target target = new TargetCreaturePermanent(filter);
|
||||
ability.addTarget(target);
|
||||
this.addAbility(ability);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public final class DwarvenWeaponsmith extends CardImpl {
|
|||
|
||||
// {tap}, Sacrifice an artifact: Put a +1/+1 counter on target creature. Activate this ability only during your upkeep.
|
||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance()),
|
||||
new TapSourceCost(), new IsStepCondition(PhaseStep.UPKEEP), null);
|
||||
new TapSourceCost(), new IsStepCondition(PhaseStep.UPKEEP));
|
||||
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent("an artifact"))));
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
|
||||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
|
|
@ -39,14 +37,12 @@ public final class ElspethKnightErrant extends CardImpl {
|
|||
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(token), 1));
|
||||
|
||||
// +1: Target creature gets +3/+3 and gains flying until end of turn.
|
||||
Effects effects1 = new Effects();
|
||||
Effect effect = new BoostTargetEffect(3, 3, Duration.EndOfTurn);
|
||||
effect.setText("Target creature gets +3/+3");
|
||||
effects1.add(effect);
|
||||
effect = new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn);
|
||||
effect.setText("and gains flying until end of turn");
|
||||
effects1.add(effect);
|
||||
LoyaltyAbility ability1 = new LoyaltyAbility(effects1, 1);
|
||||
Effect boostEffect = new BoostTargetEffect(3, 3, Duration.EndOfTurn)
|
||||
.setText("Target creature gets +3/+3");
|
||||
Effect flyingEffect = new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)
|
||||
.setText("and gains flying until end of turn");
|
||||
LoyaltyAbility ability1 = new LoyaltyAbility(boostEffect, 1);
|
||||
ability1.addEffect(flyingEffect);
|
||||
ability1.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability1);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
|
||||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.UntapTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
|
|
@ -16,7 +14,7 @@ import mage.constants.CardType;
|
|||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SuperType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.permanent.token.BeastToken;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
|
||||
|
|
@ -26,8 +24,6 @@ import mage.target.common.TargetLandPermanent;
|
|||
*/
|
||||
public final class GarrukWildspeaker extends CardImpl {
|
||||
|
||||
private static BeastToken beastToken = new BeastToken();
|
||||
|
||||
public GarrukWildspeaker(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.PLANESWALKER},"{2}{G}{G}");
|
||||
this.supertype.add(SuperType.LEGENDARY);
|
||||
|
|
@ -41,17 +37,16 @@ public final class GarrukWildspeaker extends CardImpl {
|
|||
this.addAbility(ability1);
|
||||
|
||||
// −1: Create a 3/3 green Beast creature token.
|
||||
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(beastToken), -1));
|
||||
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new BeastToken()), -1));
|
||||
|
||||
// −4: Creatures you control get +3/+3 and gain trample until end of turn.
|
||||
Effects effects1 = new Effects();
|
||||
Effect effect = new BoostControlledEffect(3, 3, Duration.EndOfTurn);
|
||||
effect.setText("Creatures you control get +3/+3");
|
||||
effects1.add(effect);
|
||||
effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent());
|
||||
effect.setText("and gain trample until end of turn");
|
||||
effects1.add(effect);
|
||||
this.addAbility(new LoyaltyAbility(effects1, -4));
|
||||
Effect boostEffect = new BoostControlledEffect(3, 3, Duration.EndOfTurn)
|
||||
.setText("Creatures you control get +3/+3");
|
||||
Effect trampleEffect = new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES)
|
||||
.setText("and gain trample until end of turn");
|
||||
LoyaltyAbility ability2 = new LoyaltyAbility(boostEffect, -4);
|
||||
ability2.addEffect(trampleEffect);
|
||||
this.addAbility(ability2);
|
||||
}
|
||||
|
||||
private GarrukWildspeaker(final GarrukWildspeaker card) {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import mage.constants.SubType;
|
|||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -35,7 +34,7 @@ public final class HellsCaretaker extends CardImpl {
|
|||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
||||
new ReturnFromGraveyardToBattlefieldTargetEffect(),
|
||||
new TapSourceCost(),
|
||||
new IsStepCondition(PhaseStep.UPKEEP), null);
|
||||
new IsStepCondition(PhaseStep.UPKEEP));
|
||||
ability.addCost(new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT));
|
||||
ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
|
||||
this.addAbility(ability);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public final class IcatianMoneychanger extends CardImpl {
|
|||
|
||||
// Sacrifice Icatian Moneychanger: You gain 1 life for each credit counter on Icatian Moneychanger. Activate this ability only during your upkeep.
|
||||
this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
||||
new GainLifeEffect(new CountersSourceCount(CounterType.CREDIT)), new SacrificeSourceCost(), new IsStepCondition(PhaseStep.UPKEEP), null));
|
||||
new GainLifeEffect(new CountersSourceCount(CounterType.CREDIT)), new SacrificeSourceCost(), new IsStepCondition(PhaseStep.UPKEEP)));
|
||||
}
|
||||
|
||||
private IcatianMoneychanger(final IcatianMoneychanger card) {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,9 @@
|
|||
|
||||
package mage.cards.k;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.Costs;
|
||||
import mage.abilities.costs.CostsImpl;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
|
||||
|
|
@ -16,12 +12,14 @@ import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.common.FilterLandCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -48,11 +46,10 @@ public final class KnightOfTheReliquary extends CardImpl {
|
|||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(value, value, Duration.WhileOnBattlefield)));
|
||||
|
||||
// {T}, Sacrifice a Forest or Plains: Search your library for a land card, put it onto the battlefield, then shuffle your library.
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(new FilterLandCard());
|
||||
Costs<Cost> costs = new CostsImpl<>();
|
||||
costs.add(new TapSourceCost());
|
||||
costs.add(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, filter, false)));
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(target, false), costs));
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(StaticFilters.FILTER_CARD_LAND);
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(target), new TapSourceCost());
|
||||
ability.addCost(new SacrificeTargetCost(filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private KnightOfTheReliquary(final KnightOfTheReliquary card) {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import mage.constants.Zone;
|
|||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -33,8 +32,7 @@ public final class LifeChisel extends CardImpl {
|
|||
Zone.BATTLEFIELD,
|
||||
new LifeChiselEffect(),
|
||||
new SacrificeTargetCost(StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT),
|
||||
new IsStepCondition(PhaseStep.UPKEEP),
|
||||
null
|
||||
new IsStepCondition(PhaseStep.UPKEEP)
|
||||
);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,8 +41,7 @@ public final class LlanowarAugur extends CardImpl {
|
|||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
||||
effect,
|
||||
new SacrificeSourceCost(),
|
||||
new IsStepCondition(PhaseStep.UPKEEP),
|
||||
null
|
||||
new IsStepCondition(PhaseStep.UPKEEP)
|
||||
);
|
||||
effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, "and gains trample until end of turn");
|
||||
ability.addEffect(effect);
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ public final class MagusOfTheMirror extends CardImpl {
|
|||
Zone.BATTLEFIELD,
|
||||
new ExchangeLifeControllerTargetEffect(),
|
||||
new TapSourceCost(),
|
||||
new IsStepCondition(PhaseStep.UPKEEP),
|
||||
null);
|
||||
new IsStepCondition(PhaseStep.UPKEEP)
|
||||
);
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
ability.addTarget(new TargetOpponent());
|
||||
this.addAbility(ability);
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ public final class MirrorUniverse extends CardImpl {
|
|||
Zone.BATTLEFIELD,
|
||||
new ExchangeLifeControllerTargetEffect(),
|
||||
new TapSourceCost(),
|
||||
new IsStepCondition(PhaseStep.UPKEEP),
|
||||
null);
|
||||
new IsStepCondition(PhaseStep.UPKEEP)
|
||||
);
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
ability.addTarget(new TargetOpponent());
|
||||
this.addAbility(ability);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.UntapTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
|
|
@ -34,14 +34,13 @@ public final class SarkhanVol extends CardImpl {
|
|||
this.setStartingLoyalty(4);
|
||||
|
||||
// +1: Creatures you control get +1/+1 and gain haste until end of turn.
|
||||
Effects effects1 = new Effects(new BoostControlledEffect(
|
||||
1, 1, Duration.EndOfTurn
|
||||
).setText("creatures you control get +1/+1"));
|
||||
effects1.add(new GainAbilityControlledEffect(
|
||||
HasteAbility.getInstance(), Duration.EndOfTurn,
|
||||
StaticFilters.FILTER_PERMANENT_CREATURES
|
||||
).setText("and gain haste until end of turn"));
|
||||
this.addAbility(new LoyaltyAbility(effects1, 1));
|
||||
Effect boostEffect = new BoostControlledEffect(1, 1, Duration.EndOfTurn)
|
||||
.setText("creatures you control get +1/+1");
|
||||
Effect hasteEffect = new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES)
|
||||
.setText("and gain haste until end of turn");
|
||||
LoyaltyAbility firstAbility = new LoyaltyAbility(boostEffect, 1);
|
||||
firstAbility.addEffect(hasteEffect);
|
||||
this.addAbility(firstAbility);
|
||||
|
||||
// -2: Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.
|
||||
LoyaltyAbility ability = new LoyaltyAbility(new GainControlTargetEffect(Duration.EndOfTurn), -2);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public final class Scourglass extends CardImpl {
|
|||
|
||||
// {T}, Sacrifice Scourglass: Destroy all permanents except for artifacts and lands. Activate this ability only during your upkeep.
|
||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
||||
new DestroyAllEffect(filter), new TapSourceCost(), new IsStepCondition(PhaseStep.UPKEEP), null);
|
||||
new DestroyAllEffect(filter), new TapSourceCost(), new IsStepCondition(PhaseStep.UPKEEP));
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,12 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.Costs;
|
||||
import mage.abilities.costs.CostsImpl;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -18,9 +14,10 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author nantuko
|
||||
|
|
@ -31,22 +28,20 @@ public final class TrigonOfCorruption extends CardImpl {
|
|||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}");
|
||||
|
||||
// Trigon of Corruption enters the battlefield with three charge counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(3)), ""));
|
||||
|
||||
// {2}, {T}, Remove a charge counter from Trigon of Corruption: Put a -1/-1 counter on target creature.
|
||||
Costs costs = new CostsImpl();
|
||||
costs.add(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance()));
|
||||
costs.add(new TapSourceCost());
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.M1M1.createInstance()), costs);
|
||||
ability.addManaCost(new GenericManaCost(2));
|
||||
Target target = new TargetCreaturePermanent();
|
||||
ability.addTarget(target);
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(3)), "with three charge counters on it"));
|
||||
|
||||
// {B}{B}, {T}: Put a charge counter on Trigon of Corruption.
|
||||
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), new TapSourceCost());
|
||||
ability2.addManaCost(new ManaCostsImpl<>("{B}{B}"));
|
||||
this.addAbility(ability2);
|
||||
|
||||
// {2}, {T}, Remove a charge counter from Trigon of Corruption: Put a -1/-1 counter on target creature.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.M1M1.createInstance()), new GenericManaCost(2));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance()));
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
|
||||
}
|
||||
|
||||
private TrigonOfCorruption(final TrigonOfCorruption card) {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,9 @@
|
|||
|
||||
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.Costs;
|
||||
import mage.abilities.costs.CostsImpl;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
|
|
@ -26,23 +22,23 @@ import mage.game.permanent.token.InsectInfectToken;
|
|||
*/
|
||||
public final class TrigonOfInfestation extends CardImpl {
|
||||
|
||||
private static InsectInfectToken insectToken = new InsectInfectToken();
|
||||
|
||||
public TrigonOfInfestation(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(3)), ""));
|
||||
|
||||
Costs costs = new CostsImpl();
|
||||
costs.add(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance()));
|
||||
costs.add(new TapSourceCost());
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(insectToken), costs);
|
||||
ability.addManaCost(new GenericManaCost(2));
|
||||
this.addAbility(ability);
|
||||
// Trigon of Infestation enters the battlefield with three charge counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(3)), "with three charge counters on it"));
|
||||
|
||||
// {G}{G}, {T}: Put a charge counter on Trigon of Infestation.
|
||||
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), new TapSourceCost());
|
||||
ability2.addManaCost(new ManaCostsImpl<>("{G}{G}"));
|
||||
this.addAbility(ability2);
|
||||
|
||||
// {2}, {T}, Remove a charge counter from Trigon of Infestation: Create a 1/1 green Phyrexian Insect creature token with infect.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new InsectInfectToken()), new GenericManaCost(2));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance()));
|
||||
this.addAbility(ability);
|
||||
|
||||
}
|
||||
|
||||
private TrigonOfInfestation(final TrigonOfInfestation card) {
|
||||
|
|
|
|||
|
|
@ -1,14 +1,9 @@
|
|||
|
||||
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.Costs;
|
||||
import mage.abilities.costs.CostsImpl;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
|
|
@ -31,21 +26,20 @@ public final class TrigonOfMending extends CardImpl {
|
|||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
|
||||
|
||||
// Trigon of Mending enters the battlefield with three charge counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(3)), ""));
|
||||
|
||||
// {2}, {T}, Remove a charge counter from Trigon of Mending: Target player gains 3 life.
|
||||
Costs<Cost> costs = new CostsImpl<>();
|
||||
costs.add(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance()));
|
||||
costs.add(new TapSourceCost());
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeTargetEffect(3), costs);
|
||||
ability.addManaCost(new GenericManaCost(2));
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(3)), "with three charge counters on it"));
|
||||
|
||||
// {W}{W}, {T}: Put a charge counter on Trigon of Mending.
|
||||
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), new TapSourceCost());
|
||||
ability2.addManaCost(new ManaCostsImpl<>("{W}{W}"));
|
||||
this.addAbility(ability2);
|
||||
|
||||
// {2}, {T}, Remove a charge counter from Trigon of Mending: Target player gains 3 life.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeTargetEffect(3), new GenericManaCost(2));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance()));
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
|
||||
}
|
||||
|
||||
private TrigonOfMending(final TrigonOfMending card) {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,9 @@
|
|||
|
||||
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.Costs;
|
||||
import mage.abilities.costs.CostsImpl;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
|
|
@ -21,7 +17,6 @@ import mage.constants.CardType;
|
|||
import mage.constants.Duration;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -32,21 +27,21 @@ public final class TrigonOfRage extends CardImpl {
|
|||
public TrigonOfRage(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(3)), ""));
|
||||
|
||||
Costs costs = new CostsImpl();
|
||||
costs.add(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance()));
|
||||
costs.add(new TapSourceCost());
|
||||
Effect pumpEffect = new BoostTargetEffect(3, 0, Duration.EndOfTurn);
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, pumpEffect, costs);
|
||||
ability.addManaCost(new GenericManaCost(2));
|
||||
Target target = new TargetCreaturePermanent();
|
||||
ability.addTarget(target);
|
||||
this.addAbility(ability);
|
||||
// Trigon of Rage enters the battlefield with three charge counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(3)), "with three charge counters on it"));
|
||||
|
||||
// {R}{R}, {T}: Put a charge counter on Trigon of Rage.
|
||||
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), new TapSourceCost());
|
||||
ability2.addManaCost(new ManaCostsImpl<>("{R}{R}"));
|
||||
this.addAbility(ability2);
|
||||
|
||||
// {2}, {T}, Remove a charge counter from Trigon of Rage: Target creature gets +3/+0 until end of turn.
|
||||
Effect pumpEffect = new BoostTargetEffect(3, 0, Duration.EndOfTurn);
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, pumpEffect, new GenericManaCost(2));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance()));
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private TrigonOfRage(final TrigonOfRage card) {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,9 @@
|
|||
|
||||
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.Costs;
|
||||
import mage.abilities.costs.CostsImpl;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
|
|
@ -28,18 +24,19 @@ public final class TrigonOfThought extends CardImpl {
|
|||
public TrigonOfThought(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{5}");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(3)), ""));
|
||||
|
||||
Costs costs = new CostsImpl();
|
||||
costs.add(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance()));
|
||||
costs.add(new TapSourceCost());
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), costs);
|
||||
ability.addManaCost(new GenericManaCost(2));
|
||||
this.addAbility(ability);
|
||||
// Trigon of Thought enters the battlefield with three charge counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance(3)), "with three charge counters on it"));
|
||||
|
||||
// {U}{U}, {T}: Put a charge counter on Trigon of Thought.
|
||||
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), new TapSourceCost());
|
||||
ability2.addManaCost(new ManaCostsImpl<>("{U}{U}"));
|
||||
this.addAbility(ability2);
|
||||
|
||||
// {2}, {T}, Remove a charge counter from Trigon of Thought: Draw a card.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new GenericManaCost(2));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new RemoveCountersSourceCost(CounterType.CHARGE.createInstance()));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private TrigonOfThought(final TrigonOfThought card) {
|
||||
|
|
|
|||
|
|
@ -1,28 +1,30 @@
|
|||
|
||||
package mage.cards.v;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.CantBlockAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.costs.mana.ColoredManaCost;
|
||||
import mage.abilities.decorator.ConditionalGainActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.decorator.ConditionalContinuousEffect;
|
||||
import mage.abilities.effects.common.RegenerateSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ColoredManaSymbol;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX
|
||||
*/
|
||||
public final class VillainousOgre extends CardImpl {
|
||||
|
||||
private static final String rule = "As long as you control a Demon, {this} has {B}: Regenerate Villainous Ogre";
|
||||
private static final String rule = "As long as you control a Demon, {this} has \"{B}: Regenerate {this}.\"";
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("Demon");
|
||||
static {
|
||||
filter.add(SubType.DEMON.getPredicate());
|
||||
|
|
@ -38,13 +40,10 @@ public final class VillainousOgre extends CardImpl {
|
|||
|
||||
this.addAbility(new CantBlockAbility());
|
||||
|
||||
// As long as you control a Demon, Villainous Ogre has "{B}: Regenerate Villainous Ogre.
|
||||
this.addAbility(new ConditionalGainActivatedAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new RegenerateSourceEffect(),
|
||||
new ColoredManaCost(ColoredManaSymbol.B),
|
||||
new PermanentsOnTheBattlefieldCondition(filter),
|
||||
rule));
|
||||
// As long as you control a Demon, Villainous Ogre has "{B}: Regenerate Villainous Ogre."
|
||||
Ability regenAbility = new SimpleActivatedAbility(new RegenerateSourceEffect(), new ManaCostsImpl<>("{B}"));
|
||||
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
|
||||
new GainAbilitySourceEffect(regenAbility), new PermanentsOnTheBattlefieldCondition(filter), rule)));
|
||||
}
|
||||
|
||||
private VillainousOgre(final VillainousOgre card) {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class ProtectionFromTypeTest extends CardTestPlayerBase {
|
|||
addCard(Zone.BATTLEFIELD, playerB, "Coral Merfolk");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}, Remove a charge counter from {this}, {T}: Put a -1/-1 counter on target creature.", "Coral Merfolk");
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}, {T}, Remove a charge counter from {this}: Put a -1/-1 counter on target creature.", "Coral Merfolk");
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,8 @@ import mage.ApprovingObject;
|
|||
import mage.MageObject;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.Costs;
|
||||
import mage.abilities.costs.mana.ManaCosts;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.mana.ManaOptions;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.*;
|
||||
|
|
@ -59,71 +57,23 @@ public abstract class ActivatedAbilityImpl extends AbilityImpl implements Activa
|
|||
condition = ability.condition;
|
||||
}
|
||||
|
||||
public ActivatedAbilityImpl(Zone zone) {
|
||||
this(zone, null);
|
||||
}
|
||||
|
||||
public ActivatedAbilityImpl(Zone zone, Effect effect) {
|
||||
protected ActivatedAbilityImpl(Zone zone, Effect effect) {
|
||||
super(AbilityType.ACTIVATED, zone);
|
||||
this.addEffect(effect);
|
||||
}
|
||||
|
||||
public ActivatedAbilityImpl(Zone zone, Effect effect, ManaCosts cost) {
|
||||
protected ActivatedAbilityImpl(Zone zone, Effect effect, ManaCosts cost) {
|
||||
super(AbilityType.ACTIVATED, zone);
|
||||
this.addEffect(effect);
|
||||
this.addManaCost(cost);
|
||||
}
|
||||
|
||||
public ActivatedAbilityImpl(Zone zone, Effects effects, ManaCosts cost) {
|
||||
super(AbilityType.ACTIVATED, zone);
|
||||
if (effects != null) {
|
||||
for (Effect effect : effects) {
|
||||
this.addEffect(effect);
|
||||
}
|
||||
}
|
||||
this.addManaCost(cost);
|
||||
}
|
||||
|
||||
public ActivatedAbilityImpl(Zone zone, Effect effect, Cost cost) {
|
||||
protected ActivatedAbilityImpl(Zone zone, Effect effect, Cost cost) {
|
||||
super(AbilityType.ACTIVATED, zone);
|
||||
this.addEffect(effect);
|
||||
this.addCost(cost);
|
||||
}
|
||||
|
||||
public ActivatedAbilityImpl(Zone zone, Effect effect, Costs<Cost> costs) {
|
||||
super(AbilityType.ACTIVATED, zone);
|
||||
this.addEffect(effect);
|
||||
if (costs != null) {
|
||||
for (Cost cost : costs) {
|
||||
this.addCost(cost);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ActivatedAbilityImpl(Zone zone, Effects effects, Cost cost) {
|
||||
super(AbilityType.ACTIVATED, zone);
|
||||
if (effects != null) {
|
||||
for (Effect effect : effects) {
|
||||
this.addEffect(effect);
|
||||
}
|
||||
}
|
||||
this.addCost(cost);
|
||||
}
|
||||
|
||||
public ActivatedAbilityImpl(Zone zone, Effects effects, Costs<Cost> costs) {
|
||||
super(AbilityType.ACTIVATED, zone);
|
||||
if (effects != null) {
|
||||
for (Effect effect : effects) {
|
||||
this.addEffect(effect);
|
||||
}
|
||||
}
|
||||
if (costs != null) {
|
||||
for (Cost cost : costs) {
|
||||
this.addCost(cost);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract ActivatedAbilityImpl copy();
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import mage.abilities.costs.Cost;
|
|||
import mage.abilities.costs.common.PayLoyaltyCost;
|
||||
import mage.abilities.costs.common.PayVariableLoyaltyCost;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.constants.TimingRule;
|
||||
import mage.constants.Zone;
|
||||
|
||||
|
|
@ -18,21 +17,11 @@ public class LoyaltyAbility extends ActivatedAbilityImpl {
|
|||
this.timing = TimingRule.SORCERY;
|
||||
}
|
||||
|
||||
public LoyaltyAbility(Effects effects, int loyalty) {
|
||||
super(Zone.BATTLEFIELD, effects, new PayLoyaltyCost(loyalty));
|
||||
this.timing = TimingRule.SORCERY;
|
||||
}
|
||||
|
||||
public LoyaltyAbility(Effect effect) {
|
||||
super(Zone.BATTLEFIELD, effect, new PayVariableLoyaltyCost());
|
||||
this.timing = TimingRule.SORCERY;
|
||||
}
|
||||
|
||||
public LoyaltyAbility(Effects effects) {
|
||||
super(Zone.BATTLEFIELD, effects, new PayVariableLoyaltyCost());
|
||||
this.timing = TimingRule.SORCERY;
|
||||
}
|
||||
|
||||
protected LoyaltyAbility(final LoyaltyAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.abilities.common;
|
||||
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
|
|
@ -8,12 +7,12 @@ import mage.abilities.costs.Cost;
|
|||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.TimingRule;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ActivateIfConditionActivatedAbility extends ActivatedAbilityImpl {
|
||||
|
||||
public ActivateIfConditionActivatedAbility(Zone zone, Effect effect, Cost cost, Condition condition) {
|
||||
this(zone, effect, cost, condition, TimingRule.INSTANT);
|
||||
}
|
||||
|
|
@ -28,11 +27,6 @@ public class ActivateIfConditionActivatedAbility extends ActivatedAbilityImpl {
|
|||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean resolve(Game game) {
|
||||
return super.resolve(game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
StringBuilder sb = new StringBuilder(super.getRule());
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -59,11 +58,10 @@ public class EscapesWithAbility extends EntersBattlefieldAbility {
|
|||
sb.append(" on it.");
|
||||
}
|
||||
|
||||
if (triggeredAbility == null) {
|
||||
// Do nothing
|
||||
} else if (triggeredAbility instanceof DelayedTriggeredAbility) {
|
||||
if (triggeredAbility instanceof DelayedTriggeredAbility) {
|
||||
sb.append(" ");
|
||||
sb.append(this.triggeredAbility.getRule());
|
||||
} else {
|
||||
} else if (triggeredAbility != null) {
|
||||
sb.append("\"");
|
||||
sb.append(this.triggeredAbility.getRule());
|
||||
sb.append("\"");
|
||||
|
|
@ -107,7 +105,7 @@ class EscapesWithEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
if (counter > 0) {
|
||||
List<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects");
|
||||
List<UUID> appliedEffects = (List<UUID>) this.getValue("appliedEffects");
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(counter), source.getControllerId(), source, game, appliedEffects);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import mage.abilities.costs.Cost;
|
|||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.TimingRule;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
|
|
@ -35,11 +34,6 @@ public class LimitedTimesPerTurnActivatedAbility extends ActivatedAbilityImpl {
|
|||
this.condition = ability.condition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean resolve(Game game) {
|
||||
return super.resolve(game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
StringBuilder sb = new StringBuilder(super.getRule()).append(" Activate ");
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
|
||||
package mage.abilities.common;
|
||||
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.Costs;
|
||||
import mage.abilities.costs.mana.ManaCosts;
|
||||
import mage.abilities.effects.Effect;
|
||||
|
||||
|
|
@ -26,15 +24,11 @@ public class SimpleActivatedAbility extends ActivatedAbilityImpl {
|
|||
super(zone, effect, cost);
|
||||
}
|
||||
|
||||
public SimpleActivatedAbility(Zone zone, Effect effect, Costs<Cost> costs) {
|
||||
super(zone, effect, costs);
|
||||
}
|
||||
|
||||
public SimpleActivatedAbility(Zone zone, Effect effect, Cost cost) {
|
||||
super(zone, effect, cost);
|
||||
}
|
||||
|
||||
protected SimpleActivatedAbility(SimpleActivatedAbility ability) {
|
||||
protected SimpleActivatedAbility(final SimpleActivatedAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package mage.abilities.decorator;
|
|||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.Costs;
|
||||
import mage.abilities.costs.mana.ManaCosts;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.Effects;
|
||||
|
|
@ -36,12 +35,6 @@ public class ConditionalActivatedAbility extends ActivatedAbilityImpl {
|
|||
this.ruleText = rule;
|
||||
}
|
||||
|
||||
public ConditionalActivatedAbility(Zone zone, Effect effect, Costs<Cost> costs, Condition condition, String rule) {
|
||||
super(zone, effect, costs);
|
||||
this.condition = condition;
|
||||
this.ruleText = rule;
|
||||
}
|
||||
|
||||
public ConditionalActivatedAbility(Zone zone, Effect effect, Cost cost, Condition condition, String rule) {
|
||||
super(zone, effect, cost);
|
||||
this.condition = condition;
|
||||
|
|
@ -80,7 +73,6 @@ public class ConditionalActivatedAbility extends ActivatedAbilityImpl {
|
|||
if (conditionText.startsWith("during")
|
||||
|| conditionText.startsWith("before")
|
||||
|| conditionText.startsWith("if")) {
|
||||
sb.append("");
|
||||
} else {
|
||||
sb.append("if ");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,75 +0,0 @@
|
|||
|
||||
package mage.abilities.decorator;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.Costs;
|
||||
import mage.abilities.costs.mana.ManaCosts;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.constants.EffectType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* The card / permanent has the ability only, if the condition is true.
|
||||
*
|
||||
* @author LevelX
|
||||
*/
|
||||
public class ConditionalGainActivatedAbility extends ActivatedAbilityImpl {
|
||||
|
||||
private String staticText = "";
|
||||
|
||||
private static final Effects emptyEffects = new Effects();
|
||||
|
||||
public ConditionalGainActivatedAbility(Zone zone, Effect effect, ManaCosts cost, Condition condition, String rule) {
|
||||
super(zone, effect, cost);
|
||||
this.condition = condition;
|
||||
this.staticText = rule;
|
||||
}
|
||||
|
||||
public ConditionalGainActivatedAbility(Zone zone, Effect effect, Costs costs, Condition condition, String rule) {
|
||||
super(zone, effect, costs);
|
||||
this.condition = condition;
|
||||
this.staticText = rule;
|
||||
}
|
||||
|
||||
public ConditionalGainActivatedAbility(Zone zone, Effect effect, Cost cost, Condition condition, String rule) {
|
||||
super(zone, effect, cost);
|
||||
this.condition = condition;
|
||||
this.staticText = rule;
|
||||
}
|
||||
|
||||
public ConditionalGainActivatedAbility(ConditionalGainActivatedAbility ability) {
|
||||
super(ability);
|
||||
this.staticText = ability.staticText;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Effects getEffects(Game game, EffectType effectType) {
|
||||
if (!condition.apply(game, this)) {
|
||||
return emptyEffects;
|
||||
}
|
||||
return super.getEffects(game, effectType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActivationStatus canActivate(UUID playerId, Game game) {
|
||||
if (!condition.apply(game, this)) {
|
||||
return ActivationStatus.getFalse();
|
||||
}
|
||||
return super.canActivate(playerId, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConditionalGainActivatedAbility copy() {
|
||||
return new ConditionalGainActivatedAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return staticText;
|
||||
}
|
||||
}
|
||||
|
|
@ -53,7 +53,7 @@ public class EscapeAbility extends SpellAbility {
|
|||
}
|
||||
|
||||
text += ", Exile " + CardUtil.numberToText(exileCount) + " other cards from your graveyard."
|
||||
+ "<i>(You may cast this card from your graveyard for its escape cost.)</i>";
|
||||
+ " <i>(You may cast this card from your graveyard for its escape cost.)</i>";
|
||||
this.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(exileCount, filter), "")); // hide additional cost text from rules
|
||||
|
||||
this.staticText = text;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue