mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
commit
93b57033b9
26 changed files with 286 additions and 225 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -86,6 +86,7 @@ mage.updater.client/target
|
|||
|
||||
# Mage.Verify
|
||||
Mage.Verify/target
|
||||
Mage.Verify/mageclient.log
|
||||
Mage.Verify/AllCards.json.zip
|
||||
Mage.Verify/AllSets.json.zip
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ public class AboutDialog extends MageDialog {
|
|||
jLabel2.setText("Courtesy: BetaSteward@googlemail.com. Site: http://XMage.de/");
|
||||
|
||||
jLabel3.setText("Devs: BetaSteward, Noxx, Eugen.Rivniy, North, LevelX2, Jeff, Plopman, dustinconrad, emerald000,");
|
||||
jLabel4.setText("fireshoes, lunaskyrise, mnapoleon, jgod, LoneFox, drmDev, spjspj, L_J, JayDi85.");
|
||||
jLabel4.setText("fireshoes, lunaskyrise, mnapoleon, jgod, LoneFox, drmDev, spjspj, TheElk801, L_J, JayDi85.");
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
|
||||
/*
|
||||
* Copyright 2011 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.deck;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
import mage.cards.ExpansionSet;
|
||||
import mage.cards.Sets;
|
||||
import mage.cards.decks.Constructed;
|
||||
import mage.constants.SetType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ModernNoBannedList extends Constructed {
|
||||
|
||||
public ModernNoBannedList() {
|
||||
super("Constructed - Modern - No Banned List");
|
||||
|
||||
Date cutoff = new GregorianCalendar(2003, 6, 28).getTime(); // Eight edition release date
|
||||
for (ExpansionSet set : Sets.getInstance().values()) {
|
||||
if ((set.getReleaseDate().after(cutoff) || set.getReleaseDate().equals(cutoff))
|
||||
&& (set.getSetType() == SetType.CORE || set.getSetType() == SetType.EXPANSION)) {
|
||||
setCodes.add(set.getCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -150,6 +150,7 @@
|
|||
<deckType name="Constructed - Australian Highlander" jar="mage-deck-constructed.jar" className="mage.deck.AusHighlander"/>
|
||||
<deckType name="Constructed - Canadian Highlander" jar="mage-deck-constructed.jar" className="mage.deck.CanadianHighlander"/>
|
||||
<deckType name="Constructed - Freeform" jar="mage-deck-constructed.jar" className="mage.deck.Freeform"/>
|
||||
<deckType name="Constructed - Constructed - Modern - No Banned List" jar="mage-deck-constructed.jar" className="mage.deck.ModernNoBannedList"/>
|
||||
<deckType name="Variant Magic - Commander" jar="mage-deck-constructed.jar" className="mage.deck.Commander"/>
|
||||
<deckType name="Variant Magic - Duel Commander" jar="mage-deck-constructed.jar" className="mage.deck.DuelCommander"/>
|
||||
<deckType name="Variant Magic - MTGO 1v1 Commander" jar="mage-deck-constructed.jar" className="mage.deck.MTGO1v1Commander"/>
|
||||
|
|
|
@ -54,7 +54,7 @@ import mage.target.common.TargetCardInHand;
|
|||
public class AcademyResearchers extends CardImpl {
|
||||
|
||||
public AcademyResearchers(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{U}");
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.WIZARD);
|
||||
|
||||
|
@ -104,7 +104,7 @@ class AcademyResearchersEffect extends OneShotEffect {
|
|||
Card auraInHand = game.getCard(target.getFirstTarget());
|
||||
if (auraInHand != null) {
|
||||
game.getState().setValue("attachTo:" + auraInHand.getId(), academyResearchers);
|
||||
auraInHand.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), controller.getId());
|
||||
controller.moveCards(auraInHand, Zone.BATTLEFIELD, source, game);
|
||||
if (academyResearchers.addAttachment(auraInHand.getId(), game)) {
|
||||
game.informPlayers(controller.getLogName() + " put " + auraInHand.getLogName() + " on the battlefield attached to " + academyResearchers.getLogName() + '.');
|
||||
return true;
|
||||
|
|
|
@ -37,10 +37,10 @@ import mage.abilities.common.SimpleStaticAbility;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
||||
import mage.abilities.keyword.TransformAbility;
|
||||
import mage.cards.i.InfectiousCurse;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.i.InfectiousCurse;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
@ -55,7 +55,7 @@ import mage.util.CardUtil;
|
|||
public class AccursedWitch extends CardImpl {
|
||||
|
||||
public AccursedWitch(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}");
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.SHAMAN);
|
||||
this.power = new MageInt(4);
|
||||
|
@ -106,8 +106,7 @@ class AccursedWitchReturnTransformedEffect extends OneShotEffect {
|
|||
//note: should check for null after game.getCard
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (card != null) {
|
||||
card.removeFromZone(game, Zone.GRAVEYARD, source.getSourceId());
|
||||
card.putOntoBattlefield(game, Zone.BATTLEFIELD, source.getSourceId(), source.getControllerId(), false);
|
||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -41,7 +41,7 @@ import mage.constants.Outcome;
|
|||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
|
@ -101,18 +101,12 @@ class AllHallowsEveEffect extends OneShotEffect {
|
|||
allHallowsEve.getCounters(game).removeCounter(CounterType.SCREAM, 1);
|
||||
if (allHallowsEve.getCounters(game).getCount(CounterType.SCREAM) == 0) {
|
||||
allHallowsEve.moveToZone(Zone.GRAVEYARD, source.getId(), game, false);
|
||||
Cards creatures = new CardsImpl();
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
for (Card creatureCard : player.getGraveyard().getCards(new FilterCreatureCard(), game)) {
|
||||
creatures.add(creatureCard);
|
||||
}
|
||||
player.moveCards(player.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game), Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
||||
for (Card card : creatures.getCards(game)) {
|
||||
card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), card.getOwnerId());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
*/
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -44,7 +46,6 @@ import mage.filter.common.FilterCreatureCard;
|
|||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
|
@ -54,7 +55,7 @@ import mage.players.Player;
|
|||
public class AngelOfGlorysRise extends CardImpl {
|
||||
|
||||
public AngelOfGlorysRise(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{W}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{W}{W}");
|
||||
this.subtype.add(SubType.ANGEL);
|
||||
|
||||
this.power = new MageInt(4);
|
||||
|
@ -79,14 +80,6 @@ public class AngelOfGlorysRise extends CardImpl {
|
|||
|
||||
class AngelOfGlorysRiseEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterCreatureCard filterHuman = new FilterCreatureCard();
|
||||
private static final FilterCreaturePermanent filterZombie = new FilterCreaturePermanent();
|
||||
|
||||
static {
|
||||
filterZombie.add(new SubtypePredicate(SubType.ZOMBIE));
|
||||
filterHuman.add(new SubtypePredicate(SubType.HUMAN));
|
||||
}
|
||||
|
||||
public AngelOfGlorysRiseEffect() {
|
||||
super(Outcome.PutCreatureInPlay);
|
||||
staticText = "Exile all Zombies, then return all Human creature cards from your graveyard to the battlefield";
|
||||
|
@ -103,14 +96,14 @@ class AngelOfGlorysRiseEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
for (Permanent zombie : game.getBattlefield().getActivePermanents(filterZombie, source.getControllerId(), source.getSourceId(), game)) {
|
||||
zombie.moveToExile(source.getSourceId(), zombie.getName(), source.getSourceId(), game);
|
||||
}
|
||||
for (Card human : player.getGraveyard().getCards(filterHuman, game)) {
|
||||
human.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId());
|
||||
}
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Set<Card> toExile = new HashSet<>(game.getBattlefield()
|
||||
.getActivePermanents(new FilterCreaturePermanent(SubType.ZOMBIE, "Zombie"), source.getControllerId(), source.getSourceId(), game));
|
||||
controller.moveCards(toExile, Zone.EXILED, source, game);
|
||||
FilterCreatureCard filterHuman = new FilterCreatureCard();
|
||||
filterHuman.add(new SubtypePredicate(SubType.HUMAN));
|
||||
controller.moveCards(controller.getGraveyard().getCards(filterHuman, game), Zone.GRAVEYARD, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public class ArachnusSpinner extends CardImpl {
|
|||
}
|
||||
|
||||
public ArachnusSpinner(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}");
|
||||
this.subtype.add(SubType.SPIDER);
|
||||
|
||||
this.power = new MageInt(5);
|
||||
|
@ -98,8 +98,10 @@ public class ArachnusSpinner extends CardImpl {
|
|||
class ArachnusSpinnerEffect extends OneShotEffect {
|
||||
|
||||
public ArachnusSpinnerEffect() {
|
||||
super(Outcome.UnboostCreature);
|
||||
this.staticText = "Search your graveyard and/or library for a card named Arachnus Web and put it onto the battlefield attached to target creature. If you search your library this way, shuffle it";
|
||||
super(Outcome.PutCardInPlay);
|
||||
this.staticText = "Search your graveyard and/or library for a card named Arachnus Web "
|
||||
+ "and put it onto the battlefield attached to target creature. "
|
||||
+ "If you search your library this way, shuffle it";
|
||||
}
|
||||
|
||||
public ArachnusSpinnerEffect(final ArachnusSpinnerEffect effect) {
|
||||
|
@ -113,8 +115,8 @@ class ArachnusSpinnerEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -122,34 +124,28 @@ class ArachnusSpinnerEffect extends OneShotEffect {
|
|||
filter.add(new NamePredicate("Arachnus Web"));
|
||||
|
||||
Card card = null;
|
||||
Zone zone = null;
|
||||
if (player.chooseUse(Outcome.Neutral, "Search your graveyard for Arachnus Web?", source, game)) {
|
||||
if (controller.chooseUse(Outcome.Neutral, "Search your graveyard for Arachnus Web?", source, game)) {
|
||||
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(filter);
|
||||
if (player.choose(Outcome.PutCardInPlay, player.getGraveyard(), target, game)) {
|
||||
if (controller.choose(Outcome.PutCardInPlay, controller.getGraveyard(), target, game)) {
|
||||
card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
zone = Zone.GRAVEYARD;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (card == null) {
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
if (player.searchLibrary(target, game)) {
|
||||
if (controller.searchLibrary(target, game)) {
|
||||
card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
zone = Zone.LIBRARY;
|
||||
}
|
||||
}
|
||||
player.shuffleLibrary(source, game);
|
||||
controller.shuffleLibrary(source, game);
|
||||
}
|
||||
if (card != null) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
game.getState().setValue("attachTo:" + card.getId(), permanent.getId());
|
||||
card.putOntoBattlefield(game, zone, source.getSourceId(), source.getControllerId());
|
||||
return permanent.addAttachment(card.getId(), game);
|
||||
if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
|
||||
permanent.addAttachment(card.getId(), game); // shouldn't this be done automatically by the logic using the "attachTo:" calue?
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,28 +88,32 @@ class AuratouchedMageEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent auratouchedMage = game.getPermanentOrLKIBattlefield(source.getSourceId()); //must be LKI to resolve
|
||||
if (controller != null && auratouchedMage != null) {
|
||||
FilterCard filter = new FilterCard("aura that could enchant " + auratouchedMage.getName());
|
||||
|
||||
if (controller != null) {
|
||||
FilterCard filter = new FilterCard("aura that could enchant " + source.getSourceObject(game).getName());
|
||||
filter.add(new SubtypePredicate(SubType.AURA));
|
||||
filter.add(new AuraCardCanAttachToLKIPermanentId(auratouchedMage.getId()));
|
||||
filter.add(new AuraCardCanAttachToLKIPermanentId(source.getSourceId()));
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
target.setNotTarget(true);
|
||||
if (controller.searchLibrary(target, game)) {
|
||||
if (target.getFirstTarget() != null) {
|
||||
Card aura = game.getCard(target.getFirstTarget());
|
||||
if (game.getBattlefield().containsPermanent(auratouchedMage.getId())) { //verify that it is still on the battlefield
|
||||
Permanent auratouchedMage = source.getSourcePermanentIfItStillExists(game);
|
||||
if (aura != null && auratouchedMage != null
|
||||
&& game.getState().getZoneChangeCounter(source.getSourceId()) == source.getSourceObjectZoneChangeCounter()) {
|
||||
game.getState().setValue("attachTo:" + aura.getId(), auratouchedMage);
|
||||
aura.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), controller.getId());
|
||||
return auratouchedMage.addAttachment(aura.getId(), game);
|
||||
if (controller.moveCards(aura, Zone.BATTLEFIELD, source, game)) {
|
||||
auratouchedMage.addAttachment(aura.getId(), game);
|
||||
}
|
||||
} else {
|
||||
Cards auraRevealed = new CardsImpl(aura);
|
||||
controller.revealCards(source, auraRevealed, game);
|
||||
controller.moveCards(aura, Zone.HAND, source, game);
|
||||
}
|
||||
Cards auraRevealed = new CardsImpl();
|
||||
auraRevealed.add(aura);
|
||||
controller.revealCards(auratouchedMage.getName(), auraRevealed, game);
|
||||
controller.putInHand(aura, game);
|
||||
}
|
||||
}
|
||||
controller.shuffleLibrary(source, game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -71,8 +71,13 @@ public class AzcantaTheSunkenRuin extends CardImpl {
|
|||
this.addAbility(new BlueManaAbility());
|
||||
|
||||
// {2}{U} , {T} : Look at the top four cards of your library. You may reveal a noncreature, nonland card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
new LookLibraryAndPickControllerEffect(new StaticValue(4), false, new StaticValue(1), filter, false), new ManaCostsImpl<>("{2}{U}"));
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new LookLibraryAndPickControllerEffect(
|
||||
new StaticValue(4), false, new StaticValue(1),
|
||||
filter, Zone.LIBRARY, false, true, true
|
||||
), new ManaCostsImpl<>("{2}{U}")
|
||||
);
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -94,15 +94,15 @@ class EnteringReturnFromGraveyardToBattlefieldEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Target target = new TargetCardInGraveyard(new FilterCreatureCard());
|
||||
target.setNotTarget(true);
|
||||
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)
|
||||
&& player.chooseTarget(outcome, target, source, game)) {
|
||||
&& controller.chooseTarget(outcome, target, source, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
if (card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId())) {
|
||||
if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
|
||||
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(card.getId()));
|
||||
game.addEffect(effect, source);
|
||||
|
|
|
@ -37,8 +37,8 @@ import mage.cards.Card;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterArtifactOrEnchantmentCard;
|
||||
import mage.game.Game;
|
||||
|
@ -105,7 +105,7 @@ class CharmedGriffinEffect extends OneShotEffect {
|
|||
&& player.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), player.getId());
|
||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,9 +33,9 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
|
@ -103,13 +103,7 @@ class CollectiveVoyageEffect extends OneShotEffect {
|
|||
if (player != null) {
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(0, xSum, StaticFilters.FILTER_BASIC_LAND_CARD);
|
||||
if (player.searchLibrary(target, game)) {
|
||||
for (UUID cardId : target.getTargets()) {
|
||||
Card card = player.getLibrary().getCard(cardId, game);
|
||||
if (card != null) {
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), player.getId(), true);
|
||||
}
|
||||
|
||||
}
|
||||
player.moveCards(new CardsImpl(target.getTargets()).getCards(game), Zone.BATTLEFIELD, source, game, true, false, true, null);
|
||||
player.shuffleLibrary(source, game);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ package mage.cards.d;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -181,14 +182,18 @@ class DarigaazReincarnatedReturnEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (player == null || card == null) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
new RemoveCounterSourceEffect(CounterType.EGG.createInstance()).apply(game, source);
|
||||
if (card.getCounters(game).getCount(CounterType.EGG) == 0) {
|
||||
return card.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), player.getId());
|
||||
MageObject sourceObject = source.getSourceObjectIfItStillExists(game);
|
||||
if (sourceObject != null && sourceObject instanceof Card) {
|
||||
Card card = (Card) sourceObject;
|
||||
new RemoveCounterSourceEffect(CounterType.EGG.createInstance()).apply(game, source);
|
||||
if (card.getCounters(game).getCount(CounterType.EGG) == 0) {
|
||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -38,7 +37,6 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.Cards;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
|
@ -49,7 +47,9 @@ import mage.filter.predicate.mageobject.NamePredicate;
|
|||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
/**
|
||||
|
@ -65,14 +65,14 @@ public class DarkSupplicant extends CardImpl {
|
|||
}
|
||||
|
||||
public DarkSupplicant(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}");
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.CLERIC);
|
||||
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// {tap}, Sacrifice three Clerics: Search your graveyard, hand, and/or library for a card named Scion of Darkness and put it onto the battlefield. If you search your library this way, shuffle it.
|
||||
// {T}, Sacrifice three Clerics: Search your graveyard, hand, and/or library for a card named Scion of Darkness and put it onto the battlefield. If you search your library this way, shuffle it.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DarkSupplicantEffect(), new TapSourceCost());
|
||||
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(3, 3, filter, true)));
|
||||
this.addAbility(ability);
|
||||
|
@ -91,7 +91,7 @@ public class DarkSupplicant extends CardImpl {
|
|||
class DarkSupplicantEffect extends OneShotEffect {
|
||||
|
||||
public DarkSupplicantEffect() {
|
||||
super(Outcome.Benefit);
|
||||
super(Outcome.PutCardInPlay);
|
||||
this.staticText = "Search your graveyard, hand, and/or library for a card named Scion of Darkness and put it onto the battlefield. If you search your library this way, shuffle it";
|
||||
}
|
||||
|
||||
|
@ -106,51 +106,49 @@ class DarkSupplicantEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
FilterCard filter = new FilterCard("card named Scion of Darkness");
|
||||
filter.add(new NamePredicate("Scion of Darkness"));
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
if (player == null) {
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
// Library check
|
||||
if (player.chooseUse(Outcome.Benefit, "Do you want to search your library for Scion of Darkness?", source, game)) {
|
||||
if (player.searchLibrary(target, game)) {
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
for (UUID cardId : (List<UUID>) target.getTargets()) {
|
||||
Card card = player.getLibrary().getCard(cardId, game);
|
||||
if (card != null) {
|
||||
if (card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
player.shuffleLibrary(source, game);
|
||||
}
|
||||
Card selectedCard = null;
|
||||
// Graveyard check
|
||||
if (player.chooseUse(Outcome.Benefit, "Do you want to search your graveyard for Scion of Darkness?", source, game)) {
|
||||
Cards graveyard = player.getGraveyard().copy();
|
||||
for (UUID card : graveyard) {
|
||||
Card checkCard = game.getCard(card);
|
||||
if (checkCard.getName().equals("Scion of Darkness")) {
|
||||
checkCard.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId());
|
||||
return true;
|
||||
}
|
||||
if (controller.chooseUse(Outcome.Benefit, "Do you want to search your graveyard for Scion of Darkness?", source, game)) {
|
||||
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(1, 1, filter, true);
|
||||
if (controller.choose(outcome, controller.getGraveyard(), target, game)) {
|
||||
selectedCard = game.getCard(target.getFirstTarget());
|
||||
}
|
||||
}
|
||||
// Hand check
|
||||
if (player.chooseUse(Outcome.Benefit, "Do you want to search your hand for Scion of Darkness?", source, game)) {
|
||||
Cards hand = player.getHand().copy();
|
||||
for (UUID card : hand) {
|
||||
Card checkCard = game.getCard(card);
|
||||
if (checkCard.getName().equals("Scion of Darkness")) {
|
||||
checkCard.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId());
|
||||
return true;
|
||||
if (selectedCard == null
|
||||
&& controller.chooseUse(Outcome.Benefit, "Do you want to search your hand for Scion of Darkness?", source, game)) {
|
||||
TargetCardInHand target = new TargetCardInHand(0, 1, filter);
|
||||
if (controller.choose(Outcome.PutCardInPlay, controller.getHand(), target, game)) {
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
selectedCard = game.getCard(target.getFirstTarget());
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
// Library check
|
||||
boolean librarySearched = false;
|
||||
if (selectedCard == null
|
||||
&& controller.chooseUse(Outcome.Benefit, "Do you want to search your library for Scion of Darkness?", source, game)) {
|
||||
librarySearched = true;
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter);
|
||||
if (controller.searchLibrary(target, game)) {
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
selectedCard = game.getCard(target.getFirstTarget());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (selectedCard != null) {
|
||||
controller.moveCards(selectedCard, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
if (librarySearched) {
|
||||
controller.shuffleLibrary(source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,9 @@
|
|||
package mage.cards.d;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
@ -40,6 +42,8 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
||||
import mage.filter.predicate.mageobject.NamePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
@ -55,6 +59,8 @@ public class DoublingChant extends CardImpl {
|
|||
public DoublingChant(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{G}");
|
||||
|
||||
// For each creature you control, you may search your library for a creature card with the same name as that creature.
|
||||
// Put those cards onto the battlefield, then shuffle your library.
|
||||
this.getSpellAbility().addEffect(new DoublingChantEffect());
|
||||
}
|
||||
|
||||
|
@ -86,41 +92,43 @@ class DoublingChantEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
List<Card> chosenCards = new ArrayList<>();
|
||||
List<String> namesFiltered = new ArrayList<>();
|
||||
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
Set<Card> chosenCards = new HashSet<>();
|
||||
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game);
|
||||
for (Permanent creature : creatures) {
|
||||
final String creatureName = creature.getName();
|
||||
if (!namesFiltered.contains(creatureName)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Search for ").append(creatureName).append(" in your library?");
|
||||
|
||||
if (player.chooseUse(Outcome.PutCreatureInPlay, sb.toString(), source, game)) {
|
||||
FilterCreatureCard filter = new FilterCreatureCard("creature card named" + creatureName);
|
||||
filter.add(new NamePredicate(creatureName));
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
|
||||
if (player.searchLibrary(target, game)) {
|
||||
Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
chosenCards.add(card);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
namesFiltered.add(creatureName);
|
||||
}
|
||||
if (creatures.isEmpty()) {
|
||||
//9/22/2011: If you control no creatures when Doubling Chant resolves, you may still search your library and you must shuffle your library.
|
||||
if (controller.chooseUse(Outcome.PutCreatureInPlay, "Search in your library?", source, game)) {
|
||||
FilterCreatureCard filter = new FilterCreatureCard("nothing (no valid card available)");
|
||||
filter.add(new NamePredicate("creatureName"));
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter);
|
||||
controller.searchLibrary(target, game);
|
||||
}
|
||||
}
|
||||
for (Permanent creature : creatures) {
|
||||
final String creatureName = creature.getName();
|
||||
List<CardIdPredicate> uuidPredicates = new ArrayList<>();
|
||||
if (controller.chooseUse(Outcome.PutCreatureInPlay, "Search for " + creatureName + " in your library?", source, game)) {
|
||||
FilterCreatureCard filter = new FilterCreatureCard("creature card named " + creatureName);
|
||||
filter.add(new NamePredicate(creatureName));
|
||||
if (!uuidPredicates.isEmpty()) { // Prevent to select a card twice
|
||||
filter.add(Predicates.not(Predicates.or(uuidPredicates)));
|
||||
}
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
if (controller.searchLibrary(target, game)) {
|
||||
Card card = controller.getLibrary().getCard(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
chosenCards.add(card);
|
||||
uuidPredicates.add(new CardIdPredicate(card.getId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Card card : chosenCards) {
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId());
|
||||
}
|
||||
player.shuffleLibrary(source, game);
|
||||
controller.moveCards(chosenCards, Zone.BATTLEFIELD, source, game);
|
||||
controller.shuffleLibrary(source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,17 +39,16 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author noxx
|
||||
*/
|
||||
public class DreadSlaver extends CardImpl {
|
||||
|
||||
public DreadSlaver(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
|
||||
this.subtype.add(SubType.ZOMBIE);
|
||||
this.subtype.add(SubType.HORROR);
|
||||
|
||||
|
@ -88,10 +87,13 @@ class DreadSlaverEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
Card card = game.getCard(targetPointer.getFirst(game, source));
|
||||
if (card != null) {
|
||||
Zone currentZone = game.getState().getZone(card.getId());
|
||||
if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId())) {
|
||||
if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
|
||||
ContinuousEffect effect = new BecomesBlackZombieAdditionEffect();
|
||||
effect.setTargetPointer(new FixedTarget(card.getId()));
|
||||
game.addEffect(effect, source);
|
||||
|
|
|
@ -39,8 +39,6 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.SaprolingToken;
|
||||
import mage.game.permanent.token.TokenImpl;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
|
@ -80,27 +78,24 @@ class DruidicSatchelEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Card card = player.getLibrary().getFromTop(game);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
controller.revealCards(source, new CardsImpl(card), game);
|
||||
if (card.isCreature()) {
|
||||
Token token = new SaprolingToken();
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||
new SaprolingToken().putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||
}
|
||||
if (card.isLand()) {
|
||||
player.getLibrary().getCard(card.getId(), game);
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId());
|
||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
if (!card.isCreature() && !card.isLand()) {
|
||||
player.gainLife(2, game, source);
|
||||
controller.gainLife(2, game, source);
|
||||
}
|
||||
|
||||
Cards cards = new CardsImpl();
|
||||
cards.add(card);
|
||||
player.revealCards("Druidic Satchel", cards, game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -99,37 +99,37 @@ class EvershrikeEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
boolean exiled = true;
|
||||
Card evershrikeCard = game.getCard(source.getSourceId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
int xAmount = source.getManaCostsToPay().getX() + 1;
|
||||
if (evershrikeCard != null) {
|
||||
if (controller != null && evershrikeCard != null) {
|
||||
if (evershrikeCard.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false)) {
|
||||
int xAmount = source.getManaCostsToPay().getX() + 1;
|
||||
Permanent evershrikePermanent = game.getPermanent(source.getSourceId());
|
||||
if (evershrikePermanent == null) {
|
||||
return false;
|
||||
}
|
||||
boolean exileSource = true;
|
||||
FilterCard filterAuraCard = new FilterCard("Aura card with converted mana cost X or less from your hand");
|
||||
filterAuraCard.add(new CardTypePredicate(CardType.ENCHANTMENT));
|
||||
filterAuraCard.add(new SubtypePredicate(SubType.AURA));
|
||||
filterAuraCard.add(new AuraCardCanAttachToPermanentId(evershrikePermanent.getId()));
|
||||
filterAuraCard.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, xAmount));
|
||||
int count = controller.getHand().count(filterAuraCard, game);
|
||||
while (controller.canRespond() && count > 0 && controller.chooseUse(Outcome.Benefit, "Do you wish to put an Aura card from your hand onto Evershrike", source, game)) {
|
||||
if (count > 0 && controller.chooseUse(Outcome.Benefit, "Do you wish to put an Aura card from your hand onto " + evershrikeCard.getIdName() + "?", source, game)) {
|
||||
TargetCard targetAura = new TargetCard(Zone.HAND, filterAuraCard);
|
||||
if (controller.choose(Outcome.Benefit, controller.getHand(), targetAura, game)) {
|
||||
Card aura = game.getCard(targetAura.getFirstTarget());
|
||||
if (aura != null) {
|
||||
game.getState().setValue("attachTo:" + aura.getId(), evershrikePermanent);
|
||||
aura.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), controller.getId());
|
||||
evershrikePermanent.addAttachment(aura.getId(), game);
|
||||
exiled = false;
|
||||
count = controller.getHand().count(filterAuraCard, game);
|
||||
if (controller.moveCards(aura, Zone.BATTLEFIELD, source, game)) {
|
||||
evershrikePermanent.addAttachment(aura.getId(), game);
|
||||
}
|
||||
exileSource = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (exiled) {
|
||||
return evershrikePermanent.moveToExile(source.getSourceId(), "Evershrike Exile", source.getSourceId(), game);
|
||||
if (exileSource) {
|
||||
controller.moveCards(evershrikeCard, Zone.EXILED, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -132,20 +132,22 @@ class GateToTheAfterlifeEffect extends OneShotEffect {
|
|||
Card card = null;
|
||||
// Graveyard check
|
||||
if (controller.chooseUse(Outcome.Benefit, "Do you want to search your graveyard for " + cardName + "?", source, game)) {
|
||||
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(filter);
|
||||
if (controller.choose(Outcome.PutCardInPlay, controller.getGraveyard(), target, game)) {
|
||||
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(1, 1, filter, true);
|
||||
if (controller.choose(outcome, controller.getGraveyard(), target, game)) {
|
||||
card = game.getCard(target.getFirstTarget());
|
||||
}
|
||||
}
|
||||
// Hand check
|
||||
if (card == null && controller.chooseUse(Outcome.Benefit, "Do you want to search your hand for " + cardName + "?", source, game)) {
|
||||
TargetCardInHand target = new TargetCardInHand(filter);
|
||||
TargetCardInHand target = new TargetCardInHand(0, 1, filter);
|
||||
if (controller.choose(Outcome.PutCardInPlay, controller.getHand(), target, game)) {
|
||||
card = game.getCard(target.getFirstTarget());
|
||||
}
|
||||
}
|
||||
// Library check
|
||||
boolean librarySearched = false;
|
||||
if (card == null && controller.chooseUse(Outcome.Benefit, "Do you want to search your library for " + cardName + "?", source, game)) {
|
||||
librarySearched = true;
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
if (controller.searchLibrary(target, game)) {
|
||||
card = game.getCard(target.getFirstTarget());
|
||||
|
@ -155,6 +157,9 @@ class GateToTheAfterlifeEffect extends OneShotEffect {
|
|||
if (card != null) {
|
||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
if (librarySearched) {
|
||||
controller.shuffleLibrary(source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
/*
|
||||
* Copyright 2011 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
|
||||
|
@ -20,7 +20,7 @@
|
|||
* 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.
|
||||
|
@ -33,12 +33,12 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.abilities.effects.common.ExileSpellEffect;
|
||||
import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect.HandSizeModification;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
|
@ -49,8 +49,9 @@ import mage.players.Player;
|
|||
public class PraetorsCounsel extends CardImpl {
|
||||
|
||||
public PraetorsCounsel(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{5}{G}{G}{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{G}{G}{G}");
|
||||
|
||||
// Return all cards from your graveyard to your hand. Exile Praetor's Counsel. You have no maximum hand size for the rest of the game.
|
||||
this.getSpellAbility().addEffect(new PraetorsCounselEffect());
|
||||
this.getSpellAbility().addEffect(ExileSpellEffect.getInstance());
|
||||
this.getSpellAbility().addEffect(new MaximumHandSizeControllerEffect(Integer.MAX_VALUE, Duration.EndOfGame, HandSizeModification.SET));
|
||||
|
@ -85,11 +86,11 @@ class PraetorsCounselEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
for (Card card: player.getGraveyard().getCards(game)) {
|
||||
player.putInHand(card, game);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
controller.moveCards(controller.getGraveyard(), Zone.HAND, source, game);
|
||||
return true;
|
||||
}
|
||||
player.getGraveyard().clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,8 +31,6 @@ import java.io.Serializable;
|
|||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.sun.org.apache.xpath.internal.operations.Bool;
|
||||
import mage.MageObject;
|
||||
import mage.MageObjectReference;
|
||||
import mage.ObjectColor;
|
||||
|
@ -81,7 +79,6 @@ import mage.target.*;
|
|||
import mage.target.common.*;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
|
||||
import static org.mage.test.serverside.base.impl.CardTestPlayerAPIImpl.*;
|
||||
|
||||
/**
|
||||
|
@ -156,7 +153,7 @@ public class TestPlayer implements Player {
|
|||
|
||||
/**
|
||||
* @param maxCallsWithoutAction max number of priority passes a player may
|
||||
* have for this test (default = 100)
|
||||
* have for this test (default = 100)
|
||||
*/
|
||||
public void setMaxCallsWithoutAction(int maxCallsWithoutAction) {
|
||||
this.maxCallsWithoutAction = maxCallsWithoutAction;
|
||||
|
@ -751,7 +748,7 @@ public class TestPlayer implements Player {
|
|||
// Loop through players and validate can attack/block this turn
|
||||
UUID defenderId = null;
|
||||
//List<PlayerAction>
|
||||
for (Iterator<org.mage.test.player.PlayerAction> it = actions.iterator(); it.hasNext(); ) {
|
||||
for (Iterator<org.mage.test.player.PlayerAction> it = actions.iterator(); it.hasNext();) {
|
||||
PlayerAction action = it.next();
|
||||
if (action.getTurnNum() == game.getTurnNum() && action.getAction().startsWith("attack:")) {
|
||||
String command = action.getAction();
|
||||
|
@ -2404,7 +2401,7 @@ public class TestPlayer implements Player {
|
|||
|
||||
@Override
|
||||
public boolean choose(Outcome outcome, Target target,
|
||||
UUID sourceId, Game game
|
||||
UUID sourceId, Game game
|
||||
) {
|
||||
// needed to call here the TestPlayer because it's overwitten
|
||||
return choose(outcome, target, sourceId, game, null);
|
||||
|
@ -2412,7 +2409,7 @@ public class TestPlayer implements Player {
|
|||
|
||||
@Override
|
||||
public boolean choose(Outcome outcome, Cards cards,
|
||||
TargetCard target, Game game
|
||||
TargetCard target, Game game
|
||||
) {
|
||||
if (!choices.isEmpty()) {
|
||||
for (String choose2 : choices) {
|
||||
|
@ -2444,7 +2441,7 @@ public class TestPlayer implements Player {
|
|||
|
||||
@Override
|
||||
public boolean chooseTargetAmount(Outcome outcome, TargetAmount target,
|
||||
Ability source, Game game
|
||||
Ability source, Game game
|
||||
) {
|
||||
return computerPlayer.chooseTargetAmount(outcome, target, source, game);
|
||||
}
|
||||
|
@ -2457,15 +2454,15 @@ public class TestPlayer implements Player {
|
|||
|
||||
@Override
|
||||
public boolean choosePile(Outcome outcome, String message,
|
||||
List<? extends Card> pile1, List<? extends Card> pile2,
|
||||
Game game
|
||||
List<? extends Card> pile1, List<? extends Card> pile2,
|
||||
Game game
|
||||
) {
|
||||
return computerPlayer.choosePile(outcome, message, pile1, pile2, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean playMana(Ability ability, ManaCost unpaid,
|
||||
String promptText, Game game
|
||||
String promptText, Game game
|
||||
) {
|
||||
groupsForTargetHandling = null;
|
||||
return computerPlayer.playMana(ability, unpaid, promptText, game);
|
||||
|
@ -2479,15 +2476,15 @@ public class TestPlayer implements Player {
|
|||
|
||||
@Override
|
||||
public UUID chooseBlockerOrder(List<Permanent> blockers, CombatGroup combatGroup,
|
||||
List<UUID> blockerOrder, Game game
|
||||
List<UUID> blockerOrder, Game game
|
||||
) {
|
||||
return computerPlayer.chooseBlockerOrder(blockers, combatGroup, blockerOrder, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void assignDamage(int damage, List<UUID> targets,
|
||||
String singleTargetName, UUID sourceId,
|
||||
Game game
|
||||
String singleTargetName, UUID sourceId,
|
||||
Game game
|
||||
) {
|
||||
computerPlayer.assignDamage(damage, targets, singleTargetName, sourceId, game);
|
||||
}
|
||||
|
@ -2506,14 +2503,14 @@ public class TestPlayer implements Player {
|
|||
|
||||
@Override
|
||||
public void pickCard(List<Card> cards, Deck deck,
|
||||
Draft draft
|
||||
Draft draft
|
||||
) {
|
||||
computerPlayer.pickCard(cards, deck, draft);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean scry(int value, Ability source,
|
||||
Game game
|
||||
Game game
|
||||
) {
|
||||
// Don't scry at the start of the game.
|
||||
if (game.getTurnNum() == 1 && game.getStep() == null) {
|
||||
|
@ -2524,37 +2521,37 @@ public class TestPlayer implements Player {
|
|||
|
||||
@Override
|
||||
public boolean moveCards(Card card, Zone toZone,
|
||||
Ability source, Game game
|
||||
Ability source, Game game
|
||||
) {
|
||||
return computerPlayer.moveCards(card, toZone, source, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean moveCards(Card card, Zone toZone,
|
||||
Ability source, Game game,
|
||||
boolean tapped, boolean faceDown, boolean byOwner, List<UUID> appliedEffects
|
||||
Ability source, Game game,
|
||||
boolean tapped, boolean faceDown, boolean byOwner, List<UUID> appliedEffects
|
||||
) {
|
||||
return computerPlayer.moveCards(card, toZone, source, game, tapped, faceDown, byOwner, appliedEffects);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean moveCards(Cards cards, Zone toZone,
|
||||
Ability source, Game game
|
||||
Ability source, Game game
|
||||
) {
|
||||
return computerPlayer.moveCards(cards, toZone, source, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean moveCards(Set<Card> cards, Zone toZone,
|
||||
Ability source, Game game
|
||||
Ability source, Game game
|
||||
) {
|
||||
return computerPlayer.moveCards(cards, toZone, source, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean moveCards(Set<Card> cards, Zone toZone,
|
||||
Ability source, Game game,
|
||||
boolean tapped, boolean faceDown, boolean byOwner, List<UUID> appliedEffects
|
||||
Ability source, Game game,
|
||||
boolean tapped, boolean faceDown, boolean byOwner, List<UUID> appliedEffects
|
||||
) {
|
||||
return computerPlayer.moveCards(cards, toZone, source, game, tapped, faceDown, byOwner, appliedEffects);
|
||||
}
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
*/
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
|
||||
|
@ -37,14 +39,10 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.TokenImpl;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
|
|
@ -142,7 +142,7 @@ public class SpellsCostReductionAllEffect extends CostModificationEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
if (onlyControlled && abilityToModify.getControllerId().equals(source.getControllerId())) {
|
||||
if (onlyControlled && !abilityToModify.getControllerId().equals(source.getControllerId())) {
|
||||
return false;
|
||||
}
|
||||
if (abilityToModify instanceof SpellAbility) {
|
||||
|
|
|
@ -655,6 +655,15 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Don't use this in normal card code, it's for more internal use. Always
|
||||
* use the [Player].moveCards methods if possible for card movement of card
|
||||
* code.
|
||||
*
|
||||
* @param card
|
||||
* @param game
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean putInHand(Card card, Game game) {
|
||||
if (card.getOwnerId().equals(playerId)) {
|
||||
|
|
Loading…
Reference in a new issue