Commit graph

479 commits

Author SHA1 Message Date
Oleg Agafonov
f3e18e245f AI: improved target amount targeting (part of #13638, #13766):
- refactor: migrated AI's target amount code to shared selection logic;
- ai: fixed game freezes on some use cases;
- tests: added AI's testable dialogs for target amount;
- tests: improved load tests result table, added game cycles stats;
- Dwarven Catapult - fixed game error on usage;
2025-06-27 01:11:10 +04:00
Oleg Agafonov
d893d52190 tests: improved testable dialogs (added source code ref in result table for better IDE navigation, part of #13643, #13638); 2025-06-15 14:08:43 +04:00
Oleg Agafonov
6ad2cdaa78 AI: improved stability:
- fixed game errors with source related filters (related to #13713);
- fixed game freeze in hand's cards selection (related to #13290);
- fixed game freeze in target amount selection with X=0 (related to #13290);
2025-06-14 16:03:44 +04:00
Oleg Agafonov
e320bf241c GUI, game: added source info in "choose number/amount" dialogs, added auto-choose for single possible value (part of #13638); 2025-05-17 21:18:45 +04:00
Oleg Agafonov
66db821437 refactor: combined announceX methods in one, improved X message and selection for AI (part of #10330) 2025-05-16 19:34:57 +04:00
Oleg Agafonov
133e4fe425
other: reworked target selection: (#13638)
- 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)
2025-05-16 13:55:54 +04:00
Oleg Agafonov
00dc6f4742 refactor: removed useless getNumberOfTargets from Target (replaced with getMinNumberOfTargets) 2025-05-07 02:55:02 +04:00
Oleg Agafonov
b915c6590b AI: fixed game freeze with yes/no combat triggers (related to #13290); 2025-04-19 04:10:55 +04:00
Oleg Agafonov
b819545744 bump version 2025-04-11 17:50:12 +04:00
Oleg Agafonov
0a1bf47434 AI: fixed game freeze on cards with combat triggers (close #13342) 2025-04-09 02:21:29 +04:00
Oleg Agafonov
bae3089abb Reworked cost adjuster logic for better support of X and cost modification effects:
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;
2025-04-08 22:39:10 +04:00
jmlundeen
63781e9ca1 Missed some references to instanceof AdventureCard
replaced with CardWithSpellOption
2025-04-08 09:49:08 -05:00
PurpleCrowbar
dfb6896453
Skip prompting player with no blockers to select blockers (#13496)
* 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
2025-04-03 18:34:04 +01:00
ssk97
969ffa1c98
FDN New Combat Rules (#13279)
* 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
2025-03-30 14:42:05 -07:00
Asa Reynolds
a20e304234
gui: fixed typo in mana pool dialog (#13391) 2025-02-26 10:39:40 +04:00
Oleg Agafonov
fc159728c7 version bump 2025-02-01 20:16:27 +04:00
Oleg Agafonov
1f1d1088a1 Turn under control reworked:
- 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;
2025-01-11 22:21:58 +04:00
Oleg Agafonov
0505f5159e Turn under control reworked:
- 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;
2025-01-10 20:20:11 +04:00
Oleg Agafonov
c076f4925f Turn under control reworked:
- 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;
2025-01-07 12:38:01 +04:00
Oleg Agafonov
75d241d541 GUI, game: improved priority pass on non-empty mana pool (no more confirm dialogs on active "don't lose unspent mana" and other effects, close #11717) 2025-01-06 03:33:06 +04:00
Oleg Agafonov
b1f914bbf4 version bump 2024-11-30 22:42:47 +04:00
xenohedron
5070f8bef7
Fix auto-choose targets for activated abilities and spells (#13036)
* rework Armory Automaton

* remove redundant "setRequired(false)" from effects that separate into piles

* replace setRequired(false) with minTargets 0

* remove setRequired(false) where minTargets already 0

* remove setRequired(false) where preceded by chooseUse

* Revert "Player auto-choose respects required targets (#10557)"

This reverts commit fb8424556e.
2024-10-26 20:23:50 -04:00
Oleg Agafonov
1ec277631f GUI, game: added card popup support in choose target amount dialogs (example: damage distribution, related to #9827) 2024-10-24 16:30:17 +04:00
Oleg Agafonov
2d9ac4e732 refactor: removed outdated Player::assignDamage by multi amount dialog, fixed getMultiAmount to work with min values, added additional checks 2024-10-24 15:31:04 +04:00
Oleg Agafonov
45ded61d6f server: improved compatibility to run server under java 9+ (related to #12768, #6197) 2024-09-13 14:53:05 +04:00
Oleg Agafonov
22c207bcd8 Lunar Convocation - fixed game error on usage (miss watcher); 2024-09-09 06:43:24 +04:00
Oleg Agafonov
278bda4c36 version bump 2024-09-08 22:13:45 +04:00
jimga150
4259b7fa39
[40K] Implement Seeker of Slaanesh; added new must attack option (#12712)
* 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
2024-08-24 18:37:17 -04:00
ssk97
b70638acc9
Unbound Flourishing's X doubling should be a triggered ability (and related refactors) (#12597)
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.
2024-08-22 13:33:39 -07:00
Oleg Agafonov
de5de0e103 version bump 2024-08-16 19:35:42 +04:00
jimga150
e976920e2d
[BLB] Implement Season of Gathering and Pawprints mechanic (#12617)
* Add skeleton

* Implement Pawprints modal functionality

* Implement Seasons of Gathering

* remove unused imports

* Add Pawprints test

* use withPawPRintValue() instead of setter

* use 0 for non-pawprint mode and modes classes and move mode validation to addMode

* Use GreatestPowerAmongControlledCreaturesValue

* Fix pawprints check

* calcualte sleected pawprint count based on selected modes

* move max pawprints check to getAvailableModes

* fix max pawprints checks
2024-08-14 21:13:09 -04:00
Oleg Agafonov
754e5fc41a GUI, preferences: removed rare/useless settings:
* Show ability picker forced - removed and keep enabled for all;
* Show turn info in logs - removed and keep enabled for all;
2024-08-12 21:25:16 +04:00
Oleg Agafonov
a974af3c61 GUI: improved choose creature type dialog - important creature types added to the start of the list and marked as my/opponent (closes #8478) 2024-07-19 03:17:53 +04:00
Oleg Agafonov
7b2e9b390c GUI: added card hints in choose replacement effect dialog 2024-07-19 00:06:18 +04:00
xenohedron
fdd244786b refactor: improve method name (related to 86fa9278) 2024-06-13 00:43:51 -04:00
Oleg Agafonov
c2ae1386ff server: improved conceding logic with more protection from game errors/freeze (related to #11285, #11460) 2024-06-07 12:52:42 +04:00
Susucre
754b382e78
implement [MH3] Nethergoyf, refactor targets usages by game param (#12267) 2024-05-21 13:34:38 +02:00
Susucre
85cad4ff1e
cleanup AbilityType for easier check that an ability is an activated ability (#12153)
* cleanup AbilityType

* further cleanup

* cleanup instanceof

* tweak formatting

* rework Rex

* fix mistake in PlayerImpl

* cleanup 'instanceof' for 'ActivatedManaAbilityImpl'
2024-05-03 22:13:34 -04:00
Alexander Novotny
8771d9b7f5
Fix NPE (#12190) 2024-04-28 04:53:38 +04:00
Alexander Novotny
42906f519b
Fixed remembering self-referential choices (#12167)
* Fixed remembering self-referential choices

* Rename filtered message to auto answer message

* Always use auto answer message
2024-04-22 23:58:26 -04:00
Oleg Agafonov
08b99fcbf7 AI: removed outdated AIMinimax project (#7075), removed some useless player classes, code and config files, improved docs; 2024-01-15 05:03:21 +04:00
Oleg Agafonov
e79f562f4a server: improved logs for some use cases (related to #11572) 2024-01-05 23:13:20 +04:00
Oleg Agafonov
d4a1e27a44 GUI: improved choose X or number dialog (added source ability and card hint support, added limits info);
game: choose X - added source ability info to game logs;
2023-12-18 01:22:14 +04:00
Oleg Agafonov
960e896903
Network upgrade and new reconnection mode (#11527)
Network upgrade and new reconnection mode:
* users can disconnect or close app without game progress loose now;
* disconnect dialog will show active tables stats and additional options;
* all active tables will be restored on reconnect (tables, tourneys, games, drafts, sideboarding, constructing);
* user must use same server and username on next connection;
* there are few minutes for reconnect until server kick off a disconnected player from all player's tables (concede/loose);
* now you can safety reconnect after IP change (after proxy/vpn/wifi/router restart);

Other improvements and fixes:
* gui: main menu - improved switch panel button, added stats about current tables/panels;
* gui: improved data sync and updates (fixes many use cases with empty battlefield, not started games/drafts/tourneys, not updatable drafts, etc);
* gui: improved stability on game updates (fixes some random errors related to wrong threads);
* server: fixed miss messages about player's disconnection problems for other players in the chat;
* refactor: simplified and improved connection and network related code, deleted outdated code, added docs;
* tests: improved load test to support lands only set for more stable performance/network testing (set TEST_AI_RANDOM_DECK_SETS = PELP and run test_TwoAIPlayGame_Multiple);
2023-12-07 20:56:52 +04:00
Oleg Agafonov
ebaa92c537 game: fixed that some users was able to run outdated macro feature 2023-12-01 19:54:21 +04:00
xenohedron
35f4a898f9
Small rework for autochoosing color of mana to add (#11495)
fix #11494
2023-12-01 00:49:42 -05:00
Cameron Merkel
1132cc27ba
[ICE] Implement Snowfall (#11467)
* [ICE] Implement Snowfall

* Change filter text, declare Island subtype in constructor

* Make choice optional

* Inherit outcome from superclass; add check in HumanPlayer.java to prevent auto-selecting non-ChoiceColor choices
2023-11-27 23:41:40 -05:00
Oleg Agafonov
53add71826 Improved network stability and other related fixes:
* server: fixed that a critical errors ignored in user commands threads (now it will be added to the logs);
* network: fixed frozen user responses in some use cases;
* network: fixed accidental and incorrect user responses (only latest response will be used now);
* network: improved freeze logs, added problem method name and code's line number;
* cheats: removed outdated deck and card load logic (only init.txt commands supports now);
* cheats: fixed wrong priority after add card dialog (closes #11437);
* cheats: improved stability and random errors on cheat executes (related to #11437);
* docs: added details on network and thread logic, human feedback life cycle, etc (see HumanPlayer, ThreadExecutorImpl);
2023-11-24 21:22:16 +04:00
Oleg Agafonov
5b49fa4cc2 choose mode improves:
- fixed broken cards with once per turn choose (example: Galadriel, Light of Valinor, closes #11362);
- fixed cheat to skip required mode by cancel button (example: Black Market Connections, closes #11149, closes #10611);
- fixed empty modes list if nothing available to choose;
- improved compatibility with max modes and other modification effects;
- fixed that non-valid modes can be selected in some use cases;
2023-11-02 17:57:55 +04:00
Oleg Agafonov
81d44e615f gui: improved multi amount dialog (added cancel option, added mana symbols support in messages, improved form structure) 2023-11-02 12:30:40 +04:00