- WIP: AI and multi targets, human and X=0 use cases, human and impossible targets use cases;
- improved stability and shared logic (related to #13606, #11134, #11666, continue from a53eb66b58, close#13617, close#13613);
- improved test logs and debug info to show more target info on errors;
- improved test framework to support multiple addTarget calls;
- improved test framework to find bad commands order for targets (related to #11666);
- fixed game freezes on auto-choice usages with disconnected or under control players (related to #11285);
- gui, game: fixed that player doesn't mark avatar as selected/green in "up to" targeting;
- gui, game: fixed small font in some popup messages on big screens (related to #969);
- gui, game: added min targets info for target selection dialog;
- for devs: added new cheat option to call and test any game dialog (define own dialogs, targets, etc in HumanDialogsTester);
- for devs: now tests require complete an any or up to target selection by addTarget + TestPlayer.TARGET_SKIP or setChoice + TestPlayer.CHOICE_SKIP (if not all max/possible targets used);
- for devs: added detail targets info for activate/trigger/cast, can be useful to debug unit tests, auto-choose or AI (see DebugUtil.GAME_SHOW_CHOOSE_TARGET_LOGS)
- bug's reason: wrong usage of canTarget, add/addTarget, getOpponents, etc;
- fixed that it can target dead players in some use cases (close#13507);
- fixed that it wrongly choose targets in bad/good effects in some use cases;
- fixed that it can't find valid targets in some use cases;
- fixed game freezes and errors with some cards;
Improves:
* refactor: split CostAdjuster logic in multiple parts - prepare X, prepare cost, increase cost, reduce cost;
* refactor: improved VariableManaCost to support min/max values, playable and AI calculations, test framework;
* refactor: improved EarlyTargetCost to support mana costs too (related to #13023);
* refactor: migrated some cards with CostAdjuster and X to EarlyTargetCost (Knollspine Invocation, etc - related to #13023);
* refactor: added shared code for "As an additional cost to cast this spell, discard X creature cards";
* refactor: added shared code for "X is the converted mana cost of the exiled card";
* tests: added dozens tests with cost adjusters;
Bug fixes:
* game: fixed that some cards with CostAdjuster ignore min/max limits for X (allow to choose any X, example: Scorched Earth, Open The Way);
* game: fixed that some cards ask to announce already defined X values (example: Bargaining Table);
* game: fixed that some cards with CostAdjuster do not support combo with other cost modification effects;
* game, gui: fixed missing game logs about predefined X values;
* game, gui: fixed wrong X icon for predefined X values;
Test framework:
* test framework: added X min/max check for wrong values;
* test framework: added X min/max info in miss X value announce;
* test framework: added check to find duplicated effect bugs (see assertNoDuplicatedEffects);
Cards:
* Open The Way - fixed that it allow to choose any X without limits (close#12810);
* Unbound Flourishing - improved combo support for activated abilities with predefined X mana costs like Bargaining Table;
* Don't prompt creatureless player to select blockers
* Move getting possible blockers back to while loop
* Several preferences text improvements, always skip select blockers prompt if no blockers
* Remove all combat ordering code
* Use MultiAmount division for damage
* Remove damage selection division skipping in tests
* Fix Banding, Multi-block, add tests
* Fix test
* Fix random iteration order, fix new tests
* Add more info to choose dialog, make MultiAmountType class instead of enum
* Don't prompt for trample damage assignment if none possible
* Mark "Assign default damage" on tests, minor other test improvements
* added DebugUtil.AI_ENABLE_DEBUG_MODE for better IDE's debugging AI code;
* it's a target amount optimizations;
* it's use a grouping of possible targets due same static and dynamic stats (name, abilities, rules, damage, etc);
* instead of going through all possible combinations, AI uses only meaningful targets from particular groups;
* now computer will use simplified 1 vs 1 combat damage simulations to choose better blockers (due better game score after combat);
* it's not a full combat simulation, but support many things like non-stack abilities, damage replacement effects and SBA -- much better than older PT compare (related to #13290);
* now AI correctly use a blockers with deathtouth, indestructible, first/double strike and other abilities;
* chump blocks also supported (chump logic implemented before in 92b7ed8efc, related to #4485);
* fixed game freezes for no-possible block configurations like Menace (#13290);
* fixed computer cheating to ignore block requirements like Menace (now AI will choose all required blockers instead 1);
* improved computer logic for blockers selection (try to sacrifice a creature instead game loose, simple use cases only);
* added freeze protection for bad or unsupported attacker-block configuration;
* refactor: deleted outdated AI code;
- game: fixed game freezes when computer try to take control over another computer or human (added game logs, related to #12878);
- cheats: improved take and give control commands, now you can give control under yourself to another player;
- cheats: improved take and give control commands, now you can return control to computer in the same priority;
- cheats: deleted useless and unused command to activate opponent's ability;
- game: added support when a human is take control over a computer player (related to #12878);
- game: fixed game freezes while controlling player leaves/disconnect on active priority/choose of another player;
- game: added support for human games (cards like Emrakul, the Promised End, #12878);
- game: added support of 720.1. to reset control in the turn beginning instead cleanup step (related to #12115);
- game: added game logs for priorities in cleanup step;
- game: fixed game freezes and wrong skip settings usages (related to #12878);
- gui: added playable and choose-able marks for controlling player's cards and permanents, including switched hands;
- gui: added controlling player name in all choice dialogs;
- info: control of computer players is it not yet supported;
* Add player-based "must attack" requirement check
* Implement Seeker of Slaanesh and add (ignored) test
* Fix check for ability of any controlled creatures to attack
* rename misleading variable
* remove unused scoring system code
* add test for Alms Collector replacement effect
* flatten draw cards into single method in PlayerImpl
* remove outdated MageAction framework
* clarify game event for drawing two or more cards
* clarify methods for getting cards from library
* implement [WHO] River Song
* fix error
* adjust library methods
* add lots of test cases for draw replacement effects
* fix#12616
* track cards drawn this way through multi draw replacement as well
* add test for River Song
* remove redundant comment
Complete rework of Unbound Flourishing, removing the multiplier code for casting X spells.
Adds ActivateAbilityTriggeredAbility, NotManaAbilityPredicate, AbilitySourceAttachedPredicate
CopyStackObjectEffect now uses a MOR.
OrTriggeredAbility now works with target pointer setting abilities.