mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 20:29:19 -08:00
[SWS] Fixed Exogorth's block ability.
This commit is contained in:
parent
99fa296e37
commit
54d5599e06
3 changed files with 49 additions and 40 deletions
|
|
@ -29,19 +29,12 @@ package mage.cards.e;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.abilities.keyword.CanBlockSpaceflightAbility;
|
||||
import mage.abilities.keyword.FlashAbility;
|
||||
import mage.abilities.keyword.SpaceflightAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -50,7 +43,7 @@ import mage.game.permanent.Permanent;
|
|||
public class Exogorth extends CardImpl {
|
||||
|
||||
public Exogorth(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{G}{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}{G}");
|
||||
this.subtype.add("Slug");
|
||||
this.power = new MageInt(7);
|
||||
this.toughness = new MageInt(7);
|
||||
|
|
@ -61,8 +54,8 @@ public class Exogorth extends CardImpl {
|
|||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// Exogorth can block only creatures with spaceflight.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockOnlySpaceflightEffect()));
|
||||
// Exogorth can block creatures with spaceflight.
|
||||
this.addAbility(CanBlockSpaceflightAbility.getInstance());
|
||||
}
|
||||
|
||||
public Exogorth(final Exogorth card) {
|
||||
|
|
@ -74,31 +67,3 @@ public class Exogorth extends CardImpl {
|
|||
return new Exogorth(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CanBlockOnlySpaceflightEffect extends RestrictionEffect {
|
||||
|
||||
public CanBlockOnlySpaceflightEffect() {
|
||||
super(Duration.EndOfTurn);
|
||||
this.staticText = "{this} can block only creatures with spaceflight";
|
||||
}
|
||||
|
||||
public CanBlockOnlySpaceflightEffect(final CanBlockOnlySpaceflightEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
return permanent.getId().equals(source.getSourceId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
return attacker.getAbilities().contains(SpaceflightAbility.getInstance());
|
||||
}
|
||||
|
||||
@Override
|
||||
public CanBlockOnlySpaceflightEffect copy() {
|
||||
return new CanBlockOnlySpaceflightEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue