[ULG] 12 cards

This commit is contained in:
Plopman 2012-09-16 19:44:59 +02:00
parent a755c06772
commit 48874a770a
15 changed files with 1605 additions and 0 deletions

View 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.eighthedition;
import java.util.UUID;
/**
*
* @author Plopman
*/
public class DefenseGrid extends mage.sets.ninthedition.DefenseGrid {
public DefenseGrid(UUID ownerId) {
super(ownerId);
this.cardNumber = 296;
this.expansionSetCode = "8ED";
}
public DefenseGrid(final DefenseGrid card) {
super(card);
}
@Override
public DefenseGrid copy() {
return new DefenseGrid(this);
}
}

View file

@ -0,0 +1,100 @@
/*
* 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.ninthedition;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.CostModificationEffectImpl;
import mage.cards.CardImpl;
import mage.game.Game;
/**
*
* @author Plopman
*/
public class DefenseGrid extends CardImpl<DefenseGrid> {
public DefenseGrid(UUID ownerId) {
super(ownerId, 293, "Defense Grid", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}");
this.expansionSetCode = "9ED";
// Each spell costs {3} more to cast except during its controller's turn.
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new DefenseGridCostModificationEffect()));
}
public DefenseGrid(final DefenseGrid card) {
super(card);
}
@Override
public DefenseGrid copy() {
return new DefenseGrid(this);
}
}
class DefenseGridCostModificationEffect extends CostModificationEffectImpl<DefenseGridCostModificationEffect> {
DefenseGridCostModificationEffect ( ) {
super(Constants.Duration.WhileOnBattlefield, Constants.Outcome.Benefit);
staticText = "Each spell costs {3} more to cast except during its controller's turn";
}
DefenseGridCostModificationEffect(DefenseGridCostModificationEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source, Ability abilityToModify) {
SpellAbility spellAbility = (SpellAbility) abilityToModify;
spellAbility.getManaCostsToPay().add(new GenericManaCost(3));
return true;
}
@Override
public boolean applies(Ability abilityToModify, Ability source, Game game) {
if (abilityToModify instanceof SpellAbility) {
if(!abilityToModify.getControllerId().equals(game.getActivePlayerId())) {
return true;
}
}
return false;
}
@Override
public DefenseGridCostModificationEffect copy() {
return new DefenseGridCostModificationEffect(this);
}
}

View 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.seventhedition;
import java.util.UUID;
/**
*
* @author Plopman
*/
public class EngineeredPlague extends mage.sets.urzaslegacy.EngineeredPlague {
public EngineeredPlague(UUID ownerId) {
super(ownerId);
this.cardNumber = 133;
this.expansionSetCode = "7ED";
}
public EngineeredPlague(final EngineeredPlague card) {
super(card);
}
@Override
public EngineeredPlague copy() {
return new EngineeredPlague(this);
}
}

View 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.seventhedition;
import java.util.UUID;
/**
*
* @author Plopman
*/
public class GangOfElk extends mage.sets.urzaslegacy.GangOfElk {
public GangOfElk(UUID ownerId) {
super(ownerId);
this.cardNumber = 247;
this.expansionSetCode = "7ED";
}
public GangOfElk(final GangOfElk card) {
super(card);
}
@Override
public GangOfElk copy() {
return new GangOfElk(this);
}
}

View 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.urzaslegacy;
import java.util.UUID;
/**
*
* @author Plopman
*/
public class DefenseGrid extends mage.sets.ninthedition.DefenseGrid {
public DefenseGrid(UUID ownerId) {
super(ownerId);
this.cardNumber = 125;
this.expansionSetCode = "ULG";
}
public DefenseGrid(final DefenseGrid card) {
super(card);
}
@Override
public DefenseGrid copy() {
return new DefenseGrid(this);
}
}

View file

@ -0,0 +1,120 @@
/*
* 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.urzaslegacy;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.StaticAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continious.BoostAllEffect;
import mage.cards.CardImpl;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.sets.Sets;
/**
*
* @author Plopman
*/
public class EngineeredPlague extends CardImpl<EngineeredPlague> {
public EngineeredPlague(UUID ownerId) {
super(ownerId, 51, "Engineered Plague", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}");
this.expansionSetCode = "ULG";
this.color.setBlack(true);
FilterCreaturePermanent filter = new FilterCreaturePermanent("All creatures of the chosen type");
// As Engineered Plague enters the battlefield, choose a creature type.
this.addAbility(new AsEntersBattlefieldAbility(new EngineeredPlagueEntersBattlefieldEffect(filter), "choose a creature type"));
// All creatures of the chosen type get -1/-1.
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostAllEffect(-1, -1, Constants.Duration.WhileOnBattlefield, filter, false)));
}
public EngineeredPlague(final EngineeredPlague card) {
super(card);
}
@Override
public EngineeredPlague copy() {
return new EngineeredPlague(this);
}
class EngineeredPlagueEntersBattlefieldEffect extends OneShotEffect<EngineeredPlagueEntersBattlefieldEffect> {
private FilterCreaturePermanent filter;
public EngineeredPlagueEntersBattlefieldEffect(FilterCreaturePermanent filter) {
super(Constants.Outcome.Benefit);
this.filter = filter;
staticText = "As {this} enters the battlefield, choose a creature type";
}
public EngineeredPlagueEntersBattlefieldEffect(final EngineeredPlagueEntersBattlefieldEffect effect) {
super(effect);
this.filter = effect.filter;
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (player != null && permanent != null) {
Choice typeChoice = new ChoiceImpl(true);
typeChoice.setMessage("Choose creature type");
typeChoice.setChoices(Sets.getCreatureTypes());
while (!player.choose(Constants.Outcome.Detriment, typeChoice, game)) {
game.debugMessage("player canceled choosing type. retrying.");
}
game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + typeChoice.getChoice());
filter.add(new SubtypePredicate(typeChoice.getChoice()));
permanent.addInfo("chosen type", "<i>Chosen type: " + typeChoice.getChoice() + "</i>");
}
return false;
}
@Override
public EngineeredPlagueEntersBattlefieldEffect copy() {
return new EngineeredPlagueEntersBattlefieldEffect(this);
}
}
}

View file

@ -0,0 +1,67 @@
/*
* 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.urzaslegacy;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.common.BecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.effects.common.continious.BoostSourceEffect;
import mage.cards.CardImpl;
/**
*
* @author Plopman
*/
public class GangOfElk extends CardImpl<GangOfElk> {
public GangOfElk(UUID ownerId) {
super(ownerId, 102, "Gang of Elk", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{G}");
this.expansionSetCode = "ULG";
this.subtype.add("Elk");
this.subtype.add("Beast");
this.color.setGreen(true);
this.power = new MageInt(5);
this.toughness = new MageInt(4);
// Whenever Gang of Elk becomes blocked, it gets +2/+2 until end of turn for each creature blocking it.
this.addAbility(new BecomesBlockedByCreatureTriggeredAbility(new BoostSourceEffect(2, 2, Constants.Duration.EndOfTurn), false));
}
public GangOfElk(final GangOfElk card) {
super(card);
}
@Override
public GangOfElk copy() {
return new GangOfElk(this);
}
}

View file

@ -0,0 +1,162 @@
/*
* 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.urzaslegacy;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.effects.common.CounterTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterSpell;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.game.stack.StackObject;
import mage.target.Target;
import mage.target.TargetObject;
/**
*
* @author Plopman
*/
public class Intervene extends CardImpl<Intervene> {
public Intervene(UUID ownerId) {
super(ownerId, 33, "Intervene", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}");
this.expansionSetCode = "ULG";
this.color.setBlue(true);
// Counter target spell that targets a creature.
this.getSpellAbility().addTarget(new InterveneTargetSpell());
this.getSpellAbility().addEffect(new CounterTargetEffect());
}
public Intervene(final Intervene card) {
super(card);
}
@Override
public Intervene copy() {
return new Intervene(this);
}
private class InterveneTargetSpell extends TargetObject<InterveneTargetSpell> {
public InterveneTargetSpell() {
super(1, Constants.Zone.STACK);
this.targetName = "spell that targets a creature";
}
public InterveneTargetSpell(final InterveneTargetSpell target) {
super(target);
}
@Override
public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
return canChoose(sourceControllerId, game);
}
@Override
public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
return possibleTargets(sourceControllerId, game);
}
@Override
public boolean canTarget(UUID id, Ability source, Game game) {
if (super.canTarget(id, source, game)) {
if (targetsCreature(id, game)) {
return true;
}
}
return false;
}
@Override
public boolean canChoose(UUID sourceControllerId, Game game) {
for (StackObject stackObject : game.getStack()) {
if (stackObject instanceof Spell) {
if (targetsCreature(stackObject.getId(), game)) {
return true;
}
}
}
return false;
}
@Override
public Set<UUID> possibleTargets(UUID sourceControllerId, Game game) {
Set<UUID> possibleTargets = new HashSet<UUID>();
for (StackObject stackObject : game.getStack()) {
if (stackObject instanceof Spell) {
if (targetsCreature(stackObject.getId(), game)) {
possibleTargets.add(stackObject.getId());
}
}
}
return possibleTargets;
}
private boolean targetsCreature(UUID id, Game game) {
StackObject spell = game.getStack().getStackObject(id);
if (spell != null) {
Ability ability = spell.getStackAbility();
if (ability != null && !ability.getTargets().isEmpty()) {
for (Target target : ability.getTargets()) {
for (UUID targetId : target.getTargets()) {
Permanent permanent = game.getPermanent(targetId);
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) {
return true;
}
}
}
}
}
return false;
}
@Override
public InterveneTargetSpell copy() {
return new InterveneTargetSpell(this);
}
@Override
public Filter getFilter() {
return new FilterSpell();
}
}
}

