[DKA] Mikaeus, the Unhallowed; Tragic Slip

[M10] Polymorph; Sanguine Blood
This commit is contained in:
North 2012-03-22 22:34:33 +02:00
parent bcf3398185
commit 63e47b795a
5 changed files with 527 additions and 0 deletions

View file

@ -0,0 +1,123 @@
/*
* 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.darkascension;
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.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.continious.BoostControlledEffect;
import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
import mage.abilities.keyword.IntimidateAbility;
import mage.abilities.keyword.UndyingAbility;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author North
*/
public class MikaeusTheUnhallowed extends CardImpl<MikaeusTheUnhallowed> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Human creatures");
static {
filter.getSubtype().add("Human");
filter.setNotSubtype(true);
}
public MikaeusTheUnhallowed(UUID ownerId) {
super(ownerId, 70, "Mikaeus, the Unhallowed", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}");
this.expansionSetCode = "DKA";
this.supertype.add("Legendary");
this.subtype.add("Zombie");
this.subtype.add("Cleric");
this.color.setBlack(true);
this.power = new MageInt(5);
this.toughness = new MageInt(5);
this.addAbility(IntimidateAbility.getInstance());
// Whenever a Human deals damage to you, destroy it.
this.addAbility(new MikaeusTheUnhallowedAbility());
// Other non-Human creatures you control get +1/+1 and have undying.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, true)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new UndyingAbility(), Duration.WhileOnBattlefield, filter, true)));
}
public MikaeusTheUnhallowed(final MikaeusTheUnhallowed card) {
super(card);
}
@Override
public MikaeusTheUnhallowed copy() {
return new MikaeusTheUnhallowed(this);
}
}
class MikaeusTheUnhallowedAbility extends TriggeredAbilityImpl<MikaeusTheUnhallowedAbility> {
public MikaeusTheUnhallowedAbility() {
super(Zone.BATTLEFIELD, new DestroyTargetEffect());
}
public MikaeusTheUnhallowedAbility(final MikaeusTheUnhallowedAbility ability) {
super(ability);
}
@Override
public MikaeusTheUnhallowedAbility copy() {
return new MikaeusTheUnhallowedAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getTargetId().equals(this.controllerId)) {
Permanent permanent = game.getPermanent(event.getSourceId());
if (permanent != null && permanent.hasSubtype("Human")) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever a Human deals damage to you, destroy it.";
}
}

View file

@ -0,0 +1,123 @@
/*
* 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.darkascension;
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.Condition;
import mage.abilities.condition.common.MorbidCondition;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.continious.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author North
*/
public class TragicSlip extends CardImpl<TragicSlip> {
public TragicSlip(UUID ownerId) {
super(ownerId, 76, "Tragic Slip", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}");
this.expansionSetCode = "DKA";
this.color.setBlack(true);
// Target creature gets -1/-1 until end of turn.
// Morbid - That creature gets -13/-13 until end of turn instead if a creature died this turn.
this.getSpellAbility().addEffect(new TragicSlipEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}
public TragicSlip(final TragicSlip card) {
super(card);
}
@Override
public TragicSlip copy() {
return new TragicSlip(this);
}
}
class TragicSlipEffect extends ContinuousEffectImpl<TragicSlipEffect> {
private ContinuousEffect effect;
private ContinuousEffect otherwiseEffect;
private Condition condition;
public TragicSlipEffect() {
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
this.effect = new BoostTargetEffect(-13, -13, Duration.EndOfTurn);
this.otherwiseEffect = new BoostTargetEffect(-1, -1, Duration.EndOfTurn);
this.condition = MorbidCondition.getInstance();
this.staticText = "Target creature gets -1/-1 until end of turn. Morbid - That creature gets -13/-13 until end of turn instead if a creature died this turn.";
}
public TragicSlipEffect(final TragicSlipEffect effect) {
super(effect);
this.effect = effect.effect;
this.otherwiseEffect = effect.otherwiseEffect;
this.condition = effect.condition;
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
if (condition.apply(game, source)) {
return effect.apply(layer, sublayer, source, game);
} else {
return otherwiseEffect.apply(layer, sublayer, source, game);
}
}
@Override
public boolean apply(Game game, Ability source) {
if (condition.apply(game, source)) {
return effect.apply(game, source);
} else {
return otherwiseEffect.apply(game, source);
}
}
@Override
public boolean hasLayer(Layer layer) {
return effect.hasLayer(layer);
}
@Override
public TragicSlipEffect copy() {
return new TragicSlipEffect(this);
}
}

View file

@ -0,0 +1,131 @@
/*
* 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.magic2010;
import java.util.Set;
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.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Library;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author North
*/
public class Polymorph extends CardImpl<Polymorph> {
public Polymorph(UUID ownerId) {
super(ownerId, 67, "Polymorph", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}");
this.expansionSetCode = "M10";
this.color.setBlue(true);
// Destroy target creature. It can't be regenerated.
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new DestroyTargetEffect(true));
// Its controller reveals cards from the top of his or her library until he or she reveals a creature card.
// The player puts that card onto the battlefield, then shuffles all other cards revealed this way into his or her library.
this.getSpellAbility().addEffect(new PolymorphEffect());
}
public Polymorph(final Polymorph card) {
super(card);
}
@Override
public Polymorph copy() {
return new Polymorph(this);
}
}
class PolymorphEffect extends OneShotEffect<PolymorphEffect> {
public PolymorphEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "Its controller reveals cards from the top of his or her library until he or she reveals a creature card. The player puts that card onto the battlefield, then shuffles all other cards revealed this way into his or her library";
}
public PolymorphEffect(final PolymorphEffect effect) {
super(effect);
}
@Override
public PolymorphEffect copy() {
return new PolymorphEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
}
if (permanent != null) {
Player player = game.getPlayer(permanent.getControllerId());
if (player != null) {
Library library = player.getLibrary();
if (library.size() > 0) {
Cards cards = new CardsImpl();
Card card = library.removeFromTop(game);
cards.add(card);
while (!card.getCardType().contains(CardType.CREATURE) && library.size() > 0) {
card = library.removeFromTop(game);
cards.add(card);
}
if (card.getCardType().contains(CardType.CREATURE)) {
card.putOntoBattlefield(game, Zone.PICK, source.getId(), player.getId());
}
if (cards.size() > 0) {
player.revealCards("Polymorph", cards, game);
Set<Card> cardsToShuffle = cards.getCards(game);
cardsToShuffle.remove(card);
library.addAll(cardsToShuffle, game);
}
}
return true;
}
}
return false;
}
}

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.magic2010;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.common.TargetOpponent;
/**
*
* @author North
*/
public class SanguineBond extends CardImpl<SanguineBond> {
public SanguineBond(UUID ownerId) {
super(ownerId, 111, "Sanguine Bond", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}");
this.expansionSetCode = "M10";
this.color.setBlack(true);
// Whenever you gain life, target opponent loses that much life.
SanguineBondTriggeredAbility ability = new SanguineBondTriggeredAbility();
ability.addTarget(new TargetOpponent());
this.addAbility(ability);
}
public SanguineBond(final SanguineBond card) {
super(card);
}
@Override
public SanguineBond copy() {
return new SanguineBond(this);
}
}
class SanguineBondTriggeredAbility extends TriggeredAbilityImpl<SanguineBondTriggeredAbility> {
public SanguineBondTriggeredAbility() {
super(Zone.BATTLEFIELD, null);
}
public SanguineBondTriggeredAbility(final SanguineBondTriggeredAbility ability) {
super(ability);
}
@Override
public SanguineBondTriggeredAbility copy() {
return new SanguineBondTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.GAINED_LIFE && event.getPlayerId().equals(this.controllerId)) {
this.getEffects().clear();
this.addEffect(new LoseLifeTargetEffect(event.getAmount()));
return true;
}
return false;
}
@Override
public String getRule() {
return "Whenever you gain life, target opponent loses that much life.";
}
}

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.ninthedition;
import java.util.UUID;
/**
*
* @author North
*/
public class Polymorph extends mage.sets.magic2010.Polymorph {
public Polymorph(UUID ownerId) {
super(ownerId);
this.cardNumber = 90;
this.expansionSetCode = "9ED";
}
public Polymorph(final Polymorph card) {
super(card);
}
@Override
public Polymorph copy() {
return new Polymorph(this);
}
}