Merge branch 'spectacle'
commit
460a51da88
|
@ -675,6 +675,14 @@ public enum MagicAbility {
|
|||
card.add(ThisDiesTrigger.Afterlife(n));
|
||||
}
|
||||
},
|
||||
Spectacle("spectacle( |—)" + ARG.MANACOST, 10) {
|
||||
@Override
|
||||
protected void addAbilityImpl(final MagicAbilityStore card, final Matcher arg) {
|
||||
final MagicCardDefinition cardDef = (MagicCardDefinition)card;
|
||||
final MagicManaCost manaCost = MagicManaCost.create(ARG.manacost(arg));
|
||||
card.add(new MagicSpectacleActivation(cardDef, manaCost));
|
||||
}
|
||||
},
|
||||
|
||||
// abilities that involve SN
|
||||
ShockLand("As SN enters the battlefield, you may " + ARG.COST + "\\. If you don't, SN enters the battlefield tapped\\.", -10) {
|
||||
|
@ -724,6 +732,12 @@ public enum MagicAbility {
|
|||
EntersKickedEffect.addAbilityImpl(card, arg);
|
||||
}
|
||||
},
|
||||
EntersSpectacleEffect("When SN enters the battlefield, if its spectacle cost was paid, " + ARG.EFFECT, 10) {
|
||||
@Override
|
||||
protected void addAbilityImpl(final MagicAbilityStore card, final Matcher arg) {
|
||||
EntersKickedEffect.addAbilityImpl(card, arg);
|
||||
}
|
||||
},
|
||||
EntersEffect("When SN enters the battlefield, " + ARG.EFFECT, 10) {
|
||||
@Override
|
||||
protected void addAbilityImpl(final MagicAbilityStore card, final Matcher arg) {
|
||||
|
|
|
@ -962,4 +962,12 @@ public abstract class MagicCondition implements MagicMatchedCostEvent {
|
|||
(phaseType == MagicPhaseType.FirstMain || phaseType == MagicPhaseType.SecondMain);
|
||||
}
|
||||
};
|
||||
|
||||
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,35 @@
|
|||
package magic.model.event;
|
||||
|
||||
import java.util.Arrays;
|
||||
import magic.model.MagicCard;
|
||||
import magic.model.MagicCardDefinition;
|
||||
import magic.model.MagicManaCost;
|
||||
import magic.model.condition.MagicCondition;
|
||||
|
||||
public class MagicSpectacleActivation extends MagicHandCastActivation {
|
||||
|
||||
final MagicManaCost cost;
|
||||
|
||||
public MagicSpectacleActivation(final MagicCardDefinition cdef, final MagicManaCost aCost) {
|
||||
super(
|
||||
new MagicCondition[]{
|
||||
MagicCondition.CARD_CONDITION,
|
||||
MagicCondition.SPECTACLE
|
||||
},
|
||||
cdef.getActivationHints(),
|
||||
"Spectacle"
|
||||
);
|
||||
cost = aCost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<? extends MagicEvent> getCostEvent(final MagicCard source) {
|
||||
return Arrays.asList(
|
||||
MagicPayManaCostEvent.Cast(
|
||||
source,
|
||||
cost
|
||||
),
|
||||
new MagicEvokeEvent(source)
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue