diff --git a/forge-game/src/main/java/forge/game/spellability/SpellAbility.java b/forge-game/src/main/java/forge/game/spellability/SpellAbility.java index e3d6efeb3f9..ce01258bafd 100644 --- a/forge-game/src/main/java/forge/game/spellability/SpellAbility.java +++ b/forge-game/src/main/java/forge/game/spellability/SpellAbility.java @@ -580,6 +580,11 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit } } } + + // key for autoyield - the card description (including number) plus the effect description + public String yieldKey() { + return getHostCard().toString() + ": " + toUnsuppressedString(); + } public String getStackDescription() { String text = getHostCard().getView().getText(); @@ -1634,4 +1639,4 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit return score; } -} \ No newline at end of file +} diff --git a/forge-game/src/main/java/forge/game/spellability/StackItemView.java b/forge-game/src/main/java/forge/game/spellability/StackItemView.java index 61b431b3b13..22ab4d46cad 100644 --- a/forge-game/src/main/java/forge/game/spellability/StackItemView.java +++ b/forge-game/src/main/java/forge/game/spellability/StackItemView.java @@ -44,7 +44,7 @@ public class StackItemView extends TrackableObject implements IHasCardView { return get(TrackableProperty.Key); } void updateKey(SpellAbilityStackInstance si) { - set(TrackableProperty.Key, si.getSpellAbility(false).toUnsuppressedString()); + set(TrackableProperty.Key, si.getSpellAbility(false).yieldKey()); } public int getSourceTrigger() { diff --git a/forge-game/src/main/java/forge/game/trigger/WrappedAbility.java b/forge-game/src/main/java/forge/game/trigger/WrappedAbility.java index b5cc9e57b68..c2c41e276be 100644 --- a/forge-game/src/main/java/forge/game/trigger/WrappedAbility.java +++ b/forge-game/src/main/java/forge/game/trigger/WrappedAbility.java @@ -189,6 +189,16 @@ public class WrappedAbility extends Ability { return sa.getView(); } + // key for autoyield - if there is a trigger use its description as the wrapper now has triggering information in its description + @Override + public String yieldKey() { + if ( getTrigger() != null ) { + return getHostCard().toString() + ": " + getTrigger().toString(); + } else { + return super.yieldKey(); + } + } + @Override public String toUnsuppressedString() { return regtrig.toString(); diff --git a/forge-gui/CHANGES.txt b/forge-gui/CHANGES.txt index 4a903fda9ca..99064318910 100644 --- a/forge-gui/CHANGES.txt +++ b/forge-gui/CHANGES.txt @@ -14,6 +14,9 @@ This release features most Commander 2016 cards scripted and ready to play. The - Escape Key Functionality Change - Forge now does not allow the player to use the Escape key as a form of an "End Turn" shortcut by default in order to avoid situations when pressing Escape recklessly can lead to missing one's own turn or other dangerous and undesirable situations. However, if you prefer the old behavior, it can be reenabled using the "Use Escape Key To End Turn" option in Forge preferences. +- Auto Yield Functionality Change - +Auto Yield is now done on a per-card basis, consistent with how it is presented in the GUI. For example, auto-yielding an Evolve effect in the stack only affects Evolve on the card for the effect, not Evolve on all cards. + - Quest Mode Updates and Fixes - It is now possible to simulate random AI vs. AI match outcome instead of playing out all AI vs. AI matches and making the player watch them. AI decks with higher total card draft ranking value have a higher chance of "winning" a random simulated AI vs. AI match. This option is disabled by default and can be enabled in Quest Preferences (set the option "Simulate AI vs. AI Matches" to 1). When using a token to create a new quest draft tournament, the player will be shown the entry fee for the tournament and will be asked to confirm creating that tournament with the provided entry fee in mind. Quest mode has become more robust and resistant to quest data corruption. Non-tournament legal substandard cards (e.g. Conspiracies) will no longer be added to quest card pool from reward booster packs and possibly other sources to prevent persistent crashes (these cards had no possible use in quest mode anyway). Quest draft tournaments with sets that have no standard draft template in Forge (e.g. Commander, Conspiracy) will no longer be created in order to prevent the game crashing when trying to start a draft tournament. diff --git a/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java b/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java index d216df32902..0e2f7077941 100644 --- a/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java +++ b/forge-gui/src/main/java/forge/player/PlayerControllerHuman.java @@ -911,7 +911,7 @@ public class PlayerControllerHuman } } else { final SpellAbility ability = stack.peekAbility(); - if (ability != null && ability.isAbility() && getGui().shouldAutoYield(ability.toUnsuppressedString())) { + if (ability != null && ability.isAbility() && getGui().shouldAutoYield(ability.yieldKey())) { //avoid prompt for input if top ability of stack is set to auto-yield try { Thread.sleep(FControlGamePlayback.resolveDelay); @@ -1236,7 +1236,7 @@ public class PlayerControllerHuman if (savedOrder == null || !sameOrder) { //prompt if no saved order for the current set of abilities or if the player wants to change the order orderedSAs = getGui().order("Select order for simultaneous abilities", "Resolve first", activePlayerSAs, null); - //save order to avoid needing to prompt a second time to order the same abilties + //save order to avoid needing to prompt a second time to order the same abilities savedOrder = new ArrayList(activePlayerSAs.size()); for (SpellAbility sa : orderedSAs) { savedOrder.add(activePlayerSAs.indexOf(sa));