AI: fix wrong cards outcome in choose dialogs;

This commit is contained in:
Oleg Agafonov 2019-09-27 22:11:30 +04:00
parent f719503a89
commit 3877d2267a
8 changed files with 20 additions and 22 deletions

View file

@ -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.";
}

View file

@ -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()

View file

@ -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)) {

View file

@ -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.";
}

View file

@ -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;
}
}

View file

@ -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";
}

View file

@ -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()) {

View file

@ -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.";