mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
Show cascade ability in hand for Abaddon the Despoiler
This commit is contained in:
parent
30c7eb6a2b
commit
ae37b6be73
1 changed files with 14 additions and 13 deletions
|
|
@ -6,23 +6,23 @@ import mage.abilities.common.SimpleStaticAbility;
|
|||
import mage.abilities.condition.common.MyTurnCondition;
|
||||
import mage.abilities.decorator.ConditionalContinuousEffect;
|
||||
import mage.abilities.dynamicvalue.common.OpponentsLostLifeCount;
|
||||
import mage.abilities.effects.GainAbilitySpellsEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityControlledSpellsEffect;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.abilities.hint.ValueHint;
|
||||
import mage.abilities.keyword.CascadeAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.FilterStackObject;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.Predicate;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.card.CastFromZonePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.StackObject;
|
||||
import mage.watchers.common.PlayerLostLifeWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -32,10 +32,11 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class AbaddonTheDespoiler extends CardImpl {
|
||||
|
||||
private static final FilterStackObject filter = new FilterSpell();
|
||||
private static final FilterCard filter = new FilterCard();
|
||||
|
||||
static {
|
||||
filter.add(new CastFromZonePredicate(Zone.HAND));
|
||||
filter.add(Predicates.not(CardType.LAND.getPredicate()));
|
||||
filter.add(AbaddonTheDespoilerPredicate.instance);
|
||||
}
|
||||
|
||||
|
|
@ -57,7 +58,7 @@ public final class AbaddonTheDespoiler extends CardImpl {
|
|||
|
||||
// Mark of Chaos Ascendant — During your turn, spells you cast from your hand with mana value X or less have cascade, where X is the total amount of life your opponents have lost this turn.
|
||||
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
|
||||
new GainAbilitySpellsEffect(new CascadeAbility(false), filter),
|
||||
new GainAbilityControlledSpellsEffect(new CascadeAbility(false), filter),
|
||||
MyTurnCondition.instance, "during your turn, spells you cast from " +
|
||||
"your hand with mana value X or less have cascade, where X is the " +
|
||||
"total amount of life your opponents have lost this turn"
|
||||
|
|
@ -79,13 +80,13 @@ enum AbaddonTheDespoilerPredicate implements Predicate<MageObject> {
|
|||
|
||||
@Override
|
||||
public boolean apply(MageObject input, Game game) {
|
||||
if (!(input instanceof StackObject)) {
|
||||
return false;
|
||||
if (input instanceof Card) {
|
||||
Card card = (Card) input;
|
||||
return card.getManaValue() <= game
|
||||
.getState()
|
||||
.getWatcher(PlayerLostLifeWatcher.class)
|
||||
.getAllOppLifeLost(card.getOwnerId(), game);
|
||||
}
|
||||
StackObject stackObject = (StackObject) input;
|
||||
return stackObject.getManaValue() <= game
|
||||
.getState()
|
||||
.getWatcher(PlayerLostLifeWatcher.class)
|
||||
.getAllOppLifeLost(stackObject.getControllerId(), game);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue