mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
playSpellAbilityNoStack - added parameter 'mayChooseNewTargets' - it is passed to HumanPlaySa method and is a key to call doTrigger on AI's side
This commit is contained in:
@@ -7299,7 +7299,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
cardsInCommand = this.getGame().getCardsIn(ZoneType.Command);
|
||||
}
|
||||
|
||||
this.getController().getController().playSpellAbilityNoStack(shieldSA);
|
||||
this.getController().getController().playSpellAbilityNoStack(shieldSA, true);
|
||||
if (apiIsEffect) {
|
||||
List<Card> newCardsInCommand = this.getGame().getCardsIn(ZoneType.Command);
|
||||
newCardsInCommand.removeAll(cardsInCommand);
|
||||
|
||||
@@ -4,7 +4,6 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import forge.Card;
|
||||
|
||||
@@ -21,12 +21,10 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.Iterables;
|
||||
|
||||
import forge.Card;
|
||||
import forge.CardLists;
|
||||
import forge.CardPredicates;
|
||||
import forge.Singletons;
|
||||
import forge.CardPredicates.Presets;
|
||||
import forge.Command;
|
||||
@@ -38,19 +36,14 @@ import forge.card.spellability.AbilityActivated;
|
||||
import forge.card.spellability.AbilityStatic;
|
||||
import forge.card.spellability.SpellAbility;
|
||||
import forge.card.spellability.SpellPermanent;
|
||||
import forge.card.spellability.TargetRestrictions;
|
||||
import forge.card.trigger.Trigger;
|
||||
import forge.card.trigger.TriggerHandler;
|
||||
import forge.game.Game;
|
||||
import forge.game.ai.ComputerUtilCard;
|
||||
import forge.game.ai.ComputerUtilCombat;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.zone.PlayerZone;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.gui.GuiChoose;
|
||||
import forge.gui.input.InputSelectCards;
|
||||
import forge.gui.input.InputSelectCardsFromList;
|
||||
import forge.util.Aggregates;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
||||
@@ -238,7 +238,7 @@ public class ReplacementHandler {
|
||||
}
|
||||
|
||||
Player player = replacementEffect.getHostCard().getController();
|
||||
player.getController().playSpellAbilityNoStack(effectSA);
|
||||
player.getController().playSpellAbilityNoStack(effectSA, true);
|
||||
|
||||
return ReplacementResult.Replaced;
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ public class WrappedAbility extends Ability implements ISpellAbility {
|
||||
if (decider != null && !confirmTrigger(decider, triggerParams))
|
||||
return;
|
||||
|
||||
getActivatingPlayer().getController().playSpellAbilityNoStack(sa);
|
||||
getActivatingPlayer().getController().playSpellAbilityNoStack(sa, false);
|
||||
|
||||
// Add eventual delayed trigger.
|
||||
if (triggerParams.containsKey("DelayedTrigger")) {
|
||||
|
||||
@@ -1624,7 +1624,7 @@ public class GameAction {
|
||||
if (!takesAction.getZone(ZoneType.Hand).contains(sa.getSourceCard()))
|
||||
continue;
|
||||
|
||||
takesAction.getController().playSpellAbilityNoStack(sa);
|
||||
takesAction.getController().playSpellAbilityNoStack(sa, true);
|
||||
}
|
||||
takesAction = game.getNextPlayerAfter(takesAction);
|
||||
} while( takesAction != first );
|
||||
|
||||
@@ -920,7 +920,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
cardsInCommand = this.getGame().getCardsIn(ZoneType.Command);
|
||||
}
|
||||
|
||||
this.getController().playSpellAbilityNoStack(shieldSA);
|
||||
this.getController().playSpellAbilityNoStack(shieldSA, true);
|
||||
if (apiIsEffect) {
|
||||
List<Card> newCardsInCommand = this.getGame().getCardsIn(ZoneType.Command);
|
||||
newCardsInCommand.removeAll(cardsInCommand);
|
||||
|
||||
@@ -97,7 +97,7 @@ public abstract class PlayerController {
|
||||
//public abstract void playFromSuspend(Card c);
|
||||
public abstract boolean playCascade(Card cascadedCard, Card sourceCard);
|
||||
public abstract void playSpellAbilityForFree(SpellAbility copySA, boolean mayChoseNewTargets);
|
||||
public abstract void playSpellAbilityNoStack(SpellAbility effectSA);
|
||||
public abstract void playSpellAbilityNoStack(SpellAbility effectSA, boolean mayChoseNewTargets);
|
||||
|
||||
public abstract Deck sideboard(final Deck deck, GameType gameType);
|
||||
|
||||
|
||||
@@ -251,7 +251,9 @@ public class PlayerControllerAi extends PlayerController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playSpellAbilityNoStack(SpellAbility effectSA) {
|
||||
public void playSpellAbilityNoStack(SpellAbility effectSA, boolean canSetupTargets) {
|
||||
if ( canSetupTargets )
|
||||
effectSA.doTrigger(true, player); // first parameter does not matter, since return value won't be used
|
||||
ComputerUtil.playNoStack(player, effectSA, game);
|
||||
}
|
||||
|
||||
|
||||
@@ -124,8 +124,8 @@ public class PlayerControllerHuman extends PlayerController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playSpellAbilityNoStack(SpellAbility effectSA) {
|
||||
HumanPlay.playSpellAbilityNoStack(player, effectSA);
|
||||
public void playSpellAbilityNoStack(SpellAbility effectSA, boolean canSetupTargets) {
|
||||
HumanPlay.playSpellAbilityNoStack(player, effectSA, !canSetupTargets);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
||||
Reference in New Issue
Block a user