mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 04:39:18 -08:00
* Rampart Crawler, Juggernaut - Fixed can't be blocked by walls ability.
This commit is contained in:
parent
60336cbc4b
commit
c0ade21efe
3 changed files with 85 additions and 103 deletions
|
|
@ -33,12 +33,12 @@ import mage.constants.CardType;
|
|||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.EvasionAbility;
|
||||
import mage.abilities.effects.common.combat.CantBlockSourceEffect;
|
||||
import mage.abilities.common.SimpleEvasionAbility;
|
||||
import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -46,6 +46,11 @@ import mage.game.permanent.Permanent;
|
|||
*/
|
||||
public class RampartCrawler extends CardImpl<RampartCrawler> {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Walls");
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Wall"));
|
||||
}
|
||||
|
||||
public RampartCrawler(UUID ownerId) {
|
||||
super(ownerId, 156, "Rampart Crawler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}");
|
||||
this.expansionSetCode = "MMQ";
|
||||
|
|
@ -56,7 +61,7 @@ public class RampartCrawler extends CardImpl<RampartCrawler> {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// Rampart Crawler can't be blocked by Walls.
|
||||
this.addAbility(new RampartCrawlerAbility());
|
||||
this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield)));
|
||||
}
|
||||
|
||||
public RampartCrawler(final RampartCrawler card) {
|
||||
|
|
@ -69,47 +74,3 @@ public class RampartCrawler extends CardImpl<RampartCrawler> {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
class RampartCrawlerAbility extends EvasionAbility<RampartCrawlerAbility> {
|
||||
|
||||
public RampartCrawlerAbility() {
|
||||
this.addEffect(new RampartCrawlerEffect());
|
||||
}
|
||||
|
||||
public RampartCrawlerAbility(final RampartCrawlerAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "{this} can't be blocked by Walls.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public RampartCrawlerAbility copy() {
|
||||
return new RampartCrawlerAbility(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class RampartCrawlerEffect extends CantBlockSourceEffect {
|
||||
|
||||
public RampartCrawlerEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
}
|
||||
|
||||
public RampartCrawlerEffect(final RampartCrawlerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
return !blocker.hasSubtype("Wall");
|
||||
}
|
||||
|
||||
@Override
|
||||
public RampartCrawlerEffect copy() {
|
||||
return new RampartCrawlerEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -29,17 +29,16 @@
|
|||
package mage.sets.tenth;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.AttacksEachTurnStaticAbility;
|
||||
import mage.abilities.common.SimpleEvasionAbility;
|
||||
import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.EvasionAbility;
|
||||
import mage.abilities.common.AttacksEachTurnStaticAbility;
|
||||
import mage.abilities.effects.common.combat.CantBlockSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -47,6 +46,11 @@ import mage.game.permanent.Permanent;
|
|||
*/
|
||||
public class Juggernaut extends CardImpl<Juggernaut> {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Walls");
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Wall"));
|
||||
}
|
||||
|
||||
public Juggernaut(UUID ownerId) {
|
||||
super(ownerId, 328, "Juggernaut", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}");
|
||||
this.expansionSetCode = "10E";
|
||||
|
|
@ -54,8 +58,10 @@ public class Juggernaut extends CardImpl<Juggernaut> {
|
|||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Juggernaut attacks each turn if able.
|
||||
this.addAbility(new AttacksEachTurnStaticAbility());
|
||||
this.addAbility(new JuggernautAbility());
|
||||
// Juggernaut can't be blocked by Walls.
|
||||
this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield)));
|
||||
}
|
||||
|
||||
public Juggernaut(final Juggernaut card) {
|
||||
|
|
@ -68,47 +74,3 @@ public class Juggernaut extends CardImpl<Juggernaut> {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
class JuggernautAbility extends EvasionAbility<JuggernautAbility> {
|
||||
|
||||
public JuggernautAbility() {
|
||||
this.addEffect(new JuggernautEffect());
|
||||
}
|
||||
|
||||
public JuggernautAbility(final JuggernautAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "{this} can't be blocked by Walls.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public JuggernautAbility copy() {
|
||||
return new JuggernautAbility(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JuggernautEffect extends CantBlockSourceEffect {
|
||||
|
||||
public JuggernautEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
}
|
||||
|
||||
public JuggernautEffect(final JuggernautEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
return !blocker.hasSubtype("Wall");
|
||||
}
|
||||
|
||||
@Override
|
||||
public JuggernautEffect copy() {
|
||||
return new JuggernautEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue