added MagicBecomesBlockedPumpTrigger. changed Ichorclaw Myr to use MagicBecomesBlockedPumpTrigger
parent
f942a9419b
commit
ea6ac20ca4
|
@ -1,31 +1,7 @@
|
|||
package magic.card;
|
||||
|
||||
import magic.model.MagicGame;
|
||||
import magic.model.MagicPermanent;
|
||||
import magic.model.action.MagicChangeTurnPTAction;
|
||||
import magic.model.event.MagicEvent;
|
||||
import magic.model.trigger.MagicWhenBecomesBlockedTrigger;
|
||||
import magic.model.trigger.MagicBecomesBlockedPumpTrigger;
|
||||
|
||||
public class Ichorclaw_Myr {
|
||||
public static final MagicWhenBecomesBlockedTrigger T = new MagicWhenBecomesBlockedTrigger() {
|
||||
@Override
|
||||
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent data) {
|
||||
return (permanent == data ) ?
|
||||
new MagicEvent(
|
||||
permanent,
|
||||
permanent.getController(),
|
||||
new Object[]{permanent},
|
||||
this,
|
||||
permanent + " gets +2/+2 until end of turn."):
|
||||
MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event,
|
||||
final Object data[],
|
||||
final Object[] choiceResults) {
|
||||
game.doAction(new MagicChangeTurnPTAction((MagicPermanent)data[0],2,2));
|
||||
}
|
||||
};
|
||||
public static final MagicBecomesBlockedPumpTrigger T = new MagicBecomesBlockedPumpTrigger(2,2);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
package magic.model.trigger;
|
||||
|
||||
import magic.model.MagicGame;
|
||||
import magic.model.MagicPermanent;
|
||||
import magic.model.action.MagicChangeTurnPTAction;
|
||||
import magic.model.event.MagicEvent;
|
||||
|
||||
public class MagicBecomesBlockedPumpTrigger extends MagicWhenBecomesBlockedTrigger {
|
||||
|
||||
private final int amountPower;
|
||||
private final int amountToughness;
|
||||
|
||||
public MagicBecomesBlockedPumpTrigger(final int amountPower,final int amountToughness) {
|
||||
this.amountPower = amountPower;
|
||||
this.amountToughness = amountToughness;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent data) {
|
||||
return (permanent == data ) ?
|
||||
new MagicEvent(
|
||||
permanent,
|
||||
permanent.getController(),
|
||||
new Object[]{permanent},
|
||||
this,
|
||||
permanent + " gets +" + amountPower + "/+" + amountToughness + " until end of turn."):
|
||||
MagicEvent.NONE;
|
||||
}
|
||||
@Override
|
||||
public void executeEvent(
|
||||
final MagicGame game,
|
||||
final MagicEvent event,
|
||||
final Object data[],
|
||||
final Object[] choiceResults) {
|
||||
game.doAction(new MagicChangeTurnPTAction(
|
||||
(MagicPermanent)data[0],
|
||||
amountPower,
|
||||
amountToughness));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue