mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 21:42:07 -08:00
fixed landwalk abilities counting all lands and not just defending player's (fixes #7427)
This commit is contained in:
parent
680083dd53
commit
5f80dba107
17 changed files with 145 additions and 125 deletions
|
|
@ -2,6 +2,7 @@
|
|||
package mage.abilities.keyword;
|
||||
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -10,7 +11,7 @@ import mage.filter.common.FilterLandPermanent;
|
|||
*/
|
||||
public class ForestwalkAbility extends LandwalkAbility {
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("forest");
|
||||
private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("forest");
|
||||
|
||||
static {
|
||||
filter.add(SubType.FOREST.getPredicate());
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
package mage.abilities.keyword;
|
||||
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -10,7 +11,7 @@ import mage.filter.common.FilterLandPermanent;
|
|||
*/
|
||||
public class IslandwalkAbility extends LandwalkAbility {
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("island");
|
||||
private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("island");
|
||||
|
||||
static {
|
||||
filter.add(SubType.ISLAND.getPredicate());
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import mage.abilities.EvasionAbility;
|
|||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.constants.AsThoughEffectType;
|
||||
import mage.constants.Duration;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
|
|
@ -20,15 +20,15 @@ public class LandwalkAbility extends EvasionAbility {
|
|||
*
|
||||
* @param filter
|
||||
*/
|
||||
public LandwalkAbility(FilterLandPermanent filter) {
|
||||
public LandwalkAbility(FilterControlledLandPermanent filter) {
|
||||
this(filter, true);
|
||||
}
|
||||
|
||||
public LandwalkAbility(FilterLandPermanent filter, boolean withHintText) {
|
||||
public LandwalkAbility(FilterControlledLandPermanent filter, boolean withHintText) {
|
||||
this.addEffect(new LandwalkEffect(filter, withHintText));
|
||||
}
|
||||
|
||||
public LandwalkAbility(final LandwalkAbility ability) {
|
||||
protected LandwalkAbility(final LandwalkAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
|
|
@ -49,15 +49,15 @@ public class LandwalkAbility extends EvasionAbility {
|
|||
|
||||
class LandwalkEffect extends RestrictionEffect {
|
||||
|
||||
protected FilterLandPermanent filter;
|
||||
private final FilterControlledLandPermanent filter;
|
||||
|
||||
public LandwalkEffect(FilterLandPermanent filter, boolean withHintText) {
|
||||
LandwalkEffect(FilterControlledLandPermanent filter, boolean withHintText) {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
this.filter = filter;
|
||||
staticText = setText(withHintText);
|
||||
}
|
||||
|
||||
public LandwalkEffect(final LandwalkEffect effect) {
|
||||
private LandwalkEffect(final LandwalkEffect effect) {
|
||||
super(effect);
|
||||
this.filter = effect.filter.copy();
|
||||
}
|
||||
|
|
@ -95,6 +95,9 @@ class LandwalkEffect extends RestrictionEffect {
|
|||
}
|
||||
|
||||
private String setText(boolean withHintText) {
|
||||
if (filter.getMessage().startsWith("chosen type")) {
|
||||
return "landwalk of the chosen type";
|
||||
}
|
||||
// Swampwalk (This creature can't be blocked as long as defending player controls a Swamp.)
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(filter.getMessage()).append("walk");
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
package mage.abilities.keyword;
|
||||
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -10,7 +11,7 @@ import mage.filter.common.FilterLandPermanent;
|
|||
*/
|
||||
public class MountainwalkAbility extends LandwalkAbility {
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("mountain");
|
||||
private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("mountain");
|
||||
|
||||
static {
|
||||
filter.add(SubType.MOUNTAIN.getPredicate());
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
package mage.abilities.keyword;
|
||||
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -10,7 +11,7 @@ import mage.filter.common.FilterLandPermanent;
|
|||
*/
|
||||
public class PlainswalkAbility extends LandwalkAbility {
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("plains");
|
||||
private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("plains");
|
||||
|
||||
static {
|
||||
filter.add(SubType.PLAINS.getPredicate());
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
package mage.abilities.keyword;
|
||||
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -10,7 +11,7 @@ import mage.filter.common.FilterLandPermanent;
|
|||
*/
|
||||
public class SwampwalkAbility extends LandwalkAbility {
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("swamp");
|
||||
private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("swamp");
|
||||
|
||||
static {
|
||||
filter.add(SubType.SWAMP.getPredicate());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue