Commit graph

1578 commits

Author SHA1 Message Date
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
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
saltstonestorm
1f04e11eab
ban Tamiyo as commander (#12948) 2024-09-30 16:42:28 -04:00
Grath
dea500c11d Update Commander ban list.
https://mtgcommander.net/index.php/2024/09/23/september-2024-quarterly-update/
2024-09-23 12:20:25 -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
xenohedron
54874a59b0
refactor: rename "remixed" to "reshuffled" (#12755) 2024-09-01 01:08:26 -04:00
Wajih Ben Slama
3a70e0c405
update banned/restricted lists per August 26th 2024 update (#12739) 2024-08-27 01:02:55 -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
xenohedron
9fcbfdeac6
Rework drawing cards and associated replacement effects; implement [WHO] River Song (#12700)
* 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
2024-08-24 01:02:55 -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
Evan Kranzler
8ed3c0c12d
Reworking standard legality (#12624)
* rework standard rotation

* add comment

* add flag to previous sets
2024-07-31 14:55:48 -04:00
Oleg Agafonov
e1cffbde40 download: reworked connection:
- added shareable code with default proxy, headers and other settings for download tasks like images, symbols, mtgjson, etc;
- use XmageURLConnection.downloadText for text resources
- use XmageURLConnection.downloadBinary for any file resources
- added user agent with app version for all requests;
- added http logs and improved error messages;
2024-07-31 21:25:56 +04:00
saltstonestorm
fff7496322
game: updated cards ban list for duel commander (#12611) 2024-07-27 22:44:33 +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