put signature of executeEvent on one line
parent
c30c037b06
commit
27ecc51e3a
|
@ -79,9 +79,7 @@ public class MagicCardActivation extends MagicActivation<MagicCard> implements M
|
|||
};
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
throw new RuntimeException(getClass() + " did not override executeEvent");
|
||||
}
|
||||
|
||||
|
|
|
@ -26,9 +26,7 @@ public class MagicCounterUnlessEvent extends MagicEvent {
|
|||
|
||||
private static final MagicEventAction EVENT_ACTION=new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final MagicItemOnStack itemOnStack = event.getRefItemOnStack();
|
||||
if (event.isYes()) {
|
||||
event.payManaCost(game,itemOnStack.getController());
|
||||
|
|
|
@ -20,9 +20,7 @@ public class MagicDeclareAttackersEvent extends MagicEvent {
|
|||
|
||||
private static final MagicEventAction EVENT_ACTION=new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final MagicPlayer player = event.getPlayer();
|
||||
final MagicDeclareAttackersResult result = event.getAttackers();
|
||||
game.doAction(new MagicDeclareAttackersAction(player,result));
|
||||
|
|
|
@ -44,9 +44,7 @@ public class MagicEvent implements MagicCopyable {
|
|||
public static final MagicEvent[] NO_EVENTS = new MagicEvent[0];
|
||||
private static final MagicCopyable NO_REF = new MagicInteger(-1);
|
||||
private static final MagicEventAction NO_ACTION = new MagicEventAction() {
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
//do nothing
|
||||
}
|
||||
};
|
||||
|
|
|
@ -18,9 +18,7 @@ public class MagicExcludeEvent extends MagicEvent {
|
|||
|
||||
private static final MagicEventAction EVENT_ACTION=new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
event.getExclude().exclude(game);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -31,9 +31,7 @@ public class MagicExileCardEvent extends MagicEvent {
|
|||
|
||||
private static final MagicEventAction EVENT_ACTION=new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
event.processTargetCard(game,new MagicCardAction() {
|
||||
public void doAction(final MagicCard card) {
|
||||
game.doAction(new MagicRemoveCardAction(
|
||||
|
|
|
@ -23,9 +23,7 @@ public class MagicMulliganEvent extends MagicEvent {
|
|||
}
|
||||
private static final MagicEventAction EVENT_ACTION=new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final MagicPlayer player = event.getPlayer();
|
||||
if (event.isYes()) {
|
||||
final MagicCardList hand = new MagicCardList(player.getHand());
|
||||
|
|
|
@ -27,9 +27,7 @@ public class MagicPayManaCostEvent extends MagicEvent {
|
|||
|
||||
private static final MagicEventAction EVENT_ACTION=new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
event.payManaCost(game,event.getPlayer());
|
||||
}
|
||||
};
|
||||
|
|
|
@ -59,9 +59,7 @@ public abstract class MagicPermanentActivation extends MagicActivation<MagicPerm
|
|||
|
||||
private static final MagicEventAction EVENT_ACTION=new MagicEventAction() {
|
||||
@Override
|
||||
public final void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public final void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final MagicPermanentActivation permanentActivation = event.getRefPermanentActivation();
|
||||
final MagicPermanent permanent = event.getPermanent();
|
||||
final MagicAbilityOnStack abilityOnStack = new MagicAbilityOnStack(
|
||||
|
@ -83,9 +81,7 @@ public abstract class MagicPermanentActivation extends MagicActivation<MagicPerm
|
|||
public abstract MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost);
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
throw new RuntimeException(getClass() + " did not override executeEvent");
|
||||
}
|
||||
|
||||
|
@ -105,24 +101,22 @@ public abstract class MagicPermanentActivation extends MagicActivation<MagicPerm
|
|||
}
|
||||
|
||||
@Override
|
||||
public MagicEvent getPermanentEvent(
|
||||
final MagicPermanent source,
|
||||
final MagicPayedCost payedCost) {
|
||||
public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
|
||||
return new MagicEvent(
|
||||
source,
|
||||
this,
|
||||
"Put a charge counter on SN.");
|
||||
"Put a charge counter on SN."
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicChangeCountersAction(
|
||||
event.getPermanent(),
|
||||
MagicCounterType.Charge,
|
||||
1,
|
||||
true));
|
||||
true
|
||||
));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -144,12 +138,11 @@ public abstract class MagicPermanentActivation extends MagicActivation<MagicPerm
|
|||
return new MagicEvent(
|
||||
source,
|
||||
this,
|
||||
"Untap SN.");
|
||||
"Untap SN."
|
||||
);
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicUntapAction(event.getPermanent()));
|
||||
}
|
||||
};
|
||||
|
@ -204,9 +197,7 @@ public abstract class MagicPermanentActivation extends MagicActivation<MagicPerm
|
|||
"Return SN to its owner's hand.");
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicRemoveFromPlayAction(event.getPermanent(),MagicLocationType.OwnersHand));
|
||||
}
|
||||
};
|
||||
|
@ -230,9 +221,7 @@ public abstract class MagicPermanentActivation extends MagicActivation<MagicPerm
|
|||
);
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicAddStaticAction(event.getPermanent(), MagicStatic.SwitchPT));
|
||||
}
|
||||
};
|
||||
|
|
|
@ -38,9 +38,7 @@ public class MagicPingActivation extends MagicPermanentActivation {
|
|||
);
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
event.processTarget(game,new MagicTargetAction() {
|
||||
public void doAction(final MagicTarget target) {
|
||||
final MagicDamage damage=new MagicDamage(event.getSource(),target,n);
|
||||
|
|
|
@ -14,9 +14,7 @@ public class MagicPlayAbilityEvent extends MagicEvent {
|
|||
}
|
||||
private static final MagicEventAction EVENT_ACTION=new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicPlayAbilityAction(event.getPermanent()));
|
||||
}
|
||||
};
|
||||
|
|
|
@ -37,9 +37,7 @@ public class MagicPlayAuraEvent extends MagicSpellCardEvent {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
event.processTargetPermanent(game,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent creature) {
|
||||
game.doAction(new MagicPlayCardFromStackAction(event.getCardOnStack(),creature));
|
||||
|
|
|
@ -25,9 +25,7 @@ public class MagicPlayCardEvent {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicPlayCardFromStackAction(event.getCardOnStack()));
|
||||
}
|
||||
};
|
||||
|
@ -44,9 +42,7 @@ public class MagicPlayCardEvent {
|
|||
);
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicPlayCardFromStackAction(event.getCardOnStack(), event.getKickerCount()));
|
||||
}
|
||||
};
|
||||
|
@ -64,9 +60,7 @@ public class MagicPlayCardEvent {
|
|||
);
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final int X = event.getRefInt();
|
||||
game.doAction(new MagicPlayCardFromStackAction(event.getCardOnStack(), X));
|
||||
}
|
||||
|
|
|
@ -29,9 +29,7 @@ public class MagicPlayMulticounterEvent extends MagicSpellCardEvent {
|
|||
);
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final MagicCardOnStack cardOnStack = event.getCardOnStack();
|
||||
final MagicPlayCardFromStackAction action = new MagicPlayCardFromStackAction(cardOnStack);
|
||||
game.doAction(action);
|
||||
|
|
|
@ -12,9 +12,7 @@ public class MagicPriorityEvent extends MagicEvent {
|
|||
private static final MagicEventAction EVENT_ACTION=new MagicEventAction() {
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
|
||||
final MagicPlayChoiceResult playChoiceResult = event.getPlayChoice();
|
||||
if (playChoiceResult==MagicPlayChoiceResult.PASS ||
|
||||
|
|
|
@ -27,9 +27,7 @@ public class MagicRedirectDamageEvent extends MagicEvent {
|
|||
private static final MagicEventAction EventAction(final int amount, final boolean isCombat) {
|
||||
return new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
if (event.isYes()) {
|
||||
event.processTargetPermanent(game,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent planeswalker) {
|
||||
|
|
|
@ -28,9 +28,7 @@ public class MagicReturnAuraEvent extends MagicEvent {
|
|||
|
||||
private static final MagicEventAction EVENT_ACTION = new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final MagicCardOnStack cardOnStack = event.getCardOnStack();
|
||||
event.processTargetPermanent(game,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent creature) {
|
||||
|
|
|
@ -23,9 +23,7 @@ import java.util.regex.Matcher;
|
|||
public enum MagicRuleEventAction {
|
||||
Destroy("destroy ([^\\.]*).", "neg", new MagicDestroyTargetPicker(false), new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
event.processTargetPermanent(game,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent creature) {
|
||||
game.doAction(new MagicDestroyAction(creature));
|
||||
|
@ -35,9 +33,7 @@ public enum MagicRuleEventAction {
|
|||
}),
|
||||
DestroyNoRegen("destroy ([^\\.]*). it can't be regenerated.", "neg", new MagicDestroyTargetPicker(true), new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
event.processTargetPermanent(game,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent creature) {
|
||||
game.doAction(new MagicChangeStateAction(creature,MagicPermanentState.CannotBeRegenerated,true));
|
||||
|
@ -48,9 +44,7 @@ public enum MagicRuleEventAction {
|
|||
}),
|
||||
Counter("counter ([^\\.]*).", "neg", MagicDefaultTargetPicker.create(), new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
event.processTargetCardOnStack(game,new MagicCardOnStackAction() {
|
||||
public void doAction(final MagicCardOnStack targetSpell) {
|
||||
game.doAction(new MagicCounterItemOnStackAction(targetSpell));
|
||||
|
@ -60,9 +54,7 @@ public enum MagicRuleEventAction {
|
|||
}),
|
||||
Exile("exile ([^\\.]*).", "neg", MagicExileTargetPicker.create(), new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
event.processTargetPermanent(game,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent perm) {
|
||||
game.doAction(new MagicRemoveFromPlayAction(perm,MagicLocationType.Exile));
|
||||
|
|
|
@ -33,9 +33,7 @@ public class MagicSacrificePermanentEvent extends MagicEvent {
|
|||
|
||||
private static final MagicEventAction EVENT_ACTION=new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
event.processTargetPermanent(game,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent permanent) {
|
||||
game.doAction(new MagicSacrificeAction(permanent));
|
||||
|
|
|
@ -37,9 +37,7 @@ public class MagicSoulbondEvent extends MagicEvent {
|
|||
|
||||
private static final MagicEventAction EVENT_ACTION = new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
if (event.isYes()) {
|
||||
event.processTargetPermanent(game,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent creature) {
|
||||
|
|
|
@ -34,9 +34,7 @@ public abstract class MagicSpellCardEvent implements MagicCardEvent,MagicEventAc
|
|||
);
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
action.executeEvent(game, event);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -19,9 +19,7 @@ public class MagicSpellCastEvent extends MagicEvent {
|
|||
|
||||
private static final MagicEventAction EVENT_ACTION=new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final MagicItemOnStack itemOnStack = event.getRefItemOnStack();
|
||||
|
||||
// execute spell is cast triggers
|
||||
|
|
|
@ -20,9 +20,7 @@ public class MagicStackGetChoicesEvent extends MagicEvent {
|
|||
|
||||
private static final MagicEventAction EVENT_ACTION=new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final MagicItemOnStack itemOnStack = event.getRefItemOnStack();
|
||||
itemOnStack.setChoiceResults(event.getChosen());
|
||||
|
||||
|
|
|
@ -30,9 +30,7 @@ public abstract class MagicTapCreatureActivation extends MagicPermanentActivatio
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
event.processTargetPermanent(game,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent creature) {
|
||||
game.doAction(new MagicTapAction(creature,true));
|
||||
|
|
|
@ -20,9 +20,7 @@ public abstract class MagicWeakenCreatureActivation extends MagicPermanentActiva
|
|||
}
|
||||
|
||||
@Override
|
||||
public MagicEvent getPermanentEvent(
|
||||
final MagicPermanent source,
|
||||
final MagicPayedCost payedCost) {
|
||||
public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
|
||||
return new MagicEvent(
|
||||
source,
|
||||
MagicTargetChoice.NEG_TARGET_CREATURE,
|
||||
|
@ -33,9 +31,7 @@ public abstract class MagicWeakenCreatureActivation extends MagicPermanentActiva
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
event.processTargetPermanent(game,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent creature) {
|
||||
game.doAction(new MagicChangeCountersAction(
|
||||
|
|
|
@ -39,9 +39,7 @@ public class MagicAllyGrowTrigger extends MagicWhenOtherComesIntoPlayTrigger {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
if (event.isYes()) {
|
||||
game.doAction(new MagicChangeCountersAction(
|
||||
event.getPermanent(),
|
||||
|
|
|
@ -30,9 +30,7 @@ public class MagicAnnihilatorTrigger extends MagicWhenAttacksTrigger {
|
|||
MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final MagicPlayer player = event.getPlayer();
|
||||
int count = amount;
|
||||
while (count > 0 && player.getPermanents().size() > 0) {
|
||||
|
|
|
@ -34,12 +34,11 @@ public abstract class MagicAtEndOfTurnTrigger extends MagicTrigger<MagicPlayer>
|
|||
MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicRemoveFromPlayAction(
|
||||
event.getPermanent(),
|
||||
MagicLocationType.OwnersHand));
|
||||
MagicLocationType.OwnersHand
|
||||
));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -35,9 +35,7 @@ public abstract class MagicAtUpkeepTrigger extends MagicTrigger<MagicPlayer> {
|
|||
MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
if (event.isYes()) {
|
||||
game.doAction(new MagicChangeCountersAction(event.getPermanent(),MagicCounterType.Charge,1,true));
|
||||
}
|
||||
|
|
|
@ -30,9 +30,7 @@ public class MagicAttacksPumpTrigger extends MagicWhenAttacksTrigger {
|
|||
MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicChangeTurnPTAction(
|
||||
event.getPermanent(),
|
||||
power,
|
||||
|
|
|
@ -35,9 +35,7 @@ public class MagicBattleCryTrigger extends MagicWhenAttacksTrigger {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final MagicPermanent permanent = event.getPermanent();
|
||||
final Collection<MagicPermanent> targets = game.filterPermanents(
|
||||
event.getPlayer(),
|
||||
|
|
|
@ -42,9 +42,7 @@ public class MagicBecomesBlockedPumpTrigger extends MagicWhenBecomesBlockedTrigg
|
|||
return MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicChangeTurnPTAction(
|
||||
event.getPermanent(),
|
||||
amountPower,
|
||||
|
|
|
@ -32,9 +32,7 @@ public class MagicBloodthirstTrigger extends MagicWhenComesIntoPlayTrigger {
|
|||
MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicChangeCountersAction(
|
||||
event.getPermanent(),
|
||||
MagicCounterType.PlusOne,
|
||||
|
|
|
@ -36,9 +36,7 @@ public class MagicComesIntoPlayWithCounterTrigger extends MagicWhenComesIntoPlay
|
|||
);
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicChangeCountersAction(
|
||||
event.getPermanent(),
|
||||
counterType,
|
||||
|
|
|
@ -56,9 +56,7 @@ public class MagicCumulativeUpkeepTrigger extends MagicAtUpkeepTrigger {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
if (event.isNo()) {
|
||||
game.doAction(new MagicSacrificeAction(event.getPermanent()));
|
||||
}
|
||||
|
|
|
@ -35,9 +35,7 @@ public class MagicDamageGrowTrigger extends MagicWhenDamageIsDealtTrigger {
|
|||
MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicChangeCountersAction(
|
||||
event.getPermanent(),
|
||||
MagicCounterType.PlusOne,
|
||||
|
|
|
@ -58,9 +58,7 @@ public class MagicDevourTrigger extends MagicWhenComesIntoPlayTrigger {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
if (event.isYes()) {
|
||||
event.processTargetPermanent(game,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent creature) {
|
||||
|
|
|
@ -42,9 +42,7 @@ public class MagicDieDrawCardTrigger extends MagicWhenPutIntoGraveyardTrigger {
|
|||
return MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
if (mustDraw) {
|
||||
game.doAction(new MagicDrawAction(event.getPlayer(),1));
|
||||
} else if (event.isYes()) {
|
||||
|
|
|
@ -38,9 +38,7 @@ public class MagicEchoTrigger extends MagicAtUpkeepTrigger {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final MagicPermanent permanent = event.getPermanent();
|
||||
if (event.isYes()) {
|
||||
game.doAction(new MagicChangeStateAction(
|
||||
|
|
|
@ -49,9 +49,7 @@ public class MagicEntersDamageTargetTrigger extends MagicWhenComesIntoPlayTrigge
|
|||
);
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
event.processTarget(game,new MagicTargetAction() {
|
||||
public void doAction(final MagicTarget target) {
|
||||
final MagicDamage damage = new MagicDamage(
|
||||
|
|
|
@ -24,12 +24,11 @@ public class MagicEntersDrawCardTrigger extends MagicWhenComesIntoPlayTrigger {
|
|||
return new MagicEvent(
|
||||
permanent,
|
||||
this,
|
||||
"PN draws a card.");
|
||||
"PN draws a card."
|
||||
);
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicDrawAction(event.getPlayer(),1));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,9 +71,7 @@ public class MagicEntersExileCreatureOrSacrificeTrigger extends MagicWhenComesIn
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final MagicPermanent permanent = event.getPermanent();
|
||||
if (event.isYes()) {
|
||||
event.processTargetPermanent(game,new MagicPermanentAction() {
|
||||
|
|
|
@ -37,9 +37,7 @@ public class MagicExtortTrigger extends MagicWhenOtherSpellIsCastTrigger {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
if (event.isYes()) {
|
||||
game.doAction(new MagicChangeLifeAction(event.getPlayer().getOpponent(),-1));
|
||||
game.doAction(new MagicChangeLifeAction(event.getPlayer(),1));
|
||||
|
|
|
@ -47,18 +47,14 @@ public class MagicFadeVanishCounterTrigger extends MagicAtUpkeepTrigger {
|
|||
|
||||
private static final MagicEventAction SAC_PERM = new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicSacrificeAction(event.getPermanent()));
|
||||
}
|
||||
};
|
||||
|
||||
private static final MagicEventAction REMOVE_COUNTER = new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicChangeCountersAction(
|
||||
event.getPermanent(),
|
||||
MagicCounterType.Charge,
|
||||
|
|
|
@ -40,9 +40,7 @@ public class MagicFlankingTrigger extends MagicWhenBecomesBlockedTrigger {
|
|||
return MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
for (final MagicPermanent blocker : event.getRefPermanentList()) {
|
||||
game.doAction(new MagicChangeTurnPTAction(blocker,-1,-1));
|
||||
}
|
||||
|
|
|
@ -26,9 +26,7 @@ public class MagicLandfallPumpTrigger extends MagicLandfallTrigger {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicChangeTurnPTAction(
|
||||
event.getPermanent(),
|
||||
power,
|
||||
|
|
|
@ -44,9 +44,7 @@ public class MagicLeavesDamageTargetTrigger extends MagicWhenLeavesPlayTrigger {
|
|||
MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
event.processTarget(game,new MagicTargetAction() {
|
||||
public void doAction(final MagicTarget target) {
|
||||
final MagicDamage damage = new MagicDamage(event.getSource(),target,n);
|
||||
|
|
|
@ -26,9 +26,7 @@ public class MagicLeavesGainLifeTrigger extends MagicWhenLeavesPlayTrigger {
|
|||
MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicChangeLifeAction(event.getPlayer(),life));
|
||||
}
|
||||
};
|
||||
|
|
|
@ -33,9 +33,7 @@ public class MagicLeavesReturnExileTrigger extends MagicWhenLeavesPlayTrigger {
|
|||
return MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicReturnExiledUntilThisLeavesPlayAction(event.getPermanent(),MagicLocationType.Play));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,9 +32,7 @@ public class MagicLivingWeaponTrigger extends MagicWhenComesIntoPlayTrigger {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
|
||||
//create the token
|
||||
final MagicPlayTokenAction play_token=new MagicPlayTokenAction(
|
||||
|
|
|
@ -32,9 +32,7 @@ public class MagicMiracleTrigger extends MagicWhenDrawnTrigger {
|
|||
MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
if (event.isYes()) {
|
||||
final MagicCard card = event.getCard();
|
||||
|
||||
|
|
|
@ -43,9 +43,7 @@ public class MagicModularTrigger extends MagicWhenPutIntoGraveyardTrigger {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
if (event.isYes()) {
|
||||
event.processTargetPermanent(game,new MagicPermanentAction() {
|
||||
public void doAction(final MagicPermanent creature) {
|
||||
|
|
|
@ -28,9 +28,7 @@ public class MagicRampageTrigger extends MagicWhenBecomesBlockedTrigger {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final int amount = event.getRefInt();
|
||||
game.doAction(new MagicChangeTurnPTAction(
|
||||
event.getPermanent(),
|
||||
|
|
|
@ -35,9 +35,7 @@ public class MagicRavnicaLandTrigger extends MagicWhenComesIntoPlayTrigger {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
if (event.isYes()) {
|
||||
game.doAction(new MagicChangeLifeAction(event.getPlayer(),-2));
|
||||
} else {
|
||||
|
|
|
@ -28,9 +28,7 @@ public class MagicRefugeLandTrigger extends MagicWhenComesIntoPlayTrigger {
|
|||
);
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicChangeLifeAction(event.getPlayer(),life));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,9 +32,7 @@ public class MagicReplicateTrigger extends MagicWhenSpellIsCastTrigger {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final MagicCardOnStack cardOnStack = event.getCardOnStack();
|
||||
final int kickerCount = (Integer)cardOnStack.getChoiceResults()[1];
|
||||
for (int i = 0; i < kickerCount; i++) {
|
||||
|
|
|
@ -28,9 +28,7 @@ public class MagicSacrificeAtEnd extends MagicAtEndOfTurnTrigger {
|
|||
MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicSacrificeAction(event.getPermanent()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,9 +50,7 @@ public class MagicSoulshiftTrigger extends MagicWhenPutIntoGraveyardTrigger {
|
|||
return MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
if (event.isYes()) {
|
||||
event.processTargetCard(game,new MagicCardAction() {
|
||||
public void doAction(final MagicCard card) {
|
||||
|
|
|
@ -34,9 +34,7 @@ public class MagicStormTrigger extends MagicWhenSpellIsCastTrigger {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final int count = event.getRefInt();
|
||||
for (int i = 0; i < count; i++) {
|
||||
game.doAction(new MagicCopyCardOnStackAction(
|
||||
|
|
|
@ -66,9 +66,7 @@ public class MagicThiefTrigger extends MagicWhenDamageIsDealtTrigger {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
if (choice == choice.Must) {
|
||||
game.doAction(new MagicDrawAction(event.getPlayer(),amount));
|
||||
} else if (event.isYes()) {
|
||||
|
|
|
@ -31,9 +31,7 @@ public abstract class MagicTrigger<T> implements MagicEventAction,MagicChangeCar
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
throw new RuntimeException(getClass() + " did not override executeEvent");
|
||||
}
|
||||
|
||||
|
|
|
@ -31,9 +31,7 @@ public class MagicUndyingTrigger extends MagicWhenDiesTrigger {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final MagicCard card = event.getPermanent().getCard();
|
||||
game.doAction(new MagicReanimateAction(
|
||||
card.getOwner(),
|
||||
|
|
|
@ -31,9 +31,7 @@ public class MagicUnleashTrigger extends MagicWhenComesIntoPlayTrigger {
|
|||
);
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
if (event.isYes()) {
|
||||
game.doAction(new MagicChangeCountersAction(
|
||||
event.getPermanent(),
|
||||
|
|
|
@ -28,9 +28,7 @@ public class MagicWhenBlocksPumpTrigger extends MagicWhenBlocksTrigger {
|
|||
MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicChangeTurnPTAction(
|
||||
event.getPermanent(),
|
||||
amountPower,
|
||||
|
|
|
@ -50,9 +50,7 @@ public abstract class MagicWhenComesIntoPlayTrigger extends MagicTrigger<MagicPl
|
|||
);
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
action.executeEvent(game, event);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -35,9 +35,7 @@ public abstract class MagicWhenDiesTrigger extends MagicWhenPutIntoGraveyardTrig
|
|||
);
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final MagicCard card = event.getCard();
|
||||
game.doAction(new MagicRemoveCardAction(card,MagicLocationType.Graveyard));
|
||||
game.doAction(new MagicMoveCardAction(card,MagicLocationType.Graveyard,MagicLocationType.OwnersHand));
|
||||
|
|
|
@ -37,9 +37,7 @@ public abstract class MagicWhenOtherComesIntoPlayTrigger extends MagicTrigger<Ma
|
|||
MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
game.doAction(new MagicChangeCountersAction(
|
||||
event.getPermanent(),
|
||||
MagicCounterType.PlusOne,
|
||||
|
|
|
@ -44,9 +44,7 @@ public abstract class MagicWhenPutIntoGraveyardTrigger extends MagicTrigger<Magi
|
|||
}
|
||||
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event) {
|
||||
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||||
final MagicPlayer player = event.getPlayer();
|
||||
final MagicCardList graveyard = new MagicCardList(player.getGraveyard());
|
||||
for (final MagicCard card : graveyard) {
|
||||
|
|
Loading…
Reference in New Issue