mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
Implemented Departed Deckhand
This commit is contained in:
parent
08d9463b1e
commit
db07686008
3 changed files with 91 additions and 2 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.abilities.effects.common.combat;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -6,6 +5,8 @@ import mage.abilities.Mode;
|
|||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.Target;
|
||||
|
|
@ -17,16 +18,27 @@ import mage.util.CardUtil;
|
|||
*/
|
||||
public class CantBeBlockedTargetEffect extends RestrictionEffect {
|
||||
|
||||
private final FilterCreaturePermanent filter;
|
||||
|
||||
public CantBeBlockedTargetEffect() {
|
||||
this(Duration.EndOfTurn);
|
||||
}
|
||||
|
||||
public CantBeBlockedTargetEffect(Duration duration) {
|
||||
this(StaticFilters.FILTER_PERMANENT_CREATURE, duration);
|
||||
this.staticText = null;
|
||||
}
|
||||
|
||||
public CantBeBlockedTargetEffect(FilterCreaturePermanent filter, Duration duration) {
|
||||
super(duration, Outcome.Benefit);
|
||||
this.filter = filter;
|
||||
staticText = new StringBuilder("{this} can't be blocked ")
|
||||
.append(filter.getMessage().startsWith("except by") ? "" : "by ").append(filter.getMessage()).toString();
|
||||
}
|
||||
|
||||
public CantBeBlockedTargetEffect(CantBeBlockedTargetEffect effect) {
|
||||
super(effect);
|
||||
this.filter = effect.filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -36,7 +48,7 @@ public class CantBeBlockedTargetEffect extends RestrictionEffect {
|
|||
|
||||
@Override
|
||||
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
return false;
|
||||
return !filter.match(blocker, source.getSourceId(), source.getControllerId(), game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue