[ZEN] 5 cards

This commit is contained in:
North 2012-04-01 19:11:16 +03:00
parent 46cbaa0ce0
commit bb272d87b7
5 changed files with 538 additions and 0 deletions

View file

@ -0,0 +1,98 @@
/*
* 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.zendikar;
import java.util.Set;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.decorator.ConditionalContinousEffect;
import mage.abilities.effects.common.DiscardTargetEffect;
import mage.abilities.effects.common.continious.BoostSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.game.Game;
/**
*
* @author North
*/
public class GuulDrazSpecter extends CardImpl<GuulDrazSpecter> {
private static final String ruleText = "{this} gets +3/+3 as long as an opponent has no cards in hand";
public GuulDrazSpecter(UUID ownerId) {
super(ownerId, 92, "Guul Draz Specter", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}");
this.expansionSetCode = "ZEN";
this.subtype.add("Specter");
this.color.setBlack(true);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.addAbility(FlyingAbility.getInstance());
// Guul Draz Specter gets +3/+3 as long as an opponent has no cards in hand.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(
new BoostSourceEffect(3, 3, Duration.WhileOnBattlefield),
new GuulDrazSpecterCondition(),
ruleText)));
// Whenever Guul Draz Specter deals combat damage to a player, that player discards a card.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(1), false, true));
}
public GuulDrazSpecter(final GuulDrazSpecter card) {
super(card);
}
@Override
public GuulDrazSpecter copy() {
return new GuulDrazSpecter(this);
}
}
class GuulDrazSpecterCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
boolean result = false;
Set<UUID> opponents = game.getOpponents(source.getControllerId());
for (UUID opponentId : opponents) {
result |= game.getPlayer(opponentId).getHand().size() == 0;
}
return result;
}
}

View file

@ -0,0 +1,128 @@
/*
* 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.zendikar;
import java.util.List;
import java.util.UUID;
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.abilities.Ability;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.costs.mana.KickerManaCost;
import mage.abilities.decorator.ConditionalContinousEffect;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPlayer;
/**
*
* @author North
*/
public class MarshCasualties extends CardImpl<MarshCasualties> {
private static final String ruleText = "Creatures target player controls get -1/-1 until end of turn. If {this} was kicked, those creatures get -2/-2 until end of turn instead.";
public MarshCasualties(UUID ownerId) {
super(ownerId, 101, "Marsh Casualties", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{B}{B}");
this.expansionSetCode = "ZEN";
this.color.setBlack(true);
// Kicker {3}
this.getSpellAbility().addOptionalCost(new KickerManaCost("{3}"));
// Creatures target player controls get -1/-1 until end of turn. If Marsh Casualties was kicked, those creatures get -2/-2 until end of turn instead.
this.getSpellAbility().addEffect(new ConditionalContinousEffect(
new MarshCasualtiesEffect(-2, -2),
new MarshCasualtiesEffect(-1, -1),
KickedCondition.getInstance(),
ruleText));
this.getSpellAbility().addTarget(new TargetPlayer());
}
public MarshCasualties(final MarshCasualties card) {
super(card);
}
@Override
public MarshCasualties copy() {
return new MarshCasualties(this);
}
}
class MarshCasualtiesEffect extends ContinuousEffectImpl<MarshCasualtiesEffect> {
private int power;
private int toughness;
public MarshCasualtiesEffect(int power, int toughness) {
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
this.power = power;
this.toughness = toughness;
}
public MarshCasualtiesEffect(final MarshCasualtiesEffect effect) {
super(effect);
this.power = effect.power;
this.toughness = effect.toughness;
}
@Override
public MarshCasualtiesEffect copy() {
return new MarshCasualtiesEffect(this);
}
@Override
public void init(Ability source, Game game) {
super.init(source, game);
if (this.affectedObjectsSet) {
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget());
for (Permanent creature : creatures) {
objects.add(creature.getId());
}
}
}
@Override
public boolean apply(Game game, Ability source) {
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget());
for (Permanent creature : creatures) {
if (!this.affectedObjectsSet || objects.contains(creature.getId())) {
creature.addPower(power);
creature.addToughness(toughness);
}
}
return true;
}
}

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.zendikar;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author North
*/
public class MireBlight extends CardImpl<MireBlight> {
public MireBlight(UUID ownerId) {
super(ownerId, 104, "Mire Blight", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}");
this.expansionSetCode = "ZEN";
this.subtype.add("Aura");
this.color.setBlack(true);
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// When enchanted creature is dealt damage, destroy it.
this.addAbility(new MireBlightTriggeredAbility());
}
public MireBlight(final MireBlight card) {
super(card);
}
@Override
public MireBlight copy() {
return new MireBlight(this);
}
}
class MireBlightTriggeredAbility extends TriggeredAbilityImpl<MireBlightTriggeredAbility> {
public MireBlightTriggeredAbility() {
super(Zone.BATTLEFIELD, new DestroyTargetEffect());
}
public MireBlightTriggeredAbility(final MireBlightTriggeredAbility ability) {
super(ability);
}
@Override
public MireBlightTriggeredAbility copy() {
return new MireBlightTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
Permanent enchantment = game.getPermanent(sourceId);
UUID targetId = event.getTargetId();
if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId));
return true;
}
}
return false;
}
@Override
public String getRule() {
return "When enchanted creature is dealt damage, destroy it.";
}
}

View file

@ -0,0 +1,109 @@
/*
* 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.zendikar;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.DamagedCreatureEvent;
import mage.game.events.GameEvent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author North
*/
public class QuestForTheGemblades extends CardImpl<QuestForTheGemblades> {
public QuestForTheGemblades(UUID ownerId) {
super(ownerId, 177, "Quest for the Gemblades", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
this.expansionSetCode = "ZEN";
this.color.setGreen(true);
// Whenever a creature you control deals combat damage to a creature, you may put a quest counter on Quest for the Gemblades.
this.addAbility(new QuestForTheGembladesTriggeredAbility());
// Remove a quest counter from Quest for the Gemblades and sacrifice it: Put four +1/+1 counters on target creature.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new AddCountersTargetEffect(CounterType.P1P1.createInstance(4)),
new RemoveCountersSourceCost(CounterType.QUEST.createInstance()));
ability.addCost(new SacrificeSourceCost());
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
public QuestForTheGemblades(final QuestForTheGemblades card) {
super(card);
}
@Override
public QuestForTheGemblades copy() {
return new QuestForTheGemblades(this);
}
}
class QuestForTheGembladesTriggeredAbility extends TriggeredAbilityImpl<QuestForTheGembladesTriggeredAbility> {
public QuestForTheGembladesTriggeredAbility() {
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.QUEST.createInstance()), true);
}
public QuestForTheGembladesTriggeredAbility(final QuestForTheGembladesTriggeredAbility ability) {
super(ability);
}
@Override
public QuestForTheGembladesTriggeredAbility copy() {
return new QuestForTheGembladesTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getPlayerId().equals(controllerId)) {
if (((DamagedCreatureEvent) event).isCombatDamage()) {
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever a creature you control deals combat damage to a creature, " + super.getRule();
}
}

View file

@ -0,0 +1,90 @@
/*
* 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.zendikar;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.CreatureDiesTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.game.permanent.token.Token;
/**
*
* @author North
*/
public class QuestForTheGravelord extends CardImpl<QuestForTheGravelord> {
public QuestForTheGravelord(UUID ownerId) {
super(ownerId, 108, "Quest for the Gravelord", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}");
this.expansionSetCode = "ZEN";
this.color.setBlack(true);
// Whenever a creature dies, you may put a quest counter on Quest for the Gravelord.
this.addAbility(new CreatureDiesTriggeredAbility(new AddCountersSourceEffect(CounterType.QUEST.createInstance()), true));
// Remove three quest counters from Quest for the Gravelord and sacrifice it: Put a 5/5 black Zombie Giant creature token onto the battlefield.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new CreateTokenEffect(new ZombieToken()),
new RemoveCountersSourceCost(CounterType.QUEST.createInstance(3)));
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);
}
public QuestForTheGravelord(final QuestForTheGravelord card) {
super(card);
}
@Override
public QuestForTheGravelord copy() {
return new QuestForTheGravelord(this);
}
}
class ZombieToken extends Token {
public ZombieToken() {
super("Zombie Giant", "5/5 black Zombie Giant creature token");
cardType.add(CardType.CREATURE);
subtype.add("Zombie");
subtype.add("Giant");
color = ObjectColor.BLACK;
power = new MageInt(5);
toughness = new MageInt(5);
}
}