Commit graph

1598 commits

Author SHA1 Message Date
Oleg Agafonov
135c594de1 AI, refactor: removed outdated and unused code like simple priority and combat implementation, simple combat damage calculator, etc (part of #13638, #13766) 2025-06-27 16:37:07 +04:00
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
theelk801
3b0a7f5d6f remove outdated standard bans 2025-06-20 09:55:10 -04:00
Oleg Agafonov
ffe902d25e
AI: purged whole targeting code and replaced with simple and shared logic (part of #13638) (#13766)
- refactor: removed outdated/unused code from AI, battlefield score, targeting, etc;
- ai: removed all targeting and filters related logic from ComputerPlayer;
- ai: improved targeting with shared and simple logic due effect's outcome and possible targets priority;
- ai: improved get amount selection (now AI will not choose big and useless values);
- ai: improved spell selection on free cast (now AI will try to cast spells with valid targets only);
- tests: improved result table with first bad dialog info for fast access (part of #13638);
2025-06-18 21:03:58 +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
b8a8d92b14 deck: updated The Paper Cube, fixed legacy/vintage (part of #13705) 2025-06-01 00:06:18 +04:00
Oleg Agafonov
eba4d0276d deck: updated Legacy Cube to latest version, removed outdated cubes, improved last update info (part of #13705) 2025-05-31 23:11:44 +04:00
Oleg Agafonov
3d45a24959
Draft Cubes rework (better cube from deck, dynamic data, better errors processing, actual MTGO Vintage Cube) (#13705)
- GUI, table: added dynamic data support for Cube Types (no more depends on server's config names, part of #12050);
- server: replace multiple MTGO Vintage Cubes by single cube, updated to April 2025 (part of #12050);
- server: fixed table freeze on starting error (related to #11285);
- GUI, table: added better support of Cube From Deck (client/server side errors, additional info about loaded cards, etc);
2025-05-31 20:15:31 +04:00
Oleg Agafonov
ef4431e7f2 merge fix 2025-05-24 20:12:53 +04:00
Oleg Agafonov
f3ba897536 gui, deck: reworked edh power level (close #5361, close #11732, related to #13341):
* added power level info in deck validation panel;
* added detail calculation info (hint with cards and their power levels);
* fixed that deck's edh power level ignore individual card's levels and used only commanders;
* removed outdated deck restrictions by commander colors;
* now players can really limit allowed decks by edh power level;
2025-05-24 19:53:37 +04:00
Oleg Agafonov
3f1a02aa03 GUI, deck: improved invalid deck information (added more details in wrong commander color); 2025-05-24 00:21:23 +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
a53eb66b58 other: reworked target selection (now it use same logic and methods in all places), fixed AI and selection freezes in some use cases (related to #13606, #11285) 2025-05-07 17:34:36 +04:00
Oleg Agafonov
00dc6f4742 refactor: removed useless getNumberOfTargets from Target (replaced with getMinNumberOfTargets) 2025-05-07 02:55:02 +04:00
PurpleCrowbar
36196742ad Update EDH bans 2025-04-22 19:47:11 +01:00
Oleg Agafonov
f83c2bea4b merge fix 2025-04-19 17:48:27 +04:00
Oleg Agafonov
3dc606501d AI: improved stability and bug fixes (related to #13290):
- 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;
2025-04-19 07:04:55 +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
theelk801
f2ea83f73b update ban lists 2025-03-31 16:16:40 -04: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
theelk801
769097cfa3 fix error 2025-03-28 15:20:41 -04:00
spjspj
a3592ad391
Update edh power level calculations
Update the edh power level calculators with the game changers and latest salty EDHREC cards (2024)
2025-03-29 02:02:50 +11:00
Asa Reynolds
a20e304234
gui: fixed typo in mana pool dialog (#13391) 2025-02-26 10:39:40 +04:00
Oleg Agafonov
07f68fbf38 server: fixed error on server startup from a launcher (temporary fix, #13315); 2025-02-08 21:41:43 +04:00
Oleg Agafonov
f17cbbe72b AI: improved performance and fixed crashes on use cases with too much target options like "deals 5 damage divided as you choose" (related to #11285):
* 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;
2025-02-06 17:40:22 +04:00
Oleg Agafonov
b4fa6ace66 AI: reworked blockers selections:
* 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);
2025-02-06 07:03:16 +04:00
Oleg Agafonov
7d229e511c tests: added AI performance tests to reproduce bad use cases with too much possible targets 2025-02-05 13:12:22 +04:00
Oleg Agafonov
b62ac065c1 AI: improved performance in tournament games (now computer will play AI vs AI games at the same time); 2025-02-04 14:26:17 +04:00
Oleg Agafonov
7035736a6c AI: improved game stability on blocking (related to #13290) 2025-02-04 10:21:13 +04:00
Oleg Agafonov
92b7ed8efc AI: reworked blockers selections:
* 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;
2025-02-04 01:14:59 +04:00
Oleg Agafonov
fc159728c7 version bump 2025-02-01 20:16:27 +04:00
Oleg Agafonov
39872e2625 AI: fixed that computer can cheat with target selection and choose 1 creature instead multiple required (example: sacrifice, close #13219) 2025-01-12 14:46:16 +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
xenohedron
9c5c394c75
refactor: TargetCreatureOrPlayer inheritance (#13199)
* update TargetCreatureOrPlayer to be a subclass of TargetPermanentOrPlayer

closes #11161

* fix usages
2025-01-08 22:47:36 -05: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
f4572faf8b AI, combat: fixed that computer blocking an attacker by biggest creature instead optimal;
refactor: fixed that Defiant Vanguard depends on debug data;
2024-12-25 18:43:26 +04:00
Oleg Agafonov
138788659a AI, combat: fixed that computer safely blocks the weakest creature instead most powerfull 2024-12-23 01:54:04 +04:00
Grath
40e2cf7cda Update banned lists for Legacy, Modern, and Pioneer.
https://magic.wizards.com/en/news/announcements/banned-and-restricted-december-16-2024
2024-12-16 12:29:04 -05: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