forked from External/mage
Merge pull request #5297 from magefree/rystan-patch-3
Update VodalianArcanist.java
This commit is contained in:
commit
17774aaad5
1 changed files with 3 additions and 74 deletions
|
|
@ -2,26 +2,13 @@
|
|||
package mage.cards.v;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ConditionalMana;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.mana.ConditionalColorlessManaAbility;
|
||||
import mage.abilities.mana.builder.ConditionalManaBuilder;
|
||||
import mage.abilities.mana.conditional.ManaCondition;
|
||||
import mage.constants.SubType;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.common.FilterInstantOrSorceryCard;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
|
|
@ -36,8 +23,9 @@ public final class VodalianArcanist extends CardImpl {
|
|||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// {t}: Add {C}. Spend this mana only to cast an instant or sorcery spell.
|
||||
this.addAbility(new ConditionalColorlessManaAbility(new TapSourceCost(), 1, new InstantOrSorcerySpellManaBuilder()));
|
||||
// {T}: Add {C}. Spend this mana only to cast an instant or sorcery spell.
|
||||
this.addAbility(new ConditionalColorlessManaAbility(new TapSourceCost(), 1,
|
||||
new mage.abilities.mana.builder.common.InstantOrSorcerySpellManaBuilder()));
|
||||
}
|
||||
|
||||
public VodalianArcanist(final VodalianArcanist card) {
|
||||
|
|
@ -49,62 +37,3 @@ public final class VodalianArcanist extends CardImpl {
|
|||
return new VodalianArcanist(this);
|
||||
}
|
||||
}
|
||||
|
||||
class InstantOrSorcerySpellManaBuilder extends ConditionalManaBuilder {
|
||||
|
||||
@Override
|
||||
public ConditionalMana build(Object... options) {
|
||||
return new InstantOrSorceryCastConditionalMana(this.mana);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Spend this mana only to cast an instant or sorcery spell";
|
||||
}
|
||||
}
|
||||
|
||||
class InstantOrSorceryCastConditionalMana extends ConditionalMana {
|
||||
|
||||
public InstantOrSorceryCastConditionalMana(Mana mana) {
|
||||
super(mana);
|
||||
staticText = "Spend this mana only to cast an instant or sorcery spell";
|
||||
addCondition(new InstantOrSorceryCastManaCondition());
|
||||
}
|
||||
}
|
||||
|
||||
class InstantOrSorceryCastManaCondition extends ManaCondition implements Condition {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (source instanceof SpellAbility) {
|
||||
MageObject object = game.getObject(source.getSourceId());
|
||||
if (object != null && (object.isInstant() || object.isSorcery())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source, UUID originalId, Cost costsToPay) {
|
||||
return apply(game, source);
|
||||
}
|
||||
}
|
||||
|
||||
class InstantOrSorceryCardsInControllerGraveCondition implements Condition {
|
||||
|
||||
private int value;
|
||||
|
||||
public InstantOrSorceryCardsInControllerGraveCondition(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player p = game.getPlayer(source.getControllerId());
|
||||
if (p != null && p.getGraveyard().count(new FilterInstantOrSorceryCard(), game) >= value) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue