diff --git a/.gitignore b/.gitignore index ca422bd18c0..7d9b621e393 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ Mage.Server/cache Mage.Server/mageserver.log Mage.Server/magediag.log Mage.Sets/target +Mage.Stats/server.log Mage.Tests/target Mage.Tests/cache Mage.Tests/db @@ -64,6 +65,8 @@ nbactions-*.xml nb-configuration.xml glob:Mage.Client/cheat.dck glob:Mage.Client/test.dck +mage-bundle.zip +mage-stats-ws.war Mage.Server.Plugins/Mage.Draft.8PlayerBooster/target \.orig\..*$ diff --git a/Mage.Sets/src/mage/sets/dissension/InfernalTutor.java b/Mage.Sets/src/mage/sets/dissension/InfernalTutor.java index 55468700ae5..7ba18752271 100644 --- a/Mage.Sets/src/mage/sets/dissension/InfernalTutor.java +++ b/Mage.Sets/src/mage/sets/dissension/InfernalTutor.java @@ -28,6 +28,7 @@ package mage.sets.dissension; import java.util.UUID; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.condition.common.HellbentCondition; import mage.abilities.decorator.ConditionalOneShotEffect; @@ -41,6 +42,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.NamePredicate; import mage.game.Game; import mage.players.Player; import mage.target.Target; @@ -99,8 +101,8 @@ class InfernalTutorEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - Card sourceCard = game.getCard(source.getSourceId()); - if (controller != null) { + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller != null && sourceObject != null) { if (controller.getHand().size() > 0) { Card cardToReveal = null; if (controller.getHand().size() > 1) { @@ -112,11 +114,16 @@ class InfernalTutorEffect extends OneShotEffect { } else { cardToReveal = controller.getHand().getRandom(game); } + FilterCard filterCard; if (cardToReveal != null) { - controller.revealCards(sourceCard.getName(), new CardsImpl(cardToReveal), game); - FilterCard filterCard = new FilterCard(new StringBuilder("card named ").append(cardToReveal.getName()).toString()); - return new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filterCard), true, true).apply(game, source); - } + controller.revealCards("from hand :" + sourceObject.getName(), new CardsImpl(cardToReveal), game); + filterCard = new FilterCard("card named " + cardToReveal.getName()); + filterCard.add(new NamePredicate(cardToReveal.getName())); + } else { + filterCard = new FilterCard(); + } + return new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filterCard), true, true).apply(game, source); + } return true; } diff --git a/Mage.Sets/src/mage/sets/fatereforged/FrontierSiege.java b/Mage.Sets/src/mage/sets/fatereforged/FrontierSiege.java index b1be9dc0340..873b0d55e5e 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/FrontierSiege.java +++ b/Mage.Sets/src/mage/sets/fatereforged/FrontierSiege.java @@ -38,7 +38,6 @@ import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AddManaToManaPoolSourceControllerEffect; import mage.abilities.effects.common.ChooseModeEffect; -import mage.abilities.effects.common.FightTargetsEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; diff --git a/Mage.Sets/src/mage/sets/fatereforged/HoodedAssassin.java b/Mage.Sets/src/mage/sets/fatereforged/HoodedAssassin.java new file mode 100644 index 00000000000..521780e61f8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fatereforged/HoodedAssassin.java @@ -0,0 +1,88 @@ +/* + * 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.fatereforged; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.filter.common.FilterCreatureCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.WasDealtDamageThisTurnPredicate; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetOpponent; + +/** + * + * @author LevelX2 + */ +public class HoodedAssassin extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature that was dealt damage this turn"); + + static { + filter.add(new WasDealtDamageThisTurnPredicate()); + } + + public HoodedAssassin(UUID ownerId) { + super(ownerId, 73, "Hooded Assassin", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "FRF"; + this.subtype.add("Human"); + this.subtype.add("Assassin"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // When Hooded Assassin enters the battlefield, choose one - + // * Put a +1/+1 counter on Hooded Assassin. + Ability ability = new EntersBattlefieldTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false); + ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard"))); + // * Destroy target creature that was dealt damage this turn. + Mode mode = new Mode(); + mode.getEffects().add(new DestroyTargetEffect()); + mode.getTargets().add(new TargetCreaturePermanent(filter)); + ability.addMode(mode); + this.addAbility(ability); + } + + public HoodedAssassin(final HoodedAssassin card) { + super(card); + } + + @Override + public HoodedAssassin copy() { + return new HoodedAssassin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fatereforged/PalaceSiege.java b/Mage.Sets/src/mage/sets/fatereforged/PalaceSiege.java new file mode 100644 index 00000000000..3b153f3e251 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fatereforged/PalaceSiege.java @@ -0,0 +1,93 @@ +/* + * 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.fatereforged; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.common.ModeChoiceSourceCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.ChooseModeEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.LoseLifeOpponentsEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LevelX2 + */ +public class PalaceSiege extends CardImpl { + + private final static String ruleTrigger1 = "&bull Khans — At the beginning of your upkeep, return target creature card from your graveyard to your hand."; + private final static String ruleTrigger2 = "&bull Dragons — At the beginning of your upkeep, each opponent loses 2 life and you gain 2 life."; + + public PalaceSiege(UUID ownerId) { + super(ownerId, 79, "Palace Siege", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}"); + this.expansionSetCode = "FRF"; + + // As Palace Siege enters the battlefield, choose Khans or Dragons. + this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?","Khans", "Dragons"),null, true, + "As {this} enters the battlefield, choose Khans or Dragons.","")); + + // * Khans - At the beginning of your upkeep, return target creature card from your graveyard to your hand. + Ability ability1 = new ConditionalTriggeredAbility( + new BeginningOfUpkeepTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect(), TargetController.YOU, false), + new ModeChoiceSourceCondition("Khans"), + ruleTrigger1); + ability1.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard())); + this.addAbility(ability1); + + // * Dragons - At the beginning of your upkeep, each opponent loses 2 life and you gain 2 life. + Ability ability2 = new ConditionalTriggeredAbility( + new BeginningOfUpkeepTriggeredAbility(new LoseLifeOpponentsEffect(2), TargetController.YOU, false), + new ModeChoiceSourceCondition("Dragons"), + ruleTrigger2); + Effect effect = new GainLifeEffect(2); + effect.setText("and you gain 2 life"); + ability2.addEffect(effect); + this.addAbility(ability2); + + } + + public PalaceSiege(final PalaceSiege card) { + super(card); + } + + @Override + public PalaceSiege copy() { + return new PalaceSiege(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fatereforged/ShamanOfTheGreatHunt.java b/Mage.Sets/src/mage/sets/fatereforged/ShamanOfTheGreatHunt.java new file mode 100644 index 00000000000..057bb28eb4f --- /dev/null +++ b/Mage.Sets/src/mage/sets/fatereforged/ShamanOfTheGreatHunt.java @@ -0,0 +1,97 @@ +/* + * 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.fatereforged; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsDamageToAPlayerAllTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.AbilityWord; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.Filter; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; + +/** + * + * @author LevelX2 + */ +public class ShamanOfTheGreatHunt extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature you control with power 4 or greater"); + + static { + filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 3)); + } + + public ShamanOfTheGreatHunt(UUID ownerId) { + super(ownerId, 113, "Shaman of the Great Hunt", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "FRF"; + this.subtype.add("Orc"); + this.subtype.add("Shaman"); + this.power = new MageInt(4); + this.toughness = new MageInt(2); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // Whenever a creature you control deals combat damage to a player, put a +1/+1 counter on it. + this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility( + new AddCountersTargetEffect(CounterType.P1P1.createInstance()), + new FilterControlledCreaturePermanent(), false, SetTargetPointer.PERMANENT, true + )); + + // Ferocious - {2}{G/U}{G/U}: Draw a card for each creature you control with power 4 or greater. + DynamicValue amount = new PermanentsOnBattlefieldCount(filter); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(amount), new ManaCostsImpl("{2}{G/U}{G/U}")); + ability.setAbilityWord(AbilityWord.FEROCIOUS); + this.addAbility(ability); + + } + + public ShamanOfTheGreatHunt(final ShamanOfTheGreatHunt card) { + super(card); + } + + @Override + public ShamanOfTheGreatHunt copy() { + return new ShamanOfTheGreatHunt(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/BroodSliver.java b/Mage.Sets/src/mage/sets/legions/BroodSliver.java index a0f5686cfb9..0067f02c331 100644 --- a/Mage.Sets/src/mage/sets/legions/BroodSliver.java +++ b/Mage.Sets/src/mage/sets/legions/BroodSliver.java @@ -35,6 +35,7 @@ import mage.abilities.effects.common.CreateTokenTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; +import mage.constants.SetTargetPointer; import mage.filter.common.FilterCreaturePermanent; import mage.game.permanent.token.Token; @@ -58,7 +59,7 @@ public class BroodSliver extends CardImpl { effect.setText("its controller may put a 1/1 colorless Sliver creature token onto the battlefield"); this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(effect, new FilterCreaturePermanent("Sliver", "a Sliver"), - true, true, true)); + true, SetTargetPointer.PLAYER, true)); } public BroodSliver(final BroodSliver card) { diff --git a/Mage.Sets/src/mage/sets/legions/SynapseSliver.java b/Mage.Sets/src/mage/sets/legions/SynapseSliver.java index 3c5692bc4db..2d7f727ad12 100644 --- a/Mage.Sets/src/mage/sets/legions/SynapseSliver.java +++ b/Mage.Sets/src/mage/sets/legions/SynapseSliver.java @@ -35,6 +35,7 @@ import mage.abilities.effects.common.DrawCardTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; +import mage.constants.SetTargetPointer; import mage.filter.common.FilterCreaturePermanent; /** @@ -57,7 +58,7 @@ public class SynapseSliver extends CardImpl { effect.setText("its controller may draw a card"); this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(effect, new FilterCreaturePermanent("Sliver", "a Sliver"), - true, true, true)); + true, SetTargetPointer.PLAYER, true)); } public SynapseSliver(final SynapseSliver card) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/SurgicalExtraction.java b/Mage.Sets/src/mage/sets/newphyrexia/SurgicalExtraction.java index 65dc483e9fe..42912b07a2a 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/SurgicalExtraction.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/SurgicalExtraction.java @@ -102,73 +102,63 @@ class SurgicalExtractionEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Card card = game.getCard(source.getFirstTarget()); - Player player = game.getPlayer(source.getControllerId()); + Card chosenCard = game.getCard(source.getFirstTarget()); + Player controller = game.getPlayer(source.getControllerId()); // 6/1/2011 "Any number of cards" means just that. If you wish, you can choose to // leave some or all of the cards with the same name as the targeted card, // including that card, in the zone they're in. - if (card != null && player != null) { - Player targetPlayer = game.getPlayer(card.getOwnerId()); - if (targetPlayer != null) { - FilterCard filter = new FilterCard("card named " + card.getName()); - filter.add(new NamePredicate(card.getName())); + if (chosenCard != null && controller != null) { + Player owner = game.getPlayer(chosenCard.getOwnerId()); + if (owner != null) { + FilterCard filterNamedCard = new FilterCard("card named " + chosenCard.getName()); + filterNamedCard.add(new NamePredicate(chosenCard.getName())); Cards cardsInLibrary = new CardsImpl(Zone.LIBRARY); - cardsInLibrary.addAll(targetPlayer.getLibrary().getCards(game)); + cardsInLibrary.addAll(owner.getLibrary().getCards(game)); // cards in Graveyard - int cardsCount = targetPlayer.getGraveyard().count(filter, game); + int cardsCount = owner.getGraveyard().count(filterNamedCard, game); if (cardsCount > 0) { - filter.setMessage("card named " + card.getName() + " in the graveyard of " + targetPlayer.getName()); - TargetCardInGraveyard target = new TargetCardInGraveyard(0, cardsCount, filter); - if (player.choose(Outcome.Exile, targetPlayer.getGraveyard(), target, game)) { + filterNamedCard.setMessage("card named " + chosenCard.getName() + " in the graveyard of " + owner.getName()); + TargetCardInGraveyard target = new TargetCardInGraveyard(0, cardsCount, filterNamedCard); + if (controller.choose(Outcome.Exile, owner.getGraveyard(), target, game)) { List targets = target.getTargets(); for (UUID targetId : targets) { - Card targetCard = targetPlayer.getGraveyard().get(targetId, game); + Card targetCard = owner.getGraveyard().get(targetId, game); if (targetCard != null) { - player.moveCardToExileWithInfo(targetCard, null, "", source.getSourceId(), game, Zone.GRAVEYARD); + controller.moveCardToExileWithInfo(targetCard, null, "", source.getSourceId(), game, Zone.GRAVEYARD); } } } } // cards in Hand - cardsCount = targetPlayer.getHand().count(filter, game); - if (cardsCount > 0) { - filter.setMessage("card named " + card.getName() + " in the hand of " + targetPlayer.getName()); - TargetCardInHand target = new TargetCardInHand(0, cardsCount, filter); - if (player.choose(Outcome.Exile, targetPlayer.getHand(), target, game)) { - List targets = target.getTargets(); - for (UUID targetId : targets) { - Card targetCard = targetPlayer.getHand().get(targetId, game); - if (targetCard != null) { - player.moveCardToExileWithInfo(targetCard, null, "", source.getSourceId(), game, Zone.HAND); - } + filterNamedCard.setMessage("card named " + chosenCard.getName() + " in the hand of " + owner.getName()); + TargetCardInHand targetCardInHand = new TargetCardInHand(0, Integer.MAX_VALUE, filterNamedCard); + if (controller.choose(Outcome.Exile, owner.getHand(), targetCardInHand, game)) { + List targets = targetCardInHand.getTargets(); + for (UUID targetId : targets) { + Card targetCard = owner.getHand().get(targetId, game); + if (targetCard != null) { + controller.moveCardToExileWithInfo(targetCard, null, "", source.getSourceId(), game, Zone.HAND); } } - } else { - player.lookAtCards(targetPlayer.getName() + " hand", targetPlayer.getHand(), game); } // cards in Library - cardsCount = cardsInLibrary.count(filter, game); - if (cardsCount > 0) { - filter.setMessage("card named " + card.getName() + " in the library of " + targetPlayer.getName()); - TargetCardInLibrary target = new TargetCardInLibrary(0, cardsCount, filter); - if (player.searchLibrary(target, game, targetPlayer.getId())) { - List targets = target.getTargets(); - for (UUID targetId : targets) { - Card targetCard = targetPlayer.getLibrary().getCard(targetId, game); - if (targetCard != null) { - player.moveCardToExileWithInfo(targetCard, null, "", source.getSourceId(), game, Zone.LIBRARY); - } + filterNamedCard.setMessage("card named " + chosenCard.getName() + " in the library of " + owner.getName()); + TargetCardInLibrary targetCardInLibrary = new TargetCardInLibrary(0, Integer.MAX_VALUE, filterNamedCard); + if (controller.searchLibrary(targetCardInLibrary, game, owner.getId())) { + List targets = targetCardInLibrary.getTargets(); + for (UUID targetId : targets) { + Card targetCard = owner.getLibrary().getCard(targetId, game); + if (targetCard != null) { + controller.moveCardToExileWithInfo(targetCard, null, "", source.getSourceId(), game, Zone.LIBRARY); } } - } else { - player.lookAtCards(targetPlayer.getName() + " library", cardsInLibrary, game); } - targetPlayer.shuffleLibrary(game); + owner.shuffleLibrary(game); return true; } } diff --git a/Mage.Sets/src/mage/sets/planarchaos/Extirpate.java b/Mage.Sets/src/mage/sets/planarchaos/Extirpate.java index 5dbdc3327d2..ea6b63df1fa 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/Extirpate.java +++ b/Mage.Sets/src/mage/sets/planarchaos/Extirpate.java @@ -116,8 +116,8 @@ class ExtirpateEffect extends OneShotEffect { // Exile all cards with the same name // Building a card filter with the name - FilterCard filterNamedCards = new FilterCard(); - filterNamedCards.add(new NamePredicate(chosenCard.getName())); + FilterCard filterNamedCard = new FilterCard(); + filterNamedCard.add(new NamePredicate(chosenCard.getName())); // The cards you're searching for must be found and exiled if they're in the graveyard because it's a public zone. // Finding those cards in the hand and library is optional, because those zones are hidden (even if the hand is temporarily revealed). @@ -129,22 +129,28 @@ class ExtirpateEffect extends OneShotEffect { } // search cards in hand - TargetCardInHand targetCardsHand = new TargetCardInHand(0, Integer.MAX_VALUE, filterNamedCards); - controller.chooseTarget(outcome, owner.getGraveyard(), targetCardsHand, source, game); - for(UUID cardId: targetCardsHand.getTargets()) { - Card card = game.getCard(cardId); - if (card != null) { - controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.HAND); + filterNamedCard.setMessage("card named " + chosenCard.getName() + " in the hand of " + owner.getName()); + TargetCardInHand targetCardInHand = new TargetCardInHand(0, Integer.MAX_VALUE, filterNamedCard); + if (controller.choose(Outcome.Exile, owner.getHand(), targetCardInHand, game)) { + List targets = targetCardInHand.getTargets(); + for (UUID targetId : targets) { + Card targetCard = owner.getHand().get(targetId, game); + if (targetCard != null) { + controller.moveCardToExileWithInfo(targetCard, null, "", source.getSourceId(), game, Zone.HAND); + } } } - + // search cards in Library - TargetCardInLibrary targetCardsLibrary = new TargetCardInLibrary(0, Integer.MAX_VALUE, filterNamedCards); - controller.searchLibrary(targetCardsLibrary, game, owner.getId()); - for(UUID cardId: targetCardsLibrary.getTargets()) { - Card card = game.getCard(cardId); - if (card != null) { - controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY); + filterNamedCard.setMessage("card named " + chosenCard.getName() + " in the library of " + owner.getName()); + TargetCardInLibrary targetCardInLibrary = new TargetCardInLibrary(0, Integer.MAX_VALUE, filterNamedCard); + if (controller.searchLibrary(targetCardInLibrary, game, owner.getId())) { + List targets = targetCardInLibrary.getTargets(); + for (UUID targetId : targets) { + Card targetCard = owner.getLibrary().getCard(targetId, game); + if (targetCard != null) { + controller.moveCardToExileWithInfo(targetCard, null, "", source.getSourceId(), game, Zone.LIBRARY); + } } } owner.shuffleLibrary(game); diff --git a/Mage.Stats/server.log b/Mage.Stats/server.log deleted file mode 100644 index 4bd7318baa5..00000000000 --- a/Mage.Stats/server.log +++ /dev/null @@ -1,28 +0,0 @@ -11:53:00.637 [main] INFO com.xmage.ws.aspect.RequestAspect - ip: null, user-agent: null -11:53:00.827 [main] INFO com.j256.ormlite.table.TableUtils - creating table 'logs' -11:53:06.126 [main] INFO com.j256.ormlite.table.TableUtils - executed create table statement changed 0 rows: CREATE TABLE IF NOT EXISTS `logs` (`key` VARCHAR(255) , `created_dt` TIMESTAMP , `arg0` VARCHAR(255) , `arg1` VARCHAR(255) , `arg2` VARCHAR(255) , `arg3` VARCHAR(255) , `arg4` VARCHAR(255) , `arg5` VARCHAR(255) ) -11:53:06.136 [main] INFO com.j256.ormlite.table.TableUtils - creating table 'feedbacks' -11:53:10.236 [main] INFO com.j256.ormlite.table.TableUtils - executed create table statement changed 0 rows: CREATE TABLE IF NOT EXISTS `feedbacks` (`username` VARCHAR(255) , `title` VARCHAR(255) , `type` VARCHAR(255) , `message` VARCHAR(255) , `email` VARCHAR(255) , `host` VARCHAR(255) , `created_dt` TIMESTAMP , `status` VARCHAR(255) ) -11:53:10.316 [main] INFO c.x.c.e.r.i.XMageStatsRepositoryImpl - logs found count: 2 -11:53:10.456 [main] INFO c.x.w.r.s.base.AbstractService - responseWithError time: 130ms -11:06:56.187 [main] INFO com.xmage.ws.aspect.RequestAspect - ip: null, user-agent: null -11:06:56.430 [main] INFO com.j256.ormlite.table.TableUtils - creating table 'logs' -11:06:57.287 [main] INFO com.j256.ormlite.table.TableUtils - executed create table statement changed 0 rows: CREATE TABLE IF NOT EXISTS `logs` (`key` VARCHAR(255) , `created_dt` TIMESTAMP , `arg0` VARCHAR(255) , `arg1` VARCHAR(255) , `arg2` VARCHAR(255) , `arg3` VARCHAR(255) , `arg4` VARCHAR(255) , `arg5` VARCHAR(255) ) -11:06:57.327 [main] INFO com.j256.ormlite.table.TableUtils - creating table 'feedbacks' -11:06:57.385 [main] INFO com.j256.ormlite.table.TableUtils - executed create table statement changed 0 rows: CREATE TABLE IF NOT EXISTS `feedbacks` (`username` VARCHAR(255) , `title` VARCHAR(255) , `type` VARCHAR(255) , `message` VARCHAR(255) , `email` VARCHAR(255) , `host` VARCHAR(255) , `created_dt` TIMESTAMP , `status` VARCHAR(255) ) -11:06:57.405 [main] INFO c.x.c.e.r.i.XMageStatsRepositoryImpl - logs found count: 0 -11:06:57.605 [main] INFO c.x.w.r.s.base.AbstractService - responseWithError time: 200ms -11:24:56.118 [main] INFO com.xmage.ws.aspect.RequestAspect - ip: null, user-agent: null -11:24:56.328 [main] INFO com.j256.ormlite.table.TableUtils - creating table 'logs' -11:24:56.736 [main] INFO com.j256.ormlite.table.TableUtils - executed create table statement changed 0 rows: CREATE TABLE IF NOT EXISTS `logs` (`key` VARCHAR(255) , `created_dt` TIMESTAMP , `arg0` VARCHAR(255) , `arg1` VARCHAR(255) , `arg2` VARCHAR(255) , `arg3` VARCHAR(255) , `arg4` VARCHAR(255) , `arg5` VARCHAR(255) ) -11:24:56.746 [main] INFO com.j256.ormlite.table.TableUtils - creating table 'feedbacks' -11:24:56.834 [main] INFO com.j256.ormlite.table.TableUtils - executed create table statement changed 0 rows: CREATE TABLE IF NOT EXISTS `feedbacks` (`username` VARCHAR(255) , `title` VARCHAR(255) , `type` VARCHAR(255) , `message` VARCHAR(255) , `email` VARCHAR(255) , `host` VARCHAR(255) , `created_dt` TIMESTAMP , `status` VARCHAR(255) ) -11:24:56.864 [main] INFO c.x.c.e.r.i.XMageStatsRepositoryImpl - logs found count: 0 -11:24:57.094 [main] INFO c.x.w.r.s.base.AbstractService - responseWithError time: 210ms -11:08:52.680 [main] INFO com.xmage.ws.aspect.RequestAspect - ip: null, user-agent: null -11:08:52.920 [main] INFO com.j256.ormlite.table.TableUtils - creating table 'logs' -11:08:57.818 [main] INFO com.j256.ormlite.table.TableUtils - executed create table statement changed 0 rows: CREATE TABLE IF NOT EXISTS `logs` (`key` VARCHAR(255) , `created_dt` TIMESTAMP , `arg0` VARCHAR(255) , `arg1` VARCHAR(255) , `arg2` VARCHAR(255) , `arg3` VARCHAR(255) , `arg4` VARCHAR(255) , `arg5` VARCHAR(255) ) -11:08:57.838 [main] INFO com.j256.ormlite.table.TableUtils - creating table 'feedbacks' -11:09:01.956 [main] INFO com.j256.ormlite.table.TableUtils - executed create table statement changed 0 rows: CREATE TABLE IF NOT EXISTS `feedbacks` (`username` VARCHAR(255) , `title` VARCHAR(255) , `type` VARCHAR(255) , `message` VARCHAR(255) , `email` VARCHAR(255) , `host` VARCHAR(255) , `created_dt` TIMESTAMP , `status` VARCHAR(255) ) -11:09:02.036 [main] INFO c.x.c.e.r.i.XMageStatsRepositoryImpl - logs found count: 16 -11:09:02.156 [main] INFO c.x.w.r.s.base.AbstractService - responseWithError time: 120ms diff --git a/Mage/src/mage/abilities/Ability.java b/Mage/src/mage/abilities/Ability.java index aab71dc8a90..887f45de75b 100644 --- a/Mage/src/mage/abilities/Ability.java +++ b/Mage/src/mage/abilities/Ability.java @@ -371,7 +371,7 @@ public interface Ability extends Controllable, Serializable { boolean isInUseableZone(Game game, MageObject source, boolean checkLKI); /** - * Returns true if this ability has to be shown on top of the card. + * Returns true if this ability has to be shown as topmost of all the rules of the object * * @return */ diff --git a/Mage/src/mage/abilities/AbilityImpl.java b/Mage/src/mage/abilities/AbilityImpl.java index 54890c9ef58..4af4e36e101 100644 --- a/Mage/src/mage/abilities/AbilityImpl.java +++ b/Mage/src/mage/abilities/AbilityImpl.java @@ -126,6 +126,7 @@ public abstract class AbilityImpl implements Ability { this.ruleAdditionalCostsVisible = ability.ruleAdditionalCostsVisible; this.costModificationActive = ability.costModificationActive; this.worksFaceDown = ability.worksFaceDown; + this.abilityWord = ability.abilityWord; } @Override diff --git a/Mage/src/mage/abilities/common/DealsDamageToAPlayerAllTriggeredAbility.java b/Mage/src/mage/abilities/common/DealsDamageToAPlayerAllTriggeredAbility.java index 55eaf3c9c59..849c8d62a8c 100644 --- a/Mage/src/mage/abilities/common/DealsDamageToAPlayerAllTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DealsDamageToAPlayerAllTriggeredAbility.java @@ -30,6 +30,7 @@ package mage.abilities.common; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; +import mage.constants.SetTargetPointer; import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.game.Game; @@ -46,10 +47,10 @@ import mage.target.targetpointer.FixedTarget; public class DealsDamageToAPlayerAllTriggeredAbility extends TriggeredAbilityImpl { private final FilterPermanent filter; - private final boolean setTargetPointer; + private final SetTargetPointer setTargetPointer; private final boolean onlyCombat; - public DealsDamageToAPlayerAllTriggeredAbility(Effect effect, FilterPermanent filter, boolean optional, boolean setTargetPointer, boolean onlyCombat) { + public DealsDamageToAPlayerAllTriggeredAbility(Effect effect, FilterPermanent filter, boolean optional, SetTargetPointer setTargetPointer, boolean onlyCombat) { super(Zone.BATTLEFIELD, effect, optional); this.setTargetPointer = setTargetPointer; this.filter = filter; @@ -74,10 +75,18 @@ public class DealsDamageToAPlayerAllTriggeredAbility extends TriggeredAbilityImp && (!onlyCombat || ((DamagedPlayerEvent) event).isCombatDamage())) { Permanent permanent = game.getPermanent(event.getSourceId()); if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) { - if (setTargetPointer) { + if (!setTargetPointer.equals(SetTargetPointer.NONE)) { for (Effect effect : this.getEffects()) { effect.setValue("damage", event.getAmount()); - effect.setTargetPointer(new FixedTarget(permanent.getControllerId())); + switch(setTargetPointer) { + case PLAYER: + effect.setTargetPointer(new FixedTarget(permanent.getControllerId())); + break; + case PERMANENT: + effect.setTargetPointer(new FixedTarget(permanent.getId())); + break; + } + } } return true; diff --git a/Mage/src/mage/abilities/common/SimpleActivatedAbility.java b/Mage/src/mage/abilities/common/SimpleActivatedAbility.java index f75a79f1fd8..9b9b93d93d4 100644 --- a/Mage/src/mage/abilities/common/SimpleActivatedAbility.java +++ b/Mage/src/mage/abilities/common/SimpleActivatedAbility.java @@ -45,7 +45,7 @@ public class SimpleActivatedAbility extends ActivatedAbilityImpl { super(zone, effect, cost); } - public SimpleActivatedAbility(Zone zone, Effect effect, Costs costs) { + public SimpleActivatedAbility(Zone zone, Effect effect, Costs costs) { super(zone, effect, costs); } diff --git a/Mage/src/mage/abilities/effects/common/counter/AddCountersTargetEffect.java b/Mage/src/mage/abilities/effects/common/counter/AddCountersTargetEffect.java index bc1f96414f8..77eef62a48b 100644 --- a/Mage/src/mage/abilities/effects/common/counter/AddCountersTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/counter/AddCountersTargetEffect.java @@ -139,6 +139,8 @@ public class AddCountersTargetEffect extends OneShotEffect { sb.append("target "); } sb.append(targetName); + } else { + sb.append("it"); } if (amount.getMessage().length() > 0) { sb.append(" for each ").append(amount.getMessage()); diff --git a/Mage/src/mage/constants/AbilityWord.java b/Mage/src/mage/constants/AbilityWord.java index d4f860aad49..e6fac9a0436 100644 --- a/Mage/src/mage/constants/AbilityWord.java +++ b/Mage/src/mage/constants/AbilityWord.java @@ -35,6 +35,7 @@ package mage.constants; public enum AbilityWord { BLOODRUSH("Bloodrush"), CONSTELLATION("Constellation"), + FEROCIOUS("Ferocious"), HELLBENT("Hellbent"), HEROIC("Heroic"), LANDFALL("Landfall"), diff --git a/mage-bundle.zip b/mage-bundle.zip deleted file mode 100644 index 4bc1045812f..00000000000 Binary files a/mage-bundle.zip and /dev/null differ diff --git a/mage-stats-ws.war b/mage-stats-ws.war deleted file mode 100644 index 8f048b7b039..00000000000 Binary files a/mage-stats-ws.war and /dev/null differ