added 'target 1/1 creature'

master
melvin 2012-08-17 23:49:03 +08:00
parent 51bb08efbd
commit b32674db83
2 changed files with 12 additions and 0 deletions

View File

@ -146,6 +146,8 @@ public class MagicTargetChoice extends MagicChoice {
new MagicTargetChoice(MagicTargetFilter.TARGET_CREATURE,true,MagicTargetHint.Negative,"target creature"); new MagicTargetChoice(MagicTargetFilter.TARGET_CREATURE,true,MagicTargetHint.Negative,"target creature");
public static final MagicTargetChoice POS_TARGET_CREATURE= public static final MagicTargetChoice POS_TARGET_CREATURE=
new MagicTargetChoice(MagicTargetFilter.TARGET_CREATURE,true,MagicTargetHint.Positive,"target creature"); new MagicTargetChoice(MagicTargetFilter.TARGET_CREATURE,true,MagicTargetHint.Positive,"target creature");
public static final MagicTargetChoice POS_TARGET_1_1_CREATURE=
new MagicTargetChoice(MagicTargetFilter.TARGET_1_1_CREATURE,true,MagicTargetHint.Positive,"target 1/1 creature");
public static final MagicTargetChoice TARGET_NONCREATURE = public static final MagicTargetChoice TARGET_NONCREATURE =
new MagicTargetChoice(MagicTargetFilter.TARGET_NONCREATURE,true,MagicTargetHint.None,"target noncreature"); new MagicTargetChoice(MagicTargetFilter.TARGET_NONCREATURE,true,MagicTargetHint.None,"target noncreature");
public static final MagicTargetChoice NEG_TARGET_NONCREATURE = public static final MagicTargetChoice NEG_TARGET_NONCREATURE =

View File

@ -371,6 +371,16 @@ public interface MagicTargetFilter {
} }
}; };
MagicTargetFilter TARGET_1_1_CREATURE=new MagicTargetFilter() {
public boolean accept(final MagicGame game,final MagicPlayer player,final MagicTarget target) {
final MagicPermanent perm = (MagicPermanent)target;
return perm.isCreature() && perm.getPower() == 1 && perm.getToughness() == 1;
}
public boolean acceptType(final MagicTargetType targetType) {
return targetType==MagicTargetType.Permanent;
}
};
MagicTargetFilter TARGET_NONCREATURE=new MagicTargetFilter() { MagicTargetFilter TARGET_NONCREATURE=new MagicTargetFilter() {
public boolean accept(final MagicGame game,final MagicPlayer player,final MagicTarget target) { public boolean accept(final MagicGame game,final MagicPlayer player,final MagicTarget target) {
return !((MagicPermanent)target).isCreature(); return !((MagicPermanent)target).isCreature();