View file

@ -0,0 +1,209 @@
/*
* 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.urzaslegacy;
import java.util.Iterator;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.delayed.AtTheEndOfTurnStepPostDelayedTriggeredAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.players.Player;
/**
*
* @author Plopman
*/
public class MemoryJar extends CardImpl<MemoryJar> {
public MemoryJar(UUID ownerId) {
super(ownerId, 129, "Memory Jar", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}");
this.expansionSetCode = "ULG";
// {tap}, Sacrifice Memory Jar: Each player exiles all cards from his or her hand face down and draws seven cards.
// At the beginning of the next end step, each player discards his or her hand and returns to his or her hand each
//card he or she exiled this way.
Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new MemoryJarEffect(), new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);
}
public MemoryJar(final MemoryJar card) {
super(card);
}
@Override
public MemoryJar copy() {
return new MemoryJar(this);
}
}
class MemoryJarEffect extends OneShotEffect<MemoryJarEffect> {
public MemoryJarEffect()
{
super(Outcome.DrawCard);
staticText = "Each player exiles all cards from his or her hand face down and draws seven cards. At the beginning of the next end step, each player discards his or her hand and returns to his or her hand each card he or she exiled this way.";
}
public MemoryJarEffect(final MemoryJarEffect effect)
{
super(effect);
}
@Override
public boolean apply(Game game, Ability source)
{
Cards cards = new CardsImpl();
//Exil hand
for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) {
Player player = game.getPlayer(playerId);
if (player != null)
{
Cards hand = player.getHand();
while (hand.size() > 0) {
Card card = hand.get(hand.iterator().next(), game);
if(card != null)
{
card.setFaceDown(true);
card.moveToExile(getId(), "Memory Jar", source.getSourceId(), game);
cards.add(card);
}
}
}
}
//Draw 7 cards
for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) {
Player player = game.getPlayer(playerId);
if (player != null)
{
player.drawCards(7, game);
}
}
//Delayed ability
Effect effect = new MemoryJarDelayedEffect();
effect.setValue("MemoryJarCards", cards);
DelayedTriggeredAbility delayedAbility = new MemoryJarDelayedTriggeredAbility(effect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}
@Override
public MemoryJarEffect copy() {
return new MemoryJarEffect(this);
}
}
class MemoryJarDelayedEffect extends OneShotEffect<MemoryJarDelayedEffect> {
public MemoryJarDelayedEffect()
{
super(Outcome.DrawCard);
staticText = "At the beginning of the next end step, each player discards his or her hand and returns to his or her hand each card he or she exiled this way.";
}
public MemoryJarDelayedEffect(final MemoryJarDelayedEffect effect)
{
super(effect);
}
@Override
public MemoryJarDelayedEffect copy() {
return new MemoryJarDelayedEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Cards cards = (Cards)this.getValue("MemoryJarCards");
if(cards != null)
{
//Discard
for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) {
Player player = game.getPlayer(playerId);
if (player != null)
{
player.discard(player.getHand().size(), source, game);
}
}
//Return to hand
for (Iterator<Card> it = cards.getCards(game).iterator(); it.hasNext();) {
Card card = it.next();
card.moveToZone(Constants.Zone.HAND, source.getSourceId(), game, true);
}
return true;
}
return false;
}
}
class MemoryJarDelayedTriggeredAbility extends DelayedTriggeredAbility<MemoryJarDelayedTriggeredAbility> {
public MemoryJarDelayedTriggeredAbility(Effect effect) {
super(effect);
}
public MemoryJarDelayedTriggeredAbility(final MemoryJarDelayedTriggeredAbility ability) {
super(ability);
}
@Override
public MemoryJarDelayedTriggeredAbility copy() {
return new MemoryJarDelayedTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == EventType.END_TURN_STEP_PRE) {
return true;
}
return false;
}
}

View file

@ -0,0 +1,176 @@
/*
* 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.urzaslegacy;
import java.util.List;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.CostImpl;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.counters.Counter;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreatureOrPlayer;
/**
*
* @author Plopman
*/
public class MoltenHydra extends CardImpl<MoltenHydra> {
public MoltenHydra(UUID ownerId) {
super(ownerId, 85, "Molten Hydra", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}");
this.expansionSetCode = "ULG";
this.subtype.add("Hydra");
this.color.setRed(true);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {1}{R}{R}: Put a +1/+1 counter on Molten Hydra.
this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), new ManaCostsImpl("{1}{R}{R}")));
// {tap}, Remove all +1/+1 counters from Molten Hydra: Molten Hydra deals damage to target creature or player equal to the number of +1/+1 counters removed this way.
Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(new MotltenHydraDynamicValue()), new TapSourceCost());
ability.addCost(new RemoveAllCountersSourceCost(CounterType.P1P1.createInstance()));
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
}
public MoltenHydra(final MoltenHydra card) {
super(card);
}
@Override
public MoltenHydra copy() {
return new MoltenHydra(this);
}
}
class RemoveAllCountersSourceCost extends CostImpl<RemoveAllCountersSourceCost> {
private int amount;
private String name;
public RemoveAllCountersSourceCost(Counter counter) {
this.name = counter.getName();
this.amount = counter.getCount();
this.text = "Remove all " + name + " counters from {this}";
}
public RemoveAllCountersSourceCost(RemoveAllCountersSourceCost cost) {
super(cost);
this.amount = cost.amount;
this.name = cost.name;
}
@Override
public boolean canPay(UUID sourceId, UUID controllerId, Game game) {
return true;
}
@Override
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
Permanent permanent = game.getPermanent(sourceId);
if (permanent != null) {
this.amount = permanent.getCounters().getCount(name);
permanent.removeCounters(name, amount, game);
this.paid = true;
}
else
{
this.amount = 0;
}
return paid;
}
@Override
public RemoveAllCountersSourceCost copy() {
return new RemoveAllCountersSourceCost(this);
}
public int getAmount() {
return amount;
}
}
class MotltenHydraDynamicValue implements DynamicValue {
public MotltenHydraDynamicValue() {
}
public MotltenHydraDynamicValue(final MotltenHydraDynamicValue dynamicValue) {
}
@Override
public int calculate(Game game, Ability source) {
int count = 0;
for(Cost cost : source.getCosts()){
if(cost instanceof RemoveAllCountersSourceCost){
count += ((RemoveAllCountersSourceCost)cost).getAmount();
}
}
return count;
}
@Override
public MotltenHydraDynamicValue clone() {
return new MotltenHydraDynamicValue(this);
}
@Override
public String toString() {
return "1";
}
@Override
public String getMessage() {
return "the number of +1/+1 counters removed this way";
}
}

View file

@ -0,0 +1,104 @@
/*
* 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.urzaslegacy;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
import mage.abilities.keyword.ShroudAbility;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author Plopman
*/
public class MultaniMaroSorcerer extends CardImpl<MultaniMaroSorcerer> {
public MultaniMaroSorcerer(UUID ownerId) {
super(ownerId, 107, "Multani, Maro-Sorcerer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}{G}");
this.expansionSetCode = "ULG";
this.supertype.add("Legendary");
this.subtype.add("Elemental");
this.color.setGreen(true);
this.power = new MageInt(0);
this.toughness = new MageInt(0);
// Shroud
this.addAbility(ShroudAbility.getInstance());
// Multani, Maro-Sorcerer's power and toughness are each equal to the total number of cards in all players' hands.
this.addAbility(new SimpleStaticAbility(Constants.Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInHandCount(), Constants.Duration.WhileOnBattlefield)));
}
public MultaniMaroSorcerer(final MultaniMaroSorcerer card) {
super(card);
}
@Override
public MultaniMaroSorcerer copy() {
return new MultaniMaroSorcerer(this);
}
}
class CardsInHandCount implements DynamicValue {
@Override
public int calculate(Game game, Ability sourceAbility) {
int count = 0;
for (UUID playerId: game.getPlayer(sourceAbility.getControllerId()).getInRange()) {
Player player = game.getPlayer(playerId);
if (player != null)
{
count += player.getHand().size();
}
}
return count;
}
@Override
public DynamicValue clone() {
return new CardsInHandCount();
}
@Override
public String getMessage() {
return "the total number of cards in all players' hands";
}
@Override
public String toString() {
return "1";
}
}

View file

@ -0,0 +1,106 @@
/*
* 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.urzaslegacy;
import java.util.Set;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.CyclingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.game.turn.TurnMod;
import mage.players.Player;
import mage.target.TargetPlayer;
/**
*
* @author Plopman
*/
public class Repopulate extends CardImpl<Repopulate> {
public Repopulate(UUID ownerId) {
super(ownerId, 111, "Repopulate", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}");
this.expansionSetCode = "ULG";
this.color.setGreen(true);
// Shuffle all creature cards from target player's graveyard into that player's library.
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new RepopulateEffect());
// Cycling {2}
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));
}
public Repopulate(final Repopulate card) {
super(card);
}
@Override
public Repopulate copy() {
return new Repopulate(this);
}
}
class RepopulateEffect extends OneShotEffect<RepopulateEffect> {
RepopulateEffect() {
super(Constants.Outcome.Benefit);
staticText = "Shuffle all creature cards from target player's graveyard into that player's library";
}
RepopulateEffect(final RepopulateEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getFirstTarget());
if (player != null) {
Set<Card> cards = player.getGraveyard().getCards(new FilterCreatureCard(), game);
for(Card card : cards)
{
card.moveToZone(Constants.Zone.LIBRARY, source.getId(), game, true);
}
player.shuffleLibrary(game);
return true;
}
return false;
}
@Override
public RepopulateEffect copy() {
return new RepopulateEffect(this);
}
}

View file

@ -0,0 +1,122 @@
/*
* 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.urzaslegacy;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterLandPermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author Plopman
*/
public class Rivalry extends CardImpl<Rivalry> {
public Rivalry(UUID ownerId) {
super(ownerId, 90, "Rivalry", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
this.expansionSetCode = "ULG";
this.color.setRed(true);
// At the beginning of each player's upkeep, if that player controls more lands than each other player, Rivalry deals 2 damage to him or her.
this.addAbility(new RivalryTriggeredAbility());
}
public Rivalry(final Rivalry card) {
super(card);
}
@Override
public Rivalry copy() {
return new Rivalry(this);
}
}
class RivalryTriggeredAbility extends TriggeredAbilityImpl<RivalryTriggeredAbility> {
private final static FilterPermanent filter = new FilterLandPermanent();
public RivalryTriggeredAbility() {
super(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(2), false);
}
public RivalryTriggeredAbility(final RivalryTriggeredAbility ability) {
super(ability);
}
@Override
public RivalryTriggeredAbility copy() {
return new RivalryTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) {
if (getTargets().size() == 0) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
}
return true;
}
return false;
}
@Override
public boolean checkInterveningIfClause(Game game) {
UUID player = game.getActivePlayerId();
int land = game.getBattlefield().countAll(filter, player, game);
if(player != null){
for(UUID opponent : game.getOpponents(player)){
if(land <= game.getBattlefield().countAll(filter, opponent, game)){
return false;
}
}
return true;
}
return false;
}
@Override
public String getRule() {
return "At the beginning of each player's upkeep, if that player controls more lands than each other player, Rivalry deals 2 damage to him or her.";
}
}

