mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
[BFZ] Added Fertile Thicket, Brutal Expulsion and Guul Draz Overseer.
This commit is contained in:
parent
ffa2f2e851
commit
6f15e38b27
7 changed files with 421 additions and 92 deletions
|
@ -0,0 +1,93 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.battleforzendikar;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
import mage.abilities.effects.common.replacement.DealtDamageToCreatureBySourceDies;
|
||||
import mage.abilities.keyword.DevoidAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.common.FilterSpellOrPermanent;
|
||||
import mage.target.common.TargetCreatureOrPlaneswalker;
|
||||
import mage.target.common.TargetSpellOrPermanent;
|
||||
import mage.watchers.common.DamagedByWatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class BrutalExpulsion extends CardImpl {
|
||||
|
||||
private static final FilterSpellOrPermanent filter = new FilterSpellOrPermanent("spell or creature");
|
||||
|
||||
static {
|
||||
filter.setPermanentFilter(new FilterCreaturePermanent());
|
||||
}
|
||||
|
||||
public BrutalExpulsion(UUID ownerId) {
|
||||
super(ownerId, 200, "Brutal Expulsion", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{U}{R}");
|
||||
this.expansionSetCode = "BFZ";
|
||||
|
||||
// Devoid
|
||||
Ability ability = new DevoidAbility(this.color);
|
||||
ability.setRuleAtTheTop(true);
|
||||
this.addAbility(ability);
|
||||
// Choose one or both
|
||||
this.getSpellAbility().getModes().setMinModes(1);
|
||||
this.getSpellAbility().getModes().setMaxModes(2);
|
||||
// - Return target spell or creature to its owner's hand;
|
||||
this.getSpellAbility().addTarget(new TargetSpellOrPermanent(1, 1, filter, false));
|
||||
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
|
||||
// or Brutal Expulsion deals 2 damage to target creature or planeswalker. If that permanent would be put into a graveyard this turn, exile it instead.
|
||||
Mode mode = new Mode();
|
||||
mode.getEffects().add(new DamageTargetEffect(2));
|
||||
mode.getTargets().add(new TargetCreatureOrPlaneswalker());
|
||||
Effect effect = new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn);
|
||||
effect.setText("If that permanent would be put into a graveyard this turn, exile it instead");
|
||||
mode.getEffects().add(effect);
|
||||
this.getSpellAbility().addMode(mode);
|
||||
this.getSpellAbility().addWatcher(new DamagedByWatcher());
|
||||
}
|
||||
|
||||
public BrutalExpulsion(final BrutalExpulsion card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BrutalExpulsion copy() {
|
||||
return new BrutalExpulsion(this);
|
||||
}
|
||||
}
|
116
Mage.Sets/src/mage/sets/battleforzendikar/FertileThicket.java
Normal file
116
Mage.Sets/src/mage/sets/battleforzendikar/FertileThicket.java
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.battleforzendikar;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTappedAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.mana.GreenManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterBasicLandCard;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class FertileThicket extends CardImpl {
|
||||
|
||||
public FertileThicket(UUID ownerId) {
|
||||
super(ownerId, 237, "Fertile Thicket", Rarity.COMMON, new CardType[]{CardType.LAND}, "");
|
||||
this.expansionSetCode = "BFZ";
|
||||
|
||||
// Fertile Thicket enters the battlefield tapped.
|
||||
this.addAbility(new EntersBattlefieldTappedAbility());
|
||||
|
||||
// When Fertile Thicket enters the battlefield, you may look at the top five cards of your library. If you do, reveal up to one basic land card from among them, then put that card on top of your library and the rest on the bottom in any order.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new FertileThicketEffect(), true));
|
||||
|
||||
// {T}: Add {G} to your mana pool.
|
||||
this.addAbility(new GreenManaAbility());
|
||||
}
|
||||
|
||||
public FertileThicket(final FertileThicket card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FertileThicket copy() {
|
||||
return new FertileThicket(this);
|
||||
}
|
||||
}
|
||||
|
||||
class FertileThicketEffect extends OneShotEffect {
|
||||
|
||||
public FertileThicketEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "you may look at the top five cards of your library. If you do, reveal up to one basic land card from among them, then put that card on top of your library and the rest on the bottom in any order";
|
||||
}
|
||||
|
||||
public FertileThicketEffect(final FertileThicketEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FertileThicketEffect copy() {
|
||||
return new FertileThicketEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (controller != null && sourceObject != null) {
|
||||
Cards cards = new CardsImpl();
|
||||
cards.addAll(controller.getLibrary().getTopCards(game, 5));
|
||||
controller.lookAtCards(sourceObject.getIdName(), cards, game);
|
||||
TargetCard target = new TargetCard(0, 1, Zone.LIBRARY, new FilterBasicLandCard());
|
||||
controller.chooseTarget(outcome, cards, target, source, game);
|
||||
Cards cardsRevealed = new CardsImpl(target.getTargets());
|
||||
if (!cardsRevealed.isEmpty()) {
|
||||
controller.revealCards(sourceObject.getIdName(), cardsRevealed, game);
|
||||
cards.removeAll(cardsRevealed);
|
||||
controller.putCardsOnTopOfLibrary(cardsRevealed, game, source, true);
|
||||
}
|
||||
controller.putCardsOnBottomOfLibrary(cards, game, source, true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
107
Mage.Sets/src/mage/sets/battleforzendikar/GuulDrazOverseer.java
Normal file
107
Mage.Sets/src/mage/sets/battleforzendikar/GuulDrazOverseer.java
Normal file
|
@ -0,0 +1,107 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.battleforzendikar;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.LandfallAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SetTargetPointer;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class GuulDrazOverseer extends CardImpl {
|
||||
|
||||
public GuulDrazOverseer(UUID ownerId) {
|
||||
super(ownerId, 112, "Guul Draz Overseer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}");
|
||||
this.expansionSetCode = "BFZ";
|
||||
this.subtype.add("Vampire");
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
// <i>Landfall</i>- Whenever a land enters the battlefield under your control, other creatures you control get +1/+0 until end of turn. If that land is a Swamp, those creatures get +2/+0 until end of turn instead.
|
||||
this.addAbility(new LandfallAbility(Zone.BATTLEFIELD, new GuulDrazOverseerEffect(), false, SetTargetPointer.PERMANENT));
|
||||
}
|
||||
|
||||
public GuulDrazOverseer(final GuulDrazOverseer card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GuulDrazOverseer copy() {
|
||||
return new GuulDrazOverseer(this);
|
||||
}
|
||||
}
|
||||
|
||||
class GuulDrazOverseerEffect extends OneShotEffect {
|
||||
|
||||
public GuulDrazOverseerEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
this.staticText = "other creatures you control get +1/+0 until end of turn. If that land is a Swamp, those creatures get +2/+0 until end of turn instead";
|
||||
}
|
||||
|
||||
public GuulDrazOverseerEffect(final GuulDrazOverseerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GuulDrazOverseerEffect copy() {
|
||||
return new GuulDrazOverseerEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
|
||||
if (controller != null && land != null) {
|
||||
int boost = 1;
|
||||
if (land.getSubtype().contains("Swamp")) {
|
||||
boost = 2;
|
||||
}
|
||||
game.addEffect(new BoostControlledEffect(boost, 0, Duration.EndOfTurn, true), source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1,40 +1,41 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.abilities.common;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SetTargetPointer;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -42,16 +43,24 @@ import mage.game.permanent.Permanent;
|
|||
*/
|
||||
public class LandfallAbility extends TriggeredAbilityImpl {
|
||||
|
||||
protected SetTargetPointer setTargetPointer;
|
||||
|
||||
public LandfallAbility(Effect effect, boolean optional) {
|
||||
this(Zone.BATTLEFIELD, effect, optional);
|
||||
this(Zone.BATTLEFIELD, effect, optional);
|
||||
}
|
||||
|
||||
public LandfallAbility (Zone zone, Effect effect, Boolean optional ) {
|
||||
public LandfallAbility(Zone zone, Effect effect, Boolean optional) {
|
||||
this(zone, effect, optional, SetTargetPointer.NONE);
|
||||
}
|
||||
|
||||
public LandfallAbility(Zone zone, Effect effect, Boolean optional, SetTargetPointer setTargetPointer) {
|
||||
super(zone, effect, optional);
|
||||
this.setTargetPointer = setTargetPointer;
|
||||
}
|
||||
|
||||
public LandfallAbility(final LandfallAbility ability) {
|
||||
super(ability);
|
||||
this.setTargetPointer = ability.setTargetPointer;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -62,7 +71,17 @@ public class LandfallAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
return permanent != null && permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.controllerId);
|
||||
if (permanent != null
|
||||
&& permanent.getCardType().contains(CardType.LAND)
|
||||
&& permanent.getControllerId().equals(this.controllerId)) {
|
||||
if (setTargetPointer.equals(SetTargetPointer.PERMANENT)) {
|
||||
for (Effect effect : getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
*
|
||||
*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
|
@ -25,10 +25,11 @@
|
|||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*
|
||||
*
|
||||
*/
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
|
@ -42,32 +43,28 @@ import mage.filter.FilterCard;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX
|
||||
*/
|
||||
|
||||
public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEffect {
|
||||
|
||||
protected FilterCard filter; // which kind of cards to reveal
|
||||
protected DynamicValue numberToPick;
|
||||
protected boolean revealPickedCards = true;
|
||||
protected Zone targetPickedCards = Zone.HAND; // HAND
|
||||
protected Zone targetPickedCards = Zone.HAND; // HAND
|
||||
protected int foundCardsToPick = 0;
|
||||
protected boolean optional;
|
||||
private boolean upTo;
|
||||
|
||||
public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards, boolean mayShuffleAfter, DynamicValue numberToPick, FilterCard pickFilter, boolean putOnTop) {
|
||||
this(numberOfCards, mayShuffleAfter, numberToPick, pickFilter, putOnTop, true);
|
||||
this(numberOfCards, mayShuffleAfter, numberToPick, pickFilter, putOnTop, true);
|
||||
}
|
||||
|
||||
public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards, boolean mayShuffleAfter, DynamicValue numberToPick, FilterCard pickFilter, boolean putOnTop, boolean reveal) {
|
||||
this(numberOfCards, mayShuffleAfter, numberToPick, pickFilter, Zone.LIBRARY, putOnTop, reveal);
|
||||
this(numberOfCards, mayShuffleAfter, numberToPick, pickFilter, Zone.LIBRARY, putOnTop, reveal);
|
||||
}
|
||||
|
||||
public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards, boolean mayShuffleAfter, DynamicValue numberToPick,
|
||||
|
@ -92,13 +89,13 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
|
|||
|
||||
public LookLibraryAndPickControllerEffect(DynamicValue numberOfCards, boolean mayShuffleAfter, DynamicValue numberToPick,
|
||||
FilterCard pickFilter, Zone targetZoneLookedCards, boolean putOnTop, boolean reveal, boolean upTo, Zone targetZonePickedCards, boolean optional) {
|
||||
super(Outcome.DrawCard, numberOfCards, mayShuffleAfter, targetZoneLookedCards, putOnTop);
|
||||
this.numberToPick = numberToPick;
|
||||
this.filter = pickFilter;
|
||||
this.revealPickedCards = reveal;
|
||||
this.targetPickedCards = targetZonePickedCards;
|
||||
this.upTo = upTo;
|
||||
this.optional = optional;
|
||||
super(Outcome.DrawCard, numberOfCards, mayShuffleAfter, targetZoneLookedCards, putOnTop);
|
||||
this.numberToPick = numberToPick;
|
||||
this.filter = pickFilter;
|
||||
this.revealPickedCards = reveal;
|
||||
this.targetPickedCards = targetZonePickedCards;
|
||||
this.upTo = upTo;
|
||||
this.optional = optional;
|
||||
}
|
||||
|
||||
public LookLibraryAndPickControllerEffect(final LookLibraryAndPickControllerEffect effect) {
|
||||
|
@ -116,6 +113,7 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
|
|||
return new LookLibraryAndPickControllerEffect(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void cardLooked(Card card, Game game, Ability source) {
|
||||
if (numberToPick.calculate(game, source, this) > 0 && filter.match(card, game)) {
|
||||
|
@ -130,7 +128,7 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
|
|||
if (!optional || player.chooseUse(Outcome.DrawCard, getMayText(), source, game)) {
|
||||
FilterCard pickFilter = filter.copy();
|
||||
pickFilter.setMessage(getPickText());
|
||||
TargetCard target = new TargetCard((upTo ? 0:numberToPick.calculate(game, source, this)),numberToPick.calculate(game, source, this), Zone.PICK, pickFilter);
|
||||
TargetCard target = new TargetCard((upTo ? 0 : numberToPick.calculate(game, source, this)), numberToPick.calculate(game, source, this), Zone.PICK, pickFilter);
|
||||
if (player.choose(Outcome.DrawCard, cards, target, game)) {
|
||||
Cards reveal = new CardsImpl();
|
||||
for (UUID cardId : target.getTargets()) {
|
||||
|
@ -141,8 +139,9 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
|
|||
player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId());
|
||||
} else {
|
||||
card.moveToZone(targetPickedCards, source.getSourceId(), game, false);
|
||||
if (!game.isSimulation())
|
||||
if (!game.isSimulation()) {
|
||||
game.informPlayers(player.getLogName() + " moves a card to " + targetPickedCards.toString().toLowerCase());
|
||||
}
|
||||
}
|
||||
if (revealPickedCards) {
|
||||
reveal.add(card);
|
||||
|
@ -161,7 +160,7 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
|
|||
|
||||
private String getMayText() {
|
||||
StringBuilder sb = new StringBuilder("Do you wish to ");
|
||||
switch(targetPickedCards) {
|
||||
switch (targetPickedCards) {
|
||||
case HAND:
|
||||
if (revealPickedCards) {
|
||||
sb.append("reveal ").append(filter.getMessage()).append(" and put into your hand");
|
||||
|
@ -181,7 +180,7 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
|
|||
|
||||
private String getPickText() {
|
||||
StringBuilder sb = new StringBuilder(filter.getMessage()).append(" to ");
|
||||
switch(targetPickedCards) {
|
||||
switch (targetPickedCards) {
|
||||
case HAND:
|
||||
if (revealPickedCards) {
|
||||
sb.append("reveal and put into your hand");
|
||||
|
@ -206,37 +205,37 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
|
|||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (numberToPick.calculate(null, null, this) > 0) {
|
||||
|
||||
if (revealPickedCards) {
|
||||
sb.append(". You may reveal ");
|
||||
sb.append(filter.getMessage()).append(" from among them and put it into your ");
|
||||
|
||||
if (revealPickedCards) {
|
||||
sb.append(". You may reveal ");
|
||||
sb.append(filter.getMessage()).append(" from among them and put it into your ");
|
||||
} else {
|
||||
if (targetPickedCards.equals(Zone.BATTLEFIELD)) {
|
||||
sb.append(". You ");
|
||||
if (optional) {
|
||||
sb.append("may ");
|
||||
}
|
||||
sb.append("put ").append(filter.getMessage()).append(" from among them onto the ");
|
||||
} else {
|
||||
if (targetPickedCards.equals(Zone.BATTLEFIELD)) {
|
||||
sb.append(". You ");
|
||||
if (optional) {
|
||||
sb.append("may ");
|
||||
}
|
||||
sb.append("put ").append(filter.getMessage()).append(" from among them onto the ");
|
||||
} else {
|
||||
sb.append(". Put ");
|
||||
if (numberToPick.calculate(null, null, this) > 1 ) {
|
||||
if (upTo) {
|
||||
if (numberToPick.calculate(null, null, this) == (numberOfCards.calculate(null, null, this))) {
|
||||
sb.append("any number");
|
||||
} else {
|
||||
sb.append("up to ").append(CardUtil.numberToText(numberToPick.calculate(null, null, this)));
|
||||
}
|
||||
} else{
|
||||
sb.append(CardUtil.numberToText(numberToPick.calculate(null, null, this)));
|
||||
sb.append(". Put ");
|
||||
if (numberToPick.calculate(null, null, this) > 1) {
|
||||
if (upTo) {
|
||||
if (numberToPick.calculate(null, null, this) == (numberOfCards.calculate(null, null, this))) {
|
||||
sb.append("any number");
|
||||
} else {
|
||||
sb.append("up to ").append(CardUtil.numberToText(numberToPick.calculate(null, null, this)));
|
||||
}
|
||||
} else {
|
||||
sb.append("one");
|
||||
sb.append(CardUtil.numberToText(numberToPick.calculate(null, null, this)));
|
||||
}
|
||||
|
||||
sb.append(" of them into your ");
|
||||
} else {
|
||||
sb.append("one");
|
||||
}
|
||||
|
||||
sb.append(" of them into your ");
|
||||
}
|
||||
sb.append(targetPickedCards.toString().toLowerCase());
|
||||
}
|
||||
sb.append(targetPickedCards.toString().toLowerCase());
|
||||
|
||||
if (targetZoneLookedCards == Zone.LIBRARY) {
|
||||
sb.append(". Put the rest ");
|
||||
|
@ -252,6 +251,6 @@ public class LookLibraryAndPickControllerEffect extends LookLibraryControllerEff
|
|||
}
|
||||
// get text frame from super class and inject action text
|
||||
return setText(mode, sb.toString());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,13 +27,9 @@
|
|||
*/
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
|
@ -74,16 +70,7 @@ public class ReturnToHandTargetEffect extends OneShotEffect {
|
|||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
Cards cardsToHand = new CardsImpl();
|
||||
Zone fromZone = game.getState().getZone(targetPointer.getFirst(game, source));
|
||||
|
||||
for (UUID targetId : targetPointer.getTargets(game, source)) {
|
||||
MageObject mageObject = game.getObject(targetId);
|
||||
if (mageObject instanceof Card) {
|
||||
cardsToHand.add((Card) mageObject);
|
||||
}
|
||||
}
|
||||
return controller.moveCards(cardsToHand, fromZone, Zone.HAND, source, game);
|
||||
return controller.moveCards(new CardsImpl(targetPointer.getTargets(game, source)), null, Zone.HAND, source, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -91,6 +91,14 @@ public class FilterSpellOrPermanent extends FilterImpl<Object> implements Filter
|
|||
return this.spellFilter;
|
||||
}
|
||||
|
||||
public void setPermanentFilter(FilterPermanent permanentFilter) {
|
||||
this.permanentFilter = permanentFilter;
|
||||
}
|
||||
|
||||
public void setSpellFilter(FilterSpell spellFilter) {
|
||||
this.spellFilter = spellFilter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FilterSpellOrPermanent copy() {
|
||||
return new FilterSpellOrPermanent(this);
|
||||
|
|
Loading…
Reference in a new issue