[C14] Missing 3 black cards and some fixes to recently ommitted cards.

This commit is contained in:
LevelX2 2014-11-27 15:18:06 +01:00
parent 0694aedb50
commit 56e60db454
11 changed files with 396 additions and 34 deletions

View file

@ -60,7 +60,7 @@ public class DemonOfWailingAgonies extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Lieutenant - As long as you control your commander, Demon of Wailing Agonies gets +2/+2 and has "Whenever Demon of Wailing Agonies deals combat damage to a player, that player sacrifices a creature."
Ability gainedAbility = new DealsCombatDamageToAPlayerTriggeredAbility(new SacrificeEffect(new FilterControlledCreaturePermanent(), 1, "that player"), false, true);
Ability gainedAbility = new DealsCombatDamageToAPlayerTriggeredAbility(new SacrificeEffect(new FilterControlledCreaturePermanent("a creature"), 1, "that player"), false, true);
ContinuousEffect effect = new GainAbilitySourceEffect(gainedAbility);
effect.setText("and has \"Whenever {this} deals combat damage to a player, that player sacrifices a creature.\"");
this.addAbility(new LieutenantAbility(effect));

View file

@ -0,0 +1,91 @@
/*
* 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.commander2014;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.SacrificeCostCreaturesPower;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.permanent.token.ZombieToken;
import mage.target.common.TargetControlledCreaturePermanent;
/**
*
* @author LevelX2
*/
public class GhoulcallerGisa extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another creature");
static {
filter.add(new AnotherPredicate());
}
public GhoulcallerGisa(UUID ownerId) {
super(ownerId, 23, "Ghoulcaller Gisa", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
this.expansionSetCode = "C14";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.subtype.add("Wizard");
this.color.setBlack(true);
this.power = new MageInt(3);
this.toughness = new MageInt(4);
// {B}, {tap}, Sacrifice another creature: Put X 2/2 black Zombie creature tokens onto the battlefield, where X is the sacrificed creature's power.
DynamicValue xValue = new SacrificeCostCreaturesPower();
Effect effect = new CreateTokenEffect(new ZombieToken("C14"), xValue);
effect.setText("Put X 2/2 black Zombie creature tokens onto the battlefield, where X is the sacrificed creature's power");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{B}"));
ability.addCost(new TapSourceCost());
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter)));
this.addAbility(ability);
}
public GhoulcallerGisa(final GhoulcallerGisa card) {
super(card);
}
@Override
public GhoulcallerGisa copy() {
return new GhoulcallerGisa(this);
}
}

View file

@ -112,8 +112,10 @@ class NecromanticSelectionEffect extends OneShotEffect {
if (sourceObject != null && controller != null) {
Cards cards = new CardsImpl();
for(Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), source.getSourceId(), game)) {
cards.add(permanent);
controller.moveCardToGraveyardWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD);
permanent.destroy(source.getSourceId(), game, false);
if (game.getState().getZone(permanent.getId()).equals(Zone.GRAVEYARD)) {
cards.add(permanent);
}
}
FilterCard filter = new FilterCreatureCard("creature card put into a graveyard with " + sourceObject.getLogName());
ArrayList<Predicate<MageObject>> cardIdPredicates = new ArrayList<>();

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.commander2014;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.permanent.token.ZombieToken;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class OverseerOfTheDamned extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creature an opponent controls");
static {
filter.add(new ControllerPredicate(TargetController.OPPONENT));
filter.add(Predicates.not(new TokenPredicate()));
}
public OverseerOfTheDamned(UUID ownerId) {
super(ownerId, 28, "Overseer of the Damned", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}");
this.expansionSetCode = "C14";
this.subtype.add("Demon");
this.color.setBlack(true);
this.power = new MageInt(5);
this.toughness = new MageInt(5);
// Flying
this.addAbility(FlyingAbility.getInstance());
// When Overseer of the Damned enters the battlefield, you may destroy target creature.
Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), true);
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
// Whenever a nontoken creature an opponent controls dies, put a 2/2 black Zombie creature token onto the battlefield tapped.
this.addAbility(new DiesCreatureTriggeredAbility(new CreateTokenEffect(new ZombieToken("C14"), 1, true, false), false, filter));
}
public OverseerOfTheDamned(final OverseerOfTheDamned card) {
super(card);
}
@Override
public OverseerOfTheDamned copy() {
return new OverseerOfTheDamned(this);
}
}

View file

@ -0,0 +1,190 @@
/*
* 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.commander2014;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.RequirementEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author LevelX2
*/
public class RavingDead extends CardImpl {
public RavingDead(UUID ownerId) {
super(ownerId, 29, "Raving Dead", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}");
this.expansionSetCode = "C14";
this.subtype.add("Zombie");
this.color.setBlack(true);
this.power = new MageInt(2);
this.toughness = new MageInt(6);
// Deathtouch
this.addAbility(DeathtouchAbility.getInstance());
// At the beginning of combat on your turn, choose an opponent at random. Raving Dead attacks that player this combat if able.
this.addAbility(new BeginningOfCombatTriggeredAbility(new RavingDeadEffect(), TargetController.YOU, false));
// Whenever Raving Dead deals combat damage to a player, that player loses half his or her life, rounded down.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new RavingDeadDamageEffect(), false, true));
}
public RavingDead(final RavingDead card) {
super(card);
}
@Override
public RavingDead copy() {
return new RavingDead(this);
}
}
class RavingDeadEffect extends OneShotEffect {
public RavingDeadEffect() {
super(Outcome.Benefit);
this.staticText = "choose an opponent at random. {this} attacks that player this combat if able";
}
public RavingDeadEffect(final RavingDeadEffect effect) {
super(effect);
}
@Override
public RavingDeadEffect copy() {
return new RavingDeadEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Random random = new Random();
List<UUID> opponents = new ArrayList<>();
opponents.addAll(game.getOpponents(controller.getId()));
Player opponent = game.getPlayer(opponents.get(random.nextInt(opponents.size())));
if (opponent != null) {
ContinuousEffect effect = new AttacksIfAbleTargetPlayerSourceEffect();
effect.setTargetPointer(new FixedTarget(opponent.getId()));
game.addEffect(effect, source);
return true;
}
}
return false;
}
}
class RavingDeadDamageEffect extends OneShotEffect {
public RavingDeadDamageEffect() {
super(Outcome.Damage);
this.staticText = "that player loses half his or her life, rounded up";
}
public RavingDeadDamageEffect(final RavingDeadDamageEffect effect) {
super(effect);
}
@Override
public RavingDeadDamageEffect copy() {
return new RavingDeadDamageEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
if (player != null) {
Integer amount = (int) Math.ceil(player.getLife() / 2f);
if (amount > 0) {
player.loseLife(amount, game);
}
return true;
}
return false;
}
}
class AttacksIfAbleTargetPlayerSourceEffect extends RequirementEffect {
public AttacksIfAbleTargetPlayerSourceEffect() {
super(Duration.EndOfTurn);
staticText = "{this} attacks that player this combat if able";
}
public AttacksIfAbleTargetPlayerSourceEffect(final AttacksIfAbleTargetPlayerSourceEffect effect) {
super(effect);
}
@Override
public AttacksIfAbleTargetPlayerSourceEffect copy() {
return new AttacksIfAbleTargetPlayerSourceEffect(this);
}
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getSourceId())) {
return true;
}
return false;
}
@Override
public boolean mustAttack(Game game) {
return true;
}
@Override
public boolean mustBlock(Game game) {
return false;
}
@Override
public UUID mustAttackDefender(Ability source, Game game) {
return getTargetPointer().getFirst(game, source);
}
}

View file

@ -79,13 +79,9 @@ public class WakeTheDead extends CardImpl {
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability instanceof SpellAbility) {
for (Effect effect : ability.getEffects()) {
if (effect instanceof WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect) {
int xValue = new GetXValue().calculate(game, ability, null);
ability.getTargets().clear();
ability.addTarget(new TargetCardInYourGraveyard(xValue,xValue, new FilterCreatureCard("creature cards from your graveyard")));
}
}
int xValue = ability.getManaCostsToPay().getX();
ability.getTargets().clear();
ability.addTarget(new TargetCardInYourGraveyard(xValue,xValue, new FilterCreatureCard("creature cards from your graveyard")));
}
}

View file

@ -40,6 +40,7 @@ import mage.game.events.GameEvent.EventType;
import mage.target.TargetPlayer;
import java.util.UUID;
import mage.abilities.effects.Effect;
/**
*
@ -59,7 +60,9 @@ public class BloodgiftDemon extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// At the beginning of your upkeep, target player draws a card and loses 1 life.
Ability ability = new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new DrawCardTargetEffect(1), false);
ability.addEffect(new LoseLifeTargetEffect(1));
Effect effect = new LoseLifeTargetEffect(1);
effect.setText("and loses 1 life");
ability.addEffect(effect);
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
}

View file

@ -29,11 +29,12 @@
package mage.sets.magic2010;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardTargetEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.target.TargetPlayer;
/**
@ -46,9 +47,13 @@ public class SignInBlood extends CardImpl {
super(ownerId, 112, "Sign in Blood", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{B}{B}");
this.expansionSetCode = "M10";
this.color.setBlack(true);
// Target player draws two cards and loses 2 life.
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new DrawCardTargetEffect(2));
this.getSpellAbility().addEffect(new LoseLifeTargetEffect(2));
Effect effect = new LoseLifeTargetEffect(2);
effect.setText("and loses 2 life");
this.getSpellAbility().addEffect(effect);
}
public SignInBlood(final SignInBlood card) {

View file

@ -133,13 +133,13 @@ class QuietusSpikeEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(targetPointer.getFirst(game, source));
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
if (player != null) {
Integer amount = (int) Math.ceil(player.getLife() / 2f);
if (amount > 0) {
player.loseLife(amount, game);
return true;
}
return true;
}
return false;
}

View file

@ -119,7 +119,7 @@ public class ConditionalContinousEffect extends ContinuousEffectImpl {
@Override
public String getText(Mode mode) {
if (staticText == null || staticText.isEmpty() && this.effect != null) { // usefull for conditional night/day card abilities
if ((staticText == null || staticText.isEmpty()) && this.effect != null) { // usefull for conditional night/day card abilities
return effect.getText(mode);
}
return staticText;

View file

@ -86,8 +86,8 @@ import mage.constants.AsThoughEffectType;
import mage.constants.CardType;
import mage.constants.ManaType;
import mage.constants.Outcome;
import mage.constants.PlayerAction;
import mage.constants.PhaseStep;
import mage.constants.PlayerAction;
import mage.constants.RangeOfInfluence;
import mage.constants.SpellAbilityType;
import mage.constants.TimingRule;
@ -106,7 +106,6 @@ import mage.game.Game;
import mage.game.Table;
import mage.game.combat.CombatGroup;
import mage.game.command.CommandObject;
import mage.game.command.Commander;
import mage.game.events.DamagePlayerEvent;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
@ -2233,21 +2232,7 @@ public abstract class PlayerImpl implements Player, Serializable {
}
}
}
// // get cast commander if available
// if (!(this.getCommanderId() == null)) {
// Zone zone = game.getState().getZone(this.getCommanderId());
// if (zone != null && zone.equals(Zone.COMMAND)) {
// MageObject object = game.getObject(this.getCommanderId());
// if (object != null) {
// for (ActivatedAbility ability : ((Commander) object).getAbilities().getActivatedAbilities(Zone.COMMAND)) {
// if (canPlay(ability, availableMana, object, game)) {
// playableActivated.put(ability.toString(), ability);
// }
// }
// }
// }
// }
// activated abilities from objects in the command zone
// activated abilities from objects in the command zone (emblems or commanders)
for (CommandObject commandObject: game.getState().getCommand()) {
for (ActivatedAbility ability: commandObject.getAbilities().getActivatedAbilities(Zone.COMMAND)) {
if (ability.getControllerId().equals(getId())