added Amphibious Kavu. Arcbound Fiend should only target creatures with +1/+1 counters

master
beholder 2011-10-09 08:03:28 +02:00
parent a9c7b81e38
commit 1d47b30e0b
5 changed files with 110 additions and 1 deletions

View File

@ -12965,3 +12965,15 @@ converted=3
cost={1}{B}{B}
pt=2/2
timing=main
>Amphibious Kavu
image=http://magiccards.info/scans/en/ps/78.jpg
value=3
rarity=C
type=Creature
subtype=Kavu
color=g
converted=3
cost={2}{G}
pt=2/2
timing=main

View File

@ -0,0 +1,82 @@
package magic.card;
import magic.model.MagicColor;
import magic.model.MagicGame;
import magic.model.MagicPermanent;
import magic.model.MagicPermanentList;
import magic.model.MagicPlayer;
import magic.model.action.MagicChangeTurnPTAction;
import magic.model.action.MagicDestroyAction;
import magic.model.event.MagicEvent;
import magic.model.trigger.MagicWhenBecomesBlockedTrigger;
import magic.model.trigger.MagicWhenBlocksTrigger;
public class Amphibious_Kavu {
public static final MagicWhenBecomesBlockedTrigger T1 = new MagicWhenBecomesBlockedTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) {
final MagicPlayer player = permanent.getController();
if (creature == permanent) {
final MagicPermanentList plist = permanent.getBlockingCreatures();
boolean pump = false;
for (final MagicPermanent blocker : plist) {
final int colorFlags = blocker.getColorFlags(game);
if (MagicColor.Blue.hasColor(colorFlags) ||
MagicColor.Black.hasColor(colorFlags)) {
pump = true;
}
}
if (pump) {
return new MagicEvent(
permanent,
player,
new Object[]{permanent},
this,
permanent + " gets +3/+3 until end of turn.");
}
}
return 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],
3,
3));
}
};
public static final MagicWhenBlocksTrigger T2 = new MagicWhenBlocksTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent data) {
final MagicPermanent blocked = permanent.getBlockedCreature();
return (permanent == data &&
blocked.isValid() &&
(MagicColor.Blue.hasColor(blocked.getColorFlags(game)) ||
MagicColor.Black.hasColor(blocked.getColorFlags(game)))) ?
new MagicEvent(
permanent,
permanent.getController(),
new Object[]{permanent},
this,
permanent + " gets +3/+3 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],
3,
3));
}
};
}

View File

@ -30,7 +30,7 @@ public class Arcbound_Fiend {
new MagicMayChoice(
player + " may move a +1/+1 counter from " +
"target creature onto " + permanent + ".",
MagicTargetChoice.NEG_TARGET_CREATURE),
MagicTargetChoice.NEG_TARGET_CREATURE_PLUSONE_COUNTER),
new Object[]{permanent},
this,
player + " may$ move a +1/+1 counter from " +

View File

@ -154,6 +154,9 @@ public class MagicTargetChoice extends MagicChoice {
public static final MagicTargetChoice NEG_TARGET_CREATURE_POWER_4_OR_MORE =
new MagicTargetChoice(MagicTargetFilter.TARGET_CREATURE_POWER_4_OR_MORE,true,MagicTargetHint.Negative,
"target creature with power 4 or greater");
public static final MagicTargetChoice NEG_TARGET_CREATURE_PLUSONE_COUNTER =
new MagicTargetChoice(MagicTargetFilter.TARGET_CREATURE_PLUSONE_COUNTER,true,MagicTargetHint.Negative,
"target creature");
public static final MagicTargetChoice NEG_TARGET_CREATURE_WITH_FLYING=
new MagicTargetChoice(MagicTargetFilter.TARGET_CREATURE_WITH_FLYING,true,MagicTargetHint.Negative,"target creature with flying");
public static final MagicTargetChoice NEG_TARGET_CREATURE_WITHOUT_FLYING=

View File

@ -4,6 +4,7 @@ import magic.model.MagicAbility;
import magic.model.MagicCard;
import magic.model.MagicCardDefinition;
import magic.model.MagicColor;
import magic.model.MagicCounterType;
import magic.model.MagicGame;
import magic.model.MagicPermanent;
import magic.model.MagicPlayer;
@ -1177,6 +1178,17 @@ public interface MagicTargetFilter {
}
};
MagicTargetFilter TARGET_CREATURE_PLUSONE_COUNTER = new MagicTargetFilter() {
public boolean accept(final MagicGame game,final MagicPlayer player,final MagicTarget target) {
final MagicPermanent permanent = (MagicPermanent)target;
return permanent.isCreature(game) &&
permanent.getCounters(MagicCounterType.PlusOne) > 0;
}
public boolean acceptType(final MagicTargetType targetType) {
return targetType == MagicTargetType.Permanent;
}
};
MagicTargetFilter TARGET_ATTACKING_CREATURE=new MagicTargetFilter() {
public boolean accept(final MagicGame game,final MagicPlayer player,final MagicTarget target) {
final MagicPermanent permanent=(MagicPermanent)target;