diff --git a/Mage.Common/src/mage/view/GameView.java b/Mage.Common/src/mage/view/GameView.java index 680f8f1b07..4672c57848 100644 --- a/Mage.Common/src/mage/view/GameView.java +++ b/Mage.Common/src/mage/view/GameView.java @@ -71,7 +71,7 @@ public class GameView implements Serializable { if (object != null) stack.put(stackObject.getId(), new StackAbilityView((StackAbility)stackObject, object.getName())); else - stack.put(null, new StackAbilityView((StackAbility)stackObject, "")); + stack.put(stackObject.getId(), new StackAbilityView((StackAbility)stackObject, "")); } else { stack.put(stackObject.getId(), new CardView((Spell)stackObject)); diff --git a/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index 8d83ec452a..d62c29862d 100644 --- a/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -46,6 +46,7 @@ import mage.MageObject; import mage.abilities.Ability; import mage.abilities.ActivatedAbility; import mage.abilities.SpecialAction; +import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.VariableManaCost; import mage.cards.decks.Deck; @@ -434,16 +435,18 @@ public class HumanPlayer extends PlayerImpl { protected void activateAbility(Map abilities, Game game) { if (abilities.size() == 1) { - activateAbility(abilities.values().iterator().next(), game); - } - else { - game.fireGetChoiceEvent(playerId, name, abilities.values()); - waitForResponse(); - if (response.getUUID() != null) { - if (abilities.containsKey(response.getUUID())) - activateAbility(abilities.get(response.getUUID()), game); + ActivatedAbility ability = abilities.values().iterator().next(); + if (ability.getTargets().size() != 0 || !(ability.getCosts().size() == 1 && ability.getCosts().get(0) instanceof SacrificeSourceCost)) { + activateAbility(ability, game); + return; } } + game.fireGetChoiceEvent(playerId, name, abilities.values()); + waitForResponse(); + if (response.getUUID() != null) { + if (abilities.containsKey(response.getUUID())) + activateAbility(abilities.get(response.getUUID()), game); + } } @Override diff --git a/Mage.Server/plugins/mage-player-human.jar b/Mage.Server/plugins/mage-player-human.jar index e67ea7c419..f18a79a363 100644 Binary files a/Mage.Server/plugins/mage-player-human.jar and b/Mage.Server/plugins/mage-player-human.jar differ diff --git a/Mage/src/mage/abilities/mana/SimpleManaAbility.java b/Mage/src/mage/abilities/mana/SimpleManaAbility.java new file mode 100644 index 0000000000..173109a5b8 --- /dev/null +++ b/Mage/src/mage/abilities/mana/SimpleManaAbility.java @@ -0,0 +1,54 @@ +/* + * 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.abilities.mana; + +import mage.Constants.Zone; +import mage.abilities.costs.Cost; +import mage.abilities.effects.common.ManaEffect; + +/** + * + * @author BetaSteward_at_googlemail.com + */ +public class SimpleManaAbility extends ManaAbility { + + public SimpleManaAbility(Zone zone, ManaEffect effect, Cost cost) { + super(zone, effect, cost); + } + + public SimpleManaAbility(final SimpleManaAbility ability) { + super(ability); + } + + @Override + public SimpleManaAbility copy() { + return new SimpleManaAbility(this); + } + +} diff --git a/Mage/src/mage/game/permanent/token/EldraziSpawnToken.java b/Mage/src/mage/game/permanent/token/EldraziSpawnToken.java index 9987195a5b..2bec8bca1b 100644 --- a/Mage/src/mage/game/permanent/token/EldraziSpawnToken.java +++ b/Mage/src/mage/game/permanent/token/EldraziSpawnToken.java @@ -32,9 +32,9 @@ import mage.Constants.CardType; import mage.Constants.Zone; import mage.MageInt; import mage.Mana; -import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.effects.common.ManaEffect; +import mage.abilities.mana.SimpleManaAbility; /** * @@ -49,8 +49,7 @@ public class EldraziSpawnToken extends Token { subtype.add("Spawn"); power = new MageInt(0); toughness = new MageInt(1); - addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ManaEffect(Mana.ColorlessMana), new SacrificeSourceCost())); + addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new ManaEffect(Mana.ColorlessMana), new SacrificeSourceCost())); } - }