add 'When SN becomes monstrous' trigger
parent
b0ed587643
commit
f7f5333d78
|
@ -836,6 +836,14 @@ public enum MagicAbility {
|
|||
card.add(new MagicMonstrosityActivation(manaCost, n));
|
||||
}
|
||||
},
|
||||
WhenMonstrous("When SN becomes monstrous, " + ARG.EFFECT, 0) {
|
||||
protected void addAbilityImpl(final MagicAbilityStore card, final Matcher arg) {
|
||||
card.add(MagicWhenBecomesStateTrigger.create(
|
||||
MagicPermanentState.Monstrous,
|
||||
MagicRuleEventAction.create(ARG.effect(arg))
|
||||
));
|
||||
}
|
||||
},
|
||||
Tribute("tribute " + ARG.NUMBER + " " + ARG.EFFECT, 10) {
|
||||
protected void addAbilityImpl(final MagicAbilityStore card, final Matcher arg) {
|
||||
final int n = ARG.number(arg);
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
package magic.model.trigger;
|
||||
|
||||
import magic.model.MagicGame;
|
||||
import magic.model.MagicPermanent;
|
||||
import magic.model.MagicPermanentState;
|
||||
import magic.model.action.MagicChangeStateAction;
|
||||
import magic.model.event.MagicEvent;
|
||||
import magic.model.event.MagicSourceEvent;
|
||||
|
||||
public abstract class MagicWhenBecomesStateTrigger extends MagicTrigger<MagicChangeStateAction> {
|
||||
public MagicWhenBecomesStateTrigger(final int priority) {
|
||||
|
@ -13,4 +18,17 @@ public abstract class MagicWhenBecomesStateTrigger extends MagicTrigger<MagicCha
|
|||
public MagicTriggerType getType() {
|
||||
return MagicTriggerType.WhenBecomesState;
|
||||
}
|
||||
|
||||
public static MagicWhenBecomesStateTrigger create(final MagicPermanentState state, final MagicSourceEvent sourceEvent) {
|
||||
return new MagicWhenBecomesStateTrigger() {
|
||||
@Override
|
||||
public boolean accept(final MagicPermanent permanent, final MagicChangeStateAction data) {
|
||||
return data.state == state;
|
||||
}
|
||||
@Override
|
||||
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicChangeStateAction data) {
|
||||
return sourceEvent.getEvent(permanent);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue