mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
Fix Slate Street Ruffian and Thresher Beast. Simplify various similar cards
This commit is contained in:
parent
635e70e77e
commit
6892776e28
10 changed files with 47 additions and 306 deletions
|
@ -1,19 +1,13 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BecomesBlockedSourceTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -29,7 +23,9 @@ public final class AlleyGrifters extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Whenever Alley Grifters becomes blocked, defending player discards a card.
|
||||
this.addAbility(new BecomesBlockedSourceTriggeredAbility(new AlleyGriftersDiscardEffect(), false));
|
||||
this.addAbility(new BecomesBlockedSourceTriggeredAbility(
|
||||
new DiscardTargetEffect(1).setText("defending player discards a card"),
|
||||
false, true));
|
||||
}
|
||||
|
||||
private AlleyGrifters(final AlleyGrifters card) {
|
||||
|
@ -41,33 +37,3 @@ public final class AlleyGrifters extends CardImpl {
|
|||
return new AlleyGrifters(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AlleyGriftersDiscardEffect extends OneShotEffect {
|
||||
|
||||
public AlleyGriftersDiscardEffect() {
|
||||
super(Outcome.Discard);
|
||||
this.staticText = "defending player discards a card";
|
||||
}
|
||||
|
||||
public AlleyGriftersDiscardEffect(final AlleyGriftersDiscardEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AlleyGriftersDiscardEffect copy() {
|
||||
return new AlleyGriftersDiscardEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent blockingCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (blockingCreature != null) {
|
||||
Player opponent = game.getPlayer(blockingCreature.getControllerId());
|
||||
if (opponent != null) {
|
||||
opponent.discard(1, false, false, source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ public final class AngrathsRampage extends CardImpl {
|
|||
// Choose one:
|
||||
// • Target player sacrifices an artifact.
|
||||
this.getSpellAbility().addEffect(new SacrificeEffect(
|
||||
StaticFilters.FILTER_PERMANENT_ARTIFACT,
|
||||
StaticFilters.FILTER_PERMANENT_ARTIFACT_AN,
|
||||
1, "Target player"
|
||||
));
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
|
|
|
@ -2,22 +2,16 @@ package mage.cards.c;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BecomesBlockedSourceTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.RegenerateSourceEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.combat.Combat;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -36,7 +30,9 @@ public final class CorruptOfficial extends CardImpl {
|
|||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{2}{B}")));
|
||||
|
||||
// Whenever Corrupt Official becomes blocked, defending player discards a card at random.
|
||||
this.addAbility(new BecomesBlockedSourceTriggeredAbility(new CorruptOfficialDiscardEffect(), false));
|
||||
this.addAbility(new BecomesBlockedSourceTriggeredAbility(
|
||||
new DiscardTargetEffect(1, true).setText("defending player discards a card at random"),
|
||||
false, true));
|
||||
}
|
||||
|
||||
private CorruptOfficial(final CorruptOfficial card) {
|
||||
|
@ -48,34 +44,3 @@ public final class CorruptOfficial extends CardImpl {
|
|||
return new CorruptOfficial(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CorruptOfficialDiscardEffect extends OneShotEffect {
|
||||
|
||||
public CorruptOfficialDiscardEffect() {
|
||||
super(Outcome.Discard);
|
||||
this.staticText = "defending player discards a card at random";
|
||||
}
|
||||
|
||||
public CorruptOfficialDiscardEffect(final CorruptOfficialDiscardEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CorruptOfficialDiscardEffect copy() {
|
||||
return new CorruptOfficialDiscardEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent corruptOfficial = game.getPermanent(source.getSourceId());
|
||||
if (corruptOfficial != null) {
|
||||
Combat combat = game.getCombat();
|
||||
Player defendingPlayer = game.getPlayer(combat.getDefendingPlayerId(corruptOfficial.getId(), game));
|
||||
if (defendingPlayer != null) {
|
||||
defendingPlayer.discard(1, true, false, source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,17 +2,12 @@ package mage.cards.f;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BecomesBlockedByCreatureTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.common.BecomesBlockedSourceTriggeredAbility;
|
||||
import mage.abilities.effects.common.MillCardsTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -26,8 +21,10 @@ public final class FlintGolem extends CardImpl {
|
|||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Whenever Flint Golem becomes blocked, defending player puts the top three cards of their library into their graveyard.
|
||||
this.addAbility(new BecomesBlockedByCreatureTriggeredAbility(new FlintGolemEffect(), false));
|
||||
// Whenever Flint Golem becomes blocked, defending player mills three cards
|
||||
this.addAbility(new BecomesBlockedSourceTriggeredAbility(
|
||||
new MillCardsTargetEffect(3).setText("defending player mills three cards"),
|
||||
false, true));
|
||||
}
|
||||
|
||||
private FlintGolem(final FlintGolem card) {
|
||||
|
@ -39,33 +36,3 @@ public final class FlintGolem extends CardImpl {
|
|||
return new FlintGolem(this);
|
||||
}
|
||||
}
|
||||
|
||||
class FlintGolemEffect extends OneShotEffect {
|
||||
|
||||
public FlintGolemEffect() {
|
||||
super(Outcome.Detriment);
|
||||
this.staticText = "defending player mills three cards";
|
||||
}
|
||||
|
||||
public FlintGolemEffect(final FlintGolemEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FlintGolemEffect copy() {
|
||||
return new FlintGolemEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent blockingCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (blockingCreature != null) {
|
||||
Player opponent = game.getPlayer(blockingCreature.getControllerId());
|
||||
if (opponent != null) {
|
||||
opponent.millCards(3, source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,18 +2,12 @@ package mage.cards.p;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BecomesBlockedSourceTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.effects.common.LookAtTargetPlayerHandEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.constants.SubType;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -30,7 +24,8 @@ public final class PortInspector extends CardImpl {
|
|||
|
||||
// Whenever Port Inspector becomes blocked, you may look at defending player's hand.
|
||||
this.addAbility(new BecomesBlockedSourceTriggeredAbility(
|
||||
Zone.BATTLEFIELD, new LookAtDefendingPlayersHandEffect(), true, true));
|
||||
new LookAtTargetPlayerHandEffect().setText("look at defending player's hand"),
|
||||
true, true));
|
||||
}
|
||||
|
||||
private PortInspector(final PortInspector card) {
|
||||
|
@ -42,36 +37,3 @@ public final class PortInspector extends CardImpl {
|
|||
return new PortInspector(this);
|
||||
}
|
||||
}
|
||||
|
||||
class LookAtDefendingPlayersHandEffect extends OneShotEffect {
|
||||
|
||||
public LookAtDefendingPlayersHandEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "look at defending player's hand";
|
||||
}
|
||||
|
||||
public LookAtDefendingPlayersHandEffect(final LookAtDefendingPlayersHandEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LookAtDefendingPlayersHandEffect copy() {
|
||||
return new LookAtDefendingPlayersHandEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Player defendingPlayer = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (controller != null
|
||||
&& defendingPlayer != null) {
|
||||
controller.lookAtCards(sourceObject != null
|
||||
? sourceObject.getIdName() : null,
|
||||
defendingPlayer.getHand(), game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,12 +5,12 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BecomesBlockedSourceTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
@ -32,8 +32,7 @@ public final class RobberFly extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Whenever Robber Fly becomes blocked, defending player discards all the cards in their hand, then draws that many cards.
|
||||
this.addAbility(new BecomesBlockedSourceTriggeredAbility(
|
||||
Zone.BATTLEFIELD, new DrawCardsDefendingPlayerEffect(), false, true));
|
||||
this.addAbility(new BecomesBlockedSourceTriggeredAbility(new DrawCardsDefendingPlayerEffect(), false, true));
|
||||
}
|
||||
|
||||
private RobberFly(final RobberFly card) {
|
||||
|
@ -76,5 +75,4 @@ class DrawCardsDefendingPlayerEffect extends OneShotEffect {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,23 +1,17 @@
|
|||
|
||||
package mage.cards.r;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BecomesBlockedSourceTriggeredAbility;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.target.Target;
|
||||
import mage.filter.common.FilterArtifactOrEnchantmentPermanent;
|
||||
import mage.filter.predicate.permanent.DefendingPlayerControlsPredicate;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
|
@ -26,6 +20,13 @@ import mage.target.TargetPermanent;
|
|||
*/
|
||||
public final class RustScarab extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter
|
||||
= new FilterArtifactOrEnchantmentPermanent("artifact or enchantment defending player controls");
|
||||
|
||||
static {
|
||||
filter.add(DefendingPlayerControlsPredicate.instance);
|
||||
}
|
||||
|
||||
public RustScarab(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{G}");
|
||||
this.subtype.add(SubType.INSECT);
|
||||
|
@ -34,10 +35,9 @@ public final class RustScarab extends CardImpl {
|
|||
this.toughness = new MageInt(5);
|
||||
|
||||
// Whenever Rust Scarab becomes blocked, you may destroy target artifact or enchantment defending player controls.
|
||||
Effect effect = new DestroyTargetEffect();
|
||||
effect.setText("destroy target artifact or enchantment defending player controls");
|
||||
this.addAbility(new RustScarabBecomesBlockedTriggeredAbility(effect, true));
|
||||
|
||||
Ability ability = new BecomesBlockedSourceTriggeredAbility(new DestroyTargetEffect(), true);
|
||||
ability.addTarget(new TargetPermanent(filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private RustScarab(final RustScarab card) {
|
||||
|
@ -49,47 +49,3 @@ public final class RustScarab extends CardImpl {
|
|||
return new RustScarab(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class RustScarabBecomesBlockedTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public RustScarabBecomesBlockedTriggeredAbility(Effect effect, boolean optional) {
|
||||
super(Zone.BATTLEFIELD, effect, optional);
|
||||
}
|
||||
|
||||
public RustScarabBecomesBlockedTriggeredAbility(final RustScarabBecomesBlockedTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.CREATURE_BLOCKED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getTargetId().equals(this.getSourceId())) {
|
||||
UUID defenderId = game.getState().getCombat().findGroup(this.getSourceId()).getDefenderId();
|
||||
if (defenderId != null) {
|
||||
this.getTargets().clear();
|
||||
FilterPermanent filter = new FilterPermanent("artifact or enchantment defending player controls");
|
||||
filter.add(Predicates.or(CardType.ARTIFACT.getPredicate(), CardType.ENCHANTMENT.getPredicate()));
|
||||
filter.add(new ControllerIdPredicate(defenderId));
|
||||
Target target = new TargetPermanent(filter);
|
||||
this.addTarget(target);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTriggerPhrase() {
|
||||
return "Whenever {this} becomes blocked, " ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RustScarabBecomesBlockedTriggeredAbility copy() {
|
||||
return new RustScarabBecomesBlockedTriggeredAbility(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,13 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BecomesBlockedByCreatureTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.common.BecomesBlockedSourceTriggeredAbility;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -29,9 +23,10 @@ public final class SlateStreetRuffian extends CardImpl {
|
|||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
|
||||
// Whenever Slate Street Ruffian becomes blocked, defending player discards a card.
|
||||
this.addAbility(new BecomesBlockedByCreatureTriggeredAbility(new SlateStreetRuffianDiscardEffect(), false));
|
||||
this.addAbility(new BecomesBlockedSourceTriggeredAbility(
|
||||
new DiscardTargetEffect(1).setText("defending player discards a card"),
|
||||
false, true));
|
||||
}
|
||||
|
||||
private SlateStreetRuffian(final SlateStreetRuffian card) {
|
||||
|
@ -43,33 +38,3 @@ public final class SlateStreetRuffian extends CardImpl {
|
|||
return new SlateStreetRuffian(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SlateStreetRuffianDiscardEffect extends OneShotEffect {
|
||||
|
||||
public SlateStreetRuffianDiscardEffect() {
|
||||
super(Outcome.Discard);
|
||||
this.staticText = "defending player discards a card";
|
||||
}
|
||||
|
||||
public SlateStreetRuffianDiscardEffect(final SlateStreetRuffianDiscardEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SlateStreetRuffianDiscardEffect copy() {
|
||||
return new SlateStreetRuffianDiscardEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent blockingCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (blockingCreature != null) {
|
||||
Player opponent = game.getPlayer(blockingCreature.getControllerId());
|
||||
if (opponent != null) {
|
||||
opponent.discard(1, false, false, source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +1,14 @@
|
|||
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BecomesBlockedByCreatureTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.common.BecomesBlockedSourceTriggeredAbility;
|
||||
import mage.abilities.effects.common.SacrificeEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -32,7 +23,9 @@ public final class ThresherBeast extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
// Whenever Thresher Beast becomes blocked, defending player sacrifices a land.
|
||||
this.addAbility(new BecomesBlockedByCreatureTriggeredAbility(new ThresherBeastEffect(), false));
|
||||
this.addAbility(new BecomesBlockedSourceTriggeredAbility(
|
||||
new SacrificeEffect(StaticFilters.FILTER_LAND, 1, "defending player"),
|
||||
false, true));
|
||||
}
|
||||
|
||||
private ThresherBeast(final ThresherBeast card) {
|
||||
|
@ -44,34 +37,3 @@ public final class ThresherBeast extends CardImpl {
|
|||
return new ThresherBeast(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ThresherBeastEffect extends OneShotEffect {
|
||||
|
||||
public ThresherBeastEffect() {
|
||||
super(Outcome.Discard);
|
||||
this.staticText = "defending player sacrifices a land";
|
||||
}
|
||||
|
||||
public ThresherBeastEffect(final ThresherBeastEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThresherBeastEffect copy() {
|
||||
return new ThresherBeastEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent blockingCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (blockingCreature != null) {
|
||||
Player opponent = game.getPlayer(blockingCreature.getControllerId());
|
||||
if (opponent != null) {
|
||||
Effect effect = new SacrificeEffect(StaticFilters.FILTER_LAND, 1, "");
|
||||
effect.setTargetPointer(new FixedTarget(opponent.getId()));
|
||||
return effect.apply(game, source);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,11 +16,11 @@ public class BecomesBlockedSourceTriggeredAbility extends TriggeredAbilityImpl {
|
|||
boolean setTargetPointer;
|
||||
|
||||
public BecomesBlockedSourceTriggeredAbility(Effect effect, boolean optional) {
|
||||
this(Zone.BATTLEFIELD, effect, optional, false);
|
||||
this(effect, optional, false);
|
||||
}
|
||||
|
||||
public BecomesBlockedSourceTriggeredAbility(Zone zone, Effect effect, boolean optional, boolean setTargetPointer) {
|
||||
super(zone, effect, optional);
|
||||
public BecomesBlockedSourceTriggeredAbility(Effect effect, boolean optional, boolean setTargetPointer) {
|
||||
super(Zone.BATTLEFIELD, effect, optional);
|
||||
this.setTargetPointer = setTargetPointer;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue