From 3877d2267ae147964b681cfb0e7c564b5dfb6976 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Fri, 27 Sep 2019 22:11:30 +0400 Subject: [PATCH] AI: fix wrong cards outcome in choose dialogs; --- Mage.Sets/src/mage/cards/b/BloodForBones.java | 2 +- Mage.Sets/src/mage/cards/c/CavalierOfFlame.java | 2 +- Mage.Sets/src/mage/cards/c/CouncilGuardian.java | 15 +++++++-------- .../src/mage/cards/d/DefensiveManeuvers.java | 7 +++---- Mage.Sets/src/mage/cards/d/DoomForetold.java | 5 +++-- Mage.Sets/src/mage/cards/e/Extinction.java | 7 +++---- .../src/mage/cards/s/SeasonedPyromancer.java | 2 +- Mage.Sets/src/mage/cards/v/ViviensArkbow.java | 2 +- 8 files changed, 20 insertions(+), 22 deletions(-) diff --git a/Mage.Sets/src/mage/cards/b/BloodForBones.java b/Mage.Sets/src/mage/cards/b/BloodForBones.java index e04e4a2717..c0c4ea3716 100644 --- a/Mage.Sets/src/mage/cards/b/BloodForBones.java +++ b/Mage.Sets/src/mage/cards/b/BloodForBones.java @@ -56,7 +56,7 @@ class BloodForBonesEffect extends OneShotEffect { = new FilterCreatureCard("creature card in your graveyard (to put into your hand"); BloodForBonesEffect() { - super(Outcome.Benefit); + super(Outcome.PutCardInPlay); staticText = "Return a creature card from your graveyard to the battlefield, " + "then return another creature card from your graveyard to your hand."; } diff --git a/Mage.Sets/src/mage/cards/c/CavalierOfFlame.java b/Mage.Sets/src/mage/cards/c/CavalierOfFlame.java index d39443a884..6021ff0504 100644 --- a/Mage.Sets/src/mage/cards/c/CavalierOfFlame.java +++ b/Mage.Sets/src/mage/cards/c/CavalierOfFlame.java @@ -103,7 +103,7 @@ class CavalierOfFlameEffect extends OneShotEffect { return false; } TargetCardInHand target = new TargetCardInHand(0, player.getHand().size(), StaticFilters.FILTER_CARD); - if (player.choose(outcome, player.getHand(), target, game)) { + if (player.choose(Outcome.Discard, player.getHand(), target, game)) { int counter = target .getTargets() .stream() diff --git a/Mage.Sets/src/mage/cards/c/CouncilGuardian.java b/Mage.Sets/src/mage/cards/c/CouncilGuardian.java index 0931fdd466..631f174e09 100644 --- a/Mage.Sets/src/mage/cards/c/CouncilGuardian.java +++ b/Mage.Sets/src/mage/cards/c/CouncilGuardian.java @@ -1,9 +1,5 @@ - package mage.cards.c; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; @@ -15,14 +11,17 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.choices.ChoiceColor; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.SubType; import mage.game.Game; import mage.players.Player; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + /** - * * @author Styxo */ public final class CouncilGuardian extends CardImpl { @@ -53,7 +52,7 @@ public final class CouncilGuardian extends CardImpl { class CouncilsGuardianEffect extends OneShotEffect { public CouncilsGuardianEffect() { - super(Outcome.Exile); + super(Outcome.Benefit); this.staticText = "starting with you, each player votes for blue, black, red, or green. {this} gains protection from each color with the most votes or tied for most votes"; } @@ -78,7 +77,7 @@ class CouncilsGuardianEffect extends OneShotEffect { Player player = game.getPlayer(playerId); if (player != null) { choice.clearChoice(); - if (player.choose(outcome, choice, game)) { + if (player.choose(Outcome.Detriment, choice, game)) { ObjectColor color = choice.getColor(); if (color != null) { if (chosenColors.containsKey(color)) { diff --git a/Mage.Sets/src/mage/cards/d/DefensiveManeuvers.java b/Mage.Sets/src/mage/cards/d/DefensiveManeuvers.java index afdce81b29..755fe98290 100644 --- a/Mage.Sets/src/mage/cards/d/DefensiveManeuvers.java +++ b/Mage.Sets/src/mage/cards/d/DefensiveManeuvers.java @@ -1,7 +1,5 @@ - package mage.cards.d; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; @@ -19,8 +17,9 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; +import java.util.UUID; + /** - * * @author TheElk801 */ public final class DefensiveManeuvers extends CardImpl { @@ -45,7 +44,7 @@ public final class DefensiveManeuvers extends CardImpl { class DefensiveManeuversEffect extends OneShotEffect { DefensiveManeuversEffect() { - super(Outcome.Benefit); + super(Outcome.BoostCreature); this.staticText = "Creatures of the creature type of your choice get +0/+4 until end of turn."; } diff --git a/Mage.Sets/src/mage/cards/d/DoomForetold.java b/Mage.Sets/src/mage/cards/d/DoomForetold.java index b472cde979..2a997df0c6 100644 --- a/Mage.Sets/src/mage/cards/d/DoomForetold.java +++ b/Mage.Sets/src/mage/cards/d/DoomForetold.java @@ -87,7 +87,7 @@ class DoomForetoldEffect extends OneShotEffect { if (game.getBattlefield().contains(filter2, 1, game)) { TargetPermanent target = new TargetPermanent(filter2); target.setNotTarget(true); - if (player.choose(outcome, target, source.getSourceId(), game)) { + if (player.choose(Outcome.Sacrifice, target, source.getSourceId(), game)) { Permanent permanent = game.getPermanent(target.getFirstTarget()); if (permanent != null && permanent.sacrifice(source.getSourceId(), game)) { return true; @@ -99,6 +99,7 @@ class DoomForetoldEffect extends OneShotEffect { controller.drawCards(1, game); controller.gainLife(2, game, source); effect1.apply(game, source); - return effect2.apply(game, source); + effect2.apply(game, source); + return true; } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/e/Extinction.java b/Mage.Sets/src/mage/cards/e/Extinction.java index e77c192cb2..27e3bc3be3 100644 --- a/Mage.Sets/src/mage/cards/e/Extinction.java +++ b/Mage.Sets/src/mage/cards/e/Extinction.java @@ -1,7 +1,5 @@ - package mage.cards.e; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; @@ -18,8 +16,9 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.UUID; + /** - * * @author fireshoes */ public final class Extinction extends CardImpl { @@ -44,7 +43,7 @@ public final class Extinction extends CardImpl { class ExtinctionEffect extends OneShotEffect { public ExtinctionEffect() { - super(Outcome.UnboostCreature); + super(Outcome.DestroyPermanent); staticText = "Destroy all creatures of the creature type of your choice"; } diff --git a/Mage.Sets/src/mage/cards/s/SeasonedPyromancer.java b/Mage.Sets/src/mage/cards/s/SeasonedPyromancer.java index 64859e6951..f30bcf4b83 100644 --- a/Mage.Sets/src/mage/cards/s/SeasonedPyromancer.java +++ b/Mage.Sets/src/mage/cards/s/SeasonedPyromancer.java @@ -86,7 +86,7 @@ class SeasonedPyromancerEffect extends OneShotEffect { int toDiscard = Math.min(player.getHand().size(), 2); if (toDiscard > 0) { TargetCard target = new TargetCardInHand(toDiscard, StaticFilters.FILTER_CARD); - if (player.choose(outcome, player.getHand(), target, game)) { + if (player.choose(Outcome.Discard, player.getHand(), target, game)) { Cards cards = new CardsImpl(target.getTargets()); for (Card card : cards.getCards(game)) { if (player.discard(card, source, game) && !card.isLand()) { diff --git a/Mage.Sets/src/mage/cards/v/ViviensArkbow.java b/Mage.Sets/src/mage/cards/v/ViviensArkbow.java index 0db7847a76..82b5814347 100644 --- a/Mage.Sets/src/mage/cards/v/ViviensArkbow.java +++ b/Mage.Sets/src/mage/cards/v/ViviensArkbow.java @@ -50,7 +50,7 @@ public final class ViviensArkbow extends CardImpl { class ViviensArkbowEffect extends OneShotEffect { ViviensArkbowEffect() { - super(Outcome.Benefit); + super(Outcome.PutCardInPlay); staticText = "Look at the top X cards of your library. " + "You may put a creature card with converted mana cost X or less " + "from among them onto the battlefield. Put the rest on the bottom of your library in a random order.";