Graveborn Muse

This commit is contained in:
Loki 2013-04-21 15:03:24 +12:00
parent a6076235a8
commit 6cce155252
3 changed files with 155 additions and 8 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.legions;
import java.util.UUID;
/**
*
* @author Loki
*/
public class GravebornMuse extends mage.sets.tenth.GravebornMuse {
public GravebornMuse(UUID ownerId) {
super(ownerId);
this.cardNumber = 73;
this.expansionSetCode = "LGN";
}
public GravebornMuse(final GravebornMuse card) {
super(card);
}
@Override
public GravebornMuse copy() {
return new GravebornMuse(this);
}
}

View file

@ -0,0 +1,80 @@
/*
* 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.tenth;
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.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.abilities.effects.common.LoseLifeSourceEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
* @author Loki
*/
public class GravebornMuse extends CardImpl<GravebornMuse> {
private static FilterControlledPermanent filter = new FilterControlledPermanent("Zombie you control");
static {
filter.add(new SubtypePredicate("Zombie"));
}
public GravebornMuse(UUID ownerId) {
super(ownerId, 145, "Graveborn Muse", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}");
this.expansionSetCode = "10E";
this.subtype.add("Zombie");
this.subtype.add("Spirit");
this.color.setBlack(true);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// At the beginning of your upkeep, you draw X cards and you lose X life, where X is the number of Zombies you control.
Ability ability = new BeginningOfUpkeepTriggeredAbility(new DrawCardControllerEffect(new PermanentsOnBattlefieldCount(filter)), Constants.TargetController.YOU, false);
ability.addEffect(new LoseLifeSourceEffect(new PermanentsOnBattlefieldCount(filter)));
this.addAbility(ability);
}
public GravebornMuse(final GravebornMuse card) {
super(card);
}
@Override
public GravebornMuse copy() {
return new GravebornMuse(this);
}
}

View file

@ -30,9 +30,13 @@ package mage.abilities.effects.common;
import mage.Constants.Outcome; import mage.Constants.Outcome;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import mage.util.CardUtil;
/** /**
* *
@ -40,21 +44,21 @@ import mage.players.Player;
*/ */
public class LoseLifeSourceEffect extends OneShotEffect<LoseLifeSourceEffect> { public class LoseLifeSourceEffect extends OneShotEffect<LoseLifeSourceEffect> {
protected int amount; protected DynamicValue amount;
public LoseLifeSourceEffect(int amount) { public LoseLifeSourceEffect(int amount) {
super(Outcome.Damage); this(new StaticValue(amount));
this.amount = amount;
staticText = "You lose " + Integer.toString(amount) + " life";
} }
public int getAmount() { public LoseLifeSourceEffect(DynamicValue amount) {
return amount; super(Outcome.Damage);
this.amount = amount;
setText();
} }
public LoseLifeSourceEffect(final LoseLifeSourceEffect effect) { public LoseLifeSourceEffect(final LoseLifeSourceEffect effect) {
super(effect); super(effect);
this.amount = effect.amount; this.amount = effect.amount.copy();
} }
@Override @Override
@ -66,10 +70,21 @@ public class LoseLifeSourceEffect extends OneShotEffect<LoseLifeSourceEffect> {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if (player != null) { if (player != null) {
player.loseLife(amount, game); player.loseLife(amount.calculate(game, source), game);
return true; return true;
} }
return false; return false;
} }
private void setText() {
StringBuilder sb = new StringBuilder();
sb.append("You lose ").append(CardUtil.numberToText(amount.toString())).append(" life");
String message = amount.getMessage();
if (message.length() > 0) {
sb.append(" for each ");
}
sb.append(message);
staticText = sb.toString();
}
} }