mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Merge pull request #2537 from nigelzor/simplify-some-cards
Simplify some cards
This commit is contained in:
commit
3966b4a217
44 changed files with 224 additions and 1452 deletions
|
|
@ -42,18 +42,14 @@ public class OnEventTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
private final EventType eventType;
|
||||
private final String eventName;
|
||||
private boolean allPlayers = false;
|
||||
private final boolean allPlayers;
|
||||
|
||||
public OnEventTriggeredAbility(EventType eventType, String eventName, Effect effect) {
|
||||
super(Zone.BATTLEFIELD, effect);
|
||||
this.eventType = eventType;
|
||||
this.eventName = eventName;
|
||||
this(eventType, eventName, effect, false);
|
||||
}
|
||||
|
||||
public OnEventTriggeredAbility(EventType eventType, String eventName, Effect effect, boolean optional) {
|
||||
super(Zone.BATTLEFIELD, effect, optional);
|
||||
this.eventType = eventType;
|
||||
this.eventName = eventName;
|
||||
this(eventType, eventName, false, effect, optional);
|
||||
}
|
||||
|
||||
public OnEventTriggeredAbility(EventType eventType, String eventName, boolean allPlayers, Effect effect) {
|
||||
|
|
@ -61,7 +57,7 @@ public class OnEventTriggeredAbility extends TriggeredAbilityImpl {
|
|||
}
|
||||
|
||||
public OnEventTriggeredAbility(EventType eventType, String eventName, boolean allPlayers, Effect effect, boolean optional) {
|
||||
super(Zone.BATTLEFIELD, effect);
|
||||
super(Zone.BATTLEFIELD, effect, optional);
|
||||
this.eventType = eventType;
|
||||
this.eventName = eventName;
|
||||
this.allPlayers = allPlayers;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.cards.Card;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterLandCard;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
|
@ -44,6 +45,7 @@ import mage.target.common.TargetCardInHand;
|
|||
*/
|
||||
public class PutLandFromHandOntoBattlefieldEffect extends OneShotEffect {
|
||||
|
||||
private FilterCard filter;
|
||||
private boolean tapped;
|
||||
|
||||
public PutLandFromHandOntoBattlefieldEffect() {
|
||||
|
|
@ -51,21 +53,27 @@ public class PutLandFromHandOntoBattlefieldEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
public PutLandFromHandOntoBattlefieldEffect(boolean tapped) {
|
||||
this(tapped, new FilterLandCard());
|
||||
}
|
||||
|
||||
public PutLandFromHandOntoBattlefieldEffect(boolean tapped, FilterCard filter) {
|
||||
super(Outcome.PutLandInPlay);
|
||||
this.tapped = tapped;
|
||||
staticText = "you may put a land card from your hand onto the battlefield" + (tapped ? " tapped" : "");
|
||||
this.filter = filter;
|
||||
staticText = "you may put a " + filter.getMessage() + " from your hand onto the battlefield" + (tapped ? " tapped" : "");
|
||||
}
|
||||
|
||||
public PutLandFromHandOntoBattlefieldEffect(final PutLandFromHandOntoBattlefieldEffect effect) {
|
||||
super(effect);
|
||||
this.tapped = effect.tapped;
|
||||
this.filter = effect.filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Target target = new TargetCardInHand(new FilterLandCard("land card"));
|
||||
Target target = new TargetCardInHand(filter);
|
||||
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)
|
||||
&& controller.chooseUse(outcome, "Put land onto battlefield?", source, game)
|
||||
&& controller.choose(outcome, target, source.getSourceId(), game)) {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ package mage.filter.common;
|
|||
import mage.constants.CardType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -47,6 +48,12 @@ public class FilterLandCard extends FilterCard {
|
|||
this.add(new CardTypePredicate(CardType.LAND));
|
||||
}
|
||||
|
||||
public static FilterLandCard basicLandCard() {
|
||||
FilterLandCard filter = new FilterLandCard("basic land card");
|
||||
filter.add(new SupertypePredicate("Basic"));
|
||||
return filter;
|
||||
}
|
||||
|
||||
public FilterLandCard(final FilterLandCard filter) {
|
||||
super(filter);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue