Commit graph

4018 commits

Author SHA1 Message Date
Grath
419030b681 [NCC] Partially fix Rain of Riches and add tests.
Two tests are failing and ignored because this is only a partial fix, as we will still need to process actions between the last mana being paid and the spell being cast.
2025-02-26 23:12:07 -05:00
Steven Knipe
17e0c82a07 Remove BroodofCockroaches text test (in Verify), uncapitalize CreateDelayedTriggeredAbilityEffect ability rule text 2025-02-20 18:27:17 -08:00
jimga150
2174797c4b
Mu Yanling, Wind Rider - fixed not working second ability (#13361) 2025-02-18 19:57:13 +04:00
Oleg Agafonov
0612431ab2 [PIP] Implement Struggle for Project Purity (part of #11324) 2025-02-08 02:00:43 +04:00
Oleg Agafonov
89be55c816 tests: fixed randomly fail test 2025-02-07 15:13:58 +04:00
Wesley Mauk
b31a6c834a
Shifting Woodland - fixed game error on usage with MDF cards (#13308) 2025-02-07 08:12:30 +04:00
Oleg Agafonov
703d275356 merge fix 2025-02-06 18:01:52 +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
416beb741c tests: improved load tests (added deck gen from all sets support, added network errors support, e.g. on server crash) 2025-02-05 13:05:37 +04:00
theelk801
e719cd03a3 fix test failure 2025-02-04 11:11:40 -05:00
Oleg Agafonov
690bc36023 tests: improved load tests (better logs) 2025-02-04 14:23:15 +04:00
Oleg Agafonov
2b659cd72c tests: improved load tests (added finish step in result table, fixed outdated game data) 2025-02-04 12:26:24 +04:00
Oleg Agafonov
3405b51aaf tests: improved load tests (improved progress bar, added effects stats) 2025-02-04 11:41:42 +04:00
Oleg Agafonov
f5b901beb4 tests: improved load tests (added creature stats, improved progress bar) 2025-02-04 10:23:00 +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
356d677dac tests: added AI reproduceable bug from #13290 2025-02-03 20:01:38 +04:00
theelk801
3776a39683 [DFT] Implement Spikeshell Harrier 2025-02-01 19:21:46 -05:00
Evan Kranzler
ef213b1bef
Implementing "Start your engines!" mechanic (#13259)
* add initial speed handling

* finish speed implementation

* remove skip list

* add initial test

* add some more tests

* change speed initialization to state-based action

* add opponent speed check

* add control change test

* add check for speed 5
2025-02-01 13:49:47 -05:00
Oleg Agafonov
fc159728c7 version bump 2025-02-01 20:16:27 +04:00
Oleg Agafonov
a0a19a6a20 tests: added test for #13002 2025-01-29 01:05:00 +04:00
Oleg Agafonov
36309206a2 Create copy effects - fixed that it can't copy second side of the modal double-faced card (close #11307, close #13269); 2025-01-29 00:51:34 +04:00
Marco Romano
0bcf5f9e03
[DSK] Implement Unable to Scream (#13234)
* Introduced LoseAllAbilitiesAttachedEffect

* Added unit tests for Unable to Scream
2025-01-19 16:09:57 -05:00
Oleg Agafonov
1f7af53dbb tests: added more strictly checks for choice commands order (related to #12044); 2025-01-16 17:26:44 +04:00
Oleg Agafonov
34af53879a Do if cost pay improved:
* added additional hint to the optional pay dialog, so user can split it and remember for auto-answer (see withChooseHint);
* Mana Vault - improved UX, now user can hide an untap cost dialog for already untapped permanent (use right click on buttons, #2656);
2025-01-16 14:14:16 +04:00
Oleg Agafonov
c82511f96f tests: added more strictly checks for choice commands order, fixed wrong commands in old tests (related to #12044); 2025-01-16 08:14:28 +04:00
Marco Romano
b58fbbdd84
[DSK] Implement Acrobatic Cheerleader and per-game trigger limits (#13232) 2025-01-15 18:28:30 +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
Marco Romano
30dac5cc9f
[DSK] Implement Nowhere to Run (#13208)
* [DSK] implemented Nowhere to Run

* [DSK] implemented Nowhere to Run

* NowhereToRun - fixed typo in static test

* NowhereToRun - fixed hexproof effect
2025-01-09 15:07:13 -05: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
0c8d49ce56 merge fix 2025-01-07 20:05:27 +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
Shashakar
7f7a6d6b83
Fixed interaction between Bello and Ashaya (#13196)
Co-authored-by: Dexton Armstrong <djarmstrong@verisk.com>
2025-01-02 20:03:19 -05:00
Oleg Agafonov
bd1f6a4ca7 tests: enabled test after #13182 2024-12-31 22:17:56 +04:00
Oleg Agafonov
b2279a8e9c tests: added many use cases for must be blocked, must blocking and menace effects (related to #13182) 2024-12-31 22:12:42 +04:00
Oleg Agafonov
aef220a19b tests: added progress bar with all running games in load tests, added error on non-started local server 2024-12-31 22:08:13 +04:00
Oleg Agafonov
60112c6be5 test framework: added commands to check declared attackers and blockers creatures (useful for AI tests, see checkAttackers and checkBlockers) 2024-12-31 22:08:13 +04:00
Grath
6b9532febd
[refactor/bugfix] use rule 802.2a where appropriate. (#13179)
* [refactor/bugfix] use rule 802.2a where appropriate.

Many effects which relied on getDefendingPlayerId would fail if the attacking creature had been removed from combat before they resolved, in which case the defending player ID would be null. This fixes these issues.

* Add test for removing attacking creature with Defending Player triggered ability.

Change allowFormer to be true by default, reduce falses to only necessary cases.
2024-12-25 14:18:01 -05: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
AlexKidd29
5928c84026
refactor: fixed wrong packge for RadCounterTriggerTest (#13162) 2024-12-19 01:55:21 +04:00
Cameron Merkel
73b63d14ad
TargetAmount refactors (#13128)
* Add minimum and maximum target counts as parameters for TargetAmount and its subclasses; update/add several rules comments (and one actual text) for clarity; remove unused imports

* Get amount+description from target instead of parameters for DistributeCountersEffect and DamageMultiEffect; additions to TargetImpl.getDescription to accommodate

* Create separate method to check if "any number" phrasing should be used, override it in TargetAmount

* Check instanceof TargetAmount before casting

* Add new constructors to chain off of for TargetCreaturePermanentAmount & TargetCreatureOrPlaneswalkerAmount

* Fix text for Storm the Seedcore

* Use Integer.MAX_VALUE instead of 0 to represent no maximum targets

* Add comment about getUseAnyNumber()

* Use amount-only constructors in some TargetAmount subclasses, add clarifying documentation

* Fix a few calls

* Require more specific filters
2024-12-17 19:23:18 -05:00
Grath
bd1f802f46 Fix DeckValidatorTest. 2024-12-16 13:48:37 -05:00
Oleg Agafonov
2955535927 tests: added tests for auto-lands suggestion in deck editor and tourney (related to #13127) 2024-12-16 21:50:27 +04:00
Oleg Agafonov
4bce1e0a9a When you cast this spell - fixed that it required double cost for cards with alternative costs like Evoke (example: Nulldrifter, #12843) 2024-12-14 21:47:55 +04:00
Oleg Agafonov
38b54beb54 tests: added Grand Abolisher tests for #13099 2024-12-14 18:49:34 +04:00
Oleg Agafonov
12220a7ada tests: added batch event tests for #13089 2024-12-14 18:25:54 +04:00