View file

@ -0,0 +1,113 @@
/*
* 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.urzaslegacy;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.Target;
/**
*
* @author Plopman
*/
public class TreefolkMystic extends CardImpl<TreefolkMystic> {
public TreefolkMystic(UUID ownerId) {
super(ownerId, 114, "Treefolk Mystic", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}");
this.expansionSetCode = "ULG";
this.subtype.add("Treefolk");
this.color.setGreen(true);
this.power = new MageInt(2);
this.toughness = new MageInt(4);
// Whenever Treefolk Mystic blocks or becomes blocked by a creature, destroy all Auras attached to that creature.
this.addAbility(new BlocksOrBecomesBlockedByCreatureTriggeredAbility(new TreefolkMysticEffect(), false));
}
public TreefolkMystic(final TreefolkMystic card) {
super(card);
}
@Override
public TreefolkMystic copy() {
return new TreefolkMystic(this);
}
}
class TreefolkMysticEffect extends OneShotEffect<TreefolkMysticEffect> {
public TreefolkMysticEffect() {
super(Constants.Outcome.DestroyPermanent);
}
public TreefolkMysticEffect(final TreefolkMysticEffect effect) {
super(effect);
}
@Override
public TreefolkMysticEffect copy() {
return new TreefolkMysticEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if(permanent != null)
{
for(UUID uuid : permanent.getAttachments())
{
Permanent aura = game.getPermanent(uuid);
if(aura != null && aura.getSubtype().contains("Aura"))
{
permanent.destroy(source.getId(), game, false);
}
}
}
return false;
}
@Override
public String getText(Mode mode) {
return "destroy all Auras attached to that creature";
}
}

View file

@ -0,0 +1,118 @@
/*
* 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.urzaslegacy;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetArtifactPermanent;
/**
*
* @author Plopman
*/
public class ViashinoHeretic extends CardImpl<ViashinoHeretic> {
public ViashinoHeretic(UUID ownerId) {
super(ownerId, 95, "Viashino Heretic", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}");
this.expansionSetCode = "ULG";
this.subtype.add("Viashino");
this.color.setRed(true);
this.power = new MageInt(1);
this.toughness = new MageInt(3);
// {1}{R}, {tap}: Destroy target artifact. Viashino Heretic deals damage to that artifact's controller equal to the artifact's converted mana cost.
Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ViashinoHereticEffect(), new ManaCostsImpl("{1}{R}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetArtifactPermanent());
this.addAbility(ability);
}
public ViashinoHeretic(final ViashinoHeretic card) {
super(card);
}
@Override
public ViashinoHeretic copy() {
return new ViashinoHeretic(this);
}
}
class ViashinoHereticEffect extends OneShotEffect<ViashinoHereticEffect> {
public ViashinoHereticEffect() {
super(Constants.Outcome.DestroyPermanent);
}
public ViashinoHereticEffect(final ViashinoHereticEffect effect) {
super(effect);
}
@Override
public ViashinoHereticEffect copy() {
return new ViashinoHereticEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if(permanent != null)
{
int couvertedManaCost = permanent.getManaCost().convertedManaCost();
Player player = game.getPlayer(permanent.getControllerId());
permanent.destroy(source.getId(), game, false);
if(player != null){
player.damage(couvertedManaCost, source.getId(), game, false, true);
}
return true;
}
return false;
}
@Override
public String getText(Mode mode) {
return "Destroy target artifact. Viashino Heretic deals damage to that artifact's controller equal to the artifact's converted mana cost";
}
}