* Kicker - added support of X and mana cost interactions like Rosheen Meanderer + Verdeloth the Ancient combo (#3538);

* Rosheen Meanderer - fixed that mana can be payed for mana cost with X instead any cost with X (#3538);
This commit is contained in:
Oleg Agafonov 2019-06-18 11:28:41 +04:00
parent 49fc094546
commit cc54a92daa
7 changed files with 216 additions and 147 deletions

View file

@ -1,22 +1,17 @@
package mage.cards.k;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CountersSourceCount;
import mage.abilities.effects.Effect;
import mage.abilities.dynamicvalue.common.GetKickerXValue;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.KickerAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
@ -24,10 +19,10 @@ import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
import java.util.UUID;
/**
*
* @author emerald000
*/
public final class KangeeAerieKeeper extends CardImpl {
@ -55,7 +50,7 @@ public final class KangeeAerieKeeper extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// When Kangee, Aerie Keeper enters the battlefield, if it was kicked, put X feather counters on it.
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new AddCountersSourceEffect(CounterType.FEATHER.createInstance(), new KangeeAerieKeeperGetKickerXValue(), true));
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new AddCountersSourceEffect(CounterType.FEATHER.createInstance(), GetKickerXValue.instance, true));
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, put X feather counters on it."));
// Other Bird creatures get +1/+1 for each feather counter on Kangee, Aerie Keeper.
@ -71,38 +66,3 @@ public final class KangeeAerieKeeper extends CardImpl {
return new KangeeAerieKeeper(this);
}
}
class KangeeAerieKeeperGetKickerXValue implements DynamicValue {
public KangeeAerieKeeperGetKickerXValue() {
}
@Override
public int calculate(Game game, Ability source, Effect effect) {
int count = 0;
Card card = game.getCard(source.getSourceId());
if (card != null) {
for (Ability ability : card.getAbilities()) {
if (ability instanceof KickerAbility) {
count += ((KickerAbility) ability).getXManaValue();
}
}
}
return count;
}
@Override
public KangeeAerieKeeperGetKickerXValue copy() {
return new KangeeAerieKeeperGetKickerXValue();
}
@Override
public String toString() {
return "X";
}
@Override
public String getMessage() {
return "X";
}
}

View file

@ -1,10 +1,7 @@
package mage.cards.r;
import java.util.UUID;
import mage.ConditionalMana;
import mage.MageInt;
import mage.MageObject;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
@ -12,20 +9,20 @@ import mage.abilities.effects.mana.BasicManaEffect;
import mage.abilities.mana.BasicManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AbilityType;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.game.Game;
import java.util.UUID;
/**
*
* @author jeffwadsworth
*/
public final class RosheenMeanderer extends CardImpl {
public RosheenMeanderer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R/G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R/G}");
addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.GIANT);
this.subtype.add(SubType.SHAMAN);
@ -75,15 +72,16 @@ class RosheenMeandererConditionalMana extends ConditionalMana {
class RosheenMeandererManaCondition implements Condition {
/*
A cost that contains {X} may be a spells total cost, an activated abilitys cost, a suspend cost, or a cost youre
asked to pay as part of the resolution of a spell or ability (such as Condescend). A spells total cost includes either
its mana cost (printed in the upper right corner) or its alternative cost (such as flashback), as well as any additional
costs (such as kicker). If its something you can spend mana on, its a cost. If that cost includes the {X} symbol in it,
you can spend mana generated by Rosheen on that cost. (2017-11-17)
*/
@Override
public boolean apply(Game game, Ability source) {
if (AbilityType.SPELL == source.getAbilityType()) {
MageObject object = game.getObject(source.getSourceId());
return object != null
&& object.getManaCost().getText().contains("X");
} else {
return source.getManaCosts().getText().contains("X");
}
return source.getManaCostsToPay().containsX();
}
}

View file

@ -1,19 +1,14 @@
package mage.cards.v;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.dynamicvalue.common.GetKickerXValue;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.keyword.KickerAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
@ -21,17 +16,17 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.PermanentIdPredicate;
import mage.game.Game;
import mage.game.permanent.token.SaprolingToken;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class VerdelothTheAncient extends CardImpl {
public VerdelothTheAncient(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{G}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}{G}");
addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.TREEFOLK);
@ -40,22 +35,22 @@ public final class VerdelothTheAncient extends CardImpl {
// Kicker {X}
this.addAbility(new KickerAbility("{X}"));
// Saproling creatures and other Treefolk creatures get +1/+1.
FilterCreaturePermanent filter = new FilterCreaturePermanent("Saproling creatures and other Treefolk creatures");
filter.add(Predicates.or(
Predicates.and(new SubtypePredicate(SubType.TREEFOLK), Predicates.not(new PermanentIdPredicate(this.getId()))),
new SubtypePredicate(SubType.SAPROLING))
);
);
filter.add(Predicates.not(new PermanentIdPredicate(this.getId())));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1,1, Duration.WhileOnBattlefield, filter, false)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false)));
// When Verdeloth the Ancient enters the battlefield, if it was kicked, create X 1/1 green Saproling creature tokens.
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new SaprolingToken(), new GetKickerXValue()), false);
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new SaprolingToken(), GetKickerXValue.instance), false);
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, KickedCondition.instance,
"When {this} enters the battlefield, if it was kicked, create X 1/1 green Saproling creature tokens."));
}
public VerdelothTheAncient(final VerdelothTheAncient card) {
@ -66,39 +61,4 @@ public final class VerdelothTheAncient extends CardImpl {
public VerdelothTheAncient copy() {
return new VerdelothTheAncient(this);
}
}
class GetKickerXValue implements DynamicValue {
public GetKickerXValue() {
}
@Override
public int calculate(Game game, Ability source, Effect effect) {
int count = 0;
Card card = game.getCard(source.getSourceId());
if (card != null) {
for (Ability ability: card.getAbilities()) {
if (ability instanceof KickerAbility) {
count += ((KickerAbility) ability).getXManaValue();
}
}
}
return count;
}
@Override
public GetKickerXValue copy() {
return new GetKickerXValue();
}
@Override
public String toString() {
return "X";
}
@Override
public String getMessage() {
return "X";
}
}