add '<n> or fewer cards in hand' condition
parent
d4920cc3d7
commit
670cc9cba1
|
@ -109,6 +109,15 @@ public class MagicConditionFactory {
|
|||
};
|
||||
}
|
||||
|
||||
public static MagicCondition HandAtMost(final int n) {
|
||||
return new MagicCondition() {
|
||||
@Override
|
||||
public boolean accept(MagicSource source) {
|
||||
return source.getController().getHandSize() <= n;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static MagicCondition RNHandAtLeast(final int n) {
|
||||
return new MagicCondition() {
|
||||
@Override
|
||||
|
|
|
@ -132,6 +132,12 @@ public enum MagicConditionParser {
|
|||
return MagicConditionFactory.HandAtLeast(amount);
|
||||
}
|
||||
},
|
||||
HandFewer("you have " + ARG.AMOUNT +" or fewer cards in hand") {
|
||||
public MagicCondition toCondition(final Matcher arg) {
|
||||
final int amount = ARG.amount(arg);
|
||||
return MagicConditionFactory.HandAtMost(amount);
|
||||
}
|
||||
},
|
||||
Hellbent("(you )?have no cards in hand") {
|
||||
public MagicCondition toCondition(final Matcher arg) {
|
||||
return MagicCondition.HELLBENT;
|
||||
|
|
Loading…
Reference in New Issue