mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
AI: fix wrong cards outcome in choose dialogs;
This commit is contained in:
parent
f719503a89
commit
3877d2267a
8 changed files with 20 additions and 22 deletions
|
@ -56,7 +56,7 @@ class BloodForBonesEffect extends OneShotEffect {
|
||||||
= new FilterCreatureCard("creature card in your graveyard (to put into your hand");
|
= new FilterCreatureCard("creature card in your graveyard (to put into your hand");
|
||||||
|
|
||||||
BloodForBonesEffect() {
|
BloodForBonesEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.PutCardInPlay);
|
||||||
staticText = "Return a creature card from your graveyard to the battlefield, " +
|
staticText = "Return a creature card from your graveyard to the battlefield, " +
|
||||||
"then return another creature card from your graveyard to your hand.";
|
"then return another creature card from your graveyard to your hand.";
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ class CavalierOfFlameEffect extends OneShotEffect {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
TargetCardInHand target = new TargetCardInHand(0, player.getHand().size(), StaticFilters.FILTER_CARD);
|
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
|
int counter = target
|
||||||
.getTargets()
|
.getTargets()
|
||||||
.stream()
|
.stream()
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
@ -15,14 +11,17 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.choices.ChoiceColor;
|
import mage.choices.ChoiceColor;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Styxo
|
* @author Styxo
|
||||||
*/
|
*/
|
||||||
public final class CouncilGuardian extends CardImpl {
|
public final class CouncilGuardian extends CardImpl {
|
||||||
|
@ -53,7 +52,7 @@ public final class CouncilGuardian extends CardImpl {
|
||||||
class CouncilsGuardianEffect extends OneShotEffect {
|
class CouncilsGuardianEffect extends OneShotEffect {
|
||||||
|
|
||||||
public CouncilsGuardianEffect() {
|
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";
|
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);
|
Player player = game.getPlayer(playerId);
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
choice.clearChoice();
|
choice.clearChoice();
|
||||||
if (player.choose(outcome, choice, game)) {
|
if (player.choose(Outcome.Detriment, choice, game)) {
|
||||||
ObjectColor color = choice.getColor();
|
ObjectColor color = choice.getColor();
|
||||||
if (color != null) {
|
if (color != null) {
|
||||||
if (chosenColors.containsKey(color)) {
|
if (chosenColors.containsKey(color)) {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
@ -19,8 +17,9 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
*/
|
*/
|
||||||
public final class DefensiveManeuvers extends CardImpl {
|
public final class DefensiveManeuvers extends CardImpl {
|
||||||
|
@ -45,7 +44,7 @@ public final class DefensiveManeuvers extends CardImpl {
|
||||||
class DefensiveManeuversEffect extends OneShotEffect {
|
class DefensiveManeuversEffect extends OneShotEffect {
|
||||||
|
|
||||||
DefensiveManeuversEffect() {
|
DefensiveManeuversEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.BoostCreature);
|
||||||
this.staticText = "Creatures of the creature type of your choice get +0/+4 until end of turn.";
|
this.staticText = "Creatures of the creature type of your choice get +0/+4 until end of turn.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ class DoomForetoldEffect extends OneShotEffect {
|
||||||
if (game.getBattlefield().contains(filter2, 1, game)) {
|
if (game.getBattlefield().contains(filter2, 1, game)) {
|
||||||
TargetPermanent target = new TargetPermanent(filter2);
|
TargetPermanent target = new TargetPermanent(filter2);
|
||||||
target.setNotTarget(true);
|
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());
|
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||||
if (permanent != null && permanent.sacrifice(source.getSourceId(), game)) {
|
if (permanent != null && permanent.sacrifice(source.getSourceId(), game)) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -99,6 +99,7 @@ class DoomForetoldEffect extends OneShotEffect {
|
||||||
controller.drawCards(1, game);
|
controller.drawCards(1, game);
|
||||||
controller.gainLife(2, game, source);
|
controller.gainLife(2, game, source);
|
||||||
effect1.apply(game, source);
|
effect1.apply(game, source);
|
||||||
return effect2.apply(game, source);
|
effect2.apply(game, source);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.e;
|
package mage.cards.e;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
@ -18,8 +16,9 @@ import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
public final class Extinction extends CardImpl {
|
public final class Extinction extends CardImpl {
|
||||||
|
@ -44,7 +43,7 @@ public final class Extinction extends CardImpl {
|
||||||
class ExtinctionEffect extends OneShotEffect {
|
class ExtinctionEffect extends OneShotEffect {
|
||||||
|
|
||||||
public ExtinctionEffect() {
|
public ExtinctionEffect() {
|
||||||
super(Outcome.UnboostCreature);
|
super(Outcome.DestroyPermanent);
|
||||||
staticText = "Destroy all creatures of the creature type of your choice";
|
staticText = "Destroy all creatures of the creature type of your choice";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ class SeasonedPyromancerEffect extends OneShotEffect {
|
||||||
int toDiscard = Math.min(player.getHand().size(), 2);
|
int toDiscard = Math.min(player.getHand().size(), 2);
|
||||||
if (toDiscard > 0) {
|
if (toDiscard > 0) {
|
||||||
TargetCard target = new TargetCardInHand(toDiscard, StaticFilters.FILTER_CARD);
|
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());
|
Cards cards = new CardsImpl(target.getTargets());
|
||||||
for (Card card : cards.getCards(game)) {
|
for (Card card : cards.getCards(game)) {
|
||||||
if (player.discard(card, source, game) && !card.isLand()) {
|
if (player.discard(card, source, game) && !card.isLand()) {
|
||||||
|
|
|
@ -50,7 +50,7 @@ public final class ViviensArkbow extends CardImpl {
|
||||||
class ViviensArkbowEffect extends OneShotEffect {
|
class ViviensArkbowEffect extends OneShotEffect {
|
||||||
|
|
||||||
ViviensArkbowEffect() {
|
ViviensArkbowEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.PutCardInPlay);
|
||||||
staticText = "Look at the top X cards of your library. " +
|
staticText = "Look at the top X cards of your library. " +
|
||||||
"You may put a creature card with converted mana cost X or less " +
|
"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.";
|
"from among them onto the battlefield. Put the rest on the bottom of your library in a random order.";
|
||||||
|
|
Loading…
Reference in a new issue