forked from External/mage
[DOM] Implement Legendary Sorceries
Add: Target Any Target for damage spells Add: Drudge Sentinel Fix: Genesis Wave Filter
This commit is contained in:
parent
ecbe7e68a6
commit
702756b4e7
13 changed files with 935 additions and 12 deletions
|
|
@ -0,0 +1,26 @@
|
|||
package mage.abilities.common;
|
||||
|
||||
import mage.abilities.condition.common.LegendaryCondition;
|
||||
import mage.constants.Zone;
|
||||
|
||||
/**
|
||||
* @author JRHerlehy
|
||||
* Created on 4/8/18.
|
||||
*/
|
||||
public class LegendarySpellAbility extends SimpleStaticAbility {
|
||||
|
||||
public LegendarySpellAbility() {
|
||||
super(Zone.ALL, new CastOnlyIfConditionIsTrueEffect(LegendaryCondition.instance));
|
||||
this.setRuleAtTheTop(true);
|
||||
this.getEffects().get(0).setText("<i>(You may cast a legendary sorcery only if you control a legendary creature or planeswalker.)</i>");
|
||||
}
|
||||
|
||||
private LegendarySpellAbility(final LegendarySpellAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LegendarySpellAbility copy() {
|
||||
return new LegendarySpellAbility(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package mage.abilities.condition.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* @author JRHerlehy
|
||||
* Created on 4/7/18.
|
||||
*/
|
||||
public enum LegendaryCondition implements Condition {
|
||||
|
||||
instance;
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("legendary creature or planeswalker");
|
||||
|
||||
static {
|
||||
filter.add(
|
||||
Predicates.and(
|
||||
new SupertypePredicate(SuperType.LEGENDARY),
|
||||
Predicates.or(
|
||||
new CardTypePredicate(CardType.CREATURE),
|
||||
new CardTypePredicate(CardType.PLANESWALKER)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return game.getBattlefield().contains(filter, source.getControllerId(), 1, game);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue