From 87c111a2531ec835cbd6123406aa4464f3d7c654 Mon Sep 17 00:00:00 2001 From: magenoxx Date: Tue, 8 May 2012 18:41:39 +0400 Subject: [PATCH] [AVR] 5 cards. Various fixes. --- .../java/mage/server/game/GameController.java | 2 +- .../mage/sets/avacynrestored/BloodArtist.java | 75 ++++++++++++++++++ .../avacynrestored/BloodflowConnoisseur.java | 74 +++++++++++++++++ .../sets/avacynrestored/CryptCreeper.java | 71 +++++++++++++++++ .../mage/sets/avacynrestored/DeathWind.java | 67 ++++++++++++++++ .../avacynrestored/DemonicTaskmaster.java | 79 +++++++++++++++++++ .../mage/sets/avacynrestored/MistRaven.java | 5 +- .../mage/sets/conflux/ScarlandThrinax.java | 5 +- .../BeginningOfUpkeepTriggeredAbility.java | 8 +- ...herCreatureYouControlTriggeredAbility.java | 4 +- ...ThisOrAnotherCreatureTriggeredAbility.java | 1 + .../effects/common/SacrificeEffect.java | 27 +++++-- 12 files changed, 406 insertions(+), 12 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/avacynrestored/BloodArtist.java create mode 100644 Mage.Sets/src/mage/sets/avacynrestored/BloodflowConnoisseur.java create mode 100644 Mage.Sets/src/mage/sets/avacynrestored/CryptCreeper.java create mode 100644 Mage.Sets/src/mage/sets/avacynrestored/DeathWind.java create mode 100644 Mage.Sets/src/mage/sets/avacynrestored/DemonicTaskmaster.java diff --git a/Mage.Server/src/main/java/mage/server/game/GameController.java b/Mage.Server/src/main/java/mage/server/game/GameController.java index a8d903b640..9d09c2c640 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameController.java +++ b/Mage.Server/src/main/java/mage/server/game/GameController.java @@ -611,7 +611,7 @@ public class GameController implements GameCallback { } if (!found) { // something wrong - it may cause game freezes - logger.warn("WARNING! GameController.sendMessage - couldn't find session for action execution."); + logger.warn("WARNING! GameController.sendMessage - couldn't find session for action execution. Player: " + player.getName()); } } } else { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/BloodArtist.java b/Mage.Sets/src/mage/sets/avacynrestored/BloodArtist.java new file mode 100644 index 0000000000..4252e15376 --- /dev/null +++ b/Mage.Sets/src/mage/sets/avacynrestored/BloodArtist.java @@ -0,0 +1,75 @@ +/* + * 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.avacynrestored; + +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesThisOrAnotherCreatureTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.cards.CardImpl; +import mage.target.Target; +import mage.target.TargetPlayer; + +import java.util.UUID; + +/** + * + * @author noxx + */ +public class BloodArtist extends CardImpl { + + public BloodArtist(UUID ownerId) { + super(ownerId, 86, "Blood Artist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "AVR"; + this.subtype.add("Vampire"); + + this.color.setBlack(true); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + // Whenever Blood Artist or another creature dies, target player loses 1 life and you gain 1 life. + Ability ability = new DiesThisOrAnotherCreatureTriggeredAbility(new LoseLifeTargetEffect(1), false); + ability.addEffect(new GainLifeEffect(1)); + Target target = new TargetPlayer(); + target.setRequired(true); + ability.addTarget(target); + this.addAbility(ability); + } + + public BloodArtist(final BloodArtist card) { + super(card); + } + + @Override + public BloodArtist copy() { + return new BloodArtist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/avacynrestored/BloodflowConnoisseur.java b/Mage.Sets/src/mage/sets/avacynrestored/BloodflowConnoisseur.java new file mode 100644 index 0000000000..42e3f9150e --- /dev/null +++ b/Mage.Sets/src/mage/sets/avacynrestored/BloodflowConnoisseur.java @@ -0,0 +1,74 @@ +/* + * 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.avacynrestored; + +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.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.counters.CounterType; +import mage.target.common.TargetControlledCreaturePermanent; + +import java.util.UUID; + +/** + * + * @author noxx + */ +public class BloodflowConnoisseur extends CardImpl { + + public BloodflowConnoisseur(UUID ownerId) { + super(ownerId, 87, "Bloodflow Connoisseur", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "AVR"; + this.subtype.add("Vampire"); + + this.color.setBlack(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Sacrifice a creature: Put a +1/+1 counter on Bloodflow Connoisseur. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl()); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + this.addAbility(ability); + } + + public BloodflowConnoisseur(final BloodflowConnoisseur card) { + super(card); + } + + @Override + public BloodflowConnoisseur copy() { + return new BloodflowConnoisseur(this); + } +} diff --git a/Mage.Sets/src/mage/sets/avacynrestored/CryptCreeper.java b/Mage.Sets/src/mage/sets/avacynrestored/CryptCreeper.java new file mode 100644 index 0000000000..00f245fb52 --- /dev/null +++ b/Mage.Sets/src/mage/sets/avacynrestored/CryptCreeper.java @@ -0,0 +1,71 @@ +/* + * 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.avacynrestored; + +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.common.SacrificeSourceCost; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.cards.CardImpl; +import mage.target.common.TargetCardInGraveyard; + +import java.util.UUID; + +/** + * @author noxx + */ +public class CryptCreeper extends CardImpl { + + public CryptCreeper(UUID ownerId) { + super(ownerId, 91, "Crypt Creeper", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "AVR"; + this.subtype.add("Zombie"); + + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Sacrifice Crypt Creeper: Exile target card from a graveyard. + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ExileTargetEffect(), new SacrificeSourceCost()); + ability.addTarget(new TargetCardInGraveyard()); + this.addAbility(ability); + } + + public CryptCreeper(final CryptCreeper card) { + super(card); + } + + @Override + public CryptCreeper copy() { + return new CryptCreeper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/avacynrestored/DeathWind.java b/Mage.Sets/src/mage/sets/avacynrestored/DeathWind.java new file mode 100644 index 0000000000..96e379d0c4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/avacynrestored/DeathWind.java @@ -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.avacynrestored; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author noxx + */ +public class DeathWind extends CardImpl { + + public DeathWind(UUID ownerId) { + super(ownerId, 93, "Death Wind", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{X}{B}"); + this.expansionSetCode = "AVR"; + + this.color.setBlack(true); + + // Target creature gets -X/-X until end of turn. + DynamicValue x = new SignInversionDynamicValue(new ManacostVariableValue()); + this.getSpellAbility().addEffect(new BoostTargetEffect(x, x, Constants.Duration.EndOfTurn, true)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public DeathWind(final DeathWind card) { + super(card); + } + + @Override + public DeathWind copy() { + return new DeathWind(this); + } +} diff --git a/Mage.Sets/src/mage/sets/avacynrestored/DemonicTaskmaster.java b/Mage.Sets/src/mage/sets/avacynrestored/DemonicTaskmaster.java new file mode 100644 index 0000000000..6e78af860e --- /dev/null +++ b/Mage.Sets/src/mage/sets/avacynrestored/DemonicTaskmaster.java @@ -0,0 +1,79 @@ +/* + * 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.avacynrestored; + +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.effects.common.SacrificeEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterControlledCreaturePermanent; + +import java.util.UUID; + +/** + * + * @author noxx + */ +public class DemonicTaskmaster extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a creature other than Demonic Taskmaster"); + + static { + filter.setAnother(true); + } + + public DemonicTaskmaster(UUID ownerId) { + super(ownerId, 95, "Demonic Taskmaster", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "AVR"; + this.subtype.add("Demon"); + + this.color.setBlack(true); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + this.addAbility(FlyingAbility.getInstance()); + + // At the beginning of your upkeep, sacrifice a creature other than Demonic Taskmaster. + Ability ability = new BeginningOfUpkeepTriggeredAbility(new SacrificeEffect(filter, 1, ""), Constants.TargetController.YOU, false); + this.addAbility(ability); + } + + public DemonicTaskmaster(final DemonicTaskmaster card) { + super(card); + } + + @Override + public DemonicTaskmaster copy() { + return new DemonicTaskmaster(this); + } +} diff --git a/Mage.Sets/src/mage/sets/avacynrestored/MistRaven.java b/Mage.Sets/src/mage/sets/avacynrestored/MistRaven.java index 97a32495b8..8eabffa152 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/MistRaven.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/MistRaven.java @@ -35,6 +35,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.target.Target; import mage.target.common.TargetCreaturePermanent; import java.util.UUID; @@ -59,7 +60,9 @@ public class MistRaven extends CardImpl { // When Mist Raven enters the battlefield, return target creature to its owner's hand. Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect()); - ability.addTarget(new TargetCreaturePermanent()); + Target target = new TargetCreaturePermanent(); + target.setRequired(true); + ability.addTarget(target); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/conflux/ScarlandThrinax.java b/Mage.Sets/src/mage/sets/conflux/ScarlandThrinax.java index 921b4938f3..3867cac300 100644 --- a/Mage.Sets/src/mage/sets/conflux/ScarlandThrinax.java +++ b/Mage.Sets/src/mage/sets/conflux/ScarlandThrinax.java @@ -28,7 +28,6 @@ package mage.sets.conflux; -import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.Constants.Zone; @@ -42,6 +41,8 @@ import mage.cards.CardImpl; import mage.counters.CounterType; import mage.target.common.TargetControlledCreaturePermanent; +import java.util.UUID; + /** * * @author Loki @@ -57,6 +58,8 @@ public class ScarlandThrinax extends CardImpl { this.subtype.add("Lizard"); this.power = new MageInt(2); this.toughness = new MageInt(2); + + // Sacrifice a creature: Put a +1/+1 counter on Scarland Thrinax. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new ManaCostsImpl()); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); this.addAbility(ability); diff --git a/Mage/src/mage/abilities/common/BeginningOfUpkeepTriggeredAbility.java b/Mage/src/mage/abilities/common/BeginningOfUpkeepTriggeredAbility.java index 877257bfa6..5dc9e91ecc 100644 --- a/Mage/src/mage/abilities/common/BeginningOfUpkeepTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/BeginningOfUpkeepTriggeredAbility.java @@ -34,7 +34,13 @@ public class BeginningOfUpkeepTriggeredAbility extends TriggeredAbilityImpl { protected FilterCreaturePermanent filter; @@ -24,6 +25,7 @@ public class DiesAnotherCreatureYouControlTriggeredAbility extends TriggeredAbil public DiesAnotherCreatureYouControlTriggeredAbility(DiesAnotherCreatureYouControlTriggeredAbility ability) { super(ability); + this.filter = ability.filter; } @Override diff --git a/Mage/src/mage/abilities/common/DiesThisOrAnotherCreatureTriggeredAbility.java b/Mage/src/mage/abilities/common/DiesThisOrAnotherCreatureTriggeredAbility.java index 7ee0d33fc5..b79ae404ae 100644 --- a/Mage/src/mage/abilities/common/DiesThisOrAnotherCreatureTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DiesThisOrAnotherCreatureTriggeredAbility.java @@ -24,6 +24,7 @@ public class DiesThisOrAnotherCreatureTriggeredAbility extends TriggeredAbilityI public DiesThisOrAnotherCreatureTriggeredAbility(DiesThisOrAnotherCreatureTriggeredAbility ability) { super(ability); + this.filter = ability.filter; } @Override diff --git a/Mage/src/mage/abilities/effects/common/SacrificeEffect.java b/Mage/src/mage/abilities/effects/common/SacrificeEffect.java index 847ba816a6..f0726ce2e9 100644 --- a/Mage/src/mage/abilities/effects/common/SacrificeEffect.java +++ b/Mage/src/mage/abilities/effects/common/SacrificeEffect.java @@ -27,7 +27,6 @@ */ package mage.abilities.effects.common; -import java.util.UUID; import mage.Constants.Outcome; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; @@ -40,6 +39,8 @@ import mage.players.Player; import mage.target.Target; import mage.target.common.TargetControlledPermanent; +import java.util.UUID; + /** * * @author maurer.it_at_gmail.com @@ -72,17 +73,20 @@ public class SacrificeEffect extends OneShotEffect{ @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(targetPointer.getFirst(source)); + if (player == null) { return false; } - //filter.setTargetController(TargetController.YOU); - int amount = count.calculate(game, source); - amount = Math.min(amount, game.getBattlefield().countAll(filter, player.getId())); - Target target = new TargetControlledPermanent(amount, amount, filter, false); + + int amount = count.calculate(game, source); + int realCount = game.getBattlefield().countAll(filter, player.getId()); + amount = Math.min(amount, realCount); + + Target target = new TargetControlledPermanent(amount, amount, filter, false); //A spell or ability could have removed the only legal target this player //had, if thats the case this ability should fizzle. - if (amount > 0 && target.canChoose(player.getId(), game)) { + if (amount > 0 && target.canChoose(source.getSourceId(), player.getId(), game)) { boolean abilityApplied = false; while (!target.isChosen() && target.canChoose(player.getId(), game)) { player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); @@ -112,7 +116,16 @@ public class SacrificeEffect extends OneShotEffect{ private void setText() { StringBuilder sb = new StringBuilder(); - sb.append(preText).append(" sacrifices ").append(count).append(" ").append(filter.getMessage()); + sb.append(preText); + if (preText.contains("player")) { + sb.append(" sacrifices "); + } else { + sb.append(" sacrifice "); + } + if (!count.toString().equals("1")) { + sb.append(count).append(" "); + } + sb.append(filter.getMessage()); staticText = sb.toString(); } }