changed some cards to properly use a may choice

master
beholder 2011-10-08 13:31:45 +02:00
parent 66688ce494
commit f3c902dcb8
3 changed files with 37 additions and 8 deletions

View File

@ -5,6 +5,8 @@ import magic.model.MagicGame;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.action.MagicChangeCountersAction;
import magic.model.choice.MagicMayChoice;
import magic.model.choice.MagicSimpleMayChoice;
import magic.model.event.MagicEvent;
import magic.model.trigger.MagicWhenLifeIsGainedTrigger;
@ -17,9 +19,14 @@ public class Ajani_s_Pridemate {
new MagicEvent(
permanent,
player,
new MagicSimpleMayChoice(
player + " may put a +1/+1 counter on " + permanent + ".",
MagicSimpleMayChoice.ADD_PLUSONE_COUNTER,
1,
MagicSimpleMayChoice.DEFAULT_YES),
new Object[]{permanent},
this,
"Put a +1/+1 counter on " + permanent + "."):
player + " may put a +1/+1 counter on " + permanent + "."):
MagicEvent.NONE;
}
@Override
@ -28,7 +35,9 @@ public class Ajani_s_Pridemate {
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
if (MagicMayChoice.isYesChoice(choiceResults[0])) {
game.doAction(new MagicChangeCountersAction((MagicPermanent)data[0],MagicCounterType.PlusOne,1,true));
}
}
};
}

View File

@ -5,6 +5,8 @@ import magic.model.MagicGame;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.action.MagicChangeCountersAction;
import magic.model.choice.MagicMayChoice;
import magic.model.choice.MagicSimpleMayChoice;
import magic.model.event.MagicEvent;
import magic.model.stack.MagicCardOnStack;
import magic.model.trigger.MagicWhenSpellIsPlayedTrigger;
@ -14,14 +16,19 @@ public class Taurean_Mauler {
public static final MagicWhenSpellIsPlayedTrigger T = new MagicWhenSpellIsPlayedTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicCardOnStack cardOnStack) {
final MagicPlayer player=permanent.getController();
return (cardOnStack.getController()!=player) ?
final MagicPlayer player = permanent.getController();
return (cardOnStack.getController() != player) ?
new MagicEvent(
permanent,
player,
new MagicSimpleMayChoice(
player + " may put a +1/+1 counter on " + permanent + ".",
MagicSimpleMayChoice.ADD_PLUSONE_COUNTER,
1,
MagicSimpleMayChoice.DEFAULT_YES),
new Object[]{permanent},
this,
"Put a +1/+1 counter on " + permanent + "."):
player + " may put a +1/+1 counter on " + permanent + "."):
MagicEvent.NONE;
}
@Override
@ -30,7 +37,9 @@ public class Taurean_Mauler {
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
if (MagicMayChoice.isYesChoice(choiceResults[0])) {
game.doAction(new MagicChangeCountersAction((MagicPermanent)data[0],MagicCounterType.PlusOne,1,true));
}
}
};
}

View File

@ -3,7 +3,10 @@ package magic.card;
import magic.model.MagicCounterType;
import magic.model.MagicGame;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
import magic.model.action.MagicChangeCountersAction;
import magic.model.choice.MagicMayChoice;
import magic.model.choice.MagicSimpleMayChoice;
import magic.model.event.MagicEvent;
import magic.model.trigger.MagicWhenBecomesTappedTrigger;
@ -11,10 +14,16 @@ public class Veteran_of_the_Depths {
public static final MagicWhenBecomesTappedTrigger T = new MagicWhenBecomesTappedTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent data) {
final MagicPlayer player = permanent.getController();
return (permanent == data) ?
new MagicEvent(
permanent,
permanent.getController(),
player,
new MagicSimpleMayChoice(
player + " may put a +1/+1 counter on " + permanent + ".",
MagicSimpleMayChoice.ADD_PLUSONE_COUNTER,
1,
MagicSimpleMayChoice.DEFAULT_YES),
new Object[]{permanent},
this,
"Put a +1/+1 counter on " + permanent + ".") :
@ -26,7 +35,9 @@ public class Veteran_of_the_Depths {
final MagicEvent event,
final Object data[],
final Object[] choiceResults) {
if (MagicMayChoice.isYesChoice(choiceResults[0])) {
game.doAction(new MagicChangeCountersAction((MagicPermanent)data[0],MagicCounterType.PlusOne,1,true));
}
}
};
}