added support for Battalion in engine
parent
8f86795b39
commit
f3a51a5224
|
@ -249,6 +249,12 @@ public interface MagicCondition {
|
|||
}
|
||||
};
|
||||
|
||||
MagicCondition THREE_ATTACKERS_CONDITION=new MagicCondition() {
|
||||
public boolean accept(final MagicSource source) {
|
||||
return source.getController().getNrOfAttackers() >= 3;
|
||||
}
|
||||
};
|
||||
|
||||
MagicCondition TWO_CREATURES_CONDITION=new MagicCondition() {
|
||||
public boolean accept(final MagicSource source) {
|
||||
return source.getController().getNrOfPermanentsWithType(MagicType.Creature)>=2;
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
package magic.model.trigger;
|
||||
|
||||
import magic.model.MagicPermanent;
|
||||
import magic.model.condition.MagicCondition;
|
||||
|
||||
public abstract class MagicBattalionTrigger extends MagicWhenAttacksTrigger {
|
||||
public boolean accept(final MagicPermanent permanent, final MagicPermanent attacker) {
|
||||
return permanent == attacker && MagicCondition.THREE_ATTACKERS_CONDITION.accept(permanent);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue