mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 12:19:59 -08:00
Merge origin/master
This commit is contained in:
commit
6925bd6d7d
89 changed files with 1584 additions and 683 deletions
|
|
@ -37,6 +37,8 @@ import mage.constants.Layer;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherTargetPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
|
@ -54,8 +56,17 @@ public class ConsumeStrength extends CardImpl {
|
|||
|
||||
// Target creature gets +2/+2 until end of turn. Another target creature gets -2/-2 until end of turn.
|
||||
this.getSpellAbility().addEffect(new ConsumeStrengthEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(2));
|
||||
|
||||
FilterCreaturePermanent filter1 = new FilterCreaturePermanent("creature to get +2/+2");
|
||||
TargetCreaturePermanent target1 = new TargetCreaturePermanent(filter1);
|
||||
target1.setTargetTag(1);
|
||||
this.getSpellAbility().addTarget(target1);
|
||||
|
||||
FilterCreaturePermanent filter2 = new FilterCreaturePermanent("another creature to get -2/-2");
|
||||
filter2.add(new AnotherTargetPredicate(2));
|
||||
TargetCreaturePermanent target2 = new TargetCreaturePermanent(filter2);
|
||||
target2.setTargetTag(2);
|
||||
this.getSpellAbility().addTarget(target2);
|
||||
}
|
||||
|
||||
public ConsumeStrength(final ConsumeStrength card) {
|
||||
|
|
@ -91,7 +102,7 @@ class ConsumeStrengthEffect extends ContinuousEffectImpl {
|
|||
permanent.addPower(2);
|
||||
permanent.addToughness(2);
|
||||
}
|
||||
permanent = game.getPermanent(source.getTargets().get(0).getTargets().get(1));
|
||||
permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.addPower(-2);
|
||||
permanent.addToughness(-2);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ public class DreamFracture extends CardImpl {
|
|||
super(ownerId, 19, "Dream Fracture", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}{U}");
|
||||
this.expansionSetCode = "EVE";
|
||||
|
||||
|
||||
// Counter target spell. Its controller draws a card.
|
||||
this.getSpellAbility().addEffect(new DreamFractureEffect());
|
||||
this.getSpellAbility().addTarget(new TargetSpell());
|
||||
|
|
@ -73,7 +72,7 @@ class DreamFractureEffect extends OneShotEffect {
|
|||
|
||||
public DreamFractureEffect() {
|
||||
super(Outcome.Neutral);
|
||||
this.staticText = "Counter target spell. Its controller draws a card";
|
||||
this.staticText = "Counter target spell. Its controller draws a card";
|
||||
}
|
||||
|
||||
public DreamFractureEffect(final DreamFractureEffect effect) {
|
||||
|
|
@ -102,4 +101,4 @@ class DreamFractureEffect extends OneShotEffect {
|
|||
}
|
||||
return countered;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
52
Mage.Sets/src/mage/sets/fifthedition/LibraryOfLeng.java
Normal file
52
Mage.Sets/src/mage/sets/fifthedition/LibraryOfLeng.java
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* 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.fifthedition;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class LibraryOfLeng extends mage.sets.limitedbeta.LibraryOfLeng {
|
||||
|
||||
public LibraryOfLeng(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 387;
|
||||
this.expansionSetCode = "5ED";
|
||||
}
|
||||
|
||||
public LibraryOfLeng(final LibraryOfLeng card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LibraryOfLeng copy() {
|
||||
return new LibraryOfLeng(this);
|
||||
}
|
||||
}
|
||||
52
Mage.Sets/src/mage/sets/fourthedition/LibraryOfLeng.java
Normal file
52
Mage.Sets/src/mage/sets/fourthedition/LibraryOfLeng.java
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* 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.fourthedition;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class LibraryOfLeng extends mage.sets.limitedbeta.LibraryOfLeng {
|
||||
|
||||
public LibraryOfLeng(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 351;
|
||||
this.expansionSetCode = "4ED";
|
||||
}
|
||||
|
||||
public LibraryOfLeng(final LibraryOfLeng card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LibraryOfLeng copy() {
|
||||
return new LibraryOfLeng(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -56,7 +56,7 @@ public class Bioshift extends CardImpl {
|
|||
// Move any number of +1/+1 counters from target creature onto another target creature with the same controller.
|
||||
getSpellAbility().addEffect(new MoveCounterFromTargetToTargetEffect());
|
||||
getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (you take counters from)")));
|
||||
getSpellAbility().addTarget(new BioshiftSecondTargetPermanent());
|
||||
getSpellAbility().addTarget(new BioshiftSecondTargetCreaturePermanent());
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -113,14 +113,15 @@ class MoveCounterFromTargetToTargetEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
|
||||
class BioshiftSecondTargetPermanent extends TargetPermanent {
|
||||
class BioshiftSecondTargetCreaturePermanent extends TargetCreaturePermanent {
|
||||
|
||||
BioshiftSecondTargetPermanent() {
|
||||
super();
|
||||
this.filter = new FilterCreaturePermanent("another target creature with the same controller (counters go to)");
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another target creature with the same controller (counters go to)");
|
||||
|
||||
BioshiftSecondTargetCreaturePermanent() {
|
||||
super(filter);
|
||||
}
|
||||
|
||||
BioshiftSecondTargetPermanent(final BioshiftSecondTargetPermanent target) {
|
||||
BioshiftSecondTargetCreaturePermanent(final BioshiftSecondTargetCreaturePermanent target) {
|
||||
super(target);
|
||||
}
|
||||
|
||||
|
|
@ -137,7 +138,7 @@ class BioshiftSecondTargetPermanent extends TargetPermanent {
|
|||
}
|
||||
|
||||
@Override
|
||||
public BioshiftSecondTargetPermanent copy() {
|
||||
return new BioshiftSecondTargetPermanent(this);
|
||||
public BioshiftSecondTargetCreaturePermanent copy() {
|
||||
return new BioshiftSecondTargetCreaturePermanent(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ import mage.constants.Layer;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherTargetPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
|
@ -53,7 +55,17 @@ public class Schismotivate extends CardImpl {
|
|||
|
||||
// Target creature gets +4/+0 until end of turn. Another target creature gets -4/-0 until end of turn.
|
||||
this.getSpellAbility().addEffect(new SchismotivateEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(2));
|
||||
|
||||
FilterCreaturePermanent filter1 = new FilterCreaturePermanent("creature (gets +4/+0 until end of turn)");
|
||||
TargetCreaturePermanent target1 = new TargetCreaturePermanent(filter1);
|
||||
target1.setTargetTag(1);
|
||||
this.getSpellAbility().addTarget(target1);
|
||||
|
||||
FilterCreaturePermanent filter2 = new FilterCreaturePermanent("another creature (gets -4/-0 until end of turn)");
|
||||
filter2.add(new AnotherTargetPredicate(2));
|
||||
TargetCreaturePermanent target2 = new TargetCreaturePermanent(filter2);
|
||||
target2.setTargetTag(2);
|
||||
this.getSpellAbility().addTarget(target2);
|
||||
}
|
||||
|
||||
public Schismotivate(final Schismotivate card) {
|
||||
|
|
@ -88,7 +100,7 @@ class SchismotivateEffect extends ContinuousEffectImpl {
|
|||
if (permanent != null) {
|
||||
permanent.addPower(4);
|
||||
}
|
||||
permanent = game.getPermanent(source.getTargets().get(0).getTargets().get(1));
|
||||
permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.addPower(-4);
|
||||
}
|
||||
|
|
|
|||
121
Mage.Sets/src/mage/sets/legions/ElvishSoultiller.java
Normal file
121
Mage.Sets/src/mage/sets/legions/ElvishSoultiller.java
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
/*
|
||||
* 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.legions;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.choices.Choice;
|
||||
import mage.choices.ChoiceImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ElvishSoultiller extends CardImpl {
|
||||
|
||||
public ElvishSoultiller(UUID ownerId) {
|
||||
super(ownerId, 124, "Elvish Soultiller", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{G}");
|
||||
this.expansionSetCode = "LGN";
|
||||
this.subtype.add("Elf");
|
||||
this.subtype.add("Mutant");
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// When Elvish Soultiller dies, choose a creature type. Shuffle all creature cards of that type from your graveyard into your library.
|
||||
addAbility(new DiesTriggeredAbility(new ElvishSoultillerEffect()));
|
||||
|
||||
}
|
||||
|
||||
public ElvishSoultiller(final ElvishSoultiller card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElvishSoultiller copy() {
|
||||
return new ElvishSoultiller(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ElvishSoultillerEffect extends OneShotEffect {
|
||||
|
||||
public ElvishSoultillerEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "choose a creature type. Shuffle all creature cards of that type from your graveyard into your library";
|
||||
}
|
||||
|
||||
public ElvishSoultillerEffect(final ElvishSoultillerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElvishSoultillerEffect copy() {
|
||||
return new ElvishSoultillerEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (controller != null && mageObject != null) {
|
||||
Choice typeChoice = new ChoiceImpl(true);
|
||||
typeChoice.setMessage("Choose creature type");
|
||||
typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
|
||||
while (!controller.choose(outcome, typeChoice, game)) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!game.isSimulation()) {
|
||||
game.informPlayers(mageObject.getName() + ": " + controller.getLogName() + " has chosen " + typeChoice.getChoice());
|
||||
}
|
||||
Cards cardsToLibrary = new CardsImpl();
|
||||
FilterCreatureCard filter = new FilterCreatureCard();
|
||||
filter.add(new SubtypePredicate(typeChoice.getChoice()));
|
||||
cardsToLibrary.addAll(controller.getGraveyard().getCards(filter, source.getSourceId(), source.getControllerId(), game));
|
||||
controller.putCardsOnTopOfLibrary(cardsToLibrary, game, source, false);
|
||||
controller.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
52
Mage.Sets/src/mage/sets/limitedalpha/LibraryOfLeng.java
Normal file
52
Mage.Sets/src/mage/sets/limitedalpha/LibraryOfLeng.java
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* 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.limitedalpha;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class LibraryOfLeng extends mage.sets.limitedbeta.LibraryOfLeng {
|
||||
|
||||
public LibraryOfLeng(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 257;
|
||||
this.expansionSetCode = "LEA";
|
||||
}
|
||||
|
||||
public LibraryOfLeng(final LibraryOfLeng card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LibraryOfLeng copy() {
|
||||
return new LibraryOfLeng(this);
|
||||
}
|
||||
}
|
||||
149
Mage.Sets/src/mage/sets/limitedbeta/LibraryOfLeng.java
Normal file
149
Mage.Sets/src/mage/sets/limitedbeta/LibraryOfLeng.java
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
/*
|
||||
* 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.limitedbeta;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class LibraryOfLeng extends CardImpl {
|
||||
|
||||
public LibraryOfLeng(UUID ownerId) {
|
||||
super(ownerId, 259, "Library of Leng", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}");
|
||||
this.expansionSetCode = "LEB";
|
||||
|
||||
// You have no maximum hand size.
|
||||
Effect effect = new MaximumHandSizeControllerEffect(Integer.MAX_VALUE, Duration.WhileOnBattlefield, MaximumHandSizeControllerEffect.HandSizeModification.SET);
|
||||
addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||
|
||||
// If an effect causes you to discard a card, discard it, but you may put it on top of your library instead of into your graveyard.
|
||||
addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LibraryOfLengEffect()));
|
||||
|
||||
}
|
||||
|
||||
public LibraryOfLeng(final LibraryOfLeng card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LibraryOfLeng copy() {
|
||||
return new LibraryOfLeng(this);
|
||||
}
|
||||
}
|
||||
|
||||
class LibraryOfLengEffect extends ReplacementEffectImpl {
|
||||
|
||||
private UUID cardId;
|
||||
private int zoneChangeCounter;
|
||||
|
||||
public LibraryOfLengEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit);
|
||||
staticText = "If an effect causes you to discard a card, discard it, but you may put it on top of your library instead of into your graveyard";
|
||||
}
|
||||
|
||||
public LibraryOfLengEffect(final LibraryOfLengEffect effect) {
|
||||
super(effect);
|
||||
this.cardId = effect.cardId;
|
||||
this.zoneChangeCounter = effect.zoneChangeCounter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LibraryOfLengEffect copy() {
|
||||
return new LibraryOfLengEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType().equals(EventType.DISCARD_CARD)
|
||||
|| event.getType().equals(EventType.ZONE_CHANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType().equals(EventType.DISCARD_CARD)) {
|
||||
return event.getPlayerId().equals(source.getControllerId());
|
||||
}
|
||||
if (event.getType().equals(EventType.ZONE_CHANGE)) {
|
||||
if (event.getTargetId().equals(cardId) && game.getState().getZoneChangeCounter(event.getTargetId()) == zoneChangeCounter) {
|
||||
if (((ZoneChangeEvent) event).getFromZone().equals(Zone.HAND) && ((ZoneChangeEvent) event).getToZone().equals(Zone.GRAVEYARD)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType().equals(EventType.DISCARD_CARD)) {
|
||||
// only save card info
|
||||
Card card = game.getCard(event.getTargetId());
|
||||
if (card != null) {
|
||||
cardId = card.getId();
|
||||
zoneChangeCounter = game.getState().getZoneChangeCounter(cardId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (event.getType().equals(EventType.ZONE_CHANGE)) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Card card = game.getCard(event.getTargetId());
|
||||
if (controller != null && card != null) {
|
||||
cardId = null;
|
||||
zoneChangeCounter = 0;
|
||||
if (controller.chooseUse(outcome, "Put " + card.getIdName() + " on top of your library instead?", source, game)) {
|
||||
Cards cardsToLibrary = new CardsImpl(card);
|
||||
controller.putCardsOnTopOfLibrary(cardsToLibrary, game, source, false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -50,7 +50,6 @@ import mage.filter.predicate.permanent.AnotherPredicate;
|
|||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
* @author nantuko
|
||||
|
|
@ -87,8 +86,8 @@ public class AdaptiveAutomaton extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
class AdaptiveAutomatonAddSubtypeEffect extends ContinuousEffectImpl {
|
||||
|
||||
public AdaptiveAutomatonAddSubtypeEffect() {
|
||||
super(Duration.WhileOnBattlefield, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit);
|
||||
staticText = "{this} is the chosen type in addition to its other types";
|
||||
|
|
|
|||
54
Mage.Sets/src/mage/sets/masterseditioniv/LibraryOfLeng.java
Normal file
54
Mage.Sets/src/mage/sets/masterseditioniv/LibraryOfLeng.java
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* 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.masterseditioniv;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.Rarity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class LibraryOfLeng extends mage.sets.limitedbeta.LibraryOfLeng {
|
||||
|
||||
public LibraryOfLeng(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 211;
|
||||
this.expansionSetCode = "ME4";
|
||||
this.rarity = Rarity.COMMON;
|
||||
}
|
||||
|
||||
public LibraryOfLeng(final LibraryOfLeng card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LibraryOfLeng copy() {
|
||||
return new LibraryOfLeng(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -35,6 +35,8 @@ import mage.constants.CardType;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherTargetPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.Target;
|
||||
|
|
@ -53,8 +55,23 @@ public class IncrementalGrowth extends CardImpl {
|
|||
|
||||
// Put a +1/+1 counter on target creature, two +1/+1 counters on another target creature, and three +1/+1 counters on a third target creature.
|
||||
this.getSpellAbility().addEffect(new IncrementalGrowthEffect());
|
||||
Target target = new TargetCreaturePermanent(3,3);
|
||||
this.getSpellAbility().addTarget(target);
|
||||
|
||||
FilterCreaturePermanent filter1 = new FilterCreaturePermanent("creature (gets a +1/+1 counter)");
|
||||
TargetCreaturePermanent target1 = new TargetCreaturePermanent(filter1);
|
||||
target1.setTargetTag(1);
|
||||
this.getSpellAbility().addTarget(target1);
|
||||
|
||||
FilterCreaturePermanent filter2 = new FilterCreaturePermanent("another creature (gets two +1/+1 counter)");
|
||||
filter2.add(new AnotherTargetPredicate(2));
|
||||
TargetCreaturePermanent target2 = new TargetCreaturePermanent(filter2);
|
||||
target2.setTargetTag(2);
|
||||
this.getSpellAbility().addTarget(target2);
|
||||
|
||||
FilterCreaturePermanent filter3 = new FilterCreaturePermanent("another creature (gets three +1/+1 counters)");
|
||||
filter3.add(new AnotherTargetPredicate(3));
|
||||
TargetCreaturePermanent target3 = new TargetCreaturePermanent(filter3);
|
||||
target3.setTargetTag(3);
|
||||
this.getSpellAbility().addTarget(target3);
|
||||
}
|
||||
|
||||
public IncrementalGrowth(final IncrementalGrowth card) {
|
||||
|
|
@ -86,9 +103,9 @@ class IncrementalGrowthEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
int i = 0;
|
||||
for (UUID targetId : getTargetPointer().getTargets(game, source)) {
|
||||
for (Target target : source.getTargets()) {
|
||||
i++;
|
||||
Permanent creature = game.getPermanent(targetId);
|
||||
Permanent creature = game.getPermanent(target.getFirstTarget());
|
||||
if (creature != null) {
|
||||
creature.addCounters(CounterType.P1P1.createInstance(i), game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,15 +28,20 @@
|
|||
package mage.sets.newphyrexia;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherTargetPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.SecondTargetPointer;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -48,16 +53,20 @@ public class LeechingBite extends CardImpl {
|
|||
super(ownerId, 113, "Leeching Bite", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}");
|
||||
this.expansionSetCode = "NPH";
|
||||
|
||||
|
||||
// Target creature gets +1/+1 until end of turn. Another target creature gets -1/-1 until end of turn.
|
||||
Effect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn);
|
||||
effect.setText("Target creature gets +1/+1 until end of turn");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (getting the +1/+1 counter)")));
|
||||
effect = new BoostTargetEffect(-1, -1, Duration.EndOfTurn);
|
||||
effect.setText("Another target creature gets -1/-1 until end of turn");
|
||||
effect.setTargetPointer(new SecondTargetPointer());
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (getting the -1/-1 counter)")));
|
||||
this.getSpellAbility().addEffect(new LeechingBiteEffect());
|
||||
|
||||
FilterCreaturePermanent filter1 = new FilterCreaturePermanent("creature to get +1/+1");
|
||||
TargetCreaturePermanent target1 = new TargetCreaturePermanent(filter1);
|
||||
target1.setTargetTag(1);
|
||||
this.getSpellAbility().addTarget(target1);
|
||||
|
||||
FilterCreaturePermanent filter2 = new FilterCreaturePermanent("another creature to get -1/-1");
|
||||
filter2.add(new AnotherTargetPredicate(2));
|
||||
TargetCreaturePermanent target2 = new TargetCreaturePermanent(filter2);
|
||||
target2.setTargetTag(2);
|
||||
this.getSpellAbility().addTarget(target2);
|
||||
}
|
||||
|
||||
public LeechingBite(final LeechingBite card) {
|
||||
|
|
@ -69,3 +78,35 @@ public class LeechingBite extends CardImpl {
|
|||
return new LeechingBite(this);
|
||||
}
|
||||
}
|
||||
|
||||
class LeechingBiteEffect extends ContinuousEffectImpl {
|
||||
|
||||
public LeechingBiteEffect() {
|
||||
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
|
||||
this.staticText = "Target creature gets +1/+1 until end of turn. Another target creature gets -1/-1 until end of turn";
|
||||
}
|
||||
|
||||
public LeechingBiteEffect(final LeechingBiteEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LeechingBiteEffect copy() {
|
||||
return new LeechingBiteEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.addPower(1);
|
||||
permanent.addToughness(1);
|
||||
}
|
||||
permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.addPower(-1);
|
||||
permanent.addToughness(-1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
99
Mage.Sets/src/mage/sets/planarchaos/DismalFailure.java
Normal file
99
Mage.Sets/src/mage/sets/planarchaos/DismalFailure.java
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
/*
|
||||
* 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.planarchaos;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetSpell;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class DismalFailure extends CardImpl {
|
||||
|
||||
public DismalFailure(UUID ownerId) {
|
||||
super(ownerId, 39, "Dismal Failure", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}{U}");
|
||||
this.expansionSetCode = "PLC";
|
||||
|
||||
// Counter target spell. Its controller discards a card.
|
||||
this.getSpellAbility().addEffect(new DismalFailureEffect());
|
||||
this.getSpellAbility().addTarget(new TargetSpell());
|
||||
}
|
||||
|
||||
public DismalFailure(final DismalFailure card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DismalFailure copy() {
|
||||
return new DismalFailure(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DismalFailureEffect extends OneShotEffect {
|
||||
|
||||
public DismalFailureEffect() {
|
||||
super(Outcome.Neutral);
|
||||
this.staticText = "Counter target spell. Its controller discards a card";
|
||||
}
|
||||
|
||||
public DismalFailureEffect(final DismalFailureEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DismalFailureEffect copy() {
|
||||
return new DismalFailureEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
UUID targetId = source.getFirstTarget();
|
||||
Player controller = null;
|
||||
boolean countered = false;
|
||||
if (targetId != null) {
|
||||
controller = game.getPlayer(game.getControllerId(targetId));
|
||||
}
|
||||
if (targetId != null
|
||||
&& game.getStack().counter(targetId, source.getSourceId(), game)) {
|
||||
countered = true;
|
||||
}
|
||||
if (controller != null) {
|
||||
controller.discard(1, false, source, game);
|
||||
}
|
||||
return countered;
|
||||
}
|
||||
}
|
||||
|
|
@ -37,6 +37,8 @@ import mage.constants.Layer;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherTargetPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
|
@ -53,7 +55,17 @@ public class StealStrength extends CardImpl {
|
|||
|
||||
// Target creature gets +1/+1 until end of turn. Another target creature gets -1/-1 until end of turn.
|
||||
this.getSpellAbility().addEffect(new StealStrengthEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(2));
|
||||
|
||||
FilterCreaturePermanent filter1 = new FilterCreaturePermanent("creature (gets +1/+1 until end of turn)");
|
||||
TargetCreaturePermanent target1 = new TargetCreaturePermanent(filter1);
|
||||
target1.setTargetTag(1);
|
||||
this.getSpellAbility().addTarget(target1);
|
||||
|
||||
FilterCreaturePermanent filter2 = new FilterCreaturePermanent("another creature (gets -1/-1 until end of turn)");
|
||||
filter2.add(new AnotherTargetPredicate(2));
|
||||
TargetCreaturePermanent target2 = new TargetCreaturePermanent(filter2);
|
||||
target2.setTargetTag(2);
|
||||
this.getSpellAbility().addTarget(target2);
|
||||
}
|
||||
|
||||
public StealStrength(final StealStrength card) {
|
||||
|
|
@ -89,7 +101,7 @@ class StealStrengthEffect extends ContinuousEffectImpl {
|
|||
permanent.addPower(1);
|
||||
permanent.addToughness(1);
|
||||
}
|
||||
permanent = game.getPermanent(source.getTargets().get(0).getTargets().get(1));
|
||||
permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.addPower(-1);
|
||||
permanent.addToughness(-1);
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ import mage.constants.SubLayer;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherTargetPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
|
@ -54,7 +56,17 @@ public class RitesOfReaping extends CardImpl {
|
|||
|
||||
// Target creature gets +3/+3 until end of turn. Another target creature gets -3/-3 until end of turn.
|
||||
this.getSpellAbility().addEffect(new RitesOfReapingEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(2));
|
||||
|
||||
FilterCreaturePermanent filter1 = new FilterCreaturePermanent("creature (gets +3/+3 until end of turn)");
|
||||
TargetCreaturePermanent target1 = new TargetCreaturePermanent(filter1);
|
||||
target1.setTargetTag(1);
|
||||
this.getSpellAbility().addTarget(target1);
|
||||
|
||||
FilterCreaturePermanent filter2 = new FilterCreaturePermanent("another creature (gets -3/-3 until end of turn)");
|
||||
filter2.add(new AnotherTargetPredicate(2));
|
||||
TargetCreaturePermanent target2 = new TargetCreaturePermanent(filter2);
|
||||
target2.setTargetTag(2);
|
||||
this.getSpellAbility().addTarget(target2);
|
||||
}
|
||||
|
||||
public RitesOfReaping(final RitesOfReaping card) {
|
||||
|
|
@ -90,7 +102,7 @@ class RitesOfReapingEffect extends ContinuousEffectImpl {
|
|||
permanent.addPower(3);
|
||||
permanent.addToughness(3);
|
||||
}
|
||||
permanent = game.getPermanent(source.getTargets().get(0).getTargets().get(1));
|
||||
permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.addPower(-3);
|
||||
permanent.addToughness(-3);
|
||||
|
|
|
|||
52
Mage.Sets/src/mage/sets/revisededition/LibraryOfLeng.java
Normal file
52
Mage.Sets/src/mage/sets/revisededition/LibraryOfLeng.java
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* 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.revisededition;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class LibraryOfLeng extends mage.sets.limitedbeta.LibraryOfLeng {
|
||||
|
||||
public LibraryOfLeng(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 261;
|
||||
this.expansionSetCode = "3ED";
|
||||
}
|
||||
|
||||
public LibraryOfLeng(final LibraryOfLeng card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LibraryOfLeng copy() {
|
||||
return new LibraryOfLeng(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -31,9 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -42,7 +40,6 @@ import mage.constants.Rarity;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -94,14 +91,17 @@ class CragganwickCrematorEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
Player targetedPlayer = game.getPlayer(source.getFirstTarget());
|
||||
if (you != null && targetedPlayer != null) {
|
||||
Card discardedCard = targetedPlayer.discardOne(true, source, game);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
|
||||
if (controller != null) {
|
||||
Card discardedCard = controller.discardOne(true, source, game);
|
||||
if (discardedCard != null
|
||||
&& discardedCard.getCardType().contains(CardType.CREATURE)) {
|
||||
int damage = discardedCard.getPower().getValue();
|
||||
targetedPlayer.damage(damage, source.getSourceId(), game, false, true);
|
||||
Player targetedPlayer = game.getPlayer(source.getFirstTarget());
|
||||
if (targetedPlayer != null) {
|
||||
int damage = discardedCard.getPower().getValue();
|
||||
targetedPlayer.damage(damage, source.getSourceId(), game, false, true);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Rarity;
|
||||
import mage.counters.Counter;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherTargetPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
|
@ -47,7 +48,7 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
public class FateTransfer extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("target creature to move all counters from");
|
||||
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("target creature to move all counters to");
|
||||
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("another target creature to move all counters to");
|
||||
|
||||
public FateTransfer(UUID ownerId) {
|
||||
super(ownerId, 161, "Fate Transfer", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U/B}");
|
||||
|
|
@ -55,8 +56,15 @@ public class FateTransfer extends CardImpl {
|
|||
|
||||
// Move all counters from target creature onto another target creature.
|
||||
this.getSpellAbility().addEffect(new FateTransferEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter2));
|
||||
|
||||
TargetCreaturePermanent fromTarget = new TargetCreaturePermanent(filter);
|
||||
fromTarget.setTargetTag(1);
|
||||
this.getSpellAbility().addTarget(fromTarget);
|
||||
|
||||
TargetCreaturePermanent toTarget = new TargetCreaturePermanent(filter2);
|
||||
filter2.add(new AnotherTargetPredicate(2));
|
||||
toTarget.setTargetTag(2);
|
||||
this.getSpellAbility().addTarget(toTarget);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherTargetPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.Target;
|
||||
|
|
@ -53,8 +55,23 @@ public class IncrementalBlight extends CardImpl {
|
|||
|
||||
// Put a -1/-1 counter on target creature, two -1/-1 counters on another target creature, and three -1/-1 counters on a third target creature.
|
||||
this.getSpellAbility().addEffect(new IncrementalBlightEffect());
|
||||
Target target = new TargetCreaturePermanent(3,3);
|
||||
this.getSpellAbility().addTarget(target);
|
||||
|
||||
FilterCreaturePermanent filter1 = new FilterCreaturePermanent("creature (gets a -1/-1 counter)");
|
||||
TargetCreaturePermanent target1 = new TargetCreaturePermanent(filter1);
|
||||
target1.setTargetTag(1);
|
||||
this.getSpellAbility().addTarget(target1);
|
||||
|
||||
FilterCreaturePermanent filter2 = new FilterCreaturePermanent("another creature (gets two -1/-1 counters)");
|
||||
filter2.add(new AnotherTargetPredicate(2));
|
||||
TargetCreaturePermanent target2 = new TargetCreaturePermanent(filter2);
|
||||
target2.setTargetTag(2);
|
||||
this.getSpellAbility().addTarget(target2);
|
||||
|
||||
FilterCreaturePermanent filter3 = new FilterCreaturePermanent("another creature (gets three -1/-1 counters)");
|
||||
filter3.add(new AnotherTargetPredicate(3));
|
||||
TargetCreaturePermanent target3 = new TargetCreaturePermanent(filter3);
|
||||
target3.setTargetTag(3);
|
||||
this.getSpellAbility().addTarget(target3);
|
||||
}
|
||||
|
||||
public IncrementalBlight(final IncrementalBlight card) {
|
||||
|
|
@ -85,9 +102,9 @@ class IncrementalBlightEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
int i = 0;
|
||||
for (UUID targetId : getTargetPointer().getTargets(game, source)) {
|
||||
for (Target target : source.getTargets()) {
|
||||
i++;
|
||||
Permanent creature = game.getPermanent(targetId);
|
||||
Permanent creature = game.getPermanent(target.getFirstTarget());
|
||||
if (creature != null) {
|
||||
creature.addCounters(CounterType.M1M1.createInstance(i), game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ class RealmRazerEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
ExileZone exZone = game.getExile().getExileZone(source.getSourceId());
|
||||
if (exZone != null) {
|
||||
return controller.moveCards(exZone.getCards(game), Zone.BATTLEFIELD, source, game, true, false, false, null);
|
||||
return controller.moveCards(exZone.getCards(game), Zone.BATTLEFIELD, source, game, true, false, true, null);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
52
Mage.Sets/src/mage/sets/unlimitededition/LibraryOfLeng.java
Normal file
52
Mage.Sets/src/mage/sets/unlimitededition/LibraryOfLeng.java
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* 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.unlimitededition;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class LibraryOfLeng extends mage.sets.limitedbeta.LibraryOfLeng {
|
||||
|
||||
public LibraryOfLeng(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 258;
|
||||
this.expansionSetCode = "2ED";
|
||||
}
|
||||
|
||||
public LibraryOfLeng(final LibraryOfLeng card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LibraryOfLeng copy() {
|
||||
return new LibraryOfLeng(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -37,6 +37,8 @@ import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.constants.Duration;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherTargetPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
|
@ -54,10 +56,18 @@ public class FeralContest extends CardImpl {
|
|||
|
||||
// Put a +1/+1 counter on target creature you control.
|
||||
this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance()));
|
||||
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
|
||||
|
||||
TargetControlledCreaturePermanent target1 = new TargetControlledCreaturePermanent();
|
||||
target1.setTargetTag(1);
|
||||
this.getSpellAbility().addTarget(target1);
|
||||
|
||||
// Another target creature blocks it this turn if able.
|
||||
this.getSpellAbility().addEffect(new FeralContestEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature (must block this turn)");
|
||||
filter.add(new AnotherTargetPredicate(2));
|
||||
TargetCreaturePermanent target2 = new TargetCreaturePermanent(filter);
|
||||
target2.setTargetTag(2);
|
||||
this.getSpellAbility().addTarget(target2);
|
||||
}
|
||||
|
||||
public FeralContest(final FeralContest card) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue