Add Spectacle mechanic
parent
50b97bd746
commit
357eeb284b
|
@ -675,6 +675,14 @@ public enum MagicAbility {
|
||||||
card.add(ThisDiesTrigger.Afterlife(n));
|
card.add(ThisDiesTrigger.Afterlife(n));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Spectacle("spectacle( |—)" + ARG.COST, 10) {
|
||||||
|
@Override
|
||||||
|
protected void addAbilityImpl(final MagicAbilityStore card, final Matcher arg) {
|
||||||
|
final MagicCardDefinition cardDef = (MagicCardDefinition)card;
|
||||||
|
final List<MagicMatchedCostEvent> matchedCostEvents = MagicRegularCostEvent.buildCast(ARG.cost(arg));
|
||||||
|
card.add(new MagicSpectacleActivation(cardDef, matchedCostEvents));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// abilities that involve SN
|
// abilities that involve SN
|
||||||
ShockLand("As SN enters the battlefield, you may " + ARG.COST + "\\. If you don't, SN enters the battlefield tapped\\.", -10) {
|
ShockLand("As SN enters the battlefield, you may " + ARG.COST + "\\. If you don't, SN enters the battlefield tapped\\.", -10) {
|
||||||
|
|
|
@ -950,4 +950,12 @@ public abstract class MagicCondition implements MagicMatchedCostEvent {
|
||||||
return player.controlsPermanent(MagicTargetFilterFactory.LEGENDARY_CREATURE_OR_PLANESWALKER);
|
return player.controlsPermanent(MagicTargetFilterFactory.LEGENDARY_CREATURE_OR_PLANESWALKER);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public static MagicCondition SPECTACLE = new MagicCondition() {
|
||||||
|
@Override
|
||||||
|
public boolean accept(final MagicSource source) {
|
||||||
|
final MagicPlayer opponent = source.getOpponent();
|
||||||
|
return opponent.getLifeLossThisTurn() > 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
package magic.model.event;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
|
import magic.model.MagicCard;
|
||||||
|
import magic.model.MagicCardDefinition;
|
||||||
|
import magic.model.MagicGame;
|
||||||
|
import magic.model.MagicPayedCost;
|
||||||
|
import magic.model.condition.MagicCondition;
|
||||||
|
|
||||||
|
public class MagicSpectacleActivation extends MagicHandCastActivation {
|
||||||
|
|
||||||
|
private final List<MagicMatchedCostEvent> matchedCostEvents;
|
||||||
|
|
||||||
|
public MagicSpectacleActivation(final MagicCardDefinition cdef, final List<MagicMatchedCostEvent> aMatchedCostEvents) {
|
||||||
|
super(
|
||||||
|
new MagicCondition[]{
|
||||||
|
MagicCondition.CARD_CONDITION,
|
||||||
|
MagicCondition.SPECTACLE
|
||||||
|
},
|
||||||
|
cdef.getActivationHints(),
|
||||||
|
"Spectacle"
|
||||||
|
);
|
||||||
|
matchedCostEvents = aMatchedCostEvents;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Iterable<? extends MagicEvent> getCostEvent(final MagicCard source) {
|
||||||
|
return MagicMatchedCostEvent.getCostEvent(matchedCostEvents, source);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
|
||||||
|
return new MagicEvent(
|
||||||
|
cardOnStack,
|
||||||
|
this,
|
||||||
|
"Put SN onto the battlefield, " +
|
||||||
|
"it gains haste and it's returned from the battlefield to its owner's hand at the beginning of the next end step."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||||
|
game.doAction(new PlayCardFromStackAction(
|
||||||
|
event.getCardOnStack(),
|
||||||
|
MagicPlayMod.HASTE, MagicPlayMod.RETURN_AT_END_OF_TURN
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue