replaced explicit checking with call to HELLBENT.accept
parent
2bcc7e1924
commit
e427390489
|
@ -5,13 +5,15 @@ import magic.model.MagicGame;
|
|||
import magic.model.MagicPermanent;
|
||||
import magic.model.mstatic.MagicLayer;
|
||||
import magic.model.mstatic.MagicStatic;
|
||||
import magic.model.condition.MagicCondition;
|
||||
|
||||
public class Cutthroat_il_Dal {
|
||||
public static final MagicStatic S = new MagicStatic(MagicLayer.Ability) {
|
||||
@Override
|
||||
public long getAbilityFlags(final MagicPermanent source,final MagicPermanent permanent,final long flags) {
|
||||
return permanent.getController().getHandSize() == 0 ?
|
||||
flags|MagicAbility.Shadow.getMask() : flags;
|
||||
return MagicCondition.HELLBENT.accept(permanent) ?
|
||||
flags | MagicAbility.Shadow.getMask() :
|
||||
flags;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -265,6 +265,12 @@ public interface MagicCondition {
|
|||
}
|
||||
};
|
||||
|
||||
MagicCondition HELLBENT = new MagicCondition() {
|
||||
public boolean accept(final MagicSource source) {
|
||||
return source.getController().getHandSize() == 0;
|
||||
}
|
||||
};
|
||||
|
||||
MagicCondition POWER_4_OR_GREATER_CONDITION = new MagicCondition() {
|
||||
public boolean accept(final MagicSource source) {
|
||||
final MagicPermanent permanent = (MagicPermanent)source;
|
||||
|
|
Loading…
Reference in New Issue