updated various activated abilities

This commit is contained in:
Evan Kranzler 2017-09-12 10:10:18 -04:00
parent 9b25dd0e39
commit 786a62befa
9 changed files with 40 additions and 172 deletions

View file

@ -52,7 +52,6 @@ import mage.target.common.TargetCardInYourGraveyard;
*
* @author cbt33
*/
public class CabalInquisitor extends CardImpl {
public CabalInquisitor(UUID ownerId, CardSetInfo setInfo) {
@ -82,11 +81,8 @@ public class CabalInquisitor extends CardImpl {
}
}
class ActivateAsSorceryConditionalActivatedAbility extends ActivatedAbilityImpl {
private Condition condition;
private static final Effects emptyEffects = new Effects();
public ActivateAsSorceryConditionalActivatedAbility(Zone zone, Effect effect, ManaCosts cost, Condition condition) {
@ -95,10 +91,8 @@ class ActivateAsSorceryConditionalActivatedAbility extends ActivatedAbilityImpl
timing = TimingRule.SORCERY;
}
public ActivateAsSorceryConditionalActivatedAbility(final ActivateAsSorceryConditionalActivatedAbility ability) {
super(ability);
this.condition = ability.condition;
}
@Override
@ -109,14 +103,6 @@ class ActivateAsSorceryConditionalActivatedAbility extends ActivatedAbilityImpl
return super.getEffects(game, effectType);
}
@Override
public boolean canActivate(UUID playerId, Game game) {
if (!condition.apply(game, this)) {
return false;
}
return super.canActivate(playerId, game);
}
@Override
public ActivateAsSorceryConditionalActivatedAbility copy() {
return new ActivateAsSorceryConditionalActivatedAbility(this);

View file

@ -91,8 +91,6 @@ class ChronatogTotemAbility extends LimitedTimesPerTurnActivatedAbility {
private static final Effects emptyEffects = new Effects();
private final Condition condition;
public ChronatogTotemAbility(Zone zone, Effect effect, Cost cost, Condition condition) {
super(zone, effect, cost);
this.condition = condition;
@ -100,7 +98,6 @@ class ChronatogTotemAbility extends LimitedTimesPerTurnActivatedAbility {
public ChronatogTotemAbility(ChronatogTotemAbility ability) {
super(ability);
this.condition = ability.condition;
}
@Override
@ -111,14 +108,6 @@ class ChronatogTotemAbility extends LimitedTimesPerTurnActivatedAbility {
return super.getEffects(game, effectType);
}
@Override
public boolean canActivate(UUID playerId, Game game) {
if (!condition.apply(game, this)) {
return false;
}
return super.canActivate(playerId, game);
}
@Override
public ChronatogTotemAbility copy() {
return new ChronatogTotemAbility(this);

View file

@ -27,19 +27,19 @@
*/
package mage.cards.e;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
/**
*
@ -51,7 +51,12 @@ public class EvolvingWilds extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.LAND}, null);
// {T}, Sacrifice Evolving Wilds: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library.
this.addAbility(new EvolvingWildsAbility());
Ability ability = new SimpleActivatedAbility(
Zone.BATTLEFIELD,
new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_BASIC_LAND_CARD), true),
new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);
}
public EvolvingWilds(final EvolvingWilds card) {
@ -64,24 +69,3 @@ public class EvolvingWilds extends CardImpl {
}
}
class EvolvingWildsAbility extends ActivatedAbilityImpl {
public EvolvingWildsAbility() {
super(Zone.BATTLEFIELD, null);
addCost(new TapSourceCost());
addCost(new SacrificeSourceCost());
TargetCardInLibrary target = new TargetCardInLibrary(StaticFilters.FILTER_BASIC_LAND_CARD);
addEffect(new SearchLibraryPutInPlayEffect(target, true, Outcome.PutLandInPlay));
}
public EvolvingWildsAbility(final EvolvingWildsAbility ability) {
super(ability);
}
@Override
public EvolvingWildsAbility copy() {
return new EvolvingWildsAbility(this);
}
}

View file

@ -28,10 +28,11 @@
package mage.cards.g;
import java.util.UUID;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.mana.ColorlessManaAbility;
import mage.cards.CardImpl;
@ -52,7 +53,13 @@ public class GargoyleCastle extends CardImpl {
this.addAbility(new ColorlessManaAbility());
// {T}, {5}, Sacrifice Gargoyle Castle: Put a 3/4 colorless Gargoyle artifact creature token with flying onto the battlefield.
this.addAbility(new GargoyleCastleAbility());
Ability ability = new SimpleActivatedAbility(
Zone.BATTLEFIELD,
new CreateTokenEffect(new GargoyleToken()),
new ManaCostsImpl("{5}"));
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);
}
public GargoyleCastle(final GargoyleCastle card) {
@ -65,24 +72,3 @@ public class GargoyleCastle extends CardImpl {
}
}
class GargoyleCastleAbility extends ActivatedAbilityImpl {
public GargoyleCastleAbility() {
super(Zone.BATTLEFIELD, null);
addCost(new TapSourceCost());
addCost(new GenericManaCost(5));
addCost(new SacrificeSourceCost());
addEffect(new CreateTokenEffect(new GargoyleToken()));
}
public GargoyleCastleAbility(final GargoyleCastleAbility ability) {
super(ability);
}
@Override
public GargoyleCastleAbility copy() {
return new GargoyleCastleAbility(this);
}
}

View file

@ -97,7 +97,6 @@ class GroundlingPouncerAbility extends LimitedTimesPerTurnActivatedAbility {
private static final Effects emptyEffects = new Effects();
private final Condition condition;
private final String ruleText;
public GroundlingPouncerAbility(Zone zone, Effect effect, Cost cost, Condition condition, String rule) {
@ -108,7 +107,6 @@ class GroundlingPouncerAbility extends LimitedTimesPerTurnActivatedAbility {
public GroundlingPouncerAbility(GroundlingPouncerAbility ability) {
super(ability);
this.condition = ability.condition;
this.ruleText = ability.ruleText;
}
@ -120,14 +118,6 @@ class GroundlingPouncerAbility extends LimitedTimesPerTurnActivatedAbility {
return super.getEffects(game, effectType);
}
@Override
public boolean canActivate(UUID playerId, Game game) {
if (!condition.apply(game, this)) {
return false;
}
return super.canActivate(playerId, game);
}
@Override
public GroundlingPouncerAbility copy() {
return new GroundlingPouncerAbility(this);

View file

@ -95,7 +95,7 @@ public class KyrenToy extends CardImpl {
KyrenToyManaEffect() {
super();
staticText = "Add X mana of {C} to your mana pool, and then add {C} to your mana pool";
staticText = "Add an amount of {C} to your mana pool equal to X plus one";
}
KyrenToyManaEffect(final KyrenToyManaEffect effect) {

View file

@ -30,17 +30,13 @@ package mage.cards.m;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.TopLibraryCardTypeCondition;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
import mage.abilities.effects.common.ManaEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.effects.common.continuous.PlayWithTheTopCardRevealedEffect;
import mage.abilities.mana.ActivatedManaAbilityImpl;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -48,7 +44,6 @@ import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.game.Game;
/**
*
@ -93,46 +88,3 @@ public class MulDayaChannelers extends CardImpl {
return new MulDayaChannelers(this);
}
}
class MulDayaChannelersActivateIfConditionManaAbility extends ActivatedManaAbilityImpl {
private Condition condition;
public MulDayaChannelersActivateIfConditionManaAbility(Zone zone, ManaEffect effect, Cost cost, Condition condition) {
super(zone, effect, cost);
this.condition = condition;
}
public MulDayaChannelersActivateIfConditionManaAbility(MulDayaChannelersActivateIfConditionManaAbility ability) {
super(ability);
this.condition = ability.condition;
}
@Override
public boolean canActivate(UUID playerId, Game game) {
if (condition.apply(game, this)) {
return super.canActivate(playerId, game);
}
return false;
}
@Override
public boolean activate(Game game, boolean noMana) {
if (canActivate(this.controllerId, game)) {
return super.activate(game, noMana);
}
return false;
}
@Override
public String getRule() {
return "As long as the top card of your library is a land card, {this} has \"{T}: Add two mana of any one color to your mana pool.";
}
@Override
public MulDayaChannelersActivateIfConditionManaAbility copy() {
return new MulDayaChannelersActivateIfConditionManaAbility(this);
}
}

View file

@ -25,22 +25,21 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.t;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
/**
*
@ -50,7 +49,13 @@ public class TerramorphicExpanse extends CardImpl {
public TerramorphicExpanse(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.LAND}, null);
this.addAbility(new TerramorphicExpanseAbility());
Ability ability = new SimpleActivatedAbility(
Zone.BATTLEFIELD,
new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_BASIC_LAND_CARD), true),
new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);
}
public TerramorphicExpanse(final TerramorphicExpanse card) {
@ -63,24 +68,3 @@ public class TerramorphicExpanse extends CardImpl {
}
}
class TerramorphicExpanseAbility extends ActivatedAbilityImpl {
public TerramorphicExpanseAbility() {
super(Zone.BATTLEFIELD, null);
addCost(new TapSourceCost());
addCost(new SacrificeSourceCost());
TargetCardInLibrary target = new TargetCardInLibrary(StaticFilters.FILTER_BASIC_LAND_CARD);
addEffect(new SearchLibraryPutInPlayEffect(target, true, Outcome.PutLandInPlay));
}
public TerramorphicExpanseAbility(final TerramorphicExpanseAbility ability) {
super(ability);
}
@Override
public TerramorphicExpanseAbility copy() {
return new TerramorphicExpanseAbility(this);
}
}

View file

@ -30,7 +30,6 @@ package mage.cards.w;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.IsStepCondition;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.Effects;
@ -71,8 +70,6 @@ public class WellOfKnowledge extends CardImpl {
class WellOfKnowledgeConditionalActivatedAbility extends ActivatedAbilityImpl {
private final Condition condition;
public WellOfKnowledgeConditionalActivatedAbility() {
super(Zone.BATTLEFIELD, new WellOfKnowledgeEffect(), new GenericManaCost(2));
condition = new IsStepCondition(PhaseStep.DRAW, false);